@oursprivacy/platform-sdk 1.21.0 → 1.23.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 (112) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +8 -8
  3. package/client.d.mts +16 -19
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +16 -19
  6. package/client.d.ts.map +1 -1
  7. package/client.js +8 -11
  8. package/client.js.map +1 -1
  9. package/client.mjs +8 -11
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/allowed-events.d.mts +206 -5
  13. package/resources/allowed-events.d.mts.map +1 -1
  14. package/resources/allowed-events.d.ts +206 -5
  15. package/resources/allowed-events.d.ts.map +1 -1
  16. package/resources/allowed-events.js +48 -4
  17. package/resources/allowed-events.js.map +1 -1
  18. package/resources/allowed-events.mjs +48 -4
  19. package/resources/allowed-events.mjs.map +1 -1
  20. package/resources/consent-analytics.d.mts +57 -0
  21. package/resources/consent-analytics.d.mts.map +1 -0
  22. package/resources/consent-analytics.d.ts +57 -0
  23. package/resources/consent-analytics.d.ts.map +1 -0
  24. package/resources/consent-analytics.js +22 -0
  25. package/resources/consent-analytics.js.map +1 -0
  26. package/resources/consent-analytics.mjs +18 -0
  27. package/resources/consent-analytics.mjs.map +1 -0
  28. package/resources/consent-settings.d.mts +198 -1
  29. package/resources/consent-settings.d.mts.map +1 -1
  30. package/resources/consent-settings.d.ts +198 -1
  31. package/resources/consent-settings.d.ts.map +1 -1
  32. package/resources/consent-settings.js +40 -0
  33. package/resources/consent-settings.js.map +1 -1
  34. package/resources/consent-settings.mjs +40 -0
  35. package/resources/consent-settings.mjs.map +1 -1
  36. package/resources/data-governance.d.mts +793 -0
  37. package/resources/data-governance.d.mts.map +1 -0
  38. package/resources/data-governance.d.ts +793 -0
  39. package/resources/data-governance.d.ts.map +1 -0
  40. package/resources/data-governance.js +70 -0
  41. package/resources/data-governance.js.map +1 -0
  42. package/resources/data-governance.mjs +66 -0
  43. package/resources/data-governance.mjs.map +1 -0
  44. package/resources/default-mappings.d.mts +60 -3
  45. package/resources/default-mappings.d.mts.map +1 -1
  46. package/resources/default-mappings.d.ts +60 -3
  47. package/resources/default-mappings.d.ts.map +1 -1
  48. package/resources/destinations.d.mts +78 -5
  49. package/resources/destinations.d.mts.map +1 -1
  50. package/resources/destinations.d.ts +78 -5
  51. package/resources/destinations.d.ts.map +1 -1
  52. package/resources/destinations.js +11 -0
  53. package/resources/destinations.js.map +1 -1
  54. package/resources/destinations.mjs +11 -0
  55. package/resources/destinations.mjs.map +1 -1
  56. package/resources/index.d.mts +6 -7
  57. package/resources/index.d.mts.map +1 -1
  58. package/resources/index.d.ts +6 -7
  59. package/resources/index.d.ts.map +1 -1
  60. package/resources/index.js +5 -7
  61. package/resources/index.js.map +1 -1
  62. package/resources/index.mjs +2 -3
  63. package/resources/index.mjs.map +1 -1
  64. package/resources/mappings.d.mts +362 -16
  65. package/resources/mappings.d.mts.map +1 -1
  66. package/resources/mappings.d.ts +362 -16
  67. package/resources/mappings.d.ts.map +1 -1
  68. package/resources/mappings.js +41 -0
  69. package/resources/mappings.js.map +1 -1
  70. package/resources/mappings.mjs +41 -0
  71. package/resources/mappings.mjs.map +1 -1
  72. package/src/client.ts +75 -60
  73. package/src/resources/allowed-events.ts +232 -4
  74. package/src/resources/consent-analytics.ts +76 -0
  75. package/src/resources/consent-settings.ts +272 -0
  76. package/src/resources/data-governance.ts +1091 -0
  77. package/src/resources/default-mappings.ts +60 -3
  78. package/src/resources/destinations.ts +189 -4
  79. package/src/resources/index.ts +31 -22
  80. package/src/resources/mappings.ts +517 -15
  81. package/src/version.ts +1 -1
  82. package/version.d.mts +1 -1
  83. package/version.d.ts +1 -1
  84. package/version.js +1 -1
  85. package/version.mjs +1 -1
  86. package/resources/destination-types.d.mts +0 -146
  87. package/resources/destination-types.d.mts.map +0 -1
  88. package/resources/destination-types.d.ts +0 -146
  89. package/resources/destination-types.d.ts.map +0 -1
  90. package/resources/destination-types.js +0 -28
  91. package/resources/destination-types.js.map +0 -1
  92. package/resources/destination-types.mjs +0 -24
  93. package/resources/destination-types.mjs.map +0 -1
  94. package/resources/global-dispatch-centers.d.mts +0 -349
  95. package/resources/global-dispatch-centers.d.mts.map +0 -1
  96. package/resources/global-dispatch-centers.d.ts +0 -349
  97. package/resources/global-dispatch-centers.d.ts.map +0 -1
  98. package/resources/global-dispatch-centers.js +0 -43
  99. package/resources/global-dispatch-centers.js.map +0 -1
  100. package/resources/global-dispatch-centers.mjs +0 -39
  101. package/resources/global-dispatch-centers.mjs.map +0 -1
  102. package/resources/mapping-templates.d.mts +0 -101
  103. package/resources/mapping-templates.d.mts.map +0 -1
  104. package/resources/mapping-templates.d.ts +0 -101
  105. package/resources/mapping-templates.d.ts.map +0 -1
  106. package/resources/mapping-templates.js +0 -22
  107. package/resources/mapping-templates.js.map +0 -1
  108. package/resources/mapping-templates.mjs +0 -18
  109. package/resources/mapping-templates.mjs.map +0 -1
  110. package/src/resources/destination-types.ts +0 -373
  111. package/src/resources/global-dispatch-centers.ts +0 -458
  112. package/src/resources/mapping-templates.ts +0 -203
