@oursprivacy/platform-sdk 1.18.0 → 1.20.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 (71) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +8 -12
  3. package/client.d.mts +14 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +14 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js +12 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +12 -0
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/destination-types.d.mts +146 -0
  13. package/resources/destination-types.d.mts.map +1 -0
  14. package/resources/destination-types.d.ts +146 -0
  15. package/resources/destination-types.d.ts.map +1 -0
  16. package/resources/destination-types.js +28 -0
  17. package/resources/destination-types.js.map +1 -0
  18. package/resources/destination-types.mjs +24 -0
  19. package/resources/destination-types.mjs.map +1 -0
  20. package/resources/destinations.d.mts +67 -52
  21. package/resources/destinations.d.mts.map +1 -1
  22. package/resources/destinations.d.ts +67 -52
  23. package/resources/destinations.d.ts.map +1 -1
  24. package/resources/destinations.js +9 -3
  25. package/resources/destinations.js.map +1 -1
  26. package/resources/destinations.mjs +9 -3
  27. package/resources/destinations.mjs.map +1 -1
  28. package/resources/index.d.mts +5 -1
  29. package/resources/index.d.mts.map +1 -1
  30. package/resources/index.d.ts +5 -1
  31. package/resources/index.d.ts.map +1 -1
  32. package/resources/index.js +9 -1
  33. package/resources/index.js.map +1 -1
  34. package/resources/index.mjs +4 -0
  35. package/resources/index.mjs.map +1 -1
  36. package/resources/locations.d.mts +270 -0
  37. package/resources/locations.d.mts.map +1 -0
  38. package/resources/locations.d.ts +270 -0
  39. package/resources/locations.d.ts.map +1 -0
  40. package/resources/locations.js +48 -0
  41. package/resources/locations.js.map +1 -0
  42. package/resources/locations.mjs +44 -0
  43. package/resources/locations.mjs.map +1 -0
  44. package/resources/web-scanner-rules.d.mts +195 -0
  45. package/resources/web-scanner-rules.d.mts.map +1 -0
  46. package/resources/web-scanner-rules.d.ts +195 -0
  47. package/resources/web-scanner-rules.d.ts.map +1 -0
  48. package/resources/web-scanner-rules.js +48 -0
  49. package/resources/web-scanner-rules.js.map +1 -0
  50. package/resources/web-scanner-rules.mjs +44 -0
  51. package/resources/web-scanner-rules.mjs.map +1 -0
  52. package/resources/web-scanners.d.mts +199 -0
  53. package/resources/web-scanners.d.mts.map +1 -0
  54. package/resources/web-scanners.d.ts +199 -0
  55. package/resources/web-scanners.d.ts.map +1 -0
  56. package/resources/web-scanners.js +67 -0
  57. package/resources/web-scanners.js.map +1 -0
  58. package/resources/web-scanners.mjs +63 -0
  59. package/resources/web-scanners.mjs.map +1 -0
  60. package/src/client.ts +90 -0
  61. package/src/resources/destination-types.ts +373 -0
  62. package/src/resources/destinations.ts +239 -161
  63. package/src/resources/index.ts +39 -0
  64. package/src/resources/locations.ts +463 -0
  65. package/src/resources/web-scanner-rules.ts +304 -0
  66. package/src/resources/web-scanners.ts +333 -0
  67. package/src/version.ts +1 -1
  68. package/version.d.mts +1 -1
  69. package/version.d.ts +1 -1
  70. package/version.js +1 -1
  71. package/version.mjs +1 -1
