@algolia/client-search 5.0.0-alpha.1 → 5.0.0-alpha.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 (215) hide show
  1. package/dist/builds/browser.d.ts +2 -2
  2. package/dist/builds/browser.d.ts.map +1 -1
  3. package/dist/builds/node.d.ts +2 -2
  4. package/dist/builds/node.d.ts.map +1 -1
  5. package/dist/client-search.cjs.js +144 -25
  6. package/dist/client-search.esm.browser.js +172 -53
  7. package/dist/client-search.esm.node.js +145 -26
  8. package/dist/client-search.umd.js +2 -2
  9. package/dist/model/acl.d.ts +3 -0
  10. package/dist/model/acl.d.ts.map +1 -1
  11. package/dist/model/addApiKeyResponse.d.ts +1 -1
  12. package/dist/model/addApiKeyResponse.d.ts.map +1 -1
  13. package/dist/model/apiKey.d.ts.map +1 -1
  14. package/dist/model/attributeToUpdate.d.ts +3 -0
  15. package/dist/model/attributeToUpdate.d.ts.map +1 -0
  16. package/dist/model/automaticFacetFilter.d.ts.map +1 -1
  17. package/dist/model/baseGetApiKeyResponse.d.ts +11 -0
  18. package/dist/model/baseGetApiKeyResponse.d.ts.map +1 -0
  19. package/dist/model/baseIndexSettings.d.ts.map +1 -1
  20. package/dist/model/baseSearchParamsWithoutQuery.d.ts.map +1 -1
  21. package/dist/model/baseSearchResponse.d.ts +2 -2
  22. package/dist/model/baseSearchResponse.d.ts.map +1 -1
  23. package/dist/model/batchAssignUserIdsParams.d.ts.map +1 -1
  24. package/dist/model/batchDictionaryEntriesParams.d.ts.map +1 -1
  25. package/dist/model/batchDictionaryEntriesRequest.d.ts.map +1 -1
  26. package/dist/model/batchParams.d.ts +2 -2
  27. package/dist/model/batchParams.d.ts.map +1 -1
  28. package/dist/model/{batchOperation.d.ts → batchRequest.d.ts} +2 -2
  29. package/dist/model/batchRequest.d.ts.map +1 -0
  30. package/dist/model/batchResponse.d.ts.map +1 -1
  31. package/dist/model/batchWriteParams.d.ts +2 -2
  32. package/dist/model/batchWriteParams.d.ts.map +1 -1
  33. package/dist/model/browseRequest.d.ts.map +1 -1
  34. package/dist/model/browseResponse.d.ts +1 -1
  35. package/dist/model/browseResponse.d.ts.map +1 -1
  36. package/dist/model/builtInOperation.d.ts.map +1 -1
  37. package/dist/model/clientMethodProps.d.ts +21 -8
  38. package/dist/model/clientMethodProps.d.ts.map +1 -1
  39. package/dist/model/condition.d.ts.map +1 -1
  40. package/dist/model/consequence.d.ts.map +1 -1
  41. package/dist/model/consequenceQueryObject.d.ts.map +1 -1
  42. package/dist/model/deletedAtResponse.d.ts.map +1 -1
  43. package/dist/model/dictionaryEntry.d.ts.map +1 -1
  44. package/dist/model/distinct.d.ts +5 -0
  45. package/dist/model/distinct.d.ts.map +1 -0
  46. package/dist/model/edit.d.ts.map +1 -1
  47. package/dist/model/facetHits.d.ts.map +1 -1
  48. package/dist/model/facetOrdering.d.ts.map +1 -1
  49. package/dist/model/facetsStats.d.ts.map +1 -1
  50. package/dist/model/fetchedIndex.d.ts.map +1 -1
  51. package/dist/model/getApiKeyResponse.d.ts +4 -0
  52. package/dist/model/getApiKeyResponse.d.ts.map +1 -0
  53. package/dist/model/getObjectsParams.d.ts +2 -2
  54. package/dist/model/getObjectsParams.d.ts.map +1 -1
  55. package/dist/model/{multipleGetObjectsParams.d.ts → getObjectsRequest.d.ts} +2 -2
  56. package/dist/model/getObjectsRequest.d.ts.map +1 -0
  57. package/dist/model/getObjectsResponse.d.ts +2 -2
  58. package/dist/model/getObjectsResponse.d.ts.map +1 -1
  59. package/dist/model/hasPendingMappingsResponse.d.ts.map +1 -1
  60. package/dist/model/highlightResultOption.d.ts.map +1 -1
  61. package/dist/model/hit.d.ts +1 -1
  62. package/dist/model/hit.d.ts.map +1 -1
  63. package/dist/model/index.d.ts +7 -6
  64. package/dist/model/index.d.ts.map +1 -1
  65. package/dist/model/indexSettingsAsSearchParams.d.ts +2 -4
  66. package/dist/model/indexSettingsAsSearchParams.d.ts.map +1 -1
  67. package/dist/model/languages.d.ts.map +1 -1
  68. package/dist/model/listApiKeysResponse.d.ts +2 -2
  69. package/dist/model/listApiKeysResponse.d.ts.map +1 -1
  70. package/dist/model/listIndicesResponse.d.ts +1 -1
  71. package/dist/model/listIndicesResponse.d.ts.map +1 -1
  72. package/dist/model/log.d.ts.map +1 -1
  73. package/dist/model/logQuery.d.ts.map +1 -1
  74. package/dist/model/matchedGeoLocation.d.ts.map +1 -1
  75. package/dist/model/{multipleBatchOperation.d.ts → multipleBatchRequest.d.ts} +5 -5
  76. package/dist/model/multipleBatchRequest.d.ts.map +1 -0
  77. package/dist/model/multipleBatchResponse.d.ts +2 -2
  78. package/dist/model/multipleBatchResponse.d.ts.map +1 -1
  79. package/dist/model/operationIndexParams.d.ts.map +1 -1
  80. package/dist/model/params.d.ts.map +1 -1
  81. package/dist/model/personalization.d.ts.map +1 -1
  82. package/dist/model/promoteObjectID.d.ts.map +1 -1
  83. package/dist/model/promoteObjectIDs.d.ts.map +1 -1
  84. package/dist/model/rankingInfo.d.ts.map +1 -1
  85. package/dist/model/rule.d.ts.map +1 -1
  86. package/dist/model/saveObjectResponse.d.ts +2 -2
  87. package/dist/model/saveObjectResponse.d.ts.map +1 -1
  88. package/dist/model/saveSynonymResponse.d.ts.map +1 -1
  89. package/dist/model/searchDictionaryEntriesParams.d.ts.map +1 -1
  90. package/dist/model/searchForFacetValuesRequest.d.ts.map +1 -1
  91. package/dist/model/searchForFacetsOptions.d.ts.map +1 -1
  92. package/dist/model/searchForHitsOptions.d.ts.map +1 -1
  93. package/dist/model/searchHits.d.ts +2 -2
  94. package/dist/model/searchHits.d.ts.map +1 -1
  95. package/dist/model/searchMethodParams.d.ts.map +1 -1
  96. package/dist/model/searchResponse.d.ts +1 -1
  97. package/dist/model/searchResponse.d.ts.map +1 -1
  98. package/dist/model/searchResponses.d.ts +1 -1
  99. package/dist/model/searchResponses.d.ts.map +1 -1
  100. package/dist/model/searchRulesParams.d.ts.map +1 -1
  101. package/dist/model/searchRulesResponse.d.ts.map +1 -1
  102. package/dist/model/searchSynonymsResponse.d.ts.map +1 -1
  103. package/dist/model/searchUserIdsParams.d.ts.map +1 -1
  104. package/dist/model/searchUserIdsResponse.d.ts.map +1 -1
  105. package/dist/model/snippetResultOption.d.ts.map +1 -1
  106. package/dist/model/source.d.ts.map +1 -1
  107. package/dist/model/standardEntries.d.ts.map +1 -1
  108. package/dist/model/synonymHit.d.ts.map +1 -1
  109. package/dist/model/synonymHitHighlightResult.d.ts.map +1 -1
  110. package/dist/model/timeRange.d.ts.map +1 -1
  111. package/dist/model/updateApiKeyResponse.d.ts +1 -1
  112. package/dist/model/updateApiKeyResponse.d.ts.map +1 -1
  113. package/dist/model/updatedAtResponse.d.ts.map +1 -1
  114. package/dist/model/updatedAtWithObjectIdResponse.d.ts.map +1 -1
  115. package/dist/model/updatedRuleResponse.d.ts.map +1 -1
  116. package/dist/model/userHighlightResult.d.ts.map +1 -1
  117. package/dist/model/userHit.d.ts.map +1 -1
  118. package/dist/model/userId.d.ts.map +1 -1
  119. package/dist/model/value.d.ts.map +1 -1
  120. package/dist/src/searchClient.d.ts +65 -15
  121. package/dist/src/searchClient.d.ts.map +1 -1
  122. package/model/acl.ts +3 -0
  123. package/model/addApiKeyResponse.ts +2 -1
  124. package/model/apiKey.ts +7 -0
  125. package/model/{attributeOrBuiltInOperation.ts → attributeToUpdate.ts} +1 -1
  126. package/model/automaticFacetFilter.ts +2 -0
  127. package/model/baseGetApiKeyResponse.ts +13 -0
  128. package/model/baseIndexSettings.ts +13 -0
  129. package/model/baseSearchParamsWithoutQuery.ts +32 -0
  130. package/model/baseSearchResponse.ts +26 -2
  131. package/model/batchAssignUserIdsParams.ts +1 -0
  132. package/model/batchDictionaryEntriesParams.ts +1 -0
  133. package/model/batchDictionaryEntriesRequest.ts +1 -0
  134. package/model/batchParams.ts +2 -2
  135. package/model/{batchOperation.ts → batchRequest.ts} +2 -1
  136. package/model/batchResponse.ts +1 -0
  137. package/model/batchWriteParams.ts +2 -2
  138. package/model/browseRequest.ts +1 -0
  139. package/model/browseResponse.ts +1 -1
  140. package/model/builtInOperation.ts +1 -0
  141. package/model/clientMethodProps.ts +28 -12
  142. package/model/condition.ts +3 -0
  143. package/model/consequence.ts +4 -0
  144. package/model/consequenceQueryObject.ts +1 -0
  145. package/model/deletedAtResponse.ts +1 -0
  146. package/model/dictionaryEntry.ts +5 -0
  147. package/model/{createdAtObject.ts → distinct.ts} +4 -6
  148. package/model/edit.ts +2 -0
  149. package/model/facetHits.ts +2 -0
  150. package/model/facetOrdering.ts +1 -0
  151. package/model/facetsStats.ts +3 -0
  152. package/model/fetchedIndex.ts +10 -0
  153. package/model/{key.ts → getApiKeyResponse.ts} +2 -2
  154. package/model/getObjectsParams.ts +2 -2
  155. package/model/{multipleGetObjectsParams.ts → getObjectsRequest.ts} +3 -1
  156. package/model/getObjectsResponse.ts +2 -2
  157. package/model/hasPendingMappingsResponse.ts +1 -0
  158. package/model/highlightResultOption.ts +3 -0
  159. package/model/hit.ts +5 -1
  160. package/model/index.ts +7 -6
  161. package/model/indexSettingsAsSearchParams.ts +43 -4
  162. package/model/languages.ts +2 -0
  163. package/model/listApiKeysResponse.ts +2 -2
  164. package/model/listIndicesResponse.ts +2 -1
  165. package/model/log.ts +14 -0
  166. package/model/logQuery.ts +2 -0
  167. package/model/matchedGeoLocation.ts +2 -0
  168. package/model/{multipleBatchOperation.ts → multipleBatchRequest.ts} +6 -4
  169. package/model/multipleBatchResponse.ts +3 -2
  170. package/model/operationIndexParams.ts +2 -0
  171. package/model/params.ts +3 -0
  172. package/model/personalization.ts +2 -0
  173. package/model/promoteObjectID.ts +1 -0
  174. package/model/promoteObjectIDs.ts +1 -0
  175. package/model/rankingInfo.ts +12 -0
  176. package/model/rule.ts +5 -0
  177. package/model/saveObjectResponse.ts +4 -2
  178. package/model/saveSynonymResponse.ts +2 -0
  179. package/model/searchDictionaryEntriesParams.ts +3 -0
  180. package/model/searchForFacetValuesRequest.ts +2 -0
  181. package/model/searchForFacetsOptions.ts +4 -0
  182. package/model/searchForHitsOptions.ts +1 -0
  183. package/model/searchHits.ts +2 -2
  184. package/model/searchMethodParams.ts +1 -0
  185. package/model/searchResponse.ts +2 -1
  186. package/model/searchResponses.ts +1 -1
  187. package/model/searchRulesParams.ts +6 -0
  188. package/model/searchRulesResponse.ts +3 -0
  189. package/model/searchSynonymsResponse.ts +1 -0
  190. package/model/searchUserIdsParams.ts +3 -0
  191. package/model/searchUserIdsResponse.ts +4 -0
  192. package/model/snippetResultOption.ts +1 -0
  193. package/model/source.ts +1 -0
  194. package/model/standardEntries.ts +2 -0
  195. package/model/synonymHit.ts +8 -0
  196. package/model/synonymHitHighlightResult.ts +1 -0
  197. package/model/timeRange.ts +1 -0
  198. package/model/updateApiKeyResponse.ts +2 -1
  199. package/model/updatedAtResponse.ts +1 -0
  200. package/model/updatedAtWithObjectIdResponse.ts +2 -0
  201. package/model/updatedRuleResponse.ts +2 -0
  202. package/model/userHighlightResult.ts +1 -0
  203. package/model/userHit.ts +5 -0
  204. package/model/userId.ts +3 -0
  205. package/model/value.ts +1 -0
  206. package/package.json +5 -5
  207. package/dist/model/attributeOrBuiltInOperation.d.ts +0 -3
  208. package/dist/model/attributeOrBuiltInOperation.d.ts.map +0 -1
  209. package/dist/model/batchOperation.d.ts.map +0 -1
  210. package/dist/model/createdAtObject.d.ts +0 -7
  211. package/dist/model/createdAtObject.d.ts.map +0 -1
  212. package/dist/model/key.d.ts +0 -4
  213. package/dist/model/key.d.ts.map +0 -1
  214. package/dist/model/multipleBatchOperation.d.ts.map +0 -1
  215. package/dist/model/multipleGetObjectsParams.d.ts.map +0 -1
