@algolia/client-search 5.0.0-alpha.102 → 5.0.0-alpha.104

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.
@@ -0,0 +1,3 @@
1
+ // 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.
2
+
3
+ export type ApiKeyOperation = 'add' | 'delete' | 'update';
@@ -131,4 +131,9 @@ export type BaseSearchResponse = Record<string, any> & {
131
131
  * Lets you store custom data in your indices.
132
132
  */
133
133
  userData?: any | null;
134
+
135
+ /**
136
+ * Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
137
+ */
138
+ queryID?: string;
134
139
  };
@@ -2,11 +2,14 @@
2
2
 
3
3
  import type { CreateIterablePromise } from '@algolia/client-common';
4
4
 
5
+ import type { Action } from './action';
5
6
  import type { ApiKey } from './apiKey';
7
+ import type { ApiKeyOperation } from './apiKeyOperation';
6
8
  import type { AssignUserIdParams } from './assignUserIdParams';
7
9
  import type { AttributeToUpdate } from './attributeToUpdate';
8
10
  import type { BatchAssignUserIdsParams } from './batchAssignUserIdsParams';
9
11
  import type { BatchDictionaryEntriesParams } from './batchDictionaryEntriesParams';
12
+ import type { BatchResponse } from './batchResponse';
10
13
  import type { BatchWriteParams } from './batchWriteParams';
11
14
  import type { BrowseParams } from './browseParams';
12
15
  import type { DeleteByParams } from './deleteByParams';
@@ -23,8 +26,10 @@ import type { SearchParams } from './searchParams';
23
26
  import type { SearchParamsObject } from './searchParamsObject';
24
27
  import type { SearchRulesParams } from './searchRulesParams';
25
28
  import type { SearchSynonymsParams } from './searchSynonymsParams';
29
+ import type { SecuredAPIKeyRestrictions } from './securedAPIKeyRestrictions';
26
30
  import type { Source } from './source';
27
31
  import type { SynonymHit } from './synonymHit';
32
+ import type { UpdatedAtResponse } from './updatedAtResponse';
28
33
 
29
34
  /**
30
35
  * Properties for the `addOrUpdateObject` method.
@@ -756,17 +761,82 @@ export type WaitForApiKeyOptions = WaitForOptions & {
756
761
  /**
757
762
  * The operation that has been performed, used to compute the stop condition.
758
763
  */
759
- operation: 'add' | 'delete';
764
+ operation: Extract<ApiKeyOperation, 'add' | 'delete'>;
760
765
  apiKey?: never;
761
766
  }
762
767
  | {
763
768
  /**
764
769
  * The operation that has been performed, used to compute the stop condition.
765
770
  */
766
- operation: 'update';
771
+ operation: Extract<ApiKeyOperation, 'update'>;
767
772
  /**
768
773
  * The updated fields, used to compute the stop condition.
769
774
  */
770
775
  apiKey: Partial<ApiKey>;
771
776
  }
772
777
  );
778
+
779
+ export type GenerateSecuredApiKeyOptions = {
780
+ /**
781
+ * The base API key from which to generate the new secured one.
782
+ */
783
+ parentApiKey: string;
784
+
785
+ /**
786
+ * A set of properties defining the restrictions of the secured API key.
787
+ */
788
+ restrictions?: SecuredAPIKeyRestrictions;
789
+ };
790
+
791
+ export type GetSecuredApiKeyRemainingValidityOptions = {
792
+ /**
793
+ * The secured API key generated with the `generateSecuredApiKey` method.
794
+ */
795
+ securedApiKey: string;
796
+ };
797
+
798
+ export type ChunkedBatchOptions = ReplaceAllObjectsOptions & {
799
+ /**
800
+ * The `batch` `action` to perform on the given array of `objects`, defaults to `addObject`.
801
+ */
802
+ action?: Action;
803
+
804
+ /**
805
+ * Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
806
+ */
807
+ waitForTasks?: boolean;
808
+ };
809
+
810
+ export type ReplaceAllObjectsOptions = {
811
+ /**
812
+ * The `indexName` to replace `objects` in.
813
+ */
814
+ indexName: string;
815
+
816
+ /**
817
+ * The array of `objects` to store in the given Algolia `indexName`.
818
+ */
819
+ objects: Array<Record<string, any>>;
820
+
821
+ /**
822
+ * The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
823
+ */
824
+ batchSize?: number;
825
+ };
826
+
827
+ export type ReplaceAllObjectsResponse = {
828
+ /**
829
+ * The response of the `operationIndex` request for the `copy` operation.
830
+ */
831
+ copyOperationResponse: UpdatedAtResponse;
832
+
833
+ /**
834
+ * The response of the `batch` request(s).
835
+ */
836
+ batchResponses: BatchResponse[];
837
+
838
+ /**
839
+ * The response of the `operationIndex` request for the `move` operation.
840
+ */
841
+ moveOperationResponse: UpdatedAtResponse;
842
+ };
package/model/index.ts CHANGED
@@ -7,6 +7,7 @@ export * from './advancedSyntaxFeatures';
7
7
  export * from './alternativesAsExact';
