@oursprivacy/platform-sdk 1.68.0 → 1.70.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 (114) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/client.d.mts +7 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +7 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/analytics.d.mts +10 -0
  12. package/resources/analytics.d.mts.map +1 -1
  13. package/resources/analytics.d.ts +10 -0
  14. package/resources/analytics.d.ts.map +1 -1
  15. package/resources/dashboards.d.mts +646 -4
  16. package/resources/dashboards.d.mts.map +1 -1
  17. package/resources/dashboards.d.ts +646 -4
  18. package/resources/dashboards.d.ts.map +1 -1
  19. package/resources/destinations.d.mts +7 -7
  20. package/resources/destinations.d.mts.map +1 -1
  21. package/resources/destinations.d.ts +7 -7
  22. package/resources/destinations.d.ts.map +1 -1
  23. package/resources/funnels.d.mts +253 -7
  24. package/resources/funnels.d.mts.map +1 -1
  25. package/resources/funnels.d.ts +253 -7
  26. package/resources/funnels.d.ts.map +1 -1
  27. package/resources/funnels.js +10 -7
  28. package/resources/funnels.js.map +1 -1
  29. package/resources/funnels.mjs +10 -7
  30. package/resources/funnels.mjs.map +1 -1
  31. package/resources/index.d.mts +3 -2
  32. package/resources/index.d.mts.map +1 -1
  33. package/resources/index.d.ts +3 -2
  34. package/resources/index.d.ts.map +1 -1
  35. package/resources/index.js +3 -1
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +1 -0
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/insights.d.mts +73 -12
  40. package/resources/insights.d.mts.map +1 -1
  41. package/resources/insights.d.ts +73 -12
  42. package/resources/insights.d.ts.map +1 -1
  43. package/resources/insights.js +9 -7
  44. package/resources/insights.js.map +1 -1
  45. package/resources/insights.mjs +9 -7
  46. package/resources/insights.mjs.map +1 -1
  47. package/resources/journey-flows.d.mts +242 -18
  48. package/resources/journey-flows.d.mts.map +1 -1
  49. package/resources/journey-flows.d.ts +242 -18
  50. package/resources/journey-flows.d.ts.map +1 -1
  51. package/resources/journey-flows.js +18 -12
  52. package/resources/journey-flows.js.map +1 -1
  53. package/resources/journey-flows.mjs +18 -12
  54. package/resources/journey-flows.mjs.map +1 -1
  55. package/resources/locations.d.mts +653 -13
  56. package/resources/locations.d.mts.map +1 -1
  57. package/resources/locations.d.ts +653 -13
  58. package/resources/locations.d.ts.map +1 -1
  59. package/resources/locations.js +10 -3
  60. package/resources/locations.js.map +1 -1
  61. package/resources/locations.mjs +10 -3
  62. package/resources/locations.mjs.map +1 -1
  63. package/resources/query-dispatches.d.mts +241 -0
  64. package/resources/query-dispatches.d.mts.map +1 -0
  65. package/resources/query-dispatches.d.ts +241 -0
  66. package/resources/query-dispatches.d.ts.map +1 -0
  67. package/resources/query-dispatches.js +56 -0
  68. package/resources/query-dispatches.js.map +1 -0
  69. package/resources/query-dispatches.mjs +52 -0
  70. package/resources/query-dispatches.mjs.map +1 -0
  71. package/resources/query-events.d.mts +10 -0
  72. package/resources/query-events.d.mts.map +1 -1
  73. package/resources/query-events.d.ts +10 -0
  74. package/resources/query-events.d.ts.map +1 -1
  75. package/resources/report-branding.d.mts +112 -28
  76. package/resources/report-branding.d.mts.map +1 -1
  77. package/resources/report-branding.d.ts +112 -28
  78. package/resources/report-branding.d.ts.map +1 -1
  79. package/resources/report-branding.js +29 -15
  80. package/resources/report-branding.js.map +1 -1
  81. package/resources/report-branding.mjs +29 -15
  82. package/resources/report-branding.mjs.map +1 -1
  83. package/resources/sources.d.mts +6 -6
  84. package/resources/sources.d.mts.map +1 -1
  85. package/resources/sources.d.ts +6 -6
  86. package/resources/sources.d.ts.map +1 -1
  87. package/resources/test-events.d.mts +28 -0
  88. package/resources/test-events.d.mts.map +1 -1
  89. package/resources/test-events.d.ts +28 -0
  90. package/resources/test-events.d.ts.map +1 -1
  91. package/resources/web-analytics.d.mts +24 -0
  92. package/resources/web-analytics.d.mts.map +1 -1
  93. package/resources/web-analytics.d.ts +24 -0
  94. package/resources/web-analytics.d.ts.map +1 -1
  95. package/src/client.ts +29 -0
  96. package/src/resources/analytics.ts +12 -0
  97. package/src/resources/dashboards.ts +876 -8
  98. package/src/resources/destinations.ts +23 -2
  99. package/src/resources/funnels.ts +332 -7
  100. package/src/resources/index.ts +13 -0
  101. package/src/resources/insights.ts +107 -12
  102. package/src/resources/journey-flows.ts +300 -22
  103. package/src/resources/locations.ts +690 -12
  104. package/src/resources/query-dispatches.ts +323 -0
  105. package/src/resources/query-events.ts +12 -0
  106. package/src/resources/report-branding.ts +132 -27
  107. package/src/resources/sources.ts +12 -0
  108. package/src/resources/test-events.ts +33 -0
  109. package/src/resources/web-analytics.ts +40 -0
  110. package/src/version.ts +1 -1
  111. package/version.d.mts +1 -1
  112. package/version.d.ts +1 -1
  113. package/version.js +1 -1
  114. package/version.mjs +1 -1
