@algolia/client-search 5.0.0-alpha.3 → 5.0.0-alpha.6

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 (60) hide show
  1. package/dist/client-search.cjs.js +148 -26
  2. package/dist/client-search.esm.browser.js +176 -54
  3. package/dist/client-search.esm.node.js +149 -27
  4. package/dist/client-search.umd.js +2 -2
  5. package/dist/model/acl.d.ts +3 -0
  6. package/dist/model/acl.d.ts.map +1 -1
  7. package/dist/model/addApiKeyResponse.d.ts +1 -1
  8. package/dist/model/attributeToUpdate.d.ts +3 -0
  9. package/dist/model/attributeToUpdate.d.ts.map +1 -0
  10. package/dist/model/baseBrowseResponse.d.ts +1 -1
  11. package/dist/model/baseBrowseResponse.d.ts.map +1 -1
  12. package/dist/model/baseGetApiKeyResponse.d.ts +11 -0
  13. package/dist/model/baseGetApiKeyResponse.d.ts.map +1 -0
  14. package/dist/model/baseSearchResponse.d.ts +1 -1
  15. package/dist/model/baseSearchResponse.d.ts.map +1 -1
  16. package/dist/model/batchParams.d.ts +1 -1
  17. package/dist/model/batchParams.d.ts.map +1 -1
  18. package/dist/model/clientMethodProps.d.ts +22 -11
  19. package/dist/model/clientMethodProps.d.ts.map +1 -1
  20. package/dist/model/getApiKeyResponse.d.ts +4 -0
  21. package/dist/model/getApiKeyResponse.d.ts.map +1 -0
  22. package/dist/model/getObjectsParams.d.ts +1 -1
  23. package/dist/model/getObjectsParams.d.ts.map +1 -1
  24. package/dist/model/index.d.ts +3 -3
  25. package/dist/model/index.d.ts.map +1 -1
  26. package/dist/model/indexSettingsAsSearchParams.d.ts +4 -0
  27. package/dist/model/indexSettingsAsSearchParams.d.ts.map +1 -1
  28. package/dist/model/listApiKeysResponse.d.ts +2 -2
  29. package/dist/model/listApiKeysResponse.d.ts.map +1 -1
  30. package/dist/model/multipleBatchRequest.d.ts +3 -3
  31. package/dist/model/multipleBatchRequest.d.ts.map +1 -1
  32. package/dist/model/multipleBatchResponse.d.ts +2 -2
  33. package/dist/model/multipleBatchResponse.d.ts.map +1 -1
  34. package/dist/model/updateApiKeyResponse.d.ts +1 -1
  35. package/dist/src/searchClient.d.ts +64 -17
  36. package/dist/src/searchClient.d.ts.map +1 -1
  37. package/model/acl.ts +3 -0
  38. package/model/addApiKeyResponse.ts +1 -1
  39. package/model/{attributeOrBuiltInOperation.ts → attributeToUpdate.ts} +1 -1
  40. package/model/baseBrowseResponse.ts +1 -1
  41. package/model/baseGetApiKeyResponse.ts +13 -0
  42. package/model/baseSearchResponse.ts +1 -1
  43. package/model/batchParams.ts +1 -1
  44. package/model/clientMethodProps.ts +27 -16
  45. package/model/{key.ts → getApiKeyResponse.ts} +2 -2
  46. package/model/getObjectsParams.ts +1 -1
  47. package/model/index.ts +3 -3
  48. package/model/indexSettingsAsSearchParams.ts +5 -0
  49. package/model/listApiKeysResponse.ts +2 -2
  50. package/model/multipleBatchRequest.ts +3 -3
  51. package/model/multipleBatchResponse.ts +2 -2
  52. package/model/updateApiKeyResponse.ts +1 -1
  53. package/package.json +5 -5
  54. package/dist/model/attributeOrBuiltInOperation.d.ts +0 -3
  55. package/dist/model/attributeOrBuiltInOperation.d.ts.map +0 -1
  56. package/dist/model/createdAtObject.d.ts +0 -7
  57. package/dist/model/createdAtObject.d.ts.map +0 -1
  58. package/dist/model/key.d.ts +0 -4
  59. package/dist/model/key.d.ts.map +0 -1
  60. package/model/createdAtObject.ts +0 -8
@@ -1,18 +1,16 @@
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 { GetTaskResponse } from './getTaskResponse';
14
13
  import type { IndexSettings } from './indexSettings';
15
- import type { Key } from './key';
16
14
  import type { LogType } from './logType';
17
15
  import type { OperationIndexParams } from './operationIndexParams';
18
16
  import type { Rule } from './rule';
