@algolia/advanced-personalization 0.0.1-alpha.4 → 0.0.1-alpha.40

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.
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  <h4 align="center">The perfect starting point to integrate <a href="https://algolia.com" target="_blank">Algolia</a> within your JavaScript project</h4>
7
7
 
8
8
  <p align="center">
9
- <a href="https://npmjs.org/package/@algolia/advanced-personalization"><img src="https://img.shields.io/npm/v/@algolia/advanced-personalization.svg?style=flat-square" alt="NPM version"></img></a>
9
+ <a href="https://npmjs.com/package/@algolia/advanced-personalization"><img src="https://img.shields.io/npm/v/@algolia/advanced-personalization.svg?style=flat-square" alt="NPM version"></img></a>
10
10
  <a href="http://npm-stat.com/charts.html?package=@algolia/advanced-personalization"><img src="https://img.shields.io/npm/dm/@algolia/advanced-personalization.svg?style=flat-square" alt="NPM downloads"></a>
11
11
  <a href="https://www.jsdelivr.com/package/npm/@algolia/advanced-personalization"><img src="https://data.jsdelivr.com/v1/package/npm/@algolia/advanced-personalization/badge" alt="jsDelivr Downloads"></img></a>
12
12
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat-square" alt="License"></a>
@@ -14,12 +14,11 @@
14
14
  </p>
15
15
 
16
16
  <p align="center">
17
- <a href="https://www.algolia.com/doc/libraries/javascript/" target="_blank">Documentation</a> •
17
+ <a href="https://www.algolia.com/doc/libraries/sdk/install#javascript" target="_blank">Documentation</a> •
18
18
  <a href="https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/" target="_blank">InstantSearch</a> •
19
19
  <a href="https://discourse.algolia.com" target="_blank">Community Forum</a> •
20
20
  <a href="http://stackoverflow.com/questions/tagged/algolia" target="_blank">Stack Overflow</a> •
21
21
  <a href="https://github.com/algolia/algoliasearch-client-javascript/issues" target="_blank">Report a bug</a> •
22
- <a href="https://www.algolia.com/doc/libraries/javascript/v5/" target="_blank">FAQ</a> •
23
22
  <a href="https://alg.li/support" target="_blank">Support</a>
24
23
  </p>
25
24
 
@@ -41,11 +40,11 @@ All of our clients comes with type definition, and are available for both browse
41
40
  ### With a package manager
42
41
 
43
42
  ```bash
44
- yarn add @algolia/advanced-personalization@0.0.1-alpha.4
43
+ yarn add @algolia/advanced-personalization@0.0.1-alpha.40
45
44
  # or
46
- npm install @algolia/advanced-personalization@0.0.1-alpha.4
45
+ npm install @algolia/advanced-personalization@0.0.1-alpha.40
47
46
  # or
48
- pnpm add @algolia/advanced-personalization@0.0.1-alpha.4
47
+ pnpm add @algolia/advanced-personalization@0.0.1-alpha.40
49
48
  ```
50
49
 
51
50
  ### Without a package manager
@@ -53,7 +52,7 @@ pnpm add @algolia/advanced-personalization@0.0.1-alpha.4
53
52
  Add the following JavaScript snippet to the <head> of your website:
54
53
 
55
54
  ```html
56
- <script src="https://cdn.jsdelivr.net/npm/@algolia/advanced-personalization@0.0.1-alpha.4/dist/builds/browser.umd.js"></script>
55
+ <script src="https://cdn.jsdelivr.net/npm/@algolia/advanced-personalization@0.0.1-alpha.40/dist/builds/browser.umd.js"></script>
57
56
  ```
58
57
 
59
58
  ### Usage
@@ -66,11 +65,11 @@ import { advancedPersonalizationClient } from '@algolia/advanced-personalization
66
65
  const client = advancedPersonalizationClient('YOUR_APP_ID', 'YOUR_API_KEY');
