@c15t/node-sdk 3.0.0-alpha.3 → 3.0.0-alpha.5

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,868 @@
1
+ /**
2
+ * The endpoint table.
3
+ *
4
+ * Each entry pairs one backend route with everything the client needs to
5
+ * call it: method, path template, auth, idempotency, input validation, the
6
+ * error codes the route can return, and how to decode its success body. The
7
+ * client, the mock client and the tests are all built from this table, so a
8
+ * route is described once.
9
+ */
10
+ import type { CheckConsentOutput, ConsentManifest, ConsentPolicyType, LegalDocumentPolicyType, PatchSubjectFullInput, PostSubjectInput } from '@c15t/schema/types';
11
+ import type { C15tApiErrorCode, C15tIssue } from './errors.js';
12
+ import type { PathParams } from './path.js';
13
+ export type HttpMethod = 'GET' | 'PATCH' | 'POST' | 'PUT';
14
+ /** What an endpoint turns its input into before it is sent. */
15
+ export interface PreparedRequest<Path extends string> {
16
+ readonly params: PathParams<Path>;
17
+ readonly query?: Readonly<Record<string, string | undefined>>;
18
+ readonly body?: unknown;
19
+ readonly headers?: Readonly<Record<string, string>>;
20
+ }
21
+ /** One backend route, as the client calls it. */
22
+ export interface Endpoint<Path extends string, Input, Data, Code extends C15tApiErrorCode> {
23
+ /** Method name on the client, such as `subjects.get`. */
24
+ readonly name: string;
25
+ readonly method: HttpMethod;
26
+ readonly path: Path;
27
+ /** `api-key` routes are refused with `MISSING_API_KEY` before sending. */
28
+ readonly auth: 'api-key' | 'none';
29
+ /**
30
+ * Whether repeating the request has the same effect as sending it once.
31
+ * Only idempotent endpoints are retried.
32
+ */
33
+ readonly idempotent: boolean;
34
+ /** Codes the route can put in `cause.code`. Others become `UNEXPECTED_RESPONSE`. */
35
+ readonly errorCodes: readonly Code[];
36
+ readonly validate: (input: Input) => Promise<readonly C15tIssue[]>;
37
+ readonly prepare: (input: Input) => PreparedRequest<Path>;
38
+ /** Statuses treated as success. Defaults to 200–299. */
39
+ readonly accepts?: (status: number) => boolean;
40
+ /**
41
+ * Turns a success body into `Data`. Throws when the body does not have the
42
+ * documented shape, which the client reports as `UNEXPECTED_RESPONSE`.
43
+ */
44
+ readonly decode: (body: unknown, response: Response, input: Input) => Data;
45
+ }
46
+ /** An endpoint of any shape, for code that handles them generically. */
47
+ export type AnyEndpoint = Endpoint<string, never, unknown, C15tApiErrorCode>;
48
+ /** A success body without the documented shape. */
49
+ export declare class DecodeError extends Error {
50
+ readonly name = "DecodeError";
51
+ }
52
+ /** Request context for `init`, sent as the headers the backend reads. */
53
+ export interface C15tInitRequest {
54
+ /** Language to resolve translations for. Sent as `Accept-Language`. */
55
+ readonly language?: string;
56
+ /** ISO 3166-1 alpha-2 country, such as `DE`. Overrides geolocation. */
57
+ readonly country?: string;
58
+ /** ISO 3166-2 subdivision, such as `BE`. Overrides geolocation. */
59
+ readonly region?: string;
60
+ /** The visitor's Global Privacy Control signal. */
61
+ readonly gpc?: boolean;
62
+ }
63
+ /** Options for `manifest`. */
64
+ export interface C15tManifestRequest {
65
+ /** Return only this language's translations. */
66
+ readonly language?: string;
67
+ /**
68
+ * The `etag` of a manifest you already hold. An unchanged manifest comes
69
+ * back as `{ status: 'not-modified' }` without a body.
70
+ */
71
+ readonly ifNoneMatch?: string;
72
+ }
73
+ /** `manifest` result data. */
74
+ export type C15tManifestResult = {
75
+ readonly status: 'modified';
76
+ readonly manifest: ConsentManifest;
77
+ readonly etag: string | undefined;
78
+ } | {
79
+ readonly status: 'not-modified';
80
+ readonly etag: string | undefined;
81
+ };
82
+ /** Options for `subjects.get`. */
83
+ export interface C15tGetSubjectRequest {
84
+ /** Only return consents of these policy types. */
85
+ readonly types?: readonly ConsentPolicyType[];
86
+ }
87
+ /**
88
+ * Input for `subjects.create`: the `POST /subjects` body, except `givenAt`
89
+ * also accepts a `Date`.
90
+ */
91
+ export type C15tCreateSubjectInput = PostSubjectInput extends infer Variant ? Variant extends PostSubjectInput ? Omit<Variant, 'givenAt'> & {
92
+ /** When consent was given: a `Date` or epoch milliseconds. */
93
+ readonly givenAt: Date | number;
94
+ } : never : never;
95
+ /** Input for `subjects.identify`. */
96
+ export type C15tIdentifySubjectInput = Omit<PatchSubjectFullInput, 'id'>;
97
+ /** Input for `consents.check`. */
98
+ export interface C15tCheckConsentInput<Types extends readonly ConsentPolicyType[]> {
99
+ /** Your user id, as linked with `subjects.identify`. */
100
+ readonly externalId: string;
101
+ /** Policy types to report. Every one appears in `results`. */
102
+ readonly types: Types;
103
+ }
104
+ /** `consents.check` data, with one result per requested type. */
105
+ export interface C15tCheckConsentOutput<Type extends string> {
106
+ readonly results: {
107
+ readonly [Key in Type]: CheckConsentOutput['results'][string];
108
+ };
109
+ }
110
+ /** Filters for `experiments.summary`. */
111
+ export interface C15tExperimentSummaryRequest {
112
+ /** Only consents given at or after this instant. A date-only string means the start of that day, UTC. */
113
+ readonly from?: Date | string;
114
+ /** Only consents given at or before this instant. A date-only string means the end of that day, UTC. */
115
+ readonly to?: Date | string;
116
+ /** Only consents recorded for this domain. */
117
+ readonly domain?: string;
118
+ }
119
+ /** Input for `legalDocuments.publish`. */
120
+ export interface C15tPublishLegalDocumentInput {
121
+ /** Release identifier, such as `2026-01-01`. */
122
+ readonly version: string;
123
+ /** Content hash of the released document, such as `sha256:…`. */
124
+ readonly hash: string;
125
+ /** When this version takes effect. */
126
+ readonly effectiveDate: Date | string;
127
+ }
128
+ interface GetSubjectEndpointInput {
129
+ readonly id: string;
130
+ readonly request: C15tGetSubjectRequest | undefined;
131
+ }
132
+ interface IdentifySubjectEndpointInput {
133
+ readonly id: string;
134
+ readonly input: C15tIdentifySubjectInput;
135
+ }
136
+ interface ExperimentSummaryEndpointInput {
137
+ readonly id: string;
138
+ readonly request: C15tExperimentSummaryRequest | undefined;
139
+ }
140
+ interface PublishLegalDocumentEndpointInput {
141
+ readonly type: LegalDocumentPolicyType;
142
+ readonly input: C15tPublishLegalDocumentInput;
143
+ }
144
+ /** Every endpoint the client calls. */
145
+ export declare const endpoints: {
146
+ readonly checkConsent: Endpoint<"/consents/check", C15tCheckConsentInput<readonly ConsentPolicyType[]>, {
147
+ results: {
148
+ [x: string]: {
149
+ hasConsent: boolean;
150
+ isLatestPolicy: boolean;
151
+ };
152
+ };
153
+ }, "DATABASE_ERROR" | "EXTERNAL_ID_REQUIRED" | "TYPE_REQUIRED">;
154
+ readonly createSubject: Endpoint<"/subjects", (Omit<{
155
+ consentAction?: string | undefined;
156
+ documentSnapshotToken?: string | undefined;
157
+ domain: string;
158
+ externalSubjectId?: string | undefined;
159
+ givenAt: number;
160
+ identityProvider?: string | undefined;
161
+ jurisdiction?: string | undefined;
162
+ jurisdictionModel?: string | undefined;
163
+ metadata?: {
164
+ [x: string]: unknown;
165
+ } | undefined;
166
+ model?: string | undefined;
167
+ policySnapshotToken?: string | undefined;
168
+ subjectId: string;
169
+ tcString?: string | undefined;
170
+ uiSource?: string | undefined;
171
+ country?: string | null | undefined;
172
+ fingerprint?: string | undefined;
173
+ gpc?: boolean | undefined;
174
+ language?: string | undefined;
175
+ policyId?: string | null | undefined;
176
+ region?: string | null | undefined;
177
+ choice?: {
178
+ categories: {
179
+ experience?: {
180
+ basis: {
181
+ fingerprint: string;
182
+ kind: "choice-v1";
183
+ } | {
184
+ kind: "legacy-v2";
185
+ materialFingerprint?: string | undefined;
186
+ };
187
+ confirmedAt: number;
188
+ value: boolean;
189
+ } | undefined;
190
+ functionality?: {
191
+ basis: {
192
+ fingerprint: string;
193
+ kind: "choice-v1";
194
+ } | {
195
+ kind: "legacy-v2";
196
+ materialFingerprint?: string | undefined;
197
+ };
198
+ confirmedAt: number;
199
+ value: boolean;
200
+ } | undefined;
201
+ marketing?: {
202
+ basis: {
203
+ fingerprint: string;
204
+ kind: "choice-v1";
205
+ } | {
206
+ kind: "legacy-v2";
207
+ materialFingerprint?: string | undefined;
208
+ };
209
+ confirmedAt: number;
210
+ value: boolean;
211
+ } | undefined;
212
+ measurement?: {
213
+ basis: {
214
+ fingerprint: string;
215
+ kind: "choice-v1";
216
+ } | {
217
+ kind: "legacy-v2";
218
+ materialFingerprint?: string | undefined;
219
+ };
220
+ confirmedAt: number;
221
+ value: boolean;
222
+ } | undefined;
223
+ };
224
+ version: 3;
225
+ } | undefined;
226
+ preferences: {
227
+ [x: string]: boolean;
228
+ };
229
+ type: "cookie_banner";
230
+ vendorChoice?: {
231
+ confirmedAt: number;
232
+ grants: {
233
+ [x: string]: boolean;
234
+ };
235
+ version: 1;
236
+ } | undefined;
237
+ }, "givenAt"> & {
238
+ /** When consent was given: a `Date` or epoch milliseconds. */
239
+ readonly givenAt: Date | number;
240
+ }) | (Omit<{
241
+ consentAction?: string | undefined;
242
+ documentSnapshotToken?: string | undefined;
243
+ domain: string;
244
+ externalSubjectId?: string | undefined;
245
+ givenAt: number;
246
+ identityProvider?: string | undefined;
247
+ jurisdiction?: string | undefined;
248
+ jurisdictionModel?: string | undefined;
249
+ metadata?: {
250
+ [x: string]: unknown;
251
+ } | undefined;
252
+ model?: string | undefined;
253
+ policySnapshotToken?: string | undefined;
254
+ subjectId: string;
255
+ tcString?: string | undefined;
256
+ uiSource?: string | undefined;
257
+ policyHash?: string | undefined;
258
+ policyId?: string | undefined;
259
+ preferences?: {
260
+ [x: string]: boolean;
261
+ } | undefined;
262
+ type: string;
263
+ }, "givenAt"> & {
264
+ /** When consent was given: a `Date` or epoch milliseconds. */
265
+ readonly givenAt: Date | number;
266
+ }) | (Omit<{
267
+ consentAction?: string | undefined;
268
+ documentSnapshotToken?: string | undefined;
269
+ domain: string;
270
+ externalSubjectId?: string | undefined;
271
+ givenAt: number;
272
+ identityProvider?: string | undefined;
273
+ jurisdiction?: string | undefined;
274
+ jurisdictionModel?: string | undefined;
275
+ metadata?: {
276
+ [x: string]: unknown;
277
+ } | undefined;
278
+ model?: string | undefined;
279
+ policySnapshotToken?: string | undefined;
280
+ subjectId: string;
281
+ tcString?: string | undefined;
282
+ uiSource?: string | undefined;
283
+ preferences?: {
284
+ [x: string]: boolean;
285
+ } | undefined;
286
+ type: "age_verification" | "marketing_communications" | "other";
287
+ }, "givenAt"> & {
288
+ /** When consent was given: a `Date` or epoch milliseconds. */
289
+ readonly givenAt: Date | number;
290
+ }), {
291
+ appliedPreferences?: {
292
+ [x: string]: boolean;
293
+ } | undefined;
294
+ consentId: string;
295
+ domain: string;
296
+ domainId: string;
297
+ givenAt: Date;
298
+ metadata?: {
299
+ [x: string]: unknown;
300
+ } | undefined;
301
+ subjectId: string;
302
+ type: string;
303
+ uiSource?: string | undefined;
304
+ }, "CHOICE_OUT_OF_SCOPE" | "CHOICE_PREFERENCE_MISMATCH" | "CONFLICT" | "DATABASE_ERROR" | "INPUT_VALIDATION_FAILED" | "POLICY_SNAPSHOT_EXPIRED" | "POLICY_SNAPSHOT_INVALID" | "POLICY_SNAPSHOT_REQUIRED" | "PURPOSE_NOT_ALLOWED" | "STALE_POLICY" | "SUBJECT_CONFLICT">;
305
+ readonly experimentSummary: Endpoint<"/experiments/:id/summary", ExperimentSummaryEndpointInput, {
306
+ arms: {
307
+ arm: string;
308
+ byAction: {
309
+ accept_all: number;
310
+ custom: number;
311
+ opt_out: number;
312
+ reject_all: number;
313
+ unknown: number;
314
+ };
315
+ bySurface: {
316
+ [x: string]: number;
317
+ };
318
+ choices: number;
319
+ medianTimeToDecisionMs: number | null;
320
+ }[];
321
+ experimentId: string;
322
+ from: string | null;
323
+ to: string | null;
324
+ }, "DATABASE_ERROR" | "INPUT_VALIDATION_FAILED" | "UNAUTHORIZED">;
325
+ readonly getSubject: Endpoint<"/subjects/:id", GetSubjectEndpointInput, {
326
+ consents: {
327
+ choice?: {
328
+ categories: {
329
+ experience?: {
330
+ basis: {
331
+ fingerprint: string;
332
+ kind: "choice-v1";
333
+ } | {
334
+ kind: "legacy-v2";
335
+ materialFingerprint?: string | undefined;
336
+ };
337
+ confirmedAt: number;
338
+ value: boolean;
339
+ } | undefined;
340
+ functionality?: {
341
+ basis: {
342
+ fingerprint: string;
343
+ kind: "choice-v1";
344
+ } | {
345
+ kind: "legacy-v2";
346
+ materialFingerprint?: string | undefined;
347
+ };
348
+ confirmedAt: number;
349
+ value: boolean;
350
+ } | undefined;
351
+ marketing?: {
352
+ basis: {
353
+ fingerprint: string;
354
+ kind: "choice-v1";
355
+ } | {
356
+ kind: "legacy-v2";
357
+ materialFingerprint?: string | undefined;
358
+ };
359
+ confirmedAt: number;
360
+ value: boolean;
361
+ } | undefined;
362
+ measurement?: {
363
+ basis: {
364
+ fingerprint: string;
365
+ kind: "choice-v1";
366
+ } | {
367
+ kind: "legacy-v2";
368
+ materialFingerprint?: string | undefined;
369
+ };
370
+ confirmedAt: number;
371
+ value: boolean;
372
+ } | undefined;
373
+ };
374
+ version: 3;
375
+ } | null | undefined;
376
+ givenAt: Date;
377
+ id: string;
378
+ isLatestPolicy: boolean;
379
+ policyEffectiveDate?: Date | undefined;
380
+ policyHash?: string | undefined;
381
+ policyId?: string | undefined;
382
+ policyVersion?: string | undefined;
383
+ preferences?: {
384
+ [x: string]: boolean;
385
+ } | undefined;
386
+ type: string;
387
+ vendorChoice?: {
388
+ confirmedAt: number;
389
+ grants: {
390
+ [x: string]: boolean;
391
+ };
392
+ version: 1;
393
+ } | null | undefined;
394
+ }[];
395
+ isValid: boolean;
396
+ subject: {
397
+ createdAt?: Date | undefined;
398
+ externalId?: string | undefined;
399
+ id: string;
400
+ identityProvider?: string | undefined;
401
+ };
402
+ subjectChoice?: {
403
+ categories: {
404
+ experience?: {
405
+ basis: {
406
+ fingerprint: string;
407
+ kind: "choice-v1";
408
+ } | {
409
+ kind: "legacy-v2";
410
+ materialFingerprint?: string | undefined;
411
+ };
412
+ confirmedAt: number;
413
+ value: boolean;
414
+ } | undefined;
415
+ functionality?: {
416
+ basis: {
417
+ fingerprint: string;
418
+ kind: "choice-v1";
419
+ } | {
420
+ kind: "legacy-v2";
421
+ materialFingerprint?: string | undefined;
422
+ };
423
+ confirmedAt: number;
424
+ value: boolean;
425
+ } | undefined;
426
+ marketing?: {
427
+ basis: {
428
+ fingerprint: string;
429
+ kind: "choice-v1";
430
+ } | {
431
+ kind: "legacy-v2";
432
+ materialFingerprint?: string | undefined;
433
+ };
434
+ confirmedAt: number;
435
+ value: boolean;
436
+ } | undefined;
437
+ measurement?: {
438
+ basis: {
439
+ fingerprint: string;
440
+ kind: "choice-v1";
441
+ } | {
442
+ kind: "legacy-v2";
443
+ materialFingerprint?: string | undefined;
444
+ };
445
+ confirmedAt: number;
446
+ value: boolean;
447
+ } | undefined;
448
+ };
449
+ version: 3;
450
+ } | null | undefined;
451
+ subjectVendorChoice?: {
452
+ confirmedAt: number;
453
+ grants: {
454
+ [x: string]: boolean;
455
+ };
456
+ version: 1;
457
+ } | null | undefined;
458
+ }, "DATABASE_ERROR" | "NOT_FOUND">;
459
+ readonly identifySubject: Endpoint<"/subjects/:id", IdentifySubjectEndpointInput, {
460
+ subject: {
461
+ externalId: string;
462
+ id: string;
463
+ identityProvider: string;
464
+ };
465
+ }, "DATABASE_ERROR" | "EXTERNAL_ID_REQUIRED" | "NOT_FOUND">;
466
+ readonly init: Endpoint<"/init", C15tInitRequest | undefined, {
467
+ branding: "c15t" | "consent" | "inth" | "none";
468
+ cmpId?: number | undefined;
469
+ customVendors?: {
470
+ cookieMaxAgeSeconds?: number | undefined;
471
+ dataCategories?: number[] | undefined;
472
+ dataRetentionDays?: number | undefined;
473
+ description?: string | undefined;
474
+ features?: number[] | undefined;
475
+ id: string | number;
476
+ legIntPurposes?: number[] | undefined;
477
+ name: string;
478
+ privacyPolicyUrl: string;
479
+ purposes: number[];
480
+ specialFeatures?: number[] | undefined;
481
+ usesCookies?: boolean | undefined;
482
+ usesNonCookieAccess?: boolean | undefined;
483
+ }[] | undefined;
484
+ gvl?: ({
485
+ dataCategories?: {
486
+ [x: string]: {
487
+ description: string;
488
+ id: number;
489
+ name: string;
490
+ } & {
491
+ [key: string]: unknown;
492
+ };
493
+ } | undefined;
494
+ features: {
495
+ [x: string]: {
496
+ description: string;
497
+ descriptionLegal?: string | undefined;
498
+ id: number;
499
+ illustrations: string[];
500
+ name: string;
501
+ } & {
502
+ [key: string]: unknown;
503
+ };
504
+ };
505
+ gvlSpecificationVersion: number;
506
+ lastUpdated: string;
507
+ purposes: {
508
+ [x: string]: {
509
+ description: string;
510
+ descriptionLegal?: string | undefined;
511
+ id: number;
512
+ illustrations: string[];
513
+ name: string;
514
+ } & {
515
+ [key: string]: unknown;
516
+ };
517
+ };
518
+ specialFeatures: {
519
+ [x: string]: {
520
+ description: string;
521
+ descriptionLegal?: string | undefined;
522
+ id: number;
523
+ illustrations: string[];
524
+ name: string;
525
+ } & {
526
+ [key: string]: unknown;
527
+ };
528
+ };
529
+ specialPurposes: {
530
+ [x: string]: {
531
+ description: string;
532
+ descriptionLegal?: string | undefined;
533
+ id: number;
534
+ illustrations: string[];
535
+ name: string;
536
+ } & {
537
+ [key: string]: unknown;
538
+ };
539
+ };
540
+ stacks: {
541
+ [x: string]: {
542
+ description: string;
543
+ id: number;
544
+ name: string;
545
+ purposes: number[];
546
+ specialFeatures: number[];
547
+ } & {
548
+ [key: string]: unknown;
549
+ };
550
+ };
551
+ standardTexts?: ({
552
+ features: string;
553
+ purposes?: string | undefined;
554
+ specialFeatures?: string | undefined;
555
+ specialPurposes?: string | undefined;
556
+ } & {
557
+ [key: string]: unknown;
558
+ }) | undefined;
559
+ tcfPolicyVersion: number;
560
+ vendorListVersion: number;
561
+ vendors: {
562
+ [x: string]: {
563
+ cookieMaxAgeSeconds: number | null;
564
+ cookieRefresh: boolean;
565
+ dataCategories?: number[] | undefined;
566
+ dataRetention?: ({
567
+ purposes?: {
568
+ [x: string]: number;
569
+ } | undefined;
570
+ specialPurposes?: {
571
+ [x: string]: number;
572
+ } | undefined;
573
+ stdRetention?: number | undefined;
574
+ } & {
575
+ [key: string]: unknown;
576
+ }) | undefined;
577
+ deletedDate?: string | undefined;
578
+ deviceStorageDisclosureUrl?: string | undefined;
579
+ features: number[];
580
+ flexiblePurposes: number[];
581
+ id: number;
582
+ legIntPurposes: number[];
583
+ name: string;
584
+ overflow?: ({
585
+ httpGetLimit: number;
586
+ } & {
587
+ [key: string]: unknown;
588
+ }) | undefined;
589
+ purposes: number[];
590
+ specialFeatures: number[];
591
+ specialPurposes: number[];
592
+ urls: ({
593
+ langId: string;
594
+ legIntClaim?: string | undefined;
595
+ privacy?: string | undefined;
596
+ } & {
597
+ [key: string]: unknown;
598
+ })[];
599
+ usesCookies: boolean;
600
+ usesNonCookieAccess: boolean;
601
+ } & {
602
+ [key: string]: unknown;
603
+ };
604
+ };
605
+ } & {
606
+ [key: string]: unknown;
607
+ }) | null | undefined;
608
+ gvlReference?: {
609
+ context?: {
610
+ country?: string | undefined;
611
+ gpc?: boolean | undefined;
612
+ region?: string | undefined;
613
+ } | undefined;
614
+ format?: "init" | undefined;
615
+ language: string;
616
+ summary?: {
617
+ items: string[];
618
+ vendorCount: number;
619
+ } | undefined;
620
+ url: string;
621
+ vendorListVersion: number;
622
+ } | undefined;
623
+ location: {
624
+ countryCode: string | null;
625
+ regionCode: string | null;
626
+ };
627
+ policyResolution: {
628
+ policy: null;
629
+ status: "unconfigured";
630
+ version: 1;
631
+ } | {
632
+ policy: null;
633
+ status: "no-match";
634
+ version: 1;
635
+ } | {
636
+ policy: null;
637
+ reason: "insufficient-inputs" | "invalid-configuration" | "invalid-payload" | "transport" | "unsupported-contract";
638
+ status: "failed";
639
+ version: 1;
640
+ } | {
641
+ fingerprints: {
642
+ choice: string;
643
+ legacyMaterial?: string | undefined;
644
+ notice: string;
645
+ policy: string;
646
+ };
647
+ matchedBy: "country" | "default" | "fallback" | "region";
648
+ policy: {
649
+ actions: {
650
+ allowed: ("accept" | "customize" | "dismiss" | "reject")[];
651
+ equivalent: ("accept" | "customize" | "dismiss" | "reject")[][];
652
+ required: ("accept" | "customize" | "dismiss" | "reject")[];
653
+ };
654
+ copyRevision: string | null;
655
+ i18n?: {
656
+ language?: string | undefined;
657
+ messageProfile?: string | undefined;
658
+ } | undefined;
659
+ id: string;
660
+ model: "iab" | "none" | "opt-in" | "opt-out";
661
+ preselectedCategories: ("experience" | "functionality" | "marketing" | "measurement")[];
662
+ privacySignals: {
663
+ gpc: {
664
+ denyCategories: ("experience" | "functionality" | "marketing" | "measurement")[];
665
+ };
666
+ };
667
+ prompt: "choice" | "none" | "notice";
668
+ proof: {
669
+ storeIp: boolean;
670
+ storeLanguage: boolean;
671
+ storeUserAgent: boolean;
672
+ };
673
+ rights: ("disclosure" | "opt-out" | "preferences")[];
674
+ scope: ("experience" | "functionality" | "marketing" | "measurement")[];
675
+ scopeMode: "permissive" | "strict";
676
+ validity: {
677
+ choiceMs: number;
678
+ noticeMs: number;
679
+ };
680
+ };
681
+ policyId: string;
682
+ status: "matched";
683
+ version: 1;
684
+ };
685
+ policySnapshotToken?: string | undefined;
686
+ resolvedPrivacySignals?: {
687
+ gpc?: boolean | undefined;
688
+ } | undefined;
689
+ translations: {
690
+ language: string;
691
+ translations: {
692
+ common: {
693
+ acceptAll?: string | undefined;
694
+ acknowledge?: string | undefined;
695
+ customize?: string | undefined;
696
+ dismiss?: string | undefined;
697
+ rejectAll?: string | undefined;
698
+ save?: string | undefined;
699
+ };
700
+ consentGate?: {
701
+ actionButton?: string | undefined;
702
+ title?: string | undefined;
703
+ } | undefined;
704
+ consentManagerDialog: {
705
+ description?: string | undefined;
706
+ title?: string | undefined;
707
+ vendors?: {
708
+ disabledByCategory?: string | undefined;
709
+ privacyPolicy?: string | undefined;
710
+ switchLabel?: string | undefined;
711
+ title?: string | undefined;
712
+ } | undefined;
713
+ };
714
+ consentTypes: {
715
+ experience?: {
716
+ description?: string | undefined;
717
+ title?: string | undefined;
718
+ } | undefined;
719
+ functionality?: {
720
+ description?: string | undefined;
721
+ title?: string | undefined;
722
+ } | undefined;
723
+ marketing?: {
724
+ description?: string | undefined;
725
+ title?: string | undefined;
726
+ } | undefined;
727
+ measurement?: {
728
+ description?: string | undefined;
729
+ title?: string | undefined;
730
+ } | undefined;
731
+ necessary?: {
732
+ description?: string | undefined;
733
+ title?: string | undefined;
734
+ } | undefined;
735
+ };
736
+ cookieBanner: {
737
+ description?: string | undefined;
738
+ title?: string | undefined;
739
+ noticeDescription?: string | undefined;
740
+ noticeTitle?: string | undefined;
741
+ };
742
+ legalLinks?: {
743
+ cookiePolicy?: string | undefined;
744
+ privacyPolicy?: string | undefined;
745
+ termsOfService?: string | undefined;
746
+ } | undefined;
747
+ rights?: {
748
+ optOut?: string | undefined;
749
+ preferences?: string | undefined;
750
+ } | undefined;
751
+ };
752
+ };
753
+ vendorListVersion?: string | undefined;
754
+ vendors?: {
755
+ category: import("@c15t/schema").VendorCategoryCondition;
756
+ description?: string | undefined;
757
+ disabled?: boolean | undefined;
758
+ homepageUrl?: string | undefined;
759
+ id: string;
760
+ legalName?: string | undefined;
761
+ name: string;
762
+ privacyPolicyUrl: string;
763
+ }[] | undefined;
764
+ }, never>;
765
+ readonly listSubjects: Endpoint<"/subjects", {
766
+ readonly externalId: string;
767
+ }, {
768
+ subjects: {
769
+ consents: {
770
+ choice?: {
771
+ categories: {
772
+ experience?: {
773
+ basis: {
774
+ fingerprint: string;
775
+ kind: "choice-v1";
776
+ } | {
777
+ kind: "legacy-v2";
778
+ materialFingerprint?: string | undefined;
779
+ };
780
+ confirmedAt: number;
781
+ value: boolean;
782
+ } | undefined;
783
+ functionality?: {
784
+ basis: {
785
+ fingerprint: string;
786
+ kind: "choice-v1";
787
+ } | {
788
+ kind: "legacy-v2";
789
+ materialFingerprint?: string | undefined;
790
+ };
791
+ confirmedAt: number;
792
+ value: boolean;
793
+ } | undefined;
794
+ marketing?: {
795
+ basis: {
796
+ fingerprint: string;
797
+ kind: "choice-v1";
798
+ } | {
799
+ kind: "legacy-v2";
800
+ materialFingerprint?: string | undefined;
801
+ };
802
+ confirmedAt: number;
803
+ value: boolean;
804
+ } | undefined;
805
+ measurement?: {
806
+ basis: {
807
+ fingerprint: string;
808
+ kind: "choice-v1";
809
+ } | {
810
+ kind: "legacy-v2";
811
+ materialFingerprint?: string | undefined;
812
+ };
813
+ confirmedAt: number;
814
+ value: boolean;
815
+ } | undefined;
816
+ };
817
+ version: 3;
818
+ } | null | undefined;
819
+ givenAt: Date;
820
+ id: string;
821
+ isLatestPolicy: boolean;
822
+ policyEffectiveDate?: Date | undefined;
823
+ policyHash?: string | undefined;
824
+ policyId?: string | undefined;
825
+ policyVersion?: string | undefined;
826
+ preferences?: {
827
+ [x: string]: boolean;
828
+ } | undefined;
829
+ type: string;
830
+ vendorChoice?: {
831
+ confirmedAt: number;
832
+ grants: {
833
+ [x: string]: boolean;
834
+ };
835
+ version: 1;
836
+ } | null | undefined;
837
+ }[];
838
+ createdAt: Date;
839
+ externalId: string;
840
+ id: string;
841
+ }[];
842
+ }, "DATABASE_ERROR" | "EXTERNAL_ID_REQUIRED" | "UNAUTHORIZED">;
843
+ readonly manifest: Endpoint<"/manifest", C15tManifestRequest | undefined, C15tManifestResult, never>;
844
+ readonly publishLegalDocument: Endpoint<"/legal-documents/:type/current", PublishLegalDocumentEndpointInput, {
845
+ policy: {
846
+ effectiveDate: Date;
847
+ hash: string;
848
+ id: string;
849
+ isActive: boolean;
850
+ type: string;
851
+ version: string;
852
+ };
853
+ }, "CONFLICT" | "DATABASE_ERROR" | "INPUT_VALIDATION_FAILED" | "UNAUTHORIZED">;
854
+ readonly status: Endpoint<"/status", undefined, {
855
+ client: {
856
+ acceptLanguage: string | null;
857
+ ip: string | null;
858
+ region: {
859
+ countryCode: string | null;
860
+ regionCode: string | null;
861
+ };
862
+ userAgent: string | null;
863
+ };
864
+ timestamp: Date;
865
+ version: string;
866
+ }, "SERVICE_UNAVAILABLE">;
867
+ };
868
+ export {};