@oursprivacy/platform-sdk 1.30.0 → 1.31.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 (56) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/client.d.mts +4 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +4 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/consent-settings.d.mts +46 -0
  10. package/resources/consent-settings.d.mts.map +1 -1
  11. package/resources/consent-settings.d.ts +46 -0
  12. package/resources/consent-settings.d.ts.map +1 -1
  13. package/resources/destinations.d.mts +7 -7
  14. package/resources/destinations.d.mts.map +1 -1
  15. package/resources/destinations.d.ts +7 -7
  16. package/resources/destinations.d.ts.map +1 -1
  17. package/resources/experiments.d.mts +13 -13
  18. package/resources/experiments.d.mts.map +1 -1
  19. package/resources/experiments.d.ts +13 -13
  20. package/resources/experiments.d.ts.map +1 -1
  21. package/resources/experiments.js +3 -3
  22. package/resources/experiments.mjs +3 -3
  23. package/resources/index.d.mts +2 -2
  24. package/resources/index.d.mts.map +1 -1
  25. package/resources/index.d.ts +2 -2
  26. package/resources/index.d.ts.map +1 -1
  27. package/resources/index.js.map +1 -1
  28. package/resources/index.mjs.map +1 -1
  29. package/resources/versions.d.mts +210 -1
  30. package/resources/versions.d.mts.map +1 -1
  31. package/resources/versions.d.ts +210 -1
  32. package/resources/versions.d.ts.map +1 -1
  33. package/resources/versions.js +33 -0
  34. package/resources/versions.js.map +1 -1
  35. package/resources/versions.mjs +33 -0
  36. package/resources/versions.mjs.map +1 -1
  37. package/resources/web-scanners.d.mts +267 -1
  38. package/resources/web-scanners.d.mts.map +1 -1
  39. package/resources/web-scanners.d.ts +267 -1
  40. package/resources/web-scanners.d.ts.map +1 -1
  41. package/resources/web-scanners.js +44 -0
  42. package/resources/web-scanners.js.map +1 -1
  43. package/resources/web-scanners.mjs +44 -0
  44. package/resources/web-scanners.mjs.map +1 -1
  45. package/src/client.ts +18 -0
  46. package/src/resources/consent-settings.ts +54 -0
  47. package/src/resources/destinations.ts +9 -2
  48. package/src/resources/experiments.ts +13 -13
  49. package/src/resources/index.ts +9 -0
  50. package/src/resources/versions.ts +272 -0
  51. package/src/resources/web-scanners.ts +431 -0
  52. package/src/version.ts +1 -1
  53. package/version.d.mts +1 -1
  54. package/version.d.ts +1 -1
  55. package/version.js +1 -1
  56. package/version.mjs +1 -1
@@ -106,6 +106,45 @@ export class Versions extends APIResource {
106
106
  ): APIPromise<VersionDiffResponse> {
107
107
  return this._client.get(path`/rest/v1/versions/${id}/diff`, { query, ...options });
108
108
  }
