@incodetech/core 2.1.0-rc.1 → 2.1.0-rc.3
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/3dAvatarProvider-ChciZmjE.esm.js +28214 -0
- package/dist/{BrowserStorageProvider-BpJM-gIl.esm.js → BrowserStorageProvider-CrrN540a.esm.js} +1 -8
- package/dist/BrowserVisibilityObserverProvider-rim9Jrz-.esm.js +25 -0
- package/dist/Face2DProvider-BeLlYBbB.esm.js +824 -0
- package/dist/FaceDetectionProvider-B78455D4.d.ts +119 -0
- package/dist/IVisibilityObserverCapability-BbWjgpiF.d.ts +12 -0
- package/dist/IWasmUtilCapability-d2XvzaCk.d.ts +145 -0
- package/dist/IpifyProvider-BRW14_uo.esm.js +51 -0
- package/dist/{OpenViduRecordingProvider-O4GjBseO.esm.js → OpenViduRecordingProvider-B_0GKkzc.esm.js} +1 -1
- package/dist/PrivacyLensProvider-hDzaDzZ6.esm.js +339 -0
- package/dist/{StreamCanvasCapture-ImiDQdVA.esm.js → StreamCanvasCapture-Bz17q4FP.esm.js} +1 -1
- package/dist/StreamCanvasCapture-DS1TOoiH.d.ts +42 -0
- package/dist/{WasmUtilProvider-BKWm8rSA.esm.js → WasmUtilProvider-ADG54T6M.esm.js} +26 -2
- package/dist/{addressSearch-DvmWXKZg.esm.js → addressSearch-DJyNTg5S.esm.js} +4 -4
- package/dist/{ae-signature-BFZta3TZ.esm.js → ae-signature-DlElqFrZ.esm.js} +1 -1
- package/dist/ae-signature.d.ts +4 -3
- package/dist/ae-signature.esm.js +10 -7
- package/dist/antifraud.d.ts +4 -3
- package/dist/antifraud.esm.js +7 -6
- package/dist/antifraudManager-BKdQoMFf.esm.js +84 -0
- package/dist/{antifraudManager-CznnhyvD.d.ts → antifraudManager-DpIvbrZP.d.ts} +2 -2
- package/dist/{antifraudStateMachine-Ccrb-Jxc.esm.js → antifraudStateMachine-C0NGnP9W.esm.js} +3 -3
- package/dist/{api-CESGtpbH.esm.js → api-DsbUi7TO.esm.js} +21 -2
- package/dist/authentication.d.ts +19 -13
- package/dist/authentication.esm.js +33 -27
- package/dist/{authenticationManager-CaiQbp-q.d.ts → authenticationManager-CdPbNS2H.d.ts} +13 -3
- package/dist/{authenticationManager-BlR6mSaG.esm.js → authenticationManager-Dtl1vcET.esm.js} +17 -8
- package/dist/{authenticationStateMachine-DkcGUMw5.esm.js → authenticationStateMachine-D-hOlg8p.esm.js} +20 -23
- package/dist/avatar.d.ts +3 -0
- package/dist/avatar.esm.js +3 -0
- package/dist/{backCameraStream-D7Wo4Nbx.esm.js → backCameraStream-ZyqrFyjO.esm.js} +3 -3
- package/dist/browser-DlFgHpoC-qLKs75Qp.esm.js +1425 -0
- package/dist/{browserSimulation-B1dWiXp7.esm.js → browserSimulation-TsSoavQv.esm.js} +153 -1216
- package/dist/camera-DUkgmYMo.esm.js +79 -0
- package/dist/camera.d.ts +7 -1
- package/dist/camera.esm.js +4 -4
- package/dist/{StreamCanvasCapture-yyl20qd9.d.ts → canvas-CJUmoXSD.d.ts} +1 -41
- package/dist/certificate-issuance.d.ts +312 -0
- package/dist/certificate-issuance.esm.js +74 -0
- package/dist/certificateIssuanceStateMachine-C07m7qtP.esm.js +127 -0
- package/dist/clientLifecycle-Ct7h9uxx.esm.js +534 -0
- package/dist/consent.d.ts +4 -3
- package/dist/consent.esm.js +7 -6
- package/dist/{consentManager-BYo9Nu1r.esm.js → consentManager-BtnPZUW4.esm.js} +30 -5
- package/dist/{consentManager-Cg5Sk2tv.d.ts → consentManager-DufVo9D9.d.ts} +55 -55
- package/dist/{consentStateMachine-BG3yL8aC.esm.js → consentStateMachine-DO2JqoZW.esm.js} +3 -3
- package/dist/cpf-ocr.d.ts +4 -3
- package/dist/cpf-ocr.esm.js +7 -6
- package/dist/{cpfOcrManager-sSKegxox.esm.js → cpfOcrManager-C4rLgKsu.esm.js} +6 -5
- package/dist/{cpfOcrManager-Dg1s_TY5.d.ts → cpfOcrManager-DqZZ94Gt.d.ts} +19 -19
- package/dist/createFaceAvatar-B8pFpy6o.d.ts +401 -0
- package/dist/createFaceAvatar-BOHDKQRq.esm.js +46 -0
- package/dist/cross-document-data-match.d.ts +2 -1
- package/dist/cross-document-data-match.esm.js +6 -5
- package/dist/curp-validation.d.ts +10 -7
- package/dist/curp-validation.esm.js +7 -6
- package/dist/{curpValidationManager-CFem6zP9.esm.js → curpValidationManager-BafobPXC.esm.js} +52 -5
- package/dist/{curpValidationManager-RttixpIc.d.ts → curpValidationManager-Co6LZAHT.d.ts} +4 -3
- package/dist/{curpValidationStateMachine-B7V_qp66.esm.js → curpValidationStateMachine-DXTPK6vI.esm.js} +3 -3
- package/dist/custom-fields.d.ts +4 -2
- package/dist/custom-fields.esm.js +49 -6
- package/dist/custom-watchlist.d.ts +2 -1
- package/dist/custom-watchlist.esm.js +27 -6
- package/dist/{customWatchlistStateMachine-HmFybXLX.esm.js → customWatchlistStateMachine-B4G3Chkx.esm.js} +3 -3
- package/dist/{deepsightLoader-8tnddNx-.esm.js → deepsightLoader-DHSVD776.esm.js} +14 -13
- package/dist/{deepsightService-CrHmvx8X.esm.js → deepsightService-CDahSjGP.esm.js} +9 -38
- package/dist/deepsightService-CMB9XjES.d.ts +69 -0
- package/dist/device.d.ts +9 -1
- package/dist/device.esm.js +5 -5
- package/dist/document-capture.d.ts +178 -177
- package/dist/document-capture.esm.js +78 -14
- package/dist/document-upload.d.ts +51 -50
- package/dist/document-upload.esm.js +10 -9
- package/dist/{documentCaptureStateMachine-CUTUzUw_.esm.js → documentCaptureStateMachine-DSOX2epf.esm.js} +7 -7
- package/dist/dynamic-forms.d.ts +4 -192
- package/dist/dynamic-forms.esm.js +8 -410
- package/dist/dynamicFormsManager-BOefZbyF.esm.js +168 -0
- package/dist/dynamicFormsManager-CUYLOj9g.d.ts +239 -0
- package/dist/dynamicFormsStateMachine-BXHcaocI.esm.js +284 -0
- package/dist/ekyb.d.ts +10 -6
- package/dist/ekyb.esm.js +62 -17
- package/dist/{ekybStateMachine-klc-AImJ.esm.js → ekybStateMachine-CCSeqjCt.esm.js} +5 -5
- package/dist/ekyc.d.ts +5 -3
- package/dist/ekyc.esm.js +55 -9
- package/dist/{ekycStateMachine-CXbpaJJn.esm.js → ekycStateMachine-DkLVTOyA.esm.js} +5 -5
- package/dist/electronic-signature.d.ts +4 -3
- package/dist/electronic-signature.esm.js +9 -6
- package/dist/{electronicSignatureManager-BaECdJ1u.esm.js → electronicSignatureManager-DjzUzqZj.esm.js} +135 -92
- package/dist/email.d.ts +5 -4
- package/dist/email.esm.js +9 -8
- package/dist/{emailManager--D5G3ChB.esm.js → emailManager-B_XzEsXH.esm.js} +47 -6
- package/dist/{emailManager-lAzDoQOs.d.ts → emailManager-fHASH6uo.d.ts} +4 -3
- package/dist/{emailStateMachine-CxTOMAjC.esm.js → emailStateMachine-fqJ42b19.esm.js} +5 -5
- package/dist/{endpoints-BeTK0Mlt.esm.js → endpoints-BzMJFAPV.esm.js} +15 -0
- package/dist/{events-Dvvriq9l.esm.js → events-CqGY1yMq.esm.js} +87 -206
- package/dist/events.d.ts +23 -16
- package/dist/events.esm.js +3 -2
- package/dist/extensibility.d.ts +37 -27
- package/dist/extensibility.esm.js +74 -57
- package/dist/externalFetch-CyhBfD-n.esm.js +22 -0
- package/dist/face-match.d.ts +2 -2
- package/dist/face-match.esm.js +6 -5
- package/dist/{faceCaptureManagerFactory-ej2j1LMr.esm.js → faceCaptureManagerFactory-2brKTzMb.esm.js} +115 -25
- package/dist/faceCaptureManagerFactory-CGKbf7zt.d.ts +400 -0
- package/dist/{faceCaptureSetup-B9t6bYze.esm.js → faceCaptureSetup-CDUVU1nl.esm.js} +97 -13
- package/dist/{faceMatchStateMachine-DeXXzSuz.esm.js → faceMatchStateMachine-DUeUjEPx.esm.js} +3 -3
- package/dist/field-comparison.d.ts +4 -3
- package/dist/field-comparison.esm.js +6 -5
- package/dist/{fieldComparisonManager-COGI2ARD.esm.js → fieldComparisonManager-B9W0a9A5.esm.js} +5 -4
- package/dist/{fieldComparisonManager-Bu5TaSr3.d.ts → fieldComparisonManager-DdLqDeB2.d.ts} +2 -2
- package/dist/fiscal-qr.d.ts +5 -3
- package/dist/fiscal-qr.esm.js +13 -12
- package/dist/flow-events.d.ts +8 -6
- package/dist/flow.d.ts +34 -16
- package/dist/flow.esm.js +53 -30
- package/dist/flowCompletionService-BIqSTZcd.d.ts +28 -0
- package/dist/flowCompletionService-qEqh_g14.esm.js +42 -0
- package/dist/{flowServices-ChgTNggJ.esm.js → flowServices-C4piblgx.esm.js} +24 -9
- package/dist/geolocation.d.ts +4 -126
- package/dist/geolocation.esm.js +8 -87
- package/dist/geolocationManager-BP2Do9O-.esm.js +123 -0
- package/dist/geolocationManager-Cs50eRlC.d.ts +156 -0
- package/dist/{geolocationStateMachine-Dvh7X0wF.esm.js → geolocationStateMachine-BYfOOOG0.esm.js} +4 -4
- package/dist/{getDeviceClass-C8Do2qYu.esm.js → getDeviceClass-DGGzzfqm.esm.js} +1 -1
- package/dist/getDeviceData-TrKM8NPh.esm.js +101 -0
- package/dist/government-validation.d.ts +4 -3
- package/dist/government-validation.esm.js +43 -8
- package/dist/{governmentValidationStateMachine-DcJ-BfsC.esm.js → governmentValidationStateMachine-CwoPPO8b.esm.js} +5 -5
- package/dist/home.d.ts +18 -15
- package/dist/home.esm.js +5 -4
- package/dist/http.d.ts +1 -0
- package/dist/http.esm.js +2 -2
- package/dist/id-ocr.d.ts +4 -625
- package/dist/id-ocr.esm.js +8 -84
- package/dist/id-verification.d.ts +28 -27
- package/dist/id-verification.esm.js +6 -5
- package/dist/id.d.ts +24 -13
- package/dist/id.esm.js +48 -33
- package/dist/idCaptureDefaults-DNJON8Xo.esm.js +188 -0
- package/dist/{idCaptureManager-ChCNmgBj.d.ts → idCaptureManager-BVdvfJys.d.ts} +47 -12
- package/dist/{idCaptureManager-D3pwWutw.esm.js → idCaptureManager-Bo9DCQSU.esm.js} +100 -15
- package/dist/{idCaptureStateMachine-B3AiDIsT.esm.js → idCaptureStateMachine-BeDidMLU.esm.js} +525 -439
- package/dist/idOcrManager-BkRDrpZu.esm.js +92 -0
- package/dist/idOcrManager-CJzrmM91.d.ts +641 -0
- package/dist/{idOcrStateMachine-CDQ5d_VM.esm.js → idOcrStateMachine-DRZc4FBl.esm.js} +5 -5
- package/dist/{idVerificationStateMachine-kRxwImzO.esm.js → idVerificationStateMachine-oqiERKpg.esm.js} +3 -3
- package/dist/identity-reuse.d.ts +4 -3
- package/dist/identity-reuse.esm.js +7 -6
- package/dist/{identityReuseManager-C6n_97dw.esm.js → identityReuseManager-Bu62LToE.esm.js} +4 -3
- package/dist/{identityReuseManager-Cww-NDtd.d.ts → identityReuseManager-TWKbXuvY.d.ts} +33 -33
- package/dist/{identityReuseStateMachine-BfE5YiEr.esm.js → identityReuseStateMachine-BmONeF6B.esm.js} +3 -3
- package/dist/{index-B5hPA0Bg.d.ts → index-DtUlD-bz.d.ts} +2 -2
- package/dist/{index-B9NysVDB.d.ts → index-Icld-cKW.d.ts} +175 -295
- package/dist/index-XTtxaahe.d.ts +93 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.esm.js +16 -12
- package/dist/{invokeOnCaptureCallback-ygByVdnn.esm.js → invokeOnCaptureCallback-v_PV_IJz.esm.js} +1 -1
- package/dist/{lib-BY67lgbq.esm.js → lib-B050WTth.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +10 -7
- package/dist/mandatory-consent.esm.js +7 -6
- package/dist/{mandatoryConsentManager-Dq6WiOZh.d.ts → mandatoryConsentManager-Bmdjo14S.d.ts} +50 -50
- package/dist/{mandatoryConsentManager-H6D18cZB.esm.js → mandatoryConsentManager-CQ3jirlZ.esm.js} +4 -3
- package/dist/{mandatoryConsentStateMachine-DtQNW1ji.esm.js → mandatoryConsentStateMachine-DkJJLHqC.esm.js} +3 -3
- package/dist/mediaRecorderOptions-C3NAkVgK.esm.js +42 -0
- package/dist/mediapipeShared-CRAKVElv.esm.js +67 -0
- package/dist/{recordingService-yRw7hfzU.esm.js → onDeviceFaceResults-DVBggeq8.esm.js} +71 -389
- package/dist/{openviduLazy-Dh14JNJc.esm.js → openviduLazy-BTOIauGP.esm.js} +2 -2
- package/dist/openviduLazy-Dov8oKfL.esm.js +3 -0
- package/dist/{permissionGuards-D0wGddy7.esm.js → permissionGuards-BR2oN573.esm.js} +1 -1
- package/dist/{permissionServices-Doec4X5L.esm.js → permissionServices-BJhGL13R.esm.js} +7 -4
- package/dist/personhood.d.ts +534 -0
- package/dist/personhood.esm.js +1494 -0
- package/dist/phone.d.ts +5 -4
- package/dist/phone.esm.js +9 -8
- package/dist/{phoneManager-fPmIBYQK.d.ts → phoneManager-BOTcjXgs.d.ts} +4 -3
- package/dist/{phoneManager-BmF-0Ez4.esm.js → phoneManager-BWlxqbyD.esm.js} +48 -6
- package/dist/{phoneStateMachine-BiV0yoEx.esm.js → phoneStateMachine-B_V9nODs.esm.js} +5 -5
- package/dist/{qe-signature-CUYPcHVo.esm.js → qe-signature-BhFnI9pT.esm.js} +1 -1
- package/dist/qe-signature.d.ts +4 -3
- package/dist/qe-signature.esm.js +10 -7
- package/dist/recordingService-m_1xCthr.esm.js +347 -0
- package/dist/redirect-to-mobile.d.ts +4 -3
- package/dist/redirect-to-mobile.esm.js +9 -7
- package/dist/{redirectToMobileManager-Dy3t7o0C.esm.js → redirectToMobileManager-BaAo9rgi.esm.js} +5 -4
- package/dist/{redirectToMobileManager-BNe3IzC_.d.ts → redirectToMobileManager-Br0KZK1G.d.ts} +2 -2
- package/dist/{redirectToMobileStateMachine-DyAdRxfP.esm.js → redirectToMobileStateMachine-DoAnf2ql.esm.js} +16 -28
- package/dist/{runChildModule-CuoHZ1cx.esm.js → runChildModule-0nQfjVVo.esm.js} +14 -24
- package/dist/selfie.d.ts +27 -14
- package/dist/selfie.esm.js +43 -30
- package/dist/{selfieManager-BNuTIGAz.esm.js → selfieManager-D_ZFERsE.esm.js} +17 -8
- package/dist/{selfieManager-C2y_t6DG.d.ts → selfieManager-R0Jw5sjb.d.ts} +13 -3
- package/dist/{selfieStateMachine-Bv99bZJE.esm.js → selfieStateMachine-CIgeeiN9.esm.js} +4 -4
- package/dist/{session-DoVb-OcB.esm.js → session-9jIfKFCc.esm.js} +3 -3
- package/dist/session.d.ts +11 -8
- package/dist/session.esm.js +16 -12
- package/dist/{sessionInitializer-DRB-hgbV.esm.js → sessionInitializer-C_TYIgyk.esm.js} +16 -109
- package/dist/{setup-BwCluiw3.d.ts → setup-CpRnXxn8.d.ts} +61 -2
- package/dist/setup-DHc6OaHm.esm.js +562 -0
- package/dist/signature.d.ts +4 -2
- package/dist/signature.esm.js +49 -6
- package/dist/{signatureStateMachine-C5qqYLRz.esm.js → signatureStateMachine-DtoiPzys.esm.js} +21 -39
- package/dist/{stats-BMNUG1AU.esm.js → stats-CYcScXcO.esm.js} +2 -2
- package/dist/stats.esm.js +3 -3
- package/dist/thumbmarkAdapter-fHBUDlAP.esm.js +1194 -0
- package/dist/tri-BG1iJsr4.esm.js +399 -0
- package/dist/tri.d.ts +2 -0
- package/dist/tri.esm-DUC01NgO.esm.js +2593 -0
- package/dist/tri.esm.js +4 -0
- package/dist/trust-graph.d.ts +4 -3
- package/dist/trust-graph.esm.js +4 -3
- package/dist/{types-NuT8ftBV.d.ts → types-BklZ_Wne.d.ts} +2 -1
- package/dist/{types-DOUhndhT.d.ts → types-BsYXnC5s.d.ts} +39 -3
- package/dist/{types-DsnEVMhr.esm.js → types-CMcxlSmH.esm.js} +2 -1
- package/dist/types-CxW2e0Ar.d.ts +132 -0
- package/dist/{types-Bj9hdFjU.d.ts → types-DgGlgyZT.d.ts} +1 -1
- package/dist/types-ElOJAGaM.esm.js +189 -0
- package/dist/urlUtils-BZqFU9rR.esm.js +16 -0
- package/dist/video-C2WIj6TS.esm.js +36 -0
- package/dist/video-selfie.d.ts +351 -0
- package/dist/video-selfie.esm.js +1509 -0
- package/dist/videoSelfieSteps-7M5vxKn-.esm.js +58 -0
- package/dist/{warmup-Dg8Lh-50.d.ts → warmup-BJZPQIiX.d.ts} +5 -1
- package/dist/wasm.d.ts +4 -3
- package/dist/wasm.esm.js +17 -13
- package/dist/watchlist-for-business.d.ts +2 -1
- package/dist/watchlist-for-business.esm.js +30 -7
- package/dist/watchlist.d.ts +2 -1
- package/dist/watchlist.esm.js +28 -6
- package/dist/{watchlistForBusinessStateMachine-DMl8j2Ov.esm.js → watchlistForBusinessStateMachine-DvEunDxs.esm.js} +3 -3
- package/dist/{watchlistStateMachine-DmQlqI6L.esm.js → watchlistStateMachine-AHXVf-TB.esm.js} +3 -3
- package/dist/workflow.d.ts +296 -103
- package/dist/workflow.esm.js +137 -74
- package/dist/{xstate.esm-C9wncMQa.esm.js → xstate.esm-Bomq1a0z.esm.js} +54 -5
- package/package.json +26 -1
- package/dist/IpifyProvider-D4LWD15E.esm.js +0 -167
- package/dist/antifraudManager-CkV4u-LE.esm.js +0 -55
- package/dist/camera-DJWm3V4g.esm.js +0 -22
- package/dist/deepsightService-Dh5P-hLf.d.ts +0 -265
- package/dist/faceCaptureManagerFactory-CjdBUS6s.d.ts +0 -721
- package/dist/flowCompletionService-BdR2cGgB.d.ts +0 -19
- package/dist/flowCompletionService-DdGojV9K.esm.js +0 -20
- package/dist/getBrowser-C8DP7oTB.esm.js +0 -8
- package/dist/openviduLazy-B8L--0oe.esm.js +0 -3
- package/dist/setup-CUO4mErT.esm.js +0 -1037
- /package/dist/{Actor-Y0_Fj-KL.d.ts → Actor-CGEelYtQ.d.ts} +0 -0
- /package/dist/{BrowserTimerProvider-DhNc_x02.esm.js → BrowserTimerProvider-CHloo0eQ.esm.js} +0 -0
- /package/dist/{ITimerCapability-CB0I1Uf2.esm.js → ITimerCapability-pltuG1E8.esm.js} +0 -0
- /package/dist/{Manager-BHn8wH8K.d.ts → Manager-CJ3G2zqi.d.ts} +0 -0
- /package/dist/{MotionSensorProvider-Bx7Mpzt0.esm.js → MotionSensorProvider-DCbId4De.esm.js} +0 -0
- /package/dist/{StateMachine-BC_nGvrc.d.ts → StateMachine-C_AY4cs7.d.ts} +0 -0
- /package/dist/{apiError-B-j-gyDx.esm.js → apiError-DNS2OCEX.esm.js} +0 -0
- /package/dist/{camera-SRBpPq2X.d.ts → camera-CNVUo-bC.d.ts} +0 -0
- /package/dist/{canvas-SKcRBxsk.esm.js → canvas-_I95hkPg.esm.js} +0 -0
- /package/dist/{chunk-CMUKZ2uL.esm.js → chunk-CIKcdghV.esm.js} +0 -0
- /package/dist/{cpf-BRzggV8G.esm.js → cpf-BKaho0j_.esm.js} +0 -0
- /package/dist/{dateUtils-AksLQmgV.esm.js → dateUtils-7-tQYRNN.esm.js} +0 -0
- /package/dist/{getDeviceClass-C0olyNFS.esm.js → getDeviceClass-DavNdcxh.esm.js} +0 -0
- /package/dist/{http-Cai3IoLS.esm.js → http-BkiUT7EB.esm.js} +0 -0
- /package/dist/{otp-CGMdUzBC.esm.js → otp-Bfnzf7I3.esm.js} +0 -0
- /package/dist/{otp-DF5A0sFx.d.ts → otp-M4iy57XY.d.ts} +0 -0
- /package/dist/{platform-SKvEfCBh.esm.js → platform-uIVQUnJP.esm.js} +0 -0
- /package/dist/{types-DvGZI7BF.d.ts → types-D_IceWxT.d.ts} +0 -0
- /package/dist/{types-ya0LN_MX.d.ts → types-Duy2rDxF.d.ts} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
//#region ../infra/src/media/camera.ts
|
|
2
|
+
/**
|
|
3
|
+
* Default resolution fallback order for camera access.
|
|
4
|
+
* Tries each resolution in order until one succeeds.
|
|
5
|
+
* Matches legacy behavior from Webcam.tsx
|
|
6
|
+
*/
|
|
7
|
+
const DEFAULT_RESOLUTION_FALLBACKS = [
|
|
8
|
+
{ height: 720 },
|
|
9
|
+
{
|
|
10
|
+
width: 3840,
|
|
11
|
+
height: 2160
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
width: 1920,
|
|
15
|
+
height: 1080
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
width: 640,
|
|
19
|
+
height: 480
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
width: 800,
|
|
23
|
+
height: 480
|
|
24
|
+
},
|
|
25
|
+
{}
|
|
26
|
+
];
|
|
27
|
+
/**
|
|
28
|
+
* Request camera access with specific constraints.
|
|
29
|
+
* Throws if the request fails - no automatic fallback.
|
|
30
|
+
*/
|
|
31
|
+
async function requestCameraAccess(constraints) {
|
|
32
|
+
if (typeof navigator === "undefined" || !navigator.mediaDevices) throw new Error("MediaDevices API not available");
|
|
33
|
+
return navigator.mediaDevices.getUserMedia(constraints);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Request camera access with automatic resolution fallback.
|
|
37
|
+
* Tries progressively different resolutions if the initial request fails.
|
|
38
|
+
*
|
|
39
|
+
* @param baseConstraints - Base constraints (facingMode, audio, etc.)
|
|
40
|
+
* @param fallbacks - Optional custom fallback order (defaults to 720p -> 1080p -> 480p -> auto)
|
|
41
|
+
* @returns MediaStream from the camera
|
|
42
|
+
* @throws Error if all fallbacks fail or MediaDevices API not available
|
|
43
|
+
*/
|
|
44
|
+
async function requestCameraWithFallback(baseConstraints, fallbacks = DEFAULT_RESOLUTION_FALLBACKS) {
|
|
45
|
+
if (typeof navigator === "undefined" || !navigator.mediaDevices) throw new Error("MediaDevices API not available");
|
|
46
|
+
const baseVideo = baseConstraints.video;
|
|
47
|
+
for (let i = 0; i < fallbacks.length; i++) {
|
|
48
|
+
const resolution = fallbacks[i];
|
|
49
|
+
const videoConstraints = { ...baseVideo };
|
|
50
|
+
if (resolution.width) videoConstraints.width = { ideal: resolution.width };
|
|
51
|
+
if (resolution.height) videoConstraints.height = { ideal: resolution.height };
|
|
52
|
+
if (!resolution.width && !resolution.height) {
|
|
53
|
+
delete videoConstraints.width;
|
|
54
|
+
delete videoConstraints.height;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
return await navigator.mediaDevices.getUserMedia({
|
|
58
|
+
...baseConstraints,
|
|
59
|
+
video: videoConstraints
|
|
60
|
+
});
|
|
61
|
+
} catch (error) {
|
|
62
|
+
if (i === fallbacks.length - 1) throw error;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
throw new Error("All camera resolution fallbacks failed");
|
|
66
|
+
}
|
|
67
|
+
function stopCameraStream(stream) {
|
|
68
|
+
for (const track of stream.getTracks()) track.stop();
|
|
69
|
+
}
|
|
70
|
+
async function enumerateVideoDevices() {
|
|
71
|
+
if (typeof navigator === "undefined" || !navigator.mediaDevices) return [];
|
|
72
|
+
return (await navigator.mediaDevices.enumerateDevices()).filter((d) => d.kind === "videoinput");
|
|
73
|
+
}
|
|
74
|
+
async function applyTrackConstraints(track, constraints) {
|
|
75
|
+
await track.applyConstraints(constraints);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
export { stopCameraStream as a, requestCameraWithFallback as i, enumerateVideoDevices as n, requestCameraAccess as r, applyTrackConstraints as t };
|
package/dist/camera.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { n as PermissionStatus, t as PermissionResult } from "./types-
|
|
1
|
+
import { n as PermissionStatus, t as PermissionResult } from "./types-Duy2rDxF.js";
|
|
2
2
|
|
|
3
3
|
//#region src/internal/permissions/permissionServices.d.ts
|
|
4
4
|
type RequestPermissionOptions = {
|
|
5
5
|
requestMotion?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Also request microphone access in the same `getUserMedia` call. Used by
|
|
8
|
+
* Video Selfie, which records audio alongside video. Defaults to `false` so
|
|
9
|
+
* camera-only flows (selfie, ID) keep requesting `{ video: true }` exactly.
|
|
10
|
+
*/
|
|
11
|
+
requestAudio?: boolean;
|
|
6
12
|
};
|
|
7
13
|
declare function checkPermission(): Promise<PermissionResult>;
|
|
8
14
|
/**
|
package/dist/camera.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./WasmUtilProvider-
|
|
2
|
-
import "./MotionSensorProvider-
|
|
3
|
-
import { i as requestPermission, t as checkPermission } from "./permissionServices-
|
|
4
|
-
import "./camera-
|
|
1
|
+
import "./WasmUtilProvider-ADG54T6M.esm.js";
|
|
2
|
+
import "./MotionSensorProvider-DCbId4De.esm.js";
|
|
3
|
+
import { i as requestPermission, t as checkPermission } from "./permissionServices-BJhGL13R.esm.js";
|
|
4
|
+
import "./camera-DUkgmYMo.esm.js";
|
|
5
5
|
|
|
6
6
|
export { checkPermission as checkCameraPermission, requestPermission as requestCameraPermission };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { t as CameraStream } from "./camera-SRBpPq2X.js";
|
|
2
|
-
|
|
3
1
|
//#region ../infra/src/media/canvas.d.ts
|
|
4
2
|
/**
|
|
5
3
|
* Class representing a canvas element for image capture and manipulation.
|
|
@@ -111,42 +109,4 @@ declare class IncodeCanvas {
|
|
|
111
109
|
getResizedCanvas(videoElementWidth: number, videoElementHeight: number): IncodeCanvas | null;
|
|
112
110
|
}
|
|
113
111
|
//#endregion
|
|
114
|
-
|
|
115
|
-
type StreamCanvasCaptureOptions = {
|
|
116
|
-
fps?: number;
|
|
117
|
-
width?: number;
|
|
118
|
-
height?: number;
|
|
119
|
-
};
|
|
120
|
-
type StreamCanvasCaptureEventMap = {
|
|
121
|
-
frame: Event;
|
|
122
|
-
};
|
|
123
|
-
declare class StreamCanvasCapture {
|
|
124
|
-
private video;
|
|
125
|
-
private canvas;
|
|
126
|
-
private ctx;
|
|
127
|
-
private rafId;
|
|
128
|
-
private lastFrameTimeSeconds;
|
|
129
|
-
private lastTickTimeMs;
|
|
130
|
-
private hasFrame;
|
|
131
|
-
private disposed;
|
|
132
|
-
private eventTarget;
|
|
133
|
-
constructor(stream: CameraStream, options?: StreamCanvasCaptureOptions);
|
|
134
|
-
addEventListener(type: keyof StreamCanvasCaptureEventMap, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
|
|
135
|
-
removeEventListener(type: keyof StreamCanvasCaptureEventMap, listener: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void;
|
|
136
|
-
/**
|
|
137
|
-
* Returns the latest cached frame as an {@link IncodeCanvas}.
|
|
138
|
-
*/
|
|
139
|
-
getLatestCanvas(): IncodeCanvas | null;
|
|
140
|
-
/**
|
|
141
|
-
* Returns the latest cached frame as raw {@link ImageData}.
|
|
142
|
-
*/
|
|
143
|
-
getLatestFrame(): ImageData | null;
|
|
144
|
-
/**
|
|
145
|
-
* Disposes internal resources and stops the capture loop.
|
|
146
|
-
*/
|
|
147
|
-
dispose(): void;
|
|
148
|
-
private rafLoop;
|
|
149
|
-
private tick;
|
|
150
|
-
}
|
|
151
|
-
//#endregion
|
|
152
|
-
export { IncodeCanvas as n, StreamCanvasCapture as t };
|
|
112
|
+
export { IncodeCanvas as t };
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import "./StateMachine-C_AY4cs7.js";
|
|
2
|
+
import { t as Manager } from "./Manager-CJ3G2zqi.js";
|
|
3
|
+
import "./Actor-CGEelYtQ.js";
|
|
4
|
+
import * as xstate1374 from "xstate";
|
|
5
|
+
|
|
6
|
+
//#region src/modules/certificate-issuance/certificateIssuanceConstants.d.ts
|
|
7
|
+
declare const MIN_PASSWORD_LENGTH = 8;
|
|
8
|
+
declare const PASSWORD_VALIDATION_KEYS: readonly ["length", "uppercase", "lowercase", "number"];
|
|
9
|
+
declare const REQUIREMENT_I18N_KEYS: Record<PasswordValidationKey, string>;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/modules/certificate-issuance/types.d.ts
|
|
12
|
+
type CertificateIssuanceType = 'ONE_TIME' | 'SHORT_TERM' | 'LONG_TERM';
|
|
13
|
+
/**
|
|
14
|
+
* Configuration for the certificate issuance module.
|
|
15
|
+
*/
|
|
16
|
+
type CertificateIssuanceConfig = {
|
|
17
|
+
/** Issuance region (from flow `moduleConfiguration`) */
|
|
18
|
+
region: string;
|
|
19
|
+
/** Certificate validity period */
|
|
20
|
+
type: CertificateIssuanceType;
|
|
21
|
+
};
|
|
22
|
+
type IssueCertificateResponse = {
|
|
23
|
+
blob: Blob;
|
|
24
|
+
};
|
|
25
|
+
type PasswordValidations = {
|
|
26
|
+
length: boolean;
|
|
27
|
+
uppercase: boolean;
|
|
28
|
+
lowercase: boolean;
|
|
29
|
+
number: boolean;
|
|
30
|
+
};
|
|
31
|
+
type PasswordValidationKey = (typeof PASSWORD_VALIDATION_KEYS)[number];
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/modules/certificate-issuance/certificateIssuanceStateMachine.d.ts
|
|
34
|
+
type CertificateIssuanceContext = {
|
|
35
|
+
config: CertificateIssuanceConfig;
|
|
36
|
+
password: string;
|
|
37
|
+
passwordValidations: PasswordValidations;
|
|
38
|
+
certificateBlob: Blob | undefined;
|
|
39
|
+
};
|
|
40
|
+
type CertificateIssuanceInput = {
|
|
41
|
+
config: CertificateIssuanceConfig;
|
|
42
|
+
};
|
|
43
|
+
declare const certificateIssuanceMachine: xstate1374.StateMachine<CertificateIssuanceContext, {
|
|
44
|
+
type: "LOAD";
|
|
45
|
+
} | {
|
|
46
|
+
type: "PASSWORD_CHANGED";
|
|
47
|
+
password: string;
|
|
48
|
+
} | {
|
|
49
|
+
type: "SUBMIT_PASSWORD";
|
|
50
|
+
} | {
|
|
51
|
+
type: "DOWNLOADED";
|
|
52
|
+
} | {
|
|
53
|
+
type: "DOWNLOAD_FAILED";
|
|
54
|
+
} | {
|
|
55
|
+
type: "FINISH";
|
|
56
|
+
}, {
|
|
57
|
+
[x: string]: xstate1374.ActorRefFromLogic<xstate1374.PromiseActorLogic<IssueCertificateResponse, {
|
|
58
|
+
password: string;
|
|
59
|
+
}, xstate1374.EventObject>> | undefined;
|
|
60
|
+
}, {
|
|
61
|
+
src: "issueCertificate";
|
|
62
|
+
logic: xstate1374.PromiseActorLogic<IssueCertificateResponse, {
|
|
63
|
+
password: string;
|
|
64
|
+
}, xstate1374.EventObject>;
|
|
65
|
+
id: string | undefined;
|
|
66
|
+
}, xstate1374.Values<{
|
|
67
|
+
setPassword: {
|
|
68
|
+
type: "setPassword";
|
|
69
|
+
params: xstate1374.NonReducibleUnknown;
|
|
70
|
+
};
|
|
71
|
+
setBlob: {
|
|
72
|
+
type: "setBlob";
|
|
73
|
+
params: xstate1374.NonReducibleUnknown;
|
|
74
|
+
};
|
|
75
|
+
}>, {
|
|
76
|
+
type: "isPasswordValid";
|
|
77
|
+
params: unknown;
|
|
78
|
+
}, never, "error" | "idle" | "processing" | "success" | "finished" | "password" | "downloaded", string, CertificateIssuanceInput, xstate1374.NonReducibleUnknown, xstate1374.EventObject, xstate1374.MetaObject, {
|
|
79
|
+
readonly id: "certificateIssuance";
|
|
80
|
+
readonly initial: "idle";
|
|
81
|
+
readonly context: ({
|
|
82
|
+
input
|
|
83
|
+
}: {
|
|
84
|
+
spawn: {
|
|
85
|
+
<TSrc extends "issueCertificate">(logic: TSrc, ...[options]: {
|
|
86
|
+
src: "issueCertificate";
|
|
87
|
+
logic: xstate1374.PromiseActorLogic<IssueCertificateResponse, {
|
|
88
|
+
password: string;
|
|
89
|
+
}, xstate1374.EventObject>;
|
|
90
|
+
id: string | undefined;
|
|
91
|
+
} extends infer T ? T extends {
|
|
92
|
+
src: "issueCertificate";
|
|
93
|
+
logic: xstate1374.PromiseActorLogic<IssueCertificateResponse, {
|
|
94
|
+
password: string;
|
|
95
|
+
}, xstate1374.EventObject>;
|
|
96
|
+
id: string | undefined;
|
|
97
|
+
} ? T extends {
|
|
98
|
+
src: TSrc;
|
|
99
|
+
} ? xstate1374.ConditionalRequired<[options?: ({
|
|
100
|
+
id?: T["id"] | undefined;
|
|
101
|
+
systemId?: string;
|
|
102
|
+
input?: xstate1374.InputFrom<T["logic"]> | undefined;
|
|
103
|
+
syncSnapshot?: boolean;
|
|
104
|
+
} & { [K in xstate1374.RequiredActorOptions<T>]: unknown }) | undefined], xstate1374.IsNotNever<xstate1374.RequiredActorOptions<T>>> : never : never : never): xstate1374.ActorRefFromLogic<xstate1374.GetConcreteByKey<{
|
|
105
|
+
src: "issueCertificate";
|
|
106
|
+
logic: xstate1374.PromiseActorLogic<IssueCertificateResponse, {
|
|
107
|
+
password: string;
|
|
108
|
+
}, xstate1374.EventObject>;
|
|
109
|
+
id: string | undefined;
|
|
110
|
+
}, "src", TSrc>["logic"]>;
|
|
111
|
+
<TLogic extends xstate1374.AnyActorLogic>(src: TLogic, ...[options]: xstate1374.ConditionalRequired<[options?: ({
|
|
112
|
+
id?: never;
|
|
113
|
+
systemId?: string;
|
|
114
|
+
input?: xstate1374.InputFrom<TLogic> | undefined;
|
|
115
|
+
syncSnapshot?: boolean;
|
|
116
|
+
} & { [K in xstate1374.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate1374.IsNotNever<xstate1374.RequiredLogicInput<TLogic>>>): xstate1374.ActorRefFromLogic<TLogic>;
|
|
117
|
+
};
|
|
118
|
+
input: CertificateIssuanceInput;
|
|
119
|
+
self: xstate1374.ActorRef<xstate1374.MachineSnapshot<CertificateIssuanceContext, {
|
|
120
|
+
type: "LOAD";
|
|
121
|
+
} | {
|
|
122
|
+
type: "PASSWORD_CHANGED";
|
|
123
|
+
password: string;
|
|
124
|
+
} | {
|
|
125
|
+
type: "SUBMIT_PASSWORD";
|
|
126
|
+
} | {
|
|
127
|
+
type: "DOWNLOADED";
|
|
128
|
+
} | {
|
|
129
|
+
type: "DOWNLOAD_FAILED";
|
|
130
|
+
} | {
|
|
131
|
+
type: "FINISH";
|
|
132
|
+
}, Record<string, xstate1374.AnyActorRef | undefined>, xstate1374.StateValue, string, unknown, any, any>, {
|
|
133
|
+
type: "LOAD";
|
|
134
|
+
} | {
|
|
135
|
+
type: "PASSWORD_CHANGED";
|
|
136
|
+
password: string;
|
|
137
|
+
} | {
|
|
138
|
+
type: "SUBMIT_PASSWORD";
|
|
139
|
+
} | {
|
|
140
|
+
type: "DOWNLOADED";
|
|
141
|
+
} | {
|
|
142
|
+
type: "DOWNLOAD_FAILED";
|
|
143
|
+
} | {
|
|
144
|
+
type: "FINISH";
|
|
145
|
+
}, xstate1374.AnyEventObject>;
|
|
146
|
+
}) => {
|
|
147
|
+
config: CertificateIssuanceConfig;
|
|
148
|
+
password: string;
|
|
149
|
+
passwordValidations: PasswordValidations;
|
|
150
|
+
certificateBlob: undefined;
|
|
151
|
+
};
|
|
152
|
+
readonly states: {
|
|
153
|
+
readonly idle: {
|
|
154
|
+
readonly on: {
|
|
155
|
+
readonly LOAD: {
|
|
156
|
+
readonly target: "password";
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
readonly password: {
|
|
161
|
+
readonly on: {
|
|
162
|
+
readonly PASSWORD_CHANGED: {
|
|
163
|
+
readonly actions: "setPassword";
|
|
164
|
+
};
|
|
165
|
+
readonly SUBMIT_PASSWORD: {
|
|
166
|
+
readonly target: "processing";
|
|
167
|
+
readonly guard: "isPasswordValid";
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
readonly processing: {
|
|
172
|
+
readonly invoke: {
|
|
173
|
+
readonly id: "issueCertificate";
|
|
174
|
+
readonly src: "issueCertificate";
|
|
175
|
+
readonly input: ({
|
|
176
|
+
context
|
|
177
|
+
}: {
|
|
178
|
+
context: CertificateIssuanceContext;
|
|
179
|
+
event: {
|
|
180
|
+
type: "LOAD";
|
|
181
|
+
} | {
|
|
182
|
+
type: "PASSWORD_CHANGED";
|
|
183
|
+
password: string;
|
|
184
|
+
} | {
|
|
185
|
+
type: "SUBMIT_PASSWORD";
|
|
186
|
+
} | {
|
|
187
|
+
type: "DOWNLOADED";
|
|
188
|
+
} | {
|
|
189
|
+
type: "DOWNLOAD_FAILED";
|
|
190
|
+
} | {
|
|
191
|
+
type: "FINISH";
|
|
192
|
+
};
|
|
193
|
+
self: xstate1374.ActorRef<xstate1374.MachineSnapshot<CertificateIssuanceContext, {
|
|
194
|
+
type: "LOAD";
|
|
195
|
+
} | {
|
|
196
|
+
type: "PASSWORD_CHANGED";
|
|
197
|
+
password: string;
|
|
198
|
+
} | {
|
|
199
|
+
type: "SUBMIT_PASSWORD";
|
|
200
|
+
} | {
|
|
201
|
+
type: "DOWNLOADED";
|
|
202
|
+
} | {
|
|
203
|
+
type: "DOWNLOAD_FAILED";
|
|
204
|
+
} | {
|
|
205
|
+
type: "FINISH";
|
|
206
|
+
}, Record<string, xstate1374.AnyActorRef>, xstate1374.StateValue, string, unknown, any, any>, {
|
|
207
|
+
type: "LOAD";
|
|
208
|
+
} | {
|
|
209
|
+
type: "PASSWORD_CHANGED";
|
|
210
|
+
password: string;
|
|
211
|
+
} | {
|
|
212
|
+
type: "SUBMIT_PASSWORD";
|
|
213
|
+
} | {
|
|
214
|
+
type: "DOWNLOADED";
|
|
215
|
+
} | {
|
|
216
|
+
type: "DOWNLOAD_FAILED";
|
|
217
|
+
} | {
|
|
218
|
+
type: "FINISH";
|
|
219
|
+
}, xstate1374.AnyEventObject>;
|
|
220
|
+
}) => {
|
|
221
|
+
password: string;
|
|
222
|
+
};
|
|
223
|
+
readonly onDone: {
|
|
224
|
+
readonly target: "success";
|
|
225
|
+
readonly actions: "setBlob";
|
|
226
|
+
};
|
|
227
|
+
readonly onError: {
|
|
228
|
+
readonly target: "error";
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
readonly success: {
|
|
233
|
+
readonly on: {
|
|
234
|
+
readonly DOWNLOADED: {
|
|
235
|
+
readonly target: "downloaded";
|
|
236
|
+
};
|
|
237
|
+
readonly DOWNLOAD_FAILED: {
|
|
238
|
+
readonly target: "error";
|
|
239
|
+
};
|
|
240
|
+
readonly FINISH: {
|
|
241
|
+
readonly target: "finished";
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
readonly downloaded: {
|
|
246
|
+
readonly on: {
|
|
247
|
+
readonly FINISH: {
|
|
248
|
+
readonly target: "finished";
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
readonly error: {
|
|
253
|
+
readonly after: {
|
|
254
|
+
readonly 3000: {
|
|
255
|
+
readonly target: "finished";
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
readonly finished: {
|
|
260
|
+
readonly type: "final";
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
}>;
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region src/modules/certificate-issuance/certificateIssuanceActor.d.ts
|
|
266
|
+
type CreateCertificateIssuanceActorOptions = {
|
|
267
|
+
config: CertificateIssuanceConfig;
|
|
268
|
+
};
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region src/modules/certificate-issuance/certificateIssuanceManager.d.ts
|
|
271
|
+
type CertificateIssuanceIdleState = {
|
|
272
|
+
status: 'idle';
|
|
273
|
+
};
|
|
274
|
+
type CertificateIssuancePasswordState = {
|
|
275
|
+
status: 'password';
|
|
276
|
+
password: string;
|
|
277
|
+
passwordValidations: PasswordValidations;
|
|
278
|
+
canSubmit: boolean;
|
|
279
|
+
};
|
|
280
|
+
type CertificateIssuanceProcessingState = {
|
|
281
|
+
status: 'processing';
|
|
282
|
+
};
|
|
283
|
+
type CertificateIssuanceErrorState = {
|
|
284
|
+
status: 'error';
|
|
285
|
+
};
|
|
286
|
+
type CertificateIssuanceSuccessState = {
|
|
287
|
+
status: 'success';
|
|
288
|
+
blob: Blob;
|
|
289
|
+
};
|
|
290
|
+
type CertificateIssuanceDownloadedState = {
|
|
291
|
+
status: 'downloaded';
|
|
292
|
+
};
|
|
293
|
+
type CertificateIssuanceFinishedState = {
|
|
294
|
+
status: 'finished';
|
|
295
|
+
};
|
|
296
|
+
type CertificateIssuanceState = CertificateIssuanceIdleState | CertificateIssuancePasswordState | CertificateIssuanceProcessingState | CertificateIssuanceSuccessState | CertificateIssuanceDownloadedState | CertificateIssuanceErrorState | CertificateIssuanceFinishedState;
|
|
297
|
+
declare function createCertificateIssuanceManager(options: CreateCertificateIssuanceActorOptions): Manager<CertificateIssuanceState> & {
|
|
298
|
+
load(): void;
|
|
299
|
+
setPassword(password: string): void;
|
|
300
|
+
submitPassword(): void;
|
|
301
|
+
markDownloaded(): void;
|
|
302
|
+
reportDownloadError(): void;
|
|
303
|
+
finish(): void;
|
|
304
|
+
};
|
|
305
|
+
type CertificateIssuanceManager = ReturnType<typeof createCertificateIssuanceManager>;
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region src/modules/certificate-issuance/certificateIssuanceUtils.d.ts
|
|
308
|
+
declare function emptyPasswordValidations(): PasswordValidations;
|
|
309
|
+
declare function validatePassword(value: string): PasswordValidations;
|
|
310
|
+
declare function isPasswordValid(validations: PasswordValidations): boolean;
|
|
311
|
+
//#endregion
|
|
312
|
+
export { type CertificateIssuanceConfig, type CertificateIssuanceManager, type CertificateIssuanceState, type CertificateIssuanceType, type IssueCertificateResponse, MIN_PASSWORD_LENGTH, PASSWORD_VALIDATION_KEYS, type PasswordValidationKey, type PasswordValidations, REQUIREMENT_I18N_KEYS, certificateIssuanceMachine, createCertificateIssuanceManager, emptyPasswordValidations, isPasswordValid, validatePassword };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import "./api-DsbUi7TO.esm.js";
|
|
2
|
+
import { n as createManagerInstrumentation } from "./events-CqGY1yMq.esm.js";
|
|
3
|
+
import { n as eventModuleNames } from "./types-ElOJAGaM.esm.js";
|
|
4
|
+
import "./endpoints-BzMJFAPV.esm.js";
|
|
5
|
+
import { l as createManager, s as createActor } from "./xstate.esm-Bomq1a0z.esm.js";
|
|
6
|
+
import "./urlUtils-BZqFU9rR.esm.js";
|
|
7
|
+
import "./externalFetch-CyhBfD-n.esm.js";
|
|
8
|
+
import { a as MIN_PASSWORD_LENGTH, i as validatePassword, n as emptyPasswordValidations, o as PASSWORD_VALIDATION_KEYS, r as isPasswordValid, s as REQUIREMENT_I18N_KEYS, t as certificateIssuanceMachine } from "./certificateIssuanceStateMachine-C07m7qtP.esm.js";
|
|
9
|
+
|
|
10
|
+
//#region src/modules/certificate-issuance/certificateIssuanceActor.ts
|
|
11
|
+
/**
|
|
12
|
+
* Creates and starts a certificate issuance actor.
|
|
13
|
+
*/
|
|
14
|
+
function createCertificateIssuanceActor(options) {
|
|
15
|
+
return createActor(certificateIssuanceMachine, { input: { config: options.config } }).start();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/modules/certificate-issuance/certificateIssuanceManager.ts
|
|
20
|
+
function mapState(snapshot) {
|
|
21
|
+
const typedSnapshot = snapshot;
|
|
22
|
+
const { context } = typedSnapshot;
|
|
23
|
+
if (typedSnapshot.matches("password")) return {
|
|
24
|
+
status: "password",
|
|
25
|
+
password: context.password,
|
|
26
|
+
passwordValidations: context.passwordValidations,
|
|
27
|
+
canSubmit: isPasswordValid(context.passwordValidations)
|
|
28
|
+
};
|
|
29
|
+
if (typedSnapshot.matches("processing")) return { status: "processing" };
|
|
30
|
+
if (typedSnapshot.matches("error")) return { status: "error" };
|
|
31
|
+
if (typedSnapshot.matches("success")) return {
|
|
32
|
+
status: "success",
|
|
33
|
+
blob: context.certificateBlob
|
|
34
|
+
};
|
|
35
|
+
if (typedSnapshot.matches("downloaded")) return { status: "downloaded" };
|
|
36
|
+
if (typedSnapshot.matches("finished")) return { status: "finished" };
|
|
37
|
+
return { status: "idle" };
|
|
38
|
+
}
|
|
39
|
+
function createApi({ actor }) {
|
|
40
|
+
return {
|
|
41
|
+
load() {
|
|
42
|
+
actor.send({ type: "LOAD" });
|
|
43
|
+
},
|
|
44
|
+
setPassword(password) {
|
|
45
|
+
actor.send({
|
|
46
|
+
type: "PASSWORD_CHANGED",
|
|
47
|
+
password
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
submitPassword() {
|
|
51
|
+
actor.send({ type: "SUBMIT_PASSWORD" });
|
|
52
|
+
},
|
|
53
|
+
markDownloaded() {
|
|
54
|
+
actor.send({ type: "DOWNLOADED" });
|
|
55
|
+
},
|
|
56
|
+
reportDownloadError() {
|
|
57
|
+
actor.send({ type: "DOWNLOAD_FAILED" });
|
|
58
|
+
},
|
|
59
|
+
finish() {
|
|
60
|
+
actor.send({ type: "FINISH" });
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function createCertificateIssuanceManager(options) {
|
|
65
|
+
return createManager({
|
|
66
|
+
actor: createCertificateIssuanceActor(options),
|
|
67
|
+
mapState,
|
|
68
|
+
createApi,
|
|
69
|
+
instrumentation: createManagerInstrumentation(eventModuleNames.certificateIssuance)
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
export { MIN_PASSWORD_LENGTH, PASSWORD_VALIDATION_KEYS, REQUIREMENT_I18N_KEYS, certificateIssuanceMachine, createCertificateIssuanceManager, emptyPasswordValidations, isPasswordValid, validatePassword };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { n as getApi, r as getToken } from "./api-DsbUi7TO.esm.js";
|
|
2
|
+
import { t as endpoints } from "./endpoints-BzMJFAPV.esm.js";
|
|
3
|
+
import { a as fromPromise, r as assign, t as setup } from "./xstate.esm-Bomq1a0z.esm.js";
|
|
4
|
+
import { t as externalFetch } from "./externalFetch-CyhBfD-n.esm.js";
|
|
5
|
+
|
|
6
|
+
//#region src/modules/certificate-issuance/certificateIssuanceServices.ts
|
|
7
|
+
function buildIssueCertificateUrl(baseURL) {
|
|
8
|
+
return `${baseURL.endsWith("/") ? baseURL.slice(0, -1) : baseURL}${endpoints.certificateIssuanceIssue}`;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Issues a digital certificate and returns it as a Blob.
|
|
12
|
+
*/
|
|
13
|
+
async function issueCertificate(params, signal) {
|
|
14
|
+
const { baseURL, headers: defaultHeaders } = getApi().defaults;
|
|
15
|
+
const token = getToken();
|
|
16
|
+
return { blob: await (await externalFetch({
|
|
17
|
+
method: "POST",
|
|
18
|
+
url: buildIssueCertificateUrl(baseURL),
|
|
19
|
+
headers: {
|
|
20
|
+
...defaultHeaders,
|
|
21
|
+
Accept: "application/octet-stream",
|
|
22
|
+
...token ? { "X-Incode-Hardware-Id": token } : {}
|
|
23
|
+
},
|
|
24
|
+
body: JSON.stringify({ password: params.password }),
|
|
25
|
+
signal
|
|
26
|
+
})).blob() };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/modules/certificate-issuance/certificateIssuanceConstants.ts
|
|
31
|
+
const MIN_PASSWORD_LENGTH = 8;
|
|
32
|
+
const PASSWORD_VALIDATION_KEYS = [
|
|
33
|
+
"length",
|
|
34
|
+
"uppercase",
|
|
35
|
+
"lowercase",
|
|
36
|
+
"number"
|
|
37
|
+
];
|
|
38
|
+
const REQUIREMENT_I18N_KEYS = {
|
|
39
|
+
length: "certificateIssuance.password.length",
|
|
40
|
+
uppercase: "certificateIssuance.password.uppercase",
|
|
41
|
+
lowercase: "certificateIssuance.password.lowercase",
|
|
42
|
+
number: "certificateIssuance.password.number"
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/modules/certificate-issuance/certificateIssuanceUtils.ts
|
|
47
|
+
function emptyPasswordValidations() {
|
|
48
|
+
return {
|
|
49
|
+
length: false,
|
|
50
|
+
uppercase: false,
|
|
51
|
+
lowercase: false,
|
|
52
|
+
number: false
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function validatePassword(value) {
|
|
56
|
+
return {
|
|
57
|
+
length: value.length >= MIN_PASSWORD_LENGTH,
|
|
58
|
+
uppercase: /[A-Z]/.test(value),
|
|
59
|
+
lowercase: /[a-z]/.test(value),
|
|
60
|
+
number: /[0-9]/.test(value)
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function isPasswordValid(validations) {
|
|
64
|
+
return PASSWORD_VALIDATION_KEYS.every((key) => validations[key]);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/modules/certificate-issuance/certificateIssuanceStateMachine.ts
|
|
69
|
+
const certificateIssuanceMachine = setup({
|
|
70
|
+
types: {
|
|
71
|
+
context: {},
|
|
72
|
+
events: {},
|
|
73
|
+
input: {}
|
|
74
|
+
},
|
|
75
|
+
actors: { issueCertificate: fromPromise(async ({ input, signal }) => issueCertificate({ password: input.password }, signal)) },
|
|
76
|
+
actions: {
|
|
77
|
+
setPassword: assign(({ event }) => {
|
|
78
|
+
const e = event;
|
|
79
|
+
return {
|
|
80
|
+
password: e.password,
|
|
81
|
+
passwordValidations: validatePassword(e.password)
|
|
82
|
+
};
|
|
83
|
+
}),
|
|
84
|
+
setBlob: assign(({ event }) => ({ certificateBlob: "output" in event ? event.output.blob : void 0 }))
|
|
85
|
+
},
|
|
86
|
+
guards: { isPasswordValid: ({ context }) => isPasswordValid(context.passwordValidations) }
|
|
87
|
+
}).createMachine({
|
|
88
|
+
id: "certificateIssuance",
|
|
89
|
+
initial: "idle",
|
|
90
|
+
context: ({ input }) => ({
|
|
91
|
+
config: input.config,
|
|
92
|
+
password: "",
|
|
93
|
+
passwordValidations: emptyPasswordValidations(),
|
|
94
|
+
certificateBlob: void 0
|
|
95
|
+
}),
|
|
96
|
+
states: {
|
|
97
|
+
idle: { on: { LOAD: { target: "password" } } },
|
|
98
|
+
password: { on: {
|
|
99
|
+
PASSWORD_CHANGED: { actions: "setPassword" },
|
|
100
|
+
SUBMIT_PASSWORD: {
|
|
101
|
+
target: "processing",
|
|
102
|
+
guard: "isPasswordValid"
|
|
103
|
+
}
|
|
104
|
+
} },
|
|
105
|
+
processing: { invoke: {
|
|
106
|
+
id: "issueCertificate",
|
|
107
|
+
src: "issueCertificate",
|
|
108
|
+
input: ({ context }) => ({ password: context.password }),
|
|
109
|
+
onDone: {
|
|
110
|
+
target: "success",
|
|
111
|
+
actions: "setBlob"
|
|
112
|
+
},
|
|
113
|
+
onError: { target: "error" }
|
|
114
|
+
} },
|
|
115
|
+
success: { on: {
|
|
116
|
+
DOWNLOADED: { target: "downloaded" },
|
|
117
|
+
DOWNLOAD_FAILED: { target: "error" },
|
|
118
|
+
FINISH: { target: "finished" }
|
|
119
|
+
} },
|
|
120
|
+
downloaded: { on: { FINISH: { target: "finished" } } },
|
|
121
|
+
error: { after: { 3e3: { target: "finished" } } },
|
|
122
|
+
finished: { type: "final" }
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
//#endregion
|
|
127
|
+
export { MIN_PASSWORD_LENGTH as a, validatePassword as i, emptyPasswordValidations as n, PASSWORD_VALIDATION_KEYS as o, isPasswordValid as r, REQUIREMENT_I18N_KEYS as s, certificateIssuanceMachine as t };
|