@oursprivacy/platform-sdk 1.16.0 → 1.18.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.
@@ -0,0 +1,259 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { Cursor, type CursorParams, PagePromise } from '../core/pagination';
6
+ import { RequestOptions } from '../internal/request-options';
7
+
8
+ export class HeatmapPages extends APIResource {
9
+ /**
10
+ * List pages with heatmap coverage in a date window, ranked for triage. Each
11
+ * entity is identified by `pageKey` (origin + pathname, query string stripped);
12
+ * use that value to drill into `GET /rest/v1/heatmap-pages/summary`. Supports
13
+ * cursor pagination — the underlying store uses offset internally, so cursors are
14
+ * bounded to roughly 10,000 entries deep; if you need pages beyond that, narrow
15
+ * `from`/`to` or add filters rather than paginating further. `from`/`to` are UTC
16
+ * calendar days in `YYYY-MM-DD`; the window must be 60 days or fewer. Requires
17
+ * scope: web-analytics:view
18
+ */
19
+ list(
20
+ query: HeatmapPageListParams,
21
+ options?: RequestOptions,
22
+ ): PagePromise<HeatmapPageListResponsesCursor, HeatmapPageListResponse> {
23
+ return this._client.getAPIList('/rest/v1/heatmap-pages', Cursor<HeatmapPageListResponse>, {
24
+ query,
25
+ ...options,
26
+ });
27
+ }
28
+
29
+ /**
30
+ * Bundled per-page heatmap rollup: click bins, dead clicks, rage clicks, scroll
31
+ * depth, and up to 5 curated in-app replay URLs in a single payload. Designed as a
32
+ * one-call diagnosis surface for an AI assistant or marketer — answers "what is
33
+ * happening on this page?" without fanning out across five endpoints. `pageKey`
34
+ * comes from `GET /rest/v1/heatmap-pages`. The endpoint is identified by query
35
+ * params rather than a path id because heatmap pages are not stored entities; this
36
+ * is a documented derived-read exception. `breakpoint` scopes the bin/scroll
37
+ * aggregations; replays are returned across all breakpoints regardless of
38
+ * `breakpoint` (weighted to cover multiple viewports) so callers can compare
39
+ * devices. Requires scope: web-analytics:view
40
+ */
41
+ summary(query: HeatmapPageSummaryParams, options?: RequestOptions): APIPromise<HeatmapPageSummaryResponse> {
42
+ return this._client.get('/rest/v1/heatmap-pages/summary', { query, ...options });
43
+ }
44
+ }
45
+
46
+ export type HeatmapPageListResponsesCursor = Cursor<HeatmapPageListResponse>;
47
+
48
+ export interface HeatmapPageListResponse {
49
+ breakpoints: Array<HeatmapPageListResponse.Breakpoint>;
50
+
51
+ deadClicks: number;
52
+
53
+ deadRate: number;
54
+
55
+ issueScore: number;
56
+
57
+ /**
58
+ * Stable per-page identifier (origin + pathname, query string stripped). Use this
59
+ * as the `pageKey` argument to `GET /rest/v1/heatmap-pages/summary` and the
60
+ * heatmap MCP tools.
61
+ */
62
+ pageKey: string;
63
+
64
+ rageClicks: number;
65
+
66
+ rageRate: number;
67
+
68
+ totalClicks: number;
69
+ }
70
+
71
+ export namespace HeatmapPageListResponse {
72
+ export interface Breakpoint {
73
+ breakpoint: string;
74
+
75
+ clicks: number;
76
+ }
77
+ }
78
+
79
+ export interface HeatmapPageSummaryResponse {
80
+ /**
81
+ * Aggregated click positions for the requested breakpoint, bucketed into a 64×64
82
+ * grid normalized to the page viewport.
83
+ */
84
+ clickBins: Array<HeatmapPageSummaryResponse.ClickBin>;
85
+
86
+ /**
87
+ * Click positions where no interactive element was hit. `topElement` is the
88
+ * most-frequently-clicked non-interactive ancestor tag at that bucket, if
89
+ * attributable.
90
+ */
91
+ deadClicks: Array<HeatmapPageSummaryResponse.DeadClick>;
92
+
93
+ /**
94
+ * Click positions where repeated clicks were detected within a short window.
95
+ */
96
+ rageClicks: Array<HeatmapPageSummaryResponse.RageClick>;
97
+
98
+ /**
99
+ * Up to 5 curated replay links for this page, ranked by engagement and weighted to
100
+ * cover multiple viewport breakpoints when possible. Each entry is an absolute URL
101
+ * into the OursPrivacy web app — open it to view the recorded session.
102
+ */
103
+ replays: Array<HeatmapPageSummaryResponse.Replay>;
104
+
105
+ /**
106
+ * Distribution of how far visitors scrolled, bucketed in percent of page height.
107
+ * `sessions` is the count of distinct sessions that reached at least that bucket.
108
+ */
109
+ scrollDepth: Array<HeatmapPageSummaryResponse.ScrollDepth>;
110
+ }
111
+
112
+ export namespace HeatmapPageSummaryResponse {
113
+ export interface ClickBin {
114
+ binX: number;
115
+
116
+ binY: number;
117
+
118
+ clicks: number;
119
+ }
120
+
121
+ export interface DeadClick {
122
+ binX: number;
123
+
124
+ binY: number;
125
+
126
+ deadClicks: number;
127
+
128
+ topElement?: string | null;
129
+ }
130
+
131
+ export interface RageClick {
132
+ binX: number;
133
+
134
+ binY: number;
135
+
136
+ rageEvents: number;
137
+
138
+ totalClicks: number;
139
+ }
140
+
141
+ export interface Replay {
142
+ /**
143
+ * Viewport bucket the session was recorded under.
144
+ */
145
+ breakpoint: 'desktop' | 'mobile' | 'tablet';
146
+
147
+ /**
148
+ * Absolute link to view the session replay in the OursPrivacy web app. Opens the
149
+ * replayer pre-scoped to this session, visitor, and date.
150
+ */
151
+ url: string;
152
+ }
153
+
154
+ export interface ScrollDepth {
155
+ bucket: number;
156
+
157
+ sessions: number;
158
+ }
159
+ }
160
+
161
+ export interface HeatmapPageListParams extends CursorParams {
162
+ /**
163
+ * Inclusive lower bound of the heatmap window, as a UTC calendar day in
164
+ * `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
165
+ * fewer.
166
+ */
167
+ from: string;
168
+
169
+ /**
170
+ * Inclusive upper bound of the heatmap window, as a UTC calendar day in
171
+ * `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
172
+ * fewer.
173
+ */
174
+ to: string;
175
+
176
+ /**
177
+ * Filter by browser name as captured on events.
178
+ */
179
+ browserName?: string;
180
+
181
+ /**
182
+ * Filter by visitor country (ISO country name or code as stored on events).
183
+ */
184
+ country?: string;
185
+
186
+ /**
187
+ * Filter by visitor region (state/province as stored on events).
188
+ */
189
+ region?: string;
190
+
191
+ /**
192
+ * Case-insensitive substring match against `pageKey`.
193
+ */
194
+ search?: string;
195
+
196
+ /**
197
+ * Sort key. Defaults to `CLICKS` (descending).
198
+ */
199
+ sortBy?: 'CLICKS' | 'DEAD_RATE' | 'ISSUE_SCORE' | 'RAGE_RATE';
200
+
201
+ /**
202
+ * Sort direction. Defaults to `DESC`.
203
+ */
204
+ sortDir?: 'ASC' | 'DESC';
205
+ }
206
+
207
+ export interface HeatmapPageSummaryParams {
208
+ /**
209
+ * Viewport bucket the click, dead-click, rage, and scroll-depth aggregations are
210
+ * computed for. Replays are returned for all breakpoints regardless of this value
211
+ * so callers can compare across devices.
212
+ */
213
+ breakpoint: 'desktop' | 'mobile' | 'tablet';
214
+
215
+ /**
216
+ * Inclusive lower bound of the heatmap window, as a UTC calendar day in
217
+ * `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
218
+ * fewer.
219
+ */
220
+ from: string;
221
+
222
+ /**
223
+ * Page identifier returned by `GET /rest/v1/heatmap-pages`. Origin + pathname with
224
+ * the query string stripped (e.g. `https://example.com/pricing`).
225
+ */
226
+ pageKey: string;
227
+
228
+ /**
229
+ * Inclusive upper bound of the heatmap window, as a UTC calendar day in
230
+ * `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
231
+ * fewer.
232
+ */
233
+ to: string;
234
+
235
+ /**
236
+ * Filter by browser name as captured on events.
237
+ */
238
+ browserName?: string;
239
+
240
+ /**
241
+ * Filter by visitor country (ISO country name or code as stored on events).
242
+ */
243
+ country?: string;
244
+
245
+ /**
246
+ * Filter by visitor region (state/province as stored on events).
247
+ */
248
+ region?: string;
249
+ }
250
+
251
+ export declare namespace HeatmapPages {
252
+ export {
253
+ type HeatmapPageListResponse as HeatmapPageListResponse,
254
+ type HeatmapPageSummaryResponse as HeatmapPageSummaryResponse,
255
+ type HeatmapPageListResponsesCursor as HeatmapPageListResponsesCursor,
256
+ type HeatmapPageListParams as HeatmapPageListParams,
257
+ type HeatmapPageSummaryParams as HeatmapPageSummaryParams,
258
+ };
259
+ }
@@ -89,6 +89,14 @@ export {
89
89
  type GlobalDispatchCenterUpdateParams,
90
90
  type GlobalDispatchCenterListResponsesCursor,
91
91
  } from './global-dispatch-centers';
92
+ export {
93
+ HeatmapPages,
94
+ type HeatmapPageListResponse,
95
+ type HeatmapPageSummaryResponse,
96
+ type HeatmapPageListParams,
97
+ type HeatmapPageSummaryParams,
98
+ type HeatmapPageListResponsesCursor,
99
+ } from './heatmap-pages';
92
100
  export {
93
101
  Mappings,
94
102
  type MappingListResponse,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.16.0'; // x-release-please-version
1
+ export const VERSION = '1.18.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.16.0";
1
+ export declare const VERSION = "1.18.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.16.0";
1
+ export declare const VERSION = "1.18.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.16.0'; // x-release-please-version
4
+ exports.VERSION = '1.18.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.16.0'; // x-release-please-version
1
+ export const VERSION = '1.18.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map