109
+
110
+ /**
111
+ * Revert one or more pending draft changes back to the latest published version
112
+ * (the "abandon a change" action). Send a body listing the entities to revert;
113
+ * each is handled independently — a modified entity is restored to its published
114
+ * values, a deleted entity is recreated, and a newly-added entity is discarded. An
115
+ * entity that already matches the published version is left untouched and is not
116
+ * counted (a no-op). An entity present in neither the draft nor the published
117
+ * version is reported in `notFoundCount`. `remainingChanges` is the total number
118
+ * of pending draft changes left after this call, which may stay above zero when
119
+ * other unreverted changes remain.
120
+ *
121
+ * The `experiments` and `experimentVariants` collections are not supported here —
122
+ * use the experiment lifecycle endpoints (`/start`, `/stop`) for those — but
123
+ * `experimentSettings` is supported. To discard every pending change at once, use
124
+ * `POST /rest/v1/versions/draft/abandon`. (`draft` is a literal path segment
125
+ * identifying the live draft as the target.) Requires scope: version:publish
126
+ */
127
+ revert(
128
+ id: 'draft',
129
+ body: VersionRevertParams,
130
+ options?: RequestOptions,
131
+ ): APIPromise<VersionRevertResponse> {
132
+ return this._client.post(path`/rest/v1/versions/${id}/revert`, { body, ...options });
133
+ }
134
+
135
+ /**
136
+ * Abandon ALL pending draft changes, resetting every supported entity collection
137
+ * back to the latest published version. Running experiments and experiment
138
+ * variants are not affected (ship those via the experiment lifecycle endpoints),
139
+ * but experiment settings are reset. Returns HTTP 409 when there is no published
140
+ * version to revert to, or when another publish or abandon is already in flight.
141
+ * To revert only specific changes, use `POST /rest/v1/versions/draft/revert`.
142
+ * (`draft` is a literal path segment identifying the live draft as the target.)
143
+ * Requires scope: version:publish
144
+ */
145
+ abandon(id: 'draft', options?: RequestOptions): APIPromise<VersionAbandonResponse> {
146
+ return this._client.post(path`/rest/v1/versions/${id}/abandon`, options);
147
+ }
109
148
  }
110
149
 
111
150
  export type VersionListResponsesCursor = Cursor<VersionListResponse>;
@@ -273,6 +312,8 @@ export namespace VersionDiffResponse {
273
312
 
274
313
  sources: Differences.Sources;
275
314
 
315
+ tagManagers: Differences.TagManagers;
316
+
276
317
  tagManagerTags: Differences.TagManagerTags;
277
318
 
278
319
  tagManagerTriggers: Differences.TagManagerTriggers;
@@ -1984,6 +2025,137 @@ export namespace VersionDiffResponse {
1984
2025
  }
1985
2026
  }
1986
2027
 
