@consent-kit/schema 0.0.0-stage → 0.1.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.
@@ -0,0 +1,2711 @@
1
+ /**
2
+ * The registry contract: the shape of a parsed `privacy.registry.yaml`.
3
+ * Every other package builds on these types. Change them deliberately.
4
+ */
5
+ type LawfulBasis = 'consent' | 'contract' | 'legal_obligation' | 'legitimate_interest' | 'vital_interests' | 'public_task';
6
+ /** BCP 47 language tag, e.g. "en", "de". */
7
+ type Locale = string;
8
+ /** One string per locale declared in `Registry.locales`. */
9
+ type LocalizedText = Record<Locale, string>;
10
+ /**
11
+ * Retention forms: "session", "until-withdrawn", a duration ("30d"),
12
+ * or relative to a project-emitted event ("30d-after-closed").
13
+ */
14
+ type Retention = string;
15
+ /** The data protection officer (Art. 37 GDPR), as printed in the privacy policy (Art. 13(1)(b)). */
16
+ interface DataProtectionOfficer {
17
+ name?: string;
18
+ /** Email address, URL or postal address the officer can be reached at. */
19
+ contact: string;
20
+ }
21
+ /** The supervisory authority complaints go to (Art. 13(2)(d), Art. 77 GDPR). */
22
+ interface SupervisoryAuthority {
23
+ name: string;
24
+ url?: string;
25
+ address?: string;
26
+ }
27
+ /** The representative in the Union of a controller that is not established there (Art. 27 GDPR). */
28
+ interface EuRepresentative {
29
+ name: string;
30
+ contact: string;
31
+ address?: string;
32
+ }
33
+ interface Controller {
34
+ name: string;
35
+ contact: string;
36
+ address?: string;
37
+ /**
38
+ * The designated data protection officer, or `false`: none is designated.
39
+ * The validator requires one of the two; silence is not a statement.
40
+ * (Optional in this type only because a registry released before the field
41
+ * existed is still read from the lock file.)
42
+ */
43
+ dpo?: DataProtectionOfficer | false;
44
+ /** Required by the validator. */
45
+ supervisoryAuthority?: SupervisoryAuthority;
46
+ /** Only for controllers not established in the Union. Absent means: not needed. */
47
+ euRepresentative?: EuRepresentative;
48
+ }
49
+ /**
50
+ * Automated decision-making, including profiling, within the meaning of Art. 22 GDPR:
51
+ * `false` states that none takes place; otherwise the information Art. 13(2)(f) asks for.
52
+ */
53
+ type AutomatedDecisionMaking = false | {
54
+ /** Meaningful information about the logic involved. */
55
+ logic: LocalizedText;
56
+ /** The significance and the envisaged consequences for the data subject. */
57
+ consequences: LocalizedText;
58
+ };
59
+ interface Purpose {
60
+ id: string;
61
+ /** Bumped on every material change to this purpose. Starts at 1. */
62
+ version: number;
63
+ basis: LawfulBasis;
64
+ title: LocalizedText;
65
+ description: LocalizedText;
66
+ /** Kinds of personal data processed, e.g. "email", "ip_address", "usage_events". */
67
+ dataCategories: string[];
68
+ retention: Retention;
69
+ /** Only meaningful for `basis: consent`, where it must be "denied" (or omitted). */
70
+ default?: 'denied' | 'granted';
71
+ /** The interest pursued (Art. 13(1)(d)). Required when `basis` is `legitimate_interest`, and only allowed there. */
72
+ legitimateInterest?: LocalizedText;
73
+ /** Required by the validator on every purpose: `false`, or what the automated decision does. */
74
+ automatedDecisionMaking?: AutomatedDecisionMaking;
75
+ /**
76
+ * Categories of data subjects (Art. 30(1)(c)), as ids, e.g. "visitors". At least one;
77
+ * required by the validator. Named in `Registry.dataSubjectCategories`.
78
+ */
79
+ dataSubjects?: string[];
80
+ /**
81
+ * Processor ids: recipients of this purpose's data that no artefact shows, e.g. the
82
+ * email provider behind a form. `[]` states that there are none besides the
83
+ * processors of the purpose's artefacts. Absent means: not stated.
84
+ */
85
+ processors?: string[];
86
+ }
87
+ type TransferMechanism = 'adequacy' | 'scc' | 'dpf' | 'bcr';
88
+ /**
89
+ * How a recipient relates to the controller: a processor acting on instructions
90
+ * (Art. 28), a controller in its own right, or a joint controller (Art. 26).
91
+ */
92
+ type ProcessorRole = 'processor' | 'independent_controller' | 'joint_controller';
93
+ interface Processor {
94
+ id: string;
95
+ name: string;
96
+ /** Default: "processor". */
97
+ role?: ProcessorRole;
98
+ legalEntity?: string;
99
+ /** ISO 3166-1 alpha-2 country code. */
100
+ country: string;
101
+ /** True when the controller itself runs this (no third party involved). */
102
+ firstParty?: boolean;
103
+ /** Required when `country` is outside the EU/EEA. */
104
+ transferMechanism?: TransferMechanism;
105
+ dpaUrl?: string;
106
+ privacyUrl?: string;
107
+ /** Where to send a data-subject request for data this processor holds. */
108
+ subjectRequestProcess?: string;
109
+ }
110
+ interface ArtefactBase {
111
+ id: string;
112
+ /** Purpose ids. At least one. */
113
+ purposes: string[];
114
+ /** Processor id. Required for anything third-party. */
115
+ processor?: string;
116
+ description?: LocalizedText;
117
+ }
118
+ interface ScriptArtefact extends ArtefactBase {
119
+ kind: 'script';
120
+ /** Absolute URL for third-party scripts, or a site-relative path. */
121
+ src: string;
122
+ }
123
+ interface CookieArtefact extends ArtefactBase {
124
+ kind: 'cookie';
125
+ /** Exactly one of `name` or `pattern` (a RegExp source, e.g. "^_ga_"). */
126
+ name?: string;
127
+ pattern?: string;
128
+ /** "session" or a duration such as "365d". */
129
+ duration: string;
130
+ domain?: string;
131
+ sameSite?: 'Strict' | 'Lax' | 'None';
132
+ secure?: boolean;
133
+ httpOnly?: boolean;
134
+ }
135
+ interface StorageArtefact extends ArtefactBase {
136
+ kind: 'storage';
137
+ area: 'local' | 'session' | 'indexeddb';
138
+ /** Exactly one of `key` or `pattern` (a RegExp source). For indexeddb: the database name. */
139
+ key?: string;
140
+ pattern?: string;
141
+ /**
142
+ * How long the entry is kept: "<n>d", or "persistent" (until deleted). A declaration for
143
+ * the documents; the project's own code has to honour it. Absent: the browser's default
144
+ * for the area (session storage ends with the tab, the others never expire).
145
+ */
146
+ duration?: string;
147
+ }
148
+ interface IframeArtefact extends ArtefactBase {
149
+ kind: 'iframe';
150
+ /** Origin or URL prefix the embed loads from. */
151
+ src: string;
152
+ }
153
+ interface PixelArtefact extends ArtefactBase {
154
+ kind: 'pixel';
155
+ url: string;
156
+ }
157
+ interface EndpointArtefact extends ArtefactBase {
158
+ kind: 'endpoint';
159
+ /** Origin or URL prefix that first-party code sends data to. */
160
+ url: string;
161
+ }
162
+ /**
163
+ * A resource the page loads without running it: a stylesheet, a font, or an audio or video
164
+ * file. Declared so that the Content-Security-Policy can admit its origin and the documents
165
+ * can name its provider (who learns the visitor's IP address when the file is fetched).
166
+ *
167
+ * Nothing consent-kit generates can hold such a load back until consent: CookieConsent
168
+ * only manages `<script>` tags, the guard does not intercept `<link>`, CSS `url()` or
169
+ * `<video>`, and the CSP is the same before and after a decision. A third-party resource
170
+ * may therefore only be bound to purposes whose basis is not consent; the validator
171
+ * rejects anything else. Site-relative resources need no declaration at all.
172
+ */
173
+ interface ResourceArtefactBase extends ArtefactBase {
174
+ /** Absolute URL of the file, or an origin or URL prefix that covers several files. */
175
+ src: string;
176
+ }
177
+ interface StylesheetArtefact extends ResourceArtefactBase {
178
+ kind: 'stylesheet';
179
+ }
180
+ interface FontArtefact extends ResourceArtefactBase {
181
+ kind: 'font';
182
+ }
183
+ interface MediaArtefact extends ResourceArtefactBase {
184
+ kind: 'media';
185
+ }
186
+ type Artefact = ScriptArtefact | CookieArtefact | StorageArtefact | IframeArtefact | PixelArtefact | EndpointArtefact | StylesheetArtefact | FontArtefact | MediaArtefact;
187
+ type ArtefactKind = Artefact['kind'];
188
+ /** Whether the data subject has to provide the data (Art. 13(2)(e) GDPR). */
189
+ type Provision = 'statutory' | 'contractual' | 'voluntary';
190
+ interface CollectionField {
191
+ name: string;
192
+ /** Purpose id this field is collected for. */
193
+ purpose: string;
194
+ required?: boolean;
195
+ /** Shown at the field. Generated from the purpose when omitted. */
196
+ notice?: LocalizedText;
197
+ /**
198
+ * Required by the validator. `statutory`: the law requires the data. `contractual`: a
199
+ * contract requires it, or it is needed to enter into one. `voluntary`: neither.
200
+ */
201
+ provision?: Provision;
202
+ /** What happens if the data is not provided. Required unless `provision` is `voluntary`. */
203
+ consequence?: LocalizedText;
204
+ }
205
+ interface CollectionPoint {
206
+ id: string;
207
+ /** The form's name in the documents. */
208
+ title?: LocalizedText;
209
+ /** Internal note; never printed in a document. */
210
+ description?: string;
211
+ fields: CollectionField[];
212
+ }
213
+ /** One kind of personal data, as named in the documents. */
214
+ interface DataCategory {
215
+ title: LocalizedText;
216
+ /** True for a special category of personal data (Art. 9 GDPR). */
217
+ special?: boolean;
218
+ }
219
+ /** One category of data subjects, as named in the record of processing activities. */
220
+ interface DataSubjectCategory {
221
+ title: LocalizedText;
222
+ }
223
+ interface Registry {
224
+ /** Registry file format version. */
225
+ version: 1;
226
+ controller: Controller;
227
+ locales: Locale[];
228
+ defaultLocale: Locale;
229
+ purposes: Purpose[];
230
+ processors: Processor[];
231
+ artefacts: Artefact[];
232
+ collectionPoints: CollectionPoint[];
233
+ /**
234
+ * Data category id to its name. Optional; once present, every id in a purpose's
235
+ * `dataCategories` must be declared here.
236
+ */
237
+ dataCategories?: Record<string, DataCategory>;
238
+ /** Data subject category id to its name. Same rule as `dataCategories`, for `purposes[].dataSubjects`. */
239
+ dataSubjectCategories?: Record<string, DataSubjectCategory>;
240
+ /**
241
+ * Retention event id (the `<event>` of "30d-after-<event>") to what happens, worded to
242
+ * follow "after": `closed: { en: "the report is closed" }`. Same rule as `dataCategories`.
243
+ */
244
+ retentionEvents?: Record<string, LocalizedText>;
245
+ /** General description of the technical and organisational security measures (Art. 30(1)(g)). */
246
+ securityMeasures?: LocalizedText;
247
+ /**
248
+ * Deviations from the strict Content-Security-Policy that `consent-kit build` generates.
249
+ * Absent means: the strict policy, enforced.
250
+ */
251
+ csp?: CspConfig;
252
+ /**
253
+ * Where proof of each consent decision goes. Required by the validator as soon as one
254
+ * purpose is based on consent: either an endpoint, or an explicit opt-out with a reason.
255
+ * (Optional in this type only because a registry released before the field existed is
256
+ * still read from the lock file, and a registry without consent purposes needs none.)
257
+ */
258
+ receipts?: Receipts;
259
+ /**
260
+ * Receiving data subject requests (access, Art. 15, and erasure, Art. 17 GDPR) through a form
261
+ * on the site's own domain. consent-kit receives, records, notifies and reminds; a person
262
+ * gathers or deletes the data and answers. Absent means: the site has no such form, and the
263
+ * privacy policy only names the controller's contact.
264
+ *
265
+ * Enabling it adds the built-in purpose `subject-requests` (`subjectRequestPurpose`), which
266
+ * the documents list like any other.
267
+ */
268
+ subjectRequests?: SubjectRequests;
269
+ }
270
+ /** The kinds of data subject request the generated form and the handler accept. */
271
+ type SubjectRequestType = 'access' | 'erasure';
272
+ interface SubjectRequests {
273
+ /**
274
+ * Site-relative path the form posts to and the handler answers, e.g. "/privacy/requests".
275
+ * Never another origin: the browser has to send the consent cookie with the request, so that
276
+ * the request can be tied to that browser's consent receipts.
277
+ */
278
+ endpoint: string;
279
+ /** The mailbox every request is emailed to, e.g. "privacy@example.com". */
280
+ notify: string;
281
+ /** Which requests the form offers. At least one; v1 knows `access` and `erasure`. */
282
+ types: SubjectRequestType[];
283
+ /**
284
+ * How long a request record is kept after the request is closed: "<n>d" or "<n>y". Required,
285
+ * with no default: the controller decides it (it is the proof that a request was answered).
286
+ */
287
+ retention: string;
288
+ /**
289
+ * Email the requester a confirmation link, through this provider. Optional; the processor
290
+ * must be declared under `processors`, since it receives the requester's address.
291
+ */
292
+ requesterEmail?: {
293
+ processor: string;
294
+ };
295
+ }
296
+ /**
297
+ * A consent receipt is the proof of one decision: CookieConsent's `consentId`, the accepted
298
+ * and rejected consent purposes with their versions, the policy hash and revision of the
299
+ * build, the event (`first` or `change`) and the time. The consent cookie is the working
300
+ * copy in the browser; receipts are the record the site keeps.
301
+ *
302
+ * Exactly one of the two forms:
303
+ * - `{ endpoint }`: the generated CookieConsent module POSTs every receipt there. A
304
+ * site-relative path ("/consent-receipts") or an https URL; a third-party URL must be
305
+ * covered by a declared endpoint artefact whose purposes need no consent. The endpoint
306
+ * is the site's to provide, and must hash `consentId` before storing it.
307
+ * - `{ optOut: { reason } }`: no receipts are sent. Reported as a warning by
308
+ * `consent-kit check` and stated in the audit report, with the reason.
309
+ */
310
+ type Receipts = {
311
+ endpoint: string;
312
+ } | {
313
+ optOut: {
314
+ reason: string;
315
+ };
316
+ };
317
+ /** One loosening of one directive of the generated Content-Security-Policy. */
318
+ interface CspAllowance {
319
+ /** The directive to loosen, e.g. "style-src". */
320
+ directive: string;
321
+ /** Source expressions to add, exactly as they appear in the header: `'unsafe-inline'`, `data:`, `https://cdn.example`. */
322
+ sources: string[];
323
+ /** Why the site needs it. Printed wherever the deviation is listed. */
324
+ reason: string;
325
+ }
326
+ /**
327
+ * Everything that makes the generated Content-Security-Policy weaker than, or different
328
+ * from, the strict default. It lives in the registry so that each loosening is validated,
329
+ * part of the policy hash, and classified by the diff like any other declaration.
330
+ */
331
+ interface CspConfig {
332
+ /** Additional sources per directive, each with a reason. */
333
+ allow?: CspAllowance[];
334
+ /**
335
+ * Emit `Content-Security-Policy-Report-Only` instead of the enforcing header: violations
336
+ * are reported but nothing is blocked. For rolling a policy out, not for staying on.
337
+ */
338
+ reportOnly?: boolean;
339
+ /** `report-uri`: where browsers POST violation reports. A third-party URL must be a declared endpoint artefact. */
340
+ reportUri?: string;
341
+ /** `report-to`: name of a reporting group. With `reportUri`, a `Reporting-Endpoints` header for it is generated too. */
342
+ reportTo?: string;
343
+ /**
344
+ * `false` leaves out `upgrade-insecure-requests`, for a site that is served over plain
345
+ * http. (It is also left out, and reported, when the registry declares an http: URL.)
346
+ */
347
+ upgradeInsecureRequests?: boolean;
348
+ }
349
+ /**
350
+ * One adopted provider preset (an entry of the top-level `presets` list).
351
+ * A preset declares one third-party tool: its processor and all its artefacts.
352
+ * `resolvePresets` expands every entry into ordinary processors and artefacts.
353
+ */
354
+ interface PresetUse {
355
+ /** Preset id in the catalogue, e.g. "plausible". */
356
+ use: string;
357
+ /** A major version (`1`: the newest 1.x.y in the catalogue) or an exact one ("1.0.2"). */
358
+ version: number | string;
359
+ /** Shorthand for presets with exactly one purpose slot: the project purpose id to bind it to. */
360
+ purpose?: string;
361
+ /** Preset purpose slot to project purpose id. Required when the preset has several slots. */
362
+ purposes?: Record<string, string>;
363
+ /** Values for the preset's parameters, e.g. `{ domain: example.org }`. */
364
+ with?: Record<string, string | number | boolean>;
365
+ /** Renames: the preset's default processor or artefact id to the id this project uses. */
366
+ ids?: Record<string, string>;
367
+ /** Default ids of preset artefacts this project does not use. Recorded as an override. */
368
+ exclude?: string[];
369
+ /**
370
+ * Local deviations from the documented defaults, by default id. Any field
371
+ * except `id` and `kind`; `null` removes an optional field. Always recorded.
372
+ */
373
+ overrides?: {
374
+ processor?: Record<string, unknown>;
375
+ artefacts?: Record<string, Record<string, unknown>>;
376
+ };
377
+ }
378
+ /**
379
+ * What `privacy.registry.yaml` may contain: a registry plus adopted presets.
380
+ * Only the validator sees this shape; everything downstream receives the
381
+ * expanded, plain `Registry`.
382
+ */
383
+ interface RegistrySource extends Registry {
384
+ presets?: PresetUse[];
385
+ }
386
+ /**
387
+ * One declared thing the runtime guard may let through, compiled from a Registry.
388
+ *
389
+ * Consent follows CookieConsent's model (categories, and services inside them).
390
+ * The entry is consented when
391
+ * 1. every id in `categories` is an accepted category, and
392
+ * 2. if `service` is set, that service is accepted in EVERY one of `categories`
393
+ * (CookieConsent's `acceptedService(service, category)` for each of them).
394
+ * An empty `categories` list means always allowed; `service` is then never set.
395
+ */
396
+ interface GuardEntry {
397
+ /** Artefact id, for error messages and reports. */
398
+ id: string;
399
+ /** Exactly one of `name` (exact match) or `pattern` (RegExp source). */
400
+ name?: string;
401
+ pattern?: string;
402
+ /** Consent-category ids (consent-purpose ids) that must ALL be accepted. */
403
+ categories: string[];
404
+ /**
405
+ * Service id that must also be accepted within each of `categories`: the
406
+ * artefact's processor id, which is the service key in the generated
407
+ * CookieConsent config. Absent means category acceptance is enough (the
408
+ * artefact has no processor, or it needs no consent at all).
409
+ */
410
+ service?: string;
411
+ }
412
+ /**
413
+ * URL lists (`scripts`, `iframes`, `endpoints`) share one matching contract:
414
+ * - `name` is an origin ("https://plausible.io"), an absolute URL prefix
415
+ * ("https://cdn.example/widgets/"), or a site-relative path prefix starting
416
+ * with a single "/" (same origin as the page). A URL matches when its origin
417
+ * is equal and its pathname is under the prefix's path by whole segments
418
+ * (`pathCovers`): equal to it, or continuing it with a "/", or starting with
419
+ * it when the prefix itself ends in "/". "/collect" therefore matches
420
+ * "/collect" and "/collect/x" but not "/collector"; a bare origin and the
421
+ * prefix "/" match every path. The longest matching prefix wins.
422
+ * - `pattern` is tested against the URL's origin + pathname (no query, no hash).
423
+ * A same-origin script or iframe that no entry matches is first-party code and
424
+ * is allowed without a declaration; a same-origin entry that does match applies
425
+ * its consent requirement like any other.
426
+ * The other lists match `name` exactly, or `pattern` against the whole key.
427
+ */
428
+ interface GuardManifest {
429
+ cookies: GuardEntry[];
430
+ localStorage: GuardEntry[];
431
+ sessionStorage: GuardEntry[];
432
+ indexedDB: GuardEntry[];
433
+ scripts: GuardEntry[];
434
+ iframes: GuardEntry[];
435
+ /**
436
+ * Every other declared network destination: where the page may send data with
437
+ * fetch / XMLHttpRequest / sendBeacon (endpoint and pixel artefacts), and the
438
+ * stylesheets, fonts and media files it loads. The guard only uses this to
439
+ * label the requests it observes as declared or undeclared; it never blocks
440
+ * them, and it does not see `<link>`, CSS `url()` or `<video>` loads at all.
441
+ * Those are the Content-Security-Policy's to stop and the audit's to report.
442
+ */
443
+ endpoints: GuardEntry[];
444
+ }
445
+
446
+ /**
447
+ * Where one documented fact comes from. Vendor facts are never written from
448
+ * memory: `source` is the page of the vendor's own documentation that states it.
449
+ */
450
+ interface PresetFact {
451
+ /** URL of the vendor documentation that states the fact. (Synthetic presets: a path in this repository.) */
452
+ source: string;
453
+ /** True when a person or tool read `source` and found the fact there, on `checkedOn`. */
454
+ verified: boolean;
455
+ /** ISO date (YYYY-MM-DD) of the last time `source` was read. Required when `verified`. */
456
+ checkedOn?: string;
457
+ /** What exactly was (or could not be) confirmed. Required when not `verified`. */
458
+ note?: string;
459
+ }
460
+ interface PresetParameter {
461
+ description: string;
462
+ /**
463
+ * `origin`: scheme, host and optional port, no path ("https://stats.example.org").
464
+ * `host`: a bare host name. `string`: anything matching `pattern` (when given).
465
+ */
466
+ type: 'string' | 'origin' | 'host';
467
+ /** RegExp source the value must match. */
468
+ pattern?: string;
469
+ /** Used when the project gives no value. Without it the parameter is required. */
470
+ default?: string;
471
+ /** A valid value, for documentation and for expanding the preset in tests. */
472
+ example: string;
473
+ }
474
+ /** A role the preset's artefacts play, which the project binds to one of its own purposes. */
475
+ interface PresetPurposeSlot {
476
+ description: string;
477
+ /**
478
+ * The lawful basis the artefacts in this slot normally need, when there is
479
+ * one to expect (e.g. `consent` for a tag that stores an identifier on the
480
+ * device). Binding the slot to a purpose with another basis is a warning,
481
+ * never an error: the basis is the project's decision.
482
+ */
483
+ expectedBasis?: LawfulBasis;
484
+ /** Why `expectedBasis` is expected. Shown in the warning. */
485
+ basisReason?: string;
486
+ }
487
+ /** One artefact of the tool, with the documentation it was taken from. */
488
+ interface PresetArtefact extends PresetFact {
489
+ /**
490
+ * The artefact as it is written into the registry, with three differences:
491
+ * `id` is the default id, `purposes` lists purpose SLOTS of this preset, and
492
+ * `processor` is left out (it is always the preset's processor). String
493
+ * values may contain `${parameter}` placeholders.
494
+ */
495
+ declares: Artefact;
496
+ }
497
+ /** How to load the tool on an otherwise empty page, and what it is then expected to do. */
498
+ interface PresetFixture {
499
+ /** Parameter values for the run. Every required parameter must be present. */
500
+ with: Record<string, string>;
501
+ /** HTML placed in the page's `<head>`. May contain `${parameter}` placeholders. */
502
+ head: string;
503
+ /** HTML placed in the page's `<body>`. */
504
+ body?: string;
505
+ /** Default ids of the artefacts a plain page view must produce. */
506
+ expect: string[];
507
+ /**
508
+ * The last run against the vendor. `null`: never run. A preset stays
509
+ * `draft` until a run against the live vendor passed.
510
+ */
511
+ lastRun: {
512
+ date: string;
513
+ against: 'live' | 'offline';
514
+ result: 'pass' | 'fail';
515
+ } | null;
516
+ note?: string;
517
+ }
518
+ /** One version of one preset: a complete, sourced declaration of a third-party tool. */
519
+ interface PresetDefinition {
520
+ /** Catalogue id, e.g. "plausible". */
521
+ id: string;
522
+ /** Semver, "MAJOR.MINOR.PATCH". A change that is material under the material-change rule is a major bump. */
523
+ version: string;
524
+ /**
525
+ * `draft` until every fact is verified and the fixture has run green against
526
+ * the live vendor; `verified` after.
527
+ */
528
+ status: 'draft' | 'verified';
529
+ /** True for presets of a vendor that does not exist (the example site's fake vendor). */
530
+ synthetic?: boolean;
531
+ name: string;
532
+ summary: string;
533
+ /** The vendor's documentation home. */
534
+ docs: string;
535
+ parameters: Record<string, PresetParameter>;
536
+ /** Purpose slots by name. At least one. */
537
+ purposes: Record<string, PresetPurposeSlot>;
538
+ processor: {
539
+ /** `id` is the default processor id. String values may contain placeholders. */
540
+ declares: Processor;
541
+ /** One fact per declared field other than `id` and `name`. */
542
+ facts: Partial<Record<Exclude<keyof Processor, 'id' | 'name'>, PresetFact>>;
543
+ };
544
+ artefacts: PresetArtefact[];
545
+ /** Documented statements that are not artefacts, e.g. "sets no cookies". */
546
+ statements?: (PresetFact & {
547
+ text: string;
548
+ })[];
549
+ fixture: PresetFixture;
550
+ }
551
+ /** Every version of every known preset. Order does not matter. */
552
+ type PresetCatalogue = readonly PresetDefinition[];
553
+ /** Where one expanded processor or artefact came from. */
554
+ interface AppliedPreset {
555
+ /** Index into the registry's `presets` list. */
556
+ index: number;
557
+ preset: string;
558
+ /** The exact version that was expanded. */
559
+ version: string;
560
+ status: PresetDefinition['status'];
561
+ synthetic: boolean;
562
+ /** Parameter values after defaults. */
563
+ parameters: Record<string, string>;
564
+ /** Purpose slot to project purpose id. */
565
+ purposes: Record<string, string>;
566
+ processor: {
567
+ id: string;
568
+ defaultId: string;
569
+ };
570
+ /** The artefacts written into the registry, in order. */
571
+ artefacts: {
572
+ id: string;
573
+ defaultId: string;
574
+ }[];
575
+ /** Default ids of the processor (by field: "processor.country") and artefacts whose facts are not verified. */
576
+ unverified: string[];
577
+ }
578
+ /** One local deviation from a preset's documented default. */
579
+ interface OverrideRecord {
580
+ /** Index into the registry's `presets` list. */
581
+ index: number;
582
+ preset: string;
583
+ version: string;
584
+ target: 'processor' | 'artefact';
585
+ /** The id in the expanded registry (for an excluded artefact: the id it would have had). */
586
+ id: string;
587
+ defaultId: string;
588
+ /** `field`: one field differs. `excluded`: the artefact is documented but not declared here. */
589
+ change: 'field' | 'excluded';
590
+ /** Set for `field`. */
591
+ field?: string;
592
+ /** The preset's value (after parameters). Undefined when the preset does not set the field. */
593
+ documented?: unknown;
594
+ /** The project's value. Undefined when the field was removed. */
595
+ local?: unknown;
596
+ /** The vendor documentation behind the documented default. */
597
+ source?: string;
598
+ }
599
+ interface PresetWarning {
600
+ /** Stable code, e.g. `preset/basis-mismatch`. */
601
+ code: 'preset/basis-mismatch' | 'preset/redundant-override' | 'preset/missing-locale';
602
+ /** JSON pointer into the registry source. */
603
+ path: string;
604
+ message: string;
605
+ }
606
+ /** What a validated registry reports about its presets. */
607
+ interface PresetReport {
608
+ applied: AppliedPreset[];
609
+ overrides: OverrideRecord[];
610
+ warnings: PresetWarning[];
611
+ }
612
+
613
+ /**
614
+ * Every rule the validator can report, with a one-line summary.
615
+ * Codes are stable: tools and tests may match on them.
616
+ */
617
+ declare const RULES: {
618
+ readonly 'yaml/syntax': "The file is not well-formed YAML.";
619
+ readonly 'schema/type': "A value has the wrong JSON type.";
620
+ readonly 'schema/required': "A required field is missing.";
621
+ readonly 'schema/unknown-property': "A field is not part of the registry format.";
622
+ readonly 'schema/enum': "A value is not one of the allowed options.";
623
+ readonly 'schema/format': "A value does not have the expected shape.";
624
+ readonly 'schema/id-format': "An id is not lowercase kebab/snake case.";
625
+ readonly 'schema/exactly-one-of': "Exactly one of two alternative fields must be set.";
626
+ readonly 'id/duplicate': "Two entries of the same kind share an id.";
627
+ readonly 'collection-point/duplicate-field': "A collection point declares the same field name twice.";
628
+ readonly 'artefact/no-purpose': "An artefact is not bound to any purpose.";
629
+ readonly 'artefact/unknown-purpose': "An artefact references a purpose that is not declared.";
630
+ readonly 'artefact/unknown-processor': "An artefact references a processor that is not declared.";
631
+ readonly 'artefact/third-party-without-processor': "A third-party artefact has no processor.";
632
+ readonly 'artefact/invalid-pattern': "A `pattern` is not a valid regular expression.";
633
+ readonly 'artefact/unsupported-url': "An artefact URL is not an http(s) URL or a site-relative path, or is written in a way browsers read differently.";
634
+ readonly 'artefact/consent-not-enforceable': "A stylesheet, font or media file is bound to a consent purpose, which nothing can enforce.";
635
+ readonly 'script/multiple-consent-purposes': "A script is bound to more than one consent purpose.";
636
+ readonly 'cookie/invalid-duration': "A cookie duration is not \"session\" or \"<n>d\".";
637
+ readonly 'storage/invalid-duration': "A storage duration is not \"persistent\" or \"<n>d\".";
638
+ readonly 'controller/dpo-not-stated': "The controller neither names a data protection officer nor states that there is none.";
639
+ readonly 'controller/missing-supervisory-authority': "The controller names no supervisory authority.";
640
+ readonly 'collection-field/no-purpose': "A collection-point field has no purpose.";
641
+ readonly 'collection-field/unknown-purpose': "A collection-point field references a purpose that is not declared.";
642
+ readonly 'collection-field/missing-provision': "A collection-point field does not say whether providing it is statutory, contractual or voluntary.";
643
+ readonly 'collection-field/missing-consequence': "A statutory or contractual field does not say what happens when it is not provided.";
644
+ readonly 'purpose/consent-default-not-denied': "A consent purpose defaults to anything other than \"denied\".";
645
+ readonly 'purpose/default-on-non-consent': "`default` is set on a purpose whose basis is not consent.";
646
+ readonly 'purpose/invalid-retention': "A retention value is not one of the supported forms.";
647
+ readonly 'purpose/reserved-id': "A purpose uses an id the banner reserves for itself.";
648
+ readonly 'purpose/vague-text': "A consent purpose is described only by a stock vague phrase.";
649
+ readonly 'purpose/missing-legitimate-interest': "A purpose based on legitimate interests does not state the interest.";
650
+ readonly 'purpose/legitimate-interest-on-other-basis': "`legitimateInterest` is set on a purpose whose basis is not legitimate_interest.";
651
+ readonly 'purpose/adm-not-stated': "A purpose does not state whether automated decision-making takes place.";
652
+ readonly 'purpose/missing-data-subjects': "A purpose names no category of data subjects.";
653
+ readonly 'purpose/unknown-processor': "A purpose references a processor that is not declared.";
654
+ readonly 'purpose/unknown-data-category': "A purpose uses a data category that the `dataCategories` map does not declare.";
655
+ readonly 'purpose/unknown-data-subject': "A purpose uses a data subject category that the `dataSubjectCategories` map does not declare.";
656
+ readonly 'purpose/unknown-retention-event': "A retention refers to an event that the `retentionEvents` map does not declare.";
657
+ readonly 'processor/missing-transfer-mechanism': "A processor outside the EU/EEA has no transfer mechanism.";
658
+ readonly 'processor/unreferenced': "A processor is used by no artefact and listed by no purpose.";
659
+ readonly 'csp/unknown-directive': "A `csp.allow` entry names a directive consent-kit does not generate.";
660
+ readonly 'csp/invalid-source': "A `csp.allow` source is not a well-formed CSP source expression.";
661
+ readonly 'csp/redundant-source': "A `csp.allow` source is `'none'` or repeats what another entry already allows.";
662
+ readonly 'csp/invalid-report-uri': "`csp.reportUri` is not an http(s) URL or a site-relative path, or is written in a way browsers read differently.";
663
+ readonly 'csp/undeclared-report-endpoint': "`csp.reportUri` points at a third party that no endpoint artefact declares.";
664
+ readonly 'receipts/not-stated': "A purpose is based on consent, but the registry does not say where consent receipts go or that it keeps none.";
665
+ readonly 'receipts/invalid-endpoint': "`receipts.endpoint` is not an https URL or a site-relative path, or is written in a way browsers read differently.";
666
+ readonly 'receipts/undeclared-endpoint': "`receipts.endpoint` points at a third party that no endpoint artefact declares.";
667
+ readonly 'receipts/endpoint-needs-consent': "The endpoint artefact that declares `receipts.endpoint` is bound to a consent purpose, so a rejection could not be recorded.";
668
+ readonly 'receipts/vague-reason': "The reason given for `receipts.optOut` is a stock phrase that says nothing.";
669
+ readonly 'subject-requests/endpoint-not-same-origin': "`subjectRequests.endpoint` is not a site-relative path, so the browser would not send the consent cookie with a request.";
670
+ readonly 'subject-requests/unknown-type': "`subjectRequests.types` lists a request type consent-kit does not know.";
671
+ readonly 'subject-requests/retention-format': "`subjectRequests.retention` is not a number of days or years (\"<n>d\" or \"<n>y\").";
672
+ readonly 'subject-requests/unknown-processor': "`subjectRequests.requesterEmail.processor` is not a declared processor.";
673
+ readonly 'subject-requests/invalid-notify': "`subjectRequests.notify` is not an email address.";
674
+ readonly 'subject-requests/purpose-id-taken': "A purpose uses the id of the built-in purpose that `subjectRequests` adds.";
675
+ readonly 'locale/default-not-declared': "`defaultLocale` is not listed in `locales`.";
676
+ readonly 'locale/missing-text': "A localized text lacks a declared locale.";
677
+ readonly 'locale/undeclared-text': "A localized text uses a locale that is not declared.";
678
+ readonly 'preset/unresolved': "The registry uses presets but no preset catalogue was given to the validator.";
679
+ readonly 'preset/unknown': "A `presets` entry names a preset or a version the catalogue does not have.";
680
+ readonly 'preset/purpose': "A preset purpose slot is unmapped, unknown, or mapped to an undeclared purpose.";
681
+ readonly 'preset/parameter': "A preset parameter is missing, unknown or of the wrong shape.";
682
+ readonly 'preset/id-collision': "An id a preset expands to is already used by another entry.";
683
+ readonly 'preset/override': "An `ids`, `exclude` or `overrides` entry does not match the preset.";
684
+ };
685
+ type RuleCode = keyof typeof RULES;
686
+ interface ValidationError {
687
+ /** Stable machine-readable code; see `RULES`. */
688
+ rule: RuleCode;
689
+ /** JSON pointer into the registry, e.g. "/artefacts/2/processor". "" is the document root. */
690
+ path: string;
691
+ /** What is wrong and how to fix it. */
692
+ message: string;
693
+ /** 1-based source position. Only set by `parseRegistry`, when the path resolves to a YAML node. */
694
+ line?: number;
695
+ column?: number;
696
+ }
697
+ type ValidationResult = {
698
+ ok: true;
699
+ /** Always a plain registry: presets, when used, are already expanded into it. */
700
+ registry: Registry;
701
+ /** Present when the source used presets: where the expanded entries came from. */
702
+ presets?: PresetReport;
703
+ } | {
704
+ ok: false;
705
+ errors: ValidationError[];
706
+ };
707
+
708
+ declare const registrySchema: {
709
+ $schema: string;
710
+ title: string;
711
+ type: string;
712
+ additionalProperties: boolean;
713
+ required: string[];
714
+ properties: {
715
+ version: {
716
+ description: string;
717
+ const: number;
718
+ };
719
+ controller: {
720
+ $ref: string;
721
+ };
722
+ locales: {
723
+ type: string;
724
+ minItems: number;
725
+ uniqueItems: boolean;
726
+ items: {
727
+ type: string;
728
+ pattern: string;
729
+ };
730
+ };
731
+ defaultLocale: {
732
+ type: string;
733
+ pattern: string;
734
+ };
735
+ purposes: {
736
+ type: string;
737
+ items: {
738
+ $ref: string;
739
+ };
740
+ };
741
+ processors: {
742
+ type: string;
743
+ items: {
744
+ $ref: string;
745
+ };
746
+ };
747
+ artefacts: {
748
+ type: string;
749
+ items: {
750
+ $ref: string;
751
+ };
752
+ };
753
+ collectionPoints: {
754
+ type: string;
755
+ items: {
756
+ $ref: string;
757
+ };
758
+ };
759
+ dataCategories: {
760
+ description: string;
761
+ type: string;
762
+ propertyNames: {
763
+ pattern: string;
764
+ };
765
+ additionalProperties: {
766
+ $ref: string;
767
+ };
768
+ };
769
+ dataSubjectCategories: {
770
+ description: string;
771
+ type: string;
772
+ propertyNames: {
773
+ pattern: string;
774
+ };
775
+ additionalProperties: {
776
+ $ref: string;
777
+ };
778
+ };
779
+ retentionEvents: {
780
+ description: string;
781
+ type: string;
782
+ propertyNames: {
783
+ pattern: string;
784
+ };
785
+ additionalProperties: {
786
+ $ref: string;
787
+ };
788
+ };
789
+ securityMeasures: {
790
+ description: string;
791
+ $ref: string;
792
+ };
793
+ csp: {
794
+ $ref: string;
795
+ };
796
+ receipts: {
797
+ $ref: string;
798
+ };
799
+ subjectRequests: {
800
+ $ref: string;
801
+ };
802
+ presets: {
803
+ description: string;
804
+ type: string;
805
+ items: {
806
+ $ref: string;
807
+ };
808
+ };
809
+ };
810
+ definitions: {
811
+ localizedText: {
812
+ description: string;
813
+ type: string;
814
+ minProperties: number;
815
+ propertyNames: {
816
+ pattern: string;
817
+ };
818
+ additionalProperties: {
819
+ type: string;
820
+ minLength: number;
821
+ };
822
+ };
823
+ controller: {
824
+ type: string;
825
+ additionalProperties: boolean;
826
+ required: string[];
827
+ properties: {
828
+ name: {
829
+ type: string;
830
+ minLength: number;
831
+ };
832
+ contact: {
833
+ type: string;
834
+ minLength: number;
835
+ };
836
+ address: {
837
+ type: string;
838
+ minLength: number;
839
+ };
840
+ dpo: {
841
+ description: string;
842
+ oneOf: ({
843
+ const: boolean;
844
+ type?: undefined;
845
+ additionalProperties?: undefined;
846
+ required?: undefined;
847
+ properties?: undefined;
848
+ } | {
849
+ type: string;
850
+ additionalProperties: boolean;
851
+ required: string[];
852
+ properties: {
853
+ name: {
854
+ type: string;
855
+ minLength: number;
856
+ };
857
+ contact: {
858
+ type: string;
859
+ minLength: number;
860
+ };
861
+ };
862
+ const?: undefined;
863
+ })[];
864
+ };
865
+ supervisoryAuthority: {
866
+ description: string;
867
+ type: string;
868
+ additionalProperties: boolean;
869
+ required: string[];
870
+ properties: {
871
+ name: {
872
+ type: string;
873
+ minLength: number;
874
+ };
875
+ url: {
876
+ type: string;
877
+ minLength: number;
878
+ };
879
+ address: {
880
+ type: string;
881
+ minLength: number;
882
+ };
883
+ };
884
+ };
885
+ euRepresentative: {
886
+ description: string;
887
+ type: string;
888
+ additionalProperties: boolean;
889
+ required: string[];
890
+ properties: {
891
+ name: {
892
+ type: string;
893
+ minLength: number;
894
+ };
895
+ contact: {
896
+ type: string;
897
+ minLength: number;
898
+ };
899
+ address: {
900
+ type: string;
901
+ minLength: number;
902
+ };
903
+ };
904
+ };
905
+ };
906
+ };
907
+ dataCategory: {
908
+ type: string;
909
+ additionalProperties: boolean;
910
+ required: string[];
911
+ properties: {
912
+ title: {
913
+ $ref: string;
914
+ };
915
+ special: {
916
+ description: string;
917
+ type: string;
918
+ };
919
+ };
920
+ };
921
+ dataSubjectCategory: {
922
+ type: string;
923
+ additionalProperties: boolean;
924
+ required: string[];
925
+ properties: {
926
+ title: {
927
+ $ref: string;
928
+ };
929
+ };
930
+ };
931
+ purpose: {
932
+ type: string;
933
+ additionalProperties: boolean;
934
+ required: string[];
935
+ properties: {
936
+ id: {
937
+ type: string;
938
+ pattern: string;
939
+ };
940
+ version: {
941
+ description: string;
942
+ type: string;
943
+ minimum: number;
944
+ };
945
+ basis: {
946
+ enum: string[];
947
+ };
948
+ title: {
949
+ $ref: string;
950
+ };
951
+ description: {
952
+ $ref: string;
953
+ };
954
+ dataCategories: {
955
+ type: string;
956
+ uniqueItems: boolean;
957
+ items: {
958
+ type: string;
959
+ minLength: number;
960
+ };
961
+ };
962
+ retention: {
963
+ description: string;
964
+ type: string;
965
+ pattern: string;
966
+ };
967
+ default: {
968
+ description: string;
969
+ enum: string[];
970
+ };
971
+ legitimateInterest: {
972
+ description: string;
973
+ $ref: string;
974
+ };
975
+ automatedDecisionMaking: {
976
+ description: string;
977
+ oneOf: ({
978
+ const: boolean;
979
+ type?: undefined;
980
+ additionalProperties?: undefined;
981
+ required?: undefined;
982
+ properties?: undefined;
983
+ } | {
984
+ type: string;
985
+ additionalProperties: boolean;
986
+ required: string[];
987
+ properties: {
988
+ logic: {
989
+ $ref: string;
990
+ };
991
+ consequences: {
992
+ $ref: string;
993
+ };
994
+ };
995
+ const?: undefined;
996
+ })[];
997
+ };
998
+ dataSubjects: {
999
+ description: string;
1000
+ type: string;
1001
+ minItems: number;
1002
+ uniqueItems: boolean;
1003
+ items: {
1004
+ type: string;
1005
+ pattern: string;
1006
+ };
1007
+ };
1008
+ processors: {
1009
+ description: string;
1010
+ type: string;
1011
+ uniqueItems: boolean;
1012
+ items: {
1013
+ type: string;
1014
+ pattern: string;
1015
+ };
1016
+ };
1017
+ };
1018
+ };
1019
+ processor: {
1020
+ type: string;
1021
+ additionalProperties: boolean;
1022
+ required: string[];
1023
+ properties: {
1024
+ id: {
1025
+ type: string;
1026
+ pattern: string;
1027
+ };
1028
+ name: {
1029
+ type: string;
1030
+ minLength: number;
1031
+ };
1032
+ role: {
1033
+ description: string;
1034
+ enum: string[];
1035
+ };
1036
+ legalEntity: {
1037
+ type: string;
1038
+ minLength: number;
1039
+ };
1040
+ country: {
1041
+ description: string;
1042
+ type: string;
1043
+ pattern: string;
1044
+ };
1045
+ firstParty: {
1046
+ type: string;
1047
+ };
1048
+ transferMechanism: {
1049
+ description: string;
1050
+ enum: string[];
1051
+ };
1052
+ dpaUrl: {
1053
+ type: string;
1054
+ minLength: number;
1055
+ };
1056
+ privacyUrl: {
1057
+ type: string;
1058
+ minLength: number;
1059
+ };
1060
+ subjectRequestProcess: {
1061
+ type: string;
1062
+ minLength: number;
1063
+ };
1064
+ };
1065
+ };
1066
+ artefact: {
1067
+ type: string;
1068
+ required: string[];
1069
+ properties: {
1070
+ kind: {
1071
+ enum: ("script" | "cookie" | "storage" | "iframe" | "pixel" | "endpoint" | "stylesheet" | "font" | "media")[];
1072
+ };
1073
+ };
1074
+ allOf: {
1075
+ if: {
1076
+ properties: {
1077
+ kind: {
1078
+ const: "script" | "cookie" | "storage" | "iframe" | "pixel" | "endpoint" | "stylesheet" | "font" | "media";
1079
+ };
1080
+ };
1081
+ required: string[];
1082
+ };
1083
+ then: {
1084
+ $ref: string;
1085
+ };
1086
+ }[];
1087
+ };
1088
+ scriptArtefact: {
1089
+ type: string;
1090
+ additionalProperties: boolean;
1091
+ required: string[];
1092
+ properties: {
1093
+ id: {
1094
+ type: string;
1095
+ pattern: string;
1096
+ };
1097
+ kind: {
1098
+ const: "script" | "cookie" | "storage" | "iframe" | "pixel" | "endpoint" | "stylesheet" | "font" | "media";
1099
+ };
1100
+ purposes: {
1101
+ description: string;
1102
+ type: string;
1103
+ minItems: number;
1104
+ uniqueItems: boolean;
1105
+ items: {
1106
+ type: string;
1107
+ pattern: string;
1108
+ };
1109
+ };
1110
+ processor: {
1111
+ description: string;
1112
+ type: string;
1113
+ pattern: string;
1114
+ };
1115
+ description: {
1116
+ $ref: string;
1117
+ };
1118
+ };
1119
+ };
1120
+ cookieArtefact: {
1121
+ type: string;
1122
+ additionalProperties: boolean;
1123
+ required: string[];
1124
+ properties: {
1125
+ id: {
1126
+ type: string;
1127
+ pattern: string;
1128
+ };
1129
+ kind: {
1130
+ const: "script" | "cookie" | "storage" | "iframe" | "pixel" | "endpoint" | "stylesheet" | "font" | "media";
1131
+ };
1132
+ purposes: {
1133
+ description: string;
1134
+ type: string;
1135
+ minItems: number;
1136
+ uniqueItems: boolean;
1137
+ items: {
1138
+ type: string;
1139
+ pattern: string;
1140
+ };
1141
+ };
1142
+ processor: {
1143
+ description: string;
1144
+ type: string;
1145
+ pattern: string;
1146
+ };
1147
+ description: {
1148
+ $ref: string;
1149
+ };
1150
+ };
1151
+ };
1152
+ storageArtefact: {
1153
+ type: string;
1154
+ additionalProperties: boolean;
1155
+ required: string[];
1156
+ properties: {
1157
+ id: {
1158
+ type: string;
1159
+ pattern: string;
1160
+ };
1161
+ kind: {
1162
+ const: "script" | "cookie" | "storage" | "iframe" | "pixel" | "endpoint" | "stylesheet" | "font" | "media";
1163
+ };
1164
+ purposes: {
1165
+ description: string;
1166
+ type: string;
1167
+ minItems: number;
1168
+ uniqueItems: boolean;
1169
+ items: {
1170
+ type: string;
1171
+ pattern: string;
1172
+ };
1173
+ };
1174
+ processor: {
1175
+ description: string;
1176
+ type: string;
1177
+ pattern: string;
1178
+ };
1179
+ description: {
1180
+ $ref: string;
1181
+ };
1182
+ };
1183
+ };
1184
+ iframeArtefact: {
1185
+ type: string;
1186
+ additionalProperties: boolean;
1187
+ required: string[];
1188
+ properties: {
1189
+ id: {
1190
+ type: string;
1191
+ pattern: string;
1192
+ };
1193
+ kind: {
1194
+ const: "script" | "cookie" | "storage" | "iframe" | "pixel" | "endpoint" | "stylesheet" | "font" | "media";
1195
+ };
1196
+ purposes: {
1197
+ description: string;
1198
+ type: string;
1199
+ minItems: number;
1200
+ uniqueItems: boolean;
1201
+ items: {
1202
+ type: string;
1203
+ pattern: string;
1204
+ };
1205
+ };
1206
+ processor: {
1207
+ description: string;
1208
+ type: string;
1209
+ pattern: string;
1210
+ };
1211
+ description: {
1212
+ $ref: string;
1213
+ };
1214
+ };
1215
+ };
1216
+ pixelArtefact: {
1217
+ type: string;
1218
+ additionalProperties: boolean;
1219
+ required: string[];
1220
+ properties: {
1221
+ id: {
1222
+ type: string;
1223
+ pattern: string;
1224
+ };
1225
+ kind: {
1226
+ const: "script" | "cookie" | "storage" | "iframe" | "pixel" | "endpoint" | "stylesheet" | "font" | "media";
1227
+ };
1228
+ purposes: {
1229
+ description: string;
1230
+ type: string;
1231
+ minItems: number;
1232
+ uniqueItems: boolean;
1233
+ items: {
1234
+ type: string;
1235
+ pattern: string;
1236
+ };
1237
+ };
1238
+ processor: {
1239
+ description: string;
1240
+ type: string;
1241
+ pattern: string;
1242
+ };
1243
+ description: {
1244
+ $ref: string;
1245
+ };
1246
+ };
1247
+ };
1248
+ endpointArtefact: {
1249
+ type: string;
1250
+ additionalProperties: boolean;
1251
+ required: string[];
1252
+ properties: {
1253
+ id: {
1254
+ type: string;
1255
+ pattern: string;
1256
+ };
1257
+ kind: {
1258
+ const: "script" | "cookie" | "storage" | "iframe" | "pixel" | "endpoint" | "stylesheet" | "font" | "media";
1259
+ };
1260
+ purposes: {
1261
+ description: string;
1262
+ type: string;
1263
+ minItems: number;
1264
+ uniqueItems: boolean;
1265
+ items: {
1266
+ type: string;
1267
+ pattern: string;
1268
+ };
1269
+ };
1270
+ processor: {
1271
+ description: string;
1272
+ type: string;
1273
+ pattern: string;
1274
+ };
1275
+ description: {
1276
+ $ref: string;
1277
+ };
1278
+ };
1279
+ };
1280
+ stylesheetArtefact: {
1281
+ type: string;
1282
+ additionalProperties: boolean;
1283
+ required: string[];
1284
+ properties: {
1285
+ id: {
1286
+ type: string;
1287
+ pattern: string;
1288
+ };
1289
+ kind: {
1290
+ const: "script" | "cookie" | "storage" | "iframe" | "pixel" | "endpoint" | "stylesheet" | "font" | "media";
1291
+ };
1292
+ purposes: {
1293
+ description: string;
1294
+ type: string;
1295
+ minItems: number;
1296
+ uniqueItems: boolean;
1297
+ items: {
1298
+ type: string;
1299
+ pattern: string;
1300
+ };
1301
+ };
1302
+ processor: {
1303
+ description: string;
1304
+ type: string;
1305
+ pattern: string;
1306
+ };
1307
+ description: {
1308
+ $ref: string;
1309
+ };
1310
+ };
1311
+ };
1312
+ fontArtefact: {
1313
+ type: string;
1314
+ additionalProperties: boolean;
1315
+ required: string[];
1316
+ properties: {
1317
+ id: {
1318
+ type: string;
1319
+ pattern: string;
1320
+ };
1321
+ kind: {
1322
+ const: "script" | "cookie" | "storage" | "iframe" | "pixel" | "endpoint" | "stylesheet" | "font" | "media";
1323
+ };
1324
+ purposes: {
1325
+ description: string;
1326
+ type: string;
1327
+ minItems: number;
1328
+ uniqueItems: boolean;
1329
+ items: {
1330
+ type: string;
1331
+ pattern: string;
1332
+ };
1333
+ };
1334
+ processor: {
1335
+ description: string;
1336
+ type: string;
1337
+ pattern: string;
1338
+ };
1339
+ description: {
1340
+ $ref: string;
1341
+ };
1342
+ };
1343
+ };
1344
+ mediaArtefact: {
1345
+ type: string;
1346
+ additionalProperties: boolean;
1347
+ required: string[];
1348
+ properties: {
1349
+ id: {
1350
+ type: string;
1351
+ pattern: string;
1352
+ };
1353
+ kind: {
1354
+ const: "script" | "cookie" | "storage" | "iframe" | "pixel" | "endpoint" | "stylesheet" | "font" | "media";
1355
+ };
1356
+ purposes: {
1357
+ description: string;
1358
+ type: string;
1359
+ minItems: number;
1360
+ uniqueItems: boolean;
1361
+ items: {
1362
+ type: string;
1363
+ pattern: string;
1364
+ };
1365
+ };
1366
+ processor: {
1367
+ description: string;
1368
+ type: string;
1369
+ pattern: string;
1370
+ };
1371
+ description: {
1372
+ $ref: string;
1373
+ };
1374
+ };
1375
+ };
1376
+ csp: {
1377
+ description: string;
1378
+ type: string;
1379
+ additionalProperties: boolean;
1380
+ properties: {
1381
+ allow: {
1382
+ description: string;
1383
+ type: string;
1384
+ items: {
1385
+ type: string;
1386
+ additionalProperties: boolean;
1387
+ required: string[];
1388
+ properties: {
1389
+ directive: {
1390
+ description: string;
1391
+ type: string;
1392
+ };
1393
+ sources: {
1394
+ description: string;
1395
+ type: string;
1396
+ minItems: number;
1397
+ uniqueItems: boolean;
1398
+ items: {
1399
+ type: string;
1400
+ minLength: number;
1401
+ };
1402
+ };
1403
+ reason: {
1404
+ description: string;
1405
+ type: string;
1406
+ minLength: number;
1407
+ };
1408
+ };
1409
+ };
1410
+ };
1411
+ reportOnly: {
1412
+ description: string;
1413
+ type: string;
1414
+ };
1415
+ reportUri: {
1416
+ description: string;
1417
+ type: string;
1418
+ minLength: number;
1419
+ };
1420
+ reportTo: {
1421
+ description: string;
1422
+ type: string;
1423
+ pattern: string;
1424
+ };
1425
+ upgradeInsecureRequests: {
1426
+ description: string;
1427
+ type: string;
1428
+ };
1429
+ };
1430
+ };
1431
+ receipts: {
1432
+ oneOf: {
1433
+ required: string[];
1434
+ }[];
1435
+ description: string;
1436
+ type: string;
1437
+ additionalProperties: boolean;
1438
+ properties: {
1439
+ endpoint: {
1440
+ description: string;
1441
+ type: string;
1442
+ minLength: number;
1443
+ };
1444
+ optOut: {
1445
+ description: string;
1446
+ type: string;
1447
+ additionalProperties: boolean;
1448
+ required: string[];
1449
+ properties: {
1450
+ reason: {
1451
+ description: string;
1452
+ type: string;
1453
+ minLength: number;
1454
+ };
1455
+ };
1456
+ };
1457
+ };
1458
+ };
1459
+ subjectRequests: {
1460
+ description: string;
1461
+ type: string;
1462
+ additionalProperties: boolean;
1463
+ required: string[];
1464
+ properties: {
1465
+ endpoint: {
1466
+ description: string;
1467
+ type: string;
1468
+ minLength: number;
1469
+ };
1470
+ notify: {
1471
+ description: string;
1472
+ type: string;
1473
+ minLength: number;
1474
+ };
1475
+ types: {
1476
+ description: string;
1477
+ type: string;
1478
+ minItems: number;
1479
+ uniqueItems: boolean;
1480
+ items: {
1481
+ type: string;
1482
+ minLength: number;
1483
+ };
1484
+ };
1485
+ retention: {
1486
+ description: string;
1487
+ type: string;
1488
+ minLength: number;
1489
+ };
1490
+ requesterEmail: {
1491
+ description: string;
1492
+ type: string;
1493
+ additionalProperties: boolean;
1494
+ required: string[];
1495
+ properties: {
1496
+ processor: {
1497
+ description: string;
1498
+ type: string;
1499
+ pattern: string;
1500
+ };
1501
+ };
1502
+ };
1503
+ };
1504
+ };
1505
+ collectionPoint: {
1506
+ type: string;
1507
+ additionalProperties: boolean;
1508
+ required: string[];
1509
+ properties: {
1510
+ id: {
1511
+ type: string;
1512
+ pattern: string;
1513
+ };
1514
+ title: {
1515
+ $ref: string;
1516
+ };
1517
+ description: {
1518
+ description: string;
1519
+ type: string;
1520
+ minLength: number;
1521
+ };
1522
+ fields: {
1523
+ type: string;
1524
+ items: {
1525
+ $ref: string;
1526
+ };
1527
+ };
1528
+ };
1529
+ };
1530
+ presetUse: {
1531
+ type: string;
1532
+ additionalProperties: boolean;
1533
+ required: string[];
1534
+ properties: {
1535
+ use: {
1536
+ description: string;
1537
+ type: string;
1538
+ pattern: string;
1539
+ };
1540
+ version: {
1541
+ description: string;
1542
+ type: string[];
1543
+ };
1544
+ purpose: {
1545
+ description: string;
1546
+ type: string;
1547
+ pattern: string;
1548
+ };
1549
+ purposes: {
1550
+ description: string;
1551
+ type: string;
1552
+ additionalProperties: {
1553
+ type: string;
1554
+ pattern: string;
1555
+ };
1556
+ };
1557
+ with: {
1558
+ description: string;
1559
+ type: string;
1560
+ additionalProperties: {
1561
+ type: string[];
1562
+ };
1563
+ };
1564
+ ids: {
1565
+ description: string;
1566
+ type: string;
1567
+ additionalProperties: {
1568
+ type: string;
1569
+ pattern: string;
1570
+ };
1571
+ };
1572
+ exclude: {
1573
+ description: string;
1574
+ type: string;
1575
+ uniqueItems: boolean;
1576
+ items: {
1577
+ type: string;
1578
+ pattern: string;
1579
+ };
1580
+ };
1581
+ overrides: {
1582
+ description: string;
1583
+ type: string;
1584
+ additionalProperties: boolean;
1585
+ properties: {
1586
+ processor: {
1587
+ type: string;
1588
+ };
1589
+ artefacts: {
1590
+ type: string;
1591
+ additionalProperties: {
1592
+ type: string;
1593
+ };
1594
+ };
1595
+ };
1596
+ };
1597
+ };
1598
+ };
1599
+ collectionField: {
1600
+ type: string;
1601
+ additionalProperties: boolean;
1602
+ required: string[];
1603
+ properties: {
1604
+ name: {
1605
+ type: string;
1606
+ minLength: number;
1607
+ };
1608
+ purpose: {
1609
+ description: string;
1610
+ type: string;
1611
+ pattern: string;
1612
+ };
1613
+ required: {
1614
+ type: string;
1615
+ };
1616
+ notice: {
1617
+ $ref: string;
1618
+ };
1619
+ provision: {
1620
+ description: string;
1621
+ enum: string[];
1622
+ };
1623
+ consequence: {
1624
+ description: string;
1625
+ $ref: string;
1626
+ };
1627
+ };
1628
+ };
1629
+ };
1630
+ };
1631
+
1632
+ interface ValidateOptions {
1633
+ /**
1634
+ * The preset catalogue the registry's `presets` entries are resolved against
1635
+ * (`@consent-kit/presets` exports the built-in one, and a `parseRegistry`
1636
+ * already bound to it). Without it, a registry that uses presets is invalid.
1637
+ */
1638
+ presets?: PresetCatalogue;
1639
+ }
1640
+ /**
1641
+ * Validates an already-parsed registry (e.g. the result of a YAML parse).
1642
+ * Never throws for invalid input. Schema errors are reported first; the
1643
+ * semantic rules only run once the structure is sound.
1644
+ *
1645
+ * A registry that adopts presets is expanded first (`resolvePresets`), and the
1646
+ * expanded registry is what gets validated and returned: `registry` is always
1647
+ * plain, and `presets` says where its expanded entries came from.
1648
+ */
1649
+ declare function validateRegistry(input: unknown, options?: ValidateOptions): ValidationResult;
1650
+ /**
1651
+ * Parses the text of a `privacy.registry.yaml` and validates it.
1652
+ * Never throws for invalid input. Errors carry `line`/`column` where the
1653
+ * path can be traced back to the source.
1654
+ */
1655
+ declare function parseRegistry(yamlText: string, options?: ValidateOptions): ValidationResult;
1656
+
1657
+ type PresetResolution = ({
1658
+ ok: true;
1659
+ registry: Registry;
1660
+ } & PresetReport) | {
1661
+ ok: false;
1662
+ errors: ValidationError[];
1663
+ };
1664
+ /** Parses "1.2.3". Null for anything else. */
1665
+ declare function parseSemver(version: string): [number, number, number] | null;
1666
+ /** Ascending semver order. Versions that do not parse sort first. */
1667
+ declare function compareSemver(a: string, b: string): number;
1668
+ /** The definition a `use` / `version` pair selects: the newest of a major, or the exact version. */
1669
+ declare function selectPreset(catalogue: PresetCatalogue, id: string, version: number | string): PresetDefinition | undefined;
1670
+ /** Fills a fixture's or snippet's `${parameter}` placeholders. Unknown placeholders are left as written. */
1671
+ declare function fillPlaceholders(text: string, parameters: Record<string, string>): string;
1672
+ /**
1673
+ * Expands the `presets` list of a registry source into ordinary processors and
1674
+ * artefacts, appended after the hand-written ones. Pure; never throws.
1675
+ *
1676
+ * Expects a source that already passed the JSON Schema. The result is a plain
1677
+ * `Registry` (no `presets` key) that still has to pass the ordinary validation:
1678
+ * an override can make an entry invalid like any hand-written one.
1679
+ *
1680
+ * `applied` says which preset and version every expanded entry came from;
1681
+ * `overrides` lists every local deviation from a documented default.
1682
+ */
1683
+ declare function resolvePresets(source: RegistrySource, catalogue: PresetCatalogue): PresetResolution;
1684
+ /** The preset use an expanded processor or artefact came from, or undefined for a hand-written entry. */
1685
+ declare function presetOrigin(applied: readonly AppliedPreset[], section: 'processors' | 'artefacts', id: string): AppliedPreset | undefined;
1686
+
1687
+ /**
1688
+ * Vague purpose text.
1689
+ *
1690
+ * The EDPB rejects purposes such as "improving users' experience" or
1691
+ * "marketing purposes" as not specific enough for valid consent. We fail a
1692
+ * consent purpose whose description is *nothing more than* one of the stock
1693
+ * phrases below. The match is deliberately conservative: the description is
1694
+ * normalised (lower-cased, punctuation and filler words removed) and must then
1695
+ * equal a normalised phrase in full. A sentence that says something specific
1696
+ * and merely contains the word "analytics" passes.
1697
+ *
1698
+ * Keep this list short. Add a phrase only when it is a recognisable stock
1699
+ * formula, not because it is merely short.
1700
+ */
1701
+ declare const VAGUE_PURPOSE_PHRASES: readonly string[];
1702
+ /**
1703
+ * Returns the stock phrase the text amounts to, or `undefined` when the text
1704
+ * says something more specific.
1705
+ */
1706
+ declare function matchVaguePhrase(text: string): string | undefined;
1707
+ /**
1708
+ * Stock non-reasons, for fields that require a reason (`receipts.optOut.reason`).
1709
+ * Same rule as the purpose phrases: the reason fails only when it amounts to
1710
+ * nothing more than one of these, after normalising. Keep this list short too.
1711
+ */
1712
+ declare const VAGUE_REASON_PHRASES: readonly string[];
1713
+ /**
1714
+ * Returns the stock phrase a reason amounts to ("" for a reason of punctuation and
1715
+ * filler words only), or `undefined` when it says something.
1716
+ */
1717
+ declare function matchVagueReason(text: string): string | undefined;
1718
+
1719
+ /**
1720
+ * String formats shared by the JSON Schema (as `pattern`) and the validator.
1721
+ */
1722
+ /** Ids: lowercase, start with a letter, then letters, digits, "_" or "-". */
1723
+ declare const ID_PATTERN: RegExp;
1724
+ /** "session", "until-withdrawn", "<n>d", "<n>y", or either of the last two followed by "-after-<event>". */
1725
+ declare const RETENTION_PATTERN: RegExp;
1726
+ /** How long a closed subject request is kept: "<n>d" or "<n>y", counted from its closing. */
1727
+ declare const SUBJECT_REQUEST_RETENTION_PATTERN: RegExp;
1728
+ /**
1729
+ * An email address as consent-kit accepts it in the registry and in a subject request: one
1730
+ * "@", a local part of printable ASCII without spaces, quotes, angle brackets or commas, and a
1731
+ * domain of at least two dot-separated labels. Deliberately narrower than RFC 5322: an address
1732
+ * that needs quoting is not one a request form should take, and nothing here may smuggle a
1733
+ * second header or recipient into an email.
1734
+ */
1735
+ declare const EMAIL_PATTERN: RegExp;
1736
+ /** The longest email address accepted (RFC 5321's path limit, less the angle brackets). */
1737
+ declare const MAX_EMAIL_LENGTH = 254;
1738
+ /** "session" or "<n>d". */
1739
+ declare const COOKIE_DURATION_PATTERN: RegExp;
1740
+ /** The directives of the generated Content-Security-Policy that a registry may loosen. */
1741
+ declare const CSP_DIRECTIVES: readonly ["default-src", "script-src", "style-src", "font-src", "img-src", "connect-src", "frame-src", "media-src", "worker-src", "manifest-src", "object-src", "base-uri", "form-action", "frame-ancestors"];
1742
+ /**
1743
+ * True for one well-formed CSP source expression: a quoted keyword, a nonce or hash, a
1744
+ * scheme ("data:"), or a host with optional scheme, wildcard, port and path. Anything with
1745
+ * whitespace, ";" or "," is refused, so a value can never smuggle in another directive.
1746
+ */
1747
+ declare function isCspSource(value: string): boolean;
1748
+ /**
1749
+ * EU-27 plus the EEA states Iceland, Liechtenstein and Norway.
1750
+ * A processor in any other country needs a `transferMechanism`.
1751
+ */
1752
+ declare const EEA_COUNTRIES: ReadonlySet<string>;
1753
+ /**
1754
+ * Where a declared URL points, decided the way a browser decides it: by parsing, never by
1755
+ * looking at the first characters.
1756
+ *
1757
+ * - `site`: a site-relative path (starts with one "/", resolves to the site's own origin).
1758
+ * - `remote`: anything that resolves to another origin, including "//host/…". `url` is
1759
+ * the parsed URL; its protocol is not checked here.
1760
+ * - `invalid`: not usable as a declaration. Backslashes, whitespace and control characters
1761
+ * are refused outright: browsers read "/\\host" as "//host" and strip tabs and line
1762
+ * breaks, so such a value names a different place than it appears to. A path that does
1763
+ * not start with "/" is refused too, because it would resolve against each page's URL.
1764
+ */
1765
+ type UrlLocation = {
1766
+ where: 'site';
1767
+ pathname: string;
1768
+ } | {
1769
+ where: 'remote';
1770
+ url: URL;
1771
+ } | {
1772
+ where: 'invalid';
1773
+ problem: string;
1774
+ };
1775
+ declare function locateUrl(value: string): UrlLocation;
1776
+ /** True for an http(s) URL on another origin than the site: "https://host/…" and "//host/…". Decided by parsing. */
1777
+ declare function isAbsoluteUrl(value: string): boolean;
1778
+ /**
1779
+ * THE path-prefix rule, shared by everything that asks "is this URL under that declared
1780
+ * one": the guard manifest's matching contract (guard runtime, audit), `consentEmbed`, and
1781
+ * the validator. Whole path segments only:
1782
+ *
1783
+ * - the paths are equal, or
1784
+ * - the declared path ends in "/" and the target starts with it, or
1785
+ * - the target continues the declared path with a "/".
1786
+ *
1787
+ * So "/collect" covers "/collect" and "/collect/x" (and "/collect?x=1", whose pathname is
1788
+ * "/collect"), but neither "/collector" nor "/collect-evil"; "/collect/" covers
1789
+ * "/collect/x" but not "/collect". A bare origin has the path "/", which ends in "/" and
1790
+ * therefore covers every path on the origin, as does the site-relative prefix "/".
1791
+ */
1792
+ declare function pathCovers(declaredPath: string, targetPath: string): boolean;
1793
+
1794
+ /** Ascending severity. A human override may move a change up this list, never down. */
1795
+ declare const CLASSIFICATIONS: readonly ["not_material", "needs_confirmation", "material", "needs_review"];
1796
+ /**
1797
+ * - `not_material`: changelog only.
1798
+ * - `needs_confirmation`: presumed non-material (typo, translation, metadata); a person confirms
1799
+ * with one click.
1800
+ * - `material`: alters what the user was told. Requires a purpose version bump; re-consent for
1801
+ * consent purposes, a notice update for the others.
1802
+ * - `needs_review`: material, and the build is blocked until a person has reviewed it.
1803
+ */
1804
+ type Classification = (typeof CLASSIFICATIONS)[number];
1805
+ declare function severity(classification: Classification): number;
1806
+ declare function isClassification(value: unknown): value is Classification;
1807
+ declare function strictest(a: Classification, b: Classification): Classification;
1808
+ /** True for `material` and `needs_review`: the classifications that force a version bump. */
1809
+ declare function isMaterial(classification: Classification): boolean;
1810
+ /** Default classification of a change kind, one per column of the spec's material-change table. */
1811
+ interface ClassificationRule {
1812
+ /** Applied to affected purposes whose basis is (or was) consent. */
1813
+ consent: Classification;
1814
+ /** Applied to affected purposes on any other lawful basis. */
1815
+ nonConsent: Classification;
1816
+ }
1817
+ /**
1818
+ * Every change kind `diffRegistry` can emit, with its default classification per column.
1819
+ * The kind alone decides the default; the affected purposes' bases pick the column.
1820
+ */
1821
+ declare const CHANGE_KINDS: {
1822
+ readonly 'registry.format_version_changed': {
1823
+ readonly consent: "material";
1824
+ readonly nonConsent: "material";
1825
+ };
1826
+ readonly 'registry.locale_added': {
1827
+ readonly consent: "not_material";
1828
+ readonly nonConsent: "not_material";
1829
+ };
1830
+ readonly 'registry.locale_removed': {
1831
+ readonly consent: "not_material";
1832
+ readonly nonConsent: "not_material";
1833
+ };
1834
+ readonly 'registry.default_locale_changed': {
1835
+ readonly consent: "not_material";
1836
+ readonly nonConsent: "not_material";
1837
+ };
1838
+ readonly 'registry.unclassified_changed': {
1839
+ readonly consent: "material";
1840
+ readonly nonConsent: "material";
1841
+ };
1842
+ /** Name, contact, address. */
1843
+ readonly 'controller.changed': {
1844
+ readonly consent: "material";
1845
+ readonly nonConsent: "material";
1846
+ };
1847
+ readonly 'controller.dpo_changed': {
1848
+ readonly consent: "needs_confirmation";
1849
+ readonly nonConsent: "material";
1850
+ };
1851
+ readonly 'controller.supervisory_authority_changed': {
1852
+ readonly consent: "needs_confirmation";
1853
+ readonly nonConsent: "material";
1854
+ };
1855
+ readonly 'controller.eu_representative_changed': {
1856
+ readonly consent: "needs_confirmation";
1857
+ readonly nonConsent: "material";
1858
+ };
1859
+ /** Internal (Art. 30 record only), but a weaker measure is not provably harmless. */
1860
+ readonly 'registry.security_measures_changed': {
1861
+ readonly consent: "needs_confirmation";
1862
+ readonly nonConsent: "needs_confirmation";
1863
+ };
1864
+ /** Glossary entries name ids; using an id is a `purpose.*` change of its own. */
1865
+ readonly 'data_category.added': {
1866
+ readonly consent: "not_material";
1867
+ readonly nonConsent: "not_material";
1868
+ };
1869
+ readonly 'data_category.removed': {
1870
+ readonly consent: "not_material";
1871
+ readonly nonConsent: "not_material";
1872
+ };
1873
+ readonly 'data_category.title_changed': {
1874
+ readonly consent: "material";
1875
+ readonly nonConsent: "material";
1876
+ };
1877
+ readonly 'data_category.title_formatting_changed': {
1878
+ readonly consent: "needs_confirmation";
1879
+ readonly nonConsent: "not_material";
1880
+ };
1881
+ readonly 'data_category.title_locale_added': {
1882
+ readonly consent: "needs_confirmation";
1883
+ readonly nonConsent: "needs_confirmation";
1884
+ };
1885
+ readonly 'data_category.title_locale_removed': {
1886
+ readonly consent: "not_material";
1887
+ readonly nonConsent: "not_material";
1888
+ };
1889
+ /** The data is now declared an Art. 9 special category: the lawful basis has to be re-examined. */
1890
+ readonly 'data_category.special_flagged': {
1891
+ readonly consent: "needs_review";
1892
+ readonly nonConsent: "needs_review";
1893
+ };
1894
+ /** No longer declared special: nothing proves the data itself changed. */
1895
+ readonly 'data_category.special_unflagged': {
1896
+ readonly consent: "needs_review";
1897
+ readonly nonConsent: "needs_review";
1898
+ };
1899
+ readonly 'data_subject_category.added': {
1900
+ readonly consent: "not_material";
1901
+ readonly nonConsent: "not_material";
1902
+ };
1903
+ readonly 'data_subject_category.removed': {
1904
+ readonly consent: "not_material";
1905
+ readonly nonConsent: "not_material";
1906
+ };
1907
+ readonly 'data_subject_category.title_changed': {
1908
+ readonly consent: "material";
1909
+ readonly nonConsent: "material";
1910
+ };
1911
+ readonly 'data_subject_category.title_formatting_changed': {
1912
+ readonly consent: "needs_confirmation";
1913
+ readonly nonConsent: "not_material";
1914
+ };
1915
+ readonly 'data_subject_category.title_locale_added': {
1916
+ readonly consent: "needs_confirmation";
1917
+ readonly nonConsent: "needs_confirmation";
1918
+ };
1919
+ readonly 'data_subject_category.title_locale_removed': {
1920
+ readonly consent: "not_material";
1921
+ readonly nonConsent: "not_material";
1922
+ };
1923
+ readonly 'retention_event.added': {
1924
+ readonly consent: "not_material";
1925
+ readonly nonConsent: "not_material";
1926
+ };
1927
+ readonly 'retention_event.removed': {
1928
+ readonly consent: "not_material";
1929
+ readonly nonConsent: "not_material";
1930
+ };
1931
+ readonly 'retention_event.description_changed': {
1932
+ readonly consent: "material";
1933
+ readonly nonConsent: "material";
1934
+ };
1935
+ readonly 'retention_event.description_formatting_changed': {
1936
+ readonly consent: "needs_confirmation";
1937
+ readonly nonConsent: "not_material";
1938
+ };
1939
+ readonly 'retention_event.description_locale_added': {
1940
+ readonly consent: "needs_confirmation";
1941
+ readonly nonConsent: "needs_confirmation";
1942
+ };
1943
+ readonly 'retention_event.description_locale_removed': {
1944
+ readonly consent: "not_material";
1945
+ readonly nonConsent: "not_material";
1946
+ };
1947
+ /**
1948
+ * The Content-Security-Policy got weaker: a source was allowed, enforcement was switched to
1949
+ * report-only, or `upgrade-insecure-requests` was dropped. Says nothing new to the visitor,
1950
+ * so nobody is asked again, but a person confirms that the loosening is wanted.
1951
+ */
1952
+ readonly 'csp.loosened': {
1953
+ readonly consent: "needs_confirmation";
1954
+ readonly nonConsent: "needs_confirmation";
1955
+ };
1956
+ readonly 'csp.tightened': {
1957
+ readonly consent: "not_material";
1958
+ readonly nonConsent: "not_material";
1959
+ };
1960
+ /** `reportUri` or `reportTo`. A third-party endpoint is a declared artefact with a diff of its own. */
1961
+ readonly 'csp.reporting_changed': {
1962
+ readonly consent: "not_material";
1963
+ readonly nonConsent: "not_material";
1964
+ };
1965
+ readonly 'csp.reason_changed': {
1966
+ readonly consent: "not_material";
1967
+ readonly nonConsent: "not_material";
1968
+ };
1969
+ /** An endpoint where there was none, or an opt-out. */
1970
+ readonly 'receipts.endpoint_declared': {
1971
+ readonly consent: "not_material";
1972
+ readonly nonConsent: "not_material";
1973
+ };
1974
+ readonly 'receipts.endpoint_changed': {
1975
+ readonly consent: "not_material";
1976
+ readonly nonConsent: "not_material";
1977
+ };
1978
+ /** The opt-out, where there was an endpoint or no statement. */
1979
+ readonly 'receipts.opted_out': {
1980
+ readonly consent: "needs_confirmation";
1981
+ readonly nonConsent: "needs_confirmation";
1982
+ };
1983
+ /** The whole section is gone (only valid without consent purposes). */
1984
+ readonly 'receipts.removed': {
1985
+ readonly consent: "needs_confirmation";
1986
+ readonly nonConsent: "needs_confirmation";
1987
+ };
1988
+ readonly 'receipts.opt_out_reason_changed': {
1989
+ readonly consent: "not_material";
1990
+ readonly nonConsent: "not_material";
1991
+ };
1992
+ /** The section where there was none: requests can now be sent through the form. */
1993
+ readonly 'subject_requests.added': {
1994
+ readonly consent: "not_material";
1995
+ readonly nonConsent: "not_material";
1996
+ };
1997
+ /** The section is gone: the form and the request records with it. */
1998
+ readonly 'subject_requests.removed': {
1999
+ readonly consent: "needs_confirmation";
2000
+ readonly nonConsent: "needs_confirmation";
2001
+ };
2002
+ readonly 'subject_requests.type_added': {
2003
+ readonly consent: "not_material";
2004
+ readonly nonConsent: "not_material";
2005
+ };
2006
+ readonly 'subject_requests.type_removed': {
2007
+ readonly consent: "needs_confirmation";
2008
+ readonly nonConsent: "needs_confirmation";
2009
+ };
2010
+ readonly 'subject_requests.retention_shorter': {
2011
+ readonly consent: "not_material";
2012
+ readonly nonConsent: "not_material";
2013
+ };
2014
+ readonly 'subject_requests.retention_longer': {
2015
+ readonly consent: "needs_confirmation";
2016
+ readonly nonConsent: "needs_confirmation";
2017
+ };
2018
+ /** Not provably shorter or longer, e.g. "365d" against "1y". */
2019
+ readonly 'subject_requests.retention_changed': {
2020
+ readonly consent: "needs_confirmation";
2021
+ readonly nonConsent: "needs_confirmation";
2022
+ };
2023
+ readonly 'subject_requests.retention_reformatted': {
2024
+ readonly consent: "not_material";
2025
+ readonly nonConsent: "not_material";
2026
+ };
2027
+ readonly 'subject_requests.endpoint_changed': {
2028
+ readonly consent: "not_material";
2029
+ readonly nonConsent: "not_material";
2030
+ };
2031
+ /** Where requests are emailed: a wrong mailbox loses them, so a person confirms. */
2032
+ readonly 'subject_requests.notify_changed': {
2033
+ readonly consent: "needs_confirmation";
2034
+ readonly nonConsent: "needs_confirmation";
2035
+ };
2036
+ /** A provider now receives the requester's address (it did not before). */
2037
+ readonly 'subject_requests.requester_email_added': {
2038
+ readonly consent: "needs_confirmation";
2039
+ readonly nonConsent: "needs_confirmation";
2040
+ };
2041
+ readonly 'subject_requests.requester_email_removed': {
2042
+ readonly consent: "not_material";
2043
+ readonly nonConsent: "not_material";
2044
+ };
2045
+ readonly 'subject_requests.requester_email_processor_changed': {
2046
+ readonly consent: "needs_confirmation";
2047
+ readonly nonConsent: "needs_confirmation";
2048
+ };
2049
+ readonly 'subject_requests.unclassified_changed': {
2050
+ readonly consent: "material";
2051
+ readonly nonConsent: "material";
2052
+ };
2053
+ readonly 'purpose.added': {
2054
+ readonly consent: "material";
2055
+ readonly nonConsent: "material";
2056
+ };
2057
+ readonly 'purpose.removed': {
2058
+ readonly consent: "not_material";
2059
+ readonly nonConsent: "not_material";
2060
+ };
2061
+ readonly 'purpose.basis_changed': {
2062
+ readonly consent: "needs_review";
2063
+ readonly nonConsent: "needs_review";
2064
+ };
2065
+ readonly 'purpose.title_changed': {
2066
+ readonly consent: "material";
2067
+ readonly nonConsent: "material";
2068
+ };
2069
+ readonly 'purpose.title_formatting_changed': {
2070
+ readonly consent: "needs_confirmation";
2071
+ readonly nonConsent: "not_material";
2072
+ };
2073
+ readonly 'purpose.title_locale_added': {
2074
+ readonly consent: "needs_confirmation";
2075
+ readonly nonConsent: "needs_confirmation";
2076
+ };
2077
+ readonly 'purpose.title_locale_removed': {
2078
+ readonly consent: "not_material";
2079
+ readonly nonConsent: "not_material";
2080
+ };
2081
+ readonly 'purpose.description_changed': {
2082
+ readonly consent: "material";
2083
+ readonly nonConsent: "material";
2084
+ };
2085
+ readonly 'purpose.description_formatting_changed': {
2086
+ readonly consent: "needs_confirmation";
2087
+ readonly nonConsent: "not_material";
2088
+ };
2089
+ readonly 'purpose.description_locale_added': {
2090
+ readonly consent: "needs_confirmation";
2091
+ readonly nonConsent: "needs_confirmation";
2092
+ };
2093
+ readonly 'purpose.description_locale_removed': {
2094
+ readonly consent: "not_material";
2095
+ readonly nonConsent: "not_material";
2096
+ };
2097
+ readonly 'purpose.data_category_added': {
2098
+ readonly consent: "material";
2099
+ readonly nonConsent: "material";
2100
+ };
2101
+ readonly 'purpose.data_category_removed': {
2102
+ readonly consent: "not_material";
2103
+ readonly nonConsent: "not_material";
2104
+ };
2105
+ readonly 'purpose.retention_longer': {
2106
+ readonly consent: "material";
2107
+ readonly nonConsent: "material";
2108
+ };
2109
+ readonly 'purpose.retention_shorter': {
2110
+ readonly consent: "not_material";
2111
+ readonly nonConsent: "not_material";
2112
+ };
2113
+ /** Not comparable (e.g. fixed vs until-withdrawn, different events). */
2114
+ readonly 'purpose.retention_changed': {
2115
+ readonly consent: "material";
2116
+ readonly nonConsent: "material";
2117
+ };
2118
+ /** Different spelling of the same duration. */
2119
+ readonly 'purpose.retention_reformatted': {
2120
+ readonly consent: "not_material";
2121
+ readonly nonConsent: "not_material";
2122
+ };
2123
+ readonly 'purpose.default_granted': {
2124
+ readonly consent: "material";
2125
+ readonly nonConsent: "material";
2126
+ };
2127
+ readonly 'purpose.default_denied': {
2128
+ readonly consent: "not_material";
2129
+ readonly nonConsent: "not_material";
2130
+ };
2131
+ /** The interest is stated where none was (only possible against a registry from before the field). */
2132
+ readonly 'purpose.legitimate_interest_added': {
2133
+ readonly consent: "material";
2134
+ readonly nonConsent: "material";
2135
+ };
2136
+ readonly 'purpose.legitimate_interest_removed': {
2137
+ readonly consent: "not_material";
2138
+ readonly nonConsent: "not_material";
2139
+ };
2140
+ readonly 'purpose.legitimate_interest_changed': {
2141
+ readonly consent: "material";
2142
+ readonly nonConsent: "material";
2143
+ };
2144
+ readonly 'purpose.legitimate_interest_formatting_changed': {
2145
+ readonly consent: "needs_confirmation";
2146
+ readonly nonConsent: "not_material";
2147
+ };
2148
+ readonly 'purpose.legitimate_interest_locale_added': {
2149
+ readonly consent: "needs_confirmation";
2150
+ readonly nonConsent: "needs_confirmation";
2151
+ };
2152
+ readonly 'purpose.legitimate_interest_locale_removed': {
2153
+ readonly consent: "not_material";
2154
+ readonly nonConsent: "not_material";
2155
+ };
2156
+ /** `false` where nothing was stated: the notice gains a sentence, the processing is the same. */
2157
+ readonly 'purpose.adm_declared_none': {
2158
+ readonly consent: "needs_confirmation";
2159
+ readonly nonConsent: "needs_confirmation";
2160
+ };
2161
+ /** Automated decision-making where there was none (or none stated). */
2162
+ readonly 'purpose.adm_introduced': {
2163
+ readonly consent: "needs_review";
2164
+ readonly nonConsent: "needs_review";
2165
+ };
2166
+ /** Its logic or consequences are described differently. */
2167
+ readonly 'purpose.adm_changed': {
2168
+ readonly consent: "material";
2169
+ readonly nonConsent: "material";
2170
+ };
2171
+ readonly 'purpose.adm_removed': {
2172
+ readonly consent: "not_material";
2173
+ readonly nonConsent: "not_material";
2174
+ };
2175
+ readonly 'purpose.data_subject_added': {
2176
+ readonly consent: "material";
2177
+ readonly nonConsent: "material";
2178
+ };
2179
+ readonly 'purpose.data_subject_removed': {
2180
+ readonly consent: "not_material";
2181
+ readonly nonConsent: "not_material";
2182
+ };
2183
+ /** A recipient listed under the purpose's `processors`. */
2184
+ readonly 'purpose.processor_added': {
2185
+ readonly consent: "material";
2186
+ readonly nonConsent: "material";
2187
+ };
2188
+ readonly 'purpose.processor_removed': {
2189
+ readonly consent: "not_material";
2190
+ readonly nonConsent: "not_material";
2191
+ };
2192
+ /** `processors` appears or disappears as an empty list: a statement, not a recipient. */
2193
+ readonly 'purpose.processors_stated': {
2194
+ readonly consent: "not_material";
2195
+ readonly nonConsent: "not_material";
2196
+ };
2197
+ readonly 'purpose.unclassified_changed': {
2198
+ readonly consent: "material";
2199
+ readonly nonConsent: "material";
2200
+ };
2201
+ readonly 'processor.added': {
2202
+ readonly consent: "material";
2203
+ readonly nonConsent: "material";
2204
+ };
2205
+ readonly 'processor.removed': {
2206
+ readonly consent: "not_material";
2207
+ readonly nonConsent: "not_material";
2208
+ };
2209
+ readonly 'processor.name_changed': {
2210
+ readonly consent: "material";
2211
+ readonly nonConsent: "material";
2212
+ };
2213
+ readonly 'processor.name_formatting_changed': {
2214
+ readonly consent: "needs_confirmation";
2215
+ readonly nonConsent: "not_material";
2216
+ };
2217
+ readonly 'processor.legal_entity_changed': {
2218
+ readonly consent: "material";
2219
+ readonly nonConsent: "material";
2220
+ };
2221
+ readonly 'processor.legal_entity_formatting_changed': {
2222
+ readonly consent: "needs_confirmation";
2223
+ readonly nonConsent: "not_material";
2224
+ };
2225
+ readonly 'processor.country_changed': {
2226
+ readonly consent: "material";
2227
+ readonly nonConsent: "material";
2228
+ };
2229
+ readonly 'processor.transfer_changed': {
2230
+ readonly consent: "material";
2231
+ readonly nonConsent: "material";
2232
+ };
2233
+ readonly 'processor.first_party_changed': {
2234
+ readonly consent: "material";
2235
+ readonly nonConsent: "material";
2236
+ };
2237
+ /** Processor, independent controller or joint controller: who decides what happens to the data. */
2238
+ readonly 'processor.role_changed': {
2239
+ readonly consent: "material";
2240
+ readonly nonConsent: "material";
2241
+ };
2242
+ /** dpaUrl, privacyUrl, subjectRequestProcess. */
2243
+ readonly 'processor.metadata_changed': {
2244
+ readonly consent: "needs_confirmation";
2245
+ readonly nonConsent: "needs_confirmation";
2246
+ };
2247
+ readonly 'processor.unclassified_changed': {
2248
+ readonly consent: "material";
2249
+ readonly nonConsent: "material";
2250
+ };
2251
+ readonly 'artefact.added': {
2252
+ readonly consent: "material";
2253
+ readonly nonConsent: "material";
2254
+ };
2255
+ readonly 'artefact.removed': {
2256
+ readonly consent: "not_material";
2257
+ readonly nonConsent: "not_material";
2258
+ };
2259
+ readonly 'artefact.kind_changed': {
2260
+ readonly consent: "material";
2261
+ readonly nonConsent: "material";
2262
+ };
2263
+ readonly 'artefact.purpose_added': {
2264
+ readonly consent: "material";
2265
+ readonly nonConsent: "material";
2266
+ };
2267
+ readonly 'artefact.purpose_removed': {
2268
+ readonly consent: "not_material";
2269
+ readonly nonConsent: "not_material";
2270
+ };
2271
+ readonly 'artefact.processor_added': {
2272
+ readonly consent: "material";
2273
+ readonly nonConsent: "material";
2274
+ };
2275
+ readonly 'artefact.processor_changed': {
2276
+ readonly consent: "material";
2277
+ readonly nonConsent: "material";
2278
+ };
2279
+ readonly 'artefact.processor_removed': {
2280
+ readonly consent: "not_material";
2281
+ readonly nonConsent: "not_material";
2282
+ };
2283
+ readonly 'artefact.description_changed': {
2284
+ readonly consent: "material";
2285
+ readonly nonConsent: "material";
2286
+ };
2287
+ readonly 'artefact.description_formatting_changed': {
2288
+ readonly consent: "needs_confirmation";
2289
+ readonly nonConsent: "not_material";
2290
+ };
2291
+ readonly 'artefact.description_locale_added': {
2292
+ readonly consent: "needs_confirmation";
2293
+ readonly nonConsent: "needs_confirmation";
2294
+ };
2295
+ readonly 'artefact.description_locale_removed': {
2296
+ readonly consent: "not_material";
2297
+ readonly nonConsent: "not_material";
2298
+ };
2299
+ /** `src` of a script, iframe, stylesheet, font or media file; `url` of a pixel or endpoint. */
2300
+ readonly 'artefact.target_changed': {
2301
+ readonly consent: "material";
2302
+ readonly nonConsent: "material";
2303
+ };
2304
+ readonly 'artefact.unclassified_changed': {
2305
+ readonly consent: "material";
2306
+ readonly nonConsent: "material";
2307
+ };
2308
+ /** A different name, or a different pattern. */
2309
+ readonly 'cookie.matcher_changed': {
2310
+ readonly consent: "material";
2311
+ readonly nonConsent: "material";
2312
+ };
2313
+ /** `name` replaced by a `pattern`. */
2314
+ readonly 'cookie.matcher_broadened': {
2315
+ readonly consent: "material";
2316
+ readonly nonConsent: "material";
2317
+ };
2318
+ /** `pattern` replaced by a `name` the old pattern matched. */
2319
+ readonly 'cookie.matcher_narrowed': {
2320
+ readonly consent: "not_material";
2321
+ readonly nonConsent: "not_material";
2322
+ };
2323
+ readonly 'cookie.duration_longer': {
2324
+ readonly consent: "material";
2325
+ readonly nonConsent: "material";
2326
+ };
2327
+ readonly 'cookie.duration_shorter': {
2328
+ readonly consent: "not_material";
2329
+ readonly nonConsent: "not_material";
2330
+ };
2331
+ readonly 'cookie.duration_changed': {
2332
+ readonly consent: "material";
2333
+ readonly nonConsent: "material";
2334
+ };
2335
+ readonly 'cookie.duration_reformatted': {
2336
+ readonly consent: "not_material";
2337
+ readonly nonConsent: "not_material";
2338
+ };
2339
+ readonly 'cookie.domain_changed': {
2340
+ readonly consent: "material";
2341
+ readonly nonConsent: "material";
2342
+ };
2343
+ /** sameSite relaxed or unset, `secure` or `httpOnly` dropped. */
2344
+ readonly 'cookie.security_loosened': {
2345
+ readonly consent: "material";
2346
+ readonly nonConsent: "material";
2347
+ };
2348
+ readonly 'cookie.security_tightened': {
2349
+ readonly consent: "not_material";
2350
+ readonly nonConsent: "not_material";
2351
+ };
2352
+ readonly 'storage.matcher_changed': {
2353
+ readonly consent: "material";
2354
+ readonly nonConsent: "material";
2355
+ };
2356
+ readonly 'storage.matcher_broadened': {
2357
+ readonly consent: "material";
2358
+ readonly nonConsent: "material";
2359
+ };
2360
+ readonly 'storage.matcher_narrowed': {
2361
+ readonly consent: "not_material";
2362
+ readonly nonConsent: "not_material";
2363
+ };
2364
+ readonly 'storage.area_changed': {
2365
+ readonly consent: "material";
2366
+ readonly nonConsent: "material";
2367
+ };
2368
+ readonly 'storage.duration_longer': {
2369
+ readonly consent: "material";
2370
+ readonly nonConsent: "material";
2371
+ };
2372
+ readonly 'storage.duration_shorter': {
2373
+ readonly consent: "not_material";
2374
+ readonly nonConsent: "not_material";
2375
+ };
2376
+ readonly 'storage.duration_changed': {
2377
+ readonly consent: "material";
2378
+ readonly nonConsent: "material";
2379
+ };
2380
+ readonly 'storage.duration_reformatted': {
2381
+ readonly consent: "not_material";
2382
+ readonly nonConsent: "not_material";
2383
+ };
2384
+ /** A lifetime where the browser default applied before: a bound, never an extension. */
2385
+ readonly 'storage.duration_declared': {
2386
+ readonly consent: "not_material";
2387
+ readonly nonConsent: "not_material";
2388
+ };
2389
+ /** Back to the browser default, which for local storage and IndexedDB is "never expires". */
2390
+ readonly 'storage.duration_removed': {
2391
+ readonly consent: "material";
2392
+ readonly nonConsent: "material";
2393
+ };
2394
+ readonly 'collection_point.added': {
2395
+ readonly consent: "material";
2396
+ readonly nonConsent: "material";
2397
+ };
2398
+ readonly 'collection_point.removed': {
2399
+ readonly consent: "not_material";
2400
+ readonly nonConsent: "not_material";
2401
+ };
2402
+ readonly 'collection_point.description_changed': {
2403
+ readonly consent: "needs_confirmation";
2404
+ readonly nonConsent: "needs_confirmation";
2405
+ };
2406
+ readonly 'collection_point.title_changed': {
2407
+ readonly consent: "material";
2408
+ readonly nonConsent: "material";
2409
+ };
2410
+ readonly 'collection_point.title_formatting_changed': {
2411
+ readonly consent: "needs_confirmation";
2412
+ readonly nonConsent: "not_material";
2413
+ };
2414
+ readonly 'collection_point.title_locale_added': {
2415
+ readonly consent: "needs_confirmation";
2416
+ readonly nonConsent: "needs_confirmation";
2417
+ };
2418
+ readonly 'collection_point.title_locale_removed': {
2419
+ readonly consent: "not_material";
2420
+ readonly nonConsent: "not_material";
2421
+ };
2422
+ readonly 'collection_point.unclassified_changed': {
2423
+ readonly consent: "material";
2424
+ readonly nonConsent: "material";
2425
+ };
2426
+ readonly 'collection_field.added': {
2427
+ readonly consent: "material";
2428
+ readonly nonConsent: "material";
2429
+ };
2430
+ readonly 'collection_field.removed': {
2431
+ readonly consent: "not_material";
2432
+ readonly nonConsent: "not_material";
2433
+ };
2434
+ /** Attributed to the field's new purpose. */
2435
+ readonly 'collection_field.purpose_changed': {
2436
+ readonly consent: "material";
2437
+ readonly nonConsent: "material";
2438
+ };
2439
+ /** Same edit, attributed to the purpose the field no longer serves. */
2440
+ readonly 'collection_field.purpose_dropped': {
2441
+ readonly consent: "not_material";
2442
+ readonly nonConsent: "not_material";
2443
+ };
2444
+ readonly 'collection_field.made_required': {
2445
+ readonly consent: "material";
2446
+ readonly nonConsent: "material";
2447
+ };
2448
+ readonly 'collection_field.made_optional': {
2449
+ readonly consent: "not_material";
2450
+ readonly nonConsent: "not_material";
2451
+ };
2452
+ readonly 'collection_field.notice_changed': {
2453
+ readonly consent: "material";
2454
+ readonly nonConsent: "material";
2455
+ };
2456
+ readonly 'collection_field.notice_formatting_changed': {
2457
+ readonly consent: "needs_confirmation";
2458
+ readonly nonConsent: "not_material";
2459
+ };
2460
+ readonly 'collection_field.notice_locale_added': {
2461
+ readonly consent: "needs_confirmation";
2462
+ readonly nonConsent: "needs_confirmation";
2463
+ };
2464
+ readonly 'collection_field.notice_locale_removed': {
2465
+ readonly consent: "not_material";
2466
+ readonly nonConsent: "not_material";
2467
+ };
2468
+ /** Stated where nothing was (a registry from before the field). */
2469
+ readonly 'collection_field.provision_stated': {
2470
+ readonly consent: "needs_confirmation";
2471
+ readonly nonConsent: "needs_confirmation";
2472
+ };
2473
+ /** statutory, contractual or voluntary changed: the visitor was told something else. */
2474
+ readonly 'collection_field.provision_changed': {
2475
+ readonly consent: "material";
2476
+ readonly nonConsent: "material";
2477
+ };
2478
+ readonly 'collection_field.consequence_changed': {
2479
+ readonly consent: "material";
2480
+ readonly nonConsent: "material";
2481
+ };
2482
+ readonly 'collection_field.consequence_formatting_changed': {
2483
+ readonly consent: "needs_confirmation";
2484
+ readonly nonConsent: "not_material";
2485
+ };
2486
+ readonly 'collection_field.consequence_locale_added': {
2487
+ readonly consent: "needs_confirmation";
2488
+ readonly nonConsent: "needs_confirmation";
2489
+ };
2490
+ readonly 'collection_field.consequence_locale_removed': {
2491
+ readonly consent: "not_material";
2492
+ readonly nonConsent: "not_material";
2493
+ };
2494
+ readonly 'collection_field.unclassified_changed': {
2495
+ readonly consent: "material";
2496
+ readonly nonConsent: "material";
2497
+ };
2498
+ };
2499
+ type ChangeKind = keyof typeof CHANGE_KINDS;
2500
+ /**
2501
+ * What a change demands for one affected purpose:
2502
+ * `human_review` (needs_review), `reconsent` (material, consent purpose),
2503
+ * `notice_update` (material, any other basis: update the Art. 13 notice and the changelog),
2504
+ * `confirmation` (needs_confirmation), `changelog` (not_material).
2505
+ */
2506
+ type Consequence = 'human_review' | 'reconsent' | 'notice_update' | 'confirmation' | 'changelog';
2507
+ interface AffectedPurpose {
2508
+ id: string;
2509
+ /** Basis in the next registry, or in the previous one when the purpose was removed. */
2510
+ basis: LawfulBasis;
2511
+ /** True when the basis is consent on either side of the diff. */
2512
+ consent: boolean;
2513
+ /** Classification of the change for this purpose, after any escalation. */
2514
+ classification: Classification;
2515
+ consequence: Consequence;
2516
+ }
2517
+ interface Change {
2518
+ /** `<kind>@<path>`. Unique within a diff and stable across runs; the key overrides refer to. */
2519
+ key: string;
2520
+ kind: ChangeKind;
2521
+ /** Where it changed, by id: e.g. `purposes.analytics.description.de`, `artefacts.ga.duration`. */
2522
+ path: string;
2523
+ /** Strictest classification over the affected purposes, after any escalation. */
2524
+ classification: Classification;
2525
+ /** What the compiler decided before overrides. */
2526
+ defaultClassification: Classification;
2527
+ /** True when an override raised the classification. */
2528
+ escalated: boolean;
2529
+ affectedPurposes: AffectedPurpose[];
2530
+ before: unknown;
2531
+ after: unknown;
2532
+ /** Present when the attribution or classification needs a word of explanation. */
2533
+ note?: string;
2534
+ }
2535
+ /** Change key to requested classification. Only escalations are honoured. */
2536
+ type Overrides = Readonly<Record<string, Classification>>;
2537
+ interface RejectedOverride {
2538
+ key: string;
2539
+ requested: unknown;
2540
+ /** The classification the change keeps. Absent when no such change exists. */
2541
+ current?: Classification;
2542
+ reason: 'downgrade' | 'unknown_change' | 'invalid_classification';
2543
+ }
2544
+ interface VersionIssue {
2545
+ purposeId: string;
2546
+ code: 'missing_bump' | 'version_decreased' | 'version_skipped' | 'unnecessary_bump' | 'initial_version_not_one';
2547
+ /** Errors fail the build. */
2548
+ severity: 'error' | 'warning';
2549
+ /** Absent for a purpose that is new in this diff. */
2550
+ previousVersion?: number;
2551
+ nextVersion: number;
2552
+ message: string;
2553
+ }
2554
+ interface RegistryDiff {
2555
+ changes: Change[];
2556
+ /** Purposes present on both sides with at least one material (or needs_review) change. */
2557
+ purposesNeedingBump: string[];
2558
+ /** Subset of `purposesNeedingBump` whose `version` did not increase. Fails the build. */
2559
+ missingVersionBumps: string[];
2560
+ /** Purposes whose `version` increased without a material change. A warning. */
2561
+ unnecessaryBumps: string[];
2562
+ /** Every version problem, including versions that went down or skipped a number. */
2563
+ versionIssues: VersionIssue[];
2564
+ /** A consent purpose was added or materially changed. v1 re-asks all consent purposes. */
2565
+ reconsentRequired: boolean;
2566
+ /** At least one change is `needs_review`: the build waits for a person. */
2567
+ blocked: boolean;
2568
+ rejectedOverrides: RejectedOverride[];
2569
+ }
2570
+
2571
+ /** The key an override uses to address a change. */
2572
+ declare function changeKey(kind: ChangeKind, path: string): string;
2573
+ /**
2574
+ * Classifies every difference between the last released registry and the new one, following the
2575
+ * spec's material-change rule (section 11). Pure: same inputs, same output, nothing mutated.
2576
+ *
2577
+ * Rules worth knowing before reading the result:
2578
+ *
2579
+ * - **Identity is by `id`** (collection-point fields: by `name` within their point). A renamed id
2580
+ * is therefore a removal plus an addition, and the addition is material. There is no rename
2581
+ * detection, on purpose: the compiler cannot prove two ids mean the same thing.
2582
+ * - **Attribution.** An artefact change affects the artefact's purposes. A processor change
2583
+ * affects every purpose that, in `next`, has an artefact using that processor or lists it under
2584
+ * `processors`; only a processor referenced nowhere (which the validator rejects) cannot be
2585
+ * attributed and is charged to every purpose. A glossary entry (data category, data subject
2586
+ * category, retention event) affects the purposes that use its id. A `receipts` change affects
2587
+ * the consent purposes, on either side. A `subjectRequests` change affects the built-in
2588
+ * purpose `subject-requests` (`subjectRequestPurpose`), which takes part in the diff as a
2589
+ * purpose of whichever side has the section, so a processor it names is attributed to it
2590
+ * too. Its own fields are never diffed as a purpose's: the section's rules classify them.
2591
+ * Controller and other registry-wide changes affect
2592
+ * every purpose. References to undeclared purposes are skipped:
2593
+ * the validator rejects those registries.
2594
+ * - **Columns.** Each affected purpose is classified by the table column for its basis. A purpose
2595
+ * counts as a consent purpose when its basis is consent on either side of the diff.
2596
+ * - **Strict default.** A field this function does not know is compared structurally and any
2597
+ * difference is reported as `*.unclassified_changed`, which is material.
2598
+ * - **Order is not content.** Reordering a list (purposes, locales, data categories, an
2599
+ * artefact's purposes) is not a change.
2600
+ * - **Overrides escalate only.** An override that would lower a classification, names a change
2601
+ * that does not exist, or is not a classification is ignored and listed in `rejectedOverrides`.
2602
+ * - **A version bump is not a change.** `Purpose.version` never appears in `changes`; it is
2603
+ * checked against them in the summary.
2604
+ *
2605
+ * Both registries are expected to have passed schema validation.
2606
+ */
2607
+ declare function diffRegistry(previous: Registry, next: Registry, overrides?: Overrides): RegistryDiff;
2608
+ /**
2609
+ * The consent revision after releasing `diff`. In v1 re-consent is global: one counter, bumped by
2610
+ * exactly 1 when any consent purpose was added or materially changed, otherwise left alone.
2611
+ */
2612
+ declare function nextRevision(previousRevision: number, diff: RegistryDiff): number;
2613
+
2614
+ /**
2615
+ * Retention and cookie-lifetime comparison.
2616
+ *
2617
+ * Grammar (the registry's): "session", "until-withdrawn", "<n>d", "<n>y", "<n>d-after-<event>",
2618
+ * "<n>y-after-<event>", and "persistent" (storage artefacts only: kept until deleted).
2619
+ * Years are calendar years: legal retention periods are mostly stated in years, and "3y" is
2620
+ * not the same as "1095d" across a leap day. Cookie and storage lifetimes stay in days.
2621
+ * Anything else does not parse, and an unparsed value is never comparable.
2622
+ */
2623
+ type ParsedDuration = {
2624
+ form: 'session';
2625
+ } | {
2626
+ form: 'until-withdrawn';
2627
+ } | {
2628
+ form: 'persistent';
2629
+ } | {
2630
+ form: 'fixed';
2631
+ days: number;
2632
+ } | {
2633
+ form: 'years';
2634
+ years: number;
2635
+ } | {
2636
+ form: 'after-event';
2637
+ days: number;
2638
+ event: string;
2639
+ } | {
2640
+ form: 'years-after-event';
2641
+ years: number;
2642
+ event: string;
2643
+ };
2644
+ /** How `after` relates to `before`. `incomparable` means the compiler cannot prove either direction. */
2645
+ type DurationComparison = 'equal' | 'shorter' | 'longer' | 'incomparable';
2646
+ declare function parseDuration(value: string): ParsedDuration | undefined;
2647
+ /** The event a duration runs from, for the forms that have one. */
2648
+ declare function durationEvent(parsed: ParsedDuration | undefined): string | undefined;
2649
+ /**
2650
+ * Compares two durations.
2651
+ *
2652
+ * - `session` is shorter than every other form.
2653
+ * - `persistent` is longer than every other form.
2654
+ * - Fixed durations compare numerically, as do event-relative durations on the same event.
2655
+ * Years against days compare only where every calendar year settles it: `n` years are at
2656
+ * least 365·n and at most 366·n days, so "1y" is longer than "364d", shorter than "367d" and
2657
+ * incomparable with "365d" and "366d".
2658
+ * - `until-withdrawn` against a fixed or event-relative duration, a fixed duration against an
2659
+ * event-relative one, and event-relative durations on different events are `incomparable`:
2660
+ * which one ends first depends on facts the registry does not hold.
2661
+ */
2662
+ declare function compareDurations(before: string, after: string): DurationComparison;
2663
+
2664
+ /**
2665
+ * The only text comparison the diff attempts: is a rewording provably meaning-neutral?
2666
+ *
2667
+ * Two strings are meaning-neutral when they differ only in letter case, in runs of whitespace,
2668
+ * or in punctuation that does not touch a digit. Everything else is a change of wording, which
2669
+ * the compiler cannot judge and therefore treats as material. No cleverer NLP on purpose.
2670
+ */
2671
+ /**
2672
+ * Canonical form used for the comparison. Punctuation becomes a space rather than vanishing, so
2673
+ * "non-essential" matches "non essential" but "don't" does not match "dont"; whitespace collapses
2674
+ * but is never removed, so "not able" does not match "notable". Punctuation beside a digit stays,
2675
+ * because "1.5" / "15" and "30-90" / "3090" are different numbers. Symbols (%, +, <, currency)
2676
+ * are not punctuation and always stay.
2677
+ */
2678
+ declare function normalizeText(text: string): string;
2679
+ declare function isMeaningNeutral(before: string, after: string): boolean;
2680
+
2681
+ /** The request types v1 knows, in the order the form offers them. */
2682
+ declare const SUBJECT_REQUEST_TYPES: readonly SubjectRequestType[];
2683
+ /** Id of the purpose `subjectRequests` adds. No purpose of the registry may use it while the section exists. */
2684
+ declare const SUBJECT_REQUESTS_PURPOSE_ID = "subject-requests";
2685
+ /** The retention event the built-in purpose's retention runs from: the request is closed. */
2686
+ declare const SUBJECT_REQUEST_CLOSED_EVENT = "subject-request-closed";
2687
+ /** The data categories of the built-in purpose. */
2688
+ declare const SUBJECT_REQUEST_DATA_CATEGORIES: readonly ["requester_email", "request_details"];
2689
+ /** The data subject category of the built-in purpose: whoever sends a request. */
2690
+ declare const SUBJECT_REQUEST_DATA_SUBJECT = "requesters";
2691
+ /** The built-in purpose without its texts, which the documents take from their phrase library. */
2692
+ type BuiltInPurpose = Omit<Purpose, 'title' | 'description'>;
2693
+ /**
2694
+ * The purpose a `subjectRequests` section adds, or `undefined` without one.
2695
+ *
2696
+ * It is derived, never written into `registry.purposes`: the section is the one declaration,
2697
+ * and its changes are classified by the rules for the section (adding the section is not
2698
+ * material, lengthening the retention needs a confirmation), not by the stricter rules for a
2699
+ * purpose. The documents list it like any other purpose (`@consent-kit/documents`); the banner
2700
+ * does not, since nothing in the browser serves it.
2701
+ *
2702
+ * - basis `legal_obligation`: Art. 12 and 15-17 GDPR oblige the controller to answer, and
2703
+ * Art. 5(2) to be able to show it did;
2704
+ * - data: the requester's email address and the request (type, details, dates, outcome);
2705
+ * - retention: the section's, counted from the closing of the request;
2706
+ * - recipients: the provider of `requesterEmail`, if any, and nobody else.
2707
+ */
2708
+ declare function subjectRequestPurpose(registry: Pick<Registry, 'subjectRequests'>): BuiltInPurpose | undefined;
2709
+
2710
+ export { CHANGE_KINDS, CLASSIFICATIONS, COOKIE_DURATION_PATTERN, CSP_DIRECTIVES, EEA_COUNTRIES, EMAIL_PATTERN, ID_PATTERN, MAX_EMAIL_LENGTH, RETENTION_PATTERN, RULES, SUBJECT_REQUESTS_PURPOSE_ID, SUBJECT_REQUEST_CLOSED_EVENT, SUBJECT_REQUEST_DATA_CATEGORIES, SUBJECT_REQUEST_DATA_SUBJECT, SUBJECT_REQUEST_RETENTION_PATTERN, SUBJECT_REQUEST_TYPES, VAGUE_PURPOSE_PHRASES, VAGUE_REASON_PHRASES, changeKey, compareDurations, compareSemver, diffRegistry, durationEvent, fillPlaceholders, isAbsoluteUrl, isClassification, isCspSource, isMaterial, isMeaningNeutral, locateUrl, matchVaguePhrase, matchVagueReason, nextRevision, normalizeText, parseDuration, parseRegistry, parseSemver, pathCovers, presetOrigin, registrySchema, resolvePresets, selectPreset, severity, strictest, subjectRequestPurpose, validateRegistry };
2711
+ export type { AffectedPurpose, AppliedPreset, Artefact, ArtefactKind, AutomatedDecisionMaking, BuiltInPurpose, Change, ChangeKind, Classification, ClassificationRule, CollectionField, CollectionPoint, Consequence, Controller, CookieArtefact, CspAllowance, CspConfig, DataCategory, DataProtectionOfficer, DataSubjectCategory, DurationComparison, EndpointArtefact, EuRepresentative, FontArtefact, GuardEntry, GuardManifest, IframeArtefact, LawfulBasis, Locale, LocalizedText, MediaArtefact, OverrideRecord, Overrides, ParsedDuration, PixelArtefact, PresetArtefact, PresetCatalogue, PresetDefinition, PresetFact, PresetFixture, PresetParameter, PresetPurposeSlot, PresetReport, PresetResolution, PresetUse, PresetWarning, Processor, ProcessorRole, Provision, Purpose, Receipts, Registry, RegistryDiff, RegistrySource, RejectedOverride, Retention, RuleCode, ScriptArtefact, StorageArtefact, StylesheetArtefact, SubjectRequestType, SubjectRequests, SupervisoryAuthority, TransferMechanism, UrlLocation, ValidateOptions, ValidationError, ValidationResult, VersionIssue };