@algolia/client-personalization 5.7.0 → 5.8.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/README.md +5 -6
- package/dist/browser.d.ts +94 -95
- package/dist/builds/browser.js +9 -17
- 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/fetch.js +6 -14
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +6 -14
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +7 -15
- package/dist/builds/node.js.map +1 -1
- package/dist/fetch.d.ts +93 -93
- package/dist/node.d.cts +93 -93
- package/dist/node.d.ts +93 -93
- package/dist/src/personalizationClient.cjs +5 -13
- package/dist/src/personalizationClient.cjs.map +1 -1
- package/dist/src/personalizationClient.js +5 -13
- package/dist/src/personalizationClient.js.map +1 -1
- package/index.d.ts +0 -1
- package/index.js +1 -2
- package/model/clientMethodProps.ts +4 -4
- package/model/index.ts +1 -1
- package/model/personalizationStrategyParams.ts +2 -2
- package/package.json +6 -6
package/dist/fetch.d.ts
CHANGED
|
@@ -1,6 +1,82 @@
|
|
|
1
1
|
import * as _algolia_client_common from '@algolia/client-common';
|
|
2
2
|
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
|
|
3
3
|
|
|
4
|
+
type DeleteUserProfileResponse = {
|
|
5
|
+
/**
|
|
6
|
+
* 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/).
|
|
7
|
+
*/
|
|
8
|
+
userToken: string;
|
|
9
|
+
/**
|
|
10
|
+
* Date and time when the user profile can be safely considered to be deleted. Any events received after the `deletedUntil` date start a new user profile.
|
|
11
|
+
*/
|
|
12
|
+
deletedUntil: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type GetUserTokenResponse = {
|
|
16
|
+
/**
|
|
17
|
+
* 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/).
|
|
18
|
+
*/
|
|
19
|
+
userToken: string;
|
|
20
|
+
/**
|
|
21
|
+
* Date and time of the last event from this user, in RFC 3339 format.
|
|
22
|
+
*/
|
|
23
|
+
lastEventAt: string;
|
|
24
|
+
/**
|
|
25
|
+
* 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.
|
|
26
|
+
*/
|
|
27
|
+
scores: Record<string, unknown>;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Event type.
|
|
32
|
+
*/
|
|
33
|
+
type EventType = 'click' | 'conversion' | 'view';
|
|
34
|
+
|
|
35
|
+
type EventScoring = {
|
|
36
|
+
/**
|
|
37
|
+
* Event score.
|
|
38
|
+
*/
|
|
39
|
+
score: number;
|
|
40
|
+
/**
|
|
41
|
+
* Event name.
|
|
42
|
+
*/
|
|
43
|
+
eventName: string;
|
|
44
|
+
eventType: EventType;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type FacetScoring = {
|
|
48
|
+
/**
|
|
49
|
+
* Event score.
|
|
50
|
+
*/
|
|
51
|
+
score: number;
|
|
52
|
+
/**
|
|
53
|
+
* Facet attribute name.
|
|
54
|
+
*/
|
|
55
|
+
facetName: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
type PersonalizationStrategyParams = {
|
|
59
|
+
/**
|
|
60
|
+
* Scores associated with each event. The higher the scores, the higher the impact of those events on the personalization of search results.
|
|
61
|
+
*/
|
|
62
|
+
eventScoring: Array<EventScoring>;
|
|
63
|
+
/**
|
|
64
|
+
* Scores associated with each facet. The higher the scores, the higher the impact of those events on the personalization of search results.
|
|
65
|
+
*/
|
|
66
|
+
facetScoring: Array<FacetScoring>;
|
|
67
|
+
/**
|
|
68
|
+
* Impact of personalization on the search results. If set to 0, personalization has no impact on the search results.
|
|
69
|
+
*/
|
|
70
|
+
personalizationImpact: number;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
type SetPersonalizationStrategyResponse = {
|
|
74
|
+
/**
|
|
75
|
+
* A message confirming the strategy update.
|
|
76
|
+
*/
|
|
77
|
+
message: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
4
80
|
/**
|
|
5
81
|
* Properties for the `customDelete` method.
|
|
6
82
|
*/
|
|
@@ -12,7 +88,9 @@ type CustomDeleteProps = {
|
|
|
12
88
|
/**
|
|
13
89
|
* Query parameters to apply to the current query.
|
|
14
90
|
*/
|
|
15
|
-
parameters?:
|
|
91
|
+
parameters?: {
|
|
92
|
+
[key: string]: any;
|
|
93
|
+
};
|
|
16
94
|
};
|
|
17
95
|
/**
|
|
18
96
|
* Properties for the `customGet` method.
|
|
@@ -25,7 +103,9 @@ type CustomGetProps = {
|
|
|
25
103
|
/**
|
|
26
104
|
* Query parameters to apply to the current query.
|
|
27
105
|
*/
|
|
28
|
-
parameters?:
|
|
106
|
+
parameters?: {
|
|
107
|
+
[key: string]: any;
|
|
108
|
+
};
|
|
29
109
|
};
|
|
30
110
|
/**
|
|
31
111
|
* Properties for the `customPost` method.
|
|
@@ -38,7 +118,9 @@ type CustomPostProps = {
|
|
|
38
118
|
/**
|
|
39
119
|
* Query parameters to apply to the current query.
|
|
40
120
|
*/
|
|
41
|
-
parameters?:
|
|
121
|
+
parameters?: {
|
|
122
|
+
[key: string]: any;
|
|
123
|
+
};
|
|
42
124
|
/**
|
|
43
125
|
* Parameters to send with the custom request.
|
|
44
126
|
*/
|
|
@@ -55,7 +137,9 @@ type CustomPutProps = {
|
|
|
55
137
|
/**
|
|
56
138
|
* Query parameters to apply to the current query.
|
|
57
139
|
*/
|
|
58
|
-
parameters?:
|
|
140
|
+
parameters?: {
|
|
141
|
+
[key: string]: any;
|
|
142
|
+
};
|
|
59
143
|
/**
|
|
60
144
|
* Parameters to send with the custom request.
|
|
61
145
|
*/
|
|
@@ -80,83 +164,7 @@ type GetUserTokenProfileProps = {
|
|
|
80
164
|
userToken: string;
|
|
81
165
|
};
|
|
82
166
|
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* 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/).
|
|
86
|
-
*/
|
|
87
|
-
userToken: string;
|
|
88
|
-
/**
|
|
89
|
-
* Date and time when the user profile can be safely considered to be deleted. Any events received after the `deletedUntil` date start a new user profile.
|
|
90
|
-
*/
|
|
91
|
-
deletedUntil: string;
|
|
92
|
-
};
|
|
93
|
-
|
|
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>;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Event type.
|
|
111
|
-
*/
|
|
112
|
-
type EventType = 'click' | 'conversion' | 'view';
|
|
113
|
-
|
|
114
|
-
type EventScoring = {
|
|
115
|
-
/**
|
|
116
|
-
* Event score.
|
|
117
|
-
*/
|
|
118
|
-
score: number;
|
|
119
|
-
/**
|
|
120
|
-
* Event name.
|
|
121
|
-
*/
|
|
122
|
-
eventName: string;
|
|
123
|
-
eventType: EventType;
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
type FacetScoring = {
|
|
127
|
-
/**
|
|
128
|
-
* Event score.
|
|
129
|
-
*/
|
|
130
|
-
score: number;
|
|
131
|
-
/**
|
|
132
|
-
* Facet attribute name.
|
|
133
|
-
*/
|
|
134
|
-
facetName: string;
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
type PersonalizationStrategyParams = {
|
|
138
|
-
/**
|
|
139
|
-
* Scores associated with each event. The higher the scores, the higher the impact of those events on the personalization of search results.
|
|
140
|
-
*/
|
|
141
|
-
eventScoring: EventScoring[];
|
|
142
|
-
/**
|
|
143
|
-
* Scores associated with each facet. The higher the scores, the higher the impact of those events on the personalization of search results.
|
|
144
|
-
*/
|
|
145
|
-
facetScoring: FacetScoring[];
|
|
146
|
-
/**
|
|
147
|
-
* Impact of personalization on the search results. If set to 0, personalization has no impact on the search results.
|
|
148
|
-
*/
|
|
149
|
-
personalizationImpact: number;
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
type SetPersonalizationStrategyResponse = {
|
|
153
|
-
/**
|
|
154
|
-
* A message confirming the strategy update.
|
|
155
|
-
*/
|
|
156
|
-
message: string;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
declare const apiClientVersion = "5.7.0";
|
|
167
|
+
declare const apiClientVersion = "5.8.1";
|
|
160
168
|
declare const REGIONS: readonly ["eu", "us"];
|
|
161
169
|
type Region = (typeof REGIONS)[number];
|
|
162
170
|
declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
|
|
@@ -193,7 +201,6 @@ declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKe
|
|
|
193
201
|
}): void;
|
|
194
202
|
/**
|
|
195
203
|
* This method allow you to send requests to the Algolia REST API.
|
|
196
|
-
*
|
|
197
204
|
* @param customDelete - The customDelete object.
|
|
198
205
|
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
199
206
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
@@ -202,7 +209,6 @@ declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKe
|
|
|
202
209
|
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
203
210
|
/**
|
|
204
211
|
* This method allow you to send requests to the Algolia REST API.
|
|
205
|
-
*
|
|
206
212
|
* @param customGet - The customGet object.
|
|
207
213
|
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
208
214
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
@@ -211,7 +217,6 @@ declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKe
|
|
|
211
217
|
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
212
218
|
/**
|
|
213
219
|
* This method allow you to send requests to the Algolia REST API.
|
|
214
|
-
*
|
|
215
220
|
* @param customPost - The customPost object.
|
|
216
221
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
217
222
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -221,7 +226,6 @@ declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKe
|
|
|
221
226
|
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
222
227
|
/**
|
|
223
228
|
* This method allow you to send requests to the Algolia REST API.
|
|
224
|
-
*
|
|
225
229
|
* @param customPut - The customPut object.
|
|
226
230
|
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
227
231
|
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
@@ -233,8 +237,7 @@ declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKe
|
|
|
233
237
|
* Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.
|
|
234
238
|
*
|
|
235
239
|
* Required API Key ACLs:
|
|
236
|
-
*
|
|
237
|
-
*
|
|
240
|
+
* - recommendation
|
|
238
241
|
* @param deleteUserProfile - The deleteUserProfile object.
|
|
239
242
|
* @param deleteUserProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
|
|
240
243
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -244,8 +247,7 @@ declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKe
|
|
|
244
247
|
* Retrieves the current personalization strategy.
|
|
245
248
|
*
|
|
246
249
|
* Required API Key ACLs:
|
|
247
|
-
*
|
|
248
|
-
*
|
|
250
|
+
* - recommendation
|
|
249
251
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
250
252
|
*/
|
|
251
253
|
getPersonalizationStrategy(requestOptions?: RequestOptions): Promise<PersonalizationStrategyParams>;
|
|
@@ -253,8 +255,7 @@ declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKe
|
|
|
253
255
|
* Retrieves a user profile and their affinities for different facets.
|
|
254
256
|
*
|
|
255
257
|
* Required API Key ACLs:
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
+
* - recommendation
|
|
258
259
|
* @param getUserTokenProfile - The getUserTokenProfile object.
|
|
259
260
|
* @param getUserTokenProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
|
|
260
261
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -264,8 +265,7 @@ declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKe
|
|
|
264
265
|
* Creates a new personalization strategy.
|
|
265
266
|
*
|
|
266
267
|
* Required API Key ACLs:
|
|
267
|
-
*
|
|
268
|
-
*
|
|
268
|
+
* - recommendation
|
|
269
269
|
* @param personalizationStrategyParams - The personalizationStrategyParams object.
|
|
270
270
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
271
271
|
*/
|
package/dist/node.d.cts
CHANGED
|
@@ -1,6 +1,82 @@
|
|
|
1
1
|
import * as _algolia_client_common from '@algolia/client-common';
|
|
2
2
|
import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
|
|
3
3
|
|
|
4
|
+
type DeleteUserProfileResponse = {
|
|
5
|
+
/**
|
|
6
|
+
* 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/).
|
|
7
|
+
*/
|
|
8
|
+
userToken: string;
|
|
9
|
+
/**
|
|
10
|
+
* Date and time when the user profile can be safely considered to be deleted. Any events received after the `deletedUntil` date start a new user profile.
|
|
11
|
+
*/
|
|
12
|
+
deletedUntil: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type GetUserTokenResponse = {
|
|
16
|
+
/**
|
|
17
|
+
* 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/).
|
|
18
|
+
*/
|
|
19
|
+
userToken: string;
|
|
20
|
+
/**
|
|
21
|
+
* Date and time of the last event from this user, in RFC 3339 format.
|
|
22
|
+
*/
|
|
23
|
+
lastEventAt: string;
|
|
24
|
+
/**
|
|
25
|
+
* 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.
|
|
26
|
+
*/
|
|
27
|
+
scores: Record<string, unknown>;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Event type.
|
|
32
|
+
*/
|
|
33
|
+
type EventType = 'click' | 'conversion' | 'view';
|
|
34
|
+
|
|
35
|
+
type EventScoring = {
|
|
36
|
+
/**
|
|
37
|
+
* Event score.
|
|
38
|
+
*/
|
|
39
|
+
score: number;
|
|
40
|
+
/**
|
|
41
|
+
* Event name.
|
|
42
|
+
*/
|
|
43
|
+
eventName: string;
|
|
44
|
+
eventType: EventType;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type FacetScoring = {
|
|
48
|
+
/**
|
|
49
|
+
* Event score.
|
|
50
|
+
*/
|
|
51
|
+
score: number;
|
|
52
|
+
/**
|
|
53
|
+
* Facet attribute name.
|
|
54
|
+
*/
|
|
55
|
+
facetName: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
type PersonalizationStrategyParams = {
|
|
59
|
+
/**
|
|
60
|
+
* Scores associated with each event. The higher the scores, the higher the impact of those events on the personalization of search results.
|
|
61
|
+
*/
|
|
62
|
+
eventScoring: Array<EventScoring>;
|
|
63
|
+
/**
|
|
64
|
+
* Scores associated with each facet. The higher the scores, the higher the impact of those events on the personalization of search results.
|
|
65
|
+
*/
|
|
66
|
+
facetScoring: Array<FacetScoring>;
|
|
67
|
+
/**
|
|
68
|
+
* Impact of personalization on the search results. If set to 0, personalization has no impact on the search results.
|
|
69
|
+
*/
|
|
70
|
+
personalizationImpact: number;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
type SetPersonalizationStrategyResponse = {
|
|
74
|
+
/**
|
|
75
|
+
* A message confirming the strategy update.
|
|
76
|
+
*/
|
|
77
|
+
message: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
4
80
|
/**
|
|
5
81
|
* Properties for the `customDelete` method.
|
|
6
82
|
*/
|
|
@@ -12,7 +88,9 @@ type CustomDeleteProps = {
|
|
|
12
88
|
/**
|
|
13
89
|
* Query parameters to apply to the current query.
|
|
14
90
|
*/
|
|
15
|
-
parameters?:
|
|
91
|
+
parameters?: {
|
|
92
|
+
[key: string]: any;
|
|
93
|
+
};
|
|
16
94
|
};
|
|
17
95
|
/**
|
|
18
96
|
* Properties for the `customGet` method.
|
|
@@ -25,7 +103,9 @@ type CustomGetProps = {
|
|
|
25
103
|
/**
|
|
26
104
|
* Query parameters to apply to the current query.
|
|
27
105
|
*/
|
|
28
|
-
parameters?:
|
|
106
|
+
parameters?: {
|
|
107
|
+
[key: string]: any;
|
|
108
|
+
};
|
|
29
109
|
};
|
|
30
110
|
/**
|
|
31
111
|
* Properties for the `customPost` method.
|
|
@@ -38,7 +118,9 @@ type CustomPostProps = {
|
|
|
38
118
|
/**
|
|
39
119
|
* Query parameters to apply to the current query.
|
|
40
120
|
*/
|
|
41
|
-
parameters?:
|
|
121
|
+
parameters?: {
|
|
122
|
+
[key: string]: any;
|
|
123
|
+
};
|
|
42
124
|
/**
|
|
43
125
|
* Parameters to send with the custom request.
|
|
44
126
|
*/
|
|
@@ -55,7 +137,9 @@ type CustomPutProps = {
|
|
|
55
137
|
/**
|
|
56
138
|
* Query parameters to apply to the current query.
|
|
57
139
|
*/
|
|
58
|
-
parameters?:
|
|
140
|
+
parameters?: {
|
|
141
|
+
[key: string]: any;
|
|
142
|
+
};
|
|
59
143
|
/**
|
|
60
144
|
* Parameters to send with the custom request.
|
|
61
145
|
*/
|
|
@@ -80,83 +164,7 @@ type GetUserTokenProfileProps = {
|
|
|
80
164
|
userToken: string;
|
|
81
165
|
};
|
|
82
166
|
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* 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/).
|
|
86
|
-
*/
|
|
87
|
-
userToken: string;
|
|
88
|
-
/**
|
|
89
|
-
* Date and time when the user profile can be safely considered to be deleted. Any events received after the `deletedUntil` date start a new user profile.
|
|
90
|
-
*/
|
|
91
|
-
deletedUntil: string;
|
|
92
|
-
};
|
|
93
|
-
|
|
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>;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Event type.
|
|
111
|
-
*/
|
|
112
|
-
type EventType = 'click' | 'conversion' | 'view';
|
|
113
|
-
|
|
114
|
-
type EventScoring = {
|
|
115
|
-
/**
|
|
116
|
-
* Event score.
|
|
117
|
-
*/
|
|
118
|
-
score: number;
|
|
119
|
-
/**
|
|
120
|
-
* Event name.
|
|
121
|
-
*/
|
|
122
|
-
eventName: string;
|
|
123
|
-
eventType: EventType;
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
type FacetScoring = {
|
|
127
|
-
/**
|
|
128
|
-
* Event score.
|
|
129
|
-
*/
|
|
130
|
-
score: number;
|
|
131
|
-
/**
|
|
132
|
-
* Facet attribute name.
|
|
133
|
-
*/
|
|
134
|
-
facetName: string;
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
type PersonalizationStrategyParams = {
|
|
138
|
-
/**
|
|
139
|
-
* Scores associated with each event. The higher the scores, the higher the impact of those events on the personalization of search results.
|
|
140
|
-
*/
|
|
141
|
-
eventScoring: EventScoring[];
|
|
142
|
-
/**
|
|
143
|
-
* Scores associated with each facet. The higher the scores, the higher the impact of those events on the personalization of search results.
|
|
144
|
-
*/
|
|
145
|
-
facetScoring: FacetScoring[];
|
|
146
|
-
/**
|
|
147
|
-
* Impact of personalization on the search results. If set to 0, personalization has no impact on the search results.
|
|
148
|
-
*/
|
|
149
|
-
personalizationImpact: number;
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
type SetPersonalizationStrategyResponse = {
|
|
153
|
-
/**
|
|
154
|
-
* A message confirming the strategy update.
|
|
155
|
-
*/
|
|
156
|
-
message: string;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
declare const apiClientVersion = "5.7.0";
|
|
167
|
+
declare const apiClientVersion = "5.8.1";
|
|
160
168
|
declare const REGIONS: readonly ["eu", "us"];
|
|
161
169
|
type Region = (typeof REGIONS)[number];
|
|
162
170
|
declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
|
|
@@ -193,7 +201,6 @@ declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKe
|
|
|
193
201
|
}): void;
|
|
194
202
|
/**
|
|
195
203
|
* This method allow you to send requests to the Algolia REST API.
|
|
196
|
-
*
|
|
197
204
|
* @param customDelete - The customDelete object.
|
|
198
205
|
* @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
199
206
|
* @param customDelete.parameters - Query parameters to apply to the current query.
|
|
@@ -202,7 +209,6 @@ declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKe
|
|
|
202
209
|
customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
203
210
|
/**
|
|
204
211
|
* This method allow you to send requests to the Algolia REST API.
|
|
205
|
-
*
|
|
206
212
|
* @param customGet - The customGet object.
|
|
207
213
|
* @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
208
214
|
* @param customGet.parameters - Query parameters to apply to the current query.
|
|
@@ -211,7 +217,6 @@ declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKe
|
|
|
211
217
|
customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
212
218
|
/**
|
|
213
219
|
* This method allow you to send requests to the Algolia REST API.
|
|
214
|
-
*
|
|
215
220
|
* @param customPost - The customPost object.
|
|
216
221
|
* @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
217
222
|
* @param customPost.parameters - Query parameters to apply to the current query.
|
|
@@ -221,7 +226,6 @@ declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKe
|
|
|
221
226
|
customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
|
|
222
227
|
/**
|
|
223
228
|
* This method allow you to send requests to the Algolia REST API.
|
|
224
|
-
*
|
|
225
229
|
* @param customPut - The customPut object.
|
|
226
230
|
* @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified.
|
|
227
231
|
* @param customPut.parameters - Query parameters to apply to the current query.
|
|
@@ -233,8 +237,7 @@ declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKe
|
|
|
233
237
|
* Deletes a user profile. The response includes a date and time when the user profile can safely be considered deleted.
|
|
234
238
|
*
|
|
235
239
|
* Required API Key ACLs:
|
|
236
|
-
*
|
|
237
|
-
*
|
|
240
|
+
* - recommendation
|
|
238
241
|
* @param deleteUserProfile - The deleteUserProfile object.
|
|
239
242
|
* @param deleteUserProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
|
|
240
243
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -244,8 +247,7 @@ declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKe
|
|
|
244
247
|
* Retrieves the current personalization strategy.
|
|
245
248
|
*
|
|
246
249
|
* Required API Key ACLs:
|
|
247
|
-
*
|
|
248
|
-
*
|
|
250
|
+
* - recommendation
|
|
249
251
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
250
252
|
*/
|
|
251
253
|
getPersonalizationStrategy(requestOptions?: RequestOptions): Promise<PersonalizationStrategyParams>;
|
|
@@ -253,8 +255,7 @@ declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKe
|
|
|
253
255
|
* Retrieves a user profile and their affinities for different facets.
|
|
254
256
|
*
|
|
255
257
|
* Required API Key ACLs:
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
+
* - recommendation
|
|
258
259
|
* @param getUserTokenProfile - The getUserTokenProfile object.
|
|
259
260
|
* @param getUserTokenProfile.userToken - Unique identifier representing a user for which to fetch the personalization profile.
|
|
260
261
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
@@ -264,8 +265,7 @@ declare function createPersonalizationClient({ appId: appIdOption, apiKey: apiKe
|
|
|
264
265
|
* Creates a new personalization strategy.
|
|
265
266
|
*
|
|
266
267
|
* Required API Key ACLs:
|
|
267
|
-
*
|
|
268
|
-
*
|
|
268
|
+
* - recommendation
|
|
269
269
|
* @param personalizationStrategyParams - The personalizationStrategyParams object.
|
|
270
270
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
271
271
|
*/
|