@algolia/client-personalization 5.0.0-alpha.91 → 5.0.0-alpha.97
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/dist/builds/browser.d.ts.map +1 -1
- package/dist/builds/node.d.ts.map +1 -1
- package/dist/client-personalization.cjs +63 -63
- package/dist/client-personalization.esm.browser.js +106 -82
- package/dist/client-personalization.esm.node.js +63 -63
- package/dist/client-personalization.umd.js +2 -2
- package/dist/model/clientMethodProps.d.ts +26 -26
- package/dist/model/clientMethodProps.d.ts.map +1 -1
- package/dist/src/personalizationClient.d.ts +37 -37
- package/dist/src/personalizationClient.d.ts.map +1 -1
- package/model/clientMethodProps.ts +28 -28
- package/package.json +7 -7
|
@@ -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,
|
|
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 +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,
|
|
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"}
|
|
@@ -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.
|
|
7
|
+
const apiClientVersion = '5.0.0-alpha.97';
|
|
8
8
|
const REGIONS = ['eu', 'us'];
|
|
9
9
|
function getDefaultHosts(region) {
|
|
10
10
|
const url = 'personalization.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -65,14 +65,14 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
65
65
|
* This method allow you to send requests to the Algolia REST API.
|
|
66
66
|
*
|
|
67
67
|
* @summary Send requests to the Algolia REST API.
|
|
68
|
-
* @param
|
|
69
|
-
* @param
|
|
70
|
-
* @param
|
|
68
|
+
* @param customDelete - The customDelete object.
|
|
69
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
70
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
71
71
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
72
72
|
*/
|
|
73
|
-
|
|
73
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
74
74
|
if (!path) {
|
|
75
|
-
throw new Error('Parameter `path` is required when calling `
|
|
75
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
76
76
|
}
|
|
77
77
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
78
78
|
const headers = {};
|
|
@@ -86,22 +86,23 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
86
86
|
return transporter.request(request, requestOptions);
|
|
87
87
|
},
|
|
88
88
|
/**
|
|
89
|
-
*
|
|
89
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
90
90
|
*
|
|
91
|
-
* @summary
|
|
92
|
-
* @param
|
|
93
|
-
* @param
|
|
91
|
+
* @summary Send requests to the Algolia REST API.
|
|
92
|
+
* @param customGet - The customGet object.
|
|
93
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
94
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
94
95
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
95
96
|
*/
|
|
96
|
-
|
|
97
|
-
if (!
|
|
98
|
-
throw new Error('Parameter `
|
|
97
|
+
customGet({ path, parameters }, requestOptions) {
|
|
98
|
+
if (!path) {
|
|
99
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
99
100
|
}
|
|
100
|
-
const requestPath = '/1
|
|
101
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
101
102
|
const headers = {};
|
|
102
|
-
const queryParameters = {};
|
|
103
|
+
const queryParameters = parameters ? parameters : {};
|
|
103
104
|
const request = {
|
|
104
|
-
method: '
|
|
105
|
+
method: 'GET',
|
|
105
106
|
path: requestPath,
|
|
106
107
|
queryParameters,
|
|
107
108
|
headers,
|
|
@@ -112,61 +113,71 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
112
113
|
* This method allow you to send requests to the Algolia REST API.
|
|
113
114
|
*
|
|
114
115
|
* @summary Send requests to the Algolia REST API.
|
|
115
|
-
* @param
|
|
116
|
-
* @param
|
|
117
|
-
* @param
|
|
116
|
+
* @param customPost - The customPost object.
|
|
117
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
118
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
119
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
118
120
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
119
121
|
*/
|
|
120
|
-
|
|
122
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
121
123
|
if (!path) {
|
|
122
|
-
throw new Error('Parameter `path` is required when calling `
|
|
124
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
123
125
|
}
|
|
124
126
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
125
127
|
const headers = {};
|
|
126
128
|
const queryParameters = parameters ? parameters : {};
|
|
127
129
|
const request = {
|
|
128
|
-
method: '
|
|
130
|
+
method: 'POST',
|
|
129
131
|
path: requestPath,
|
|
130
132
|
queryParameters,
|
|
131
133
|
headers,
|
|
134
|
+
data: body ? body : {},
|
|
132
135
|
};
|
|
133
136
|
return transporter.request(request, requestOptions);
|
|
134
137
|
},
|
|
135
138
|
/**
|
|
136
|
-
*
|
|
139
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
137
140
|
*
|
|
138
|
-
* @summary
|
|
141
|
+
* @summary Send requests to the Algolia REST API.
|
|
142
|
+
* @param customPut - The customPut object.
|
|
143
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
144
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
145
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
139
146
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
140
147
|
*/
|
|
141
|
-
|
|
142
|
-
|
|
148
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
149
|
+
if (!path) {
|
|
150
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
151
|
+
}
|
|
152
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
143
153
|
const headers = {};
|
|
144
|
-
const queryParameters = {};
|
|
154
|
+
const queryParameters = parameters ? parameters : {};
|
|
145
155
|
const request = {
|
|
146
|
-
method: '
|
|
156
|
+
method: 'PUT',
|
|
147
157
|
path: requestPath,
|
|
148
158
|
queryParameters,
|
|
149
159
|
headers,
|
|
160
|
+
data: body ? body : {},
|
|
150
161
|
};
|
|
151
162
|
return transporter.request(request, requestOptions);
|
|
152
163
|
},
|
|
153
164
|
/**
|
|
154
|
-
*
|
|
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.
|
|
155
166
|
*
|
|
156
|
-
* @summary
|
|
157
|
-
* @param
|
|
158
|
-
* @param
|
|
167
|
+
* @summary Delete a user profile.
|
|
168
|
+
* @param deleteUserProfile - The deleteUserProfile object.
|
|
169
|
+
* @param deleteUserProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
|
|
159
170
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
160
171
|
*/
|
|
161
|
-
|
|
172
|
+
deleteUserProfile({ userToken }, requestOptions) {
|
|
162
173
|
if (!userToken) {
|
|
163
|
-
throw new Error('Parameter `userToken` is required when calling `
|
|
174
|
+
throw new Error('Parameter `userToken` is required when calling `deleteUserProfile`.');
|
|
164
175
|
}
|
|
165
|
-
const requestPath = '/1/profiles/
|
|
176
|
+
const requestPath = '/1/profiles/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));
|
|
166
177
|
const headers = {};
|
|
167
178
|
const queryParameters = {};
|
|
168
179
|
const request = {
|
|
169
|
-
method: '
|
|
180
|
+
method: 'DELETE',
|
|
170
181
|
path: requestPath,
|
|
171
182
|
queryParameters,
|
|
172
183
|
headers,
|
|
@@ -174,54 +185,43 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
174
185
|
return transporter.request(request, requestOptions);
|
|
175
186
|
},
|
|
176
187
|
/**
|
|
177
|
-
*
|
|
188
|
+
* The strategy contains information on the events and facets that impact user profiles and personalized search results.
|
|
178
189
|
*
|
|
179
|
-
* @summary
|
|
180
|
-
* @param post - The post object.
|
|
181
|
-
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
182
|
-
* @param post.parameters - Query parameters to apply to the current query.
|
|
183
|
-
* @param post.body - Parameters to send with the custom request.
|
|
190
|
+
* @summary Get the current strategy.
|
|
184
191
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
185
192
|
*/
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
throw new Error('Parameter `path` is required when calling `post`.');
|
|
189
|
-
}
|
|
190
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
193
|
+
getPersonalizationStrategy(requestOptions) {
|
|
194
|
+
const requestPath = '/1/strategies/personalization';
|
|
191
195
|
const headers = {};
|
|
192
|
-
const queryParameters =
|
|
196
|
+
const queryParameters = {};
|
|
193
197
|
const request = {
|
|
194
|
-
method: '
|
|
198
|
+
method: 'GET',
|
|
195
199
|
path: requestPath,
|
|
196
200
|
queryParameters,
|
|
197
201
|
headers,
|
|
198
|
-
data: body ? body : {},
|
|
199
202
|
};
|
|
200
203
|
return transporter.request(request, requestOptions);
|
|
201
204
|
},
|
|
202
205
|
/**
|
|
203
|
-
*
|
|
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.
|
|
204
207
|
*
|
|
205
|
-
* @summary
|
|
206
|
-
* @param
|
|
207
|
-
* @param
|
|
208
|
-
* @param put.parameters - Query parameters to apply to the current query.
|
|
209
|
-
* @param put.body - Parameters to send with the custom request.
|
|
208
|
+
* @summary Get a user profile.
|
|
209
|
+
* @param getUserTokenProfile - The getUserTokenProfile object.
|
|
210
|
+
* @param getUserTokenProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
|
|
210
211
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
211
212
|
*/
|
|
212
|
-
|
|
213
|
-
if (!
|
|
214
|
-
throw new Error('Parameter `
|
|
213
|
+
getUserTokenProfile({ userToken }, requestOptions) {
|
|
214
|
+
if (!userToken) {
|
|
215
|
+
throw new Error('Parameter `userToken` is required when calling `getUserTokenProfile`.');
|
|
215
216
|
}
|
|
216
|
-
const requestPath = '/1{
|
|
217
|
+
const requestPath = '/1/profiles/personalization/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));
|
|
217
218
|
const headers = {};
|
|
218
|
-
const queryParameters =
|
|
219
|
+
const queryParameters = {};
|
|
219
220
|
const request = {
|
|
220
|
-
method: '
|
|
221
|
+
method: 'GET',
|
|
221
222
|
path: requestPath,
|
|
222
223
|
queryParameters,
|
|
223
224
|
headers,
|
|
224
|
-
data: body ? body : {},
|
|
225
225
|
};
|
|
226
226
|
return transporter.request(request, requestOptions);
|
|
227
227
|
},
|
|
@@ -26,14 +26,35 @@ function createBrowserLocalStorageCache(options) {
|
|
|
26
26
|
function getNamespace() {
|
|
27
27
|
return JSON.parse(getStorage().getItem(namespaceKey) || '{}');
|
|
28
28
|
}
|
|
29
|
+
function setNamespace(namespace) {
|
|
30
|
+
getStorage().setItem(namespaceKey, JSON.stringify(namespace));
|
|
31
|
+
}
|
|
32
|
+
function removeOutdatedCacheItems() {
|
|
33
|
+
const timeToLive = options.timeToLive ? options.timeToLive * 1000 : null;
|
|
34
|
+
const namespace = getNamespace();
|
|
35
|
+
const filteredNamespaceWithoutOldFormattedCacheItems = Object.fromEntries(Object.entries(namespace).filter(([, cacheItem]) => {
|
|
36
|
+
return cacheItem.timestamp !== undefined;
|
|
37
|
+
}));
|
|
38
|
+
setNamespace(filteredNamespaceWithoutOldFormattedCacheItems);
|
|
39
|
+
if (!timeToLive) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const filteredNamespaceWithoutExpiredItems = Object.fromEntries(Object.entries(filteredNamespaceWithoutOldFormattedCacheItems).filter(([, cacheItem]) => {
|
|
43
|
+
const currentTimestamp = new Date().getTime();
|
|
44
|
+
const isExpired = cacheItem.timestamp + timeToLive < currentTimestamp;
|
|
45
|
+
return !isExpired;
|
|
46
|
+
}));
|
|
47
|
+
setNamespace(filteredNamespaceWithoutExpiredItems);
|
|
48
|
+
}
|
|
29
49
|
return {
|
|
30
50
|
get(key, defaultValue, events = {
|
|
31
51
|
miss: () => Promise.resolve()
|
|
32
52
|
}) {
|
|
33
53
|
return Promise.resolve().then(() => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
54
|
+
removeOutdatedCacheItems();
|
|
55
|
+
return getNamespace()[JSON.stringify(key)];
|
|
56
|
+
}).then(value => {
|
|
57
|
+
return Promise.all([value ? value.value : defaultValue(), value !== undefined]);
|
|
37
58
|
}).then(([value, exists]) => {
|
|
38
59
|
return Promise.all([value, exists || events.miss(value)]);
|
|
39
60
|
}).then(([value]) => value);
|
|
@@ -41,7 +62,10 @@ function createBrowserLocalStorageCache(options) {
|
|
|
41
62
|
set(key, value) {
|
|
42
63
|
return Promise.resolve().then(() => {
|
|
43
64
|
const namespace = getNamespace();
|
|
44
|
-
namespace[JSON.stringify(key)] =
|
|
65
|
+
namespace[JSON.stringify(key)] = {
|
|
66
|
+
timestamp: new Date().getTime(),
|
|
67
|
+
value
|
|
68
|
+
};
|
|
45
69
|
getStorage().setItem(namespaceKey, JSON.stringify(namespace));
|
|
46
70
|
return value;
|
|
47
71
|
});
|
|
@@ -171,6 +195,20 @@ function createStatefulHost(host, status = 'up') {
|
|
|
171
195
|
};
|
|
172
196
|
}
|
|
173
197
|
|
|
198
|
+
function _toPrimitive(t, r) {
|
|
199
|
+
if ("object" != typeof t || !t) return t;
|
|
200
|
+
var e = t[Symbol.toPrimitive];
|
|
201
|
+
if (void 0 !== e) {
|
|
202
|
+
var i = e.call(t, r || "default");
|
|
203
|
+
if ("object" != typeof i) return i;
|
|
204
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
205
|
+
}
|
|
206
|
+
return ("string" === r ? String : Number)(t);
|
|
207
|
+
}
|
|
208
|
+
function _toPropertyKey(t) {
|
|
209
|
+
var i = _toPrimitive(t, "string");
|
|
210
|
+
return "symbol" == typeof i ? i : String(i);
|
|
211
|
+
}
|
|
174
212
|
function _defineProperty(obj, key, value) {
|
|
175
213
|
key = _toPropertyKey(key);
|
|
176
214
|
if (key in obj) {
|
|
@@ -185,20 +223,6 @@ function _defineProperty(obj, key, value) {
|
|
|
185
223
|
}
|
|
186
224
|
return obj;
|
|
187
225
|
}
|
|
188
|
-
function _toPrimitive(input, hint) {
|
|
189
|
-
if (typeof input !== "object" || input === null) return input;
|
|
190
|
-
var prim = input[Symbol.toPrimitive];
|
|
191
|
-
if (prim !== undefined) {
|
|
192
|
-
var res = prim.call(input, hint || "default");
|
|
193
|
-
if (typeof res !== "object") return res;
|
|
194
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
195
|
-
}
|
|
196
|
-
return (hint === "string" ? String : Number)(input);
|
|
197
|
-
}
|
|
198
|
-
function _toPropertyKey(arg) {
|
|
199
|
-
var key = _toPrimitive(arg, "string");
|
|
200
|
-
return typeof key === "symbol" ? key : String(key);
|
|
201
|
-
}
|
|
202
226
|
|
|
203
227
|
class AlgoliaError extends Error {
|
|
204
228
|
constructor(message, name) {
|
|
@@ -219,7 +243,7 @@ class ErrorWithStackTrace extends AlgoliaError {
|
|
|
219
243
|
}
|
|
220
244
|
class RetryError extends ErrorWithStackTrace {
|
|
221
245
|
constructor(stackTrace) {
|
|
222
|
-
super('Unreachable hosts - your application id may be incorrect. If the error persists,
|
|
246
|
+
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.', stackTrace, 'RetryError');
|
|
223
247
|
}
|
|
224
248
|
}
|
|
225
249
|
class ApiError extends ErrorWithStackTrace {
|
|
@@ -662,7 +686,7 @@ function createXhrRequester() {
|
|
|
662
686
|
}
|
|
663
687
|
|
|
664
688
|
// 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.
|
|
665
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
689
|
+
const apiClientVersion = '5.0.0-alpha.97';
|
|
666
690
|
const REGIONS = ['eu', 'us'];
|
|
667
691
|
function getDefaultHosts(region) {
|
|
668
692
|
const url = 'personalization.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -723,14 +747,14 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
723
747
|
* This method allow you to send requests to the Algolia REST API.
|
|
724
748
|
*
|
|
725
749
|
* @summary Send requests to the Algolia REST API.
|
|
726
|
-
* @param
|
|
727
|
-
* @param
|
|
728
|
-
* @param
|
|
750
|
+
* @param customDelete - The customDelete object.
|
|
751
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
752
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
729
753
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
730
754
|
*/
|
|
731
|
-
|
|
755
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
732
756
|
if (!path) {
|
|
733
|
-
throw new Error('Parameter `path` is required when calling `
|
|
757
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
734
758
|
}
|
|
735
759
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
736
760
|
const headers = {};
|
|
@@ -744,22 +768,23 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
744
768
|
return transporter.request(request, requestOptions);
|
|
745
769
|
},
|
|
746
770
|
/**
|
|
747
|
-
*
|
|
771
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
748
772
|
*
|
|
749
|
-
* @summary
|
|
750
|
-
* @param
|
|
751
|
-
* @param
|
|
773
|
+
* @summary Send requests to the Algolia REST API.
|
|
774
|
+
* @param customGet - The customGet object.
|
|
775
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
776
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
752
777
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
753
778
|
*/
|
|
754
|
-
|
|
755
|
-
if (!
|
|
756
|
-
throw new Error('Parameter `
|
|
779
|
+
customGet({ path, parameters }, requestOptions) {
|
|
780
|
+
if (!path) {
|
|
781
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
757
782
|
}
|
|
758
|
-
const requestPath = '/1
|
|
783
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
759
784
|
const headers = {};
|
|
760
|
-
const queryParameters = {};
|
|
785
|
+
const queryParameters = parameters ? parameters : {};
|
|
761
786
|
const request = {
|
|
762
|
-
method: '
|
|
787
|
+
method: 'GET',
|
|
763
788
|
path: requestPath,
|
|
764
789
|
queryParameters,
|
|
765
790
|
headers,
|
|
@@ -770,61 +795,71 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
770
795
|
* This method allow you to send requests to the Algolia REST API.
|
|
771
796
|
*
|
|
772
797
|
* @summary Send requests to the Algolia REST API.
|
|
773
|
-
* @param
|
|
774
|
-
* @param
|
|
775
|
-
* @param
|
|
798
|
+
* @param customPost - The customPost object.
|
|
799
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
800
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
801
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
776
802
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
777
803
|
*/
|
|
778
|
-
|
|
804
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
779
805
|
if (!path) {
|
|
780
|
-
throw new Error('Parameter `path` is required when calling `
|
|
806
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
781
807
|
}
|
|
782
808
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
783
809
|
const headers = {};
|
|
784
810
|
const queryParameters = parameters ? parameters : {};
|
|
785
811
|
const request = {
|
|
786
|
-
method: '
|
|
812
|
+
method: 'POST',
|
|
787
813
|
path: requestPath,
|
|
788
814
|
queryParameters,
|
|
789
815
|
headers,
|
|
816
|
+
data: body ? body : {},
|
|
790
817
|
};
|
|
791
818
|
return transporter.request(request, requestOptions);
|
|
792
819
|
},
|
|
793
820
|
/**
|
|
794
|
-
*
|
|
821
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
795
822
|
*
|
|
796
|
-
* @summary
|
|
823
|
+
* @summary Send requests to the Algolia REST API.
|
|
824
|
+
* @param customPut - The customPut object.
|
|
825
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
826
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
827
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
797
828
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
798
829
|
*/
|
|
799
|
-
|
|
800
|
-
|
|
830
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
831
|
+
if (!path) {
|
|
832
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
833
|
+
}
|
|
834
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
801
835
|
const headers = {};
|
|
802
|
-
const queryParameters = {};
|
|
836
|
+
const queryParameters = parameters ? parameters : {};
|
|
803
837
|
const request = {
|
|
804
|
-
method: '
|
|
838
|
+
method: 'PUT',
|
|
805
839
|
path: requestPath,
|
|
806
840
|
queryParameters,
|
|
807
841
|
headers,
|
|
842
|
+
data: body ? body : {},
|
|
808
843
|
};
|
|
809
844
|
return transporter.request(request, requestOptions);
|
|
810
845
|
},
|
|
811
846
|
/**
|
|
812
|
-
*
|
|
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.
|
|
813
848
|
*
|
|
814
|
-
* @summary
|
|
815
|
-
* @param
|
|
816
|
-
* @param
|
|
849
|
+
* @summary Delete a user profile.
|
|
850
|
+
* @param deleteUserProfile - The deleteUserProfile object.
|
|
851
|
+
* @param deleteUserProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
|
|
817
852
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
818
853
|
*/
|
|
819
|
-
|
|
854
|
+
deleteUserProfile({ userToken }, requestOptions) {
|
|
820
855
|
if (!userToken) {
|
|
821
|
-
throw new Error('Parameter `userToken` is required when calling `
|
|
856
|
+
throw new Error('Parameter `userToken` is required when calling `deleteUserProfile`.');
|
|
822
857
|
}
|
|
823
|
-
const requestPath = '/1/profiles/
|
|
858
|
+
const requestPath = '/1/profiles/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));
|
|
824
859
|
const headers = {};
|
|
825
860
|
const queryParameters = {};
|
|
826
861
|
const request = {
|
|
827
|
-
method: '
|
|
862
|
+
method: 'DELETE',
|
|
828
863
|
path: requestPath,
|
|
829
864
|
queryParameters,
|
|
830
865
|
headers,
|
|
@@ -832,54 +867,43 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
832
867
|
return transporter.request(request, requestOptions);
|
|
833
868
|
},
|
|
834
869
|
/**
|
|
835
|
-
*
|
|
870
|
+
* The strategy contains information on the events and facets that impact user profiles and personalized search results.
|
|
836
871
|
*
|
|
837
|
-
* @summary
|
|
838
|
-
* @param post - The post object.
|
|
839
|
-
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
840
|
-
* @param post.parameters - Query parameters to apply to the current query.
|
|
841
|
-
* @param post.body - Parameters to send with the custom request.
|
|
872
|
+
* @summary Get the current strategy.
|
|
842
873
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
843
874
|
*/
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
throw new Error('Parameter `path` is required when calling `post`.');
|
|
847
|
-
}
|
|
848
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
875
|
+
getPersonalizationStrategy(requestOptions) {
|
|
876
|
+
const requestPath = '/1/strategies/personalization';
|
|
849
877
|
const headers = {};
|
|
850
|
-
const queryParameters =
|
|
878
|
+
const queryParameters = {};
|
|
851
879
|
const request = {
|
|
852
|
-
method: '
|
|
880
|
+
method: 'GET',
|
|
853
881
|
path: requestPath,
|
|
854
882
|
queryParameters,
|
|
855
883
|
headers,
|
|
856
|
-
data: body ? body : {},
|
|
857
884
|
};
|
|
858
885
|
return transporter.request(request, requestOptions);
|
|
859
886
|
},
|
|
860
887
|
/**
|
|
861
|
-
*
|
|
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.
|
|
862
889
|
*
|
|
863
|
-
* @summary
|
|
864
|
-
* @param
|
|
865
|
-
* @param
|
|
866
|
-
* @param put.parameters - Query parameters to apply to the current query.
|
|
867
|
-
* @param put.body - Parameters to send with the custom request.
|
|
890
|
+
* @summary Get a user profile.
|
|
891
|
+
* @param getUserTokenProfile - The getUserTokenProfile object.
|
|
892
|
+
* @param getUserTokenProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
|
|
868
893
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
869
894
|
*/
|
|
870
|
-
|
|
871
|
-
if (!
|
|
872
|
-
throw new Error('Parameter `
|
|
895
|
+
getUserTokenProfile({ userToken }, requestOptions) {
|
|
896
|
+
if (!userToken) {
|
|
897
|
+
throw new Error('Parameter `userToken` is required when calling `getUserTokenProfile`.');
|
|
873
898
|
}
|
|
874
|
-
const requestPath = '/1{
|
|
899
|
+
const requestPath = '/1/profiles/personalization/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));
|
|
875
900
|
const headers = {};
|
|
876
|
-
const queryParameters =
|
|
901
|
+
const queryParameters = {};
|
|
877
902
|
const request = {
|
|
878
|
-
method: '
|
|
903
|
+
method: 'GET',
|
|
879
904
|
path: requestPath,
|
|
880
905
|
queryParameters,
|
|
881
906
|
headers,
|
|
882
|
-
data: body ? body : {},
|
|
883
907
|
};
|
|
884
908
|
return transporter.request(request, requestOptions);
|
|
885
909
|
},
|
|
@@ -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.
|
|
5
|
+
const apiClientVersion = '5.0.0-alpha.97';
|
|
6
6
|
const REGIONS = ['eu', 'us'];
|
|
7
7
|
function getDefaultHosts(region) {
|
|
8
8
|
const url = 'personalization.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -63,14 +63,14 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
63
63
|
* This method allow you to send requests to the Algolia REST API.
|
|
64
64
|
*
|
|
65
65
|
* @summary Send requests to the Algolia REST API.
|
|
66
|
-
* @param
|
|
67
|
-
* @param
|
|
68
|
-
* @param
|
|
66
|
+
* @param customDelete - The customDelete object.
|
|
67
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
68
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
69
69
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
70
70
|
*/
|
|
71
|
-
|
|
71
|
+
customDelete({ path, parameters }, requestOptions) {
|
|
72
72
|
if (!path) {
|
|
73
|
-
throw new Error('Parameter `path` is required when calling `
|
|
73
|
+
throw new Error('Parameter `path` is required when calling `customDelete`.');
|
|
74
74
|
}
|
|
75
75
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
76
76
|
const headers = {};
|
|
@@ -84,22 +84,23 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
84
84
|
return transporter.request(request, requestOptions);
|
|
85
85
|
},
|
|
86
86
|
/**
|
|
87
|
-
*
|
|
87
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
88
88
|
*
|
|
89
|
-
* @summary
|
|
90
|
-
* @param
|
|
91
|
-
* @param
|
|
89
|
+
* @summary Send requests to the Algolia REST API.
|
|
90
|
+
* @param customGet - The customGet object.
|
|
91
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
92
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
92
93
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
93
94
|
*/
|
|
94
|
-
|
|
95
|
-
if (!
|
|
96
|
-
throw new Error('Parameter `
|
|
95
|
+
customGet({ path, parameters }, requestOptions) {
|
|
96
|
+
if (!path) {
|
|
97
|
+
throw new Error('Parameter `path` is required when calling `customGet`.');
|
|
97
98
|
}
|
|
98
|
-
const requestPath = '/1
|
|
99
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
99
100
|
const headers = {};
|
|
100
|
-
const queryParameters = {};
|
|
101
|
+
const queryParameters = parameters ? parameters : {};
|
|
101
102
|
const request = {
|
|
102
|
-
method: '
|
|
103
|
+
method: 'GET',
|
|
103
104
|
path: requestPath,
|
|
104
105
|
queryParameters,
|
|
105
106
|
headers,
|
|
@@ -110,61 +111,71 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
110
111
|
* This method allow you to send requests to the Algolia REST API.
|
|
111
112
|
*
|
|
112
113
|
* @summary Send requests to the Algolia REST API.
|
|
113
|
-
* @param
|
|
114
|
-
* @param
|
|
115
|
-
* @param
|
|
114
|
+
* @param customPost - The customPost object.
|
|
115
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
116
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
117
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
116
118
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
117
119
|
*/
|
|
118
|
-
|
|
120
|
+
customPost({ path, parameters, body }, requestOptions) {
|
|
119
121
|
if (!path) {
|
|
120
|
-
throw new Error('Parameter `path` is required when calling `
|
|
122
|
+
throw new Error('Parameter `path` is required when calling `customPost`.');
|
|
121
123
|
}
|
|
122
124
|
const requestPath = '/1{path}'.replace('{path}', path);
|
|
123
125
|
const headers = {};
|
|
124
126
|
const queryParameters = parameters ? parameters : {};
|
|
125
127
|
const request = {
|
|
126
|
-
method: '
|
|
128
|
+
method: 'POST',
|
|
127
129
|
path: requestPath,
|
|
128
130
|
queryParameters,
|
|
129
131
|
headers,
|
|
132
|
+
data: body ? body : {},
|
|
130
133
|
};
|
|
131
134
|
return transporter.request(request, requestOptions);
|
|
132
135
|
},
|
|
133
136
|
/**
|
|
134
|
-
*
|
|
137
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
135
138
|
*
|
|
136
|
-
* @summary
|
|
139
|
+
* @summary Send requests to the Algolia REST API.
|
|
140
|
+
* @param customPut - The customPut object.
|
|
141
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
142
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
143
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
137
144
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
138
145
|
*/
|
|
139
|
-
|
|
140
|
-
|
|
146
|
+
customPut({ path, parameters, body }, requestOptions) {
|
|
147
|
+
if (!path) {
|
|
148
|
+
throw new Error('Parameter `path` is required when calling `customPut`.');
|
|
149
|
+
}
|
|
150
|
+
const requestPath = '/1{path}'.replace('{path}', path);
|
|
141
151
|
const headers = {};
|
|
142
|
-
const queryParameters = {};
|
|
152
|
+
const queryParameters = parameters ? parameters : {};
|
|
143
153
|
const request = {
|
|
144
|
-
method: '
|
|
154
|
+
method: 'PUT',
|
|
145
155
|
path: requestPath,
|
|
146
156
|
queryParameters,
|
|
147
157
|
headers,
|
|
158
|
+
data: body ? body : {},
|
|
148
159
|
};
|
|
149
160
|
return transporter.request(request, requestOptions);
|
|
150
161
|
},
|
|
151
162
|
/**
|
|
152
|
-
*
|
|
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.
|
|
153
164
|
*
|
|
154
|
-
* @summary
|
|
155
|
-
* @param
|
|
156
|
-
* @param
|
|
165
|
+
* @summary Delete a user profile.
|
|
166
|
+
* @param deleteUserProfile - The deleteUserProfile object.
|
|
167
|
+
* @param deleteUserProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
|
|
157
168
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
158
169
|
*/
|
|
159
|
-
|
|
170
|
+
deleteUserProfile({ userToken }, requestOptions) {
|
|
160
171
|
if (!userToken) {
|
|
161
|
-
throw new Error('Parameter `userToken` is required when calling `
|
|
172
|
+
throw new Error('Parameter `userToken` is required when calling `deleteUserProfile`.');
|
|
162
173
|
}
|
|
163
|
-
const requestPath = '/1/profiles/
|
|
174
|
+
const requestPath = '/1/profiles/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));
|
|
164
175
|
const headers = {};
|
|
165
176
|
const queryParameters = {};
|
|
166
177
|
const request = {
|
|
167
|
-
method: '
|
|
178
|
+
method: 'DELETE',
|
|
168
179
|
path: requestPath,
|
|
169
180
|
queryParameters,
|
|
170
181
|
headers,
|
|
@@ -172,54 +183,43 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
172
183
|
return transporter.request(request, requestOptions);
|
|
173
184
|
},
|
|
174
185
|
/**
|
|
175
|
-
*
|
|
186
|
+
* The strategy contains information on the events and facets that impact user profiles and personalized search results.
|
|
176
187
|
*
|
|
177
|
-
* @summary
|
|
178
|
-
* @param post - The post object.
|
|
179
|
-
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
180
|
-
* @param post.parameters - Query parameters to apply to the current query.
|
|
181
|
-
* @param post.body - Parameters to send with the custom request.
|
|
188
|
+
* @summary Get the current strategy.
|
|
182
189
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
183
190
|
*/
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
throw new Error('Parameter `path` is required when calling `post`.');
|
|
187
|
-
}
|
|
188
|
-
const requestPath = '/1{path}'.replace('{path}', path);
|
|
191
|
+
getPersonalizationStrategy(requestOptions) {
|
|
192
|
+
const requestPath = '/1/strategies/personalization';
|
|
189
193
|
const headers = {};
|
|
190
|
-
const queryParameters =
|
|
194
|
+
const queryParameters = {};
|
|
191
195
|
const request = {
|
|
192
|
-
method: '
|
|
196
|
+
method: 'GET',
|
|
193
197
|
path: requestPath,
|
|
194
198
|
queryParameters,
|
|
195
199
|
headers,
|
|
196
|
-
data: body ? body : {},
|
|
197
200
|
};
|
|
198
201
|
return transporter.request(request, requestOptions);
|
|
199
202
|
},
|
|
200
203
|
/**
|
|
201
|
-
*
|
|
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.
|
|
202
205
|
*
|
|
203
|
-
* @summary
|
|
204
|
-
* @param
|
|
205
|
-
* @param
|
|
206
|
-
* @param put.parameters - Query parameters to apply to the current query.
|
|
207
|
-
* @param put.body - Parameters to send with the custom request.
|
|
206
|
+
* @summary Get a user profile.
|
|
207
|
+
* @param getUserTokenProfile - The getUserTokenProfile object.
|
|
208
|
+
* @param getUserTokenProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
|
|
208
209
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
209
210
|
*/
|
|
210
|
-
|
|
211
|
-
if (!
|
|
212
|
-
throw new Error('Parameter `
|
|
211
|
+
getUserTokenProfile({ userToken }, requestOptions) {
|
|
212
|
+
if (!userToken) {
|
|
213
|
+
throw new Error('Parameter `userToken` is required when calling `getUserTokenProfile`.');
|
|
213
214
|
}
|
|
214
|
-
const requestPath = '/1{
|
|
215
|
+
const requestPath = '/1/profiles/personalization/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));
|
|
215
216
|
const headers = {};
|
|
216
|
-
const queryParameters =
|
|
217
|
+
const queryParameters = {};
|
|
217
218
|
const request = {
|
|
218
|
-
method: '
|
|
219
|
+
method: 'GET',
|
|
219
220
|
path: requestPath,
|
|
220
221
|
queryParameters,
|
|
221
222
|
headers,
|
|
222
|
-
data: body ? body : {},
|
|
223
223
|
};
|
|
224
224
|
return transporter.request(request, requestOptions);
|
|
225
225
|
},
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! client-personalization.umd.js | 5.0.0-alpha.
|
|
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)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),s=a()[r];return Promise.all([s||t(),void 0!==s])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const o=a();return o[JSON.stringify(e)]=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||null===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)}(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 c extends i{constructor(e,t,r){super(e,r),n(this,"stackTrace",void 0),this.stackTrace=t}}class u extends c{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class l extends c{constructor(e,t,r,s="ApiError"){super(e,r,s),n(this,"status",void 0),this.status=t}}class h extends i{constructor(e,t){super(e,"DeserializationError"),n(this,"response",void 0),this.response=t}}class d extends l{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),n(this,"error",void 0),this.error=r}}function m(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 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:c,responsesCache:g}){async function f(c,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)}(c,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,c.headers,g.headers),v="GET"===c.method?{...c.data,...g.data}:{},q={...s,...c.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 u(function(e){return e.map((e=>p(e)))}(y));let a=g.timeout;void 0===a&&(a=f?n.read:n.write);const v={data:P,headers:w,method:c.method,url:m(s,c.path,q),connectTimeout:r(T,n.connect),responseTimeout:r(T,a)},S=t=>{const r={request:v,response:t,host:s,triesLeft:e.length};return y.push(r),r},O=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)}(O)){const a=S(O);return O.isTimedOut&&T++,console.log("Retryable failure",p(a)),await t.set(s,o(s,O.isTimedOut?"timed out":"down")),b(e,r)}if(function({status:e}){return 2==~~(e/100)}(O))return function(e){try{return JSON.parse(e.content)}catch(t){throw new h(t.message,e)}}(O);throw S(O),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 l(s.message,t,r)}catch(e){}return new l(e,t,r)}(O,y)},S=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),O=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}}(S);return b([...O.hosts].reverse(),O.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,(()=>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=>g.set(n,e)})},requestsCache:c,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-alpha.91",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:(c=a,[{url:"personalization.{region}.algolia.com".replace("{region}",c),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 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})},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const s={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},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)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const s={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},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)},post({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const a={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},put({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const a={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},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})}}));
|
|
1
|
+
/*! client-personalization.umd.js | 5.0.0-alpha.97 | © 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.97",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,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Properties for the `
|
|
2
|
+
* Properties for the `customDelete` method.
|
|
3
3
|
*/
|
|
4
|
-
export type
|
|
4
|
+
export type CustomDeleteProps = {
|
|
5
5
|
/**
|
|
6
6
|
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
7
7
|
*/
|
|
@@ -12,18 +12,9 @@ export type DelProps = {
|
|
|
12
12
|
parameters?: Record<string, any>;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
* Properties for the `
|
|
16
|
-
*/
|
|
17
|
-
export type DeleteUserProfileProps = {
|
|
18
|
-
/**
|
|
19
|
-
* UserToken representing the user for which to fetch the Personalization profile.
|
|
20
|
-
*/
|
|
21
|
-
userToken: string;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Properties for the `get` method.
|
|
15
|
+
* Properties for the `customGet` method.
|
|
25
16
|
*/
|
|
26
|
-
export type
|
|
17
|
+
export type CustomGetProps = {
|
|
27
18
|
/**
|
|
28
19
|
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
29
20
|
*/
|
|
@@ -34,18 +25,9 @@ export type GetProps = {
|
|
|
34
25
|
parameters?: Record<string, any>;
|
|
35
26
|
};
|
|
36
27
|
/**
|
|
37
|
-
* Properties for the `
|
|
38
|
-
*/
|
|
39
|
-
export type GetUserTokenProfileProps = {
|
|
40
|
-
/**
|
|
41
|
-
* UserToken representing the user for which to fetch the Personalization profile.
|
|
42
|
-
*/
|
|
43
|
-
userToken: string;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Properties for the `post` method.
|
|
28
|
+
* Properties for the `customPost` method.
|
|
47
29
|
*/
|
|
48
|
-
export type
|
|
30
|
+
export type CustomPostProps = {
|
|
49
31
|
/**
|
|
50
32
|
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
51
33
|
*/
|
|
@@ -60,9 +42,9 @@ export type PostProps = {
|
|
|
60
42
|
body?: Record<string, any>;
|
|
61
43
|
};
|
|
62
44
|
/**
|
|
63
|
-
* Properties for the `
|
|
45
|
+
* Properties for the `customPut` method.
|
|
64
46
|
*/
|
|
65
|
-
export type
|
|
47
|
+
export type CustomPutProps = {
|
|
66
48
|
/**
|
|
67
49
|
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
68
50
|
*/
|
|
@@ -76,4 +58,22 @@ export type PutProps = {
|
|
|
76
58
|
*/
|
|
77
59
|
body?: Record<string, any>;
|
|
78
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* Properties for the `deleteUserProfile` method.
|
|
63
|
+
*/
|
|
64
|
+
export type DeleteUserProfileProps = {
|
|
65
|
+
/**
|
|
66
|
+
* UserToken representing the user for which to fetch the Personalization profile.
|
|
67
|
+
*/
|
|
68
|
+
userToken: string;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Properties for the `getUserTokenProfile` method.
|
|
72
|
+
*/
|
|
73
|
+
export type GetUserTokenProfileProps = {
|
|
74
|
+
/**
|
|
75
|
+
* UserToken representing the user for which to fetch the Personalization profile.
|
|
76
|
+
*/
|
|
77
|
+
userToken: string;
|
|
78
|
+
};
|
|
79
79
|
//# sourceMappingURL=clientMethodProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientMethodProps.d.ts","sourceRoot":"","sources":["../../model/clientMethodProps.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"clientMethodProps.d.ts","sourceRoot":"","sources":["../../model/clientMethodProps.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { CreateClientOptions, RequestOptions } from '@algolia/client-common';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, DeleteUserProfileProps, GetUserTokenProfileProps } from '../model/clientMethodProps';
|
|
3
3
|
import type { DeleteUserProfileResponse } from '../model/deleteUserProfileResponse';
|
|
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.
|
|
7
|
+
export declare const apiClientVersion = "5.0.0-alpha.97";
|
|
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 & {
|
|
@@ -34,69 +34,69 @@ export declare function createPersonalizationClient({ appId: appIdOption, apiKey
|
|
|
34
34
|
* This method allow you to send requests to the Algolia REST API.
|
|
35
35
|
*
|
|
36
36
|
* @summary Send requests to the Algolia REST API.
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
39
|
-
* @param
|
|
37
|
+
* @param customDelete - The customDelete object.
|
|
38
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
39
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
40
40
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
45
45
|
*
|
|
46
|
-
* @summary
|
|
47
|
-
* @param
|
|
48
|
-
* @param
|
|
46
|
+
* @summary Send requests to the Algolia REST API.
|
|
47
|
+
* @param customGet - The customGet object.
|
|
48
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
49
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
49
50
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
50
51
|
*/
|
|
51
|
-
|
|
52
|
+
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
52
53
|
/**
|
|
53
54
|
* This method allow you to send requests to the Algolia REST API.
|
|
54
55
|
*
|
|
55
56
|
* @summary Send requests to the Algolia REST API.
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
58
|
-
* @param
|
|
57
|
+
* @param customPost - The customPost object.
|
|
58
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
59
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
60
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
59
61
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
60
62
|
*/
|
|
61
|
-
|
|
63
|
+
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
62
64
|
/**
|
|
63
|
-
*
|
|
65
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
64
66
|
*
|
|
65
|
-
* @summary
|
|
67
|
+
* @summary Send requests to the Algolia REST API.
|
|
68
|
+
* @param customPut - The customPut object.
|
|
69
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
70
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
71
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
66
72
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
67
73
|
*/
|
|
68
|
-
|
|
74
|
+
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, any>>;
|
|
69
75
|
/**
|
|
70
|
-
*
|
|
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.
|
|
71
77
|
*
|
|
72
|
-
* @summary
|
|
73
|
-
* @param
|
|
74
|
-
* @param
|
|
78
|
+
* @summary Delete a user profile.
|
|
79
|
+
* @param deleteUserProfile - The deleteUserProfile object.
|
|
80
|
+
* @param deleteUserProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
|
|
75
81
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
76
82
|
*/
|
|
77
|
-
|
|
83
|
+
deleteUserProfile({ userToken }: DeleteUserProfileProps, requestOptions?: RequestOptions): Promise<DeleteUserProfileResponse>;
|
|
78
84
|
/**
|
|
79
|
-
*
|
|
85
|
+
* The strategy contains information on the events and facets that impact user profiles and personalized search results.
|
|
80
86
|
*
|
|
81
|
-
* @summary
|
|
82
|
-
* @param post - The post object.
|
|
83
|
-
* @param post.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
84
|
-
* @param post.parameters - Query parameters to apply to the current query.
|
|
85
|
-
* @param post.body - Parameters to send with the custom request.
|
|
87
|
+
* @summary Get the current strategy.
|
|
86
88
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
87
89
|
*/
|
|
88
|
-
|
|
90
|
+
getPersonalizationStrategy(requestOptions?: RequestOptions): Promise<PersonalizationStrategyParams>;
|
|
89
91
|
/**
|
|
90
|
-
*
|
|
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.
|
|
91
93
|
*
|
|
92
|
-
* @summary
|
|
93
|
-
* @param
|
|
94
|
-
* @param
|
|
95
|
-
* @param put.parameters - Query parameters to apply to the current query.
|
|
96
|
-
* @param put.body - Parameters to send with the custom request.
|
|
94
|
+
* @summary Get a user profile.
|
|
95
|
+
* @param getUserTokenProfile - The getUserTokenProfile object.
|
|
96
|
+
* @param getUserTokenProfile.userToken - UserToken representing the user for which to fetch the Personalization profile.
|
|
97
97
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
98
98
|
*/
|
|
99
|
-
|
|
99
|
+
getUserTokenProfile({ userToken }: GetUserTokenProfileProps, requestOptions?: RequestOptions): Promise<GetUserTokenResponse>;
|
|
100
100
|
/**
|
|
101
101
|
* A strategy defines the events and facets that impact user profiles and personalized search results.
|
|
102
102
|
*
|
|
@@ -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,
|
|
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,9 +1,9 @@
|
|
|
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
3
|
/**
|
|
4
|
-
* Properties for the `
|
|
4
|
+
* Properties for the `customDelete` method.
|
|
5
5
|
*/
|
|
6
|
-
export type
|
|
6
|
+
export type CustomDeleteProps = {
|
|
7
7
|
/**
|
|
8
8
|
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
9
9
|
*/
|
|
@@ -15,19 +15,9 @@ export type DelProps = {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Properties for the `
|
|
19
|
-
*/
|
|
20
|
-
export type DeleteUserProfileProps = {
|
|
21
|
-
/**
|
|
22
|
-
* UserToken representing the user for which to fetch the Personalization profile.
|
|
23
|
-
*/
|
|
24
|
-
userToken: string;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Properties for the `get` method.
|
|
18
|
+
* Properties for the `customGet` method.
|
|
29
19
|
*/
|
|
30
|
-
export type
|
|
20
|
+
export type CustomGetProps = {
|
|
31
21
|
/**
|
|
32
22
|
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
33
23
|
*/
|
|
@@ -39,19 +29,9 @@ export type GetProps = {
|
|
|
39
29
|
};
|
|
40
30
|
|
|
41
31
|
/**
|
|
42
|
-
* Properties for the `
|
|
43
|
-
*/
|
|
44
|
-
export type GetUserTokenProfileProps = {
|
|
45
|
-
/**
|
|
46
|
-
* UserToken representing the user for which to fetch the Personalization profile.
|
|
47
|
-
*/
|
|
48
|
-
userToken: string;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Properties for the `post` method.
|
|
32
|
+
* Properties for the `customPost` method.
|
|
53
33
|
*/
|
|
54
|
-
export type
|
|
34
|
+
export type CustomPostProps = {
|
|
55
35
|
/**
|
|
56
36
|
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
57
37
|
*/
|
|
@@ -67,9 +47,9 @@ export type PostProps = {
|
|
|
67
47
|
};
|
|
68
48
|
|
|
69
49
|
/**
|
|
70
|
-
* Properties for the `
|
|
50
|
+
* Properties for the `customPut` method.
|
|
71
51
|
*/
|
|
72
|
-
export type
|
|
52
|
+
export type CustomPutProps = {
|
|
73
53
|
/**
|
|
74
54
|
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
75
55
|
*/
|
|
@@ -83,3 +63,23 @@ export type PutProps = {
|
|
|
83
63
|
*/
|
|
84
64
|
body?: Record<string, any>;
|
|
85
65
|
};
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Properties for the `deleteUserProfile` method.
|
|
69
|
+
*/
|
|
70
|
+
export type DeleteUserProfileProps = {
|
|
71
|
+
/**
|
|
72
|
+
* UserToken representing the user for which to fetch the Personalization profile.
|
|
73
|
+
*/
|
|
74
|
+
userToken: string;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Properties for the `getUserTokenProfile` method.
|
|
79
|
+
*/
|
|
80
|
+
export type GetUserTokenProfileProps = {
|
|
81
|
+
/**
|
|
82
|
+
* UserToken representing the user for which to fetch the Personalization profile.
|
|
83
|
+
*/
|
|
84
|
+
userToken: string;
|
|
85
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algolia/client-personalization",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.97",
|
|
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.
|
|
43
|
-
"@algolia/requester-browser-xhr": "5.0.0-alpha.
|
|
44
|
-
"@algolia/requester-node-http": "5.0.0-alpha.
|
|
42
|
+
"@algolia/client-common": "5.0.0-alpha.98",
|
|
43
|
+
"@algolia/requester-browser-xhr": "5.0.0-alpha.98",
|
|
44
|
+
"@algolia/requester-node-http": "5.0.0-alpha.98"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@types/node": "20.
|
|
48
|
-
"rollup": "4.
|
|
49
|
-
"typescript": "5.
|
|
47
|
+
"@types/node": "20.11.1",
|
|
48
|
+
"rollup": "4.9.5",
|
|
49
|
+
"typescript": "5.3.3"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">= 14.0.0"
|