@oursprivacy/platform-sdk 1.45.0 → 1.47.0

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 (178) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/client.d.mts +25 -13
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +25 -13
  5. package/client.d.ts.map +1 -1
  6. package/client.js +14 -2
  7. package/client.js.map +1 -1
  8. package/client.mjs +14 -2
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/attribution.d.mts +9 -1
  12. package/resources/attribution.d.mts.map +1 -1
  13. package/resources/attribution.d.ts +9 -1
  14. package/resources/attribution.d.ts.map +1 -1
  15. package/resources/consent-settings.d.mts +48 -0
  16. package/resources/consent-settings.d.mts.map +1 -1
  17. package/resources/consent-settings.d.ts +48 -0
  18. package/resources/consent-settings.d.ts.map +1 -1
  19. package/resources/conversion-journey-summaries.d.mts +38 -0
  20. package/resources/conversion-journey-summaries.d.mts.map +1 -1
  21. package/resources/conversion-journey-summaries.d.ts +38 -0
  22. package/resources/conversion-journey-summaries.d.ts.map +1 -1
  23. package/resources/conversion-journey-summaries.js +38 -0
  24. package/resources/conversion-journey-summaries.js.map +1 -1
  25. package/resources/conversion-journey-summaries.mjs +38 -0
  26. package/resources/conversion-journey-summaries.mjs.map +1 -1
  27. package/resources/data-governance.d.mts +5 -5
  28. package/resources/data-governance.d.mts.map +1 -1
  29. package/resources/data-governance.d.ts +5 -5
  30. package/resources/data-governance.d.ts.map +1 -1
  31. package/resources/destinations.d.mts +7 -27
  32. package/resources/destinations.d.mts.map +1 -1
  33. package/resources/destinations.d.ts +7 -27
  34. package/resources/destinations.d.ts.map +1 -1
  35. package/resources/experiment-variants.d.mts +4 -2
  36. package/resources/experiment-variants.d.mts.map +1 -1
  37. package/resources/experiment-variants.d.ts +4 -2
  38. package/resources/experiment-variants.d.ts.map +1 -1
  39. package/resources/experiments.d.mts +677 -102
  40. package/resources/experiments.d.mts.map +1 -1
  41. package/resources/experiments.d.ts +677 -102
  42. package/resources/experiments.d.ts.map +1 -1
  43. package/resources/experiments.js +32 -2
  44. package/resources/experiments.js.map +1 -1
  45. package/resources/experiments.mjs +32 -2
  46. package/resources/experiments.mjs.map +1 -1
  47. package/resources/funnels.d.mts +172 -22
  48. package/resources/funnels.d.mts.map +1 -1
  49. package/resources/funnels.d.ts +172 -22
  50. package/resources/funnels.d.ts.map +1 -1
  51. package/resources/funnels.js +10 -2
  52. package/resources/funnels.js.map +1 -1
  53. package/resources/funnels.mjs +10 -2
  54. package/resources/funnels.mjs.map +1 -1
  55. package/resources/heatmap-pages.d.mts +42 -14
  56. package/resources/heatmap-pages.d.mts.map +1 -1
  57. package/resources/heatmap-pages.d.ts +42 -14
  58. package/resources/heatmap-pages.d.ts.map +1 -1
  59. package/resources/heatmap-pages.js +11 -7
  60. package/resources/heatmap-pages.js.map +1 -1
  61. package/resources/heatmap-pages.mjs +11 -7
  62. package/resources/heatmap-pages.mjs.map +1 -1
  63. package/resources/index.d.mts +10 -6
  64. package/resources/index.d.mts.map +1 -1
  65. package/resources/index.d.ts +10 -6
  66. package/resources/index.d.ts.map +1 -1
  67. package/resources/index.js +9 -1
  68. package/resources/index.js.map +1 -1
  69. package/resources/index.mjs +4 -0
  70. package/resources/index.mjs.map +1 -1
  71. package/resources/mappings.d.mts +2 -2
  72. package/resources/mappings.d.mts.map +1 -1
  73. package/resources/mappings.d.ts +2 -2
  74. package/resources/mappings.d.ts.map +1 -1
  75. package/resources/personalization-properties.d.mts +547 -0
  76. package/resources/personalization-properties.d.mts.map +1 -0
  77. package/resources/personalization-properties.d.ts +547 -0
  78. package/resources/personalization-properties.d.ts.map +1 -0
  79. package/resources/personalization-properties.js +100 -0
  80. package/resources/personalization-properties.js.map +1 -0
  81. package/resources/personalization-properties.mjs +96 -0
  82. package/resources/personalization-properties.mjs.map +1 -0
  83. package/resources/session-replays.d.mts +91 -0
  84. package/resources/session-replays.d.mts.map +1 -0
  85. package/resources/session-replays.d.ts +91 -0
  86. package/resources/session-replays.d.ts.map +1 -0
  87. package/resources/session-replays.js +24 -0
  88. package/resources/session-replays.js.map +1 -0
  89. package/resources/session-replays.mjs +20 -0
  90. package/resources/session-replays.mjs.map +1 -0
  91. package/resources/short-links.d.mts +138 -37
  92. package/resources/short-links.d.mts.map +1 -1
  93. package/resources/short-links.d.ts +138 -37
  94. package/resources/short-links.d.ts.map +1 -1
  95. package/resources/short-links.js +27 -12
  96. package/resources/short-links.js.map +1 -1
  97. package/resources/short-links.mjs +27 -12
  98. package/resources/short-links.mjs.map +1 -1
  99. package/resources/sources.d.mts +10 -6
  100. package/resources/sources.d.mts.map +1 -1
  101. package/resources/sources.d.ts +10 -6
  102. package/resources/sources.d.ts.map +1 -1
  103. package/resources/tag-manager-tags.d.mts +2 -2
  104. package/resources/tag-manager-tags.d.ts +2 -2
  105. package/resources/tag-manager-tags.js +2 -2
  106. package/resources/tag-manager-tags.mjs +2 -2
  107. package/resources/tag-manager-triggers.d.mts +18 -1
  108. package/resources/tag-manager-triggers.d.mts.map +1 -1
  109. package/resources/tag-manager-triggers.d.ts +18 -1
  110. package/resources/tag-manager-triggers.d.ts.map +1 -1
  111. package/resources/translation-widgets.d.mts +62 -0
  112. package/resources/translation-widgets.d.mts.map +1 -0
  113. package/resources/translation-widgets.d.ts +62 -0
  114. package/resources/translation-widgets.d.ts.map +1 -0
  115. package/resources/translation-widgets.js +18 -0
  116. package/resources/translation-widgets.js.map +1 -0
  117. package/resources/translation-widgets.mjs +14 -0
  118. package/resources/translation-widgets.mjs.map +1 -0
  119. package/resources/versions.d.mts +52 -1
  120. package/resources/versions.d.mts.map +1 -1
  121. package/resources/versions.d.ts +52 -1
  122. package/resources/versions.d.ts.map +1 -1
  123. package/resources/versions.js +20 -0
  124. package/resources/versions.js.map +1 -1
  125. package/resources/versions.mjs +20 -0
  126. package/resources/versions.mjs.map +1 -1
  127. package/resources/video-channels.d.mts +17 -17
  128. package/resources/video-channels.d.mts.map +1 -1
  129. package/resources/video-channels.d.ts +17 -17
  130. package/resources/video-channels.d.ts.map +1 -1
  131. package/resources/video-channels.js +17 -16
  132. package/resources/video-channels.js.map +1 -1
  133. package/resources/video-channels.mjs +17 -16
  134. package/resources/video-channels.mjs.map +1 -1
  135. package/resources/web-analytics.d.mts +345 -0
  136. package/resources/web-analytics.d.mts.map +1 -0
  137. package/resources/web-analytics.d.ts +345 -0
  138. package/resources/web-analytics.d.ts.map +1 -0
  139. package/resources/web-analytics.js +61 -0
  140. package/resources/web-analytics.js.map +1 -0
  141. package/resources/web-analytics.mjs +57 -0
  142. package/resources/web-analytics.mjs.map +1 -0
  143. package/resources/web-scanners.d.mts +314 -14
  144. package/resources/web-scanners.d.mts.map +1 -1
  145. package/resources/web-scanners.d.ts +314 -14
  146. package/resources/web-scanners.d.ts.map +1 -1
  147. package/resources/web-scanners.js +139 -13
  148. package/resources/web-scanners.js.map +1 -1
  149. package/resources/web-scanners.mjs +139 -13
  150. package/resources/web-scanners.mjs.map +1 -1
  151. package/src/client.ts +147 -19
  152. package/src/resources/attribution.ts +11 -1
  153. package/src/resources/consent-settings.ts +56 -0
  154. package/src/resources/conversion-journey-summaries.ts +38 -0
  155. package/src/resources/data-governance.ts +5 -5
  156. package/src/resources/destinations.ts +18 -115
  157. package/src/resources/experiment-variants.ts +4 -2
  158. package/src/resources/experiments.ts +812 -101
  159. package/src/resources/funnels.ts +276 -21
  160. package/src/resources/heatmap-pages.ts +49 -14
  161. package/src/resources/index.ts +61 -3
  162. package/src/resources/mappings.ts +2 -2
  163. package/src/resources/personalization-properties.ts +662 -0
  164. package/src/resources/session-replays.ts +138 -0
  165. package/src/resources/short-links.ts +164 -36
  166. package/src/resources/sources.ts +11 -0
  167. package/src/resources/tag-manager-tags.ts +2 -2
  168. package/src/resources/tag-manager-triggers.ts +18 -1
  169. package/src/resources/translation-widgets.ts +97 -0
  170. package/src/resources/versions.ts +95 -0
  171. package/src/resources/video-channels.ts +19 -18
  172. package/src/resources/web-analytics.ts +494 -0
  173. package/src/resources/web-scanners.ts +443 -13
  174. package/src/version.ts +1 -1
  175. package/version.d.mts +1 -1
  176. package/version.d.ts +1 -1
  177. package/version.js +1 -1
  178. package/version.mjs +1 -1
