@oursprivacy/platform-sdk 1.30.0 → 1.32.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 (56) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/client.d.mts +4 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +4 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/consent-settings.d.mts +46 -0
  10. package/resources/consent-settings.d.mts.map +1 -1
  11. package/resources/consent-settings.d.ts +46 -0
  12. package/resources/consent-settings.d.ts.map +1 -1
  13. package/resources/destinations.d.mts +7 -7
  14. package/resources/destinations.d.mts.map +1 -1
  15. package/resources/destinations.d.ts +7 -7
  16. package/resources/destinations.d.ts.map +1 -1
  17. package/resources/experiments.d.mts +13 -13
  18. package/resources/experiments.d.mts.map +1 -1
  19. package/resources/experiments.d.ts +13 -13
  20. package/resources/experiments.d.ts.map +1 -1
  21. package/resources/experiments.js +3 -3
  22. package/resources/experiments.mjs +3 -3
  23. package/resources/index.d.mts +2 -2
  24. package/resources/index.d.mts.map +1 -1
  25. package/resources/index.d.ts +2 -2
  26. package/resources/index.d.ts.map +1 -1
  27. package/resources/index.js.map +1 -1
  28. package/resources/index.mjs.map +1 -1
  29. package/resources/versions.d.mts +618 -1
  30. package/resources/versions.d.mts.map +1 -1
  31. package/resources/versions.d.ts +618 -1
  32. package/resources/versions.d.ts.map +1 -1
  33. package/resources/versions.js +33 -0
  34. package/resources/versions.js.map +1 -1
  35. package/resources/versions.mjs +33 -0
  36. package/resources/versions.mjs.map +1 -1
  37. package/resources/web-scanners.d.mts +267 -1
  38. package/resources/web-scanners.d.mts.map +1 -1
  39. package/resources/web-scanners.d.ts +267 -1
  40. package/resources/web-scanners.d.ts.map +1 -1
  41. package/resources/web-scanners.js +44 -0
  42. package/resources/web-scanners.js.map +1 -1
  43. package/resources/web-scanners.mjs +44 -0
  44. package/resources/web-scanners.mjs.map +1 -1
  45. package/src/client.ts +18 -0
  46. package/src/resources/consent-settings.ts +54 -0
  47. package/src/resources/destinations.ts +9 -2
  48. package/src/resources/experiments.ts +13 -13
  49. package/src/resources/index.ts +9 -0
  50. package/src/resources/versions.ts +748 -0
  51. package/src/resources/web-scanners.ts +431 -0
  52. package/src/version.ts +1 -1
  53. package/version.d.mts +1 -1
  54. package/version.d.ts +1 -1
  55. package/version.js +1 -1
  56. package/version.mjs +1 -1