67
66
  ```
68
67
 
69
- For full documentation, visit the **[Algolia JavaScript API Client](https://www.algolia.com/doc/libraries/javascript/v5/methods/advanced-personalization/)**.
68
+ For full documentation, visit the **[Algolia JavaScript API Client](https://www.algolia.com/doc/libraries/sdk/methods/advanced-personalization/)**.
70
69
 
71
70
  ## ❓ Troubleshooting
72
71
 
73
- Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/libraries/javascript/v5/) where you will find answers for the most common issues and gotchas with the client. You can also open [a GitHub issue](https://github.com/algolia/api-clients-automation/issues/new?assignees=&labels=&projects=&template=Bug_report.md)
72
+ Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://support.algolia.com/hc/en-us/sections/15061037630609-API-Client-FAQs) where you will find answers for the most common issues and gotchas with the client. You can also open [a GitHub issue](https://github.com/algolia/api-clients-automation/issues/new?assignees=&labels=&projects=&template=Bug_report.md)
74
73
 
75
74
  ## 📄 License
76
75
 
package/dist/browser.d.ts CHANGED
@@ -127,8 +127,11 @@ type Affinity = {
127
127
  lastUpdatedAt: string;
128
128
  };
129
129
 
130
+ type UserType = 'basic' | 'predictive' | 'realtime';
131
+
130
132
  type User = {
131
133
  userID: string;
134
+ type: UserType;
132
135
  affinities: Array<Affinity>;
133
136
  lastUpdatedAt: string;
134
137
  };
@@ -167,6 +170,10 @@ type RealtimeUser = {
167
170
  * User ID of the user.
168
171
  */
169
172
  userID: string;
173
+ /**
174
+ * Date and time when the profile was last computed, in RFC 3339 format.
175
+ */
176
+ lastUpdatedAt: string;
170
177
  /**
171
178
  * Index personalization filters by index name.
172
179
  */
@@ -284,11 +291,11 @@ type GetUserProps = {
284
291
  */
285
292
  type GetUsersProps = {
286
293
  /**
287
- * Filter users by start date (in RFC3339 format). Only users that were updated after the passed date will be returned.
294
+ * Filter users by start date and time, in RFC 3339 format. Only users that were updated after the passed date will be returned.
288
295
  */
289
296
  startDate?: string | undefined;
290
297
  /**
291
- * Filter users by end date (in RFC3339 format). Only users that were updated before the passed date will be returned.
298
+ * Filter users by end date and time, in RFC 3339 format. Only users that were updated before the passed date will be returned.
292
299
  */
293
300
  endDate?: string | undefined;
294
301
  /**
@@ -313,7 +320,7 @@ type GetUsersProps = {
313
320
  previousPageToken?: string | undefined;
314
321
  };
315
322
 
316
- declare const apiClientVersion = "0.0.1-alpha.4";
323
+ declare const apiClientVersion = "0.0.1-alpha.40";
317
324
  declare const REGIONS: readonly ["eu", "us"];
318
325
  type Region = (typeof REGIONS)[number];
319
326
  type RegionOptions = {
@@ -354,10 +361,12 @@ declare function createAdvancedPersonalizationClient({ appId: appIdOption, apiKe
354
361
  apiKey: string;
355
362
  }): void;
356
363
  /**
357
- * Sends a request to compute the user\'s personalization profile.
364
+ * Sends a request to compute the real-time user\'s personalization profile.
358
365
  *
359
366
  * Required API Key ACLs:
360
367
  * - recommendation
368
+ *
369
+ * @deprecated
361
370
  * @param computeRealtimeUser - The computeRealtimeUser object.
362
371
  * @param computeRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.
363
372
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -420,7 +429,7 @@ declare function createAdvancedPersonalizationClient({ appId: appIdOption, apiKe
420
429
  */
421
430
  getConfig(requestOptions?: RequestOptions | undefined): Promise<ConfigurationObject>;
422
431
  /**
423
- * Retrieves the user\'s personalization profiles containing search filters.
432
+ * Retrieves the real-time user\'s personalization profiles containing search filters.
424
433
  *
425
434
  * Required API Key ACLs:
426
435
  * - recommendation
@@ -449,8 +458,8 @@ declare function createAdvancedPersonalizationClient({ appId: appIdOption, apiKe
449
458
  * - browse
450
459
  * - recommendation
451
460
  * @param getUsers - The getUsers object.
452
- * @param getUsers.startDate - Filter users by start date (in RFC3339 format). Only users that were updated after the passed date will be returned.
453
- * @param getUsers.endDate - Filter users by end date (in RFC3339 format). Only users that were updated before the passed date will be returned.
461
+ * @param getUsers.startDate - Filter users by start date and time, in RFC 3339 format. Only users that were updated after the passed date will be returned.
462
+ * @param getUsers.endDate - Filter users by end date and time, in RFC 3339 format. Only users that were updated before the passed date will be returned.
454
463
  * @param getUsers.indices - Filter users by matching indices. If multiple indices are passed, returned users will match all indices.
455
464
  * @param getUsers.affinity - Filter users by affinity name and value. If multiple values are passed, returned users will match all values.
456
465
  * @param getUsers.limit - Limit the number of users in the response. The value of this parameter ranges from 1 to 1000.
@@ -614,4 +623,4 @@ type TooManyRequestsResponse = {
614
623
  declare function advancedPersonalizationClient(appId: string, apiKey: string, region: Region, options?: ClientOptions | undefined): AdvancedPersonalizationClient;
615
624
  type AdvancedPersonalizationClient = ReturnType<typeof createAdvancedPersonalizationClient>;
616
625
 
617
- export { type AcceptedResponse, type AdvancedPersonalizationClient, type Affinity, type BadRequest, type BadUserID, type ComputeRealtimeUserProps, type ConfigurationObject, type ConfigurationObject1, type ConfigurationParameters, type ConfigurationParametersObject, type ConfigurationStatus, type ConflictResponse, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteUserProps, type DeleteUserResponse, type ErrorBase, type ErrorCodes, type ErrorMessagesBadRequest, type ErrorMessagesInternalServerError, type ErrorMessagesUnauthorized, type ErrorResponsesBadRequest, type ErrorResponsesBadUserID, type ErrorResponsesFeatureNotEnabled, type ErrorResponsesGenericNotFound, type ErrorResponsesGenericUnprocessableEntity, type ErrorResponsesInternalServerError, type ErrorResponsesInvalidUserID, type ErrorResponsesUnauthorized, type Event, type EventType, type Events, type FeatureNotEnabled, type Features, type GenericNotFound, type GenericUnprocessableEntity, type GetRealtimeUserProps, type GetUserProps, type GetUsersProps, type GetUsersResponse, type InternalServerError, type InvalidUserID, type Issue, type NotFound, type PaymentRequired, type PersonalizationReRanking, type ProfileType, type PutConfigResponse, type Realtime, type RealtimeUser, type Region, type RegionOptions, type SearchFilter, type SearchFilters, type Source, type Source1, type SourceType, type Status, type Strategy, type Subtype, type TooManyRequestsResponse, type Unauthorized, type UnprocessableEntity, type User, advancedPersonalizationClient, apiClientVersion };
626
+ export { type AcceptedResponse, type AdvancedPersonalizationClient, type Affinity, type BadRequest, type BadUserID, type ComputeRealtimeUserProps, type ConfigurationObject, type ConfigurationObject1, type ConfigurationParameters, type ConfigurationParametersObject, type ConfigurationStatus, type ConflictResponse, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteUserProps, type DeleteUserResponse, type ErrorBase, type ErrorCodes, type ErrorMessagesBadRequest, type ErrorMessagesInternalServerError, type ErrorMessagesUnauthorized, type ErrorResponsesBadRequest, type ErrorResponsesBadUserID, type ErrorResponsesFeatureNotEnabled, type ErrorResponsesGenericNotFound, type ErrorResponsesGenericUnprocessableEntity, type ErrorResponsesInternalServerError, type ErrorResponsesInvalidUserID, type ErrorResponsesUnauthorized, type Event, type EventType, type Events, type FeatureNotEnabled, type Features, type GenericNotFound, type GenericUnprocessableEntity, type GetRealtimeUserProps, type GetUserProps, type GetUsersProps, type GetUsersResponse, type InternalServerError, type InvalidUserID, type Issue, type NotFound, type PaymentRequired, type PersonalizationReRanking, type ProfileType, type PutConfigResponse, type Realtime, type RealtimeUser, type Region, type RegionOptions, type SearchFilter, type SearchFilters, type Source, type Source1, type SourceType, type Status, type Strategy, type Subtype, type TooManyRequestsResponse, type Unauthorized, type UnprocessableEntity, type User, type UserType, advancedPersonalizationClient, apiClientVersion };
@@ -1,15 +1,15 @@
1
1
  // builds/browser.ts
2
- import { createXhrRequester } from "@algolia/requester-browser-xhr";
3
2
  import {
4
3
  createBrowserLocalStorageCache,
5
4
  createFallbackableCache,
6
5
  createMemoryCache,
7
6
  createNullLogger
8
7
  } from "@algolia/client-common";
8
+ import { createXhrRequester } from "@algolia/requester-browser-xhr";
9
9
 
10
10
  // src/advancedPersonalizationClient.ts
11
- import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
12
- var apiClientVersion = "0.0.1-alpha.4";
11
+ import { createAuth, createTransporter, getAlgoliaAgent, validateRequired } from "@algolia/client-common";
12
+ var apiClientVersion = "0.0.1-alpha.40";
13
13
  var REGIONS = ["eu", "us"];
14
14
  function getDefaultHosts(region) {
15
15
  const url = "ai-personalization.{region}.algolia.com".replace("{region}", region);
@@ -87,18 +87,18 @@ function createAdvancedPersonalizationClient({
87
87
  }
88
88
  },
89
89
  /**
90
- * Sends a request to compute the user\'s personalization profile.
90
+ * Sends a request to compute the real-time user\'s personalization profile.
91
91
  *
92
92
  * Required API Key ACLs:
93
93
  * - recommendation
94
+ *
95
+ * @deprecated
94
96
  * @param computeRealtimeUser - The computeRealtimeUser object.
95
97
  * @param computeRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.
96
98
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
97
99
  */
98
100
  computeRealtimeUser({ userToken }, requestOptions) {
99
- if (!userToken) {
100
- throw new Error("Parameter `userToken` is required when calling `computeRealtimeUser`.");
101
- }
101
+ validateRequired("userToken", "computeRealtimeUser", userToken);
102
102
  const requestPath = "/2/realtime/users/{userToken}/compute".replace("{userToken}", encodeURIComponent(userToken));
103
103
  const headers = {};
104
104
  const queryParameters = {};
@@ -118,9 +118,7 @@ function createAdvancedPersonalizationClient({
118
118
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
119
119
  */
120
120
  customDelete({ path, parameters }, requestOptions) {
121
- if (!path) {
122
- throw new Error("Parameter `path` is required when calling `customDelete`.");
123
- }
121
+ validateRequired("path", "customDelete", path);
124
122
  const requestPath = "/{path}".replace("{path}", path);
125
123
  const headers = {};
126
124
  const queryParameters = parameters ? parameters : {};
@@ -140,9 +138,7 @@ function createAdvancedPersonalizationClient({
140
138
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
141
139
  */
142
140
  customGet({ path, parameters }, requestOptions) {
143
- if (!path) {
144
- throw new Error("Parameter `path` is required when calling `customGet`.");
145
- }
141
+ validateRequired("path", "customGet", path);
146
142
  const requestPath = "/{path}".replace("{path}", path);
147
143
  const headers = {};
148
144
  const queryParameters = parameters ? parameters : {};
@@ -163,9 +159,7 @@ function createAdvancedPersonalizationClient({
163
159
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
164
160
  */
165
161
  customPost({ path, parameters, body }, requestOptions) {
166
- if (!path) {
167
- throw new Error("Parameter `path` is required when calling `customPost`.");
168
- }
162
+ validateRequired("path", "customPost", path);
169
163
  const requestPath = "/{path}".replace("{path}", path);
170
164
  const headers = {};
171
165
  const queryParameters = parameters ? parameters : {};
@@ -187,9 +181,7 @@ function createAdvancedPersonalizationClient({
187
181
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
188
182
  */
189
183
  customPut({ path, parameters, body }, requestOptions) {
190
- if (!path) {
191
- throw new Error("Parameter `path` is required when calling `customPut`.");
192
- }
184
+ validateRequired("path", "customPut", path);
193
185
  const requestPath = "/{path}".replace("{path}", path);
194
186
  const headers = {};
195
187
  const queryParameters = parameters ? parameters : {};
@@ -214,9 +206,7 @@ function createAdvancedPersonalizationClient({
214
206
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
215
207
  */
216
208
  deleteUser({ userID }, requestOptions) {
217
- if (!userID) {
218
- throw new Error("Parameter `userID` is required when calling `deleteUser`.");
219
- }
209
+ validateRequired("userID", "deleteUser", userID);
220
210
  const requestPath = "/2/users/{userID}".replace("{userID}", encodeURIComponent(userID));
221
211
  const headers = {};
222
212
  const queryParameters = {};
@@ -250,7 +240,7 @@ function createAdvancedPersonalizationClient({
250
240
  return transporter.request(request, requestOptions);
251
241
  },
252
242
  /**
253
- * Retrieves the user\'s personalization profiles containing search filters.
243
+ * Retrieves the real-time user\'s personalization profiles containing search filters.
254
244
  *
255
245
  * Required API Key ACLs:
256
246
  * - recommendation
@@ -259,9 +249,7 @@ function createAdvancedPersonalizationClient({
259
249
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
260
250
  */
261
251
  getRealtimeUser({ userToken }, requestOptions) {
262
- if (!userToken) {
263
- throw new Error("Parameter `userToken` is required when calling `getRealtimeUser`.");
264
- }
252
+ validateRequired("userToken", "getRealtimeUser", userToken);
265
253
  const requestPath = "/2/realtime/users/{userToken}".replace("{userToken}", encodeURIComponent(userToken));
266
254
  const headers = {};
267
255
  const queryParameters = {};
@@ -285,9 +273,7 @@ function createAdvancedPersonalizationClient({
285
273
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
286
274
  */
287
275
  getUser({ userID }, requestOptions) {
288
- if (!userID) {
289
- throw new Error("Parameter `userID` is required when calling `getUser`.");
290
- }
276
+ validateRequired("userID", "getUser", userID);
291
277
  const requestPath = "/2/users/{userID}".replace("{userID}", encodeURIComponent(userID));
292
278
  const headers = {};
293
279
  const queryParameters = {};
@@ -307,8 +293,8 @@ function createAdvancedPersonalizationClient({
307
293
  * - browse
308
294
  * - recommendation
309
295
  * @param getUsers - The getUsers object.
310
- * @param getUsers.startDate - Filter users by start date (in RFC3339 format). Only users that were updated after the passed date will be returned.
311
- * @param getUsers.endDate - Filter users by end date (in RFC3339 format). Only users that were updated before the passed date will be returned.
296
+ * @param getUsers.startDate - Filter users by start date and time, in RFC 3339 format. Only users that were updated after the passed date will be returned.
297
+ * @param getUsers.endDate - Filter users by end date and time, in RFC 3339 format. Only users that were updated before the passed date will be returned.
312
298
  * @param getUsers.indices - Filter users by matching indices. If multiple indices are passed, returned users will match all indices.
313
299
  * @param getUsers.affinity - Filter users by affinity name and value. If multiple values are passed, returned users will match all values.
314
300
  * @param getUsers.limit - Limit the number of users in the response. The value of this parameter ranges from 1 to 1000.
@@ -360,23 +346,15 @@ function createAdvancedPersonalizationClient({
360
346
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
361
347
  */
362
348
  putConfig(configurationParameters, requestOptions) {
363
- if (!configurationParameters) {
364
- throw new Error("Parameter `configurationParameters` is required when calling `putConfig`.");
365
- }
366
- if (!configurationParameters.indices) {
367
- throw new Error("Parameter `configurationParameters.indices` is required when calling `putConfig`.");
368
- }
369
- if (!configurationParameters.personalizationReRanking) {
370
- throw new Error(
371
- "Parameter `configurationParameters.personalizationReRanking` is required when calling `putConfig`."
372
- );
373
- }
374
- if (!configurationParameters.profileType) {
375
- throw new Error("Parameter `configurationParameters.profileType` is required when calling `putConfig`.");
376
- }
377
- if (!configurationParameters.features) {
378
- throw new Error("Parameter `configurationParameters.features` is required when calling `putConfig`.");
379
- }
349
+ validateRequired("configurationParameters", "putConfig", configurationParameters);
350
+ validateRequired("configurationParameters.indices", "putConfig", configurationParameters.indices);
351
+ validateRequired(
352
+ "configurationParameters.personalizationReRanking",
353
+ "putConfig",
354
+ configurationParameters.personalizationReRanking
355
+ );
356
+ validateRequired("configurationParameters.profileType", "putConfig", configurationParameters.profileType);
357
+ validateRequired("configurationParameters.features", "putConfig", configurationParameters.features);
380
358
  const requestPath = "/2/config";
381
359
  const headers = {};
382
360
  const queryParameters = {};
@@ -403,6 +381,7 @@ function advancedPersonalizationClient(appId, apiKey, region, options) {
403
381
  if (!region || region && (typeof region !== "string" || !REGIONS.includes(region))) {
404
382
  throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(", ")}`);
