@oursprivacy/platform-sdk 1.22.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 (81) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +8 -8
  3. package/client.d.mts +10 -7
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +10 -7
  6. package/client.d.ts.map +1 -1
  7. package/client.js +6 -3
  8. package/client.js.map +1 -1
  9. package/client.mjs +6 -3
  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/index.d.mts +4 -3
  49. package/resources/index.d.mts.map +1 -1
  50. package/resources/index.d.ts +4 -3
  51. package/resources/index.d.ts.map +1 -1
  52. package/resources/index.js +5 -3
  53. package/resources/index.js.map +1 -1
  54. package/resources/index.mjs +2 -1
  55. package/resources/index.mjs.map +1 -1
  56. package/resources/mappings.d.mts +174 -15
  57. package/resources/mappings.d.mts.map +1 -1
  58. package/resources/mappings.d.ts +174 -15
  59. package/resources/mappings.d.ts.map +1 -1
  60. package/src/client.ts +56 -27
  61. package/src/resources/allowed-events.ts +232 -4
  62. package/src/resources/consent-analytics.ts +76 -0
  63. package/src/resources/consent-settings.ts +272 -0
  64. package/src/resources/data-governance.ts +1091 -0
  65. package/src/resources/default-mappings.ts +60 -3
  66. package/src/resources/index.ts +25 -12
  67. package/src/resources/mappings.ts +174 -15
  68. package/src/version.ts +1 -1
  69. package/version.d.mts +1 -1
  70. package/version.d.ts +1 -1
  71. package/version.js +1 -1
  72. package/version.mjs +1 -1
  73. package/resources/global-dispatch-centers.d.mts +0 -349
  74. package/resources/global-dispatch-centers.d.mts.map +0 -1
  75. package/resources/global-dispatch-centers.d.ts +0 -349
  76. package/resources/global-dispatch-centers.d.ts.map +0 -1
  77. package/resources/global-dispatch-centers.js +0 -43
  78. package/resources/global-dispatch-centers.js.map +0 -1
  79. package/resources/global-dispatch-centers.mjs +0 -39
  80. package/resources/global-dispatch-centers.mjs.map +0 -1
  81. package/src/resources/global-dispatch-centers.ts +0 -458
@@ -6,25 +6,69 @@ const resource_1 = require("../core/resource.js");
6
6
  const path_1 = require("../internal/utils/path.js");
