@cookiemunch/sdk 0.7.1 → 0.9.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.
- package/CHANGELOG.md +13 -1
- package/dist/consent-sync.d.ts +13 -0
- package/dist/consent.d.ts +21 -22
- package/dist/executor-conformance.d.ts +75 -0
- package/dist/fd-consent.d.ts +73 -0
- package/dist/index.cjs +6 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +295 -1032
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/token-exchange.d.ts +42 -0
- package/dist/types.d.ts +637 -0
- package/dist/webhooks.d.ts +22 -0
- package/package.json +2 -2
- package/dist/consent.d.cts +0 -169
- package/dist/index.d.cts +0 -4267
package/dist/index.d.ts
CHANGED
|
@@ -1,829 +1,3 @@
|
|
|
1
|
-
export { CONSENT_COOKIE_NAME, ConsentCategory, ConsentSource, ConsentTokenClaims, DEFAULT_JWKS_URL, JsonWebKeySet, KeySetOptions, ReadConsentOptions, ReadSignedConsentOptions, ServerConsent, SignableDecision, VerifyTokenOptions, consentSignaturePayload, getConsent, isAllowed, parseConsentValue, readConsent, verifyDecisionSignature, verifyToken } from './consent.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Request/response shapes for the Cookie Munch Developer API (/v1). These mirror the
|
|
5
|
-
* server's dev-api surface; they are defined here (rather than imported) so the SDK
|
|
6
|
-
* has no runtime/workspace dependency on the server package.
|
|
7
|
-
*/
|
|
8
|
-
interface Identity {
|
|
9
|
-
orgId: string;
|
|
10
|
-
orgName?: string | null;
|
|
11
|
-
/** The EFFECTIVE plan — the one every feature gate and limit uses. */
|
|
12
|
-
plan: string;
|
|
13
|
-
/**
|
|
14
|
-
* Why: `org` = this org's own subscription (or free, or a reseller-managed `child` plan);
|
|
15
|
-
* `account` = another org with the same owner pays for a higher plan that covers this one.
|
|
16
|
-
*/
|
|
17
|
-
planSource: PlanSource;
|
|
18
|
-
/** What this org subscribes to itself (`free` = no subscription of its own). */
|
|
19
|
-
subscribedPlan: string;
|
|
20
|
-
/** Features the effective plan unlocks (e.g. `whiteLabel`, `tcf`, `sso`, `abTesting`). */
|
|
21
|
-
features: string[];
|
|
22
|
-
keyPrefix: string;
|
|
23
|
-
/** null = full access. */
|
|
24
|
-
scopes?: string[] | null;
|
|
25
|
-
unscoped?: boolean;
|
|
26
|
-
propertyLocked?: boolean;
|
|
27
|
-
cbids?: string[];
|
|
28
|
-
reseller?: boolean;
|
|
29
|
-
/** This organisation is a sandbox (`sandbox.create()`): test keys, test rights requests, never billed. */
|
|
30
|
-
sandbox?: boolean;
|
|
31
|
-
/** For a sandbox: the live organisation it belongs to. */
|
|
32
|
-
sandboxOf?: string;
|
|
33
|
-
}
|
|
34
|
-
type PlanSource = 'org' | 'account';
|
|
35
|
-
/** One organisation on an account (GET /v1/orgs, and the `org_limit` refusal). */
|
|
36
|
-
interface AccountOrg {
|
|
37
|
-
id: string;
|
|
38
|
-
name: string;
|
|
39
|
-
/** The effective plan. */
|
|
40
|
-
plan: string;
|
|
41
|
-
planSource: PlanSource;
|
|
42
|
-
subscribedPlan: string;
|
|
43
|
-
/** Present on a reseller-managed child organisation. */
|
|
44
|
-
parentOrgId?: string;
|
|
45
|
-
createdAt: number;
|
|
46
|
-
/** True for the organisation the calling key belongs to. */
|
|
47
|
-
current: boolean;
|
|
48
|
-
}
|
|
49
|
-
interface AccountOrgs {
|
|
50
|
-
orgs: AccountOrg[];
|
|
51
|
-
/** The per-account org cap: `max` (null = unlimited), the `plan` that sets it, and `used`. */
|
|
52
|
-
orgLimit: {
|
|
53
|
-
max: number | null;
|
|
54
|
-
plan: string;
|
|
55
|
-
used: number;
|
|
56
|
-
};
|
|
57
|
-
/** The dashboard billing page, where a plan is chosen. */
|
|
58
|
-
upgradeUrl: string;
|
|
59
|
-
}
|
|
60
|
-
interface Site {
|
|
61
|
-
cbid: string;
|
|
62
|
-
orgId: string;
|
|
63
|
-
domain: string;
|
|
64
|
-
/** The business name data subjects see on the rights page, in notices and the policy. Absent: the domain is shown. */
|
|
65
|
-
name?: string;
|
|
66
|
-
/** Other hosts serving the site: accepted consent-ingest origins, never verified claims. */
|
|
67
|
-
aliases?: string[];
|
|
68
|
-
verified?: boolean;
|
|
69
|
-
}
|
|
70
|
-
/** PATCH /v1/sites/{cbid} — rename or move a site. `name: null` clears the name; `aliases: []` clears them. */
|
|
71
|
-
interface SiteUpdate {
|
|
72
|
-
domain?: string;
|
|
73
|
-
name?: string | null;
|
|
74
|
-
aliases?: string[];
|
|
75
|
-
}
|
|
76
|
-
interface SiteUpdateResult {
|
|
77
|
-
dryRun?: true;
|
|
78
|
-
site: Site;
|
|
79
|
-
diff: Array<{
|
|
80
|
-
field: 'domain' | 'name' | 'aliases' | 'verified';
|
|
81
|
-
before: unknown;
|
|
82
|
-
after: unknown;
|
|
83
|
-
}>;
|
|
84
|
-
effects: {
|
|
85
|
-
/** `reset`: the domain moved; verify the new one. */
|
|
86
|
-
verification: 'kept' | 'reset';
|
|
87
|
-
scanTarget: string;
|
|
88
|
-
previewDefaultUrl: string;
|
|
89
|
-
displayName: string;
|
|
90
|
-
/** Custom rights-page hostnames no longer under the domain or an alias (left in place). */
|
|
91
|
-
staleRightsDomains: string[];
|
|
92
|
-
};
|
|
93
|
-
warnings?: Array<{
|
|
94
|
-
field: string;
|
|
95
|
-
reason: string;
|
|
96
|
-
}>;
|
|
97
|
-
}
|
|
98
|
-
/** One row of GET /v1/integration-health. `ok: null` = the check could not run (see `detail`). */
|
|
99
|
-
interface HealthRow {
|
|
100
|
-
/** The suite shape's name for `check` (always equal). */
|
|
101
|
-
id: string;
|
|
102
|
-
check: string;
|
|
103
|
-
/** The generic check this row is an instance of (`forumulate.webhook` → `webhook.delivery`); otherwise `check`. */
|
|
104
|
-
kind: string;
|
|
105
|
-
/** The vendor a vendor-specific instance is about. */
|
|
106
|
-
vendor?: string;
|
|
107
|
-
ok: boolean | null;
|
|
108
|
-
severity: 'error' | 'warning' | 'info';
|
|
109
|
-
subject: string;
|
|
110
|
-
fixHint?: string;
|
|
111
|
-
/** The same as fixHint (suite shape). */
|
|
112
|
-
fix?: string;
|
|
113
|
-
/** Where the check and its fix are explained. */
|
|
114
|
-
docs: string;
|
|
115
|
-
detail?: string;
|
|
116
|
-
/** Network checks: the hop that failed (or, on success, the last one reached). */
|
|
117
|
-
hop?: 'dns' | 'tls' | 'http' | 'challenge' | 'auth';
|
|
118
|
-
status?: number;
|
|
119
|
-
elapsedMs?: number;
|
|
120
|
-
/** Failed network checks: a stable code (ENOTFOUND, timeout, challenge, http_503, …). */
|
|
121
|
-
error?: string;
|
|
122
|
-
/** A waiver covers this failing row; `ok` is then null. */
|
|
123
|
-
waived?: {
|
|
124
|
-
reason: string;
|
|
125
|
-
by: string;
|
|
126
|
-
until: number | null;
|
|
127
|
-
};
|
|
128
|
-
lastCheckedAt: number;
|
|
129
|
-
}
|
|
130
|
-
interface IntegrationHealthReport {
|
|
131
|
-
cbid: string;
|
|
132
|
-
checkedAt: number;
|
|
133
|
-
generatedAt: string;
|
|
134
|
-
ok: boolean;
|
|
135
|
-
counts: {
|
|
136
|
-
error: number;
|
|
137
|
-
warning: number;
|
|
138
|
-
notChecked: number;
|
|
139
|
-
waived: number;
|
|
140
|
-
};
|
|
141
|
-
checks: HealthRow[];
|
|
142
|
-
}
|
|
143
|
-
/** PUT /v1/integration-health/waivers. */
|
|
144
|
-
interface HealthWaiverInput {
|
|
145
|
-
/** Optional when the organisation has one site. */
|
|
146
|
-
cbid?: string;
|
|
147
|
-
/** A row's `check` or `kind`. */
|
|
148
|
-
check: string;
|
|
149
|
-
/** A row's `subject`; omitted: every subject of the check (`*`). */
|
|
150
|
-
subject?: string;
|
|
151
|
-
/** Why this is deliberate (1–500 characters). */
|
|
152
|
-
reason: string;
|
|
153
|
-
/** ISO date or epoch ms, future, within a year; omitted or null: never expires. */
|
|
154
|
-
until?: string | number | null;
|
|
155
|
-
}
|
|
156
|
-
interface HealthWaiver {
|
|
157
|
-
cbid: string;
|
|
158
|
-
check: string;
|
|
159
|
-
subject: string;
|
|
160
|
-
reason: string;
|
|
161
|
-
by: string;
|
|
162
|
-
until: number | null;
|
|
163
|
-
createdAt: number;
|
|
164
|
-
expired?: boolean;
|
|
165
|
-
}
|
|
166
|
-
/** POST /v1/provision. Secrets are used for the request only and never returned. */
|
|
167
|
-
interface ProvisionRequest {
|
|
168
|
-
product: string;
|
|
169
|
-
domain: string;
|
|
170
|
-
name?: string;
|
|
171
|
-
aliases?: string[];
|
|
172
|
-
cbid?: string;
|
|
173
|
-
/** `frontendApiHost` (e.g. auth.example.com) lets provision declare Atlas's sign-in cookies on the site. */
|
|
174
|
-
/** `rightsIdentity` (default true) makes Atlas the site's rights sign-in (step `rights.identity`). */
|
|
175
|
-
atlas?: {
|
|
176
|
-
secretKey: string;
|
|
177
|
-
cookieConsent?: boolean;
|
|
178
|
-
dsrWebhook?: boolean;
|
|
179
|
-
rightsIdentity?: boolean;
|
|
180
|
-
frontendApiHost?: string;
|
|
181
|
-
};
|
|
182
|
-
forumulate?: {
|
|
183
|
-
token: string;
|
|
184
|
-
orgId: string;
|
|
185
|
-
consent?: boolean;
|
|
186
|
-
executorKey?: boolean;
|
|
187
|
-
label?: string;
|
|
188
|
-
};
|
|
189
|
-
rightsApi?: {
|
|
190
|
-
baseUrl: string;
|
|
191
|
-
secretKey: string;
|
|
192
|
-
profilePreset?: string;
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
interface ProvisionStep {
|
|
196
|
-
/** v2 answers: the stable step id (`fromStep` takes it). */
|
|
197
|
-
id?: string;
|
|
198
|
-
step: string;
|
|
199
|
-
status: 'created' | 'updated' | 'unchanged' | 'would_create' | 'would_update' | 'skipped' | 'waiting' | 'waiting_on' | 'failed' | 'passed';
|
|
200
|
-
detail?: string;
|
|
201
|
-
diff?: Array<{
|
|
202
|
-
field: string;
|
|
203
|
-
before: unknown;
|
|
204
|
-
after: unknown;
|
|
205
|
-
}>;
|
|
206
|
-
/** A string in v1 answers; `{ platform, items }` in v2 answers. */
|
|
207
|
-
waitingOn?: string | {
|
|
208
|
-
platform: string;
|
|
209
|
-
items: string[];
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
interface ProvisionResult {
|
|
213
|
-
dryRun: boolean;
|
|
214
|
-
product: string;
|
|
215
|
-
cbid: string | null;
|
|
216
|
-
steps: ProvisionStep[];
|
|
217
|
-
summary: {
|
|
218
|
-
changed: number;
|
|
219
|
-
unchanged: number;
|
|
220
|
-
waiting: number;
|
|
221
|
-
failed: number;
|
|
222
|
-
};
|
|
223
|
-
/** v2 answers only. */
|
|
224
|
-
version?: 2;
|
|
225
|
-
ids?: {
|
|
226
|
-
orgId: string;
|
|
227
|
-
cbid: string | null;
|
|
228
|
-
executors: Record<string, string>;
|
|
229
|
-
webhooks: string[];
|
|
230
|
-
};
|
|
231
|
-
sealedSecrets?: Array<Record<string, unknown>>;
|
|
232
|
-
checklist?: string[];
|
|
233
|
-
}
|
|
234
|
-
/** A partner the deployment knows: built in (forumulate, atlas, chatly, referalli) or any other registered on it. */
|
|
235
|
-
type PartnerId = 'forumulate' | 'atlas' | 'chatly' | 'referalli' | (string & {});
|
|
236
|
-
interface PartnerLinkCreate {
|
|
237
|
-
partner: PartnerId;
|
|
238
|
-
/** The partner's id for the receiving account (a Forumulate organisation id, an Atlas instance id). */
|
|
239
|
-
externalId: string;
|
|
240
|
-
label?: string;
|
|
241
|
-
events?: Array<'consent.recorded' | 'consent.withdrawn'>;
|
|
242
|
-
}
|
|
243
|
-
interface PartnerLink {
|
|
244
|
-
id: string;
|
|
245
|
-
cbid: string;
|
|
246
|
-
partner: PartnerId;
|
|
247
|
-
externalId: string;
|
|
248
|
-
label?: string;
|
|
249
|
-
events: string[];
|
|
250
|
-
status: 'active' | 'waiting_on_partner' | 'revoked';
|
|
251
|
-
/** e.g. "Forumulate (docs) — receiving consent events". */
|
|
252
|
-
summary: string;
|
|
253
|
-
waitingOn?: string;
|
|
254
|
-
createdAt: number;
|
|
255
|
-
createdBy?: string;
|
|
256
|
-
revokedAt?: number;
|
|
257
|
-
revokedBy?: string | null;
|
|
258
|
-
lastDeliveryAt: number | null;
|
|
259
|
-
lastError: string | null;
|
|
260
|
-
}
|
|
261
|
-
interface PartnerCatalogEntry {
|
|
262
|
-
id: PartnerId;
|
|
263
|
-
label: string;
|
|
264
|
-
externalIdLabel: string;
|
|
265
|
-
events: string[];
|
|
266
|
-
available: boolean;
|
|
267
|
-
waitingOn?: string;
|
|
268
|
-
}
|
|
269
|
-
interface SiteCreate {
|
|
270
|
-
domain: string;
|
|
271
|
-
/** Optional; the server auto-generates a cbid when omitted. */
|
|
272
|
-
cbid?: string;
|
|
273
|
-
}
|
|
274
|
-
/** Site config is an open, deeply-nested object owned by @cookiemunch/core. */
|
|
275
|
-
type SiteConfig = Record<string, unknown>;
|
|
276
|
-
interface ConsentDay {
|
|
277
|
-
Date: string;
|
|
278
|
-
OptIn: number;
|
|
279
|
-
OptOut: number;
|
|
280
|
-
OptInImplied: number;
|
|
281
|
-
OptInStrict: number;
|
|
282
|
-
TypeOptInPref: number;
|
|
283
|
-
TypeOptInStat: number;
|
|
284
|
-
TypeOptInMark: number;
|
|
285
|
-
Impressions: number;
|
|
286
|
-
Countries: Record<string, number>;
|
|
287
|
-
}
|
|
288
|
-
interface ConsentLogRow {
|
|
289
|
-
stamp: string;
|
|
290
|
-
receivedAt: number;
|
|
291
|
-
region: string;
|
|
292
|
-
method: string;
|
|
293
|
-
choices: {
|
|
294
|
-
preferences: boolean;
|
|
295
|
-
statistics: boolean;
|
|
296
|
-
marketing: boolean;
|
|
297
|
-
};
|
|
298
|
-
anonIp: string;
|
|
299
|
-
url: string;
|
|
300
|
-
}
|
|
301
|
-
interface RangeQuery {
|
|
302
|
-
from?: number;
|
|
303
|
-
to?: number;
|
|
304
|
-
}
|
|
305
|
-
interface LogQuery extends RangeQuery {
|
|
306
|
-
limit?: number;
|
|
307
|
-
}
|
|
308
|
-
type DsarType = 'access' | 'deletion' | 'rectification' | 'portability' | 'opt-out' | 'closure' | 'restriction';
|
|
309
|
-
/** A type word as sent: the canonical words, or an alias (`erasure`/`erase` → deletion, `export` → access). */
|
|
310
|
-
type DsarTypeWord = DsarType | 'erasure' | 'erase' | 'export';
|
|
311
|
-
type Regulation = 'gdpr' | 'ccpa';
|
|
312
|
-
type DsarStatus = 'received' | 'verifying' | 'in_progress' | 'completed' | 'rejected' | 'cancelled';
|
|
313
|
-
interface DsarRequest {
|
|
314
|
-
id: string;
|
|
315
|
-
type: DsarType;
|
|
316
|
-
subjectEmail: string;
|
|
317
|
-
regulation: Regulation;
|
|
318
|
-
status: DsarStatus;
|
|
319
|
-
createdAt: number;
|
|
320
|
-
dueAt: number;
|
|
321
|
-
/** Where the subject said they are, when the intake captured it. */
|
|
322
|
-
jurisdiction?: string;
|
|
323
|
-
/** INTERNAL: intake note plus the audit lines `/erase` and `/export` append. Never shown to the subject. */
|
|
324
|
-
note?: string;
|
|
325
|
-
/** The line the subject reads in the response notice. */
|
|
326
|
-
messageToSubject?: string;
|
|
327
|
-
/** A test request: off the SLA board, labelled, and deletable with `dsar.delete`. A closed request can be marked one with `dsar.markTest`. */
|
|
328
|
-
test?: boolean;
|
|
329
|
-
/** Its type in the suite vocabulary (`erasure` was stored as `deletion`). */
|
|
330
|
-
canonicalType?: string;
|
|
331
|
-
/** The case's X-ForgeDeck-Trace, when it has one. */
|
|
332
|
-
trace?: string;
|
|
333
|
-
}
|
|
334
|
-
/** A signed-in identity from any OIDC issuer the site trusts. `(iss, sub)` is the key. */
|
|
335
|
-
interface SubjectIdentity {
|
|
336
|
-
iss: string;
|
|
337
|
-
sub: string;
|
|
338
|
-
ext?: string;
|
|
339
|
-
principal?: string;
|
|
340
|
-
}
|
|
341
|
-
/** Who a case is about. `atlas` is accepted as an alias of `identity`. */
|
|
342
|
-
interface DsarSubject {
|
|
343
|
-
emails: string[];
|
|
344
|
-
identity?: SubjectIdentity;
|
|
345
|
-
atlas?: SubjectIdentity;
|
|
346
|
-
}
|
|
347
|
-
/** POST /v1/dsar/requests. */
|
|
348
|
-
interface DsarCaseCreate {
|
|
349
|
-
cbid: string;
|
|
350
|
-
type: DsarTypeWord;
|
|
351
|
-
subject?: DsarSubject;
|
|
352
|
-
/** The person's own token from the site's sign-in issuer (aud `cookiemunch:<cbid>`). */
|
|
353
|
-
subjectToken?: string;
|
|
354
|
-
/** product and atlas need dsar:write and attest the person; admin (default) files it received. */
|
|
355
|
-
source?: 'product' | 'atlas' | 'admin';
|
|
356
|
-
reason?: string;
|
|
357
|
-
/** Connections not to ask: system names, connection ids, or `self`. */
|
|
358
|
-
skipSystems?: string[];
|
|
359
|
-
/** Default true. */
|
|
360
|
-
fulfill?: boolean;
|
|
361
|
-
regulation?: 'gdpr' | 'ccpa' | 'lgpd' | 'pipeda' | 'vcdpa';
|
|
362
|
-
jurisdiction?: string;
|
|
363
|
-
test?: boolean;
|
|
364
|
-
}
|
|
365
|
-
type DsarCaseStatus = 'pending' | 'scheduled' | 'processing' | 'completed' | 'completed_with_retention' | 'rejected' | 'cancelled';
|
|
366
|
-
interface RetentionLine {
|
|
367
|
-
category: string;
|
|
368
|
-
basis: 'legal_obligation' | 'legal_claims' | 'contract' | 'public_interest';
|
|
369
|
-
until?: string;
|
|
370
|
-
}
|
|
371
|
-
interface DsarCaseTask {
|
|
372
|
-
system: string;
|
|
373
|
-
executorId: string | null;
|
|
374
|
-
taskId: string;
|
|
375
|
-
status: DsarCaseStatus | 'no_match';
|
|
376
|
-
requestId: string | null;
|
|
377
|
-
eta: string | null;
|
|
378
|
-
completedAt: string | null;
|
|
379
|
-
detail: string | null;
|
|
380
|
-
retention?: RetentionLine[];
|
|
381
|
-
}
|
|
382
|
-
/** A case across every connected system. */
|
|
383
|
-
interface DsarCase {
|
|
384
|
-
id: string;
|
|
385
|
-
type: DsarType;
|
|
386
|
-
canonicalType: string;
|
|
387
|
-
status: DsarCaseStatus;
|
|
388
|
-
requestStatus: DsarStatus;
|
|
389
|
-
cbid?: string;
|
|
390
|
-
source: 'product' | 'atlas' | 'rights_page' | 'admin' | null;
|
|
391
|
-
reason: string | null;
|
|
392
|
-
openedAt: string;
|
|
393
|
-
/** Nothing is erased anywhere before this. */
|
|
394
|
-
executeAfter: string | null;
|
|
395
|
-
graceDays: number | null;
|
|
396
|
-
closedAt: string | null;
|
|
397
|
-
/** False for a closure: no statutory clock. */
|
|
398
|
-
statutory: boolean;
|
|
399
|
-
dueAt: string | null;
|
|
400
|
-
verification: string | null;
|
|
401
|
-
trace: string | null;
|
|
402
|
-
subject: {
|
|
403
|
-
emails: string[];
|
|
404
|
-
identity: SubjectIdentity | null;
|
|
405
|
-
};
|
|
406
|
-
skipSystems: string[];
|
|
407
|
-
fulfill: boolean | null;
|
|
408
|
-
cancelRequestedAt: string | null;
|
|
409
|
-
test: boolean;
|
|
410
|
-
tasks: DsarCaseTask[];
|
|
411
|
-
receiptUrl: string;
|
|
412
|
-
/** Lets the person who asked read this case through POST /api/v1/public/dsar/status. */
|
|
413
|
-
statusToken?: string;
|
|
414
|
-
}
|
|
415
|
-
/** One signed receipt for a case (Ed25519; verify with GET /v1/partner/jwks.json). */
|
|
416
|
-
interface DsarCaseReceipt {
|
|
417
|
-
receiptVersion: number;
|
|
418
|
-
caseId: string;
|
|
419
|
-
type: DsarType;
|
|
420
|
-
canonicalType: string;
|
|
421
|
-
status: DsarCaseStatus;
|
|
422
|
-
openedAt: string;
|
|
423
|
-
executeAfter: string | null;
|
|
424
|
-
closedAt: string | null;
|
|
425
|
-
verification: string | null;
|
|
426
|
-
trace: string | null;
|
|
427
|
-
subject: {
|
|
428
|
-
emailHashes: string[];
|
|
429
|
-
identityHash?: string;
|
|
430
|
-
atlasSubHash?: string;
|
|
431
|
-
};
|
|
432
|
-
systems: Array<{
|
|
433
|
-
system: string;
|
|
434
|
-
executorId: string | null;
|
|
435
|
-
requestId: string | null;
|
|
436
|
-
status: string;
|
|
437
|
-
completedAt: string | null;
|
|
438
|
-
trace: string | null;
|
|
439
|
-
retention?: RetentionLine[];
|
|
440
|
-
}>;
|
|
441
|
-
issuedAt: string;
|
|
442
|
-
signature: {
|
|
443
|
-
alg: 'Ed25519';
|
|
444
|
-
kid: string;
|
|
445
|
-
value: string;
|
|
446
|
-
covers?: string;
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
/** A site's rights-request settings. */
|
|
450
|
-
interface DsarSettings {
|
|
451
|
-
cbid: string;
|
|
452
|
-
/** Days an erasure or account closure waits before any system acts (0–30). 7 for a new site; 0 for one that existed before (opt-in). */
|
|
453
|
-
graceDays: number;
|
|
454
|
-
/** site: set explicitly; default: a new site's 7 days; legacy: an existing site, 0 until set. */
|
|
455
|
-
source: 'site' | 'default' | 'legacy';
|
|
456
|
-
updatedAt: number | null;
|
|
457
|
-
}
|
|
458
|
-
/** GET /v1/integrations/{app}/card. */
|
|
459
|
-
interface SubjectCard {
|
|
460
|
-
app: string;
|
|
461
|
-
openCases: Array<{
|
|
462
|
-
id: string;
|
|
463
|
-
type: string;
|
|
464
|
-
status: string;
|
|
465
|
-
executeAfter: string | null;
|
|
466
|
-
openedAt: string;
|
|
467
|
-
receiptUrl: string;
|
|
468
|
-
}>;
|
|
469
|
-
consent: null;
|
|
470
|
-
}
|
|
471
|
-
/**
|
|
472
|
-
* How a rights-page requester was verified — on every answer of the public intake
|
|
473
|
-
* (`POST /api/v1/public/dsar`, `/verify`, `/resend`) and so in the `dsar.created` webhook payload.
|
|
474
|
-
* `email_code` on a 202: a code was mailed through your own provider; on a 201: the code matched.
|
|
475
|
-
* `none` with a `reason`: filed without verification — confirm the requester yourself. `none`
|
|
476
|
-
* without one: an opt-out, which needs no verification.
|
|
477
|
-
*/
|
|
478
|
-
type PublicVerification = {
|
|
479
|
-
method: 'session' | 'email_code' | 'account_link';
|
|
480
|
-
} | {
|
|
481
|
-
method: 'none';
|
|
482
|
-
reason?: 'no_verification_configured' | 'mail_failed' | 'recipient_rejected';
|
|
483
|
-
};
|
|
484
|
-
/** A public intake that filed a request (201): also the `dsar.created` payload for one. */
|
|
485
|
-
interface PublicDsarFiled {
|
|
486
|
-
id: string;
|
|
487
|
-
status: 'received' | 'verifying';
|
|
488
|
-
/** Epoch ms the statutory response is due. */
|
|
489
|
-
deadline: number;
|
|
490
|
-
/** Only when filed without verification; the same as `verification.method` `none` with a `reason`. */
|
|
491
|
-
unverified?: true;
|
|
492
|
-
verification: PublicVerification;
|
|
493
|
-
}
|
|
494
|
-
/** A public intake waiting for its email code (202). */
|
|
495
|
-
interface PublicDsarPending {
|
|
496
|
-
pendingId: string;
|
|
497
|
-
expiresAt: number;
|
|
498
|
-
resendAfter?: number;
|
|
499
|
-
verification: {
|
|
500
|
-
method: 'email_code';
|
|
501
|
-
};
|
|
502
|
-
}
|
|
503
|
-
interface DsarCreate {
|
|
504
|
-
type: DsarType;
|
|
505
|
-
subjectEmail: string;
|
|
506
|
-
/** Picks the statutory response window. */
|
|
507
|
-
regulation: Regulation;
|
|
508
|
-
/**
|
|
509
|
-
* Where the subject says they are (ISO 3166 country or country-subdivision, e.g.
|
|
510
|
-
* `US-TX`). The response notice names the statute that governs there — without it a
|
|
511
|
-
* Texan is told their request was handled under a Virginia law, since every US state
|
|
512
|
-
* shares one `regulation` for the deadline.
|
|
513
|
-
*/
|
|
514
|
-
jurisdiction?: string;
|
|
515
|
-
/** INTERNAL: kept on the request, never shown to the subject. */
|
|
516
|
-
note?: string;
|
|
517
|
-
/** The one free-text line the subject reads in the notice (≤2000 chars; an API key or key prefix is refused). */
|
|
518
|
-
messageToSubject?: string;
|
|
519
|
-
/** The property this request belongs to; decides which connected systems answer it. */
|
|
520
|
-
cbid?: string;
|
|
521
|
-
/** The subject's consent-receipt id. */
|
|
522
|
-
stamp?: string;
|
|
523
|
-
/**
|
|
524
|
-
* Mark it as a test: left out of SLA metrics and the deadline board, labelled as a test,
|
|
525
|
-
* and deletable with `dsar.delete(id)`. For end-to-end checks of a rights flow.
|
|
526
|
-
*/
|
|
527
|
-
test?: boolean;
|
|
528
|
-
}
|
|
529
|
-
interface VendorInput {
|
|
530
|
-
name: string;
|
|
531
|
-
category: string;
|
|
532
|
-
dataShared: string[];
|
|
533
|
-
dpaSigned: boolean;
|
|
534
|
-
subprocessors: number;
|
|
535
|
-
certifications: string[];
|
|
536
|
-
region: string;
|
|
537
|
-
}
|
|
538
|
-
interface RiskScore {
|
|
539
|
-
score: number;
|
|
540
|
-
band: 'low' | 'medium' | 'high';
|
|
541
|
-
}
|
|
542
|
-
/** A stored vendor record (no computed risk; see {@link ScoredVendor}). Returned as the
|
|
543
|
-
* `vendor` field of POST /v1/vendors. */
|
|
544
|
-
interface VendorRecord extends VendorInput {
|
|
545
|
-
id: string;
|
|
546
|
-
}
|
|
547
|
-
/** A vendor as listed, with its computed risk flattened in. */
|
|
548
|
-
interface ScoredVendor extends VendorRecord {
|
|
549
|
-
risk: RiskScore;
|
|
550
|
-
}
|
|
551
|
-
type LegalBasis = 'consent' | 'contract' | 'legal-obligation' | 'vital-interests' | 'public-task' | 'legitimate-interests';
|
|
552
|
-
interface RopaInput {
|
|
553
|
-
name: string;
|
|
554
|
-
purpose: string;
|
|
555
|
-
legalBasis: LegalBasis;
|
|
556
|
-
dataCategories: string[];
|
|
557
|
-
recipients: string[];
|
|
558
|
-
retentionDays: number;
|
|
559
|
-
crossBorderTransfer: boolean;
|
|
560
|
-
}
|
|
561
|
-
interface RopaEntry extends RopaInput {
|
|
562
|
-
id: string;
|
|
563
|
-
}
|
|
564
|
-
/** A signed consent receipt (shape owned by @cookiemunch/receipts). */
|
|
565
|
-
type SignedReceipt = Record<string, unknown>;
|
|
566
|
-
/** How a preference-center opt-in was captured. Mirrors @cookiemunch/preferences OptInMethod. */
|
|
567
|
-
type OptInMethod = 'single-opt-in' | 'double-opt-in';
|
|
568
|
-
/**
|
|
569
|
-
* A subject's saved preference-center record (identity-keyed named purposes, distinct
|
|
570
|
-
* from the org-level {@link PreferenceItem} catalog). Matches @cookiemunch/preferences
|
|
571
|
-
* PreferenceRecord (mirrored here per this package's no-server-dependency convention).
|
|
572
|
-
* Returned wrapped as `{ record }` by POST /v1/preferences.
|
|
573
|
-
*/
|
|
574
|
-
interface PreferenceRecord {
|
|
575
|
-
subjectId: string;
|
|
576
|
-
purposes: Record<string, boolean>;
|
|
577
|
-
method: OptInMethod;
|
|
578
|
-
confirmed: boolean;
|
|
579
|
-
updatedAt: number;
|
|
580
|
-
version: number;
|
|
581
|
-
}
|
|
582
|
-
/** GET /v1/categories/registry — the reserved category templates (CMU-X15). */
|
|
583
|
-
interface CategoryRegistry {
|
|
584
|
-
version: 1;
|
|
585
|
-
standard: string[];
|
|
586
|
-
suite: Array<{
|
|
587
|
-
id: 'support_chat' | 'referrals';
|
|
588
|
-
stance: 'necessary_on_request' | 'opt_in_eu_uk';
|
|
589
|
-
fallback: 'preferences' | 'marketing';
|
|
590
|
-
/** By banner language. */
|
|
591
|
-
labels: Record<string, string>;
|
|
592
|
-
descriptions: Record<string, string>;
|
|
593
|
-
basis?: string[];
|
|
594
|
-
vendors?: Array<{
|
|
595
|
-
product: string;
|
|
596
|
-
storage: string[];
|
|
597
|
-
}>;
|
|
598
|
-
}>;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
interface VerifyWebhookInput {
|
|
602
|
-
/** The raw request body, exactly as received. Do NOT re-stringify parsed JSON. */
|
|
603
|
-
payload: string;
|
|
604
|
-
/** The `X-CookieMunch-Signature` header value. */
|
|
605
|
-
signature: string | undefined | null;
|
|
606
|
-
/** The `X-CookieMunch-Timestamp` header value (unix seconds). */
|
|
607
|
-
timestamp: string | number | undefined | null;
|
|
608
|
-
/** The subscription secret (`whsec_…`), shown once when the webhook was created. */
|
|
609
|
-
secret: string;
|
|
610
|
-
/**
|
|
611
|
-
* Maximum age (in seconds) of a delivery before it is rejected as stale/replayed.
|
|
612
|
-
* Defaults to 300 (5 minutes). Pass 0 to disable the freshness check entirely.
|
|
613
|
-
*/
|
|
614
|
-
toleranceSeconds?: number;
|
|
615
|
-
/** Current time in ms (injectable for tests); defaults to `Date.now()`. */
|
|
616
|
-
now?: number;
|
|
617
|
-
}
|
|
618
|
-
/**
|
|
619
|
-
* Returns true only when the signature is valid AND (unless disabled) the timestamp is fresh.
|
|
620
|
-
* Fail-closed: any missing/malformed input returns false rather than throwing.
|
|
621
|
-
*/
|
|
622
|
-
declare function verifyWebhookSignature(input: VerifyWebhookInput): boolean;
|
|
623
|
-
|
|
624
|
-
interface MintConsentSyncTokenInput {
|
|
625
|
-
/** The site's consent-sync secret (`cmss_…`). */
|
|
626
|
-
secret: string;
|
|
627
|
-
/** The site the token is for. A token for one site is refused by every other. */
|
|
628
|
-
cbid: string;
|
|
629
|
-
/** Who is signed in: 1–128 of `A-Z a-z 0-9 . _ : @ + / = ~ -`. Use an opaque id. */
|
|
630
|
-
subject: string;
|
|
631
|
-
/** Lifetime in seconds. Default 3600; at most 86400 (Cookie Munch refuses longer). */
|
|
632
|
-
ttlSeconds?: number;
|
|
633
|
-
/** Current time in ms (injectable for tests). */
|
|
634
|
-
now?: number;
|
|
635
|
-
}
|
|
636
|
-
declare function mintConsentSyncToken(input: MintConsentSyncTokenInput): string;
|
|
637
|
-
|
|
638
|
-
/**
|
|
639
|
-
* The cm-standard-v2 executor conformance kit (CMU-X20).
|
|
640
|
-
*
|
|
641
|
-
* cm-standard-v2 is an open contract: any system that holds personal data can implement it and
|
|
642
|
-
* be driven by Cookie Munch with no code on our side (docs: cookiemunch.net/docs/executor-contract-v2).
|
|
643
|
-
* This kit checks an implementation rule by rule, and names the rule that fails. It is the same
|
|
644
|
-
* suite Cookie Munch runs on `POST /v1/dsar/executors/{id}/test {conformance: true}`, and the
|
|
645
|
-
* `cookiemunch executors conformance <baseUrl>` command runs it from a terminal or CI.
|
|
646
|
-
*
|
|
647
|
-
* It only ever touches the CANARY subject — an address no real person has. The contract asks every
|
|
648
|
-
* implementation to treat the canary as an existing synthetic person: it is found by its email and
|
|
649
|
-
* by its identity, requests on it move through the full state machine, and nothing real is ever
|
|
650
|
-
* erased. So the kit can check that an erasure waits for `executeAfter`, that a cancel leaves the
|
|
651
|
-
* person in place, and that an identity is never matched to someone else through a shared email —
|
|
652
|
-
* without a real person's data being anywhere near it.
|
|
653
|
-
*
|
|
654
|
-
* No dependencies: `fetch` only, so it runs in Node 18+, a browser, or an edge runtime.
|
|
655
|
-
*/
|
|
656
|
-
type ConformanceStatus = 'pass' | 'fail' | 'skip';
|
|
657
|
-
interface ConformanceRuleResult {
|
|
658
|
-
/** A stable id, e.g. `requests.execute_after.scheduled`. */
|
|
659
|
-
id: string;
|
|
660
|
-
/** What the rule says, in one sentence. */
|
|
661
|
-
title: string;
|
|
662
|
-
status: ConformanceStatus;
|
|
663
|
-
/** What was seen, when it failed or was skipped. */
|
|
664
|
-
detail?: string;
|
|
665
|
-
}
|
|
666
|
-
interface ConformanceReport {
|
|
667
|
-
/** True when no rule failed. */
|
|
668
|
-
ok: boolean;
|
|
669
|
-
passed: number;
|
|
670
|
-
failed: number;
|
|
671
|
-
skipped: number;
|
|
672
|
-
rules: ConformanceRuleResult[];
|
|
673
|
-
/** The `X-Version` the executor answered with, when it sent one. */
|
|
674
|
-
version?: string;
|
|
675
|
-
}
|
|
676
|
-
interface ConformanceOptions {
|
|
677
|
-
/** The executor's base: the contract paths are `{baseUrl}/privacy/lookup` and so on. https (http only for localhost). */
|
|
678
|
-
baseUrl: string;
|
|
679
|
-
/** The credential Cookie Munch would send. */
|
|
680
|
-
secret: string;
|
|
681
|
-
/**
|
|
682
|
-
* The canary address: `canary-<16 hex>@canary.cookiemunch.net`, per organisation
|
|
683
|
-
* (`GET /v1/dsar/executors/presets` → `canaryEmail`).
|
|
684
|
-
*/
|
|
685
|
-
canaryEmail: string;
|
|
686
|
-
/** How the secret is sent. Default `Authorization: Bearer {secret}`. */
|
|
687
|
-
auth?: {
|
|
688
|
-
header: string;
|
|
689
|
-
format: string;
|
|
690
|
-
};
|
|
691
|
-
/** Path prefix under baseUrl. Default `/privacy`. */
|
|
692
|
-
prefix?: string;
|
|
693
|
-
fetch?: typeof fetch;
|
|
694
|
-
now?: () => number;
|
|
695
|
-
/** A per-run tag for idempotency keys and case ids. Default random. */
|
|
696
|
-
runId?: string;
|
|
697
|
-
}
|
|
698
|
-
/** The issuer the canary identity carries. */
|
|
699
|
-
declare const CANARY_ISSUER = "https://canary.cookiemunch.net";
|
|
700
|
-
/** The canary subject's identity, derived from its address. */
|
|
701
|
-
declare function canaryIdentityFor(canaryEmail: string): {
|
|
702
|
-
iss: string;
|
|
703
|
-
sub: string;
|
|
704
|
-
ext: string;
|
|
705
|
-
};
|
|
706
|
-
/** Every rule, in the order they run. */
|
|
707
|
-
declare const CONFORMANCE_RULES: ReadonlyArray<{
|
|
708
|
-
id: string;
|
|
709
|
-
title: string;
|
|
710
|
-
}>;
|
|
711
|
-
/** Run every rule against one executor. Never throws for an executor's answer; only for bad options. */
|
|
712
|
-
declare function runExecutorConformance(o: ConformanceOptions): Promise<ConformanceReport>;
|
|
713
|
-
|
|
714
|
-
/**
|
|
715
|
-
* Operator token exchange (RFC 8693, CMU-X33): swap your identity provider's token for a short-lived,
|
|
716
|
-
* scoped Cookie Munch API key, so no long-lived key has to live in a file.
|
|
717
|
-
*
|
|
718
|
-
* import { exchangeOperatorToken, createCookieMunch } from '@cookiemunch/sdk';
|
|
719
|
-
* const { accessToken } = await exchangeOperatorToken({
|
|
720
|
-
* subjectToken: process.env.STAFF_ACCESS_TOKEN!, // from the sign-in your organisation trusts
|
|
721
|
-
* scope: ['sites:read', 'dsar:read'],
|
|
722
|
-
* resource: 'org:2f1c…', // or 'site:<cbid>' to lock the key to one site
|
|
723
|
-
* });
|
|
724
|
-
* const client = createCookieMunch({ apiKey: accessToken, baseUrl: 'https://api.cookiemunch.net' });
|
|
725
|
-
*
|
|
726
|
-
* No API key is needed for the exchange itself. The key it returns expires on its own (at most an hour).
|
|
727
|
-
*/
|
|
728
|
-
interface OperatorTokenExchangeInput {
|
|
729
|
-
/** The access or ID token from an OIDC issuer the deployment trusts. */
|
|
730
|
-
subjectToken: string;
|
|
731
|
-
/** Which kind of token `subjectToken` is. Default `access_token`. */
|
|
732
|
-
subjectTokenType?: 'access_token' | 'jwt' | 'id_token';
|
|
733
|
-
/** The API scopes the key should carry. Required: an exchanged key is never full access. */
|
|
734
|
-
scope: string[];
|
|
735
|
-
/** `org:<id>`, or `site:<cbid>` to lock the key to one site. */
|
|
736
|
-
resource: `org:${string}` | `site:${string}`;
|
|
737
|
-
/** Seconds, 60 to 3600. Default 3600. */
|
|
738
|
-
expiresIn?: number;
|
|
739
|
-
/** Default `https://api.cookiemunch.net`. */
|
|
740
|
-
baseUrl?: string;
|
|
741
|
-
fetch?: typeof fetch;
|
|
742
|
-
}
|
|
743
|
-
interface OperatorTokenExchangeResult {
|
|
744
|
-
/** A scoped Cookie Munch API key. */
|
|
745
|
-
accessToken: string;
|
|
746
|
-
expiresIn: number;
|
|
747
|
-
scope: string[];
|
|
748
|
-
}
|
|
749
|
-
/** Thrown with the RFC 6749 `error` and `error_description` the server answered. */
|
|
750
|
-
declare class TokenExchangeError extends Error {
|
|
751
|
-
readonly error: string;
|
|
752
|
-
readonly status: number;
|
|
753
|
-
constructor(error: string, status: number, description?: string);
|
|
754
|
-
}
|
|
755
|
-
declare function exchangeOperatorToken(input: OperatorTokenExchangeInput): Promise<OperatorTokenExchangeResult>;
|
|
756
|
-
|
|
757
|
-
/**
|
|
758
|
-
* Types for `window.__fdConsent`, the shared consent API any embed can code against — a chat
|
|
759
|
-
* widget, a referral snippet, an analytics tag — whatever CMP the page runs. Cookie Munch sets
|
|
760
|
-
* it natively; `fd-consent-shim.js` sets the same object over Cookiebot, OneTrust or no CMP.
|
|
761
|
-
* Type-only: importing this module adds nothing to a bundle.
|
|
762
|
-
*
|
|
763
|
-
* import type { FdConsent, FdConsentQueue } from '@cookiemunch/sdk';
|
|
764
|
-
* const fd = (window.__fdConsent ??= { q: [] });
|
|
765
|
-
* if ('version' in fd) fd.on('change', (s) => …); else fd.q.push(['on', 'change', (s) => …]);
|
|
766
|
-
*
|
|
767
|
-
* `version` changes only with a breaking change; new members do not bump it.
|
|
768
|
-
*/
|
|
769
|
-
/** What caused a change. The same causes Cookie Munch's ledger records. */
|
|
770
|
-
type FdCause = 'replay' | 'accept' | 'decline' | 'selection' | 'withdraw' | 'implied' | 'sync' | 'request' | 'migrated';
|
|
771
|
-
interface FdSnapshot {
|
|
772
|
-
/** False until the visitor has answered. */
|
|
773
|
-
decided: boolean;
|
|
774
|
-
/** False when this visitor's region and the site's rules need no answer (a default applies). */
|
|
775
|
-
required: boolean;
|
|
776
|
-
/** Every category the site offers (standard, custom, reserved) and its answer. */
|
|
777
|
-
categories: Record<string, boolean>;
|
|
778
|
-
/** The decision's stamp (`CookieMunch.consentId()`), or null. */
|
|
779
|
-
stamp: string | null;
|
|
780
|
-
region: string;
|
|
781
|
-
/** A Global Privacy Control signal was seen. */
|
|
782
|
-
gpc: boolean;
|
|
783
|
-
/** ISO 8601, or null before a decision. */
|
|
784
|
-
decidedAt: string | null;
|
|
785
|
-
}
|
|
786
|
-
interface FdRequestOptions {
|
|
787
|
-
/** One sentence in the page's language: what will be stored and why. Shown as the prompt's text. */
|
|
788
|
-
reason: string;
|
|
789
|
-
/** Who is asking: your vendor id. Recorded with the answer. */
|
|
790
|
-
vendor: string;
|
|
791
|
-
}
|
|
792
|
-
interface FdConsent {
|
|
793
|
-
readonly version: 1;
|
|
794
|
-
/** `cookiemunch`, or `shim:cookiebot` / `shim:onetrust` / `shim:none`. */
|
|
795
|
-
readonly provider: string;
|
|
796
|
-
/** Resolves once a decision exists, or at once where the region needs none. */
|
|
797
|
-
ready(): Promise<FdSnapshot>;
|
|
798
|
-
/** true / false, or null while a required decision is pending. Never false for "not decided". */
|
|
799
|
-
has(category: string): boolean | null;
|
|
800
|
-
/** Fires once per decision (a returning visitor's as `replay`); a withdrawal synchronously. Returns unsubscribe. */
|
|
801
|
-
on(event: 'change', cb: (snapshot: FdSnapshot, cause: FdCause) => void): () => void;
|
|
802
|
-
/** Ask for one category at the moment you need it. Never re-asks a refusal; one prompt per category per page view. */
|
|
803
|
-
request(category: string, opts: FdRequestOptions): Promise<boolean>;
|
|
804
|
-
/** Not available yet: warns once and does nothing. */
|
|
805
|
-
identify(token: string): void;
|
|
806
|
-
layout: {
|
|
807
|
-
bottomInset(): number;
|
|
808
|
-
on(cb: (insetPx: number) => void): () => void;
|
|
809
|
-
};
|
|
810
|
-
/** Calls made on the queue before this existed ran in order; later pushes run at once. */
|
|
811
|
-
q: {
|
|
812
|
-
push(...calls: FdQueuedCall[]): number;
|
|
813
|
-
};
|
|
814
|
-
}
|
|
815
|
-
/** A call queued before the real object exists. */
|
|
816
|
-
type FdQueuedCall = ['on', 'change', (snapshot: FdSnapshot, cause: FdCause) => void] | ['ready', (snapshot: FdSnapshot) => void] | ['request', string, FdRequestOptions, (granted: boolean) => void] | ['identify', string];
|
|
817
|
-
/** What an embed that loads first creates: `window.__fdConsent = window.__fdConsent || { q: [] }`. */
|
|
818
|
-
interface FdConsentQueue {
|
|
819
|
-
q: FdQueuedCall[];
|
|
820
|
-
}
|
|
821
|
-
declare global {
|
|
822
|
-
interface Window {
|
|
823
|
-
__fdConsent?: FdConsent | FdConsentQueue;
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
|
|
827
1
|
/**
|
|
828
2
|
* @cookiemunch/sdk — a small, typed REST client for the Cookie Munch Developer API
|
|
829
3
|
* (the /v1 surface). Construct it with an API key; the org is derived server-side
|
|
@@ -833,13 +7,21 @@ declare global {
|
|
|
833
7
|
* const fc = createCookieMunch({ apiKey: 'fck_…', baseUrl: 'https://api.cookiemunch.net' });
|
|
834
8
|
* const sites = await fc.sites.list();
|
|
835
9
|
*/
|
|
836
|
-
|
|
10
|
+
export * from './types.js';
|
|
11
|
+
export * from './consent.js';
|
|
12
|
+
export * from './webhooks.js';
|
|
13
|
+
export * from './consent-sync.js';
|
|
14
|
+
export * from './executor-conformance.js';
|
|
15
|
+
export * from './token-exchange.js';
|
|
16
|
+
export type * from './fd-consent.js';
|
|
17
|
+
import type { CategoryRegistry, Identity, AccountOrgs, Site, SiteCreate, SiteConfig, SiteUpdate, SiteUpdateResult, IntegrationHealthReport, HealthWaiver, HealthWaiverInput, ProvisionRequest, ProvisionResult, PartnerLink, PartnerLinkCreate, PartnerCatalogEntry, ConsentDay, ConsentLogRow, RangeQuery, LogQuery, DsarRequest, DsarCreate, DsarCase, DsarCaseCreate, DsarCaseReceipt, DsarSettings, SubjectCard, IntegrationConnect, IntegrationConnectResult, DsarStatus, ScoredVendor, VendorInput, VendorRecord, RiskScore, RopaEntry, RopaInput, SignedReceipt, PreferenceRecord } from './types.js';
|
|
18
|
+
import type { ConformanceReport } from './executor-conformance.js';
|
|
837
19
|
/**
|
|
838
20
|
* This package's version, sent in the default User-Agent. Cloudflare answers a request with
|
|
839
21
|
* no recognisable User-Agent with `403 error code: 1010`; a test pins this to package.json.
|
|
840
22
|
*/
|
|
841
|
-
declare const SDK_VERSION = "0.
|
|
842
|
-
interface CookieMunchOptions {
|
|
23
|
+
export declare const SDK_VERSION = "0.9.0";
|
|
24
|
+
export interface CookieMunchOptions {
|
|
843
25
|
apiKey: string;
|
|
844
26
|
/** "https://api.cookiemunch.net" — the /v1 prefix is appended automatically. */
|
|
845
27
|
baseUrl: string;
|
|
@@ -863,32 +45,32 @@ interface CookieMunchOptions {
|
|
|
863
45
|
*/
|
|
864
46
|
secretRecipient?: string;
|
|
865
47
|
/**
|
|
866
|
-
* Extra headers on every request, e.g. `{ 'Idempotency-Key': '<
|
|
48
|
+
* Extra headers on every request, e.g. `{ 'Idempotency-Key': '<stack ref>:<run>' }` on a client made for
|
|
867
49
|
* one create: a retry with the same key replays the first answer (secrets included) for 24 hours.
|
|
868
50
|
*/
|
|
869
51
|
headers?: Record<string, string>;
|
|
870
52
|
}
|
|
871
|
-
/** Tags on a created resource (CMU-X29). `
|
|
872
|
-
type ResourceMetadata = Record<string, string | number | boolean>;
|
|
873
|
-
/** Keep only resources whose tags match, e.g. `{
|
|
874
|
-
interface MetadataFilter {
|
|
53
|
+
/** Tags on a created resource (CMU-X29). `stack_sandbox: true` can only be set at creation. */
|
|
54
|
+
export type ResourceMetadata = Record<string, string | number | boolean>;
|
|
55
|
+
/** Keep only resources whose tags match, e.g. `{ stack_product: 'referalli' }`. */
|
|
56
|
+
export interface MetadataFilter {
|
|
875
57
|
metadata?: Record<string, string>;
|
|
876
58
|
}
|
|
877
59
|
/** externalRef and metadata, accepted by every create (orgs, sites, webhooks, executors, DSARs, partner links). */
|
|
878
|
-
interface ResourceTagsInput {
|
|
60
|
+
export interface ResourceTagsInput {
|
|
879
61
|
/** Your own name for it, unique per org and type: a repeat create with the same body returns the existing one. */
|
|
880
62
|
externalRef?: string;
|
|
881
63
|
metadata?: ResourceMetadata;
|
|
882
64
|
}
|
|
883
|
-
type TaggedType = 'org' | 'site' | 'webhook' | 'executor' | 'dsar' | 'partner_link';
|
|
884
|
-
interface ResourceTags {
|
|
65
|
+
export type TaggedType = 'org' | 'site' | 'webhook' | 'executor' | 'dsar' | 'partner_link';
|
|
66
|
+
export interface ResourceTags {
|
|
885
67
|
type: TaggedType;
|
|
886
68
|
id: string;
|
|
887
69
|
metadata: ResourceMetadata;
|
|
888
70
|
externalRef: string | null;
|
|
889
71
|
sandbox: boolean;
|
|
890
72
|
}
|
|
891
|
-
interface ResourceTagsUpdate {
|
|
73
|
+
export interface ResourceTagsUpdate {
|
|
892
74
|
dryRun?: true;
|
|
893
75
|
type: TaggedType;
|
|
894
76
|
id: string;
|
|
@@ -900,14 +82,14 @@ interface ResourceTagsUpdate {
|
|
|
900
82
|
}>;
|
|
901
83
|
}
|
|
902
84
|
/** What a sandbox hard delete removed. */
|
|
903
|
-
interface SandboxPurge {
|
|
85
|
+
export interface SandboxPurge {
|
|
904
86
|
deleted: true;
|
|
905
87
|
cbid?: string;
|
|
906
88
|
orgId?: string;
|
|
907
89
|
counts: Record<string, number>;
|
|
908
90
|
}
|
|
909
91
|
/** A partner link in the suite-standard shape (CMU-X34). */
|
|
910
|
-
interface StandardPartnerLink {
|
|
92
|
+
export interface StandardPartnerLink {
|
|
911
93
|
id: string;
|
|
912
94
|
partner: string;
|
|
913
95
|
resource: string;
|
|
@@ -920,7 +102,7 @@ interface StandardPartnerLink {
|
|
|
920
102
|
externalId?: string;
|
|
921
103
|
label?: string;
|
|
922
104
|
}
|
|
923
|
-
interface StandardPartnerLinkCreate extends ResourceTagsInput {
|
|
105
|
+
export interface StandardPartnerLinkCreate extends ResourceTagsInput {
|
|
924
106
|
partner: string;
|
|
925
107
|
/** `site:<cbid>` or `org:<org id>`. */
|
|
926
108
|
resource: string;
|
|
@@ -929,9 +111,9 @@ interface StandardPartnerLinkCreate extends ResourceTagsInput {
|
|
|
929
111
|
externalId?: string;
|
|
930
112
|
label?: string;
|
|
931
113
|
}
|
|
932
|
-
/** POST /v1/provision v2: the `cookiemunch` block of a
|
|
933
|
-
interface ProvisionRequestV2 {
|
|
934
|
-
|
|
114
|
+
/** POST /v1/provision v2: the `cookiemunch` block of a stack.yaml (see the provisioning API map page). */
|
|
115
|
+
export interface ProvisionRequestV2 {
|
|
116
|
+
stack: {
|
|
935
117
|
ref?: string;
|
|
936
118
|
product: string;
|
|
937
119
|
env?: string;
|
|
@@ -990,7 +172,7 @@ interface ProvisionRequestV2 {
|
|
|
990
172
|
};
|
|
991
173
|
}
|
|
992
174
|
/** GET /v1/provision/env: names, non-secret values, and references for secrets. */
|
|
993
|
-
interface ProvisionEnv {
|
|
175
|
+
export interface ProvisionEnv {
|
|
994
176
|
ref: string;
|
|
995
177
|
cbid: string;
|
|
996
178
|
env: Array<{
|
|
@@ -1000,7 +182,7 @@ interface ProvisionEnv {
|
|
|
1000
182
|
}>;
|
|
1001
183
|
}
|
|
1002
184
|
/** A vended short-lived key, shown once. */
|
|
1003
|
-
interface ApiKeyVended {
|
|
185
|
+
export interface ApiKeyVended {
|
|
1004
186
|
key: string;
|
|
1005
187
|
prefix: string;
|
|
1006
188
|
expiresAt: number;
|
|
@@ -1008,7 +190,7 @@ interface ApiKeyVended {
|
|
|
1008
190
|
cbids: string[] | null;
|
|
1009
191
|
}
|
|
1010
192
|
/** The suite-standard key listing (GET /v1/keys?shape=standard). */
|
|
1011
|
-
interface StandardKeyList {
|
|
193
|
+
export interface StandardKeyList {
|
|
1012
194
|
keys: Array<{
|
|
1013
195
|
id: string;
|
|
1014
196
|
prefix: string;
|
|
@@ -1027,7 +209,7 @@ interface StandardKeyList {
|
|
|
1027
209
|
}>;
|
|
1028
210
|
}
|
|
1029
211
|
/** A leaked secret to revoke (POST /v1/keys/revoke_leaked, no authentication needed). */
|
|
1030
|
-
type LeakReport = {
|
|
212
|
+
export type LeakReport = {
|
|
1031
213
|
key: string;
|
|
1032
214
|
source?: string;
|
|
1033
215
|
} | {
|
|
@@ -1040,7 +222,7 @@ type LeakReport = {
|
|
|
1040
222
|
* (e.g. `forbidden` on a scope failure, whose `message` is `insufficient_scope`,
|
|
1041
223
|
* or `banner_in_use` on a banner-library conflict). It's `undefined` when the body has no `code`.
|
|
1042
224
|
*/
|
|
1043
|
-
declare class CookieMunchApiError extends Error {
|
|
225
|
+
export declare class CookieMunchApiError extends Error {
|
|
1044
226
|
readonly status: number;
|
|
1045
227
|
readonly code?: string;
|
|
1046
228
|
/** The parsed JSON error body, when there was one (e.g. `issues` on a 422). */
|
|
@@ -1049,7 +231,7 @@ declare class CookieMunchApiError extends Error {
|
|
|
1049
231
|
}
|
|
1050
232
|
/** A cookie discovered on a site, classified into a consent category (wire shape of the
|
|
1051
233
|
* cookie-declaration feed). Matches the server's CategorizedCookie schema. */
|
|
1052
|
-
interface CategorizedCookie {
|
|
234
|
+
export interface CategorizedCookie {
|
|
1053
235
|
name: string;
|
|
1054
236
|
category: 'necessary' | 'preferences' | 'statistics' | 'marketing' | 'unclassified' | (string & {});
|
|
1055
237
|
domain?: string;
|
|
@@ -1100,9 +282,9 @@ interface CategorizedCookie {
|
|
|
1100
282
|
vendor?: string;
|
|
1101
283
|
}
|
|
1102
284
|
/** What a declaration row describes. */
|
|
1103
|
-
type StorageType = 'cookie' | 'localStorage' | 'sessionStorage' | 'indexedDB';
|
|
285
|
+
export type StorageType = 'cookie' | 'localStorage' | 'sessionStorage' | 'indexedDB';
|
|
1104
286
|
/** A cookie the site owner retired: the site renamed or stopped setting it. */
|
|
1105
|
-
interface RetiredCookie {
|
|
287
|
+
export interface RetiredCookie {
|
|
1106
288
|
/** Exact name, or a `prefix*` wildcard. */
|
|
1107
289
|
name: string;
|
|
1108
290
|
/** Epoch-ms it was retired; anything seen after this brings it back. */
|
|
@@ -1115,7 +297,7 @@ interface RetiredCookie {
|
|
|
1115
297
|
}
|
|
1116
298
|
/** A site's cookie declaration: the latest scan and observed visits with the site's own
|
|
1117
299
|
* declarations on top. This is what GET /v1/sites/:cbid/cookies returns. */
|
|
1118
|
-
interface CookieDeclaration {
|
|
300
|
+
export interface CookieDeclaration {
|
|
1119
301
|
/** Epoch-ms of the latest scan or declaration change, or 0 if none. */
|
|
1120
302
|
updatedAt: number;
|
|
1121
303
|
cookies: CategorizedCookie[];
|
|
@@ -1125,7 +307,7 @@ interface CookieDeclaration {
|
|
|
1125
307
|
retired?: RetiredCookie[];
|
|
1126
308
|
}
|
|
1127
309
|
/** What the site owner says a cookie is (PUT /v1/sites/:cbid/cookies/:name). */
|
|
1128
|
-
interface DeclaredCookieInput {
|
|
310
|
+
export interface DeclaredCookieInput {
|
|
1129
311
|
/** A standard category or one of the site's `categories.custom` ids. Not `unclassified`. */
|
|
1130
312
|
category: string;
|
|
1131
313
|
/** Shown to visitors, and the fallback for any language `purposes` lacks. */
|
|
@@ -1145,7 +327,7 @@ interface DeclaredCookieInput {
|
|
|
1145
327
|
type?: StorageType;
|
|
1146
328
|
}
|
|
1147
329
|
/** A stored declaration. */
|
|
1148
|
-
interface DeclaredCookie extends DeclaredCookieInput {
|
|
330
|
+
export interface DeclaredCookie extends DeclaredCookieInput {
|
|
1149
331
|
name: string;
|
|
1150
332
|
updatedAt: number;
|
|
1151
333
|
/** `import` when a vendor preset wrote it. */
|
|
@@ -1154,11 +336,11 @@ interface DeclaredCookie extends DeclaredCookieInput {
|
|
|
1154
336
|
vendor?: string;
|
|
1155
337
|
}
|
|
1156
338
|
/** A platform whose cookies and storage a preset declares. */
|
|
1157
|
-
type CookiePresetVendor = 'atlas' | 'forumulate' | 'chatly' | 'cookiemunch' | 'referalli' | 'firstpromoter' | 'partnerstack' | 'tapfiliate' | 'impact'
|
|
339
|
+
export type CookiePresetVendor = 'atlas' | 'forumulate' | 'chatly' | 'cookiemunch' | 'referalli' | 'firstpromoter' | 'partnerstack' | 'tapfiliate' | 'impact'
|
|
1158
340
|
/** @deprecated the old name of `referalli`, accepted until 2027-10-23. */
|
|
1159
341
|
| 'referally';
|
|
1160
342
|
/** Where a vendor's live manifest will come from, and whether it exists yet. */
|
|
1161
|
-
interface CookiePresetManifest {
|
|
343
|
+
export interface CookiePresetManifest {
|
|
1162
344
|
/** `live`/`stale`/`invalid`: the vendor's embed manifest feeds the preset; `waiting_on_vendor`: built-in rows. */
|
|
1163
345
|
status: 'builtin' | 'live' | 'stale' | 'invalid' | 'waiting_on_vendor';
|
|
1164
346
|
waitingOn?: string;
|
|
@@ -1176,15 +358,20 @@ interface CookiePresetManifest {
|
|
|
1176
358
|
code?: string;
|
|
1177
359
|
message: string;
|
|
1178
360
|
}>;
|
|
361
|
+
/**
|
|
362
|
+
* About the copy in effect: `entry_skipped` / `storage_entry_skipped` (one entry was unreadable and left out; the
|
|
363
|
+
* rest still applies, and a left-out storage entry gives `name`), or `short_notice`.
|
|
364
|
+
*/
|
|
1179
365
|
warnings?: Array<{
|
|
1180
366
|
rule?: number;
|
|
1181
367
|
path?: string;
|
|
1182
368
|
code?: string;
|
|
1183
369
|
message: string;
|
|
370
|
+
name?: string;
|
|
1184
371
|
}>;
|
|
1185
372
|
}
|
|
1186
373
|
/** PUT /v1/sites/:cbid/cookies/presets/custom — any vendor's embed manifest, by URL or as a body. */
|
|
1187
|
-
type CustomPresetInput = ({
|
|
374
|
+
export type CustomPresetInput = ({
|
|
1188
375
|
url: string;
|
|
1189
376
|
manifest?: never;
|
|
1190
377
|
} | {
|
|
@@ -1195,7 +382,7 @@ type CustomPresetInput = ({
|
|
|
1195
382
|
params?: Record<string, string>;
|
|
1196
383
|
};
|
|
1197
384
|
/** One suggestion in GET /v1/sites/:cbid/cookies/suggestions. */
|
|
1198
|
-
interface CookieSuggestion {
|
|
385
|
+
export interface CookieSuggestion {
|
|
1199
386
|
name: string;
|
|
1200
387
|
storage: 'cookie' | 'localStorage' | 'sessionStorage' | 'indexedDB';
|
|
1201
388
|
foundOnPages: string[];
|
|
@@ -1208,7 +395,7 @@ interface CookieSuggestion {
|
|
|
1208
395
|
reason: string;
|
|
1209
396
|
}
|
|
1210
397
|
/** GET /v1/sites/:cbid/cookies/suggestions */
|
|
1211
|
-
interface CookieSuggestions {
|
|
398
|
+
export interface CookieSuggestions {
|
|
1212
399
|
suggestions: CookieSuggestion[];
|
|
1213
400
|
vendors: Array<{
|
|
1214
401
|
vendor: string;
|
|
@@ -1224,7 +411,7 @@ interface CookieSuggestions {
|
|
|
1224
411
|
}>;
|
|
1225
412
|
}
|
|
1226
413
|
/** POST /v1/sites/:cbid/cookies/suggestions/declare */
|
|
1227
|
-
interface CookieSuggestionsDeclared {
|
|
414
|
+
export interface CookieSuggestionsDeclared {
|
|
1228
415
|
presetsApplied: string[];
|
|
1229
416
|
declaredCount: number;
|
|
1230
417
|
skipped?: Array<{
|
|
@@ -1236,7 +423,7 @@ interface CookieSuggestionsDeclared {
|
|
|
1236
423
|
diff?: DeclarationDiff;
|
|
1237
424
|
}
|
|
1238
425
|
/** Preset parameters: Atlas `frontendApiHost`/`crossSubdomainCookies`; Chatly `publicId`/`dragging`/`category`; referral and affiliate presets (referalli, firstpromoter, partnerstack, tapfiliate, impact) `cookieDomain`/`cookieDays`/`category`, referalli `legacyName`, impact `campaignId`. */
|
|
1239
|
-
interface CookiePresetParams {
|
|
426
|
+
export interface CookiePresetParams {
|
|
1240
427
|
frontendApiHost?: string;
|
|
1241
428
|
crossSubdomainCookies?: boolean;
|
|
1242
429
|
publicId?: string;
|
|
@@ -1250,7 +437,7 @@ interface CookiePresetParams {
|
|
|
1250
437
|
campaignId?: string;
|
|
1251
438
|
}
|
|
1252
439
|
/** One browser key a surface writes, in an embed manifest. */
|
|
1253
|
-
interface EmbedManifestStorage {
|
|
440
|
+
export interface EmbedManifestStorage {
|
|
1254
441
|
name: string;
|
|
1255
442
|
type: 'cookie' | 'localStorage' | 'sessionStorage' | 'indexedDB';
|
|
1256
443
|
category: string;
|
|
@@ -1262,7 +449,7 @@ interface EmbedManifestStorage {
|
|
|
1262
449
|
sentTo?: string;
|
|
1263
450
|
}
|
|
1264
451
|
/** One embeddable surface in an embed manifest: its origins by CSP directive and its storage. */
|
|
1265
|
-
interface EmbedManifestSurface {
|
|
452
|
+
export interface EmbedManifestSurface {
|
|
1266
453
|
/** Origins by CSP directive (`script-src`, `connect-src`, …). */
|
|
1267
454
|
csp?: Record<string, string[]>;
|
|
1268
455
|
/** Non-origin sources the surface needs (`'unsafe-inline'`, `data:`). */
|
|
@@ -1273,7 +460,7 @@ interface EmbedManifestSurface {
|
|
|
1273
460
|
sri?: Record<string, string>;
|
|
1274
461
|
}
|
|
1275
462
|
/** The shared embed/origins manifest (https://cookiemunch.net/schemas/embed-v1.json). */
|
|
1276
|
-
interface EmbedManifest {
|
|
463
|
+
export interface EmbedManifest {
|
|
1277
464
|
schema: string;
|
|
1278
465
|
product: string;
|
|
1279
466
|
updated: string;
|
|
@@ -1309,7 +496,7 @@ interface EmbedManifest {
|
|
|
1309
496
|
};
|
|
1310
497
|
}
|
|
1311
498
|
/** One preset in GET /v1/sites/:cbid/cookies/presets. */
|
|
1312
|
-
interface CookiePreset {
|
|
499
|
+
export interface CookiePreset {
|
|
1313
500
|
/** A first-class preset, or a custom preset's product id. */
|
|
1314
501
|
vendor: CookiePresetVendor | (string & {});
|
|
1315
502
|
/** A custom preset (importCookieManifest). */
|
|
@@ -1326,10 +513,10 @@ interface CookiePreset {
|
|
|
1326
513
|
manifest: CookiePresetManifest;
|
|
1327
514
|
}
|
|
1328
515
|
/** What applying a preset declared. */
|
|
1329
|
-
interface CookiePresetResult {
|
|
516
|
+
export interface CookiePresetResult {
|
|
1330
517
|
vendor: CookiePresetVendor | (string & {});
|
|
1331
|
-
/** `
|
|
1332
|
-
source?: 'manifest';
|
|
518
|
+
/** `builtin` (Cookie Munch's own rows, also while the vendor's manifest is invalid), `manifest` (its valid embed manifest), or `instance`. */
|
|
519
|
+
source?: 'builtin' | 'manifest' | 'instance';
|
|
1333
520
|
cookies: DeclaredCookie[];
|
|
1334
521
|
removed: string[];
|
|
1335
522
|
skipped?: Array<{
|
|
@@ -1353,7 +540,7 @@ interface CookiePresetResult {
|
|
|
1353
540
|
diff?: DeclarationDiff;
|
|
1354
541
|
}
|
|
1355
542
|
/** What removing observed rows removed (or, with `dryRun`, would). */
|
|
1356
|
-
interface ObservedPurgeResult {
|
|
543
|
+
export interface ObservedPurgeResult {
|
|
1357
544
|
removed: string[];
|
|
1358
545
|
count: number;
|
|
1359
546
|
since?: number;
|
|
@@ -1361,7 +548,7 @@ interface ObservedPurgeResult {
|
|
|
1361
548
|
dryRun?: true;
|
|
1362
549
|
}
|
|
1363
550
|
/** What a declaration write would change (`dryRun`). */
|
|
1364
|
-
interface DeclarationDiff {
|
|
551
|
+
export interface DeclarationDiff {
|
|
1365
552
|
added: DeclaredCookie[];
|
|
1366
553
|
removed: DeclaredCookie[];
|
|
1367
554
|
changed: Array<{
|
|
@@ -1371,19 +558,19 @@ interface DeclarationDiff {
|
|
|
1371
558
|
}>;
|
|
1372
559
|
}
|
|
1373
560
|
/** The answer to a `dryRun` declaration write: nothing was stored. */
|
|
1374
|
-
interface DeclarationDryRun {
|
|
561
|
+
export interface DeclarationDryRun {
|
|
1375
562
|
dryRun: true;
|
|
1376
563
|
/** Every declaration the site would have. */
|
|
1377
564
|
declared: DeclaredCookie[];
|
|
1378
565
|
diff: DeclarationDiff;
|
|
1379
566
|
}
|
|
1380
567
|
/** A warning about a write: e.g. the category is switched off for the site. */
|
|
1381
|
-
interface DeclarationWarning {
|
|
568
|
+
export interface DeclarationWarning {
|
|
1382
569
|
field: string;
|
|
1383
570
|
reason: string;
|
|
1384
571
|
}
|
|
1385
572
|
/** What an import with `apply` declared, on top of what it read. */
|
|
1386
|
-
interface AppliedImport extends ImportedDeclaration {
|
|
573
|
+
export interface AppliedImport extends ImportedDeclaration {
|
|
1387
574
|
applied: number;
|
|
1388
575
|
skipped: Array<{
|
|
1389
576
|
name: string;
|
|
@@ -1392,7 +579,7 @@ interface AppliedImport extends ImportedDeclaration {
|
|
|
1392
579
|
warnings?: DeclarationWarning[];
|
|
1393
580
|
}
|
|
1394
581
|
/** @deprecated The server returns {@link CookieDeclaration}; kept only for back-compat. */
|
|
1395
|
-
interface SiteCookie {
|
|
582
|
+
export interface SiteCookie {
|
|
1396
583
|
name: string;
|
|
1397
584
|
domain: string;
|
|
1398
585
|
category: string;
|
|
@@ -1402,7 +589,7 @@ interface SiteCookie {
|
|
|
1402
589
|
firstSeen?: number;
|
|
1403
590
|
}
|
|
1404
591
|
/** Cookie-scan status, from GET /v1/sites/:cbid/scan. */
|
|
1405
|
-
interface ScanStatus {
|
|
592
|
+
export interface ScanStatus {
|
|
1406
593
|
/** `scanning` while the last scan is queued or crawling. Kept for older clients; read `state`. */
|
|
1407
594
|
status: 'idle' | 'scanning';
|
|
1408
595
|
/** Epoch-ms of the last completed scan, or null. */
|
|
@@ -1425,7 +612,7 @@ interface ScanStatus {
|
|
|
1425
612
|
error?: string;
|
|
1426
613
|
}
|
|
1427
614
|
/** Consent-button parity of the banner a real browser saw on the site (see ScanStatus). */
|
|
1428
|
-
interface ButtonParityScan {
|
|
615
|
+
export interface ButtonParityScan {
|
|
1429
616
|
url: string;
|
|
1430
617
|
/** False when no visible consent accept control was found in a recognisable banner. */
|
|
1431
618
|
bannerFound: boolean;
|
|
@@ -1444,7 +631,7 @@ interface ButtonParityScan {
|
|
|
1444
631
|
checkedAt?: number;
|
|
1445
632
|
}
|
|
1446
633
|
/** @deprecated The server returns {@link ScanStatus}; kept only for back-compat. */
|
|
1447
|
-
interface ScanResult {
|
|
634
|
+
export interface ScanResult {
|
|
1448
635
|
scanId: string;
|
|
1449
636
|
status: 'queued' | 'running' | 'complete' | 'failed';
|
|
1450
637
|
startedAt?: number;
|
|
@@ -1453,14 +640,14 @@ interface ScanResult {
|
|
|
1453
640
|
cookiesFound?: number;
|
|
1454
641
|
}
|
|
1455
642
|
/** A/B banner experiment results for a single variant. */
|
|
1456
|
-
interface AbResult {
|
|
643
|
+
export interface AbResult {
|
|
1457
644
|
variant: string;
|
|
1458
645
|
impressions: number;
|
|
1459
646
|
optIns: number;
|
|
1460
647
|
optInRate: number;
|
|
1461
648
|
}
|
|
1462
649
|
/** The response shape of GET /v1/sites/:cbid/snippet. */
|
|
1463
|
-
interface InstallSnippet {
|
|
650
|
+
export interface InstallSnippet {
|
|
1464
651
|
/** The exact `<script>` tag to paste into `<head>`. */
|
|
1465
652
|
snippet: string;
|
|
1466
653
|
/** URL of the consent.js embed file (the embed/CDN origin). */
|
|
@@ -1481,7 +668,7 @@ interface InstallSnippet {
|
|
|
1481
668
|
warnings?: ConfigWarning[];
|
|
1482
669
|
}
|
|
1483
670
|
/** Content Security Policy sources the embed needs. */
|
|
1484
|
-
interface CspSources {
|
|
671
|
+
export interface CspSources {
|
|
1485
672
|
script: string[];
|
|
1486
673
|
connect: string[];
|
|
1487
674
|
img: string[];
|
|
@@ -1493,22 +680,22 @@ interface CspSources {
|
|
|
1493
680
|
policy: string;
|
|
1494
681
|
}
|
|
1495
682
|
/** Something a config write did not store as sent. */
|
|
1496
|
-
interface ConfigWarning {
|
|
683
|
+
export interface ConfigWarning {
|
|
1497
684
|
field: string;
|
|
1498
685
|
reason: string;
|
|
1499
686
|
}
|
|
1500
687
|
/** One leaf a config write would change. */
|
|
1501
|
-
interface ConfigChange {
|
|
688
|
+
export interface ConfigChange {
|
|
1502
689
|
path: string;
|
|
1503
690
|
from?: unknown;
|
|
1504
691
|
to?: unknown;
|
|
1505
692
|
}
|
|
1506
693
|
/** `PUT …/config` options. `keep: 'unspecified'` keeps the stored value of every top-level field the body omits. */
|
|
1507
|
-
interface PutConfigOptions {
|
|
694
|
+
export interface PutConfigOptions {
|
|
1508
695
|
keep?: 'unspecified';
|
|
1509
696
|
}
|
|
1510
697
|
/** What a config write would do (`?dryRun=1`) — nothing is saved. */
|
|
1511
|
-
interface ConfigDryRun {
|
|
698
|
+
export interface ConfigDryRun {
|
|
1512
699
|
dryRun: true;
|
|
1513
700
|
/** The config as it would be saved. */
|
|
1514
701
|
config: SiteConfig;
|
|
@@ -1519,7 +706,7 @@ interface ConfigDryRun {
|
|
|
1519
706
|
designWarnings: ButtonParityFinding[];
|
|
1520
707
|
}
|
|
1521
708
|
/** The effective style of an Accept all / Reject all control. */
|
|
1522
|
-
interface ParityControlSummary {
|
|
709
|
+
export interface ParityControlSummary {
|
|
1523
710
|
id?: string;
|
|
1524
711
|
label: string;
|
|
1525
712
|
element: 'button' | 'link';
|
|
@@ -1537,8 +724,8 @@ interface ParityControlSummary {
|
|
|
1537
724
|
* CSS). Returned as `designWarnings` on every config read and write, and by `lintConfig`.
|
|
1538
725
|
* A warning, never an error — the config is saved regardless. See /docs/fair-consent-buttons.
|
|
1539
726
|
*/
|
|
1540
|
-
interface ButtonParityFinding {
|
|
1541
|
-
code: 'reject_missing_first_layer' | 'reject_missing_same_layer' | 'reject_hidden' | 'reject_below_fold' | 'reject_isolated' | 'reject_low_emphasis' | 'saturation_gap' | 'color_mismatch' | 'reject_text_low_contrast' | 'reject_styled_as_link' | 'font_size_gap' | 'font_weight_gap' | 'size_gap' | 'padding_gap' | 'border_mismatch' | 'reject_label_missing' | 'reject_label_long' | 'confirmshaming' | 'custom_css_asymmetric' | 'text_low_contrast' | 'link_low_contrast' | 'button_text_low_contrast' | 'focus_ring_low_contrast' | 'toggle_low_contrast' | 'control_boundary_low_contrast';
|
|
727
|
+
export interface ButtonParityFinding {
|
|
728
|
+
code: 'reject_missing_first_layer' | 'reject_missing_same_layer' | 'reject_hidden' | 'reject_below_fold' | 'reject_isolated' | 'reject_low_emphasis' | 'saturation_gap' | 'color_mismatch' | 'reject_text_low_contrast' | 'reject_styled_as_link' | 'font_size_gap' | 'font_weight_gap' | 'size_gap' | 'padding_gap' | 'border_mismatch' | 'reject_label_missing' | 'reject_label_long' | 'confirmshaming' | 'custom_css_asymmetric' | 'customize_label_clash' | 'text_low_contrast' | 'link_low_contrast' | 'button_text_low_contrast' | 'focus_ring_low_contrast' | 'toggle_low_contrast' | 'control_boundary_low_contrast';
|
|
1542
729
|
severity: 'warning' | 'notice';
|
|
1543
730
|
layer: 'banner' | 'preferences' | 'modal' | 'popup' | 'bar' | 'inline' | 'custom';
|
|
1544
731
|
accept: ParityControlSummary | null;
|
|
@@ -1564,7 +751,7 @@ interface ButtonParityFinding {
|
|
|
1564
751
|
wcag?: '1.4.3' | '1.4.11';
|
|
1565
752
|
}
|
|
1566
753
|
/** Reject all style values that would match the Accept all on the same layer. */
|
|
1567
|
-
interface SuggestedRejectStyle {
|
|
754
|
+
export interface SuggestedRejectStyle {
|
|
1568
755
|
layer: string;
|
|
1569
756
|
view?: string;
|
|
1570
757
|
background?: string;
|
|
@@ -1577,19 +764,28 @@ interface SuggestedRejectStyle {
|
|
|
1577
764
|
height?: number;
|
|
1578
765
|
}
|
|
1579
766
|
/** `POST /v1/sites/:cbid/config/lint` — nothing is saved. */
|
|
1580
|
-
interface ButtonParityLint {
|
|
767
|
+
export interface ButtonParityLint {
|
|
1581
768
|
/** `merged` = what PATCH would store (merged over the stored config); `replaced` = what PUT would store (`replace: true`). */
|
|
1582
769
|
mode: 'merged' | 'replaced';
|
|
1583
770
|
designWarnings: ButtonParityFinding[];
|
|
1584
771
|
/** 100 minus 20 per warning and 5 per notice, floored at 0. */
|
|
1585
772
|
score: number;
|
|
1586
773
|
suggestedReject: SuggestedRejectStyle[];
|
|
774
|
+
/** Laws taking effect within 90 days where at least 1% of the site's recent decisions come from. Absent when none. */
|
|
775
|
+
regulatoryWarnings?: Array<{
|
|
776
|
+
code: 'law_upcoming';
|
|
777
|
+
law: string;
|
|
778
|
+
effective: string;
|
|
779
|
+
daysUntil: number;
|
|
780
|
+
trafficShare: number;
|
|
781
|
+
message: string;
|
|
782
|
+
}>;
|
|
1587
783
|
}
|
|
1588
784
|
/**
|
|
1589
785
|
* Scrollbars on the surfaces Cookie Munch renders — the same shape on the banner theme (`theme.scrollbar`)
|
|
1590
786
|
* and the rights-page theme. Colours are #hex, rgb() or hsl(); width is clamped to 4–16, radius to 0–999.
|
|
1591
787
|
*/
|
|
1592
|
-
interface ScrollbarTheme {
|
|
788
|
+
export interface ScrollbarTheme {
|
|
1593
789
|
style: 'themed' | 'thin' | 'native' | 'hidden';
|
|
1594
790
|
thumb?: string;
|
|
1595
791
|
thumbHover?: string;
|
|
@@ -1598,7 +794,7 @@ interface ScrollbarTheme {
|
|
|
1598
794
|
radius?: number;
|
|
1599
795
|
}
|
|
1600
796
|
/** The hosted rights page document. See docs/rights-page for each section type's props. */
|
|
1601
|
-
interface RightsPageDocument {
|
|
797
|
+
export interface RightsPageDocument {
|
|
1602
798
|
v: 1;
|
|
1603
799
|
theme: {
|
|
1604
800
|
preset: 'brand' | 'light' | 'dark' | 'custom';
|
|
@@ -1644,13 +840,13 @@ interface RightsPageDocument {
|
|
|
1644
840
|
customCss?: string;
|
|
1645
841
|
}
|
|
1646
842
|
/** `message` is English; `code` (+ `params`) is stable, for your own wording or language. */
|
|
1647
|
-
interface RightsPageIssue {
|
|
843
|
+
export interface RightsPageIssue {
|
|
1648
844
|
path: string;
|
|
1649
845
|
message: string;
|
|
1650
846
|
code?: string;
|
|
1651
847
|
params?: Record<string, string | number>;
|
|
1652
848
|
}
|
|
1653
|
-
interface RightsPageDraft {
|
|
849
|
+
export interface RightsPageDraft {
|
|
1654
850
|
cbid: string;
|
|
1655
851
|
draft: RightsPageDocument;
|
|
1656
852
|
version: number;
|
|
@@ -1658,19 +854,19 @@ interface RightsPageDraft {
|
|
|
1658
854
|
updatedAt: number | null;
|
|
1659
855
|
warnings: RightsPageIssue[];
|
|
1660
856
|
}
|
|
1661
|
-
interface RightsPageDryRun {
|
|
857
|
+
export interface RightsPageDryRun {
|
|
1662
858
|
dryRun: true;
|
|
1663
859
|
cbid: string;
|
|
1664
860
|
draft: RightsPageDocument;
|
|
1665
861
|
warnings: RightsPageIssue[];
|
|
1666
862
|
}
|
|
1667
863
|
/** Who published a version: `publishedBy` is an actor id; `publishedByEmail` names a dashboard user (null for an API key). */
|
|
1668
|
-
interface RightsPagePublisher {
|
|
864
|
+
export interface RightsPagePublisher {
|
|
1669
865
|
publishedBy: string;
|
|
1670
866
|
publishedByEmail: string | null;
|
|
1671
867
|
publishedVia: 'dashboard' | 'api_key';
|
|
1672
868
|
}
|
|
1673
|
-
interface RightsPagePublished {
|
|
869
|
+
export interface RightsPagePublished {
|
|
1674
870
|
cbid: string;
|
|
1675
871
|
page: RightsPageDocument;
|
|
1676
872
|
version: number;
|
|
@@ -1685,22 +881,22 @@ interface RightsPagePublished {
|
|
|
1685
881
|
* body is RightsPageDraftConflict. Omitted: a full write (put) is last-write-wins; a patch merges onto the draft
|
|
1686
882
|
* as it is when written, so a concurrent edit is not lost.
|
|
1687
883
|
*/
|
|
1688
|
-
interface RightsPageWriteOptions {
|
|
884
|
+
export interface RightsPageWriteOptions {
|
|
1689
885
|
baseUpdatedAt?: number | string | null;
|
|
1690
886
|
}
|
|
1691
|
-
interface RightsPageDraftConflict {
|
|
887
|
+
export interface RightsPageDraftConflict {
|
|
1692
888
|
error: 'draft_conflict';
|
|
1693
889
|
draft: RightsPageDraft;
|
|
1694
890
|
}
|
|
1695
891
|
/** `draftUpdatedAt`: the draft's updatedAt after the call — pass it as the next `baseUpdatedAt`. */
|
|
1696
|
-
interface RightsPagePublishResult {
|
|
892
|
+
export interface RightsPagePublishResult {
|
|
1697
893
|
cbid: string;
|
|
1698
894
|
version: number;
|
|
1699
895
|
publishedAt: number;
|
|
1700
896
|
draftUpdatedAt: number;
|
|
1701
897
|
rolledBackTo?: number;
|
|
1702
898
|
}
|
|
1703
|
-
interface RightsPageVersions {
|
|
899
|
+
export interface RightsPageVersions {
|
|
1704
900
|
cbid: string;
|
|
1705
901
|
versions: Array<{
|
|
1706
902
|
version: number;
|
|
@@ -1708,7 +904,7 @@ interface RightsPageVersions {
|
|
|
1708
904
|
} & RightsPagePublisher>;
|
|
1709
905
|
}
|
|
1710
906
|
/** Options for POST /v1/sites/:cbid/preview-token. All optional. */
|
|
1711
|
-
interface PreviewTokenOptions {
|
|
907
|
+
export interface PreviewTokenOptions {
|
|
1712
908
|
/** Lifetime in seconds, 1..3600. Default 900. */
|
|
1713
909
|
ttlSeconds?: number;
|
|
1714
910
|
/** The page to preview. Default: the site's registered domain. */
|
|
@@ -1719,7 +915,7 @@ interface PreviewTokenOptions {
|
|
|
1719
915
|
lang?: string;
|
|
1720
916
|
}
|
|
1721
917
|
/** A banner preview token, and the page URL that opens the preview. */
|
|
1722
|
-
interface PreviewToken {
|
|
918
|
+
export interface PreviewToken {
|
|
1723
919
|
cbid: string;
|
|
1724
920
|
token: string;
|
|
1725
921
|
/** Epoch milliseconds. */
|
|
@@ -1730,9 +926,9 @@ interface PreviewToken {
|
|
|
1730
926
|
previewUrl?: string;
|
|
1731
927
|
}
|
|
1732
928
|
/** A right a rights link may file (the hosted rights page's request-type kinds). */
|
|
1733
|
-
type RightKind = 'access' | 'erasure' | 'rectification' | 'portability' | 'restriction' | 'objection' | 'opt_out_sale' | 'opt_out_targeted' | 'limit_sensitive';
|
|
929
|
+
export type RightKind = 'access' | 'erasure' | 'rectification' | 'portability' | 'restriction' | 'objection' | 'opt_out_sale' | 'opt_out_targeted' | 'limit_sensitive';
|
|
1734
930
|
/** Input for POST /v1/sites/:cbid/rights-links. */
|
|
1735
|
-
interface RightsLinkInput {
|
|
931
|
+
export interface RightsLinkInput {
|
|
1736
932
|
/** The signed-in person. `email` must be an address you have verified. */
|
|
1737
933
|
subject: {
|
|
1738
934
|
email: string;
|
|
@@ -1744,7 +940,7 @@ interface RightsLinkInput {
|
|
|
1744
940
|
ttlSeconds?: number;
|
|
1745
941
|
}
|
|
1746
942
|
/** A signed, single-use link to the hosted rights page for one signed-in person. */
|
|
1747
|
-
interface RightsLink {
|
|
943
|
+
export interface RightsLink {
|
|
1748
944
|
/** `https://<customDomain>/?t=…`, or `https://cookiemunch.net/r/<cbid>?t=…` when `customDomain` is null. */
|
|
1749
945
|
url: string;
|
|
1750
946
|
/** Epoch milliseconds. */
|
|
@@ -1753,13 +949,13 @@ interface RightsLink {
|
|
|
1753
949
|
customDomain: string | null;
|
|
1754
950
|
}
|
|
1755
951
|
/** One DNS record to create, exactly as written. */
|
|
1756
|
-
interface DnsRecordInstruction {
|
|
952
|
+
export interface DnsRecordInstruction {
|
|
1757
953
|
type: 'CNAME' | 'TXT';
|
|
1758
954
|
name: string;
|
|
1759
955
|
value: string;
|
|
1760
956
|
}
|
|
1761
957
|
/** A custom hostname serving a site's rights page. */
|
|
1762
|
-
interface RightsPageDomain {
|
|
958
|
+
export interface RightsPageDomain {
|
|
1763
959
|
/** Lowercase ASCII form (punycode for an internationalised name). */
|
|
1764
960
|
hostname: string;
|
|
1765
961
|
/** As a person reads it. */
|
|
@@ -1790,14 +986,14 @@ interface RightsPageDomain {
|
|
|
1790
986
|
};
|
|
1791
987
|
}
|
|
1792
988
|
/** The site's custom hostnames, the plan allowance (null = unlimited) and the org's usage. */
|
|
1793
|
-
interface RightsPageDomainList {
|
|
989
|
+
export interface RightsPageDomainList {
|
|
1794
990
|
domains: RightsPageDomain[];
|
|
1795
991
|
limit: number | null;
|
|
1796
992
|
used: number;
|
|
1797
993
|
target: string;
|
|
1798
994
|
}
|
|
1799
995
|
/** Options for the snippet endpoint. */
|
|
1800
|
-
interface SnippetOptions {
|
|
996
|
+
export interface SnippetOptions {
|
|
1801
997
|
/** Override the site's configured `blocking.mode`. Default: the config's. */
|
|
1802
998
|
blockingMode?: 'auto' | 'manual';
|
|
1803
999
|
/** Language culture override, e.g. "en" or "fr". */
|
|
@@ -1809,13 +1005,13 @@ interface SnippetOptions {
|
|
|
1809
1005
|
* packages/server/src/dev-api.ts (~L267) — note the server adds `method` on success,
|
|
1810
1006
|
* so this wire shape is wider than domain-verify.ts's internal VerifyResult.
|
|
1811
1007
|
*/
|
|
1812
|
-
interface VerifyResult {
|
|
1008
|
+
export interface VerifyResult {
|
|
1813
1009
|
verified: boolean;
|
|
1814
1010
|
method?: 'dns' | 'meta' | 'file';
|
|
1815
1011
|
reason?: string;
|
|
1816
1012
|
}
|
|
1817
1013
|
/** A site brand suggestion ("Match my site"). Keep in sync with packages/server/src/brand-extract.ts BrandSuggestion. */
|
|
1818
|
-
interface BrandSuggestion {
|
|
1014
|
+
export interface BrandSuggestion {
|
|
1819
1015
|
background?: string;
|
|
1820
1016
|
text?: string;
|
|
1821
1017
|
highlight?: string;
|
|
@@ -1824,15 +1020,15 @@ interface BrandSuggestion {
|
|
|
1824
1020
|
palette?: string[];
|
|
1825
1021
|
}
|
|
1826
1022
|
/** The response shape of POST /v1/sites/:cbid/brand. */
|
|
1827
|
-
interface BrandExtractionResult {
|
|
1023
|
+
export interface BrandExtractionResult {
|
|
1828
1024
|
suggestion: BrandSuggestion;
|
|
1829
1025
|
}
|
|
1830
1026
|
/** PUT /v1/sites/{cbid}/brand: `{url}` alone (fetched once, https only), or a DTCG brand.json document. */
|
|
1831
|
-
type BrandImportInput = {
|
|
1027
|
+
export type BrandImportInput = {
|
|
1832
1028
|
url: string;
|
|
1833
1029
|
} | Record<string, unknown>;
|
|
1834
1030
|
/** One brand.json role and what it became. */
|
|
1835
|
-
interface BrandMappingRow {
|
|
1031
|
+
export interface BrandMappingRow {
|
|
1836
1032
|
role: string;
|
|
1837
1033
|
/** The site-config path it sets, e.g. `banner.theme.highlight`. */
|
|
1838
1034
|
target: string;
|
|
@@ -1846,7 +1042,7 @@ interface BrandMappingRow {
|
|
|
1846
1042
|
variants?: string[];
|
|
1847
1043
|
}
|
|
1848
1044
|
/** The read-back of a brand.json import. Precedence: brand.json < site banner theme < per-banner variant. */
|
|
1849
|
-
interface BrandReadBack {
|
|
1045
|
+
export interface BrandReadBack {
|
|
1850
1046
|
cbid: string;
|
|
1851
1047
|
dryRun?: boolean;
|
|
1852
1048
|
source: {
|
|
@@ -1873,13 +1069,13 @@ interface BrandReadBack {
|
|
|
1873
1069
|
}>;
|
|
1874
1070
|
}
|
|
1875
1071
|
/** A validation/lint issue on a v2 banner flow. */
|
|
1876
|
-
interface FlowIssue {
|
|
1072
|
+
export interface FlowIssue {
|
|
1877
1073
|
code: string;
|
|
1878
1074
|
message: string;
|
|
1879
1075
|
path?: string;
|
|
1880
1076
|
}
|
|
1881
1077
|
/** A site's v2 banner flow + lint issues, from GET /v1/sites/:cbid/flow. */
|
|
1882
|
-
interface SiteFlow {
|
|
1078
|
+
export interface SiteFlow {
|
|
1883
1079
|
v: 2;
|
|
1884
1080
|
flow: Record<string, unknown>;
|
|
1885
1081
|
categories: Record<string, unknown>;
|
|
@@ -1890,14 +1086,14 @@ interface SiteFlow {
|
|
|
1890
1086
|
* A single structured flow edit operation. `op` selects the kind; remaining fields are
|
|
1891
1087
|
* that op's args (e.g. { op: 'addView', id, surface, layoutMode }).
|
|
1892
1088
|
*/
|
|
1893
|
-
type FlowOp = {
|
|
1089
|
+
export type FlowOp = {
|
|
1894
1090
|
op: string;
|
|
1895
1091
|
} & Record<string, unknown>;
|
|
1896
1092
|
/**
|
|
1897
1093
|
* Result of editFlow/setFlow. On success the new flow is persisted and returned;
|
|
1898
1094
|
* on a validation/lint failure the config is NOT saved and `issues` says why.
|
|
1899
1095
|
*/
|
|
1900
|
-
type FlowOpResponse = {
|
|
1096
|
+
export type FlowOpResponse = {
|
|
1901
1097
|
ok: true;
|
|
1902
1098
|
flow: Record<string, unknown>; /** Consent-button parity of the saved design. */
|
|
1903
1099
|
designWarnings?: ButtonParityFinding[];
|
|
@@ -1908,7 +1104,7 @@ type FlowOpResponse = {
|
|
|
1908
1104
|
issues: FlowIssue[];
|
|
1909
1105
|
};
|
|
1910
1106
|
/** A reusable brand kit (colors/logo/typography) for banner theming. */
|
|
1911
|
-
interface BrandKit {
|
|
1107
|
+
export interface BrandKit {
|
|
1912
1108
|
id: string;
|
|
1913
1109
|
orgId: string;
|
|
1914
1110
|
name: string;
|
|
@@ -1920,7 +1116,7 @@ interface BrandKit {
|
|
|
1920
1116
|
customCss?: string;
|
|
1921
1117
|
}
|
|
1922
1118
|
/** A configurable consent preference/purpose item. */
|
|
1923
|
-
interface PreferenceItem {
|
|
1119
|
+
export interface PreferenceItem {
|
|
1924
1120
|
id: string;
|
|
1925
1121
|
orgId: string;
|
|
1926
1122
|
cbid?: string;
|
|
@@ -1929,13 +1125,13 @@ interface PreferenceItem {
|
|
|
1929
1125
|
category?: string;
|
|
1930
1126
|
}
|
|
1931
1127
|
/** An organization member. */
|
|
1932
|
-
interface Member {
|
|
1128
|
+
export interface Member {
|
|
1933
1129
|
userId: string;
|
|
1934
1130
|
email: string;
|
|
1935
1131
|
role: 'owner' | 'admin' | 'member' | 'viewer' | (string & {});
|
|
1936
1132
|
}
|
|
1937
1133
|
/** Display metadata for an issued key — never the secret. Returned by keys.list(). */
|
|
1938
|
-
interface ApiKeyPrefix {
|
|
1134
|
+
export interface ApiKeyPrefix {
|
|
1939
1135
|
prefix: string;
|
|
1940
1136
|
createdAt?: number;
|
|
1941
1137
|
/** Epoch ms the key stops working; null = never. */
|
|
@@ -1958,14 +1154,14 @@ interface ApiKeyPrefix {
|
|
|
1958
1154
|
apiVersion?: string;
|
|
1959
1155
|
}
|
|
1960
1156
|
/** A live organisation's sandbox (GET /v1/sandbox). */
|
|
1961
|
-
interface SandboxOrg {
|
|
1157
|
+
export interface SandboxOrg {
|
|
1962
1158
|
orgId: string;
|
|
1963
1159
|
name: string;
|
|
1964
1160
|
sandboxOf: string;
|
|
1965
1161
|
createdAt: string;
|
|
1966
1162
|
}
|
|
1967
1163
|
/** POST /v1/sandbox: the sandbox and a test key for it, shown once. */
|
|
1968
|
-
interface SandboxCreated {
|
|
1164
|
+
export interface SandboxCreated {
|
|
1969
1165
|
sandbox: SandboxOrg;
|
|
1970
1166
|
created: boolean;
|
|
1971
1167
|
key: string;
|
|
@@ -1973,7 +1169,7 @@ interface SandboxCreated {
|
|
|
1973
1169
|
keyExpiresAt: string;
|
|
1974
1170
|
}
|
|
1975
1171
|
/** GET /v1/versions. */
|
|
1976
|
-
interface ApiVersions {
|
|
1172
|
+
export interface ApiVersions {
|
|
1977
1173
|
latest: string;
|
|
1978
1174
|
base: string;
|
|
1979
1175
|
/** With a key: the version it is pinned to. */
|
|
@@ -1989,7 +1185,7 @@ interface ApiVersions {
|
|
|
1989
1185
|
}>;
|
|
1990
1186
|
}
|
|
1991
1187
|
/** A revoked key in the report: when, by whom, why; never the secret. */
|
|
1992
|
-
interface ApiKeyRevoked {
|
|
1188
|
+
export interface ApiKeyRevoked {
|
|
1993
1189
|
prefix: string;
|
|
1994
1190
|
name: string | null;
|
|
1995
1191
|
owner: string | null;
|
|
@@ -2005,7 +1201,7 @@ interface ApiKeyRevoked {
|
|
|
2005
1201
|
leakSource: string | null;
|
|
2006
1202
|
}
|
|
2007
1203
|
/** GET /v1/keys/report — key hygiene. */
|
|
2008
|
-
interface ApiKeyReport {
|
|
1204
|
+
export interface ApiKeyReport {
|
|
2009
1205
|
generatedAt: number;
|
|
2010
1206
|
unusedDays: number;
|
|
2011
1207
|
expiringDays: number;
|
|
@@ -2024,7 +1220,7 @@ interface ApiKeyReport {
|
|
|
2024
1220
|
revoked?: ApiKeyRevoked[];
|
|
2025
1221
|
}
|
|
2026
1222
|
/** A newly issued key. `key` is returned ONCE and never again (or, with `secretRecipient`, sealed). */
|
|
2027
|
-
interface ApiKeyIssued {
|
|
1223
|
+
export interface ApiKeyIssued {
|
|
2028
1224
|
key: string;
|
|
2029
1225
|
prefix: string;
|
|
2030
1226
|
expiresAt?: number | null;
|
|
@@ -2037,7 +1233,7 @@ interface ApiKeyIssued {
|
|
|
2037
1233
|
sealed_field?: string;
|
|
2038
1234
|
}
|
|
2039
1235
|
/** @deprecated No endpoint returns this shape; use {@link ApiKeyPrefix} / {@link ApiKeyIssued}. */
|
|
2040
|
-
interface ApiKey {
|
|
1236
|
+
export interface ApiKey {
|
|
2041
1237
|
id: string;
|
|
2042
1238
|
orgId: string;
|
|
2043
1239
|
prefix: string;
|
|
@@ -2050,7 +1246,7 @@ interface ApiKey {
|
|
|
2050
1246
|
* Input for issuing a new API key (POST /v1/keys). Every field is honoured: `scopes`, `cbids`,
|
|
2051
1247
|
* `expiresInDays` / `expiresAt`, `name`, `owner` and `strictUnknownFields`.
|
|
2052
1248
|
*/
|
|
2053
|
-
interface ApiKeyIssueInput {
|
|
1249
|
+
export interface ApiKeyIssueInput {
|
|
2054
1250
|
/** `user:<id>`, `service:<name>` or `apikey:<prefix>`. Default: the calling key. */
|
|
2055
1251
|
owner?: string;
|
|
2056
1252
|
/** Writes with the new key refuse unknown body fields unless they send `Prefer: lenient-unknown-fields`. */
|
|
@@ -2069,7 +1265,7 @@ interface ApiKeyIssueInput {
|
|
|
2069
1265
|
expiresAt?: number | string;
|
|
2070
1266
|
}
|
|
2071
1267
|
/** One entitlement (suite-standard shape). A feature is `{key, enabled}`; a limit is `limits.<name>`. */
|
|
2072
|
-
interface Entitlement {
|
|
1268
|
+
export interface Entitlement {
|
|
2073
1269
|
key: string;
|
|
2074
1270
|
enabled: boolean;
|
|
2075
1271
|
/** Limits only. null = unlimited, 0 = not on this plan. */
|
|
@@ -2079,7 +1275,7 @@ interface Entitlement {
|
|
|
2079
1275
|
source: 'plan';
|
|
2080
1276
|
}
|
|
2081
1277
|
/** GET /v1/entitlements: what the org may use, from its effective plan. */
|
|
2082
|
-
interface Entitlements {
|
|
1278
|
+
export interface Entitlements {
|
|
2083
1279
|
orgId: string;
|
|
2084
1280
|
plan: string;
|
|
2085
1281
|
planSource: 'org' | 'account';
|
|
@@ -2088,13 +1284,13 @@ interface Entitlements {
|
|
|
2088
1284
|
generatedAt: string;
|
|
2089
1285
|
}
|
|
2090
1286
|
/** Org usage/quota summary. Matches the server's Usage schema. */
|
|
2091
|
-
interface Usage {
|
|
1287
|
+
export interface Usage {
|
|
2092
1288
|
domains: number;
|
|
2093
1289
|
seats: number;
|
|
2094
1290
|
monthlyEvents: number;
|
|
2095
1291
|
}
|
|
2096
1292
|
/** A webhook subscription. `secret` is present only in the create response. */
|
|
2097
|
-
interface WebhookSubscription {
|
|
1293
|
+
export interface WebhookSubscription {
|
|
2098
1294
|
id: string;
|
|
2099
1295
|
orgId: string;
|
|
2100
1296
|
url: string;
|
|
@@ -2125,7 +1321,7 @@ interface WebhookSubscription {
|
|
|
2125
1321
|
};
|
|
2126
1322
|
}
|
|
2127
1323
|
/** POST /v1/webhooks/{id}/replay. */
|
|
2128
|
-
interface WebhookReplayResult {
|
|
1324
|
+
export interface WebhookReplayResult {
|
|
2129
1325
|
ok: boolean;
|
|
2130
1326
|
replayed: number;
|
|
2131
1327
|
failed: number;
|
|
@@ -2135,7 +1331,7 @@ interface WebhookReplayResult {
|
|
|
2135
1331
|
error?: string;
|
|
2136
1332
|
}
|
|
2137
1333
|
/** The audit-log export (GET/PUT /v1/audit/sink). Never the secret. */
|
|
2138
|
-
interface AuditSink {
|
|
1334
|
+
export interface AuditSink {
|
|
2139
1335
|
type: 'webhook';
|
|
2140
1336
|
url: string;
|
|
2141
1337
|
secretSet: true;
|
|
@@ -2145,14 +1341,14 @@ interface AuditSink {
|
|
|
2145
1341
|
lastStatus: number | null;
|
|
2146
1342
|
lastError: string | null;
|
|
2147
1343
|
}
|
|
2148
|
-
interface AuditSinkInput {
|
|
1344
|
+
export interface AuditSinkInput {
|
|
2149
1345
|
type: 'webhook';
|
|
2150
1346
|
url: string;
|
|
2151
1347
|
/** 16–256 characters; omitted: one is generated and returned once. */
|
|
2152
1348
|
secret?: string;
|
|
2153
1349
|
}
|
|
2154
1350
|
/** GET /v1/sites/{cbid}/consent/insights. */
|
|
2155
|
-
interface ConsentInsights {
|
|
1351
|
+
export interface ConsentInsights {
|
|
2156
1352
|
cbid: string;
|
|
2157
1353
|
from: number;
|
|
2158
1354
|
to: number;
|
|
@@ -2203,7 +1399,7 @@ interface ConsentInsights {
|
|
|
2203
1399
|
};
|
|
2204
1400
|
}
|
|
2205
1401
|
/** One cookie read from another CMP's export. */
|
|
2206
|
-
interface ImportedCookie {
|
|
1402
|
+
export interface ImportedCookie {
|
|
2207
1403
|
name: string;
|
|
2208
1404
|
domain: string;
|
|
2209
1405
|
/** Ours, or `unclassified` when their category did not map to one. */
|
|
@@ -2215,7 +1411,7 @@ interface ImportedCookie {
|
|
|
2215
1411
|
expiry: string;
|
|
2216
1412
|
}
|
|
2217
1413
|
/** What a competitor's cookie-declaration export contained, in our vocabulary. */
|
|
2218
|
-
interface ImportedDeclaration {
|
|
1414
|
+
export interface ImportedDeclaration {
|
|
2219
1415
|
source: 'onetrust' | 'cookiebot' | 'cookieyes' | 'unknown';
|
|
2220
1416
|
cookies: ImportedCookie[];
|
|
2221
1417
|
/** Rows whose category could not be placed — review these first. */
|
|
@@ -2228,7 +1424,7 @@ interface ImportedDeclaration {
|
|
|
2228
1424
|
* A page that refused to load the banner renderer. The site is live and configured, so
|
|
2229
1425
|
* every other signal looks healthy; this is the one that says nobody can be asked.
|
|
2230
1426
|
*/
|
|
2231
|
-
interface BlockedReport {
|
|
1427
|
+
export interface BlockedReport {
|
|
2232
1428
|
cbid: string;
|
|
2233
1429
|
/** Origin of the page the embed was running on. */
|
|
2234
1430
|
page: string;
|
|
@@ -2241,7 +1437,7 @@ interface BlockedReport {
|
|
|
2241
1437
|
count: number;
|
|
2242
1438
|
}
|
|
2243
1439
|
/** A webhook delivery that failed every retry. Replay it by `id`. */
|
|
2244
|
-
interface WebhookDeadLetter {
|
|
1440
|
+
export interface WebhookDeadLetter {
|
|
2245
1441
|
id: string;
|
|
2246
1442
|
orgId: string;
|
|
2247
1443
|
subscriptionId: string;
|
|
@@ -2255,25 +1451,25 @@ interface WebhookDeadLetter {
|
|
|
2255
1451
|
failedAt: number;
|
|
2256
1452
|
}
|
|
2257
1453
|
/** What a test delivery's endpoint answered. */
|
|
2258
|
-
interface WebhookTestResult {
|
|
1454
|
+
export interface WebhookTestResult {
|
|
2259
1455
|
ok: boolean;
|
|
2260
1456
|
status?: number;
|
|
2261
1457
|
error?: string;
|
|
2262
1458
|
}
|
|
2263
1459
|
/** The key's organisation. */
|
|
2264
|
-
interface Org {
|
|
1460
|
+
export interface Org {
|
|
2265
1461
|
id: string;
|
|
2266
1462
|
name: string;
|
|
2267
1463
|
plan: string;
|
|
2268
1464
|
logoUrl: string | null;
|
|
2269
1465
|
}
|
|
2270
|
-
type MailProviderKind = 'brevo' | 'sendgrid' | 'postmark' | 'resend' | 'ses' | 'smtp';
|
|
1466
|
+
export type MailProviderKind = 'brevo' | 'sendgrid' | 'postmark' | 'resend' | 'ses' | 'smtp';
|
|
2271
1467
|
/**
|
|
2272
1468
|
* The org's own mail provider for rights-request mail. The credential is never returned —
|
|
2273
1469
|
* `secretLast4` only. `sender` says whether verification codes go through it right now
|
|
2274
1470
|
* (`own`) or are not mailed at all (`none`): there is no shared sender for rights mail.
|
|
2275
1471
|
*/
|
|
2276
|
-
interface MailProvider {
|
|
1472
|
+
export interface MailProvider {
|
|
2277
1473
|
configured: boolean;
|
|
2278
1474
|
sender: 'own' | 'none';
|
|
2279
1475
|
provider?: MailProviderKind;
|
|
@@ -2303,7 +1499,7 @@ interface MailProvider {
|
|
|
2303
1499
|
note?: string;
|
|
2304
1500
|
}
|
|
2305
1501
|
/** Save a provider. `secret` is write-only; omit it to keep the stored one (same provider only). */
|
|
2306
|
-
interface MailProviderInput {
|
|
1502
|
+
export interface MailProviderInput {
|
|
2307
1503
|
provider: MailProviderKind;
|
|
2308
1504
|
fromEmail: string;
|
|
2309
1505
|
fromName?: string | null;
|
|
@@ -2320,13 +1516,13 @@ interface MailProviderInput {
|
|
|
2320
1516
|
username: string;
|
|
2321
1517
|
};
|
|
2322
1518
|
}
|
|
2323
|
-
type RightsCaptchaProvider = 'turnstile' | 'hcaptcha' | 'recaptcha_v2' | 'recaptcha_v3';
|
|
1519
|
+
export type RightsCaptchaProvider = 'turnstile' | 'hcaptcha' | 'recaptcha_v2' | 'recaptcha_v3';
|
|
2324
1520
|
/**
|
|
2325
1521
|
* The rights page's captcha in force: your own keys (`own`, recommended) or none (`off`, the default).
|
|
2326
1522
|
* Cookie Munch's own captcha is never used on rights pages. The secret is never returned.
|
|
2327
1523
|
*/
|
|
2328
1524
|
/** Whether hosted consent sync is set up for a site. The secret itself is never read back. */
|
|
2329
|
-
interface ConsentSyncSecret {
|
|
1525
|
+
export interface ConsentSyncSecret {
|
|
2330
1526
|
cbid: string;
|
|
2331
1527
|
configured: boolean;
|
|
2332
1528
|
secretLast4: string | null;
|
|
@@ -2337,7 +1533,7 @@ interface ConsentSyncSecret {
|
|
|
2337
1533
|
* Who a preference-centre token is for: a site of your organisation and exactly one of `email`
|
|
2338
1534
|
* (resolved as the emailed preference link resolves it) or `subjectId`.
|
|
2339
1535
|
*/
|
|
2340
|
-
type CenterTokenInput = {
|
|
1536
|
+
export type CenterTokenInput = {
|
|
2341
1537
|
cbid: string;
|
|
2342
1538
|
ttlSeconds?: number;
|
|
2343
1539
|
} & ({
|
|
@@ -2348,16 +1544,16 @@ type CenterTokenInput = {
|
|
|
2348
1544
|
email?: never;
|
|
2349
1545
|
});
|
|
2350
1546
|
/** A preference-centre token. A credential: hand it to `CookieMunch.setSubjectToken`, never put it in a shared URL or a log. */
|
|
2351
|
-
interface CenterToken {
|
|
1547
|
+
export interface CenterToken {
|
|
2352
1548
|
token: string;
|
|
2353
1549
|
/** ISO 8601. */
|
|
2354
1550
|
expiresAt: string;
|
|
2355
1551
|
}
|
|
2356
1552
|
/** A freshly minted or rotated consent-sync secret: `secret` is shown this once. */
|
|
2357
|
-
interface ConsentSyncSecretMinted extends ConsentSyncSecret {
|
|
1553
|
+
export interface ConsentSyncSecretMinted extends ConsentSyncSecret {
|
|
2358
1554
|
secret: string;
|
|
2359
1555
|
}
|
|
2360
|
-
interface RightsCaptcha {
|
|
1556
|
+
export interface RightsCaptcha {
|
|
2361
1557
|
/** `site`: the site's own setting; `org`: the organisation default; `default`: neither (off). */
|
|
2362
1558
|
source: 'site' | 'org' | 'default';
|
|
2363
1559
|
mode: 'own' | 'off';
|
|
@@ -2378,7 +1574,7 @@ interface RightsCaptcha {
|
|
|
2378
1574
|
* anything is saved (422 captcha_secret_invalid / 502 captcha_unreachable). `off` removes spam protection beyond
|
|
2379
1575
|
* the hidden spam-trap field, the rate limits and the email code.
|
|
2380
1576
|
*/
|
|
2381
|
-
interface RightsCaptchaInput {
|
|
1577
|
+
export interface RightsCaptchaInput {
|
|
2382
1578
|
mode: 'own' | 'off';
|
|
2383
1579
|
provider?: RightsCaptchaProvider;
|
|
2384
1580
|
siteKey?: string;
|
|
@@ -2387,12 +1583,12 @@ interface RightsCaptchaInput {
|
|
|
2387
1583
|
/** reCAPTCHA v3 only: 0.1–0.9, default 0.5. */
|
|
2388
1584
|
minScore?: number;
|
|
2389
1585
|
}
|
|
2390
|
-
type RightsIdentityType = 'clerk' | 'atlas' | 'oidc_jwt';
|
|
1586
|
+
export type RightsIdentityType = 'clerk' | 'atlas' | 'oidc_jwt';
|
|
2391
1587
|
/**
|
|
2392
1588
|
* The sign-in provider rights requests are verified with: a visitor signed in to your site is
|
|
2393
1589
|
* verified by their session, with no code mail. Nothing here is secret.
|
|
2394
1590
|
*/
|
|
2395
|
-
interface RightsIdentity {
|
|
1591
|
+
export interface RightsIdentity {
|
|
2396
1592
|
/** `site`: the site's own setting; `org`: the organisation default; `default`: neither (none). */
|
|
2397
1593
|
source: 'site' | 'org' | 'default';
|
|
2398
1594
|
configured: boolean;
|
|
@@ -2417,7 +1613,7 @@ interface RightsIdentity {
|
|
|
2417
1613
|
* never an IP address. The token must carry the email and a verified-email claim set to `true`
|
|
2418
1614
|
* (clerk/atlas with `trustEmailClaim`: the verified claim may be absent).
|
|
2419
1615
|
*/
|
|
2420
|
-
interface RightsIdentityInput {
|
|
1616
|
+
export interface RightsIdentityInput {
|
|
2421
1617
|
type: RightsIdentityType;
|
|
2422
1618
|
/** Exactly the token's `iss` (Clerk: your Frontend API URL). */
|
|
2423
1619
|
issuer: string;
|
|
@@ -2438,7 +1634,7 @@ interface RightsIdentityInput {
|
|
|
2438
1634
|
trustEmailClaim?: boolean;
|
|
2439
1635
|
}
|
|
2440
1636
|
/** The organisation's own data-controller identity (GET /v1/org/controller). */
|
|
2441
|
-
interface OrgControllerIdentity {
|
|
1637
|
+
export interface OrgControllerIdentity {
|
|
2442
1638
|
/** False when none is set; then only `updatedAt` (null) is present. */
|
|
2443
1639
|
set: boolean;
|
|
2444
1640
|
legalName?: string;
|
|
@@ -2449,25 +1645,25 @@ interface OrgControllerIdentity {
|
|
|
2449
1645
|
updatedAt: number | null;
|
|
2450
1646
|
}
|
|
2451
1647
|
/** Replaces the identity: a field left out is removed. `legalName` is required. */
|
|
2452
|
-
interface OrgControllerInput {
|
|
1648
|
+
export interface OrgControllerInput {
|
|
2453
1649
|
legalName: string;
|
|
2454
1650
|
contactEmail?: string;
|
|
2455
1651
|
address?: string;
|
|
2456
1652
|
dpoContact?: string;
|
|
2457
1653
|
}
|
|
2458
|
-
interface MailProviderTestResult {
|
|
1654
|
+
export interface MailProviderTestResult {
|
|
2459
1655
|
ok: boolean;
|
|
2460
1656
|
sentTo: string;
|
|
2461
1657
|
error?: string;
|
|
2462
1658
|
mailProvider: MailProvider;
|
|
2463
1659
|
}
|
|
2464
1660
|
/** Change an org's name or logo. `logoUrl: null` removes the logo. */
|
|
2465
|
-
interface OrgUpdate {
|
|
1661
|
+
export interface OrgUpdate {
|
|
2466
1662
|
name?: string;
|
|
2467
1663
|
logoUrl?: string | null;
|
|
2468
1664
|
}
|
|
2469
1665
|
/** One entry in the org's audit log. */
|
|
2470
|
-
interface AuditEntry {
|
|
1666
|
+
export interface AuditEntry {
|
|
2471
1667
|
id: string;
|
|
2472
1668
|
orgId: string;
|
|
2473
1669
|
actorUserId: string;
|
|
@@ -2478,7 +1674,7 @@ interface AuditEntry {
|
|
|
2478
1674
|
at: number;
|
|
2479
1675
|
}
|
|
2480
1676
|
/** Rename a key, or replace its scopes or the properties it is locked to. */
|
|
2481
|
-
interface ApiKeyUpdate {
|
|
1677
|
+
export interface ApiKeyUpdate {
|
|
2482
1678
|
owner?: string;
|
|
2483
1679
|
strictUnknownFields?: boolean;
|
|
2484
1680
|
name?: string;
|
|
@@ -2488,12 +1684,12 @@ interface ApiKeyUpdate {
|
|
|
2488
1684
|
expiresAt?: number | string | null;
|
|
2489
1685
|
}
|
|
2490
1686
|
/** An image to upload: base64 (or a `data:` URL) plus its type. */
|
|
2491
|
-
interface AssetUpload {
|
|
1687
|
+
export interface AssetUpload {
|
|
2492
1688
|
data: string;
|
|
2493
1689
|
contentType: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'image/svg+xml';
|
|
2494
1690
|
}
|
|
2495
1691
|
/** Result of erasing a subject's consent for a deletion request. */
|
|
2496
|
-
interface DsarEraseResult {
|
|
1692
|
+
export interface DsarEraseResult {
|
|
2497
1693
|
erased: number;
|
|
2498
1694
|
encryptionEnabled: boolean;
|
|
2499
1695
|
/** Present when no KEK is configured, so nothing was cryptographically erased. */
|
|
@@ -2501,19 +1697,19 @@ interface DsarEraseResult {
|
|
|
2501
1697
|
request: DsarRequest;
|
|
2502
1698
|
}
|
|
2503
1699
|
/** Result of exporting a subject's consent for an access or portability request. */
|
|
2504
|
-
interface DsarExportResult {
|
|
1700
|
+
export interface DsarExportResult {
|
|
2505
1701
|
records: unknown[];
|
|
2506
1702
|
count: number;
|
|
2507
1703
|
request: DsarRequest;
|
|
2508
1704
|
}
|
|
2509
1705
|
/** Input for creating a webhook subscription. */
|
|
2510
|
-
interface WebhookCreate {
|
|
1706
|
+
export interface WebhookCreate {
|
|
2511
1707
|
url: string;
|
|
2512
1708
|
events: string[];
|
|
2513
1709
|
cbid?: string;
|
|
2514
1710
|
}
|
|
2515
1711
|
/** Fields to change on a webhook subscription. Only those present are sent. */
|
|
2516
|
-
interface WebhookUpdate {
|
|
1712
|
+
export interface WebhookUpdate {
|
|
2517
1713
|
url?: string;
|
|
2518
1714
|
events?: string[];
|
|
2519
1715
|
/** One property, or null for every property in the org. */
|
|
@@ -2524,20 +1720,20 @@ interface WebhookUpdate {
|
|
|
2524
1720
|
alertContacts?: string[] | null;
|
|
2525
1721
|
}
|
|
2526
1722
|
/** One site to create in a bulk call. */
|
|
2527
|
-
interface BulkSiteInput {
|
|
1723
|
+
export interface BulkSiteInput {
|
|
2528
1724
|
domain: string;
|
|
2529
1725
|
cbid?: string;
|
|
2530
1726
|
platform?: string;
|
|
2531
1727
|
}
|
|
2532
1728
|
/** Per-item outcome of a bulk create, in input order. */
|
|
2533
|
-
interface BulkSiteResult {
|
|
1729
|
+
export interface BulkSiteResult {
|
|
2534
1730
|
ok: boolean;
|
|
2535
1731
|
cbid?: string;
|
|
2536
1732
|
domain?: string;
|
|
2537
1733
|
error?: string;
|
|
2538
1734
|
}
|
|
2539
1735
|
/** Input for creating a brand kit. */
|
|
2540
|
-
interface BrandKitCreate {
|
|
1736
|
+
export interface BrandKitCreate {
|
|
2541
1737
|
name: string;
|
|
2542
1738
|
theme: unknown;
|
|
2543
1739
|
content?: unknown;
|
|
@@ -2545,7 +1741,7 @@ interface BrandKitCreate {
|
|
|
2545
1741
|
customCss?: string;
|
|
2546
1742
|
}
|
|
2547
1743
|
/** A lightweight summary of an account-level banner, as returned by GET /v1/banners. */
|
|
2548
|
-
interface BannerSummary {
|
|
1744
|
+
export interface BannerSummary {
|
|
2549
1745
|
id: string;
|
|
2550
1746
|
name: string;
|
|
2551
1747
|
updatedAt: number;
|
|
@@ -2554,7 +1750,7 @@ interface BannerSummary {
|
|
|
2554
1750
|
designWarningCount: number;
|
|
2555
1751
|
}
|
|
2556
1752
|
/** A full account-level banner record, including its config JSON. */
|
|
2557
|
-
interface BannerRecord {
|
|
1753
|
+
export interface BannerRecord {
|
|
2558
1754
|
id: string;
|
|
2559
1755
|
orgId: string;
|
|
2560
1756
|
name: string;
|
|
@@ -2570,7 +1766,7 @@ interface BannerRecord {
|
|
|
2570
1766
|
* server's ConsentPayload; optional fields are sent only when set. Records are
|
|
2571
1767
|
* anonymised (IP truncated) and hash-chained server-side.
|
|
2572
1768
|
*/
|
|
2573
|
-
interface ConsentIngestInput {
|
|
1769
|
+
export interface ConsentIngestInput {
|
|
2574
1770
|
/** The registered site id the consent belongs to. */
|
|
2575
1771
|
cbid: string;
|
|
2576
1772
|
/** Stable per-subject consent-receipt id (used for erase/export). */
|
|
@@ -2609,11 +1805,11 @@ interface ConsentIngestInput {
|
|
|
2609
1805
|
subjectId?: string;
|
|
2610
1806
|
}
|
|
2611
1807
|
/** One of a person's identifiers: an identity-space code plus the normalised value. */
|
|
2612
|
-
interface Identifier {
|
|
1808
|
+
export interface Identifier {
|
|
2613
1809
|
space: string;
|
|
2614
1810
|
value: string;
|
|
2615
1811
|
}
|
|
2616
|
-
interface ConsentDecisionInput {
|
|
1812
|
+
export interface ConsentDecisionInput {
|
|
2617
1813
|
purpose: string;
|
|
2618
1814
|
allowed: boolean;
|
|
2619
1815
|
legalBasis?: string;
|
|
@@ -2621,19 +1817,19 @@ interface ConsentDecisionInput {
|
|
|
2621
1817
|
provenance?: string;
|
|
2622
1818
|
collectedAt?: number;
|
|
2623
1819
|
}
|
|
2624
|
-
interface ProfileAttributeInput {
|
|
1820
|
+
export interface ProfileAttributeInput {
|
|
2625
1821
|
value: string;
|
|
2626
1822
|
purpose?: string;
|
|
2627
1823
|
collectedAt?: number;
|
|
2628
1824
|
}
|
|
2629
|
-
interface SubscriptionTopicInput {
|
|
1825
|
+
export interface SubscriptionTopicInput {
|
|
2630
1826
|
code: string;
|
|
2631
1827
|
name?: string;
|
|
2632
1828
|
channels: string[];
|
|
2633
1829
|
downstream?: Record<string, string>;
|
|
2634
1830
|
}
|
|
2635
1831
|
/** A warehouse-native enforcement rule. See POST /v1/discovery/enforcement. */
|
|
2636
|
-
interface EnforcementRuleInput {
|
|
1832
|
+
export interface EnforcementRuleInput {
|
|
2637
1833
|
id: string;
|
|
2638
1834
|
action: 'mask' | 'restrict';
|
|
2639
1835
|
/** Select columns at or above this sensitivity. */
|
|
@@ -2647,7 +1843,7 @@ interface EnforcementRuleInput {
|
|
|
2647
1843
|
/** restrict: the column holding the subject id. Default SUBJECT_ID. */
|
|
2648
1844
|
subjectColumn?: string;
|
|
2649
1845
|
}
|
|
2650
|
-
interface RegulationSummary {
|
|
1846
|
+
export interface RegulationSummary {
|
|
2651
1847
|
id: string;
|
|
2652
1848
|
jurisdiction: string;
|
|
2653
1849
|
name: string;
|
|
@@ -2658,7 +1854,7 @@ interface RegulationSummary {
|
|
|
2658
1854
|
/** Primary source — the statute or the regulator. */
|
|
2659
1855
|
source: string;
|
|
2660
1856
|
}
|
|
2661
|
-
interface RegulatoryFeedResult {
|
|
1857
|
+
export interface RegulatoryFeedResult {
|
|
2662
1858
|
/** When a human last checked the dataset against its sources. */
|
|
2663
1859
|
reviewedAt: string;
|
|
2664
1860
|
/** Days since that review. */
|
|
@@ -2669,7 +1865,45 @@ interface RegulatoryFeedResult {
|
|
|
2669
1865
|
stale: boolean;
|
|
2670
1866
|
regulations: RegulationSummary[];
|
|
2671
1867
|
}
|
|
2672
|
-
|
|
1868
|
+
/** A law taking effect soon where a site's visitors are. */
|
|
1869
|
+
export interface SiteUpcomingRegulation {
|
|
1870
|
+
id: string;
|
|
1871
|
+
name: string;
|
|
1872
|
+
jurisdiction: string;
|
|
1873
|
+
effective: string;
|
|
1874
|
+
/** Whole days from today; 0 = takes effect today. */
|
|
1875
|
+
daysUntil: number;
|
|
1876
|
+
/** Share (0–1) of the site's decisions in the window from where this law applies. */
|
|
1877
|
+
trafficShare: number;
|
|
1878
|
+
obligations: string[];
|
|
1879
|
+
/** For a US state law: what changes for the banner. */
|
|
1880
|
+
changes?: {
|
|
1881
|
+
universalOptOut: boolean;
|
|
1882
|
+
universalOptOutFrom?: string;
|
|
1883
|
+
sensitiveOptIn: boolean;
|
|
1884
|
+
minorOptInUnder: number;
|
|
1885
|
+
minorsAds: 'opt-in' | 'prohibited';
|
|
1886
|
+
};
|
|
1887
|
+
source: string;
|
|
1888
|
+
}
|
|
1889
|
+
/** `GET /v1/sites/{cbid}/regulatory/upcoming`. */
|
|
1890
|
+
export interface SiteUpcomingRegulations {
|
|
1891
|
+
reviewedAt: string;
|
|
1892
|
+
ageDays: number;
|
|
1893
|
+
reviewAfterDays: number;
|
|
1894
|
+
stale: boolean;
|
|
1895
|
+
days: number;
|
|
1896
|
+
minShare: number;
|
|
1897
|
+
/** The traffic window, epoch ms: the last 30 days. */
|
|
1898
|
+
window: {
|
|
1899
|
+
from: number;
|
|
1900
|
+
to: number;
|
|
1901
|
+
};
|
|
1902
|
+
/** Decisions recorded in the window. */
|
|
1903
|
+
decisions: number;
|
|
1904
|
+
upcoming: SiteUpcomingRegulation[];
|
|
1905
|
+
}
|
|
1906
|
+
export interface AiInspectInput {
|
|
2673
1907
|
prompt: string;
|
|
2674
1908
|
purpose: string;
|
|
2675
1909
|
model?: string;
|
|
@@ -2678,7 +1912,7 @@ interface AiInspectInput {
|
|
|
2678
1912
|
/** The subject's current permits, when the call concerns an identified person. */
|
|
2679
1913
|
consent?: Record<string, boolean>;
|
|
2680
1914
|
}
|
|
2681
|
-
interface AiInspectResult {
|
|
1915
|
+
export interface AiInspectResult {
|
|
2682
1916
|
action: 'allow' | 'redact' | 'block';
|
|
2683
1917
|
/** The text to forward: redacted when `redact`, empty when `block`. */
|
|
2684
1918
|
prompt: string;
|
|
@@ -2688,9 +1922,9 @@ interface AiInspectResult {
|
|
|
2688
1922
|
blocked: boolean;
|
|
2689
1923
|
direction: 'prompt' | 'response';
|
|
2690
1924
|
}
|
|
2691
|
-
type FulfillmentOp = 'locate' | 'export' | 'erase' | 'optOut';
|
|
1925
|
+
export type FulfillmentOp = 'locate' | 'export' | 'erase' | 'optOut';
|
|
2692
1926
|
/** A child org provisioned by a reseller. */
|
|
2693
|
-
interface ResellerChild {
|
|
1927
|
+
export interface ResellerChild {
|
|
2694
1928
|
id: string;
|
|
2695
1929
|
name: string;
|
|
2696
1930
|
status: 'active' | 'suspended';
|
|
@@ -2700,7 +1934,7 @@ interface ResellerChild {
|
|
|
2700
1934
|
createdAt?: number;
|
|
2701
1935
|
usage?: unknown;
|
|
2702
1936
|
}
|
|
2703
|
-
interface ResellerChildList {
|
|
1937
|
+
export interface ResellerChildList {
|
|
2704
1938
|
children: ResellerChild[];
|
|
2705
1939
|
/** Pooled usage across the reseller and all its children, when metering is wired. */
|
|
2706
1940
|
aggregate?: {
|
|
@@ -2711,7 +1945,7 @@ interface ResellerChildList {
|
|
|
2711
1945
|
overCap: boolean;
|
|
2712
1946
|
};
|
|
2713
1947
|
}
|
|
2714
|
-
interface ResellerChildCreate {
|
|
1948
|
+
export interface ResellerChildCreate {
|
|
2715
1949
|
name: string;
|
|
2716
1950
|
ownerEmail?: string;
|
|
2717
1951
|
/** legalName, contactEmail, address, dpoContact. */
|
|
@@ -2724,20 +1958,20 @@ interface ResellerChildCreate {
|
|
|
2724
1958
|
/** Scopes for that key. Defaults to ["sites:read"]. */
|
|
2725
1959
|
keyScopes?: string[];
|
|
2726
1960
|
}
|
|
2727
|
-
interface ResellerChildPatch {
|
|
1961
|
+
export interface ResellerChildPatch {
|
|
2728
1962
|
status?: 'active' | 'suspended';
|
|
2729
1963
|
delegatedAccess?: boolean;
|
|
2730
1964
|
/** Pin this child's DSAR routing; null clears the override. */
|
|
2731
1965
|
dsarRouting?: 'reseller' | 'child' | null;
|
|
2732
1966
|
controller?: Record<string, unknown>;
|
|
2733
1967
|
}
|
|
2734
|
-
interface ChildKeyInput {
|
|
1968
|
+
export interface ChildKeyInput {
|
|
2735
1969
|
name?: string;
|
|
2736
1970
|
scopes?: string[];
|
|
2737
1971
|
/** Lock the key to these properties of the child org. */
|
|
2738
1972
|
cbids?: string[];
|
|
2739
1973
|
}
|
|
2740
|
-
interface PolicyOptions {
|
|
1974
|
+
export interface PolicyOptions {
|
|
2741
1975
|
/** Contact email shown in the policy. Falls back to the org controller's, then the owner's. */
|
|
2742
1976
|
contactEmail?: string;
|
|
2743
1977
|
/** YYYY-MM-DD. Defaults to today. */
|
|
@@ -2745,13 +1979,13 @@ interface PolicyOptions {
|
|
|
2745
1979
|
/** Override the jurisdictions the policy addresses. */
|
|
2746
1980
|
jurisdictions?: string[];
|
|
2747
1981
|
}
|
|
2748
|
-
interface AdPersonalizationInput {
|
|
1982
|
+
export interface AdPersonalizationInput {
|
|
2749
1983
|
enabled: boolean;
|
|
2750
1984
|
/** Whether personalised ads start on before the visitor chooses. */
|
|
2751
1985
|
default?: boolean;
|
|
2752
1986
|
label?: string;
|
|
2753
1987
|
}
|
|
2754
|
-
interface SessionAnalysisInput {
|
|
1988
|
+
export interface SessionAnalysisInput {
|
|
2755
1989
|
/** A HAR export of the captured session. */
|
|
2756
1990
|
har?: unknown;
|
|
2757
1991
|
/** Or the requests directly. */
|
|
@@ -2767,7 +2001,7 @@ interface SessionAnalysisInput {
|
|
|
2767
2001
|
* rather than a release. Paths are relative to `baseUrl`; placeholders are `{email}`,
|
|
2768
2002
|
* `{subject}`, `{operation}`, `{correlation}` and `{id}`.
|
|
2769
2003
|
*/
|
|
2770
|
-
interface ExecutorProfile {
|
|
2004
|
+
export interface ExecutorProfile {
|
|
2771
2005
|
/** How requests carry the credential. Defaults to `Authorization: Bearer {secret}`. */
|
|
2772
2006
|
auth?: {
|
|
2773
2007
|
header: string;
|
|
@@ -2859,7 +2093,7 @@ interface ExecutorProfile {
|
|
|
2859
2093
|
};
|
|
2860
2094
|
}
|
|
2861
2095
|
/** A system connected to run part of a rights request. Credentials are never included. */
|
|
2862
|
-
interface DsarExecutor {
|
|
2096
|
+
export interface DsarExecutor {
|
|
2863
2097
|
id: string;
|
|
2864
2098
|
/** The name it answers to in a fulfillment plan, e.g. `identity` or `crm`. */
|
|
2865
2099
|
system: string;
|
|
@@ -2910,7 +2144,7 @@ interface DsarExecutor {
|
|
|
2910
2144
|
completionSecret?: string;
|
|
2911
2145
|
}
|
|
2912
2146
|
/** POST …/completion-secret/roll. */
|
|
2913
|
-
interface CompletionSecretRolled {
|
|
2147
|
+
export interface CompletionSecretRolled {
|
|
2914
2148
|
id: string;
|
|
2915
2149
|
completionSecret: string;
|
|
2916
2150
|
completionSecretPrefix: string;
|
|
@@ -2918,13 +2152,13 @@ interface CompletionSecretRolled {
|
|
|
2918
2152
|
completionsUrl?: string;
|
|
2919
2153
|
}
|
|
2920
2154
|
/** POST …/test {conformance: true}: the conformance kit's report. */
|
|
2921
|
-
interface ExecutorConformanceResult extends ConformanceReport {
|
|
2155
|
+
export interface ExecutorConformanceResult extends ConformanceReport {
|
|
2922
2156
|
conformance: true;
|
|
2923
2157
|
canary: true;
|
|
2924
2158
|
email: string;
|
|
2925
2159
|
}
|
|
2926
2160
|
/** A connection's last health check. */
|
|
2927
|
-
interface ExecutorHealth {
|
|
2161
|
+
export interface ExecutorHealth {
|
|
2928
2162
|
lastCheckedAt: number;
|
|
2929
2163
|
ok: boolean;
|
|
2930
2164
|
verdict: string;
|
|
@@ -2937,16 +2171,24 @@ interface ExecutorHealth {
|
|
|
2937
2171
|
hint?: string;
|
|
2938
2172
|
}
|
|
2939
2173
|
/** A preset's name, as `executorPresets()` lists them. Not enumerated here: presets are data. */
|
|
2940
|
-
type ExecutorPresetName = string;
|
|
2174
|
+
export type ExecutorPresetName = string;
|
|
2941
2175
|
/**
|
|
2942
2176
|
* Connect a system from a versioned preset instead of a hand-written profile. Each preset
|
|
2943
2177
|
* lists the params it takes (`executorPresets()`); a preset waiting on another platform is
|
|
2944
2178
|
* refused with `preset_waiting_on_platform`.
|
|
2945
2179
|
*/
|
|
2946
|
-
interface DsarExecutorPresetInput {
|
|
2180
|
+
export interface DsarExecutorPresetInput {
|
|
2947
2181
|
preset: ExecutorPresetName;
|
|
2948
2182
|
presetVersion?: number;
|
|
2949
|
-
|
|
2183
|
+
/** The connection's key. Send this or `mintFrom`. */
|
|
2184
|
+
secretKey?: string;
|
|
2185
|
+
/**
|
|
2186
|
+
* A partner id (it registered an `executorKeyUrl`: chatly, forumulate, referalli, …) that mints the key for
|
|
2187
|
+
* the site under its partner link, in place of `secretKey`. The connection is scoped to that site.
|
|
2188
|
+
*/
|
|
2189
|
+
mintFrom?: string;
|
|
2190
|
+
/** With `mintFrom`: the partner account the key is minted for. Default: the one the site's live link for that partner names. */
|
|
2191
|
+
externalId?: string;
|
|
2950
2192
|
system?: string;
|
|
2951
2193
|
baseUrl?: string;
|
|
2952
2194
|
orgId?: string;
|
|
@@ -2962,7 +2204,7 @@ interface DsarExecutorPresetInput {
|
|
|
2962
2204
|
orchestrator?: 1 | 2;
|
|
2963
2205
|
}
|
|
2964
2206
|
/** What `upgradeExecutorPreset` takes: a version, a preset to adopt, or params to add. */
|
|
2965
|
-
interface ExecutorPresetUpgrade {
|
|
2207
|
+
export interface ExecutorPresetUpgrade {
|
|
2966
2208
|
preset?: ExecutorPresetName;
|
|
2967
2209
|
presetVersion?: number;
|
|
2968
2210
|
orgId?: string;
|
|
@@ -2972,7 +2214,7 @@ interface ExecutorPresetUpgrade {
|
|
|
2972
2214
|
acceptPreset?: string | string[];
|
|
2973
2215
|
}
|
|
2974
2216
|
/** One step a preset builds, and whether it can run now (CMU-B01). */
|
|
2975
|
-
interface ExecutorPresetStep {
|
|
2217
|
+
export interface ExecutorPresetStep {
|
|
2976
2218
|
name: 'subjectLookup' | 'open' | 'poll' | 'webhook' | 'grantRevoke';
|
|
2977
2219
|
available: boolean;
|
|
2978
2220
|
/** Never fails a connection: a credential without the scope reports `skipped: insufficient_scope`. */
|
|
@@ -2988,7 +2230,7 @@ interface ExecutorPresetStep {
|
|
|
2988
2230
|
};
|
|
2989
2231
|
}
|
|
2990
2232
|
/** The presets, which are usable now, and this org's canary address. */
|
|
2991
|
-
interface ExecutorPresets {
|
|
2233
|
+
export interface ExecutorPresets {
|
|
2992
2234
|
canaryEmail: string;
|
|
2993
2235
|
presets: Array<{
|
|
2994
2236
|
name: ExecutorPresetName;
|
|
@@ -3011,7 +2253,7 @@ interface ExecutorPresets {
|
|
|
3011
2253
|
}>;
|
|
3012
2254
|
}
|
|
3013
2255
|
/** What a connection write would do (`?dryRun=1`). Nothing was stored. */
|
|
3014
|
-
interface DsarExecutorDryRun {
|
|
2256
|
+
export interface DsarExecutorDryRun {
|
|
3015
2257
|
dryRun: true;
|
|
3016
2258
|
/** The connection as it would be, credentials excluded. A create has no `id` or `webhookUrl` yet. */
|
|
3017
2259
|
executor: Partial<DsarExecutor> & Record<string, unknown>;
|
|
@@ -3021,13 +2263,20 @@ interface DsarExecutorDryRun {
|
|
|
3021
2263
|
field: string;
|
|
3022
2264
|
reason: string;
|
|
3023
2265
|
}>;
|
|
2266
|
+
/** With `mintFrom`: who would mint the key, for which account and site. Nothing is minted. */
|
|
2267
|
+
mint?: {
|
|
2268
|
+
partner: string;
|
|
2269
|
+
externalId: string | null;
|
|
2270
|
+
cbid: string;
|
|
2271
|
+
detail: string;
|
|
2272
|
+
};
|
|
3024
2273
|
}
|
|
3025
2274
|
/** Where a webhook check stopped. */
|
|
3026
|
-
type WebhookStage = 'configuration' | 'headers' | 'timestamp' | 'prefix' | 'signature';
|
|
2275
|
+
export type WebhookStage = 'configuration' | 'headers' | 'timestamp' | 'prefix' | 'signature';
|
|
3027
2276
|
/** Which key a verified delivery matched: a `whsec_` secret's base64-decoded remainder, or the secret as typed. */
|
|
3028
|
-
type WebhookKeyForm = 'decoded' | 'raw';
|
|
2277
|
+
export type WebhookKeyForm = 'decoded' | 'raw';
|
|
3029
2278
|
/** Whether a supplied delivery verified (`stage` and `reason` are null when it did). */
|
|
3030
|
-
interface ExecutorWebhookTestResult {
|
|
2279
|
+
export interface ExecutorWebhookTestResult {
|
|
3031
2280
|
verified: boolean;
|
|
3032
2281
|
stage: WebhookStage | null;
|
|
3033
2282
|
reason: string | null;
|
|
@@ -3035,7 +2284,7 @@ interface ExecutorWebhookTestResult {
|
|
|
3035
2284
|
keyForm: WebhookKeyForm | null;
|
|
3036
2285
|
}
|
|
3037
2286
|
/** One delivery to a connection's webhook. Never the secret, the signature or the body. */
|
|
3038
|
-
interface ExecutorWebhookDelivery {
|
|
2287
|
+
export interface ExecutorWebhookDelivery {
|
|
3039
2288
|
id: string;
|
|
3040
2289
|
executorId: string;
|
|
3041
2290
|
at: number;
|
|
@@ -3050,7 +2299,7 @@ interface ExecutorWebhookDelivery {
|
|
|
3050
2299
|
/** Which key form matched; null when refused (or logged before this was kept). Never the key. */
|
|
3051
2300
|
keyForm: WebhookKeyForm | null;
|
|
3052
2301
|
}
|
|
3053
|
-
interface DsarExecutorInput {
|
|
2302
|
+
export interface DsarExecutorInput {
|
|
3054
2303
|
/** The name this connection answers to in a plan, e.g. `identity` or `crm`. */
|
|
3055
2304
|
system: string;
|
|
3056
2305
|
/** The system's public https origin. */
|
|
@@ -3072,9 +2321,9 @@ interface DsarExecutorInput {
|
|
|
3072
2321
|
/** Default 2. */
|
|
3073
2322
|
orchestrator?: 1 | 2;
|
|
3074
2323
|
}
|
|
3075
|
-
type DsarExecutorCreated = DsarExecutor;
|
|
2324
|
+
export type DsarExecutorCreated = DsarExecutor;
|
|
3076
2325
|
/** The fields `updateExecutor` may change. */
|
|
3077
|
-
interface DsarExecutorPatch {
|
|
2326
|
+
export interface DsarExecutorPatch {
|
|
3078
2327
|
profile?: unknown;
|
|
3079
2328
|
baseUrl?: string;
|
|
3080
2329
|
secretKey?: string;
|
|
@@ -3090,7 +2339,7 @@ interface DsarExecutorPatch {
|
|
|
3090
2339
|
orchestrator?: 1 | 2;
|
|
3091
2340
|
}
|
|
3092
2341
|
/** One entry in a fulfilment task's status history. */
|
|
3093
|
-
interface DsarTaskEvent {
|
|
2342
|
+
export interface DsarTaskEvent {
|
|
3094
2343
|
at: number;
|
|
3095
2344
|
kind: 'created' | 'changed' | 'version_changed';
|
|
3096
2345
|
status: 'pending' | 'running' | 'done' | 'failed' | 'cancelled';
|
|
@@ -3100,9 +2349,9 @@ interface DsarTaskEvent {
|
|
|
3100
2349
|
externalRef?: string;
|
|
3101
2350
|
}
|
|
3102
2351
|
/** What a task's answer means for the person. `exported` only once the export was fetched. */
|
|
3103
|
-
type DsarTaskOutcome = 'located' | 'exported' | 'erased' | 'no_record' | 'done_without_artifact' | 'not_applicable' | 'already_erased' | 'external_identity';
|
|
2352
|
+
export type DsarTaskOutcome = 'located' | 'exported' | 'erased' | 'no_record' | 'done_without_artifact' | 'not_applicable' | 'already_erased' | 'external_identity';
|
|
3104
2353
|
/** One request made to a connected system on a task's behalf, credentials removed. Kept 30 days. */
|
|
3105
|
-
interface DsarTaskLogEntry {
|
|
2354
|
+
export interface DsarTaskLogEntry {
|
|
3106
2355
|
id?: string;
|
|
3107
2356
|
system?: string;
|
|
3108
2357
|
step: 'lookup' | 'open' | 'poll' | 'export' | 'grant';
|
|
@@ -3127,7 +2376,7 @@ interface DsarTaskLogEntry {
|
|
|
3127
2376
|
at: number;
|
|
3128
2377
|
}
|
|
3129
2378
|
/** One fulfilment task with its history and its upstream request log. */
|
|
3130
|
-
interface DsarTask {
|
|
2379
|
+
export interface DsarTask {
|
|
3131
2380
|
id: string;
|
|
3132
2381
|
requestId: string;
|
|
3133
2382
|
system: string;
|
|
@@ -3154,7 +2403,7 @@ interface DsarTask {
|
|
|
3154
2403
|
versionChanged: boolean;
|
|
3155
2404
|
}
|
|
3156
2405
|
/** What testing a connection found. Nothing was filed. */
|
|
3157
|
-
interface ExecutorTestResult {
|
|
2406
|
+
export interface ExecutorTestResult {
|
|
3158
2407
|
system: string;
|
|
3159
2408
|
/** Did the lookup find the person; null when there is no lookup step or it failed. */
|
|
3160
2409
|
matched: boolean | null;
|
|
@@ -3184,7 +2433,7 @@ interface ExecutorTestResult {
|
|
|
3184
2433
|
/** Every upstream answer, as the system gave it (credentials removed). */
|
|
3185
2434
|
exchanges: DsarTaskLogEntry[];
|
|
3186
2435
|
}
|
|
3187
|
-
interface ExecutorTestInput {
|
|
2436
|
+
export interface ExecutorTestInput {
|
|
3188
2437
|
/** The address to look up. Required unless `canary` is true. */
|
|
3189
2438
|
email?: string;
|
|
3190
2439
|
/** Use this org's canary address — no real person. A canary `locate` also updates `health`. */
|
|
@@ -3194,14 +2443,14 @@ interface ExecutorTestInput {
|
|
|
3194
2443
|
/** For `export` only: open a real export and poll it once. An erasure is never sent. */
|
|
3195
2444
|
open?: boolean;
|
|
3196
2445
|
}
|
|
3197
|
-
interface DsarTaskExport {
|
|
2446
|
+
export interface DsarTaskExport {
|
|
3198
2447
|
system: string;
|
|
3199
2448
|
ref: string;
|
|
3200
2449
|
/** The bundle as that system returned it. Not stored here. */
|
|
3201
2450
|
bundle: unknown;
|
|
3202
2451
|
}
|
|
3203
2452
|
/** A language the banner already has copy for. */
|
|
3204
|
-
interface SupportedLanguage {
|
|
2453
|
+
export interface SupportedLanguage {
|
|
3205
2454
|
/** BCP-47 tag, lowercase. Matched exactly, then by language prefix. */
|
|
3206
2455
|
code: string;
|
|
3207
2456
|
/** English name. */
|
|
@@ -3213,7 +2462,7 @@ interface SupportedLanguage {
|
|
|
3213
2462
|
/** `bundled` ships in consent.js; `extended` ships in the renderer, fetched when a banner is first drawn. */
|
|
3214
2463
|
source: 'bundled' | 'extended';
|
|
3215
2464
|
}
|
|
3216
|
-
interface CookieMunchClient {
|
|
2465
|
+
export interface CookieMunchClient {
|
|
3217
2466
|
me(): Promise<Identity>;
|
|
3218
2467
|
/**
|
|
3219
2468
|
* Languages the banner already speaks. Diff this against the locales your visitors
|
|
@@ -3245,13 +2494,13 @@ interface CookieMunchClient {
|
|
|
3245
2494
|
apiKey?: string;
|
|
3246
2495
|
keyError?: string;
|
|
3247
2496
|
}>;
|
|
3248
|
-
/** Hard-delete a SANDBOX organisation of this account (created with metadata.
|
|
2497
|
+
/** Hard-delete a SANDBOX organisation of this account (created with metadata.stack_sandbox). Anything else: 403 not_a_sandbox. */
|
|
3249
2498
|
deleteSandbox(id: string): Promise<SandboxPurge>;
|
|
3250
2499
|
};
|
|
3251
2500
|
/** Tags on any created resource (CMU-X29). */
|
|
3252
2501
|
metadata: {
|
|
3253
2502
|
get(type: TaggedType, id: string): Promise<ResourceTags>;
|
|
3254
|
-
/** Merge tags (null removes one). `
|
|
2503
|
+
/** Merge tags (null removes one). `stack_sandbox` cannot be set here. `{ dryRun: true }` answers with the diff. */
|
|
3255
2504
|
update(type: TaggedType, id: string, metadata: Record<string, string | number | boolean | null>, opts?: {
|
|
3256
2505
|
dryRun?: boolean;
|
|
3257
2506
|
}): Promise<ResourceTagsUpdate>;
|
|
@@ -3262,7 +2511,7 @@ interface CookieMunchClient {
|
|
|
3262
2511
|
create(input: StandardPartnerLinkCreate): Promise<StandardPartnerLink>;
|
|
3263
2512
|
revoke(id: string): Promise<StandardPartnerLink>;
|
|
3264
2513
|
};
|
|
3265
|
-
/** What `
|
|
2514
|
+
/** What `env` writes for a product provisioned with this stack ref: names, values, secret references. */
|
|
3266
2515
|
provisionEnv(ref: string): Promise<ProvisionEnv>;
|
|
3267
2516
|
sites: {
|
|
3268
2517
|
list(opts?: MetadataFilter): Promise<Site[]>;
|
|
@@ -3599,11 +2848,11 @@ interface CookieMunchClient {
|
|
|
3599
2848
|
request: DsarRequest;
|
|
3600
2849
|
changed: boolean;
|
|
3601
2850
|
}>;
|
|
3602
|
-
/** Requests carrying one X-
|
|
2851
|
+
/** Requests carrying one X-Trace-Id (`GET /v1/dsar?trace=`). */
|
|
3603
2852
|
listByTrace(trace: string): Promise<DsarRequest[]>;
|
|
3604
2853
|
/**
|
|
3605
2854
|
* Open a case fanned out to every connected system (POST /v1/dsar/requests). `opts.idempotencyKey`
|
|
3606
|
-
* (16–128 chars) makes a retry answer the same case; `opts.trace` passes your X-
|
|
2855
|
+
* (16–128 chars) makes a retry answer the same case; `opts.trace` passes your X-Trace-Id on.
|
|
3607
2856
|
*/
|
|
3608
2857
|
openCase(input: DsarCaseCreate, opts?: {
|
|
3609
2858
|
idempotencyKey?: string;
|
|
@@ -3802,6 +3051,14 @@ interface CookieMunchClient {
|
|
|
3802
3051
|
feed(jurisdictions?: string[]): Promise<RegulatoryFeedResult>;
|
|
3803
3052
|
/** What takes effect within `days` (default 180), soonest first. */
|
|
3804
3053
|
upcoming(days?: number): Promise<RegulatoryFeedResult>;
|
|
3054
|
+
/**
|
|
3055
|
+
* `GET /v1/sites/{cbid}/regulatory/upcoming`: what takes effect within `days` (default 90)
|
|
3056
|
+
* where at least `minShare` (default 0.01) of this site's last 30 days of decisions came from.
|
|
3057
|
+
*/
|
|
3058
|
+
upcomingForSite(cbid: string, opts?: {
|
|
3059
|
+
days?: number;
|
|
3060
|
+
minShare?: number;
|
|
3061
|
+
}): Promise<SiteUpcomingRegulations>;
|
|
3805
3062
|
};
|
|
3806
3063
|
/** AI governance: policy, the inline gateway, inventory and lineage. */
|
|
3807
3064
|
ai: {
|
|
@@ -4040,7 +3297,7 @@ interface CookieMunchClient {
|
|
|
4040
3297
|
}): Promise<void>;
|
|
4041
3298
|
};
|
|
4042
3299
|
/**
|
|
4043
|
-
* The site's embed manifest: the tenant variant of `/.well-known/
|
|
3300
|
+
* The site's embed manifest: the tenant variant of `/.well-known/cookiemunch-embed.json` — every
|
|
4044
3301
|
* origin by CSP directive and every browser key the embed writes for this site's config. Public.
|
|
4045
3302
|
*/
|
|
4046
3303
|
embedManifest(cbid: string): Promise<EmbedManifest>;
|
|
@@ -4219,7 +3476,7 @@ interface CookieMunchClient {
|
|
|
4219
3476
|
graceDays: number;
|
|
4220
3477
|
}): Promise<DsarSettings>;
|
|
4221
3478
|
};
|
|
4222
|
-
/** Cards for support, CRM and helpdesk sidebars
|
|
3479
|
+
/** Cards for support, CRM and helpdesk sidebars (dsar:read), and one-call identity-provider connect (dsar:write). */
|
|
4223
3480
|
integrations: {
|
|
4224
3481
|
/** Open rights requests for one person, by identity (preferred) or email. */
|
|
4225
3482
|
subjectCard(app: string, person: {
|
|
@@ -4228,6 +3485,14 @@ interface CookieMunchClient {
|
|
|
4228
3485
|
} | {
|
|
4229
3486
|
email: string;
|
|
4230
3487
|
}): Promise<SubjectCard>;
|
|
3488
|
+
/**
|
|
3489
|
+
* Connect an identity provider's privacy orchestrator (`atlas`, or any provider with `connector`): mints a
|
|
3490
|
+
* dsar:write key locked to `cbid` and hands it to the provider, authorised with `providerKey`. The minted key
|
|
3491
|
+
* is never returned (only its prefix). `{ dryRun: true }` mints and sends nothing.
|
|
3492
|
+
*/
|
|
3493
|
+
connect(provider: string, input: IntegrationConnect, opts?: {
|
|
3494
|
+
dryRun?: boolean;
|
|
3495
|
+
}): Promise<IntegrationConnectResult>;
|
|
4231
3496
|
};
|
|
4232
3497
|
/** One person's consent across every site in the org, by the subjectId your apps attach. */
|
|
4233
3498
|
subjects: {
|
|
@@ -4262,6 +3527,4 @@ interface CookieMunchClient {
|
|
|
4262
3527
|
}>;
|
|
4263
3528
|
};
|
|
4264
3529
|
}
|
|
4265
|
-
declare function createCookieMunch(opts: CookieMunchOptions): CookieMunchClient;
|
|
4266
|
-
|
|
4267
|
-
export { type AbResult, type AccountOrg, type AccountOrgs, type AdPersonalizationInput, type AiInspectInput, type AiInspectResult, type ApiKey, type ApiKeyIssueInput, type ApiKeyIssued, type ApiKeyPrefix, type ApiKeyReport, type ApiKeyRevoked, type ApiKeyUpdate, type ApiKeyVended, type ApiVersions, type AppliedImport, type AssetUpload, type AuditEntry, type AuditSink, type AuditSinkInput, type BannerRecord, type BannerSummary, type BlockedReport, type BrandExtractionResult, type BrandImportInput, type BrandKit, type BrandKitCreate, type BrandMappingRow, type BrandReadBack, type BrandSuggestion, type BulkSiteInput, type BulkSiteResult, type ButtonParityFinding, type ButtonParityLint, type ButtonParityScan, CANARY_ISSUER, CONFORMANCE_RULES, type CategorizedCookie, type CategoryRegistry, type CenterToken, type CenterTokenInput, type ChildKeyInput, type CompletionSecretRolled, type ConfigChange, type ConfigDryRun, type ConfigWarning, type ConformanceOptions, type ConformanceReport, type ConformanceRuleResult, type ConformanceStatus, type ConsentDay, type ConsentDecisionInput, type ConsentIngestInput, type ConsentInsights, type ConsentLogRow, type ConsentSyncSecret, type ConsentSyncSecretMinted, type CookieDeclaration, CookieMunchApiError, type CookieMunchClient, type CookieMunchOptions, type CookiePreset, type CookiePresetManifest, type CookiePresetParams, type CookiePresetResult, type CookiePresetVendor, type CookieSuggestion, type CookieSuggestions, type CookieSuggestionsDeclared, type CspSources, type CustomPresetInput, type DeclarationDiff, type DeclarationDryRun, type DeclarationWarning, type DeclaredCookie, type DeclaredCookieInput, type DnsRecordInstruction, type DsarCase, type DsarCaseCreate, type DsarCaseReceipt, type DsarCaseStatus, type DsarCaseTask, type DsarCreate, type DsarEraseResult, type DsarExecutor, type DsarExecutorCreated, type DsarExecutorDryRun, type DsarExecutorInput, type DsarExecutorPatch, type DsarExecutorPresetInput, type DsarExportResult, type DsarRequest, type DsarSettings, type DsarStatus, type DsarSubject, type DsarTask, type DsarTaskEvent, type DsarTaskExport, type DsarTaskLogEntry, type DsarTaskOutcome, type DsarType, type DsarTypeWord, type EmbedManifest, type EmbedManifestStorage, type EmbedManifestSurface, type EnforcementRuleInput, type Entitlement, type Entitlements, type ExecutorConformanceResult, type ExecutorHealth, type ExecutorPresetName, type ExecutorPresetStep, type ExecutorPresetUpgrade, type ExecutorPresets, type ExecutorProfile, type ExecutorTestInput, type ExecutorTestResult, type ExecutorWebhookDelivery, type ExecutorWebhookTestResult, type FdCause, type FdConsent, type FdConsentQueue, type FdQueuedCall, type FdRequestOptions, type FdSnapshot, type FlowIssue, type FlowOp, type FlowOpResponse, type FulfillmentOp, type HealthRow, type HealthWaiver, type HealthWaiverInput, type Identifier, type Identity, type ImportedCookie, type ImportedDeclaration, type InstallSnippet, type IntegrationHealthReport, type LeakReport, type LegalBasis, type LogQuery, type MailProvider, type MailProviderInput, type MailProviderKind, type MailProviderTestResult, type Member, type MetadataFilter, type MintConsentSyncTokenInput, type ObservedPurgeResult, type OperatorTokenExchangeInput, type OperatorTokenExchangeResult, type OptInMethod, type Org, type OrgControllerIdentity, type OrgControllerInput, type OrgUpdate, type ParityControlSummary, type PartnerCatalogEntry, type PartnerId, type PartnerLink, type PartnerLinkCreate, type PlanSource, type PolicyOptions, type PreferenceItem, type PreferenceRecord, type PreviewToken, type PreviewTokenOptions, type ProfileAttributeInput, type ProvisionEnv, type ProvisionRequest, type ProvisionRequestV2, type ProvisionResult, type ProvisionStep, type PublicDsarFiled, type PublicDsarPending, type PublicVerification, type PutConfigOptions, type RangeQuery, type Regulation, type RegulationSummary, type RegulatoryFeedResult, type ResellerChild, type ResellerChildCreate, type ResellerChildList, type ResellerChildPatch, type ResourceMetadata, type ResourceTags, type ResourceTagsInput, type ResourceTagsUpdate, type RetentionLine, type RetiredCookie, type RightKind, type RightsCaptcha, type RightsCaptchaInput, type RightsCaptchaProvider, type RightsIdentity, type RightsIdentityInput, type RightsIdentityType, type RightsLink, type RightsLinkInput, type RightsPageDocument, type RightsPageDomain, type RightsPageDomainList, type RightsPageDraft, type RightsPageDraftConflict, type RightsPageDryRun, type RightsPageIssue, type RightsPagePublishResult, type RightsPagePublished, type RightsPagePublisher, type RightsPageVersions, type RightsPageWriteOptions, type RiskScore, type RopaEntry, type RopaInput, SDK_VERSION, type SandboxCreated, type SandboxOrg, type SandboxPurge, type ScanResult, type ScanStatus, type ScoredVendor, type ScrollbarTheme, type SessionAnalysisInput, type SignedReceipt, type Site, type SiteConfig, type SiteCookie, type SiteCreate, type SiteFlow, type SiteUpdate, type SiteUpdateResult, type SnippetOptions, type StandardKeyList, type StandardPartnerLink, type StandardPartnerLinkCreate, type StorageType, type SubjectCard, type SubjectIdentity, type SubscriptionTopicInput, type SuggestedRejectStyle, type SupportedLanguage, type TaggedType, TokenExchangeError, type Usage, type VendorInput, type VendorRecord, type VerifyResult, type VerifyWebhookInput, type WebhookCreate, type WebhookDeadLetter, type WebhookKeyForm, type WebhookReplayResult, type WebhookStage, type WebhookSubscription, type WebhookTestResult, type WebhookUpdate, canaryIdentityFor, createCookieMunch, exchangeOperatorToken, mintConsentSyncToken, runExecutorConformance, verifyWebhookSignature };
|
|
3530
|
+
export declare function createCookieMunch(opts: CookieMunchOptions): CookieMunchClient;
|