@@ -0,0 +1,463 @@
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
+ import { path } from '../internal/utils/path';
7
+
8
+ export class Locations extends APIResource {
9
+ /**
10
+ * List every location for this account. Not paginated — each account has a small
11
+ * map-count limit (single digits in practice) so the response always fits in a
12
+ * single page. Requires scope: maps:list
13
+ */
14
+ list(options?: RequestOptions): APIPromise<LocationListResponse> {
15
+ return this._client.get('/rest/v1/locations', options);
16
+ }
17
+
18
+ /**
19
+ * Create a new location (map embed). All address fields are optional and can be
20
+ * filled in later via PATCH. Returns the slim entity with the server-assigned `id`
21
+ * so callers can immediately request `GET /rest/v1/locations/{id}/embed-code`.
22
+ * Requires scope: maps:create
23
+ */
24
+ create(body: LocationCreateParams, options?: RequestOptions): APIPromise<LocationCreateResponse> {
25
+ return this._client.post('/rest/v1/locations', { body, ...options });
26
+ }
27
+
28
+ /**
29
+ * Partially update a location. Only the fields you send are changed.
30
+ * `additionalAddresses` is replaced wholesale when sent — partial item updates are
31
+ * not merged. The map's computed center is recalculated on every PATCH from the
32
+ * latest coordinates. Requires scope: maps:update
33
+ */
34
+ update(
35
+ id: string,
36
+ body: LocationUpdateParams,
37
+ options?: RequestOptions,
38
+ ): APIPromise<LocationUpdateResponse> {
39
+ return this._client.patch(path`/rest/v1/locations/${id}`, { body, ...options });
40
+ }
41
+
42
+ /**
43
+ * Generate the paste-ready HTML embed snippet for a location. The response is a
44
+ * single self-contained HTML string (a `<style>` block + `<div>` wrapping an
45
+ * `<iframe>` pointed at the maps CDN for the current stage, plus an optional
46
+ * JSON-LD `<script>`). Customize the render with the optional query params
47
+ * (`color`, `theme`, `colorScheme`, `mapStyle`, `includeAddressBox`, `zoom`,
48
+ * `includeControls`, `includeSEOSchema`); all have sane defaults. Requires scope:
49
+ * maps:find
50
+ */
51
+ embedCode(
52
+ id: string,
53
+ query: LocationEmbedCodeParams | null | undefined = {},
54
+ options?: RequestOptions,
55
+ ): APIPromise<LocationEmbedCodeResponse> {
56
+ return this._client.get(path`/rest/v1/locations/${id}/embed-code`, { query, ...options });
57
+ }
58
+ }
59
+
60
+ export interface LocationListResponse {
61
+ entities: Array<LocationListResponse.Entity>;
62
+ }
63
+
64
+ export namespace LocationListResponse {
65
+ export interface Entity {
66
+ id: string;
67
+
68
+ accountId: string;
69
+
70
+ additionalAddresses?: Array<Entity.AdditionalAddress> | null;
71
+
72
+ center?: unknown | null;
73
+
74
+ city?: string | null;
75
+
76
+ country?: string | null;
77
+
78
+ createdAt?: string | null;
79
+
80
+ customDomain?: string | null;
81
+
82
+ latitude?: number | null;
83
+
84
+ line1?: string | null;
85
+
86
+ line2?: string | null;
87
+
88
+ longitude?: number | null;
89
+
90
+ mapName?: string | null;
91
+
92
+ name?: string | null;
93
+
94
+ phoneNumber?: string | null;
95
+
96
+ state?: string | null;
97
+
98
+ updatedAt?: string | null;
99
+
100
+ websiteLinkText?: string | null;
101
+
102
+ websiteUrl?: string | null;
103
+
104
+ zip?: string | null;
105
+ }
106
+
107
+ export namespace Entity {
108
+ export interface AdditionalAddress {
109
+ city?: string | null;
110
+
111
+ country?: string | null;
112
+
113
+ latitude?: number | null;
114
+
115
+ line1?: string | null;
116
+
117
+ line2?: string | null;
118
+
119
+ longitude?: number | null;
120
+
121
+ name?: string | null;
122
+
123
+ phoneNumber?: string | null;
124
+
125
+ state?: string | null;
126
+
127
+ websiteLinkText?: string | null;
128
+
129
+ websiteUrl?: string | null;
130
+
131
+ zip?: string | null;
132
+ }
133
+ }
134
+ }
135
+
136
+ export interface LocationCreateResponse {
137
+ id: string;
138
+
139
+ accountId: string;
140
+
141
+ additionalAddresses?: Array<LocationCreateResponse.AdditionalAddress> | null;
142
+
143
+ center?: unknown | null;
144
+
145
+ city?: string | null;
146
+
147
+ country?: string | null;
148
+
149
+ createdAt?: string | null;
150
+
151
+ customDomain?: string | null;
152
+
153
+ latitude?: number | null;
154
+
155
+ line1?: string | null;
156
+
157
+ line2?: string | null;
158
+
159
+ longitude?: number | null;
160
+
161
+ mapName?: string | null;
162
+
163
+ name?: string | null;
164
+
165
+ phoneNumber?: string | null;
166
+
167
+ state?: string | null;
168
+
169
+ updatedAt?: string | null;
170
+
171
+ websiteLinkText?: string | null;
172
+
173
+ websiteUrl?: string | null;
174
+
175
+ zip?: string | null;
176
+ }
177
+
178
+ export namespace LocationCreateResponse {
179
+ export interface AdditionalAddress {
180
+ city?: string | null;
181
+
182
+ country?: string | null;
183
+
184
+ latitude?: number | null;
185
+
186
+ line1?: string | null;
187
+
188
+ line2?: string | null;
189
+
190
+ longitude?: number | null;
191
+
192
+ name?: string | null;
193
+
194
+ phoneNumber?: string | null;
195
+
196
+ state?: string | null;
197
+
198
+ websiteLinkText?: string | null;
199
+
200
+ websiteUrl?: string | null;
201
+
202
+ zip?: string | null;
203
+ }
204
+ }
205
+
206
+ export interface LocationUpdateResponse {
207
+ id: string;
208
+
209
+ accountId: string;
210
+
211
+ additionalAddresses?: Array<LocationUpdateResponse.AdditionalAddress> | null;
212
+
213
+ center?: unknown | null;
214
+
215
+ city?: string | null;
216
+
217
+ country?: string | null;
218
+
219
+ createdAt?: string | null;
220
+
221
+ customDomain?: string | null;
222
+
223
+ latitude?: number | null;
224
+
225
+ line1?: string | null;
226
+
227
+ line2?: string | null;
228
+
229
+ longitude?: number | null;
230
+
231
+ mapName?: string | null;
232
+
233
+ name?: string | null;
234
+
235
+ phoneNumber?: string | null;
236
+
237
+ state?: string | null;
238
+
239
+ updatedAt?: string | null;
240
+
241
+ websiteLinkText?: string | null;
242
+
243
+ websiteUrl?: string | null;
244
+
245
+ zip?: string | null;
246
+ }
247
+
248
+ export namespace LocationUpdateResponse {
249
+ export interface AdditionalAddress {
250
+ city?: string | null;
251
+
252
+ country?: string | null;
253
+
254
+ latitude?: number | null;
255
+
256
+ line1?: string | null;
257
+
258
+ line2?: string | null;
259
+
260
+ longitude?: number | null;
261
+
262
+ name?: string | null;
263
+
264
+ phoneNumber?: string | null;
265
+
266
+ state?: string | null;
267
+
268
+ websiteLinkText?: string | null;
269
+
270
+ websiteUrl?: string | null;
271
+
272
+ zip?: string | null;
273
+ }
274
+ }
275
+
276
+ export interface LocationEmbedCodeResponse {
277
+ /**
278
+ * Self-contained HTML snippet (a `<style>` + `<div>` wrapping an `<iframe>`, plus
279
+ * an optional JSON-LD `<script>`) ready to paste into any page. The iframe `src`
280
+ * points to the maps CDN for the current stage.
281
+ */
282
+ embedCode: string;
283
+ }
284
+
285
+ export interface LocationCreateParams {
286
+ additionalAddresses?: Array<LocationCreateParams.AdditionalAddress> | null;
287
+
288
+ center?: unknown | null;
289
+
290
+ city?: string | null;
291
+
292
+ country?: string | null;
293
+
294
+ customDomain?: string | null;
295
+
296
+ latitude?: number | null;
297
+
298
+ line1?: string | null;
299
+
300
+ line2?: string | null;
301
+
302
+ longitude?: number | null;
303
+
304
+ mapName?: string | null;
305
+
306
+ name?: string | null;
307
+
308
+ phoneNumber?: string | null;
309
+
310
+ state?: string | null;
311
+
312
+ websiteLinkText?: string | null;
313
+
314
+ websiteUrl?: string | null;
315
+
316
+ zip?: string | null;
317
+ }
318
+
319
+ export namespace LocationCreateParams {
320
+ export interface AdditionalAddress {
321
+ latitude: number;
322
+
323
+ longitude: number;
324
+
325
+ city?: string | null;
326
+
327
+ country?: string | null;
328
+
329
+ line1?: string | null;
330
+
331
+ line2?: string | null;
332
+
333
+ name?: string | null;
334
+
335
+ phoneNumber?: string | null;
336
+
337
+ state?: string | null;
338
+
339
+ websiteLinkText?: string | null;
340
+
341
+ websiteUrl?: string | null;
342
+
343
+ zip?: string | null;
344
+ }
345
+ }
346
+
347
+ export interface LocationUpdateParams {
348
+ additionalAddresses?: Array<LocationUpdateParams.AdditionalAddress> | null;
349
+
350
+ center?: unknown | null;
351
+
352
+ city?: string | null;
353
+
354
+ country?: string | null;
355
+
356
+ customDomain?: string | null;
357
+
358
+ latitude?: number | null;
359
+
360
+ line1?: string | null;
361
+
362
+ line2?: string | null;
363
+
364
+ longitude?: number | null;
365
+
366
+ mapName?: string | null;
367
+
368
+ name?: string | null;
369
+
370
+ phoneNumber?: string | null;
371
+
372
+ state?: string | null;
373
+
374
+ websiteLinkText?: string | null;
375
+
376
+ websiteUrl?: string | null;
377
+
378
+ zip?: string | null;
379
+ }
380
+
381
+ export namespace LocationUpdateParams {
382
+ export interface AdditionalAddress {
383
+ latitude: number;
384
+
385
+ longitude: number;
386
+
387
+ city?: string | null;
388
+
389
+ country?: string | null;
390
+
391
+ line1?: string | null;
392
+
393
+ line2?: string | null;
394
+
395
+ name?: string | null;
396
+
397
+ phoneNumber?: string | null;
398
+
399
+ state?: string | null;
400
+
401
+ websiteLinkText?: string | null;
402
+
403
+ websiteUrl?: string | null;
404
+
405
+ zip?: string | null;
406
+ }
407
+ }
408
+
409
+ export interface LocationEmbedCodeParams {
410
+ /**
411
+ * Brand color used in the embedded map UI. Any CSS color string.
412
+ */
413
+ color?: string;
414
+
415
+ /**
416
+ * Light or dark color scheme.
417
+ */
418
+ colorScheme?: 'light' | 'dark';
419
+
420
+ /**
421
+ * Render the address sidebar overlay next to the map. Send `false` to hide.
422
+ */
423
+ includeAddressBox?: boolean;
424
+
425
+ /**
426
+ * Whether the embed renders map controls. `accessible` enables keyboard-navigable
427
+ * controls.
428
+ */
429
+ includeControls?: 'yes' | 'no' | 'accessible';
430
+
431
+ /**
432
+ * Emit a `schema.org` Place JSON-LD block alongside the iframe so search engines
433
+ * can index the location.
434
+ */
435
+ includeSEOSchema?: boolean;
436
+
437
+ /**
438
+ * Base map style.
439
+ */
440
+ mapStyle?: 'Standard' | 'Monochrome';
441
+
442
+ /**
443
+ * Visual theme variant.
444
+ */
445
+ theme?: 'default' | 'modern';
446
+
447
+ /**
448
+ * Initial map zoom level (Google-style 1–20).
449
+ */
450
+ zoom?: number;
451
+ }
452
+
453
+ export declare namespace Locations {
454
+ export {
455
+ type LocationListResponse as LocationListResponse,
456
+ type LocationCreateResponse as LocationCreateResponse,
457
+ type LocationUpdateResponse as LocationUpdateResponse,
458
+ type LocationEmbedCodeResponse as LocationEmbedCodeResponse,
459
+ type LocationCreateParams as LocationCreateParams,
460
+ type LocationUpdateParams as LocationUpdateParams,
461
+ type LocationEmbedCodeParams as LocationEmbedCodeParams,
462
+ };
463
+ }