@@ -0,0 +1,662 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { Cursor, type CursorParams, PagePromise } from '../core/pagination';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ export class PersonalizationProperties extends APIResource {
10
+ /**
11
+ * List personalization properties for one experiment settings record. Requires the
12
+ * `experimentSettingsId` query parameter — properties are always scoped to a
13
+ * single record; list the records with `GET /rest/v1/experiment-settings`.
14
+ * Supports cursor pagination via `limit` and `cursor`; the limit clamp is 1000 so
15
+ * a single request can return the full set. Requires scope:
16
+ * experimentSettings:list
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * // Automatically fetches more pages as needed.
21
+ * for await (const personalizationPropertyListResponse of client.personalizationProperties.list(
22
+ * {
23
+ * experimentSettingsId:
24
+ * '08524dc8-5289-48e8-bf40-b3a7cfa6ca0a',
25
+ * },
26
+ * )) {
27
+ * // ...
28
+ * }
29
+ * ```
30
+ */
31
+ list(
32
+ query: PersonalizationPropertyListParams,
33
+ options?: RequestOptions,
34
+ ): PagePromise<PersonalizationPropertyListResponsesCursor, PersonalizationPropertyListResponse> {
35
+ return this._client.getAPIList(
36
+ '/rest/v1/personalization-properties',
37
+ Cursor<PersonalizationPropertyListResponse>,
38
+ { query, ...options },
39
+ );
40
+ }
41
+
42
+ /**
43
+ * Create a personalization property on an experiment settings record. The new rule
44
+ * is published automatically and starts accumulating from the next matching event
45
+ * — no separate publish call is needed. `propertyKey` must be unique within the
46
+ * parent record. Requires scope: experimentSettings:update
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const personalizationProperty =
51
+ * await client.personalizationProperties.create({
52
+ * accumulator: 'set_true',
53
+ * experimentSettingsId:
54
+ * '08524dc8-5289-48e8-bf40-b3a7cfa6ca0a',
55
+ * propertyKey: 'visited_pricing',
56
+ * triggerEventName: 'page_view',
57
+ * });
58
+ * ```
59
+ */
60
+ create(
61
+ body: PersonalizationPropertyCreateParams,
62
+ options?: RequestOptions,
63
+ ): APIPromise<PersonalizationPropertyCreateResponse> {
64
+ return this._client.post('/rest/v1/personalization-properties', { body, ...options });
65
+ }
66
+
67
+ /**
68
+ * Find a single personalization property by ID. Returns 404 when no property
69
+ * matches the supplied id. Requires scope: experimentSettings:find
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * const personalizationProperty =
74
+ * await client.personalizationProperties.retrieve('id');
75
+ * ```
76
+ */
77
+ retrieve(id: string, options?: RequestOptions): APIPromise<PersonalizationPropertyRetrieveResponse> {
78
+ return this._client.get(path`/rest/v1/personalization-properties/${id}`, options);
79
+ }
80
+
81
+ /**
82
+ * Partially update a personalization property. Only the fields you send are
83
+ * changed, and the update is published automatically. Sending `triggerConditions`
84
+ * replaces the prior list — partial-array merging is not supported. Values already
85
+ * accumulated for visitors are kept; the new rule applies to events from here on.
86
+ * Returns 404 when no property matches the supplied id. Requires scope:
87
+ * experimentSettings:update
88
+ *
89
+ * @example
90
+ * ```ts
91
+ * const personalizationProperty =
92
+ * await client.personalizationProperties.update('id');
93
+ * ```
94
+ */
95
+ update(
96
+ id: string,
97
+ body: PersonalizationPropertyUpdateParams,
98
+ options?: RequestOptions,
99
+ ): APIPromise<PersonalizationPropertyUpdateResponse> {
100
+ return this._client.patch(path`/rest/v1/personalization-properties/${id}`, { body, ...options });
101
+ }
102
+
103
+ /**
104
+ * Delete a personalization property. The rule stops accumulating immediately;
105
+ * values already recorded for visitors are no longer maintained. Returns 404 when
106
+ * no property matches the supplied id. Requires scope: experimentSettings:update
107
+ *
108
+ * @example
109
+ * ```ts
110
+ * const personalizationProperty =
111
+ * await client.personalizationProperties.delete('id');
112
+ * ```
113
+ */
114
+ delete(id: string, options?: RequestOptions): APIPromise<PersonalizationPropertyDeleteResponse> {
115
+ return this._client.delete(path`/rest/v1/personalization-properties/${id}`, options);
116
+ }
117
+ }
118
+
119
+ export type PersonalizationPropertyListResponsesCursor = Cursor<PersonalizationPropertyListResponse>;
120
+
121
+ export interface PersonalizationPropertyListResponse {
122
+ /**
123
+ * Unique identifier for this personalization property.
124
+ */
125
+ id: string;
126
+
127
+ /**
128
+ * How repeated trigger events fold into the stored value. `set_true` records
129
+ * `true` the first time the event matches — use it for one-shot interest flags.
130
+ * `increment` counts matching events as a number. `latest_value` stores the most
131
+ * recent value read from `valueField`, replacing whatever was there before.
132
+ */
133
+ accumulator: 'increment' | 'latest_value' | 'set_true';
134
+
135
+ /**
136
+ * ISO 8601 timestamp of when the property was created.
137
+ */
138
+ createdAt: string;
139
+
140
+ /**
141
+ * Experiment settings record that owns this property.
142
+ */
143
+ experimentSettingsId: string;
144
+
145
+ /**
146
+ * Name this value is stored and read under. Must be unique within the parent
147
+ * experiment settings record — a duplicate key is rejected with 409. Because
148
+ * accumulated values are delivered to the visitor's browser and are readable
149
+ * there, never accumulate secrets, credentials, PHI, or confidential data into a
150
+ * property.
151
+ */
152
+ propertyKey: string;
153
+
154
+ /**
155
+ * Whether the property is accumulating. `Disabled` properties stop accumulating
156
+ * but keep values already recorded.
157
+ */
158
+ status: 'Disabled' | 'Enabled';
159
+
160
+ /**
161
+ * Name of the tracked event that advances this property. Every event with this
162
+ * name is evaluated against `triggerConditions`.
163
+ */
164
+ triggerEventName: string;
165
+
166
+ /**
167
+ * Optional filters the triggering event must satisfy. All conditions must match
168
+ * (AND). Omit or send an empty list to accumulate on every event with the matching
169
+ * name.
170
+ */
171
+ triggerConditions?: Array<PersonalizationPropertyListResponse.TriggerCondition> | null;
172
+
173
+ /**
174
+ * ISO 8601 timestamp of the last update, or null when never updated.
175
+ */
176
+ updatedAt?: string | null;
177
+
178
+ /**
179
+ * Event field to read the stored value from. Required for `latest_value`; ignored
180
+ * by `set_true` and `increment`. Only scalar values (string, number, boolean) are
181
+ * stored. Must be one of `event.name`, `event.properties.<name>`, or
182
+ * `event.context.<name>` where `<name>` is one of `current_url`, `referrer`,
183
+ * `utm_source`, `utm_medium`, `utm_campaign`, `utm_content`, or `utm_term`. Any
184
+ * other path is rejected with 400.
185
+ */
186
+ valueField?: string | null;
187
+ }
188
+
189
+ export namespace PersonalizationPropertyListResponse {
190
+ export interface TriggerCondition {
191
+ /**
192
+ * Event field the condition reads. Must be one of `event.name`,
193
+ * `event.properties.<name>`, or `event.context.<name>` where `<name>` is one of
194
+ * `current_url`, `referrer`, `utm_source`, `utm_medium`, `utm_campaign`,
195
+ * `utm_content`, or `utm_term`. Any other path is rejected with 400.
196
+ */
197
+ field: string;
198
+
199
+ /**
200
+ * Comparison applied to the field. `exists` and `not_exists` ignore `value`;
201
+ * `regex` matches the field against `value` as a regular expression.
202
+ */
203
+ operator: 'contains' | 'equals' | 'exists' | 'not_equals' | 'not_exists' | 'regex';
204
+
205
+ /**
206
+ * Scalar value the operator compares against. Omit for `exists` and `not_exists`.
207
+ * Nested objects and arrays are rejected.
208
+ */
209
+ value?: string | null;
210
+ }
211
+ }
212
+
213
+ export interface PersonalizationPropertyCreateResponse {
214
+ /**
215
+ * Unique identifier for this personalization property.
216
+ */
217
+ id: string;
218
+
219
+ /**
220
+ * How repeated trigger events fold into the stored value. `set_true` records
221
+ * `true` the first time the event matches — use it for one-shot interest flags.
222
+ * `increment` counts matching events as a number. `latest_value` stores the most
223
+ * recent value read from `valueField`, replacing whatever was there before.
224
+ */
225
+ accumulator: 'increment' | 'latest_value' | 'set_true';
226
+
227
+ /**
228
+ * ISO 8601 timestamp of when the property was created.
229
+ */
230
+ createdAt: string;
231
+
232
+ /**
233
+ * Experiment settings record that owns this property.
234
+ */
235
+ experimentSettingsId: string;
236
+
237
+ /**
238
+ * Name this value is stored and read under. Must be unique within the parent
239
+ * experiment settings record — a duplicate key is rejected with 409. Because
240
+ * accumulated values are delivered to the visitor's browser and are readable
241
+ * there, never accumulate secrets, credentials, PHI, or confidential data into a
242
+ * property.
243
+ */
244
+ propertyKey: string;
245
+
246
+ /**
247
+ * Whether the property is accumulating. `Disabled` properties stop accumulating
248
+ * but keep values already recorded.
249
+ */
250
+ status: 'Disabled' | 'Enabled';
251
+
252
+ /**
253
+ * Name of the tracked event that advances this property. Every event with this
254
+ * name is evaluated against `triggerConditions`.
255
+ */
256
+ triggerEventName: string;
257
+
258
+ /**
259
+ * Optional filters the triggering event must satisfy. All conditions must match
260
+ * (AND). Omit or send an empty list to accumulate on every event with the matching
261
+ * name.
262
+ */
263
+ triggerConditions?: Array<PersonalizationPropertyCreateResponse.TriggerCondition> | null;
264
+
265
+ /**
266
+ * ISO 8601 timestamp of the last update, or null when never updated.
267
+ */
268
+ updatedAt?: string | null;
269
+
270
+ /**
271
+ * Event field to read the stored value from. Required for `latest_value`; ignored
272
+ * by `set_true` and `increment`. Only scalar values (string, number, boolean) are
273
+ * stored. Must be one of `event.name`, `event.properties.<name>`, or
274
+ * `event.context.<name>` where `<name>` is one of `current_url`, `referrer`,
275
+ * `utm_source`, `utm_medium`, `utm_campaign`, `utm_content`, or `utm_term`. Any
276
+ * other path is rejected with 400.
277
+ */
278
+ valueField?: string | null;
279
+ }
280
+
281
+ export namespace PersonalizationPropertyCreateResponse {
282
+ export interface TriggerCondition {
283
+ /**
284
+ * Event field the condition reads. Must be one of `event.name`,
285
+ * `event.properties.<name>`, or `event.context.<name>` where `<name>` is one of
286
+ * `current_url`, `referrer`, `utm_source`, `utm_medium`, `utm_campaign`,
287
+ * `utm_content`, or `utm_term`. Any other path is rejected with 400.
288
+ */
289
+ field: string;
290
+
291
+ /**
292
+ * Comparison applied to the field. `exists` and `not_exists` ignore `value`;
293
+ * `regex` matches the field against `value` as a regular expression.
294
+ */
295
+ operator: 'contains' | 'equals' | 'exists' | 'not_equals' | 'not_exists' | 'regex';
296
+
297
+ /**
298
+ * Scalar value the operator compares against. Omit for `exists` and `not_exists`.
299
+ * Nested objects and arrays are rejected.
300
+ */
301
+ value?: string | null;
302
+ }
303
+ }
304
+
305
+ export interface PersonalizationPropertyRetrieveResponse {
306
+ /**
307
+ * Unique identifier for this personalization property.
308
+ */
309
+ id: string;
310
+
311
+ /**
312
+ * How repeated trigger events fold into the stored value. `set_true` records
313
+ * `true` the first time the event matches — use it for one-shot interest flags.
314
+ * `increment` counts matching events as a number. `latest_value` stores the most
315
+ * recent value read from `valueField`, replacing whatever was there before.
316
+ */
317
+ accumulator: 'increment' | 'latest_value' | 'set_true';
318
+
319
+ /**
320
+ * ISO 8601 timestamp of when the property was created.
321
+ */
322
+ createdAt: string;
323
+
324
+ /**
325
+ * Experiment settings record that owns this property.
326
+ */
327
+ experimentSettingsId: string;
328
+
329
+ /**
330
+ * Name this value is stored and read under. Must be unique within the parent
331
+ * experiment settings record — a duplicate key is rejected with 409. Because
332
+ * accumulated values are delivered to the visitor's browser and are readable
333
+ * there, never accumulate secrets, credentials, PHI, or confidential data into a
334
+ * property.
335
+ */
336
+ propertyKey: string;
337
+
338
+ /**
339
+ * Whether the property is accumulating. `Disabled` properties stop accumulating
340
+ * but keep values already recorded.
341
+ */
342
+ status: 'Disabled' | 'Enabled';
343
+
344
+ /**
345
+ * Name of the tracked event that advances this property. Every event with this
346
+ * name is evaluated against `triggerConditions`.
347
+ */
348
+ triggerEventName: string;
349
+
350
+ /**
351
+ * Optional filters the triggering event must satisfy. All conditions must match
352
+ * (AND). Omit or send an empty list to accumulate on every event with the matching
353
+ * name.
354
+ */
355
+ triggerConditions?: Array<PersonalizationPropertyRetrieveResponse.TriggerCondition> | null;
356
+
357
+ /**
358
+ * ISO 8601 timestamp of the last update, or null when never updated.
359
+ */
360
+ updatedAt?: string | null;
361
+
362
+ /**
363
+ * Event field to read the stored value from. Required for `latest_value`; ignored
364
+ * by `set_true` and `increment`. Only scalar values (string, number, boolean) are
365
+ * stored. Must be one of `event.name`, `event.properties.<name>`, or
366
+ * `event.context.<name>` where `<name>` is one of `current_url`, `referrer`,
367
+ * `utm_source`, `utm_medium`, `utm_campaign`, `utm_content`, or `utm_term`. Any
368
+ * other path is rejected with 400.
369
+ */
370
+ valueField?: string | null;
371
+ }
372
+
373
+ export namespace PersonalizationPropertyRetrieveResponse {
374
+ export interface TriggerCondition {
375
+ /**
376
+ * Event field the condition reads. Must be one of `event.name`,
377
+ * `event.properties.<name>`, or `event.context.<name>` where `<name>` is one of
378
+ * `current_url`, `referrer`, `utm_source`, `utm_medium`, `utm_campaign`,
379
+ * `utm_content`, or `utm_term`. Any other path is rejected with 400.
380
+ */
381
+ field: string;
382
+
383
+ /**
384
+ * Comparison applied to the field. `exists` and `not_exists` ignore `value`;
385
+ * `regex` matches the field against `value` as a regular expression.
386
+ */
387
+ operator: 'contains' | 'equals' | 'exists' | 'not_equals' | 'not_exists' | 'regex';
388
+
389
+ /**
390
+ * Scalar value the operator compares against. Omit for `exists` and `not_exists`.
391
+ * Nested objects and arrays are rejected.
392
+ */
393
+ value?: string | null;
394
+ }
395
+ }
396
+
397
+ export interface PersonalizationPropertyUpdateResponse {
398
+ /**
399
+ * Unique identifier for this personalization property.
400
+ */
401
+ id: string;
402
+
403
+ /**
404
+ * How repeated trigger events fold into the stored value. `set_true` records
405
+ * `true` the first time the event matches — use it for one-shot interest flags.
406
+ * `increment` counts matching events as a number. `latest_value` stores the most
407
+ * recent value read from `valueField`, replacing whatever was there before.
408
+ */
409
+ accumulator: 'increment' | 'latest_value' | 'set_true';
410
+
411
+ /**
412
+ * ISO 8601 timestamp of when the property was created.
413
+ */
414
+ createdAt: string;
415
+
416
+ /**
417
+ * Experiment settings record that owns this property.
418
+ */
419
+ experimentSettingsId: string;
420
+
421
+ /**
422
+ * Name this value is stored and read under. Must be unique within the parent
423
+ * experiment settings record — a duplicate key is rejected with 409. Because
424
+ * accumulated values are delivered to the visitor's browser and are readable
425
+ * there, never accumulate secrets, credentials, PHI, or confidential data into a
426
+ * property.
427
+ */
428
+ propertyKey: string;
429
+
430
+ /**
431
+ * Whether the property is accumulating. `Disabled` properties stop accumulating
432
+ * but keep values already recorded.
433
+ */
434
+ status: 'Disabled' | 'Enabled';
435
+
436
+ /**
437
+ * Name of the tracked event that advances this property. Every event with this
438
+ * name is evaluated against `triggerConditions`.
439
+ */
440
+ triggerEventName: string;
441
+
442
+ /**
443
+ * Optional filters the triggering event must satisfy. All conditions must match
444
+ * (AND). Omit or send an empty list to accumulate on every event with the matching
445
+ * name.
446
+ */
447
+ triggerConditions?: Array<PersonalizationPropertyUpdateResponse.TriggerCondition> | null;
448
+
449
+ /**
450
+ * ISO 8601 timestamp of the last update, or null when never updated.
451
+ */
452
+ updatedAt?: string | null;
453
+
454
+ /**
455
+ * Event field to read the stored value from. Required for `latest_value`; ignored
456
+ * by `set_true` and `increment`. Only scalar values (string, number, boolean) are
457
+ * stored. Must be one of `event.name`, `event.properties.<name>`, or
458
+ * `event.context.<name>` where `<name>` is one of `current_url`, `referrer`,
459
+ * `utm_source`, `utm_medium`, `utm_campaign`, `utm_content`, or `utm_term`. Any
460
+ * other path is rejected with 400.
461
+ */
462
+ valueField?: string | null;
463
+ }
464
+
465
+ export namespace PersonalizationPropertyUpdateResponse {
466
+ export interface TriggerCondition {
467
+ /**
468
+ * Event field the condition reads. Must be one of `event.name`,
469
+ * `event.properties.<name>`, or `event.context.<name>` where `<name>` is one of
470
+ * `current_url`, `referrer`, `utm_source`, `utm_medium`, `utm_campaign`,
471
+ * `utm_content`, or `utm_term`. Any other path is rejected with 400.
472
+ */
473
+ field: string;
474
+
475
+ /**
476
+ * Comparison applied to the field. `exists` and `not_exists` ignore `value`;
477
+ * `regex` matches the field against `value` as a regular expression.
478
+ */
479
+ operator: 'contains' | 'equals' | 'exists' | 'not_equals' | 'not_exists' | 'regex';
480
+
481
+ /**
482
+ * Scalar value the operator compares against. Omit for `exists` and `not_exists`.
483
+ * Nested objects and arrays are rejected.
484
+ */
485
+ value?: string | null;
486
+ }
487
+ }
488
+
489
+ /**
490
+ * Whether the personalization property was deleted successfully.
491
+ */
492
+ export type PersonalizationPropertyDeleteResponse = boolean;
493
+
494
+ export interface PersonalizationPropertyListParams extends CursorParams {
495
+ /**
496
+ * Required. List properties belonging to this experiment settings record. Get the
497
+ * id from `GET /rest/v1/experiment-settings`.
498
+ */
499
+ experimentSettingsId: string;
500
+ }
501
+
502
+ export interface PersonalizationPropertyCreateParams {
503
+ /**
504
+ * How repeated trigger events fold into the stored value. `set_true` records
505
+ * `true` the first time the event matches — use it for one-shot interest flags.
506
+ * `increment` counts matching events as a number. `latest_value` stores the most
507
+ * recent value read from `valueField`, replacing whatever was there before.
508
+ */
509
+ accumulator: 'increment' | 'latest_value' | 'set_true';
510
+
511
+ /**
512
+ * Experiment settings record that will own this property. Get the id from
513
+ * `GET /rest/v1/experiment-settings`.
514
+ */
515
+ experimentSettingsId: string;
516
+
517
+ /**
518
+ * Name this value is stored and read under. Must be unique within the parent
519
+ * experiment settings record — a duplicate key is rejected with 409. Because
520
+ * accumulated values are delivered to the visitor's browser and are readable
521
+ * there, never accumulate secrets, credentials, PHI, or confidential data into a
522
+ * property.
523
+ */
524
+ propertyKey: string;
525
+
526
+ /**
527
+ * Name of the tracked event that advances this property. Every event with this
528
+ * name is evaluated against `triggerConditions`.
529
+ */
530
+ triggerEventName: string;
531
+
532
+ /**
533
+ * Optional filters the triggering event must satisfy. All conditions must match
534
+ * (AND). Omit or send an empty list to accumulate on every event with the matching
535
+ * name.
536
+ */
537
+ triggerConditions?: Array<PersonalizationPropertyCreateParams.TriggerCondition> | null;
538
+
539
+ /**
540
+ * Event field to read the stored value from. Required for `latest_value`; ignored
541
+ * by `set_true` and `increment`. Only scalar values (string, number, boolean) are
542
+ * stored. Must be one of `event.name`, `event.properties.<name>`, or
543
+ * `event.context.<name>` where `<name>` is one of `current_url`, `referrer`,
544
+ * `utm_source`, `utm_medium`, `utm_campaign`, `utm_content`, or `utm_term`. Any
545
+ * other path is rejected with 400.
546
+ */
547
+ valueField?: string | null;
548
+ }
549
+
550
+ export namespace PersonalizationPropertyCreateParams {
551
+ export interface TriggerCondition {
552
+ /**
553
+ * Event field the condition reads. Must be one of `event.name`,
554
+ * `event.properties.<name>`, or `event.context.<name>` where `<name>` is one of
555
+ * `current_url`, `referrer`, `utm_source`, `utm_medium`, `utm_campaign`,
556
+ * `utm_content`, or `utm_term`. Any other path is rejected with 400.
557
+ */
558
+ field: string;
559
+
560
+ /**
561
+ * Comparison applied to the field. `exists` and `not_exists` ignore `value`;
562
+ * `regex` matches the field against `value` as a regular expression.
563
+ */
564
+ operator: 'contains' | 'equals' | 'exists' | 'not_equals' | 'not_exists' | 'regex';
565
+
566
+ /**
567
+ * Scalar value the operator compares against. Omit for `exists` and `not_exists`.
568
+ * Nested objects and arrays are rejected.
569
+ */
570
+ value?: string | null;
571
+ }
572
+ }
573
+
574
+ export interface PersonalizationPropertyUpdateParams {
575
+ /**
576
+ * How repeated trigger events fold into the stored value. `set_true` records
577
+ * `true` the first time the event matches — use it for one-shot interest flags.
578
+ * `increment` counts matching events as a number. `latest_value` stores the most
579
+ * recent value read from `valueField`, replacing whatever was there before. Omit
580
+ * this field or send `null` to leave it unchanged.
581
+ */
582
+ accumulator?: 'increment' | 'latest_value' | 'set_true' | null;
583
+
584
+ /**
585
+ * Renamed key. Name this value is stored and read under. Must be unique within the
586
+ * parent experiment settings record — a duplicate key is rejected with 409.
587
+ * Because accumulated values are delivered to the visitor's browser and are
588
+ * readable there, never accumulate secrets, credentials, PHI, or confidential data
589
+ * into a property. Omit this field or send `null` to leave it unchanged.
590
+ */
591
+ propertyKey?: string | null;
592
+
593
+ /**
594
+ * Pause or resume accumulation. `Disabled` stops accumulating without discarding
595
+ * values already recorded. Omit this field or send `null` to leave it unchanged.
596
+ */
597
+ status?: 'Disabled' | 'Enabled' | null;
598
+
599
+ /**
600
+ * Optional filters the triggering event must satisfy. All conditions must match
601
+ * (AND). Omit or send an empty list to accumulate on every event with the matching
602
+ * name. Sending this field replaces the prior list — partial-array merging is not
603
+ * supported. Send `null` or an empty array to clear every condition, which makes
604
+ * the rule fire on each occurrence of the trigger event.
605
+ */
606
+ triggerConditions?: Array<PersonalizationPropertyUpdateParams.TriggerCondition> | null;
607
+
608
+ /**
609
+ * Name of the tracked event that advances this property. Every event with this
610
+ * name is evaluated against `triggerConditions`. Omit this field or send `null` to
611
+ * leave it unchanged.
612
+ */
613
+ triggerEventName?: string | null;
614
+
615
+ /**
616
+ * Event field to read the stored value from. Required for `latest_value`; ignored
617
+ * by `set_true` and `increment`. Only scalar values (string, number, boolean) are
618
+ * stored. Must be one of `event.name`, `event.properties.<name>`, or
619
+ * `event.context.<name>` where `<name>` is one of `current_url`, `referrer`,
620
+ * `utm_source`, `utm_medium`, `utm_campaign`, `utm_content`, or `utm_term`. Any
621
+ * other path is rejected with 400.
622
+ */
623
+ valueField?: string | null;
624
+ }
625
+
626
+ export namespace PersonalizationPropertyUpdateParams {
627
+ export interface TriggerCondition {
628
+ /**
629
+ * Event field the condition reads. Must be one of `event.name`,
630
+ * `event.properties.<name>`, or `event.context.<name>` where `<name>` is one of
631
+ * `current_url`, `referrer`, `utm_source`, `utm_medium`, `utm_campaign`,
632
+ * `utm_content`, or `utm_term`. Any other path is rejected with 400.
633
+ */
634
+ field: string;
635
+
636
+ /**
637
+ * Comparison applied to the field. `exists` and `not_exists` ignore `value`;
638
+ * `regex` matches the field against `value` as a regular expression.
639
+ */
640
+ operator: 'contains' | 'equals' | 'exists' | 'not_equals' | 'not_exists' | 'regex';
641
+
642
+ /**
643
+ * Scalar value the operator compares against. Omit for `exists` and `not_exists`.
644
+ * Nested objects and arrays are rejected.
645
+ */
646
+ value?: string | null;
647
+ }
648
+ }
649
+
650
+ export declare namespace PersonalizationProperties {
651
+ export {
652
+ type PersonalizationPropertyListResponse as PersonalizationPropertyListResponse,
653
+ type PersonalizationPropertyCreateResponse as PersonalizationPropertyCreateResponse,
654
+ type PersonalizationPropertyRetrieveResponse as PersonalizationPropertyRetrieveResponse,
655
+ type PersonalizationPropertyUpdateResponse as PersonalizationPropertyUpdateResponse,
656
+ type PersonalizationPropertyDeleteResponse as PersonalizationPropertyDeleteResponse,
657
+ type PersonalizationPropertyListResponsesCursor as PersonalizationPropertyListResponsesCursor,
658
+ type PersonalizationPropertyListParams as PersonalizationPropertyListParams,
659
+ type PersonalizationPropertyCreateParams as PersonalizationPropertyCreateParams,
660
+ type PersonalizationPropertyUpdateParams as PersonalizationPropertyUpdateParams,
661
+ };
662
+ }