@algolia/advanced-personalization 0.0.1-alpha.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/LICENSE +21 -0
- package/README.md +77 -0
- package/dist/browser.d.ts +617 -0
- package/dist/builds/browser.js +431 -0
- package/dist/builds/browser.js.map +1 -0
- package/dist/builds/browser.min.js +2 -0
- package/dist/builds/browser.min.js.map +1 -0
- package/dist/builds/browser.umd.js +12 -0
- package/dist/builds/fetch.js +425 -0
- package/dist/builds/fetch.js.map +1 -0
- package/dist/builds/node.cjs +451 -0
- package/dist/builds/node.cjs.map +1 -0
- package/dist/builds/node.js +425 -0
- package/dist/builds/node.js.map +1 -0
- package/dist/builds/worker.js +425 -0
- package/dist/builds/worker.js.map +1 -0
- package/dist/fetch.d.ts +618 -0
- package/dist/node.d.cts +618 -0
- package/dist/node.d.ts +618 -0
- package/dist/src/advancedPersonalizationClient.cjs +417 -0
- package/dist/src/advancedPersonalizationClient.cjs.map +1 -0
- package/dist/src/advancedPersonalizationClient.js +390 -0
- package/dist/src/advancedPersonalizationClient.js.map +1 -0
- package/dist/worker.d.ts +618 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
import * as _algolia_client_common from '@algolia/client-common';
|
|
2
|
+
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
|
|
3
|
+
|
|
4
|
+
type AcceptedResponse = {
|
|
5
|
+
/**
|
|
6
|
+
* Status code.
|
|
7
|
+
*/
|
|
8
|
+
status: number;
|
|
9
|
+
/**
|
|
10
|
+
* Response message.
|
|
11
|
+
*/
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* An issue is either an \'error\' or a \'warning\' that is generated by the validator.
|
|
17
|
+
*/
|
|
18
|
+
type Issue = {
|
|
19
|
+
code: string;
|
|
20
|
+
index: string;
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
type EventType = 'view' | 'click' | 'conversion';
|
|
25
|
+
|
|
26
|
+
type Subtype = 'addToCart' | 'purchase';
|
|
27
|
+
|
|
28
|
+
type Event = {
|
|
29
|
+
type: EventType;
|
|
30
|
+
subtype?: Subtype | undefined;
|
|
31
|
+
name: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type Events = {
|
|
35
|
+
viewDetails: Array<Event>;
|
|
36
|
+
viewListing: Array<Event>;
|
|
37
|
+
addToCart: Array<Event>;
|
|
38
|
+
purchase: Array<Event>;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
type SourceType = 'insights';
|
|
42
|
+
|
|
43
|
+
type Source1 = {
|
|
44
|
+
type?: SourceType | undefined;
|
|
45
|
+
events?: Events | undefined;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
type ConfigurationObject1 = {
|
|
49
|
+
index: string;
|
|
50
|
+
affinities: Array<string>;
|
|
51
|
+
source: Source1;
|
|
52
|
+
errors: Array<Issue>;
|
|
53
|
+
warnings: Array<Issue>;
|
|
54
|
+
lastUpdatedAt: string;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
type ErrorCodes = 'blocked' | 'deleted' | 'no_perso_access' | 'all_attr_value_filtered' | 'missing_index' | 'no_events_last_30_days' | 'pending_pipelines' | 'invalid_config' | 'all_facets_invalid';
|
|
58
|
+
|
|
59
|
+
type Status = 'pending' | 'active' | 'paused';
|
|
60
|
+
|
|
61
|
+
type ConfigurationStatus = {
|
|
62
|
+
type?: Status | undefined;
|
|
63
|
+
errors?: Array<ErrorCodes> | undefined;
|
|
64
|
+
lastUpdatedAt?: string | undefined;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
type Realtime = {
|
|
68
|
+
/**
|
|
69
|
+
* Whether the realtime personalization feature is enabled.
|
|
70
|
+
*/
|
|
71
|
+
enabled?: boolean | undefined;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
type Features = {
|
|
75
|
+
realtime?: Realtime | undefined;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The impact that personalization has on the re-ranking of search results.
|
|
80
|
+
*/
|
|
81
|
+
type PersonalizationReRanking = 'none' | 'low' | 'medium' | 'high' | 'maximum';
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The type of user profiles to generate. Basic profiles are based on past behaviors, ensuring search results align with previous interests.
|
|
85
|
+
*/
|
|
86
|
+
type ProfileType = 'basic';
|
|
87
|
+
|
|
88
|
+
type ConfigurationObject = {
|
|
89
|
+
indices: Array<ConfigurationObject1>;
|
|
90
|
+
personalizationReRanking?: PersonalizationReRanking | undefined;
|
|
91
|
+
profileType: ProfileType;
|
|
92
|
+
status: ConfigurationStatus;
|
|
93
|
+
features: Features;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
type Source = {
|
|
97
|
+
type: SourceType;
|
|
98
|
+
events?: Events | undefined;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
type ConfigurationParametersObject = {
|
|
102
|
+
index?: string | undefined;
|
|
103
|
+
affinities?: Array<string> | undefined;
|
|
104
|
+
source?: Source | undefined;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
type ConfigurationParameters = {
|
|
108
|
+
indices: Array<ConfigurationParametersObject>;
|
|
109
|
+
personalizationReRanking: PersonalizationReRanking;
|
|
110
|
+
profileType: ProfileType;
|
|
111
|
+
features: Features;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
type DeleteUserResponse = {
|
|
115
|
+
message?: string | undefined;
|
|
116
|
+
status?: number | undefined;
|
|
117
|
+
userID?: string | undefined;
|
|
118
|
+
deletedUntil?: string | undefined;
|
|
119
|
+
deletedAt?: string | undefined;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
type Affinity = {
|
|
123
|
+
name: string;
|
|
124
|
+
indices: Array<string>;
|
|
125
|
+
value: string;
|
|
126
|
+
score: number;
|
|
127
|
+
lastUpdatedAt: string;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
type User = {
|
|
131
|
+
userID: string;
|
|
132
|
+
affinities: Array<Affinity>;
|
|
133
|
+
lastUpdatedAt: string;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
type GetUsersResponse = {
|
|
137
|
+
users: Array<User>;
|
|
138
|
+
previousPageToken?: string | undefined;
|
|
139
|
+
nextPageToken?: string | undefined;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
type PutConfigResponse = {
|
|
143
|
+
status: number;
|
|
144
|
+
errors: Array<Issue>;
|
|
145
|
+
warnings: Array<Issue>;
|
|
146
|
+
message: string;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
type SearchFilter = {
|
|
150
|
+
session?: Array<string> | undefined;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
type Strategy = 'session' | 'historical' | 'hybrid';
|
|
154
|
+
|
|
155
|
+
type SearchFilters = {
|
|
156
|
+
indices?: Array<string> | undefined;
|
|
157
|
+
strategy?: Strategy | undefined;
|
|
158
|
+
filters?: SearchFilter | undefined;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
type RealtimeUserUser = {
|
|
162
|
+
/**
|
|
163
|
+
* Version of the response format.
|
|
164
|
+
*/
|
|
165
|
+
version: string;
|
|
166
|
+
/**
|
|
167
|
+
* User ID of the user.
|
|
168
|
+
*/
|
|
169
|
+
userID: string;
|
|
170
|
+
/**
|
|
171
|
+
* Index personalization filters by index name.
|
|
172
|
+
*/
|
|
173
|
+
search: {
|
|
174
|
+
[key: string]: SearchFilters;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Properties for the `computeRealtimeUser` method.
|
|
180
|
+
*/
|
|
181
|
+
type ComputeRealtimeUserProps = {
|
|
182
|
+
/**
|
|
183
|
+
* Unique identifier representing a user for which to fetch the personalization profile.
|
|
184
|
+
*/
|
|
185
|
+
userToken: string;
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* Properties for the `customDelete` method.
|
|
189
|
+
*/
|
|
190
|
+
type CustomDeleteProps = {
|
|
191
|
+
/**
|
|
192
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
193
|
+
*/
|
|
194
|
+
path: string;
|
|
195
|
+
/**
|
|
196
|
+
* Query parameters to apply to the current query.
|
|
197
|
+
*/
|
|
198
|
+
parameters?: {
|
|
199
|
+
[key: string]: any;
|
|
200
|
+
} | undefined;
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* Properties for the `customGet` method.
|
|
204
|
+
*/
|
|
205
|
+
type CustomGetProps = {
|
|
206
|
+
/**
|
|
207
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
208
|
+
*/
|
|
209
|
+
path: string;
|
|
210
|
+
/**
|
|
211
|
+
* Query parameters to apply to the current query.
|
|
212
|
+
*/
|
|
213
|
+
parameters?: {
|
|
214
|
+
[key: string]: any;
|
|
215
|
+
} | undefined;
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* Properties for the `customPost` method.
|
|
219
|
+
*/
|
|
220
|
+
type CustomPostProps = {
|
|
221
|
+
/**
|
|
222
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
223
|
+
*/
|
|
224
|
+
path: string;
|
|
225
|
+
/**
|
|
226
|
+
* Query parameters to apply to the current query.
|
|
227
|
+
*/
|
|
228
|
+
parameters?: {
|
|
229
|
+
[key: string]: any;
|
|
230
|
+
} | undefined;
|
|
231
|
+
/**
|
|
232
|
+
* Parameters to send with the custom request.
|
|
233
|
+
*/
|
|
234
|
+
body?: Record<string, unknown> | undefined;
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* Properties for the `customPut` method.
|
|
238
|
+
*/
|
|
239
|
+
type CustomPutProps = {
|
|
240
|
+
/**
|
|
241
|
+
* Path of the endpoint, anything after \"/1\" must be specified.
|
|
242
|
+
*/
|
|
243
|
+
path: string;
|
|
244
|
+
/**
|
|
245
|
+
* Query parameters to apply to the current query.
|
|
246
|
+
*/
|
|
247
|
+
parameters?: {
|
|
248
|
+
[key: string]: any;
|
|
249
|
+
} | undefined;
|
|
250
|
+
/**
|
|
251
|
+
* Parameters to send with the custom request.
|
|
252
|
+
*/
|
|
253
|
+
body?: Record<string, unknown> | undefined;
|
|
254
|
+
};
|
|
255
|
+
/**
|
|
256
|
+
* Properties for the `deleteUser` method.
|
|
257
|
+
*/
|
|
258
|
+
type DeleteUserProps = {
|
|
259
|
+
/**
|
|
260
|
+
* ID of the user.
|
|
261
|
+
*/
|
|
262
|
+
userID: string;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* Properties for the `getRealtimeUser` method.
|
|
266
|
+
*/
|
|
267
|
+
type GetRealtimeUserProps = {
|
|
268
|
+
/**
|
|
269
|
+
* Unique identifier representing a user for which to fetch the personalization profile.
|
|
270
|
+
*/
|
|
271
|
+
userToken: string;
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* Properties for the `getUser` method.
|
|
275
|
+
*/
|
|
276
|
+
type GetUserProps = {
|
|
277
|
+
/**
|
|
278
|
+
* ID of the user.
|
|
279
|
+
*/
|
|
280
|
+
userID: string;
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* Properties for the `getUsers` method.
|
|
284
|
+
*/
|
|
285
|
+
type GetUsersProps = {
|
|
286
|
+
/**
|
|
287
|
+
* Filter users by start date (in RFC3339 format). Only users that were updated after the passed date will be returned.
|
|
288
|
+
*/
|
|
289
|
+
startDate?: string | undefined;
|
|
290
|
+
/**
|
|
291
|
+
* Filter users by end date (in RFC3339 format). Only users that were updated before the passed date will be returned.
|
|
292
|
+
*/
|
|
293
|
+
endDate?: string | undefined;
|
|
294
|
+
/**
|
|
295
|
+
* Filter users by matching indices. If multiple indices are passed, returned users will match all indices.
|
|
296
|
+
*/
|
|
297
|
+
indices?: Array<string> | undefined;
|
|
298
|
+
/**
|
|
299
|
+
* Filter users by affinity name and value. If multiple values are passed, returned users will match all values.
|
|
300
|
+
*/
|
|
301
|
+
affinity?: Array<string> | undefined;
|
|
302
|
+
/**
|
|
303
|
+
* Limit the number of users in the response. The value of this parameter ranges from 1 to 1000.
|
|
304
|
+
*/
|
|
305
|
+
limit?: number | undefined;
|
|
306
|
+
/**
|
|
307
|
+
* Reference for the next page, when navigating forward using pagination. Can\'t be used in the same request as `previousPageToken`.
|
|
308
|
+
*/
|
|
309
|
+
nextPageToken?: string | undefined;
|
|
310
|
+
/**
|
|
311
|
+
* Reference for the previous page, when navigating backward using pagination. Can\'t be used in the same request as `nextPageToken`.
|
|
312
|
+
*/
|
|
313
|
+
previousPageToken?: string | undefined;
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
declare const apiClientVersion = "0.0.1-alpha.1";
|
|
317
|
+
declare const REGIONS: readonly ["eu", "us"];
|
|
318
|
+
type Region = (typeof REGIONS)[number];
|
|
319
|
+
type RegionOptions = {
|
|
320
|
+
region: Region;
|
|
321
|
+
};
|
|
322
|
+
declare function createAdvancedPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & RegionOptions): {
|
|
323
|
+
transporter: _algolia_client_common.Transporter;
|
|
324
|
+
/**
|
|
325
|
+
* The `appId` currently in use.
|
|
326
|
+
*/
|
|
327
|
+
appId: string;
|
|
328
|
+
/**
|
|
329
|
+
* The `apiKey` currently in use.
|
|
330
|
+
*/
|
|
331
|
+
apiKey: string;
|
|
332
|
+
/**
|
|
333
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
334
|
+
*/
|
|
335
|
+
clearCache(): Promise<void>;
|
|
336
|
+
/**
|
|
337
|
+
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
338
|
+
*/
|
|
339
|
+
readonly _ua: string;
|
|
340
|
+
/**
|
|
341
|
+
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
|
|
342
|
+
*
|
|
343
|
+
* @param segment - The algolia agent (user-agent) segment to add.
|
|
344
|
+
* @param version - The version of the agent.
|
|
345
|
+
*/
|
|
346
|
+
addAlgoliaAgent(segment: string, version?: string | undefined): void;
|
|
347
|
+
/**
|
|
348
|
+
* Helper method to switch the API key used to authenticate the requests.
|
|
349
|
+
*
|
|
350
|
+
* @param params - Method params.
|
|
351
|
+
* @param params.apiKey - The new API Key to use.
|
|
352
|
+
*/
|
|
353
|
+
setClientApiKey({ apiKey }: {
|
|
354
|
+
apiKey: string;
|
|
355
|
+
}): void;
|
|
356
|
+
/**
|
|
357
|
+
* Sends a request to compute the user\'s personalization profile.
|
|
358
|
+
*
|
|
359
|
+
* Required API Key ACLs:
|
|
360
|
+
* - recommendation
|
|
361
|
+
* @param computeRealtimeUser - The computeRealtimeUser object.
|
|
362
|
+
* @param computeRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.
|
|
363
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
364
|
+
*/
|
|
365
|
+
computeRealtimeUser({ userToken }: ComputeRealtimeUserProps, requestOptions?: RequestOptions): Promise<AcceptedResponse>;
|
|
366
|
+
/**
|
|
367
|
+
* This method lets you send requests to the Algolia REST API.
|
|
368
|
+
* @param customDelete - The customDelete object.
|
|
369
|
+
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
370
|
+
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
371
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
372
|
+
*/
|
|
373
|
+
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
374
|
+
/**
|
|
375
|
+
* This method lets you send requests to the Algolia REST API.
|
|
376
|
+
* @param customGet - The customGet object.
|
|
377
|
+
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
378
|
+
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
379
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
380
|
+
*/
|
|
381
|
+
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
382
|
+
/**
|
|
383
|
+
* This method lets you send requests to the Algolia REST API.
|
|
384
|
+
* @param customPost - The customPost object.
|
|
385
|
+
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
386
|
+
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
387
|
+
* @param customPost.body - Parameters to send with the custom request.
|
|
388
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
389
|
+
*/
|
|
390
|
+
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
391
|
+
/**
|
|
392
|
+
* This method lets you send requests to the Algolia REST API.
|
|
393
|
+
* @param customPut - The customPut object.
|
|
394
|
+
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
395
|
+
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
396
|
+
* @param customPut.body - Parameters to send with the custom request.
|
|
397
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
398
|
+
*/
|
|
399
|
+
customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
400
|
+
/**
|
|
401
|
+
* Deletes a user profile.
|
|
402
|
+
*
|
|
403
|
+
* Required API Key ACLs:
|
|
404
|
+
* - search
|
|
405
|
+
* - browse
|
|
406
|
+
* - recommendation
|
|
407
|
+
* @param deleteUser - The deleteUser object.
|
|
408
|
+
* @param deleteUser.userID - ID of the user.
|
|
409
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
410
|
+
*/
|
|
411
|
+
deleteUser({ userID }: DeleteUserProps, requestOptions?: RequestOptions): Promise<DeleteUserResponse>;
|
|
412
|
+
/**
|
|
413
|
+
* Retrieves a list of configuration objects for each index.
|
|
414
|
+
*
|
|
415
|
+
* Required API Key ACLs:
|
|
416
|
+
* - search
|
|
417
|
+
* - browse
|
|
418
|
+
* - recommendation
|
|
419
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
420
|
+
*/
|
|
421
|
+
getConfig(requestOptions?: RequestOptions | undefined): Promise<ConfigurationObject>;
|
|
422
|
+
/**
|
|
423
|
+
* Retrieves the user\'s personalization profiles containing search filters.
|
|
424
|
+
*
|
|
425
|
+
* Required API Key ACLs:
|
|
426
|
+
* - recommendation
|
|
427
|
+
* @param getRealtimeUser - The getRealtimeUser object.
|
|
428
|
+
* @param getRealtimeUser.userToken - Unique identifier representing a user for which to fetch the personalization profile.
|
|
429
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
430
|
+
*/
|
|
431
|
+
getRealtimeUser({ userToken }: GetRealtimeUserProps, requestOptions?: RequestOptions): Promise<RealtimeUserUser>;
|
|
432
|
+
/**
|
|
433
|
+
* Retrieves a user profile.
|
|
434
|
+
*
|
|
435
|
+
* Required API Key ACLs:
|
|
436
|
+
* - search
|
|
437
|
+
* - browse
|
|
438
|
+
* - recommendation
|
|
439
|
+
* @param getUser - The getUser object.
|
|
440
|
+
* @param getUser.userID - ID of the user.
|
|
441
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
442
|
+
*/
|
|
443
|
+
getUser({ userID }: GetUserProps, requestOptions?: RequestOptions): Promise<User>;
|
|
444
|
+
/**
|
|
445
|
+
* Retrieves a list of user profiles in [lexicographical order](https://www.educative.io/answers/what-is-a-lexicographic-order).
|
|
446
|
+
*
|
|
447
|
+
* Required API Key ACLs:
|
|
448
|
+
* - search
|
|
449
|
+
* - browse
|
|
450
|
+
* - recommendation
|
|
451
|
+
* @param getUsers - The getUsers object.
|
|
452
|
+
* @param getUsers.startDate - Filter users by start date (in RFC3339 format). Only users that were updated after the passed date will be returned.
|
|
453
|
+
* @param getUsers.endDate - Filter users by end date (in RFC3339 format). Only users that were updated before the passed date will be returned.
|
|
454
|
+
* @param getUsers.indices - Filter users by matching indices. If multiple indices are passed, returned users will match all indices.
|
|
455
|
+
* @param getUsers.affinity - Filter users by affinity name and value. If multiple values are passed, returned users will match all values.
|
|
456
|
+
* @param getUsers.limit - Limit the number of users in the response. The value of this parameter ranges from 1 to 1000.
|
|
457
|
+
* @param getUsers.nextPageToken - Reference for the next page, when navigating forward using pagination. Can\'t be used in the same request as `previousPageToken`.
|
|
458
|
+
* @param getUsers.previousPageToken - Reference for the previous page, when navigating backward using pagination. Can\'t be used in the same request as `nextPageToken`.
|
|
459
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
460
|
+
*/
|
|
461
|
+
getUsers({ startDate, endDate, indices, affinity, limit, nextPageToken, previousPageToken }?: GetUsersProps, requestOptions?: RequestOptions | undefined): Promise<GetUsersResponse>;
|
|
462
|
+
/**
|
|
463
|
+
* Updates the configuration. The configuration is a list of configuration objects for each index. To configure Advanced Personalization for an index, create a new configuration object for the index.
|
|
464
|
+
*
|
|
465
|
+
* Required API Key ACLs:
|
|
466
|
+
* - search
|
|
467
|
+
* - browse
|
|
468
|
+
* - recommendation
|
|
469
|
+
* @param configurationParameters - The configurationParameters object.
|
|
470
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
471
|
+
*/
|
|
472
|
+
putConfig(configurationParameters: ConfigurationParameters, requestOptions?: RequestOptions): Promise<PutConfigResponse>;
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* HTTP status code for a bad request error.
|
|
477
|
+
*/
|
|
478
|
+
type BadRequest = 400;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Details about the response, such as error messages.
|
|
482
|
+
*/
|
|
483
|
+
type BadUserID = 'Invalid userID format';
|
|
484
|
+
|
|
485
|
+
type ConflictResponse = {
|
|
486
|
+
/**
|
|
487
|
+
* Status code.
|
|
488
|
+
*/
|
|
489
|
+
status: number;
|
|
490
|
+
/**
|
|
491
|
+
* Response message.
|
|
492
|
+
*/
|
|
493
|
+
message: string;
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Error.
|
|
498
|
+
*/
|
|
499
|
+
type ErrorBase = Record<string, any> & {
|
|
500
|
+
message?: string | undefined;
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Details about the response, such as error messages.
|
|
505
|
+
*/
|
|
506
|
+
type ErrorMessagesBadRequest = 'Invalid request body';
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Details about the response, such as error messages.
|
|
510
|
+
*/
|
|
511
|
+
type ErrorMessagesInternalServerError = 'Internal Server Error';
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Details about the response, such as error messages.
|
|
515
|
+
*/
|
|
516
|
+
type ErrorMessagesUnauthorized = 'Unauthorized';
|
|
517
|
+
|
|
518
|
+
type ErrorResponsesBadRequest = {
|
|
519
|
+
status?: BadRequest | undefined;
|
|
520
|
+
message?: ErrorMessagesBadRequest | undefined;
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
type ErrorResponsesBadUserID = {
|
|
524
|
+
status?: BadRequest | undefined;
|
|
525
|
+
message?: BadUserID | undefined;
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Details about the response, such as error messages.
|
|
530
|
+
*/
|
|
531
|
+
type FeatureNotEnabled = 'Predictive profiles are not allowed for this app. Please contact support to upgrade your plan: https://support.algolia.com/' | 'Realtime Personalization is not allowed for this app. Please contact support to upgrade your plan: https://support.algolia.com/';
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* HTTP status code for a payment required error.
|
|
535
|
+
*/
|
|
536
|
+
type PaymentRequired = 402;
|
|
537
|
+
|
|
538
|
+
type ErrorResponsesFeatureNotEnabled = {
|
|
539
|
+
status?: PaymentRequired | undefined;
|
|
540
|
+
message?: FeatureNotEnabled | undefined;
|
|
541
|
+
};
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Details about the response, such as error messages.
|
|
545
|
+
*/
|
|
546
|
+
type GenericNotFound = 'Not Found';
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* HTTP status code for a not found error.
|
|
550
|
+
*/
|
|
551
|
+
type NotFound = 404;
|
|
552
|
+
|
|
553
|
+
type ErrorResponsesGenericNotFound = {
|
|
554
|
+
status?: NotFound | undefined;
|
|
555
|
+
message?: GenericNotFound | undefined;
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Details about the response, such as error messages.
|
|
560
|
+
*/
|
|
561
|
+
type GenericUnprocessableEntity = 'Unprocessable Entity';
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* HTTP status code for an unprocessable entity error.
|
|
565
|
+
*/
|
|
566
|
+
type UnprocessableEntity = 422;
|
|
567
|
+
|
|
568
|
+
type ErrorResponsesGenericUnprocessableEntity = {
|
|
569
|
+
status?: UnprocessableEntity | undefined;
|
|
570
|
+
message?: GenericUnprocessableEntity | undefined;
|
|
571
|
+
};
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* HTTP status code for an internal server error.
|
|
575
|
+
*/
|
|
576
|
+
type InternalServerError = 500;
|
|
577
|
+
|
|
578
|
+
type ErrorResponsesInternalServerError = {
|
|
579
|
+
status?: InternalServerError | undefined;
|
|
580
|
+
message?: ErrorMessagesInternalServerError | undefined;
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Details about the response, such as error messages.
|
|
585
|
+
*/
|
|
586
|
+
type InvalidUserID = 'UserID must contain only alphanumeric' | 'equal' | 'plus' | 'slash' | 'hyphen' | 'or underscore characters' | 'and be between 1 and 129 characters long';
|
|
587
|
+
|
|
588
|
+
type ErrorResponsesInvalidUserID = {
|
|
589
|
+
status?: UnprocessableEntity | undefined;
|
|
590
|
+
message?: InvalidUserID | undefined;
|
|
591
|
+
};
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* HTTP status code for an authorization error.
|
|
595
|
+
*/
|
|
596
|
+
type Unauthorized = 401;
|
|
597
|
+
|
|
598
|
+
type ErrorResponsesUnauthorized = {
|
|
599
|
+
status?: Unauthorized | undefined;
|
|
600
|
+
message?: ErrorMessagesUnauthorized | undefined;
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
type TooManyRequestsResponse = {
|
|
604
|
+
/**
|
|
605
|
+
* Status code.
|
|
606
|
+
*/
|
|
607
|
+
status: number;
|
|
608
|
+
/**
|
|
609
|
+
* Response message.
|
|
610
|
+
*/
|
|
611
|
+
message: string;
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
declare function advancedPersonalizationClient(appId: string, apiKey: string, region: Region, options?: ClientOptions | undefined): AdvancedPersonalizationClient;
|
|
615
|
+
type AdvancedPersonalizationClient = ReturnType<typeof createAdvancedPersonalizationClient>;
|
|
616
|
+
|
|
617
|
+
export { type AcceptedResponse, type AdvancedPersonalizationClient, type Affinity, type BadRequest, type BadUserID, type ComputeRealtimeUserProps, type ConfigurationObject, type ConfigurationObject1, type ConfigurationParameters, type ConfigurationParametersObject, type ConfigurationStatus, type ConflictResponse, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteUserProps, type DeleteUserResponse, type ErrorBase, type ErrorCodes, type ErrorMessagesBadRequest, type ErrorMessagesInternalServerError, type ErrorMessagesUnauthorized, type ErrorResponsesBadRequest, type ErrorResponsesBadUserID, type ErrorResponsesFeatureNotEnabled, type ErrorResponsesGenericNotFound, type ErrorResponsesGenericUnprocessableEntity, type ErrorResponsesInternalServerError, type ErrorResponsesInvalidUserID, type ErrorResponsesUnauthorized, type Event, type EventType, type Events, type FeatureNotEnabled, type Features, type GenericNotFound, type GenericUnprocessableEntity, type GetRealtimeUserProps, type GetUserProps, type GetUsersProps, type GetUsersResponse, type InternalServerError, type InvalidUserID, type Issue, type NotFound, type PaymentRequired, type PersonalizationReRanking, type ProfileType, type PutConfigResponse, type Realtime, type RealtimeUserUser, type Region, type RegionOptions, type SearchFilter, type SearchFilters, type Source, type Source1, type SourceType, type Status, type Strategy, type Subtype, type TooManyRequestsResponse, type Unauthorized, type UnprocessableEntity, type User, advancedPersonalizationClient, apiClientVersion };
|