2028
+ export interface TagManagers {
2029
+ added: Array<TagManagers.Added>;
2030
+
2031
+ /**
2032
+ * Entities present in both snapshots but with at least one field changed. `old` is
2033
+ * the snapshot of the entity in the baseline (latest published); `new` is the
2034
+ * snapshot in the comparison target (the draft).
2035
+ */
2036
+ modified: Array<TagManagers.Modified>;
2037
+
2038
+ removed: Array<TagManagers.Removed>;
2039
+ }
2040
+
2041
+ export namespace TagManagers {
2042
+ export interface Added {
2043
+ id: string;
2044
+
2045
+ /**
2046
+ * Human-readable label for the entity at the snapshot it was captured in. For most
2047
+ * collections this is the entity's `name` field; for `allowedEvents` it is a
2048
+ * computed summary of the event's key fields. Two `modified` items can therefore
2049
+ * have identical `old.name` and `new.name` even though their underlying records
2050
+ * differ — the change is in fields not surfaced by the summary. Use the `id` to
2051
+ * fetch full detail.
2052
+ */
2053
+ name?: string | null;
2054
+
2055
+ /**
2056
+ * Optional change-classifier. Currently set to `'Reordered'` on `mappings`
2057
+ * modifications when the only change is priority reordering — this lets clients
2058
+ * de-emphasize them in change-review UI. `null` for every other diff item.
2059
+ */
2060
+ summary?: string | null;
2061
+
2062
+ /**
2063
+ * Parent tag-manager id for `tagManagerTags`, `tagManagerTriggers`, and
2064
+ * `tagManagerVariables`. `null` for every other collection.
2065
+ */
2066
+ tagManagerId?: string | null;
2067
+ }
2068
+
2069
+ export interface Modified {
2070
+ new: Modified.New;
2071
+
2072
+ old: Modified.Old;
2073
+ }
2074
+
2075
+ export namespace Modified {
2076
+ export interface New {
2077
+ id: string;
2078
+
2079
+ /**
2080
+ * Human-readable label for the entity at the snapshot it was captured in. For most
2081
+ * collections this is the entity's `name` field; for `allowedEvents` it is a
2082
+ * computed summary of the event's key fields. Two `modified` items can therefore
2083
+ * have identical `old.name` and `new.name` even though their underlying records
2084
+ * differ — the change is in fields not surfaced by the summary. Use the `id` to
2085
+ * fetch full detail.
2086
+ */
2087
+ name?: string | null;
2088
+
2089
+ /**
2090
+ * Optional change-classifier. Currently set to `'Reordered'` on `mappings`
2091
+ * modifications when the only change is priority reordering — this lets clients
2092
+ * de-emphasize them in change-review UI. `null` for every other diff item.
2093
+ */
2094
+ summary?: string | null;
2095
+
2096
+ /**
2097
+ * Parent tag-manager id for `tagManagerTags`, `tagManagerTriggers`, and
2098
+ * `tagManagerVariables`. `null` for every other collection.
2099
+ */
2100
+ tagManagerId?: string | null;
2101
+ }
2102
+
2103
+ export interface Old {
2104
+ id: string;
2105
+
2106
+ /**
2107
+ * Human-readable label for the entity at the snapshot it was captured in. For most
2108
+ * collections this is the entity's `name` field; for `allowedEvents` it is a
2109
+ * computed summary of the event's key fields. Two `modified` items can therefore
2110
+ * have identical `old.name` and `new.name` even though their underlying records
2111
+ * differ — the change is in fields not surfaced by the summary. Use the `id` to
2112
+ * fetch full detail.
2113
+ */
2114
+ name?: string | null;
2115
+
2116
+ /**
2117
+ * Optional change-classifier. Currently set to `'Reordered'` on `mappings`
2118
+ * modifications when the only change is priority reordering — this lets clients
2119
+ * de-emphasize them in change-review UI. `null` for every other diff item.
2120
+ */
2121
+ summary?: string | null;
2122
+
2123
+ /**
2124
+ * Parent tag-manager id for `tagManagerTags`, `tagManagerTriggers`, and
2125
+ * `tagManagerVariables`. `null` for every other collection.
2126
+ */
2127
+ tagManagerId?: string | null;
2128
+ }
2129
+ }
2130
+
2131
+ export interface Removed {
2132
+ id: string;
2133
+
2134
+ /**
2135
+ * Human-readable label for the entity at the snapshot it was captured in. For most
2136
+ * collections this is the entity's `name` field; for `allowedEvents` it is a
2137
+ * computed summary of the event's key fields. Two `modified` items can therefore
2138
+ * have identical `old.name` and `new.name` even though their underlying records
2139
+ * differ — the change is in fields not surfaced by the summary. Use the `id` to
2140
+ * fetch full detail.
2141
+ */
2142
+ name?: string | null;
2143
+
2144
+ /**
2145
+ * Optional change-classifier. Currently set to `'Reordered'` on `mappings`
2146
+ * modifications when the only change is priority reordering — this lets clients
2147
+ * de-emphasize them in change-review UI. `null` for every other diff item.
2148
+ */
2149
+ summary?: string | null;
2150
+
2151
+ /**
2152
+ * Parent tag-manager id for `tagManagerTags`, `tagManagerTriggers`, and
2153
+ * `tagManagerVariables`. `null` for every other collection.
2154
+ */
2155
+ tagManagerId?: string | null;
2156
+ }
2157
+ }
2158
+
1987
2159
  export interface TagManagerTags {
1988
2160
  added: Array<TagManagerTags.Added>;
1989
2161
 
@@ -2379,6 +2551,62 @@ export namespace VersionDiffResponse {
2379
2551
  }
2380
2552
  }
2381
2553
 
