@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/node.d.cts 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
- * Error.
17
- */
18
- type ErrorBase = Record<string, any> & {
19
- message?: string;
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
- * Properties for the `customDelete` method.
89
- */
90
- type CustomDeleteProps = {
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
- * Path of the endpoint, anything after \"/1\" must be specified.
167
+ * The `appId` currently in use.
93
168
  */
94
- path: string;
169
+ appId: string;
95
170
  /**
96
- * Query parameters to apply to the current query.
171
+ * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
97
172
  */
98
- parameters?: Record<string, any>;
99
- };
100
- /**
101
- * Properties for the `customGet` method.
102
- */
103
- type CustomGetProps = {
173
+ clearCache(): Promise<void>;
104
174
  /**
105
- * Path of the endpoint, anything after \"/1\" must be specified.
175
+ * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
106
176
  */
107
- path: string;
177
+ readonly _ua: string;
108
178
  /**
109
- * Query parameters to apply to the current query.
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
- parameters?: Record<string, any>;
112
- };
113
- /**
114
- * Properties for the `customPost` method.
115
- */
116
- type CustomPostProps = {
184
+ addAlgoliaAgent(segment: string, version?: string): void;
117
185
  /**
118
- * Path of the endpoint, anything after \"/1\" must be specified.
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
- path: string;
191
+ setClientApiKey({ apiKey }: {
192
+ apiKey: string;
193
+ }): void;
121
194
  /**
122
- * Query parameters to apply to the current query.
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, any>;
202
+ customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
125
203
  /**
126
- * Parameters to send with the custom request.
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
- body?: Record<string, unknown>;
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
- * Path of the endpoint, anything after \"/1\" must be specified.
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
- * Query parameters to apply to the current query.
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, any>;
231
+ customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
142
232
  /**
143
- * Parameters to send with the custom request.
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
- body?: Record<string, unknown>;
146
- };
147
- /**
148
- * Properties for the `deleteUserProfile` method.
149
- */
150
- type DeleteUserProfileProps = {
242
+ deleteUserProfile({ userToken }: DeleteUserProfileProps, requestOptions?: RequestOptions): Promise<DeleteUserProfileResponse>;
151
243
  /**
152
- * Unique identifier representing a user for which to fetch the personalization profile.
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
- userToken: string;
155
- };
156
- /**
157
- * Properties for the `getUserTokenProfile` method.
158
- */
159
- type GetUserTokenProfileProps = {
251
+ getPersonalizationStrategy(requestOptions?: RequestOptions): Promise<PersonalizationStrategyParams>;
160
252
  /**
161
- * Unique identifier representing a user for which to fetch the personalization profile.
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: string;
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
- * The client type.
276
+ * Error.
172
277
  */
173
- type PersonalizationClient = ReturnType<typeof personalizationClient>;
174
- declare function personalizationClient(appId: string, apiKey: string, region: Region, options?: ClientOptions): {
175
- transporter: _algolia_client_common.Transporter;
176
- appId: string;
177
- clearCache(): Promise<void>;
178
- _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/node.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
- * Error.
17
- */
18
- type ErrorBase = Record<string, any> & {
19
- message?: string;
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
- * Properties for the `customDelete` method.
89
- */
90
- type CustomDeleteProps = {
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
- * Path of the endpoint, anything after \"/1\" must be specified.
167
+ * The `appId` currently in use.
93
168
  */
94
- path: string;
169
+ appId: string;
95
170
  /**
96
- * Query parameters to apply to the current query.
171
+ * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
97
172
  */
98
- parameters?: Record<string, any>;
99
- };
100
- /**
101
- * Properties for the `customGet` method.
102
- */
103
- type CustomGetProps = {
173
+ clearCache(): Promise<void>;
104
174
  /**
105
- * Path of the endpoint, anything after \"/1\" must be specified.
175
+ * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
106
176
  */
107
- path: string;
177
+ readonly _ua: string;
108
178
  /**
109
- * Query parameters to apply to the current query.
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
- parameters?: Record<string, any>;
112
- };
113
- /**
114
- * Properties for the `customPost` method.
115
- */
116
- type CustomPostProps = {
184
+ addAlgoliaAgent(segment: string, version?: string): void;
117
185
  /**
118
- * Path of the endpoint, anything after \"/1\" must be specified.
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
- path: string;
191
+ setClientApiKey({ apiKey }: {
192
+ apiKey: string;
193
+ }): void;
121
194
  /**
122
- * Query parameters to apply to the current query.
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, any>;
202
+ customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
125
203
  /**
126
- * Parameters to send with the custom request.
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
- body?: Record<string, unknown>;
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
- * Path of the endpoint, anything after \"/1\" must be specified.
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
- * Query parameters to apply to the current query.
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, any>;
231
+ customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
142
232
  /**
143
- * Parameters to send with the custom request.
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
- body?: Record<string, unknown>;
146
- };
147
- /**
148
- * Properties for the `deleteUserProfile` method.
149
- */
150
- type DeleteUserProfileProps = {
242
+ deleteUserProfile({ userToken }: DeleteUserProfileProps, requestOptions?: RequestOptions): Promise<DeleteUserProfileResponse>;
151
243
  /**
152
- * Unique identifier representing a user for which to fetch the personalization profile.
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
- userToken: string;
155
- };
156
- /**
157
- * Properties for the `getUserTokenProfile` method.
158
- */
159
- type GetUserTokenProfileProps = {
251
+ getPersonalizationStrategy(requestOptions?: RequestOptions): Promise<PersonalizationStrategyParams>;
160
252
  /**
161
- * Unique identifier representing a user for which to fetch the personalization profile.
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: string;
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
- * The client type.
276
+ * Error.
172
277
  */
173
- type PersonalizationClient = ReturnType<typeof personalizationClient>;
174
- declare function personalizationClient(appId: string, apiKey: string, region: Region, options?: ClientOptions): {
175
- transporter: _algolia_client_common.Transporter;
176
- appId: string;
177
- clearCache(): Promise<void>;
178
- _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 };