@incodetech/core 2.4.0 → 2.4.1-agentic.1
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/BrowserNetworkStatusProvider-BrDXBEDd.esm.js +21 -0
- package/dist/{multipartRecordingService-CLwrF5wD.esm.js → CameraCompositor-DN7NkJzV.esm.js} +7 -744
- package/dist/{FaceDetectionProvider-DcPOC2gS.esm.js → FaceDetectionProvider-CAY43vSI.esm.js} +28 -64
- package/dist/IBrowserEnvironmentCapability-D7JG7ML3.esm.js +16 -0
- package/dist/IGeolocationCapability-r49Qo7rR.d.ts +10 -0
- package/dist/{IWasmUtilCapability-GF2n7sfm.d.ts → IWasmUtilCapability-Cqiaxydi.d.ts} +31 -4
- package/dist/MultipartRecordingProvider-D9mauUdS.esm.js +146 -0
- package/dist/{PhoneValidationProvider-SZiOS0jB.esm.js → PhoneValidationProvider-Co4zk2en.esm.js} +7 -0
- package/dist/{StreamCanvasCapture-7JRf-2ck.d.ts → StreamCanvasCapture-C3xNfOsv.d.ts} +12 -3
- package/dist/StreamCanvasProcessingSession-CBnbTnOr.esm.js +42 -0
- package/dist/{WasmUtilProvider-DtJuBdt-.esm.js → WasmUtilProvider-Dp2V-Uct.esm.js} +75 -22
- package/dist/WorkerEncoderRecordingProvider-B1ODYtgN.esm.js +80 -0
- package/dist/addressSearch-DzbE9Ogt.esm.js +254 -0
- package/dist/{advanceableErrors-q_pfU3Cn.esm.js → advanceableErrors-k-U-cL5m.esm.js} +1 -2
- package/dist/ae-signature.esm.js +1 -1
- package/dist/antifraud.esm.js +2 -2
- package/dist/{antifraudManager-CaweCYnY.esm.js → antifraudManager-BObuHBjn.esm.js} +2 -2
- package/dist/{antifraudStateMachine-DRl0UVyA.esm.js → antifraudStateMachine-Dfrd2-26.esm.js} +1 -1
- package/dist/{api-Cz90EHyu.esm.js → api-CpP4PS4S.esm.js} +8 -5
- package/dist/{apiError-DPwFas2f.esm.js → apiError-DH-CH4Nz.esm.js} +1 -1
- package/dist/attemptCarry-WOkfvFMw.esm.js +45 -0
- package/dist/authentication.d.ts +3 -3
- package/dist/authentication.esm.js +2 -2
- package/dist/{authenticationManager-BIZC55Bi.d.ts → authenticationManager-CWmh7aSY.d.ts} +1 -1
- package/dist/{authenticationManager-2Lr5V_7p.esm.js → authenticationManager-DjX0XDyH.esm.js} +5 -5
- package/dist/{authenticationStateMachine-C99B0GFP.esm.js → authenticationStateMachine-BMbZL8wm.esm.js} +3 -3
- package/dist/backCameraLabel-yda5ugE4.esm.js +67 -0
- package/dist/{backCameraStream-CMvXj4X4.esm.js → backCameraStream-DS1oDiUq.esm.js} +12 -107
- package/dist/{browser-DlFgHpoC-DnyrCR8r.esm.js → browser-pQZA35G2-DtkAf6sn.esm.js} +161 -150
- package/dist/{camera-sIa9ceW2.esm.js → camera-E_Kcre4O.esm.js} +15 -23
- package/dist/camera.d.ts +2 -2
- package/dist/camera.esm.js +1 -1
- package/dist/certificate-issuance.esm.js +2 -2
- package/dist/{certificateIssuanceManager-BfeMv2PU.esm.js → certificateIssuanceManager-C1nETQos.esm.js} +2 -2
- package/dist/{certificateIssuanceStateMachine-Frgjbjw8.esm.js → certificateIssuanceStateMachine-DThXMDqr.esm.js} +2 -2
- package/dist/cnpj-Co1ottYN.esm.js +77 -0
- package/dist/connectivity-BCuEoQ-n.esm.js +114 -0
- package/dist/consent.d.ts +1 -1
- package/dist/consent.esm.js +2 -2
- package/dist/{consentManager-CvEu8h_W.esm.js → consentManager-DMlSL6Ax.esm.js} +4 -3
- package/dist/{consentManager-Cv_0QKLD.d.ts → consentManager-bjfVXO7p.d.ts} +9 -2
- package/dist/{consentStateMachine-DJTgN_-1.esm.js → consentStateMachine-DIYSMxKQ.esm.js} +20 -7
- package/dist/cross-document-data-match.esm.js +1 -1
- package/dist/{crossDocumentDataMatchManager-Cu141CE8.esm.js → crossDocumentDataMatchManager-BFTdiEDB.esm.js} +2 -2
- package/dist/curp-validation.d.ts +1 -1
- package/dist/curp-validation.esm.js +2 -2
- package/dist/{curpValidationManager-B-z9q5V3.esm.js → curpValidationManager-DNpC3wyf.esm.js} +3 -2
- package/dist/{curpValidationManager-C9sqoh9n.d.ts → curpValidationManager-z8428oCM.d.ts} +1 -1
- package/dist/{curpValidationStateMachine-vDEFLMPw.esm.js → curpValidationStateMachine-B3iVsDyt.esm.js} +28 -20
- package/dist/custom-fields.esm.js +1 -1
- package/dist/custom-watchlist.esm.js +2 -2
- package/dist/{customFieldsManager-D1ex2cFM.esm.js → customFieldsManager-CvI-pDT3.esm.js} +2 -2
- package/dist/{customWatchlistManager-CTI-SGk0.esm.js → customWatchlistManager-BuHtUb0y.esm.js} +2 -2
- package/dist/{customWatchlistStateMachine-hmRd0f2I.esm.js → customWatchlistStateMachine-CiVD9wyF.esm.js} +1 -1
- package/dist/{deepsightService-CKTYDIXD.esm.js → deepsightLoader-B7DEYoyY.esm.js} +40 -74
- package/dist/{createCameraCycleOwnership-Dj_LHUvN.esm.js → desktopCameraElection-BGMtYwk3.esm.js} +177 -40
- package/dist/device.esm.js +2 -2
- package/dist/document-capture.d.ts +3 -3
- package/dist/document-capture.esm.js +2 -2
- package/dist/{documentCaptureManager-DkyDtm3Y.d.ts → documentCaptureManager-CD5iQiUI.d.ts} +37 -4
- package/dist/{documentCaptureManager-DUJwpKC5.esm.js → documentCaptureManager-DLPqruXJ.esm.js} +27 -19
- package/dist/{documentCaptureStateMachine-B8i7GnLh.esm.js → documentCaptureStateMachine-DCvWQhFG.esm.js} +105 -56
- package/dist/dynamic-forms.d.ts +2 -2
- package/dist/dynamic-forms.esm.js +2 -2
- package/dist/{dynamicFormsManager-C0dHs1ty.d.ts → dynamicFormsManager-9kwY8Bf5.d.ts} +1 -1
- package/dist/{dynamicFormsManager-DiKYjcF3.esm.js → dynamicFormsManager-DfqCEPg9.esm.js} +2 -2
- package/dist/{dynamicFormsStateMachine-DEI45xYW.esm.js → dynamicFormsStateMachine-USQMB-uV.esm.js} +2 -2
- package/dist/ekyb.d.ts +4 -4
- package/dist/ekyb.esm.js +3 -3
- package/dist/{ekybManager-BaZ_7CEu.d.ts → ekybManager-BLOkwmWO.d.ts} +2 -2
- package/dist/{ekybManager-8WLkNcqg.esm.js → ekybManager-CR8YSYux.esm.js} +2 -2
- package/dist/{ekybStateMachine-BLRT45Ex.esm.js → ekybStateMachine-kHwdz6hm.esm.js} +28 -44
- package/dist/ekybUtils-Cw8Ta9Qi.esm.js +140 -0
- package/dist/ekyc.d.ts +4 -3
- package/dist/ekyc.esm.js +3 -3
- package/dist/{ekycManager-DW-ynodd.d.ts → ekycManager-DlGIn9wA.d.ts} +2 -1
- package/dist/{ekycManager-BO-Lui3t.esm.js → ekycManager-DymCvmVB.esm.js} +2 -2
- package/dist/ekycStateMachine-CoFCUJ2z.esm.js +7578 -0
- package/dist/ekycUtils-GRuMELYr.esm.js +1472 -0
- package/dist/electronic-signature.esm.js +1 -1
- package/dist/{electronicSignatureManager-CcIMOb_Y.esm.js → electronicSignatureManager-BCE3uA3z.esm.js} +4 -4
- package/dist/email.esm.js +2 -2
- package/dist/{emailManager-ButFktRm.esm.js → emailManager-CGoE3CUe.esm.js} +2 -2
- package/dist/{emailStateMachine-BXtlC0NV.esm.js → emailStateMachine-KgHfDNvM.esm.js} +32 -20
- package/dist/{events-Du2A4-Qr.esm.js → events-ggpBBaZ8.esm.js} +2 -2
- package/dist/events.esm.js +1 -1
- package/dist/extensibility.d.ts +37 -22
- package/dist/extensibility.esm.js +36 -35
- package/dist/{externalFetch-DrR9xshk.esm.js → externalFetch-CQY41QT1.esm.js} +4 -1
- package/dist/face-match.d.ts +1 -1
- package/dist/face-match.esm.js +2 -2
- package/dist/{faceCaptureManagerFactory-1hzeS_rB.d.ts → faceCaptureManagerFactory-DV2ULUYS.d.ts} +71 -66
- package/dist/{faceCaptureManagerFactory-BlGvXzXA.esm.js → faceCaptureManagerFactory-Dp90bedH.esm.js} +4 -4
- package/dist/{faceCaptureSetup-TY8RXc2N.esm.js → faceCaptureSetup-ZfiWg0fo.esm.js} +84 -457
- package/dist/{faceMatchManager-DWFUQjMQ.esm.js → faceMatchManager-D2xKPjjQ.esm.js} +2 -2
- package/dist/{faceMatchManager-DIgG-UFS.d.ts → faceMatchManager-Z4UDLwAv.d.ts} +16 -7
- package/dist/{faceMatchStateMachine-CUCvlydD.esm.js → faceMatchStateMachine-CUvwiQi9.esm.js} +40 -27
- package/dist/{feature-management-B5rR10uS.esm.js → feature-management-BbCIA4og.esm.js} +35 -21
- package/dist/feature-management.esm.js +1 -1
- package/dist/field-comparison.esm.js +1 -1
- package/dist/{fieldComparisonManager-v3knTYV_.esm.js → fieldComparisonManager-DgDbEeFZ.esm.js} +2 -2
- package/dist/fiscal-qr.esm.js +1 -1
- package/dist/{fiscalQrManager-Dt9fHG7h.esm.js → fiscalQrManager-BZeklojR.esm.js} +4 -4
- package/dist/flow-events.d.ts +1 -1
- package/dist/flow.d.ts +10 -10
- package/dist/flow.esm.js +10 -9
- package/dist/{flowCompletionService-BDI5QpfR.esm.js → flowCompletionService-CcCnPs_T.esm.js} +2 -2
- package/dist/{flowServices-roD0oIQL.esm.js → flowServices-Dmnc8Rye.esm.js} +69 -185
- package/dist/geolocation.d.ts +1 -1
- package/dist/geolocation.esm.js +2 -2
- package/dist/{geolocationManager-Dn24g1fl.d.ts → geolocationManager-6e1i9UIR.d.ts} +15 -17
- package/dist/{geolocationManager-DnONzWL5.esm.js → geolocationManager-BJJ3m_I8.esm.js} +6 -8
- package/dist/{geolocationStateMachine-eWy_G4Os.esm.js → geolocationStateMachine-CTI3m4Ie.esm.js} +12 -8
- package/dist/{getDeviceClass-bsWdEDxP.esm.js → getDeviceClass-DoIWuKI8.esm.js} +1 -1
- package/dist/government-validation.esm.js +2 -2
- package/dist/{governmentValidationManager-BtXWHICu.esm.js → governmentValidationManager-CjChjZ3C.esm.js} +2 -2
- package/dist/{governmentValidationStateMachine-COL-Vs48.esm.js → governmentValidationStateMachine-AEbn3Afi.esm.js} +1 -1
- package/dist/home.d.ts +1 -1
- package/dist/home.esm.js +1 -1
- package/dist/http.esm.js +1 -1
- package/dist/id-ocr.d.ts +1 -1
- package/dist/id-ocr.esm.js +2 -2
- package/dist/id-selfie-flow.d.ts +1 -1
- package/dist/id-selfie-flow.esm.js +10 -9
- package/dist/id-verification.esm.js +2 -2
- package/dist/id.d.ts +3 -16
- package/dist/id.esm.js +4 -4
- package/dist/{idCaptureDefaults-BGsG2OAs.esm.js → idCaptureDefaults-Dszuq9ng.esm.js} +3 -3
- package/dist/{idCaptureManager-BrfYjCm_.esm.js → idCaptureManager-B3oR4RnA.esm.js} +64 -17
- package/dist/{idCaptureManager-0M02hSuC.d.ts → idCaptureManager-CCA2D1Ah.d.ts} +68 -5
- package/dist/{idCaptureServices-BSj6EH2l.esm.js → idCaptureServices-DK0QboqT.esm.js} +29 -198
- package/dist/{idCaptureStateMachine-dXKBYHQp.esm.js → idCaptureStateMachine-zzar9MPy.esm.js} +914 -536
- package/dist/{idOcrManager-DT3kPIB3.d.ts → idOcrManager-BTdHlJ9D.d.ts} +1 -1
- package/dist/{idOcrManager-D3-HNMXP.esm.js → idOcrManager-xyEZNOBa.esm.js} +2 -2
- package/dist/{idOcrStateMachine-DyENX6Ki.esm.js → idOcrStateMachine-DNKXh4Rn.esm.js} +2 -2
- package/dist/{idVerificationManager-iWz7Avkr.esm.js → idVerificationManager-DdnvYfgN.esm.js} +2 -2
- package/dist/{idVerificationStateMachine-CL1kUdBe.esm.js → idVerificationStateMachine-DtIBCa32.esm.js} +1 -1
- package/dist/identity-reuse.esm.js +2 -2
- package/dist/{identityReuseManager-CD1ucp1d.esm.js → identityReuseManager-CcpovlfD.esm.js} +2 -2
- package/dist/{identityReuseStateMachine-DfV81wQC.esm.js → identityReuseStateMachine-DxZFWy47.esm.js} +1 -1
- package/dist/{index-CKQ9QBZP.d.ts → index-DC0P2Vzw.d.ts} +1 -1
- package/dist/{index-BKOWUhxG.d.ts → index-DEfwds5y.d.ts} +55 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/{invokeOnCaptureCallback-DYrkOXO6.esm.js → invokeOnCaptureCallback-BJ0GVHGr.esm.js} +1 -1
- package/dist/kyb-checks.d.ts +3 -0
- package/dist/kyb-checks.esm.js +3 -0
- package/dist/kybChecksManager-CblEL97E.d.ts +95 -0
- package/dist/kybChecksManager-DpGOp4Su.esm.js +89 -0
- package/dist/kybChecksStateMachine-B43NAnv7.esm.js +718 -0
- package/dist/mandatory-consent.d.ts +2 -2
- package/dist/mandatory-consent.esm.js +2 -2
- package/dist/{mandatoryConsentManager-Cwqx1nK7.esm.js → mandatoryConsentManager-B4vCYslr.esm.js} +4 -3
- package/dist/{mandatoryConsentManager-BQ43yndC.d.ts → mandatoryConsentManager-B88Sm5nd.d.ts} +10 -3
- package/dist/{mandatoryConsentStateMachine-pXWqAHo_.esm.js → mandatoryConsentStateMachine-DWslYPA3.esm.js} +20 -7
- package/dist/mediaRecorderOptions-B9-IEVtV.esm.js +70 -0
- package/dist/multipartRecordingService-BTqkHGG9.esm.js +407 -0
- package/dist/nationalIds-B91f_RuB.esm.js +99 -0
- package/dist/{permissionGuards-gcy3U0SL.esm.js → permissionGuards-DFV-Ws0a.esm.js} +1 -1
- package/dist/{permissionServices-Ca-tSNhT.esm.js → permissionServices-D190ATGD.esm.js} +11 -9
- package/dist/phone-number.d.ts +7 -1
- package/dist/phone-number.esm.js +15 -2
- package/dist/phone.d.ts +1 -1
- package/dist/phone.esm.js +2 -2
- package/dist/phoneFormat-JJNaWthV.esm.js +75 -0
- package/dist/{phoneManager-BO-LTih5.d.ts → phoneManager-6nrJkvkG.d.ts} +5 -0
- package/dist/{phoneManager-KKUq-Vgo.esm.js → phoneManager-Dy5tODCU.esm.js} +3 -3
- package/dist/phoneServices-DJgyOzU2.esm.js +77 -0
- package/dist/{phoneStateMachine-D2QWS2cu.esm.js → phoneStateMachine-DnlPhnw7.esm.js} +54 -82
- package/dist/{phoneValidation-DnBcNUNh.esm.js → phoneValidation-OggtfjRt.esm.js} +1 -2
- package/dist/{platform-DkcRc9JV.esm.js → platform-aPh7gTWh.esm.js} +15 -1
- package/dist/processFaceMatch-Bst83HaS.esm.js +21 -0
- package/dist/qe-signature.esm.js +1 -1
- package/dist/recordingService-CTko6Cjn.esm.js +397 -0
- package/dist/redirect-to-mobile.d.ts +2 -2
- package/dist/redirect-to-mobile.esm.js +2 -2
- package/dist/{redirectToMobileManager-uHW3dyuQ.esm.js → redirectToMobileManager-CgGaT2NP.esm.js} +5 -4
- package/dist/{redirectToMobileManager-CVsvpVbQ.d.ts → redirectToMobileManager-Dm9ctRCC.d.ts} +3 -1
- package/dist/{redirectToMobileStateMachine-b-H-ipGM.esm.js → redirectToMobileStateMachine-CbhN8uVN.esm.js} +65 -26
- package/dist/resolveForm-O7-r79VA.esm.js +351 -0
- package/dist/{runChildModule-BF_atgNx.esm.js → runChildModule-BffFArwl.esm.js} +3 -3
- package/dist/{sdkVersion-CsIbltJF.esm.js → sdkVersion-CDd_gaR7.esm.js} +1 -1
- package/dist/selfie.d.ts +4 -4
- package/dist/selfie.esm.js +10 -10
- package/dist/{selfieErrorUtils-BY0-YbPW.esm.js → selfieErrorUtils-f4MgAG2A.esm.js} +1 -1
- package/dist/{selfieManager-BJdNu_nd.d.ts → selfieManager-DmZFzs1-.d.ts} +1 -1
- package/dist/{selfieManager-vAAwzsHk.esm.js → selfieManager-hopelYEk.esm.js} +5 -5
- package/dist/{selfieStateMachine-BFVp3ElQ.esm.js → selfieStateMachine-DaZIVv3Q.esm.js} +3 -3
- package/dist/{session-CpwfoVdH.esm.js → session-CdSX4wsZ.esm.js} +77 -9
- package/dist/session.d.ts +96 -10
- package/dist/session.esm.js +7 -6
- package/dist/{sessionInitializer-BTjYgE-V.esm.js → sessionInitializer-DsL7X2j9.esm.js} +465 -206
- package/dist/{setup-YPKTUCY5.d.ts → setup-D9qt8YVU.d.ts} +2 -2
- package/dist/{setup-BInNAvQw.esm.js → setup-DDahygZs.esm.js} +44 -30
- package/dist/signature.esm.js +2 -2
- package/dist/{signatureManager-f_dPAGXn.esm.js → signatureManager-CwqjcxPg.esm.js} +2 -2
- package/dist/{signatureStateMachine-C-nUq_oq.esm.js → signatureStateMachine-DBVDd1Eu.esm.js} +1 -1
- package/dist/{stats-BEvexnKC.esm.js → stats-CatA2dea.esm.js} +1 -1
- package/dist/stats.esm.js +1 -1
- package/dist/textRules-D4NRinKY.d.ts +41 -0
- package/dist/{tri-xzRLIIMN.esm.js → tri-DG6priFa.esm.js} +142 -8
- package/dist/tri.d.ts +1 -1
- package/dist/tri.esm-CzTNi5Q_.esm.js +3826 -0
- package/dist/tri.esm.js +1 -1
- package/dist/{trueSightService-BMT-TubT.esm.js → trueSightService-GuLthUVK.esm.js} +19 -10
- package/dist/trust-graph.esm.js +1 -1
- package/dist/types-B9C8W01q.d.ts +34 -0
- package/dist/{types-yPH8lAH-.d.ts → types-BEVHQbbC.d.ts} +2 -2
- package/dist/{types-BAxn7MpY.d.ts → types-BPm1JSu7.d.ts} +123 -48
- package/dist/{types-0L-eFDmr.d.ts → types-BgRHw-dR.d.ts} +1 -1
- package/dist/{types-B6HsSzpk.d.ts → types-CRaFu6wS.d.ts} +6 -3
- package/dist/types-CTaL0XJz.d.ts +80 -0
- package/dist/{types-Ckir_BEs.d.ts → types-Cd0J0F9D.d.ts} +1 -1
- package/dist/{types-CK8Jbjkp.d.ts → types-Csh8vzPo.d.ts} +1 -1
- package/dist/types-CuMJ2M7D.d.ts +210 -0
- package/dist/{types-DUnFZ08M.d.ts → types-CyNndVAT.d.ts} +16 -8
- package/dist/{types-DPIDuhut.d.ts → types-DNVzoRvi.d.ts} +2 -1
- package/dist/types-J6g6iKe_.d.ts +6 -0
- package/dist/{urlUtils-6jsE6rKp.esm.js → urlUtils-eYiyWjh0.esm.js} +4 -1
- package/dist/video-selfie.d.ts +8 -8
- package/dist/video-selfie.esm.js +97 -22
- package/dist/{videoSelfieCameraWarmer-D1xA0u8y.esm.js → videoSelfieCameraWarmer-e3irGfcO.esm.js} +18 -21
- package/dist/{videoSelfieStepDetector-CGsTltqB.d.ts → videoSelfieStepDetector-Dv3Mgws-.d.ts} +9 -4
- package/dist/virtualCameraCheck-eFOm2C9q.esm.js +27 -0
- package/dist/{warmup-BElYWRh7.esm.js → warmup-DtB0DJpl.esm.js} +198 -27
- package/dist/wasm.d.ts +2 -2
- package/dist/wasm.esm.js +3 -3
- package/dist/{wasmDsFlagSync-CYj5LL9z.esm.js → wasmDsFlagSync-BtiR5pig.esm.js} +1 -1
- package/dist/wasmMetadataVersionSync-U8EFUr1T.esm.js +27 -0
- package/dist/{wasmWebClient-BjZw_7OB.esm.js → wasmWebClient-BDrax6Eu.esm.js} +55 -26
- package/dist/watchlist-for-business.d.ts +2 -1
- package/dist/watchlist-for-business.esm.js +2 -2
- package/dist/watchlist.esm.js +2 -2
- package/dist/{watchlistForBusinessManager-B3GDPZrr.d.ts → watchlistForBusinessManager-DX2AyM4Y.d.ts} +54 -18
- package/dist/{watchlistForBusinessManager-CZZOFkGl.esm.js → watchlistForBusinessManager-DqUpAEj_.esm.js} +37 -7
- package/dist/watchlistForBusinessStateMachine-DdaPl2PS.esm.js +166 -0
- package/dist/{watchlistManager-DXtX94SN.esm.js → watchlistManager-CdpXzT4B.esm.js} +2 -2
- package/dist/{watchlistStateMachine-McALifag.esm.js → watchlistStateMachine-ofHW_lPk.esm.js} +1 -1
- package/dist/workflow.d.ts +5 -2
- package/dist/workflow.esm.js +60 -50
- package/package.json +12 -5
- package/dist/IBrowserEnvironmentCapability-DEaRRk-R.esm.js +0 -9
- package/dist/addressSearch-DPjIKJrX.esm.js +0 -563
- package/dist/deepsightLoader-DeNvGU3c.esm.js +0 -55
- package/dist/ekycStateMachine-CDnI_NRq.esm.js +0 -1443
- package/dist/ekycUtils-zY8CdKJL.esm.js +0 -300
- package/dist/thumbmark.esm-CRc0cYvz.esm.js +0 -1242
- package/dist/tri.esm-BIjHhBJ2.esm.js +0 -2620
- package/dist/types-BvLo3U4u.d.ts +0 -134
- package/dist/types-zOgZqMni.d.ts +0 -6
- package/dist/watchlistForBusinessStateMachine-B66E7jud.esm.js +0 -78
- /package/dist/{types-BSBzhHRH2.d.ts → types-BSBzhHRH.d.ts} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { r as MandatoryConsentConfig } from "./types-
|
|
2
|
-
import { a as MandatoryConsentActor, i as createMandatoryConsentManagerFromActor, n as MandatoryConsentState, o as mandatoryConsentMachine, r as createMandatoryConsentManager, t as MandatoryConsentManager } from "./mandatoryConsentManager-
|
|
1
|
+
import { r as MandatoryConsentConfig } from "./types-Cd0J0F9D.js";
|
|
2
|
+
import { a as MandatoryConsentActor, i as createMandatoryConsentManagerFromActor, n as MandatoryConsentState, o as mandatoryConsentMachine, r as createMandatoryConsentManager, t as MandatoryConsentManager } from "./mandatoryConsentManager-B88Sm5nd.js";
|
|
3
3
|
export { type MandatoryConsentActor, type MandatoryConsentConfig, type MandatoryConsentManager, type MandatoryConsentState, createMandatoryConsentManager, createMandatoryConsentManagerFromActor, mandatoryConsentMachine };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-
|
|
2
|
-
import { n as createMandatoryConsentManagerFromActor, t as createMandatoryConsentManager } from "./mandatoryConsentManager-
|
|
1
|
+
import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-DWslYPA3.esm.js";
|
|
2
|
+
import { n as createMandatoryConsentManagerFromActor, t as createMandatoryConsentManager } from "./mandatoryConsentManager-B4vCYslr.esm.js";
|
|
3
3
|
export { createMandatoryConsentManager, createMandatoryConsentManagerFromActor, mandatoryConsentMachine };
|
package/dist/{mandatoryConsentManager-Cwqx1nK7.esm.js → mandatoryConsentManager-B4vCYslr.esm.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-
|
|
1
|
+
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-ggpBBaZ8.esm.js";
|
|
2
2
|
import { s as createActor, u as createManager } from "./xstate.esm-DSajW7CJ.esm.js";
|
|
3
|
-
import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-
|
|
3
|
+
import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-DWslYPA3.esm.js";
|
|
4
4
|
//#region src/modules/mandatory-consent/mandatoryConsentActor.ts
|
|
5
5
|
function createMandatoryConsentActor(options) {
|
|
6
6
|
return createActor(mandatoryConsentMachine, { input: { config: options.config } }).start();
|
|
@@ -32,7 +32,8 @@ function mapState(snapshot) {
|
|
|
32
32
|
if (typedSnapshot.matches("closed")) return { status: "closed" };
|
|
33
33
|
if (typedSnapshot.matches("error")) return {
|
|
34
34
|
status: "error",
|
|
35
|
-
error: context.error ?? "Unknown error"
|
|
35
|
+
error: context.error ?? "Unknown error",
|
|
36
|
+
moduleErrorCode: context.moduleErrorCode
|
|
36
37
|
};
|
|
37
38
|
return { status: "idle" };
|
|
38
39
|
}
|
package/dist/{mandatoryConsentManager-BQ43yndC.d.ts → mandatoryConsentManager-B88Sm5nd.d.ts}
RENAMED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { A as StateMachine, C as StateValue, D as PromiseActorLogic, a as ActorRefFromLogic, b as RequiredActorOptions, c as AnyEventObject, g as IsNotNever, h as InputFrom, i as ActorRefFrom, k as MachineSnapshot, m as GetConcreteByKey, o as AnyActorLogic, p as EventObject, r as ActorRef, s as AnyActorRef, u as ConditionalRequired, v as MetaObject, w as Values, x as RequiredLogicInput, y as NonReducibleUnknown } from "./spawn-D9jgw9pW.js";
|
|
2
2
|
import { t as Manager } from "./Manager-C9T5amUN.js";
|
|
3
3
|
import "./Actor-DpTj5PFb.js";
|
|
4
|
-
import { n as MandatoryConsent, r as MandatoryConsentConfig, t as FetchMandatoryConsentResponse } from "./types-
|
|
4
|
+
import { n as MandatoryConsent, r as MandatoryConsentConfig, t as FetchMandatoryConsentResponse } from "./types-Cd0J0F9D.js";
|
|
5
5
|
//#region src/modules/mandatory-consent/mandatoryConsentStateMachine.d.ts
|
|
6
6
|
type MandatoryConsentContext = {
|
|
7
7
|
config: MandatoryConsentConfig;
|
|
8
8
|
consent: MandatoryConsent | undefined;
|
|
9
9
|
isSigned: boolean;
|
|
10
10
|
error: string | undefined;
|
|
11
|
+
moduleErrorCode: string | undefined;
|
|
11
12
|
};
|
|
12
13
|
type MandatoryConsentInput = {
|
|
13
14
|
config: MandatoryConsentConfig;
|
|
@@ -56,6 +57,10 @@ declare const mandatoryConsentMachine: StateMachine<MandatoryConsentContext, {
|
|
|
56
57
|
type: "setError";
|
|
57
58
|
params: NonReducibleUnknown;
|
|
58
59
|
};
|
|
60
|
+
setLoadError: {
|
|
61
|
+
type: "setLoadError";
|
|
62
|
+
params: NonReducibleUnknown;
|
|
63
|
+
};
|
|
59
64
|
toggleSigned: {
|
|
60
65
|
type: "toggleSigned";
|
|
61
66
|
params: NonReducibleUnknown;
|
|
@@ -71,7 +76,7 @@ declare const mandatoryConsentMachine: StateMachine<MandatoryConsentContext, {
|
|
|
71
76
|
}>, {
|
|
72
77
|
type: "canSubmit";
|
|
73
78
|
params: unknown;
|
|
74
|
-
}, never, "error" | "idle" | "closed" | "finished" | "
|
|
79
|
+
}, never, "error" | "idle" | "closed" | "finished" | "loading" | "submitting" | "display", string, MandatoryConsentInput, NonReducibleUnknown, EventObject, MetaObject, {
|
|
75
80
|
readonly id: "mandatoryConsent";
|
|
76
81
|
readonly initial: "idle";
|
|
77
82
|
readonly context: ({ input }: {
|
|
@@ -171,6 +176,7 @@ declare const mandatoryConsentMachine: StateMachine<MandatoryConsentContext, {
|
|
|
171
176
|
consent: undefined;
|
|
172
177
|
isSigned: false;
|
|
173
178
|
error: undefined;
|
|
179
|
+
moduleErrorCode: undefined;
|
|
174
180
|
};
|
|
175
181
|
readonly states: {
|
|
176
182
|
readonly idle: {
|
|
@@ -234,7 +240,7 @@ declare const mandatoryConsentMachine: StateMachine<MandatoryConsentContext, {
|
|
|
234
240
|
};
|
|
235
241
|
readonly onError: {
|
|
236
242
|
readonly target: "error";
|
|
237
|
-
readonly actions: "
|
|
243
|
+
readonly actions: "setLoadError";
|
|
238
244
|
};
|
|
239
245
|
};
|
|
240
246
|
};
|
|
@@ -375,6 +381,7 @@ type MandatoryConsentClosedState = {
|
|
|
375
381
|
type MandatoryConsentErrorState = {
|
|
376
382
|
status: 'error';
|
|
377
383
|
error: string;
|
|
384
|
+
moduleErrorCode?: string;
|
|
378
385
|
};
|
|
379
386
|
type MandatoryConsentState = MandatoryConsentIdleState | MandatoryConsentLoadingState | MandatoryConsentDisplayState | MandatoryConsentSubmittingState | MandatoryConsentFinishedState | MandatoryConsentClosedState | MandatoryConsentErrorState;
|
|
380
387
|
declare function createMandatoryConsentManager(options: CreateMandatoryConsentActorOptions): Manager<MandatoryConsentState> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as api, u as endpoints } from "./api-
|
|
1
|
+
import { t as api, u as endpoints } from "./api-CpP4PS4S.esm.js";
|
|
2
2
|
import { i as assign, t as setup } from "./xstate.esm-DSajW7CJ.esm.js";
|
|
3
3
|
import { n as fromPromise } from "./xstate-actors.esm-8Gzepa_A.esm.js";
|
|
4
4
|
//#region src/modules/mandatory-consent/mandatoryConsentServices.ts
|
|
@@ -34,21 +34,33 @@ const mandatoryConsentMachine = setup({
|
|
|
34
34
|
}] }, signal))
|
|
35
35
|
},
|
|
36
36
|
actions: {
|
|
37
|
+
setLoadError: assign(({ event }) => ({
|
|
38
|
+
error: String(event.error),
|
|
39
|
+
moduleErrorCode: "REGULATORY_CONSENT_LOAD_FAILED"
|
|
40
|
+
})),
|
|
37
41
|
setConsent: assign(({ event }) => {
|
|
38
42
|
return {
|
|
39
43
|
consent: event.output.consents[0],
|
|
40
44
|
isSigned: false,
|
|
41
|
-
error: void 0
|
|
45
|
+
error: void 0,
|
|
46
|
+
moduleErrorCode: void 0
|
|
42
47
|
};
|
|
43
48
|
}),
|
|
44
49
|
toggleSigned: assign(({ context }) => ({ isSigned: !context.isSigned })),
|
|
45
|
-
setError: assign(({ event }) => ({
|
|
46
|
-
|
|
50
|
+
setError: assign(({ event }) => ({
|
|
51
|
+
error: String(event.error),
|
|
52
|
+
moduleErrorCode: void 0
|
|
53
|
+
})),
|
|
54
|
+
clearError: assign({
|
|
55
|
+
error: () => void 0,
|
|
56
|
+
moduleErrorCode: () => void 0
|
|
57
|
+
}),
|
|
47
58
|
resetContext: assign(({ context }) => ({
|
|
48
59
|
config: context.config,
|
|
49
60
|
consent: void 0,
|
|
50
61
|
isSigned: false,
|
|
51
|
-
error: void 0
|
|
62
|
+
error: void 0,
|
|
63
|
+
moduleErrorCode: void 0
|
|
52
64
|
}))
|
|
53
65
|
},
|
|
54
66
|
guards: { canSubmit: ({ context }) => Boolean(context.consent?.id) && context.isSigned }
|
|
@@ -59,7 +71,8 @@ const mandatoryConsentMachine = setup({
|
|
|
59
71
|
config: input.config,
|
|
60
72
|
consent: void 0,
|
|
61
73
|
isSigned: false,
|
|
62
|
-
error: void 0
|
|
74
|
+
error: void 0,
|
|
75
|
+
moduleErrorCode: void 0
|
|
63
76
|
}),
|
|
64
77
|
states: {
|
|
65
78
|
idle: { on: { LOAD: {
|
|
@@ -76,7 +89,7 @@ const mandatoryConsentMachine = setup({
|
|
|
76
89
|
},
|
|
77
90
|
onError: {
|
|
78
91
|
target: "error",
|
|
79
|
-
actions: "
|
|
92
|
+
actions: "setLoadError"
|
|
80
93
|
}
|
|
81
94
|
} },
|
|
82
95
|
display: { on: {
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { a as isIOS } from "./platform-aPh7gTWh.esm.js";
|
|
2
|
+
//#region ../infra/src/media/mediaRecorderOptions.ts
|
|
3
|
+
/**
|
|
4
|
+
* Picks a `MediaRecorder` mime type the current browser actually supports.
|
|
5
|
+
* WebM avoids Safari's fragmented-MP4 unknown-duration metadata on versions
|
|
6
|
+
* that can record it; older Safari versions fall back to MP4. Returns '' when
|
|
7
|
+
* none match.
|
|
8
|
+
*/
|
|
9
|
+
function getSupportedMediaRecorderMimeType() {
|
|
10
|
+
for (const type of [
|
|
11
|
+
"video/webm",
|
|
12
|
+
"video/webm;codecs=vp9",
|
|
13
|
+
"video/webm;codecs=vp8",
|
|
14
|
+
"video/mp4"
|
|
15
|
+
]) if (MediaRecorder.isTypeSupported(type)) return type;
|
|
16
|
+
return "";
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Multipart recordings use the same WebM-first order. Some Android devices
|
|
20
|
+
* advertise H.264 support but fail after MediaRecorder starts (ENG-56439).
|
|
21
|
+
*/
|
|
22
|
+
function getMultipartRecorderMimeType() {
|
|
23
|
+
return getSupportedMediaRecorderMimeType();
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* `MediaRecorder` options tuned per platform — a higher bitrate on iOS, lower
|
|
27
|
+
* elsewhere — paired with the supported mime type.
|
|
28
|
+
*/
|
|
29
|
+
function getAdaptiveMediaRecorderOptions() {
|
|
30
|
+
const mimeType = getSupportedMediaRecorderMimeType();
|
|
31
|
+
if (isIOS()) return {
|
|
32
|
+
mimeType,
|
|
33
|
+
videoBitsPerSecond: 1e6,
|
|
34
|
+
bitsPerSecond: 1e6
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
mimeType,
|
|
38
|
+
videoBitsPerSecond: 5e5,
|
|
39
|
+
bitsPerSecond: 5e5
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Worker-encoded multipart recording profile (ENG-55397). 2 GB-class devices
|
|
44
|
+
* (`navigator.deviceMemory` ≤ 2) record 360p at 15 fps: on a Galaxy A01 Core,
|
|
45
|
+
* 720p30 plus WASM detection exhausted memory (renderer swapped, GPU process
|
|
46
|
+
* killed), and even the in-worker encoder starved the camera preview to
|
|
47
|
+
* 6 fps. They also upload 2 s parts: every part is one request through the
|
|
48
|
+
* WASM HTTP client on the main thread, and at 0.5 s parts the uploads fell
|
|
49
|
+
* behind during face detection, stretching the final "processing" wait.
|
|
50
|
+
* Other devices, and browsers without `deviceMemory`, keep 720p30 at the
|
|
51
|
+
* MediaRecorder bitrate and 0.5 s parts.
|
|
52
|
+
*/
|
|
53
|
+
function getWorkerRecordingProfile(deviceMemoryGb = typeof navigator !== "undefined" ? navigator.deviceMemory : void 0) {
|
|
54
|
+
if (deviceMemoryGb !== void 0 && deviceMemoryGb <= 2) return {
|
|
55
|
+
maxLongEdge: 640,
|
|
56
|
+
maxShortEdge: 360,
|
|
57
|
+
fps: 15,
|
|
58
|
+
bitrate: 6e5,
|
|
59
|
+
timesliceMs: 2e3
|
|
60
|
+
};
|
|
61
|
+
return {
|
|
62
|
+
maxLongEdge: 1280,
|
|
63
|
+
maxShortEdge: 720,
|
|
64
|
+
fps: 30,
|
|
65
|
+
bitrate: 25e5,
|
|
66
|
+
timesliceMs: 500
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { getMultipartRecorderMimeType as n, getWorkerRecordingProfile as r, getAdaptiveMediaRecorderOptions as t };
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import { n as __exportAll } from "./rolldown-runtime-B-1-B7_t.esm.js";
|
|
2
|
+
import { t as api, u as endpoints } from "./api-CpP4PS4S.esm.js";
|
|
3
|
+
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
|
|
4
|
+
import { t as BrowserNetworkStatusProvider } from "./BrowserNetworkStatusProvider-BrDXBEDd.esm.js";
|
|
5
|
+
import { t as MultipartRecordingProvider } from "./MultipartRecordingProvider-D9mauUdS.esm.js";
|
|
6
|
+
//#region src/internal/recordings/videoSelfieUploadService.ts
|
|
7
|
+
/**
|
|
8
|
+
* Opens a scoped multipart video upload session. Idempotent server-side: if
|
|
9
|
+
* an upload is already in progress for the `(session, scope)` pair, the same `uploadId`
|
|
10
|
+
* comes back along with the parts already stored (`parts` non-empty) — but
|
|
11
|
+
* always with a fresh `epoch` that locks out whoever held the previous one.
|
|
12
|
+
*/
|
|
13
|
+
async function initiateVideoSelfieUpload(scope = "videoselfie") {
|
|
14
|
+
const response = await api.post(endpoints.videoSelfieUploadInitiate, void 0, { query: { scope } });
|
|
15
|
+
return {
|
|
16
|
+
uploadId: response.data.uploadId,
|
|
17
|
+
epoch: response.data.epoch,
|
|
18
|
+
scope,
|
|
19
|
+
parts: response.data.parts ?? []
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Uploads a single chunk as a multipart part. The body is the raw video bytes
|
|
24
|
+
* (no base64, no client-side encryption — encryption at rest is server-side
|
|
25
|
+
* S3 SSE). Every part except the last must be >= 5 MiB (enforced
|
|
26
|
+
* server-side). Returns the part number + `etag` needed to complete the
|
|
27
|
+
* upload. Rejects with a `409` status when a newer initiate fenced this
|
|
28
|
+
* session out.
|
|
29
|
+
*/
|
|
30
|
+
async function uploadVideoSelfiePart(session, partNumber, chunk) {
|
|
31
|
+
const response = await api.post(endpoints.videoSelfieUploadPart, chunk, {
|
|
32
|
+
query: {
|
|
33
|
+
uploadId: session.uploadId,
|
|
34
|
+
epoch: session.epoch,
|
|
35
|
+
partNumber,
|
|
36
|
+
scope: session.scope
|
|
37
|
+
},
|
|
38
|
+
headers: { "Content-Type": "application/octet-stream" }
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
partNumber: response.data.partNumber,
|
|
42
|
+
etag: response.data.etag
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Finalizes the upload. The service assembles from the parts it stored; the
|
|
47
|
+
* optional `parts` list is deliberately NOT sent — chunks staged below the
|
|
48
|
+
* S3 minimum are combined and renumbered server-side, so a client-side list
|
|
49
|
+
* could contradict the authoritative one. Safe to repeat if the response
|
|
50
|
+
* was lost. Returns the server-reported status. Rejects with `400` naming a
|
|
51
|
+
* missing part when the sequence has a hole.
|
|
52
|
+
*/
|
|
53
|
+
async function completeVideoSelfieUpload(session) {
|
|
54
|
+
return (await api.post(endpoints.videoSelfieUploadComplete, {
|
|
55
|
+
uploadId: session.uploadId,
|
|
56
|
+
epoch: session.epoch
|
|
57
|
+
}, { query: { scope: session.scope } })).data.status;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Discards an in-progress upload and everything already sent for it, so the
|
|
61
|
+
* backend fails the upload straight away instead of waiting for its expiry.
|
|
62
|
+
* Call when a recording is abandoned or its upload can no longer complete.
|
|
63
|
+
*/
|
|
64
|
+
async function abortVideoSelfieUpload(session) {
|
|
65
|
+
return (await api.post(endpoints.videoSelfieUploadAbort, {
|
|
66
|
+
uploadId: session.uploadId,
|
|
67
|
+
epoch: session.epoch
|
|
68
|
+
}, { query: { scope: session.scope } })).data.status;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/internal/recordings/videoSelfieChunkUploader.ts
|
|
72
|
+
/**
|
|
73
|
+
* How many part uploads run concurrently. The service allows 10 rps with a
|
|
74
|
+
* burst of 30 per session; a real recorder emits ~2 chunks/s, so this cap
|
|
75
|
+
* only matters when a backlog is draining after a network stall.
|
|
76
|
+
*/
|
|
77
|
+
const MAX_IN_FLIGHT = 3;
|
|
78
|
+
/** Attempts per chunk in the live round (first try + retries). */
|
|
79
|
+
const MAX_ATTEMPTS = 4;
|
|
80
|
+
/** Extra attempts per parked chunk during the final drain() round. */
|
|
81
|
+
const DRAIN_ATTEMPTS = 2;
|
|
82
|
+
const BACKOFF_BASE_MS = 500;
|
|
83
|
+
const BACKOFF_CAP_MS = 8e3;
|
|
84
|
+
/** Upper bound honored for a server-sent `Retry-After` (seconds). */
|
|
85
|
+
const RETRY_AFTER_CAP_MS = 3e4;
|
|
86
|
+
/**
|
|
87
|
+
* Ceiling on un-acknowledged chunk bytes held in memory. On a network slower
|
|
88
|
+
* than the encoder the backlog grows without bound; past this the upload
|
|
89
|
+
* cannot realistically catch up, so the uploader fails instead of eating
|
|
90
|
+
* memory on a low-end device. ~48 MiB ≈ 2.5 minutes of video at our bitrate.
|
|
91
|
+
*/
|
|
92
|
+
const MAX_BUFFERED_BYTES = 48 * 1024 * 1024;
|
|
93
|
+
function httpStatusOf$1(error) {
|
|
94
|
+
if (typeof error === "object" && error !== null && "status" in error && typeof error.status === "number") return error.status;
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
function retryAfterMsOf(error) {
|
|
98
|
+
if (typeof error === "object" && error !== null && "headers" in error && typeof error.headers === "object") {
|
|
99
|
+
const headers = error.headers;
|
|
100
|
+
const seconds = Number(headers?.["retry-after"]);
|
|
101
|
+
if (Number.isFinite(seconds) && seconds >= 0) return Math.min(seconds * 1e3, RETRY_AFTER_CAP_MS);
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Uploads video-selfie chunks with the client-side half of the service's
|
|
107
|
+
* resilience contract (`video-selfie-service` README, "What a client can
|
|
108
|
+
* rely on"):
|
|
109
|
+
*
|
|
110
|
+
* - **Keep-until-ack** — every chunk is held in memory until its upload
|
|
111
|
+
* returns 200 (a hole in the sequence can only be filled by that exact
|
|
112
|
+
* data). Acked bytes are durable in S3 (stored as a part or staged), so
|
|
113
|
+
* the blob is released the moment the ack lands.
|
|
114
|
+
* - **Retry with backoff** — transient failures (network error/timeout,
|
|
115
|
+
* 408, 429, 5xx) retry the same bytes under the same partNumber with
|
|
116
|
+
* exponential backoff + full jitter; 429 honors the server's
|
|
117
|
+
* `Retry-After`. Chunks may land out of order — the service stages them.
|
|
118
|
+
* - **Park, then drain** — a chunk that exhausts its live retries is parked
|
|
119
|
+
* (blob kept) without failing the recording; {@link drain} gives every
|
|
120
|
+
* parked chunk a final round once recording stops, so a mid-recording
|
|
121
|
+
* network outage only fails the upload if it persists to the end. A
|
|
122
|
+
* browser `online` event un-parks early: parked chunks get a fresh live
|
|
123
|
+
* round as soon as connectivity returns instead of waiting for stop.
|
|
124
|
+
* - **409 is fatal** — a newer initiate fenced this session out ("latest
|
|
125
|
+
* initiate wins"); no retry can succeed, so the uploader stops.
|
|
126
|
+
* - **Bounded memory** — when un-acked bytes exceed the ceiling the
|
|
127
|
+
* uploader fails rather than buffering a runaway backlog.
|
|
128
|
+
*/
|
|
129
|
+
var VideoSelfieChunkUploader = class {
|
|
130
|
+
constructor(session, dependencies = {}) {
|
|
131
|
+
this.queue = [];
|
|
132
|
+
this.parked = [];
|
|
133
|
+
this.inFlight = 0;
|
|
134
|
+
this.bufferedBytes = 0;
|
|
135
|
+
this.fatal = false;
|
|
136
|
+
this.disposed = false;
|
|
137
|
+
this.tasks = [];
|
|
138
|
+
this.session = session;
|
|
139
|
+
this.timer = dependencies.timer ?? BrowserTimerProvider.getInstance();
|
|
140
|
+
this.jitter = dependencies.jitter ?? Math.random;
|
|
141
|
+
const networkStatus = dependencies.networkStatus ?? new BrowserNetworkStatusProvider();
|
|
142
|
+
this.unsubscribeOnline = networkStatus.onOnline(() => this.unparkEarly());
|
|
143
|
+
}
|
|
144
|
+
/** True once the upload cannot complete (fenced out or over the memory cap). */
|
|
145
|
+
get failed() {
|
|
146
|
+
return this.fatal;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Accepts the next chunk for upload. Non-blocking: the upload (and any
|
|
150
|
+
* retries) run in the background; failures surface through {@link failed}
|
|
151
|
+
* and {@link drain}.
|
|
152
|
+
*/
|
|
153
|
+
enqueue(partNumber, chunk) {
|
|
154
|
+
if (this.fatal || this.disposed) return;
|
|
155
|
+
this.bufferedBytes += chunk.size;
|
|
156
|
+
if (this.bufferedBytes > MAX_BUFFERED_BYTES) {
|
|
157
|
+
this.fatal = true;
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
this.queue.push({
|
|
161
|
+
partNumber,
|
|
162
|
+
chunk,
|
|
163
|
+
attempts: 0
|
|
164
|
+
});
|
|
165
|
+
this.pump();
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Waits for every accepted chunk to be acknowledged, giving parked chunks
|
|
169
|
+
* one final retry round. Returns `true` when all chunks landed and the
|
|
170
|
+
* upload can be completed.
|
|
171
|
+
*/
|
|
172
|
+
async drain() {
|
|
173
|
+
this.unsubscribeOnline();
|
|
174
|
+
await this.settleLiveRound();
|
|
175
|
+
while (!this.fatal && this.parked.length > 0) {
|
|
176
|
+
const chunk = this.parked.shift();
|
|
177
|
+
chunk.attempts = MAX_ATTEMPTS - DRAIN_ATTEMPTS;
|
|
178
|
+
this.queue.push(chunk);
|
|
179
|
+
this.pump();
|
|
180
|
+
await this.settleLiveRound();
|
|
181
|
+
if (this.parked.some((p) => p.partNumber === chunk.partNumber)) return false;
|
|
182
|
+
}
|
|
183
|
+
return !this.disposed && !this.fatal && this.parked.length === 0;
|
|
184
|
+
}
|
|
185
|
+
/** Cancels all pending work; held blobs are released. */
|
|
186
|
+
dispose() {
|
|
187
|
+
this.disposed = true;
|
|
188
|
+
this.queue = [];
|
|
189
|
+
this.parked = [];
|
|
190
|
+
this.unsubscribeOnline();
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Connectivity is back (browser `online` event) — give parked chunks a
|
|
194
|
+
* fresh live round right away instead of holding them until {@link drain}.
|
|
195
|
+
* The event is only a hint: chunks that still fail simply park again.
|
|
196
|
+
*/
|
|
197
|
+
unparkEarly() {
|
|
198
|
+
if (this.fatal || this.disposed || this.parked.length === 0) return;
|
|
199
|
+
for (const chunk of this.parked.splice(0)) {
|
|
200
|
+
chunk.attempts = 0;
|
|
201
|
+
this.queue.push(chunk);
|
|
202
|
+
}
|
|
203
|
+
this.pump();
|
|
204
|
+
}
|
|
205
|
+
async settleLiveRound() {
|
|
206
|
+
while (this.tasks.length > 0) {
|
|
207
|
+
const snapshot = [...this.tasks];
|
|
208
|
+
await Promise.all(snapshot);
|
|
209
|
+
this.tasks = this.tasks.filter((task) => !snapshot.includes(task));
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
pump() {
|
|
213
|
+
while (!this.fatal && !this.disposed && this.inFlight < MAX_IN_FLIGHT && this.queue.length > 0) {
|
|
214
|
+
const chunk = this.queue.shift();
|
|
215
|
+
this.inFlight += 1;
|
|
216
|
+
const task = this.uploadWithRetry(chunk).finally(() => {
|
|
217
|
+
this.inFlight -= 1;
|
|
218
|
+
this.pump();
|
|
219
|
+
});
|
|
220
|
+
this.tasks.push(task);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
async uploadWithRetry(pending) {
|
|
224
|
+
while (!this.disposed) {
|
|
225
|
+
pending.attempts += 1;
|
|
226
|
+
try {
|
|
227
|
+
await uploadVideoSelfiePart(this.session, pending.partNumber, pending.chunk);
|
|
228
|
+
this.bufferedBytes -= pending.chunk.size;
|
|
229
|
+
return;
|
|
230
|
+
} catch (error) {
|
|
231
|
+
const status = httpStatusOf$1(error);
|
|
232
|
+
if (status === 409) {
|
|
233
|
+
this.fatal = true;
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
if (status !== null && status >= 400 && status < 500 && status !== 408 && status !== 429 || pending.attempts >= MAX_ATTEMPTS) {
|
|
237
|
+
this.parked.push(pending);
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
await this.delayBeforeRetry(pending.attempts, error);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
delayBeforeRetry(attempt, error) {
|
|
245
|
+
const retryAfterMs = retryAfterMsOf(error);
|
|
246
|
+
const backoffCeiling = Math.min(BACKOFF_BASE_MS * 2 ** (attempt - 1), BACKOFF_CAP_MS);
|
|
247
|
+
const waitMs = retryAfterMs ?? backoffCeiling / 2 + this.jitter() * (backoffCeiling / 2);
|
|
248
|
+
return new Promise((resolve) => {
|
|
249
|
+
this.timer.setTimeout(resolve, waitMs);
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region src/internal/recordings/multipartRecordingService.ts
|
|
255
|
+
var multipartRecordingService_exports = /* @__PURE__ */ __exportAll({ MultipartRecordingService: () => MultipartRecordingService });
|
|
256
|
+
/** Attempts for `complete` — documented safe to repeat if the response was lost. */
|
|
257
|
+
const COMPLETE_ATTEMPTS = 3;
|
|
258
|
+
const COMPLETE_BACKOFF_MS = 500;
|
|
259
|
+
function httpStatusOf(error) {
|
|
260
|
+
if (typeof error === "object" && error !== null && "status" in error && typeof error.status === "number") return error.status;
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Records the camera on-device and streams it to the backend as it is
|
|
265
|
+
* captured, using the video-selfie-service multipart upload protocol
|
|
266
|
+
* (`/v1/video-upload/*`).
|
|
267
|
+
*
|
|
268
|
+
* This is the client-side recorder for Video Selfie and for scoped regular
|
|
269
|
+
* Selfie and ID recordings. It replaces the former server-side recording path.
|
|
270
|
+
*
|
|
271
|
+
* Every ~0.5 s recorder blob uploads as its own chunk, concurrently with
|
|
272
|
+
* recording, through {@link VideoSelfieChunkUploader} (keep-until-ack +
|
|
273
|
+
* retry with backoff — see its doc for the full policy). The service stages
|
|
274
|
+
* sub-5 MiB chunks and combines them server-side, so `stop()` only drains
|
|
275
|
+
* the stragglers and finalizes; client memory holds un-acked chunks only.
|
|
276
|
+
* No client-side encryption: video is encrypted at rest server-side
|
|
277
|
+
* (S3 SSE-AES-256).
|
|
278
|
+
*/
|
|
279
|
+
var MultipartRecordingService = class {
|
|
280
|
+
constructor(scope = "videoselfie", recorder = new MultipartRecordingProvider()) {
|
|
281
|
+
this.scope = scope;
|
|
282
|
+
this.timer = BrowserTimerProvider.getInstance();
|
|
283
|
+
this.session = null;
|
|
284
|
+
this.uploader = null;
|
|
285
|
+
this.chunksEmitted = 0;
|
|
286
|
+
this.stopPromise = null;
|
|
287
|
+
this.abandonRequested = false;
|
|
288
|
+
this.recorder = recorder;
|
|
289
|
+
}
|
|
290
|
+
get isRecording() {
|
|
291
|
+
return this.recorder.isRecording;
|
|
292
|
+
}
|
|
293
|
+
async start(stream) {
|
|
294
|
+
if (this.recorder.isRecording) return;
|
|
295
|
+
let initiated = await initiateVideoSelfieUpload(this.scope);
|
|
296
|
+
if (initiated.parts.length > 0) {
|
|
297
|
+
await abortVideoSelfieUpload(initiated).catch(() => {});
|
|
298
|
+
initiated = await initiateVideoSelfieUpload(this.scope);
|
|
299
|
+
}
|
|
300
|
+
this.session = {
|
|
301
|
+
uploadId: initiated.uploadId,
|
|
302
|
+
epoch: initiated.epoch,
|
|
303
|
+
scope: this.scope
|
|
304
|
+
};
|
|
305
|
+
this.uploader = new VideoSelfieChunkUploader(this.session);
|
|
306
|
+
this.chunksEmitted = 0;
|
|
307
|
+
this.abandonRequested = false;
|
|
308
|
+
this.recorder.startRecording(stream, ({ chunk, partNumber }) => {
|
|
309
|
+
this.chunksEmitted += 1;
|
|
310
|
+
this.uploader?.enqueue(partNumber, chunk);
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
/** Pause the current media container without finalizing its upload. */
|
|
314
|
+
pause() {
|
|
315
|
+
return this.recorder.pauseRecording?.() ?? false;
|
|
316
|
+
}
|
|
317
|
+
/** Resume the same media container after its video source has recovered. */
|
|
318
|
+
resume() {
|
|
319
|
+
return this.recorder.resumeRecording?.() ?? false;
|
|
320
|
+
}
|
|
321
|
+
stop() {
|
|
322
|
+
if (this.stopPromise) return this.stopPromise;
|
|
323
|
+
const stopPromise = this.finalizeRecording();
|
|
324
|
+
this.stopPromise = stopPromise;
|
|
325
|
+
const clearStopPromise = () => {
|
|
326
|
+
if (this.stopPromise === stopPromise) {
|
|
327
|
+
this.stopPromise = null;
|
|
328
|
+
this.abandonRequested = false;
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
stopPromise.then(clearStopPromise, clearStopPromise);
|
|
332
|
+
return stopPromise;
|
|
333
|
+
}
|
|
334
|
+
async finalizeRecording() {
|
|
335
|
+
const session = this.session;
|
|
336
|
+
const uploader = this.uploader;
|
|
337
|
+
if (!this.recorder.isRecording || !session || !uploader) return { recordingId: null };
|
|
338
|
+
try {
|
|
339
|
+
await this.recorder.stopRecording();
|
|
340
|
+
if (this.abandonRequested) {
|
|
341
|
+
this.abandonUpload(session);
|
|
342
|
+
return { recordingId: null };
|
|
343
|
+
}
|
|
344
|
+
const delivered = await uploader.drain();
|
|
345
|
+
if (this.abandonRequested || !delivered || uploader.failed || this.chunksEmitted === 0) {
|
|
346
|
+
this.abandonUpload(session);
|
|
347
|
+
return { recordingId: null };
|
|
348
|
+
}
|
|
349
|
+
} catch (error) {
|
|
350
|
+
this.abandonUpload(session);
|
|
351
|
+
throw error;
|
|
352
|
+
}
|
|
353
|
+
try {
|
|
354
|
+
await this.completeWithRetry(session);
|
|
355
|
+
this.session = null;
|
|
356
|
+
this.uploader = null;
|
|
357
|
+
return { recordingId: session.uploadId };
|
|
358
|
+
} catch {
|
|
359
|
+
this.abandonUpload(session);
|
|
360
|
+
return { recordingId: null };
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
cleanup() {
|
|
364
|
+
if (this.session) if (this.stopPromise) {
|
|
365
|
+
this.abandonRequested = true;
|
|
366
|
+
this.uploader?.dispose();
|
|
367
|
+
} else this.abandonUpload(this.session);
|
|
368
|
+
this.recorder.reset();
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* `complete` is idempotent server-side ("safe to repeat if the response
|
|
372
|
+
* was lost"), so transient failures — network errors, 5xx, 429 — retry a
|
|
373
|
+
* couple of times before the recording is declared failed. A 4xx (e.g.
|
|
374
|
+
* `400` naming a missing part) is permanent: after a clean drain every
|
|
375
|
+
* chunk was acked, so a reported hole cannot be filled from here.
|
|
376
|
+
*/
|
|
377
|
+
async completeWithRetry(session) {
|
|
378
|
+
for (let attempt = 1;; attempt += 1) {
|
|
379
|
+
if (this.abandonRequested) throw new Error("Video upload abandoned");
|
|
380
|
+
try {
|
|
381
|
+
await completeVideoSelfieUpload(session);
|
|
382
|
+
return;
|
|
383
|
+
} catch (error) {
|
|
384
|
+
const status = httpStatusOf(error);
|
|
385
|
+
if (status !== null && status >= 400 && status < 500 && status !== 408 && status !== 429 || attempt >= COMPLETE_ATTEMPTS) throw error;
|
|
386
|
+
await new Promise((resolve) => {
|
|
387
|
+
this.timer.setTimeout(resolve, COMPLETE_BACKOFF_MS * attempt);
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Fire-and-forget abort: the upload can no longer complete, so tell the
|
|
394
|
+
* backend to fail it immediately rather than at its expiry. Best-effort —
|
|
395
|
+
* an abort that doesn't land (including a 409 from a newer epoch having
|
|
396
|
+
* taken over) just means the server falls back to expiry or salvage.
|
|
397
|
+
*/
|
|
398
|
+
abandonUpload(session) {
|
|
399
|
+
if (this.session !== session) return;
|
|
400
|
+
this.session = null;
|
|
401
|
+
this.uploader?.dispose();
|
|
402
|
+
this.uploader = null;
|
|
403
|
+
abortVideoSelfieUpload(session).catch(() => {});
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
//#endregion
|
|
407
|
+
export { multipartRecordingService_exports as n, MultipartRecordingService as t };
|