@oursprivacy/platform-sdk 1.24.0 → 1.26.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 (78) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/client.d.mts +15 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +15 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +15 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +15 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/destinations.d.mts +7 -7
  12. package/resources/destinations.d.mts.map +1 -1
  13. package/resources/destinations.d.ts +7 -7
  14. package/resources/destinations.d.ts.map +1 -1
  15. package/resources/index.d.mts +5 -0
  16. package/resources/index.d.mts.map +1 -1
  17. package/resources/index.d.ts +5 -0
  18. package/resources/index.d.ts.map +1 -1
  19. package/resources/index.js +11 -1
  20. package/resources/index.js.map +1 -1
  21. package/resources/index.mjs +5 -0
  22. package/resources/index.mjs.map +1 -1
  23. package/resources/sources.d.mts +2 -2
  24. package/resources/sources.d.ts +2 -2
  25. package/resources/tag-manager-folders.d.mts +100 -0
  26. package/resources/tag-manager-folders.d.mts.map +1 -0
  27. package/resources/tag-manager-folders.d.ts +100 -0
  28. package/resources/tag-manager-folders.d.ts.map +1 -0
  29. package/resources/tag-manager-folders.js +55 -0
  30. package/resources/tag-manager-folders.js.map +1 -0
  31. package/resources/tag-manager-folders.mjs +51 -0
  32. package/resources/tag-manager-folders.mjs.map +1 -0
  33. package/resources/tag-manager-tags.d.mts +430 -0
  34. package/resources/tag-manager-tags.d.mts.map +1 -0
  35. package/resources/tag-manager-tags.d.ts +430 -0
  36. package/resources/tag-manager-tags.d.ts.map +1 -0
  37. package/resources/tag-manager-tags.js +66 -0
  38. package/resources/tag-manager-tags.js.map +1 -0
  39. package/resources/tag-manager-tags.mjs +62 -0
  40. package/resources/tag-manager-tags.mjs.map +1 -0
  41. package/resources/tag-manager-triggers.d.mts +327 -0
  42. package/resources/tag-manager-triggers.d.mts.map +1 -0
  43. package/resources/tag-manager-triggers.d.ts +327 -0
  44. package/resources/tag-manager-triggers.d.ts.map +1 -0
  45. package/resources/tag-manager-triggers.js +61 -0
  46. package/resources/tag-manager-triggers.js.map +1 -0
  47. package/resources/tag-manager-triggers.mjs +57 -0
  48. package/resources/tag-manager-triggers.mjs.map +1 -0
  49. package/resources/tag-manager-variables.d.mts +370 -0
  50. package/resources/tag-manager-variables.d.mts.map +1 -0
  51. package/resources/tag-manager-variables.d.ts +370 -0
  52. package/resources/tag-manager-variables.d.ts.map +1 -0
  53. package/resources/tag-manager-variables.js +63 -0
  54. package/resources/tag-manager-variables.js.map +1 -0
  55. package/resources/tag-manager-variables.mjs +59 -0
  56. package/resources/tag-manager-variables.mjs.map +1 -0
  57. package/resources/tag-managers.d.mts +207 -0
  58. package/resources/tag-managers.d.mts.map +1 -0
  59. package/resources/tag-managers.d.ts +207 -0
  60. package/resources/tag-managers.d.ts.map +1 -0
  61. package/resources/tag-managers.js +51 -0
  62. package/resources/tag-managers.js.map +1 -0
  63. package/resources/tag-managers.mjs +47 -0
  64. package/resources/tag-managers.mjs.map +1 -0
  65. package/src/client.ts +137 -0
  66. package/src/resources/destinations.ts +7 -0
  67. package/src/resources/index.ts +61 -0
  68. package/src/resources/sources.ts +2 -2
  69. package/src/resources/tag-manager-folders.ts +172 -0
  70. package/src/resources/tag-manager-tags.ts +555 -0
  71. package/src/resources/tag-manager-triggers.ts +431 -0
  72. package/src/resources/tag-manager-variables.ts +469 -0
  73. package/src/resources/tag-managers.ts +272 -0
  74. package/src/version.ts +1 -1
  75. package/version.d.mts +1 -1
  76. package/version.d.ts +1 -1
  77. package/version.js +1 -1
  78. package/version.mjs +1 -1
