@cookiemunch/sdk 0.11.0 → 0.12.1
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.
- package/CHANGELOG.md +10 -0
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +121 -8
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +78 -3
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -64,6 +64,8 @@ export interface Site {
|
|
|
64
64
|
/** Other hosts serving the site: accepted consent-ingest origins, never verified claims. */
|
|
65
65
|
aliases?: string[];
|
|
66
66
|
verified?: boolean;
|
|
67
|
+
/** Epoch ms of the last embed beacon from the domain or an alias, accurate to the hour. null/absent: none yet. */
|
|
68
|
+
lastSeenAt?: number | null;
|
|
67
69
|
}
|
|
68
70
|
/** PATCH /v1/sites/{cbid} — rename or move a site. `name: null` clears the name; `aliases: []` clears them. */
|
|
69
71
|
export interface SiteUpdate {
|
|
@@ -330,6 +332,50 @@ export interface DsarRequest {
|
|
|
330
332
|
canonicalType?: string;
|
|
331
333
|
/** The case's X-Trace-Id, when it has one. */
|
|
332
334
|
trace?: string;
|
|
335
|
+
/** Filed at a processor site: the controller it goes to and how the forward went. */
|
|
336
|
+
processor?: DsarProcessorForward;
|
|
337
|
+
}
|
|
338
|
+
/** A processor site's request on its way to the controller (dsar-settings `processing`). */
|
|
339
|
+
export interface DsarProcessorForward {
|
|
340
|
+
controllerId: string;
|
|
341
|
+
controllerName: string;
|
|
342
|
+
attempts: number;
|
|
343
|
+
lastAttemptAt?: number;
|
|
344
|
+
/** Why the last forward failed; the request stays in_progress and is retried. */
|
|
345
|
+
lastError?: string;
|
|
346
|
+
/** The retries are spent: a person must act. The request is still open. */
|
|
347
|
+
needsPerson?: boolean;
|
|
348
|
+
outcome?: 'processor_forwarded' | 'processor_referred';
|
|
349
|
+
forwardedTo?: {
|
|
350
|
+
controllerId: string;
|
|
351
|
+
name: string;
|
|
352
|
+
kind: 'cookiemunch' | 'webhook' | 'refer';
|
|
353
|
+
at: number;
|
|
354
|
+
caseId?: string;
|
|
355
|
+
contactUrl?: string;
|
|
356
|
+
contactEmail?: string;
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
/** A business a processor site handles data for, and how its requests reach it. */
|
|
360
|
+
export interface ProcessorController {
|
|
361
|
+
id: string;
|
|
362
|
+
name: string;
|
|
363
|
+
contactUrl?: string;
|
|
364
|
+
contactEmail?: string;
|
|
365
|
+
/** cookiemunch: open a case on that site (it must list you in acceptForwardsFrom). webhook: POST dsar.forwarded, signed. refer: send nothing. */
|
|
366
|
+
forward: {
|
|
367
|
+
kind: 'cookiemunch';
|
|
368
|
+
cbid: string;
|
|
369
|
+
}
|
|
370
|
+
/** `secret` is write-only; it reads back as `hasSecret`. */
|
|
371
|
+
| {
|
|
372
|
+
kind: 'webhook';
|
|
373
|
+
url: string;
|
|
374
|
+
secret?: string;
|
|
375
|
+
hasSecret?: boolean;
|
|
376
|
+
} | {
|
|
377
|
+
kind: 'refer';
|
|
378
|
+
};
|
|
333
379
|
}
|
|
334
380
|
/** A signed-in identity from any OIDC issuer the site trusts. `(iss, sub)` is the key. */
|
|
335
381
|
export interface SubjectIdentity {
|
|
@@ -354,7 +400,7 @@ export interface DsarCaseCreate {
|
|
|
354
400
|
/** product and atlas need dsar:write and attest the person; admin (default) files it received. */
|
|
355
401
|
/** `identity`: the site's sign-in provider. `atlas` is its former name. */
|
|
356
402
|
source?: 'product' | 'identity' | 'admin' | 'atlas';
|
|
357
|
-
/** The person deleted their own account. Default for a closure from product or identity. */
|
|
403
|
+
/** The person deleted their own account. Default for a closure from product or identity. (`processor_forward` is set by Cookie Munch only.) */
|
|
358
404
|
origin?: 'account_deletion';
|
|
359
405
|
reason?: string;
|
|
360
406
|
/** Connections not to ask: system names, connection ids, or `self`. */
|
|
@@ -364,6 +410,8 @@ export interface DsarCaseCreate {
|
|
|
364
410
|
regulation?: 'gdpr' | 'ccpa' | 'lgpd' | 'pipeda' | 'vcdpa';
|
|
365
411
|
jurisdiction?: string;
|
|
366
412
|
test?: boolean;
|
|
413
|
+
/** On a processor site: the id of the controller this concerns. Optional when the site lists one. */
|
|
414
|
+
controller?: string;
|
|
367
415
|
}
|
|
368
416
|
export type DsarCaseStatus = 'pending' | 'scheduled' | 'processing' | 'completed' | 'completed_with_retention' | 'rejected' | 'cancelled';
|
|
369
417
|
export interface RetentionLine {
|
|
@@ -401,8 +449,8 @@ export interface DsarCase {
|
|
|
401
449
|
requestStatus: DsarStatus;
|
|
402
450
|
cbid?: string;
|
|
403
451
|
source: 'product' | 'identity' | 'rights_page' | 'admin' | 'atlas' | null;
|
|
404
|
-
/** account_deletion: the person deleted their own account. */
|
|
405
|
-
origin: 'account_deletion' | null;
|
|
452
|
+
/** account_deletion: the person deleted their own account. processor_forward: a processor passed it on to you (see forwardedFrom). */
|
|
453
|
+
origin: 'account_deletion' | 'processor_forward' | null;
|
|
406
454
|
reason: string | null;
|
|
407
455
|
openedAt: string;
|
|
408
456
|
/** Nothing is erased anywhere before this. */
|
|
@@ -422,6 +470,15 @@ export interface DsarCase {
|
|
|
422
470
|
fulfill: boolean | null;
|
|
423
471
|
cancelRequestedAt: string | null;
|
|
424
472
|
test: boolean;
|
|
473
|
+
/** Filed at a processor site: the controller it goes to and how the forward went. */
|
|
474
|
+
processor: DsarProcessorForward | null;
|
|
475
|
+
/** origin processor_forward: the processor that passed it on. */
|
|
476
|
+
forwardedFrom: {
|
|
477
|
+
orgId: string;
|
|
478
|
+
name: string;
|
|
479
|
+
cbid: string;
|
|
480
|
+
caseId: string;
|
|
481
|
+
} | null;
|
|
425
482
|
tasks: DsarCaseTask[];
|
|
426
483
|
receiptUrl: string;
|
|
427
484
|
/** Lets the person who asked read this case through POST /api/v1/public/dsar/status. */
|
|
@@ -469,6 +526,22 @@ export interface DsarSettings {
|
|
|
469
526
|
/** site: set explicitly; default: a new site's 7 days; legacy: an existing site, 0 until set. */
|
|
470
527
|
source: 'site' | 'default' | 'legacy';
|
|
471
528
|
updatedAt: number | null;
|
|
529
|
+
/** Set when this site is a processor: its requests go to the controller they concern, not your connected systems. */
|
|
530
|
+
processing: {
|
|
531
|
+
role: 'processor';
|
|
532
|
+
controllers: ProcessorController[];
|
|
533
|
+
} | null;
|
|
534
|
+
/** On a controller's site: the processors (org ids or cbids) that may open cases here. */
|
|
535
|
+
acceptForwardsFrom: string[];
|
|
536
|
+
}
|
|
537
|
+
/** PUT /v1/sites/{cbid}/dsar-settings: only the fields sent change; null clears. */
|
|
538
|
+
export interface DsarSettingsInput {
|
|
539
|
+
graceDays?: number;
|
|
540
|
+
processing?: {
|
|
541
|
+
role: 'processor';
|
|
542
|
+
controllers: ProcessorController[];
|
|
543
|
+
} | null;
|
|
544
|
+
acceptForwardsFrom?: string[] | null;
|
|
472
545
|
}
|
|
473
546
|
/** GET /v1/integrations/{app}/card. */
|
|
474
547
|
export interface SubjectCard {
|
|
@@ -579,6 +652,8 @@ export interface DsarCreate {
|
|
|
579
652
|
* and deletable with `dsar.delete(id)`. For end-to-end checks of a rights flow.
|
|
580
653
|
*/
|
|
581
654
|
test?: boolean;
|
|
655
|
+
/** On a processor site: the id of the controller this concerns. Optional when the site lists one. */
|
|
656
|
+
controller?: string;
|
|
582
657
|
}
|
|
583
658
|
export interface VendorInput {
|
|
584
659
|
name: string;
|