@@ -71,6 +71,65 @@ export class WebScanners extends APIResource {
71
71
  trigger(id: string, options?: RequestOptions): APIPromise<WebScannerTriggerResponse> {
72
72
  return this._client.post(path`/rest/v1/web-scanners/${id}/trigger`, options);
73
73
  }
74
+
75
+ /**
76
+ * List the third-party trackers (requests) found on a scan run, with their risk,
77
+ * category, the pages they were seen on, and whether each host is already covered
78
+ * by a CMP consent service. Defaults to the latest run; pass `date` (an ISO-8601
79
+ * timestamp; only the calendar day is used to select the run) to read an earlier
80
+ * run. Documented exception to the cursor-pagination standard: paginates with
81
+ * `limit` and `offset` because each run is an immutable snapshot. A host that is
82
+ * neither covered (`coveredByCmp: false`) nor matched by a suppression rule still
83
+ * needs a triage decision — resolve it by adding the host to a CMP consent service
84
+ * or by creating a suppression rule with `POST /rest/v1/web-scanner-rules`. Use
85
+ * `GET /rest/v1/web-scanners/{id}/summary` for the rolled-up counts. Requires
86
+ * scope: webScanner:find
87
+ */
88
+ findings(
89
+ id: string,
90
+ query: WebScannerFindingsParams | null | undefined = {},
91
+ options?: RequestOptions,
92
+ ): APIPromise<WebScannerFindingsResponse> {
93
+ return this._client.get(path`/rest/v1/web-scanners/${id}/findings`, { query, ...options });
94
+ }
95
+
96
+ /**
97
+ * List the cookies and local-storage entries observed on a scan run. Defaults to
98
+ * the latest run; pass `date` (an ISO-8601 timestamp; only the calendar day is
99
+ * used to select the run) to read an earlier run. Cookies paginate with `limit`
100
+ * and `offset` (a documented exception to the cursor-pagination standard, since
101
+ * each run is an immutable snapshot); local-storage entries are returned in full.
102
+ * Requires scope: webScanner:find
103
+ */
104
+ cookies(
105
+ id: string,
106
+ query: WebScannerCookiesParams | null | undefined = {},
107
+ options?: RequestOptions,
108
+ ): APIPromise<WebScannerCookiesResponse> {
109
+ return this._client.get(path`/rest/v1/web-scanners/${id}/cookies`, { query, ...options });
110
+ }
111
+
112
+ /**
113
+ * Compliance summary for a scan run — the rolled-up "what does this site look
114
+ * like, and what still needs a decision" view, assembled server-side so you do not
115
+ * have to page every finding. Includes total host/vendor/cookie counts, a
116
+ * breakdown by risk and by category, coverage (how many hosts are already covered
117
+ * by a CMP consent service or a suppression rule vs. how many still need a
118
+ * decision), the new/removed host delta versus the previous run, and up to 10
119
+ * highest-risk hosts that still need a decision. Defaults to the latest run; pass
120
+ * `date` (an ISO-8601 timestamp; only the calendar day is used to select the run)
121
+ * to read an earlier run. Clear a host that needs a decision by adding it to a CMP
122
+ * consent service or creating a suppression rule with
123
+ * `POST /rest/v1/web-scanner-rules`. When the scanner has no completed runs, every
124
+ * count is 0 and `runDate` is null. Requires scope: webScanner:find
125
+ */
126
+ summary(
127
+ id: string,
128
+ query: WebScannerSummaryParams | null | undefined = {},
129
+ options?: RequestOptions,
130
+ ): APIPromise<WebScannerSummaryResponse> {
131
+ return this._client.get(path`/rest/v1/web-scanners/${id}/summary`, { query, ...options });
132
+ }
74
133
  }
75
134
 
