File tree Expand file tree Collapse file tree 10 files changed +52
-31
lines changed
templates/javascript/clients/client/api
tests/CTS/methods/requests/search Expand file tree Collapse file tree 10 files changed +52
-31
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ export async function generate(
56
56
spinner . succeed ( ) ;
57
57
}
58
58
59
- for ( const lang of langs ) {
60
- await formatter ( lang , getLanguageFolder ( lang ) , verbose ) ;
61
- }
59
+ await Promise . all (
60
+ langs . map ( ( lang ) => formatter ( lang , getLanguageFolder ( lang ) , verbose ) )
61
+ ) ;
62
62
}
Original file line number Diff line number Diff line change @@ -232,11 +232,6 @@ page:
232
232
x-categories :
233
233
- Pagination
234
234
235
- cursor :
236
- type : string
237
- description : Cursor indicating the location to resume browsing from. Must match the value returned by the previous call.
238
- example : jMDY3M2MwM2QwMWUxMmQwYWI0ZTN
239
-
240
235
aroundRadius :
241
236
description : Define the maximum radius for a geo search (in meters).
242
237
oneOf :
Original file line number Diff line number Diff line change
1
+ browseParams :
2
+ oneOf :
3
+ - $ref : ' ../../../common/schemas/SearchParams.yml#/searchParamsString'
4
+ - $ref : ' #/browseParamsObject'
5
+
6
+ browseParamsObject :
7
+ allOf :
8
+ - $ref : ' ../../../common/schemas/SearchParams.yml#/searchParamsObject'
9
+ - $ref : ' #/cursor'
10
+
11
+ cursor :
12
+ type : object
13
+ additionalProperties : false
14
+ properties :
15
+ cursor :
16
+ type : string
17
+ description : Cursor indicating the location to resume browsing from. Must match the value returned by the previous call.
18
+ example : jMDY3M2MwM2QwMWUxMmQwYWI0ZTN
Original file line number Diff line number Diff line change
1
+ browseResponse :
2
+ allOf :
3
+ - $ref : ' ./SearchResponse.yml#/baseSearchResponse'
4
+ - $ref : ' ./SearchResponse.yml#/searchHits'
5
+ - $ref : ' ./BrowseParams.yml#/cursor'
Original file line number Diff line number Diff line change 1
- SearchResponse :
1
+ searchResponse :
2
2
allOf :
3
3
- $ref : ' #/baseSearchResponse'
4
4
- $ref : ' #/searchHits'
5
5
6
- browseResponse :
7
- allOf :
8
- - $ref : ' #/baseSearchResponse'
9
- - $ref : ' #/searchHits'
10
- - $ref : ' #/baseBrowseResponse'
11
-
12
- baseBrowseResponse :
13
- type : object
14
- additionalProperties : false
15
- properties :
16
- cursor :
17
- $ref : ' ../../../common/schemas/SearchParams.yml#/cursor'
18
-
19
6
searchHits :
20
7
type : object
21
8
additionalProperties : false
Original file line number Diff line number Diff line change @@ -15,14 +15,14 @@ post:
15
15
content :
16
16
application/json :
17
17
schema :
18
- $ref : ' ../../../ common/schemas/SearchParams .yml#/searchParams '
18
+ $ref : ' ../../common/schemas/BrowseParams .yml#/browseParams '
19
19
responses :
20
20
' 200 ' :
21
21
description : OK
22
22
content :
23
23
application/json :
24
24
schema :
25
- $ref : ' ../../common/schemas/SearchResponse .yml#/browseResponse'
25
+ $ref : ' ../../common/schemas/BrowseResponse .yml#/browseResponse'
26
26
' 400 ' :
27
27
$ref : ' ../../../common/responses/BadRequest.yml'
28
28
' 402 ' :
Original file line number Diff line number Diff line change 38
38
results :
39
39
type : array
40
40
items :
41
- $ref : ' ../../common/schemas/SearchResponse.yml#/SearchResponse '
41
+ $ref : ' ../../common/schemas/SearchResponse.yml#/searchResponse '
42
42
required :
43
43
- results
44
44
' 400 ' :
Original file line number Diff line number Diff line change 19
19
content :
20
20
application/json :
21
21
schema :
22
- $ref : ' ../../common/schemas/SearchResponse.yml#/SearchResponse '
22
+ $ref : ' ../../common/schemas/SearchResponse.yml#/searchResponse '
23
23
' 400 ' :
24
24
$ref : ' ../../../common/responses/BadRequest.yml'
25
25
' 402 ' :
Original file line number Diff line number Diff line change @@ -113,15 +113,15 @@ waitForApiKey(
113
113
* @summary Helper method that iterates on the `browse` method.
114
114
* @param browseObjects - The browseObjects object.
115
115
* @param browseObjects.indexName - The index in which to perform the request.
116
- * @param browseObjects.searchParams - The `browse` search parameters.
116
+ * @param browseObjects.browseParams - The `browse` parameters.
117
117
* @param browseObjects.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is no `cursor` in the response.
118
118
* @param browseObjects.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.
119
119
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `browse` method and merged with the transporter requestOptions.
120
120
*/
121
121
browseObjects<T >(
122
122
{
123
123
indexName,
124
- searchParams ,
124
+ browseParams ,
125
125
...browseObjectsOptions
126
126
} : BrowseOptions<BrowseResponse <T >> & BrowseProps,
127
127
requestOptions?: RequestOptions
@@ -131,9 +131,9 @@ browseObjects<T>(
131
131
return this.browse(
132
132
{
133
133
indexName,
134
- searchParams : {
134
+ browseParams : {
135
135
cursor: previousResponse ? previousResponse.cursor : undefined,
136
- ...searchParams ,
136
+ ...browseParams ,
137
137
} ,
138
138
},
139
139
requestOptions
Original file line number Diff line number Diff line change 13
13
"testName" : " browse with search parameters" ,
14
14
"parameters" : {
15
15
"indexName" : " indexName" ,
16
- "searchParams " : {
16
+ "browseParams " : {
17
17
"query" : " myQuery" ,
18
18
"facetFilters" : [
19
19
" tags:algolia"
30
30
]
31
31
}
32
32
}
33
+ },
34
+ {
35
+ "testName" : " browse allow a cursor in parameters" ,
36
+ "parameters" : {
37
+ "indexName" : " indexName" ,
38
+ "browseParams" : {
39
+ "cursor" : " test"
40
+ }
41
+ },
42
+ "request" : {
43
+ "path" : " /1/indexes/indexName/browse" ,
44
+ "method" : " POST" ,
45
+ "body" : {
46
+ "cursor" : " test"
47
+ }
48
+ }
33
49
}
34
50
]
You can’t perform that action at this time.
0 commit comments