@checktiv/sdk-web 1.9.0 → 1.10.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/dist/agents/manifest.json +12 -0
- package/dist/api-EY_fOZm-.d.ts +578 -0
- package/dist/capture-ui.d.ts +4 -4
- package/dist/capture-ui.js +4 -4
- package/dist/capture.d.ts +3 -3
- package/dist/capture.js +2 -2
- package/dist/challenge.js +1 -1
- package/dist/chunk-2SPZA3CQ.js +3 -0
- package/dist/chunk-4HIQN4KL.js +3 -0
- package/dist/chunk-C7GRMEYT.js +3 -0
- package/dist/{chunk-MCYAWMYQ.js → chunk-KYV5BPCD.js} +2 -2
- package/dist/chunk-LRKS6JEP.js +9 -0
- package/dist/chunk-SU6RE6UR.js +12 -0
- package/dist/chunk-T6NMRTFB.js +7 -0
- package/dist/chunk-UVTAPUGQ.js +3 -0
- package/dist/{chunk-WC6TLR42.js → chunk-WALPQ6TH.js} +2 -1
- package/dist/chunk-YK4WW4LX.js +7 -0
- package/dist/{chunk-FL2GCRSI.js → chunk-YRM5SYRT.js} +2 -2
- package/dist/{chunk-XSSM5ZB7.js → chunk-ZU4L3NDZ.js} +1 -1
- package/dist/collect-user-info.d.ts +4 -4
- package/dist/collect-user-info.js +5 -5
- package/dist/{controller-Ta5RgFZ4.d.ts → controller-CO5r6vXD.d.ts} +2 -2
- package/dist/{copy-CEILzVXc.d.ts → copy-D6Sd0BIe.d.ts} +1 -1
- package/dist/custom-form.css +1 -1
- package/dist/custom-form.d.ts +3 -3
- package/dist/custom-form.js +6 -7
- package/dist/esign/ceremony-runtime.js +7 -0
- package/dist/esign.d.ts +4 -0
- package/dist/esign.js +422 -0
- package/dist/fraud.d.ts +3 -3
- package/dist/fraud.js +4 -5
- package/dist/idv/cross-device.d.ts +3 -3
- package/dist/idv/cross-device.js +4 -5
- package/dist/idv.d.ts +3 -3
- package/dist/idv.js +12 -12
- package/dist/{index-G5mVvjNZ.d.ts → index-iyKwn5_z.d.ts} +3 -3
- package/dist/index.d.ts +6 -6
- package/dist/index.js +6 -7
- package/dist/{machine-BhPiYmOR.d.ts → machine-DXxarDcC.d.ts} +37 -2
- package/dist/react.d.ts +4 -4
- package/dist/react.js +7 -8
- package/dist/workspace.d.ts +3 -3
- package/dist/workspace.js +2 -1
- package/package.json +10 -3
- package/dist/api-BrQqQbGK.d.ts +0 -342
- package/dist/chunk-523TT3PD.js +0 -7
- package/dist/chunk-7GP5REM7.js +0 -3
- package/dist/chunk-BBO2X73Y.js +0 -9
- package/dist/chunk-S2OOEDJS.js +0 -3
- package/dist/chunk-T4R5TTE5.js +0 -7
- package/dist/chunk-WPMO4FQ2.js +0 -13
|
@@ -23,6 +23,18 @@
|
|
|
23
23
|
"custom_form:steps:submit"
|
|
24
24
|
],
|
|
25
25
|
"eventNamespace": "checktiv.custom_form"
|
|
26
|
+
},
|
|
27
|
+
"esign": {
|
|
28
|
+
"scopes": [
|
|
29
|
+
"sessions:me:read",
|
|
30
|
+
"esign:bundle:read",
|
|
31
|
+
"esign:context:mint",
|
|
32
|
+
"esign:events:write",
|
|
33
|
+
"esign:steps:submit",
|
|
34
|
+
"esign:consent:withdraw",
|
|
35
|
+
"esign:document:read"
|
|
36
|
+
],
|
|
37
|
+
"eventNamespace": "checktiv.esign"
|
|
26
38
|
}
|
|
27
39
|
},
|
|
28
40
|
"rules": [
|
|
@@ -0,0 +1,578 @@
|
|
|
1
|
+
import { C as CaptureLayout, a as CaptureBehaviorMessage, k as SelfiePromptMap, l as SelfieChromeCopy, B as BeginScanCopyOverrides, b as CoachingKind } from './machine-DXxarDcC.js';
|
|
2
|
+
import { M as MountCopy } from './copy-D6Sd0BIe.js';
|
|
3
|
+
import { C as CrossDeviceCopy } from './copy-DCeQ4JKx.js';
|
|
4
|
+
|
|
5
|
+
declare const SystemModes: readonly ["live", "test"];
|
|
6
|
+
type SystemMode = (typeof SystemModes)[number];
|
|
7
|
+
declare const DataRegions: readonly ["us", "eu"];
|
|
8
|
+
type DataRegion = (typeof DataRegions)[number];
|
|
9
|
+
|
|
10
|
+
type ChecktivKnownErrorCode = 'origin_not_allowed' | 'token_expired' | 'session_expired' | 'wrong_token_type' | 'protocol_mismatch' | 'camera_denied' | 'camera_policy_blocked' | 'camera_unsupported' | 'cv_gate_failed' | 'upload_failed' | 'submit_failed' | 'sdk_load_failed' | 'biometric_unsupported' | 'isolation_required' | 'session_parked';
|
|
11
|
+
type ChecktivErrorCode = ChecktivKnownErrorCode | (string & {});
|
|
12
|
+
declare const CHECKTIV_RECOVERY_STRATEGIES: readonly ["retry", "cross_device", "refresh_session", "contact_operator"];
|
|
13
|
+
type ChecktivRecovery = (typeof CHECKTIV_RECOVERY_STRATEGIES)[number];
|
|
14
|
+
interface ChecktivError {
|
|
15
|
+
code: ChecktivErrorCode;
|
|
16
|
+
recoverable: boolean;
|
|
17
|
+
recovery: ChecktivRecovery;
|
|
18
|
+
message: string;
|
|
19
|
+
}
|
|
20
|
+
declare const CHECKTIV_ERROR_CODES: readonly ChecktivKnownErrorCode[];
|
|
21
|
+
declare function createChecktivError(code: ChecktivKnownErrorCode): ChecktivError;
|
|
22
|
+
|
|
23
|
+
interface TokenManager {
|
|
24
|
+
get(): Promise<string>;
|
|
25
|
+
refresh(reason: 'expired' | '401'): Promise<string>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface SyntheticIdvScript {
|
|
29
|
+
injectError?: ChecktivKnownErrorCode;
|
|
30
|
+
stepDelayMs?: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type CrossDeviceHandoffHook = () => Promise<{
|
|
34
|
+
kind: 'ok';
|
|
35
|
+
url: string;
|
|
36
|
+
} | {
|
|
37
|
+
kind: 'unavailable';
|
|
38
|
+
}>;
|
|
39
|
+
interface IdvMountOptions {
|
|
40
|
+
target: HTMLElement | string;
|
|
41
|
+
onEvent?: (e: ChecktivIdvEvent) => void;
|
|
42
|
+
copy?: MountCopy;
|
|
43
|
+
layout?: CaptureLayout;
|
|
44
|
+
maxWidth?: string;
|
|
45
|
+
onBeforeSubmit?: () => Promise<void>;
|
|
46
|
+
onBehaviorSegment?: (segment: Pick<CaptureBehaviorMessage, 'steps' | 'traits'>) => void;
|
|
47
|
+
fetchImpl?: typeof fetch;
|
|
48
|
+
synthetic?: SyntheticIdvScript;
|
|
49
|
+
onOpenCrossDevice?: CrossDeviceHandoffHook;
|
|
50
|
+
crossDeviceCopy?: CrossDeviceCopy;
|
|
51
|
+
}
|
|
52
|
+
interface IdvHandle {
|
|
53
|
+
destroy(): void;
|
|
54
|
+
unmount(): void;
|
|
55
|
+
openCrossDevice?(): void;
|
|
56
|
+
}
|
|
57
|
+
declare const REMINT_READY_TIMEOUT_MS = 15000;
|
|
58
|
+
declare function createIdv(ctx: SubstrateContext, opts: IdvMountOptions): IdvHandle;
|
|
59
|
+
|
|
60
|
+
declare const FORM_FIELD_TYPES: readonly ["short_text", "long_text", "number", "email", "phone", "date", "single_select", "multi_select", "boolean", "file_upload", "content_heading", "content_paragraph"];
|
|
61
|
+
type FormFieldType = (typeof FORM_FIELD_TYPES)[number];
|
|
62
|
+
|
|
63
|
+
type CustomFormApplicantLabel = Record<string, string>;
|
|
64
|
+
interface CustomFormApplicantFieldValidation {
|
|
65
|
+
minLength?: number;
|
|
66
|
+
maxLength?: number;
|
|
67
|
+
min?: number;
|
|
68
|
+
max?: number;
|
|
69
|
+
minSelections?: number;
|
|
70
|
+
maxSelections?: number;
|
|
71
|
+
}
|
|
72
|
+
interface CustomFormApplicantFieldOption {
|
|
73
|
+
value: string;
|
|
74
|
+
label: CustomFormApplicantLabel;
|
|
75
|
+
}
|
|
76
|
+
interface CustomFormApplicantField {
|
|
77
|
+
id: string;
|
|
78
|
+
type: FormFieldType;
|
|
79
|
+
label: CustomFormApplicantLabel;
|
|
80
|
+
helpText?: CustomFormApplicantLabel;
|
|
81
|
+
required: boolean;
|
|
82
|
+
validation?: CustomFormApplicantFieldValidation;
|
|
83
|
+
options?: CustomFormApplicantFieldOption[];
|
|
84
|
+
}
|
|
85
|
+
type CustomFormApplicantConfig = {
|
|
86
|
+
supportedLocales: string[];
|
|
87
|
+
fields: CustomFormApplicantField[];
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
interface CustomFormFieldCopy {
|
|
91
|
+
readonly label?: string;
|
|
92
|
+
readonly helpText?: string;
|
|
93
|
+
readonly options?: Readonly<Record<string, string>>;
|
|
94
|
+
}
|
|
95
|
+
interface CustomFormCopy {
|
|
96
|
+
readonly fields?: Readonly<Record<string, CustomFormFieldCopy>>;
|
|
97
|
+
readonly submit?: string;
|
|
98
|
+
readonly submitPending?: string;
|
|
99
|
+
readonly requiredError?: string;
|
|
100
|
+
readonly invalidPhoneError?: string;
|
|
101
|
+
readonly invalidEmailError?: string;
|
|
102
|
+
readonly invalidDateError?: string;
|
|
103
|
+
readonly invalidOptionError?: string;
|
|
104
|
+
readonly outOfRangeError?: string;
|
|
105
|
+
readonly invalidFormatError?: string;
|
|
106
|
+
readonly invalidError?: string;
|
|
107
|
+
readonly validationError?: string;
|
|
108
|
+
readonly uploadError?: string;
|
|
109
|
+
readonly submitError?: string;
|
|
110
|
+
readonly booleanYes?: string;
|
|
111
|
+
readonly booleanNo?: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
type ChecktivCustomFormEvent = {
|
|
115
|
+
type: 'checktiv.custom_form.ready';
|
|
116
|
+
} | {
|
|
117
|
+
type: 'checktiv.custom_form.submitted';
|
|
118
|
+
sessionId: string;
|
|
119
|
+
} | {
|
|
120
|
+
type: 'checktiv.custom_form.error';
|
|
121
|
+
error: ChecktivError;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
interface CustomFormMountOptions {
|
|
125
|
+
target: HTMLElement | string;
|
|
126
|
+
config: CustomFormApplicantConfig;
|
|
127
|
+
copy?: CustomFormCopy;
|
|
128
|
+
onEvent?: (e: ChecktivCustomFormEvent) => void;
|
|
129
|
+
session?: {
|
|
130
|
+
sessionId: string;
|
|
131
|
+
stepId: string;
|
|
132
|
+
};
|
|
133
|
+
fetchImpl?: typeof fetch;
|
|
134
|
+
preview?: boolean;
|
|
135
|
+
}
|
|
136
|
+
interface CustomFormHandle {
|
|
137
|
+
destroy(): void;
|
|
138
|
+
}
|
|
139
|
+
declare function createCustomForm(ctx: SubstrateContext, opts: CustomFormMountOptions): CustomFormHandle;
|
|
140
|
+
|
|
141
|
+
declare const ESIGN_STATES: readonly ["preparing", "consent", "read", "scroll_incomplete", "adopt", "age_gate", "explain", "sign", "decline", "withdraw", "obscured", "frame_blocked", "age_blocked", "conflict", "token_expired", "protocol_mismatch", "error", "submit_error", "terminal_signed", "terminal_declined", "terminal_voided", "terminal_expired", "terminal_withdrawn"];
|
|
142
|
+
type EsignState = (typeof ESIGN_STATES)[number];
|
|
143
|
+
type TerminalEnvelopeStatus = 'signed' | 'declined' | 'voided' | 'expired';
|
|
144
|
+
declare const TERMINAL_STATUS_TO_STATE: {
|
|
145
|
+
readonly signed: "terminal_signed";
|
|
146
|
+
readonly declined: "terminal_declined";
|
|
147
|
+
readonly voided: "terminal_voided";
|
|
148
|
+
readonly expired: "terminal_expired";
|
|
149
|
+
};
|
|
150
|
+
declare const ESIGN_CONSENT_ACTIONS: readonly ["withdraw_consent", "request_paper_copy"];
|
|
151
|
+
type EsignConsentAction = (typeof ESIGN_CONSENT_ACTIONS)[number];
|
|
152
|
+
type EsignConsentOutcome = 'consent_withdrawn_before_signing' | 'consent_withdrawn_after_signing' | 'paper_copy_requested' | 'paper_copy_already_outstanding';
|
|
153
|
+
type EsignRightsAffordance = 'both' | 'none';
|
|
154
|
+
declare const ESIGN_STATE_RIGHTS: {
|
|
155
|
+
readonly preparing: "none";
|
|
156
|
+
readonly consent: "both";
|
|
157
|
+
readonly read: "both";
|
|
158
|
+
readonly scroll_incomplete: "both";
|
|
159
|
+
readonly adopt: "both";
|
|
160
|
+
readonly age_gate: "both";
|
|
161
|
+
readonly explain: "both";
|
|
162
|
+
readonly sign: "both";
|
|
163
|
+
readonly decline: "both";
|
|
164
|
+
readonly withdraw: "both";
|
|
165
|
+
readonly obscured: "both";
|
|
166
|
+
readonly age_blocked: "none";
|
|
167
|
+
readonly frame_blocked: "none";
|
|
168
|
+
readonly conflict: "none";
|
|
169
|
+
readonly token_expired: "none";
|
|
170
|
+
readonly protocol_mismatch: "none";
|
|
171
|
+
readonly error: "none";
|
|
172
|
+
readonly submit_error: "none";
|
|
173
|
+
readonly terminal_signed: "none";
|
|
174
|
+
readonly terminal_declined: "none";
|
|
175
|
+
readonly terminal_voided: "none";
|
|
176
|
+
readonly terminal_expired: "none";
|
|
177
|
+
readonly terminal_withdrawn: "none";
|
|
178
|
+
};
|
|
179
|
+
declare function esignStateOffersRights(state: EsignState): boolean;
|
|
180
|
+
declare const ESIGN_FRAME_ANNOUNCE_TIMEOUT_MS = 20000;
|
|
181
|
+
|
|
182
|
+
type EsignCopy = Partial<Record<EsignState, string>> & {
|
|
183
|
+
frameTitle?: string;
|
|
184
|
+
labels?: Partial<Record<EsignLabel, string>>;
|
|
185
|
+
rights?: Partial<Record<EsignRightsKey, string>>;
|
|
186
|
+
documents?: Partial<Record<EsignDocumentCopyKey, string>>;
|
|
187
|
+
shell?: Partial<Record<EsignShellKey, string>>;
|
|
188
|
+
};
|
|
189
|
+
type EsignCopyScalarKey = {
|
|
190
|
+
[K in keyof EsignCopy]-?: EsignCopy[K] extends string | undefined ? K : never;
|
|
191
|
+
}[keyof EsignCopy];
|
|
192
|
+
declare const ESIGN_COPY_FALLBACKS: {
|
|
193
|
+
preparing: string;
|
|
194
|
+
consent: string;
|
|
195
|
+
read: string;
|
|
196
|
+
scroll_incomplete: string;
|
|
197
|
+
adopt: string;
|
|
198
|
+
age_gate: string;
|
|
199
|
+
explain: string;
|
|
200
|
+
sign: string;
|
|
201
|
+
decline: string;
|
|
202
|
+
withdraw: string;
|
|
203
|
+
obscured: string;
|
|
204
|
+
frame_blocked: string;
|
|
205
|
+
conflict: string;
|
|
206
|
+
token_expired: string;
|
|
207
|
+
protocol_mismatch: string;
|
|
208
|
+
error: string;
|
|
209
|
+
submit_error: string;
|
|
210
|
+
terminal_signed: string;
|
|
211
|
+
terminal_declined: string;
|
|
212
|
+
terminal_voided: string;
|
|
213
|
+
terminal_expired: string;
|
|
214
|
+
terminal_withdrawn: string;
|
|
215
|
+
age_blocked: string;
|
|
216
|
+
frameTitle: string;
|
|
217
|
+
};
|
|
218
|
+
declare const ESIGN_LABELS: readonly ["finish", "adopt", "cancel", "change", "tryAgain", "reload", "reloadToCheck", "getHelp", "moreActions", "jumpToEnd", "readNotice", "signatureBlock", "signatureBlockDone", "finishLater", "printAndSign", "decline", "declineSubmit", "declineCancel", "signatureName", "signatureStyle", "declineReason", "ageConfirm", "documentHeading", "signatureHeading"];
|
|
219
|
+
type EsignLabel = (typeof ESIGN_LABELS)[number];
|
|
220
|
+
declare const ESIGN_LABEL_FALLBACKS: {
|
|
221
|
+
readonly finish: "Finish";
|
|
222
|
+
readonly adopt: "Use this signature";
|
|
223
|
+
readonly cancel: "Cancel";
|
|
224
|
+
readonly change: "Change";
|
|
225
|
+
readonly tryAgain: "Try again";
|
|
226
|
+
readonly reload: "Reload the page";
|
|
227
|
+
readonly reloadToCheck: "Reload to check";
|
|
228
|
+
readonly getHelp: "Get help";
|
|
229
|
+
readonly moreActions: "More actions";
|
|
230
|
+
readonly readNotice: "Notice and your rights";
|
|
231
|
+
readonly jumpToEnd: "Jump to the end";
|
|
232
|
+
readonly signatureBlock: "Add your signature here. Required.";
|
|
233
|
+
readonly signatureBlockDone: "Your signature. Select to change it.";
|
|
234
|
+
readonly finishLater: "Finish later";
|
|
235
|
+
readonly printAndSign: "Print and sign";
|
|
236
|
+
readonly decline: "Decline to sign";
|
|
237
|
+
readonly declineSubmit: "Send my decline";
|
|
238
|
+
readonly declineCancel: "Go back";
|
|
239
|
+
readonly signatureName: "Your full legal name";
|
|
240
|
+
readonly signatureStyle: "Signature style";
|
|
241
|
+
readonly declineReason: "Why are you declining?";
|
|
242
|
+
readonly ageConfirm: "I meet the minimum age";
|
|
243
|
+
readonly documentHeading: "Document";
|
|
244
|
+
readonly signatureHeading: "Your signature";
|
|
245
|
+
};
|
|
246
|
+
declare const ESIGN_RIGHTS_KEYS: readonly ["heading", "intro", "withdraw", "paperCopy", "working", "error", "confirmTitle", "confirmBody", "confirmSubmit", "confirmCancel", "withdrawnBeforeSigning", "withdrawnAfterSigning", "paperCopyRequested", "paperCopyAlreadyOutstanding"];
|
|
247
|
+
type EsignRightsKey = (typeof ESIGN_RIGHTS_KEYS)[number];
|
|
248
|
+
declare const ESIGN_RIGHTS_FALLBACKS: {
|
|
249
|
+
readonly heading: "Your rights";
|
|
250
|
+
readonly intro: "You do not have to use electronic records. You can stop using them for this document, or ask for a paper copy in the mail. Neither costs anything.";
|
|
251
|
+
readonly withdraw: "Stop using electronic records";
|
|
252
|
+
readonly paperCopy: "Ask for a mailed paper copy";
|
|
253
|
+
readonly working: "Working on your request.";
|
|
254
|
+
readonly error: "Your request did not go through. Select it again. If it keeps failing, contact the company that sent you this link.";
|
|
255
|
+
readonly confirmTitle: "Withdraw your consent?";
|
|
256
|
+
readonly confirmBody: "This ends the signing session and no electronic signature is recorded for you. The company that sent you this link is told that you withdrew. This costs nothing and no penalty applies, and you can still ask for a mailed paper copy afterward.";
|
|
257
|
+
readonly confirmSubmit: "Yes, withdraw consent";
|
|
258
|
+
readonly confirmCancel: "Go back";
|
|
259
|
+
readonly withdrawnBeforeSigning: "You withdrew your consent to use electronic records, and nothing was signed. The company that sent you this link has been told. If you want this document on paper, ask for a copy below. You can close this window.";
|
|
260
|
+
readonly withdrawnAfterSigning: "You withdrew your consent to use electronic records. The document you already signed still stands, because a signature cannot be taken back after the fact. The company that sent you this link has been told. If you want this document on paper, ask them to send you a copy.";
|
|
261
|
+
readonly paperCopyRequested: "We asked the company that sent you this link to send you a paper copy. There is no fee.";
|
|
262
|
+
readonly paperCopyAlreadyOutstanding: "A paper copy is already on its way to you, so there was nothing new to request.";
|
|
263
|
+
};
|
|
264
|
+
declare const ESIGN_OUTCOME_RIGHTS_KEY: {
|
|
265
|
+
readonly consent_withdrawn_before_signing: "withdrawnBeforeSigning";
|
|
266
|
+
readonly consent_withdrawn_after_signing: "withdrawnAfterSigning";
|
|
267
|
+
readonly paper_copy_requested: "paperCopyRequested";
|
|
268
|
+
readonly paper_copy_already_outstanding: "paperCopyAlreadyOutstanding";
|
|
269
|
+
};
|
|
270
|
+
declare const ESIGN_DOCUMENT_KEYS: readonly ["download", "printAndSignStarted", "downloadFailed", "downloadRemoved"];
|
|
271
|
+
type EsignDocumentCopyKey = (typeof ESIGN_DOCUMENT_KEYS)[number];
|
|
272
|
+
declare const ESIGN_DOCUMENT_FALLBACKS: {
|
|
273
|
+
readonly download: "Download a copy";
|
|
274
|
+
readonly printAndSignStarted: "Print your copy, sign it by hand, and send it to the company that sent you this link. You cannot return a printed page through this page.";
|
|
275
|
+
readonly downloadFailed: "We could not download that document. Select it again. If it keeps failing, contact the company that sent you this link.";
|
|
276
|
+
readonly downloadRemoved: "This copy is no longer stored. Ask the company that sent you this link to send you a new copy or a printed record.";
|
|
277
|
+
};
|
|
278
|
+
declare const ESIGN_COUNT_TOKEN = "{count}";
|
|
279
|
+
declare const ESIGN_SHELL_KEYS: readonly ["stepsBlocked", "gateRead", "gateSignature", "gateAge", "consentTermsLink", "consentTermsNewWindow", "consentAgeAttest", "consentError", "adoptTitle", "adoptConsent", "adoptFinePrint", "declineTitle", "declineBody", "finishLaterTitle", "finishLaterBody", "disclosureTitle", "disclosureVersionLabel", "disclosurePublicCopy", "disclosureBack", "statusSigned", "statusDeclined", "statusVoided", "statusExpired", "statusWithdrawn"];
|
|
280
|
+
type EsignShellKey = (typeof ESIGN_SHELL_KEYS)[number];
|
|
281
|
+
declare const ESIGN_SHELL_FALLBACKS: {
|
|
282
|
+
readonly stepsBlocked: "Not finished yet. Taking you to what is left.";
|
|
283
|
+
readonly gateRead: "Please read to the end";
|
|
284
|
+
readonly gateSignature: "Please sign above";
|
|
285
|
+
readonly gateAge: "Please confirm your age";
|
|
286
|
+
readonly consentTermsLink: "See terms.";
|
|
287
|
+
readonly consentTermsNewWindow: "Opens in a new window.";
|
|
288
|
+
readonly consentAgeAttest: "I am {count} or older.";
|
|
289
|
+
readonly consentError: "We could not record your agreement, so your signature was not added. Select the signature line in the document to try again.";
|
|
290
|
+
readonly adoptTitle: "Add your signature";
|
|
291
|
+
readonly adoptConsent: "Selecting Use this signature also records your agreement to sign and to get records for this document electronically.";
|
|
292
|
+
readonly adoptFinePrint: "Use this signature adopts what you see above as your signature. Selecting Finish signs the document.";
|
|
293
|
+
readonly declineTitle: "Decline to sign?";
|
|
294
|
+
readonly declineBody: "This ends your signing session and tells the company that sent you this link. No penalty applies. You can ask them for a new link later.";
|
|
295
|
+
readonly finishLaterTitle: "Finish later?";
|
|
296
|
+
readonly finishLaterBody: "Come back to this same link any time before the deadline. What you have done is kept.";
|
|
297
|
+
readonly disclosureTitle: "Using electronic records";
|
|
298
|
+
readonly disclosureVersionLabel: "Notice version";
|
|
299
|
+
readonly disclosurePublicCopy: "Open this notice in a new window";
|
|
300
|
+
readonly disclosureBack: "Back to the document";
|
|
301
|
+
readonly statusSigned: "Signed";
|
|
302
|
+
readonly statusDeclined: "Declined";
|
|
303
|
+
readonly statusVoided: "Canceled";
|
|
304
|
+
readonly statusExpired: "Expired";
|
|
305
|
+
readonly statusWithdrawn: "Withdrawn";
|
|
306
|
+
};
|
|
307
|
+
type EsignTerminalState = Extract<EsignState, `terminal_${string}`>;
|
|
308
|
+
declare const ESIGN_TERMINAL_STATUS_KEY: {
|
|
309
|
+
readonly terminal_signed: "statusSigned";
|
|
310
|
+
readonly terminal_declined: "statusDeclined";
|
|
311
|
+
readonly terminal_voided: "statusVoided";
|
|
312
|
+
readonly terminal_expired: "statusExpired";
|
|
313
|
+
readonly terminal_withdrawn: "statusWithdrawn";
|
|
314
|
+
};
|
|
315
|
+
declare function resolveEsignDocumentCopy(copy: EsignCopy | undefined, key: EsignDocumentCopyKey): string;
|
|
316
|
+
declare function resolveEsignShellCopy(copy: EsignCopy | undefined, key: EsignShellKey): string;
|
|
317
|
+
declare function resolveEsignTerminalStatus(copy: EsignCopy | undefined, state: EsignTerminalState): string;
|
|
318
|
+
declare function resolveEsignRightsCopy(copy: EsignCopy | undefined, key: EsignRightsKey): string;
|
|
319
|
+
declare function resolveEsignOutcomeCopy(copy: EsignCopy | undefined, outcome: EsignConsentOutcome): string;
|
|
320
|
+
declare function resolveEsignLabel(copy: EsignCopy | undefined, label: EsignLabel): string;
|
|
321
|
+
declare function resolveEsignCopy(copy: EsignCopy | undefined, state: EsignState): string;
|
|
322
|
+
declare function resolveEsignFrameTitle(copy: EsignCopy | undefined): string;
|
|
323
|
+
declare const ESIGN_COPY_STATE_KEYS: readonly EsignState[];
|
|
324
|
+
|
|
325
|
+
type EsignSubmitOutcome = 'signed' | 'declined';
|
|
326
|
+
type ChecktivEsignEvent = {
|
|
327
|
+
type: 'checktiv.esign.ready';
|
|
328
|
+
} | {
|
|
329
|
+
type: 'checktiv.esign.state';
|
|
330
|
+
state: EsignState;
|
|
331
|
+
} | {
|
|
332
|
+
type: 'checktiv.esign.submitted';
|
|
333
|
+
sessionId: string;
|
|
334
|
+
outcome: EsignSubmitOutcome;
|
|
335
|
+
} | {
|
|
336
|
+
type: 'checktiv.esign.error';
|
|
337
|
+
error: ChecktivError;
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
interface EsignContextMint {
|
|
341
|
+
contextToken: string;
|
|
342
|
+
embedOrigin: string;
|
|
343
|
+
disclosureLocale: string;
|
|
344
|
+
}
|
|
345
|
+
declare function parseEsignMint(body: unknown): EsignContextMint | null;
|
|
346
|
+
declare function parseEsignPending(body: unknown): {
|
|
347
|
+
retryAfterMs: number;
|
|
348
|
+
} | null;
|
|
349
|
+
|
|
350
|
+
interface EsignMountOptions {
|
|
351
|
+
target: HTMLElement | string;
|
|
352
|
+
copy?: EsignCopy;
|
|
353
|
+
onEvent?: (e: ChecktivEsignEvent) => void;
|
|
354
|
+
session?: {
|
|
355
|
+
sessionId: string;
|
|
356
|
+
stepId: string;
|
|
357
|
+
};
|
|
358
|
+
fetchImpl?: typeof fetch;
|
|
359
|
+
onRequestHelp?: (state: EsignState) => void;
|
|
360
|
+
schedule?: {
|
|
361
|
+
set(cb: () => void, ms: number): unknown;
|
|
362
|
+
clear(handle: unknown): void;
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
interface EsignHandle {
|
|
366
|
+
destroy(): void;
|
|
367
|
+
}
|
|
368
|
+
declare function createEsign(ctx: SubstrateContext, opts: EsignMountOptions): EsignHandle;
|
|
369
|
+
|
|
370
|
+
interface ProvisionedHandle {
|
|
371
|
+
destroy(): void;
|
|
372
|
+
openCrossDevice?(): void;
|
|
373
|
+
}
|
|
374
|
+
interface MountProvisionedOptions {
|
|
375
|
+
target: HTMLElement | string;
|
|
376
|
+
onEvent?: (e: ChecktivEvent) => void;
|
|
377
|
+
onConsent?: () => boolean | Promise<boolean>;
|
|
378
|
+
copy?: MountCopy;
|
|
379
|
+
layout?: CaptureLayout;
|
|
380
|
+
maxWidth?: string;
|
|
381
|
+
onBeforeSubmit?: () => Promise<void>;
|
|
382
|
+
onBehaviorSegment?: (segment: Pick<CaptureBehaviorMessage, 'steps' | 'traits'>) => void;
|
|
383
|
+
fetchImpl?: typeof fetch;
|
|
384
|
+
synthetic?: IdvMountOptions['synthetic'];
|
|
385
|
+
customFormConfig?: CustomFormApplicantConfig;
|
|
386
|
+
customFormCopy?: CustomFormCopy;
|
|
387
|
+
esignCopy?: EsignCopy;
|
|
388
|
+
crossDeviceCopy?: CrossDeviceCopy;
|
|
389
|
+
onOpenCrossDevice?: CrossDeviceHandoffHook;
|
|
390
|
+
onRequestHelp?: EsignMountOptions['onRequestHelp'];
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
interface GetSessionTokenContext {
|
|
394
|
+
sessionId: string;
|
|
395
|
+
reason: 'initial' | 'expired' | '401';
|
|
396
|
+
}
|
|
397
|
+
type GetSessionToken = string | ((ctx: GetSessionTokenContext) => Promise<string>);
|
|
398
|
+
interface ChecktivInitOptionsBase {
|
|
399
|
+
getSessionToken: GetSessionToken;
|
|
400
|
+
theme?: {
|
|
401
|
+
primaryColor?: string;
|
|
402
|
+
};
|
|
403
|
+
locale?: string;
|
|
404
|
+
apiBase?: string;
|
|
405
|
+
betas?: string[];
|
|
406
|
+
selfiePromptMap?: SelfiePromptMap;
|
|
407
|
+
selfieChromeCopy?: SelfieChromeCopy;
|
|
408
|
+
beginScanCopy?: BeginScanCopyOverrides;
|
|
409
|
+
}
|
|
410
|
+
type ChecktivInitScope = {
|
|
411
|
+
publishableKey: string;
|
|
412
|
+
} | {
|
|
413
|
+
region: SdkRegion;
|
|
414
|
+
mode: SdkMode;
|
|
415
|
+
};
|
|
416
|
+
type ChecktivInitOptions = ChecktivInitOptionsBase & ChecktivInitScope;
|
|
417
|
+
interface ChecktivClient {
|
|
418
|
+
mountProvisioned(opts: MountProvisionedOptions): ProvisionedHandle;
|
|
419
|
+
mount(module: 'idv', opts: IdvMountOptions): IdvHandle;
|
|
420
|
+
mount(module: 'fraud', opts: FraudMountOptions): FraudHandle;
|
|
421
|
+
mount(module: 'custom_form', opts: CustomFormMountOptions): CustomFormHandle;
|
|
422
|
+
mount(module: 'esign', opts: EsignMountOptions): EsignHandle;
|
|
423
|
+
}
|
|
424
|
+
interface SubstrateContext {
|
|
425
|
+
readonly region: SdkRegion;
|
|
426
|
+
readonly mode: SdkMode;
|
|
427
|
+
readonly publishableKey: string | undefined;
|
|
428
|
+
readonly apiBaseOrigin: string;
|
|
429
|
+
readonly theme?: ChecktivInitOptions['theme'];
|
|
430
|
+
readonly locale: string;
|
|
431
|
+
readonly betas: readonly string[];
|
|
432
|
+
readonly selfiePromptMap?: SelfiePromptMap;
|
|
433
|
+
readonly selfieChromeCopy?: SelfieChromeCopy;
|
|
434
|
+
readonly beginScanCopy?: BeginScanCopyOverrides;
|
|
435
|
+
readonly tokens: TokenManager;
|
|
436
|
+
getSessionId(): string;
|
|
437
|
+
setSessionId(id: string): void;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
type ChecktivFraudEvent = {
|
|
441
|
+
type: 'checktiv.fraud.started';
|
|
442
|
+
} | {
|
|
443
|
+
type: 'checktiv.fraud.error';
|
|
444
|
+
error: ChecktivError;
|
|
445
|
+
};
|
|
446
|
+
interface FraudMountOptions {
|
|
447
|
+
onConsent: () => boolean | Promise<boolean>;
|
|
448
|
+
onEvent?: (e: ChecktivFraudEvent) => void;
|
|
449
|
+
fetchImpl?: typeof fetch;
|
|
450
|
+
}
|
|
451
|
+
interface FraudHandle {
|
|
452
|
+
destroy(): void;
|
|
453
|
+
}
|
|
454
|
+
declare function createFraud(ctx: SubstrateContext, opts: FraudMountOptions): FraudHandle;
|
|
455
|
+
|
|
456
|
+
type IdvCoachingHint = CoachingKind;
|
|
457
|
+
interface ResolvedIdvConfig {
|
|
458
|
+
documentTypes: readonly string[];
|
|
459
|
+
biometricMode: 'selfie' | 'liveness' | 'none';
|
|
460
|
+
allowDocumentUpload?: boolean;
|
|
461
|
+
}
|
|
462
|
+
type ChecktivIdvEvent = {
|
|
463
|
+
type: 'checktiv.idv.ready';
|
|
464
|
+
config: ResolvedIdvConfig;
|
|
465
|
+
} | {
|
|
466
|
+
type: 'checktiv.idv.phase';
|
|
467
|
+
phase: string;
|
|
468
|
+
} | {
|
|
469
|
+
type: 'checktiv.idv.coaching';
|
|
470
|
+
hint: IdvCoachingHint;
|
|
471
|
+
} | {
|
|
472
|
+
type: 'checktiv.idv.submitted';
|
|
473
|
+
sessionId: string;
|
|
474
|
+
} | {
|
|
475
|
+
type: 'checktiv.idv.processing';
|
|
476
|
+
reason?: 'signal_pending' | 'no_renderable_step';
|
|
477
|
+
} | {
|
|
478
|
+
type: 'checktiv.idv.capture_superseded';
|
|
479
|
+
} | {
|
|
480
|
+
type: 'checktiv.idv.error';
|
|
481
|
+
error: ChecktivError;
|
|
482
|
+
} | {
|
|
483
|
+
type: 'checktiv.idv.cross_device_opened';
|
|
484
|
+
} | {
|
|
485
|
+
type: 'checktiv.idv.cross_device_unavailable';
|
|
486
|
+
} | {
|
|
487
|
+
type: 'checktiv.idv.cross_device_capped';
|
|
488
|
+
} | {
|
|
489
|
+
type: 'checktiv.idv.cross_device_closed';
|
|
490
|
+
};
|
|
491
|
+
type ChecktivEvent = ChecktivIdvEvent | ChecktivFraudEvent | {
|
|
492
|
+
type: `checktiv.${string}`;
|
|
493
|
+
[k: string]: unknown;
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
type SdkRegion = DataRegion;
|
|
497
|
+
type SdkMode = SystemMode;
|
|
498
|
+
interface InitOptions {
|
|
499
|
+
readonly publishableKey: string;
|
|
500
|
+
readonly applicantLinkToken?: string;
|
|
501
|
+
readonly target?: HTMLElement;
|
|
502
|
+
readonly onComplete?: (payload: unknown) => void;
|
|
503
|
+
}
|
|
504
|
+
interface MountCompleteResult {
|
|
505
|
+
readonly sessionId: string;
|
|
506
|
+
}
|
|
507
|
+
type MountScope = {
|
|
508
|
+
readonly publishableKey: string;
|
|
509
|
+
} | {
|
|
510
|
+
readonly region: SdkRegion;
|
|
511
|
+
readonly mode: SdkMode;
|
|
512
|
+
};
|
|
513
|
+
type MountOptions = MountScope & {
|
|
514
|
+
readonly fetchToken: () => Promise<string>;
|
|
515
|
+
readonly onComplete?: (result: MountCompleteResult) => void;
|
|
516
|
+
readonly onEvent?: (e: ChecktivEvent) => void;
|
|
517
|
+
readonly onError?: (e: ChecktivError) => void;
|
|
518
|
+
readonly onConsent?: () => boolean | Promise<boolean>;
|
|
519
|
+
readonly apiBase?: string;
|
|
520
|
+
readonly fetchImpl?: typeof fetch;
|
|
521
|
+
readonly resumeKey?: string;
|
|
522
|
+
readonly shortCode?: string;
|
|
523
|
+
readonly layout?: CaptureLayout;
|
|
524
|
+
readonly maxWidth?: string;
|
|
525
|
+
readonly theme?: {
|
|
526
|
+
readonly primaryColor?: string;
|
|
527
|
+
};
|
|
528
|
+
readonly copy?: MountCopy;
|
|
529
|
+
readonly crossDeviceCopy?: CrossDeviceCopy;
|
|
530
|
+
readonly onOpenCrossDevice?: CrossDeviceHandoffHook;
|
|
531
|
+
};
|
|
532
|
+
interface SessionsCreateApplicantAddress {
|
|
533
|
+
readonly line1: string;
|
|
534
|
+
readonly line2?: string;
|
|
535
|
+
readonly city: string;
|
|
536
|
+
readonly region?: string;
|
|
537
|
+
readonly postalCode?: string;
|
|
538
|
+
readonly country: string;
|
|
539
|
+
readonly placeId?: string;
|
|
540
|
+
readonly formatted?: string;
|
|
541
|
+
}
|
|
542
|
+
interface SessionsCreateApplicant {
|
|
543
|
+
readonly externalId?: string;
|
|
544
|
+
readonly email?: string;
|
|
545
|
+
readonly phone?: string;
|
|
546
|
+
readonly familyName?: string;
|
|
547
|
+
readonly givenNames?: readonly string[];
|
|
548
|
+
readonly nameSuffix?: string;
|
|
549
|
+
readonly dateOfBirth?: string;
|
|
550
|
+
readonly address?: SessionsCreateApplicantAddress;
|
|
551
|
+
readonly referenceName?: string;
|
|
552
|
+
}
|
|
553
|
+
interface SessionsCreateInput {
|
|
554
|
+
readonly templateId: string;
|
|
555
|
+
readonly applicant: SessionsCreateApplicant;
|
|
556
|
+
}
|
|
557
|
+
interface SessionsCreateOptions {
|
|
558
|
+
readonly apiBase: string;
|
|
559
|
+
readonly secretKey: string;
|
|
560
|
+
readonly idempotencyKey?: string;
|
|
561
|
+
readonly fetchImpl?: typeof fetch;
|
|
562
|
+
}
|
|
563
|
+
interface SessionsCreateResult {
|
|
564
|
+
readonly clientToken: string;
|
|
565
|
+
}
|
|
566
|
+
interface ChecktivSessions {
|
|
567
|
+
create(input: SessionsCreateInput, options: SessionsCreateOptions): Promise<SessionsCreateResult>;
|
|
568
|
+
}
|
|
569
|
+
interface ParsedPublishableKey {
|
|
570
|
+
readonly region: SdkRegion;
|
|
571
|
+
readonly mode: SdkMode;
|
|
572
|
+
}
|
|
573
|
+
declare class InvalidPublishableKeyError extends Error {
|
|
574
|
+
constructor(message: string);
|
|
575
|
+
}
|
|
576
|
+
declare function parsePublishableKey(key: string): ParsedPublishableKey;
|
|
577
|
+
|
|
578
|
+
export { createCustomForm as $, type SessionsCreateApplicant as A, type SessionsCreateApplicantAddress as B, type ChecktivInitOptions as C, type SessionsCreateInput as D, type EsignCopy as E, type FraudHandle as F, type GetSessionToken as G, type SessionsCreateOptions as H, type InitOptions as I, type SessionsCreateResult as J, type SyntheticIdvScript as K, createChecktivError as L, type MountOptions as M, parsePublishableKey as N, type ChecktivInitScope as O, type ProvisionedHandle as P, type SubstrateContext as Q, type ResolvedIdvConfig as R, type SdkRegion as S, type TokenManager as T, REMINT_READY_TIMEOUT_MS as U, createIdv as V, type ChecktivCustomFormEvent as W, type CustomFormCopy as X, type CustomFormFieldCopy as Y, type CustomFormHandle as Z, type CustomFormMountOptions as _, type ChecktivClient as a, ESIGN_CONSENT_ACTIONS as a0, ESIGN_COPY_FALLBACKS as a1, ESIGN_COPY_STATE_KEYS as a2, ESIGN_COUNT_TOKEN as a3, ESIGN_DOCUMENT_FALLBACKS as a4, ESIGN_DOCUMENT_KEYS as a5, ESIGN_FRAME_ANNOUNCE_TIMEOUT_MS as a6, ESIGN_LABELS as a7, ESIGN_LABEL_FALLBACKS as a8, ESIGN_OUTCOME_RIGHTS_KEY as a9, resolveEsignFrameTitle as aA, resolveEsignLabel as aB, resolveEsignOutcomeCopy as aC, resolveEsignRightsCopy as aD, resolveEsignShellCopy as aE, resolveEsignTerminalStatus as aF, createFraud as aG, ESIGN_RIGHTS_FALLBACKS as aa, ESIGN_RIGHTS_KEYS as ab, ESIGN_SHELL_FALLBACKS as ac, ESIGN_SHELL_KEYS as ad, ESIGN_STATES as ae, ESIGN_STATE_RIGHTS as af, ESIGN_TERMINAL_STATUS_KEY as ag, type EsignConsentAction as ah, type EsignConsentOutcome as ai, type EsignContextMint as aj, type EsignCopyScalarKey as ak, type EsignDocumentCopyKey as al, type EsignLabel as am, type EsignRightsAffordance as an, type EsignRightsKey as ao, type EsignShellKey as ap, type EsignSubmitOutcome as aq, type EsignTerminalState as ar, TERMINAL_STATUS_TO_STATE as as, type TerminalEnvelopeStatus as at, createEsign as au, esignStateOffersRights as av, parseEsignMint as aw, parseEsignPending as ax, resolveEsignCopy as ay, resolveEsignDocumentCopy as az, type ChecktivSessions as b, CHECKTIV_ERROR_CODES as c, type ChecktivError as d, type ChecktivErrorCode as e, type ChecktivEsignEvent as f, type ChecktivEvent as g, type ChecktivFraudEvent as h, type ChecktivIdvEvent as i, type ChecktivKnownErrorCode as j, type ChecktivRecovery as k, type CrossDeviceHandoffHook as l, type EsignHandle as m, type EsignMountOptions as n, type EsignState as o, type FraudMountOptions as p, type GetSessionTokenContext as q, type IdvCoachingHint as r, type IdvHandle as s, type IdvMountOptions as t, InvalidPublishableKeyError as u, type MountCompleteResult as v, type MountProvisionedOptions as w, type MountScope as x, type ParsedPublishableKey as y, type SdkMode as z };
|
package/dist/capture-ui.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as CaptureControllerDeps, b as CaptureEvent } from './controller-
|
|
2
|
-
import { C as CaptureLayout, f as CaptureState } from './machine-
|
|
3
|
-
import { M as MountCopy } from './copy-
|
|
4
|
-
export { T as TerminalKind, f as fallbackCopy } from './copy-
|
|
1
|
+
import { a as CaptureControllerDeps, b as CaptureEvent } from './controller-CO5r6vXD.js';
|
|
2
|
+
import { C as CaptureLayout, f as CaptureState } from './machine-DXxarDcC.js';
|
|
3
|
+
import { M as MountCopy } from './copy-D6Sd0BIe.js';
|
|
4
|
+
export { T as TerminalKind, f as fallbackCopy } from './copy-D6Sd0BIe.js';
|
|
5
5
|
|
|
6
6
|
interface MountCaptureOptions extends Omit<CaptureControllerDeps, 'getIframe'> {
|
|
7
7
|
copy: MountCopy;
|
package/dist/capture-ui.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { fallbackCopy, mount } from './chunk-
|
|
1
|
+
export { fallbackCopy, mount } from './chunk-YRM5SYRT.js';
|
|
2
|
+
import './chunk-T6NMRTFB.js';
|
|
3
|
+
import './chunk-NHNGQ5BB.js';
|
|
4
|
+
import './chunk-ZU4L3NDZ.js';
|
|
2
5
|
import './chunk-HV2QKVJX.js';
|
|
3
6
|
import './chunk-XOGHMNBX.js';
|
|
4
|
-
import './chunk-T4R5TTE5.js';
|
|
5
|
-
import './chunk-NHNGQ5BB.js';
|
|
6
|
-
import './chunk-XSSM5ZB7.js';
|
|
7
7
|
import './chunk-IQKHRPJR.js';
|
|
8
8
|
import './chunk-QFA3K5ZV.js';
|
|
9
9
|
import './chunk-AIK7CDV6.js';
|
package/dist/capture.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { C as CaptureController, a as CaptureControllerDeps, b as CaptureEvent, c as CaptureEventType, S as SubmitResult, d as createCaptureController } from './controller-
|
|
2
|
-
import { b as CoachingKind } from './machine-
|
|
3
|
-
export { c as CaptureAction, d as CaptureErrorKind, e as CapturePhase, f as CaptureState, i as isBiometricPhase, n as nextCapturePhaseAfterDocument, r as reducer } from './machine-
|
|
1
|
+
export { C as CaptureController, a as CaptureControllerDeps, b as CaptureEvent, c as CaptureEventType, S as SubmitResult, d as createCaptureController } from './controller-CO5r6vXD.js';
|
|
2
|
+
import { b as CoachingKind } from './machine-DXxarDcC.js';
|
|
3
|
+
export { c as CaptureAction, d as CaptureErrorKind, e as CapturePhase, f as CaptureState, i as isBiometricPhase, n as nextCapturePhaseAfterDocument, r as reducer } from './machine-DXxarDcC.js';
|
|
4
4
|
|
|
5
5
|
declare function coachingKindForState(state: string): CoachingKind;
|
|
6
6
|
|
package/dist/capture.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { coachingKindForState, createCaptureController, isBiometricPhase, nextCapturePhaseAfterDocument, reducer } from './chunk-
|
|
1
|
+
export { coachingKindForState, createCaptureController, isBiometricPhase, nextCapturePhaseAfterDocument, reducer } from './chunk-T6NMRTFB.js';
|
|
2
2
|
import './chunk-NHNGQ5BB.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-ZU4L3NDZ.js';
|
|
4
4
|
import './chunk-IQKHRPJR.js';
|
|
5
5
|
import './chunk-QFA3K5ZV.js';
|
|
6
6
|
import './chunk-AIK7CDV6.js';
|
package/dist/challenge.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assertNever } from './chunk-UBQTPS5J.js';
|
|
2
1
|
import { external_exports } from './chunk-NHNGQ5BB.js';
|
|
2
|
+
import { assertNever } from './chunk-UBQTPS5J.js';
|
|
3
3
|
import './chunk-AIK7CDV6.js';
|
|
4
4
|
|
|
5
5
|
var canonicalOriginSchema=external_exports.string().min(1).refine(v=>{if(v.includes("*"))return false;try{return new URL(v).origin===v}catch{return false}},"must be a canonical origin (scheme and host[:port], no path / query / fragment / credentials / wildcard)");var challengeErrorCodeEnum=external_exports.enum(["challenge_failed","load_failed","expired","config_error"]);var challengeInitMessageSchema=external_exports.object({type:external_exports.literal("challenge:init"),theme:external_exports.enum(["light","dark"]).optional(),locale:external_exports.string().optional()}).strict();var challengeResetMessageSchema=external_exports.object({type:external_exports.literal("challenge:reset")}).strict();external_exports.discriminatedUnion("type",[challengeInitMessageSchema,challengeResetMessageSchema]);var challengeReadyMessageSchema=external_exports.object({type:external_exports.literal("challenge:ready")}).strict();var challengeTokenMessageSchema=external_exports.object({type:external_exports.literal("challenge:token"),token:external_exports.string().min(1)}).strict();var challengeErrorMessageSchema=external_exports.object({type:external_exports.literal("challenge:error"),code:challengeErrorCodeEnum}).strict();var challengeFromIframeMessageSchema=external_exports.discriminatedUnion("type",[challengeReadyMessageSchema,challengeTokenMessageSchema,challengeErrorMessageSchema]);external_exports.object({challengeContextToken:external_exports.string().min(1),embedOrigin:canonicalOriginSchema}).strict();function createChallengeController(deps){let started=false;let destroyed=false;let resetInFlight=false;let messageListener=null;function postInit(){const iframe=deps.getIframe();if(iframe===null||iframe.contentWindow===null)return;const init={type:"challenge:init",...deps.theme!==void 0?{theme:deps.theme}:{},...deps.locale!==void 0?{locale:deps.locale}:{}};iframe.contentWindow.postMessage(init,deps.embedOrigin);}function postReset(){const iframe=deps.getIframe();if(iframe===null||iframe.contentWindow===null)return;const reset={type:"challenge:reset"};iframe.contentWindow.postMessage(reset,deps.embedOrigin);}function handleMessage(msg){switch(msg.type){case "challenge:ready":{resetInFlight=false;return}case "challenge:token":{resetInFlight=false;deps.onToken(msg.token);return}case "challenge:error":{resetInFlight=false;deps.onError(msg.code);return}default:{return assertNever(msg)}}}function onWindowMessage(event){if(destroyed)return;if(event.origin!==deps.embedOrigin)return;if(event.source!==null&&event.source!==deps.getIframe()?.contentWindow)return;const parsed=challengeFromIframeMessageSchema.safeParse(event.data);if(!parsed.success)return;handleMessage(parsed.data);}return {start(){if(destroyed||started)return;started=true;messageListener=onWindowMessage;window.addEventListener("message",messageListener);postInit();},reset(){if(destroyed||!started)return;if(resetInFlight)return;resetInFlight=true;postReset();},destroy(){if(destroyed)return;destroyed=true;if(messageListener!==null){window.removeEventListener("message",messageListener);messageListener=null;}}}}
|