@algolia/recommend 5.17.1 → 5.19.0

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,429 @@
1
+ // builds/worker.ts
2
+ import { createMemoryCache, createNullCache, createNullLogger } from "@algolia/client-common";
3
+ import { createFetchRequester } from "@algolia/requester-fetch";
4
+
5
+ // src/recommendClient.ts
6
+ import { createAuth, createTransporter, getAlgoliaAgent, shuffle } from "@algolia/client-common";
7
+ var apiClientVersion = "5.19.0";
8
+ function getDefaultHosts(appId) {
9
+ return [
10
+ {
11
+ url: `${appId}-dsn.algolia.net`,
12
+ accept: "read",
13
+ protocol: "https"
14
+ },
15
+ {
16
+ url: `${appId}.algolia.net`,
17
+ accept: "write",
18
+ protocol: "https"
19
+ }
20
+ ].concat(
21
+ shuffle([
22
+ {
23
+ url: `${appId}-1.algolianet.com`,
24
+ accept: "readWrite",
25
+ protocol: "https"
26
+ },
27
+ {
28
+ url: `${appId}-2.algolianet.com`,
29
+ accept: "readWrite",
30
+ protocol: "https"
31
+ },
32
+ {
33
+ url: `${appId}-3.algolianet.com`,
34
+ accept: "readWrite",
35
+ protocol: "https"
36
+ }
37
+ ])
38
+ );
39
+ }
40
+ function createRecommendClient({
41
+ appId: appIdOption,
42
+ apiKey: apiKeyOption,
43
+ authMode,
44
+ algoliaAgents,
45
+ ...options
46
+ }) {
47
+ const auth = createAuth(appIdOption, apiKeyOption, authMode);
48
+ const transporter = createTransporter({
49
+ hosts: getDefaultHosts(appIdOption),
50
+ ...options,
51
+ algoliaAgent: getAlgoliaAgent({
52
+ algoliaAgents,
53
+ client: "Recommend",
54
+ version: apiClientVersion
55
+ }),
56
+ baseHeaders: {
57
+ "content-type": "text/plain",
58
+ ...auth.headers(),
59
+ ...options.baseHeaders
60
+ },
61
+ baseQueryParameters: {
62
+ ...auth.queryParameters(),
63
+ ...options.baseQueryParameters
64
+ }
65
+ });
66
+ return {
67
+ transporter,
68
+ /**
69
+ * The `appId` currently in use.
70
+ */
71
+ appId: appIdOption,
72
+ /**
73
+ * The `apiKey` currently in use.
74
+ */
75
+ apiKey: apiKeyOption,
76
+ /**
77
+ * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
78
+ */
79
+ clearCache() {
80
+ return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
81
+ },
82
+ /**
83
+ * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
84
+ */
85
+ get _ua() {
86
+ return transporter.algoliaAgent.value;
87
+ },
88
+ /**
89
+ * Adds a `segment` to the `x-algolia-agent` sent with every requests.
90
+ *
91
+ * @param segment - The algolia agent (user-agent) segment to add.
92
+ * @param version - The version of the agent.
93
+ */
94
+ addAlgoliaAgent(segment, version) {
95
+ transporter.algoliaAgent.add({ segment, version });
96
+ },
97
+ /**
98
+ * Helper method to switch the API key used to authenticate the requests.
99
+ *
100
+ * @param params - Method params.
101
+ * @param params.apiKey - The new API Key to use.
102
+ */
103
+ setClientApiKey({ apiKey }) {
104
+ if (!authMode || authMode === "WithinHeaders") {
105
+ transporter.baseHeaders["x-algolia-api-key"] = apiKey;
106
+ } else {
107
+ transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
108
+ }
109
+ },
110
+ /**
111
+ * Create or update a batch of Recommend Rules Each Recommend Rule is created or updated, depending on whether a Recommend Rule with the same `objectID` already exists. You may also specify `true` for `clearExistingRules`, in which case the batch will atomically replace all the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the conditions and consequences apply to a [source item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main differences are the following: - Conditions `pattern` and `anchoring` are unavailable. - Condition `filters` triggers if the source item matches the specified filters. - Condition `filters` accepts numeric filters. - Consequence `params` only covers filtering parameters. - Consequence `automaticFacetFilters` doesn\'t require a facet value placeholder (it tries to match the data source item\'s attributes instead).
112
+ *
113
+ * Required API Key ACLs:
114
+ * - editSettings
115
+ * @param batchRecommendRules - The batchRecommendRules object.
116
+ * @param batchRecommendRules.indexName - Name of the index on which to perform the operation.
117
+ * @param batchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
118
+ * @param batchRecommendRules.recommendRule - The recommendRule object.
119
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
120
+ */
121
+ batchRecommendRules({ indexName, model, recommendRule }, requestOptions) {
122
+ if (!indexName) {
123
+ throw new Error("Parameter `indexName` is required when calling `batchRecommendRules`.");
124
+ }
125
+ if (!model) {
126
+ throw new Error("Parameter `model` is required when calling `batchRecommendRules`.");
127
+ }
128
+ const requestPath = "/1/indexes/{indexName}/{model}/recommend/rules/batch".replace("{indexName}", encodeURIComponent(indexName)).replace("{model}", encodeURIComponent(model));
129
+ const headers = {};
130
+ const queryParameters = {};
131
+ const request = {
132
+ method: "POST",
133
+ path: requestPath,
134
+ queryParameters,
135
+ headers,
136
+ data: recommendRule ? recommendRule : {}
137
+ };
138
+ return transporter.request(request, requestOptions);
139
+ },
140
+ /**
141
+ * This method allow you to send requests to the Algolia REST API.
142
+ * @param customDelete - The customDelete object.
143
+ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
144
+ * @param customDelete.parameters - Query parameters to apply to the current query.
145
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
146
+ */
147
+ customDelete({ path, parameters }, requestOptions) {
148
+ if (!path) {
149
+ throw new Error("Parameter `path` is required when calling `customDelete`.");
150
+ }
151
+ const requestPath = "/{path}".replace("{path}", path);
152
+ const headers = {};
153
+ const queryParameters = parameters ? parameters : {};
154
+ const request = {
155
+ method: "DELETE",
156
+ path: requestPath,
157
+ queryParameters,
158
+ headers
159
+ };
160
+ return transporter.request(request, requestOptions);
161
+ },
162
+ /**
163
+ * This method allow you to send requests to the Algolia REST API.
164
+ * @param customGet - The customGet object.
165
+ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
166
+ * @param customGet.parameters - Query parameters to apply to the current query.
167
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
168
+ */
169
+ customGet({ path, parameters }, requestOptions) {
170
+ if (!path) {
171
+ throw new Error("Parameter `path` is required when calling `customGet`.");
172
+ }
173
+ const requestPath = "/{path}".replace("{path}", path);
174
+ const headers = {};
175
+ const queryParameters = parameters ? parameters : {};
176
+ const request = {
177
+ method: "GET",
178
+ path: requestPath,
179
+ queryParameters,
180
+ headers
181
+ };
182
+ return transporter.request(request, requestOptions);
183
+ },
184
+ /**
185
+ * This method allow you to send requests to the Algolia REST API.
186
+ * @param customPost - The customPost object.
187
+ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
188
+ * @param customPost.parameters - Query parameters to apply to the current query.
189
+ * @param customPost.body - Parameters to send with the custom request.
190
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
191
+ */
192
+ customPost({ path, parameters, body }, requestOptions) {
193
+ if (!path) {
194
+ throw new Error("Parameter `path` is required when calling `customPost`.");
195
+ }
196
+ const requestPath = "/{path}".replace("{path}", path);
197
+ const headers = {};
198
+ const queryParameters = parameters ? parameters : {};
199
+ const request = {
200
+ method: "POST",
201
+ path: requestPath,
202
+ queryParameters,
203
+ headers,
204
+ data: body ? body : {}
205
+ };
206
+ return transporter.request(request, requestOptions);
207
+ },
208
+ /**
209
+ * This method allow you to send requests to the Algolia REST API.
210
+ * @param customPut - The customPut object.
211
+ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
212
+ * @param customPut.parameters - Query parameters to apply to the current query.
213
+ * @param customPut.body - Parameters to send with the custom request.
214
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
215
+ */
216
+ customPut({ path, parameters, body }, requestOptions) {
217
+ if (!path) {
218
+ throw new Error("Parameter `path` is required when calling `customPut`.");
219
+ }
220
+ const requestPath = "/{path}".replace("{path}", path);
221
+ const headers = {};
222
+ const queryParameters = parameters ? parameters : {};
223
+ const request = {
224
+ method: "PUT",
225
+ path: requestPath,
226
+ queryParameters,
227
+ headers,
228
+ data: body ? body : {}
229
+ };
230
+ return transporter.request(request, requestOptions);
231
+ },
232
+ /**
233
+ * Deletes a Recommend rule from a recommendation scenario.
234
+ *
235
+ * Required API Key ACLs:
236
+ * - editSettings
237
+ * @param deleteRecommendRule - The deleteRecommendRule object.
238
+ * @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
239
+ * @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
240
+ * @param deleteRecommendRule.objectID - Unique record identifier.
241
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
242
+ */
243
+ deleteRecommendRule({ indexName, model, objectID }, requestOptions) {
244
+ if (!indexName) {
245
+ throw new Error("Parameter `indexName` is required when calling `deleteRecommendRule`.");
246
+ }
247
+ if (!model) {
248
+ throw new Error("Parameter `model` is required when calling `deleteRecommendRule`.");
249
+ }
250
+ if (!objectID) {
251
+ throw new Error("Parameter `objectID` is required when calling `deleteRecommendRule`.");
252
+ }
253
+ const requestPath = "/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}", encodeURIComponent(indexName)).replace("{model}", encodeURIComponent(model)).replace("{objectID}", encodeURIComponent(objectID));
254
+ const headers = {};
255
+ const queryParameters = {};
256
+ const request = {
257
+ method: "DELETE",
258
+ path: requestPath,
259
+ queryParameters,
260
+ headers
261
+ };
262
+ return transporter.request(request, requestOptions);
263
+ },
264
+ /**
265
+ * Retrieves a Recommend rule that you previously created in the Algolia dashboard.
266
+ *
267
+ * Required API Key ACLs:
268
+ * - settings
269
+ * @param getRecommendRule - The getRecommendRule object.
270
+ * @param getRecommendRule.indexName - Name of the index on which to perform the operation.
271
+ * @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
272
+ * @param getRecommendRule.objectID - Unique record identifier.
273
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
274
+ */
275
+ getRecommendRule({ indexName, model, objectID }, requestOptions) {
276
+ if (!indexName) {
277
+ throw new Error("Parameter `indexName` is required when calling `getRecommendRule`.");
278
+ }
279
+ if (!model) {
280
+ throw new Error("Parameter `model` is required when calling `getRecommendRule`.");
281
+ }
282
+ if (!objectID) {
283
+ throw new Error("Parameter `objectID` is required when calling `getRecommendRule`.");
284
+ }
285
+ const requestPath = "/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}", encodeURIComponent(indexName)).replace("{model}", encodeURIComponent(model)).replace("{objectID}", encodeURIComponent(objectID));
286
+ const headers = {};
287
+ const queryParameters = {};
288
+ const request = {
289
+ method: "GET",
290
+ path: requestPath,
291
+ queryParameters,
292
+ headers
293
+ };
294
+ return transporter.request(request, requestOptions);
295
+ },
296
+ /**
297
+ * Checks the status of a given task. Deleting a Recommend rule is asynchronous. When you delete a rule, a task is created on a queue and completed depending on the load on the server. The API response includes a task ID that you can use to check the status.
298
+ *
299
+ * Required API Key ACLs:
300
+ * - editSettings
301
+ * @param getRecommendStatus - The getRecommendStatus object.
302
+ * @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
303
+ * @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
304
+ * @param getRecommendStatus.taskID - Unique task identifier.
305
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
306
+ */
307
+ getRecommendStatus({ indexName, model, taskID }, requestOptions) {
308
+ if (!indexName) {
309
+ throw new Error("Parameter `indexName` is required when calling `getRecommendStatus`.");
310
+ }
311
+ if (!model) {
312
+ throw new Error("Parameter `model` is required when calling `getRecommendStatus`.");
313
+ }
314
+ if (!taskID) {
315
+ throw new Error("Parameter `taskID` is required when calling `getRecommendStatus`.");
316
+ }
317
+ const requestPath = "/1/indexes/{indexName}/{model}/task/{taskID}".replace("{indexName}", encodeURIComponent(indexName)).replace("{model}", encodeURIComponent(model)).replace("{taskID}", encodeURIComponent(taskID));
318
+ const headers = {};
319
+ const queryParameters = {};
320
+ const request = {
321
+ method: "GET",
322
+ path: requestPath,
323
+ queryParameters,
324
+ headers
325
+ };
326
+ return transporter.request(request, requestOptions);
327
+ },
328
+ /**
329
+ * Retrieves recommendations from selected AI models.
330
+ *
331
+ * Required API Key ACLs:
332
+ * - search
333
+ * @param getRecommendationsParams - The getRecommendationsParams object.
334
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
335
+ */
336
+ getRecommendations(getRecommendationsParams, requestOptions) {
337
+ if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
338
+ const newSignatureRequest = {
339
+ requests: getRecommendationsParams
340
+ };
341
+ getRecommendationsParams = newSignatureRequest;
342
+ }
343
+ if (!getRecommendationsParams) {
344
+ throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");
345
+ }
346
+ if (!getRecommendationsParams.requests) {
347
+ throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");
348
+ }
349
+ const requestPath = "/1/indexes/*/recommendations";
350
+ const headers = {};
351
+ const queryParameters = {};
352
+ const request = {
353
+ method: "POST",
354
+ path: requestPath,
355
+ queryParameters,
356
+ headers,
357
+ data: getRecommendationsParams,
358
+ useReadTransporter: true,
359
+ cacheable: true
360
+ };
361
+ return transporter.request(request, requestOptions);
362
+ },
363
+ /**
364
+ * Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
365
+ *
366
+ * Required API Key ACLs:
367
+ * - settings
368
+ * @param searchRecommendRules - The searchRecommendRules object.
369
+ * @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
370
+ * @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
371
+ * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
372
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
373
+ */
374
+ searchRecommendRules({ indexName, model, searchRecommendRulesParams }, requestOptions) {
375
+ if (!indexName) {
376
+ throw new Error("Parameter `indexName` is required when calling `searchRecommendRules`.");
377
+ }
378
+ if (!model) {
379
+ throw new Error("Parameter `model` is required when calling `searchRecommendRules`.");
380
+ }
381
+ const requestPath = "/1/indexes/{indexName}/{model}/recommend/rules/search".replace("{indexName}", encodeURIComponent(indexName)).replace("{model}", encodeURIComponent(model));
382
+ const headers = {};
383
+ const queryParameters = {};
384
+ const request = {
385
+ method: "POST",
386
+ path: requestPath,
387
+ queryParameters,
388
+ headers,
389
+ data: searchRecommendRulesParams ? searchRecommendRulesParams : {},
390
+ useReadTransporter: true,
391
+ cacheable: true
392
+ };
393
+ return transporter.request(request, requestOptions);
394
+ }
395
+ };
396
+ }
397
+
398
+ // builds/worker.ts
399
+ function recommendClient(appId, apiKey, options) {
400
+ if (!appId || typeof appId !== "string") {
401
+ throw new Error("`appId` is missing.");
402
+ }
403
+ if (!apiKey || typeof apiKey !== "string") {
404
+ throw new Error("`apiKey` is missing.");
405
+ }
406
+ return {
407
+ ...createRecommendClient({
408
+ appId,
409
+ apiKey,
410
+ timeouts: {
411
+ connect: 2e3,
412
+ read: 5e3,
413
+ write: 3e4
414
+ },
415
+ logger: createNullLogger(),
416
+ requester: createFetchRequester(),
417
+ algoliaAgents: [{ segment: "Worker" }],
418
+ responsesCache: createNullCache(),
419
+ requestsCache: createNullCache(),
420
+ hostsCache: createMemoryCache(),
421
+ ...options
422
+ })
423
+ };
424
+ }
425
+ export {
426
+ apiClientVersion,
427
+ recommendClient
428
+ };
429
+ //# sourceMappingURL=worker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../builds/worker.ts","../../src/recommendClient.ts"],"sourcesContent":["// 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.\n\nexport type RecommendClient = ReturnType<typeof createRecommendClient>;\n\nimport { createMemoryCache, createNullCache, createNullLogger } from '@algolia/client-common';\nimport { createFetchRequester } from '@algolia/requester-fetch';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { createRecommendClient } from '../src/recommendClient';\n\nexport { apiClientVersion } from '../src/recommendClient';\n\nexport * from '../model';\n\nexport function recommendClient(appId: string, apiKey: string, options?: ClientOptions): RecommendClient {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n return {\n ...createRecommendClient({\n appId,\n apiKey,\n timeouts: {\n connect: 2000,\n read: 5000,\n write: 30000,\n },\n logger: createNullLogger(),\n requester: createFetchRequester(),\n algoliaAgents: [{ segment: 'Worker' }],\n responsesCache: createNullCache(),\n requestsCache: createNullCache(),\n hostsCache: createMemoryCache(),\n ...options,\n }),\n };\n}\n","// 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.\n\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\nimport { createAuth, createTransporter, getAlgoliaAgent, shuffle } from '@algolia/client-common';\n\nimport type { DeletedAtResponse } from '../model/deletedAtResponse';\n\nimport type { GetRecommendTaskResponse } from '../model/getRecommendTaskResponse';\nimport type { GetRecommendationsParams } from '../model/getRecommendationsParams';\nimport type { GetRecommendationsResponse } from '../model/getRecommendationsResponse';\n\nimport type { RecommendRule } from '../model/recommendRule';\nimport type { RecommendUpdatedAtResponse } from '../model/recommendUpdatedAtResponse';\n\nimport type { SearchRecommendRulesResponse } from '../model/searchRecommendRulesResponse';\n\nimport type {\n BatchRecommendRulesProps,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteRecommendRuleProps,\n GetRecommendRuleProps,\n GetRecommendStatusProps,\n LegacyGetRecommendationsParams,\n SearchRecommendRulesProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '5.19.0';\n\nfunction getDefaultHosts(appId: string): Host[] {\n return (\n [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: 'read',\n protocol: 'https',\n },\n {\n url: `${appId}.algolia.net`,\n accept: 'write',\n protocol: 'https',\n },\n ] as Host[]\n ).concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: 'readWrite',\n protocol: 'https',\n },\n ]),\n );\n}\n\nexport function createRecommendClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}: CreateClientOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Recommend',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * Create or update a batch of Recommend Rules Each Recommend Rule is created or updated, depending on whether a Recommend Rule with the same `objectID` already exists. You may also specify `true` for `clearExistingRules`, in which case the batch will atomically replace all the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the conditions and consequences apply to a [source item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main differences are the following: - Conditions `pattern` and `anchoring` are unavailable. - Condition `filters` triggers if the source item matches the specified filters. - Condition `filters` accepts numeric filters. - Consequence `params` only covers filtering parameters. - Consequence `automaticFacetFilters` doesn\\'t require a facet value placeholder (it tries to match the data source item\\'s attributes instead).\n *\n * Required API Key ACLs:\n * - editSettings\n * @param batchRecommendRules - The batchRecommendRules object.\n * @param batchRecommendRules.indexName - Name of the index on which to perform the operation.\n * @param batchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param batchRecommendRules.recommendRule - The recommendRule object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n batchRecommendRules(\n { indexName, model, recommendRule }: BatchRecommendRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<RecommendUpdatedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `batchRecommendRules`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `batchRecommendRules`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/batch'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: recommendRule ? recommendRule : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes a Recommend rule from a recommendation scenario.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param deleteRecommendRule - The deleteRecommendRule object.\n * @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.\n * @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param deleteRecommendRule.objectID - Unique record identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteRecommendRule(\n { indexName, model, objectID }: DeleteRecommendRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<DeletedAtResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `deleteRecommendRule`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `deleteRecommendRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `deleteRecommendRule`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a Recommend rule that you previously created in the Algolia dashboard.\n *\n * Required API Key ACLs:\n * - settings\n * @param getRecommendRule - The getRecommendRule object.\n * @param getRecommendRule.indexName - Name of the index on which to perform the operation.\n * @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param getRecommendRule.objectID - Unique record identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendRule(\n { indexName, model, objectID }: GetRecommendRuleProps,\n requestOptions?: RequestOptions,\n ): Promise<RecommendRule> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getRecommendRule`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `getRecommendRule`.');\n }\n\n if (!objectID) {\n throw new Error('Parameter `objectID` is required when calling `getRecommendRule`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/{objectID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model))\n .replace('{objectID}', encodeURIComponent(objectID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Checks the status of a given task. Deleting a Recommend rule is asynchronous. When you delete a rule, a task is created on a queue and completed depending on the load on the server. The API response includes a task ID that you can use to check the status.\n *\n * Required API Key ACLs:\n * - editSettings\n * @param getRecommendStatus - The getRecommendStatus object.\n * @param getRecommendStatus.indexName - Name of the index on which to perform the operation.\n * @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param getRecommendStatus.taskID - Unique task identifier.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendStatus(\n { indexName, model, taskID }: GetRecommendStatusProps,\n requestOptions?: RequestOptions,\n ): Promise<GetRecommendTaskResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `getRecommendStatus`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `getRecommendStatus`.');\n }\n\n if (!taskID) {\n throw new Error('Parameter `taskID` is required when calling `getRecommendStatus`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/task/{taskID}'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model))\n .replace('{taskID}', encodeURIComponent(taskID));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves recommendations from selected AI models.\n *\n * Required API Key ACLs:\n * - search\n * @param getRecommendationsParams - The getRecommendationsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendations(\n getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams,\n requestOptions?: RequestOptions,\n ): Promise<GetRecommendationsResponse> {\n if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {\n const newSignatureRequest: GetRecommendationsParams = {\n requests: getRecommendationsParams,\n };\n\n getRecommendationsParams = newSignatureRequest;\n }\n\n if (!getRecommendationsParams) {\n throw new Error('Parameter `getRecommendationsParams` is required when calling `getRecommendations`.');\n }\n\n if (!getRecommendationsParams.requests) {\n throw new Error('Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.');\n }\n\n const requestPath = '/1/indexes/*/recommendations';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: getRecommendationsParams,\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.\n *\n * Required API Key ACLs:\n * - settings\n * @param searchRecommendRules - The searchRecommendRules object.\n * @param searchRecommendRules.indexName - Name of the index on which to perform the operation.\n * @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).\n * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchRecommendRules(\n { indexName, model, searchRecommendRulesParams }: SearchRecommendRulesProps,\n requestOptions?: RequestOptions,\n ): Promise<SearchRecommendRulesResponse> {\n if (!indexName) {\n throw new Error('Parameter `indexName` is required when calling `searchRecommendRules`.');\n }\n\n if (!model) {\n throw new Error('Parameter `model` is required when calling `searchRecommendRules`.');\n }\n\n const requestPath = '/1/indexes/{indexName}/{model}/recommend/rules/search'\n .replace('{indexName}', encodeURIComponent(indexName))\n .replace('{model}', encodeURIComponent(model));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: searchRecommendRulesParams ? searchRecommendRulesParams : {},\n useReadTransporter: true,\n cacheable: true,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAIA,SAAS,mBAAmB,iBAAiB,wBAAwB;AACrE,SAAS,4BAA4B;;;ACKrC,SAAS,YAAY,mBAAmB,iBAAiB,eAAe;AA0BjE,IAAM,mBAAmB;AAEhC,SAAS,gBAAgB,OAAuB;AAC9C,SACE;AAAA,IACE;AAAA,MACE,KAAK,GAAG,KAAK;AAAA,MACb,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,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,SAAO;AAAA,IACL,GAAG,sBAAsB;AAAA,MACvB;AAAA,MACA;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,QAAQ,iBAAiB;AAAA,MACzB,WAAW,qBAAqB;AAAA,MAChC,eAAe,CAAC,EAAE,SAAS,SAAS,CAAC;AAAA,MACrC,gBAAgB,gBAAgB;AAAA,MAChC,eAAe,gBAAgB;AAAA,MAC/B,YAAY,kBAAkB;AAAA,MAC9B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;","names":[]}
package/dist/fetch.d.ts CHANGED
@@ -1400,13 +1400,17 @@ type SearchRecommendRulesProps = {
1400
1400
  searchRecommendRulesParams?: SearchRecommendRulesParams;
1401
1401
  };
