@oursprivacy/platform-sdk 1.59.0 → 1.61.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 (68) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +58 -15
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts.map +1 -1
  5. package/client.js +10 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs +10 -1
  8. package/client.mjs.map +1 -1
  9. package/core/error.d.mts.map +1 -1
  10. package/core/error.d.ts.map +1 -1
  11. package/core/error.js +2 -1
  12. package/core/error.js.map +1 -1
  13. package/core/error.mjs +2 -1
  14. package/core/error.mjs.map +1 -1
  15. package/internal/utils/log.d.mts +5 -0
  16. package/internal/utils/log.d.mts.map +1 -1
  17. package/internal/utils/log.d.ts +5 -0
  18. package/internal/utils/log.d.ts.map +1 -1
  19. package/internal/utils/log.js +62 -1
  20. package/internal/utils/log.js.map +1 -1
  21. package/internal/utils/log.mjs +60 -0
  22. package/internal/utils/log.mjs.map +1 -1
  23. package/package.json +1 -12
  24. package/resources/destinations.d.mts +7 -7
  25. package/resources/destinations.d.mts.map +1 -1
  26. package/resources/destinations.d.ts +7 -7
  27. package/resources/destinations.d.ts.map +1 -1
  28. package/resources/experiment-settings.d.mts +24 -14
  29. package/resources/experiment-settings.d.mts.map +1 -1
  30. package/resources/experiment-settings.d.ts +24 -14
  31. package/resources/experiment-settings.d.ts.map +1 -1
  32. package/resources/experiment-settings.js +8 -4
  33. package/resources/experiment-settings.js.map +1 -1
  34. package/resources/experiment-settings.mjs +8 -4
  35. package/resources/experiment-settings.mjs.map +1 -1
  36. package/resources/heatmap-pages.d.mts +51 -28
  37. package/resources/heatmap-pages.d.mts.map +1 -1
  38. package/resources/heatmap-pages.d.ts +51 -28
  39. package/resources/heatmap-pages.d.ts.map +1 -1
  40. package/resources/heatmap-pages.js +23 -17
  41. package/resources/heatmap-pages.js.map +1 -1
  42. package/resources/heatmap-pages.mjs +23 -17
  43. package/resources/heatmap-pages.mjs.map +1 -1
  44. package/resources/test-events.d.mts +6 -0
  45. package/resources/test-events.d.mts.map +1 -1
  46. package/resources/test-events.d.ts +6 -0
  47. package/resources/test-events.d.ts.map +1 -1
  48. package/resources/web-scanners.d.mts +6 -3
  49. package/resources/web-scanners.d.mts.map +1 -1
  50. package/resources/web-scanners.d.ts +6 -3
  51. package/resources/web-scanners.d.ts.map +1 -1
  52. package/resources/web-scanners.js +4 -1
  53. package/resources/web-scanners.js.map +1 -1
  54. package/resources/web-scanners.mjs +4 -1
  55. package/resources/web-scanners.mjs.map +1 -1
  56. package/src/client.ts +10 -0
  57. package/src/core/error.ts +2 -1
  58. package/src/internal/utils/log.ts +64 -0
  59. package/src/resources/destinations.ts +9 -2
  60. package/src/resources/experiment-settings.ts +24 -14
  61. package/src/resources/heatmap-pages.ts +53 -28
  62. package/src/resources/test-events.ts +7 -0
  63. package/src/resources/web-scanners.ts +6 -3
  64. package/src/version.ts +1 -1
  65. package/version.d.mts +1 -1
  66. package/version.d.ts +1 -1
  67. package/version.js +1 -1
  68. package/version.mjs +1 -1
