@algolia/client-personalization 5.2.5 → 5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +190 -94
- package/dist/builds/browser.js +45 -31
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +1 -1
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +2 -2
- package/dist/builds/node.cjs +45 -31
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +45 -31
- package/dist/builds/node.js.map +1 -1
- package/dist/node.d.cts +190 -94
- package/dist/node.d.ts +190 -94
- package/dist/src/personalizationClient.cjs +45 -31
- package/dist/src/personalizationClient.cjs.map +1 -1
- package/dist/src/personalizationClient.js +45 -31
- package/dist/src/personalizationClient.js.map +1 -1
- package/package.json +4 -4
package/dist/browser.d.ts
CHANGED
|
@@ -1,5 +1,84 @@
|
|
|
1
1
|
import * as _algolia_client_common from '@algolia/client-common';
|
|
2
|
-
import { ClientOptions } from '@algolia/client-common';
|
|
2
|
+
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Properties for the `customDelete` method.
|
|
6
|
+
*/
|
|
7
|
+
type CustomDeleteProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
10
|
+
*/
|
|
11
|
+
path: string;
|
|
12
|
+
/**
|
|
13
|
+
* Query parameters to apply to the current query.
|
|
14
|
+
*/
|
|
15
|
+
parameters?: Record<string, any>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Properties for the `customGet` method.
|
|
19
|
+
*/
|
|
20
|
+
type CustomGetProps = {
|
|
21
|
+
/**
|
|
22
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
23
|
+
*/
|
|
24
|
+
path: string;
|
|
25
|
+
/**
|
|
26
|
+
* Query parameters to apply to the current query.
|
|
27
|
+
*/
|
|
28
|
+
parameters?: Record<string, any>;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Properties for the `customPost` method.
|
|
32
|
+
*/
|
|
33
|
+
type CustomPostProps = {
|
|
34
|
+
/**
|
|
35
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
36
|
+
*/
|
|
37
|
+
path: string;
|
|
38
|
+
/**
|
|
39
|
+
* Query parameters to apply to the current query.
|
|
40
|
+
*/
|
|
41
|
+
parameters?: Record<string, any>;
|
|
42
|
+
/**
|
|
43
|
+
* Parameters to send with the custom request.
|
|
44
|
+
*/
|
|
45
|
+
body?: Record<string, unknown>;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Properties for the `customPut` method.
|
|
49
|
+
*/
|
|
50
|
+
type CustomPutProps = {
|
|
51
|
+
/**
|
|
52
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
53
|
+
*/
|
|
54
|
+
path: string;
|
|
55
|
+
/**
|
|
56
|
+
* Query parameters to apply to the current query.
|
|
57
|
+
*/
|
|
58
|
+
parameters?: Record<string, any>;
|
|
59
|
+
/**
|
|
60
|
+
* Parameters to send with the custom request.
|
|
61
|
+
*/
|
|
62
|
+
body?: Record<string, unknown>;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Properties for the `deleteUserProfile` method.
|
|
66
|
+
*/
|
|
67
|
+
type DeleteUserProfileProps = {
|
|
68
|
+
/**
|
|
69
|
+
* Unique identifier representing a user for which to fetch the personalization profile.
|
|
70
|
+
*/
|
|
71
|
+
userToken: string;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Properties for the `getUserTokenProfile` method.
|
|
75
|
+
*/
|
|
76
|
+
type GetUserTokenProfileProps = {
|
|
77
|
+
/**
|
|
78
|
+
* Unique identifier representing a user for which to fetch the personalization profile.
|
|
79
|
+
*/
|
|
80
|
+
userToken: string;
|
|
81
|
+
};
|
|
3
82
|
|
|
4
83
|
type DeleteUserProfileResponse = {
|
|
5
84
|
/**
|
|
@@ -12,11 +91,19 @@ type DeleteUserProfileResponse = {
|
|
|
12
91
|
deletedUntil: string;
|
|
13
92
|
};
|
|
14
93
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
94
|
+
type GetUserTokenResponse = {
|
|
95
|
+
/**
|
|
96
|
+
* 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/).
|
|
97
|
+
*/
|
|
98
|
+
userToken: string;
|
|
99
|
+
/**
|
|
100
|
+
* Date and time of the last event from this user, in RFC 3339 format.
|
|
101
|
+
*/
|
|
102
|
+
lastEventAt: string;
|
|
103
|
+
/**
|
|
104
|
+
* 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.
|
|
105
|
+
*/
|
|
106
|
+
scores: Record<string, unknown>;
|
|
20
107
|
};
|
|
21
108
|
|
|
22
109
|
/**
|
|
@@ -47,21 +134,6 @@ type FacetScoring = {
|
|
|
47
134
|
facetName: string;
|
|
48
135
|
};
|
|
49
136
|
|
|
50
|
-
type GetUserTokenResponse = {
|
|
51
|
-
/**
|
|
52
|
-
* 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/).
|
|
53
|
-
*/
|
|
54
|
-
userToken: string;
|
|
55
|
-
/**
|
|
56
|
-
* Date and time of the last event from this user, in RFC 3339 format.
|
|
57
|
-
*/
|
|
58
|
-
lastEventAt: string;
|
|
59
|
-
/**
|
|
60
|
-
* 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.
|
|
61
|
-
*/
|
|
62
|
-
scores: Record<string, unknown>;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
137
|
type PersonalizationStrategyParams = {
|
|
66
138
|
/**
|
|
67
139
|
* Scores associated with each event. The higher the scores, the higher the impact of those events on the personalization of search results.
|
|
@@ -84,107 +156,131 @@ type SetPersonalizationStrategyResponse = {
|
|
|
84
156
|
message: string;
|
|
85
157
|
};
|
|
86
158
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
159
|
+
declare const apiClientVersion = "5.3.1";
|
|
160
|
+
declare const REGIONS: readonly ["eu", "us"];
|
|
161
|
+
type Region = (typeof REGIONS)[number];
|
|
162
|
+
declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
|
|
163
|
+
region: Region;
|
|
164
|
+
}): {
|
|
165
|
+
transporter: _algolia_client_common.Transporter;
|
|
91
166
|
/**
|
|
92
|
-
*
|
|
167
|
+
* The `appId` currently in use.
|
|
93
168
|
*/
|
|
94
|
-
|
|
169
|
+
appId: string;
|
|
95
170
|
/**
|
|
96
|
-
*
|
|
171
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
97
172
|
*/
|
|
98
|
-
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
* Properties for the `customGet` method.
|
|
102
|
-
*/
|
|
103
|
-
type CustomGetProps = {
|
|
173
|
+
clearCache(): Promise<void>;
|
|
104
174
|
/**
|
|
105
|
-
*
|
|
175
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
106
176
|
*/
|
|
107
|
-
|
|
177
|
+
readonly _ua: string;
|
|
108
178
|
/**
|
|
109
|
-
*
|
|
179
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
180
|
+
*
|
|
181
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
182
|
+
* @param version - The version of the agent.
|
|
110
183
|
*/
|
|
111
|
-
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* Properties for the `customPost` method.
|
|
115
|
-
*/
|
|
116
|
-
type CustomPostProps = {
|
|
184
|
+
addAlgoliaAgent(segment: string, version?: string): void;
|
|
117
185
|
/**
|
|
118
|
-
*
|
|
186
|
+
* Helper method to switch the API key used to authenticate the requests.
|
|
187
|
+
*
|
|
188
|
+
* @param params - Method params.
|
|
189
|
+
* @param params.apiKey - The new API Key to use.
|
|
119
190
|
*/
|
|
120
|
-
|
|
191
|
+
setClientApiKey({ apiKey }: {
|
|
192
|
+
apiKey: string;
|
|
193
|
+
}): void;
|
|
121
194
|
/**
|
|
122
|
-
*
|
|
195
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
196
|
+
*
|
|
197
|
+
* @param customDelete - The customDelete object.
|
|
198
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
199
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
200
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
123
201
|
*/
|
|
124
|
-
parameters?: Record<string,
|
|
202
|
+
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
125
203
|
/**
|
|
126
|
-
*
|
|
204
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
205
|
+
*
|
|
206
|
+
* @param customGet - The customGet object.
|
|
207
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
208
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
209
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
127
210
|
*/
|
|
128
|
-
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* Properties for the `customPut` method.
|
|
132
|
-
*/
|
|
133
|
-
type CustomPutProps = {
|
|
211
|
+
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
134
212
|
/**
|
|
135
|
-
*
|
|
213
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
214
|
+
*
|
|
215
|
+
* @param customPost - The customPost object.
|
|
216
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
217
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
218
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
219
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
136
220
|
*/
|
|
137
|
-
path: string
|
|
221
|
+
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
138
222
|
/**
|
|
139
|
-
*
|
|
223
|
+
* This method allow you to send requests to the Algolia REST API.
|
|
224
|
+
*
|
|
225
|
+
* @param customPut - The customPut object.
|
|
226
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
227
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
228
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
229
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
140
230
|
*/
|
|
141
|
-
parameters?: Record<string,
|
|
231
|
+
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
142
232
|
/**
|
|
143
|
-
*
|
|
233
|
+
* Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.
|
|
234
|
+
*
|
|
235
|
+
* Required API Key ACLs:
|
|
236
|
+
* - recommendation.
|
|
237
|
+
*
|
|
238
|
+
* @param deleteUserProfile - The deleteUserProfile object.
|
|
239
|
+
* @param deleteUserProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
|
|
240
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
144
241
|
*/
|
|
145
|
-
|
|
146
|
-
};
|
|
147
|
-
/**
|
|
148
|
-
* Properties for the `deleteUserProfile` method.
|
|
149
|
-
*/
|
|
150
|
-
type DeleteUserProfileProps = {
|
|
242
|
+
deleteUserProfile({ userToken }: DeleteUserProfileProps, requestOptions?: RequestOptions): Promise<DeleteUserProfileResponse>;
|
|
151
243
|
/**
|
|
152
|
-
*
|
|
244
|
+
* Retrieves the current personalization strategy.
|
|
245
|
+
*
|
|
246
|
+
* Required API Key ACLs:
|
|
247
|
+
* - recommendation.
|
|
248
|
+
*
|
|
249
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
153
250
|
*/
|
|
154
|
-
|
|
155
|
-
};
|
|
156
|
-
/**
|
|
157
|
-
* Properties for the `getUserTokenProfile` method.
|
|
158
|
-
*/
|
|
159
|
-
type GetUserTokenProfileProps = {
|
|
251
|
+
getPersonalizationStrategy(requestOptions?: RequestOptions): Promise<PersonalizationStrategyParams>;
|
|
160
252
|
/**
|
|
161
|
-
*
|
|
253
|
+
* Retrieves a user profile and their affinities for different facets.
|
|
254
|
+
*
|
|
255
|
+
* Required API Key ACLs:
|
|
256
|
+
* - recommendation.
|
|
257
|
+
*
|
|
258
|
+
* @param getUserTokenProfile - The getUserTokenProfile object.
|
|
259
|
+
* @param getUserTokenProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
|
|
260
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
162
261
|
*/
|
|
163
|
-
userToken:
|
|
262
|
+
getUserTokenProfile({ userToken }: GetUserTokenProfileProps, requestOptions?: RequestOptions): Promise<GetUserTokenResponse>;
|
|
263
|
+
/**
|
|
264
|
+
* Creates a new personalization strategy.
|
|
265
|
+
*
|
|
266
|
+
* Required API Key ACLs:
|
|
267
|
+
* - recommendation.
|
|
268
|
+
*
|
|
269
|
+
* @param personalizationStrategyParams - The personalizationStrategyParams object.
|
|
270
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
271
|
+
*/
|
|
272
|
+
setPersonalizationStrategy(personalizationStrategyParams: PersonalizationStrategyParams, requestOptions?: RequestOptions): Promise<SetPersonalizationStrategyResponse>;
|
|
164
273
|
};
|
|
165
274
|
|
|
166
|
-
declare const apiClientVersion = "5.2.5";
|
|
167
|
-
declare const REGIONS: readonly ["eu", "us"];
|
|
168
|
-
type Region = (typeof REGIONS)[number];
|
|
169
|
-
|
|
170
275
|
/**
|
|
171
|
-
*
|
|
276
|
+
* Error.
|
|
172
277
|
*/
|
|
173
|
-
type
|
|
174
|
-
|
|
175
|
-
transporter: _algolia_client_common.Transporter;
|
|
176
|
-
appId: string;
|
|
177
|
-
clearCache(): Promise<void>;
|
|
178
|
-
readonly _ua: string;
|
|
179
|
-
addAlgoliaAgent(segment: string, version?: string): void;
|
|
180
|
-
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
|
|
181
|
-
customGet({ path, parameters }: CustomGetProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
|
|
182
|
-
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
|
|
183
|
-
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
|
|
184
|
-
deleteUserProfile({ userToken }: DeleteUserProfileProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<DeleteUserProfileResponse>;
|
|
185
|
-
getPersonalizationStrategy(requestOptions?: _algolia_client_common.RequestOptions): Promise<PersonalizationStrategyParams>;
|
|
186
|
-
getUserTokenProfile({ userToken }: GetUserTokenProfileProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<GetUserTokenResponse>;
|
|
187
|
-
setPersonalizationStrategy(personalizationStrategyParams: PersonalizationStrategyParams, requestOptions?: _algolia_client_common.RequestOptions): Promise<SetPersonalizationStrategyResponse>;
|
|
278
|
+
type ErrorBase = Record<string, any> & {
|
|
279
|
+
message?: string;
|
|
188
280
|
};
|
|
189
281
|
|
|
282
|
+
type PersonalizationClient = ReturnType<typeof createPersonalizationClient>;
|
|
283
|
+
|
|
284
|
+
declare function personalizationClient(appId: string, apiKey: string, region: Region, options?: ClientOptions): PersonalizationClient;
|
|
285
|
+
|
|
190
286
|
export { type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteUserProfileProps, type DeleteUserProfileResponse, type ErrorBase, type EventScoring, type EventType, type FacetScoring, type GetUserTokenProfileProps, type GetUserTokenResponse, type PersonalizationClient, type PersonalizationStrategyParams, type Region, type SetPersonalizationStrategyResponse, apiClientVersion, personalizationClient };
|
package/dist/builds/browser.js
CHANGED
|
@@ -11,7 +11,7 @@ import { createXhrRequester } from "@algolia/requester-browser-xhr";
|
|
|
11
11
|
|
|
12
12
|
// src/personalizationClient.ts
|
|
13
13
|
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
|
|
14
|
-
var apiClientVersion = "5.
|
|
14
|
+
var apiClientVersion = "5.3.1";
|
|
15
15
|
var REGIONS = ["eu", "us"];
|
|
16
16
|
function getDefaultHosts(region) {
|
|
17
17
|
const url = "personalization.{region}.algolia.com".replace("{region}", region);
|
|
@@ -26,26 +26,25 @@ function createPersonalizationClient({
|
|
|
26
26
|
...options
|
|
27
27
|
}) {
|
|
28
28
|
const auth = createAuth(appIdOption, apiKeyOption, authMode);
|
|
29
|
-
const transporter = createTransporter({
|
|
30
|
-
hosts: getDefaultHosts(regionOption),
|
|
31
|
-
...options,
|
|
32
|
-
algoliaAgent: getAlgoliaAgent({
|
|
33
|
-
algoliaAgents,
|
|
34
|
-
client: "Personalization",
|
|
35
|
-
version: apiClientVersion
|
|
36
|
-
}),
|
|
37
|
-
baseHeaders: {
|
|
38
|
-
"content-type": "text/plain",
|
|
39
|
-
...auth.headers(),
|
|
40
|
-
...options.baseHeaders
|
|
41
|
-
},
|
|
42
|
-
baseQueryParameters: {
|
|
43
|
-
...auth.queryParameters(),
|
|
44
|
-
...options.baseQueryParameters
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
29
|
return {
|
|
48
|
-
transporter
|
|
30
|
+
transporter: createTransporter({
|
|
31
|
+
hosts: getDefaultHosts(regionOption),
|
|
32
|
+
...options,
|
|
33
|
+
algoliaAgent: getAlgoliaAgent({
|
|
34
|
+
algoliaAgents,
|
|
35
|
+
client: "Personalization",
|
|
36
|
+
version: apiClientVersion
|
|
37
|
+
}),
|
|
38
|
+
baseHeaders: {
|
|
39
|
+
"content-type": "text/plain",
|
|
40
|
+
...auth.headers(),
|
|
41
|
+
...options.baseHeaders
|
|
42
|
+
},
|
|
43
|
+
baseQueryParameters: {
|
|
44
|
+
...auth.queryParameters(),
|
|
45
|
+
...options.baseQueryParameters
|
|
46
|
+
}
|
|
47
|
+
}),
|
|
49
48
|
/**
|
|
50
49
|
* The `appId` currently in use.
|
|
51
50
|
*/
|
|
@@ -54,13 +53,15 @@ function createPersonalizationClient({
|
|
|
54
53
|
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
55
54
|
*/
|
|
56
55
|
clearCache() {
|
|
57
|
-
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(
|
|
56
|
+
return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then(
|
|
57
|
+
() => void 0
|
|
58
|
+
);
|
|
58
59
|
},
|
|
59
60
|
/**
|
|
60
61
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
61
62
|
*/
|
|
62
63
|
get _ua() {
|
|
63
|
-
return transporter.algoliaAgent.value;
|
|
64
|
+
return this.transporter.algoliaAgent.value;
|
|
64
65
|
},
|
|
65
66
|
/**
|
|
66
67
|
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
@@ -69,7 +70,20 @@ function createPersonalizationClient({
|
|
|
69
70
|
* @param version - The version of the agent.
|
|
70
71
|
*/
|
|
71
72
|
addAlgoliaAgent(segment, version) {
|
|
72
|
-
transporter.algoliaAgent.add({ segment, version });
|
|
73
|
+
this.transporter.algoliaAgent.add({ segment, version });
|
|
74
|
+
},
|
|
75
|
+
/**
|
|
76
|
+
* Helper method to switch the API key used to authenticate the requests.
|
|
77
|
+
*
|
|
78
|
+
* @param params - Method params.
|
|
79
|
+
* @param params.apiKey - The new API Key to use.
|
|
80
|
+
*/
|
|
81
|
+
setClientApiKey({ apiKey }) {
|
|
82
|
+
if (!authMode || authMode === "WithinHeaders") {
|
|
83
|
+
this.transporter.baseHeaders["x-algolia-api-key"] = apiKey;
|
|
84
|
+
} else {
|
|
85
|
+
this.transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
|
|
86
|
+
}
|
|
73
87
|
},
|
|
74
88
|
/**
|
|
75
89
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -92,7 +106,7 @@ function createPersonalizationClient({
|
|
|
92
106
|
queryParameters,
|
|
93
107
|
headers
|
|
94
108
|
};
|
|
95
|
-
return transporter.request(request, requestOptions);
|
|
109
|
+
return this.transporter.request(request, requestOptions);
|
|
96
110
|
},
|
|
97
111
|
/**
|
|
98
112
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -115,7 +129,7 @@ function createPersonalizationClient({
|
|
|
115
129
|
queryParameters,
|
|
116
130
|
headers
|
|
117
131
|
};
|
|
118
|
-
return transporter.request(request, requestOptions);
|
|
132
|
+
return this.transporter.request(request, requestOptions);
|
|
119
133
|
},
|
|
120
134
|
/**
|
|
121
135
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -140,7 +154,7 @@ function createPersonalizationClient({
|
|
|
140
154
|
headers,
|
|
141
155
|
data: body ? body : {}
|
|
142
156
|
};
|
|
143
|
-
return transporter.request(request, requestOptions);
|
|
157
|
+
return this.transporter.request(request, requestOptions);
|
|
144
158
|
},
|
|
145
159
|
/**
|
|
146
160
|
* This method allow you to send requests to the Algolia REST API.
|
|
@@ -165,7 +179,7 @@ function createPersonalizationClient({
|
|
|
165
179
|
headers,
|
|
166
180
|
data: body ? body : {}
|
|
167
181
|
};
|
|
168
|
-
return transporter.request(request, requestOptions);
|
|
182
|
+
return this.transporter.request(request, requestOptions);
|
|
169
183
|
},
|
|
170
184
|
/**
|
|
171
185
|
* Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.
|
|
@@ -190,7 +204,7 @@ function createPersonalizationClient({
|
|
|
190
204
|
queryParameters,
|
|
191
205
|
headers
|
|
192
206
|
};
|
|
193
|
-
return transporter.request(request, requestOptions);
|
|
207
|
+
return this.transporter.request(request, requestOptions);
|
|
194
208
|
},
|
|
195
209
|
/**
|
|
196
210
|
* Retrieves the current personalization strategy.
|
|
@@ -210,7 +224,7 @@ function createPersonalizationClient({
|
|
|
210
224
|
queryParameters,
|
|
211
225
|
headers
|
|
212
226
|
};
|
|
213
|
-
return transporter.request(request, requestOptions);
|
|
227
|
+
return this.transporter.request(request, requestOptions);
|
|
214
228
|
},
|
|
215
229
|
/**
|
|
216
230
|
* Retrieves a user profile and their affinities for different facets.
|
|
@@ -238,7 +252,7 @@ function createPersonalizationClient({
|
|
|
238
252
|
queryParameters,
|
|
239
253
|
headers
|
|
240
254
|
};
|
|
241
|
-
return transporter.request(request, requestOptions);
|
|
255
|
+
return this.transporter.request(request, requestOptions);
|
|
242
256
|
},
|
|
243
257
|
/**
|
|
244
258
|
* Creates a new personalization strategy.
|
|
@@ -280,7 +294,7 @@ function createPersonalizationClient({
|
|
|
280
294
|
headers,
|
|
281
295
|
data: personalizationStrategyParams
|
|
282
296
|
};
|
|
283
|
-
return transporter.request(request, requestOptions);
|
|
297
|
+
return this.transporter.request(request, requestOptions);
|
|
284
298
|
}
|
|
285
299
|
};
|
|
286
300
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../builds/browser.ts","../../src/personalizationClient.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type { ClientOptions } from '@algolia/client-common';\nimport {\n createMemoryCache,\n createFallbackableCache,\n createBrowserLocalStorageCache,\n DEFAULT_CONNECT_TIMEOUT_BROWSER,\n DEFAULT_READ_TIMEOUT_BROWSER,\n DEFAULT_WRITE_TIMEOUT_BROWSER,\n} from '@algolia/client-common';\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport type { Region } from '../src/personalizationClient';\nimport { createPersonalizationClient, apiClientVersion, REGIONS } from '../src/personalizationClient';\n\nexport { apiClientVersion, Region } from '../src/personalizationClient';\nexport * from '../model';\n\n/**\n * The client type.\n */\nexport type PersonalizationClient = ReturnType<typeof personalizationClient>;\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function personalizationClient(appId: string, apiKey: string, region: Region, options?: ClientOptions) {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {\n throw new Error(`\\`region\\` is required and must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n return createPersonalizationClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,\n read: DEFAULT_READ_TIMEOUT_BROWSER,\n write: DEFAULT_WRITE_TIMEOUT_BROWSER,\n },\n requester: createXhrRequester(),\n algoliaAgents: [{ segment: 'Browser' }],\n authMode: 'WithinQueryParameters',\n responsesCache: createMemoryCache(),\n requestsCache: createMemoryCache({ serializable: false }),\n hostsCache: createFallbackableCache({\n caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],\n }),\n ...options,\n });\n}\n","// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserProfileProps,\n GetUserTokenProfileProps,\n} from '../model/clientMethodProps';\nimport type { DeleteUserProfileResponse } from '../model/deleteUserProfileResponse';\nimport type { GetUserTokenResponse } from '../model/getUserTokenResponse';\nimport type { PersonalizationStrategyParams } from '../model/personalizationStrategyParams';\nimport type { SetPersonalizationStrategyResponse } from '../model/setPersonalizationStrategyResponse';\n\nexport const apiClientVersion = '5.2.5';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'personalization.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function createPersonalizationClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & { region: Region }) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Personalization',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n });\n\n return {\n transporter,\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => undefined);\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.\n *\n * Required API Key ACLs:\n * - recommendation.\n *\n * @param deleteUserProfile - The deleteUserProfile object.\n * @param deleteUserProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUserProfile(\n { userToken }: DeleteUserProfileProps,\n requestOptions?: RequestOptions,\n ): Promise<DeleteUserProfileResponse> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `deleteUserProfile`.');\n }\n\n const requestPath = '/1/profiles/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the current personalization strategy.\n *\n * Required API Key ACLs:\n * - recommendation.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getPersonalizationStrategy(requestOptions?: RequestOptions): Promise<PersonalizationStrategyParams> {\n const requestPath = '/1/strategies/personalization';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a user profile and their affinities for different facets.\n *\n * Required API Key ACLs:\n * - recommendation.\n *\n * @param getUserTokenProfile - The getUserTokenProfile object.\n * @param getUserTokenProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUserTokenProfile(\n { userToken }: GetUserTokenProfileProps,\n requestOptions?: RequestOptions,\n ): Promise<GetUserTokenResponse> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `getUserTokenProfile`.');\n }\n\n const requestPath = '/1/profiles/personalization/{userToken}'.replace(\n '{userToken}',\n encodeURIComponent(userToken),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return transporter.request(request, requestOptions);\n },\n\n /**\n * Creates a new personalization strategy.\n *\n * Required API Key ACLs:\n * - recommendation.\n *\n * @param personalizationStrategyParams - The personalizationStrategyParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n setPersonalizationStrategy(\n personalizationStrategyParams: PersonalizationStrategyParams,\n requestOptions?: RequestOptions,\n ): Promise<SetPersonalizationStrategyResponse> {\n if (!personalizationStrategyParams) {\n throw new Error(\n 'Parameter `personalizationStrategyParams` is required when calling `setPersonalizationStrategy`.',\n );\n }\n\n if (!personalizationStrategyParams.eventScoring) {\n throw new Error(\n 'Parameter `personalizationStrategyParams.eventScoring` is required when calling `setPersonalizationStrategy`.',\n );\n }\n if (!personalizationStrategyParams.facetScoring) {\n throw new Error(\n 'Parameter `personalizationStrategyParams.facetScoring` is required when calling `setPersonalizationStrategy`.',\n );\n }\n if (!personalizationStrategyParams.personalizationImpact) {\n throw new Error(\n 'Parameter `personalizationStrategyParams.personalizationImpact` is required when calling `setPersonalizationStrategy`.',\n );\n }\n\n const requestPath = '/1/strategies/personalization';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: personalizationStrategyParams,\n };\n\n return transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAGA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;;;ACTnC,SAAS,YAAY,mBAAmB,uBAAuB;AAuBxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAGlC,SAAS,gBAAgB,QAAwB;AAC/C,QAAM,MAAM,uCAAuC,QAAQ,YAAY,MAAM;AAE7E,SAAO,CAAC,EAAE,KAAK,QAAQ,aAAa,UAAU,QAAQ,CAAC;AACzD;AAGO,SAAS,4BAA4B;AAAA,EAC1C,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,GAAG;AACL,GAA6C;AAC3C,QAAM,OAAO,WAAW,aAAa,cAAc,QAAQ;AAC3D,QAAM,cAAc,kBAAkB;AAAA,IACpC,OAAO,gBAAgB,YAAY;AAAA,IACnC,GAAG;AAAA,IACH,cAAc,gBAAgB;AAAA,MAC5B;AAAA,MACA,QAAQ;AAAA,MACR,SAAS;AAAA,IACX,CAAC;AAAA,IACD,aAAa;AAAA,MACX,gBAAgB;AAAA,MAChB,GAAG,KAAK,QAAQ;AAAA,MAChB,GAAG,QAAQ;AAAA,I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AA,IACD,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../builds/browser.ts","../../src/personalizationClient.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type { ClientOptions } from '@algolia/client-common';\nimport {\n createMemoryCache,\n createFallbackableCache,\n createBrowserLocalStorageCache,\n DEFAULT_CONNECT_TIMEOUT_BROWSER,\n DEFAULT_READ_TIMEOUT_BROWSER,\n DEFAULT_WRITE_TIMEOUT_BROWSER,\n} from '@algolia/client-common';\nimport { createXhrRequester } from '@algolia/requester-browser-xhr';\n\nimport type { Region } from '../src/personalizationClient';\nimport { createPersonalizationClient, apiClientVersion, REGIONS } from '../src/personalizationClient';\n\nexport type PersonalizationClient = ReturnType<typeof createPersonalizationClient>;\n\nexport { apiClientVersion, Region } from '../src/personalizationClient';\nexport * from '../model';\n\nexport function personalizationClient(\n appId: string,\n apiKey: string,\n region: Region,\n options?: ClientOptions,\n): PersonalizationClient {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n if (!region || (region && (typeof region !== 'string' || !REGIONS.includes(region)))) {\n throw new Error(`\\`region\\` is required and must be one of the following: ${REGIONS.join(', ')}`);\n }\n\n return createPersonalizationClient({\n appId,\n apiKey,\n region,\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_BROWSER,\n read: DEFAULT_READ_TIMEOUT_BROWSER,\n write: DEFAULT_WRITE_TIMEOUT_BROWSER,\n },\n requester: createXhrRequester(),\n algoliaAgents: [{ segment: 'Browser' }],\n authMode: 'WithinQueryParameters',\n responsesCache: createMemoryCache(),\n requestsCache: createMemoryCache({ serializable: false }),\n hostsCache: createFallbackableCache({\n caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()],\n }),\n ...options,\n });\n}\n","// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport { createAuth, createTransporter, getAlgoliaAgent } from '@algolia/client-common';\nimport type {\n CreateClientOptions,\n Headers,\n Host,\n QueryParameters,\n Request,\n RequestOptions,\n} from '@algolia/client-common';\n\nimport type {\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeleteUserProfileProps,\n GetUserTokenProfileProps,\n} from '../model/clientMethodProps';\nimport type { DeleteUserProfileResponse } from '../model/deleteUserProfileResponse';\nimport type { GetUserTokenResponse } from '../model/getUserTokenResponse';\nimport type { PersonalizationStrategyParams } from '../model/personalizationStrategyParams';\nimport type { SetPersonalizationStrategyResponse } from '../model/setPersonalizationStrategyResponse';\n\nexport const apiClientVersion = '5.3.1';\n\nexport const REGIONS = ['eu', 'us'] as const;\nexport type Region = (typeof REGIONS)[number];\n\nfunction getDefaultHosts(region: Region): Host[] {\n const url = 'personalization.{region}.algolia.com'.replace('{region}', region);\n\n return [{ url, accept: 'readWrite', protocol: 'https' }];\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function createPersonalizationClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n region: regionOption,\n ...options\n}: CreateClientOptions & { region: Region }) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n\n return {\n transporter: createTransporter({\n hosts: getDefaultHosts(regionOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: 'Personalization',\n version: apiClientVersion,\n }),\n baseHeaders: {\n 'content-type': 'text/plain',\n ...auth.headers(),\n ...options.baseHeaders,\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters,\n },\n }),\n\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache(): Promise<void> {\n return Promise.all([this.transporter.requestsCache.clear(), this.transporter.responsesCache.clear()]).then(\n () => undefined,\n );\n },\n\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return this.transporter.algoliaAgent.value;\n },\n\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment: string, version?: string): void {\n this.transporter.algoliaAgent.add({ segment, version });\n },\n\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }: { apiKey: string }): void {\n if (!authMode || authMode === 'WithinHeaders') {\n this.transporter.baseHeaders['x-algolia-api-key'] = apiKey;\n } else {\n this.transporter.baseQueryParameters['x-algolia-api-key'] = apiKey;\n }\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customDelete - The customDelete object.\n * @param customDelete.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customDelete.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customDelete(\n { path, parameters }: CustomDeleteProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customDelete`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customGet - The customGet object.\n * @param customGet.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customGet.parameters - Query parameters to apply to the current query.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customGet`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost(\n { path, parameters, body }: CustomPostProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPost`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * This method allow you to send requests to the Algolia REST API.\n *\n * @param customPut - The customPut object.\n * @param customPut.path - Path of the endpoint, anything after \\\"/1\\\" must be specified.\n * @param customPut.parameters - Query parameters to apply to the current query.\n * @param customPut.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPut(\n { path, parameters, body }: CustomPutProps,\n requestOptions?: RequestOptions,\n ): Promise<Record<string, unknown>> {\n if (!path) {\n throw new Error('Parameter `path` is required when calling `customPut`.');\n }\n\n const requestPath = '/{path}'.replace('{path}', path);\n const headers: Headers = {};\n const queryParameters: QueryParameters = parameters ? parameters : {};\n\n const request: Request = {\n method: 'PUT',\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {},\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.\n *\n * Required API Key ACLs:\n * - recommendation.\n *\n * @param deleteUserProfile - The deleteUserProfile object.\n * @param deleteUserProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n deleteUserProfile(\n { userToken }: DeleteUserProfileProps,\n requestOptions?: RequestOptions,\n ): Promise<DeleteUserProfileResponse> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `deleteUserProfile`.');\n }\n\n const requestPath = '/1/profiles/{userToken}'.replace('{userToken}', encodeURIComponent(userToken));\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'DELETE',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves the current personalization strategy.\n *\n * Required API Key ACLs:\n * - recommendation.\n *\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getPersonalizationStrategy(requestOptions?: RequestOptions): Promise<PersonalizationStrategyParams> {\n const requestPath = '/1/strategies/personalization';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Retrieves a user profile and their affinities for different facets.\n *\n * Required API Key ACLs:\n * - recommendation.\n *\n * @param getUserTokenProfile - The getUserTokenProfile object.\n * @param getUserTokenProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getUserTokenProfile(\n { userToken }: GetUserTokenProfileProps,\n requestOptions?: RequestOptions,\n ): Promise<GetUserTokenResponse> {\n if (!userToken) {\n throw new Error('Parameter `userToken` is required when calling `getUserTokenProfile`.');\n }\n\n const requestPath = '/1/profiles/personalization/{userToken}'.replace(\n '{userToken}',\n encodeURIComponent(userToken),\n );\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'GET',\n path: requestPath,\n queryParameters,\n headers,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n\n /**\n * Creates a new personalization strategy.\n *\n * Required API Key ACLs:\n * - recommendation.\n *\n * @param personalizationStrategyParams - The personalizationStrategyParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n setPersonalizationStrategy(\n personalizationStrategyParams: PersonalizationStrategyParams,\n requestOptions?: RequestOptions,\n ): Promise<SetPersonalizationStrategyResponse> {\n if (!personalizationStrategyParams) {\n throw new Error(\n 'Parameter `personalizationStrategyParams` is required when calling `setPersonalizationStrategy`.',\n );\n }\n\n if (!personalizationStrategyParams.eventScoring) {\n throw new Error(\n 'Parameter `personalizationStrategyParams.eventScoring` is required when calling `setPersonalizationStrategy`.',\n );\n }\n if (!personalizationStrategyParams.facetScoring) {\n throw new Error(\n 'Parameter `personalizationStrategyParams.facetScoring` is required when calling `setPersonalizationStrategy`.',\n );\n }\n if (!personalizationStrategyParams.personalizationImpact) {\n throw new Error(\n 'Parameter `personalizationStrategyParams.personalizationImpact` is required when calling `setPersonalizationStrategy`.',\n );\n }\n\n const requestPath = '/1/strategies/personalization';\n const headers: Headers = {};\n const queryParameters: QueryParameters = {};\n\n const request: Request = {\n method: 'POST',\n path: requestPath,\n queryParameters,\n headers,\n data: personalizationStrategyParams,\n };\n\n return this.transporter.request(request, requestOptions);\n },\n };\n}\n"],"mappings":";AAGA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;;;ACTnC,SAAS,YAAY,mBAAmB,uBAAuB;AAuBxD,IAAM,mBAAmB;AAEzB,IAAM,UAAU,CAAC,MAAM,IAAI;AAGlC,SAAS,gBAAgB,Q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