2554
+ export interface VersionRevertResponse {
2555
+ /**
2556
+ * Newly-added draft entities that were deleted.
2557
+ */
2558
+ discardedCount: number;
2559
+
2560
+ /**
2561
+ * Requested entities present in neither the draft nor the latest published
2562
+ * version.
2563
+ */
2564
+ notFoundCount: number;
2565
+
2566
+ /**
2567
+ * Total pending draft changes remaining after this operation.
2568
+ */
2569
+ remainingChanges: number;
2570
+
2571
+ /**
2572
+ * Entities recreated because they had been deleted from the draft.
2573
+ */
2574
+ restoredCount: number;
2575
+
2576
+ /**
2577
+ * Entities overwritten back to their published values.
2578
+ */
2579
+ revertedCount: number;
2580
+ }
2581
+
2582
+ export interface VersionAbandonResponse {
2583
+ /**
2584
+ * Newly-added draft entities that were deleted.
2585
+ */
2586
+ discardedCount: number;
2587
+
2588
+ /**
2589
+ * Requested entities present in neither the draft nor the latest published
2590
+ * version.
2591
+ */
2592
+ notFoundCount: number;
2593
+
2594
+ /**
2595
+ * Total pending draft changes remaining after this operation.
2596
+ */
2597
+ remainingChanges: number;
2598
+
2599
+ /**
2600
+ * Entities recreated because they had been deleted from the draft.
2601
+ */
2602
+ restoredCount: number;
2603
+
2604
+ /**
2605
+ * Entities overwritten back to their published values.
2606
+ */
2607
+ revertedCount: number;
2608
+ }
2609
+
2382
2610
  export interface VersionListParams extends CursorParams {
2383
2611
  /**
2384
2612
  * Filter to only published or unpublished versions.
@@ -2512,6 +2740,47 @@ export interface VersionDiffParams {
2512
2740
  against?: string;
2513
2741
  }
2514
2742
 
2743
+ export interface VersionRevertParams {
2744
+ /**
2745
+ * Draft entities to revert back to the latest published version. Each entry is
2746
+ * processed independently: a modified entity is restored to its published values,
2747
+ * a deleted entity is recreated, and a newly-added entity is discarded. Pass a
2748
+ * single entry to revert one change.
2749
+ */
2750
+ entities: Array<VersionRevertParams.Entity>;
2751
+ }
2752
+
2753
+ export namespace VersionRevertParams {
2754
+ export interface Entity {
2755
+ /**
2756
+ * Id of the draft entity to revert.
2757
+ */
2758
+ id: string;
2759
+
2760
+ /**
2761
+ * Entity collection the id belongs to. `experiments` and `experimentVariants` are
2762
+ * not supported — use the experiment lifecycle endpoints for those — but
2763
+ * `experimentSettings` is.
2764
+ */
2765
+ collection:
2766
+ | 'allowedEvents'
2767
+ | 'consentSettings'
2768
+ | 'dataGovernanceEvents'
2769
+ | 'dataGovernanceRules'
2770
+ | 'destinations'
2771
+ | 'experimentSettings'
2772
+ | 'externalAllowedEventData'
2773
+ | 'globalDispatchCenters'
2774
+ | 'mappings'
2775
+ | 'replaySettings'
2776
+ | 'sources'
2777
+ | 'tagManagerTags'
2778
+ | 'tagManagerTriggers'
2779
+ | 'tagManagerVariables'
2780
+ | 'tagManagers';
2781
+ }
2782
+ }
2783
+
2515
2784
  export declare namespace Versions {
2516
2785
  export {
2517
2786
  type VersionListResponse as VersionListResponse,
@@ -2521,10 +2790,13 @@ export declare namespace Versions {
2521
2790
  type VersionPublishResponse as VersionPublishResponse,
2522
2791
  type VersionSnapshotResponse as VersionSnapshotResponse,
2523
2792
  type VersionDiffResponse as VersionDiffResponse,
2793
+ type VersionRevertResponse as VersionRevertResponse,
2794
+ type VersionAbandonResponse as VersionAbandonResponse,
2524
2795
  type VersionListResponsesCursor as VersionListResponsesCursor,
2525
2796
  type VersionListParams as VersionListParams,
2526
2797
  type VersionCreateParams as VersionCreateParams,
2527
2798
  type VersionUpdateParams as VersionUpdateParams,
2528
2799
  type VersionDiffParams as VersionDiffParams,
2800
+ type VersionRevertParams as VersionRevertParams,
2529
2801
  };
2530
2802
  }