@checktiv/sdk-web 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +172 -96
- package/dist/agents/AGENTS.md +20 -25
- package/dist/agents/manifest.json +15 -4
- package/dist/{types-CnlkFS7V.d.ts → api-BkCFpMrw.d.ts} +160 -97
- package/dist/capture-ui.css +1 -1
- package/dist/capture-ui.d.ts +5 -4
- package/dist/capture-ui.js +4 -2
- package/dist/capture.d.ts +3 -3
- package/dist/capture.js +3 -1
- package/dist/challenge.d.ts +18 -0
- package/dist/challenge.js +9 -0
- package/dist/chunk-5AQCMTZV.js +6 -0
- package/dist/chunk-5MNNRYD5.js +7 -0
- package/dist/{chunk-TRTAZKYV.js → chunk-6U53T32A.js} +4 -3
- package/dist/chunk-6YTXZEVF.js +5 -0
- package/dist/chunk-FV2UJL7E.js +8 -0
- package/dist/chunk-GFHNOZVO.js +3 -0
- package/dist/chunk-IQKHRPJR.js +3 -0
- package/dist/chunk-ITLSDZHK.js +5 -0
- package/dist/chunk-PZJMAB7K.js +3 -0
- package/dist/chunk-UBQTPS5J.js +3 -0
- package/dist/chunk-YGBYH4IK.js +7 -0
- package/dist/{controller-C4vJ47JI.d.ts → controller-CFL3mA5e.d.ts} +2 -2
- package/dist/copy-DCeQ4JKx.d.ts +19 -0
- package/dist/{copy-DeUly5vr.d.ts → copy-Dfmk11S_.d.ts} +2 -2
- package/dist/cross-device.d.ts +19 -1
- package/dist/custom-form.css +1 -1
- package/dist/custom-form.d.ts +4 -3
- package/dist/custom-form.js +5 -3
- package/dist/fraud.d.ts +4 -3
- package/dist/fraud.js +5 -3
- package/dist/idv/cross-device.d.ts +41 -6
- package/dist/idv/cross-device.js +8 -3
- package/dist/idv.css +1 -1
- package/dist/idv.d.ts +4 -3
- package/dist/idv.js +10 -6
- package/dist/index.d.ts +19 -6
- package/dist/index.js +9 -7
- package/dist/{machine--zVZIM4F.d.ts → machine-CuZalPFX.d.ts} +15 -3
- package/dist/react.d.ts +6 -4
- package/dist/react.js +7 -5
- package/dist/workspace.d.ts +60 -0
- package/dist/workspace.js +7 -0
- package/package.json +15 -5
- package/dist/chunk-BYTKOKAD.js +0 -7
- package/dist/chunk-C7H2ZVQT.js +0 -7
- package/dist/chunk-CXNPD67Z.js +0 -5
- package/dist/chunk-FGWZZNAN.js +0 -5
- package/dist/chunk-WQCYRLWP.js +0 -3
- package/dist/fp.esm.min-QD5CJD52.js +0 -5
- package/dist/index-BtJbU9MC.d.ts +0 -43
package/dist/index.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { parsePublishableKey } from './chunk-
|
|
2
|
-
export { InvalidPublishableKeyError, init, parsePublishableKey } from './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import
|
|
1
|
+
import { parsePublishableKey, init } from './chunk-FV2UJL7E.js';
|
|
2
|
+
export { InvalidPublishableKeyError, init, parsePublishableKey } from './chunk-FV2UJL7E.js';
|
|
3
|
+
import './chunk-YGBYH4IK.js';
|
|
4
|
+
import './chunk-GFHNOZVO.js';
|
|
5
|
+
import './chunk-PZJMAB7K.js';
|
|
5
6
|
import { R, k } from './chunk-XOGHMNBX.js';
|
|
7
|
+
import './chunk-IQKHRPJR.js';
|
|
8
|
+
import { resolveApiBaseOrigin, sdkPublicSettings, shortCodeRefreshPath, PUBLISHABLE_KEY_HEADER, SESSIONS_ME_REFRESH_LINK_PATH, WORKING_TOKEN_MINT_PATH } from './chunk-ITLSDZHK.js';
|
|
6
9
|
import { getServiceOrigin } from './chunk-QFA3K5ZV.js';
|
|
7
|
-
import './chunk-WQCYRLWP.js';
|
|
8
10
|
import './chunk-AIK7CDV6.js';
|
|
9
11
|
|
|
10
|
-
var HOST_TAG="checktiv-root";var MOUNTED_FLAG="__checktivMounted";var LEGACY_HOST_ATTR="data-autohost-kyc-host";var HOST_ATTR="data-checktiv-host";var shadowCache=new WeakMap;function mountShadowHost(target){const existing=findExistingHost(target);if(existing){const cached=shadowCache.get(existing);if(cached)return cached}const host=document.createElement("div");host.setAttribute(HOST_ATTR,HOST_TAG);host.setAttribute(LEGACY_HOST_ATTR,HOST_TAG);host[MOUNTED_FLAG]=true;target.appendChild(host);const shadow=host.attachShadow({mode:"closed"});shadowCache.set(host,shadow);return shadow}function findExistingHost(target){for(const child of Array.from(target.children)){if(!(child instanceof HTMLElement))continue;const candidate=child;if(candidate[MOUNTED_FLAG]===true)return candidate}return null}var version="1.0.0";var initialised=new WeakSet;function resolveVerifyOrigin(parsed){return getServiceOrigin(sdkPublicSettings.apps.verify.subdomain,"prod",parsed.region,sdkPublicSettings)}function buildPopupUrl(parsed,opts){const origin=resolveVerifyOrigin(parsed);if(opts.applicantLinkToken){return `${origin}/start?lt=${encodeURIComponent(opts.applicantLinkToken)}`}return `${origin}/`}function launchPopup(url){const w=460;const h=760;const left=Math.max(0,Math.floor((window.screen.width-w)/2));const top=Math.max(0,Math.floor((window.screen.height-h)/2));const features=`popup=yes,width=${w},height=${h},left=${left},top=${top}`;const popup=window.open(url,"checktiv",features);if(!popup){window.location.href=url;return null}return popup}var COMPLETE_EVENT_TYPE="autohost.kyc.complete";function isCompletionMessage(data){if(typeof data!=="object"||data===null)return false;if(!("type"in data))return false;return data.type===COMPLETE_EVENT_TYPE}function listenForCompletion(expectedOrigin,onComplete){if(!onComplete)return;const handler=event=>{if(event.origin!==expectedOrigin)return;const data=event.data;if(!isCompletionMessage(data))return;onComplete(data);};window.addEventListener("message",handler);}function buildButton(onClick){const children="Start verification";return k("button",{type:"button",onClick,style:'display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; font-size: 14px; font-weight: 600; color: #fff; background: #0b5fff; border: none; border-radius: 6px; cursor: pointer;'},children)}function resolveTarget(opts){if(opts.target)return opts.target;return document.querySelector("[data-checktiv]")??document.querySelector("[data-autohost-kyc]")}function mountButton(opts){const parsed=parsePublishableKey(opts.publishableKey);const target=resolveTarget(opts);if(!target){console.warn("[Checktiv] No mount target found. Either pass `target` explicitly or add `<div data-checktiv>` to your page.");return}if(initialised.has(target))return;initialised.add(target);const shadow=mountShadowHost(target);const verifyOrigin=resolveVerifyOrigin(parsed);listenForCompletion(verifyOrigin,opts.onComplete);const onClick=()=>{const popupUrl=buildPopupUrl(parsed,opts);launchPopup(popupUrl);};R(buildButton(onClick),shadow);}
|
|
12
|
+
var HOST_TAG="checktiv-root";var MOUNTED_FLAG="__checktivMounted";var LEGACY_HOST_ATTR="data-autohost-kyc-host";var HOST_ATTR="data-checktiv-host";var shadowCache=new WeakMap;function mountShadowHost(target){const existing=findExistingHost(target);if(existing){const cached=shadowCache.get(existing);if(cached)return cached}const host=document.createElement("div");host.setAttribute(HOST_ATTR,HOST_TAG);host.setAttribute(LEGACY_HOST_ATTR,HOST_TAG);host[MOUNTED_FLAG]=true;target.appendChild(host);const shadow=host.attachShadow({mode:"closed"});shadowCache.set(host,shadow);return shadow}function findExistingHost(target){for(const child of Array.from(target.children)){if(!(child instanceof HTMLElement))continue;const candidate=child;if(candidate[MOUNTED_FLAG]===true)return candidate}return null}var DEFAULT_REFRESH_MARGIN_MS=6e4;function createWorkingTokenManager(source,deps={}){const now=deps.now??(()=>Date.now());const setTimer=deps.setTimer??((fn,ms)=>setTimeout(fn,ms));const clearTimer=deps.clearTimer??(handle=>clearTimeout(handle));const marginMs=deps.marginMs??DEFAULT_REFRESH_MARGIN_MS;const onProactiveError=deps.onProactiveError;let cached=null;let pending=null;let timer=null;let stopped=false;const clearScheduled=()=>{if(timer!==null){clearTimer(timer);timer=null;}};const scheduleProactive=expiresAt=>{clearScheduled();if(stopped)return;const expiryMs=Date.parse(expiresAt);if(Number.isNaN(expiryMs))return;const delay=expiryMs-now()-marginMs;if(delay<=0)return;timer=setTimer(()=>{timer=null;void doRefresh("expired").catch(err=>onProactiveError?.(err));},delay);};const mintOnce=reason=>source(reason).then(minted=>{scheduleProactive(minted.expiresAt);return minted.token});const doRefresh=reason=>{if(pending!==null)return pending;const p=mintOnce(reason);pending=p;cached=p;void p.then(()=>{if(pending===p)pending=null;},()=>{if(pending===p)pending=null;if(cached===p)cached=null;});return p};return {get(){if(cached!==null)return cached;const p=mintOnce("initial");cached=p;void p.catch(()=>{if(cached===p)cached=null;});return p},refresh(reason){return doRefresh(reason)},stop(){stopped=true;clearScheduled();}}}var RESUME_CLIENT_TOKEN_KEY_PREFIX="checktiv.rct.";function safeLocalStorage(){try{return globalThis.localStorage??null}catch{return null}}function createClientTokenStore(resumeKey,storage=safeLocalStorage()){const key=RESUME_CLIENT_TOKEN_KEY_PREFIX+resumeKey;return {read(){if(storage===null)return null;try{const raw=storage.getItem(key);return raw!==null&&raw.length>0?raw:null}catch{return null}},write(token){if(storage===null)return;try{storage.setItem(key,token);}catch{}},clear(){if(storage===null)return;try{storage.removeItem(key);}catch{}}}}async function requestSelfServiceResend(params){const fetchImpl=params.fetchImpl??fetch;const body=JSON.stringify({confirmEmail:params.confirmEmail});try{let res;if(params.mode==="short_code"){res=await fetchImpl(params.origin+shortCodeRefreshPath(params.shortCode),{method:"POST",headers:{"content-type":"application/json"},body});}return {requested:res.ok}}catch{return {requested:false}}}var version="1.1.0";var initialised=new WeakSet;function resolveVerifyOrigin(parsed){return getServiceOrigin(sdkPublicSettings.apps.verify.subdomain,"prod",parsed.region,sdkPublicSettings)}function buildPopupUrl(parsed,opts){const origin=resolveVerifyOrigin(parsed);if(opts.applicantLinkToken){return `${origin}/start?lt=${encodeURIComponent(opts.applicantLinkToken)}`}return `${origin}/`}function launchPopup(url){const w=460;const h=760;const left=Math.max(0,Math.floor((window.screen.width-w)/2));const top=Math.max(0,Math.floor((window.screen.height-h)/2));const features=`popup=yes,width=${w},height=${h},left=${left},top=${top}`;const popup=window.open(url,"checktiv",features);if(!popup){window.location.href=url;return null}return popup}var COMPLETE_EVENT_TYPE="autohost.kyc.complete";function isCompletionMessage(data){if(typeof data!=="object"||data===null)return false;if(!("type"in data))return false;return data.type===COMPLETE_EVENT_TYPE}function listenForCompletion(expectedOrigin,onComplete){if(!onComplete)return;const handler=event=>{if(event.origin!==expectedOrigin)return;const data=event.data;if(!isCompletionMessage(data))return;onComplete(data);};window.addEventListener("message",handler);}function buildButton(onClick){const children="Start verification";return k("button",{type:"button",onClick,style:'display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; font-size: 14px; font-weight: 600; color: #fff; background: #0b5fff; border: none; border-radius: 6px; cursor: pointer;'},children)}function resolveTarget(opts){if(opts.target)return opts.target;return document.querySelector("[data-checktiv]")??document.querySelector("[data-autohost-kyc]")}function mountButton(opts){const parsed=parsePublishableKey(opts.publishableKey);const target=resolveTarget(opts);if(!target){console.warn("[Checktiv] No mount target found. Either pass `target` explicitly or add `<div data-checktiv>` to your page.");return}if(initialised.has(target))return;initialised.add(target);const shadow=mountShadowHost(target);const verifyOrigin=resolveVerifyOrigin(parsed);listenForCompletion(verifyOrigin,opts.onComplete);const onClick=()=>{const popupUrl=buildPopupUrl(parsed,opts);launchPopup(popupUrl);};R(buildButton(onClick),shadow);}function parseWorkingTokenMintResponse(body){if(typeof body!=="object"||body===null)return null;if(!("workingToken"in body)||!("expiresAt"in body))return null;const workingToken=body.workingToken;const expiresAt=body.expiresAt;if(typeof workingToken!=="string"||workingToken.length===0)return null;if(typeof expiresAt!=="string"||expiresAt.length===0)return null;return {workingToken,expiresAt}}async function mintWorkingTokenFacet(origin,clientToken,publishableKey,fetchImpl){const headers={Authorization:`Bearer ${clientToken}`};if(publishableKey!==void 0)headers[PUBLISHABLE_KEY_HEADER]=publishableKey;const res=await fetchImpl(origin+WORKING_TOKEN_MINT_PATH,{method:"POST",headers});if(!res.ok){throw new Error(`Checktiv working-token mint failed (status ${res.status}).`)}let body;try{body=await res.json();}catch{throw new Error("Checktiv working-token mint returned a non-JSON body.")}const parsed=parseWorkingTokenMintResponse(body);if(parsed===null)throw new Error("Checktiv working-token mint returned a malformed body.");return parsed}function completionSessionId(e){if(e.type!=="checktiv.idv.submitted"&&e.type!=="checktiv.custom_form.submitted"){return null}const sid="sessionId"in e?e.sessionId:void 0;return typeof sid==="string"&&sid.length>0?sid:null}function isSessionExpiredEvent(e){if(!e.type.endsWith(".error")||!("error"in e))return false;const err=e.error;if(typeof err!=="object"||err===null||!("code"in err))return false;return err.code==="session_expired"}function mount(target,opts){const fetchImpl=opts.fetchImpl??fetch;const scope="publishableKey"in opts?{...parsePublishableKey(opts.publishableKey),publishableKey:opts.publishableKey}:{region:opts.region,mode:opts.mode,publishableKey:void 0};const mintOrigin=resolveApiBaseOrigin(opts.apiBase,scope.region,scope.mode);const store=opts.resumeKey!==void 0?createClientTokenStore(opts.resumeKey):null;let clientTokenPromise=null;const getClientToken=()=>{if(clientTokenPromise!==null)return clientTokenPromise;const persisted=store?.read()??null;if(persisted!==null){clientTokenPromise=Promise.resolve(persisted);return clientTokenPromise}const p=opts.fetchToken();clientTokenPromise=p;void p.then(tok=>store?.write(tok),()=>{if(clientTokenPromise===p)clientTokenPromise=null;});return p};const mintWorkingToken=async()=>{const clientToken=await getClientToken();const minted=await mintWorkingTokenFacet(mintOrigin,clientToken,scope.publishableKey,fetchImpl);return {token:minted.workingToken,expiresAt:minted.expiresAt}};const tokens=createWorkingTokenManager(mintWorkingToken);const base={getSessionToken:()=>tokens.get(),...opts.apiBase!==void 0?{apiBase:opts.apiBase}:{}};const initOptions=scope.publishableKey!==void 0?{...base,publishableKey:scope.publishableKey}:{...base,region:scope.region,mode:scope.mode};const needsChannel=opts.onEvent!==void 0||opts.onComplete!==void 0||store!==null;const onEvent=needsChannel?e=>{opts.onEvent?.(e);const sessionId=completionSessionId(e);if(sessionId!==null){store?.clear();opts.onComplete?.({sessionId});}else if(isSessionExpiredEvent(e)){store?.clear();}}:void 0;const client=init(initOptions,{tokens});const handle=client.mountProvisioned({target,fetchImpl,onEvent});const requestResend=confirmEmail=>{if(opts.shortCode===void 0)return Promise.resolve({requested:false});return requestSelfServiceResend({mode:"short_code",origin:mintOrigin,shortCode:opts.shortCode,confirmEmail,fetchImpl})};return {destroy(){handle.destroy();tokens.stop();},requestResend}}function applicantToWire(a){const wire={};if(a.externalId!==void 0)wire.external_id=a.externalId;if(a.email!==void 0)wire.email=a.email;if(a.phone!==void 0)wire.phone=a.phone;if(a.firstName!==void 0)wire.first_name=a.firstName;if(a.lastName!==void 0)wire.last_name=a.lastName;if(a.dateOfBirth!==void 0)wire.date_of_birth=a.dateOfBirth;if(a.referenceName!==void 0)wire.reference_name=a.referenceName;return wire}function readCreatedClientToken(body){if(typeof body!=="object"||body===null||!("data"in body))return null;const data=body.data;if(typeof data!=="object"||data===null||!("client_token"in data))return null;const clientToken=data.client_token;return typeof clientToken==="string"&&clientToken.length>0?clientToken:null}var sessions={async create(input,options){if(typeof window!=="undefined"||typeof document!=="undefined"){throw new Error("checktiv.sessions.create must run on your server: it needs your secret key. Never call it in the browser.")}const fetchImpl=options.fetchImpl??fetch;const headers={Authorization:`Bearer ${options.secretKey}`,"content-type":"application/json"};if(options.idempotencyKey!==void 0)headers["Idempotency-Key"]=options.idempotencyKey;const body=JSON.stringify({workflow_template_id:input.templateId,applicant:applicantToWire(input.applicant)});const res=await fetchImpl(`${options.apiBase}/v1/sessions`,{method:"POST",headers,body});if(!res.ok){throw new Error(`Checktiv sessions.create failed (status ${res.status}). Verify the apiBase origin and secret key.`)}let parsed;try{parsed=await res.json();}catch{throw new Error("Checktiv sessions.create returned a non-JSON response.")}const clientToken=readCreatedClientToken(parsed);if(clientToken===null){throw new Error("Checktiv sessions.create response carried no client token. Enable the working-token capability for this environment, then retry.")}return {clientToken}}};
|
|
11
13
|
|
|
12
|
-
export { mountButton, version };
|
|
14
|
+
export { mount, mountButton, sessions, version };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type CaptureDocumentSide = 'front' | 'back';
|
|
2
|
-
type CaptureErrorCode = 'cv_gate_failed' | 'upload_failed' | 'sdk_load_failed' | 'token_expired' | 'biometric_unsupported' | 'selfie_camera_denied' | 'liveness_camera_denied' | 'liveness_timeout' | 'liveness_server_error' | 'liveness_runtime_error' | 'liveness_cancelled' | 'protocol_mismatch';
|
|
2
|
+
type CaptureErrorCode = 'cv_gate_failed' | 'upload_failed' | 'sdk_load_failed' | 'token_expired' | 'biometric_unsupported' | 'camera_unsupported' | 'selfie_camera_denied' | 'liveness_camera_denied' | 'liveness_timeout' | 'liveness_server_error' | 'liveness_runtime_error' | 'liveness_cancelled' | 'protocol_mismatch';
|
|
3
3
|
interface SelfiePromptMap {
|
|
4
4
|
no_face?: string;
|
|
5
5
|
multiple_faces?: string;
|
|
@@ -9,8 +9,15 @@ interface SelfiePromptMap {
|
|
|
9
9
|
hold_still?: string;
|
|
10
10
|
ready?: string;
|
|
11
11
|
}
|
|
12
|
+
interface SelfieChromeCopy {
|
|
13
|
+
shutterLabel?: string;
|
|
14
|
+
shutterHint?: string;
|
|
15
|
+
confirm?: string;
|
|
16
|
+
retake?: string;
|
|
17
|
+
}
|
|
12
18
|
type DataMode = 'live' | 'test';
|
|
13
19
|
type TestHint = 'pass' | 'review' | 'fail' | 'doc_quality';
|
|
20
|
+
type CaptureLayout = 'inline' | 'immersive';
|
|
14
21
|
interface CaptureBrandTokens {
|
|
15
22
|
primary: string;
|
|
16
23
|
primaryHover: string;
|
|
@@ -23,7 +30,7 @@ interface CaptureTheme {
|
|
|
23
30
|
colorMode: 'light' | 'dark';
|
|
24
31
|
brandTokens: CaptureBrandTokens | null;
|
|
25
32
|
}
|
|
26
|
-
type IdvDocumentType = 'passport' | 'drivers_license' | 'id_card';
|
|
33
|
+
type IdvDocumentType = 'passport' | 'drivers_license' | 'id_card' | 'residence_permit' | 'visa' | 'work_permit';
|
|
27
34
|
interface IdVerificationConfig {
|
|
28
35
|
documentTypes: IdvDocumentType[];
|
|
29
36
|
biometricMode: 'none' | 'selfie' | 'liveness';
|
|
@@ -45,6 +52,7 @@ interface CaptureInitMessage {
|
|
|
45
52
|
beginScanPrompt?: string;
|
|
46
53
|
beginScanLabel?: string;
|
|
47
54
|
selfiePromptMap?: SelfiePromptMap;
|
|
55
|
+
selfieChromeCopy?: SelfieChromeCopy;
|
|
48
56
|
}
|
|
49
57
|
interface IdvR2Keys {
|
|
50
58
|
front: string;
|
|
@@ -98,6 +106,8 @@ type CaptureState = {
|
|
|
98
106
|
kind: 'submit_error';
|
|
99
107
|
} | {
|
|
100
108
|
kind: 'submit_pending';
|
|
109
|
+
} | {
|
|
110
|
+
kind: 'capture_superseded';
|
|
101
111
|
} | {
|
|
102
112
|
kind: 'token_expired';
|
|
103
113
|
} | {
|
|
@@ -131,6 +141,8 @@ type CaptureAction = {
|
|
|
131
141
|
type: 'submit_failed';
|
|
132
142
|
} | {
|
|
133
143
|
type: 'submit_pending';
|
|
144
|
+
} | {
|
|
145
|
+
type: 'capture_superseded';
|
|
134
146
|
} | {
|
|
135
147
|
type: 'token_expired';
|
|
136
148
|
} | {
|
|
@@ -141,4 +153,4 @@ declare function reducer(state: CaptureState, action: CaptureAction): CaptureSta
|
|
|
141
153
|
declare function nextCapturePhaseAfterDocument(side: CaptureDocumentSide, documentTypes: IdVerificationConfig['documentTypes'], biometricMode: IdVerificationConfig['biometricMode']): CapturePhase;
|
|
142
154
|
declare function isBiometricPhase(phase: CapturePhase): boolean;
|
|
143
155
|
|
|
144
|
-
export { type
|
|
156
|
+
export { type CaptureLayout as C, type IdvR2Keys as I, type SelfiePromptMap as S, type CaptureBehaviorMessage as a, type CoachingKind as b, type CaptureAction as c, type CaptureErrorKind as d, type CapturePhase as e, type CaptureState as f, type CaptureInitMessage as g, type SelfieChromeCopy as h, isBiometricPhase as i, nextCapturePhaseAfterDocument as n, reducer as r };
|
package/dist/react.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ReactNode, ReactElement } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { C as CaptureBehaviorMessage } from './machine
|
|
4
|
-
import { M as MountCopy } from './copy-
|
|
2
|
+
import { g as ChecktivIdvEvent, C as ChecktivInitOptions, z as ChecktivInitScope, a as ChecktivClient } from './api-BkCFpMrw.js';
|
|
3
|
+
import { C as CaptureLayout, a as CaptureBehaviorMessage } from './machine-CuZalPFX.js';
|
|
4
|
+
import { M as MountCopy } from './copy-Dfmk11S_.js';
|
|
5
|
+
import './copy-DCeQ4JKx.js';
|
|
5
6
|
|
|
6
7
|
interface ChecktivProviderPropsBase {
|
|
7
8
|
getSessionToken: ChecktivInitOptions['getSessionToken'];
|
|
@@ -15,9 +16,10 @@ declare function useChecktiv(): ChecktivClient;
|
|
|
15
16
|
interface ChecktivIdvProps {
|
|
16
17
|
onEvent: (e: ChecktivIdvEvent) => void;
|
|
17
18
|
copy?: MountCopy;
|
|
19
|
+
layout?: CaptureLayout;
|
|
18
20
|
onBeforeSubmit?: () => Promise<void>;
|
|
19
21
|
onBehaviorSegment?: (segment: Pick<CaptureBehaviorMessage, 'steps' | 'traits'>) => void;
|
|
20
22
|
}
|
|
21
|
-
declare function ChecktivIdv({ onEvent, copy, onBeforeSubmit, onBehaviorSegment, }: ChecktivIdvProps): ReactElement | null;
|
|
23
|
+
declare function ChecktivIdv({ onEvent, copy, layout, onBeforeSubmit, onBehaviorSegment, }: ChecktivIdvProps): ReactElement | null;
|
|
22
24
|
|
|
23
25
|
export { ChecktivIdv, type ChecktivIdvProps, ChecktivProvider, type ChecktivProviderProps, type ChecktivProviderPropsBase, useChecktiv };
|
package/dist/react.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { init } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
import { init } from './chunk-FV2UJL7E.js';
|
|
2
|
+
import './chunk-YGBYH4IK.js';
|
|
3
|
+
import './chunk-GFHNOZVO.js';
|
|
4
|
+
import './chunk-PZJMAB7K.js';
|
|
5
|
+
import './chunk-IQKHRPJR.js';
|
|
6
|
+
import './chunk-ITLSDZHK.js';
|
|
4
7
|
import './chunk-QFA3K5ZV.js';
|
|
5
|
-
import './chunk-WQCYRLWP.js';
|
|
6
8
|
import './chunk-AIK7CDV6.js';
|
|
7
9
|
import { createContext, useMemo, useContext, useRef, useEffect } from 'react';
|
|
8
10
|
import { jsx } from 'react/jsx-runtime';
|
|
9
11
|
|
|
10
|
-
var ChecktivContext=createContext(null);function ChecktivProvider(props){if(typeof window==="undefined")return null;return jsx(ProviderImpl,{...props})}function ProviderImpl(props){const{getSessionToken,theme,locale,children}=props;const scope="publishableKey"in props?{publishableKey:props.publishableKey}:{region:props.region,mode:props.mode};const pk="publishableKey"in props?props.publishableKey:void 0;const region="publishableKey"in props?void 0:props.region;const mode="publishableKey"in props?void 0:props.mode;const themeKey=JSON.stringify(theme??null);const client=useMemo(()=>init({...scope,getSessionToken,theme,locale}),[pk,region,mode,getSessionToken,themeKey,locale]);return jsx(ChecktivContext.Provider,{value:client,children})}function useChecktiv(){const client=useContext(ChecktivContext);if(client===null){throw new Error("useChecktiv must be used within a <ChecktivProvider>. Wrap the component tree that needs the Checktiv client with <ChecktivProvider>.")}return client}function ChecktivIdv({onEvent,copy,onBeforeSubmit,onBehaviorSegment}){const client=useChecktiv();const containerRef=useRef(null);const handleRef=useRef(null);const mountConfigRef=useRef({copy,onBeforeSubmit,onBehaviorSegment});const onEventRef=useRef(onEvent);onEventRef.current=onEvent;useEffect(()=>{if(typeof window==="undefined")return;if(containerRef.current===null)return;if(handleRef.current!==null)return;const mountConfig=mountConfigRef.current;handleRef.current=client.mount("idv",{target:containerRef.current,onEvent:e=>onEventRef.current(e),...mountConfig.copy!==void 0?{copy:mountConfig.copy}:{},...mountConfig.onBeforeSubmit!==void 0?{onBeforeSubmit:mountConfig.onBeforeSubmit}:{},...mountConfig.onBehaviorSegment!==void 0?{onBehaviorSegment:mountConfig.onBehaviorSegment}:{}});return ()=>{handleRef.current?.destroy();handleRef.current=null;}},[client]);if(typeof window==="undefined")return null;return jsx("div",{ref:containerRef})}
|
|
12
|
+
var ChecktivContext=createContext(null);function ChecktivProvider(props){if(typeof window==="undefined")return null;return jsx(ProviderImpl,{...props})}function ProviderImpl(props){const{getSessionToken,theme,locale,children}=props;const scope="publishableKey"in props?{publishableKey:props.publishableKey}:{region:props.region,mode:props.mode};const pk="publishableKey"in props?props.publishableKey:void 0;const region="publishableKey"in props?void 0:props.region;const mode="publishableKey"in props?void 0:props.mode;const themeKey=JSON.stringify(theme??null);const client=useMemo(()=>init({...scope,getSessionToken,theme,locale}),[pk,region,mode,getSessionToken,themeKey,locale]);return jsx(ChecktivContext.Provider,{value:client,children})}function useChecktiv(){const client=useContext(ChecktivContext);if(client===null){throw new Error("useChecktiv must be used within a <ChecktivProvider>. Wrap the component tree that needs the Checktiv client with <ChecktivProvider>.")}return client}function ChecktivIdv({onEvent,copy,layout,onBeforeSubmit,onBehaviorSegment}){const client=useChecktiv();const containerRef=useRef(null);const handleRef=useRef(null);const mountConfigRef=useRef({copy,layout,onBeforeSubmit,onBehaviorSegment});const onEventRef=useRef(onEvent);onEventRef.current=onEvent;useEffect(()=>{if(typeof window==="undefined")return;if(containerRef.current===null)return;if(handleRef.current!==null)return;const mountConfig=mountConfigRef.current;handleRef.current=client.mount("idv",{target:containerRef.current,onEvent:e=>onEventRef.current(e),...mountConfig.copy!==void 0?{copy:mountConfig.copy}:{},...mountConfig.layout!==void 0?{layout:mountConfig.layout}:{},...mountConfig.onBeforeSubmit!==void 0?{onBeforeSubmit:mountConfig.onBeforeSubmit}:{},...mountConfig.onBehaviorSegment!==void 0?{onBehaviorSegment:mountConfig.onBehaviorSegment}:{}});return ()=>{handleRef.current?.destroy();handleRef.current=null;}},[client]);if(typeof window==="undefined")return null;return jsx("div",{ref:containerRef})}
|
|
11
13
|
|
|
12
14
|
export { ChecktivIdv, ChecktivProvider, useChecktiv };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { s as SdkRegion } from './api-BkCFpMrw.js';
|
|
2
|
+
import './machine-CuZalPFX.js';
|
|
3
|
+
import './copy-Dfmk11S_.js';
|
|
4
|
+
import './copy-DCeQ4JKx.js';
|
|
5
|
+
|
|
6
|
+
interface WorkspaceTokenBundle {
|
|
7
|
+
readonly framingToken: string;
|
|
8
|
+
readonly dataToken: string;
|
|
9
|
+
readonly expiresAt?: string | number;
|
|
10
|
+
}
|
|
11
|
+
type WorkspaceGetToken = (ctx: {
|
|
12
|
+
readonly sessionId: string;
|
|
13
|
+
readonly reason: 'initial' | 'refresh';
|
|
14
|
+
}) => Promise<WorkspaceTokenBundle>;
|
|
15
|
+
|
|
16
|
+
interface WorkspaceThemeConfig {
|
|
17
|
+
readonly primaryColor?: string;
|
|
18
|
+
readonly colorMode?: 'light' | 'dark' | 'auto';
|
|
19
|
+
readonly logoUrl?: string;
|
|
20
|
+
readonly brandName?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type WorkspaceNavigationEvent = 'session_complete' | 'navigate_away';
|
|
24
|
+
type WorkspaceErrorCode = 'session_expired' | 'protocol_mismatch' | 'origin_rejected' | 'nonce_mismatch';
|
|
25
|
+
|
|
26
|
+
interface ChecktivWorkspaceNavigationEvent {
|
|
27
|
+
readonly type: 'checktiv.workspace.navigate';
|
|
28
|
+
readonly intent: WorkspaceNavigationEvent;
|
|
29
|
+
}
|
|
30
|
+
interface ChecktivWorkspaceErrorEvent {
|
|
31
|
+
readonly type: 'checktiv.workspace.error';
|
|
32
|
+
readonly code: WorkspaceErrorCode;
|
|
33
|
+
readonly recoverable: boolean;
|
|
34
|
+
readonly recovery: 'retry_review' | 'reload_host';
|
|
35
|
+
}
|
|
36
|
+
type ChecktivWorkspaceEvent = ChecktivWorkspaceNavigationEvent | ChecktivWorkspaceErrorEvent | {
|
|
37
|
+
readonly type: `checktiv.workspace.${string}`;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
interface MountReviewerOptions {
|
|
41
|
+
readonly sessionId: string;
|
|
42
|
+
readonly target: HTMLElement;
|
|
43
|
+
onEvent?(event: ChecktivWorkspaceEvent): void;
|
|
44
|
+
}
|
|
45
|
+
interface ReviewerHandle {
|
|
46
|
+
destroy(): void;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface WorkspaceConfig {
|
|
50
|
+
readonly getToken: WorkspaceGetToken;
|
|
51
|
+
readonly region: SdkRegion;
|
|
52
|
+
readonly workspaceBaseUrl?: string;
|
|
53
|
+
readonly theme?: WorkspaceThemeConfig;
|
|
54
|
+
}
|
|
55
|
+
interface WorkspaceClient {
|
|
56
|
+
mount(component: 'reviewer', options: MountReviewerOptions): ReviewerHandle;
|
|
57
|
+
}
|
|
58
|
+
declare function workspace(config: WorkspaceConfig): WorkspaceClient;
|
|
59
|
+
|
|
60
|
+
export { type ChecktivWorkspaceErrorEvent, type ChecktivWorkspaceEvent, type ChecktivWorkspaceNavigationEvent, type MountReviewerOptions, type ReviewerHandle, type WorkspaceClient, type WorkspaceConfig, type WorkspaceGetToken, type WorkspaceThemeConfig, type WorkspaceTokenBundle, workspace };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { isCanonicalOrigin, sdkPublicSettings } from './chunk-ITLSDZHK.js';
|
|
2
|
+
import { getServiceOrigin } from './chunk-QFA3K5ZV.js';
|
|
3
|
+
import './chunk-AIK7CDV6.js';
|
|
4
|
+
|
|
5
|
+
function isOriginTargetedPoster(value){return typeof value==="object"&&value!==null&&"postMessage"in value}function initTransport(options,announce){const{win,allowedOrigins,parse,onMessage,accept,reAnnounce}=options;if(!Array.isArray(allowedOrigins)||allowedOrigins.length===0){return {teardown:()=>{}}}const allowlist=new Set(allowedOrigins);const onMessageListener=event=>{if(!allowlist.has(event.origin))return;const parsed=parse(event.data);if(parsed===null)return;if(accept&&!accept(parsed,event.origin))return;const source=event.source;if(!isOriginTargetedPoster(source))return;const post=message=>source.postMessage(message,event.origin);onMessage(parsed,post,event.origin);};win.addEventListener("message",onMessageListener);const broadcast=message=>{for(const origin of allowlist){win.parent.postMessage(message,origin);}};let timer=null;if(reAnnounce!==void 0&&reAnnounce.maxAttempts>0){const scheduler=reAnnounce.schedule??{set:(cb,ms)=>setTimeout(cb,ms),clear:handle=>clearTimeout(handle)};let attemptsLeft=reAnnounce.maxAttempts;const tick=()=>{if(attemptsLeft<=0){timer=null;return}attemptsLeft-=1;broadcast(reAnnounce.message);timer=attemptsLeft>0?scheduler.set(tick,reAnnounce.intervalMs):null;};timer=scheduler.set(tick,reAnnounce.intervalMs);return {teardown:()=>{win.removeEventListener("message",onMessageListener);if(timer!==null){scheduler.clear(timer);timer=null;}}}}return {teardown:()=>{win.removeEventListener("message",onMessageListener);}}}var REVIEWER_COMPONENT="reviewer";var LOADER_PROTOCOL_VERSION=1;var NAVIGATION_EVENTS=new Set(["session_complete","navigate_away"]);function parseWorkspaceInbound(data){if(typeof data!=="object"||data===null)return null;const record=data;const type=record.type;if(type==="wk:ready"){if(record.component!==REVIEWER_COMPONENT)return null;if(typeof record.sessionId!=="string"||record.sessionId.length===0)return null;if(typeof record.nonce!=="string"||record.nonce.length===0)return null;return {type:"wk:ready",component:REVIEWER_COMPONENT,sessionId:record.sessionId,nonce:record.nonce,...typeof record.protocolVersion==="number"?{protocolVersion:record.protocolVersion}:{}}}if(type==="wk:token_refresh"){return {type:"wk:token_refresh",...typeof record.protocolVersion==="number"?{protocolVersion:record.protocolVersion}:{}}}if(type==="wk:event"){if(record.component!==REVIEWER_COMPONENT)return null;const event=record.event;if(typeof event!=="string"||!NAVIGATION_EVENTS.has(event)){return null}return {type:"wk:event",component:REVIEWER_COMPONENT,event,...typeof record.protocolVersion==="number"?{protocolVersion:record.protocolVersion}:{}}}if(type==="wk:error"){const code=record.code;if(code!=="session_expired"&&code!=="protocol_mismatch"&&code!=="origin_rejected"&&code!=="nonce_mismatch"){return null}return {type:"wk:error",code,...typeof record.protocolVersion==="number"?{protocolVersion:record.protocolVersion}:{}}}return null}function makeNonce(){const c=globalThis.crypto;if(c&&typeof c.randomUUID==="function")return c.randomUUID();return `wkn_${Date.now().toString(36)}_${Math.random().toString(36).slice(2)}`}function buildInitMessage(dataToken,nonce){return {type:"wk:init",component:REVIEWER_COMPONENT,dataToken,nonce,protocolVersion:LOADER_PROTOCOL_VERSION}}function buildErrorMessage(code){return {type:"wk:error",code,protocolVersion:LOADER_PROTOCOL_VERSION}}function wireWorkspaceTransport(options){const{win,workspaceOrigin,currentNonce,handlers}=options;return initTransport({win,allowedOrigins:[workspaceOrigin],parse:parseWorkspaceInbound,accept:message=>{if(message.type!=="wk:ready")return true;const current=currentNonce();if(current===null)return true;return message.nonce===current},onMessage:(message,post,origin)=>{switch(message.type){case "wk:ready":handlers.onReady(message,post,origin);return;case "wk:token_refresh":handlers.onTokenRefresh(post,origin);return;case "wk:event":handlers.onNavigation(message.event,origin);return;case "wk:error":handlers.onError(message,origin);return;default:return assertNeverInbound(message)}}})}function assertNeverInbound(message){throw new Error(`Unhandled workspace inbound message: ${JSON.stringify(message)}`)}function createWorkspaceTokenPair(getToken,sessionId){let cached=null;let pending=null;let liveDataToken=null;const mint=reason=>{const p=getToken({sessionId:sessionId(),reason});void p.then(bundle=>{liveDataToken=bundle.dataToken;},()=>{});return p};const initialBundle=()=>{if(cached!==null)return cached;const p=mint("initial");cached=p;void p.catch(()=>{if(cached===p)cached=null;});return p};return {framingToken(){return initialBundle().then(b=>b.framingToken)},currentDataToken(){return liveDataToken},dataToken(){return initialBundle().then(b=>b.dataToken)},refreshDataToken(){if(pending!==null)return pending.then(b=>b.dataToken);const p=mint("refresh");pending=p;cached=p;void p.then(()=>{if(pending===p)pending=null;},()=>{if(pending===p)pending=null;if(cached===p)cached=null;});return p.then(b=>b.dataToken)}}}function resolveWorkspaceOrigin(region){return getServiceOrigin(sdkPublicSettings.apps["workspace-embed"].subdomain,"prod",region,sdkPublicSettings)}function resolveWorkspaceBaseOrigin(workspaceBaseUrl,region){if(isCanonicalOrigin(workspaceBaseUrl))return workspaceBaseUrl;return resolveWorkspaceOrigin(region)}var REVIEWER_PATH_PREFIX="/reviewer";function buildReviewerSrc(origin,sessionId,framingToken,theme){const path=`${REVIEWER_PATH_PREFIX}/${encodeURIComponent(sessionId)}`;const url=new URL(path,`${origin}/`);url.searchParams.set("ctx",framingToken);if(theme?.primaryColor!==void 0&&theme.primaryColor.length>0){url.searchParams.set("primary",theme.primaryColor);}if(theme?.colorMode!==void 0){url.searchParams.set("mode",theme.colorMode);}if(theme?.logoUrl!==void 0&&theme.logoUrl.length>0){url.searchParams.set("logo",theme.logoUrl);}if(theme?.brandName!==void 0&&theme.brandName.length>0){url.searchParams.set("brand",theme.brandName);}return url.toString()}var IFRAME_SANDBOX="allow-scripts allow-same-origin allow-downloads";function createReviewerController(deps){return {mount(options){return mountReviewer(deps,options)}}}function mountReviewer(deps,options){const doc=deps.doc??deps.win.document;const{sessionId,target,onEvent}=options;const tokens=createWorkspaceTokenPair(deps.getToken,()=>sessionId);const workspaceOrigin=resolveWorkspaceBaseOrigin(deps.workspaceBaseUrl,deps.region);let currentNonce=null;let consecutiveRefreshRejects=0;const container=doc.createElement("div");target.appendChild(container);const iframe=doc.createElement("iframe");iframe.setAttribute("title","Identity review");iframe.setAttribute("sandbox",IFRAME_SANDBOX);iframe.setAttribute("referrerpolicy","no-referrer");container.appendChild(iframe);let destroyed=false;let transport=null;const emit=event=>{if(destroyed)return;try{onEvent?.(event);}catch{}};const deliverInit=(dataToken,post)=>{if(destroyed)return;currentNonce=makeNonce();post(buildInitMessage(dataToken,currentNonce));};transport=wireWorkspaceTransport({win:deps.win,workspaceOrigin,currentNonce:()=>currentNonce,handlers:{onReady:(_message,post)=>{consecutiveRefreshRejects=0;if(currentNonce!==null)return;void tokens.dataToken().then(dataToken=>{if(destroyed)return;deliverInit(dataToken,post);}).catch(()=>{emit({type:"checktiv.workspace.error",code:"session_expired",recoverable:true,recovery:"retry_review"});});},onTokenRefresh:post=>{void tokens.refreshDataToken().then(fresh=>{consecutiveRefreshRejects=0;deliverInit(fresh,post);}).catch(()=>{if(destroyed)return;consecutiveRefreshRejects+=1;if(consecutiveRefreshRejects>=2){post(buildErrorMessage("session_expired"));emit({type:"checktiv.workspace.error",code:"session_expired",recoverable:true,recovery:"retry_review"});}});},onNavigation:intent=>{emit({type:"checktiv.workspace.navigate",intent});},onError:message=>{const recoverable=message.code==="session_expired";emit({type:"checktiv.workspace.error",code:message.code,recoverable,recovery:recoverable?"retry_review":"reload_host"});}}});void tokens.framingToken().then(framingToken=>{if(destroyed)return;iframe.src=buildReviewerSrc(workspaceOrigin,sessionId,framingToken,deps.theme);}).catch(()=>{emit({type:"checktiv.workspace.error",code:"session_expired",recoverable:true,recovery:"retry_review"});});return {destroy(){if(destroyed)return;destroyed=true;transport?.teardown();transport=null;container.remove();}}}function workspace(config){const controller=createReviewerController({getToken:config.getToken,region:config.region,workspaceBaseUrl:config.workspaceBaseUrl,theme:config.theme,win:window});return {mount(_component,options){return controller.mount(options)}}}
|
|
6
|
+
|
|
7
|
+
export { workspace };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checktiv/sdk-web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"//publishConfigNameNote": "pnpm does NOT apply `publishConfig.name` (the publishConfig override list at https://pnpm.io/package_json#publishconfig excludes `name`; `pnpm pack` leaves the tarball `name` as the workspace name). The published `name` rewrite to `@checktiv/sdk-web` happens in the root `.pnpmfile.cjs` `beforePacking` hook (pnpm >= 10.28) instead — see that file's header. This field is retained ONLY as documentation of intent; the hook deletes it from the packed manifest. The packed-name gate in __tests__/dist-shape.test.ts reads the REAL extracted tarball, not this field.",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"type": "module",
|
|
13
13
|
"//exportsNote": "Dual conditions: `types` resolves to the source `.ts` file so in-repo consumers (verify, console) type-check against source without a build step (mirrors @rf/schemas pattern). `import` resolves to the compiled `dist/*.js` for the published npm package. `./agent` is a SOURCE-ONLY interim export (tsup profile A does not build a dist/agent.js yet; the verify app consumes it via its own bundler). `./agents` ships the C13 machine-readable steering manifest; `AGENTS.md` lives alongside it in dist/agents/ (discoverable via the file tree, no export entry to avoid publint resolution warnings). `src/cdn.ts` is the CDN-IIFE-only entry (tsup profile B) and is NOT a published subpath.",
|
|
14
14
|
"//customFormStyleNote": "`./custom-form/style.css` exports the custom-form module's field stylesheet so the verify host can `import '@rf/sdk-web/custom-form/style.css'` from its island: the module renders REAL DOM field controls into the host document (unlike the IDV iframe), so its CSS must be injected into the host page. The workspace map points at the SOURCE css so verify's Vite processes + injects it WITHOUT a prior sdk-web dist build (dev-friendly); the publishConfig override points at the extracted `dist/custom-form.css` for CDN customers (who `<link>` it, like `capture-ui.css`). ONE stylesheet, single-sourced in `src/custom-form/custom-form.css`, theme-aware via `@rf/theme` tokens.",
|
|
15
|
+
"//captureUiStyleNote": "`./capture-ui/style.css` exports the Tier-2 capture-frame stylesheet (`src/capture-ui/capture-ui.css`: frame sizing, biometric height, the C6 landscape clamp, and the phone immersive `layout` overlay) for the SAME reason as `./custom-form/style.css`. tsup EXTRACTS `capture-ui.css` to `dist/capture-ui.css` and STRIPS the source `import './capture-ui.css'` from the built JS, so an in-repo consumer bundling the `import`-condition `dist/*.js` (verify's PROD build) never auto-pulls the stylesheet and the frame ships UNSTYLED on deployed cells (local dev resolves the `types`/source condition, where the import IS followed — which is why it only regressed on a deployed cell). Verify imports `@rf/sdk-web/capture-ui/style.css` from `SdkIdVerificationIsland` (workspace map -> SOURCE, so Vite bundles it build-independently); the publishConfig override points at `dist/capture-ui.css` for CDN customers who `<link>` it.",
|
|
15
16
|
"exports": {
|
|
16
17
|
".": {
|
|
17
18
|
"types": "./dist/index.d.ts",
|
|
@@ -42,6 +43,11 @@
|
|
|
42
43
|
"types": "./dist/capture-ui.d.ts",
|
|
43
44
|
"import": "./dist/capture-ui.js"
|
|
44
45
|
},
|
|
46
|
+
"./capture-ui/style.css": "./dist/capture-ui.css",
|
|
47
|
+
"./workspace": {
|
|
48
|
+
"types": "./dist/workspace.d.ts",
|
|
49
|
+
"import": "./dist/workspace.js"
|
|
50
|
+
},
|
|
45
51
|
"./cross-device": {
|
|
46
52
|
"types": "./dist/cross-device.d.ts",
|
|
47
53
|
"import": "./dist/cross-device.js"
|
|
@@ -53,13 +59,16 @@
|
|
|
53
59
|
"./agents": "./dist/agents/manifest.json",
|
|
54
60
|
"./package.json": "./package.json"
|
|
55
61
|
},
|
|
56
|
-
"//
|
|
62
|
+
"//challengeExportNote": "The `./challenge` subpath (top-level `exports` only, ABSENT from `publishConfig.exports`) is the generic parent-side challenge relay kernel consumed by `apps/verify` (ChallengeIframe). It stays OFF the npm-publish boundary (no schema-mirror / dist-shape / bundle-budget / CDN build), like `./agent`. tsup emits `dist/challenge.js` from the entry map for the in-repo `import` condition.",
|
|
63
|
+
"//sideEffectsNote": "The module-load seam (src/substrate/module-registry.ts) makes the `./idv`, `./fraud`, and `./custom-form` entries SIDE-EFFECTFUL: each calls registerModule(...) at import-eval time so the substrate's mount('idv'|'fraud'|'custom_form')/mountProvisioned can resolve it. `./idv/cross-device` is ALSO side-effectful: it calls registerCrossDeviceOpener(...) (src/idv/cross-device-registry.ts) so createIdv().openCrossDevice() (S13/B2) resolves the overlay WITHOUT idv/index.ts importing the heavy orchestrator (keeps the CDN sdk.js flat). A blanket `sideEffects: false` would let a consumer's bundler tree-shake those registrations away (breaking the seams), so this lists ONLY the side-effectful entry files (src + published dist forms). Everything else still tree-shakes, so the `.` and `./react` entries stay Zod-free and per-subpath tree-shaking holds. When plan-C rewrites this manifest, KEEP this array (do NOT replace it with `false`).",
|
|
57
64
|
"sideEffects": [
|
|
58
65
|
"./src/idv/index.ts",
|
|
66
|
+
"./src/idv/cross-device.ts",
|
|
59
67
|
"./src/fraud/index.ts",
|
|
60
68
|
"./src/custom-form/index.ts",
|
|
61
69
|
"./src/cdn.ts",
|
|
62
70
|
"./dist/idv.js",
|
|
71
|
+
"./dist/idv/cross-device.js",
|
|
63
72
|
"./dist/fraud.js",
|
|
64
73
|
"./dist/custom-form.js",
|
|
65
74
|
"*.css"
|
|
@@ -105,12 +114,13 @@
|
|
|
105
114
|
"vitest": "^4.1.9",
|
|
106
115
|
"@rf/config": "0.0.0",
|
|
107
116
|
"@rf/schemas": "0.1.0",
|
|
108
|
-
"@rf/
|
|
109
|
-
"@rf/
|
|
117
|
+
"@rf/iam-core": "0.0.1",
|
|
118
|
+
"@rf/theme": "0.1.0"
|
|
110
119
|
},
|
|
111
120
|
"scripts": {
|
|
112
|
-
"build": "tsup && node scripts/generate-agent-steering.mjs && pnpm run build:embed-capture && pnpm run build:host-capture && pnpm run build:cross-device",
|
|
121
|
+
"build": "tsup && node scripts/generate-agent-steering.mjs && pnpm run build:embed-capture && pnpm run build:embed-challenge && pnpm run build:host-capture && pnpm run build:cross-device",
|
|
113
122
|
"build:embed-capture": "node scripts/build-embed-capture.mjs",
|
|
123
|
+
"build:embed-challenge": "node scripts/build-embed-challenge.mjs",
|
|
114
124
|
"build:host-capture": "node scripts/build-host-capture.mjs",
|
|
115
125
|
"build:cross-device": "node scripts/build-cross-device.mjs",
|
|
116
126
|
"test": "vitest run",
|
package/dist/chunk-BYTKOKAD.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { resolveSession } from './chunk-CXNPD67Z.js';
|
|
2
|
-
import { resolveApiBaseOrigin, createTokenManager, getModule } from './chunk-FGWZZNAN.js';
|
|
3
|
-
import { createChecktivError } from './chunk-WQCYRLWP.js';
|
|
4
|
-
|
|
5
|
-
var PUBLISHABLE_KEY_REGEX=/^ah_pk_(us|eu)_(live|test)_[A-Za-z0-9_-]{8,}$/;var InvalidPublishableKeyError=class extends Error{constructor(message){super(message);this.name="InvalidPublishableKeyError";}};function parsePublishableKey(key){const match=PUBLISHABLE_KEY_REGEX.exec(key);if(!match){throw new InvalidPublishableKeyError(`Invalid publishable key format. Expected ah_pk_<us|eu>_<live|test>_<token>, got: ${maskKey(key)}`)}const region=match[1];const mode=match[2];if(region!=="us"&®ion!=="eu"){throw new InvalidPublishableKeyError(`Invalid region in publishable key: ${maskKey(key)}`)}if(mode!=="test"&&mode!=="live"){throw new InvalidPublishableKeyError(`Invalid mode in publishable key: ${maskKey(key)}`)}return {region,mode}}function maskKey(key){if(key.length<=8)return "***";return `${key.slice(0,6)}...${key.slice(-2)}`}function moduleErrorEvent(name,error){switch(name){case "idv":return {type:"checktiv.idv.error",error};case "fraud":return {type:"checktiv.fraud.error",error};case "custom_form":return {type:"checktiv.custom_form.error",error}}}function missingModuleMessage(name){return `This session requires the '${name}' module. Import '@checktiv/sdk-web/${name}' in your app.`}function missingModuleError(name){const base=createChecktivError("sdk_load_failed");return moduleErrorEvent(name,{...base,message:missingModuleMessage(name)})}function consentGateRequiredError(){const base=createChecktivError("sdk_load_failed");return moduleErrorEvent("fraud",{...base,message:"This session includes the 'fraud' module, which needs a consent gate. Pass onConsent to mountProvisioned() to enable it."})}function customFormConfigRequiredError(){const base=createChecktivError("sdk_load_failed");return moduleErrorEvent("custom_form",{...base,message:"This session includes the 'custom_form' module, which needs its form config. Pass customFormConfig to mountProvisioned() to enable it."})}function unmappedStepTypeError(stepType){const base=createChecktivError("sdk_load_failed");return moduleErrorEvent("idv",{...base,message:`This session's current step ('${stepType}') has no matching visual module in this SDK build. Upgrade '@checktiv/sdk-web' to a version that renders this step.`})}var MODULE_IS_VISUAL={idv:true,fraud:false,custom_form:true};var STEP_TYPE_TO_VISUAL_MODULE={id_verification:"idv",custom_form:"custom_form"};var stepTypeToVisualModuleView=STEP_TYPE_TO_VISUAL_MODULE;function resolveCurrentStepVisualModule(stepType){return stepTypeToVisualModuleView[stepType]}function defaultLoadModule(name){if(name==="idv"){const factory2=getModule("idv");if(factory2===void 0)return Promise.resolve(null);return Promise.resolve({mount:(ctx,opts)=>factory2(ctx,{target:opts.target,onEvent:opts.onEvent,copy:opts.copy,onBeforeSubmit:opts.onBeforeSubmit,onBehaviorSegment:opts.onBehaviorSegment,synthetic:opts.synthetic})})}if(name==="custom_form"){const factory2=getModule("custom_form");if(factory2===void 0)return Promise.resolve(null);return Promise.resolve({mount:(ctx,opts)=>{if(opts.customFormConfig===void 0){opts.onEvent?.(customFormConfigRequiredError());return {destroy:()=>void 0}}return factory2(ctx,{target:opts.target,config:opts.customFormConfig,copy:opts.customFormCopy,onEvent:opts.onEvent,session:opts.session})}})}const factory=getModule("fraud");if(factory===void 0)return Promise.resolve(null);return Promise.resolve({mount:(ctx,opts)=>{const onConsent=opts.onConsent;if(onConsent===void 0){opts.onEvent?.(consentGateRequiredError());return {destroy:()=>void 0}}return factory(ctx,{onConsent,onEvent:opts.onEvent})}})}function moduleErrorFor(name,code){return moduleErrorEvent(name,createChecktivError(code))}function createMountProvisioned(ctx,opts,deps={}){const emit=e=>opts.onEvent?.(e);const fetchImpl=opts.fetchImpl??fetch;const resolveSession2=deps.resolveSession??(()=>resolveSession(ctx,fetchImpl));const loadModule=deps.loadModule??defaultLoadModule;const handles=[];let destroyed=false;void(async()=>{try{await composeModules();}catch(err){if(destroyed)return;console.warn("[Checktiv] mountProvisioned composition failed.",err);emit(moduleErrorFor("idv","sdk_load_failed"));}})();async function composeModules(){const session=await resolveSession2();if(destroyed)return;if(session===null){emit(moduleErrorFor("idv","session_expired"));return}const currentStepVisualModule=resolveCurrentStepVisualModule(session.stepType);if(currentStepVisualModule===void 0&&session.modules.some(m=>MODULE_IS_VISUAL[m])){emit(unmappedStepTypeError(session.stepType));return}for(const name of session.modules){if(destroyed)return;if(MODULE_IS_VISUAL[name]&&name!==currentStepVisualModule){continue}if(name==="fraud"&&opts.onConsent===void 0){emit(consentGateRequiredError());continue}const mod=await loadModule(name);if(destroyed)return;if(mod===null){emit(missingModuleError(name));continue}let moduleTarget;let containerToRemove=null;if(MODULE_IS_VISUAL[name]){const resolvedParent=typeof opts.target==="string"?typeof document!=="undefined"?document.querySelector(opts.target):null:opts.target;if(resolvedParent!==null){const container=document.createElement("div");resolvedParent.appendChild(container);containerToRemove=container;moduleTarget=container;}else {moduleTarget=opts.target;}}else {moduleTarget=opts.target;}let innerHandle;try{innerHandle=mod.mount(ctx,{target:moduleTarget,onEvent:opts.onEvent,onConsent:opts.onConsent,copy:opts.copy,onBeforeSubmit:opts.onBeforeSubmit,onBehaviorSegment:opts.onBehaviorSegment,synthetic:opts.synthetic,customFormConfig:opts.customFormConfig,customFormCopy:opts.customFormCopy,session:{sessionId:session.sessionId,stepId:session.stepId}});}catch(err){containerToRemove?.remove();throw err}const capturedContainer=containerToRemove;const handle={destroy(){try{innerHandle.destroy();}finally{capturedContainer?.remove();}}};if(destroyed){handle.destroy();return}handles.push(handle);}}return {destroy(){destroyed=true;while(handles.length>0){const handle=handles.pop();handle?.destroy();}}}}function init(opts){const scope="publishableKey"in opts?{...parsePublishableKey(opts.publishableKey),publishableKey:opts.publishableKey}:{region:opts.region,mode:opts.mode,publishableKey:void 0};let sessionId="";const apiBaseOrigin=resolveApiBaseOrigin(opts.apiBase,scope.region,scope.mode);const ctx={region:scope.region,mode:scope.mode,publishableKey:scope.publishableKey,apiBaseOrigin,theme:opts.theme,locale:opts.locale??"en",betas:opts.betas??[],...opts.selfiePromptMap!==void 0?{selfiePromptMap:opts.selfiePromptMap}:{},tokens:createTokenManager(opts.getSessionToken,()=>sessionId),getSessionId:()=>sessionId,setSessionId:id=>{sessionId=id;}};function mount(...args){if(args[0]==="idv"){const factory2=getModule("idv");if(factory2===void 0)return missingIdvHandle(args[1]);return factory2(ctx,args[1])}if(args[0]==="custom_form"){const factory2=getModule("custom_form");if(factory2===void 0)return missingCustomFormHandle(args[1]);return factory2(ctx,args[1])}const factory=getModule("fraud");if(factory===void 0)return missingFraudHandle(args[1]);return factory(ctx,args[1])}return {mountProvisioned:provOpts=>createMountProvisioned(ctx,provOpts),mount}}function missingIdvHandle(opts){const base=createChecktivError("sdk_load_failed");opts.onEvent?.({type:"checktiv.idv.error",error:{...base,message:missingModuleMessage("idv")}});return {destroy:()=>void 0,unmount:()=>void 0}}function missingFraudHandle(opts){const base=createChecktivError("sdk_load_failed");opts.onEvent?.({type:"checktiv.fraud.error",error:{...base,message:missingModuleMessage("fraud")}});return {destroy:()=>void 0}}function missingCustomFormHandle(opts){const base=createChecktivError("sdk_load_failed");const error={type:"checktiv.custom_form.error",error:{...base,message:missingModuleMessage("custom_form")}};opts.onEvent?.(error);return {destroy:()=>void 0}}
|
|
6
|
-
|
|
7
|
-
export { InvalidPublishableKeyError, init, parsePublishableKey };
|
package/dist/chunk-C7H2ZVQT.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { u } from './chunk-HV2QKVJX.js';
|
|
2
|
-
import { R, k } from './chunk-XOGHMNBX.js';
|
|
3
|
-
import { createCaptureController, isBiometricPhase, coachingKindForState } from './chunk-TRTAZKYV.js';
|
|
4
|
-
|
|
5
|
-
function coachingFallback(kind){switch(kind){case "move_closer":return "Move a little closer.";case "move_farther":return "Move a little farther away.";case "reduce_glare":return "Reduce glare: tilt away from bright light.";case "too_dark":return "Find a brighter, well-lit spot.";case "wrong_side":return "Show the other side of your document.";case "hold_steady":return "Hold steady and keep everything in frame."}}function statusFallback(phase){switch(phase){case "ready":return "Getting the camera ready.";case "document_front":return "Position the front of your document in the frame.";case "document_back":return "Now show the back of your document.";case "selfie":return "Center your face in the frame.";case "liveness":return "Follow the on-screen prompts to confirm it is you.";case "uploading":return "Uploading. This takes a few seconds.";case "coaching":return "Hold steady and keep everything in frame."}}function errorFallback(kind){switch(kind){case "cv_gate_failed":return "We could not read that capture. Please try again in good lighting.";case "upload_failed":return "The upload did not finish. Check your connection and try again.";case "sdk_load_failed":return "The capture tools could not load. Refresh, or continue on your phone.";case "biometric_unsupported":return "This device cannot run the selfie check. Please continue on your phone.";case "selfie_camera_denied":return "Camera access was blocked. Allow the camera, or continue on your phone.";case "liveness_camera_denied":return "Camera access was blocked. Allow the camera, or continue on your phone.";case "liveness_timeout":return "The check timed out. Please try again.";case "liveness_server_error":return "Something went wrong on our side. Please try again.";case "liveness_runtime_error":return "The check could not run. Refresh and try again.";case "liveness_cancelled":return "The check was canceled. Please try again when you are ready.";case "protocol_mismatch":return "This version of the verification tool is no longer supported. Please contact the operator to continue."}}function terminalFallback(kind){switch(kind){case "mint_error":return "We could not start verification. Please try again.";case "submit_error":return "We could not submit your capture. Please try again.";case "token_expired":return "This step expired for your security. Please refresh to start again."}}var fallbackCopy={cvReject:(_attemptIndex,kind)=>`We could not use that photo. ${coachingFallback(kind)}`,error:errorFallback,status:statusFallback,coaching:coachingFallback,terminal:terminalFallback,tryAgain:()=>"Try again",frameTitle:()=>"Identity verification capture"};var IFRAME_SANDBOX="allow-scripts allow-same-origin";function phaseOf(state){if(state.kind==="capturing")return state.phase;return "ready"}function statusLine(state,copy){if(state.kind==="capturing"&&state.phase==="coaching"&&state.coaching!==null){return (copy.coaching??fallbackCopy.coaching)(state.coaching)}return (copy.status??fallbackCopy.status)(phaseOf(state))}function CvRejectAlert({reason,attemptIndex,copy}){const kind=coachingKindForState(reason);const text=(copy.cvReject??fallbackCopy.cvReject)(attemptIndex,kind);return u("div",{role:"status","data-testid":"idv-cv-reject-alert",className:"idv-capture-cv-reject",style:"margin-bottom: 0.75rem;",children:text})}function CaptureFrame({state,attemptIndex,getEmbedSrc,onTryAgain,copy,colorMode="light"}){switch(state.kind){case "minting":return u("p",{className:"idv-capture-status",children:(copy.status??fallbackCopy.status)("ready")});case "mint_error":case "submit_error":case "token_expired":return u("div",{className:"idv-capture-error",role:"alert",children:[u("p",{children:(copy.terminal??fallbackCopy.terminal)(state.kind)}),u("button",{type:"button",onClick:onTryAgain,className:"idv-capture-retry",children:copy.tryAgain??fallbackCopy.tryAgain()})]});case "capture_error":{const errorKind=state.errorKind;const terminal=errorKind==="protocol_mismatch";return u("div",{className:"idv-capture-error",role:"alert",children:[u("p",{children:(copy.error??fallbackCopy.error)(errorKind)}),!terminal&&u("button",{type:"button",onClick:onTryAgain,className:"idv-capture-retry",children:copy.tryAgain??fallbackCopy.tryAgain()})]})}case "submitting":case "submit_pending":return u("p",{className:"idv-capture-status",children:(copy.status??fallbackCopy.status)("uploading")});case "waiting_for_init":case "ready":case "capturing":{const phase=phaseOf(state);const biometric=isBiometricPhase(phase);const frameClass=biometric?"idv-capture-frame idv-capture-frame--biometric":"idv-capture-frame";const reason=state.kind==="capturing"?state.lastCvRejectReason:null;const biometricLoading=biometric&&state.kind==="capturing"&&state.biometricLoading;const embedSrc=getEmbedSrc(state.embedOrigin);return u("div",{className:"idv-capture-active",children:[reason!==null&&u(CvRejectAlert,{reason,attemptIndex,copy}),biometricLoading&&u("div",{"data-testid":"idv-capture-skeleton","data-color-mode":colorMode,className:"idv-capture-skeleton","aria-hidden":"true"}),u("iframe",{className:frameClass,title:copy.frameTitle??fallbackCopy.frameTitle(),src:embedSrc,allow:"camera",sandbox:IFRAME_SANDBOX}),u("p",{className:"idv-capture-status","aria-live":"polite",children:statusLine(state,copy)})]})}default:{const _exhaustive=state;return _exhaustive}}}function mount(element,options){const{copy,onState,onControllerEvent,...deps}=options;const resolvedInitPayload=deps.initPayload();const controller=createCaptureController({...deps,initPayload:()=>resolvedInitPayload,getIframe:()=>element.querySelector("iframe.idv-capture-frame")});let destroyed=false;let state={kind:"minting"};let attemptIndex=0;const onTryAgain=()=>{if(typeof window!=="undefined")window.location.reload();};const paint=()=>{if(destroyed)return;R(k(CaptureFrame,{state,attemptIndex,getEmbedSrc:deps.getEmbedSrc,onTryAgain,copy,colorMode:resolvedInitPayload.theme.colorMode}),element);};const safeObserve=(fn,arg)=>{if(fn===void 0)return;try{fn(arg);}catch(err){console.warn("[Checktiv] capture observer threw; ignoring (observational only).",err);}};const unsubState=controller.subscribe(next=>{state=next;paint();safeObserve(onState,next);});const offReject=controller.on("selfie-cv-reject",event=>{if(event.type==="selfie-cv-reject"){attemptIndex=event.attemptIndex;paint();}safeObserve(onControllerEvent,event);});const offComplete=controller.on("all-complete",event=>{safeObserve(onControllerEvent,event);});controller.start();return {destroy(){if(destroyed)return;destroyed=true;unsubState();offReject();offComplete();R(null,element);controller.destroy();}}}
|
|
6
|
-
|
|
7
|
-
export { fallbackCopy, mount };
|
package/dist/chunk-CXNPD67Z.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { sdkPublicSettings, withTokenRetry, SESSIONS_ME_PATH, dataPlaneHeaders } from './chunk-FGWZZNAN.js';
|
|
2
|
-
|
|
3
|
-
var SDK_MODULES=["idv","fraud","custom_form"];var BIOMETRIC_MODES=["none","selfie","liveness"];var DOCUMENT_TYPES=["passport","drivers_license","id_card"];var SDK_MODES=["live","test"];var DATA_REGIONS=Object.keys(sdkPublicSettings.regions);function isRecord(v){return typeof v==="object"&&v!==null}function isNonEmptyString(v){return typeof v==="string"&&v.length>0}function isSdkModule(v){return typeof v==="string"&&SDK_MODULES.includes(v)}function isBiometricMode(v){return typeof v==="string"&&BIOMETRIC_MODES.includes(v)}function isSdkMode(v){return typeof v==="string"&&SDK_MODES.includes(v)}function isSdkRegion(v){return typeof v==="string"&&DATA_REGIONS.includes(v)}function isDocumentType(v){return typeof v==="string"&&DOCUMENT_TYPES.includes(v)}function parseIdvConfig(value){if(!isRecord(value))return null;const documentTypes=value.document_types;const biometricMode=value.biometric_mode;const minAge=value.min_age;if(!Array.isArray(documentTypes)||documentTypes.length<1)return null;const types=[];for(const t of documentTypes){if(!isDocumentType(t))return null;types.push(t);}if(!isBiometricMode(biometricMode))return null;if(minAge!==void 0&&typeof minAge!=="number")return null;const config={documentTypes:types,biometricMode};if(typeof minAge==="number")config.minAge=minAge;return config}function parseSessionData(body){if(!isRecord(body)||!isRecord(body.data))return null;const d=body.data;const sessionId=d.session_id;const stepId=d.step_id;const stepType=d.step_type;if(!isNonEmptyString(sessionId)||!isNonEmptyString(stepId)||!isNonEmptyString(stepType)||!isSdkMode(d.mode)||!isSdkRegion(d.region)){return null}if(!Array.isArray(d.modules)||!d.modules.every(isSdkModule))return null;const modules=d.modules;const wantsIdv=stepType==="id_verification";let config=null;if(wantsIdv){config=parseIdvConfig(d.config);if(config===null)return null}return {sessionId,stepId,stepType,config,mode:d.mode,region:d.region,modules}}async function resolveSession(ctx,fetchImpl){const origin=ctx.apiBaseOrigin;let res;try{res=await withTokenRetry(ctx.tokens,token=>fetchImpl(origin+SESSIONS_ME_PATH,{method:"GET",headers:dataPlaneHeaders(ctx,token)}),result=>result?.status===401);}catch{return null}if(!res.ok)return null;let body;try{body=await res.json();}catch{return null}const data=parseSessionData(body);if(data===null)return null;ctx.setSessionId(data.sessionId);return data}
|
|
4
|
-
|
|
5
|
-
export { resolveSession };
|
package/dist/chunk-FGWZZNAN.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { getServiceOrigin } from './chunk-QFA3K5ZV.js';
|
|
2
|
-
|
|
3
|
-
var sdkPublicSettings={"project":{"marketingApex":"checktiv.com"},"apps":{"verify":{"subdomain":"verify"}},"services":{"sdk-api":{"subdomain":"sdk-api"}},"regions":{"us":{"apex":"us.checktiv.com"},"eu":{"apex":"eu.checktiv.com"}}};function createTokenManager(source,sessionId){const mint=reason=>typeof source==="string"?Promise.resolve(source):source({sessionId:sessionId(),reason});let cached=null;let pending=null;return {get(){if(cached!==null)return cached;const p=mint("initial");cached=p;void p.catch(()=>{if(cached===p)cached=null;});return p},refresh(reason){if(pending!==null)return pending;const p=mint(reason);pending=p;cached=p;void p.then(()=>{if(pending===p)pending=null;},()=>{if(pending===p)pending=null;if(cached===p)cached=null;});return p}}}async function withTokenRetry(tokens,fn,isUnauthorized){const first=await tokens.get();let result;let error;try{result=await fn(first);}catch(err){error=err;}if(error===void 0&&result!==void 0&&!isUnauthorized(result,void 0)){return result}if(error!==void 0&&!isUnauthorized(void 0,error)){throw error}const fresh=await tokens.refresh("401");return fn(fresh)}var PUBLISHABLE_KEY_HEADER="X-Publishable-Key";function dataPlaneHeaders(ctx,token,opts={}){const headers={Authorization:`Bearer ${token}`};if(ctx.publishableKey!==void 0){headers[PUBLISHABLE_KEY_HEADER]=ctx.publishableKey;}if(opts.withJsonBody)headers["content-type"]="application/json";return headers}function resolveSdkApiOrigin(region,_mode,_hostname){return getServiceOrigin(sdkPublicSettings.services["sdk-api"].subdomain,"prod",region,sdkPublicSettings)}function isCanonicalOrigin(value){if(typeof value!=="string"||value.length===0)return false;try{return new URL(value).origin===value}catch{return false}}function resolveApiBaseOrigin(apiBase,region,mode,hostname){if(isCanonicalOrigin(apiBase))return apiBase;return resolveSdkApiOrigin(region)}var SESSIONS_ME_PATH="/sdk/v1/sessions/me";var CAPTURE_TOKEN_MINT_PATH="/sdk/v1/idv/capture-token";function stepSubmitPath(_sessionId,stepId){return `${SESSIONS_ME_PATH}/steps/${encodeURIComponent(stepId)}/submit`}var TELEMETRY_PATH="/sdk/v1/telemetry";function formUploadUrlPath(stepId){return `${SESSIONS_ME_PATH}/steps/${encodeURIComponent(stepId)}/form-upload-url`}var registry={};function registerModule(name,factory){registry[name]=factory;}function getModule(name){return registry[name]}
|
|
4
|
-
|
|
5
|
-
export { CAPTURE_TOKEN_MINT_PATH, SESSIONS_ME_PATH, TELEMETRY_PATH, createTokenManager, dataPlaneHeaders, formUploadUrlPath, getModule, isCanonicalOrigin, registerModule, resolveApiBaseOrigin, sdkPublicSettings, stepSubmitPath, withTokenRetry };
|
package/dist/chunk-WQCYRLWP.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var ERROR_TABLE={origin_not_allowed:{recoverable:false,recovery:"contact_operator",message:"This origin is not allowed for the publishable key. Add it to the allowed origins list in the Checktiv console."},token_expired:{recoverable:true,recovery:"retry",message:"The session token expired. The SDK is refreshing it; if this persists, mint a new token from your backend."},session_expired:{recoverable:false,recovery:"refresh_session",message:"The verification session is no longer valid. Start a new verification from your backend."},protocol_mismatch:{recoverable:false,recovery:"contact_operator",message:"The SDK version is out of date. Update to the latest published version."},camera_denied:{recoverable:true,recovery:"cross_device",message:"Camera access was blocked. Allow camera access, or continue on another device."},cv_gate_failed:{recoverable:true,recovery:"retry",message:"We could not read the image clearly. Try again with better lighting and a steady hand."},upload_failed:{recoverable:true,recovery:"retry",message:"The upload did not complete. Check the connection and try again."},sdk_load_failed:{recoverable:true,recovery:"cross_device",message:"Verification could not start on this device. Try again, or continue on another device."},biometric_unsupported:{recoverable:false,recovery:"contact_operator",message:"This capture is not supported on this page. Contact the site operator."},isolation_required:{recoverable:false,recovery:"contact_operator",message:"This page configuration is not supported. Contact the site operator."}};Object.keys(ERROR_TABLE).filter(key=>key in ERROR_TABLE);function createChecktivError(code){const entry=ERROR_TABLE[code];return {code,...entry}}function mapHttpStatusToError(status){if(status===401)return "token_expired";if(status===403)return "origin_not_allowed";if(status===429)return "upload_failed";if(status>=500)return "upload_failed";return "session_expired"}
|
|
2
|
-
|
|
3
|
-
export { createChecktivError, mapHttpStatusToError };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import './chunk-AIK7CDV6.js';
|
|
2
|
-
|
|
3
|
-
var t="client_timeout";var n="network_connection";var e="network_abort";var r="csp_block";var o="invalid_endpoint";var i="handle_agent_data";var c="script_load_fail";var a="bad_response_format";var s="api_key_missing";var u="api_key_invalid";var l="cache_misconfigured";var f="endpoints_misconfigured";var d="wrong_worker_option";var h="worker_initialization_failed";var p="sandboxed_iframe";var w="bundle_not_defined";var m={[t]:"Client timeout",[n]:"Network connection error",[e]:"Network request aborted",[r]:"Blocked by CSP",[o]:'The provided endpoint in "endpoints" parameter is not a valid URL',[i]:"Handle on demand agent data error",[c]:"Failed to load the JS script of the agent",[w]:"9319",[a]:"Can't parse the backend response. Make sure the proper endpoints are used.",[s]:"The `apiKey` option is not provided",[u]:"The `apiKey` option is not a string",[l]:"The `cache` option is misconfigured",[f]:"The `endpoints` option is misconfigured",[d]:"Wrong `worker` option, it should be a Worker instance",[h]:"Web Worker initialization failed",[p]:"Running inside sandboxed iframes is not supported"};var y=class extends Error{constructor(t2,n2){super(t2),this.name="FingerprintError",this.event_id=null,this.code=n2;}};function g(t2,n2){return new Promise((e2,r2)=>{let o2=false;null==n2||n2.then(()=>o2=true,()=>o2=true);("function"==typeof t2?g(Promise.resolve(),n2).then(t2):t2).then(t3=>{o2||e2(t3);},t3=>{o2||r2(t3);});})}function v(t2){if(!t2||"object"!=typeof t2)return false;const n2=t2;return "string"==typeof n2.__type__&&694409711===(function(t3){const n3=Et(t3);x=x||(function(){let t4;const n4=new Uint32Array(256);for(let e3=0;e3<256;e3++){t4=e3;for(let n5=0;n5<8;n5++)t4=1&t4?3988292384^t4>>>1:t4>>>1;n4[e3]=t4;}return n4})();let e2=-1;for(let t4=0;t4<n3.length;t4++)e2=e2>>>8^x[255&(e2^n3[t4])];return (-1^e2)>>>0})(X(n2.__type__))&&((void 0===n2.script||k(n2.script))&&(void 0===n2.helper||k(n2.helper))&&(void 0===n2.ingress||k(n2.ingress)))}function b(t2,n2){try{document.cookie;}catch(t3){if((function(t4){if(!(t4 instanceof DOMException))return false;const n3=t4.message;return G.test(n3)||Q.test(n3)||Y.test(n3)})(t3))return n2;throw t3}return t2()}function _(t2,n2,...e2){t2&&(async function(t3,n3){try{return await t3()}catch(t4){return console.error(t4),n3}})(()=>{const r2=n2(...e2);void 0!==r2&&t2(r2);});}function k(t2){return S(t2)?Z(t2.value):Z(t2)}function A(t2=V){return function(n2){let e2,i2;const{picked:a2,rest:l2}=(function(t3,n3){const e3={},r2={};for(const[o2,i3]of Object.entries(t3))n3.includes(o2)?e3[o2]=i3:r2[o2]=i3;return {picked:e3,rest:r2}})(n2,["apiKey"]),{apiKey:d2}=a2;if(!d2)throw new y(m[s],s);if("string"!=typeof d2)throw new y(m[u],u);const h2=(function(t3,n3){return Object.prototype.hasOwnProperty.call(t3,n3)})(p2=n2,g2="endpoints")?p2[g2]:void 0;var p2,g2;const v2=(function(t3,n3,e3){const r2=t3.prepareScriptEndpoints(n3,"https://fpnpmcdn.net/");if(null===r2)throw new y(m[f],f);return r2.map(t4=>(function(t5,n4){const e4=new URL(t5,window.location.href),r3=e4.pathname;return e4.pathname=`${r3}${r3.endsWith("/")?"":"/"}v4/${encodeURIComponent(n4)}`,e4.search=`?ci=jsl/${encodeURIComponent(F)}`,e4.href})(t4,e3))})(t2,h2,d2),[b2,_2]=(function(){const t3=[],n3=()=>{t3.push({time:new Date,state:document.visibilityState});},e3=(function(t4,n4,e4,r2){return t4.addEventListener(n4,e4,r2),()=>t4.removeEventListener(n4,e4,r2)})(document,"visibilitychange",n3);return n3(),[t3,e3]})();const k2=(async function(){try{const[n3,i3]=await(function(t3,n4){if(0===t3.length)return Promise.reject(new TypeError("The list of script URL patterns is empty"));const e3=[],r2=(function(t4,n5,e4,r3,o2={}){const{maxAttemptCount:i4=5,backoffBase:c2=200,backoffCap:a4=1e4,abort:s2}=o2,u2={failedAttempts:[]},[l3,f2]=(function(t5,n6,e5,r4){const o3=(function(t6){const n7=[...t6];return {current:()=>n7[0],postpone(){const t7=n7.shift();void 0!==t7&&n7.push(t7);},exclude(){n7.shift();}}})(t5),i5=(function(t6,n7){let e6=0;return ()=>Math.random()*Math.min(n7,t6*Math.pow(2,e6++))})(e5,r4),c3=new Set;return [o3.current(),(t6,e6,r5)=>{const a5=n6(t6,e6,r5);"exclude"===a5.action?o3.exclude():o3.postpone();const s3=()=>Math.max(0,t6.getTime()+i5()-Date.now());let u3;u3="number"==typeof a5.delay?a5.delay:s3();const l4=o3.current();if(0===u3&&l4){Date.now()-t6.getTime()<50&&(c3.has(l4)?u3=s3():c3.add(l4));}return void 0===l4?void 0:[l4,u3]}]})(t4,r3,c2,a4),d3=(h3=[null==s2?void 0:s2.then(t5=>u2.aborted={resolve:true,value:t5},t5=>u2.aborted={resolve:false,error:t5}),z(l3,i4,n5,e4,f2,u2,s2)],Promise.race(h3.filter(t5=>!!t5))).then(()=>u2);var h3;return {then:d3.then.bind(d3),current:u2}})(t3,async t4=>{const r3=new Date;try{const o2=await n4(t4);return e3.push({url:t4,startedAt:r3,finishedAt:new Date,error:void 0}),o2}catch(n5){throw e3.push({url:t4,startedAt:r3,finishedAt:new Date,error:n5}),n5}},t4=>({result:t4}),$,{maxAttemptCount:5,backoffBase:100,backoffCap:3e3});return new Promise((t4,n5)=>{Promise.resolve(r2).then(r3=>{if(void 0!==r3.result)t4([r3.result,e3]);else {const t5=r3.failedAttempts[0];n5(t5?t5.error:new Error("No attempts were made"));}}).catch(n5);})})(v2,n4=>(function(t3,n5){return t3.withCspViolationWatch(n5,async()=>{if((function(t4){if(!URL.prototype)return;try{return new URL(t4,location.href),false}catch(t5){if(R(t5))return true;throw t5}})(n5))throw new y(m[o],o);try{return await import(n5)}catch(t4){throw new y(m[c],c)}},()=>{throw new y(m[r],r)}).then(t4=>{if("function"!=typeof(null==t4?void 0:t4.start))throw new y(m[w],w);return t4})})(t2,n4)),a3=await n3.start({...l2,ldi:{attempts:i3,visibilityStates:b2}});return e2=a3,a3}catch(t3){throw i2=(function(t4){if(t4 instanceof y&&t4.code===w)return new y(m[c],c);return t4})(t3),i2}finally{_2();}})();return {async get(t3){if(e2)return e2.get(t3);if(i2)throw i2;return (await k2).get(t3)},async collect(t3){if(e2)return e2.collect(t3);if(i2)throw i2;return (await k2).collect(t3)}}}}var x;function C(t2,n2){return (function(t3,n3,e2){const r2=()=>{throw new Error("Invalid data")},o2=Et(t3);o2.length<n3.length+2&&r2();for(let t4=0;t4<n3.length;++t4)K(o2[1+t4],o2[0])!==n3[t4]&&r2();const i2=1+n3.length,c2=K(o2[i2],o2[0]);o2.length<i2+1+c2+e2&&r2();const a2=i2+1+c2,s2=a2+e2,u2=new ArrayBuffer(o2.length-s2),l2=new Uint8Array(u2);for(let t4=0;t4<l2.length;++t4)l2[t4]=o2[s2+t4]^o2[a2+t4%e2];return u2})(t2,St,$t)}function U(t2,n2){!(function(t3,n3,e2){if(J(n4=>{!(function(t4,n5){B(t4,"",-1,n5);})(t3,n4);}),e2<0);J(r2=>(B(t3,n3,e2,r2),(function(t4){return b(()=>{const n4=`${t4}=`;for(const t5 of document.cookie.split(";")){let e3=0;for(;" "===t5[e3]&&e3<t5.length;)++e3;if(t5.indexOf(n4)===e3)return t5.slice(e3+n4.length)}},void 0)})(t3)===n3));})(n2,t2,365),(function(t3,n3){var e2;try{null===(e2=null===localStorage||void 0===localStorage?void 0:localStorage.setItem)||void 0===e2||e2.call(localStorage,t3,n3);}catch(t4){}})(n2,t2);}function E(){return (function(){var t2,n2;const e2=window;return r2=["buildID"in navigator,"MozAppearance"in(null!==(n2=null===(t2=document.documentElement)||void 0===t2?void 0:t2.style)&&void 0!==n2?n2:{}),"onmozfullscreenchange"in e2,"mozInnerScreenX"in e2,"CSSMozDocumentRule"in e2,"CanvasCaptureMediaStream"in e2],r2.reduce((t3,n3)=>t3+(n3?1:0),0)>=4;var r2;})()}var D=Array.isArray;function S(t2){return !!t2&&t2.__type__===L}function T(t2){return {__type__:L,value:t2}}function $(t2,n2,e2){const i2=e2 instanceof y?e2.code:null;if(i2===r||i2===o)return {action:"exclude",delay:0};if(i2===w)return {action:"exclude",delay:"backoff"};if(i2===c){return {action:"postpone",delay:Date.now()-t2.getTime()<50?0:"backoff"}}return {action:"postpone",delay:"backoff"}}var L="withoutDefault";var P="_vid_";function R(t2){return t2 instanceof Error&&"TypeError"===t2.name}function M(t2){return t2>=lt&&t2<lt+10||t2===wt}function I(t2,n2){Dt(t2,t2.len+1),t2.arr[t2.len++]=n2;}function j(t2){return null!==t2&&"object"==typeof t2&&"name"in t2&&"FingerprintError"===t2.name&&"code"in t2}function O(t2,n2){try{return new window.URL(t2,window.location.href)}catch(e2){if(R(e2))return console.warn(`Ignoring an invalid '${n2}' value: "${t2}"`),null;throw e2}}function W(t2){return `${t2.origin}${t2.pathname.endsWith("/")?t2.pathname:`${t2.pathname}/`}web/`}async function z(t2,n2,e2,r2,o2,i2,c2){if(void 0===t2)return;let a2=t2;for(let t3=0;t3<n2;++t3){const n3=new Date;let s2,u2;try{s2=await g(()=>e2(a2,t3,c2),c2);}catch(t4){u2=t4,i2.failedAttempts.push({level:0,endpoint:a2,error:t4});}if(s2){const t4=r2(s2);if("result"in t4){i2.result=t4.result;break}if(i2.failedAttempts.push({level:1,endpoint:a2,error:t4.error}),t4.stop)break}const l2=o2(n3,s2,u2);if(!l2)break;await g(nt(l2[1]),c2),a2=l2[0];}}var F="4.1.0";function B(t2,n2,e2,r2){b(()=>{const o2=`${t2}=${n2}`,i2=`expires=${new Date(Date.now()+24*e2*60*60*1e3).toUTCString()}`,c2=r2?`domain=${r2}`:"";document.cookie=[o2,"path=/",i2,c2,"SameSite=Lax"].join("; ");},void 0);}function K(t2,n2){return (t2-n2+256)%256}function N(t2,n2){Dt(t2,t2.len+n2.length),t2.arr.set(n2,t2.len),t2.len+=n2.length;}var V={prepareScriptEndpoints:function(t2,n2){if(void 0===t2)return [n2];if(k(t2))return (function(t3,n3){let e2,r2=false;S(t3)?(r2=true,e2=tt(t3.value)):e2=tt(t3);const o2=[];for(const t4 of e2){const n4=O(t4,"endpoints");n4&&o2.push(W(n4));}r2||o2.push(n3);return o2})(t2,n2);if(v(t2))return (function(t3,n3,e2){if(void 0===t3)return [n3];let r2,o2=false;S(t3)?(o2=true,r2=tt(t3.value)):r2=tt(t3);const i2=[];for(const t4 of r2){const n4=O(t4,e2);n4&&i2.push(n4.href);}o2||i2.push(n3);return i2})(t2.script,n2,"script");return null},withCspViolationWatch:function(t2,n2,e2,r2){const o2=document,i2="securitypolicyviolation";let c2;const a2=n3=>{const e3=new URL(t2,location.href),{blockedURI:r3}=n3;r3!==e3.href&&r3!==e3.protocol.slice(0,-1)&&r3!==e3.origin||(c2=n3,s2());};o2.addEventListener(i2,a2);const s2=()=>o2.removeEventListener(i2,a2);return null==r2||r2.then(s2,s2),Promise.resolve().then(n2).then(t3=>(s2(),t3),t3=>new Promise(t4=>{const n3=new MessageChannel;n3.port1.onmessage=()=>t4(),n3.port2.postMessage(null);}).then(()=>{if(s2(),c2)return e2(c2);throw t3}))}};function q({level:t2,message:n2}){"error"===t2?console.error(n2):"warning"===t2?console.warn(n2):console.log(n2);}var H=A();function J(t2){const n2=location.hostname,e2=E();(function(t3,n3){let e3=t3.length-("."===t3.slice(-1)?1:0);do{if(e3=e3>0?t3.lastIndexOf(".",e3-1):-1,true===n3(t3.slice(e3+1)))return true}while(e3>=0);return false})(n2,r2=>{if(!e2||!/^([^.]{1,3}\.)*[^.]+\.?$/.test(r2)||r2===n2)return t2(r2)})||t2();}function X(t2){const n2=new Uint8Array(t2.length);for(let e2=0;e2<t2.length;e2++){const r2=t2.charCodeAt(e2);if(r2>127)return new TextEncoder().encode(t2);n2[e2]=r2;}return n2}var G=/The document is sandboxed and lacks the 'allow-same-origin' flag/;var Q=/The operation is insecure/;var Y=/Forbidden in a sandboxed document without the 'allow-same-origin' flag/;function Z(t2){return "string"==typeof t2||Array.isArray(t2)&&t2.every(t3=>"string"==typeof t3)}function tt(t2){return D(t2)?t2:[t2]}function nt(t2,n2){return new Promise(e2=>(function(t3,n3,...e3){const r2=Date.now()+n3;let o2=0;const i2=()=>{o2=setTimeout(()=>{Date.now()<r2?i2():t3(...e3);},r2-Date.now());};return i2(),()=>clearTimeout(o2)})(e2,t2,n2))}var et=34;var rt=44;var ot=58;var it=32;var ct=9;var at=13;var st=10;var ut=92;var lt=48;var ft=101;var dt=117;var ht=69;var pt=43;var wt=45;var mt=46;var yt=91;var gt=93;var vt=123;var bt=125;var _t=new Uint8Array([110,dt,108,108]);var kt=new Uint8Array([116,114,dt,ft]);var At=new Uint8Array([102,97,108,115,ft]);var xt={'"':'"',"\\":"\\","\b":"b","\f":"f","\n":"n","\r":"r"," ":"t"};var Ct=(()=>{const t2=new Uint8Array(128);for(const[n2,e2]of Object.entries(xt))t2[e2.charCodeAt(0)]=n2.charCodeAt(0);return t2})();function Ut(t2){if("function"==typeof TextDecoder){const n3=new TextDecoder().decode(t2);if(n3)return n3}const n2=Et(t2);return decodeURIComponent(escape(String.fromCharCode.apply(null,n2)))}function Et(t2){return t2 instanceof ArrayBuffer?new Uint8Array(t2):new Uint8Array(t2.buffer,t2.byteOffset,t2.byteLength)}function Dt(t2,n2){if(t2.arr.length<n2){const e2=new Uint8Array(Math.max(2*t2.arr.length,n2));e2.set(t2.arr),t2.arr=e2;}}var St=[3,13];var $t=9;var Lt=function(t2,n2={}){const{storageKeyPrefix:e2=P,do:r2}=n2;try{const n3=(function(t3){const n4=(function(t4){const n5=atob(t4),e4=n5.length,r3=new Uint8Array(e4);for(let t5=0;t5<e4;t5++)r3[t5]=n5.charCodeAt(t5);return r3})(t3);let e3=n4;try{e3=C(n4,false);}catch(t4){}try{return (function(t4){const n5={len:0,arr:new Uint8Array(128)},e4=Et(t4);let r3=0;const o2=()=>(u2(),e4[r3]===et?i2():M(e4[r3])?c2():l2(_t)?(r3+=_t.length,null):l2(kt)?(r3+=kt.length,true):l2(At)?(r3+=At.length,false):e4[r3]===yt?a2():e4[r3]===vt?s2():f2()),i2=()=>{for(n5.len=0;r3++,e4[r3]!==et;){if(e4[r3]===ut){if(r3++,e4[r3]===dt){const t6=parseInt(Ut(e4.subarray(r3+1,r3+5)),16);N(n5,X(String.fromCharCode(t6))),r3+=4;continue}const t5=Ct[e4[r3]];if(t5){I(n5,t5);continue}return f2()}if(void 0===e4[r3])return f2();I(n5,e4[r3]);}return r3++,Ut((function(t5){return t5.arr.subarray(0,t5.len)})(n5))},c2=()=>{const t5=r3;for(;e4[r3]===mt||e4[r3]===ft||e4[r3]===ht||e4[r3]===pt||M(e4[r3]);)r3++;return Number(Ut(e4.subarray(t5,r3)))},a2=()=>{const t5=[];for(r3++;;){if(u2(),e4[r3]===gt){r3++;break}if(t5.length){if(e4[r3]!==rt)return f2();r3++;}t5.push(o2());}return t5},s2=()=>{const t5={};let n6=true;for(r3++;;){if(u2(),e4[r3]===bt){r3++;break}if(!n6){if(e4[r3]!==rt)return f2();r3++,u2();}if(e4[r3]!==et)return f2();const c3=i2();if(u2(),e4[r3]!==ot)return f2();r3++,Object.defineProperty(t5,c3,{value:o2(),configurable:true,enumerable:true,writable:true}),n6=false;}return t5},u2=()=>{for(;e4[r3]===it||e4[r3]===st||e4[r3]===at||e4[r3]===ct;)r3++;},l2=t5=>{for(let n6=0;n6<t5.length;n6++)if(e4[r3+n6]!==t5[n6])return false;return true},f2=()=>{throw new SyntaxError("Unexpected "+(r3<e4.length?`byte ${r3}`:"end"))},d2=o2();u2(),void 0!==e4[r3]&&f2();return d2})(e3)}catch(t4){}return null})(t2);null!==n3?(n3.visitorToken&&U(n3.visitorToken,`${e2}t`),n3.notifications.forEach(q),_(r2,()=>({e:25,result:{response:n3}}))):_(r2,()=>({e:25,result:{error:new Error("Failed to decode response")}}));}catch(t3){throw _(r2,()=>({e:25,result:{error:t3 instanceof Error?t3:new Error(String(t3))}})),new y(m[i],i)}};var Pt={start:H,handleAgentData:Lt,isFingerprintError:j,withoutDefault:T};
|
|
4
|
-
|
|
5
|
-
export { Pt as default, Lt as handleAgentData, j as isFingerprintError, H as start, T as withoutDefault };
|
package/dist/index-BtJbU9MC.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
interface CrossDeviceCopy {
|
|
2
|
-
readonly desktopPrompt?: string;
|
|
3
|
-
readonly desktopSubtext?: string;
|
|
4
|
-
readonly waitingLabel?: string;
|
|
5
|
-
readonly copyLinkLabel?: string;
|
|
6
|
-
readonly linkCopiedLabel?: string;
|
|
7
|
-
readonly backLabel?: string;
|
|
8
|
-
readonly refreshLinkLabel?: string;
|
|
9
|
-
readonly qrAlt?: string;
|
|
10
|
-
readonly mobilePrompt?: string;
|
|
11
|
-
readonly mobileOpenBrowserHint?: string;
|
|
12
|
-
readonly mobileCopyLinkLabel?: string;
|
|
13
|
-
readonly mobileLinkCopiedLabel?: string;
|
|
14
|
-
readonly mobileTryAgainLabel?: string;
|
|
15
|
-
readonly mobileCameraSettingsNote?: string;
|
|
16
|
-
readonly unavailableMessage: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
interface CrossDevicePanelProps {
|
|
20
|
-
url: string;
|
|
21
|
-
copy: CrossDeviceCopy;
|
|
22
|
-
isMobile: boolean;
|
|
23
|
-
completing?: boolean;
|
|
24
|
-
onBack?: () => void;
|
|
25
|
-
onRefreshLink?: () => void;
|
|
26
|
-
onRetry?: () => void;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface CrossDeviceHandle {
|
|
30
|
-
update(next: CrossDevicePanelProps): void;
|
|
31
|
-
destroy(): void;
|
|
32
|
-
}
|
|
33
|
-
declare function mountCrossDevice(target: HTMLElement, props: CrossDevicePanelProps): CrossDeviceHandle;
|
|
34
|
-
|
|
35
|
-
type ___cross_device_index_js_CrossDeviceCopy = CrossDeviceCopy;
|
|
36
|
-
type ___cross_device_index_js_CrossDeviceHandle = CrossDeviceHandle;
|
|
37
|
-
type ___cross_device_index_js_CrossDevicePanelProps = CrossDevicePanelProps;
|
|
38
|
-
declare const ___cross_device_index_js_mountCrossDevice: typeof mountCrossDevice;
|
|
39
|
-
declare namespace ___cross_device_index_js {
|
|
40
|
-
export { type ___cross_device_index_js_CrossDeviceCopy as CrossDeviceCopy, type ___cross_device_index_js_CrossDeviceHandle as CrossDeviceHandle, type ___cross_device_index_js_CrossDevicePanelProps as CrossDevicePanelProps, ___cross_device_index_js_mountCrossDevice as mountCrossDevice };
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { type CrossDeviceCopy as C, ___cross_device_index_js as _, type CrossDeviceHandle as a, type CrossDevicePanelProps as b, mountCrossDevice as m };
|