@algolia/client-personalization 5.0.0-alpha.99 → 5.0.0-beta.10
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/LICENSE +21 -0
- package/dist/builds/browser.d.ts +21 -3
- package/dist/builds/browser.d.ts.map +1 -1
- package/dist/builds/node.d.ts +21 -3
- package/dist/builds/node.d.ts.map +1 -1
- package/dist/client-personalization.cjs +42 -35
- package/dist/client-personalization.esm.browser.js +38 -43
- package/dist/client-personalization.esm.node.js +42 -35
- package/dist/client-personalization.umd.js +2 -2
- package/dist/model/clientMethodProps.d.ts +2 -2
- package/dist/model/deleteUserProfileResponse.d.ts +2 -2
- package/dist/model/eventScoring.d.ts +4 -6
- package/dist/model/eventScoring.d.ts.map +1 -1
- package/dist/model/eventType.d.ts +5 -0
- package/dist/model/eventType.d.ts.map +1 -0
- package/dist/model/facetScoring.d.ts +2 -2
- package/dist/model/getUserTokenResponse.d.ts +3 -3
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/personalizationStrategyParams.d.ts +3 -3
- package/dist/src/personalizationClient.d.ts +19 -19
- package/dist/src/personalizationClient.d.ts.map +1 -1
- package/model/clientMethodProps.ts +2 -2
- package/model/deleteUserProfileResponse.ts +2 -2
- package/model/eventScoring.ts +5 -6
- package/model/eventType.ts +6 -0
- package/model/facetScoring.ts +2 -2
- package/model/getUserTokenResponse.ts +3 -3
- package/model/index.ts +1 -0
- package/model/personalizationStrategyParams.ts +3 -3
- package/package.json +11 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2013-Present Algolia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/builds/browser.d.ts
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import type { ClientOptions } from '@algolia/client-common';
|
|
2
|
-
import type {
|
|
3
|
-
export { apiClientVersion,
|
|
2
|
+
import type { Region } from '../src/personalizationClient';
|
|
3
|
+
export { apiClientVersion, Region } from '../src/personalizationClient';
|
|
4
4
|
export * from '../model';
|
|
5
|
-
|
|
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): void;
|
|
15
|
+
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
16
|
+
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
17
|
+
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
18
|
+
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
19
|
+
deleteUserProfile({ userToken }: import("../model").DeleteUserProfileProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").DeleteUserProfileResponse>;
|
|
20
|
+
getPersonalizationStrategy(requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").PersonalizationStrategyParams>;
|
|
21
|
+
getUserTokenProfile({ userToken }: import("../model").GetUserTokenProfileProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").GetUserTokenResponse>;
|
|
22
|
+
setPersonalizationStrategy(personalizationStrategyParams: import("../model").PersonalizationStrategyParams, requestOptions?: import("@algolia/client-common").RequestOptions): 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,
|
|
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"}
|
package/dist/builds/node.d.ts
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import type { ClientOptions } from '@algolia/client-common';
|
|
2
|
-
import type {
|
|
3
|
-
export { apiClientVersion,
|
|
2
|
+
import type { Region } from '../src/personalizationClient';
|
|
3
|
+
export { apiClientVersion, Region } from '../src/personalizationClient';
|
|
4
4
|
export * from '../model';
|
|
5
|
-
|
|
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): void;
|
|
15
|
+
customDelete({ path, parameters }: import("../model").CustomDeleteProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
16
|
+
customGet({ path, parameters }: import("../model").CustomGetProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
17
|
+
customPost({ path, parameters, body }: import("../model").CustomPostProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
18
|
+
customPut({ path, parameters, body }: import("../model").CustomPutProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<Record<string, any>>;
|
|
19
|
+
deleteUserProfile({ userToken }: import("../model").DeleteUserProfileProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").DeleteUserProfileResponse>;
|
|
20
|
+
getPersonalizationStrategy(requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").PersonalizationStrategyParams>;
|
|
21
|
+
getUserTokenProfile({ userToken }: import("../model").GetUserTokenProfileProps, requestOptions?: import("@algolia/client-common").RequestOptions): Promise<import("../model").GetUserTokenResponse>;
|
|
22
|
+
setPersonalizationStrategy(personalizationStrategyParams: import("../model").PersonalizationStrategyParams, requestOptions?: import("@algolia/client-common").RequestOptions): 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,
|
|
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-
|
|
7
|
+
const apiClientVersion = '5.0.0-beta.10';
|
|
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 = '/
|
|
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 = '/
|
|
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 = '/
|
|
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 = '/
|
|
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
|
-
*
|
|
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 -
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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 -
|
|
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
|
-
*
|
|
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
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
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;
|
|
@@ -195,6 +195,14 @@ function createStatefulHost(host, status = 'up') {
|
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
+
function _defineProperty(e, r, t) {
|
|
199
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
200
|
+
value: t,
|
|
201
|
+
enumerable: !0,
|
|
202
|
+
configurable: !0,
|
|
203
|
+
writable: !0
|
|
204
|
+
}) : e[r] = t, e;
|
|
205
|
+
}
|
|
198
206
|
function _toPrimitive(t, r) {
|
|
199
207
|
if ("object" != typeof t || !t) return t;
|
|
200
208
|
var e = t[Symbol.toPrimitive];
|
|
@@ -207,21 +215,7 @@ function _toPrimitive(t, r) {
|
|
|
207
215
|
}
|
|
208
216
|
function _toPropertyKey(t) {
|
|
209
217
|
var i = _toPrimitive(t, "string");
|
|
210
|
-
return "symbol" == typeof i ? i :
|
|
211
|
-
}
|
|
212
|
-
function _defineProperty(obj, key, value) {
|
|
213
|
-
key = _toPropertyKey(key);
|
|
214
|
-
if (key in obj) {
|
|
215
|
-
Object.defineProperty(obj, key, {
|
|
216
|
-
value: value,
|
|
217
|
-
enumerable: true,
|
|
218
|
-
configurable: true,
|
|
219
|
-
writable: true
|
|
220
|
-
});
|
|
221
|
-
} else {
|
|
222
|
-
obj[key] = value;
|
|
223
|
-
}
|
|
224
|
-
return obj;
|
|
218
|
+
return "symbol" == typeof i ? i : i + "";
|
|
225
219
|
}
|
|
226
220
|
|
|
227
221
|
class AlgoliaError extends Error {
|
|
@@ -243,7 +237,7 @@ class ErrorWithStackTrace extends AlgoliaError {
|
|
|
243
237
|
}
|
|
244
238
|
class RetryError extends ErrorWithStackTrace {
|
|
245
239
|
constructor(stackTrace) {
|
|
246
|
-
super('Unreachable hosts - your application id may be incorrect. If the error persists, please
|
|
240
|
+
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.', stackTrace, 'RetryError');
|
|
247
241
|
}
|
|
248
242
|
}
|
|
249
243
|
class ApiError extends ErrorWithStackTrace {
|
|
@@ -270,15 +264,14 @@ class DetailedApiError extends ApiError {
|
|
|
270
264
|
}
|
|
271
265
|
function serializeUrl(host, path, queryParameters) {
|
|
272
266
|
const queryParametersAsString = serializeQueryParameters(queryParameters);
|
|
273
|
-
let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.
|
|
267
|
+
let url = `${host.protocol}://${host.url}${host.port ? `:${host.port}` : ''}/${path.charAt(0) === '/' ? path.substring(1) : path}`;
|
|
274
268
|
if (queryParametersAsString.length) {
|
|
275
269
|
url += `?${queryParametersAsString}`;
|
|
276
270
|
}
|
|
277
271
|
return url;
|
|
278
272
|
}
|
|
279
273
|
function serializeQueryParameters(parameters) {
|
|
280
|
-
|
|
281
|
-
return Object.keys(parameters).map(key => `${key}=${encodeURIComponent(isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key])}`).join('&');
|
|
274
|
+
return Object.keys(parameters).filter(key => parameters[key] !== undefined).sort().map(key => `${key}=${encodeURIComponent(Object.prototype.toString.call(parameters[key]) === '[object Array]' ? parameters[key].join(',') : parameters[key]).replaceAll('+', '%20')}`).join('&');
|
|
282
275
|
}
|
|
283
276
|
function serializeData(request, requestOptions) {
|
|
284
277
|
if (request.method === 'GET' || request.data === undefined && requestOptions.data === undefined) {
|
|
@@ -449,16 +442,13 @@ function createTransporter({
|
|
|
449
442
|
if (host === undefined) {
|
|
450
443
|
throw new RetryError(stackTraceWithoutCredentials(stackTrace));
|
|
451
444
|
}
|
|
452
|
-
let responseTimeout = requestOptions.
|
|
453
|
-
if (responseTimeout === undefined) {
|
|
454
|
-
responseTimeout = isRead ? timeouts.read : timeouts.write;
|
|
455
|
-
}
|
|
445
|
+
let responseTimeout = isRead ? requestOptions.timeouts?.read || timeouts.read : requestOptions.timeouts?.write || timeouts.write;
|
|
456
446
|
const payload = {
|
|
457
447
|
data,
|
|
458
448
|
headers,
|
|
459
449
|
method: request.method,
|
|
460
450
|
url: serializeUrl(host, request.path, queryParameters),
|
|
461
|
-
connectTimeout: getTimeout(timeoutsCount, timeouts.connect),
|
|
451
|
+
connectTimeout: getTimeout(timeoutsCount, requestOptions.timeouts?.connect || timeouts.connect),
|
|
462
452
|
responseTimeout: getTimeout(timeoutsCount, responseTimeout)
|
|
463
453
|
};
|
|
464
454
|
/**
|
|
@@ -686,7 +676,7 @@ function createXhrRequester() {
|
|
|
686
676
|
}
|
|
687
677
|
|
|
688
678
|
// 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-
|
|
679
|
+
const apiClientVersion = '5.0.0-beta.10';
|
|
690
680
|
const REGIONS = ['eu', 'us'];
|
|
691
681
|
function getDefaultHosts(region) {
|
|
692
682
|
const url = 'personalization.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -746,7 +736,6 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
746
736
|
/**
|
|
747
737
|
* This method allow you to send requests to the Algolia REST API.
|
|
748
738
|
*
|
|
749
|
-
* @summary Send requests to the Algolia REST API.
|
|
750
739
|
* @param customDelete - The customDelete object.
|
|
751
740
|
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
752
741
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
@@ -756,7 +745,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
756
745
|
if (!path) {
|
|
757
746
|
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
758
747
|
}
|
|
759
|
-
const requestPath = '/
|
|
748
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
760
749
|
const headers = {};
|
|
761
750
|
const queryParameters = parameters ? parameters : {};
|
|
762
751
|
const request = {
|
|
@@ -770,7 +759,6 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
770
759
|
/**
|
|
771
760
|
* This method allow you to send requests to the Algolia REST API.
|
|
772
761
|
*
|
|
773
|
-
* @summary Send requests to the Algolia REST API.
|
|
774
762
|
* @param customGet - The customGet object.
|
|
775
763
|
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
776
764
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
@@ -780,7 +768,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
780
768
|
if (!path) {
|
|
781
769
|
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
782
770
|
}
|
|
783
|
-
const requestPath = '/
|
|
771
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
784
772
|
const headers = {};
|
|
785
773
|
const queryParameters = parameters ? parameters : {};
|
|
786
774
|
const request = {
|
|
@@ -794,7 +782,6 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
794
782
|
/**
|
|
795
783
|
* This method allow you to send requests to the Algolia REST API.
|
|
796
784
|
*
|
|
797
|
-
* @summary Send requests to the Algolia REST API.
|
|
798
785
|
* @param customPost - The customPost object.
|
|
799
786
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
800
787
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -805,7 +792,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
805
792
|
if (!path) {
|
|
806
793
|
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
807
794
|
}
|
|
808
|
-
const requestPath = '/
|
|
795
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
809
796
|
const headers = {};
|
|
810
797
|
const queryParameters = parameters ? parameters : {};
|
|
811
798
|
const request = {
|
|
@@ -820,7 +807,6 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
820
807
|
/**
|
|
821
808
|
* This method allow you to send requests to the Algolia REST API.
|
|
822
809
|
*
|
|
823
|
-
* @summary Send requests to the Algolia REST API.
|
|
824
810
|
* @param customPut - The customPut object.
|
|
825
811
|
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
826
812
|
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
@@ -831,7 +817,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
831
817
|
if (!path) {
|
|
832
818
|
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
833
819
|
}
|
|
834
|
-
const requestPath = '/
|
|
820
|
+
const requestPath = '/{path}'.replace('{path}', path);
|
|
835
821
|
const headers = {};
|
|
836
822
|
const queryParameters = parameters ? parameters : {};
|
|
837
823
|
const request = {
|
|
@@ -844,11 +830,13 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
844
830
|
return transporter.request(request, requestOptions);
|
|
845
831
|
},
|
|
846
832
|
/**
|
|
847
|
-
*
|
|
833
|
+
* Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.
|
|
834
|
+
*
|
|
835
|
+
* Required API Key ACLs:
|
|
836
|
+
* - recommendation.
|
|
848
837
|
*
|
|
849
|
-
* @summary Delete a user profile.
|
|
850
838
|
* @param deleteUserProfile - The deleteUserProfile object.
|
|
851
|
-
* @param deleteUserProfile.userToken -
|
|
839
|
+
* @param deleteUserProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
|
|
852
840
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
853
841
|
*/
|
|
854
842
|
deleteUserProfile({ userToken }, requestOptions) {
|
|
@@ -867,9 +855,11 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
867
855
|
return transporter.request(request, requestOptions);
|
|
868
856
|
},
|
|
869
857
|
/**
|
|
870
|
-
*
|
|
858
|
+
* Retrieves the current personalization strategy.
|
|
859
|
+
*
|
|
860
|
+
* Required API Key ACLs:
|
|
861
|
+
* - recommendation.
|
|
871
862
|
*
|
|
872
|
-
* @summary Get the current strategy.
|
|
873
863
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
874
864
|
*/
|
|
875
865
|
getPersonalizationStrategy(requestOptions) {
|
|
@@ -885,11 +875,13 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
885
875
|
return transporter.request(request, requestOptions);
|
|
886
876
|
},
|
|
887
877
|
/**
|
|
888
|
-
*
|
|
878
|
+
* Retrieves a user profile and their affinities for different facets.
|
|
879
|
+
*
|
|
880
|
+
* Required API Key ACLs:
|
|
881
|
+
* - recommendation.
|
|
889
882
|
*
|
|
890
|
-
* @summary Get a user profile.
|
|
891
883
|
* @param getUserTokenProfile - The getUserTokenProfile object.
|
|
892
|
-
* @param getUserTokenProfile.userToken -
|
|
884
|
+
* @param getUserTokenProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
|
|
893
885
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
894
886
|
*/
|
|
895
887
|
getUserTokenProfile({ userToken }, requestOptions) {
|
|
@@ -908,9 +900,11 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
908
900
|
return transporter.request(request, requestOptions);
|
|
909
901
|
},
|
|
910
902
|
/**
|
|
911
|
-
*
|
|
903
|
+
* Creates a new personalization strategy.
|
|
904
|
+
*
|
|
905
|
+
* Required API Key ACLs:
|
|
906
|
+
* - recommendation.
|
|
912
907
|
*
|
|
913
|
-
* @summary Set a new strategy.
|
|
914
908
|
* @param personalizationStrategyParams - The personalizationStrategyParams object.
|
|
915
909
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
916
910
|
*/
|
|
@@ -943,6 +937,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
943
937
|
}
|
|
944
938
|
|
|
945
939
|
// 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.
|
|
940
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
946
941
|
function personalizationClient(appId, apiKey, region, options) {
|
|
947
942
|
if (!appId || typeof appId !== 'string') {
|
|
948
943
|
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-
|
|
5
|
+
const apiClientVersion = '5.0.0-beta.10';
|
|
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 = '/
|
|
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 = '/
|
|
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 = '/
|
|
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 = '/
|
|
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
|
-
*
|
|
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 -
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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 -
|
|
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
|
-
*
|
|
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
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
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-
|
|
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.99",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.10 | © 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,t,r){return(t=function(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+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),n(this,"name","AlgoliaError"),t&&(this.name=t)}}class u extends i{constructor(e,t,r){super(e,r),n(this,"stackTrace",void 0),this.stackTrace=t}}class c extends u{constructor(e){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.",e,"RetryError")}}class l extends u{constructor(e,t,r,s="ApiError"){super(e,r,s),n(this,"status",void 0),this.status=t}}class m extends i{constructor(e,t){super(e,"DeserializationError"),n(this,"response",void 0),this.response=t}}class h extends l{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),n(this,"error",void 0),this.error=r}}function d(e,t,r){const s=(a=r,Object.keys(a).filter((e=>void 0!==a[e])).sort().map((e=>`${e}=${encodeURIComponent("[object Array]"===Object.prototype.toString.call(a[e])?a[e].join(","):a[e]).replaceAll("+","%20")}`)).join("&"));var a;let o=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(1):t}`;return s.length&&(o+=`?${s}`),o}function p(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 g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:n,requester:i,requestsCache:u,responsesCache:g}){async function f(u,g,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)}(u,g),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,u.headers,g.headers),v="GET"===u.method?{...u.data,...g.data}:{},q={...s,...u.queryParameters,...v};if(a.value&&(q["x-algolia-agent"]=a.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?q[e]=g.queryParameters[e].toString():q[e]=g.queryParameters[e];let T=0;const b=async(e,r)=>{const s=e.pop();if(void 0===s)throw new c(function(e){return e.map((e=>p(e)))}(y));let a=f?g.timeouts?.read||n.read:g.timeouts?.write||n.write;const v={data:P,headers:w,method:u.method,url:d(s,u.path,q),connectTimeout:r(T,g.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",p(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 m(t.message,e)}}(S);throw O(S),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new h(s.message,t,s.error,r):new l(s.message,t,r)}catch(e){}return new l(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 g.get(n,(()=>u.get(n,(()=>u.set(n,o()).then((e=>Promise.all([u.delete(n),e])),(e=>Promise.all([u.delete(n),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>g.set(n,e)})},requestsCache:u,responsesCache:g}}function f({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 y="5.0.0-beta.10",P=["eu","us"];e.apiClientVersion=y,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||!P.includes(o)))throw new Error(`\`region\` is required and must be one of the following: ${P.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=g({hosts:(u=a,[{url:"personalization.{region}.algolia.com".replace("{region}",u),accept:"readWrite",protocol:"https"}]),...o,algoliaAgent:f({algoliaAgents:s,client:"Personalization",version:y}),baseHeaders:{"content-type":"text/plain",...n.headers(),...o.baseHeaders},baseQueryParameters:{...n.queryParameters(),...o.baseQueryParameters}});var u;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:`${y}-${e}`}),s()]}),...n})}}));
|
|
@@ -63,7 +63,7 @@ export type CustomPutProps = {
|
|
|
63
63
|
*/
|
|
64
64
|
export type DeleteUserProfileProps = {
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
4
|
+
* Event score.
|
|
4
5
|
*/
|
|
5
6
|
score: number;
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
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
|
|
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 @@
|
|
|
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,14 +1,14 @@
|
|
|
1
1
|
export type GetUserTokenResponse = {
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
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
|
|
7
|
+
* Date and time of the last event from this user, in RFC 3339 format.
|
|
8
8
|
*/
|
|
9
9
|
lastEventAt: string;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
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
|
};
|
package/dist/model/index.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
*
|
|
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-
|
|
7
|
+
export declare const apiClientVersion = "5.0.0-beta.10";
|
|
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
|
-
*
|
|
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 -
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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 -
|
|
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
|
-
*
|
|
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,
|
|
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,kBAAkB,CAAC;AAEhD,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,OAAO,CAAC,IAAI,CAAC;IAO3B;;OAEG;;IAKH;;;;;OAKG;6BACsB,MAAM,YAAY,MAAM,GAAG,IAAI;IAIxD;;;;;;;OAOG;uCAEqB,iBAAiB,mBACtB,cAAc,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;OAOG;oCAEqB,cAAc,mBACnB,cAAc,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAqB/B;;;;;;;;OAQG;2CAE2B,eAAe,mBAC1B,cAAc,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;OAQG;0CAE2B,cAAc,mBACzB,cAAc,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAsB/B;;;;;;;;;OASG;qCAEc,sBAAsB,mBACpB,cAAc,GAC9B,OAAO,CAAC,yBAAyB,CAAC;IAwBrC;;;;;;;OAOG;gDAEgB,cAAc,GAC9B,OAAO,CAAC,6BAA6B,CAAC;IAezC;;;;;;;;;OASG;uCAEc,wBAAwB,mBACtB,cAAc,GAC9B,OAAO,CAAC,oBAAoB,CAAC;IAwBhC;;;;;;;;OAQG;8DAE8B,6BAA6B,mBAC3C,cAAc,GAC9B,OAAO,CAAC,kCAAkC,CAAC;EAsCjD"}
|
|
@@ -69,7 +69,7 @@ export type CustomPutProps = {
|
|
|
69
69
|
*/
|
|
70
70
|
export type DeleteUserProfileProps = {
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
};
|
package/model/eventScoring.ts
CHANGED
|
@@ -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
|
-
*
|
|
7
|
+
* Event score.
|
|
6
8
|
*/
|
|
7
9
|
score: number;
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
|
-
*
|
|
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
|
};
|
package/model/facetScoring.ts
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
export type GetUserTokenResponse = {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
@@ -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
|
|
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
|
-
*
|
|
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,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algolia/client-personalization",
|
|
3
|
-
"version": "5.0.0-
|
|
3
|
+
"version": "5.0.0-beta.10",
|
|
4
4
|
"description": "JavaScript client for client-personalization",
|
|
5
|
-
"repository":
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/algolia/algoliasearch-client-javascript.git"
|
|
8
|
+
},
|
|
6
9
|
"license": "MIT",
|
|
7
10
|
"author": "Algolia",
|
|
8
11
|
"type": "module",
|
|
@@ -39,14 +42,14 @@
|
|
|
39
42
|
"clean": "rm -rf ./dist || true"
|
|
40
43
|
},
|
|
41
44
|
"dependencies": {
|
|
42
|
-
"@algolia/client-common": "5.0.0-
|
|
43
|
-
"@algolia/requester-browser-xhr": "5.0.0-
|
|
44
|
-
"@algolia/requester-node-http": "5.0.0-
|
|
45
|
+
"@algolia/client-common": "5.0.0-beta.11",
|
|
46
|
+
"@algolia/requester-browser-xhr": "5.0.0-beta.11",
|
|
47
|
+
"@algolia/requester-node-http": "5.0.0-beta.11"
|
|
45
48
|
},
|
|
46
49
|
"devDependencies": {
|
|
47
|
-
"@types/node": "20.
|
|
48
|
-
"rollup": "4.
|
|
49
|
-
"typescript": "5.
|
|
50
|
+
"@types/node": "20.14.10",
|
|
51
|
+
"rollup": "4.18.0",
|
|
52
|
+
"typescript": "5.5.3"
|
|
50
53
|
},
|
|
51
54
|
"engines": {
|
|
52
55
|
"node": ">= 14.0.0"
|