@@ -72,6 +72,51 @@ export class Mappings extends APIResource {
72
72
  reorder(body: MappingReorderParams, options?: RequestOptions): APIPromise<MappingReorderResponse> {
73
73
  return this._client.post('/rest/v1/mappings/reorder', { body, ...options });
74
74
  }
75
+
76
+ /**
77
+ * Discover every mapping template available for a destination or source, with full
78
+ * property descriptors inlined. Use the returned `id` as `templateId` when calling
79
+ * `POST /rest/v1/mappings` (template fat-create variant), and use each entry under
80
+ * `mappings[]` to learn the valid `property`, `kind`, `modificationOptions`, and
81
+ * any enforced `options`. The `isDefault: true` entry is the destination's
82
+ * built-in default template (the one stored at `MAPPER#{destinationId}` when
83
+ * configured via `PUT /rest/v1/default-mappings/{destinationId}`). Requires scope:
84
+ * mapping:find
85
+ */
86
+ templates(query: MappingTemplatesParams, options?: RequestOptions): APIPromise<MappingTemplatesResponse> {
87
+ return this._client.get('/rest/v1/mappings/templates', { query, ...options });
88
+ }
89
+
90
+ /**
91
+ * Lists the platform-provided variables that any mapping `value` can reference
92
+ * (e.g. `event.email`, `event.request_context.ip`, `visitor.id`). Account-agnostic
93
+ * discovery — use these paths as the right-hand side of a mapping field. Requires
94
+ * scope: variables:find-default
95
+ */
96
+ defaultVariables(options?: RequestOptions): APIPromise<MappingDefaultVariablesResponse> {
97
+ return this._client.get('/rest/v1/mappings/default-variables', options);
98
+ }
99
+
100
+ /**
101
+ * Lists the custom variables observed in this account’s recent event stream (last
102
+ * 14 days). These are dot-paths under `event.event_properties.*` that callers can
103
+ * target in mapping `value` fields. The result is cached for 10 minutes; an empty
104
+ * list means no custom properties have been seen yet for this account. Requires
105
+ * scope: variables:find-custom
106
+ */
107
+ customVariables(options?: RequestOptions): APIPromise<MappingCustomVariablesResponse> {
108
+ return this._client.get('/rest/v1/mappings/custom-variables', options);
109
+ }
110
+
111
+ /**
112
+ * Lists every value accepted on a mapping field’s `modification` property, with a
113
+ * human-readable label and one-sentence description. Account-agnostic. Use this
114
+ * alongside `GET /rest/v1/mapping-templates` to render a labelled modification
115
+ * picker without hardcoding the enum. Requires scope: variables:find-default
116
+ */
117
+ modifications(options?: RequestOptions): APIPromise<MappingModificationsResponse> {
118
+ return this._client.get('/rest/v1/mappings/modifications', options);
119
+ }
75
120
  }
76
121
 
77
122
  export type MappingListResponsesCursor = Cursor<MappingListResponse>;