76
135
  export interface WebScannerListResponse {
@@ -271,6 +330,325 @@ export interface WebScannerTriggerResponse {
271
330
  urlLimit?: number | null;
272
331
  }
273
332
 
333
+ export interface WebScannerFindingsResponse {
334
+ /**
335
+ * True when more findings are available beyond the current window.
336
+ */
337
+ hasMore: boolean;
338
+
339
+ /**
340
+ * Third-party trackers seen on the run. `coveredByCmp` is true when the host is
341
+ * already mapped to a CMP consent service; `risk` is high/medium/low/unknown.
342
+ * Hosts that are neither covered nor matched by a suppression rule are the ones
343
+ * that need a triage decision — clear them by adding the host to a CMP consent
344
+ * service or creating a suppression rule (POST /rest/v1/web-scanner-rules).
345
+ */
346
+ items: Array<WebScannerFindingsResponse.Item>;
347
+
348
+ /**
349
+ * Total number of findings in the run.
350
+ */
351
+ total: number;
352
+ }
353
+
354
+ export namespace WebScannerFindingsResponse {
355
+ export interface Item {
356
+ coveredByCmp: boolean;
357
+
358
+ hostname: string;
359
+
360
+ seenOn: Array<string>;
361
+
362
+ types: Array<
363
+ | 'audio'
364
+ | 'beacon'
365
+ | 'document'
366
+ | 'eventsource'
367
+ | 'fetch'
368
+ | 'font'
369
+ | 'image'
370
+ | 'manifest'
371
+ | 'media'
372
+ | 'other'
373
+ | 'ping'
374
+ | 'prefetch'
375
+ | 'script'
376
+ | 'stylesheet'
377
+ | 'texttrack'
378
+ | 'video'
379
+ | 'websocket'
380
+ | 'xhr'
381
+ >;
382
+
383
+ urls: Array<string>;
384
+
385
+ category?: string | null;
386
+
387
+ cookies?: Array<Item.Cookie> | null;
388
+
389
+ coveredByVendorLabel?: string | null;
390
+
391
+ displayName?: string | null;
392
+
393
+ privacyKeywords?: Array<string> | null;
394
+
395
+ risk?: string | null;
396
+ }
397
+
398
+ export namespace Item {
399
+ export interface Cookie {
400
+ name: string;
401
+
402
+ domain?: string | null;
403
+
404
+ path?: string | null;
405
+
406
+ value?: string | null;
407
+ }
408
+ }
409
+ }
410
+
411
+ export interface WebScannerCookiesResponse {
412
+ /**
413
+ * Cookies observed on the run, paginated by `limit`/`offset`.
414
+ */
415
+ cookies: Array<WebScannerCookiesResponse.Cookie>;
416
+
417
+ /**
418
+ * True when more cookies are available beyond the current window.
419
+ */
420
+ hasMore: boolean;
421
+
422
+ /**
423
+ * Local-storage entries observed on the run. Returned in full (not paginated).
424
+ */
425
+ localStorage: Array<WebScannerCookiesResponse.LocalStorage>;
426
+
427
+ totalCookies: number;
428
+
429
+ totalLocalStorage: number;
430
+ }
431
+
432
+ export namespace WebScannerCookiesResponse {
433
+ export interface Cookie {
434
+ name: string;
435
+
436
+ domain?: string | null;
437
+
438
+ path?: string | null;
439
+
440
+ value?: string | null;
441
+ }
442
+
443
+ export interface LocalStorage {
444
+ name: string;
445
+
446
+ value?: string | null;
447
+ }
448
+ }
449
+
450
+ export interface WebScannerSummaryResponse {
451
+ byCategory: Array<WebScannerSummaryResponse.ByCategory>;
452
+
453
+ cookieCount: number;
454
+
455
+ countsByRisk: WebScannerSummaryResponse.CountsByRisk;
456
+
457
+ coverage: WebScannerSummaryResponse.Coverage;
458
+
459
+ hostCount: number;
460
+
461
+ localStorageCount: number;
462
+
463
+ rootDomain: string;
464
+
465
+ scannerId: string;
466
+
467
+ scanStatus: 'idle' | 'scanning';
468
+
469
+ /**
470
+ * Up to 10 hosts that still need a decision (neither CMP-covered nor suppressed),
471
+ * highest risk first. Clear each by adding the host to a CMP consent service or
472
+ * creating a suppression rule (POST /rest/v1/web-scanner-rules) with the reason
473
+ * that explains why it is allowed (baa, internal, approved, compliant, firstParty,
474
+ * ignore).
475
+ */
476
+ topUncoveredHosts: Array<WebScannerSummaryResponse.TopUncoveredHost>;
477
+
478
+ vendorCount: number;
479
+
480
+ /**
481
+ * Automated accessibility (WCAG 2.1/2.2 A + AA) rollup for the run: `score` is a
482
+ * 0-100 site score (mean of per-page scores; higher is better), with distinct
483
+ * rule-violation `countsByImpact` and the most frequently violated rules in
484
+ * `topViolations` (each with the number of pages it appears on). Covers only the
485
+ * machine-detectable subset of WCAG (~30-40%) — a high score is not a
486
+ * certification of full conformance; manual audit is still required. Null when the
487
+ * run audited no pages.
488
+ */
489
+ accessibility?: WebScannerSummaryResponse.Accessibility | null;
490
+
491
+ delta?: WebScannerSummaryResponse.Delta | null;
492
+
493
+ runDate?: string | null;
494
+ }
495
+
496
+ export namespace WebScannerSummaryResponse {
497
+ export interface ByCategory {
498
+ category: string;
499
+
500
+ hostCount: number;
501
+ }
502
+
503
+ export interface CountsByRisk {
504
+ high: number;
505
+
506
+ low: number;
507
+
508
+ medium: number;
509
+
510
+ unknown: number;
511
+ }
512
+
513
+ export interface Coverage {
514
+ coveragePercent: number;
515
+
516
+ coveredHostCount: number;
517
+
518
+ needsDecisionHostCount: number;
519
+
520
+ totalHostCount: number;
521
+ }
522
+
523
+ export interface TopUncoveredHost {
524
+ coveredByCmp: boolean;
525
+
526
+ hostname: string;
527
+
528
+ seenOn: Array<string>;
529
+
530
+ types: Array<
531
+ | 'audio'
532
+ | 'beacon'
533
+ | 'document'
534
+ | 'eventsource'
535
+ | 'fetch'
536
+ | 'font'
537
+ | 'image'
538
+ | 'manifest'
539
+ | 'media'
540
+ | 'other'
541
+ | 'ping'
542
+ | 'prefetch'
543
+ | 'script'
544
+ | 'stylesheet'
545
+ | 'texttrack'
546
+ | 'video'
547
+ | 'websocket'
548
+ | 'xhr'
549
+ >;
550
+
551
+ urls: Array<string>;
552
+
553
+ category?: string | null;
554
+
555
+ cookies?: Array<TopUncoveredHost.Cookie> | null;
556
+
557
+ coveredByVendorLabel?: string | null;
558
+
559
+ displayName?: string | null;
560
+
561
+ privacyKeywords?: Array<string> | null;
562
+
563
+ risk?: string | null;
564
+ }
565
+
566
+ export namespace TopUncoveredHost {
567
+ export interface Cookie {
568
+ name: string;
569
+
570
+ domain?: string | null;
571
+
572
+ path?: string | null;
573
+
574
+ value?: string | null;
575
+ }
576
+ }
577
+
578
+ /**
579
+ * Automated accessibility (WCAG 2.1/2.2 A + AA) rollup for the run: `score` is a
580
+ * 0-100 site score (mean of per-page scores; higher is better), with distinct
581
+ * rule-violation `countsByImpact` and the most frequently violated rules in
582
+ * `topViolations` (each with the number of pages it appears on). Covers only the
583
+ * machine-detectable subset of WCAG (~30-40%) — a high score is not a
584
+ * certification of full conformance; manual audit is still required. Null when the
585
+ * run audited no pages.
586
+ */
587
+ export interface Accessibility {
588
+ countsByImpact: Accessibility.CountsByImpact;
589
+
590
+ engine: string;
591
+
592
+ pagesEvaluated: number;
593
+
594
+ score: number;
595
+
596
+ topViolations: Array<Accessibility.TopViolation>;
597
+
598
+ totalNodes: number;
599
+
600
+ totalViolations: number;
601
+ }
602
+
603
+ export namespace Accessibility {
604
+ export interface CountsByImpact {
605
+ critical: number;
606
+
607
+ minor: number;
608
+
609
+ moderate: number;
610
+
611
+ serious: number;
612
+ }
613
+
614
+ export interface TopViolation {
615
+ id: string;
616
+
617
+ help: string;
618
+
619
+ helpUrl: string;
620
+
621
+ nodeCount: number;
622
+
623
+ pageCount: number;
624
+
625
+ pages: Array<string>;
626
+
627
+ sampleNodes: Array<TopViolation.SampleNode>;
628
+
629
+ wcagTags: Array<string>;
630
+
631
+ impact?: string | null;
632
+ }
633
+
634
+ export namespace TopViolation {
635
+ export interface SampleNode {
636
+ html: string;
637
+
638
+ target: Array<string>;
639
+
640
+ failureSummary?: string | null;
641
+ }
642
+ }
643
+ }
644
+
645
+ export interface Delta {
646
+ newHostCount: number;
647
+
648
+ removedHostCount: number;
649
+ }
650
+ }
651
+
274
652
  export interface WebScannerCreateParams {
275
653
  /**
276
654
  * Root domain to crawl (e.g. `example.com`). Required on create. Missing or empty
@@ -318,6 +696,53 @@ export interface WebScannerUpdateParams {
318
696
  urlLimit?: number | null;
319
697
  }
320
698
 
699
+ export interface WebScannerFindingsParams {
700
+ /**
701
+ * Which scan run to read, as an ISO-8601 timestamp. Only the UTC calendar day is
702
+ * used to select the run; the time component is ignored. Defaults to the most
703
+ * recent run when omitted.
704
+ */
705
+ date?: string;
706
+
707
+ /**
708
+ * Maximum number of findings to return. Defaults to 25; clamped to 1–100.
709
+ */
710
+ limit?: number;
711
+
712
+ /**
713
+ * Skip this many findings before returning. Use with `limit` for load-more paging.
714
+ */
715
+ offset?: number | null;
716
+ }
717
+
718
+ export interface WebScannerCookiesParams {
719
+ /**
720
+ * Which scan run to read, as an ISO-8601 timestamp. Only the UTC calendar day is
721
+ * used to select the run; the time component is ignored. Defaults to the most
722
+ * recent run when omitted.
723
+ */
724
+ date?: string;
725
+
726
+ /**
727
+ * Maximum number of findings to return. Defaults to 25; clamped to 1–100.
728
+ */
729
+ limit?: number;
730
+
731
+ /**
732
+ * Skip this many findings before returning. Use with `limit` for load-more paging.
733
+ */
734
+ offset?: number | null;
735
+ }
736
+
737
+ export interface WebScannerSummaryParams {
738
+ /**
739
+ * Which scan run to read, as an ISO-8601 timestamp. Only the UTC calendar day is
740
+ * used to select the run; the time component is ignored. Defaults to the most
741
+ * recent run when omitted.
742
+ */
743
+ date?: string;
744
+ }
745
+
321
746
  export declare namespace WebScanners {
322
747
  export {
323
748
  type WebScannerListResponse as WebScannerListResponse,
@@ -326,7 +751,13 @@ export declare namespace WebScanners {
326
751
  type WebScannerUpdateResponse as WebScannerUpdateResponse,
327
752
  type WebScannerDeleteResponse as WebScannerDeleteResponse,
328
753
  type WebScannerTriggerResponse as WebScannerTriggerResponse,
754
+ type WebScannerFindingsResponse as WebScannerFindingsResponse,
755
+ type WebScannerCookiesResponse as WebScannerCookiesResponse,
756
+ type WebScannerSummaryResponse as WebScannerSummaryResponse,
329
757
  type WebScannerCreateParams as WebScannerCreateParams,
330
758
  type WebScannerUpdateParams as WebScannerUpdateParams,
759
+ type WebScannerFindingsParams as WebScannerFindingsParams,
760
+ type WebScannerCookiesParams as WebScannerCookiesParams,
761
+ type WebScannerSummaryParams as WebScannerSummaryParams,
331
762
  };
332
763
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.30.0'; // x-release-please-version
1
+ export const VERSION = '1.32.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.30.0";
1
+ export declare const VERSION = "1.32.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.30.0";
1
+ export declare const VERSION = "1.32.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.30.0'; // x-release-please-version
4
+ exports.VERSION = '1.32.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.30.0'; // x-release-please-version
1
+ export const VERSION = '1.32.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map