@incodetech/core 0.0.0-dev-20260828-b9d1a451 → 0.0.0-dev-20260831-e0b1ec3e
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/{BrowserDiagnosticsCryptoProvider-CE_x-xOb.esm.js → BrowserDiagnosticsCryptoProvider-D-brZd0n.esm.js} +1 -1
- package/dist/{addressSearch-DyHT4P-9.esm.js → addressSearch-DsE3V2Eu.esm.js} +1 -1
- package/dist/ae-signature.esm.js +1 -1
- package/dist/antifraud.esm.js +2 -2
- package/dist/{antifraudManager-BdU1QhX4.esm.js → antifraudManager-BIAewhuy.esm.js} +1 -1
- package/dist/{antifraudStateMachine-Cz1CcQ7C.esm.js → antifraudStateMachine-CloLO5Ac.esm.js} +1 -1
- package/dist/{apiError-Mnmplf9Q.esm.js → apiError-pVExQuwZ.esm.js} +1 -1
- package/dist/authentication.esm.js +2 -2
- package/dist/{authenticationManager-ehF0_6-a.esm.js → authenticationManager-Cbqd1jY0.esm.js} +2 -2
- package/dist/{authenticationStateMachine-CJgXrJ07.esm.js → authenticationStateMachine-Oj_QiFZM.esm.js} +5 -5
- package/dist/{backCameraStream-B1fulX20.esm.js → backCameraStream-DE_5qY04.esm.js} +1 -1
- package/dist/camera.esm.js +1 -1
- package/dist/certificate-issuance.esm.js +2 -2
- package/dist/{certificateIssuanceManager-C7_h81Hf.esm.js → certificateIssuanceManager-Boxv4Ua1.esm.js} +1 -1
- package/dist/{certificateIssuanceStateMachine-CkBC6BEp.esm.js → certificateIssuanceStateMachine-DPxboygj.esm.js} +1 -1
- package/dist/consent.d.ts +1 -1
- package/dist/consent.esm.js +2 -2
- package/dist/{consentManager-Dvf4vlZf.esm.js → consentManager-DGUR1n_2.esm.js} +1 -1
- package/dist/{consentManager-3Pbtj-RV.d.ts → consentManager-uhDPdU6i.d.ts} +4 -4
- package/dist/{consentStateMachine-DN4RVt8c.esm.js → consentStateMachine-NzTtgWFt.esm.js} +1 -1
- package/dist/cross-document-data-match.esm.js +1 -1
- package/dist/{crossDocumentDataMatchManager-DijKyqhL.esm.js → crossDocumentDataMatchManager-B-LnSOkM.esm.js} +1 -1
- package/dist/curp-validation.esm.js +2 -2
- package/dist/{curpValidationManager-4-Hr3jF9.esm.js → curpValidationManager-Br8nG43T.esm.js} +1 -1
- package/dist/{curpValidationStateMachine-BQ3QE_OL.esm.js → curpValidationStateMachine-LUNoe6Qf.esm.js} +1 -1
- package/dist/custom-fields.esm.js +1 -1
- package/dist/custom-watchlist.esm.js +2 -2
- package/dist/{customFieldsManager-cmNjB49H.esm.js → customFieldsManager-227MSvQB.esm.js} +1 -1
- package/dist/{customWatchlistManager-mqkLkQ-8.esm.js → customWatchlistManager-BAaSxZYb.esm.js} +1 -1
- package/dist/{customWatchlistStateMachine-l6Acxa3S.esm.js → customWatchlistStateMachine-D5_1ttJm.esm.js} +1 -1
- package/dist/{deepsightLoader-DcLVxmv0.esm.js → deepsightLoader-DdgzfNqc.esm.js} +4 -4
- package/dist/device.esm.js +2 -2
- package/dist/document-capture.d.ts +1 -1
- package/dist/document-capture.esm.js +2 -2
- package/dist/{documentCaptureManager-DensIj5F.d.ts → documentCaptureManager-DD0qtFdE.d.ts} +1 -1
- package/dist/{documentCaptureManager-BaiS92yo.esm.js → documentCaptureManager-DrXzgDgl.esm.js} +1 -1
- package/dist/{documentCaptureStateMachine-DAvZR8V_.esm.js → documentCaptureStateMachine-P791mQyQ.esm.js} +4 -4
- package/dist/dynamic-forms.esm.js +2 -2
- package/dist/{dynamicFormsManager-BdT_TJVp.esm.js → dynamicFormsManager-BT70ntas.esm.js} +1 -1
- package/dist/{dynamicFormsStateMachine-CUkci6hL.esm.js → dynamicFormsStateMachine-Wm3Qk4Og.esm.js} +2 -2
- package/dist/ekyb.esm.js +3 -3
- package/dist/{ekybManager-D8hg76La.esm.js → ekybManager-D_eYl2XT.esm.js} +1 -1
- package/dist/{ekybStateMachine-DKvNv2gS.esm.js → ekybStateMachine-BtUtCow-.esm.js} +3 -3
- package/dist/ekyc.esm.js +2 -2
- package/dist/{ekycManager-CrTOTtiv.esm.js → ekycManager-w9og7p3B.esm.js} +1 -1
- package/dist/{ekycStateMachine-CbelE4HF.esm.js → ekycStateMachine-DI-cxTKR.esm.js} +2 -2
- package/dist/electronic-signature.esm.js +1 -1
- package/dist/{electronicSignatureManager-btSe4krY.esm.js → electronicSignatureManager-DMl5qN8w.esm.js} +2 -2
- package/dist/email.esm.js +2 -2
- package/dist/{emailManager-bHVudUAI.esm.js → emailManager-XkoenO_I.esm.js} +1 -1
- package/dist/{emailStateMachine-DPtIEmcf.esm.js → emailStateMachine-bE6BrcSV.esm.js} +1 -1
- package/dist/{endpoints-BnZlELpm.esm.js → endpoints-CXZYMaDj.esm.js} +11 -1
- package/dist/extensibility.d.ts +5 -5
- package/dist/extensibility.esm.js +32 -32
- package/dist/face-match.esm.js +2 -2
- package/dist/{faceCaptureManagerFactory-BlaACb7g.esm.js → faceCaptureManagerFactory-Bshb1ei1.esm.js} +2 -2
- package/dist/{faceCaptureSetup-v9mm6NJ_.esm.js → faceCaptureSetup-VhCtXFHh.esm.js} +7 -7
- package/dist/{faceMatchManager-DqEr_Ovu.esm.js → faceMatchManager-B7zieNzG.esm.js} +1 -1
- package/dist/{faceMatchStateMachine-CFzg2w5G.esm.js → faceMatchStateMachine-D-ji0pxU.esm.js} +1 -1
- package/dist/{feature-management-DH59Seq9.esm.js → feature-management-BGp5JXEs.esm.js} +1 -1
- package/dist/feature-management.esm.js +1 -1
- package/dist/field-comparison.esm.js +1 -1
- package/dist/{fieldComparisonManager-BEAPrbKl.esm.js → fieldComparisonManager-e3mCrzVQ.esm.js} +1 -1
- package/dist/fiscal-qr.esm.js +1 -1
- package/dist/{fiscalQrManager-BqWHC9L8.esm.js → fiscalQrManager-Q8dfZMRj.esm.js} +2 -2
- package/dist/flow.d.ts +1 -1
- package/dist/flow.esm.js +3 -3
- package/dist/{flowCompletionService-VLB2Gh9N.esm.js → flowCompletionService-Dv1WW2pP.esm.js} +2 -2
- package/dist/{flowServices-DU5JGQJX.esm.js → flowServices-D3cLNBun.esm.js} +5 -5
- package/dist/geolocation.esm.js +2 -2
- package/dist/{geolocationManager-CEK9Elbu.esm.js → geolocationManager-DN0Bno91.esm.js} +1 -1
- package/dist/{geolocationStateMachine-BoOCPtaV.esm.js → geolocationStateMachine-DIM4MbiT.esm.js} +3 -3
- package/dist/{getDeviceClass-CHfFphdD.esm.js → getDeviceClass-q9LxdYDh.esm.js} +1 -1
- package/dist/government-validation.esm.js +2 -2
- package/dist/{governmentValidationManager-Cn03QPKc.esm.js → governmentValidationManager-CxXc4qBe.esm.js} +1 -1
- package/dist/{governmentValidationStateMachine-Djb0nOCD.esm.js → governmentValidationStateMachine-flYtmgoA.esm.js} +1 -1
- package/dist/id-ocr.esm.js +2 -2
- package/dist/id-selfie-flow.esm.js +8 -8
- package/dist/id-verification.esm.js +2 -2
- package/dist/id.d.ts +27 -3
- package/dist/id.esm.js +15 -4
- package/dist/{idCaptureManager-238BYMuO.d.ts → idCaptureManager-D9Kc4PAJ.d.ts} +21 -2
- package/dist/{idCaptureManager-Bixa6yWR.esm.js → idCaptureManager-DUQtwq8R.esm.js} +72 -4
- package/dist/{idCaptureServices-Bm7ddfni.esm.js → idCaptureServices-eA84vRnx.esm.js} +8 -8
- package/dist/{idCaptureStateMachine-D4G28qF9.esm.js → idCaptureStateMachine-BHQiU_qh.esm.js} +449 -36
- package/dist/{idOcrManager-D3W_gJCw.esm.js → idOcrManager-BgZ19BTC.esm.js} +1 -1
- package/dist/{idOcrStateMachine-BC7HT3LZ.esm.js → idOcrStateMachine-7XoaRHAP.esm.js} +1 -1
- package/dist/{idVerificationManager-BP_qxCyL.esm.js → idVerificationManager-CcnzNq2Y.esm.js} +1 -1
- package/dist/{idVerificationStateMachine-D5pZC498.esm.js → idVerificationStateMachine-COvxom5O.esm.js} +1 -1
- package/dist/identity-reuse.esm.js +2 -2
- package/dist/{identityReuseManager-C41EuIKT.esm.js → identityReuseManager-DYBNjSsr.esm.js} +1 -1
- package/dist/{identityReuseStateMachine-B6iJEVTc.esm.js → identityReuseStateMachine-BAhNyyC6.esm.js} +1 -1
- package/dist/{imageFile-BheSny5p.esm.js → imageFile-DPRoXt59.esm.js} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/mandatory-consent.d.ts +1 -1
- package/dist/mandatory-consent.esm.js +2 -2
- package/dist/{mandatoryConsentManager-Dj1R-P4D.esm.js → mandatoryConsentManager-BiqhwVoc.esm.js} +1 -1
- package/dist/{mandatoryConsentManager-CaTcQLK6.d.ts → mandatoryConsentManager-DvR2XzUH.d.ts} +4 -4
- package/dist/{mandatoryConsentStateMachine-S5zIgyKL.esm.js → mandatoryConsentStateMachine-DYDyl5f9.esm.js} +1 -1
- package/dist/{multipartRecordingService-H4hNUZTM.esm.js → multipartRecordingService-BLGAj7Yi.esm.js} +2 -2
- package/dist/{onDeviceFaceResults-iKn9vLVM.esm.js → onDeviceFaceResults-By6JExpS.esm.js} +7 -7
- package/dist/{permissionGuards-DKnCqOsF.esm.js → permissionGuards-tw0DA6fF.esm.js} +1 -1
- package/dist/{permissionServices-QCFFUVkj.esm.js → permissionServices-D209jzcE.esm.js} +1 -1
- package/dist/personhood.esm.js +5 -5
- package/dist/phone.esm.js +2 -2
- package/dist/{phoneManager-BcvQ7FBl.esm.js → phoneManager-Bo6xxcMW.esm.js} +1 -1
- package/dist/{phoneStateMachine-2fZ8B66_.esm.js → phoneStateMachine--38hob0F.esm.js} +1 -1
- package/dist/{platform-BtKmqD_U.esm.js → platform-DkcRc9JV.esm.js} +11 -1
- package/dist/qe-signature.esm.js +1 -1
- package/dist/{recordingsRepository-KTZA-U7u.esm.js → recordingsRepository-BF82zFip.esm.js} +1 -1
- package/dist/redirect-to-mobile.esm.js +2 -2
- package/dist/{redirectToMobileManager-COlmYu8N.esm.js → redirectToMobileManager-CYgl8NQf.esm.js} +1 -1
- package/dist/{redirectToMobileStateMachine-BpyiaOjv.esm.js → redirectToMobileStateMachine-DaIHD4sd.esm.js} +1 -1
- package/dist/{runChildModule-Dat6UDwV.esm.js → runChildModule-eGnqjjQZ.esm.js} +1 -1
- package/dist/{sdkVersion-C-3Pw3mj.esm.js → sdkVersion-C3Ov_zq7.esm.js} +1 -1
- package/dist/selfie.esm.js +5 -5
- package/dist/{selfieErrorUtils-D4C7q0NB.esm.js → selfieErrorUtils-YPP_eGhX.esm.js} +3 -3
- package/dist/{selfieManager-CC6Qpdxn.esm.js → selfieManager-H-KELqyV.esm.js} +2 -2
- package/dist/{selfieStateMachine-CeDLN24K.esm.js → selfieStateMachine-Dr2nfgMp.esm.js} +3 -3
- package/dist/{session-D4Q1GV5k.esm.js → session-BQth2eww.esm.js} +5 -5
- package/dist/session.esm.js +4 -4
- package/dist/{sessionInitializer-DM0BhcNp.esm.js → sessionInitializer-CqQyhPfm.esm.js} +7 -7
- package/dist/{setup-OBkNnjPB.esm.js → setup-qH3XKIRQ.esm.js} +7 -7
- package/dist/signature.esm.js +2 -2
- package/dist/{signatureManager-5EzByW5k.esm.js → signatureManager-CxlTDSPF.esm.js} +1 -1
- package/dist/{signatureStateMachine-Cxm8EZqM.esm.js → signatureStateMachine-PME6kYsi.esm.js} +1 -1
- package/dist/{stats-CfKJ7B8k.esm.js → stats-CI6TkL3K.esm.js} +1 -1
- package/dist/stats.esm.js +1 -1
- package/dist/trueSight-BzKA0pUI.esm.js +1 -0
- package/dist/{trueSightService-BZMNBMxd.esm.js → trueSightService-QiGjDkBK.esm.js} +3 -3
- package/dist/{types-_tpclaFq2.d.ts → types-C2AjieoA2.d.ts} +186 -22
- package/dist/video-selfie.esm.js +5 -5
- package/dist/{videoSelfieCameraWarmer-CqCrlHNJ.esm.js → videoSelfieCameraWarmer-Bii8IaBN.esm.js} +7 -7
- package/dist/wasm.esm.js +1 -1
- package/dist/watchlist-for-business.esm.js +2 -2
- package/dist/watchlist.esm.js +2 -2
- package/dist/{watchlistForBusinessManager-BaqsWFpn.esm.js → watchlistForBusinessManager-B4OQWJzu.esm.js} +1 -1
- package/dist/{watchlistForBusinessStateMachine-u-ENnYB-.esm.js → watchlistForBusinessStateMachine-LwE1Hwug.esm.js} +1 -1
- package/dist/{watchlistManager-CVHrWp80.esm.js → watchlistManager-COcrhkNj.esm.js} +1 -1
- package/dist/{watchlistStateMachine-PctWisG5.esm.js → watchlistStateMachine-CvQkLMAm.esm.js} +1 -1
- package/dist/workflow.esm.js +35 -35
- package/package.json +3 -3
- package/dist/trueSight-BUPXVCDt.esm.js +0 -1
package/dist/{idCaptureStateMachine-D4G28qF9.esm.js → idCaptureStateMachine-BHQiU_qh.esm.js}
RENAMED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { t as BrowserStorageProvider } from "./BrowserStorageProvider-DC___749.esm.js";
|
|
2
2
|
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
|
|
3
|
-
import { s as exposeExperimentOnce } from "./feature-management-
|
|
3
|
+
import { s as exposeExperimentOnce } from "./feature-management-BGp5JXEs.esm.js";
|
|
4
4
|
import { n as revokeObjectURL } from "./IBrowserEnvironmentCapability-DEaRRk-R.esm.js";
|
|
5
5
|
import { r as getToken, t as api } from "./api-Bx3gKW_y.esm.js";
|
|
6
|
-
import { c as trueSightHintTransition, l as trueSightLog, r as noteTrueSightCaptureActivity } from "./trueSightService-
|
|
6
|
+
import { c as trueSightHintTransition, l as trueSightLog, r as noteTrueSightCaptureActivity } from "./trueSightService-QiGjDkBK.esm.js";
|
|
7
7
|
import { n as eventModuleNames, s as recordExperimentAssignmentOnce } from "./events-ijlbX_Wx.esm.js";
|
|
8
|
-
import { t as getDisableIpify } from "./sessionInitializer-
|
|
9
|
-
import { t as endpoints } from "./endpoints-
|
|
10
|
-
import "./trueSight-
|
|
11
|
-
import { t as addDeviceStats } from "./stats-
|
|
12
|
-
import { t as isAndroid } from "./platform-
|
|
13
|
-
import "./session-
|
|
8
|
+
import { t as getDisableIpify } from "./sessionInitializer-CqQyhPfm.esm.js";
|
|
9
|
+
import { t as endpoints } from "./endpoints-CXZYMaDj.esm.js";
|
|
10
|
+
import "./trueSight-BzKA0pUI.esm.js";
|
|
11
|
+
import { t as addDeviceStats } from "./stats-CI6TkL3K.esm.js";
|
|
12
|
+
import { a as isIOS, s as isIPad, t as isAndroid, u as isMacOsSafari } from "./platform-DkcRc9JV.esm.js";
|
|
13
|
+
import "./session-BQth2eww.esm.js";
|
|
14
14
|
import { c as not, i as assign, l as raise, n as enqueueActions, o as and, r as sendTo, t as setup } from "./xstate.esm-BuFLFuzz.esm.js";
|
|
15
15
|
import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
|
|
16
|
-
import { n as invokeRequestPermissionActor, t as checkPermission } from "./permissionServices-
|
|
16
|
+
import { n as invokeRequestPermissionActor, t as checkPermission } from "./permissionServices-D209jzcE.esm.js";
|
|
17
17
|
import { t as sleep } from "./ITimerCapability-DgdDzp8G.esm.js";
|
|
18
18
|
import { t as IncodeCanvas } from "./canvas-E1zGkel4.esm.js";
|
|
19
|
-
import { a as StreamCanvasProcessingSession } from "./recordingsRepository-
|
|
19
|
+
import { a as StreamCanvasProcessingSession } from "./recordingsRepository-BF82zFip.esm.js";
|
|
20
20
|
import { t as getBrowser } from "./getBrowser-Cbe1C4Tn.esm.js";
|
|
21
21
|
import { n as getWindowDimensions } from "./getDeviceClass-CeBiEayS.esm.js";
|
|
22
22
|
import { t as StreamCanvasCapture } from "./StreamCanvasCapture-D2XcXCZ4.esm.js";
|
|
23
|
-
import { n as needsMotionPrimeOnlyFromPermission, r as resolveStoredPermissionResult, t as isReadyForCaptureFromPermission } from "./permissionGuards-
|
|
24
|
-
import { r as flagIdManualReview, t as imageFileToDataUrl } from "./imageFile-
|
|
25
|
-
import { _ as getIdCameraStream, a as processId, c as stopStream, d as validateUploadResponse, f as ID_ERROR_CODES, g as OPTIMIZING_WATCHDOG_MARGIN_MS, h as CAPTURE_OPTIMIZING, l as uploadIdImage, m as resolveIdCaptureThresholds, o as startRecordingSession, r as initializeIdCapture, s as stopRecording, t as addBarcode, u as uploadManualIdFile } from "./idCaptureServices-
|
|
23
|
+
import { n as needsMotionPrimeOnlyFromPermission, r as resolveStoredPermissionResult, t as isReadyForCaptureFromPermission } from "./permissionGuards-tw0DA6fF.esm.js";
|
|
24
|
+
import { r as flagIdManualReview, t as imageFileToDataUrl } from "./imageFile-DPRoXt59.esm.js";
|
|
25
|
+
import { _ as getIdCameraStream, a as processId, c as stopStream, d as validateUploadResponse, f as ID_ERROR_CODES, g as OPTIMIZING_WATCHDOG_MARGIN_MS, h as CAPTURE_OPTIMIZING, l as uploadIdImage, m as resolveIdCaptureThresholds, o as startRecordingSession, r as initializeIdCapture, s as stopRecording, t as addBarcode, u as uploadManualIdFile } from "./idCaptureServices-eA84vRnx.esm.js";
|
|
26
26
|
//#region src/modules/id/digitalUpload/digitalUploadErrors.ts
|
|
27
27
|
const TERMINAL_FAIL_REASONS = /* @__PURE__ */ new Set(["DIGITAL_ID_REQUESTED_BUT_OTHER_PROVIDED", "ID_TYPE_UNACCEPTABLE"]);
|
|
28
28
|
function isKnownFailReason(reason) {
|
|
@@ -309,6 +309,222 @@ const digitalUploadMachine = setup({
|
|
|
309
309
|
}
|
|
310
310
|
});
|
|
311
311
|
//#endregion
|
|
312
|
+
//#region src/modules/id/deviceWallet/deviceWalletServices.ts
|
|
313
|
+
/** Both wallet endpoint families are versioned via header, not path. */
|
|
314
|
+
const API_VERSION_HEADERS = { "api-version": "1.0" };
|
|
315
|
+
/**
|
|
316
|
+
* Fetches the wallet request payload for the platform and wraps it in the
|
|
317
|
+
* Digital Credentials API request shape.
|
|
318
|
+
*
|
|
319
|
+
* Apple: POST with an empty body → `{ deviceRequest, encryptionInfo }`,
|
|
320
|
+
* presented with protocol `org-iso-mdoc`.
|
|
321
|
+
* Google: GET → the whole backend-built OIDC4VP/DCQL object (opaque here),
|
|
322
|
+
* presented with protocol `openid4vp-v1-unsigned`.
|
|
323
|
+
*/
|
|
324
|
+
async function requestWalletData(platform, signal) {
|
|
325
|
+
if (platform === "ios") {
|
|
326
|
+
const res = await api.post(endpoints.deviceWalletAppleRequest, {}, {
|
|
327
|
+
headers: API_VERSION_HEADERS,
|
|
328
|
+
signal
|
|
329
|
+
});
|
|
330
|
+
if (!res.ok) throw new Error(`POST ${endpoints.deviceWalletAppleRequest} failed: ${res.status}`);
|
|
331
|
+
const data = res.data;
|
|
332
|
+
return {
|
|
333
|
+
protocol: "org-iso-mdoc",
|
|
334
|
+
data: {
|
|
335
|
+
deviceRequest: data.deviceRequest,
|
|
336
|
+
encryptionInfo: data.encryptionInfo
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
const res = await api.get(endpoints.deviceWalletGoogleRequest, {
|
|
341
|
+
headers: API_VERSION_HEADERS,
|
|
342
|
+
signal
|
|
343
|
+
});
|
|
344
|
+
if (!res.ok) throw new Error(`GET ${endpoints.deviceWalletGoogleRequest} failed: ${res.status}`);
|
|
345
|
+
return {
|
|
346
|
+
protocol: "openid4vp-v1-unsigned",
|
|
347
|
+
data: res.data
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Forwards the opaque wallet response for backend decryption. The body key
|
|
352
|
+
* differs per platform (`deviceResponse` for Apple, `identityToken` — a JWE —
|
|
353
|
+
* for Google); decryption is entirely server-side.
|
|
354
|
+
*/
|
|
355
|
+
async function decryptWalletResponse(platform, walletResponse, signal) {
|
|
356
|
+
const url = platform === "ios" ? endpoints.deviceWalletAppleDecrypt : endpoints.deviceWalletGoogleDecrypt;
|
|
357
|
+
const body = platform === "ios" ? { deviceResponse: walletResponse } : { identityToken: walletResponse };
|
|
358
|
+
const res = await api.post(url, body, {
|
|
359
|
+
headers: API_VERSION_HEADERS,
|
|
360
|
+
signal
|
|
361
|
+
});
|
|
362
|
+
if (!res.ok) throw new Error(`POST ${url} failed: ${res.status}`);
|
|
363
|
+
return res.data;
|
|
364
|
+
}
|
|
365
|
+
const defaultDeviceWalletServices = {
|
|
366
|
+
requestWalletData,
|
|
367
|
+
decryptWalletResponse
|
|
368
|
+
};
|
|
369
|
+
//#endregion
|
|
370
|
+
//#region src/modules/id/deviceWallet/deviceWalletStateMachine.ts
|
|
371
|
+
const requestWalletDataActor = fromPromise(async ({ input, signal }) => input.services.requestWalletData(input.platform, signal));
|
|
372
|
+
const presentCredentialActor = fromPromise(async ({ input, signal }) => input.credentials.get(input.walletRequest, { signal }));
|
|
373
|
+
const decryptWalletActor = fromPromise(async ({ input, signal }) => input.services.decryptWalletResponse(input.platform, input.walletResponse, signal));
|
|
374
|
+
const getCredentialResponseFromEvent = (event) => {
|
|
375
|
+
if (!("output" in event)) return;
|
|
376
|
+
return event.output?.response;
|
|
377
|
+
};
|
|
378
|
+
const deviceWalletMachine = setup({
|
|
379
|
+
types: {
|
|
380
|
+
context: {},
|
|
381
|
+
events: {},
|
|
382
|
+
input: {},
|
|
383
|
+
output: {}
|
|
384
|
+
},
|
|
385
|
+
actors: {
|
|
386
|
+
requestWalletData: requestWalletDataActor,
|
|
387
|
+
presentCredential: presentCredentialActor,
|
|
388
|
+
decryptWallet: decryptWalletActor
|
|
389
|
+
},
|
|
390
|
+
actions: {
|
|
391
|
+
storeWalletRequest: assign(({ event }) => {
|
|
392
|
+
if (!("output" in event)) return {};
|
|
393
|
+
return { walletRequest: event.output };
|
|
394
|
+
}),
|
|
395
|
+
storeCredentialResponse: assign(({ event }) => ({ walletResponse: getCredentialResponseFromEvent(event) })),
|
|
396
|
+
storeDecryptResponse: assign(({ event }) => {
|
|
397
|
+
if (!("output" in event)) return {};
|
|
398
|
+
return { response: event.output };
|
|
399
|
+
}),
|
|
400
|
+
setNoCredentialFailReason: assign(() => ({ failReason: "NO_CREDENTIAL" })),
|
|
401
|
+
setWalletErrorFailReason: assign(() => ({ failReason: "WALLET_ERROR" })),
|
|
402
|
+
setUnsupportedPlatformFailReason: assign(() => ({ failReason: "UNSUPPORTED_PLATFORM" })),
|
|
403
|
+
clearTransientState: assign(() => ({
|
|
404
|
+
walletRequest: void 0,
|
|
405
|
+
walletResponse: void 0,
|
|
406
|
+
response: void 0,
|
|
407
|
+
failReason: null
|
|
408
|
+
}))
|
|
409
|
+
},
|
|
410
|
+
guards: {
|
|
411
|
+
hasCredentialsApi: ({ context }) => context.credentials.isAvailable(),
|
|
412
|
+
hasCredential: ({ event }) => Boolean(getCredentialResponseFromEvent(event))
|
|
413
|
+
}
|
|
414
|
+
}).createMachine({
|
|
415
|
+
id: "deviceWallet",
|
|
416
|
+
initial: "decideStart",
|
|
417
|
+
context: ({ input }) => ({
|
|
418
|
+
platform: input.platform,
|
|
419
|
+
credentials: input.credentials,
|
|
420
|
+
services: input.services ?? defaultDeviceWalletServices,
|
|
421
|
+
walletRequest: void 0,
|
|
422
|
+
walletResponse: void 0,
|
|
423
|
+
response: void 0,
|
|
424
|
+
failReason: null,
|
|
425
|
+
resultType: null
|
|
426
|
+
}),
|
|
427
|
+
output: ({ context }) => context.resultType === "success" && context.response ? {
|
|
428
|
+
result: "success",
|
|
429
|
+
decision: context.response.decision,
|
|
430
|
+
response: context.response
|
|
431
|
+
} : { result: "dismissed" },
|
|
432
|
+
states: {
|
|
433
|
+
decideStart: { always: [{
|
|
434
|
+
guard: "hasCredentialsApi",
|
|
435
|
+
target: "requesting"
|
|
436
|
+
}, {
|
|
437
|
+
target: "failed",
|
|
438
|
+
actions: ["setUnsupportedPlatformFailReason"]
|
|
439
|
+
}] },
|
|
440
|
+
requesting: { invoke: {
|
|
441
|
+
id: "requestWalletData",
|
|
442
|
+
src: "requestWalletData",
|
|
443
|
+
input: ({ context }) => ({
|
|
444
|
+
platform: context.platform,
|
|
445
|
+
services: context.services
|
|
446
|
+
}),
|
|
447
|
+
onDone: {
|
|
448
|
+
target: "presenting",
|
|
449
|
+
actions: ["storeWalletRequest"]
|
|
450
|
+
},
|
|
451
|
+
onError: {
|
|
452
|
+
target: "failed",
|
|
453
|
+
actions: ["setWalletErrorFailReason"]
|
|
454
|
+
}
|
|
455
|
+
} },
|
|
456
|
+
presenting: { invoke: {
|
|
457
|
+
id: "presentCredential",
|
|
458
|
+
src: "presentCredential",
|
|
459
|
+
input: ({ context }) => ({
|
|
460
|
+
credentials: context.credentials,
|
|
461
|
+
walletRequest: context.walletRequest
|
|
462
|
+
}),
|
|
463
|
+
onDone: [{
|
|
464
|
+
guard: "hasCredential",
|
|
465
|
+
target: "decrypting",
|
|
466
|
+
actions: ["storeCredentialResponse"]
|
|
467
|
+
}, {
|
|
468
|
+
target: "failed",
|
|
469
|
+
actions: ["setNoCredentialFailReason"]
|
|
470
|
+
}],
|
|
471
|
+
onError: {
|
|
472
|
+
target: "failed",
|
|
473
|
+
actions: ["setWalletErrorFailReason"]
|
|
474
|
+
}
|
|
475
|
+
} },
|
|
476
|
+
decrypting: { invoke: {
|
|
477
|
+
id: "decryptWallet",
|
|
478
|
+
src: "decryptWallet",
|
|
479
|
+
input: ({ context }) => ({
|
|
480
|
+
platform: context.platform,
|
|
481
|
+
walletResponse: context.walletResponse,
|
|
482
|
+
services: context.services
|
|
483
|
+
}),
|
|
484
|
+
onDone: {
|
|
485
|
+
target: "finished",
|
|
486
|
+
actions: ["storeDecryptResponse"]
|
|
487
|
+
},
|
|
488
|
+
onError: {
|
|
489
|
+
target: "failed",
|
|
490
|
+
actions: ["setWalletErrorFailReason"]
|
|
491
|
+
}
|
|
492
|
+
} },
|
|
493
|
+
failed: { on: {
|
|
494
|
+
RETRY: {
|
|
495
|
+
target: "decideStart",
|
|
496
|
+
actions: ["clearTransientState"]
|
|
497
|
+
},
|
|
498
|
+
USE_ANOTHER_METHOD: { target: "closed" }
|
|
499
|
+
} },
|
|
500
|
+
finished: {
|
|
501
|
+
type: "final",
|
|
502
|
+
entry: assign({ resultType: "success" })
|
|
503
|
+
},
|
|
504
|
+
closed: {
|
|
505
|
+
type: "final",
|
|
506
|
+
entry: assign({ resultType: "dismissed" })
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
//#endregion
|
|
511
|
+
//#region src/modules/id/deviceWallet/deviceWalletPlatform.ts
|
|
512
|
+
/**
|
|
513
|
+
* Maps an explicit provider override or the current user agent to the wallet
|
|
514
|
+
* platform (ported from V1 `resolveWalletPlatform`, minus the Credentials API
|
|
515
|
+
* capability check — that lives on `IDigitalCredentialsCapability.isAvailable()`
|
|
516
|
+
* and is consulted by the digital-ID funnel before this module is invoked).
|
|
517
|
+
*
|
|
518
|
+
* Auto-detection: iOS/iPadOS and macOS Safari → Apple Wallet (web); Android
|
|
519
|
+
* and every other desktop/unknown browser (incl. macOS Chrome) → Google
|
|
520
|
+
* Wallet, which is the only wallet reachable there.
|
|
521
|
+
*/
|
|
522
|
+
function resolveWalletPlatform(provider) {
|
|
523
|
+
if (provider === "apple_web") return "ios";
|
|
524
|
+
if (provider === "google") return "android";
|
|
525
|
+
return isIOS() || isMacOsSafari() || isIPad() ? "ios" : "android";
|
|
526
|
+
}
|
|
527
|
+
//#endregion
|
|
312
528
|
//#region src/modules/id/manualUpload/manualUploadErrors.ts
|
|
313
529
|
/**
|
|
314
530
|
* i18n keys for manual-upload user-facing error copy.
|
|
@@ -831,6 +1047,12 @@ const hasNoDocumentTypesAvailableGuard = ({ context }) => context.availableDocum
|
|
|
831
1047
|
const isManualIdUploadSelectedGuard = ({ event }) => event.type === "SELECT_DOCUMENT" && event.documentType === "manualIdUpload";
|
|
832
1048
|
const isDigitalIdUploadSelectedGuard = ({ event }) => event.type === "SELECT_DOCUMENT" && event.documentType === "digitalIdUpload";
|
|
833
1049
|
const isDigitalIdRedirectSelectedGuard = ({ event }) => event.type === "SELECT_DOCUMENT" && event.documentType === "digitalIdRedirect";
|
|
1050
|
+
/** The Digital ID (device wallet) chooser tile was picked. */
|
|
1051
|
+
const isDigitalIdSelectedGuard = ({ event }) => event.type === "SELECT_DOCUMENT" && event.documentType === "digitalId";
|
|
1052
|
+
/** Funnel resolution stored by `resolveDigitalIdRoute` picked the native wallet. */
|
|
1053
|
+
const digitalIdRouteIsWalletGuard = ({ context }) => context.digitalIdRoute?.kind === "incodeWallet";
|
|
1054
|
+
/** Funnel resolution picked the Trinsic web-redirect fallback. */
|
|
1055
|
+
const digitalIdRouteIsTrinsicGuard = ({ context }) => context.digitalIdRoute?.kind === "trinsicRedirect";
|
|
834
1056
|
const isUploadExpiredGuard = ({ context }) => context.uploadResponse?.isDocumentExpired === true;
|
|
835
1057
|
/**
|
|
836
1058
|
* True when *this* expired upload will exhaust the same-side expired budget.
|
|
@@ -913,26 +1135,106 @@ const isBackModeInMultiSideFlowGuard = ({ context }) => context.currentMode ===
|
|
|
913
1135
|
const wasExpiredRedirectedGuard = ({ context }) => context.expiredRedirected === true;
|
|
914
1136
|
const hasManualCaptureTriggeredGuard = ({ context }) => context.manualCaptureTriggered;
|
|
915
1137
|
//#endregion
|
|
916
|
-
//#region src/modules/id/
|
|
1138
|
+
//#region src/modules/id/digitalIdRegistry.ts
|
|
917
1139
|
/**
|
|
918
1140
|
* True when a digital-ID method uses a full-page web-redirect flow (Trinsic
|
|
919
1141
|
* iDIN/FTN). Accepts both the module `FlowType` value (`REDIRECT`) and the
|
|
920
|
-
* backend value (`WEB_REDIRECT`).
|
|
1142
|
+
* backend value (`WEB_REDIRECT`). (Lives here rather than in
|
|
1143
|
+
* `idCaptureHelpers` to keep the registry free of circular imports; the
|
|
1144
|
+
* helpers re-export it.)
|
|
921
1145
|
*/
|
|
922
1146
|
function isRedirectFlowType(flowType) {
|
|
923
1147
|
return flowType === "REDIRECT" || flowType === "WEB_REDIRECT";
|
|
924
1148
|
}
|
|
1149
|
+
const DIGITAL_ID_REGISTRY = {
|
|
1150
|
+
mDL: [{
|
|
1151
|
+
kind: "incodeWallet",
|
|
1152
|
+
documentType: "digitalId",
|
|
1153
|
+
configFlag: "deviceWallet"
|
|
1154
|
+
}, {
|
|
1155
|
+
kind: "trinsicRedirect",
|
|
1156
|
+
documentType: "digitalIdRedirect",
|
|
1157
|
+
providerId: "trinsic_mdl_placeholder",
|
|
1158
|
+
method: "MDL"
|
|
1159
|
+
}],
|
|
1160
|
+
iDIN: [{
|
|
1161
|
+
kind: "trinsicRedirect",
|
|
1162
|
+
documentType: "digitalIdRedirect",
|
|
1163
|
+
providerId: "trinsic_netherlands_idin",
|
|
1164
|
+
method: "IDIN"
|
|
1165
|
+
}],
|
|
1166
|
+
FTN: [{
|
|
1167
|
+
kind: "trinsicRedirect",
|
|
1168
|
+
documentType: "digitalIdRedirect",
|
|
1169
|
+
providerId: "trinsic_finnish_trust_network",
|
|
1170
|
+
method: "FTN"
|
|
1171
|
+
}]
|
|
1172
|
+
};
|
|
1173
|
+
const DIGITAL_ID_DOCUMENT_TYPES = Object.keys(DIGITAL_ID_REGISTRY);
|
|
925
1174
|
/**
|
|
926
|
-
*
|
|
927
|
-
*
|
|
928
|
-
*
|
|
929
|
-
*
|
|
930
|
-
* Phase 1: hardcoded; later this could be sourced from the `/providers` catalog.
|
|
1175
|
+
* Tolerant view over `config.digitalIds`: accepts both the mapped array
|
|
1176
|
+
* (`IdCaptureDigitalIdMethod[]`) and the raw backend object
|
|
1177
|
+
* (`{ enabled, methods: [...] }`). Extracted from the old
|
|
1178
|
+
* `getDigitalIdRedirectMethod` cast so every consumer parses it the same way.
|
|
931
1179
|
*/
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
}
|
|
1180
|
+
function normalizeDigitalIdMethods(config) {
|
|
1181
|
+
const raw = config.digitalIds;
|
|
1182
|
+
return Array.isArray(raw) ? raw : raw?.methods ?? [];
|
|
1183
|
+
}
|
|
1184
|
+
/** Whether a funnel entry is activated by config + platform capabilities. */
|
|
1185
|
+
function isEntryActive(entry, config, platform) {
|
|
1186
|
+
if (entry.kind === "incodeWallet") return config[entry.configFlag] === true && platform.credentialsAvailable;
|
|
1187
|
+
return findConfiguredMethod(entry, config) !== void 0;
|
|
1188
|
+
}
|
|
1189
|
+
/**
|
|
1190
|
+
* The configured `digitalIds` method matching a Trinsic funnel entry — by
|
|
1191
|
+
* persisted method name, or (mapped shape) by provider id on a redirect
|
|
1192
|
+
* flowType. Mirrors the old first-match semantics; `methods[].enabled` is
|
|
1193
|
+
* deliberately still not consulted (pre-existing behavior).
|
|
1194
|
+
*/
|
|
1195
|
+
function findConfiguredMethod(entry, config) {
|
|
1196
|
+
return normalizeDigitalIdMethods(config).find((method) => method.method?.toUpperCase() === entry.method || method.provider === entry.providerId && !!method.flowType && isRedirectFlowType(method.flowType));
|
|
1197
|
+
}
|
|
1198
|
+
/** Normalizes a raw configured method into the mapped shape for the child input. */
|
|
1199
|
+
function toMappedMethod(entry, method) {
|
|
1200
|
+
if (method.flowType && isRedirectFlowType(method.flowType)) return method;
|
|
1201
|
+
return {
|
|
1202
|
+
method: method.method,
|
|
1203
|
+
provider: entry.providerId,
|
|
1204
|
+
flowType: "WEB_REDIRECT",
|
|
1205
|
+
country: method.country ?? method.countries?.[0],
|
|
1206
|
+
displayName: method.displayName
|
|
1207
|
+
};
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* Resolves the implementation that should fulfil a digital-ID document type:
|
|
1211
|
+
* the first funnel entry that is active under the given config and platform.
|
|
1212
|
+
* `undefined` when nothing can run it (the chooser then shows no tile for it).
|
|
1213
|
+
*/
|
|
1214
|
+
function resolveDigitalIdImplementation(docType, config, platform) {
|
|
1215
|
+
for (const entry of DIGITAL_ID_REGISTRY[docType]) {
|
|
1216
|
+
if (!isEntryActive(entry, config, platform)) continue;
|
|
1217
|
+
if (entry.kind === "incodeWallet") return { kind: "incodeWallet" };
|
|
1218
|
+
const method = findConfiguredMethod(entry, config);
|
|
1219
|
+
return {
|
|
1220
|
+
kind: "trinsicRedirect",
|
|
1221
|
+
providerId: entry.providerId,
|
|
1222
|
+
method: method ? toMappedMethod(entry, method) : void 0
|
|
1223
|
+
};
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
//#endregion
|
|
1227
|
+
//#region src/modules/id/idCaptureHelpers.ts
|
|
1228
|
+
/**
|
|
1229
|
+
* Persisted method name → catalog provider id, derived from the digital-ID
|
|
1230
|
+
* registry's Trinsic entries (single source of truth — was a hardcoded map
|
|
1231
|
+
* here before the registry existed).
|
|
1232
|
+
*/
|
|
1233
|
+
const REDIRECT_PROVIDER_BY_METHOD = (() => {
|
|
1234
|
+
const map = {};
|
|
1235
|
+
for (const docType of DIGITAL_ID_DOCUMENT_TYPES) for (const entry of DIGITAL_ID_REGISTRY[docType]) if (entry.kind === "trinsicRedirect") map[entry.method] = entry.providerId;
|
|
1236
|
+
return map;
|
|
1237
|
+
})();
|
|
936
1238
|
/**
|
|
937
1239
|
* The first enabled web-redirect digital-ID method (iDIN-only for now), or
|
|
938
1240
|
* `undefined` when none is configured. Drives both the `digitalIdRedirect`
|
|
@@ -941,12 +1243,11 @@ const REDIRECT_PROVIDER_BY_METHOD = {
|
|
|
941
1243
|
* Accepts both the mapped array (`IdCaptureDigitalIdMethod[]`) and the raw
|
|
942
1244
|
* backend `configuration.digitalIds` object (`{ enabled, methods: [...] }`);
|
|
943
1245
|
* for the raw shape it derives `provider`/`flowType` from the persisted method
|
|
944
|
-
* name (`IDIN` → `trinsic_netherlands_idin`,
|
|
1246
|
+
* name via the digital-ID registry (`IDIN` → `trinsic_netherlands_idin`,
|
|
1247
|
+
* `WEB_REDIRECT`).
|
|
945
1248
|
*/
|
|
946
1249
|
function getDigitalIdRedirectMethod(config) {
|
|
947
|
-
const
|
|
948
|
-
const methods = Array.isArray(raw) ? raw : raw?.methods ?? [];
|
|
949
|
-
for (const method of methods) {
|
|
1250
|
+
for (const method of normalizeDigitalIdMethods(config)) {
|
|
950
1251
|
if (method.flowType && isRedirectFlowType(method.flowType)) return method;
|
|
951
1252
|
const provider = method.method ? REDIRECT_PROVIDER_BY_METHOD[method.method.toUpperCase()] : void 0;
|
|
952
1253
|
if (provider) return {
|
|
@@ -965,20 +1266,33 @@ const DOCUMENT_TYPES_CONFIG_TO_ADJUSTED_MAP = [
|
|
|
965
1266
|
["enableId", "id"],
|
|
966
1267
|
["enablePassport", "passport"],
|
|
967
1268
|
["manualUploadIdCapture", "manualIdUpload"],
|
|
968
|
-
["digitalIdsUpload", "digitalIdUpload"]
|
|
969
|
-
["deviceWallet", "digitalId"]
|
|
1269
|
+
["digitalIdsUpload", "digitalIdUpload"]
|
|
970
1270
|
];
|
|
971
1271
|
/**
|
|
972
1272
|
* Returns the list of document types enabled by config for the chooser screen, in display order.
|
|
973
1273
|
* Used to populate chooser state so UI and headless consumers can render the correct options.
|
|
974
1274
|
*
|
|
1275
|
+
* Digital-ID document types (device wallet, Trinsic web-redirect) come from
|
|
1276
|
+
* the digital-ID registry funnel: each registry document type contributes the
|
|
1277
|
+
* tile of its first active implementation. A `deviceWallet: true` config on a
|
|
1278
|
+
* platform without the Credentials API therefore shows the Trinsic fallback
|
|
1279
|
+
* tile when one is configured — or no tile at all, instead of a dead-end one.
|
|
1280
|
+
*
|
|
975
1281
|
* @param config - ID capture configuration (from flow or init)
|
|
1282
|
+
* @param platform - Platform capabilities consulted by the digital-ID funnel.
|
|
1283
|
+
* Defaults to no Credentials API for pure-node callers; the machine passes
|
|
1284
|
+
* the real capability check.
|
|
976
1285
|
* @returns Array of IdDocumentType values that should be shown in the document type chooser
|
|
977
1286
|
*/
|
|
978
|
-
function getAvailableDocumentTypes(config) {
|
|
1287
|
+
function getAvailableDocumentTypes(config, platform = { credentialsAvailable: false }) {
|
|
979
1288
|
const adjustedDocumentTypes = [];
|
|
980
1289
|
for (const [configProperty, adjustedType] of DOCUMENT_TYPES_CONFIG_TO_ADJUSTED_MAP) if (config[configProperty]) adjustedDocumentTypes.push(adjustedType);
|
|
981
|
-
|
|
1290
|
+
for (const docType of DIGITAL_ID_DOCUMENT_TYPES) {
|
|
1291
|
+
const route = resolveDigitalIdImplementation(docType, config, platform);
|
|
1292
|
+
if (!route) continue;
|
|
1293
|
+
const documentType = route.kind === "incodeWallet" ? "digitalId" : "digitalIdRedirect";
|
|
1294
|
+
if (!adjustedDocumentTypes.includes(documentType)) adjustedDocumentTypes.push(documentType);
|
|
1295
|
+
}
|
|
982
1296
|
return adjustedDocumentTypes;
|
|
983
1297
|
}
|
|
984
1298
|
/**
|
|
@@ -1772,7 +2086,7 @@ const startRecordingActor = fromPromise(async ({ input }) => {
|
|
|
1772
2086
|
});
|
|
1773
2087
|
const initializeDeepsightSessionActor = fromPromise(async ({ input }) => {
|
|
1774
2088
|
if (!input.dependencies) return;
|
|
1775
|
-
const { loadDeepsightSession } = await import("./deepsightLoader-
|
|
2089
|
+
const { loadDeepsightSession } = await import("./deepsightLoader-DdgzfNqc.esm.js");
|
|
1776
2090
|
return loadDeepsightSession({
|
|
1777
2091
|
ds: input.ds,
|
|
1778
2092
|
storage: input.dependencies.storage,
|
|
@@ -2188,6 +2502,18 @@ function getBarcodeResponseValues(context, event) {
|
|
|
2188
2502
|
//#endregion
|
|
2189
2503
|
//#region src/modules/id/idCaptureStateMachine.ts
|
|
2190
2504
|
/**
|
|
2505
|
+
* Null-object stand-in when no credentials capability was injected (the
|
|
2506
|
+
* composition root, `createIdCaptureActor`, always injects one — this covers
|
|
2507
|
+
* direct machine construction only). Reports unavailable, so the wallet tile
|
|
2508
|
+
* never surfaces and the child fails defensively with UNSUPPORTED_PLATFORM.
|
|
2509
|
+
* Kept here instead of `?? new BrowserProvider()` fallbacks: Core never
|
|
2510
|
+
* constructs concrete providers, and an injected mock is never bypassed.
|
|
2511
|
+
*/
|
|
2512
|
+
const unavailableDigitalCredentials = {
|
|
2513
|
+
isAvailable: () => false,
|
|
2514
|
+
get: () => Promise.reject(/* @__PURE__ */ new Error("No digital-credentials capability injected"))
|
|
2515
|
+
};
|
|
2516
|
+
/**
|
|
2191
2517
|
* Shown/logged when an ID capture module has no accepted documents and no
|
|
2192
2518
|
* other capture option enabled — there is nothing to capture (ENG-43983).
|
|
2193
2519
|
*/
|
|
@@ -2222,6 +2548,7 @@ const idCaptureMachine = setup({
|
|
|
2222
2548
|
manualUploadMachine,
|
|
2223
2549
|
digitalUploadMachine,
|
|
2224
2550
|
digitalIdRedirectMachine,
|
|
2551
|
+
deviceWalletMachine,
|
|
2225
2552
|
readPendingDigitalIdRedirect: fromPromise(async ({ input }) => {
|
|
2226
2553
|
const pending = await readPendingRedirect(input.storage);
|
|
2227
2554
|
if (!pending) return null;
|
|
@@ -2496,6 +2823,29 @@ const idCaptureMachine = setup({
|
|
|
2496
2823
|
};
|
|
2497
2824
|
}),
|
|
2498
2825
|
/**
|
|
2826
|
+
* Runs the digital-ID funnel for the Digital ID chooser tile: native
|
|
2827
|
+
* device wallet when `deviceWallet` is on and the platform exposes the
|
|
2828
|
+
* Credentials API, else the configured Trinsic fallback for the same
|
|
2829
|
+
* document type. Stored on context so `digitalIdRouting` can branch and
|
|
2830
|
+
* the Trinsic leg can preset its provider. Resolution is synchronous —
|
|
2831
|
+
* it runs inside the tile click's `send()`, preserving the transient
|
|
2832
|
+
* user activation `navigator.credentials.get()` needs on iOS Safari.
|
|
2833
|
+
*/
|
|
2834
|
+
resolveDigitalIdRoute: assign(({ context }) => ({ digitalIdRoute: resolveDigitalIdImplementation("mDL", context.config, { credentialsAvailable: context.dependencies?.credentials?.isAvailable() ?? false }) })),
|
|
2835
|
+
/**
|
|
2836
|
+
* Records a completed device-wallet (mDL) handshake from the child's
|
|
2837
|
+
* `onDone` output. Wallet credentials are single-side; the verified
|
|
2838
|
+
* attributes (incl. the portrait) land in the session server-side, so —
|
|
2839
|
+
* unlike a portrait-less redirect — the downstream Face Match is kept.
|
|
2840
|
+
*/
|
|
2841
|
+
storeDeviceWalletResult: assign(({ event }) => {
|
|
2842
|
+
const output = event.output;
|
|
2843
|
+
return {
|
|
2844
|
+
isDeviceWallet: true,
|
|
2845
|
+
deviceWalletDecision: output?.result === "success" ? output.decision : void 0
|
|
2846
|
+
};
|
|
2847
|
+
}),
|
|
2848
|
+
/**
|
|
2499
2849
|
* Return leg: stash the storage-recovered `verificationId` + `providerId`
|
|
2500
2850
|
* (from the `readPendingDigitalIdRedirect` actor) so the `digitalIdRedirect`
|
|
2501
2851
|
* child can be invoked in resume mode.
|
|
@@ -2544,6 +2894,9 @@ const idCaptureMachine = setup({
|
|
|
2544
2894
|
isManualIdUploadSelected: isManualIdUploadSelectedGuard,
|
|
2545
2895
|
isDigitalIdUploadSelected: isDigitalIdUploadSelectedGuard,
|
|
2546
2896
|
isDigitalIdRedirectSelected: isDigitalIdRedirectSelectedGuard,
|
|
2897
|
+
isDigitalIdSelected: isDigitalIdSelectedGuard,
|
|
2898
|
+
digitalIdRouteIsWallet: digitalIdRouteIsWalletGuard,
|
|
2899
|
+
digitalIdRouteIsTrinsic: digitalIdRouteIsTrinsicGuard,
|
|
2547
2900
|
isUploadExpired: isUploadExpiredGuard,
|
|
2548
2901
|
isExpiredAttemptsExhausted: isExpiredAttemptsExhaustedGuard,
|
|
2549
2902
|
isNotPassportMode: isNotPassportModeGuard,
|
|
@@ -2562,6 +2915,7 @@ const idCaptureMachine = setup({
|
|
|
2562
2915
|
isDigitalUploadExhausted: ({ event }) => event.output?.result === "exhausted",
|
|
2563
2916
|
isDigitalUploadSuccessful: ({ event }) => event.output?.result === "success",
|
|
2564
2917
|
isDigitalIdRedirectCompleted: ({ event }) => event.output?.status === "COMPLETED",
|
|
2918
|
+
isDeviceWalletSuccessful: ({ event }) => event.output?.result === "success",
|
|
2565
2919
|
hasDigitalIdReturn: ({ context }) => context.digitalIdReturnParams !== void 0,
|
|
2566
2920
|
hasPendingDigitalIdRedirect: ({ event }) => event.output != null
|
|
2567
2921
|
},
|
|
@@ -2631,6 +2985,9 @@ const idCaptureMachine = setup({
|
|
|
2631
2985
|
isDigitalUpload: false,
|
|
2632
2986
|
isDigitalIdRedirect: false,
|
|
2633
2987
|
portraitPresent: false,
|
|
2988
|
+
digitalIdRoute: void 0,
|
|
2989
|
+
isDeviceWallet: false,
|
|
2990
|
+
deviceWalletDecision: void 0,
|
|
2634
2991
|
digitalIdReturnParams: input.config.digitalIdReturn?.returnParams,
|
|
2635
2992
|
digitalIdResumeVerificationId: void 0,
|
|
2636
2993
|
digitalIdResumeProviderId: void 0,
|
|
@@ -2652,7 +3009,7 @@ const idCaptureMachine = setup({
|
|
|
2652
3009
|
dependencies: input.dependencies,
|
|
2653
3010
|
disableIpify: getDisableIpify(),
|
|
2654
3011
|
deepsightInitAttempted: false,
|
|
2655
|
-
availableDocumentTypes: getAvailableDocumentTypes(input.config),
|
|
3012
|
+
availableDocumentTypes: getAvailableDocumentTypes(input.config, { credentialsAvailable: input.dependencies?.credentials?.isAvailable() ?? false }),
|
|
2656
3013
|
captureResolution: void 0,
|
|
2657
3014
|
cameraFallbackLevel: void 0,
|
|
2658
3015
|
usingBackCamera: void 0
|
|
@@ -2692,6 +3049,11 @@ const idCaptureMachine = setup({
|
|
|
2692
3049
|
{ target: "loading" }
|
|
2693
3050
|
] } },
|
|
2694
3051
|
chooser: { on: { SELECT_DOCUMENT: [
|
|
3052
|
+
{
|
|
3053
|
+
target: "digitalIdRouting",
|
|
3054
|
+
guard: "isDigitalIdSelected",
|
|
3055
|
+
actions: ["setSelectedDocument", "resolveDigitalIdRoute"]
|
|
3056
|
+
},
|
|
2695
3057
|
{
|
|
2696
3058
|
target: "digitalIdRedirect",
|
|
2697
3059
|
guard: "isDigitalIdRedirectSelected",
|
|
@@ -3779,9 +4141,10 @@ const idCaptureMachine = setup({
|
|
|
3779
4141
|
input: ({ context }) => {
|
|
3780
4142
|
const method = getDigitalIdRedirectMethod(context.config);
|
|
3781
4143
|
const resuming = context.digitalIdReturnParams !== void 0 && context.digitalIdResumeVerificationId !== void 0;
|
|
4144
|
+
const routedProvider = context.digitalIdRoute?.kind === "trinsicRedirect" ? context.digitalIdRoute.providerId : void 0;
|
|
3782
4145
|
return {
|
|
3783
4146
|
config: {
|
|
3784
|
-
provider: context.digitalIdResumeProviderId ?? method?.provider,
|
|
4147
|
+
provider: context.digitalIdResumeProviderId ?? routedProvider ?? method?.provider,
|
|
3785
4148
|
returnUrl: context.config.digitalIdReturnUrl,
|
|
3786
4149
|
country: method?.country
|
|
3787
4150
|
},
|
|
@@ -3818,8 +4181,58 @@ const idCaptureMachine = setup({
|
|
|
3818
4181
|
DIGITAL_ID_REDIRECT_CONTINUE: { actions: sendTo("digitalIdRedirect", { type: "CONTINUE" }) },
|
|
3819
4182
|
DIGITAL_ID_REDIRECT_REFRESH: { actions: sendTo("digitalIdRedirect", { type: "REFRESH" }) }
|
|
3820
4183
|
}
|
|
4184
|
+
},
|
|
4185
|
+
digitalIdRouting: { always: [
|
|
4186
|
+
{
|
|
4187
|
+
guard: "digitalIdRouteIsWallet",
|
|
4188
|
+
target: "deviceWallet"
|
|
4189
|
+
},
|
|
4190
|
+
{
|
|
4191
|
+
guard: "digitalIdRouteIsTrinsic",
|
|
4192
|
+
target: "digitalIdRedirect"
|
|
4193
|
+
},
|
|
4194
|
+
{
|
|
4195
|
+
target: "chooser",
|
|
4196
|
+
guard: "hasShowDocumentChooser"
|
|
4197
|
+
},
|
|
4198
|
+
{
|
|
4199
|
+
target: "#idCapture.error",
|
|
4200
|
+
actions: assign({ error: () => "No digital-ID implementation available for the selected document type" })
|
|
4201
|
+
}
|
|
4202
|
+
] },
|
|
4203
|
+
deviceWallet: {
|
|
4204
|
+
invoke: {
|
|
4205
|
+
id: "deviceWallet",
|
|
4206
|
+
src: "deviceWalletMachine",
|
|
4207
|
+
input: ({ context }) => ({
|
|
4208
|
+
platform: resolveWalletPlatform(),
|
|
4209
|
+
credentials: context.dependencies?.credentials ?? unavailableDigitalCredentials
|
|
4210
|
+
}),
|
|
4211
|
+
onSnapshot: { actions: () => {} },
|
|
4212
|
+
onDone: [
|
|
4213
|
+
{
|
|
4214
|
+
guard: "isDeviceWalletSuccessful",
|
|
4215
|
+
target: "#idCapture.finished",
|
|
4216
|
+
actions: ["storeDeviceWalletResult"]
|
|
4217
|
+
},
|
|
4218
|
+
{
|
|
4219
|
+
target: "chooser",
|
|
4220
|
+
guard: "hasShowDocumentChooser"
|
|
4221
|
+
},
|
|
4222
|
+
{ target: "closed" }
|
|
4223
|
+
],
|
|
4224
|
+
onError: {
|
|
4225
|
+
target: "#idCapture.error",
|
|
4226
|
+
actions: assign({ error: ({ event }) => String(event.error) })
|
|
4227
|
+
}
|
|
4228
|
+
},
|
|
4229
|
+
on: {
|
|
4230
|
+
QUIT: { target: "closed" },
|
|
4231
|
+
DEVICE_WALLET_RETRY: { actions: sendTo("deviceWallet", { type: "RETRY" }) },
|
|
4232
|
+
DEVICE_WALLET_USE_ANOTHER_METHOD: { actions: sendTo("deviceWallet", { type: "USE_ANOTHER_METHOD" }) }
|
|
4233
|
+
}
|
|
3821
4234
|
}
|
|
3822
4235
|
}
|
|
3823
4236
|
});
|
|
3824
4237
|
//#endregion
|
|
3825
|
-
export {
|
|
4238
|
+
export { isRedirectFlowType as a, MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES as c, DIGITAL_ID_REGISTRY as i, MANUAL_UPLOAD_MAX_RETRIES as l, getManualUploadTabs as n, resolveDigitalIdImplementation as o, DIGITAL_ID_DOCUMENT_TYPES as r, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS as s, idCaptureMachine as t, resolveWalletPlatform as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ijlbX_Wx.esm.js";
|
|
2
2
|
import { s as createActor, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
|
|
3
|
-
import { t as idOcrStateMachine } from "./idOcrStateMachine-
|
|
3
|
+
import { t as idOcrStateMachine } from "./idOcrStateMachine-7XoaRHAP.esm.js";
|
|
4
4
|
//#region src/modules/id-ocr/idOcrActor.ts
|
|
5
5
|
function createIdOcrActor(options) {
|
|
6
6
|
return createActor(idOcrStateMachine, { input: { config: options.config } }).start();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as getTimestamp } from "./IBrowserEnvironmentCapability-DEaRRk-R.esm.js";
|
|
2
2
|
import { t as api } from "./api-Bx3gKW_y.esm.js";
|
|
3
|
-
import { t as endpoints } from "./endpoints-
|
|
3
|
+
import { t as endpoints } from "./endpoints-CXZYMaDj.esm.js";
|
|
4
4
|
import { i as assign, t as setup } from "./xstate.esm-BuFLFuzz.esm.js";
|
|
5
5
|
import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
|
|
6
6
|
import { t as validateCPF } from "./cpf-BIADjddF.esm.js";
|
package/dist/{idVerificationManager-BP_qxCyL.esm.js → idVerificationManager-CcnzNq2Y.esm.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ijlbX_Wx.esm.js";
|
|
2
2
|
import { s as createActor, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
|
|
3
|
-
import { t as idVerificationMachine } from "./idVerificationStateMachine-
|
|
3
|
+
import { t as idVerificationMachine } from "./idVerificationStateMachine-COvxom5O.esm.js";
|
|
4
4
|
//#region src/modules/id-verification/idVerificationActor.ts
|
|
5
5
|
function createIdVerificationActor(options) {
|
|
6
6
|
return createActor(idVerificationMachine, { input: { config: options.config } }).start();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as api } from "./api-Bx3gKW_y.esm.js";
|
|
2
|
-
import { t as endpoints } from "./endpoints-
|
|
2
|
+
import { t as endpoints } from "./endpoints-CXZYMaDj.esm.js";
|
|
3
3
|
import { t as setup } from "./xstate.esm-BuFLFuzz.esm.js";
|
|
4
4
|
import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
|
|
5
5
|
//#region src/modules/id-verification/idVerificationServices.ts
|