@@ -29,18 +29,20 @@ class Index<T> implements Types.IndexInterface<T> {
2929 [ key : string ] : createIndexPath
3030 } = {
3131 indexRoute : ( indexUid : string ) => {
32- return `${ Index . apiRoutes . indexes } /${ indexUid } / `
32+ return `${ Index . apiRoutes . indexes } /${ indexUid } `
3333 } ,
3434 getUpdateStatus : ( indexUid : string , updateId : objectId ) => {
3535 return (
36- Index . routeConstructors . indexRoute ( indexUid ) + `updates/${ updateId } `
36+ Index . routeConstructors . indexRoute ( indexUid ) +
37+ '/' +
38+ `updates/${ updateId } `
3739 )
3840 } ,
3941 getAllUpdateStatus : ( indexUid : string ) => {
40- return Index . routeConstructors . indexRoute ( indexUid ) + `updates`
42+ return Index . routeConstructors . indexRoute ( indexUid ) + '/' + `updates`
4143 } ,
4244 search : ( indexUid : string ) => {
43- return Index . routeConstructors . indexRoute ( indexUid ) + `search`
45+ return Index . routeConstructors . indexRoute ( indexUid ) + '/' + `search`
4446 } ,
4547 getRawInfo : ( indexUid : string ) => {
4648 return `indexes/${ indexUid } `
@@ -52,15 +54,17 @@ class Index<T> implements Types.IndexInterface<T> {
5254 return Index . routeConstructors . indexRoute ( indexUid )
5355 } ,
5456 getStats : ( indexUid : string ) => {
55- return Index . routeConstructors . indexRoute ( indexUid ) + `stats`
57+ return Index . routeConstructors . indexRoute ( indexUid ) + '/' + `stats`
5658 } ,
5759 getDocument : ( indexUid : string , documentId : objectId ) => {
5860 return (
59- Index . routeConstructors . indexRoute ( indexUid ) + `documents/${ documentId } `
61+ Index . routeConstructors . indexRoute ( indexUid ) +
62+ '/' +
63+ `documents/${ documentId } `
6064 )
6165 } ,
6266 getDocuments : ( indexUid : string ) => {
63- return Index . routeConstructors . indexRoute ( indexUid ) + `documents`
67+ return Index . routeConstructors . indexRoute ( indexUid ) + '/' + `documents`
6468 } ,
6569 addDocuments : ( indexUid : string ) => {
6670 return Index . routeConstructors . getDocuments ( indexUid )
@@ -73,16 +77,20 @@ class Index<T> implements Types.IndexInterface<T> {
7377 } ,
7478 deleteDocument : ( indexUid : string , documentId : objectId ) => {
7579 return (
76- Index . routeConstructors . indexRoute ( indexUid ) + `documents/${ documentId } `
80+ Index . routeConstructors . indexRoute ( indexUid ) +
81+ '/' +
82+ `documents/${ documentId } `
7783 )
7884 } ,
7985 deleteDocuments : ( indexUid : string ) => {
8086 return (
81- Index . routeConstructors . indexRoute ( indexUid ) + `documents/delete-batch`
87+ Index . routeConstructors . indexRoute ( indexUid ) +
88+ '/' +
89+ `documents/delete-batch`
8290 )
8391 } ,
8492 getSettings : ( indexUid : string ) => {
85- return Index . routeConstructors . indexRoute ( indexUid ) + `settings`
93+ return Index . routeConstructors . indexRoute ( indexUid ) + '/' + `settings`
8694 } ,
8795 updateSettings : ( indexUid : string ) => {
8896 return Index . routeConstructors . getSettings ( indexUid )
@@ -91,7 +99,9 @@ class Index<T> implements Types.IndexInterface<T> {
9199 return Index . routeConstructors . getSettings ( indexUid )
92100 } ,
93101 getSynonyms : ( indexUid : string ) => {
94- return Index . routeConstructors . indexRoute ( indexUid ) + `settings/synonyms`
102+ return (
103+ Index . routeConstructors . indexRoute ( indexUid ) + '/' + `settings/synonyms`
104+ )
95105 } ,
96106 updateSynonyms : ( indexUid : string ) => {
97107 return Index . routeConstructors . getSynonyms ( indexUid )
@@ -101,7 +111,9 @@ class Index<T> implements Types.IndexInterface<T> {
101111 } ,
102112 getStopWords : ( indexUid : string ) => {
103113 return (
104- Index . routeConstructors . indexRoute ( indexUid ) + `settings/stop-words`
114+ Index . routeConstructors . indexRoute ( indexUid ) +
115+ '/' +
116+ `settings/stop-words`
105117 )
106118 } ,
107119 updateStopWords : ( indexUid : string ) => {
@@ -112,7 +124,9 @@ class Index<T> implements Types.IndexInterface<T> {
112124 } ,
113125 getRankingRules : ( indexUid : string ) => {
114126 return (
115- Index . routeConstructors . indexRoute ( indexUid ) + `settings/ranking-rules`
127+ Index . routeConstructors . indexRoute ( indexUid ) +
128+ '/' +
129+ `settings/ranking-rules`
116130 )
117131 } ,
118132 updateRankingRules : ( indexUid : string ) => {
@@ -124,6 +138,7 @@ class Index<T> implements Types.IndexInterface<T> {
124138 getDistinctAttribute : ( indexUid : string ) => {
125139 return (
126140 Index . routeConstructors . indexRoute ( indexUid ) +
141+ '/' +
127142 `settings/distinct-attribute`
128143 )
129144 } ,
@@ -136,6 +151,7 @@ class Index<T> implements Types.IndexInterface<T> {
136151 getAttributesForFaceting : ( indexUid : string ) => {
137152 return (
138153 Index . routeConstructors . indexRoute ( indexUid ) +
154+ '/' +
139155 `settings/attributes-for-faceting`
140156 )
141157 } ,
@@ -148,6 +164,7 @@ class Index<T> implements Types.IndexInterface<T> {
148164 getSearchableAttributes : ( indexUid : string ) => {
149165 return (
150166 Index . routeConstructors . indexRoute ( indexUid ) +
167+ '/' +
151168 `settings/searchable-attributes`
152169 )
153170 } ,
@@ -160,6 +177,7 @@ class Index<T> implements Types.IndexInterface<T> {
160177 getDisplayedAttributes : ( indexUid : string ) => {
161178 return (
162179 Index . routeConstructors . indexRoute ( indexUid ) +
180+ '/' +
163181 `settings/displayed-attributes`
164182 )
165183 } ,
@@ -176,6 +194,16 @@ class Index<T> implements Types.IndexInterface<T> {
176194 this . primaryKey = primaryKey
177195 this . httpRequest = new HttpRequests ( config )
178196 }
197+ ///
198+ /// STATIC
199+ ///
200+
201+ static getApiRoutes ( ) : { [ key : string ] : string } {
202+ return Index . apiRoutes
203+ }
204+ static getRouteConstructors ( ) : { [ key : string ] : createIndexPath } {
205+ return Index . routeConstructors
206+ }
179207
180208 ///
181209 /// UPDATES
0 commit comments