@@ -8,97 +8,121 @@ export type BaseSearchResponse = {
8
8
  * If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID.
9
9
  */
10
10
  abTestID?: number;
11
+
11
12
  /**
12
- * If a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used.
13
+ * If a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used (starting at 1).
13
14
  */
14
15
  abTestVariantID?: number;
16
+
15
17
  /**
16
18
  * The computed geo location.
17
19
  */
18
20
  aroundLatLng?: string;
21
+
19
22
  /**
20
23
  * The automatically computed radius. For legacy reasons, this parameter is a string and not an integer.
21
24
  */
22
25
  automaticRadius?: string;
26
+
23
27
  /**
24
28
  * Whether the facet count is exhaustive or approximate.
25
29
  */
26
30
  exhaustiveFacetsCount?: boolean;
31
+
27
32
  /**
28
33
  * Indicate if the nbHits count was exhaustive or approximate.
29
34
  */
30
35
  exhaustiveNbHits: boolean;
36
+
31
37
  /**
32
38
  * Indicate if the typo-tolerance search was exhaustive or approximate (only included when typo-tolerance is enabled).
33
39
  */
34
40
  exhaustiveTypo: boolean;
41
+
35
42
  /**
36
43
  * A mapping of each facet name to the corresponding facet counts.
37
44
  */
38
- facets?: Record<string, Record<string, string>>;
45
+ facets?: Record<string, Record<string, number>>;
46
+
39
47
  /**
40
48
  * Statistics for numerical facets.
41
49
  */
42
50
  facets_stats?: Record<string, FacetsStats>;
51
+
43
52
  /**
44
53
  * Set the number of hits per page.
45
54
  */
46
55
  hitsPerPage: number;
56
+
47
57
  /**
48
58
  * Index name used for the query.
49
59
  */
50
60
  index?: string;
61
+
51
62
  /**
52
63
  * Index name used for the query. In the case of an A/B test, the targeted index isn\'t always the index used by the query.
53
64
  */
54
65
  indexUsed?: string;
66
+
55
67
  /**
56
68
  * Used to return warnings about the query.
57
69
  */
58
70
  message?: string;
71
+
59
72
  /**
60
73
  * Number of hits that the search query matched.
61
74
  */
62
75
  nbHits: number;
76
+
63
77
  /**
64
78
  * Number of pages available for the current query.
65
79
  */
66
80
  nbPages: number;
81
+
67
82
  /**
68
83
  * The number of hits selected and sorted by the relevant sort algorithm.
69
84
  */
70
85
  nbSortedHits?: number;
86
+
71
87
  /**
72
88
  * Specify the page to retrieve.
73
89
  */
74
90
  page: number;
91
+
75
92
  /**
76
93
  * A url-encoded string of all search parameters.
77
94
  */
78
95
  params: string;
96
+
79
97
  /**
80
98
  * The query string that will be searched, after normalization.
81
99
  */
82
100
  parsedQuery?: string;
101
+
83
102
  /**
84
103
  * Time the server took to process the request, in milliseconds.
85
104
  */
86
105
  processingTimeMS: number;
106
+
87
107
  /**
88
108
  * The text to search in the index.
89
109
  */
90
110
  query: string;
111
+
91
112
  /**
92
113
  * A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set.
93
114
  */
94
115
  queryAfterRemoval?: string;
116
+
95
117
  /**
96
118
  * Actual host name of the server that processed the request.
97
119
  */
98
120
  serverUsed?: string;
121
+
99
122
  /**
100
123
  * Lets you store custom data in your indices.
101
124
  */
102
125
  userData?: Record<string, any>;
126
+
103
127
  renderingContent?: RenderingContent;
104
128
  };