@@ -428,11 +426,9 @@ export type PartialUpdateObjectProps = {
428
426
  */
429
427
  objectID: string;
430
428
  /**
431
- * List of attributes to update.
429
+ * Map of attribute(s) to update.
432
430
  */
433
- attributeOrBuiltInOperation: Array<
434
- Record<string, AttributeOrBuiltInOperation>
435
- >;
431
+ attributesToUpdate: Record<string, AttributeToUpdate>;
436
432
  /**
437
433
  * Creates the record if it does not exist yet.
438
434
  */
@@ -546,7 +542,7 @@ export type SaveRulesProps = {
546
542
  * The index in which to perform the request.
547
543
  */
548
544
  indexName: string;
549
- rule: Rule[];
545
+ rules: Rule[];
550
546
  /**
551
547
  * When true, changes are also propagated to replicas of the given indexName.
552
548
  */
@@ -661,7 +657,7 @@ export type SearchRulesProps = {
661
657
  * The index in which to perform the request.
662
658
  */
663
659
  indexName: string;
664
- searchRulesParams: SearchRulesParams;
660
+ searchRulesParams?: SearchRulesParams;
665
661
  };
666
662
 
667
663
  /**
@@ -727,12 +723,27 @@ export type UpdateApiKeyProps = {
727
723
  apiKey: ApiKey;
728
724
  };
729
725
 
730
- type WaitForOptions<T> = Omit<
731
- CreateRetryablePromiseOptions<T>,
732
- 'func' | 'validate'
733
- >;
726
+ /**
727
+ * The `browseObjects`, `browseRules`, `browseSynonyms` options.
728
+ */
729
+ export type BrowseOptions<T> = Partial<
730
+ Pick<CreateIterablePromise<T>, 'validate'>
731
+ > &
732
+ Required<Pick<CreateIterablePromise<T>, 'aggregator'>>;
733
+
734
+ type WaitForOptions = Partial<{
735
+ /**
736
+ * The maximum number of retries. 50 by default.
737
+ */
738
+ maxRetries: number;
739
+
740
+ /**
741
+ * The function to decide how long to wait between retries.
742
+ */
743
+ timeout: (retryCount: number) => number;
744
+ }>;
734
745
 
735
- export type WaitForTaskOptions = WaitForOptions<GetTaskResponse> & {
746
+ export type WaitForTaskOptions = WaitForOptions & {
736
747
  /**
737
748
  * The `indexName` where the operation was performed.
738
749
  */
@@ -743,7 +754,7 @@ export type WaitForTaskOptions = WaitForOptions<GetTaskResponse> & {
743
754
  taskID: number;
744
755
  };
745
756
 
746
- export type WaitForApiKeyOptions = WaitForOptions<Key> & {
757
+ export type WaitForApiKeyOptions = WaitForOptions & {
747
758
  /**
748
759
  * The API Key.
749
760
  */
@@ -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;
@@ -6,5 +6,5 @@ import type { GetObjectsRequest } from './getObjectsRequest';
6
6
  * The `getObjects` parameters.
7
7
  */
8
8
  export type GetObjectsParams = {
9
- requests?: GetObjectsRequest[];
9
+ requests: GetObjectsRequest[];
10
10
  };
package/model/index.ts CHANGED
@@ -10,10 +10,11 @@ export * from './apiKey';
10
10
  export * from './aroundRadius';
11
11
  export * from './aroundRadiusAll';
12
12
  export * from './assignUserIdParams';
13
- export * from './attributeOrBuiltInOperation';
13
+ export * from './attributeToUpdate';
14
14
  export * from './automaticFacetFilter';
15
15
  export * from './automaticFacetFilters';
16
16
  export * from './baseBrowseResponse';
17
+ export * from './baseGetApiKeyResponse';
17
18
  export * from './baseIndexSettings';
18
19
  export * from './baseSearchParams';
19
20
  export * from './baseSearchParamsWithoutQuery';
@@ -35,7 +36,6 @@ export * from './consequenceHide';
35
36
  export * from './consequenceParams';
36
37
  export * from './consequenceQuery';
37
38
  export * from './consequenceQueryObject';
38
- export * from './createdAtObject';
39
39
  export * from './createdAtResponse';
40
40
  export * from './deleteApiKeyResponse';
41
41
  export * from './deleteSourceResponse';
@@ -57,6 +57,7 @@ export * from './facetOrdering';
57
57
  export * from './facets';
58
58
  export * from './facetsStats';
59
59
  export * from './fetchedIndex';
60
+ export * from './getApiKeyResponse';
60
61
  export * from './getDictionarySettingsResponse';
61
62
  export * from './getLogsResponse';
62
63
  export * from './getObjectsParams';
@@ -71,7 +72,6 @@ export * from './hit';
71
72
  export * from './ignorePlurals';
72
73
  export * from './indexSettings';
73
74
  export * from './indexSettingsAsSearchParams';
74
- export * from './key';
75
75
  export * from './languages';
76
76
  export * from './listApiKeysResponse';
77
77
  export * from './listClustersResponse';
@@ -166,6 +166,11 @@ export type IndexSettingsAsSearchParams = {
166
166
 
167
167
  distinct?: Distinct;
168
168
 
169
+ /**
170
+ * Name of the de-duplication attribute to be used with the distinct feature.
171
+ */
172
+ attributeForDistinct?: string;
173
+
169
174
  /**
170
175
  * Whether to take into account an index\'s synonyms for a particular search.
171
176
  */
@@ -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 { Key } from './key';
3
+ import type { GetApiKeyResponse } from './getApiKeyResponse';
4
4
 
5
5
  export type ListApiKeysResponse = {
6
6
  /**
7
7
  * List of api keys.
8
8
  */
9
- keys: Key[];
9
+ keys: GetApiKeyResponse[];
10
10
  };
@@ -3,15 +3,15 @@
3
3
  import type { Action } from './action';
4
4
 
5
5
  export type MultipleBatchRequest = {
6
- action?: Action;
6
+ action: Action;
7
7
 
8
8
  /**
9
9
  * Arguments to the operation (depends on the type of the operation).
10
10
  */
11
- body?: Record<string, any>;
11
+ body: Record<string, any>;
12
12
 
13
13
  /**
14
14
  * Index to target for this operation.
15
15
  */
16
- indexName?: string;
16
+ indexName: string;
17
17
  };
@@ -4,10 +4,10 @@ export type MultipleBatchResponse = {
4
4
  /**
5
5
  * List of tasksIDs per index.
6
6
  */
7
- taskID?: Record<string, any>;
7
+ taskID: Record<string, number>;
8
8
 
9
9
  /**
10
10
  * List of objectID.
11
11
  */
12
- objectIDs?: string[];
12
+ objectIDs: string[];
13
13
  };
@@ -2,7 +2,7 @@
2
2
 
3
3
  export type UpdateApiKeyResponse = {
4
4
  /**
5
- * Key string.
5
+ * The API key.
6
6
  */
7
7
  key: string;
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algolia/client-search",
3
- "version": "5.0.0-alpha.3",
3
+ "version": "5.0.0-alpha.6",
4
4
  "description": "JavaScript client for client-search",
5
5
  "repository": "algolia/algoliasearch-client-javascript",
6
6
  "license": "MIT",
@@ -21,12 +21,12 @@
21
21
  "clean": "rm -rf ./dist"
22
22
  },
23
23
  "dependencies": {
24
- "@algolia/client-common": "5.0.0-alpha.3",
25
- "@algolia/requester-browser-xhr": "5.0.0-alpha.3",
26
- "@algolia/requester-node-http": "5.0.0-alpha.3"
24
+ "@algolia/client-common": "5.0.0-alpha.6",
25
+ "@algolia/requester-browser-xhr": "5.0.0-alpha.6",
26
+ "@algolia/requester-node-http": "5.0.0-alpha.6"
27
27
  },
28
28
  "devDependencies": {
29
- "@types/node": "16.11.45",
29
+ "@types/node": "16.11.47",
30
30
  "typescript": "4.7.4"
31
31
  },
32
32
  "engines": {
@@ -1,3 +0,0 @@
1
- import type { BuiltInOperation } from './builtInOperation';
2
- export declare type AttributeOrBuiltInOperation = BuiltInOperation | string;
3
- //# sourceMappingURL=attributeOrBuiltInOperation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attributeOrBuiltInOperation.d.ts","sourceRoot":"","sources":["../../../../packages/client-search/model/attributeOrBuiltInOperation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,oBAAY,2BAA2B,GAAG,gBAAgB,GAAG,MAAM,CAAC"}
@@ -1,7 +0,0 @@
1
- export declare type CreatedAtObject = {
2
- /**
3
- * Date of creation (ISO-8601 format).
4
- */
5
- createdAt: string;
6
- };
7
- //# sourceMappingURL=createdAtObject.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createdAtObject.d.ts","sourceRoot":"","sources":["../../../../packages/client-search/model/createdAtObject.ts"],"names":[],"mappings":"AAEA,oBAAY,eAAe,GAAG;IAC5B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { ApiKey } from './apiKey';
2
- import type { CreatedAtObject } from './createdAtObject';
3
- export declare type Key = ApiKey & CreatedAtObject;
4
- //# sourceMappingURL=key.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../../../packages/client-search/model/key.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,oBAAY,GAAG,GAAG,MAAM,GAAG,eAAe,CAAC"}
@@ -1,8 +0,0 @@
1
- // This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2
-
3
- export type CreatedAtObject = {
4
- /**
5
- * Date of creation (ISO-8601 format).
6
- */
7
- createdAt: string;
8
- };