@@ -8,14 +8,15 @@ import { RequestOptions } from '../internal/request-options';
8
8
  export class HeatmapPages extends APIResource {
9
9
  /**
10
10
  * List pages with heatmap coverage in a date window, ranked for triage. Each
11
- * entity is identified by `pageKey`, normally origin + pathname with the query
12
- * string stripped; an account-configured split may include one significant query
13
- * parameter. Preserve the returned `pageKey` when calling
14
- * `GET /rest/v1/heatmap-pages/summary`. Supports cursor pagination, with cursor
15
- * depth capped at roughly 10,000 entries; if you need pages beyond that, narrow
16
- * `from`/`to` or add filters rather than paginating further. `from`/`to` are UTC
17
- * calendar days in `YYYY-MM-DD`; the window must be 60 days or fewer. Requires
18
- * API-key scope or current OAuth user permission: web-analytics:view
11
+ * entity is identified by `pageKey` (origin + pathname, query string stripped).
12
+ * Use `queryParameterFilter` to inspect one survey step or other URL parameter
13
+ * value; filtering narrows events without creating separate page rows. Pass the
14
+ * same filter and returned `pageKey` to `GET /rest/v1/heatmap-pages/summary`.
15
+ * Supports cursor pagination, with cursor depth capped at roughly 10,000 entries;
16
+ * if you need pages beyond that, narrow `from`/`to` or add filters rather than
17
+ * paginating further. `from`/`to` are UTC calendar days in `YYYY-MM-DD`; the
18
+ * window must be 60 days or fewer. Requires API-key scope or current OAuth user
19
+ * permission: web-analytics:view
19
20
  */
20
21
  list(
21
22
  query: HeatmapPageListParams,
@@ -32,15 +33,20 @@ export class HeatmapPages extends APIResource {
32
33
  * depth, and up to 5 curated in-app replay URLs in a single payload. Designed as a
33
34
  * one-call diagnosis surface for an AI assistant or marketer — answers "what is
34
35
  * happening on this page?" without fanning out across five endpoints. `pageKey`
35
- * comes from `GET /rest/v1/heatmap-pages`. The endpoint is identified by query
36
- * params rather than a path id because heatmap pages are not stored entities; this
37
- * is a documented derived-read exception. `breakpoint` scopes the bin/scroll
38
- * aggregations; replays are returned across all breakpoints regardless of
39
- * `breakpoint` (weighted to cover multiple viewports) so callers can compare
40
- * devices. `clickGrid` always supplies fine click positions for rendering.
41
- * `clickBins` derives compatible 64×64 counts from the same grid; its totals must
42
- * not be added to them. Requires API-key scope or current OAuth user permission:
43
- * web-analytics:view
36
+ * comes from `GET /rest/v1/heatmap-pages`. A base key includes all query variants
37
+ * regardless of saved splits. Reuse the same `queryParameterFilter` to scope all
38
+ * aggregates and replay links to the selected survey step. Legacy saved split keys
39
+ * remain supported without a filter; combining a query string in `pageKey` with
40
+ * `queryParameterFilter` returns 400. This reads retained historical events
41
+ * containing the parameter, requires no account setting, and does not change
42
+ * web-analytics page paths. The endpoint is identified by query params rather than
43
+ * a path id because heatmap pages are not stored entities; this is a documented
44
+ * derived-read exception. `breakpoint` scopes the bin/scroll aggregations; replays
45
+ * are returned across all breakpoints regardless of `breakpoint` (weighted to
46
+ * cover multiple viewports) so callers can compare devices. `clickGrid` always
47
+ * supplies fine click positions for rendering. `clickBins` derives compatible
48
+ * 64×64 counts from the same grid; its totals must not be added to them. Requires
49
+ * API-key scope or current OAuth user permission: web-analytics:view
44
50
  */
45
51
  summary(query: HeatmapPageSummaryParams, options?: RequestOptions): APIPromise<HeatmapPageSummaryResponse> {
46
52
  return this._client.get('/rest/v1/heatmap-pages/summary', { query, ...options });
@@ -59,10 +65,9 @@ export interface HeatmapPageListResponse {
59
65
  issueScore: number;
60
66
 
61
67
  /**
62
- * Stable per-page identifier. It is normally origin + pathname with the query
63
- * string stripped, but an account-configured split may include one significant
64
- * query parameter. Preserve the returned value when calling
65
- * `GET /rest/v1/heatmap-pages/summary` and the heatmap MCP tools.
68
+ * Stable per-page identifier: origin + pathname with the query string stripped.
69
+ * Query-parameter filtering narrows events without changing this key. Use the same
70
+ * filter when requesting the page summary.
66
71
  */
67
72
  pageKey: string;
68
73
 
@@ -175,7 +180,7 @@ export namespace HeatmapPageSummaryResponse {
175
180
  /**
176
181
  * Viewport bucket the session was recorded under.
177
182
  */
178
- breakpoint: 'desktop' | 'mobile' | 'tablet';
183
+ breakpoint: 'mobile' | 'tablet' | 'desktop';
179
184
 
180
185
  /**
181
186
  * Absolute link to view the session replay in the OursPrivacy web app. Opens the
@@ -216,6 +221,16 @@ export interface HeatmapPageListParams extends CursorParams {
216
221
  */
217
222
  country?: string;
218
223
 
224
+ /**
225
+ * Filter heatmap events by one URL query parameter, such as
226
+ * {"name":"p","values":["Contact Details"]}. Send as JSON in an HTTP query string
227
+ * and as an object in MCP. Matches any listed decoded value; values: [] matches
228
+ * any non-empty value. Apply the same filter to the list and summary. Works on
229
+ * retained historical events containing the parameter, requires no account
230
+ * setting, and does not change web-analytics page paths.
231
+ */
232
+ queryParameterFilter?: string;
233
+
219
234
  /**
220
235
  * Filter by visitor region (state/province as stored on events).
221
236
  */
@@ -229,7 +244,7 @@ export interface HeatmapPageListParams extends CursorParams {
229
244
  /**
230
245
  * Sort key. Defaults to `CLICKS` (descending).
231
246
  */
232
- sortBy?: 'CLICKS' | 'DEAD_RATE' | 'ISSUE_SCORE' | 'RAGE_RATE';
247
+ sortBy?: 'CLICKS' | 'RAGE_RATE' | 'DEAD_RATE' | 'ISSUE_SCORE';
233
248
 
234
249
  /**
235
250
  * Sort direction. Defaults to `DESC`.
@@ -243,7 +258,7 @@ export interface HeatmapPageSummaryParams {
243
258
  * computed for. Replays are returned for all breakpoints regardless of this value
244
259
  * so callers can compare across devices.
245
260
  */
246
- breakpoint: 'desktop' | 'mobile' | 'tablet';
261
+ breakpoint: 'mobile' | 'tablet' | 'desktop';
247
262
 
248
263
  /**
249
264
  * Inclusive lower bound of the heatmap window, as a UTC calendar day in
@@ -253,10 +268,10 @@ export interface HeatmapPageSummaryParams {
253
268
  from: string;
254
269
 
255
270
  /**
256
- * Page identifier returned by `GET /rest/v1/heatmap-pages`. It is normally
257
- * origin + pathname with the query string stripped, but may include one
258
- * account-configured significant query parameter. Pass the returned value
259
- * unchanged.
271
+ * Base page identifier returned by the heatmap pages list. Pass it unchanged,
272
+ * together with the same queryParameterFilter to inspect the same survey step. A
273
+ * legacy saved split key is accepted only without queryParameterFilter; combining
274
+ * them returns 400.
260
275
  */
261
276
  pageKey: string;
262
277
 
@@ -277,6 +292,16 @@ export interface HeatmapPageSummaryParams {
277
292
  */
278
293
  country?: string;
279
294
 
295
+ /**
296
+ * Filter heatmap events by one URL query parameter, such as
297
+ * {"name":"p","values":["Contact Details"]}. Send as JSON in an HTTP query string
298
+ * and as an object in MCP. Matches any listed decoded value; values: [] matches
299
+ * any non-empty value. Apply the same filter to the list and summary. Works on
300
+ * retained historical events containing the parameter, requires no account
301
+ * setting, and does not change web-analytics page paths.
302
+ */
303
+ queryParameterFilter?: string;
304
+
280
305
  /**
281
306
  * Filter by visitor region (state/province as stored on events).
282
307
  */
@@ -331,6 +331,13 @@ export namespace TestEventCreateParams {
331
331
  */
332
332
  adset_id?: string | null;
333
333
 
334
+ /**
335
+ * The raw Affiliatly tracking cookie value (affiliatly_v3), set by the Affiliatly
336
+ * script when a visitor lands from an affiliate link. Web-only. Ex:
337
+ * id_hash=abc&id_user=123&aff_uid=45
338
+ */
339
+ affiliatly_v3?: string | null;
340
+
334
341
  /**
335
342
  * The AppLovin alart query parameter. Ex: alart123
336
343
  */
@@ -246,11 +246,14 @@ export class WebScanners extends APIResource {
246
246
  * used to select the run) to read an earlier run. Cookies paginate with `limit`
247
247
  * and `offset` (a documented exception to the cursor-pagination standard, since
248
248
  * each run is an immutable snapshot); local-storage entries are returned in full.
249
+ * A missing id and an id this credential cannot access return the same 404.
249
250
  * Requires API-key scope or current OAuth user permission: webScanner:find
250
251
  *
251
252
  * @example
252
253
  * ```ts
253
- * const response = await client.webScanners.cookies('id');
254
+ * const response = await client.webScanners.cookies(
255
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
256
+ * );
254
257
  * ```
255
258
  */
256
259
  cookies(
@@ -1625,12 +1628,12 @@ export interface WebScannerCookiesParams {
1625
1628
  date?: string;
1626
1629
 
1627
1630
  /**
1628
- * Maximum number of findings to return. Defaults to 25; clamped to 1–100.
1631
+ * Maximum number of cookies to return, from 1 to 100. Defaults to 25.
1629
1632
  */
1630
1633
  limit?: number;
1631
1634
 
1632
1635
  /**
1633
- * Skip this many findings before returning. Use with `limit` for load-more paging.
1636
+ * Skip this many cookies before returning. Use with `limit` for load-more paging.
1634
1637
  */
1635
1638
  offset?: number | null;
1636
1639
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.59.0'; // x-release-please-version
1
+ export const VERSION = '1.61.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.59.0";
1
+ export declare const VERSION = "1.61.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.59.0";
1
+ export declare const VERSION = "1.61.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.59.0'; // x-release-please-version
4
+ exports.VERSION = '1.61.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.59.0'; // x-release-please-version
1
+ export const VERSION = '1.61.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map