@@ -8,6 +8,7 @@ export type BatchAssignUserIdsParams = {
8
8
  * Name of the cluster.
9
9
  */
10
10
  cluster: string;
11
+
11
12
  /**
12
13
  * UserIDs to assign. Note you cannot move users with this method.
13
14
  */
@@ -10,6 +10,7 @@ export type BatchDictionaryEntriesParams = {
10
10
  * When `true`, start the batch by removing all the custom entries from the dictionary.
11
11
  */
12
12
  clearExistingDictionaryEntries?: boolean;
13
+
13
14
  /**
14
15
  * List of operations to batch. Each operation is described by an `action` and a `body`.
15
16
  */
@@ -5,5 +5,6 @@ import type { DictionaryEntry } from './dictionaryEntry';
5
5
 
6
6
  export type BatchDictionaryEntriesRequest = {
7
7
  action: DictionaryAction;
8
+
8
9
  body: DictionaryEntry;
9
10
  };
@@ -1,10 +1,10 @@
1
1
  // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2
2
 
3
- import type { MultipleBatchOperation } from './multipleBatchOperation';
3
+ import type { MultipleBatchRequest } from './multipleBatchRequest';
4
4
 
5
5
  /**
6
6
  * The `multipleBatch` parameters.
7
7
  */
8
8
  export type BatchParams = {
9
- requests?: MultipleBatchOperation[];
9
+ requests: MultipleBatchRequest[];
10
10
  };
@@ -2,8 +2,9 @@
2
2
 
3
3
  import type { Action } from './action';
4
4
 
5
- export type BatchOperation = {
5
+ export type BatchRequest = {
6
6
  action?: Action;
7
+
7
8
  /**
8
9
  * Arguments to the operation (depends on the type of the operation).
9
10
  */
@@ -5,6 +5,7 @@ export type BatchResponse = {
5
5
  * TaskID of the task to wait for.
6
6
  */
7
7
  taskID: number;
8
+
8
9
  /**
9
10
  * List of objectID.
10
11
  */
@@ -1,10 +1,10 @@
1
1
  // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2
2
 
3
- import type { BatchOperation } from './batchOperation';
3
+ import type { BatchRequest } from './batchRequest';
4
4
 
5
5
  /**
6
6
  * The `batch` parameters.
7
7
  */
8
8
  export type BatchWriteParams = {
9
- requests?: BatchOperation[];
9
+ requests?: BatchRequest[];
10
10
  };
@@ -5,6 +5,7 @@ export type BrowseRequest = {
5
5
  * Search parameters as URL-encoded query string.
6
6
  */
7
7
  params?: string;
8
+
8
9
  /**
9
10
  * Cursor indicating the location to resume browsing from. Must match the value returned by the previous call.
10
11
  */
@@ -4,6 +4,6 @@ import type { BaseBrowseResponse } from './baseBrowseResponse';
4
4
  import type { BaseSearchResponse } from './baseSearchResponse';
5
5
  import type { SearchHits } from './searchHits';
6
6
 
7
- export type BrowseResponse<T> = BaseBrowseResponse &
7
+ export type BrowseResponse<T = Record<string, any>> = BaseBrowseResponse &
8
8
  BaseSearchResponse &
9
9
  SearchHits<T>;
@@ -7,6 +7,7 @@ import type { BuiltInOperationType } from './builtInOperationType';
7
7
  */
8
8
  export type BuiltInOperation = {
9
9
  _operation: BuiltInOperationType;
10
+
10
11
  /**
11
12
  * The right-hand side argument to the operation, for example, increment or decrement step, value to add or remove.
12
13
  */
@@ -1,18 +1,18 @@
1
1
  // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2
2
 
3
- import type { CreateRetryablePromiseOptions } from '@algolia/client-common';
3
+ import type { CreateIterablePromise } from '@algolia/client-common';
4
4
 
5
5
  import type { ApiKey } from './apiKey';
6
6
  import type { AssignUserIdParams } from './assignUserIdParams';
7
- import type { AttributeOrBuiltInOperation } from './attributeOrBuiltInOperation';
7
+ import type { AttributeToUpdate } from './attributeToUpdate';
8
8
  import type { BatchAssignUserIdsParams } from './batchAssignUserIdsParams';
9
9
  import type { BatchDictionaryEntriesParams } from './batchDictionaryEntriesParams';
10
10
  import type { BatchWriteParams } from './batchWriteParams';
11
11
  import type { BrowseRequest } from './browseRequest';
12
12
  import type { DictionaryType } from './dictionaryType';
13
+ import type { GetApiKeyResponse } from './getApiKeyResponse';
13
14
  import type { GetTaskResponse } from './getTaskResponse';
14
15
  import type { IndexSettings } from './indexSettings';
15
- import type { Key } from './key';
16
16
  import type { LogType } from './logType';
17
17
  import type { OperationIndexParams } from './operationIndexParams';
18
18
  import type { Rule } from './rule';
@@ -430,9 +430,7 @@ export type PartialUpdateObjectProps = {
430
430
  /**
431
431
  * List of attributes to update.
432
432
  */
433
- attributeOrBuiltInOperation: Array<
434
- Record<string, AttributeOrBuiltInOperation>
435
- >;
433
+ attributeToUpdate: Array<Record<string, AttributeToUpdate>>;
436
434
  /**
437
435
  * Creates the record if it does not exist yet.
438
436
  */
@@ -661,7 +659,7 @@ export type SearchRulesProps = {
661
659
  * The index in which to perform the request.
662
660
  */
663
661
  indexName: string;
664
- searchRulesParams: SearchRulesParams;
662
+ searchRulesParams?: SearchRulesParams;
665
663
  };
666
664
 
667
665
  /**
@@ -672,7 +670,7 @@ export type SearchSingleIndexProps = {
672
670
  * The index in which to perform the request.
673
671
  */
674
672
  indexName: string;
675
- searchParams: SearchParams;
673
+ searchParams?: SearchParams;
676
674
  };
677
675
 
678
676
  /**
@@ -727,10 +725,28 @@ export type UpdateApiKeyProps = {
727
725
  apiKey: ApiKey;
728
726
  };
729
727
 
728
+ /**
729
+ * The `browseObjects`, `browseRules`, `browseSynonyms` options.
730
+ */
731
+ export type BrowseOptions<T> = Partial<
732
+ Pick<CreateIterablePromise<T>, 'validate'>
733
+ > &
734
+ Required<Pick<CreateIterablePromise<T>, 'aggregator'>>;
735
+
730
736
  type WaitForOptions<T> = Omit<
731
- CreateRetryablePromiseOptions<T>,
732
- 'func' | 'validate'
733
- >;
737
+ CreateIterablePromise<T>,
738
+ 'func' | 'timeout' | 'validate'
739
+ > & {
740
+ /**
741
+ * The maximum number of retries. 50 by default.
742
+ */
743
+ maxRetries: number;
744
+
745
+ /**
746
+ * The function to decide how long to wait between retries.
747
+ */
748
+ timeout: (retryCount: number) => number;
749
+ };
734
750
 
735
751
  export type WaitForTaskOptions = WaitForOptions<GetTaskResponse> & {
736
752
  /**
@@ -743,7 +759,7 @@ export type WaitForTaskOptions = WaitForOptions<GetTaskResponse> & {
743
759
  taskID: number;
744
760
  };
745
761
 
746
- export type WaitForApiKeyOptions = WaitForOptions<Key> & {
762
+ export type WaitForApiKeyOptions = WaitForOptions<GetApiKeyResponse> & {
747
763
  /**
748
764
  * The API Key.
749
765
  */
@@ -7,11 +7,14 @@ export type Condition = {
7
7
  * Query pattern syntax.
8
8
  */
9
9
  pattern?: string;
10
+
10
11
  anchoring?: Anchoring;
12
+
11
13
  /**
12
14
  * Whether the pattern matches on plurals, synonyms, and typos.
13
15
  */
14
16
  alternatives?: boolean;
17
+
15
18
  /**
16
19
  * Rule context format: [A-Za-z0-9_-]+).
17
20
  */
@@ -9,18 +9,22 @@ import type { Promote } from './promote';
9
9
  */
10
10
  export type Consequence = {
11
11
  params?: ConsequenceParams;
12
+
12
13
  /**
13
14
  * Objects to promote as hits.
14
15
  */
15
16
  promote?: Promote[];
17
+
16
18
  /**
17
19
  * Only use in combination with the promote consequence. When true, promoted results will be restricted to match the filters of the current search. When false, the promoted results will show up regardless of the filters.
18
20
  */
19
21
  filterPromotes?: boolean;
22
+
20
23
  /**
21
24
  * Objects to hide from hits. Each object must contain an objectID field. By default, you can hide up to 50 items per rule.
22
25
  */
23
26
  hide?: ConsequenceHide[];
27
+
24
28
  /**
25
29
  * Custom JSON object that will be appended to the userData array in the response. This object isn\'t interpreted by the API. It\'s limited to 1kB of minified JSON.
26
30
  */
@@ -7,6 +7,7 @@ export type ConsequenceQueryObject = {
7
7
  * Words to remove.
8
8
  */
9
9
  remove?: string[];
10
+
10
11
  /**
11
12
  * Edits to apply.
12
13
  */
@@ -8,6 +8,7 @@ export type DeletedAtResponse = {
8
8
  * TaskID of the task to wait for.
9
9
  */
10
10
  taskID: number;
11
+
11
12
  /**
12
13
  * Date of deletion (ISO-8601 format).
13
14
  */
@@ -10,21 +10,26 @@ export type DictionaryEntry = Record<string, any> & {
10
10
  * Unique identifier of the object.
11
11
  */
12
12
  objectID: string;
13
+
13
14
  /**
14
15
  * Language ISO code supported by the dictionary (e.g., \"en\" for English).
15
16
  */
16
17
  language: string;
18
+
17
19
  /**
18
20
  * The word of the dictionary entry.
19
21
  */
20
22
  word?: string;
23
+
21
24
  /**
22
25
  * The words of the dictionary entry.
23
26
  */
24
27
  words?: string[];
28
+
25
29
  /**
26
30
  * A decomposition of the word of the dictionary entry.
27
31
  */
28
32
  decomposition?: string[];
33
+
29
34
  state?: DictionaryEntryState;
30
35
  };
@@ -1,8 +1,6 @@
1
1
  // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2
2
 
3
- export type CreatedAtObject = {
4
- /**
5
- * Date of creation (ISO-8601 format).
6
- */
7
- createdAt: string;
8
- };
3
+ /**
4
+ * Enables de-duplication or grouping of results.
5
+ */
6
+ export type Distinct = boolean | number;
package/model/edit.ts CHANGED
@@ -4,10 +4,12 @@ import type { EditType } from './editType';
4
4
 
5
5
  export type Edit = {
6
6
  type?: EditType;
7
+
7
8
  /**
8
9
  * Text or patterns to remove from the query string.
9
10
  */
10
11
  delete?: string;
12
+
11
13
  /**
12
14
  * Text that should be inserted in place of the removed text inside the query string.
13
15
  */
@@ -5,10 +5,12 @@ export type FacetHits = {
5
5
  * Raw value of the facet.
6
6
  */
7
7
  value: string;
8
+
8
9
  /**
9
10
  * Markup text with occurrences highlighted.
10
11
  */
11
12
  highlighted: string;
13
+
12
14
  /**
13
15
  * How many objects contain this facet value. This takes into account the extra search parameters specified in the query. Like for a regular search query, the counts may not be exhaustive.
14
16
  */
@@ -8,6 +8,7 @@ import type { Value } from './value';
8
8
  */
9
9
  export type FacetOrdering = {
10
10
  facets?: Facets;
11
+
11
12
  /**
12
13
  * The ordering of facet values, within an individual list.
13
14
  */
@@ -5,14 +5,17 @@ export type FacetsStats = {
5
5
  * The minimum value in the result set.
6
6
  */
7
7
  min?: number;
8
+
8
9
  /**
9
10
  * The maximum value in the result set.
10
11
  */
11
12
  max?: number;
13
+
12
14
  /**
13
15
  * The average facet value in the result set.
14
16
  */
15
17
  avg?: number;
18
+
16
19
  /**
17
20
  * The sum of all values in the result set.
18
21
  */
@@ -5,42 +5,52 @@ export type FetchedIndex = {
5
5
  * Index name.
6
6
  */
7
7
  name: string;
8
+
8
9
  /**
9
10
  * Index creation date. An empty string means that the index has no records.
10
11
  */
11
12
  createdAt: string;
13
+
12
14
  /**
13
15
  * Date of last update (ISO-8601 format).
14
16
  */
15
17
  updatedAt: string;
18
+
16
19
  /**
17
20
  * Number of records contained in the index.
18
21
  */
19
22
  entries: number;
23
+
20
24
  /**
21
25
  * Number of bytes of the index in minified format.
22
26
  */
23
27
  dataSize: number;
28
+
24
29
  /**
25
30
  * Number of bytes of the index binary file.
26
31
  */
27
32
  fileSize: number;
33
+
28
34
  /**
29
35
  * Last build time.
30
36
  */
31
37
  lastBuildTimeS: number;
38
+
32
39
  /**
33
40
  * Number of pending indexing operations. This value is deprecated and should not be used.
34
41
  */
35
42
  numberOfPendingTask?: number;
43
+
36
44
  /**
37
45
  * A boolean which says whether the index has pending tasks. This value is deprecated and should not be used.
38
46
  */
39
47
  pendingTask: boolean;
48
+
40
49
  /**
41
50
  * Only present if the index is a replica. Contains the name of the related primary index.
42
51
  */
43
52
  primary?: string;
53
+
44
54
  /**
45
55
  * Only present if the index is a primary index with replicas. Contains the names of all linked replicas.
46
56
  */
@@ -1,6 +1,6 @@
1
1
  // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2
2
 
3
3
  import type { ApiKey } from './apiKey';
4
- import type { CreatedAtObject } from './createdAtObject';
4
+ import type { BaseGetApiKeyResponse } from './baseGetApiKeyResponse';
5
5
 
6
- export type Key = ApiKey & CreatedAtObject;
6
+ export type GetApiKeyResponse = ApiKey & BaseGetApiKeyResponse;
@@ -1,10 +1,10 @@
1
1
  // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2
2
 
3
- import type { MultipleGetObjectsParams } from './multipleGetObjectsParams';
3
+ import type { GetObjectsRequest } from './getObjectsRequest';
4
4
 
5
5
  /**
6
6
  * The `getObjects` parameters.
7
7
  */
8
8
  export type GetObjectsParams = {
9
- requests?: MultipleGetObjectsParams[];
9
+ requests: GetObjectsRequest[];
10
10
  };
@@ -3,15 +3,17 @@
3
3
  /**
4
4
  * GetObjects operation on an index.
5
5
  */
6
- export type MultipleGetObjectsParams = {
6
+ export type GetObjectsRequest = {
7
7
  /**
8
8
  * List of attributes to retrieve. By default, all retrievable attributes are returned.
9
9
  */
10
10
  attributesToRetrieve?: string[];
11
+
11
12
  /**
12
13
  * ID of the object within that index.
13
14
  */
14
15
  objectID: string;
16
+
15
17
  /**
16
18
  * Name of the index containing the object.
17
19
  */
@@ -1,8 +1,8 @@
1
1
  // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2
2
 
3
- export type GetObjectsResponse = {
3
+ export type GetObjectsResponse<T = Record<string, any>> = {
4
4
  /**
5
5
  * List of results fetched.
6
6
  */
7
- results?: Array<Record<string, any>>;
7
+ results: T[];
8
8
  };
@@ -5,6 +5,7 @@ export type HasPendingMappingsResponse = {
5
5
  * If there is any clusters with pending mapping state.
6
6
  */
7
7
  pending: boolean;
8
+
8
9
  /**
9
10
  * Describe cluster pending (migrating, creating, deleting) mapping state.
10
11
  */
@@ -10,11 +10,14 @@ export type HighlightResultOption = {
10
10
  * Markup text with occurrences highlighted.
11
11
  */
12
12
  value: string;
13
+
13
14
  matchLevel: MatchLevel;
15
+
14
16
  /**
15
17
  * List of words from the query that matched the object.
16
18
  */
17
19
  matchedWords: string[];
20
+
18
21
  /**
19
22
  * Whether the entire attribute value is highlighted.
20
23
  */
package/model/hit.ts CHANGED
@@ -7,19 +7,23 @@ import type { SnippetResult } from './snippetResult';
7
7
  /**
8
8
  * A single hit.
9
9
  */
10
- export type Hit<T> = T & {
10
+ export type Hit<T = Record<string, any>> = T & {
11
11
  /**
12
12
  * Unique identifier of the object.
13
13
  */
14
14
  objectID: string;
15
+
15
16
  /**
16
17
  * Show highlighted section and words matched on a query.
17
18
  */
18
19
  _highlightResult?: Record<string, HighlightResult>;
20
+
19
21
  /**
20
22
  * Snippeted attributes show parts of the matched attributes. Only returned when attributesToSnippet is non-empty.
21
23
  */
22
24
  _snippetResult?: Record<string, SnippetResult>;
25
+
23
26
  _rankingInfo?: RankingInfo;
27
+
24
28
  _distinctSeqID?: number;
25
29
  };