@@ -74,9 +74,11 @@ export class Insights extends APIResource {
74
74
 
75
75
  /**
76
76
  * Compute a saved Insight using expectedRevision with optional date, smoothing,
77
- * cumulative, and comparison overrides. Overrides do not change the saved report.
78
- * Requires API-key scope or current OAuth user permission: web-analytics:view,
79
- * variables:find-custom
77
+ * cumulative, comparison, and breakdown overrides. A breakdown splits every metric
78
+ * into one series per property value (top values plus Other and (not set)); unique
79
+ * visitor and average series do not add up across segments. Overrides do not
80
+ * change the saved report. Requires API-key scope or current OAuth user
81
+ * permission: web-analytics:view, variables:find-custom
80
82
  */
81
83
  results(
82
84
  id: string,
@@ -87,10 +89,10 @@ export class Insights extends APIResource {
87
89
  }
88
90
 
89
91
  /**
90
- * Compute an unsaved Insight preview from its metric definition and date range.
91
- * JSON-encode input in the query string; maximum 16384 bytes before URL encoding.
92
- * Requires API-key scope or current OAuth user permission: web-analytics:view,
93
- * variables:find-custom
92
+ * Compute an unsaved Insight preview from its metric definition and date range,
93
+ * optionally with a comparison and a breakdown. JSON-encode input in the query
94
+ * string; maximum 16384 bytes before URL encoding. Requires API-key scope or
95
+ * current OAuth user permission: web-analytics:view, variables:find-custom
94
96
  */
95
97
  preview(query: InsightPreviewParams, options?: RequestOptions): APIPromise<InsightPreviewResponse> {
96
98
  return this._client.get('/rest/v1/insights/preview', { query, ...options });
@@ -1218,6 +1220,8 @@ export interface InsightDeleteResponse {
1218
1220
  export interface InsightCapabilitiesResponse {
1219
1221
  definitionVersion: 1;
1220
1222
 
1223
+ maxBreakdownSegments: 10;
1224
+
1221
1225
  maxDateRangeDays: 366;
1222
1226
 
1223
1227
  maxEventNamesPerMetric: 10;
@@ -1254,7 +1258,7 @@ export interface InsightCapabilitiesResponse {
1254
1258
 
1255
1259
  supportedVisualizations: Array<'line' | 'column' | 'bar' | 'pie' | 'table' | 'metric'>;
1256
1260
 
1257
- supportsBreakdowns: false;
1261
+ supportsBreakdowns: true;
1258
1262
 
1259
1263
  supportsComparisons: true;
1260
1264
 
@@ -1309,10 +1313,36 @@ export namespace InsightResultsResponse {
1309
1313
 
1310
1314
  to: string;
1311
1315
 
1316
+ breakdown?: Scope.Breakdown | null;
1317
+
1312
1318
  comparison?: Scope.Comparison | null;
1313
1319
  }
1314
1320
 
1315
1321
  export namespace Scope {
1322
+ export interface Breakdown {
1323
+ atAnchorId: string | null;
1324
+
1325
+ limit: number;
1326
+
1327
+ property: Breakdown.Property;
1328
+
1329
+ stepNumber: number | null;
1330
+
1331
+ truncated: boolean;
1332
+
1333
+ valueCount: number;
1334
+ }
1335
+
1336
+ export namespace Breakdown {
1337
+ export interface Property {
1338
+ property: string;
1339
+
1340
+ type: 'string' | 'number' | 'boolean';
1341
+
1342
+ path?: Array<string>;
1343
+ }
1344
+ }
1345
+
1316
1346
  export interface Comparison {
1317
1347
  from: string;
1318
1348
 
@@ -1338,6 +1368,8 @@ export namespace InsightResultsResponse {
1338
1368
  points: Array<Series.Point>;
1339
1369
 
1340
1370
  rangeValue: number | null;
1371
+
1372
+ segment?: Series.Segment | null;
1341
1373
  }
1342
1374
 
1343
1375
  export namespace Series {
@@ -1360,6 +1392,18 @@ export namespace InsightResultsResponse {
1360
1392
 
1361
1393
  smoothed: number | null;
1362
1394
  }
1395
+
1396
+ export interface Segment {
1397
+ key: string;
1398
+
1399
+ kind: 'value' | 'other' | 'not_set';
1400
+
1401
+ label: string;
1402
+
1403
+ rank: number;
1404
+
1405
+ value: string | null;
1406
+ }
1363
1407
  }
1364
1408
  }
1365
1409
 
@@ -1405,10 +1449,36 @@ export namespace InsightPreviewResponse {
1405
1449
 
1406
1450
  to: string;
1407
1451
 
1452
+ breakdown?: Scope.Breakdown | null;
1453
+
1408
1454
  comparison?: Scope.Comparison | null;
1409
1455
  }
1410
1456
 
1411
1457
  export namespace Scope {
1458
+ export interface Breakdown {
1459
+ atAnchorId: string | null;
1460
+
1461
+ limit: number;
1462
+
1463
+ property: Breakdown.Property;
1464
+
1465
+ stepNumber: number | null;
1466
+
1467
+ truncated: boolean;
1468
+
1469
+ valueCount: number;
1470
+ }
1471
+
1472
+ export namespace Breakdown {
1473
+ export interface Property {
1474
+ property: string;
1475
+
1476
+ type: 'string' | 'number' | 'boolean';
1477
+
1478
+ path?: Array<string>;
1479
+ }
1480
+ }
1481
+
1412
1482
  export interface Comparison {
1413
1483
  from: string;
1414
1484
 
@@ -1434,6 +1504,8 @@ export namespace InsightPreviewResponse {
1434
1504
  points: Array<Series.Point>;
1435
1505
 
1436
1506
  rangeValue: number | null;
1507
+
1508
+ segment?: Series.Segment | null;
1437
1509
  }
1438
1510
 
1439
1511
  export namespace Series {
@@ -1456,6 +1528,18 @@ export namespace InsightPreviewResponse {
1456
1528
 
1457
1529
  smoothed: number | null;
1458
1530
  }
1531
+
1532
+ export interface Segment {
1533
+ key: string;
1534
+
1535
+ kind: 'value' | 'other' | 'not_set';
1536
+
1537
+ label: string;
1538
+
1539
+ rank: number;
1540
+
1541
+ value: string | null;
1542
+ }
1459
1543
  }
1460
1544
  }
1461
1545
 
@@ -2018,8 +2102,18 @@ export interface InsightResultsParams {
2018
2102
  expectedRevision: string;
2019
2103
 
2020
2104
  /**
2021
- * Compare with the previous period, previous year, or a custom starting date.
2022
- * JSON-encoded in the REST query string; never saved.
2105
+ * Split results by a property. JSON object
2106
+ * {property:{property,path?,type},limit?}. type is string, number or boolean;
2107
+ * limit is 1–10 (default 5). Properties come from GET
2108
+ * /rest/v1/analytics/query-catalog. Example:
2109
+ * {"property":{"property":"event.source_name","type":"string"},"limit":5}
2110
+ */
2111
+ breakdown?: string;
2112
+
2113
+ /**
2114
+ * Compare with another range of the same length. JSON object {kind,from?}: kind is
2115
+ * previous_period, previous_year or custom; custom requires from (YYYY-MM-DD).
2116
+ * Example: {"kind":"previous_period"}
2023
2117
  */
2024
2118
  comparison?: string;
2025
2119
 
@@ -2045,8 +2139,9 @@ export interface InsightResultsParams {
2045
2139
  export interface InsightPreviewParams {
2046
2140
  /**
2047
2141
  * Object with required definition and reportContext, plus optional
2048
- * smoothingWindow, cumulative, and comparison. Chart view settings belong to saved
2049
- * reports. JSON-encode input in the REST query string; maximum 16384 bytes.
2142
+ * smoothingWindow, cumulative, comparison, and breakdown. Chart view settings
2143
+ * belong to saved reports. JSON-encode input in the REST query string; maximum
2144
+ * 16384 bytes.
2050
2145
  */
2051
2146
  input: string;
2052
2147
  }