405
383
  }
384
+ const { compression: _compression, ...browserOptions } = options || {};
406
385
  return createAdvancedPersonalizationClient({
407
386
  appId,
408
387
  apiKey,
@@ -415,13 +394,13 @@ function advancedPersonalizationClient(appId, apiKey, region, options) {
415
394
  logger: createNullLogger(),
416
395
  requester: createXhrRequester(),
417
396
  algoliaAgents: [{ segment: "Browser" }],
418
- authMode: "WithinQueryParameters",
397
+ authMode: "WithinHeaders",
419
398
  responsesCache: createMemoryCache(),
420
399
  requestsCache: createMemoryCache({ serializable: false }),
421
400
  hostsCache: createFallbackableCache({
422
401
  caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()]
423
402
  }),
424
- ...options
403
+ ...browserOptions
425
404
  });
426
405
  }
427
406
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../builds/browser.ts","../../src/advancedPersonalizationClient.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\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport {\n createBrowserLocalStorageCache,\n createFallbackableCache,\n createMemoryCache,\n createNullLogger,\n} from '@algolia/client-common';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { apiClientVersion, createAdvancedPersonalizationClient } from '../src/advancedPersonalizationClient';\n\nimport type { Region } from '../src/advancedPersonalizationClient';\nimport { REGIONS } from '../src/advancedPersonalizationClient';\n\nexport type { Region, RegionOptions } from '../src/advancedPersonalizationClient';\n\nexport { apiClientVersion } from '../src/advancedPersonalizationClient';\n\nexport * from '../model';\n\nexport function advancedPersonalizationClient(\n appId: string,\n apiKey: string,\n region: Region,\n options?: ClientOptions | undefined,\n): AdvancedPersonalizationClient {\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 if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {\n throw new Error(`\\`region\\` is required and must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n return createAdvancedPersonalizationClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: 1000,\n read: 2000,\n write: 30000,\n },\n logger: createNullLogger(),\n requester: createXhrRequester(),\n algoliaAgents: [{ segment: 'Browser' }],\n authMode: 'WithinQueryParameters',\n responsesCache: createMemoryCache(),\n requestsCache: createMemoryCache({ serializable: false }),\n hostsCache: createFallbackableCache({\n caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],\n }),\n ...options,\n });\n}\n\nexport type AdvancedPersonalizationClient = ReturnType<typeof createAdvancedPersonalizationClient>;\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 } from '@algolia/client-common';\n\nimport type { AcceptedResponse } from '../model/acceptedResponse';\nimport type { ConfigurationObject } from '../model/configurationObject';\nimport type { ConfigurationParameters } from '../model/configurationParameters';\n\nimport type { DeleteUserResponse } from '../model/deleteUserResponse';\n\nimport type { GetUsersResponse } from '../model/getUsersResponse';\nimport type { PutConfigResponse } from '../model/putConfigResponse';\nimport type { RealtimeUser } from '../model/realtimeUser';\n\nimport type { User } from '../model/user';\n\nimport type {\n ComputeRealtimeUserProps,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserProps,\n GetRealtimeUserProps,\n GetUserProps,\n GetUsersProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '0.0.1-alpha.4';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region: Region };\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'ai-personalization.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createAdvancedPersonalizationClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'AdvancedPersonalization',\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 | undefined): 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 * Sends a request to compute the user\\'s personalization profile.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param computeRealtimeUser - The computeRealtimeUser object.\n * @param computeRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n computeRealtimeUser(\n { userToken }: ComputeRealtimeUserProps,\n requestOptions?: RequestOptions,\n ): Promise<AcceptedResponse> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `computeRealtimeUser`.');\n }\n\n const requestPath = '/2/realtime/users/{userToken}/compute'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\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 lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\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 lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\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 lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\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 user profile.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param deleteUser - The deleteUser object.\n * @param deleteUser.userID - ID of the user.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUser({ userID }: DeleteUserProps, requestOptions?: RequestOptions): Promise<DeleteUserResponse> {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `deleteUser`.');\n }\n\n const requestPath = '/2/users/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 list of configuration objects for each index.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConfig(requestOptions?: RequestOptions | undefined): Promise<ConfigurationObject> {\n const requestPath = '/2/config';\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 the user\\'s personalization profiles containing search filters.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param getRealtimeUser - The getRealtimeUser object.\n * @param getRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRealtimeUser({ userToken }: GetRealtimeUserProps, requestOptions?: RequestOptions): Promise<RealtimeUser> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `getRealtimeUser`.');\n }\n\n const requestPath = '/2/realtime/users/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\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 a user profile.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param getUser - The getUser object.\n * @param getUser.userID - ID of the user.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUser({ userID }: GetUserProps, requestOptions?: RequestOptions): Promise<User> {\n if (!userID) {\n throw new Error('Parameter `userID` is required when calling `getUser`.');\n }\n\n const requestPath = '/2/users/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 a list of user profiles in [lexicographical order](https://www.educative.io/answers/what-is-a-lexicographic-order).\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param getUsers - The getUsers object.\n * @param getUsers.startDate - Filter users by start date (in RFC3339 format). Only users that were updated after the passed date will be returned.\n * @param getUsers.endDate - Filter users by end date (in RFC3339 format). Only users that were updated before the passed date will be returned.\n * @param getUsers.indices - Filter users by matching indices. If multiple indices are passed, returned users will match all indices.\n * @param getUsers.affinity - Filter users by affinity name and value. If multiple values are passed, returned users will match all values.\n * @param getUsers.limit - Limit the number of users in the response. The value of this parameter ranges from 1 to 1000.\n * @param getUsers.nextPageToken - Reference for the next page, when navigating forward using pagination. Can\\'t be used in the same request as `previousPageToken`.\n * @param getUsers.previousPageToken - Reference for the previous page, when navigating backward using pagination. Can\\'t be used in the same request as `nextPageToken`.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUsers(\n { startDate, endDate, indices, affinity, limit, nextPageToken, previousPageToken }: GetUsersProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<GetUsersResponse> {\n const requestPath = '/2/users';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (startDate !== undefined) {\n queryParameters['startDate'] = startDate.toString();\n }\n\n if (endDate !== undefined) {\n queryParameters['endDate'] = endDate.toString();\n }\n\n if (indices !== undefined) {\n queryParameters['indices'] = indices.toString();\n }\n\n if (affinity !== undefined) {\n queryParameters['affinity'] = affinity.toString();\n }\n\n if (limit !== undefined) {\n queryParameters['limit'] = limit.toString();\n }\n\n if (nextPageToken !== undefined) {\n queryParameters['nextPageToken'] = nextPageToken.toString();\n }\n\n if (previousPageToken !== undefined) {\n queryParameters['previousPageToken'] = previousPageToken.toString();\n }\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 * Updates the configuration. The configuration is a list of configuration objects for each index. To configure Advanced Personalization for an index, create a new configuration object for the index.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param configurationParameters - The configurationParameters object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putConfig(\n configurationParameters: ConfigurationParameters,\n requestOptions?: RequestOptions,\n ): Promise<PutConfigResponse> {\n if (!configurationParameters) {\n throw new Error('Parameter `configurationParameters` is required when calling `putConfig`.');\n }\n\n if (!configurationParameters.indices) {\n throw new Error('Parameter `configurationParameters.indices` is required when calling `putConfig`.');\n }\n if (!configurationParameters.personalizationReRanking) {\n throw new Error(\n 'Parameter `configurationParameters.personalizationReRanking` is required when calling `putConfig`.',\n );\n }\n if (!configurationParameters.profileType) {\n throw new Error('Parameter `configurationParameters.profileType` is required when calling `putConfig`.');\n }\n if (!configurationParameters.features) {\n throw new Error('Parameter `configurationParameters.features` is required when calling `putConfig`.');\n }\n\n const requestPath = '/2/config';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: configurationParameters,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAEA,SAAS,0BAA0B;AAEnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACCP,SAAS,YAAY,mBAAmB,uBAAuB;AA0BxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAIlC,SAAS,gBAAgB,QAAwB;AAC/C,QAAM,MAAM,0CAA0C,QAAQ,YAAY,MAAM;AAEhF,SAAO,CAAC,EAAE,KAAK,QAAQ,aAAa,UAAU,QAAQ,CAAC;AACzD;AAEO,SAAS,oCAAoC;AAAA,EAClD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,GAAG;AACL,GAAwC;AACtC,QAAM,OAAO,WAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,cAAc,kBAAkB;AAAA,IACpC,OAAO,gBAAgB,YAAY;AAAA,IACnC,GAAG;AAAA,IACH,cAAc,gBAAgB;AAAA,MAC5B;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,IACX,CAAC;AAAA,IACD,aAAa;AAAA,MACX,gBAAgB;AAAA,MAChB,GAAG,KAAK,QAAQ;AAAA,MAChB,GAAG,QAAQ;AAAA,IACb;AAAA,IACA,qBAAqB;AAAA,MACnB,GAAG,KAAK,gBAAgB;AAAA,MACxB,GAAG,QAAQ;AAAA,IACb;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA;AAAA;AAAA;AAAA,IAKA,OAAO;AAAA;AAAA;AAAA;AAAA,IAKP,QAAQ;AAAA;AAAA;AAAA;AAAA,IAKR,aAA4B;AAC1B,aAAO,QAAQ,IAAI,CAAC,YAAY,cAAc,MAAM,GAAG,YAAY,eAAe,MAAM,CAAC,CAAC,EAAE,KAAK,MAA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IAAI,MAAM,4DAA4D,QAAQ,KAAK,IAAI,CAAC,EAAE;AAAA,EAClG;AAEA,SAAO,oCAAoC;AAAA,IACzC;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,IACA,QAAQ,iBAAiB;AAAA,IACzB,WAAW,mBAAmB;AAAA,IAC9B,eAAe,CAAC,EAAE,SAAS,UAAU,CAAC;AAAA,IACtC,UAAU;AAAA,IACV,gBAAgB,kBAAkB;AAAA,IAClC,eAAe,kBAAkB,EAAE,cAAc,MAAM,CAAC;AAAA,IACxD,YAAY,wBAAwB;AAAA,MAClC,QAAQ,CAAC,+BAA+B,EAAE,KAAK,GAAG,gBAAgB,IAAI,KAAK,GAAG,CAAC,GAAG,kBAAkB,CAAC;AAAA,IACvG,CAAC;AAAA,IACD,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../../builds/browser.ts","../../src/advancedPersonalizationClient.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\nimport {\n createBrowserLocalStorageCache,\n createFallbackableCache,\n createMemoryCache,\n createNullLogger,\n} from '@algolia/client-common';\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport type { ClientOptions } from '@algolia/client-common';\n\nimport { apiClientVersion, createAdvancedPersonalizationClient } from '../src/advancedPersonalizationClient';\n\nimport type { Region } from '../src/advancedPersonalizationClient';\nimport { REGIONS } from '../src/advancedPersonalizationClient';\n\nexport type { Region, RegionOptions } from '../src/advancedPersonalizationClient';\n\nexport { apiClientVersion } from '../src/advancedPersonalizationClient';\n\nexport * from '../model';\n\nexport function advancedPersonalizationClient(\n appId: string,\n apiKey: string,\n region: Region,\n options?: ClientOptions | undefined,\n): AdvancedPersonalizationClient {\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 if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {\n throw new Error(`\\`region\\` is required and must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n const { compression: _compression, ...browserOptions } = options || {};\n\n return createAdvancedPersonalizationClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: 1000,\n read: 2000,\n write: 30000,\n },\n logger: createNullLogger(),\n requester: createXhrRequester(),\n algoliaAgents: [{ segment: 'Browser' }],\n authMode: 'WithinHeaders',\n responsesCache: createMemoryCache(),\n requestsCache: createMemoryCache({ serializable: false }),\n hostsCache: createFallbackableCache({\n caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],\n }),\n ...browserOptions,\n });\n}\n\nexport type AdvancedPersonalizationClient = ReturnType<typeof createAdvancedPersonalizationClient>;\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, validateRequired } from '@algolia/client-common';\n\nimport type { AcceptedResponse } from '../model/acceptedResponse';\nimport type { ConfigurationObject } from '../model/configurationObject';\nimport type { ConfigurationParameters } from '../model/configurationParameters';\nimport type { DeleteUserResponse } from '../model/deleteUserResponse';\nimport type { GetUsersResponse } from '../model/getUsersResponse';\nimport type { PutConfigResponse } from '../model/putConfigResponse';\nimport type { RealtimeUser } from '../model/realtimeUser';\nimport type { User } from '../model/user';\n\nimport type {\n ComputeRealtimeUserProps,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserProps,\n GetRealtimeUserProps,\n GetUserProps,\n GetUsersProps,\n} from '../model/clientMethodProps';\n\nexport const apiClientVersion = '0.0.1-alpha.40';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\nexport type RegionOptions = { region: Region };\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'ai-personalization.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\nexport function createAdvancedPersonalizationClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & RegionOptions) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'AdvancedPersonalization',\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 | undefined): 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 * Sends a request to compute the real-time user\\'s personalization profile.\n *\n * Required API Key ACLs:\n * - recommendation\n *\n * @deprecated\n * @param computeRealtimeUser - The computeRealtimeUser object.\n * @param computeRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n computeRealtimeUser(\n { userToken }: ComputeRealtimeUserProps,\n requestOptions?: RequestOptions,\n ): Promise<AcceptedResponse> {\n validateRequired('userToken', 'computeRealtimeUser', userToken);\n\n const requestPath = '/2/realtime/users/{userToken}/compute'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.\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 validateRequired('path', 'customDelete', path);\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 lets you send requests to the Algolia REST API.\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, for example `1/newFeature`.\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 validateRequired('path', 'customGet', path);\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 lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\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 validateRequired('path', 'customPost', path);\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 lets you send requests to the Algolia REST API.\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, for example `1/newFeature`.\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 validateRequired('path', 'customPut', path);\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 user profile.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param deleteUser - The deleteUser object.\n * @param deleteUser.userID - ID of the user.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUser({ userID }: DeleteUserProps, requestOptions?: RequestOptions): Promise<DeleteUserResponse> {\n validateRequired('userID', 'deleteUser', userID);\n\n const requestPath = '/2/users/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 list of configuration objects for each index.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getConfig(requestOptions?: RequestOptions | undefined): Promise<ConfigurationObject> {\n const requestPath = '/2/config';\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 the real-time user\\'s personalization profiles containing search filters.\n *\n * Required API Key ACLs:\n * - recommendation\n * @param getRealtimeUser - The getRealtimeUser object.\n * @param getRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRealtimeUser({ userToken }: GetRealtimeUserProps, requestOptions?: RequestOptions): Promise<RealtimeUser> {\n validateRequired('userToken', 'getRealtimeUser', userToken);\n\n const requestPath = '/2/realtime/users/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\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 a user profile.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param getUser - The getUser object.\n * @param getUser.userID - ID of the user.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUser({ userID }: GetUserProps, requestOptions?: RequestOptions): Promise<User> {\n validateRequired('userID', 'getUser', userID);\n\n const requestPath = '/2/users/{userID}'.replace('{userID}', encodeURIComponent(userID));\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 a list of user profiles in [lexicographical order](https://www.educative.io/answers/what-is-a-lexicographic-order).\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param getUsers - The getUsers object.\n * @param getUsers.startDate - Filter users by start date and time, in RFC 3339 format. Only users that were updated after the passed date will be returned.\n * @param getUsers.endDate - Filter users by end date and time, in RFC 3339 format. Only users that were updated before the passed date will be returned.\n * @param getUsers.indices - Filter users by matching indices. If multiple indices are passed, returned users will match all indices.\n * @param getUsers.affinity - Filter users by affinity name and value. If multiple values are passed, returned users will match all values.\n * @param getUsers.limit - Limit the number of users in the response. The value of this parameter ranges from 1 to 1000.\n * @param getUsers.nextPageToken - Reference for the next page, when navigating forward using pagination. Can\\'t be used in the same request as `previousPageToken`.\n * @param getUsers.previousPageToken - Reference for the previous page, when navigating backward using pagination. Can\\'t be used in the same request as `nextPageToken`.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUsers(\n { startDate, endDate, indices, affinity, limit, nextPageToken, previousPageToken }: GetUsersProps = {},\n requestOptions: RequestOptions | undefined = undefined,\n ): Promise<GetUsersResponse> {\n const requestPath = '/2/users';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n if (startDate !== undefined) {\n queryParameters['startDate'] = startDate.toString();\n }\n\n if (endDate !== undefined) {\n queryParameters['endDate'] = endDate.toString();\n }\n\n if (indices !== undefined) {\n queryParameters['indices'] = indices.toString();\n }\n\n if (affinity !== undefined) {\n queryParameters['affinity'] = affinity.toString();\n }\n\n if (limit !== undefined) {\n queryParameters['limit'] = limit.toString();\n }\n\n if (nextPageToken !== undefined) {\n queryParameters['nextPageToken'] = nextPageToken.toString();\n }\n\n if (previousPageToken !== undefined) {\n queryParameters['previousPageToken'] = previousPageToken.toString();\n }\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 * Updates the configuration. The configuration is a list of configuration objects for each index. To configure Advanced Personalization for an index, create a new configuration object for the index.\n *\n * Required API Key ACLs:\n * - search\n * - browse\n * - recommendation\n * @param configurationParameters - The configurationParameters object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n putConfig(\n configurationParameters: ConfigurationParameters,\n requestOptions?: RequestOptions,\n ): Promise<PutConfigResponse> {\n validateRequired('configurationParameters', 'putConfig', configurationParameters);\n\n validateRequired('configurationParameters.indices', 'putConfig', configurationParameters.indices);\n validateRequired(\n 'configurationParameters.personalizationReRanking',\n 'putConfig',\n configurationParameters.personalizationReRanking,\n );\n validateRequired('configurationParameters.profileType', 'putConfig', configurationParameters.profileType);\n validateRequired('configurationParameters.features', 'putConfig', configurationParameters.features);\n\n const requestPath = '/2/config';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: configurationParameters,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;;;ACEnC,SAAS,YAAY,mBAAmB,iBAAiB,wBAAwB;AAuB1E,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAIlC,SAAS,gBAAgB,QAAwB;AAC/C,QAAM,MAAM,0CAA0C,QAAQ,YAAY,MAAM;AAEhF,SAAO,CAAC,EAAE,KAAK,QAAQ,aAAa,UAAU,QAAQ,CAAC;AACzD;AAEO,S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AY,QAAQ,SAAS,cAAc;AAAA,IACpD;AAAA,EACF;AACF;;;ADlcO,SAAS,8BACd,OACA,QACA,QACA,SAC+B;AAC/B,MAAI,CAAC,SAAS,OAAO,UAAU,UAAU;AACvC,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAEA,MAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,MAAI,CAAC,UAAW,WAAW,OAAO,WAAW,YAAY,CAAC,QAAQ,SAAS,MAAM,IAAK;AACpF,UAAM,IAAI,MAAM,4DAA4D,QAAQ,KAAK,IAAI,CAAC,EAAE;AAAA,EAClG;AAEA,QAAM,EAAE,aAAa,cAAc,GAAG,eAAe,IAAI,WAAW,CAAC;AAErE,SAAO,oCAAoC;AAAA,IACzC;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,IACA,QAAQ,iBAAiB;AAAA,IACzB,WAAW,mBAAmB;AAAA,IAC9B,eAAe,CAAC,EAAE,SAAS,UAAU,CAAC;AAAA,IACtC,UAAU;AAAA,IACV,gBAAgB,kBAAkB;AAAA,IAClC,eAAe,kBAAkB,EAAE,cAAc,MAAM,CAAC;AAAA,IACxD,YAAY,wBAAwB;AAAA,MAClC,QAAQ,CAAC,+BAA+B,EAAE,KAAK,GAAG,gBAAgB,IAAI,KAAK,GAAG,CAAC,GAAG,kBAAkB,CAAC;AAAA,IACvG,CAAC;AAAA,IACD,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
@@ -1,2 +1,6 @@
1
- function H(){function r(e){return new Promise(o=>{let t=new XMLHttpRequest;t.open(e.method,e.url,!0),Object.keys(e.headers).forEach(n=>t.setRequestHeader(n,e.headers[n]));let i=(n,s)=>setTimeout(()=>{t.abort(),o({status:0,content:s,isTimedOut:!0})},n),l=i(e.connectTimeout,"Connection timeout"),h;t.onreadystatechange=()=>{t.readyState>t.OPENED&&h===void 0&&(clearTimeout(l),h=i(e.responseTimeout,"Socket timeout"))},t.onerror=()=>{t.status===0&&(clearTimeout(l),clearTimeout(h),o({content:t.responseText||"Network request failed",status:t.status,isTimedOut:!1}))},t.onload=()=>{clearTimeout(l),clearTimeout(h),o({content:t.responseText,status:t.status,isTimedOut:!1})},t.send(e.data)})}return{send:r}}function j(r){let e,o=`algolia-client-js-${r.key}`;function t(){return e===void 0&&(e=r.localStorage||window.localStorage),e}function i(){return JSON.parse(t().getItem(o)||"{}")}function l(n){t().setItem(o,JSON.stringify(n))}function h(){let n=r.timeToLive?r.timeToLive*1e3:null,s=i(),a=Object.fromEntries(Object.entries(s).filter(([,p])=>p.timestamp!==void 0));if(l(a),!n)return;let c=Object.fromEntries(Object.entries(a).filter(([,p])=>{let g=new Date().getTime();return!(p.timestamp+n<g)}));l(c)}return{get(n,s,a={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(h(),i()[JSON.stringify(n)])).then(c=>Promise.all([c?c.value:s(),c!==void 0])).then(([c,p])=>Promise.all([c,p||a.miss(c)])).then(([c])=>c)},set(n,s){return Promise.resolve().then(()=>{let a=i();return a[JSON.stringify(n)]={timestamp:new Date().getTime(),value:s},t().setItem(o,JSON.stringify(a)),s})},delete(n){return Promise.resolve().then(()=>{let s=i();delete s[JSON.stringify(n)],t().setItem(o,JSON.stringify(s))})},clear(){return Promise.resolve().then(()=>{t().removeItem(o)})}}}function V(){return{get(r,e,o={miss:()=>Promise.resolve()}){return e().then(i=>Promise.all([i,o.miss(i)])).then(([i])=>i)},set(r,e){return Promise.resolve(e)},delete(r){return Promise.resolve()},clear(){return Promise.resolve()}}}function w(r){let e=[...r.caches],o=e.shift();return o===void 0?V():{get(t,i,l={miss:()=>Promise.resolve()}){return o.get(t,i,l).catch(()=>w({caches:e}).get(t,i,l))},set(t,i){return o.set(t,i).catch(()=>w({caches:e}).set(t,i))},delete(t){return o.delete(t).catch(()=>w({caches:e}).delete(t))},clear(){return o.clear().catch(()=>w({caches:e}).clear())}}}function O(r={serializable:!0}){let e={};return{get(o,t,i={miss:()=>Promise.resolve()}){let l=JSON.stringify(o);if(l in e)return Promise.resolve(r.serializable?JSON.parse(e[l]):e[l]);let h=t();return h.then(n=>i.miss(n)).then(()=>h)},set(o,t){return e[JSON.stringify(o)]=r.serializable?JSON.stringify(t):t,Promise.resolve(t)},delete(o){return delete e[JSON.stringify(o)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}function Y(r){let e={value:`Algolia for JavaScript (${r})`,add(o){let t=`; ${o.segment}${o.version!==void 0?` (${o.version})`:""}`;return e.value.indexOf(t)===-1&&(e.value=`${e.value}${t}`),e}};return e}function $(r,e,o="WithinHeaders"){let t={"x-algolia-api-key":e,"x-algolia-application-id":r};return{headers(){return o==="WithinHeaders"?t:{}},queryParameters(){return o==="WithinQueryParameters"?t:{}}}}function Q({algoliaAgents:r,client:e,version:o}){let t=Y(o).add({segment:e,version:o});return r.forEach(i=>t.add(i)),t}function W(){return{debug(r,e){return Promise.resolve()},info(r,e){return Promise.resolve()},error(r,e){return Promise.resolve()}}}var G=2*60*1e3;function L(r,e="up"){let o=Date.now();function t(){return e==="up"||Date.now()-o>G}function i(){return e==="timed out"&&Date.now()-o<=G}return{...r,status:e,lastUpdate:o,isUp:t,isTimedOut:i}}var J=class extends Error{name="AlgoliaError";constructor(r,e){super(r),e&&(this.name=e)}};var M=class extends J{stackTrace;constructor(r,e,o){super(r,o),this.stackTrace=e}},Z=class extends M{constructor(r){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",r,"RetryError")}},b=class extends M{status;constructor(r,e,o,t="ApiError"){super(r,o,t),this.status=e}},ee=class extends J{response;constructor(r,e){super(r,"DeserializationError"),this.response=e}},re=class extends b{error;constructor(r,e,o,t){super(r,e,t,"DetailedApiError"),this.error=o}};function te(r,e,o){let t=oe(o),i=`${r.protocol}://${r.url}${r.port?`:${r.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return t.length&&(i+=`?${t}`),i}function oe(r){return Object.keys(r).filter(e=>r[e]!==void 0).sort().map(e=>`${e}=${encodeURIComponent(Object.prototype.toString.call(r[e])==="[object Array]"?r[e].join(","):r[e]).replace(/\+/g,"%20")}`).join("&")}function se(r,e){if(r.method==="GET"||r.data===void 0&&e.data===void 0)return;let o=Array.isArray(r.data)?r.data:{...r.data,...e.data};return JSON.stringify(o)}function ne(r,e,o){let t={Accept:"application/json",...r,...e,...o},i={};return Object.keys(t).forEach(l=>{let h=t[l];i[l.toLowerCase()]=h}),i}function ae(r){try{return JSON.parse(r.content)}catch(e){throw new ee(e.message,r)}}function ie({content:r,status:e},o){try{let t=JSON.parse(r);return"error"in t?new re(t.message,e,t.error,o):new b(t.message,e,o)}catch{}return new b(r,e,o)}function ue({isTimedOut:r,status:e}){return!r&&~~e===0}function ce({isTimedOut:r,status:e}){return r||ue({isTimedOut:r,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function me({status:r}){return~~(r/100)===2}function le(r){return r.map(e=>F(e))}function F(r){let e=r.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...r,request:{...r.request,headers:{...r.request.headers,...e}}}}function B({hosts:r,hostsCache:e,baseHeaders:o,logger:t,baseQueryParameters:i,algoliaAgent:l,timeouts:h,requester:n,requestsCache:s,responsesCache:a}){async function c(u){let m=await Promise.all(u.map(d=>e.get(d,()=>Promise.resolve(L(d))))),y=m.filter(d=>d.isUp()),x=m.filter(d=>d.isTimedOut()),E=[...y,...x];return{hosts:E.length>0?E:u,getTimeout(d,q){return(x.length===0&&d===0?1:x.length+3+d)*q}}}async function p(u,m,y=!0){let x=[],E=se(u,m),f=ne(o,u.headers,m.headers),d=u.method==="GET"?{...u.data,...m.data}:{},q={...i,...u.queryParameters,...d};if(l.value&&(q["x-algolia-agent"]=l.value),m&&m.queryParameters)for(let P of Object.keys(m.queryParameters))!m.queryParameters[P]||Object.prototype.toString.call(m.queryParameters[P])==="[object Object]"?q[P]=m.queryParameters[P]:q[P]=m.queryParameters[P].toString();let v=0,D=async(P,A)=>{let T=P.pop();if(T===void 0)throw new Z(le(x));let U={...h,...m.timeouts},k={data:E,headers:f,method:u.method,url:te(T,u.path,q),connectTimeout:A(v,U.connect),responseTimeout:A(v,y?U.read:U.write)},_=S=>{let z={request:k,response:S,host:T,triesLeft:P.length};return x.push(z),z},R=await n.send(k);if(ce(R)){let S=_(R);return R.isTimedOut&&v++,t.info("Retryable failure",F(S)),await e.set(T,L(T,R.isTimedOut?"timed out":"down")),D(P,A)}if(me(R))return ae(R);throw _(R),ie(R,x)},K=r.filter(P=>P.accept==="readWrite"||(y?P.accept==="read":P.accept==="write")),N=await c(K);return D([...N.hosts].reverse(),N.getTimeout)}function g(u,m={}){let y=u.useReadTransporter||u.method==="GET";if(!y)return p(u,m,y);let x=()=>p(u,m);if((m.cacheable||u.cacheable)!==!0)return x();let f={request:u,requestOptions:m,transporter:{queryParameters:i,headers:o}};return a.get(f,()=>s.get(f,()=>s.set(f,x()).then(d=>Promise.all([s.delete(f),d]),d=>Promise.all([s.delete(f),Promise.reject(d)])).then(([d,q])=>q)),{miss:d=>a.set(f,d)})}return{hostsCache:e,requester:n,timeouts:h,logger:t,algoliaAgent:l,baseHeaders:o,baseQueryParameters:i,hosts:r,request:g,requestsCache:s,responsesCache:a}}var C="0.0.1-alpha.4",I=["eu","us"];function pe(r){return[{url:"ai-personalization.{region}.algolia.com".replace("{region}",r),accept:"readWrite",protocol:"https"}]}function X({appId:r,apiKey:e,authMode:o,algoliaAgents:t,region:i,...l}){let h=$(r,e,o),n=B({hosts:pe(i),...l,algoliaAgent:Q({algoliaAgents:t,client:"AdvancedPersonalization",version:C}),baseHeaders:{"content-type":"text/plain",...h.headers(),...l.baseHeaders},baseQueryParameters:{...h.queryParameters(),...l.baseQueryParameters}});return{transporter:n,appId:r,apiKey:e,clearCache(){return Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then(()=>{})},get _ua(){return n.algoliaAgent.value},addAlgoliaAgent(s,a){n.algoliaAgent.add({segment:s,version:a})},setClientApiKey({apiKey:s}){!o||o==="WithinHeaders"?n.baseHeaders["x-algolia-api-key"]=s:n.baseQueryParameters["x-algolia-api-key"]=s},computeRealtimeUser({userToken:s},a){if(!s)throw new Error("Parameter `userToken` is required when calling `computeRealtimeUser`.");let u={method:"POST",path:"/2/realtime/users/{userToken}/compute".replace("{userToken}",encodeURIComponent(s)),queryParameters:{},headers:{}};return n.request(u,a)},customDelete({path:s,parameters:a},c){if(!s)throw new Error("Parameter `path` is required when calling `customDelete`.");let m={method:"DELETE",path:"/{path}".replace("{path}",s),queryParameters:a||{},headers:{}};return n.request(m,c)},customGet({path:s,parameters:a},c){if(!s)throw new Error("Parameter `path` is required when calling `customGet`.");let m={method:"GET",path:"/{path}".replace("{path}",s),queryParameters:a||{},headers:{}};return n.request(m,c)},customPost({path:s,parameters:a,body:c},p){if(!s)throw new Error("Parameter `path` is required when calling `customPost`.");let y={method:"POST",path:"/{path}".replace("{path}",s),queryParameters:a||{},headers:{},data:c||{}};return n.request(y,p)},customPut({path:s,parameters:a,body:c},p){if(!s)throw new Error("Parameter `path` is required when calling `customPut`.");let y={method:"PUT",path:"/{path}".replace("{path}",s),queryParameters:a||{},headers:{},data:c||{}};return n.request(y,p)},deleteUser({userID:s},a){if(!s)throw new Error("Parameter `userID` is required when calling `deleteUser`.");let u={method:"DELETE",path:"/2/users/{userID}".replace("{userID}",encodeURIComponent(s)),queryParameters:{},headers:{}};return n.request(u,a)},getConfig(s){let g={method:"GET",path:"/2/config",queryParameters:{},headers:{}};return n.request(g,s)},getRealtimeUser({userToken:s},a){if(!s)throw new Error("Parameter `userToken` is required when calling `getRealtimeUser`.");let u={method:"GET",path:"/2/realtime/users/{userToken}".replace("{userToken}",encodeURIComponent(s)),queryParameters:{},headers:{}};return n.request(u,a)},getUser({userID:s},a){if(!s)throw new Error("Parameter `userID` is required when calling `getUser`.");let u={method:"GET",path:"/2/users/{userID}".replace("{userID}",encodeURIComponent(s)),queryParameters:{},headers:{}};return n.request(u,a)},getUsers({startDate:s,endDate:a,indices:c,affinity:p,limit:g,nextPageToken:u,previousPageToken:m}={},y=void 0){let x="/2/users",E={},f={};s!==void 0&&(f.startDate=s.toString()),a!==void 0&&(f.endDate=a.toString()),c!==void 0&&(f.indices=c.toString()),p!==void 0&&(f.affinity=p.toString()),g!==void 0&&(f.limit=g.toString()),u!==void 0&&(f.nextPageToken=u.toString()),m!==void 0&&(f.previousPageToken=m.toString());let d={method:"GET",path:x,queryParameters:f,headers:E};return n.request(d,y)},putConfig(s,a){if(!s)throw new Error("Parameter `configurationParameters` is required when calling `putConfig`.");if(!s.indices)throw new Error("Parameter `configurationParameters.indices` is required when calling `putConfig`.");if(!s.personalizationReRanking)throw new Error("Parameter `configurationParameters.personalizationReRanking` is required when calling `putConfig`.");if(!s.profileType)throw new Error("Parameter `configurationParameters.profileType` is required when calling `putConfig`.");if(!s.features)throw new Error("Parameter `configurationParameters.features` is required when calling `putConfig`.");let u={method:"PUT",path:"/2/config",queryParameters:{},headers:{},data:s};return n.request(u,a)}}}function Ar(r,e,o,t){if(!r||typeof r!="string")throw new Error("`appId` is missing.");if(!e||typeof e!="string")throw new Error("`apiKey` is missing.");if(!o||o&&(typeof o!="string"||!I.includes(o)))throw new Error(`\`region\` is required and must be one of the following: ${I.join(", ")}`);return X({appId:r,apiKey:e,region:o,timeouts:{connect:1e3,read:2e3,write:3e4},logger:W(),requester:H(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:O(),requestsCache:O({serializable:!1}),hostsCache:w({caches:[j({key:`${C}-${r}`}),O()]}),...t})}export{Ar as advancedPersonalizationClient,C as apiClientVersion};
1
+ function Y(t){let e,r=`algolia-client-js-${t.key}`;function o(){return e===void 0&&(e=t.localStorage||window.localStorage),e}function a(){return JSON.parse(o().getItem(r)||"{}")}function m(s){o().setItem(r,JSON.stringify(s))}function h(){return new Promise(s=>setTimeout(s,0))}function i(){let s=t.timeToLive?t.timeToLive*1e3:null,n=a(),c=new Date().getTime(),p=!1;return{namespace:Object.fromEntries(Object.entries(n).filter(([,d])=>!d||d.timestamp===void 0||s&&d.timestamp+s<c?(p=!0,!1):!0)),changed:p}}return{get(s,n,c={miss:()=>Promise.resolve()}){return h().then(()=>{let{namespace:p,changed:f}=i(),d=p[JSON.stringify(s)];return f&&m(p),d?d.value:n().then(y=>c.miss(y).then(()=>y))})},set(s,n){return h().then(()=>{let c=a();return c[JSON.stringify(s)]={timestamp:new Date().getTime(),value:n},o().setItem(r,JSON.stringify(c)),n})},delete(s){return h().then(()=>{let n=a();delete n[JSON.stringify(s)],o().setItem(r,JSON.stringify(n))})},clear(){return Promise.resolve().then(()=>{o().removeItem(r)})}}}function ce(){return{get(t,e,r={miss:()=>Promise.resolve()}){return e().then(a=>Promise.all([a,r.miss(a)])).then(([a])=>a)},set(t,e){return Promise.resolve(e)},delete(t){return Promise.resolve()},clear(){return Promise.resolve()}}}function O(t){let e=[...t.caches],r=e.shift();return r===void 0?ce():{get(o,a,m={miss:()=>Promise.resolve()}){return r.get(o,a,m).catch(()=>O({caches:e}).get(o,a,m))},set(o,a){return r.set(o,a).catch(()=>O({caches:e}).set(o,a))},delete(o){return r.delete(o).catch(()=>O({caches:e}).delete(o))},clear(){return r.clear().catch(()=>O({caches:e}).clear())}}}function k(t={serializable:!0}){let e={};return{get(r,o,a={miss:()=>Promise.resolve()}){let m=JSON.stringify(r);if(m in e)return Promise.resolve(t.serializable?JSON.parse(e[m]):e[m]);let h=o();return h.then(i=>a.miss(i)).then(()=>h)},set(r,o){return e[JSON.stringify(r)]=t.serializable?JSON.stringify(o):o,Promise.resolve(o)},delete(r){return delete e[JSON.stringify(r)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}function ue(t){let e={value:`Algolia for JavaScript (${t})`,add(r){let o=`; ${r.segment}${r.version!==void 0?` (${r.version})`:""}`;return e.value.indexOf(o)===-1&&(e.value=`${e.value}${o}`),e}};return e}function Z(t,e,r="WithinHeaders"){let o={"x-algolia-api-key":e,"x-algolia-application-id":t};return{headers(){return r==="WithinHeaders"?o:{}},queryParameters(){return r==="WithinQueryParameters"?o:{}}}}function ee({algoliaAgents:t,client:e,version:r}){let o=ue(r).add({segment:e,version:r});return t.forEach(a=>o.add(a)),o}function te(){return{debug(t,e){return Promise.resolve()},info(t,e){return Promise.resolve()},error(t,e){return Promise.resolve()}}}var le=10*1024*1024;async function*me(t){let e=t.getReader();try{for(;;){let{done:r,value:o}=await e.read();if(r)return;yield o}}finally{e.releaseLock()}}function de(t){return Symbol.asyncIterator in t?t:me(t)}async function*pe(t){let e=new TextDecoder("utf-8"),r=[],o=0,a=!1,m=!0;for await(let i of de(t)){let s=e.decode(i,{stream:!0}),n=0;for(a&&(a=!1,s.length>0&&s[0]===`
2
+ `&&(n=1));n<s.length;){let c=s.indexOf("\r",n),p=s.indexOf(`
3
+ `,n);if(c===-1&&p===-1){let u=s.slice(n);if(r.push(u),o+=u.length,o>le)throw new Error("SSE line buffer exceeded 10MB");break}let f,d;c!==-1&&(p===-1||c<p)?(f=c,c+1<s.length?d=s[c+1]===`
4
+ `?2:1:(a=!0,d=1)):(f=p,d=1);let y=s.slice(n,f);r.push(y);let E=r.length===1?r[0]:r.join("");r.length=0,o=0,m&&(E.startsWith("\uFEFF")&&(E=E.slice(1)),m=!1),yield E,n=f+d}}let h=e.decode();if(h&&r.push(h),r.length>0){let i=r.join("");m&&i.startsWith("\uFEFF")&&(i=i.slice(1)),yield i}}var fe=class{data=[];eventType="";lastEventId=null;retry=null;decode(t){if(t==="")return this.dispatch();if(t[0]===":")return null;let e=t.indexOf(":"),r,o;switch(e===-1?(r=t,o=""):(r=t.slice(0,e),o=t.slice(e+1),o[0]===" "&&(o=o.slice(1))),r){case"data":this.data.push(o);break;case"event":this.eventType=o;break;case"id":o.includes("\0")||(this.lastEventId=o);break;case"retry":/^[0-9]+$/.test(o)&&(this.retry=parseInt(o,10));break}return null}dispatch(){let t=this.eventType;if(this.eventType="",this.data.length===0)return null;let e={data:this.data.join(`
5
+ `),event:t,id:this.lastEventId,retry:this.retry};return this.data=[],e}};async function*he(t){let e=new fe;for await(let r of pe(t)){let o=e.decode(r);o!==null&&(yield o)}}var ge=750,M=120*1e3;function Q(t,e="up"){let r=Date.now();function o(){return e==="up"||Date.now()-r>M}function a(){return e==="timed out"&&Date.now()-r<=M}return{...t,status:e,lastUpdate:r,isUp:o,isTimedOut:a}}var re=class extends Error{name="AlgoliaError";constructor(t,e){super(t),e&&(this.name=e)}};var oe=class extends re{stackTrace;constructor(t,e,r){super(t,r),this.stackTrace=e}},B=class extends oe{constructor(t){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",t,"RetryError")}},j=class extends oe{status;constructor(t,e,r,o="ApiError"){super(t,r,o),this.status=e}},Pe=class extends re{response;constructor(t,e){super(t,"DeserializationError"),this.response=e}},ye=class extends j{error;constructor(t,e,r,o){super(t,e,o,"DetailedApiError"),this.error=r}};function X(t,e,r){let o=xe(r),a=`${t.protocol}://${t.url}${t.port?`:${t.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return o.length&&(a+=`?${o}`),a}function xe(t){return Object.keys(t).filter(e=>t[e]!==void 0).sort().map(e=>`${e}=${encodeURIComponent(Object.prototype.toString.call(t[e])==="[object Array]"?t[e].join(","):t[e]).replace(/\+/g,"%20")}`).join("&")}function K(t,e){if(t.method==="GET"||t.data===void 0&&e.data===void 0)return;let r=Array.isArray(t.data)?t.data:{...t.data,...e.data};return JSON.stringify(r)}function V(t,e,r){let o={Accept:"application/json",...t,...e,...r},a={};return Object.keys(o).forEach(m=>{let h=o[m];a[m.toLowerCase()]=h}),a}function Re(t){if(!(t.status===204||t.content.length===0))try{return JSON.parse(t.content)}catch(e){throw new Pe(e.message,t)}}function ve({content:t,status:e},r){try{let o=JSON.parse(t);return"error"in o?new ye(o.message,e,o.error,r):new j(o.message,e,r)}catch{}return new j(t,e,r)}function Te({isTimedOut:t,status:e}){return!t&&~~e===0}function Ee({isTimedOut:t,status:e}){return t||Te({isTimedOut:t,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function qe({status:t}){return~~(t/100)===2}function we(t){return t.map(e=>se(e))}function se(t){let e=t.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...t,request:{...t.request,headers:{...t.request.headers,...e}}}}function ne({hosts:t,hostsCache:e,baseHeaders:r,logger:o,baseQueryParameters:a,algoliaAgent:m,timeouts:h,requester:i,requestsCache:s,responsesCache:n,compress:c,compression:p}){async function f(u){let l=await Promise.all(u.map(g=>e.get(g,()=>Promise.resolve(Q(g))))),P=l.filter(g=>g.isUp()),R=l.filter(g=>g.isTimedOut()),w=[...P,...R];return{hosts:w.length>0?w:u,getTimeout(g,S){return(R.length===0&&g===0?1:R.length+3+g)*S}}}async function d(u,l,P){let R=[],w=K(u,l),x=V(r,u.headers,l.headers),g=p==="gzip"&&w!==void 0&&w.length>ge&&(u.method==="POST"||u.method==="PUT");g&&c===void 0&&o.info("Compression is disabled because no compress method is available.");let S=g&&c!==void 0,_=S?await c(w):w;S&&(x["content-encoding"]="gzip");let I=u.method==="GET"?{...u.data,...l.data}:{},C={...a,...u.queryParameters,...I};if(m.value&&(C["x-algolia-agent"]=m.value),l&&l.queryParameters)for(let v of Object.keys(l.queryParameters))!l.queryParameters[v]||Object.prototype.toString.call(l.queryParameters[v])==="[object Object]"?C[v]=l.queryParameters[v]:C[v]=l.queryParameters[v].toString();let A=0,D=async(v,z)=>{let U=v.pop();if(U===void 0)throw new B(we(R));let H={...h,...l.timeouts},F={data:_,headers:x,method:u.method,url:X(U,u.path,C),connectTimeout:z(A,H.connect),responseTimeout:z(A,P?H.read:H.write)},W=L=>{let J={request:F,response:L,host:U,triesLeft:v.length};return R.push(J),J},b=await i.send(F);if(Ee(b)){let L=W(b);return b.isTimedOut&&A++,o.info("Retryable failure",se(L)),await e.set(U,Q(U,b.isTimedOut?"timed out":"down")),D(v,z)}if(qe(b))return Re(b);throw W(b),ve(b,R)},q=t.filter(v=>v.accept==="readWrite"||(P?v.accept==="read":v.accept==="write")),$=await f(q);return D([...$.hosts].reverse(),$.getTimeout)}function y(u,l={}){let P=()=>d(u,l,R),R=u.useReadTransporter||u.method==="GET";if((l.cacheable||u.cacheable)!==!0)return P();let x={request:u,requestOptions:l,transporter:{queryParameters:a,headers:r}};return n.get(x,()=>s.get(x,()=>s.set(x,P()).then(g=>Promise.all([s.delete(x),g]),g=>Promise.all([s.delete(x),Promise.reject(g)])).then(([g,S])=>S)),{miss:g=>n.set(x,g)})}async function*E(u,l={}){if(!i.sendStream)throw new Error("This requester does not support streaming");let P=K(u,l),R=V(r,u.headers,l.headers);R.accept="text/event-stream";let w=u.method==="GET"?{...u.data,...l.data}:{},x={...a,...u.queryParameters,...w};if(m.value&&(x["x-algolia-agent"]=m.value),l&&l.queryParameters)for(let q of Object.keys(l.queryParameters))!l.queryParameters[q]||Object.prototype.toString.call(l.queryParameters[q])==="[object Object]"?x[q]=l.queryParameters[q]:x[q]=l.queryParameters[q].toString();let g=u.useReadTransporter||u.method==="GET",S=t.filter(q=>q.accept==="readWrite"||(g?q.accept==="read":q.accept==="write")),I=(await f(S)).hosts[0];if(!I)throw new B([]);let C={...h,...l.timeouts},A={data:P,headers:R,method:u.method,url:X(I,u.path,x),connectTimeout:C.connect,responseTimeout:g?C.read:C.write},D=await i.sendStream(A);yield*he(D)}return{hostsCache:e,requester:i,timeouts:h,logger:o,algoliaAgent:m,baseHeaders:r,baseQueryParameters:a,hosts:t,request:y,requestStream:E,requestsCache:s,responsesCache:n}}function T(t,e,r){if(r==null||typeof r=="string"&&r.length===0)throw new Error(`Parameter \`${t}\` is required when calling \`${e}\`.`)}function ae(){function t(e){return new Promise(r=>{let o=new XMLHttpRequest;o.open(e.method,e.url,!0),Object.keys(e.headers).forEach(i=>o.setRequestHeader(i,e.headers[i]));let a=(i,s)=>setTimeout(()=>{o.abort(),r({status:0,content:s,isTimedOut:!0})},i),m=a(e.connectTimeout,"Connection timeout"),h;o.onreadystatechange=()=>{o.readyState>o.OPENED&&h===void 0&&(clearTimeout(m),h=a(e.responseTimeout,"Socket timeout"))},o.onerror=()=>{o.status===0&&(clearTimeout(m),clearTimeout(h),r({content:o.responseText||"Network request failed",status:o.status,isTimedOut:!1}))},o.onload=()=>{clearTimeout(m),clearTimeout(h),r({content:o.responseText,status:o.status,isTimedOut:!1})},o.send(e.data)})}return{send:t}}var N="0.0.1-alpha.40",G=["eu","us"];function Se(t){return[{url:"ai-personalization.{region}.algolia.com".replace("{region}",t),accept:"readWrite",protocol:"https"}]}function ie({appId:t,apiKey:e,authMode:r,algoliaAgents:o,region:a,...m}){let h=Z(t,e,r),i=ne({hosts:Se(a),...m,algoliaAgent:ee({algoliaAgents:o,client:"AdvancedPersonalization",version:N}),baseHeaders:{"content-type":"text/plain",...h.headers(),...m.baseHeaders},baseQueryParameters:{...h.queryParameters(),...m.baseQueryParameters}});return{transporter:i,appId:t,apiKey:e,clearCache(){return Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then(()=>{})},get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(s,n){i.algoliaAgent.add({segment:s,version:n})},setClientApiKey({apiKey:s}){!r||r==="WithinHeaders"?i.baseHeaders["x-algolia-api-key"]=s:i.baseQueryParameters["x-algolia-api-key"]=s},computeRealtimeUser({userToken:s},n){T("userToken","computeRealtimeUser",s);let d={method:"POST",path:"/2/realtime/users/{userToken}/compute".replace("{userToken}",encodeURIComponent(s)),queryParameters:{},headers:{}};return i.request(d,n)},customDelete({path:s,parameters:n},c){T("path","customDelete",s);let y={method:"DELETE",path:"/{path}".replace("{path}",s),queryParameters:n||{},headers:{}};return i.request(y,c)},customGet({path:s,parameters:n},c){T("path","customGet",s);let y={method:"GET",path:"/{path}".replace("{path}",s),queryParameters:n||{},headers:{}};return i.request(y,c)},customPost({path:s,parameters:n,body:c},p){T("path","customPost",s);let E={method:"POST",path:"/{path}".replace("{path}",s),queryParameters:n||{},headers:{},data:c||{}};return i.request(E,p)},customPut({path:s,parameters:n,body:c},p){T("path","customPut",s);let E={method:"PUT",path:"/{path}".replace("{path}",s),queryParameters:n||{},headers:{},data:c||{}};return i.request(E,p)},deleteUser({userID:s},n){T("userID","deleteUser",s);let d={method:"DELETE",path:"/2/users/{userID}".replace("{userID}",encodeURIComponent(s)),queryParameters:{},headers:{}};return i.request(d,n)},getConfig(s){let f={method:"GET",path:"/2/config",queryParameters:{},headers:{}};return i.request(f,s)},getRealtimeUser({userToken:s},n){T("userToken","getRealtimeUser",s);let d={method:"GET",path:"/2/realtime/users/{userToken}".replace("{userToken}",encodeURIComponent(s)),queryParameters:{},headers:{}};return i.request(d,n)},getUser({userID:s},n){T("userID","getUser",s);let d={method:"GET",path:"/2/users/{userID}".replace("{userID}",encodeURIComponent(s)),queryParameters:{},headers:{}};return i.request(d,n)},getUsers({startDate:s,endDate:n,indices:c,affinity:p,limit:f,nextPageToken:d,previousPageToken:y}={},E=void 0){let u="/2/users",l={},P={};s!==void 0&&(P.startDate=s.toString()),n!==void 0&&(P.endDate=n.toString()),c!==void 0&&(P.indices=c.toString()),p!==void 0&&(P.affinity=p.toString()),f!==void 0&&(P.limit=f.toString()),d!==void 0&&(P.nextPageToken=d.toString()),y!==void 0&&(P.previousPageToken=y.toString());let R={method:"GET",path:u,queryParameters:P,headers:l};return i.request(R,E)},putConfig(s,n){T("configurationParameters","putConfig",s),T("configurationParameters.indices","putConfig",s.indices),T("configurationParameters.personalizationReRanking","putConfig",s.personalizationReRanking),T("configurationParameters.profileType","putConfig",s.profileType),T("configurationParameters.features","putConfig",s.features);let d={method:"PUT",path:"/2/config",queryParameters:{},headers:{},data:s};return i.request(d,n)}}}function Wt(t,e,r,o){if(!t||typeof t!="string")throw new Error("`appId` is missing.");if(!e||typeof e!="string")throw new Error("`apiKey` is missing.");if(!r||r&&(typeof r!="string"||!G.includes(r)))throw new Error(`\`region\` is required and must be one of the following: ${G.join(", ")}`);let{compression:a,...m}=o||{};return ie({appId:t,apiKey:e,region:r,timeouts:{connect:1e3,read:2e3,write:3e4},logger:te(),requester:ae(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinHeaders",responsesCache:k(),requestsCache:k({serializable:!1}),hostsCache:O({caches:[Y({key:`${N}-${t}`}),k()]}),...m})}export{Wt as advancedPersonalizationClient,N as apiClientVersion};
2
6
  //# sourceMappingURL=browser.min.js.map