algoliasearch 5.0.0-beta.2 → 5.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/algoliasearch/builds/browser.d.ts +4 -2
  2. package/dist/algoliasearch/builds/browser.d.ts.map +1 -1
  3. package/dist/algoliasearch/builds/node.d.ts +4 -2
  4. package/dist/algoliasearch/builds/node.d.ts.map +1 -1
  5. package/dist/algoliasearch.cjs +73 -11
  6. package/dist/algoliasearch.esm.browser.js +82 -26
  7. package/dist/algoliasearch.esm.node.js +73 -11
  8. package/dist/algoliasearch.umd.js +2 -2
  9. package/dist/client-abtesting/src/abtestingClient.d.ts +1 -1
  10. package/dist/client-analytics/src/analyticsClient.d.ts +1 -1
  11. package/dist/client-personalization/src/personalizationClient.d.ts +1 -1
  12. package/dist/client-search/model/clientMethodProps.d.ts +16 -21
  13. package/dist/client-search/model/clientMethodProps.d.ts.map +1 -1
  14. package/dist/client-search/model/index.d.ts +1 -0
  15. package/dist/client-search/model/index.d.ts.map +1 -1
  16. package/dist/client-search/model/rankingInfo.d.ts +3 -3
  17. package/dist/client-search/model/rankingInfo.d.ts.map +1 -1
  18. package/dist/client-search/model/replaceAllObjectsResponse.d.ts +11 -0
  19. package/dist/client-search/model/replaceAllObjectsResponse.d.ts.map +1 -0
  20. package/dist/client-search/src/searchClient.d.ts +28 -4
  21. package/dist/client-search/src/searchClient.d.ts.map +1 -1
  22. package/dist/lite/lite.cjs +1 -1
  23. package/dist/lite/lite.esm.browser.js +10 -16
  24. package/dist/lite/lite.esm.node.js +1 -1
  25. package/dist/lite/lite.umd.js +2 -2
  26. package/dist/lite/model/index.d.ts +0 -38
  27. package/dist/lite/model/index.d.ts.map +1 -1
  28. package/dist/lite/model/rankingInfo.d.ts +3 -3
  29. package/dist/lite/model/rankingInfo.d.ts.map +1 -1
  30. package/dist/lite/src/liteClient.d.ts +1 -1
  31. package/lite/model/index.ts +0 -38
  32. package/lite/model/rankingInfo.ts +3 -3
  33. package/lite/src/liteClient.ts +1 -1
  34. package/package.json +12 -12
  35. package/dist/lite/model/action.d.ts +0 -5
  36. package/dist/lite/model/action.d.ts.map +0 -1
  37. package/dist/lite/model/addApiKeyResponse.d.ts +0 -11
  38. package/dist/lite/model/addApiKeyResponse.d.ts.map +0 -1
  39. package/dist/lite/model/anchoring.d.ts +0 -5
  40. package/dist/lite/model/anchoring.d.ts.map +0 -1
  41. package/dist/lite/model/apiKeyOperation.d.ts +0 -2
  42. package/dist/lite/model/apiKeyOperation.d.ts.map +0 -1
  43. package/dist/lite/model/attributeToUpdate.d.ts +0 -3
  44. package/dist/lite/model/attributeToUpdate.d.ts.map +0 -1
  45. package/dist/lite/model/browseParams.d.ts +0 -4
  46. package/dist/lite/model/browseParams.d.ts.map +0 -1
  47. package/dist/lite/model/builtInOperation.d.ts +0 -12
  48. package/dist/lite/model/builtInOperation.d.ts.map +0 -1
  49. package/dist/lite/model/builtInOperationType.d.ts +0 -5
  50. package/dist/lite/model/builtInOperationType.d.ts.map +0 -1
  51. package/dist/lite/model/condition.d.ts +0 -21
  52. package/dist/lite/model/condition.d.ts.map +0 -1
  53. package/dist/lite/model/consequence.d.ts +0 -26
  54. package/dist/lite/model/consequence.d.ts.map +0 -1
  55. package/dist/lite/model/consequenceHide.d.ts +0 -10
  56. package/dist/lite/model/consequenceHide.d.ts.map +0 -1
  57. package/dist/lite/model/deleteByParams.d.ts +0 -27
  58. package/dist/lite/model/deleteByParams.d.ts.map +0 -1
  59. package/dist/lite/model/dictionaryAction.d.ts +0 -5
  60. package/dist/lite/model/dictionaryAction.d.ts.map +0 -1
  61. package/dist/lite/model/dictionaryEntry.d.ts +0 -26
  62. package/dist/lite/model/dictionaryEntry.d.ts.map +0 -1
  63. package/dist/lite/model/dictionaryEntryState.d.ts +0 -5
  64. package/dist/lite/model/dictionaryEntryState.d.ts.map +0 -1
  65. package/dist/lite/model/dictionaryLanguage.d.ts +0 -10
  66. package/dist/lite/model/dictionaryLanguage.d.ts.map +0 -1
  67. package/dist/lite/model/dictionaryType.d.ts +0 -2
  68. package/dist/lite/model/dictionaryType.d.ts.map +0 -1
  69. package/dist/lite/model/fetchedIndex.d.ts +0 -47
  70. package/dist/lite/model/fetchedIndex.d.ts.map +0 -1
  71. package/dist/lite/model/languages.d.ts +0 -10
  72. package/dist/lite/model/languages.d.ts.map +0 -1
  73. package/dist/lite/model/listIndicesResponse.d.ts +0 -12
  74. package/dist/lite/model/listIndicesResponse.d.ts.map +0 -1
  75. package/dist/lite/model/logType.d.ts +0 -2
  76. package/dist/lite/model/logType.d.ts.map +0 -1
  77. package/dist/lite/model/operationType.d.ts +0 -5
  78. package/dist/lite/model/operationType.d.ts.map +0 -1
  79. package/dist/lite/model/promote.d.ts +0 -4
  80. package/dist/lite/model/promote.d.ts.map +0 -1
  81. package/dist/lite/model/promoteObjectID.d.ts +0 -14
  82. package/dist/lite/model/promoteObjectID.d.ts.map +0 -1
  83. package/dist/lite/model/promoteObjectIDs.d.ts +0 -14
  84. package/dist/lite/model/promoteObjectIDs.d.ts.map +0 -1
  85. package/dist/lite/model/rule.d.ts +0 -30
  86. package/dist/lite/model/rule.d.ts.map +0 -1
  87. package/dist/lite/model/scopeType.d.ts +0 -2
  88. package/dist/lite/model/scopeType.d.ts.map +0 -1
  89. package/dist/lite/model/searchDictionaryEntriesResponse.d.ts +0 -20
  90. package/dist/lite/model/searchDictionaryEntriesResponse.d.ts.map +0 -1
  91. package/dist/lite/model/searchSynonymsResponse.d.ts +0 -12
  92. package/dist/lite/model/searchSynonymsResponse.d.ts.map +0 -1
  93. package/dist/lite/model/securedAPIKeyRestrictions.d.ts +0 -25
  94. package/dist/lite/model/securedAPIKeyRestrictions.d.ts.map +0 -1
  95. package/dist/lite/model/source.d.ts +0 -14
  96. package/dist/lite/model/source.d.ts.map +0 -1
  97. package/dist/lite/model/standardEntries.d.ts +0 -18
  98. package/dist/lite/model/standardEntries.d.ts.map +0 -1
  99. package/dist/lite/model/synonymHit.d.ts +0 -36
  100. package/dist/lite/model/synonymHit.d.ts.map +0 -1
  101. package/dist/lite/model/synonymType.d.ts +0 -5
  102. package/dist/lite/model/synonymType.d.ts.map +0 -1
  103. package/dist/lite/model/taskStatus.d.ts +0 -5
  104. package/dist/lite/model/taskStatus.d.ts.map +0 -1
  105. package/dist/lite/model/timeRange.d.ts +0 -11
  106. package/dist/lite/model/timeRange.d.ts.map +0 -1
  107. package/dist/lite/model/updatedRuleResponse.d.ts +0 -15
  108. package/dist/lite/model/updatedRuleResponse.d.ts.map +0 -1
  109. package/dist/lite/model/userId.d.ts +0 -22
  110. package/dist/lite/model/userId.d.ts.map +0 -1
  111. package/lite/model/action.ts +0 -13
  112. package/lite/model/addApiKeyResponse.ts +0 -13
  113. package/lite/model/anchoring.ts +0 -6
  114. package/lite/model/apiKeyOperation.ts +0 -3
  115. package/lite/model/attributeToUpdate.ts +0 -5
  116. package/lite/model/browseParams.ts +0 -6
  117. package/lite/model/builtInOperation.ts +0 -15
  118. package/lite/model/builtInOperationType.ts +0 -13
  119. package/lite/model/condition.ts +0 -27
  120. package/lite/model/consequence.ts +0 -32
  121. package/lite/model/consequenceHide.ts +0 -11
  122. package/lite/model/deleteByParams.ts +0 -36
  123. package/lite/model/dictionaryAction.ts +0 -6
  124. package/lite/model/dictionaryEntry.ts +0 -33
  125. package/lite/model/dictionaryEntryState.ts +0 -6
  126. package/lite/model/dictionaryLanguage.ts +0 -11
  127. package/lite/model/dictionaryType.ts +0 -3
  128. package/lite/model/fetchedIndex.ts +0 -58
  129. package/lite/model/languages.ts +0 -14
  130. package/lite/model/listIndicesResponse.ts +0 -15
  131. package/lite/model/logType.ts +0 -3
  132. package/lite/model/operationType.ts +0 -6
  133. package/lite/model/promote.ts +0 -6
  134. package/lite/model/promoteObjectID.ts +0 -16
  135. package/lite/model/promoteObjectIDs.ts +0 -16
  136. package/lite/model/rule.ts +0 -37
  137. package/lite/model/scopeType.ts +0 -3
  138. package/lite/model/searchDictionaryEntriesResponse.ts +0 -25
  139. package/lite/model/searchSynonymsResponse.ts +0 -15
  140. package/lite/model/securedAPIKeyRestrictions.ts +0 -32
  141. package/lite/model/source.ts +0 -16
  142. package/lite/model/standardEntries.ts +0 -21
  143. package/lite/model/synonymHit.ts +0 -45
  144. package/lite/model/synonymType.ts +0 -11
  145. package/lite/model/taskStatus.ts +0 -6
  146. package/lite/model/timeRange.ts +0 -13
  147. package/lite/model/updatedRuleResponse.ts +0 -18
  148. package/lite/model/userId.ts +0 -26
