@oursprivacy/platform-sdk 1.69.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 (43) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/client.d.mts +5 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +5 -2
  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/index.d.mts +2 -1
  12. package/resources/index.d.mts.map +1 -1
  13. package/resources/index.d.ts +2 -1
  14. package/resources/index.d.ts.map +1 -1
  15. package/resources/index.js +3 -1
  16. package/resources/index.js.map +1 -1
  17. package/resources/index.mjs +1 -0
  18. package/resources/index.mjs.map +1 -1
  19. package/resources/locations.d.mts +653 -13
  20. package/resources/locations.d.mts.map +1 -1
  21. package/resources/locations.d.ts +653 -13
  22. package/resources/locations.d.ts.map +1 -1
  23. package/resources/locations.js +10 -3
  24. package/resources/locations.js.map +1 -1
  25. package/resources/locations.mjs +10 -3
  26. package/resources/locations.mjs.map +1 -1
  27. package/resources/query-dispatches.d.mts +241 -0
  28. package/resources/query-dispatches.d.mts.map +1 -0
  29. package/resources/query-dispatches.d.ts +241 -0
  30. package/resources/query-dispatches.d.ts.map +1 -0
  31. package/resources/query-dispatches.js +56 -0
  32. package/resources/query-dispatches.js.map +1 -0
  33. package/resources/query-dispatches.mjs +52 -0
  34. package/resources/query-dispatches.mjs.map +1 -0
  35. package/src/client.ts +25 -0
  36. package/src/resources/index.ts +11 -0
  37. package/src/resources/locations.ts +690 -12
  38. package/src/resources/query-dispatches.ts +323 -0
  39. package/src/version.ts +1 -1
  40. package/version.d.mts +1 -1
  41. package/version.d.ts +1 -1
  42. package/version.js +1 -1
  43. package/version.mjs +1 -1
