idmission-web-sdk 2.2.92 → 2.2.94
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/components/CompositeWizard.d.ts.map +1 -1
- package/dist/components/customer_flows/SignatureKYC.d.ts +2 -0
- package/dist/components/customer_flows/SignatureKYC.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts +2 -1
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts +2 -1
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +97 -74
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +97 -74
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +97 -74
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/sdk2.esm.js
CHANGED
|
@@ -203,7 +203,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
203
203
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
204
204
|
};
|
|
205
205
|
|
|
206
|
-
var webSdkVersion = '2.2.
|
|
206
|
+
var webSdkVersion = '2.2.94';
|
|
207
207
|
|
|
208
208
|
function getPlatform() {
|
|
209
209
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -9373,7 +9373,7 @@ function FilePickerButton(_a) {
|
|
|
9373
9373
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("input", {
|
|
9374
9374
|
ref: fileInput,
|
|
9375
9375
|
type: "file",
|
|
9376
|
-
accept: "image
|
|
9376
|
+
accept: "image/*,.pdf",
|
|
9377
9377
|
style: {
|
|
9378
9378
|
display: 'none'
|
|
9379
9379
|
},
|
|
@@ -12696,35 +12696,39 @@ var videoSignatureInitialState = {
|
|
|
12696
12696
|
var VideoSignatureContext = /*#__PURE__*/createContext(videoSignatureInitialState);
|
|
12697
12697
|
function VideoSignatureContextProvider(_a) {
|
|
12698
12698
|
var _this = this;
|
|
12699
|
-
var children = _a.children
|
|
12699
|
+
var children = _a.children,
|
|
12700
|
+
_b = _a.captureAudio,
|
|
12701
|
+
captureAudio = _b === void 0 ? false : _b;
|
|
12700
12702
|
var signaturePad = useRef(null);
|
|
12701
|
-
var _b = useState(null),
|
|
12702
|
-
signatureData = _b[0],
|
|
12703
|
-
setSignatureData = _b[1];
|
|
12704
12703
|
var _c = useState(null),
|
|
12705
|
-
|
|
12706
|
-
|
|
12704
|
+
signatureData = _c[0],
|
|
12705
|
+
setSignatureData = _c[1];
|
|
12707
12706
|
var _d = useState(null),
|
|
12708
|
-
|
|
12709
|
-
|
|
12707
|
+
signatureDataUrl = _d[0],
|
|
12708
|
+
setSignatureDataUrl = _d[1];
|
|
12710
12709
|
var _e = useState(null),
|
|
12711
|
-
|
|
12712
|
-
|
|
12710
|
+
signatureVideoData = _e[0],
|
|
12711
|
+
setSignatureVideoData = _e[1];
|
|
12712
|
+
var _f = useState(null),
|
|
12713
|
+
signatureVideoUrl = _f[0],
|
|
12714
|
+
setSignatureVideoUrl = _f[1];
|
|
12713
12715
|
var signatureRecorder = useRef(null);
|
|
12714
12716
|
var recordedChunks = useRef([]);
|
|
12715
|
-
var
|
|
12716
|
-
camera =
|
|
12717
|
-
videoRef =
|
|
12718
|
-
|
|
12719
|
-
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12717
|
+
var _g = useCameraStore(),
|
|
12718
|
+
camera = _g.camera,
|
|
12719
|
+
videoRef = _g.videoRef,
|
|
12720
|
+
audioStream = _g.audioStream;
|
|
12721
|
+
var _h = useVideoRecorder(camera, audioStream, captureAudio),
|
|
12722
|
+
isRecordingVideo = _h.isRecordingVideo,
|
|
12723
|
+
startRecordingVideo = _h.startRecordingVideo,
|
|
12724
|
+
stopRecordingVideo = _h.stopRecordingVideo,
|
|
12725
|
+
startRecordingAudio = _h.startRecordingAudio,
|
|
12726
|
+
stopRecordingAudio = _h.stopRecordingAudio;
|
|
12723
12727
|
var outputCanvas = useRef(null);
|
|
12724
12728
|
var recordingLock = useRef(false);
|
|
12725
|
-
var
|
|
12726
|
-
isRecording =
|
|
12727
|
-
setIsRecording =
|
|
12729
|
+
var _j = useState(false),
|
|
12730
|
+
isRecording = _j[0],
|
|
12731
|
+
setIsRecording = _j[1];
|
|
12728
12732
|
var startRecording = useCallback(function () {
|
|
12729
12733
|
setIsRecording(true);
|
|
12730
12734
|
}, []);
|
|
@@ -12737,7 +12741,7 @@ function VideoSignatureContextProvider(_a) {
|
|
|
12737
12741
|
recordingLock.current = true;
|
|
12738
12742
|
(function () {
|
|
12739
12743
|
return __awaiter(_this, void 0, void 0, function () {
|
|
12740
|
-
var stream;
|
|
12744
|
+
var stream, tracks, audioTrack;
|
|
12741
12745
|
return __generator(this, function (_a) {
|
|
12742
12746
|
switch (_a.label) {
|
|
12743
12747
|
case 0:
|
|
@@ -12755,8 +12759,12 @@ function VideoSignatureContextProvider(_a) {
|
|
|
12755
12759
|
_a.label = 2;
|
|
12756
12760
|
case 2:
|
|
12757
12761
|
startRecordingVideo();
|
|
12762
|
+
if (captureAudio) startRecordingAudio();
|
|
12758
12763
|
stream = outputCanvas.current.captureStream(24 /* fps */);
|
|
12759
|
-
|
|
12764
|
+
tracks = [stream.getVideoTracks()[0]];
|
|
12765
|
+
audioTrack = audioStream.getAudioTracks()[0];
|
|
12766
|
+
if (audioTrack) tracks.push(audioTrack);
|
|
12767
|
+
signatureRecorder.current = new MediaRecorder(new MediaStream(tracks), {
|
|
12760
12768
|
videoBitsPerSecond: 270000
|
|
12761
12769
|
});
|
|
12762
12770
|
signatureRecorder.current.start();
|
|
@@ -12779,7 +12787,7 @@ function VideoSignatureContextProvider(_a) {
|
|
|
12779
12787
|
});
|
|
12780
12788
|
});
|
|
12781
12789
|
})();
|
|
12782
|
-
}, [isRecording,
|
|
12790
|
+
}, [audioStream, captureAudio, isRecording, startRecordingAudio, startRecordingVideo]);
|
|
12783
12791
|
var animationFrame = useRef(0);
|
|
12784
12792
|
useEffect(function () {
|
|
12785
12793
|
if (!signaturePad.current || !videoRef.current || !outputCanvas.current || !camera || !isRecording || !isRecordingVideo) return;
|
|
@@ -12827,12 +12835,13 @@ function VideoSignatureContextProvider(_a) {
|
|
|
12827
12835
|
setSignatureDataUrl(imageUrl);
|
|
12828
12836
|
setSignatureData(signatureDataToIdmissionFormat(signaturePad.current, imageUrl));
|
|
12829
12837
|
stopRecordingVideo();
|
|
12838
|
+
stopRecordingAudio();
|
|
12830
12839
|
(_a = signatureRecorder.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
12831
12840
|
return [2 /*return*/];
|
|
12832
12841
|
}
|
|
12833
12842
|
});
|
|
12834
12843
|
});
|
|
12835
|
-
}, [stopRecordingVideo]);
|
|
12844
|
+
}, [stopRecordingAudio, stopRecordingVideo]);
|
|
12836
12845
|
var value = useMemo(function () {
|
|
12837
12846
|
return {
|
|
12838
12847
|
startRecording: startRecording,
|
|
@@ -13084,44 +13093,50 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
13084
13093
|
customOverlayContent = _a.customOverlayContent,
|
|
13085
13094
|
_d = _a.skipSuccessScreen,
|
|
13086
13095
|
skipSuccessScreen = _d === void 0 ? false : _d,
|
|
13087
|
-
_e = _a.
|
|
13088
|
-
|
|
13096
|
+
_e = _a.captureAudio,
|
|
13097
|
+
captureAudio = _e === void 0 ? false : _e,
|
|
13098
|
+
_f = _a.allowSignatureAfterLivenessCheckFailure,
|
|
13099
|
+
allowSignatureAfterLivenessCheckFailure = _f === void 0 ? false : _f,
|
|
13089
13100
|
faceLivenessProps = _a.faceLivenessProps,
|
|
13090
|
-
|
|
13091
|
-
assets =
|
|
13092
|
-
|
|
13093
|
-
classNames =
|
|
13094
|
-
|
|
13095
|
-
colors =
|
|
13096
|
-
|
|
13097
|
-
verbiage =
|
|
13098
|
-
|
|
13099
|
-
debugMode =
|
|
13100
|
-
var
|
|
13101
|
-
selfieImage =
|
|
13102
|
-
setSelfieImage =
|
|
13103
|
-
setSignatureData =
|
|
13104
|
-
setSignatureVideoUrl =
|
|
13105
|
-
logSelfieCaptureAttempt =
|
|
13106
|
-
var
|
|
13101
|
+
_g = _a.assets,
|
|
13102
|
+
assets = _g === void 0 ? {} : _g,
|
|
13103
|
+
_h = _a.classNames,
|
|
13104
|
+
classNames = _h === void 0 ? {} : _h,
|
|
13105
|
+
_j = _a.colors,
|
|
13106
|
+
colors = _j === void 0 ? {} : _j,
|
|
13107
|
+
_k = _a.verbiage,
|
|
13108
|
+
verbiage = _k === void 0 ? {} : _k,
|
|
13109
|
+
_l = _a.debugMode,
|
|
13110
|
+
debugMode = _l === void 0 ? false : _l;
|
|
13111
|
+
var _m = useContext(SubmissionContext),
|
|
13112
|
+
selfieImage = _m.selfieImage,
|
|
13113
|
+
setSelfieImage = _m.setSelfieImage,
|
|
13114
|
+
setSignatureData = _m.setSignatureData,
|
|
13115
|
+
setSignatureVideoUrl = _m.setSignatureVideoUrl,
|
|
13116
|
+
logSelfieCaptureAttempt = _m.logSelfieCaptureAttempt;
|
|
13117
|
+
var _o = useCameraStore(useShallow(function (state) {
|
|
13107
13118
|
return {
|
|
13108
13119
|
cameraAccessDenied: state.cameraAccessDenied,
|
|
13109
13120
|
requestCameraAccess: state.requestCameraAccess,
|
|
13110
|
-
releaseCameraAccess: state.releaseCameraAccess
|
|
13121
|
+
releaseCameraAccess: state.releaseCameraAccess,
|
|
13122
|
+
requestMicrophoneAccess: state.requestMicrophoneAccess,
|
|
13123
|
+
releaseMicrophoneAccess: state.releaseMicrophoneAccess
|
|
13111
13124
|
};
|
|
13112
13125
|
})),
|
|
13113
|
-
cameraAccessDenied =
|
|
13114
|
-
requestCameraAccess =
|
|
13115
|
-
releaseCameraAccess =
|
|
13116
|
-
|
|
13117
|
-
|
|
13118
|
-
|
|
13126
|
+
cameraAccessDenied = _o.cameraAccessDenied,
|
|
13127
|
+
requestCameraAccess = _o.requestCameraAccess,
|
|
13128
|
+
releaseCameraAccess = _o.releaseCameraAccess,
|
|
13129
|
+
requestMicrophoneAccess = _o.requestMicrophoneAccess,
|
|
13130
|
+
releaseMicrophoneAccess = _o.releaseMicrophoneAccess;
|
|
13131
|
+
var _p = useState('CHECKING_LIVENESS'),
|
|
13132
|
+
captureState = _p[0],
|
|
13133
|
+
setCaptureState = _p[1];
|
|
13119
13134
|
var operationStartedAt = useRef();
|
|
13120
13135
|
var captureStartedAt = useRef();
|
|
13121
13136
|
var captureEndedAt = useRef();
|
|
13122
|
-
var
|
|
13123
|
-
start =
|
|
13124
|
-
stop =
|
|
13137
|
+
var _q = useContext(SelfieGuidanceModelsContext),
|
|
13138
|
+
start = _q.start,
|
|
13139
|
+
stop = _q.stop;
|
|
13125
13140
|
useEffect(function () {
|
|
13126
13141
|
operationStartedAt.current = new Date();
|
|
13127
13142
|
}, []);
|
|
@@ -13157,9 +13172,9 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
13157
13172
|
setSelfieImage(selfieFromRequest);
|
|
13158
13173
|
}
|
|
13159
13174
|
}, [logCaptureMetadata, onFaceLivenessSuccessProp, selfieImage, setSelfieImage]);
|
|
13160
|
-
var
|
|
13161
|
-
signatureImageUrl =
|
|
13162
|
-
setSignatureImageUrl =
|
|
13175
|
+
var _r = useState(null),
|
|
13176
|
+
signatureImageUrl = _r[0],
|
|
13177
|
+
setSignatureImageUrl = _r[1];
|
|
13163
13178
|
var onSignatureCaptureCompleted = useCallback(function (videoData, signatureData, signatureImageData) {
|
|
13164
13179
|
setSignatureData(signatureData);
|
|
13165
13180
|
setSignatureVideoUrl(URL.createObjectURL(videoData));
|
|
@@ -13170,18 +13185,20 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
13170
13185
|
var onSignatureCaptureFacesNotDetected = useCallback(function () {
|
|
13171
13186
|
setCaptureState('CHECKING_LIVENESS');
|
|
13172
13187
|
}, []);
|
|
13173
|
-
var
|
|
13174
|
-
attempt =
|
|
13175
|
-
setAttempt =
|
|
13188
|
+
var _s = useState(0),
|
|
13189
|
+
attempt = _s[0],
|
|
13190
|
+
setAttempt = _s[1];
|
|
13176
13191
|
var onExit = useCallback(function () {
|
|
13177
13192
|
releaseCameraAccess();
|
|
13193
|
+
releaseMicrophoneAccess();
|
|
13178
13194
|
setAttempt(function (n) {
|
|
13179
13195
|
return n + 1;
|
|
13180
13196
|
});
|
|
13181
13197
|
setCaptureState('CHECKING_LIVENESS');
|
|
13182
13198
|
onExitCapture === null || onExitCapture === void 0 ? void 0 : onExitCapture();
|
|
13183
|
-
requestCameraAccess();
|
|
13184
|
-
|
|
13199
|
+
void requestCameraAccess();
|
|
13200
|
+
if (captureAudio) void requestMicrophoneAccess();
|
|
13201
|
+
}, [captureAudio, onExitCapture, releaseCameraAccess, releaseMicrophoneAccess, requestCameraAccess, requestMicrophoneAccess]);
|
|
13185
13202
|
var onRetry = useCallback(function () {
|
|
13186
13203
|
onRetryClicked === null || onRetryClicked === void 0 ? void 0 : onRetryClicked();
|
|
13187
13204
|
onExit();
|
|
@@ -13215,7 +13232,9 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
13215
13232
|
onLoadingOverlayDismissed === null || onLoadingOverlayDismissed === void 0 ? void 0 : onLoadingOverlayDismissed();
|
|
13216
13233
|
faceLivenessOnLoadingOverlayDismissed === null || faceLivenessOnLoadingOverlayDismissed === void 0 ? void 0 : faceLivenessOnLoadingOverlayDismissed();
|
|
13217
13234
|
}, [faceLivenessOnLoadingOverlayDismissed, onLoadingOverlayDismissed]);
|
|
13218
|
-
return /*#__PURE__*/React__default.createElement(VideoSignatureContextProvider,
|
|
13235
|
+
return /*#__PURE__*/React__default.createElement(VideoSignatureContextProvider, {
|
|
13236
|
+
captureAudio: captureAudio
|
|
13237
|
+
}, /*#__PURE__*/React__default.createElement(PageContainer, {
|
|
13219
13238
|
className: "flex ".concat((_b = classNames === null || classNames === void 0 ? void 0 : classNames.container) !== null && _b !== void 0 ? _b : '')
|
|
13220
13239
|
}, /*#__PURE__*/React__default.createElement(CameraVideoTag, {
|
|
13221
13240
|
className: classNames.cameraFeed
|
|
@@ -14542,6 +14561,7 @@ function CompositeWizard(_a) {
|
|
|
14542
14561
|
return /*#__PURE__*/React__default.createElement(CameraStoreProvider, {
|
|
14543
14562
|
preferIphoneContinuityCamera: false,
|
|
14544
14563
|
preferFrontFacingCamera: true,
|
|
14564
|
+
requireMicrophoneAccess: videoSignatureCaptureProps.captureAudio,
|
|
14545
14565
|
maxVideoWidth: 1280,
|
|
14546
14566
|
maxFps: 30,
|
|
14547
14567
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
@@ -16798,21 +16818,23 @@ var SignatureKYC = function SignatureKYC(_a) {
|
|
|
16798
16818
|
customOverlayContent = _a.customOverlayContent,
|
|
16799
16819
|
_d = _a.skipSuccessScreen,
|
|
16800
16820
|
skipSuccessScreen = _d === void 0 ? false : _d,
|
|
16821
|
+
_e = _a.captureAudio,
|
|
16822
|
+
captureAudio = _e === void 0 ? false : _e,
|
|
16801
16823
|
idCardForFaceMatch = _a.idCardForFaceMatch,
|
|
16802
|
-
|
|
16803
|
-
modelLoadTimeoutMs =
|
|
16804
|
-
|
|
16805
|
-
allowSignatureAfterLivenessCheckFailure =
|
|
16824
|
+
_f = _a.modelLoadTimeoutMs,
|
|
16825
|
+
modelLoadTimeoutMs = _f === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _f,
|
|
16826
|
+
_g = _a.allowSignatureAfterLivenessCheckFailure,
|
|
16827
|
+
allowSignatureAfterLivenessCheckFailure = _g === void 0 ? false : _g,
|
|
16806
16828
|
faceLivenessProps = _a.faceLivenessProps,
|
|
16807
|
-
|
|
16808
|
-
theme =
|
|
16829
|
+
_h = _a.theme,
|
|
16830
|
+
theme = _h === void 0 ? 'default' : _h,
|
|
16809
16831
|
classNames = _a.classNames,
|
|
16810
16832
|
colors = _a.colors,
|
|
16811
16833
|
verbiage = _a.verbiage,
|
|
16812
16834
|
geolocationEnabled = _a.geolocationEnabled,
|
|
16813
16835
|
geolocationRequired = _a.geolocationRequired,
|
|
16814
|
-
|
|
16815
|
-
debugMode =
|
|
16836
|
+
_j = _a.debugMode,
|
|
16837
|
+
debugMode = _j === void 0 ? false : _j;
|
|
16816
16838
|
useLanguage(lang);
|
|
16817
16839
|
useDebugLogging(debugMode);
|
|
16818
16840
|
return /*#__PURE__*/React__default.createElement(AuthProvider, {
|
|
@@ -16849,6 +16871,7 @@ var SignatureKYC = function SignatureKYC(_a) {
|
|
|
16849
16871
|
onLoadingOverlayDismissed: onLoadingOverlayDismissed,
|
|
16850
16872
|
loadingOverlayMode: loadingOverlayMode,
|
|
16851
16873
|
skipSuccessScreen: skipSuccessScreen,
|
|
16874
|
+
captureAudio: captureAudio,
|
|
16852
16875
|
modelLoadTimeoutMs: modelLoadTimeoutMs,
|
|
16853
16876
|
faceLivenessProps: faceLivenessProps,
|
|
16854
16877
|
allowSignatureAfterLivenessCheckFailure: allowSignatureAfterLivenessCheckFailure,
|
|
@@ -16859,7 +16882,7 @@ var SignatureKYC = function SignatureKYC(_a) {
|
|
|
16859
16882
|
onModelError: onModelError,
|
|
16860
16883
|
onUserCancel: onUserCancel
|
|
16861
16884
|
};
|
|
16862
|
-
}, [customOverlayContent, onLoadingOverlayDismissed, loadingOverlayMode, skipSuccessScreen, modelLoadTimeoutMs, faceLivenessProps, allowSignatureAfterLivenessCheckFailure, classNames, colors, debugMode, verbiage, onModelError, onUserCancel])
|
|
16885
|
+
}, [customOverlayContent, onLoadingOverlayDismissed, loadingOverlayMode, skipSuccessScreen, captureAudio, modelLoadTimeoutMs, faceLivenessProps, allowSignatureAfterLivenessCheckFailure, classNames, colors, debugMode, verbiage, onModelError, onUserCancel])
|
|
16863
16886
|
}))));
|
|
16864
16887
|
};
|
|
16865
16888
|
|