1402
1402
 
1403
- declare const apiClientVersion = "5.17.1";
1403
+ declare const apiClientVersion = "5.19.0";
1404
1404
  declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
1405
1405
  transporter: _algolia_client_common.Transporter;
1406
1406
  /**
1407
1407
  * The `appId` currently in use.
1408
1408
  */
1409
1409
  appId: string;
1410
+ /**
1411
+ * The `apiKey` currently in use.
1412
+ */
1413
+ apiKey: string;
1410
1414
  /**
1411
1415
  * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
1412
1416
  */
package/dist/node.d.cts CHANGED
@@ -1400,13 +1400,17 @@ type SearchRecommendRulesProps = {
1400
1400
  searchRecommendRulesParams?: SearchRecommendRulesParams;
1401
1401
  };
1402
1402
 
1403
- declare const apiClientVersion = "5.17.1";
1403
+ declare const apiClientVersion = "5.19.0";
1404
1404
  declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
1405
1405
  transporter: _algolia_client_common.Transporter;
1406
1406
  /**
1407
1407
  * The `appId` currently in use.
1408
1408
  */
1409
1409
  appId: string;
1410
+ /**
1411
+ * The `apiKey` currently in use.
1412
+ */
1413
+ apiKey: string;
1410
1414
  /**
1411
1415
  * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
1412
1416
  */