8
8
  export * from './anchoring';
9
9
  export * from './apiKey';
10
+ export * from './apiKeyOperation';
10
11
  export * from './aroundPrecision';
11
12
  export * from './aroundPrecisionFromValueInner';
12
13
  export * from './aroundRadius';
@@ -141,6 +142,7 @@ export * from './searchTypeDefault';
141
142
  export * from './searchTypeFacet';
142
143
  export * from './searchUserIdsParams';
143
144
  export * from './searchUserIdsResponse';
145
+ export * from './securedAPIKeyRestrictions';
144
146
  export * from './semanticSearch';
145
147
  export * from './snippetResult';
146
148
  export * from './snippetResultOption';
@@ -0,0 +1,32 @@
1
+ // 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.
2
+
3
+ import type { SearchParamsObject } from './searchParamsObject';
4
+
5
+ export type SecuredAPIKeyRestrictions = {
6
+ searchParams?: SearchParamsObject;
7
+
8
+ /**
9
+ * Filters that apply to every search made with the secured API key. You can add extra filters at search time with the filters query parameter. For example, if you set the filter group:admin on your generated API key, and you add groups:press OR groups:visitors with the filters query parameter, your final search filter is equivalent to groups:admin AND (groups:press OR groups:visitors).
10
+ */
11
+ filters?: string;
12
+
13
+ /**
14
+ * Unix timestamp used to set the expiration date of the API key.
15
+ */
16
+ validUntil?: number;
17
+
18
+ /**
19
+ * Index names that can be queried.
20
+ */
21
+ restrictIndices?: string[];
22
+
23
+ /**
24
+ * IPv4 network allowed to use the generated key. Use this to protect against API key leaking and reuse. You can only provide a single source, but you can specify a range of IPs (for example, 192.168.1.0/24).
25
+ */
26
+ restrictSources?: string;
27
+
28
+ /**
29
+ * Unique user IP address. This can be useful when you want to impose a rate limit on specific users. By default, rate limits are set based on the IP address. This can become an issue when several users search from the same IP address. To avoid this, you can set a unique userToken for each user when generating their API key. This lets you restrict each user to a maximum number of API calls per hour, even if they share their IP with another user. Specifying the userToken in a secured API key is also a good security practice as it ensures users don\'t change it. Many features like Analytics, Personalization, and Dynamic Re-ranking rely on the authenticity of user identifiers. Setting the userToken at the API key level ensures that downstream services work as expected and prevents abuse.
30
+ */
31
+ userToken?: string;
32
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algolia/client-search",
3
- "version": "5.0.0-alpha.102",
3
+ "version": "5.0.0-alpha.104",
4
4
  "description": "JavaScript client for client-search",
5
5
  "repository": "algolia/algoliasearch-client-javascript",
6
6
  "license": "MIT",
@@ -39,12 +39,12 @@
39
39
  "clean": "rm -rf ./dist || true"
40
40
  },
41
41
  "dependencies": {
42
- "@algolia/client-common": "5.0.0-alpha.103",
43
- "@algolia/requester-browser-xhr": "5.0.0-alpha.103",
44
- "@algolia/requester-node-http": "5.0.0-alpha.103"
42
+ "@algolia/client-common": "5.0.0-alpha.105",
43
+ "@algolia/requester-browser-xhr": "5.0.0-alpha.105",
44
+ "@algolia/requester-node-http": "5.0.0-alpha.105"
45
45
  },
46
46
  "devDependencies": {
47
- "@types/node": "20.11.19",
47
+ "@types/node": "20.11.20",
48
48
  "rollup": "4.12.0",
49
49
  "typescript": "5.3.3"
50
50
  },