@algolia/client-personalization 5.2.3 → 5.2.4-beta.3

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.
Files changed (89) hide show
  1. package/dist/browser.d.ts +190 -0
  2. package/dist/builds/browser.js +323 -0
  3. package/dist/builds/browser.js.map +1 -0
  4. package/dist/builds/browser.min.js +2 -0
  5. package/dist/builds/browser.min.js.map +1 -0
  6. package/dist/builds/browser.umd.js +12 -0
  7. package/dist/builds/node.cjs +341 -0
  8. package/dist/builds/node.cjs.map +1 -0
  9. package/dist/builds/node.js +321 -0
  10. package/dist/builds/node.js.map +1 -0
  11. package/dist/model/clientMethodProps.cjs +19 -0
  12. package/dist/model/clientMethodProps.cjs.map +1 -0
  13. package/dist/model/clientMethodProps.js +1 -0
  14. package/dist/model/clientMethodProps.js.map +1 -0
  15. package/dist/model/deleteUserProfileResponse.cjs +19 -0
  16. package/dist/model/deleteUserProfileResponse.cjs.map +1 -0
  17. package/dist/model/deleteUserProfileResponse.js +1 -0
  18. package/dist/model/deleteUserProfileResponse.js.map +1 -0
  19. package/dist/model/errorBase.cjs +19 -0
  20. package/dist/model/errorBase.cjs.map +1 -0
  21. package/dist/model/errorBase.js +1 -0
  22. package/dist/model/errorBase.js.map +1 -0
  23. package/dist/model/eventScoring.cjs +19 -0
  24. package/dist/model/eventScoring.cjs.map +1 -0
  25. package/dist/model/eventScoring.js +1 -0
  26. package/dist/model/eventScoring.js.map +1 -0
  27. package/dist/model/eventType.cjs +19 -0
  28. package/dist/model/eventType.cjs.map +1 -0
  29. package/dist/model/eventType.js +1 -0
  30. package/dist/model/eventType.js.map +1 -0
  31. package/dist/model/facetScoring.cjs +19 -0
  32. package/dist/model/facetScoring.cjs.map +1 -0
  33. package/dist/model/facetScoring.js +1 -0
  34. package/dist/model/facetScoring.js.map +1 -0
  35. package/dist/model/getUserTokenResponse.cjs +19 -0
  36. package/dist/model/getUserTokenResponse.cjs.map +1 -0
  37. package/dist/model/getUserTokenResponse.js +1 -0
  38. package/dist/model/getUserTokenResponse.js.map +1 -0
  39. package/dist/model/index.cjs +19 -0
  40. package/dist/model/index.cjs.map +1 -0
  41. package/dist/model/index.js +1 -0
  42. package/dist/model/index.js.map +1 -0
  43. package/dist/model/personalizationStrategyParams.cjs +19 -0
  44. package/dist/model/personalizationStrategyParams.cjs.map +1 -0
  45. package/dist/model/personalizationStrategyParams.js +1 -0
  46. package/dist/model/personalizationStrategyParams.js.map +1 -0
  47. package/dist/model/setPersonalizationStrategyResponse.cjs +19 -0
  48. package/dist/model/setPersonalizationStrategyResponse.cjs.map +1 -0
  49. package/dist/model/setPersonalizationStrategyResponse.js +1 -0
  50. package/dist/model/setPersonalizationStrategyResponse.js.map +1 -0
  51. package/dist/node.d.cts +190 -0
  52. package/dist/node.d.ts +190 -0
  53. package/dist/src/personalizationClient.cjs +308 -0
  54. package/dist/src/personalizationClient.cjs.map +1 -0
  55. package/dist/src/personalizationClient.js +281 -0
  56. package/dist/src/personalizationClient.js.map +1 -0
  57. package/index.d.ts +1 -1
  58. package/index.js +1 -1
  59. package/package.json +33 -30
  60. package/dist/builds/browser.d.ts +0 -24
  61. package/dist/builds/browser.d.ts.map +0 -1
  62. package/dist/builds/node.d.ts +0 -24
  63. package/dist/builds/node.d.ts.map +0 -1
  64. package/dist/client-personalization.cjs +0 -297
  65. package/dist/client-personalization.esm.browser.js +0 -971
  66. package/dist/client-personalization.esm.node.js +0 -294
  67. package/dist/client-personalization.umd.js +0 -2
  68. package/dist/model/clientMethodProps.d.ts +0 -79
  69. package/dist/model/clientMethodProps.d.ts.map +0 -1
  70. package/dist/model/deleteUserProfileResponse.d.ts +0 -11
  71. package/dist/model/deleteUserProfileResponse.d.ts.map +0 -1
  72. package/dist/model/errorBase.d.ts +0 -7
  73. package/dist/model/errorBase.d.ts.map +0 -1
  74. package/dist/model/eventScoring.d.ts +0 -13
  75. package/dist/model/eventScoring.d.ts.map +0 -1
  76. package/dist/model/eventType.d.ts +0 -5
  77. package/dist/model/eventType.d.ts.map +0 -1
  78. package/dist/model/facetScoring.d.ts +0 -11
  79. package/dist/model/facetScoring.d.ts.map +0 -1
  80. package/dist/model/getUserTokenResponse.d.ts +0 -15
  81. package/dist/model/getUserTokenResponse.d.ts.map +0 -1
  82. package/dist/model/index.d.ts +0 -10
  83. package/dist/model/index.d.ts.map +0 -1
  84. package/dist/model/personalizationStrategyParams.d.ts +0 -17
  85. package/dist/model/personalizationStrategyParams.d.ts.map +0 -1
  86. package/dist/model/setPersonalizationStrategyResponse.d.ts +0 -7
  87. package/dist/model/setPersonalizationStrategyResponse.d.ts.map +0 -1
  88. package/dist/src/personalizationClient.d.ts +0 -113
  89. package/dist/src/personalizationClient.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../model/personalizationStrategyParams.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 { EventScoring } from './eventScoring';\nimport type { FacetScoring } from './facetScoring';\n\nexport type PersonalizationStrategyParams = {\n /**\n * Scores associated with each event. The higher the scores, the higher the impact of those events on the personalization of search results.\n */\n eventScoring: EventScoring[];\n\n /**\n * Scores associated with each facet. The higher the scores, the higher the impact of those events on the personalization of search results.\n */\n facetScoring: FacetScoring[];\n\n /**\n * Impact of personalization on the search results. If set to 0, personalization has no impact on the search results.\n */\n personalizationImpact: number;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=personalizationStrategyParams.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // model/setPersonalizationStrategyResponse.ts
17
+ var setPersonalizationStrategyResponse_exports = {};
18
+ module.exports = __toCommonJS(setPersonalizationStrategyResponse_exports);
19
+ //# sourceMappingURL=setPersonalizationStrategyResponse.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../model/setPersonalizationStrategyResponse.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\nexport type SetPersonalizationStrategyResponse = {\n /**\n * A message confirming the strategy update.\n */\n message: string;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=setPersonalizationStrategyResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,190 @@
1
+ import * as _algolia_client_common from '@algolia/client-common';
2
+ import { ClientOptions } from '@algolia/client-common';
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
+ /**
16
+ * Error.
17
+ */
18
+ type ErrorBase = Record<string, any> & {
19
+ message?: string;
20
+ };
21
+
22
+ /**
23
+ * Event type.
24
+ */
25
+ type EventType = 'click' | 'conversion' | 'view';
26
+
27
+ type EventScoring = {
28
+ /**
29
+ * Event score.
30
+ */
31
+ score: number;
32
+ /**
33
+ * Event name.
34
+ */
35
+ eventName: string;
36
+ eventType: EventType;
37
+ };
38
+
39
+ type FacetScoring = {
40
+ /**
41
+ * Event score.
42
+ */
43
+ score: number;
44
+ /**
45
+ * Facet attribute name.
46
+ */
47
+ facetName: string;
48
+ };
49
+
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
+ type PersonalizationStrategyParams = {
66
+ /**
67
+ * Scores associated with each event. The higher the scores, the higher the impact of those events on the personalization of search results.
68
+ */
69
+ eventScoring: EventScoring[];
70
+ /**
71
+ * Scores associated with each facet. The higher the scores, the higher the impact of those events on the personalization of search results.
72
+ */
73
+ facetScoring: FacetScoring[];
74
+ /**
75
+ * Impact of personalization on the search results. If set to 0, personalization has no impact on the search results.
76
+ */
77
+ personalizationImpact: number;
78
+ };
79
+
80
+ type SetPersonalizationStrategyResponse = {
81
+ /**
82
+ * A message confirming the strategy update.
83
+ */
84
+ message: string;
85
+ };
86
+
87
+ /**
88
+ * Properties for the `customDelete` method.
89
+ */
90
+ type CustomDeleteProps = {
91
+ /**
92
+ * Path of the endpoint, anything after \"/1\" must be specified.
93
+ */
94
+ path: string;
95
+ /**
96
+ * Query parameters to apply to the current query.
97
+ */
98
+ parameters?: Record<string, any>;
99
+ };
100
+ /**
101
+ * Properties for the `customGet` method.
102
+ */
103
+ type CustomGetProps = {
104
+ /**
105
+ * Path of the endpoint, anything after \"/1\" must be specified.
106
+ */
107
+ path: string;
108
+ /**
109
+ * Query parameters to apply to the current query.
110
+ */
111
+ parameters?: Record<string, any>;
112
+ };
113
+ /**
114
+ * Properties for the `customPost` method.
115
+ */
116
+ type CustomPostProps = {
117
+ /**
118
+ * Path of the endpoint, anything after \"/1\" must be specified.
119
+ */
120
+ path: string;
121
+ /**
122
+ * Query parameters to apply to the current query.
123
+ */
124
+ parameters?: Record<string, any>;
125
+ /**
126
+ * Parameters to send with the custom request.
127
+ */
128
+ body?: Record<string, unknown>;
129
+ };
130
+ /**
131
+ * Properties for the `customPut` method.
132
+ */
133
+ type CustomPutProps = {
134
+ /**
135
+ * Path of the endpoint, anything after \"/1\" must be specified.
136
+ */
137
+ path: string;
138
+ /**
139
+ * Query parameters to apply to the current query.
140
+ */
141
+ parameters?: Record<string, any>;
142
+ /**
143
+ * Parameters to send with the custom request.
144
+ */
145
+ body?: Record<string, unknown>;
146
+ };
147
+ /**
148
+ * Properties for the `deleteUserProfile` method.
149
+ */
150
+ type DeleteUserProfileProps = {
151
+ /**
152
+ * Unique identifier representing a user for which to fetch the personalization profile.
153
+ */
154
+ userToken: string;
155
+ };
156
+ /**
157
+ * Properties for the `getUserTokenProfile` method.
158
+ */
159
+ type GetUserTokenProfileProps = {
160
+ /**
161
+ * Unique identifier representing a user for which to fetch the personalization profile.
162
+ */
163
+ userToken: string;
164
+ };
165
+
166
+ declare const apiClientVersion = "5.2.4";
167
+ declare const REGIONS: readonly ["eu", "us"];
168
+ type Region = (typeof REGIONS)[number];
169
+
170
+ /**
171
+ * The client type.
172
+ */
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>;
188
+ };
189
+
190
+ 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 ADDED
@@ -0,0 +1,190 @@
1
+ import * as _algolia_client_common from '@algolia/client-common';
2
+ import { ClientOptions } from '@algolia/client-common';
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
+ /**
16
+ * Error.
17
+ */
18
+ type ErrorBase = Record<string, any> & {
19
+ message?: string;
20
+ };
21
+
22
+ /**
23
+ * Event type.
24
+ */
25
+ type EventType = 'click' | 'conversion' | 'view';
26
+
27
+ type EventScoring = {
28
+ /**
29
+ * Event score.
30
+ */
31
+ score: number;
32
+ /**
33
+ * Event name.
34
+ */
35
+ eventName: string;
36
+ eventType: EventType;
37
+ };
38
+
39
+ type FacetScoring = {
40
+ /**
41
+ * Event score.
42
+ */
43
+ score: number;
44
+ /**
45
+ * Facet attribute name.
46
+ */
47
+ facetName: string;
48
+ };
49
+
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
+ type PersonalizationStrategyParams = {
66
+ /**
67
+ * Scores associated with each event. The higher the scores, the higher the impact of those events on the personalization of search results.
68
+ */
69
+ eventScoring: EventScoring[];
70
+ /**
71
+ * Scores associated with each facet. The higher the scores, the higher the impact of those events on the personalization of search results.
72
+ */
73
+ facetScoring: FacetScoring[];
74
+ /**
75
+ * Impact of personalization on the search results. If set to 0, personalization has no impact on the search results.
76
+ */
77
+ personalizationImpact: number;
78
+ };
79
+
80
+ type SetPersonalizationStrategyResponse = {
81
+ /**
82
+ * A message confirming the strategy update.
83
+ */
84
+ message: string;
85
+ };
86
+
87
+ /**
88
+ * Properties for the `customDelete` method.
89
+ */
90
+ type CustomDeleteProps = {
91
+ /**
92
+ * Path of the endpoint, anything after \"/1\" must be specified.
93
+ */
94
+ path: string;
95
+ /**
96
+ * Query parameters to apply to the current query.
97
+ */
98
+ parameters?: Record<string, any>;
99
+ };
100
+ /**
101
+ * Properties for the `customGet` method.
102
+ */
103
+ type CustomGetProps = {
104
+ /**
105
+ * Path of the endpoint, anything after \"/1\" must be specified.
106
+ */
107
+ path: string;
108
+ /**
109
+ * Query parameters to apply to the current query.
110
+ */
111
+ parameters?: Record<string, any>;
112
+ };
113
+ /**
114
+ * Properties for the `customPost` method.
115
+ */
116
+ type CustomPostProps = {
117
+ /**
118
+ * Path of the endpoint, anything after \"/1\" must be specified.
119
+ */
120
+ path: string;
121
+ /**
122
+ * Query parameters to apply to the current query.
123
+ */
124
+ parameters?: Record<string, any>;
125
+ /**
126
+ * Parameters to send with the custom request.
127
+ */
128
+ body?: Record<string, unknown>;
129
+ };
130
+ /**
131
+ * Properties for the `customPut` method.
132
+ */
133
+ type CustomPutProps = {
134
+ /**
135
+ * Path of the endpoint, anything after \"/1\" must be specified.
136
+ */
137
+ path: string;
138
+ /**
139
+ * Query parameters to apply to the current query.
140
+ */
141
+ parameters?: Record<string, any>;
142
+ /**
143
+ * Parameters to send with the custom request.
144
+ */
145
+ body?: Record<string, unknown>;
146
+ };
147
+ /**
148
+ * Properties for the `deleteUserProfile` method.
149
+ */
150
+ type DeleteUserProfileProps = {
151
+ /**
152
+ * Unique identifier representing a user for which to fetch the personalization profile.
153
+ */
154
+ userToken: string;
155
+ };
156
+ /**
157
+ * Properties for the `getUserTokenProfile` method.
158
+ */
159
+ type GetUserTokenProfileProps = {
160
+ /**
161
+ * Unique identifier representing a user for which to fetch the personalization profile.
162
+ */
163
+ userToken: string;
164
+ };
165
+
166
+ declare const apiClientVersion = "5.2.4";
167
+ declare const REGIONS: readonly ["eu", "us"];
168
+ type Region = (typeof REGIONS)[number];
169
+
170
+ /**
171
+ * The client type.
172
+ */
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>;
188
+ };
189
+
190
+ 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 };