package/dist/node.d.ts CHANGED
@@ -1400,13 +1400,17 @@ type SearchRecommendRulesProps = {
1400
1400
  searchRecommendRulesParams?: SearchRecommendRulesParams;
1401
1401
  };
1402
1402
 
1403
- declare const apiClientVersion = "5.17.1";
1403
+ declare const apiClientVersion = "5.19.0";
1404
1404
  declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
1405
1405
  transporter: _algolia_client_common.Transporter;
1406
1406
  /**
1407
1407
  * The `appId` currently in use.
1408
1408
  */
1409
1409
  appId: string;
1410
+ /**
1411
+ * The `apiKey` currently in use.
1412
+ */
1413
+ apiKey: string;
1410
1414
  /**
1411
1415
  * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
1412
1416
  */
@@ -25,7 +25,7 @@ __export(recommendClient_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(recommendClient_exports);
27
27
  var import_client_common = require("@algolia/client-common");
28
- var apiClientVersion = "5.17.1";
28
+ var apiClientVersion = "5.19.0";
29
29
  function getDefaultHosts(appId) {
30
30
  return [
31
31
  {
@@ -90,6 +90,10 @@ function createRecommendClient({
90
90
  * The `appId` currently in use.
91
91
  */
92
92
  appId: appIdOption,
93
+ /**
94
+ * The `apiKey` currently in use.
95
+ */
96
+ apiKey: apiKeyOption,
93
97
  /**
94
98
  * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
95
99
  */