@@ -7,7 +7,7 @@ import type { PersonalizationClient } from '@algolia/client-personalization';
7
7
  import type { Region as PersonalizationRegion } from '@algolia/client-personalization/src/personalizationClient';
8
8
  import type { InitClientOptions, InitClientRegion } from './models';
9
9
  export * from './models';
10
- export declare const apiClientVersion = "5.0.0-beta.2";
10
+ export declare const apiClientVersion = "5.0.0-beta.4";
11
11
  /**
12
12
  * The client type.
13
13
  */
@@ -22,6 +22,7 @@ export declare function algoliasearch(appId: string, apiKey: string, options?: C
22
22
  clearCache(): Promise<void>;
23
23
  addAlgoliaAgent(segment: string, version?: string | undefined): void;
24
24
  waitForTask({ indexName, taskID, maxRetries, timeout, }: import("@algolia/client-search/model/clientMethodProps").WaitForTaskOptions, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/getTaskResponse").GetTaskResponse>;
25
+ waitForAppTask({ taskID, maxRetries, timeout, }: import("@algolia/client-search/model/clientMethodProps").WaitForAppTaskOptions, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/getTaskResponse").GetTaskResponse>;
25
26
  waitForApiKey({ operation, key, apiKey, maxRetries, timeout, }: import("@algolia/client-search/model/clientMethodProps").WaitForApiKeyOptions, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-common").ApiError | import("@algolia/client-search/model/getApiKeyResponse").GetApiKeyResponse>;
26
27
  browseObjects<T>({ indexName, browseParams, ...browseObjectsOptions }: Partial<Pick<import("@algolia/client-common").CreateIterablePromise<import("@algolia/client-search/model/browseResponse").BrowseResponse<T>>, "validate">> & Required<Pick<import("@algolia/client-common").CreateIterablePromise<import("@algolia/client-search/model/browseResponse").BrowseResponse<T>>, "aggregator">> & import("@algolia/client-search/model/clientMethodProps").BrowseProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/browseResponse").BrowseResponse<T>>;
27
28
  browseRules({ indexName, searchRulesParams, ...browseRulesOptions }: Partial<Pick<import("@algolia/client-common").CreateIterablePromise<import("@algolia/client-search/model/searchRulesResponse").SearchRulesResponse>, "validate">> & Required<Pick<import("@algolia/client-common").CreateIterablePromise<import("@algolia/client-search/model/searchRulesResponse").SearchRulesResponse>, "aggregator">> & import("@algolia/client-search/model/clientMethodProps").SearchRulesProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/searchRulesResponse").SearchRulesResponse>;
@@ -33,7 +34,7 @@ export declare function algoliasearch(appId: string, apiKey: string, options?: C
33
34
  results: import("@algolia/client-search/model/searchForFacetValuesResponse").SearchForFacetValuesResponse[];
34
35
  }>;
35
36
  chunkedBatch({ indexName, objects, action, waitForTasks, batchSize, }: import("@algolia/client-search/model/clientMethodProps").ChunkedBatchOptions, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/batchResponse").BatchResponse[]>;
36
- replaceAllObjects({ indexName, objects, batchSize }: import("@algolia/client-search/model/clientMethodProps").ReplaceAllObjectsOptions, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/clientMethodProps").ReplaceAllObjectsResponse>;
37
+ replaceAllObjects({ indexName, objects, batchSize }: import("@algolia/client-search/model/clientMethodProps").ReplaceAllObjectsOptions, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/replaceAllObjectsResponse").ReplaceAllObjectsResponse>;
37
38
  addApiKey(apiKey: import("@algolia/client-search/model/apiKey").ApiKey, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/addApiKeyResponse").AddApiKeyResponse>;
38
39
  addOrUpdateObject({ indexName, objectID, body }: import("@algolia/client-search/model/clientMethodProps").AddOrUpdateObjectProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/updatedAtWithObjectIdResponse").UpdatedAtWithObjectIdResponse>;
39
40
  appendSource(source: import("@algolia/client-search/model/source").Source, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/createdAtResponse").CreatedAtResponse>;
@@ -57,6 +58,7 @@ export declare function algoliasearch(appId: string, apiKey: string, options?: C
57
58
  deleteSource({ source }: import("@algolia/client-search/model/clientMethodProps").DeleteSourceProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/deleteSourceResponse").DeleteSourceResponse>;
58
59
  deleteSynonym({ indexName, objectID, forwardToReplicas }: import("@algolia/client-search/model/clientMethodProps").DeleteSynonymProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/deletedAtResponse").DeletedAtResponse>;
59
60
  getApiKey({ key }: import("@algolia/client-search/model/clientMethodProps").GetApiKeyProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/getApiKeyResponse").GetApiKeyResponse>;
61
+ getAppTask({ taskID }: import("@algolia/client-search/model/clientMethodProps").GetAppTaskProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/getTaskResponse").GetTaskResponse>;
60
62
  getDictionaryLanguages(requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, import("@algolia/client-search/model/languages").Languages>>;
61
63
  getDictionarySettings(requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/getDictionarySettingsResponse").GetDictionarySettingsResponse>;
62
64
  getLogs({ offset, length, indexName, type }?: import("@algolia/client-search/model/clientMethodProps").GetLogsProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/getLogsResponse").GetLogsResponse>;
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../builds/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAK/F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAa/F,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,IAAI,qBAAqB,EAAE,MAAM,2DAA2D,CAAC;AAWjH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEpE,cAAc,UAAU,CAAC;AAEzB,eAAO,MAAM,gBAAgB,iBAAsB,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AAG7D,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,aAAa;;kCAgCR,iBAAiB,GAAG,iBAAiB,eAAe,CAAC,KACjE,eAAe;uCAuCH,iBAAiB,GAC5B,SAAS,iBAAiB,qBAAqB,CAAC,CAAC,KAClD,qBAAqB;kCAtBT,iBAAiB,GAAG,iBAAiB,eAAe,CAAC,KACjE,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDnB"}
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../builds/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAK/F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAa/F,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,IAAI,qBAAqB,EAAE,MAAM,2DAA2D,CAAC;AAWjH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEpE,cAAc,UAAU,CAAC;AAEzB,eAAO,MAAM,gBAAgB,iBAAsB,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AAG7D,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,aAAa;;kCAgCR,iBAAiB,GAAG,iBAAiB,eAAe,CAAC,KACjE,eAAe;uCAuCH,iBAAiB,GAC5B,SAAS,iBAAiB,qBAAqB,CAAC,CAAC,KAClD,qBAAqB;kCAtBT,iBAAiB,GAAG,iBAAiB,eAAe,CAAC,KACjE,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDnB"}
@@ -7,7 +7,7 @@ import type { PersonalizationClient } from '@algolia/client-personalization';
7
7
  import type { Region as PersonalizationRegion } from '@algolia/client-personalization/src/personalizationClient';
8
8
  import type { InitClientOptions, InitClientRegion, GenerateSecuredApiKeyOptions, GetSecuredApiKeyRemainingValidityOptions } from './models';
9
9
  export * from './models';
10
- export declare const apiClientVersion = "5.0.0-beta.2";
10
+ export declare const apiClientVersion = "5.0.0-beta.4";
11
11
  /**
12
12
  * The client type.
13
13
  */
@@ -39,6 +39,7 @@ export declare function algoliasearch(appId: string, apiKey: string, options?: C
39
39
  clearCache(): Promise<void>;
40
40
  addAlgoliaAgent(segment: string, version?: string | undefined): void;
41
41
  waitForTask({ indexName, taskID, maxRetries, timeout, }: import("@algolia/client-search/model/clientMethodProps").WaitForTaskOptions, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/getTaskResponse").GetTaskResponse>;
42
+ waitForAppTask({ taskID, maxRetries, timeout, }: import("@algolia/client-search/model/clientMethodProps").WaitForAppTaskOptions, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/getTaskResponse").GetTaskResponse>;
42
43
  waitForApiKey({ operation, key, apiKey, maxRetries, timeout, }: import("@algolia/client-search/model/clientMethodProps").WaitForApiKeyOptions, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-common").ApiError | import("@algolia/client-search/model/getApiKeyResponse").GetApiKeyResponse>;
43
44
  browseObjects<T>({ indexName, browseParams, ...browseObjectsOptions }: Partial<Pick<import("@algolia/client-common").CreateIterablePromise<import("@algolia/client-search/model/browseResponse").BrowseResponse<T>>, "validate">> & Required<Pick<import("@algolia/client-common").CreateIterablePromise<import("@algolia/client-search/model/browseResponse").BrowseResponse<T>>, "aggregator">> & import("@algolia/client-search/model/clientMethodProps").BrowseProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/browseResponse").BrowseResponse<T>>;
44
45
  browseRules({ indexName, searchRulesParams, ...browseRulesOptions }: Partial<Pick<import("@algolia/client-common").CreateIterablePromise<import("@algolia/client-search/model/searchRulesResponse").SearchRulesResponse>, "validate">> & Required<Pick<import("@algolia/client-common").CreateIterablePromise<import("@algolia/client-search/model/searchRulesResponse").SearchRulesResponse>, "aggregator">> & import("@algolia/client-search/model/clientMethodProps").SearchRulesProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/searchRulesResponse").SearchRulesResponse>;
@@ -50,7 +51,7 @@ export declare function algoliasearch(appId: string, apiKey: string, options?: C
50
51
  results: import("@algolia/client-search/model/searchForFacetValuesResponse").SearchForFacetValuesResponse[];
51
52
  }>;
52
53
  chunkedBatch({ indexName, objects, action, waitForTasks, batchSize, }: import("@algolia/client-search/model/clientMethodProps").ChunkedBatchOptions, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/batchResponse").BatchResponse[]>;
53
- replaceAllObjects({ indexName, objects, batchSize }: import("@algolia/client-search/model/clientMethodProps").ReplaceAllObjectsOptions, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/clientMethodProps").ReplaceAllObjectsResponse>;
54
+ replaceAllObjects({ indexName, objects, batchSize }: import("@algolia/client-search/model/clientMethodProps").ReplaceAllObjectsOptions, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/replaceAllObjectsResponse").ReplaceAllObjectsResponse>;
54
55
  addApiKey(apiKey: import("@algolia/client-search/model/apiKey").ApiKey, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/addApiKeyResponse").AddApiKeyResponse>;
55
56
  addOrUpdateObject({ indexName, objectID, body }: import("@algolia/client-search/model/clientMethodProps").AddOrUpdateObjectProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/updatedAtWithObjectIdResponse").UpdatedAtWithObjectIdResponse>;
56
57
  appendSource(source: import("@algolia/client-search/model/source").Source, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/createdAtResponse").CreatedAtResponse>;
@@ -74,6 +75,7 @@ export declare function algoliasearch(appId: string, apiKey: string, options?: C
74
75
  deleteSource({ source }: import("@algolia/client-search/model/clientMethodProps").DeleteSourceProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/deleteSourceResponse").DeleteSourceResponse>;
75
76
  deleteSynonym({ indexName, objectID, forwardToReplicas }: import("@algolia/client-search/model/clientMethodProps").DeleteSynonymProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/deletedAtResponse").DeletedAtResponse>;
76
77
  getApiKey({ key }: import("@algolia/client-search/model/clientMethodProps").GetApiKeyProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/getApiKeyResponse").GetApiKeyResponse>;
78
+ getAppTask({ taskID }: import("@algolia/client-search/model/clientMethodProps").GetAppTaskProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/getTaskResponse").GetTaskResponse>;
77
79
  getDictionaryLanguages(requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, import("@algolia/client-search/model/languages").Languages>>;
78
80
  getDictionarySettings(requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/getDictionarySettingsResponse").GetDictionarySettingsResponse>;
79
81
  getLogs({ offset, length, indexName, type }?: import("@algolia/client-search/model/clientMethodProps").GetLogsProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("@algolia/client-search/model/getLogsResponse").GetLogsResponse>;
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../builds/node.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAK/F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAa/F,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,IAAI,qBAAqB,EAAE,MAAM,2DAA2D,CAAC;AAWjH,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,4BAA4B,EAC5B,wCAAwC,EACzC,MAAM,UAAU,CAAC;AAElB,cAAc,UAAU,CAAC;AAEzB,eAAO,MAAM,gBAAgB,iBAAsB,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AAG7D,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,aAAa;;kCA0BR,iBAAiB,GAAG,iBAAiB,eAAe,CAAC,KACjE,eAAe;uCAuCH,iBAAiB,GAC5B,SAAS,iBAAiB,qBAAqB,CAAC,CAAC,KAClD,qBAAqB;kCAtBT,iBAAiB,GAAG,iBAAiB,eAAe,CAAC,KACjE,eAAe;IAmDhB;;;;;;;OAOG;2DAIA,4BAA4B,GAAG,MAAM;IASxC;;;;;;OAMG;0DAGA,wCAAwC,GAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcvD"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../builds/node.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAK/F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAa/F,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,IAAI,qBAAqB,EAAE,MAAM,2DAA2D,CAAC;AAWjH,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,4BAA4B,EAC5B,wCAAwC,EACzC,MAAM,UAAU,CAAC;AAElB,cAAc,UAAU,CAAC;AAEzB,eAAO,MAAM,gBAAgB,iBAAsB,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AAG7D,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,aAAa;;kCA0BR,iBAAiB,GAAG,iBAAiB,eAAe,CAAC,KACjE,eAAe;uCAuCH,iBAAiB,GAC5B,SAAS,iBAAiB,qBAAqB,CAAC,CAAC,KAClD,qBAAqB;kCAtBT,iBAAiB,GAAG,iBAAiB,eAAe,CAAC,KACjE,eAAe;IAmDhB;;;;;;;OAOG;2DAIA,4BAA4B,GAAG,MAAM;IASxC;;;;;;OAMG;0DAGA,wCAAwC,GAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcvD"}
@@ -5,7 +5,7 @@ var clientCommon = require('@algolia/client-common');
5
5
  var requesterNodeHttp = require('@algolia/requester-node-http');
6
6
 
7
7
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
8
- const apiClientVersion$4 = '5.0.0-beta.2';
8
+ const apiClientVersion$4 = '5.0.0-beta.4';
9
9
  const REGIONS$2 = ['de', 'us'];
10
10
  function getDefaultHosts$3(region) {
11
11
  const url = !region
@@ -310,7 +310,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
310
310
  }
311
311
 
312
312
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
313
- const apiClientVersion$3 = '5.0.0-beta.2';
313
+ const apiClientVersion$3 = '5.0.0-beta.4';
314
314
  const REGIONS$1 = ['de', 'us'];
315
315
  function getDefaultHosts$2(region) {
316
316
  const url = !region
@@ -1365,7 +1365,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
1365
1365
  }
1366
1366
 
1367
1367
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
1368
- const apiClientVersion$2 = '5.0.0-beta.2';
1368
+ const apiClientVersion$2 = '5.0.0-beta.4';
1369
1369
  const REGIONS = ['eu', 'us'];
1370
1370
  function getDefaultHosts$1(region) {
1371
1371
  const url = 'personalization.{region}.algolia.com'.replace('{region}', region);
@@ -1626,7 +1626,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
1626
1626
  }
1627
1627
 
1628
1628
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
1629
- const apiClientVersion$1 = '5.0.0-beta.2';
1629
+ const apiClientVersion$1 = '5.0.0-beta.4';
1630
1630
  function getDefaultHosts(appId) {
1631
1631
  return [
1632
1632
  {
@@ -1732,6 +1732,29 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1732
1732
  timeout: () => timeout(retryCount),
1733
1733
  });
1734
1734
  },
1735
+ /**
1736
+ * Helper: Wait for an application-level task to complete for a given `taskID`.
1737
+ *
1738
+ * @summary Helper method that waits for a task to be published (completed).
1739
+ * @param waitForAppTaskOptions - The `waitForTaskOptions` object.
1740
+ * @param waitForAppTaskOptions.taskID - The `taskID` returned in the method response.
1741
+ * @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 50 by default.
1742
+ * @param waitForAppTaskOptions.timeout - The function to decide how long to wait between retries.
1743
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
1744
+ */
1745
+ waitForAppTask({ taskID, maxRetries = 50, timeout = (retryCount) => Math.min(retryCount * 200, 5000), }, requestOptions) {
1746
+ let retryCount = 0;
1747
+ return clientCommon.createIterablePromise({
1748
+ func: () => this.getAppTask({ taskID }, requestOptions),
1749
+ validate: (response) => response.status === 'published',
1750
+ aggregator: () => (retryCount += 1),
1751
+ error: {
1752
+ validate: () => retryCount >= maxRetries,
1753
+ message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,
1754
+ },
1755
+ timeout: () => timeout(retryCount),
1756
+ });
1757
+ },
1735
1758
  /**
1736
1759
  * Helper: Wait for an API key to be added, updated or deleted based on a given `operation`.
1737
1760
  *
@@ -1913,9 +1936,10 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1913
1936
  async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000, }, requestOptions) {
1914
1937
  let requests = [];
1915
1938
  const responses = [];
1916
- for (const [i, obj] of objects.entries()) {
1939
+ const objectEntries = objects.entries();
1940
+ for (const [i, obj] of objectEntries) {
1917
1941
  requests.push({ action, body: obj });
1918
- if (i % batchSize === 0) {
1942
+ if (requests.length === batchSize || i === objects.length - 1) {
1919
1943
  responses.push(await this.batch({ indexName, batchWriteParams: { requests } }, requestOptions));
1920
1944
  requests = [];
1921
1945
  }
@@ -1929,18 +1953,19 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1929
1953
  },
1930
1954
  /**
1931
1955
  * Helper: Replaces all objects (records) in the given `index_name` with the given `objects`. A temporary index is created during this process in order to backup your data.
1956
+ * See https://api-clients-automation.netlify.app/docs/contributing/add-new-api-client#5-helpers for implementation details.
1932
1957
  *
1933
1958
  * @summary Helper: Replaces all objects (records) in the given `index_name` with the given `objects`. A temporary index is created during this process in order to backup your data.
1934
1959
  * @param replaceAllObjects - The `replaceAllObjects` object.
1935
1960
  * @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
1936
1961
  * @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
1937
- * @param replaceAllObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
1962
+ * @param replaceAllObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `objects.length / batchSize`. Defaults to 1000.
1938
1963
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
1939
1964
  */
1940
1965
  async replaceAllObjects({ indexName, objects, batchSize }, requestOptions) {
1941
1966
  const randomSuffix = Math.random().toString(36).substring(7);
1942
1967
  const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
1943
- const copyOperationResponse = await this.operationIndex({
1968
+ let copyOperationResponse = await this.operationIndex({
1944
1969
  indexName,
1945
1970
  operationIndexParams: {
1946
1971
  operation: 'copy',
@@ -1948,17 +1973,29 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
1948
1973
  scope: ['settings', 'rules', 'synonyms'],
1949
1974
  },
1950
1975
  }, requestOptions);
1976
+ const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
1951
1977
  await this.waitForTask({
1978
+ indexName: tmpIndexName,
1979
+ taskID: copyOperationResponse.taskID,
1980
+ });
1981
+ copyOperationResponse = await this.operationIndex({
1952
1982
  indexName,
1983
+ operationIndexParams: {
1984
+ operation: 'copy',
1985
+ destination: tmpIndexName,
1986
+ scope: ['settings', 'rules', 'synonyms'],
1987
+ },
1988
+ }, requestOptions);
1989
+ await this.waitForTask({
1990
+ indexName: tmpIndexName,
1953
1991
  taskID: copyOperationResponse.taskID,
1954
1992
  });
1955
- const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
1956
1993
  const moveOperationResponse = await this.operationIndex({
1957
1994
  indexName: tmpIndexName,
1958
1995
  operationIndexParams: { operation: 'move', destination: indexName },
1959
1996
  }, requestOptions);
1960
1997
  await this.waitForTask({
1961
- indexName,
1998
+ indexName: tmpIndexName,
1962
1999
  taskID: moveOperationResponse.taskID,
1963
2000
  });
1964
2001
  return { copyOperationResponse, batchResponses, moveOperationResponse };
@@ -2627,6 +2664,31 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
2627
2664
  };
2628
2665
  return transporter.request(request, requestOptions);
2629
2666
  },
2667
+ /**
2668
+ * Checks the status of a given application task.
2669
+ *
2670
+ * Required API Key ACLs:
2671
+ * - editSettings.
2672
+ *
2673
+ * @param getAppTask - The getAppTask object.
2674
+ * @param getAppTask.taskID - Unique task identifier.
2675
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2676
+ */
2677
+ getAppTask({ taskID }, requestOptions) {
2678
+ if (!taskID) {
2679
+ throw new Error('Parameter `taskID` is required when calling `getAppTask`.');
2680
+ }
2681
+ const requestPath = '/1/task/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
2682
+ const headers = {};
2683
+ const queryParameters = {};
2684
+ const request = {
2685
+ method: 'GET',
2686
+ path: requestPath,
2687
+ queryParameters,
2688
+ headers,
2689
+ };
2690
+ return transporter.request(request, requestOptions);
2691
+ },
2630
2692
  /**
2631
2693
  * Lists supported languages with their supported dictionary types and number of custom entries.
2632
2694
  *
@@ -3101,7 +3163,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
3101
3163
  return transporter.request(request, requestOptions);
3102
3164
  },
3103
3165
  /**
3104
- * Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for index-specific API keys and analytics data. - If the destination index doesn\'t exist yet, it\'ll be created. **Copy** - Copying a source index that doesn\'t exist creates a new index with 0 records and default settings. - The API keys of the source index are merged with the existing keys in the destination index. - You can\'t copy the `enableReRanking`, `mode`, and `replicas` settings. - You can\'t copy to a destination index that already has replicas. - Be aware of the [size limits](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits). - Related guide: [Copy indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/copy-indices/) **Move** - Moving a source index that doesn\'t exist is ignored without returning an error. - When moving an index, the analytics data keep their original name and a new set of analytics data is started for the new name. To access the original analytics in the dashboard, create an index with the original name. - If the destination index has replicas, moving will overwrite the existing index and copy the data to the replica indices. - Related guide: [Move indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/move-indices/).
3166
+ * Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for their analytics data. - If the destination index doesn\'t exist yet, it\'ll be created. **Copy** - Copying a source index that doesn\'t exist creates a new index with 0 records and default settings. - The API keys of the source index are merged with the existing keys in the destination index. - You can\'t copy the `enableReRanking`, `mode`, and `replicas` settings. - You can\'t copy to a destination index that already has replicas. - Be aware of the [size limits](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits). - Related guide: [Copy indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/copy-indices/) **Move** - Moving a source index that doesn\'t exist is ignored without returning an error. - When moving an index, the analytics data keep their original name and a new set of analytics data is started for the new name. To access the original analytics in the dashboard, create an index with the original name. - If the destination index has replicas, moving will overwrite the existing index and copy the data to the replica indices. - Related guide: [Move indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/move-indices/).
3105
3167
  *
3106
3168
  * Required API Key ACLs:
3107
3169
  * - addObject.
@@ -235,6 +235,14 @@ function createStatefulHost(host, status = 'up') {
235
235
  };
236
236
  }
237
237
 
238
+ function _defineProperty(e, r, t) {
239
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
240
+ value: t,
241
+ enumerable: !0,
242
+ configurable: !0,
243
+ writable: !0
244
+ }) : e[r] = t, e;
245
+ }
238
246
  function _toPrimitive(t, r) {
239
247
  if ("object" != typeof t || !t) return t;
240
248
  var e = t[Symbol.toPrimitive];
@@ -249,20 +257,6 @@ function _toPropertyKey(t) {
249
257
  var i = _toPrimitive(t, "string");
250
258
  return "symbol" == typeof i ? i : i + "";
251
259
  }
252
- function _defineProperty(obj, key, value) {
253
- key = _toPropertyKey(key);
254
- if (key in obj) {
255
- Object.defineProperty(obj, key, {
256
- value: value,
257
- enumerable: true,
258
- configurable: true,
259
- writable: true
260
- });
261
- } else {
262
- obj[key] = value;
263
- }
264
- return obj;
265
- }
266
260
 
267
261
  class AlgoliaError extends Error {
268
262
  constructor(message, name) {
@@ -283,7 +277,7 @@ class ErrorWithStackTrace extends AlgoliaError {
283
277
  }
284
278
  class RetryError extends ErrorWithStackTrace {
285
279
  constructor(stackTrace) {
286
- super('Unreachable hosts - your application id may be incorrect. If the error persists, please create a ticket at https://support.algolia.com/ sharing steps we can use to reproduce the issue.', stackTrace, 'RetryError');
280
+ super('Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.', stackTrace, 'RetryError');
287
281
  }
288
282
  }
289
283
  class ApiError extends ErrorWithStackTrace {
@@ -682,7 +676,7 @@ const DEFAULT_READ_TIMEOUT_BROWSER = 2000;
682
676
  const DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;
683
677
 
684
678
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
685
- const apiClientVersion$4 = '5.0.0-beta.2';
679
+ const apiClientVersion$4 = '5.0.0-beta.4';
686
680
  const REGIONS$2 = ['de', 'us'];
687
681
  function getDefaultHosts$3(region) {
688
682
  const url = !region
@@ -987,7 +981,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
987
981
  }
988
982
 
989
983
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
990
- const apiClientVersion$3 = '5.0.0-beta.2';
984
+ const apiClientVersion$3 = '5.0.0-beta.4';
991
985
  const REGIONS$1 = ['de', 'us'];
992
986
  function getDefaultHosts$2(region) {
993
987
  const url = !region
@@ -2042,7 +2036,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
2042
2036
  }
2043
2037
 
2044
2038
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2045
- const apiClientVersion$2 = '5.0.0-beta.2';
2039
+ const apiClientVersion$2 = '5.0.0-beta.4';
2046
2040
  const REGIONS = ['eu', 'us'];
2047
2041
  function getDefaultHosts$1(region) {
2048
2042
  const url = 'personalization.{region}.algolia.com'.replace('{region}', region);
@@ -2303,7 +2297,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
2303
2297
  }
2304
2298
 
2305
2299
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2306
- const apiClientVersion$1 = '5.0.0-beta.2';
2300
+ const apiClientVersion$1 = '5.0.0-beta.4';
2307
2301
  function getDefaultHosts(appId) {
2308
2302
  return [
2309
2303
  {
@@ -2409,6 +2403,29 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
2409
2403
  timeout: () => timeout(retryCount),
2410
2404
  });
2411
2405
  },
2406
+ /**
2407
+ * Helper: Wait for an application-level task to complete for a given `taskID`.
2408
+ *
2409
+ * @summary Helper method that waits for a task to be published (completed).
2410
+ * @param waitForAppTaskOptions - The `waitForTaskOptions` object.
2411
+ * @param waitForAppTaskOptions.taskID - The `taskID` returned in the method response.
2412
+ * @param waitForAppTaskOptions.maxRetries - The maximum number of retries. 50 by default.
2413
+ * @param waitForAppTaskOptions.timeout - The function to decide how long to wait between retries.
2414
+ * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
2415
+ */
2416
+ waitForAppTask({ taskID, maxRetries = 50, timeout = (retryCount) => Math.min(retryCount * 200, 5000), }, requestOptions) {
2417
+ let retryCount = 0;
2418
+ return createIterablePromise({
2419
+ func: () => this.getAppTask({ taskID }, requestOptions),
2420
+ validate: (response) => response.status === 'published',
2421
+ aggregator: () => (retryCount += 1),
2422
+ error: {
2423
+ validate: () => retryCount >= maxRetries,
2424
+ message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,
2425
+ },
2426
+ timeout: () => timeout(retryCount),
2427
+ });
2428
+ },
2412
2429
  /**
2413
2430
  * Helper: Wait for an API key to be added, updated or deleted based on a given `operation`.
2414
2431
  *
@@ -2590,9 +2607,10 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
2590
2607
  async chunkedBatch({ indexName, objects, action = 'addObject', waitForTasks, batchSize = 1000, }, requestOptions) {
2591
2608
  let requests = [];
2592
2609
  const responses = [];
2593
- for (const [i, obj] of objects.entries()) {
2610
+ const objectEntries = objects.entries();
2611
+ for (const [i, obj] of objectEntries) {
2594
2612
  requests.push({ action, body: obj });
2595
- if (i % batchSize === 0) {
2613
+ if (requests.length === batchSize || i === objects.length - 1) {
2596
2614
  responses.push(await this.batch({ indexName, batchWriteParams: { requests } }, requestOptions));
2597
2615
  requests = [];
2598
2616
  }
@@ -2606,18 +2624,19 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
2606
2624
  },
2607
2625
  /**
2608
2626
  * Helper: Replaces all objects (records) in the given `index_name` with the given `objects`. A temporary index is created during this process in order to backup your data.
2627
+ * See https://api-clients-automation.netlify.app/docs/contributing/add-new-api-client#5-helpers for implementation details.
2609
2628
  *
2610
2629
  * @summary Helper: Replaces all objects (records) in the given `index_name` with the given `objects`. A temporary index is created during this process in order to backup your data.
2611
2630
  * @param replaceAllObjects - The `replaceAllObjects` object.
2612
2631
  * @param replaceAllObjects.indexName - The `indexName` to replace `objects` in.
2613
2632
  * @param replaceAllObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
2614
- * @param replaceAllObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
2633
+ * @param replaceAllObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `objects.length / batchSize`. Defaults to 1000.
2615
2634
  * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
2616
2635
  */
2617
2636
  async replaceAllObjects({ indexName, objects, batchSize }, requestOptions) {
2618
2637
  const randomSuffix = Math.random().toString(36).substring(7);
2619
2638
  const tmpIndexName = `${indexName}_tmp_${randomSuffix}`;
2620
- const copyOperationResponse = await this.operationIndex({
2639
+ let copyOperationResponse = await this.operationIndex({
2621
2640
  indexName,
2622
2641
  operationIndexParams: {
2623
2642
  operation: 'copy',
@@ -2625,17 +2644,29 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
2625
2644
  scope: ['settings', 'rules', 'synonyms'],
2626
2645
  },
2627
2646
  }, requestOptions);
2647
+ const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
2628
2648
  await this.waitForTask({
2649
+ indexName: tmpIndexName,
2650
+ taskID: copyOperationResponse.taskID,
2651
+ });
2652
+ copyOperationResponse = await this.operationIndex({
2629
2653
  indexName,
2654
+ operationIndexParams: {
2655
+ operation: 'copy',
2656
+ destination: tmpIndexName,
2657
+ scope: ['settings', 'rules', 'synonyms'],
2658
+ },
2659
+ }, requestOptions);
2660
+ await this.waitForTask({
2661
+ indexName: tmpIndexName,
2630
2662
  taskID: copyOperationResponse.taskID,
2631
2663
  });
2632
- const batchResponses = await this.chunkedBatch({ indexName: tmpIndexName, objects, waitForTasks: true, batchSize }, requestOptions);
2633
2664
  const moveOperationResponse = await this.operationIndex({
2634
2665
  indexName: tmpIndexName,
2635
2666
  operationIndexParams: { operation: 'move', destination: indexName },
2636
2667
  }, requestOptions);
2637
2668
  await this.waitForTask({
2638
- indexName,
2669
+ indexName: tmpIndexName,
2639
2670
  taskID: moveOperationResponse.taskID,
2640
2671
  });
2641
2672
  return { copyOperationResponse, batchResponses, moveOperationResponse };
@@ -3304,6 +3335,31 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
3304
3335
  };
3305
3336
  return transporter.request(request, requestOptions);
3306
3337
  },
3338
+ /**
3339
+ * Checks the status of a given application task.
3340
+ *
3341
+ * Required API Key ACLs:
3342
+ * - editSettings.
3343
+ *
3344
+ * @param getAppTask - The getAppTask object.
3345
+ * @param getAppTask.taskID - Unique task identifier.
3346
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
3347
+ */
3348
+ getAppTask({ taskID }, requestOptions) {
3349
+ if (!taskID) {
3350
+ throw new Error('Parameter `taskID` is required when calling `getAppTask`.');
3351
+ }
3352
+ const requestPath = '/1/task/{taskID}'.replace('{taskID}', encodeURIComponent(taskID));
3353
+ const headers = {};
3354
+ const queryParameters = {};
3355
+ const request = {
3356
+ method: 'GET',
3357
+ path: requestPath,
3358
+ queryParameters,
3359
+ headers,
3360
+ };
3361
+ return transporter.request(request, requestOptions);
3362
+ },
3307
3363
  /**
3308
3364
  * Lists supported languages with their supported dictionary types and number of custom entries.
3309
3365
  *
@@ -3778,7 +3834,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
3778
3834
  return transporter.request(request, requestOptions);
3779
3835
  },
3780
3836
  /**
3781
- * Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for index-specific API keys and analytics data. - If the destination index doesn\'t exist yet, it\'ll be created. **Copy** - Copying a source index that doesn\'t exist creates a new index with 0 records and default settings. - The API keys of the source index are merged with the existing keys in the destination index. - You can\'t copy the `enableReRanking`, `mode`, and `replicas` settings. - You can\'t copy to a destination index that already has replicas. - Be aware of the [size limits](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits). - Related guide: [Copy indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/copy-indices/) **Move** - Moving a source index that doesn\'t exist is ignored without returning an error. - When moving an index, the analytics data keep their original name and a new set of analytics data is started for the new name. To access the original analytics in the dashboard, create an index with the original name. - If the destination index has replicas, moving will overwrite the existing index and copy the data to the replica indices. - Related guide: [Move indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/move-indices/).
3837
+ * Copies or moves (renames) an index within the same Algolia application. - Existing destination indices are overwritten, except for their analytics data. - If the destination index doesn\'t exist yet, it\'ll be created. **Copy** - Copying a source index that doesn\'t exist creates a new index with 0 records and default settings. - The API keys of the source index are merged with the existing keys in the destination index. - You can\'t copy the `enableReRanking`, `mode`, and `replicas` settings. - You can\'t copy to a destination index that already has replicas. - Be aware of the [size limits](https://www.algolia.com/doc/guides/scaling/algolia-service-limits/#application-record-and-index-limits). - Related guide: [Copy indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/copy-indices/) **Move** - Moving a source index that doesn\'t exist is ignored without returning an error. - When moving an index, the analytics data keep their original name and a new set of analytics data is started for the new name. To access the original analytics in the dashboard, create an index with the original name. - If the destination index has replicas, moving will overwrite the existing index and copy the data to the replica indices. - Related guide: [Move indices](https://www.algolia.com/doc/guides/sending-and-managing-data/manage-indices-and-apps/manage-indices/how-to/move-indices/).
3782
3838
  *
3783
3839
  * Required API Key ACLs:
3784
3840
  * - addObject.