@@ -0,0 +1,469 @@
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 TagManagerVariables extends APIResource {
10
+ /**
11
+ * List variables inside a single tag manager. Requires the `tagManagerId` query
12
+ * parameter — variables are always scoped to one parent container. Supports cursor
13
+ * pagination via `limit` and `cursor`; the limit clamp is 1000 so a single request
14
+ * can return the full set (the web-app workspace renders all variables in one
15
+ * shot). Requires scope: tagManagers:find
16
+ */
17
+ list(
18
+ query: TagManagerVariableListParams,
19
+ options?: RequestOptions,
20
+ ): PagePromise<TagManagerVariableListResponsesCursor, TagManagerVariableListResponse> {
21
+ return this._client.getAPIList('/rest/v1/tag-manager-variables', Cursor<TagManagerVariableListResponse>, {
22
+ query,
23
+ ...options,
24
+ });
25
+ }
26
+
27
+ /**
28
+ * Create a new variable inside a tag manager. `tagManagerId` is required in the
29
+ * body. Known input failures (e.g. duplicate variable name within the tag manager)
30
+ * are returned as HTTP 409 with the reason in the response `error` field. Requires
31
+ * scope: tagManagers:update
32
+ */
33
+ create(
34
+ body: TagManagerVariableCreateParams,
35
+ options?: RequestOptions,
36
+ ): APIPromise<TagManagerVariableCreateResponse> {
37
+ return this._client.post('/rest/v1/tag-manager-variables', { body, ...options });
38
+ }
39
+
40
+ /**
41
+ * Find a single tag manager variable by ID. Requires scope: tagManagers:find
42
+ */
43
+ retrieve(id: string, options?: RequestOptions): APIPromise<TagManagerVariableRetrieveResponse> {
44
+ return this._client.get(path`/rest/v1/tag-manager-variables/${id}`, options);
45
+ }
46
+
47
+ /**
48
+ * Partially update a variable. Only the fields you send are changed. Name
49
+ * collisions with other variables in the same tag manager return 409 with the
50
+ * reason in the response `error` field. Requires scope: tagManagers:update
51
+ */
52
+ update(
53
+ id: string,
54
+ body: TagManagerVariableUpdateParams,
55
+ options?: RequestOptions,
56
+ ): APIPromise<TagManagerVariableUpdateResponse> {
57
+ return this._client.patch(path`/rest/v1/tag-manager-variables/${id}`, { body, ...options });
58
+ }
59
+
60
+ /**
61
+ * Delete a tag manager variable. Requires scope: tagManagers:update
62
+ */
63
+ delete(id: string, options?: RequestOptions): APIPromise<TagManagerVariableDeleteResponse> {
64
+ return this._client.delete(path`/rest/v1/tag-manager-variables/${id}`, options);
65
+ }
66
+
67
+ /**
68
+ * Lists every variable template the platform supports — what `type` discriminator
69
+ * to send on create/patch, the shape of the type-specific `parameters` payload,
70
+ * and `supportsVariables` (whether the variable's own parameter fields may
71
+ * reference `{{OtherVariable}}` at runtime). Account-agnostic: the response is the
72
+ * same for every API key. Requires scope: tagManagers:find
73
+ */
74
+ types(options?: RequestOptions): APIPromise<TagManagerVariableTypesResponse> {
75
+ return this._client.get('/rest/v1/tag-manager-variables/types', options);
76
+ }
77
+ }
78
+
79
+ export type TagManagerVariableListResponsesCursor = Cursor<TagManagerVariableListResponse>;
80
+
81
+ export interface TagManagerVariableListResponse {
82
+ id: string;
83
+
84
+ accountId: string;
85
+
86
+ name: string;
87
+
88
+ /**
89
+ * Type-specific configuration.
90
+ */
91
+ parameters: { [key: string]: unknown };
92
+
93
+ tagManagerId: string;
94
+
95
+ /**
96
+ * Variable type (e.g. `DataLayer`, `Constant`, `LookUpTable`).
97
+ */
98
+ type: string;
99
+
100
+ /**
101
+ * Variable implementation identifier (typically equals `type`).
102
+ */
103
+ Variable: string;
104
+
105
+ createdAt?: string | null;
106
+
107
+ /**
108
+ * Default value returned when no rule matches. JSON value — type depends on
109
+ * `type`.
110
+ */
111
+ defaultValue?: { [key: string]: unknown };
112
+
113
+ enabled?: boolean | null;
114
+
115
+ /**
116
+ * Folder this variable belongs to. Read-only on this endpoint — use the GraphQL
117
+ * `assignTagManagerAssetToFolder` mutation to change.
118
+ */
119
+ folderId?: string | null;
120
+
121
+ /**
122
+ * Optional lookup table for `LookUpTable`-style variables. JSON value.
123
+ */
124
+ lookUpTable?: { [key: string]: unknown };
125
+
126
+ updatedAt?: string | null;
127
+ }
128
+
129
+ export interface TagManagerVariableCreateResponse {
130
+ id: string;
131
+
132
+ accountId: string;
133
+
134
+ name: string;
135
+
136
+ /**
137
+ * Type-specific configuration.
138
+ */
139
+ parameters: { [key: string]: unknown };
140
+
141
+ tagManagerId: string;
142
+
143
+ /**
144
+ * Variable type (e.g. `DataLayer`, `Constant`, `LookUpTable`).
145
+ */
146
+ type: string;
147
+
148
+ /**
149
+ * Variable implementation identifier (typically equals `type`).
150
+ */
151
+ Variable: string;
152
+
153
+ createdAt?: string | null;
154
+
155
+ /**
156
+ * Default value returned when no rule matches. JSON value — type depends on
157
+ * `type`.
158
+ */
159
+ defaultValue?: { [key: string]: unknown };
160
+
161
+ enabled?: boolean | null;
162
+
163
+ /**
164
+ * Folder this variable belongs to. Read-only on this endpoint — use the GraphQL
165
+ * `assignTagManagerAssetToFolder` mutation to change.
166
+ */
167
+ folderId?: string | null;
168
+
169
+ /**
170
+ * Optional lookup table for `LookUpTable`-style variables. JSON value.
171
+ */
172
+ lookUpTable?: { [key: string]: unknown };
173
+
174
+ updatedAt?: string | null;
175
+ }
176
+
177
+ export interface TagManagerVariableRetrieveResponse {
178
+ id: string;
179
+
180
+ accountId: string;
181
+
182
+ name: string;
183
+
184
+ /**
185
+ * Type-specific configuration.
186
+ */
187
+ parameters: { [key: string]: unknown };
188
+
189
+ tagManagerId: string;
190
+
191
+ /**
192
+ * Variable type (e.g. `DataLayer`, `Constant`, `LookUpTable`).
193
+ */
194
+ type: string;
195
+
196
+ /**
197
+ * Variable implementation identifier (typically equals `type`).
198
+ */
199
+ Variable: string;
200
+
201
+ createdAt?: string | null;
202
+
203
+ /**
204
+ * Default value returned when no rule matches. JSON value — type depends on
205
+ * `type`.
206
+ */
207
+ defaultValue?: { [key: string]: unknown };
208
+
209
+ enabled?: boolean | null;
210
+
211
+ /**
212
+ * Folder this variable belongs to. Read-only on this endpoint — use the GraphQL
213
+ * `assignTagManagerAssetToFolder` mutation to change.
214
+ */
215
+ folderId?: string | null;
216
+
217
+ /**
218
+ * Optional lookup table for `LookUpTable`-style variables. JSON value.
219
+ */
220
+ lookUpTable?: { [key: string]: unknown };
221
+
222
+ updatedAt?: string | null;
223
+ }
224
+
225
+ export interface TagManagerVariableUpdateResponse {
226
+ id: string;
227
+
228
+ accountId: string;
229
+
230
+ name: string;
231
+
232
+ /**
233
+ * Type-specific configuration.
234
+ */
235
+ parameters: { [key: string]: unknown };
236
+
237
+ tagManagerId: string;
238
+
239
+ /**
240
+ * Variable type (e.g. `DataLayer`, `Constant`, `LookUpTable`).
241
+ */
242
+ type: string;
243
+
244
+ /**
245
+ * Variable implementation identifier (typically equals `type`).
246
+ */
247
+ Variable: string;
248
+
249
+ createdAt?: string | null;
250
+
251
+ /**
252
+ * Default value returned when no rule matches. JSON value — type depends on
253
+ * `type`.
254
+ */
255
+ defaultValue?: { [key: string]: unknown };
256
+
257
+ enabled?: boolean | null;
258
+
259
+ /**
260
+ * Folder this variable belongs to. Read-only on this endpoint — use the GraphQL
261
+ * `assignTagManagerAssetToFolder` mutation to change.
262
+ */
263
+ folderId?: string | null;
264
+
265
+ /**
266
+ * Optional lookup table for `LookUpTable`-style variables. JSON value.
267
+ */
268
+ lookUpTable?: { [key: string]: unknown };
269
+
270
+ updatedAt?: string | null;
271
+ }
272
+
273
+ export interface TagManagerVariableDeleteResponse {
274
+ id: string;
275
+
276
+ deleted: boolean;
277
+ }
278
+
279
+ export interface TagManagerVariableTypesResponse {
280
+ entities: Array<TagManagerVariableTypesResponse.Entity>;
281
+ }
282
+
283
+ export namespace TagManagerVariableTypesResponse {
284
+ export interface Entity {
285
+ /**
286
+ * Type discriminator — pass this as `type` on create/patch.
287
+ */
288
+ id: string;
289
+
290
+ /**
291
+ * Grouping label.
292
+ */
293
+ category: string;
294
+
295
+ fields: Array<Entity.Field>;
296
+
297
+ /**
298
+ * Human-readable display name.
299
+ */
300
+ name: string;
301
+
302
+ description?: string | null;
303
+
304
+ /**
305
+ * When `true`, this variable type's parameter fields can themselves contain
306
+ * `{{OtherVariable}}` references that the SDK resolves at runtime.
307
+ */
308
+ supportsVariables?: boolean | null;
309
+ }
310
+
311
+ export namespace Entity {
312
+ export interface Field {
313
+ /**
314
+ * Parameter key that goes in the `parameters` payload at create/patch.
315
+ */
316
+ id: string;
317
+
318
+ /**
319
+ * Human-readable title for the field.
320
+ */
321
+ title: string;
322
+
323
+ /**
324
+ * Underlying data type of the parameter value.
325
+ */
326
+ type: 'STRING' | 'BOOLEAN' | 'INTEGER' | 'FLOAT' | 'TABLE';
327
+
328
+ /**
329
+ * For TABLE-typed fields, the predefined keys each row may contain.
330
+ */
331
+ allowedKeys?: Array<string> | null;
332
+
333
+ /**
334
+ * When present, the field accepts only one of these values. Send the `value`
335
+ * string in `parameters`; the `label` is for display.
336
+ */
337
+ availableValues?: Array<Field.AvailableValue> | null;
338
+
339
+ /**
340
+ * Default value when the caller omits the parameter on create.
341
+ */
342
+ default?: { [key: string]: unknown };
343
+
344
+ description?: string | null;
345
+
346
+ /**
347
+ * When `true`, omitting or sending an empty value for this parameter on
348
+ * create/patch returns HTTP 400.
349
+ */
350
+ required?: boolean | null;
351
+
352
+ /**
353
+ * Server-enforced rules applied to this field at create and patch.
354
+ */
355
+ validators?: Array<Field.Validator> | null;
356
+ }
357
+
358
+ export namespace Field {
359
+ export interface AvailableValue {
360
+ label: string;
361
+
362
+ value: string;
363
+ }
364
+
365
+ export interface Validator {
366
+ type: 'NotEmpty' | 'CharacterLength' | 'Url' | 'Email' | 'Number' | 'Range';
367
+
368
+ max?: number | null;
369
+
370
+ min?: number | null;
371
+ }
372
+ }
373
+ }
374
+ }
375
+
376
+ export interface TagManagerVariableListParams extends CursorParams {
377
+ /**
378
+ * Parent tag manager whose variables should be returned.
379
+ */
380
+ tagManagerId: string;
381
+ }
382
+
383
+ export interface TagManagerVariableCreateParams {
384
+ name: string;
385
+
386
+ /**
387
+ * Type-specific JSON configuration.
388
+ */
389
+ parameters: { [key: string]: unknown };
390
+
391
+ /**
392
+ * Parent tag manager that will own the new variable.
393
+ */
394
+ tagManagerId: string;
395
+
396
+ /**
397
+ * Variable type discriminator.
398
+ */
399
+ type: string;
400
+
401
+ /**
402
+ * Variable implementation identifier (typically equals `type`).
403
+ */
404
+ Variable: string;
405
+
406
+ /**
407
+ * Optional default value. JSON value of any type.
408
+ */
409
+ defaultValue?: { [key: string]: unknown } | null;
410
+
411
+ enabled?: boolean | null;
412
+
413
+ /**
414
+ * Optional lookup table for `LookUpTable` variables.
415
+ */
416
+ lookUpTable?: { [key: string]: unknown } | null;
417
+ }
418
+
419
+ export interface TagManagerVariableUpdateParams {
420
+ /**
421
+ * Updated default value. JSON value of any type.
422
+ */
423
+ defaultValue?: { [key: string]: unknown } | null;
424
+
425
+ /**
426
+ * Pause/resume the variable without changing other fields.
427
+ */
428
+ enabled?: boolean | null;
429
+
430
+ /**
431
+ * Updated lookup table payload.
432
+ */
433
+ lookUpTable?: { [key: string]: unknown } | null;
434
+
435
+ /**
436
+ * Updated variable name.
437
+ */
438
+ name?: string;
439
+
440
+ /**
441
+ * Updated type-specific JSON configuration.
442
+ */
443
+ parameters?: { [key: string]: unknown };
444
+
445
+ /**
446
+ * Updated variable type.
447
+ */
448
+ type?: string;
449
+
450
+ /**
451
+ * Updated variable implementation identifier.
452
+ */
453
+ Variable?: string;
454
+ }
455
+
456
+ export declare namespace TagManagerVariables {
457
+ export {
458
+ type TagManagerVariableListResponse as TagManagerVariableListResponse,
459
+ type TagManagerVariableCreateResponse as TagManagerVariableCreateResponse,
460
+ type TagManagerVariableRetrieveResponse as TagManagerVariableRetrieveResponse,
461
+ type TagManagerVariableUpdateResponse as TagManagerVariableUpdateResponse,
462
+ type TagManagerVariableDeleteResponse as TagManagerVariableDeleteResponse,
463
+ type TagManagerVariableTypesResponse as TagManagerVariableTypesResponse,
464
+ type TagManagerVariableListResponsesCursor as TagManagerVariableListResponsesCursor,
465
+ type TagManagerVariableListParams as TagManagerVariableListParams,
466
+ type TagManagerVariableCreateParams as TagManagerVariableCreateParams,
467
+ type TagManagerVariableUpdateParams as TagManagerVariableUpdateParams,
468
+ };
469
+ }