@@ -90,8 +135,11 @@ export interface MappingListResponse {
90
135
  /**
91
136
  * Condition tree gating when this mapping fires. A node is either a leaf
92
137
  * `condition` or a combinator (`AND`, `OR`, `NOT`). Combinator children are
93
- * themselves `MappingLogic` nodes, so trees nest arbitrarily. Example leaf:
138
+ * themselves logic nodes, so trees nest arbitrarily.
139
+ *
140
+ * Example leaf:
94
141
  * `{ "condition": { "property": "$event.event", "operator": "Is", "value": "page_view" } }`.
142
+ *
95
143
  * Example combinator: `{ "AND": [{ "condition": ... }, { "OR": [...] }] }`.
96
144
  */
97
145
  logic?: unknown;
@@ -111,8 +159,20 @@ export interface MappingListResponse {
111
159
 
112
160
  export namespace MappingListResponse {
113
161
  export interface Mapping {
162
+ /**
163
+ * Source expression sent to the destination for this `property`. Use `{{...}}`
164
+ * template syntax to substitute values from the event/visitor record:
165
+ * `{{event.event}}`, `{{event.event_properties.value}}`, `{{visitor.email}}`. Bare
166
+ * strings (no `{{}}`) are sent verbatim. Note: `{{...}}` template syntax belongs
167
+ * HERE, NOT in `logic.condition.property` — logic conditions use bare dotted paths
168
+ * like `$event.event_properties.value`.
169
+ */
114
170
  map: string;
115
171
 
172
+ /**
173
+ * Destination-side field name. Comes from the destination template — discover the
174
+ * valid set via `GET /rest/v1/mapping-templates?entityId=...`.
175
+ */
116
176
  property: string;
117
177
 
118
178
  modification?:
@@ -163,8 +223,11 @@ export interface MappingCreateResponse {
163
223
  /**
164
224
  * Condition tree gating when this mapping fires. A node is either a leaf
165
225
  * `condition` or a combinator (`AND`, `OR`, `NOT`). Combinator children are
166
- * themselves `MappingLogic` nodes, so trees nest arbitrarily. Example leaf:
226
+ * themselves logic nodes, so trees nest arbitrarily.
227
+ *
228
+ * Example leaf:
167
229
  * `{ "condition": { "property": "$event.event", "operator": "Is", "value": "page_view" } }`.
230
+ *
168
231
  * Example combinator: `{ "AND": [{ "condition": ... }, { "OR": [...] }] }`.
169
232
  */
170
233
  logic?: unknown;
@@ -184,8 +247,20 @@ export interface MappingCreateResponse {
184
247
 
185
248
  export namespace MappingCreateResponse {
186
249
  export interface Mapping {
250
+ /**
251
+ * Source expression sent to the destination for this `property`. Use `{{...}}`
252
+ * template syntax to substitute values from the event/visitor record:
253
+ * `{{event.event}}`, `{{event.event_properties.value}}`, `{{visitor.email}}`. Bare
254
+ * strings (no `{{}}`) are sent verbatim. Note: `{{...}}` template syntax belongs
255
+ * HERE, NOT in `logic.condition.property` — logic conditions use bare dotted paths
256
+ * like `$event.event_properties.value`.
257
+ */
187
258
  map: string;
188
259
 
260
+ /**
261
+ * Destination-side field name. Comes from the destination template — discover the
262
+ * valid set via `GET /rest/v1/mapping-templates?entityId=...`.
263
+ */
189
264
  property: string;
190
265
 
191
266
  modification?:
@@ -236,8 +311,11 @@ export interface MappingRetrieveResponse {
236
311
  /**
237
312
  * Condition tree gating when this mapping fires. A node is either a leaf
238
313
  * `condition` or a combinator (`AND`, `OR`, `NOT`). Combinator children are
239
- * themselves `MappingLogic` nodes, so trees nest arbitrarily. Example leaf:
314
+ * themselves logic nodes, so trees nest arbitrarily.
315
+ *
316
+ * Example leaf:
240
317
  * `{ "condition": { "property": "$event.event", "operator": "Is", "value": "page_view" } }`.
318
+ *
241
319
  * Example combinator: `{ "AND": [{ "condition": ... }, { "OR": [...] }] }`.
242
320
  */
243
321
  logic?: unknown;
@@ -257,8 +335,20 @@ export interface MappingRetrieveResponse {
257
335
 
258
336
  export namespace MappingRetrieveResponse {
259
337
  export interface Mapping {
338
+ /**
339
+ * Source expression sent to the destination for this `property`. Use `{{...}}`
340
+ * template syntax to substitute values from the event/visitor record:
341
+ * `{{event.event}}`, `{{event.event_properties.value}}`, `{{visitor.email}}`. Bare
342
+ * strings (no `{{}}`) are sent verbatim. Note: `{{...}}` template syntax belongs
343
+ * HERE, NOT in `logic.condition.property` — logic conditions use bare dotted paths
344
+ * like `$event.event_properties.value`.
345
+ */
260
346
  map: string;
261
347
 
348
+ /**
349
+ * Destination-side field name. Comes from the destination template — discover the
350
+ * valid set via `GET /rest/v1/mapping-templates?entityId=...`.
351
+ */
262
352
  property: string;
263
353
 
264
354
  modification?:
@@ -309,8 +399,11 @@ export interface MappingUpdateResponse {
309
399
  /**
310
400
  * Condition tree gating when this mapping fires. A node is either a leaf
311
401
  * `condition` or a combinator (`AND`, `OR`, `NOT`). Combinator children are
312
- * themselves `MappingLogic` nodes, so trees nest arbitrarily. Example leaf:
402
+ * themselves logic nodes, so trees nest arbitrarily.
403
+ *
404
+ * Example leaf:
313
405
  * `{ "condition": { "property": "$event.event", "operator": "Is", "value": "page_view" } }`.
406
+ *
314
407
  * Example combinator: `{ "AND": [{ "condition": ... }, { "OR": [...] }] }`.
315
408
  */
316
409
  logic?: unknown;
@@ -330,8 +423,20 @@ export interface MappingUpdateResponse {
330
423
 
331
424
  export namespace MappingUpdateResponse {
332
425
  export interface Mapping {
426
+ /**
427
+ * Source expression sent to the destination for this `property`. Use `{{...}}`
428
+ * template syntax to substitute values from the event/visitor record:
429
+ * `{{event.event}}`, `{{event.event_properties.value}}`, `{{visitor.email}}`. Bare
430
+ * strings (no `{{}}`) are sent verbatim. Note: `{{...}}` template syntax belongs
431
+ * HERE, NOT in `logic.condition.property` — logic conditions use bare dotted paths
432
+ * like `$event.event_properties.value`.
433
+ */
333
434
  map: string;
334
435
 
436
+ /**
437
+ * Destination-side field name. Comes from the destination template — discover the
438
+ * valid set via `GET /rest/v1/mapping-templates?entityId=...`.
439
+ */
335
440
  property: string;
336
441
 
337
442
  modification?:
@@ -389,8 +494,11 @@ export namespace MappingReorderResponse {
389
494
  /**
390
495
  * Condition tree gating when this mapping fires. A node is either a leaf
391
496
  * `condition` or a combinator (`AND`, `OR`, `NOT`). Combinator children are
392
- * themselves `MappingLogic` nodes, so trees nest arbitrarily. Example leaf:
497
+ * themselves logic nodes, so trees nest arbitrarily.
498
+ *
499
+ * Example leaf:
393
500
  * `{ "condition": { "property": "$event.event", "operator": "Is", "value": "page_view" } }`.
501
+ *
394
502
  * Example combinator: `{ "AND": [{ "condition": ... }, { "OR": [...] }] }`.
395
503
  */
396
504
  logic?: unknown;
@@ -410,8 +518,20 @@ export namespace MappingReorderResponse {
410
518
 
411
519
  export namespace Entity {
412
520
  export interface Mapping {
521
+ /**
522
+ * Source expression sent to the destination for this `property`. Use `{{...}}`
523
+ * template syntax to substitute values from the event/visitor record:
524
+ * `{{event.event}}`, `{{event.event_properties.value}}`, `{{visitor.email}}`. Bare
525
+ * strings (no `{{}}`) are sent verbatim. Note: `{{...}}` template syntax belongs
526
+ * HERE, NOT in `logic.condition.property` — logic conditions use bare dotted paths
527
+ * like `$event.event_properties.value`.
528
+ */
413
529
  map: string;
414
530
 
531
+ /**
532
+ * Destination-side field name. Comes from the destination template — discover the
533
+ * valid set via `GET /rest/v1/mapping-templates?entityId=...`.
534
+ */
415
535
  property: string;
416
536
 
417
537
  modification?:
@@ -449,6 +569,292 @@ export namespace MappingReorderResponse {
449
569
  }
450
570
  }
451
571
 
572
+ export interface MappingTemplatesResponse {
573
+ entities: Array<MappingTemplatesResponse.Entity>;
574
+ }
575
+
576
+ export namespace MappingTemplatesResponse {
577
+ export interface Entity {
578
+ /**
579
+ * Template identifier — pass to `POST /rest/v1/mappings` as `templateId`.
580
+ */
581
+ id: string;
582
+
583
+ /**
584
+ * True for the destination's built-in default template (the one stored at
585
+ * `MAPPER#{destinationId}` when configured). Sources only have one template; it is
586
+ * always default.
587
+ */
588
+ isDefault: boolean;
589
+
590
+ mappings: Array<Entity.Mapping>;
591
+
592
+ name: string;
593
+
594
+ description?: string | null;
595
+ }
596
+
597
+ export namespace Entity {
598
+ export interface Mapping {
599
+ /**
600
+ * Long-form description / tooltip for this property.
601
+ */
602
+ description: string | null;
603
+
604
+ isPII: boolean;
605
+
606
+ /**
607
+ * Type information for SDK validation (Text, Integer, Email, Url, IP, Object,
608
+ * KnownObject, Date, DateTime, Array, Boolean, JSON).
609
+ */
610
+ kind:
611
+ | 'Array'
612
+ | 'Boolean'
613
+ | 'Date'
614
+ | 'DateTime'
615
+ | 'Email'
616
+ | 'IP'
617
+ | 'Integer'
618
+ | 'JSON'
619
+ | 'KnownObject'
620
+ | 'Object'
621
+ | 'Text'
622
+ | 'Url';
623
+
624
+ /**
625
+ * Human-readable label (e.g. "Email", "Event Name").
626
+ */
627
+ label: string;
628
+
629
+ /**
630
+ * The template default source expression, e.g. `{{visitor.email}}`.
631
+ */
632
+ map: string;
633
+
634
+ /**
635
+ * The value to send as `mappings[].property` when creating or patching a mapping.
636
+ */
637
+ property: string;
638
+
639
+ required: boolean;
640
+
641
+ /**
642
+ * The template default modification (hashing / case / URL truncation).
643
+ */
644
+ modification?:
645
+ | 'CamelCase'
646
+ | 'DmaIP'
647
+ | 'DomainOnly'
648
+ | 'DomainPathOnly'
649
+ | 'DomainPathUTMs'
650
+ | 'DomainUTMs'
651
+ | 'FakeDomain'
652
+ | 'FakeDomainRealPath'
653
+ | 'FakeIP'
654
+ | 'FullUrl'
655
+ | 'Hash'
656
+ | 'HashMD5'
657
+ | 'HashedCountry'
658
+ | 'HashedDateOfBirth'
659
+ | 'HashedGender'
660
+ | 'HashedNormalized'
661
+ | 'HashedNormalizedNoSpecialChars'
662
+ | 'HashedPhone'
663
+ | 'HashedState'
664
+ | 'HashedZip'
665
+ | 'KebabCase'
666
+ | 'LowerCase'
667
+ | 'None'
668
+ | 'Null'
669
+ | 'Redacted'
670
+ | 'RegionalIP'
671
+ | 'SnakeCase'
672
+ | 'StartCase'
673
+ | 'UpperCase'
674
+ | null;
675
+
676
+ /**
677
+ * Suggested modification options for this property. Not a whitelist.
678
+ */
679
+ modificationOptions?: Array<
680
+ | 'CamelCase'
681
+ | 'DmaIP'
682
+ | 'DomainOnly'
683
+ | 'DomainPathOnly'
684
+ | 'DomainPathUTMs'
685
+ | 'DomainUTMs'
686
+ | 'FakeDomain'
687
+ | 'FakeDomainRealPath'
688
+ | 'FakeIP'
689
+ | 'FullUrl'
690
+ | 'Hash'
691
+ | 'HashMD5'
692
+ | 'HashedCountry'
693
+ | 'HashedDateOfBirth'
694
+ | 'HashedGender'
695
+ | 'HashedNormalized'
696
+ | 'HashedNormalizedNoSpecialChars'
697
+ | 'HashedPhone'
698
+ | 'HashedState'
699
+ | 'HashedZip'
700
+ | 'KebabCase'
701
+ | 'LowerCase'
702
+ | 'None'
703
+ | 'Null'
704
+ | 'Redacted'
705
+ | 'RegionalIP'
706
+ | 'SnakeCase'
707
+ | 'StartCase'
708
+ | 'UpperCase'
709
+ > | null;
710
+
711
+ /**
712
+ * When set, the ONLY valid `map` values for this property. Typically used for
713
+ * enum-shaped destinations.
714
+ */
715
+ options?: Array<Mapping.Option> | null;
716
+
717
+ /**
718
+ * Non-binding suggestions for the `map` value (e.g. common event names a customer
719
+ * might want to use).
720
+ */
721
+ suggestedOptions?: Array<Mapping.SuggestedOption> | null;
722
+ }
723
+
724
+ export namespace Mapping {
725
+ export interface Option {
726
+ label: string;
727
+
728
+ value: string;
729
+ }
730
+
731
+ export interface SuggestedOption {
732
+ label: string;
733
+
734
+ value: string;
735
+ }
736
+ }
737
+ }
738
+ }
739
+
740
+ export interface MappingDefaultVariablesResponse {
741
+ entities: Array<MappingDefaultVariablesResponse.Entity>;
742
+ }
743
+
744
+ export namespace MappingDefaultVariablesResponse {
745
+ export interface Entity {
746
+ /**
747
+ * Sample values observed for this path (empty for unsampled defaults).
748
+ */
749
+ examples: Array<string>;
750
+
751
+ /**
752
+ * Human-readable display name.
753
+ */
754
+ name: string;
755
+
756
+ /**
757
+ * Dot-path used in mapping `value` fields (e.g. `event.email`).
758
+ */
759
+ path: string;
760
+
761
+ /**
762
+ * Relative popularity rank. Higher means more frequently set across events.
763
+ */
764
+ popularity: number;
765
+
766
+ /**
767
+ * Optional long-form context shown in the variable dictionary drawer.
768
+ */
769
+ advancedInfo?: string | null;
770
+ }
771
+ }
772
+
773
+ export interface MappingCustomVariablesResponse {
774
+ entities: Array<MappingCustomVariablesResponse.Entity>;
775
+ }
776
+
777
+ export namespace MappingCustomVariablesResponse {
778
+ export interface Entity {
779
+ /**
780
+ * Sample values observed for this path (empty for unsampled defaults).
781
+ */
782
+ examples: Array<string>;
783
+
784
+ /**
785
+ * Human-readable display name.
786
+ */
787
+ name: string;
788
+
789
+ /**
790
+ * Dot-path used in mapping `value` fields (e.g. `event.email`).
791
+ */
792
+ path: string;
793
+
794
+ /**
795
+ * Relative popularity rank. Higher means more frequently set across events.
796
+ */
797
+ popularity: number;
798
+
799
+ /**
800
+ * Optional long-form context shown in the variable dictionary drawer.
801
+ */
802
+ advancedInfo?: string | null;
803
+ }
804
+ }
805
+
806
+ export interface MappingModificationsResponse {
807
+ entities: Array<MappingModificationsResponse.Entity>;
808
+ }
809
+
810
+ export namespace MappingModificationsResponse {
811
+ export interface Entity {
812
+ /**
813
+ * One-sentence explanation of what the modification does to the mapped value.
814
+ */
815
+ description: string;
816
+
817
+ /**
818
+ * Short human-readable name (suitable for picker labels).
819
+ */
820
+ label: string;
821
+
822
+ /**
823
+ * Enum value to send on `modification` fields when authoring a mapping.
824
+ */
825
+ value:
826
+ | 'CamelCase'
827
+ | 'DmaIP'
828
+ | 'DomainOnly'
829
+ | 'DomainPathOnly'
830
+ | 'DomainPathUTMs'
831
+ | 'DomainUTMs'
832
+ | 'FakeDomain'
833
+ | 'FakeDomainRealPath'
834
+ | 'FakeIP'
835
+ | 'FullUrl'
836
+ | 'Hash'
837
+ | 'HashMD5'
838
+ | 'HashedCountry'
839
+ | 'HashedDateOfBirth'
840
+ | 'HashedGender'
841
+ | 'HashedNormalized'
842
+ | 'HashedNormalizedNoSpecialChars'
843
+ | 'HashedPhone'
844
+ | 'HashedState'
845
+ | 'HashedZip'
846
+ | 'KebabCase'
847
+ | 'LowerCase'
848
+ | 'None'
849
+ | 'Null'
850
+ | 'Redacted'
851
+ | 'RegionalIP'
852
+ | 'SnakeCase'
853
+ | 'StartCase'
854
+ | 'UpperCase';
855
+ }
856
+ }
857
+
452
858
  export interface MappingListParams extends CursorParams {
453
859
  /**
454
860
  * Filter mappings by their parent entity id. Must be a destination id or source
@@ -490,8 +896,11 @@ export interface MappingCreateParams {
490
896
  /**
491
897
  * Condition tree gating when this mapping fires. A node is either a leaf
492
898
  * `condition` or a combinator (`AND`, `OR`, `NOT`). Combinator children are
493
- * themselves `MappingLogic` nodes, so trees nest arbitrarily. Example leaf:
899
+ * themselves logic nodes, so trees nest arbitrarily.
900
+ *
901
+ * Example leaf:
494
902
  * `{ "condition": { "property": "$event.event", "operator": "Is", "value": "page_view" } }`.
903
+ *
495
904
  * Example combinator: `{ "AND": [{ "condition": ... }, { "OR": [...] }] }`.
496
905
  */
497
906
  logic?: MappingCreateParams.Logic;
@@ -520,31 +929,46 @@ export namespace MappingCreateParams {
520
929
  /**
521
930
  * Condition tree gating when this mapping fires. A node is either a leaf
522
931
  * `condition` or a combinator (`AND`, `OR`, `NOT`). Combinator children are
523
- * themselves `MappingLogic` nodes, so trees nest arbitrarily. Example leaf:
932
+ * themselves logic nodes, so trees nest arbitrarily.
933
+ *
934
+ * Example leaf:
524
935
  * `{ "condition": { "property": "$event.event", "operator": "Is", "value": "page_view" } }`.
936
+ *
525
937
  * Example combinator: `{ "AND": [{ "condition": ... }, { "OR": [...] }] }`.
526
938
  */
527
939
  export interface Logic {
528
940
  /**
529
- * All child nodes must match. Each child is a `MappingLogic` node.
941
+ * All child nodes must match. Each child is itself a logic node (leaf `condition`
942
+ * or combinator).
530
943
  */
531
944
  AND?: Array<unknown> | null;
532
945
 
533
946
  condition?: Logic.Condition;
534
947
 
535
948
  /**
536
- * Negates a single child `MappingLogic` node.
949
+ * Negates a single child logic node.
537
950
  */
538
951
  NOT?: unknown;
539
952
 
540
953
  /**
541
- * Any child node must match. Each child is a `MappingLogic` node.
954
+ * Any child node must match. Each child is itself a logic node (leaf `condition`
955
+ * or combinator).
542
956
  */
543
957
  OR?: Array<unknown> | null;
544
958
  }
545
959
 
546
960
  export namespace Logic {
547
961
  export interface Condition {
962
+ /**
963
+ * Comparison verb in PascalCase. Equality/text: `Is`, `IsNot`, `Contains`,
964
+ * `DoesNotContain`, `StartsWith`, `EndsWith`. Truthiness/nullability: `IsFalsy`,
965
+ * `IsTruthy`, `IsNull`, `IsNotNull`, `IsUndefined`, `IsNotUndefined`, `IsTrue`,
966
+ * `IsFalse`. Numeric: `IsGreaterThan`, `IsGreaterThanOrEqual`, `IsLessThan`,
967
+ * `IsLessThanOrEqual`. Set membership: `IsIn`, `IsNotIn`, `IsFoundIn`,
968
+ * `IsNotFoundIn`. Date: `IsBefore`, `IsAfter`, `IsBetween`, `IsOnOrBefore`,
969
+ * `IsOnOrAfter`. Regex: `MatchesRegex`, `MatchesRegexIgnoreCase`,
970
+ * `DoesNotMatchRegex`, `DoesNotMatchRegexIgnoreCase`.
971
+ */
548
972
  operator:
549
973
  | 'Is'
550
974
  | 'IsNot'
@@ -578,15 +1002,39 @@ export namespace MappingCreateParams {
578
1002
  | 'DoesNotMatchRegex'
579
1003
  | 'DoesNotMatchRegexIgnoreCase';
580
1004
 
1005
+ /**
1006
+ * Bare dotted path into the event/visitor record. Examples: `$event.event`,
1007
+ * `$event.event_properties.value`, `visitor.consent.marketing`. The leading `$` is
1008
+ * optional and stripped before lookup. Do **not** use `{{...}}` here — that
1009
+ * template syntax is for mapping values (`mappings[].map`), not logic conditions,
1010
+ * and would be compared as a literal string.
1011
+ */
581
1012
  property: string;
582
1013
 
1014
+ /**
1015
+ * String compared against the resolved property. Operators that take no value
1016
+ * (`IsFalsy`, `IsTruthy`, `IsNull`, `IsNotNull`, `IsUndefined`, `IsNotUndefined`,
1017
+ * `IsTrue`, `IsFalse`) ignore this field — send `""`.
1018
+ */
583
1019
  value: string;
584
1020
  }
585
1021
  }
586
1022
 
587
1023
  export interface Mapping {
1024
+ /**
1025
+ * Source expression sent to the destination for this `property`. Use `{{...}}`
1026
+ * template syntax to substitute values from the event/visitor record:
1027
+ * `{{event.event}}`, `{{event.event_properties.value}}`, `{{visitor.email}}`. Bare
1028
+ * strings (no `{{}}`) are sent verbatim. Note: `{{...}}` template syntax belongs
1029
+ * HERE, NOT in `logic.condition.property` — logic conditions use bare dotted paths
1030
+ * like `$event.event_properties.value`.
1031
+ */
588
1032
  map: string;
589
1033
 
1034
+ /**
1035
+ * Destination-side field name. Comes from the destination template — discover the
1036
+ * valid set via `GET /rest/v1/mapping-templates?entityId=...`.
1037
+ */
590
1038
  property: string;
591
1039
 
592
1040
  modification?:
@@ -633,8 +1081,11 @@ export interface MappingUpdateParams {
633
1081
  /**
634
1082
  * Condition tree gating when this mapping fires. A node is either a leaf
635
1083
  * `condition` or a combinator (`AND`, `OR`, `NOT`). Combinator children are
636
- * themselves `MappingLogic` nodes, so trees nest arbitrarily. Example leaf:
1084
+ * themselves logic nodes, so trees nest arbitrarily.
1085
+ *
1086
+ * Example leaf:
637
1087
  * `{ "condition": { "property": "$event.event", "operator": "Is", "value": "page_view" } }`.
1088
+ *
638
1089
  * Example combinator: `{ "AND": [{ "condition": ... }, { "OR": [...] }] }`.
639
1090
  */
640
1091
  logic?: MappingUpdateParams.Logic;
@@ -648,31 +1099,46 @@ export namespace MappingUpdateParams {
648
1099
  /**
649
1100
  * Condition tree gating when this mapping fires. A node is either a leaf
650
1101
  * `condition` or a combinator (`AND`, `OR`, `NOT`). Combinator children are
651
- * themselves `MappingLogic` nodes, so trees nest arbitrarily. Example leaf:
1102
+ * themselves logic nodes, so trees nest arbitrarily.
1103
+ *
1104
+ * Example leaf:
652
1105
  * `{ "condition": { "property": "$event.event", "operator": "Is", "value": "page_view" } }`.
1106
+ *
653
1107
  * Example combinator: `{ "AND": [{ "condition": ... }, { "OR": [...] }] }`.
654
1108
  */
655
1109
  export interface Logic {
656
1110
  /**
657
- * All child nodes must match. Each child is a `MappingLogic` node.
1111
+ * All child nodes must match. Each child is itself a logic node (leaf `condition`
1112
+ * or combinator).
658
1113
  */
659
1114
  AND?: Array<unknown> | null;
660
1115
 
661
1116
  condition?: Logic.Condition;
662
1117
 
663
1118
  /**
664
- * Negates a single child `MappingLogic` node.
1119
+ * Negates a single child logic node.
665
1120
  */
666
1121
  NOT?: unknown;
667
1122
 
668
1123
  /**
669
- * Any child node must match. Each child is a `MappingLogic` node.
1124
+ * Any child node must match. Each child is itself a logic node (leaf `condition`
1125
+ * or combinator).
670
1126
  */
671
1127
  OR?: Array<unknown> | null;
672
1128
  }
673
1129
 
674
1130
  export namespace Logic {
675
1131
  export interface Condition {
1132
+ /**
1133
+ * Comparison verb in PascalCase. Equality/text: `Is`, `IsNot`, `Contains`,
1134
+ * `DoesNotContain`, `StartsWith`, `EndsWith`. Truthiness/nullability: `IsFalsy`,
1135
+ * `IsTruthy`, `IsNull`, `IsNotNull`, `IsUndefined`, `IsNotUndefined`, `IsTrue`,
1136
+ * `IsFalse`. Numeric: `IsGreaterThan`, `IsGreaterThanOrEqual`, `IsLessThan`,
1137
+ * `IsLessThanOrEqual`. Set membership: `IsIn`, `IsNotIn`, `IsFoundIn`,
1138
+ * `IsNotFoundIn`. Date: `IsBefore`, `IsAfter`, `IsBetween`, `IsOnOrBefore`,
1139
+ * `IsOnOrAfter`. Regex: `MatchesRegex`, `MatchesRegexIgnoreCase`,
1140
+ * `DoesNotMatchRegex`, `DoesNotMatchRegexIgnoreCase`.
1141
+ */
676
1142
  operator:
677
1143
  | 'Is'
678
1144
  | 'IsNot'
@@ -706,15 +1172,39 @@ export namespace MappingUpdateParams {
706
1172
  | 'DoesNotMatchRegex'
707
1173
  | 'DoesNotMatchRegexIgnoreCase';
708
1174
 
1175
+ /**
1176
+ * Bare dotted path into the event/visitor record. Examples: `$event.event`,
1177
+ * `$event.event_properties.value`, `visitor.consent.marketing`. The leading `$` is
1178
+ * optional and stripped before lookup. Do **not** use `{{...}}` here — that
1179
+ * template syntax is for mapping values (`mappings[].map`), not logic conditions,
1180
+ * and would be compared as a literal string.
1181
+ */
709
1182
  property: string;
710
1183
 
1184
+ /**
1185
+ * String compared against the resolved property. Operators that take no value
1186
+ * (`IsFalsy`, `IsTruthy`, `IsNull`, `IsNotNull`, `IsUndefined`, `IsNotUndefined`,
1187
+ * `IsTrue`, `IsFalse`) ignore this field — send `""`.
1188
+ */
711
1189
  value: string;
712
1190
  }
713
1191
  }
714
1192
 
715
1193
  export interface Mapping {
1194
+ /**
1195
+ * Source expression sent to the destination for this `property`. Use `{{...}}`
1196
+ * template syntax to substitute values from the event/visitor record:
1197
+ * `{{event.event}}`, `{{event.event_properties.value}}`, `{{visitor.email}}`. Bare
1198
+ * strings (no `{{}}`) are sent verbatim. Note: `{{...}}` template syntax belongs
1199
+ * HERE, NOT in `logic.condition.property` — logic conditions use bare dotted paths
1200
+ * like `$event.event_properties.value`.
1201
+ */
716
1202
  map: string;
717
1203
 
1204
+ /**
1205
+ * Destination-side field name. Comes from the destination template — discover the
1206
+ * valid set via `GET /rest/v1/mapping-templates?entityId=...`.
1207
+ */
718
1208
  property: string;
719
1209
 
720
1210
  modification?:
@@ -759,6 +1249,13 @@ export interface MappingReorderParams {
759
1249
  uuids: Array<string>;
760
1250
  }
761
1251
 
1252
+ export interface MappingTemplatesParams {
1253
+ /**
1254
+ * Destination or source id. Required.
1255
+ */
1256
+ entityId: string;
1257
+ }
1258
+
762
1259
  export declare namespace Mappings {
763
1260
  export {
764
1261
  type MappingListResponse as MappingListResponse,
@@ -767,10 +1264,15 @@ export declare namespace Mappings {
767
1264
  type MappingUpdateResponse as MappingUpdateResponse,
768
1265
  type MappingDeleteResponse as MappingDeleteResponse,
769
1266
  type MappingReorderResponse as MappingReorderResponse,
1267
+ type MappingTemplatesResponse as MappingTemplatesResponse,
1268
+ type MappingDefaultVariablesResponse as MappingDefaultVariablesResponse,
1269
+ type MappingCustomVariablesResponse as MappingCustomVariablesResponse,
1270
+ type MappingModificationsResponse as MappingModificationsResponse,
770
1271
  type MappingListResponsesCursor as MappingListResponsesCursor,
771
1272
  type MappingListParams as MappingListParams,
772
1273
  type MappingCreateParams as MappingCreateParams,
773
1274
  type MappingUpdateParams as MappingUpdateParams,
774
1275
  type MappingReorderParams as MappingReorderParams,
1276
+ type MappingTemplatesParams as MappingTemplatesParams,
775
1277
  };
776
1278
  }