@nodii/onboarding 0.1.0-dev.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -0
- package/dist/{chunk-4SWOVHZ2.js → chunk-A3DE2IAH.js} +155 -18
- package/dist/chunk-A3DE2IAH.js.map +1 -0
- package/dist/{chunk-AFCJLUPK.js → chunk-DWFZA5T6.js} +19 -8
- package/dist/chunk-DWFZA5T6.js.map +1 -0
- package/dist/chunk-FIRSA7EH.js +3 -0
- package/dist/{chunk-ZDY2I6KY.js.map → chunk-FIRSA7EH.js.map} +1 -1
- package/dist/chunk-JFDQZ3AC.js +3 -0
- package/dist/chunk-JFDQZ3AC.js.map +1 -0
- package/dist/{chunk-34BQX2KR.js → chunk-KFHVZGX6.js} +61 -6
- package/dist/chunk-KFHVZGX6.js.map +1 -0
- package/dist/chunk-NDSBIB3N.js +99 -0
- package/dist/chunk-NDSBIB3N.js.map +1 -0
- package/dist/chunk-OLWR5COK.js +10 -0
- package/dist/chunk-OLWR5COK.js.map +1 -0
- package/dist/{chunk-SWMIIUXR.js → chunk-OVULPWNZ.js} +917 -158
- package/dist/chunk-OVULPWNZ.js.map +1 -0
- package/dist/chunk-SEKNVHD3.js +59 -0
- package/dist/chunk-SEKNVHD3.js.map +1 -0
- package/dist/chunk-T7EWURTF.js +321 -0
- package/dist/chunk-T7EWURTF.js.map +1 -0
- package/dist/{chunk-BQCTDU5V.js → chunk-UHOFGWI7.js} +90 -15
- package/dist/chunk-UHOFGWI7.js.map +1 -0
- package/dist/chunk-WKN4U7QF.js +35 -0
- package/dist/chunk-WKN4U7QF.js.map +1 -0
- package/dist/{chunk-AW7W3HAC.js → chunk-XJTJPBJB.js} +40 -3
- package/dist/chunk-XJTJPBJB.js.map +1 -0
- package/dist/chunk-ZR6X3GSM.js +186 -0
- package/dist/chunk-ZR6X3GSM.js.map +1 -0
- package/dist/client-NvqPpfQP.d.ts +86 -0
- package/dist/consent/index.d.ts +59 -0
- package/dist/consent/index.js +7 -0
- package/dist/consent/index.js.map +1 -0
- package/dist/controller-BLH3wnxl.d.ts +177 -0
- package/dist/dynamic/index.d.ts +65 -6
- package/dist/dynamic/index.js +5 -2
- package/dist/errors-vJkye4a0.d.ts +110 -0
- package/dist/form/index.d.ts +12 -4
- package/dist/form/index.js +2 -2
- package/dist/index-BMSbQGWP.d.ts +103 -0
- package/dist/index.d.ts +13 -7
- package/dist/index.js +13 -8
- package/dist/model-BI_I-D_V.d.ts +267 -0
- package/dist/{model-IEyDI54w.d.ts → model-CEwvHlWA.d.ts} +212 -46
- package/dist/render-EWQXF73I.js +5 -0
- package/dist/render-EWQXF73I.js.map +1 -0
- package/dist/schema-BrtjpXfL.d.ts +257 -0
- package/dist/{signup-client-Bl6eUrxR.d.ts → signup-client-CS95nkVO.d.ts} +152 -19
- package/dist/spec/index.d.ts +10 -81
- package/dist/spec/index.js +3 -2
- package/dist/submit/index.d.ts +7 -71
- package/dist/submit/index.js +4 -3
- package/dist/viewer/index.d.ts +4 -0
- package/dist/viewer/index.js +5 -0
- package/dist/viewer/index.js.map +1 -0
- package/dist/widget/index.d.ts +102 -20
- package/dist/widget/index.js +10 -7
- package/package.json +21 -2
- package/dist/chunk-34BQX2KR.js.map +0 -1
- package/dist/chunk-4SWOVHZ2.js.map +0 -1
- package/dist/chunk-AFCJLUPK.js.map +0 -1
- package/dist/chunk-AW7W3HAC.js.map +0 -1
- package/dist/chunk-BIFANV7M.js +0 -22
- package/dist/chunk-BIFANV7M.js.map +0 -1
- package/dist/chunk-BQCTDU5V.js.map +0 -1
- package/dist/chunk-SWMIIUXR.js.map +0 -1
- package/dist/chunk-ZDY2I6KY.js +0 -3
- package/dist/schema-TfyBU6JW.d.ts +0 -107
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
export { C as ContactFormValues, L as LeadsWirePayload, c as contactFormSchema, l as leadsWireSchema, v as validateContactForm, a as validateLeadsPayload } from './schema-
|
|
2
|
-
export { ContactFormControl, ContactFormState, ContactFormStateListener, FieldError, FormStatus, createContactFormState } from './form/index.js';
|
|
3
|
-
export { F as FIELD_KEY_PATTERN, O as OnboarderTier, a as OnboardingSpec, P as PiiClass, S as SpecField, b as SpecStage, c as SpecStep, T as TerminalStage, o as onboardingSpecSchema, s as specFieldSchema, d as specStepSchema, v as validateOnboardingSpec } from './model-
|
|
4
|
-
export {
|
|
1
|
+
export { C as ContactFormValues, L as LeadsWirePayload, c as contactFormSchema, l as leadsWireSchema, v as validateContactForm, a as validateLeadsPayload } from './schema-BrtjpXfL.js';
|
|
2
|
+
export { ContactFormControl, ContactFormState, ContactFormStateListener, ContactFormStateOptions, FieldError, FormStatus, createContactFormState } from './form/index.js';
|
|
3
|
+
export { F as FIELD_KEY_PATTERN, O as OnboarderTier, a as OnboardingSpec, P as PiiClass, S as SpecField, b as SpecStage, c as SpecStep, T as TerminalStage, o as onboardingSpecSchema, s as specFieldSchema, d as specStepSchema, v as validateOnboardingSpec } from './model-CEwvHlWA.js';
|
|
4
|
+
export { A as ACCEPTANCE_LEVELS, a as AcceptanceLevel, C as ConsentDocType, b as ConsentDocument, c as ConsentPack, D as DOC_TYPES, d as acceptanceLevelSchema, e as consentDocKey, f as consentDocumentSchema, g as consentPackSchema } from './model-BI_I-D_V.js';
|
|
5
|
+
export { O as OnboardingSpecCache, S as SpecFetchOptions, a as SpecFieldDiff, d as defaultSpecCache, b as diffSpecFields, f as fetchOnboardingSpec } from './client-NvqPpfQP.js';
|
|
6
|
+
export { PinStateResult, fetchPinState } from './spec/index.js';
|
|
5
7
|
export { SignupConsent, SignupCredentials, SignupStepperControl, SignupStepperListener, SignupStepperState, StepperStatus, createSignupStepper, deriveAnswersSchema, deriveFieldSchema, deriveStepSchema, optionValue } from './dynamic/index.js';
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
+
export { C as ConsentController, a as ConsentDocState, b as ConsentEvidence, c as ConsentState, d as ConsentStateListener, e as ConsentSubmitDocument, S as SCROLL_END_THRESHOLD, f as createConsentController, i as initialGateSatisfied } from './controller-BLH3wnxl.js';
|
|
9
|
+
export { ConsentDocumentKind, FetchDocumentContentOptions, FetchedConsentDocument, OnboardingDocumentFetchError, fetchDocumentContent } from './consent/index.js';
|
|
10
|
+
export { B as BotTokenSource, L as LeadsSubmitOptions, a as LeadsSubmitResult, S as SignupSubmitBody, b as SignupSubmitOptions, c as SignupSubmitResult, d as SignupWirePayload, e as computePayloadFingerprint, f as computeSignupFingerprint, g as consentSubmitDocumentSchema, h as generateIdempotencyKey, r as resolveBotToken, s as signupWireSchema, i as submitLead, j as submitSignup } from './signup-client-CS95nkVO.js';
|
|
11
|
+
export { DEFAULT_REQUEST_TIMEOUT_MS, fetchWithTimeout, withTimeout } from './submit/index.js';
|
|
12
|
+
export { O as OnboardingBotChallengeError, a as OnboardingConflictError, b as OnboardingConsentIncompleteError, c as OnboardingConsentStaleError, d as OnboardingError, e as OnboardingErrorKind, f as OnboardingNetworkError, g as OnboardingRateLimitError, h as OnboardingServerError, i as OnboardingSpecInvalidError, j as OnboardingSpecStaleError, k as OnboardingSubdomainTakenError, l as OnboardingValidationError, S as StaleConsentDocument } from './errors-vJkye4a0.js';
|
|
8
13
|
export { RecaptchaError, RecaptchaErrorKind, RecaptchaLoadOptions, _resetRecaptchaState, executeRecaptcha, loadRecaptcha } from './recaptcha/index.js';
|
|
9
|
-
export { ContactFormMountOptions, DEFAULT_WIDGET_CSS, MountedWidget, OnboardingWidget, SignupFormMountOptions, WidgetMountOptions, cssEscape, idSelector, injectWidgetStyles, mountContactForm, mountSignupForm } from './widget/index.js';
|
|
14
|
+
export { ConsentStepRenderOptions, ContactFormMountOptions, DEFAULT_WIDGET_CSS, MountedWidget, OnboardingWidget, SignupFormMountOptions, WidgetMountOptions, consentDocElementId, cssEscape, idSelector, injectWidgetStyles, mountContactForm, mountSignupForm, renderConsentStep, updateConsentStep } from './widget/index.js';
|
|
10
15
|
import 'zod/v3';
|
|
16
|
+
import './index-BMSbQGWP.js';
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
export { DEFAULT_WIDGET_CSS, OnboardingWidget, consentDocElementId, cssEscape, idSelector, injectWidgetStyles, mountContactForm, mountSignupForm, renderConsentStep, updateConsentStep } from './chunk-OVULPWNZ.js';
|
|
1
2
|
import './chunk-JFIONONR.js';
|
|
2
|
-
|
|
3
|
+
export { createContactFormState } from './chunk-DWFZA5T6.js';
|
|
4
|
+
export { FIELD_KEY_PATTERN, OnboardingSpecCache, defaultSpecCache, diffSpecFields, fetchOnboardingSpec, fetchPinState, onboardingSpecSchema, specFieldSchema, specStepSchema, validateOnboardingSpec } from './chunk-KFHVZGX6.js';
|
|
5
|
+
import './chunk-JFDQZ3AC.js';
|
|
6
|
+
export { createSignupStepper, deriveAnswersSchema, deriveFieldSchema, deriveStepSchema, optionValue } from './chunk-A3DE2IAH.js';
|
|
7
|
+
import './chunk-FIRSA7EH.js';
|
|
8
|
+
export { SCROLL_END_THRESHOLD, createConsentController, initialGateSatisfied } from './chunk-ZR6X3GSM.js';
|
|
9
|
+
export { ACCEPTANCE_LEVELS, DOC_TYPES, acceptanceLevelSchema, consentDocKey, consentDocumentSchema, consentPackSchema } from './chunk-NDSBIB3N.js';
|
|
10
|
+
export { OnboardingDocumentFetchError, fetchDocumentContent } from './chunk-SEKNVHD3.js';
|
|
3
11
|
import './chunk-Z4PA6C2Z.js';
|
|
12
|
+
export { computePayloadFingerprint, computeSignupFingerprint, consentSubmitDocumentSchema, generateIdempotencyKey, resolveBotToken, signupWireSchema, submitLead, submitSignup } from './chunk-UHOFGWI7.js';
|
|
13
|
+
export { contactFormSchema, leadsWireSchema, validateContactForm, validateLeadsPayload } from './chunk-WKN4U7QF.js';
|
|
14
|
+
import './chunk-OLWR5COK.js';
|
|
15
|
+
export { DEFAULT_REQUEST_TIMEOUT_MS, OnboardingBotChallengeError, OnboardingConflictError, OnboardingConsentIncompleteError, OnboardingConsentStaleError, OnboardingError, OnboardingNetworkError, OnboardingRateLimitError, OnboardingServerError, OnboardingSpecInvalidError, OnboardingSpecStaleError, OnboardingSubdomainTakenError, OnboardingValidationError, fetchWithTimeout, withTimeout } from './chunk-XJTJPBJB.js';
|
|
4
16
|
import './chunk-VH6FWDWI.js';
|
|
5
|
-
export { DEFAULT_WIDGET_CSS, OnboardingWidget, cssEscape, idSelector, injectWidgetStyles, mountContactForm, mountSignupForm } from './chunk-SWMIIUXR.js';
|
|
6
|
-
export { createContactFormState } from './chunk-AFCJLUPK.js';
|
|
7
|
-
export { FIELD_KEY_PATTERN, OnboardingSpecCache, defaultSpecCache, diffSpecFields, fetchOnboardingSpec, onboardingSpecSchema, specFieldSchema, specStepSchema, validateOnboardingSpec } from './chunk-34BQX2KR.js';
|
|
8
|
-
export { createSignupStepper, deriveAnswersSchema, deriveFieldSchema, deriveStepSchema, optionValue } from './chunk-4SWOVHZ2.js';
|
|
9
|
-
export { computePayloadFingerprint, computeSignupFingerprint, generateIdempotencyKey, resolveBotToken, signupWireSchema, submitLead, submitSignup } from './chunk-BQCTDU5V.js';
|
|
10
|
-
export { contactFormSchema, leadsWireSchema, validateContactForm, validateLeadsPayload } from './chunk-BIFANV7M.js';
|
|
11
|
-
export { DEFAULT_REQUEST_TIMEOUT_MS, OnboardingBotChallengeError, OnboardingConflictError, OnboardingError, OnboardingNetworkError, OnboardingRateLimitError, OnboardingServerError, OnboardingSpecInvalidError, OnboardingSpecStaleError, OnboardingValidationError, fetchWithTimeout, withTimeout } from './chunk-AW7W3HAC.js';
|
|
12
17
|
export { RecaptchaError, _resetRecaptchaState, executeRecaptcha, loadRecaptcha } from './chunk-7NS7ENJV.js';
|
|
13
18
|
//# sourceMappingURL=index.js.map
|
|
14
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* D543 §4 ConsentPack spec model — the `consentPack` block that GET
|
|
5
|
+
* /api/v1/public/onboarding/spec grows on top of the D540 shape:
|
|
6
|
+
*
|
|
7
|
+
* consentPack: {
|
|
8
|
+
* documents: [
|
|
9
|
+
* { doc_type, custom_key?, title, version_no, content_hash,
|
|
10
|
+
* download_url, acceptance_level, required }
|
|
11
|
+
* ]
|
|
12
|
+
* }
|
|
13
|
+
*
|
|
14
|
+
* The intake projects ONLY `live` versions into this block (D543 §4);
|
|
15
|
+
* `download_url` is a short-TTL presigned GET the SDK renders/opens.
|
|
16
|
+
*
|
|
17
|
+
* `acceptance_level` (D543 §2) is a per-document GATE:
|
|
18
|
+
* - "checkbox" — a single accept checkbox (basic clickwrap).
|
|
19
|
+
* - "scroll_then_accept" — accept disabled until the doc is scrolled to
|
|
20
|
+
* the end (client asserts evidence.scrolled_to_end).
|
|
21
|
+
* - "open_then_accept" — accept disabled until the doc is opened/viewed
|
|
22
|
+
* (client asserts evidence.opened).
|
|
23
|
+
* (E-signature is a deferred future level, D543 §2 — NOT modeled here.)
|
|
24
|
+
*
|
|
25
|
+
* FAIL-CLOSED (R1 + D543 §5 / D540 §1): a malformed consentPack throws
|
|
26
|
+
* OnboardingSpecInvalidError at parse time — never rendered half-parsed
|
|
27
|
+
* (a dropped `required` doc would let a user submit without consent, and a
|
|
28
|
+
* missing `content_hash`/`version_no` would break the server's re-validation
|
|
29
|
+
* match). The SDK refuses to render a consent step it cannot trust.
|
|
30
|
+
*
|
|
31
|
+
* DOM-ID HARDENING: a document's DOM-id token is derived from `doc_type`
|
|
32
|
+
* (a fixed enum — safe) or, for custom docs, from `custom_key` (free-form
|
|
33
|
+
* from the served spec). Custom keys are interpolated into element ids and
|
|
34
|
+
* (historically) selectors by the widget layer, so they are constrained to
|
|
35
|
+
* the SAME strict identifier alphabet as field keys (CUSTOM_KEY_PATTERN,
|
|
36
|
+
* identical to the spec model's FIELD_KEY_PATTERN) and REJECTED at parse time
|
|
37
|
+
* if they carry CSS/selector metacharacters. This is layer 1; the widget also
|
|
38
|
+
* CSS.escapes every id token as defense-in-depth.
|
|
39
|
+
*
|
|
40
|
+
* SUBMIT PIN (P4): the submit array carries {legalDocumentId, versionNo,
|
|
41
|
+
* accepted, evidence} — the server matches on legalDocumentId + versionNo
|
|
42
|
+
* (contentHash is spec-side integrity metadata, NOT echoed on submit; a
|
|
43
|
+
* content change publishes a new versionNo, so versionNo is a complete pin).
|
|
44
|
+
*
|
|
45
|
+
* DRIFT 5e3df7a3 (2026-07-14, consumer-visible) — RESOLVED by the canonical
|
|
46
|
+
* shape: D543 §4 as literally written omitted `legal_document_id` from the
|
|
47
|
+
* spec block, yet the submit array is KEYED on it (the server matches
|
|
48
|
+
* legalDocumentId + versionNo against the live version). The
|
|
49
|
+
* canonical alignment (both tiers, camelCase) INCLUDES `legalDocumentId` in
|
|
50
|
+
* the spec `consentPack.documents[]`, exactly as the drift proposed. This
|
|
51
|
+
* model REQUIRES it (fail-closed OnboardingSpecInvalidError if missing).
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
/** D543 §2 acceptance-level enum. Extensible (adding a level is additive). */
|
|
55
|
+
declare const ACCEPTANCE_LEVELS: readonly ["checkbox", "scroll_then_accept", "open_then_accept"];
|
|
56
|
+
type AcceptanceLevel = (typeof ACCEPTANCE_LEVELS)[number];
|
|
57
|
+
declare const acceptanceLevelSchema: z.ZodEnum<["checkbox", "scroll_then_accept", "open_then_accept"]>;
|
|
58
|
+
/** D543 §3 docType enum. */
|
|
59
|
+
declare const DOC_TYPES: readonly ["tos", "privacy", "dpa", "custom"];
|
|
60
|
+
type ConsentDocType = (typeof DOC_TYPES)[number];
|
|
61
|
+
/**
|
|
62
|
+
* One live legal document projected into the consent step. Mirrors the D543
|
|
63
|
+
* §4 `consentPack.documents[]` element — CANONICAL camelCase wire shape (both
|
|
64
|
+
* tenant + platform tiers aligned to this): { legalDocumentId, docType,
|
|
65
|
+
* customKey (nullable), title, versionNo, contentHash, downloadUrl,
|
|
66
|
+
* acceptanceLevel, required }. The `acceptanceLevel` enum VALUES stay snake
|
|
67
|
+
* (checkbox | scroll_then_accept | open_then_accept).
|
|
68
|
+
*
|
|
69
|
+
* Cross-field invariant (D543 §3): `customKey` is a non-null identifier when
|
|
70
|
+
* `docType === "custom"` and MUST be null otherwise (a canonical tos/privacy/
|
|
71
|
+
* dpa doc is keyed by docType; only custom docs carry a key). The custom-key
|
|
72
|
+
* alphabet is DOM-id safe.
|
|
73
|
+
*/
|
|
74
|
+
declare const consentDocumentSchema: z.ZodEffects<z.ZodObject<{
|
|
75
|
+
legalDocumentId: z.ZodString;
|
|
76
|
+
docType: z.ZodEnum<["tos", "privacy", "dpa", "custom"]>;
|
|
77
|
+
customKey: z.ZodNullable<z.ZodString>;
|
|
78
|
+
title: z.ZodString;
|
|
79
|
+
versionNo: z.ZodNumber;
|
|
80
|
+
contentHash: z.ZodString;
|
|
81
|
+
downloadUrl: z.ZodEffects<z.ZodString, string, string>;
|
|
82
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
83
|
+
acceptanceLevel: z.ZodEnum<["checkbox", "scroll_then_accept", "open_then_accept"]>;
|
|
84
|
+
required: z.ZodBoolean;
|
|
85
|
+
}, "strict", z.ZodTypeAny, {
|
|
86
|
+
legalDocumentId: string;
|
|
87
|
+
docType: "custom" | "tos" | "privacy" | "dpa";
|
|
88
|
+
customKey: string | null;
|
|
89
|
+
title: string;
|
|
90
|
+
versionNo: number;
|
|
91
|
+
contentHash: string;
|
|
92
|
+
downloadUrl: string;
|
|
93
|
+
acceptanceLevel: "checkbox" | "scroll_then_accept" | "open_then_accept";
|
|
94
|
+
required: boolean;
|
|
95
|
+
contentType?: string | undefined;
|
|
96
|
+
}, {
|
|
97
|
+
legalDocumentId: string;
|
|
98
|
+
docType: "custom" | "tos" | "privacy" | "dpa";
|
|
99
|
+
customKey: string | null;
|
|
100
|
+
title: string;
|
|
101
|
+
versionNo: number;
|
|
102
|
+
contentHash: string;
|
|
103
|
+
downloadUrl: string;
|
|
104
|
+
acceptanceLevel: "checkbox" | "scroll_then_accept" | "open_then_accept";
|
|
105
|
+
required: boolean;
|
|
106
|
+
contentType?: string | undefined;
|
|
107
|
+
}>, {
|
|
108
|
+
legalDocumentId: string;
|
|
109
|
+
docType: "custom" | "tos" | "privacy" | "dpa";
|
|
110
|
+
customKey: string | null;
|
|
111
|
+
title: string;
|
|
112
|
+
versionNo: number;
|
|
113
|
+
contentHash: string;
|
|
114
|
+
downloadUrl: string;
|
|
115
|
+
acceptanceLevel: "checkbox" | "scroll_then_accept" | "open_then_accept";
|
|
116
|
+
required: boolean;
|
|
117
|
+
contentType?: string | undefined;
|
|
118
|
+
}, {
|
|
119
|
+
legalDocumentId: string;
|
|
120
|
+
docType: "custom" | "tos" | "privacy" | "dpa";
|
|
121
|
+
customKey: string | null;
|
|
122
|
+
title: string;
|
|
123
|
+
versionNo: number;
|
|
124
|
+
contentHash: string;
|
|
125
|
+
downloadUrl: string;
|
|
126
|
+
acceptanceLevel: "checkbox" | "scroll_then_accept" | "open_then_accept";
|
|
127
|
+
required: boolean;
|
|
128
|
+
contentType?: string | undefined;
|
|
129
|
+
}>;
|
|
130
|
+
type ConsentDocument = z.infer<typeof consentDocumentSchema>;
|
|
131
|
+
/**
|
|
132
|
+
* The `consentPack` block. `documents` may be empty (an onboarder with no
|
|
133
|
+
* required legal docs) — the consent stage is then omitted from the flow.
|
|
134
|
+
*
|
|
135
|
+
* Uniqueness: no two documents may share the same STABLE key (docType, or
|
|
136
|
+
* custom:<customKey> for custom docs). A duplicate would collide their DOM
|
|
137
|
+
* ids AND their consent records — fail-closed at parse (the server keys the
|
|
138
|
+
* registry on (scope, docType) / (scope, customKey) per D543 §3, so a
|
|
139
|
+
* duplicate here is a projection bug, not a renderable spec).
|
|
140
|
+
*/
|
|
141
|
+
declare const consentPackSchema: z.ZodEffects<z.ZodObject<{
|
|
142
|
+
documents: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
143
|
+
legalDocumentId: z.ZodString;
|
|
144
|
+
docType: z.ZodEnum<["tos", "privacy", "dpa", "custom"]>;
|
|
145
|
+
customKey: z.ZodNullable<z.ZodString>;
|
|
146
|
+
title: z.ZodString;
|
|
147
|
+
versionNo: z.ZodNumber;
|
|
148
|
+
contentHash: z.ZodString;
|
|
149
|
+
downloadUrl: z.ZodEffects<z.ZodString, string, string>;
|
|
150
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
151
|
+
acceptanceLevel: z.ZodEnum<["checkbox", "scroll_then_accept", "open_then_accept"]>;
|
|
152
|
+
required: z.ZodBoolean;
|
|
153
|
+
}, "strict", z.ZodTypeAny, {
|
|
154
|
+
legalDocumentId: string;
|
|
155
|
+
docType: "custom" | "tos" | "privacy" | "dpa";
|
|
156
|
+
customKey: string | null;
|
|
157
|
+
title: string;
|
|
158
|
+
versionNo: number;
|
|
159
|
+
contentHash: string;
|
|
160
|
+
downloadUrl: string;
|
|
161
|
+
acceptanceLevel: "checkbox" | "scroll_then_accept" | "open_then_accept";
|
|
162
|
+
required: boolean;
|
|
163
|
+
contentType?: string | undefined;
|
|
164
|
+
}, {
|
|
165
|
+
legalDocumentId: string;
|
|
166
|
+
docType: "custom" | "tos" | "privacy" | "dpa";
|
|
167
|
+
customKey: string | null;
|
|
168
|
+
title: string;
|
|
169
|
+
versionNo: number;
|
|
170
|
+
contentHash: string;
|
|
171
|
+
downloadUrl: string;
|
|
172
|
+
acceptanceLevel: "checkbox" | "scroll_then_accept" | "open_then_accept";
|
|
173
|
+
required: boolean;
|
|
174
|
+
contentType?: string | undefined;
|
|
175
|
+
}>, {
|
|
176
|
+
legalDocumentId: string;
|
|
177
|
+
docType: "custom" | "tos" | "privacy" | "dpa";
|
|
178
|
+
customKey: string | null;
|
|
179
|
+
title: string;
|
|
180
|
+
versionNo: number;
|
|
181
|
+
contentHash: string;
|
|
182
|
+
downloadUrl: string;
|
|
183
|
+
acceptanceLevel: "checkbox" | "scroll_then_accept" | "open_then_accept";
|
|
184
|
+
required: boolean;
|
|
185
|
+
contentType?: string | undefined;
|
|
186
|
+
}, {
|
|
187
|
+
legalDocumentId: string;
|
|
188
|
+
docType: "custom" | "tos" | "privacy" | "dpa";
|
|
189
|
+
customKey: string | null;
|
|
190
|
+
title: string;
|
|
191
|
+
versionNo: number;
|
|
192
|
+
contentHash: string;
|
|
193
|
+
downloadUrl: string;
|
|
194
|
+
acceptanceLevel: "checkbox" | "scroll_then_accept" | "open_then_accept";
|
|
195
|
+
required: boolean;
|
|
196
|
+
contentType?: string | undefined;
|
|
197
|
+
}>, "many">;
|
|
198
|
+
}, "strict", z.ZodTypeAny, {
|
|
199
|
+
documents: {
|
|
200
|
+
legalDocumentId: string;
|
|
201
|
+
docType: "custom" | "tos" | "privacy" | "dpa";
|
|
202
|
+
customKey: string | null;
|
|
203
|
+
title: string;
|
|
204
|
+
versionNo: number;
|
|
205
|
+
contentHash: string;
|
|
206
|
+
downloadUrl: string;
|
|
207
|
+
acceptanceLevel: "checkbox" | "scroll_then_accept" | "open_then_accept";
|
|
208
|
+
required: boolean;
|
|
209
|
+
contentType?: string | undefined;
|
|
210
|
+
}[];
|
|
211
|
+
}, {
|
|
212
|
+
documents: {
|
|
213
|
+
legalDocumentId: string;
|
|
214
|
+
docType: "custom" | "tos" | "privacy" | "dpa";
|
|
215
|
+
customKey: string | null;
|
|
216
|
+
title: string;
|
|
217
|
+
versionNo: number;
|
|
218
|
+
contentHash: string;
|
|
219
|
+
downloadUrl: string;
|
|
220
|
+
acceptanceLevel: "checkbox" | "scroll_then_accept" | "open_then_accept";
|
|
221
|
+
required: boolean;
|
|
222
|
+
contentType?: string | undefined;
|
|
223
|
+
}[];
|
|
224
|
+
}>, {
|
|
225
|
+
documents: {
|
|
226
|
+
legalDocumentId: string;
|
|
227
|
+
docType: "custom" | "tos" | "privacy" | "dpa";
|
|
228
|
+
customKey: string | null;
|
|
229
|
+
title: string;
|
|
230
|
+
versionNo: number;
|
|
231
|
+
contentHash: string;
|
|
232
|
+
downloadUrl: string;
|
|
233
|
+
acceptanceLevel: "checkbox" | "scroll_then_accept" | "open_then_accept";
|
|
234
|
+
required: boolean;
|
|
235
|
+
contentType?: string | undefined;
|
|
236
|
+
}[];
|
|
237
|
+
}, {
|
|
238
|
+
documents: {
|
|
239
|
+
legalDocumentId: string;
|
|
240
|
+
docType: "custom" | "tos" | "privacy" | "dpa";
|
|
241
|
+
customKey: string | null;
|
|
242
|
+
title: string;
|
|
243
|
+
versionNo: number;
|
|
244
|
+
contentHash: string;
|
|
245
|
+
downloadUrl: string;
|
|
246
|
+
acceptanceLevel: "checkbox" | "scroll_then_accept" | "open_then_accept";
|
|
247
|
+
required: boolean;
|
|
248
|
+
contentType?: string | undefined;
|
|
249
|
+
}[];
|
|
250
|
+
}>;
|
|
251
|
+
type ConsentPack = z.infer<typeof consentPackSchema>;
|
|
252
|
+
/**
|
|
253
|
+
* Stable, collision-proof identity for a consent document, used as the map
|
|
254
|
+
* key in the controller and the DOM-id token in the widget. `docType` is a
|
|
255
|
+
* fixed enum; `custom:` is prefixed for custom docs so a customKey of
|
|
256
|
+
* "tos" can never alias the canonical tos doc.
|
|
257
|
+
*
|
|
258
|
+
* Note: this is NOT the submit key — the submit array keys on the server's
|
|
259
|
+
* opaque `legalDocumentId` (D543 §4), which the SDK does not synthesize.
|
|
260
|
+
* This is a purely CLIENT-side identity for state + DOM.
|
|
261
|
+
*/
|
|
262
|
+
declare function consentDocKey(doc: {
|
|
263
|
+
docType: ConsentDocType;
|
|
264
|
+
customKey?: string | null | undefined;
|
|
265
|
+
}): string;
|
|
266
|
+
|
|
267
|
+
export { ACCEPTANCE_LEVELS as A, type ConsentDocType as C, DOC_TYPES as D, type AcceptanceLevel as a, type ConsentDocument as b, type ConsentPack as c, acceptanceLevelSchema as d, consentDocKey as e, consentDocumentSchema as f, consentPackSchema as g };
|