7
7
  class AllowedEvents extends resource_1.APIResource {
8
8
  /**
9
- * List all allowed events. Requires scope: allowedEvent:list
9
+ * List every allowed event for this account. Allowed events sit between sources
10
+ * and destinations in the dispatch flow — only inbound events whose `event` field
11
+ * matches the `name` of an allowed event (case-insensitive) can be routed to that
12
+ * event's `destinationIds`. Events without a matching allowed event are dropped.
13
+ * The list is not paginated; the per-account count is bounded. System events
14
+ * (names beginning with `$`, e.g. `$heatmap_click`) are hidden from the response —
15
+ * only `$identify` is creatable as an allowed event. Requires scope:
16
+ * allowedEvent:list
10
17
  */
11
18
  list(options) {
12
19
  return this._client.get('/rest/v1/allowed-events', options);
13
20
  }
14
21
  /**
15
- * Create a new allowed event. Requires scope: allowedEvent:create
22
+ * Create a new allowed event for this account.
23
+ *
24
+ * - `name` is required, trimmed, case-insensitively unique within the account, and
25
+ * rejected if it exceeds the platform event-name length limit.
26
+ * - Names starting with `$` are reserved for system events. Only `$identify` is
27
+ * accepted.
28
+ * - `destinationIds` is optional. Unknown ids and ids belonging to other accounts
29
+ * are silently filtered out at write time (the destination must exist on this
30
+ * account to be saved).
31
+ *
32
+ * Returns the full entity so callers can read the server-assigned `id`,
33
+ * `createdAt`, and the filtered `destinationIds` without a follow-up GET. Known
34
+ * input failures (duplicate name, name length, `$`-prefix reservation, empty name)
35
+ * are returned as HTTP 409 with the reason in the response `error` field. Requires
36
+ * scope: allowedEvent:create
16
37
  */
17
38
  create(body, options) {
18
39
  return this._client.post('/rest/v1/allowed-events', { body, ...options });
19
40
  }
20
41
  /**
21
- * Find a single allowed event by ID. Requires scope: allowedEvent:find
42
+ * Fetch a single allowed event by id. Returns 404 when no record matches the
43
+ * supplied id or it belongs to a different account. Requires scope:
44
+ * allowedEvent:find
22
45
  */
23
46
  retrieve(id, options) {
24
47
  return this._client.get((0, path_1.path) `/rest/v1/allowed-events/${id}`, options);
25
48
  }
26
49
  /**
27
- * Delete an allowed event. Requires scope: allowedEvent:delete
50
+ * Partially update an allowed event. Only the fields you send are changed; omitted
51
+ * fields keep their current value.
52
+ *
53
+ * - `destinationIds` is replaced wholesale when sent — the canonical way to add or
54
+ * remove a destination is to fetch, modify the array, and PATCH it back. Stale
55
+ * ids (deleted destinations or destinations on another account) are silently
56
+ * filtered out at write time.
57
+ * - `name` is subject to the same rules as create: case-insensitive uniqueness,
58
+ * length cap, `$`-prefix reservation.
59
+ * - `trigger` accepts `null` to clear the existing value.
60
+ *
61
+ * Returns the full entity. Known input failures (duplicate name, length,
62
+ * `$`-prefix, empty name) are returned as HTTP 409 with the reason in the response
63
+ * `error` field. Requires scope: allowedEvent:update
64
+ */
65
+ update(id, body, options) {
66
+ return this._client.patch((0, path_1.path) `/rest/v1/allowed-events/${id}`, { body, ...options });
67
+ }
68
+ /**
69
+ * Delete an allowed event. After deletion, inbound events whose `event` field
70
+ * matches the deleted name are no longer routed and are dropped at the allow-list
71
+ * stage of the dispatch flow. Requires scope: allowedEvent:delete
28
72
  */
29
73
  delete(id, options) {
30
74
  return this._client.delete((0, path_1.path) `/rest/v1/allowed-events/${id}`, options);
@@ -1 +1 @@
1
- {"version":3,"file":"allowed-events.js","sourceRoot":"","sources":["../src/resources/allowed-events.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,aAAc,SAAQ,sBAAW;IAC5C;;OAEG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAA8B,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,2BAA2B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;IA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AAO,CAAC,CAAC;IAC3E,CAAC;CACF;AA7ED,sCA6EC"}
@@ -3,25 +3,69 @@ import { APIResource } from "../core/resource.mjs";
3
3
  import { path } from "../internal/utils/path.mjs";
4
4
  export class AllowedEvents extends APIResource {
5
5
  /**
6
- * List all allowed events. Requires scope: allowedEvent:list
6
+ * List every allowed event for this account. Allowed events sit between sources
7
+ * and destinations in the dispatch flow — only inbound events whose `event` field
8
+ * matches the `name` of an allowed event (case-insensitive) can be routed to that
9
+ * event's `destinationIds`. Events without a matching allowed event are dropped.
10
+ * The list is not paginated; the per-account count is bounded. System events
11
+ * (names beginning with `$`, e.g. `$heatmap_click`) are hidden from the response —
12
+ * only `$identify` is creatable as an allowed event. Requires scope:
13
+ * allowedEvent:list
7
14
  */
8
15
  list(options) {
9
16
  return this._client.get('/rest/v1/allowed-events', options);
10
17
  }
11
18
  /**
12
- * Create a new allowed event. Requires scope: allowedEvent:create
19
+ * Create a new allowed event for this account.
20
+ *
21
+ * - `name` is required, trimmed, case-insensitively unique within the account, and
22
+ * rejected if it exceeds the platform event-name length limit.
23
+ * - Names starting with `$` are reserved for system events. Only `$identify` is
24
+ * accepted.
25
+ * - `destinationIds` is optional. Unknown ids and ids belonging to other accounts
26
+ * are silently filtered out at write time (the destination must exist on this
27
+ * account to be saved).
28
+ *
29
+ * Returns the full entity so callers can read the server-assigned `id`,
30
+ * `createdAt`, and the filtered `destinationIds` without a follow-up GET. Known
31
+ * input failures (duplicate name, name length, `$`-prefix reservation, empty name)
32
+ * are returned as HTTP 409 with the reason in the response `error` field. Requires
33
+ * scope: allowedEvent:create
13
34
  */
14
35
  create(body, options) {
15
36
  return this._client.post('/rest/v1/allowed-events', { body, ...options });
16
37
  }
17
38
  /**
18
- * Find a single allowed event by ID. Requires scope: allowedEvent:find
39
+ * Fetch a single allowed event by id. Returns 404 when no record matches the
40
+ * supplied id or it belongs to a different account. Requires scope:
41
+ * allowedEvent:find
19
42
  */
20
43
  retrieve(id, options) {
21
44
  return this._client.get(path `/rest/v1/allowed-events/${id}`, options);
22
45
  }
23
46
  /**
24
- * Delete an allowed event. Requires scope: allowedEvent:delete
47
+ * Partially update an allowed event. Only the fields you send are changed; omitted
48
+ * fields keep their current value.
49
+ *
50
+ * - `destinationIds` is replaced wholesale when sent — the canonical way to add or
51
+ * remove a destination is to fetch, modify the array, and PATCH it back. Stale
52
+ * ids (deleted destinations or destinations on another account) are silently
53
+ * filtered out at write time.
54
+ * - `name` is subject to the same rules as create: case-insensitive uniqueness,
55
+ * length cap, `$`-prefix reservation.
56
+ * - `trigger` accepts `null` to clear the existing value.
57
+ *
58
+ * Returns the full entity. Known input failures (duplicate name, length,
59
+ * `$`-prefix, empty name) are returned as HTTP 409 with the reason in the response
60
+ * `error` field. Requires scope: allowedEvent:update
61
+ */
62
+ update(id, body, options) {
63
+ return this._client.patch(path `/rest/v1/allowed-events/${id}`, { body, ...options });
64
+ }
65
+ /**
66
+ * Delete an allowed event. After deletion, inbound events whose `event` field
67
+ * matches the deleted name are no longer routed and are dropped at the allow-list
68
+ * stage of the dispatch flow. Requires scope: allowedEvent:delete
25
69
  */
26
70
  delete(id, options) {
27
71
  return this._client.delete(path `/rest/v1/allowed-events/${id}`, options);
@@ -1 +1 @@
1
- {"version":3,"file":"allowed-events.mjs","sourceRoot":"","sources":["../src/resources/allowed-events.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C;;OAEG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAA8B,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,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,CAAA,2BAA2B,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,2BAA2B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;CACF"}
@@ -0,0 +1,57 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { RequestOptions } from "../internal/request-options.mjs";
4
+ export declare class ConsentAnalytics extends APIResource {
5
+ /**
6
+ * Account-wide blocking stats from the Global Consent Center for the window: how
7
+ * many dispatches were attempted, how many were blocked, and a per-category
8
+ * breakdown of the blocks (with `percentageBlocked` = share of `totalDispatches`).
9
+ * Not scoped to a single consent settings record — this aggregates across every
10
+ * destination in the account. The endpoint is identified by query params rather
11
+ * than a path id because the report is account-scoped; this is a documented
12
+ * derived-read exception. Reuses the API-key scope `consentSettings:list` because
13
+ * the report crosses every consent setting. Requires scope: consentSettings:list
14
+ */
15
+ list(query: ConsentAnalyticsListParams, options?: RequestOptions): APIPromise<ConsentAnalyticsListResponse>;
16
+ }
17
+ export interface ConsentAnalyticsListResponse {
18
+ /**
19
+ * Per-category breakdown of blocked dispatches. `categoryName` is `Unknown` when
20
+ * the upstream block message could not be parsed; `percentageBlocked` is the share
21
+ * of `totalDispatches` blocked under that category.
22
+ */
23
+ items: Array<ConsentAnalyticsListResponse.Item>;
24
+ /**
25
+ * Total dispatches blocked by the Global Consent Center across all categories.
26
+ */
27
+ totalBlocked: number;
28
+ /**
29
+ * Total dispatches attempted across all destinations for the window.
30
+ */
31
+ totalDispatches: number;
32
+ }
33
+ export declare namespace ConsentAnalyticsListResponse {
34
+ interface Item {
35
+ blockedCount: number;
36
+ categoryName: string;
37
+ percentageBlocked: number;
38
+ }
39
+ }
40
+ export interface ConsentAnalyticsListParams {
41
+ /**
42
+ * Inclusive lower bound of the analytics window, as a UTC calendar day in
43
+ * `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
44
+ * fewer.
45
+ */
46
+ from: string;
47
+ /**
48
+ * Inclusive upper bound of the analytics window, as a UTC calendar day in
49
+ * `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
50
+ * fewer.
51
+ */
52
+ to: string;
53
+ }
54
+ export declare namespace ConsentAnalytics {
55
+ export { type ConsentAnalyticsListResponse as ConsentAnalyticsListResponse, type ConsentAnalyticsListParams as ConsentAnalyticsListParams, };
56
+ }
57
+ //# sourceMappingURL=consent-analytics.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consent-analytics.d.mts","sourceRoot":"","sources":["../src/resources/consent-analytics.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C;;;;;;;;;OASG;IACH,IAAI,CACF,KAAK,EAAE,0BAA0B,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,4BAA4B,CAAC;CAG5C;AAED,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,KAAK,EAAE,KAAK,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC;IAEhD;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,yBAAiB,4BAA4B,CAAC;IAC5C,UAAiB,IAAI;QACnB,YAAY,EAAE,MAAM,CAAC;QAErB,YAAY,EAAE,MAAM,CAAC;QAErB,iBAAiB,EAAE,MAAM,CAAC;KAC3B;CACF;AAED,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,CAAC,OAAO,WAAW,gBAAgB,CAAC;IACxC,OAAO,EACL,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
@@ -0,0 +1,57 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import { APIPromise } from "../core/api-promise.js";
3
+ import { RequestOptions } from "../internal/request-options.js";
4
+ export declare class ConsentAnalytics extends APIResource {
5
+ /**
6
+ * Account-wide blocking stats from the Global Consent Center for the window: how
7
+ * many dispatches were attempted, how many were blocked, and a per-category
8
+ * breakdown of the blocks (with `percentageBlocked` = share of `totalDispatches`).
9
+ * Not scoped to a single consent settings record — this aggregates across every
10
+ * destination in the account. The endpoint is identified by query params rather
11
+ * than a path id because the report is account-scoped; this is a documented
12
+ * derived-read exception. Reuses the API-key scope `consentSettings:list` because
13
+ * the report crosses every consent setting. Requires scope: consentSettings:list
14
+ */
15
+ list(query: ConsentAnalyticsListParams, options?: RequestOptions): APIPromise<ConsentAnalyticsListResponse>;
16
+ }
17
+ export interface ConsentAnalyticsListResponse {
18
+ /**
19
+ * Per-category breakdown of blocked dispatches. `categoryName` is `Unknown` when
20
+ * the upstream block message could not be parsed; `percentageBlocked` is the share
21
+ * of `totalDispatches` blocked under that category.
22
+ */
23
+ items: Array<ConsentAnalyticsListResponse.Item>;
24
+ /**
25
+ * Total dispatches blocked by the Global Consent Center across all categories.
26
+ */
27
+ totalBlocked: number;
28
+ /**
29
+ * Total dispatches attempted across all destinations for the window.
30
+ */
31
+ totalDispatches: number;
32
+ }
33
+ export declare namespace ConsentAnalyticsListResponse {
34
+ interface Item {
35
+ blockedCount: number;
36
+ categoryName: string;
37
+ percentageBlocked: number;
38
+ }
39
+ }
40
+ export interface ConsentAnalyticsListParams {
41
+ /**
42
+ * Inclusive lower bound of the analytics window, as a UTC calendar day in
43
+ * `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
44
+ * fewer.
45
+ */
46
+ from: string;
47
+ /**
48
+ * Inclusive upper bound of the analytics window, as a UTC calendar day in
49
+ * `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
50
+ * fewer.
51
+ */
52
+ to: string;
53
+ }
54
+ export declare namespace ConsentAnalytics {
55
+ export { type ConsentAnalyticsListResponse as ConsentAnalyticsListResponse, type ConsentAnalyticsListParams as ConsentAnalyticsListParams, };
56
+ }
57
+ //# sourceMappingURL=consent-analytics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consent-analytics.d.ts","sourceRoot":"","sources":["../src/resources/consent-analytics.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAE7D,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C;;;;;;;;;OASG;IACH,IAAI,CACF,KAAK,EAAE,0BAA0B,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,4BAA4B,CAAC;CAG5C;AAED,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,KAAK,EAAE,KAAK,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC;IAEhD;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,yBAAiB,4BAA4B,CAAC;IAC5C,UAAiB,IAAI;QACnB,YAAY,EAAE,MAAM,CAAC;QAErB,YAAY,EAAE,MAAM,CAAC;QAErB,iBAAiB,EAAE,MAAM,CAAC;KAC3B;CACF;AAED,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,CAAC,OAAO,WAAW,gBAAgB,CAAC;IACxC,OAAO,EACL,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ConsentAnalytics = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ class ConsentAnalytics extends resource_1.APIResource {
7
+ /**
8
+ * Account-wide blocking stats from the Global Consent Center for the window: how
9
+ * many dispatches were attempted, how many were blocked, and a per-category
10
+ * breakdown of the blocks (with `percentageBlocked` = share of `totalDispatches`).
11
+ * Not scoped to a single consent settings record — this aggregates across every
12
+ * destination in the account. The endpoint is identified by query params rather
13
+ * than a path id because the report is account-scoped; this is a documented
14
+ * derived-read exception. Reuses the API-key scope `consentSettings:list` because
15
+ * the report crosses every consent setting. Requires scope: consentSettings:list
16
+ */
17
+ list(query, options) {
18
+ return this._client.get('/rest/v1/consent-analytics', { query, ...options });
19
+ }
20
+ }
21
+ exports.ConsentAnalytics = ConsentAnalytics;
22
+ //# sourceMappingURL=consent-analytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consent-analytics.js","sourceRoot":"","sources":["../src/resources/consent-analytics.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,gBAAiB,SAAQ,sBAAW;IAC/C;;;;;;;;;OASG;IACH,IAAI,CACF,KAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF;AAjBD,4CAiBC"}
@@ -0,0 +1,18 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ export class ConsentAnalytics extends APIResource {
4
+ /**
5
+ * Account-wide blocking stats from the Global Consent Center for the window: how
6
+ * many dispatches were attempted, how many were blocked, and a per-category
7
+ * breakdown of the blocks (with `percentageBlocked` = share of `totalDispatches`).
8
+ * Not scoped to a single consent settings record — this aggregates across every
9
+ * destination in the account. The endpoint is identified by query params rather
10
+ * than a path id because the report is account-scoped; this is a documented
11
+ * derived-read exception. Reuses the API-key scope `consentSettings:list` because
12
+ * the report crosses every consent setting. Requires scope: consentSettings:list
13
+ */
14
+ list(query, options) {
15
+ return this._client.get('/rest/v1/consent-analytics', { query, ...options });
16
+ }
17
+ }
18
+ //# sourceMappingURL=consent-analytics.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consent-analytics.mjs","sourceRoot":"","sources":["../src/resources/consent-analytics.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAC/C;;;;;;;;;OASG;IACH,IAAI,CACF,KAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF"}
@@ -37,6 +37,40 @@ export declare class ConsentSettings extends APIResource {
37
37
  * Delete a consent setting. Requires scope: consentSettings:delete
38
38
  */
39
39
  delete(id: string, options?: RequestOptions): APIPromise<ConsentSettingDeleteResponse>;
40
+ /**
41
+ * Time-series consent analytics for a single consent settings record: banner
42
+ * views, opt-ins, opt-outs, close-icon clicks, and derived opt-in/out rates per
43
+ * UTC day (or per UTC hour with `granularity=HOURLY`). The window is zero-filled
44
+ * so callers get a contiguous series, and rates are person-level
45
+ * (`COUNT(DISTINCT visitor_id)`). Use the optional `pagePath` and `region` filters
46
+ * to scope to one page or one visitor region; use `compareWithPreviousPeriod=true`
47
+ * to also receive the matching prior window. `DAILY` allows a 90-day window;
48
+ * `HOURLY` is capped at 14 days. Reuses the API-key scope `consentSettings:find`
49
+ * because the endpoint is identified by a consent settings `id`. Requires scope:
50
+ * consentSettings:find
51
+ */
52
+ analytics(id: string, query: ConsentSettingAnalyticsParams, options?: RequestOptions): APIPromise<ConsentSettingAnalyticsResponse>;
53
+ /**
54
+ * Per-page consent breakdown for one consent settings record, ranked by opt-outs
55
+ * (descending). Each row bundles banner views, opt-outs, close-icon clicks, and
56
+ * the derived opt-out rate. Documented exception to the cursor-pagination
57
+ * standard: this is a derived read whose underlying GraphQL contract is
58
+ * offset/limit-based; cursors are not used. `search` is a substring match against
59
+ * `pathname`; `region` filters to one visitor region. Reuses the API-key scope
60
+ * `consentSettings:find`. Requires scope: consentSettings:find
61
+ */
62
+ pageAnalysis(id: string, query: ConsentSettingPageAnalysisParams, options?: RequestOptions): APIPromise<ConsentSettingPageAnalysisResponse>;
63
+ /**
64
+ * Region-grouped consent totals for the window: banner views, opt-ins, opt-outs,
65
+ * close-icon clicks, and derived rates per visitor `country_region_name`, ranked
66
+ * by banner views (descending). Visitors whose region cannot be resolved (e.g. bot
67
+ * traffic, IP geo failure) are bucketed under the literal `Unknown` so per-region
68
+ * counts always sum to the global totals. Use this to discover the region names
69
+ * you can later pass to the `region` filter on
70
+ * `GET /rest/v1/consent-settings/{id}/analytics`. Reuses the API-key scope
71
+ * `consentSettings:find`. Requires scope: consentSettings:find
72
+ */
73
+ analyticsByRegion(id: string, query: ConsentSettingAnalyticsByRegionParams, options?: RequestOptions): APIPromise<ConsentSettingAnalyticsByRegionResponse>;
40
74
  }
41
75
  export interface ConsentSettingListResponse {
42
76
  entities: Array<ConsentSettingListResponse.Entity>;
@@ -2167,6 +2201,81 @@ export declare namespace ConsentSettingDeleteResponse {
2167
2201
  domainPatterns?: Array<string> | null;
2168
2202
  }
2169
2203
  }
2204
+ export interface ConsentSettingAnalyticsResponse {
2205
+ /**
2206
+ * One entry per time bucket (day or hour, depending on `granularity`) covering the
2207
+ * full window — empty windows are zero-filled so callers can render contiguous
2208
+ * time series without gap-handling logic.
2209
+ */
2210
+ items: Array<ConsentSettingAnalyticsResponse.Item>;
2211
+ }
2212
+ export declare namespace ConsentSettingAnalyticsResponse {
2213
+ interface Item {
2214
+ bannerViews: number;
2215
+ closeIconClicks: number;
2216
+ dateTime: string;
2217
+ explicitOptIns: number;
2218
+ explicitOptOuts: number;
2219
+ optInRate: number;
2220
+ optOutRate: number;
2221
+ percentageChangeBannerViews?: number | null;
2222
+ percentageChangeCloseIconClicks?: number | null;
2223
+ percentageChangeExplicitOptIns?: number | null;
2224
+ percentageChangeExplicitOptOuts?: number | null;
2225
+ previousBannerViews?: number | null;
2226
+ previousCloseIconClicks?: number | null;
2227
+ previousExplicitOptIns?: number | null;
2228
+ previousExplicitOptOuts?: number | null;
2229
+ previousOptInRate?: number | null;
2230
+ previousOptOutRate?: number | null;
2231
+ }
2232
+ }
2233
+ export interface ConsentSettingPageAnalysisResponse {
2234
+ /**
2235
+ * True when at least one more page is available beyond the current window.
2236
+ */
2237
+ hasMore: boolean;
2238
+ /**
2239
+ * Pages with consent activity in the window, ranked by opt-outs (descending). Each
2240
+ * page bundles banner views, opt-outs, close-icon clicks, and the derived opt-out
2241
+ * rate.
2242
+ */
2243
+ items: Array<ConsentSettingPageAnalysisResponse.Item>;
2244
+ /**
2245
+ * Running count of pages loaded so far (`offset + items.length`). Approximate for
2246
+ * load-more flows; query without `offset` to get the exact size of the first page.
2247
+ */
2248
+ total: number;
2249
+ }
2250
+ export declare namespace ConsentSettingPageAnalysisResponse {
2251
+ interface Item {
2252
+ bannerViews: number;
2253
+ closeIconClicks: number;
2254
+ optOutRate: number;
2255
+ optOuts: number;
2256
+ page: string;
2257
+ }
2258
+ }
2259
+ export interface ConsentSettingAnalyticsByRegionResponse {
2260
+ /**
2261
+ * Per-region totals for the window, ranked by banner views (descending). Visitors
2262
+ * whose region cannot be resolved (e.g. bot traffic, IP geo failure) are bucketed
2263
+ * under the literal `Unknown`, so the per-region counts always sum to the global
2264
+ * totals.
2265
+ */
2266
+ regions: Array<ConsentSettingAnalyticsByRegionResponse.Region>;
2267
+ }
2268
+ export declare namespace ConsentSettingAnalyticsByRegionResponse {
2269
+ interface Region {
2270
+ bannerViews: number;
2271
+ closeIconClicks: number;
2272
+ explicitOptIns: number;
2273
+ explicitOptOuts: number;
2274
+ optInRate: number;
2275
+ optOutRate: number;
2276
+ regionName: string;
2277
+ }
2278
+ }
2170
2279
  export interface ConsentSettingReplaceParams {
2171
2280
  /**
2172
2281
  * Top-level consent categories. Server re-stamps `priority` to 0..N.
@@ -2831,7 +2940,95 @@ export declare namespace ConsentSettingUpdateParams {
2831
2940
  domainPatterns?: Array<string> | null;
2832
2941
  }
2833
2942
  }
2943
+ export interface ConsentSettingAnalyticsParams {
2944
+ /**
2945
+ * Inclusive lower bound of the analytics window, as a UTC calendar day in
2946
+ * `YYYY-MM-DD` format. The window between `from` and `to` must be 90 days or fewer
2947
+ * (14 for `HOURLY` granularity).
2948
+ */
2949
+ from: string;
2950
+ /**
2951
+ * Inclusive upper bound of the analytics window, as a UTC calendar day in
2952
+ * `YYYY-MM-DD` format. The window between `from` and `to` must be 90 days or fewer
2953
+ * (14 for `HOURLY` granularity).
2954
+ */
2955
+ to: string;
2956
+ /**
2957
+ * When `true`, each bucket also returns the matching bucket from the immediately
2958
+ * preceding window of equal length (in `previous*` and `percentageChange*`
2959
+ * fields). Defaults to `false`.
2960
+ */
2961
+ compareWithPreviousPeriod?: boolean;
2962
+ /**
2963
+ * Bucket size for the time-series rollup. `DAILY` (default) buckets per UTC day;
2964
+ * `HOURLY` buckets per UTC hour and limits the window to 14 days.
2965
+ */
2966
+ granularity?: 'DAILY' | 'HOURLY';
2967
+ /**
2968
+ * Filter to events whose `default_properties.pathname` equals this value (exact
2969
+ * match, case-sensitive). Use this to drill into a single page.
2970
+ */
2971
+ pagePath?: string;
2972
+ /**
2973
+ * Filter results to events whose `request_context.country_region_name` is in this
2974
+ * set. Pass a single region (e.g. `California`) or a comma-separated list
2975
+ * (`California,Texas`). Case-sensitive. Use
2976
+ * `GET /rest/v1/consent-settings/{id}/analytics-by-region` to discover the region
2977
+ * names available for an account.
2978
+ */
2979
+ regions?: string;
2980
+ }
2981
+ export interface ConsentSettingPageAnalysisParams {
2982
+ /**
2983
+ * Inclusive lower bound of the analytics window, as a UTC calendar day in
2984
+ * `YYYY-MM-DD` format. The window between `from` and `to` must be 90 days or fewer
2985
+ * (14 for `HOURLY` granularity).
2986
+ */
2987
+ from: string;
2988
+ /**
2989
+ * Inclusive upper bound of the analytics window, as a UTC calendar day in
2990
+ * `YYYY-MM-DD` format. The window between `from` and `to` must be 90 days or fewer
2991
+ * (14 for `HOURLY` granularity).
2992
+ */
2993
+ to: string;
2994
+ /**
2995
+ * Maximum number of pages to return. Defaults to 50.
2996
+ */
2997
+ limit?: number;
2998
+ /**
2999
+ * Skip this many top-ranked pages before returning. Use together with `limit` for
3000
+ * load-more pagination.
3001
+ */
3002
+ offset?: number | null;
3003
+ /**
3004
+ * Filter results to events whose `request_context.country_region_name` is in this
3005
+ * set. Pass a single region (e.g. `California`) or a comma-separated list
3006
+ * (`California,Texas`). Case-sensitive. Use
3007
+ * `GET /rest/v1/consent-settings/{id}/analytics-by-region` to discover the region
3008
+ * names available for an account.
3009
+ */
3010
+ regions?: string;
3011
+ /**
3012
+ * Case-sensitive substring match against `default_properties.pathname`. Wrapped in
3013
+ * `%...%` server-side.
3014
+ */
3015
+ search?: string;
3016
+ }
3017
+ export interface ConsentSettingAnalyticsByRegionParams {
3018
+ /**
3019
+ * Inclusive lower bound of the analytics window, as a UTC calendar day in
3020
+ * `YYYY-MM-DD` format. The window between `from` and `to` must be 90 days or fewer
3021
+ * (14 for `HOURLY` granularity).
3022
+ */
3023
+ from: string;
3024
+ /**
3025
+ * Inclusive upper bound of the analytics window, as a UTC calendar day in
3026
+ * `YYYY-MM-DD` format. The window between `from` and `to` must be 90 days or fewer
3027
+ * (14 for `HOURLY` granularity).
3028
+ */
3029
+ to: string;
3030
+ }
2834
3031
  export declare namespace ConsentSettings {
2835
- export { type ConsentSettingListResponse as ConsentSettingListResponse, type ConsentSettingCreateResponse as ConsentSettingCreateResponse, type ConsentSettingRetrieveResponse as ConsentSettingRetrieveResponse, type ConsentSettingReplaceResponse as ConsentSettingReplaceResponse, type ConsentSettingUpdateResponse as ConsentSettingUpdateResponse, type ConsentSettingDeleteResponse as ConsentSettingDeleteResponse, type ConsentSettingReplaceParams as ConsentSettingReplaceParams, type ConsentSettingUpdateParams as ConsentSettingUpdateParams, };
3032
+ export { type ConsentSettingListResponse as ConsentSettingListResponse, type ConsentSettingCreateResponse as ConsentSettingCreateResponse, type ConsentSettingRetrieveResponse as ConsentSettingRetrieveResponse, type ConsentSettingReplaceResponse as ConsentSettingReplaceResponse, type ConsentSettingUpdateResponse as ConsentSettingUpdateResponse, type ConsentSettingDeleteResponse as ConsentSettingDeleteResponse, type ConsentSettingAnalyticsResponse as ConsentSettingAnalyticsResponse, type ConsentSettingPageAnalysisResponse as ConsentSettingPageAnalysisResponse, type ConsentSettingAnalyticsByRegionResponse as ConsentSettingAnalyticsByRegionResponse, type ConsentSettingReplaceParams as ConsentSettingReplaceParams, type ConsentSettingUpdateParams as ConsentSettingUpdateParams, type ConsentSettingAnalyticsParams as ConsentSettingAnalyticsParams, type ConsentSettingPageAnalysisParams as ConsentSettingPageAnalysisParams, type ConsentSettingAnalyticsByRegionParams as ConsentSettingAnalyticsByRegionParams, };
2836
3033
  }
2837
3034
  //# sourceMappingURL=consent-settings.d.mts.map