@algolia/client-personalization 5.0.0-alpha.98 → 5.0.0-beta.1

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.
@@ -1,6 +1,24 @@
1
1
  import type { ClientOptions } from '@algolia/client-common';
2
- import type { PersonalizationClient, Region } from '../src/personalizationClient';
3
- export { apiClientVersion, PersonalizationClient, Region, } from '../src/personalizationClient';
2
+ import type { Region } from '../src/personalizationClient';
3
+ export { apiClientVersion, Region } from '../src/personalizationClient';
4
4
  export * from '../model';
5
- export declare function personalizationClient(appId: string, apiKey: string, region: Region, options?: ClientOptions): PersonalizationClient;
5
+ /**
6
+ * The client type.
7
+ */
8
+ export type PersonalizationClient = ReturnType<typeof personalizationClient>;
9
+ export declare function personalizationClient(appId: string, apiKey: string, region: Region, options?: ClientOptions): {
10
+ transporter: import("@algolia/client-common").Transporter;
11
+ appId: string;
12
+ clearCache(): Promise<void>;
13
+ readonly _ua: string;
14
+ addAlgoliaAgent(segment: string, version?: string | undefined): void;
15
+ customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, any>>;
16
+ customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, any>>;
17
+ customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, any>>;
18
+ customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, any>>;
19
+ deleteUserProfile({ userToken }: import("../model").DeleteUserProfileProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").DeleteUserProfileResponse>;
20
+ getPersonalizationStrategy(requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").PersonalizationStrategyParams>;
21
+ getUserTokenProfile({ userToken }: import("../model").GetUserTokenProfileProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").GetUserTokenResponse>;
22
+ setPersonalizationStrategy(personalizationStrategyParams: import("../model").PersonalizationStrategyParams, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").SetPersonalizationStrategyResponse>;
23
+ };
6
24
  //# sourceMappingURL=browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../builds/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAW5D,OAAO,KAAK,EACV,qBAAqB,EACrB,MAAM,EACP,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,MAAM,GACP,MAAM,8BAA8B,CAAC;AACtC,cAAc,UAAU,CAAC;AAEzB,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,aAAa,GACtB,qBAAqB,CAwCvB"}
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../builds/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAW5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAO3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACxE,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAG7E,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,aAAa;;;;;;;;;;;;;;EAyCxB"}
@@ -1,6 +1,24 @@
1
1
  import type { ClientOptions } from '@algolia/client-common';
2
- import type { PersonalizationClient, Region } from '../src/personalizationClient';
3
- export { apiClientVersion, PersonalizationClient, Region, } from '../src/personalizationClient';
2
+ import type { Region } from '../src/personalizationClient';
3
+ export { apiClientVersion, Region } from '../src/personalizationClient';
4
4
  export * from '../model';
5
- export declare function personalizationClient(appId: string, apiKey: string, region: Region, options?: ClientOptions): PersonalizationClient;
5
+ /**
6
+ * The client type.
7
+ */
8
+ export type PersonalizationClient = ReturnType<typeof personalizationClient>;
9
+ export declare function personalizationClient(appId: string, apiKey: string, region: Region, options?: ClientOptions): {
10
+ transporter: import("@algolia/client-common").Transporter;
11
+ appId: string;
12
+ clearCache(): Promise<void>;
13
+ _ua: string;
14
+ addAlgoliaAgent(segment: string, version?: string | undefined): void;
15
+ customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, any>>;
16
+ customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, any>>;
17
+ customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, any>>;
18
+ customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<Record<string, any>>;
19
+ deleteUserProfile({ userToken }: import("../model").DeleteUserProfileProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").DeleteUserProfileResponse>;
20
+ getPersonalizationStrategy(requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").PersonalizationStrategyParams>;
21
+ getUserTokenProfile({ userToken }: import("../model").GetUserTokenProfileProps, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").GetUserTokenResponse>;
22
+ setPersonalizationStrategy(personalizationStrategyParams: import("../model").PersonalizationStrategyParams, requestOptions?: import("@algolia/client-common").RequestOptions | undefined): Promise<import("../model").SetPersonalizationStrategyResponse>;
23
+ };
6
24
  //# sourceMappingURL=node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../builds/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAU5D,OAAO,KAAK,EACV,qBAAqB,EACrB,MAAM,EACP,MAAM,8BAA8B,CAAC;AAMtC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,MAAM,GACP,MAAM,8BAA8B,CAAC;AACtC,cAAc,UAAU,CAAC;AAEzB,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,aAAa,GACtB,qBAAqB,CAkCvB"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../builds/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAU5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAM3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACxE,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAG7E,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,aAAa;;;;;;;;;;;;;;EAqCxB"}
@@ -4,7 +4,7 @@ var clientCommon = require('@algolia/client-common');
4
4
  var requesterNodeHttp = require('@algolia/requester-node-http');
5
5
 
6
6
  // 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.
7
- const apiClientVersion = '5.0.0-alpha.98';
7
+ const apiClientVersion = '5.0.0-beta.1';
8
8
  const REGIONS = ['eu', 'us'];
9
9
  function getDefaultHosts(region) {
10
10
  const url = 'personalization.{region}.algolia.com'.replace('{region}', region);
@@ -64,7 +64,6 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
64
64
  /**
65
65
  * This method allow you to send requests to the Algolia REST API.
66
66
  *
67
- * @summary Send requests to the Algolia REST API.
68
67
  * @param customDelete - The customDelete object.
69
68
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
70
69
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -74,7 +73,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
74
73
  if (!path) {
75
74
  throw new Error('Parameter `path` is required when calling `customDelete`.');
76
75
  }
77
- const requestPath = '/1{path}'.replace('{path}', path);
76
+ const requestPath = '/{path}'.replace('{path}', path);
78
77
  const headers = {};
79
78
  const queryParameters = parameters ? parameters : {};
80
79
  const request = {
@@ -88,7 +87,6 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
88
87
  /**
89
88
  * This method allow you to send requests to the Algolia REST API.
90
89
  *
91
- * @summary Send requests to the Algolia REST API.
92
90
  * @param customGet - The customGet object.
93
91
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
94
92
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -98,7 +96,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
98
96
  if (!path) {
99
97
  throw new Error('Parameter `path` is required when calling `customGet`.');
100
98
  }
101
- const requestPath = '/1{path}'.replace('{path}', path);
99
+ const requestPath = '/{path}'.replace('{path}', path);
102
100
  const headers = {};
103
101
  const queryParameters = parameters ? parameters : {};
104
102
  const request = {
@@ -112,7 +110,6 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
112
110
  /**
113
111
  * This method allow you to send requests to the Algolia REST API.
114
112
  *
115
- * @summary Send requests to the Algolia REST API.
116
113
  * @param customPost - The customPost object.
117
114
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
118
115
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -123,7 +120,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
123
120
  if (!path) {
124
121
  throw new Error('Parameter `path` is required when calling `customPost`.');
125
122
  }
126
- const requestPath = '/1{path}'.replace('{path}', path);
123
+ const requestPath = '/{path}'.replace('{path}', path);
127
124
  const headers = {};
128
125
  const queryParameters = parameters ? parameters : {};
129
126
  const request = {
@@ -138,7 +135,6 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
138
135
  /**
139
136
  * This method allow you to send requests to the Algolia REST API.
140
137
  *
141
- * @summary Send requests to the Algolia REST API.
142
138
  * @param customPut - The customPut object.
143
139
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
144
140
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -149,7 +145,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
149
145
  if (!path) {
150
146
  throw new Error('Parameter `path` is required when calling `customPut`.');
151
147
  }
152
- const requestPath = '/1{path}'.replace('{path}', path);
148
+ const requestPath = '/{path}'.replace('{path}', path);
153
149
  const headers = {};
154
150
  const queryParameters = parameters ? parameters : {};
155
151
  const request = {
@@ -162,11 +158,13 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
162
158
  return transporter.request(request, requestOptions);
163
159
  },
164
160
  /**
165
- * Delete the user profile and all its associated data. Returns, as part of the response, a date until which the data can safely be considered as deleted for the given user. This means if you send events for the given user before this date, they will be ignored. Any data received after the deletedUntil date will start building a new user profile. It might take a couple hours for the deletion request to be fully processed.
161
+ * Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.
162
+ *
163
+ * Required API Key ACLs:
164
+ * - recommendation.
166
165
  *
167
- * @summary Delete a user profile.
168
166
  * @param deleteUserProfile - The deleteUserProfile object.
169
- * @param deleteUserProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
167
+ * @param deleteUserProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
170
168
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
171
169
  */
172
170
  deleteUserProfile({ userToken }, requestOptions) {
@@ -185,9 +183,11 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
185
183
  return transporter.request(request, requestOptions);
186
184
  },
187
185
  /**
188
- * The strategy contains information on the events and facets that impact user profiles and personalized search results.
186
+ * Retrieves the current personalization strategy.
187
+ *
188
+ * Required API Key ACLs:
189
+ * - recommendation.
189
190
  *
190
- * @summary Get the current strategy.
191
191
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
192
192
  */
193
193
  getPersonalizationStrategy(requestOptions) {
@@ -203,11 +203,13 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
203
203
  return transporter.request(request, requestOptions);
204
204
  },
205
205
  /**
206
- * Get the user profile built from Personalization strategy. The profile is structured by facet name used in the strategy. Each facet value is mapped to its score. Each score represents the user affinity for a specific facet value given the userToken past events and the Personalization strategy defined. Scores are bounded to 20. The last processed event timestamp is provided using the ISO 8601 format for debugging purposes.
206
+ * Retrieves a user profile and their affinities for different facets.
207
+ *
208
+ * Required API Key ACLs:
209
+ * - recommendation.
207
210
  *
208
- * @summary Get a user profile.
209
211
  * @param getUserTokenProfile - The getUserTokenProfile object.
210
- * @param getUserTokenProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
212
+ * @param getUserTokenProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
211
213
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
212
214
  */
213
215
  getUserTokenProfile({ userToken }, requestOptions) {
@@ -226,9 +228,11 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
226
228
  return transporter.request(request, requestOptions);
227
229
  },
228
230
  /**
229
- * A strategy defines the events and facets that impact user profiles and personalized search results.
231
+ * Creates a new personalization strategy.
232
+ *
233
+ * Required API Key ACLs:
234
+ * - recommendation.
230
235
  *
231
- * @summary Set a new strategy.
232
236
  * @param personalizationStrategyParams - The personalizationStrategyParams object.
233
237
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
234
238
  */
@@ -261,6 +265,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
261
265
  }
262
266
 
263
267
  // 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.
268
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
264
269
  function personalizationClient(appId, apiKey, region, options) {
265
270
  if (!appId || typeof appId !== 'string') {
266
271
  throw new Error('`appId` is missing.');
@@ -272,22 +277,24 @@ function personalizationClient(appId, apiKey, region, options) {
272
277
  (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
273
278
  throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(', ')}`);
274
279
  }
275
- return createPersonalizationClient({
276
- appId,
277
- apiKey,
278
- region,
279
- timeouts: {
280
- connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
281
- read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
282
- write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
283
- },
284
- requester: requesterNodeHttp.createHttpRequester(),
285
- algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
286
- responsesCache: clientCommon.createNullCache(),
287
- requestsCache: clientCommon.createNullCache(),
288
- hostsCache: clientCommon.createMemoryCache(),
289
- ...options,
290
- });
280
+ return {
281
+ ...createPersonalizationClient({
282
+ appId,
283
+ apiKey,
284
+ region,
285
+ timeouts: {
286
+ connect: clientCommon.DEFAULT_CONNECT_TIMEOUT_NODE,
287
+ read: clientCommon.DEFAULT_READ_TIMEOUT_NODE,
288
+ write: clientCommon.DEFAULT_WRITE_TIMEOUT_NODE,
289
+ },
290
+ requester: requesterNodeHttp.createHttpRequester(),
291
+ algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
292
+ responsesCache: clientCommon.createNullCache(),
293
+ requestsCache: clientCommon.createNullCache(),
294
+ hostsCache: clientCommon.createMemoryCache(),
295
+ ...options,
296
+ }),
297
+ };
291
298
  }
292
299
 
293
300
  exports.apiClientVersion = apiClientVersion;
@@ -207,7 +207,7 @@ function _toPrimitive(t, r) {
207
207
  }
208
208
  function _toPropertyKey(t) {
209
209
  var i = _toPrimitive(t, "string");
210
- return "symbol" == typeof i ? i : String(i);
210
+ return "symbol" == typeof i ? i : i + "";
211
211
  }
212
212
  function _defineProperty(obj, key, value) {
213
213
  key = _toPropertyKey(key);
@@ -270,7 +270,7 @@ class DetailedApiError extends ApiError {
270
270
  }
271
271
  function serializeUrl(host, path, queryParameters) {
272
272
  const queryParametersAsString = serializeQueryParameters(queryParameters);
273
- let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.substr(1) : path}`;
273
+ let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;
274
274
  if (queryParametersAsString.length) {
275
275
  url += `?${queryParametersAsString}`;
276
276
  }
@@ -278,7 +278,7 @@ function serializeUrl(host, path, queryParameters) {
278
278
  }
279
279
  function serializeQueryParameters(parameters) {
280
280
  const isObjectOrArray = value => Object.prototype.toString.call(value) === '[object Object]' || Object.prototype.toString.call(value) === '[object Array]';
281
- return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key])}`).join('&');
281
+ return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]).replaceAll('+', '%20')}`).join('&');
282
282
  }
283
283
  function serializeData(request, requestOptions) {
284
284
  if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {
@@ -449,16 +449,13 @@ function createTransporter({
449
449
  if (host === undefined) {
450
450
  throw new RetryError(stackTraceWithoutCredentials(stackTrace));
451
451
  }
452
- let responseTimeout = requestOptions.timeout;
453
- if (responseTimeout === undefined) {
454
- responseTimeout = isRead ? timeouts.read : timeouts.write;
455
- }
452
+ let responseTimeout = isRead ? requestOptions.timeouts?.read || timeouts.read : requestOptions.timeouts?.write || timeouts.write;
456
453
  const payload = {
457
454
  data,
458
455
  headers,
459
456
  method: request.method,
460
457
  url: serializeUrl(host, request.path, queryParameters),
461
- connectTimeout: getTimeout(timeoutsCount, timeouts.connect),
458
+ connectTimeout: getTimeout(timeoutsCount, requestOptions.timeouts?.connect || timeouts.connect),
462
459
  responseTimeout: getTimeout(timeoutsCount, responseTimeout)
463
460
  };
464
461
  /**
@@ -686,7 +683,7 @@ function createXhrRequester() {
686
683
  }
687
684
 
688
685
  // 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.
689
- const apiClientVersion = '5.0.0-alpha.98';
686
+ const apiClientVersion = '5.0.0-beta.1';
690
687
  const REGIONS = ['eu', 'us'];
691
688
  function getDefaultHosts(region) {
692
689
  const url = 'personalization.{region}.algolia.com'.replace('{region}', region);
@@ -746,7 +743,6 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
746
743
  /**
747
744
  * This method allow you to send requests to the Algolia REST API.
748
745
  *
749
- * @summary Send requests to the Algolia REST API.
750
746
  * @param customDelete - The customDelete object.
751
747
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
752
748
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -756,7 +752,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
756
752
  if (!path) {
757
753
  throw new Error('Parameter `path` is required when calling `customDelete`.');
758
754
  }
759
- const requestPath = '/1{path}'.replace('{path}', path);
755
+ const requestPath = '/{path}'.replace('{path}', path);
760
756
  const headers = {};
761
757
  const queryParameters = parameters ? parameters : {};
762
758
  const request = {
@@ -770,7 +766,6 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
770
766
  /**
771
767
  * This method allow you to send requests to the Algolia REST API.
772
768
  *
773
- * @summary Send requests to the Algolia REST API.
774
769
  * @param customGet - The customGet object.
775
770
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
776
771
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -780,7 +775,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
780
775
  if (!path) {
781
776
  throw new Error('Parameter `path` is required when calling `customGet`.');
782
777
  }
783
- const requestPath = '/1{path}'.replace('{path}', path);
778
+ const requestPath = '/{path}'.replace('{path}', path);
784
779
  const headers = {};
785
780
  const queryParameters = parameters ? parameters : {};
786
781
  const request = {
@@ -794,7 +789,6 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
794
789
  /**
795
790
  * This method allow you to send requests to the Algolia REST API.
796
791
  *
797
- * @summary Send requests to the Algolia REST API.
798
792
  * @param customPost - The customPost object.
799
793
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
800
794
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -805,7 +799,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
805
799
  if (!path) {
806
800
  throw new Error('Parameter `path` is required when calling `customPost`.');
807
801
  }
808
- const requestPath = '/1{path}'.replace('{path}', path);
802
+ const requestPath = '/{path}'.replace('{path}', path);
809
803
  const headers = {};
810
804
  const queryParameters = parameters ? parameters : {};
811
805
  const request = {
@@ -820,7 +814,6 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
820
814
  /**
821
815
  * This method allow you to send requests to the Algolia REST API.
822
816
  *
823
- * @summary Send requests to the Algolia REST API.
824
817
  * @param customPut - The customPut object.
825
818
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
826
819
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -831,7 +824,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
831
824
  if (!path) {
832
825
  throw new Error('Parameter `path` is required when calling `customPut`.');
833
826
  }
834
- const requestPath = '/1{path}'.replace('{path}', path);
827
+ const requestPath = '/{path}'.replace('{path}', path);
835
828
  const headers = {};
836
829
  const queryParameters = parameters ? parameters : {};
837
830
  const request = {
@@ -844,11 +837,13 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
844
837
  return transporter.request(request, requestOptions);
845
838
  },
846
839
  /**
847
- * Delete the user profile and all its associated data. Returns, as part of the response, a date until which the data can safely be considered as deleted for the given user. This means if you send events for the given user before this date, they will be ignored. Any data received after the deletedUntil date will start building a new user profile. It might take a couple hours for the deletion request to be fully processed.
840
+ * Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.
841
+ *
842
+ * Required API Key ACLs:
843
+ * - recommendation.
848
844
  *
849
- * @summary Delete a user profile.
850
845
  * @param deleteUserProfile - The deleteUserProfile object.
851
- * @param deleteUserProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
846
+ * @param deleteUserProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
852
847
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
853
848
  */
854
849
  deleteUserProfile({ userToken }, requestOptions) {
@@ -867,9 +862,11 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
867
862
  return transporter.request(request, requestOptions);
868
863
  },
869
864
  /**
870
- * The strategy contains information on the events and facets that impact user profiles and personalized search results.
865
+ * Retrieves the current personalization strategy.
866
+ *
867
+ * Required API Key ACLs:
868
+ * - recommendation.
871
869
  *
872
- * @summary Get the current strategy.
873
870
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
874
871
  */
875
872
  getPersonalizationStrategy(requestOptions) {
@@ -885,11 +882,13 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
885
882
  return transporter.request(request, requestOptions);
886
883
  },
887
884
  /**
888
- * Get the user profile built from Personalization strategy. The profile is structured by facet name used in the strategy. Each facet value is mapped to its score. Each score represents the user affinity for a specific facet value given the userToken past events and the Personalization strategy defined. Scores are bounded to 20. The last processed event timestamp is provided using the ISO 8601 format for debugging purposes.
885
+ * Retrieves a user profile and their affinities for different facets.
886
+ *
887
+ * Required API Key ACLs:
888
+ * - recommendation.
889
889
  *
890
- * @summary Get a user profile.
891
890
  * @param getUserTokenProfile - The getUserTokenProfile object.
892
- * @param getUserTokenProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
891
+ * @param getUserTokenProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
893
892
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
894
893
  */
895
894
  getUserTokenProfile({ userToken }, requestOptions) {
@@ -908,9 +907,11 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
908
907
  return transporter.request(request, requestOptions);
909
908
  },
910
909
  /**
911
- * A strategy defines the events and facets that impact user profiles and personalized search results.
910
+ * Creates a new personalization strategy.
911
+ *
912
+ * Required API Key ACLs:
913
+ * - recommendation.
912
914
  *
913
- * @summary Set a new strategy.
914
915
  * @param personalizationStrategyParams - The personalizationStrategyParams object.
915
916
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
916
917
  */
@@ -943,6 +944,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
943
944
  }
944
945
 
945
946
  // 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.
947
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
946
948
  function personalizationClient(appId, apiKey, region, options) {
947
949
  if (!appId || typeof appId !== 'string') {
948
950
  throw new Error('`appId` is missing.');
@@ -2,7 +2,7 @@ import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT
2
2
  import { createHttpRequester } from '@algolia/requester-node-http';
3
3
 
4
4
  // 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.
5
- const apiClientVersion = '5.0.0-alpha.98';
5
+ const apiClientVersion = '5.0.0-beta.1';
6
6
  const REGIONS = ['eu', 'us'];
7
7
  function getDefaultHosts(region) {
8
8
  const url = 'personalization.{region}.algolia.com'.replace('{region}', region);
@@ -62,7 +62,6 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
62
62
  /**
63
63
  * This method allow you to send requests to the Algolia REST API.
64
64
  *
65
- * @summary Send requests to the Algolia REST API.
66
65
  * @param customDelete - The customDelete object.
67
66
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
68
67
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -72,7 +71,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
72
71
  if (!path) {
73
72
  throw new Error('Parameter `path` is required when calling `customDelete`.');
74
73
  }
75
- const requestPath = '/1{path}'.replace('{path}', path);
74
+ const requestPath = '/{path}'.replace('{path}', path);
76
75
  const headers = {};
77
76
  const queryParameters = parameters ? parameters : {};
78
77
  const request = {
@@ -86,7 +85,6 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
86
85
  /**
87
86
  * This method allow you to send requests to the Algolia REST API.
88
87
  *
89
- * @summary Send requests to the Algolia REST API.
90
88
  * @param customGet - The customGet object.
91
89
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
92
90
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -96,7 +94,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
96
94
  if (!path) {
97
95
  throw new Error('Parameter `path` is required when calling `customGet`.');
98
96
  }
99
- const requestPath = '/1{path}'.replace('{path}', path);
97
+ const requestPath = '/{path}'.replace('{path}', path);
100
98
  const headers = {};
101
99
  const queryParameters = parameters ? parameters : {};
102
100
  const request = {
@@ -110,7 +108,6 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
110
108
  /**
111
109
  * This method allow you to send requests to the Algolia REST API.
112
110
  *
113
- * @summary Send requests to the Algolia REST API.
114
111
  * @param customPost - The customPost object.
115
112
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
116
113
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -121,7 +118,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
121
118
  if (!path) {
122
119
  throw new Error('Parameter `path` is required when calling `customPost`.');
123
120
  }
124
- const requestPath = '/1{path}'.replace('{path}', path);
121
+ const requestPath = '/{path}'.replace('{path}', path);
125
122
  const headers = {};
126
123
  const queryParameters = parameters ? parameters : {};
127
124
  const request = {
@@ -136,7 +133,6 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
136
133
  /**
137
134
  * This method allow you to send requests to the Algolia REST API.
138
135
  *
139
- * @summary Send requests to the Algolia REST API.
140
136
  * @param customPut - The customPut object.
141
137
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
142
138
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -147,7 +143,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
147
143
  if (!path) {
148
144
  throw new Error('Parameter `path` is required when calling `customPut`.');
149
145
  }
150
- const requestPath = '/1{path}'.replace('{path}', path);
146
+ const requestPath = '/{path}'.replace('{path}', path);
151
147
  const headers = {};
152
148
  const queryParameters = parameters ? parameters : {};
153
149
  const request = {
@@ -160,11 +156,13 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
160
156
  return transporter.request(request, requestOptions);
161
157
  },
162
158
  /**
163
- * Delete the user profile and all its associated data. Returns, as part of the response, a date until which the data can safely be considered as deleted for the given user. This means if you send events for the given user before this date, they will be ignored. Any data received after the deletedUntil date will start building a new user profile. It might take a couple hours for the deletion request to be fully processed.
159
+ * Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.
160
+ *
161
+ * Required API Key ACLs:
162
+ * - recommendation.
164
163
  *
165
- * @summary Delete a user profile.
166
164
  * @param deleteUserProfile - The deleteUserProfile object.
167
- * @param deleteUserProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
165
+ * @param deleteUserProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
168
166
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
169
167
  */
170
168
  deleteUserProfile({ userToken }, requestOptions) {
@@ -183,9 +181,11 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
183
181
  return transporter.request(request, requestOptions);
184
182
  },
185
183
  /**
186
- * The strategy contains information on the events and facets that impact user profiles and personalized search results.
184
+ * Retrieves the current personalization strategy.
185
+ *
186
+ * Required API Key ACLs:
187
+ * - recommendation.
187
188
  *
188
- * @summary Get the current strategy.
189
189
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
190
190
  */
191
191
  getPersonalizationStrategy(requestOptions) {
@@ -201,11 +201,13 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
201
201
  return transporter.request(request, requestOptions);
202
202
  },
203
203
  /**
204
- * Get the user profile built from Personalization strategy. The profile is structured by facet name used in the strategy. Each facet value is mapped to its score. Each score represents the user affinity for a specific facet value given the userToken past events and the Personalization strategy defined. Scores are bounded to 20. The last processed event timestamp is provided using the ISO 8601 format for debugging purposes.
204
+ * Retrieves a user profile and their affinities for different facets.
205
+ *
206
+ * Required API Key ACLs:
207
+ * - recommendation.
205
208
  *
206
- * @summary Get a user profile.
207
209
  * @param getUserTokenProfile - The getUserTokenProfile object.
208
- * @param getUserTokenProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
210
+ * @param getUserTokenProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
209
211
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
210
212
  */
211
213
  getUserTokenProfile({ userToken }, requestOptions) {
@@ -224,9 +226,11 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
224
226
  return transporter.request(request, requestOptions);
225
227
  },
226
228
  /**
227
- * A strategy defines the events and facets that impact user profiles and personalized search results.
229
+ * Creates a new personalization strategy.
230
+ *
231
+ * Required API Key ACLs:
232
+ * - recommendation.
228
233
  *
229
- * @summary Set a new strategy.
230
234
  * @param personalizationStrategyParams - The personalizationStrategyParams object.
231
235
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
232
236
  */
@@ -259,6 +263,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
259
263
  }
260
264
 
261
265
  // 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.
266
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
262
267
  function personalizationClient(appId, apiKey, region, options) {
263
268
  if (!appId || typeof appId !== 'string') {
264
269
  throw new Error('`appId` is missing.');
@@ -270,22 +275,24 @@ function personalizationClient(appId, apiKey, region, options) {
270
275
  (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {
271
276
  throw new Error(`\`region\` is required and must be one of the following: ${REGIONS.join(', ')}`);
272
277
  }
273
- return createPersonalizationClient({
274
- appId,
275
- apiKey,
276
- region,
277
- timeouts: {
278
- connect: DEFAULT_CONNECT_TIMEOUT_NODE,
279
- read: DEFAULT_READ_TIMEOUT_NODE,
280
- write: DEFAULT_WRITE_TIMEOUT_NODE,
281
- },
282
- requester: createHttpRequester(),
283
- algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
284
- responsesCache: createNullCache(),
285
- requestsCache: createNullCache(),
286
- hostsCache: createMemoryCache(),
287
- ...options,
288
- });
278
+ return {
279
+ ...createPersonalizationClient({
280
+ appId,
281
+ apiKey,
282
+ region,
283
+ timeouts: {
284
+ connect: DEFAULT_CONNECT_TIMEOUT_NODE,
285
+ read: DEFAULT_READ_TIMEOUT_NODE,
286
+ write: DEFAULT_WRITE_TIMEOUT_NODE,
287
+ },
288
+ requester: createHttpRequester(),
289
+ algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],
290
+ responsesCache: createNullCache(),
291
+ requestsCache: createNullCache(),
292
+ hostsCache: createMemoryCache(),
293
+ ...options,
294
+ }),
295
+ };
289
296
  }
290
297
 
291
298
  export { apiClientVersion, personalizationClient };
@@ -1,2 +1,2 @@
1
- /*! client-personalization.umd.js | 5.0.0-alpha.98 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
2
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-personalization"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function s(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(s().getItem(r)||"{}")}function o(e){s().setItem(r,JSON.stringify(e))}return{get:(t,r,s={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>(function(){const t=e.timeToLive?1e3*e.timeToLive:null,r=a(),s=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(o(s),!t)return;o(Object.fromEntries(Object.entries(s).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+t<r)}))))}(),a()[JSON.stringify(t)]))).then((e=>Promise.all([e?e.value:r(),void 0!==e]))).then((([e,t])=>Promise.all([e,t||s.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const o=a();return o[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},s().setItem(r,JSON.stringify(o)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,o={miss:()=>Promise.resolve()})=>s.get(e,a,o).catch((()=>r({caches:t}).get(e,a,o))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const o=JSON.stringify(r);if(o in t)return Promise.resolve(e.serializable?JSON.parse(t[o]):t[o]);const n=s();return n.then((e=>a.miss(e))).then((()=>n))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function o(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function n(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function i(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class c extends Error{constructor(e,t){super(e),i(this,"name","AlgoliaError"),t&&(this.name=t)}}class u extends c{constructor(e,t,r){super(e,r),i(this,"stackTrace",void 0),this.stackTrace=t}}class l extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please create a ticket at https://support.algolia.com/ sharing steps we can use to reproduce the issue.",e,"RetryError")}}class m extends u{constructor(e,t,r,s="ApiError"){super(e,r,s),i(this,"status",void 0),this.status=t}}class h extends c{constructor(e,t){super(e,"DeserializationError"),i(this,"response",void 0),this.response=t}}class d extends m{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),i(this,"error",void 0),this.error=r}}function p(e,t,r){const s=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r])}`)).join("&")}(r);let a=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return s.length&&(a+=`?${s}`),a}function g(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function f({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:n,requester:i,requestsCache:c,responsesCache:u}){async function f(c,u,f=!0){const y=[],P=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,u),w=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,c.headers,u.headers),v="GET"===c.method?{...c.data,...u.data}:{},q={...s,...c.queryParameters,...v};if(a.value&&(q["x-algolia-agent"]=a.value),u&&u.queryParameters)for(const e of Object.keys(u.queryParameters))u.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(u.queryParameters[e])?q[e]=u.queryParameters[e].toString():q[e]=u.queryParameters[e];let T=0;const b=async(e,r)=>{const s=e.pop();if(void 0===s)throw new l(function(e){return e.map((e=>g(e)))}(y));let a=u.timeout;void 0===a&&(a=f?n.read:n.write);const v={data:P,headers:w,method:c.method,url:p(s,c.path,q),connectTimeout:r(T,n.connect),responseTimeout:r(T,a)},O=t=>{const r={request:v,response:t,host:s,triesLeft:e.length};return y.push(r),r},S=await i.send(v);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(S)){const a=O(S);return S.isTimedOut&&T++,console.log("Retryable failure",g(a)),await t.set(s,o(s,S.isTimedOut?"timed out":"down")),b(e,r)}if(function({status:e}){return 2==~~(e/100)}(S))return function(e){try{return JSON.parse(e.content)}catch(t){throw new h(t.message,e)}}(S);throw O(S),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new d(s.message,t,s.error,r):new m(s.message,t,r)}catch(e){}return new m(e,t,r)}(S,y)},O=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),S=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(o(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),n=[...s,...a];return{hosts:n.length>0?n:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(O);return b([...S.hosts].reverse(),S.getTimeout)}return{hostsCache:t,requester:i,timeouts:n,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return f(e,t,a);const o=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return o();const n={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return u.get(n,(()=>c.get(n,(()=>c.set(n,o()).then((e=>Promise.all([c.delete(n),e])),(e=>Promise.all([c.delete(n),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>u.set(n,e)})},requestsCache:c,responsesCache:u}}function y({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const P="5.0.0-alpha.98",w=["eu","us"];e.apiClientVersion=P,e.personalizationClient=function(e,a,o,n){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");if(!o||o&&("string"!=typeof o||!w.includes(o)))throw new Error(`\`region\` is required and must be one of the following: ${w.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,region:a,...o}){const n=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),i=f({hosts:(c=a,[{url:"personalization.{region}.algolia.com".replace("{region}",c),accept:"readWrite",protocol:"https"}]),...o,algoliaAgent:y({algoliaAgents:s,client:"Personalization",version:P}),baseHeaders:{"content-type":"text/plain",...n.headers(),...o.baseHeaders},baseQueryParameters:{...n.queryParameters(),...o.baseQueryParameters}});var c;return{transporter:i,appId:e,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then((()=>{})),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,t){i.algoliaAgent.add({segment:e,version:t})},customDelete({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const s={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},customGet({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const s={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},customPost({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const a={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},customPut({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const a={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},deleteUserProfile({userToken:e},t){if(!e)throw new Error("Parameter `userToken` is required when calling `deleteUserProfile`.");const r={method:"DELETE",path:"/1/profiles/{userToken}".replace("{userToken}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getPersonalizationStrategy(e){const t={method:"GET",path:"/1/strategies/personalization",queryParameters:{},headers:{}};return i.request(t,e)},getUserTokenProfile({userToken:e},t){if(!e)throw new Error("Parameter `userToken` is required when calling `getUserTokenProfile`.");const r={method:"GET",path:"/1/profiles/personalization/{userToken}".replace("{userToken}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},setPersonalizationStrategy(e,t){if(!e)throw new Error("Parameter `personalizationStrategyParams` is required when calling `setPersonalizationStrategy`.");if(!e.eventScoring)throw new Error("Parameter `personalizationStrategyParams.eventScoring` is required when calling `setPersonalizationStrategy`.");if(!e.facetScoring)throw new Error("Parameter `personalizationStrategyParams.facetScoring` is required when calling `setPersonalizationStrategy`.");if(!e.personalizationImpact)throw new Error("Parameter `personalizationStrategyParams.personalizationImpact` is required when calling `setPersonalizationStrategy`.");const r={method:"POST",path:"/1/strategies/personalization",queryParameters:{},headers:{},data:e};return i.request(r,t)}}}({appId:e,apiKey:a,region:o,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let o;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===o&&(clearTimeout(a),o=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(o),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(o),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`${P}-${e}`}),s()]}),...n})}}));
1
+ /*! client-personalization.umd.js | 5.0.0-beta.1 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
2
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-personalization"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function s(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(s().getItem(r)||"{}")}function o(e){s().setItem(r,JSON.stringify(e))}return{get:(t,r,s={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>(function(){const t=e.timeToLive?1e3*e.timeToLive:null,r=a(),s=Object.fromEntries(Object.entries(r).filter((([,e])=>void 0!==e.timestamp)));if(o(s),!t)return;o(Object.fromEntries(Object.entries(s).filter((([,e])=>{const r=(new Date).getTime();return!(e.timestamp+t<r)}))))}(),a()[JSON.stringify(t)]))).then((e=>Promise.all([e?e.value:r(),void 0!==e]))).then((([e,t])=>Promise.all([e,t||s.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const o=a();return o[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},s().setItem(r,JSON.stringify(o)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,o={miss:()=>Promise.resolve()})=>s.get(e,a,o).catch((()=>r({caches:t}).get(e,a,o))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const o=JSON.stringify(r);if(o in t)return Promise.resolve(e.serializable?JSON.parse(t[o]):t[o]);const n=s();return n.then((e=>a.miss(e))).then((()=>n))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function o(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function n(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function i(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class c extends Error{constructor(e,t){super(e),i(this,"name","AlgoliaError"),t&&(this.name=t)}}class u extends c{constructor(e,t,r){super(e,r),i(this,"stackTrace",void 0),this.stackTrace=t}}class l extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please create a ticket at https://support.algolia.com/ sharing steps we can use to reproduce the issue.",e,"RetryError")}}class m extends u{constructor(e,t,r,s="ApiError"){super(e,r,s),i(this,"status",void 0),this.status=t}}class h extends c{constructor(e,t){super(e,"DeserializationError"),i(this,"response",void 0),this.response=t}}class d extends m{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),i(this,"error",void 0),this.error=r}}function p(e,t,r){const s=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r]).replaceAll("+","%20")}`)).join("&")}(r);let a=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(1):t}`;return s.length&&(a+=`?${s}`),a}function g(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function f({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:n,requester:i,requestsCache:c,responsesCache:u}){async function f(c,u,f=!0){const y=[],P=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,u),w=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,c.headers,u.headers),v="GET"===c.method?{...c.data,...u.data}:{},q={...s,...c.queryParameters,...v};if(a.value&&(q["x-algolia-agent"]=a.value),u&&u.queryParameters)for(const e of Object.keys(u.queryParameters))u.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(u.queryParameters[e])?q[e]=u.queryParameters[e].toString():q[e]=u.queryParameters[e];let T=0;const b=async(e,r)=>{const s=e.pop();if(void 0===s)throw new l(function(e){return e.map((e=>g(e)))}(y));let a=f?u.timeouts?.read||n.read:u.timeouts?.write||n.write;const v={data:P,headers:w,method:c.method,url:p(s,c.path,q),connectTimeout:r(T,u.timeouts?.connect||n.connect),responseTimeout:r(T,a)},O=t=>{const r={request:v,response:t,host:s,triesLeft:e.length};return y.push(r),r},S=await i.send(v);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&!~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(S)){const a=O(S);return S.isTimedOut&&T++,console.log("Retryable failure",g(a)),await t.set(s,o(s,S.isTimedOut?"timed out":"down")),b(e,r)}if(function({status:e}){return 2==~~(e/100)}(S))return function(e){try{return JSON.parse(e.content)}catch(t){throw new h(t.message,e)}}(S);throw O(S),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new d(s.message,t,s.error,r):new m(s.message,t,r)}catch(e){}return new m(e,t,r)}(S,y)},O=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),S=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(o(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),n=[...s,...a];return{hosts:n.length>0?n:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(O);return b([...S.hosts].reverse(),S.getTimeout)}return{hostsCache:t,requester:i,timeouts:n,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return f(e,t,a);const o=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return o();const n={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return u.get(n,(()=>c.get(n,(()=>c.set(n,o()).then((e=>Promise.all([c.delete(n),e])),(e=>Promise.all([c.delete(n),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>u.set(n,e)})},requestsCache:c,responsesCache:u}}function y({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const P="5.0.0-beta.1",w=["eu","us"];e.apiClientVersion=P,e.personalizationClient=function(e,a,o,n){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");if(!o||o&&("string"!=typeof o||!w.includes(o)))throw new Error(`\`region\` is required and must be one of the following: ${w.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,region:a,...o}){const n=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),i=f({hosts:(c=a,[{url:"personalization.{region}.algolia.com".replace("{region}",c),accept:"readWrite",protocol:"https"}]),...o,algoliaAgent:y({algoliaAgents:s,client:"Personalization",version:P}),baseHeaders:{"content-type":"text/plain",...n.headers(),...o.baseHeaders},baseQueryParameters:{...n.queryParameters(),...o.baseQueryParameters}});var c;return{transporter:i,appId:e,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then((()=>{})),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,t){i.algoliaAgent.add({segment:e,version:t})},customDelete({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const s={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},customGet({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const s={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},customPost({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const a={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},customPut({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const a={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},deleteUserProfile({userToken:e},t){if(!e)throw new Error("Parameter `userToken` is required when calling `deleteUserProfile`.");const r={method:"DELETE",path:"/1/profiles/{userToken}".replace("{userToken}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getPersonalizationStrategy(e){const t={method:"GET",path:"/1/strategies/personalization",queryParameters:{},headers:{}};return i.request(t,e)},getUserTokenProfile({userToken:e},t){if(!e)throw new Error("Parameter `userToken` is required when calling `getUserTokenProfile`.");const r={method:"GET",path:"/1/profiles/personalization/{userToken}".replace("{userToken}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},setPersonalizationStrategy(e,t){if(!e)throw new Error("Parameter `personalizationStrategyParams` is required when calling `setPersonalizationStrategy`.");if(!e.eventScoring)throw new Error("Parameter `personalizationStrategyParams.eventScoring` is required when calling `setPersonalizationStrategy`.");if(!e.facetScoring)throw new Error("Parameter `personalizationStrategyParams.facetScoring` is required when calling `setPersonalizationStrategy`.");if(!e.personalizationImpact)throw new Error("Parameter `personalizationStrategyParams.personalizationImpact` is required when calling `setPersonalizationStrategy`.");const r={method:"POST",path:"/1/strategies/personalization",queryParameters:{},headers:{},data:e};return i.request(r,t)}}}({appId:e,apiKey:a,region:o,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let o;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===o&&(clearTimeout(a),o=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(o),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(o),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`${P}-${e}`}),s()]}),...n})}}));
@@ -63,7 +63,7 @@ export type CustomPutProps = {
63
63
  */
64
64
  export type DeleteUserProfileProps = {
65
65
  /**
66
- * UserToken representing the user for which to fetch the Personalization profile.
66
+ * Unique identifier representing a user for which to fetch the personalization profile.
67
67
  */
68
68
  userToken: string;
69
69
  };
@@ -72,7 +72,7 @@ export type DeleteUserProfileProps = {
72
72
  */
73
73
  export type GetUserTokenProfileProps = {
74
74
  /**
75
- * UserToken representing the user for which to fetch the Personalization profile.
75
+ * Unique identifier representing a user for which to fetch the personalization profile.
76
76
  */
77
77
  userToken: string;
78
78
  };
@@ -1,10 +1,10 @@
1
1
  export type DeleteUserProfileResponse = {
2
2
  /**
3
- * UserToken representing the user for which to fetch the Personalization profile.
3
+ * Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
4
4
  */
5
5
  userToken: string;
6
6
  /**
7
- * A date until which the data can safely be considered as deleted for the given user. Any data received after the `deletedUntil` date will start building a new user profile.
7
+ * Date and time when the user profile can be safely considered to be deleted. Any events received after the `deletedUntil` date start a new user profile.
8
8
  */
9
9
  deletedUntil: string;
10
10
  };
@@ -1,15 +1,13 @@
1
+ import type { EventType } from './eventType';
1
2
  export type EventScoring = {
2
3
  /**
3
- * The score for the event.
4
+ * Event score.
4
5
  */
5
6
  score: number;
6
7
  /**
7
- * The name of the event.
8
+ * Event name.
8
9
  */
9
10
  eventName: string;
10
- /**
11
- * The type of the event.
12
- */
13
- eventType: string;
11
+ eventType: EventType;
14
12
  };
15
13
  //# sourceMappingURL=eventScoring.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eventScoring.d.ts","sourceRoot":"","sources":["../../model/eventScoring.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
1
+ {"version":3,"file":"eventScoring.d.ts","sourceRoot":"","sources":["../../model/eventScoring.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Event type.
3
+ */
4
+ export type EventType = 'click' | 'conversion' | 'view';
5
+ //# sourceMappingURL=eventType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventType.d.ts","sourceRoot":"","sources":["../../model/eventType.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,MAAM,CAAC"}
@@ -1,10 +1,10 @@
1
1
  export type FacetScoring = {
2
2
  /**
3
- * The score for the event.
3
+ * Event score.
4
4
  */
5
5
  score: number;
6
6
  /**
7
- * The name of the facet.
7
+ * Facet attribute name.
8
8
  */
9
9
  facetName: string;
10
10
  };
@@ -1,14 +1,14 @@
1
1
  export type GetUserTokenResponse = {
2
2
  /**
3
- * UserToken representing the user for which to fetch the Personalization profile.
3
+ * Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
4
4
  */
5
5
  userToken: string;
6
6
  /**
7
- * Date of last event update. (ISO-8601 format).
7
+ * Date and time of the last event from this user, in RFC 3339 format.
8
8
  */
9
9
  lastEventAt: string;
10
10
  /**
11
- * The userToken scores.
11
+ * Scores for different facet values. Scores represent the user affinity for a user profile towards specific facet values, given the personalization strategy and past events.
12
12
  */
13
13
  scores: Record<string, any>;
14
14
  };
@@ -1,6 +1,7 @@
1
1
  export * from './deleteUserProfileResponse';
2
2
  export * from './errorBase';
3
3
  export * from './eventScoring';
4
+ export * from './eventType';
4
5
  export * from './facetScoring';
5
6
  export * from './getUserTokenResponse';
6
7
  export * from './personalizationStrategyParams';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../model/index.ts"],"names":[],"mappings":"AAEA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../model/index.ts"],"names":[],"mappings":"AAEA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,cAAc,qBAAqB,CAAC"}
@@ -2,15 +2,15 @@ import type { EventScoring } from './eventScoring';
2
2
  import type { FacetScoring } from './facetScoring';
3
3
  export type PersonalizationStrategyParams = {
4
4
  /**
5
- * Scores associated with the events.
5
+ * Scores associated with each event. The higher the scores, the higher the impact of those events on the personalization of search results.
6
6
  */
7
7
  eventScoring: EventScoring[];
8
8
  /**
9
- * Scores associated with the facets.
9
+ * Scores associated with each facet. The higher the scores, the higher the impact of those events on the personalization of search results.
10
10
  */
11
11
  facetScoring: FacetScoring[];
12
12
  /**
13
- * The impact that personalization has on search results: a number between 0 (personalization disabled) and 100 (personalization fully enabled).
13
+ * Impact of personalization on the search results. If set to 0, personalization has no impact on the search results.
14
14
  */
15
15
  personalizationImpact: number;
16
16
  };
@@ -4,7 +4,7 @@ import type { DeleteUserProfileResponse } from '../model/deleteUserProfileRespon
4
4
  import type { GetUserTokenResponse } from '../model/getUserTokenResponse';
5
5
  import type { PersonalizationStrategyParams } from '../model/personalizationStrategyParams';
6
6
  import type { SetPersonalizationStrategyResponse } from '../model/setPersonalizationStrategyResponse';
7
- export declare const apiClientVersion = "5.0.0-alpha.98";
7
+ export declare const apiClientVersion = "5.0.0-beta.1";
8
8
  export declare const REGIONS: readonly ["eu", "us"];
9
9
  export type Region = (typeof REGIONS)[number];
10
10
  export declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
@@ -33,7 +33,6 @@ export declare function createPersonalizationClient({ appId: appIdOption, apiKey
33
33
  /**
34
34
  * This method allow you to send requests to the Algolia REST API.
35
35
  *
36
- * @summary Send requests to the Algolia REST API.
37
36
  * @param customDelete - The customDelete object.
38
37
  * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
39
38
  * @param customDelete.parameters - Query parameters to apply to the current query.
@@ -43,7 +42,6 @@ export declare function createPersonalizationClient({ appId: appIdOption, apiKey
43
42
  /**
44
43
  * This method allow you to send requests to the Algolia REST API.
45
44
  *
46
- * @summary Send requests to the Algolia REST API.
47
45
  * @param customGet - The customGet object.
48
46
  * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
49
47
  * @param customGet.parameters - Query parameters to apply to the current query.
@@ -53,7 +51,6 @@ export declare function createPersonalizationClient({ appId: appIdOption, apiKey
53
51
  /**
54
52
  * This method allow you to send requests to the Algolia REST API.
55
53
  *
56
- * @summary Send requests to the Algolia REST API.
57
54
  * @param customPost - The customPost object.
58
55
  * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
59
56
  * @param customPost.parameters - Query parameters to apply to the current query.
@@ -64,7 +61,6 @@ export declare function createPersonalizationClient({ appId: appIdOption, apiKey
64
61
  /**
65
62
  * This method allow you to send requests to the Algolia REST API.
66
63
  *
67
- * @summary Send requests to the Algolia REST API.
68
64
  * @param customPut - The customPut object.
69
65
  * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
70
66
  * @param customPut.parameters - Query parameters to apply to the current query.
@@ -73,41 +69,45 @@ export declare function createPersonalizationClient({ appId: appIdOption, apiKey
73
69
  */
74
70
  customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
75
71
  /**
76
- * Delete the user profile and all its associated data. Returns, as part of the response, a date until which the data can safely be considered as deleted for the given user. This means if you send events for the given user before this date, they will be ignored. Any data received after the deletedUntil date will start building a new user profile. It might take a couple hours for the deletion request to be fully processed.
72
+ * Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.
73
+ *
74
+ * Required API Key ACLs:
75
+ * - recommendation.
77
76
  *
78
- * @summary Delete a user profile.
79
77
  * @param deleteUserProfile - The deleteUserProfile object.
80
- * @param deleteUserProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
78
+ * @param deleteUserProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
81
79
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
82
80
  */
83
81
  deleteUserProfile({ userToken }: DeleteUserProfileProps, requestOptions?: RequestOptions): Promise<DeleteUserProfileResponse>;
84
82
  /**
85
- * The strategy contains information on the events and facets that impact user profiles and personalized search results.
83
+ * Retrieves the current personalization strategy.
84
+ *
85
+ * Required API Key ACLs:
86
+ * - recommendation.
86
87
  *
87
- * @summary Get the current strategy.
88
88
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
89
89
  */
90
90
  getPersonalizationStrategy(requestOptions?: RequestOptions): Promise<PersonalizationStrategyParams>;
91
91
  /**
92
- * Get the user profile built from Personalization strategy. The profile is structured by facet name used in the strategy. Each facet value is mapped to its score. Each score represents the user affinity for a specific facet value given the userToken past events and the Personalization strategy defined. Scores are bounded to 20. The last processed event timestamp is provided using the ISO 8601 format for debugging purposes.
92
+ * Retrieves a user profile and their affinities for different facets.
93
+ *
94
+ * Required API Key ACLs:
95
+ * - recommendation.
93
96
  *
94
- * @summary Get a user profile.
95
97
  * @param getUserTokenProfile - The getUserTokenProfile object.
96
- * @param getUserTokenProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
98
+ * @param getUserTokenProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
97
99
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
98
100
  */
99
101
  getUserTokenProfile({ userToken }: GetUserTokenProfileProps, requestOptions?: RequestOptions): Promise<GetUserTokenResponse>;
100
102
  /**
101
- * A strategy defines the events and facets that impact user profiles and personalized search results.
103
+ * Creates a new personalization strategy.
104
+ *
105
+ * Required API Key ACLs:
106
+ * - recommendation.
102
107
  *
103
- * @summary Set a new strategy.
104
108
  * @param personalizationStrategyParams - The personalizationStrategyParams object.
105
109
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
106
110
  */
107
111
  setPersonalizationStrategy(personalizationStrategyParams: PersonalizationStrategyParams, requestOptions?: RequestOptions): Promise<SetPersonalizationStrategyResponse>;
108
112
  };
109
- /**
110
- * The client type.
111
- */
112
- export type PersonalizationClient = ReturnType<typeof createPersonalizationClient>;
113
113
  //# sourceMappingURL=personalizationClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"personalizationClient.d.ts","sourceRoot":"","sources":["../../src/personalizationClient.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EAInB,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAC5F,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,6CAA6C,CAAC;AAEtG,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAEjD,eAAO,MAAM,OAAO,uBAAwB,CAAC;AAC7C,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAY9C,wBAAgB,2BAA2B,CAAC,EAC1C,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,EACpB,QAAQ,EACR,aAAa,EACb,MAAM,EAAE,YAAY,EACpB,GAAG,OAAO,EACX,EAAE,mBAAmB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;;IAwBvC;;OAEG;;IAGH;;OAEG;kBACW,QAAQ,IAAI,CAAC;IAO3B;;OAEG;;IAKH;;;;;OAKG;6BACsB,MAAM,YAAY,MAAM,GAAG,IAAI;IAIxD;;;;;;;;OAQG;uCAEqB,iBAAiB,mBACtB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;;OAQG;oCAEqB,cAAc,mBACnB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;;;OASG;2CAE2B,eAAe,mBAC1B,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;;OASG;0CAE2B,cAAc,mBACzB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;OAOG;qCAEc,sBAAsB,mBACpB,cAAc,GAC9B,QAAQ,yBAAyB,CAAC;IAwBrC;;;;;OAKG;gDAEgB,cAAc,GAC9B,QAAQ,6BAA6B,CAAC;IAezC;;;;;;;OAOG;uCAEc,wBAAwB,mBACtB,cAAc,GAC9B,QAAQ,oBAAoB,CAAC;IAwBhC;;;;;;OAMG;8DAE8B,6BAA6B,mBAC3C,cAAc,GAC9B,QAAQ,kCAAkC,CAAC;EAsCjD;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAC5C,OAAO,2BAA2B,CACnC,CAAC"}
1
+ {"version":3,"file":"personalizationClient.d.ts","sourceRoot":"","sources":["../../src/personalizationClient.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EAKnB,cAAc,EACf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAC5F,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,6CAA6C,CAAC;AAEtG,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C,eAAO,MAAM,OAAO,uBAAwB,CAAC;AAC7C,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAY9C,wBAAgB,2BAA2B,CAAC,EAC1C,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,EACpB,QAAQ,EACR,aAAa,EACb,MAAM,EAAE,YAAY,EACpB,GAAG,OAAO,EACX,EAAE,mBAAmB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;;IAwBvC;;OAEG;;IAGH;;OAEG;kBACW,QAAQ,IAAI,CAAC;IAO3B;;OAEG;;IAKH;;;;;OAKG;6BACsB,MAAM,YAAY,MAAM,GAAG,IAAI;IAIxD;;;;;;;OAOG;uCAEqB,iBAAiB,mBACtB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;OAOG;oCAEqB,cAAc,mBACnB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;;OAQG;2CAE2B,eAAe,mBAC1B,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;OAQG;0CAE2B,cAAc,mBACzB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;;OASG;qCAEc,sBAAsB,mBACpB,cAAc,GAC9B,QAAQ,yBAAyB,CAAC;IAwBrC;;;;;;;OAOG;gDAEgB,cAAc,GAC9B,QAAQ,6BAA6B,CAAC;IAezC;;;;;;;;;OASG;uCAEc,wBAAwB,mBACtB,cAAc,GAC9B,QAAQ,oBAAoB,CAAC;IAwBhC;;;;;;;;OAQG;8DAE8B,6BAA6B,mBAC3C,cAAc,GAC9B,QAAQ,kCAAkC,CAAC;EAsCjD"}
@@ -69,7 +69,7 @@ export type CustomPutProps = {
69
69
  */
70
70
  export type DeleteUserProfileProps = {
71
71
  /**
72
- * UserToken representing the user for which to fetch the Personalization profile.
72
+ * Unique identifier representing a user for which to fetch the personalization profile.
73
73
  */
74
74
  userToken: string;
75
75
  };
@@ -79,7 +79,7 @@ export type DeleteUserProfileProps = {
79
79
  */
80
80
  export type GetUserTokenProfileProps = {
81
81
  /**
82
- * UserToken representing the user for which to fetch the Personalization profile.
82
+ * Unique identifier representing a user for which to fetch the personalization profile.
83
83
  */
84
84
  userToken: string;
85
85
  };
@@ -2,12 +2,12 @@
2
2
 
3
3
  export type DeleteUserProfileResponse = {
4
4
  /**
5
- * UserToken representing the user for which to fetch the Personalization profile.
5
+ * Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
6
6
  */
7
7
  userToken: string;
8
8
 
9
9
  /**
10
- * A date until which the data can safely be considered as deleted for the given user. Any data received after the `deletedUntil` date will start building a new user profile.
10
+ * Date and time when the user profile can be safely considered to be deleted. Any events received after the `deletedUntil` date start a new user profile.
11
11
  */
12
12
  deletedUntil: string;
13
13
  };
@@ -1,18 +1,17 @@
1
1
  // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2
2
 
3
+ import type { EventType } from './eventType';
4
+
3
5
  export type EventScoring = {
4
6
  /**
5
- * The score for the event.
7
+ * Event score.
6
8
  */
7
9
  score: number;
8
10
 
9
11
  /**
10
- * The name of the event.
12
+ * Event name.
11
13
  */
12
14
  eventName: string;
13
15
 
14
- /**
15
- * The type of the event.
16
- */
17
- eventType: string;
16
+ eventType: EventType;
18
17
  };
@@ -0,0 +1,6 @@
1
+ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2
+
3
+ /**
4
+ * Event type.
5
+ */
6
+ export type EventType = 'click' | 'conversion' | 'view';
@@ -2,12 +2,12 @@
2
2
 
3
3
  export type FacetScoring = {
4
4
  /**
5
- * The score for the event.
5
+ * Event score.
6
6
  */
7
7
  score: number;
8
8
 
9
9
  /**
10
- * The name of the facet.
10
+ * Facet attribute name.
11
11
  */
12
12
  facetName: string;
13
13
  };
@@ -2,17 +2,17 @@
2
2
 
3
3
  export type GetUserTokenResponse = {
4
4
  /**
5
- * UserToken representing the user for which to fetch the Personalization profile.
5
+ * Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/).
6
6
  */
7
7
  userToken: string;
8
8
 
9
9
  /**
10
- * Date of last event update. (ISO-8601 format).
10
+ * Date and time of the last event from this user, in RFC 3339 format.
11
11
  */
12
12
  lastEventAt: string;
13
13
 
14
14
  /**
15
- * The userToken scores.
15
+ * Scores for different facet values. Scores represent the user affinity for a user profile towards specific facet values, given the personalization strategy and past events.
16
16
  */
17
17
  scores: Record<string, any>;
18
18
  };
package/model/index.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  export * from './deleteUserProfileResponse';
4
4
  export * from './errorBase';
5
5
  export * from './eventScoring';
6
+ export * from './eventType';
6
7
  export * from './facetScoring';
7
8
  export * from './getUserTokenResponse';
8
9
  export * from './personalizationStrategyParams';
@@ -5,17 +5,17 @@ import type { FacetScoring } from './facetScoring';
5
5
 
6
6
  export type PersonalizationStrategyParams = {
7
7
  /**
8
- * Scores associated with the events.
8
+ * Scores associated with each event. The higher the scores, the higher the impact of those events on the personalization of search results.
9
9
  */
10
10
  eventScoring: EventScoring[];
11
11
 
12
12
  /**
13
- * Scores associated with the facets.
13
+ * Scores associated with each facet. The higher the scores, the higher the impact of those events on the personalization of search results.
14
14
  */
15
15
  facetScoring: FacetScoring[];
16
16
 
17
17
  /**
18
- * The impact that personalization has on search results: a number between 0 (personalization disabled) and 100 (personalization fully enabled).
18
+ * Impact of personalization on the search results. If set to 0, personalization has no impact on the search results.
19
19
  */
20
20
  personalizationImpact: number;
21
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algolia/client-personalization",
3
- "version": "5.0.0-alpha.98",
3
+ "version": "5.0.0-beta.1",
4
4
  "description": "JavaScript client for client-personalization",
5
5
  "repository": "algolia/algoliasearch-client-javascript",
6
6
  "license": "MIT",
@@ -39,14 +39,14 @@
39
39
  "clean": "rm -rf ./dist || true"
40
40
  },
41
41
  "dependencies": {
42
- "@algolia/client-common": "5.0.0-alpha.99",
43
- "@algolia/requester-browser-xhr": "5.0.0-alpha.99",
44
- "@algolia/requester-node-http": "5.0.0-alpha.99"
42
+ "@algolia/client-common": "5.0.0-beta.1",
43
+ "@algolia/requester-browser-xhr": "5.0.0-beta.1",
44
+ "@algolia/requester-node-http": "5.0.0-beta.1"
45
45
  },
46
46
  "devDependencies": {
47
- "@types/node": "20.11.5",
48
- "rollup": "4.9.5",
49
- "typescript": "5.3.3"
47
+ "@types/node": "20.12.7",
48
+ "rollup": "4.14.2",
49
+ "typescript": "5.4.5"
50
50
  },
51
51
  "engines": {
52
52
  "node": ">= 14.0.0"