You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/client-search/src/searchClient.ts
+23-14Lines changed: 23 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -192,15 +192,19 @@ export function createSearchClient({
192
192
* @param waitForTaskOptions - The waitForTaskOptions object.
193
193
* @param waitForTaskOptions.indexName - The `indexName` where the operation was performed.
194
194
* @param waitForTaskOptions.taskID - The `taskID` returned in the method response.
195
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
@@ -213,13 +217,17 @@ export function createSearchClient({
213
217
* @param waitForApiKeyOptions.operation - The `operation` that was done on a `key`.
214
218
* @param waitForApiKeyOptions.key - The `key` that has been added, deleted or updated.
215
219
* @param waitForApiKeyOptions.apiKey - Necessary to know if an `update` operation has been processed, compare fields of the response with it.
220
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getApikey` method and merged with the transporter requestOptions.
216
221
*/
217
-
waitForApiKey({
218
-
operation,
219
-
key,
220
-
apiKey,
221
-
...createRetryablePromiseOptions
222
-
}: WaitForApiKeyOptions): Promise<ApiError|Key>{
222
+
waitForApiKey(
223
+
{
224
+
operation,
225
+
key,
226
+
apiKey,
227
+
...createRetryablePromiseOptions
228
+
}: WaitForApiKeyOptions,
229
+
requestOptions?: RequestOptions
230
+
): Promise<ApiError|Key>{
223
231
if(operation==='update'){
224
232
if(!apiKey){
225
233
thrownewError(
@@ -229,7 +237,7 @@ export function createSearchClient({
229
237
230
238
returncreateRetryablePromise({
231
239
...createRetryablePromiseOptions,
232
-
func: ()=>this.getApiKey({ key }),
240
+
func: ()=>this.getApiKey({ key },requestOptions),
233
241
validate: (response)=>{
234
242
for(constfieldofObject.keys(apiKey)){
235
243
if(Array.isArray(apiKey[field])){
@@ -252,7 +260,8 @@ export function createSearchClient({
0 commit comments