@@ -0,0 +1,323 @@
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 { RequestOptions } from '../internal/request-options';
6
+
7
+ export class QueryDispatches extends APIResource {
8
+ /**
9
+ * Return the Query Dispatches query version, date-range limits, and breakdown
10
+ * limits. Requires the API-key scope `report:view-dispatch`. Requires API-key
11
+ * scope or current OAuth user permission: report:view-dispatch
12
+ */
13
+ capabilities(options?: RequestOptions): APIPromise<QueryDispatchCapabilitiesResponse> {
14
+ return this._client.get('/rest/v1/query-dispatches/capabilities', options);
15
+ }
16
+
17
+ /**
18
+ * Count dispatches to destinations, grouped by up to two of destination,
19
+ * destination type, status, reason, event name, source, or identifier, optionally
20
+ * per hour or day. Use it for dispatch health over a window (filter
21
+ * `destinationIds`, group by `STATUS` and `REASON`), dispatches per event and day
22
+ * (filter `eventNames`, `timeGrain: DAY`), or identifier coverage per destination.
23
+ * To diagnose delivery problems, group by `STATUS` and `REASON` rather than
24
+ * filtering to `FAILED`, since `NOT_SENT` also covers destination settings to fix.
25
+ * JSON-encode `input` and `breakdown` in the query string. Returns counts only,
26
+ * never dispatch payloads or visitor identifiers. A destination or source ID this
27
+ * account does not own returns 404. Requires the API-key scope
28
+ * `report:view-dispatch`. Requires API-key scope or current OAuth user permission:
29
+ * report:view-dispatch
30
+ */
31
+ breakdown(
32
+ query: QueryDispatchBreakdownParams,
33
+ options?: RequestOptions,
34
+ ): APIPromise<QueryDispatchBreakdownResponse> {
35
+ return this._client.get('/rest/v1/query-dispatches/breakdown', { query, ...options });
36
+ }
37
+
38
+ /**
39
+ * List the values seen for one dispatch dimension in a date range, with dispatch
40
+ * counts, such as the failure reasons or event names to filter a breakdown by.
41
+ * Counts include test events; set `includeTestEvents` on the breakdown to match
42
+ * them. JSON-encode `input` in the query string. A destination ID this account
43
+ * does not own returns 404. Requires the API-key scope `report:view-dispatch`.
44
+ * Requires API-key scope or current OAuth user permission: report:view-dispatch
45
+ */
46
+ facetValues(
47
+ query: QueryDispatchFacetValuesParams,
48
+ options?: RequestOptions,
49
+ ): APIPromise<QueryDispatchFacetValuesResponse> {
50
+ return this._client.get('/rest/v1/query-dispatches/facet-values', { query, ...options });
51
+ }
52
+
53
+ /**
54
+ * Suggest the payload field paths and value types sent to destinations, from a
55
+ * sample of recent dispatches, to check which mapped fields a destination
56
+ * receives. Returns paths and types only, never values. JSON-encode the optional
57
+ * `input` in the query string. A destination ID this account does not own
58
+ * returns 404. Requires the API-key scope `report:view-dispatch`. Requires API-key
59
+ * scope or current OAuth user permission: report:view-dispatch
60
+ */
61
+ propertySuggestions(
62
+ query: QueryDispatchPropertySuggestionsParams | null | undefined = {},
63
+ options?: RequestOptions,
64
+ ): APIPromise<QueryDispatchPropertySuggestionsResponse> {
65
+ return this._client.get('/rest/v1/query-dispatches/property-suggestions', { query, ...options });
66
+ }
67
+ }
68
+
69
+ export interface QueryDispatchCapabilitiesResponse {
70
+ /**
71
+ * Days covered when property suggestions omit from.
72
+ */
73
+ defaultDateRangeDays: number;
74
+
75
+ /**
76
+ * Most dimensions in one breakdown.
77
+ */
78
+ maxBreakdownDimensions: number;
79
+
80
+ /**
81
+ * Most groups returned before the rest fold into otherDispatches.
82
+ */
83
+ maxBreakdownGroups: number;
84
+
85
+ /**
86
+ * Longest from-to range, in days.
87
+ */
88
+ maxDateRangeDays: number;
89
+
90
+ /**
91
+ * Longest range, in days, for an HOUR time grain.
92
+ */
93
+ maxHourlyDateRangeDays: number;
94
+
95
+ /**
96
+ * Query format version to send as input.version.
97
+ */
98
+ version: number;
99
+ }
100
+
101
+ export interface QueryDispatchBreakdownResponse {
102
+ /**
103
+ * Dispatches in groups past the limit. Zero when grouped by IDENTIFIER, since a
104
+ * dispatch can count in several groups.
105
+ */
106
+ otherDispatches: number;
107
+
108
+ /**
109
+ * Largest groups first, up to the group limit in capabilities.
110
+ */
111
+ rows: Array<QueryDispatchBreakdownResponse.Row>;
112
+
113
+ /**
114
+ * All dispatches matching input.
115
+ */
116
+ totalDispatches: number;
117
+
118
+ /**
119
+ * True when groups beyond the group limit were folded into otherDispatches.
120
+ */
121
+ truncated: boolean;
122
+ }
123
+
124
+ export namespace QueryDispatchBreakdownResponse {
125
+ export interface Row {
126
+ /**
127
+ * Dispatches matching the keys other than IDENTIFIER: the denominator for
128
+ * identifier coverage.
129
+ */
130
+ baseDispatches: number;
131
+
132
+ /**
133
+ * Start of the time bucket; null without a time grain.
134
+ */
135
+ bucket: string | null;
136
+
137
+ /**
138
+ * Dispatches in this group. Under an IDENTIFIER key, those carrying it.
139
+ */
140
+ dispatches: number;
141
+
142
+ /**
143
+ * Per-identifier counts when breakdown.identifiers was set.
144
+ */
145
+ identifierCounts: Array<Row.IdentifierCount>;
146
+
147
+ /**
148
+ * One key per requested dimension, in request order.
149
+ */
150
+ keys: Array<Row.Key>;
151
+ }
152
+
153
+ export namespace Row {
154
+ export interface IdentifierCount {
155
+ /**
156
+ * Dispatches in the row to destination types that use the identifier: the
157
+ * denominator for its coverage.
158
+ */
159
+ applicableDispatches: number;
160
+
161
+ /**
162
+ * Dispatches in the row that carried the identifier.
163
+ */
164
+ count: number;
165
+
166
+ /**
167
+ * Identifier a destination can match on. CLICK_ID is the destination platform's
168
+ * own click ID, such as ttclid or msclkid.
169
+ */
170
+ identifier:
171
+ | 'EMAIL'
172
+ | 'PHONE'
173
+ | 'EXTERNAL_ID'
174
+ | 'FBC'
175
+ | 'FBP'
176
+ | 'GCLID'
177
+ | 'GBRAID'
178
+ | 'WBRAID'
179
+ | 'CLICK_ID'
180
+ | 'IP_ADDRESS'
181
+ | 'USER_AGENT';
182
+ }
183
+
184
+ export interface Key {
185
+ /**
186
+ * Dimension to group by. IDENTIFIER makes one group per identifier a dispatch
187
+ * carried, so a dispatch counts once in each.
188
+ */
189
+ dimension:
190
+ 'DESTINATION' | 'DESTINATION_TYPE' | 'STATUS' | 'REASON' | 'EVENT_NAME' | 'SOURCE' | 'IDENTIFIER';
191
+
192
+ /**
193
+ * Display name for the value, such as the destination name, when one exists.
194
+ */
195
+ label: string | null;
196
+
197
+ /**
198
+ * Group value, such as a destination ID or event name; null when absent.
199
+ */
200
+ value: string | null;
201
+ }
202
+ }
203
+ }
204
+
205
+ export interface QueryDispatchFacetValuesResponse {
206
+ /**
207
+ * Start of the counted range.
208
+ */
209
+ from: string;
210
+
211
+ /**
212
+ * Exclusive end of the counted range.
213
+ */
214
+ to: string;
215
+
216
+ /**
217
+ * Most frequent values first, up to 100.
218
+ */
219
+ values: Array<QueryDispatchFacetValuesResponse.Value>;
220
+ }
221
+
222
+ export namespace QueryDispatchFacetValuesResponse {
223
+ export interface Value {
224
+ /**
225
+ * Dispatches with this value in the range, test events included.
226
+ */
227
+ count: number;
228
+
229
+ /**
230
+ * Display name for the value, when one exists.
231
+ */
232
+ label: string | null;
233
+
234
+ /**
235
+ * Value to use in a breakdown filter.
236
+ */
237
+ value: string;
238
+ }
239
+ }
240
+
241
+ export interface QueryDispatchPropertySuggestionsResponse {
242
+ /**
243
+ * Payload field paths and types seen in a sample of recent dispatches; no values.
244
+ */
245
+ entities: Array<QueryDispatchPropertySuggestionsResponse.Entity>;
246
+
247
+ /**
248
+ * Start of the sampled range.
249
+ */
250
+ from: string;
251
+
252
+ /**
253
+ * True when the paths come from a sample, so rare paths may be missing.
254
+ */
255
+ sampled: boolean;
256
+
257
+ /**
258
+ * Exclusive end of the sampled range.
259
+ */
260
+ to: string;
261
+ }
262
+
263
+ export namespace QueryDispatchPropertySuggestionsResponse {
264
+ export interface Entity {
265
+ /**
266
+ * Payload path segments, outermost first. A `0` segment is the first array item.
267
+ */
268
+ path: Array<string>;
269
+
270
+ /**
271
+ * Always `dispatch.payload`: the payload sent to the destination.
272
+ */
273
+ property: string;
274
+
275
+ /**
276
+ * False when the path identifies a person, such as an email field.
277
+ */
278
+ supportsBreakdown: boolean;
279
+
280
+ /**
281
+ * Value type observed at this path.
282
+ */
283
+ type: 'string' | 'number' | 'boolean';
284
+ }
285
+ }
286
+
287
+ export interface QueryDispatchBreakdownParams {
288
+ /**
289
+ * How to group the counts. JSON-encode breakdown in the REST query string.
290
+ */
291
+ breakdown: string;
292
+
293
+ /**
294
+ * Which dispatches to count. JSON-encode input in the REST query string.
295
+ */
296
+ input: string;
297
+ }
298
+
299
+ export interface QueryDispatchFacetValuesParams {
300
+ /**
301
+ * Which values to list. JSON-encode input in the REST query string.
302
+ */
303
+ input: string;
304
+ }
305
+
306
+ export interface QueryDispatchPropertySuggestionsParams {
307
+ /**
308
+ * Which dispatches to sample. JSON-encode input in the REST query string.
309
+ */
310
+ input?: string;
311
+ }
312
+
313
+ export declare namespace QueryDispatches {
314
+ export {
315
+ type QueryDispatchCapabilitiesResponse as QueryDispatchCapabilitiesResponse,
316
+ type QueryDispatchBreakdownResponse as QueryDispatchBreakdownResponse,
317
+ type QueryDispatchFacetValuesResponse as QueryDispatchFacetValuesResponse,
318
+ type QueryDispatchPropertySuggestionsResponse as QueryDispatchPropertySuggestionsResponse,
319
+ type QueryDispatchBreakdownParams as QueryDispatchBreakdownParams,
320
+ type QueryDispatchFacetValuesParams as QueryDispatchFacetValuesParams,
321
+ type QueryDispatchPropertySuggestionsParams as QueryDispatchPropertySuggestionsParams,
322
+ };
323
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.69.0'; // x-release-please-version
1
+ export const VERSION = '1.70.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.69.0";
1
+ export declare const VERSION = "1.70.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.69.0";
1
+ export declare const VERSION = "1.70.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.69.0'; // x-release-please-version
4
+ exports.VERSION = '1.70.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.69.0'; // x-release-please-version
1
+ export const VERSION = '1.70.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map