@ekyc_qoobiss/qbs-ect-cmp 3.6.83 → 3.6.85
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/cjs/{TranslationUtils-6fdf7b55.js → TranslationUtils-48d56242.js} +2 -8
- package/dist/cjs/agreement-check_18.cjs.entry.js +34 -19
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/qbs-ect-cmp.cjs.js +1 -1
- package/dist/cjs/random-actions.cjs.entry.js +1 -1
- package/dist/collection/components/common/capture-error/capture-error.js +19 -2
- package/dist/collection/components/common/how-to-info/how-to-info.js +2 -9
- package/dist/collection/components/flow/process-id/process-id.js +14 -4
- package/dist/collection/components/flow/user-liveness/user-liveness.js +12 -4
- package/dist/collection/helpers/ApiCall.js +2 -8
- package/dist/collection/utils/utils.js +4 -0
- package/dist/esm/{TranslationUtils-57159270.js → TranslationUtils-ecf807c7.js} +2 -8
- package/dist/esm/agreement-check_18.entry.js +34 -19
- package/dist/esm/loader.js +1 -1
- package/dist/esm/qbs-ect-cmp.js +1 -1
- package/dist/esm/random-actions.entry.js +1 -1
- package/dist/qbs-ect-cmp/{p-4b40acc5.entry.js → p-60979a92.entry.js} +2 -2
- package/dist/qbs-ect-cmp/{p-952ea10c.entry.js → p-8339bc81.entry.js} +1 -1
- package/dist/qbs-ect-cmp/{p-8552ab44.js → p-8a9ec85f.js} +1 -1
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/common/capture-error/capture-error.d.ts +1 -0
- package/dist/types/components.d.ts +2 -0
- package/dist/types/helpers/ApiCall.d.ts +1 -2
- package/dist/types/models/CaptureFlow.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +2 -1
- package/package.json +1 -1
|
@@ -350,12 +350,6 @@ class ApiCall {
|
|
|
350
350
|
}
|
|
351
351
|
constructor() {
|
|
352
352
|
this.serviceErrors = ['Service Unavailable', 'Unauthorized'];
|
|
353
|
-
this.toBase64 = (file) => new Promise((resolve, reject) => {
|
|
354
|
-
const reader = new FileReader();
|
|
355
|
-
reader.readAsDataURL(file);
|
|
356
|
-
reader.onload = () => resolve(reader.result);
|
|
357
|
-
reader.onerror = error => reject(error);
|
|
358
|
-
});
|
|
359
353
|
this.urls = new ApiUrls();
|
|
360
354
|
}
|
|
361
355
|
// private async http2<T>(method: string, url: string, data: string): Promise<T> {
|
|
@@ -507,11 +501,11 @@ class ApiCall {
|
|
|
507
501
|
state.modelsPath = jsonResp.modelsPath;
|
|
508
502
|
return true;
|
|
509
503
|
}
|
|
510
|
-
async UploadFileForRequestB64(requestId, type,
|
|
504
|
+
async UploadFileForRequestB64(requestId, type, b64Data) {
|
|
511
505
|
let data = {
|
|
512
506
|
requestId: requestId,
|
|
513
507
|
type: type,
|
|
514
|
-
data:
|
|
508
|
+
data: b64Data,
|
|
515
509
|
};
|
|
516
510
|
let respJson = await this.post(this.urls.UploadCapture, JSON.stringify(data));
|
|
517
511
|
if (state.debug)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-41696e0e.js');
|
|
6
|
-
const TranslationUtils = require('./TranslationUtils-
|
|
6
|
+
const TranslationUtils = require('./TranslationUtils-48d56242.js');
|
|
7
7
|
|
|
8
8
|
const agreementCheckCss = "";
|
|
9
9
|
|
|
@@ -1522,6 +1522,10 @@ const blobToBase64 = (blob) => {
|
|
|
1522
1522
|
reader.readAsDataURL(blob);
|
|
1523
1523
|
});
|
|
1524
1524
|
};
|
|
1525
|
+
const base64Size = (base64Data) => {
|
|
1526
|
+
const kb = Math.ceil((base64Data.length * 6) / 8 / 1000);
|
|
1527
|
+
return kb / 1000;
|
|
1528
|
+
};
|
|
1525
1529
|
const delay = ms => new Promise(res => setTimeout(res, ms));
|
|
1526
1530
|
const getLogMessage = (param_req_id = '', param_redirect_id = '', param_token = '') => {
|
|
1527
1531
|
return {
|
|
@@ -4725,7 +4729,7 @@ CameraError.style = cameraErrorCss;
|
|
|
4725
4729
|
const captureErrorCss = "";
|
|
4726
4730
|
|
|
4727
4731
|
const CaptureError = class {
|
|
4728
|
-
constructor(hostRef) { index.registerInstance(this, hostRef); this.eventCaptureErrorDone = index.createEvent(this, "captureErrorDone", 7); this.type = undefined; this.reason = undefined; this.buttonEnabled = undefined; this.buttonText = undefined; }
|
|
4732
|
+
constructor(hostRef) { index.registerInstance(this, hostRef); this.eventCaptureErrorDone = index.createEvent(this, "captureErrorDone", 7); this.type = undefined; this.reason = undefined; this.error = undefined; this.buttonEnabled = undefined; this.buttonText = undefined; }
|
|
4729
4733
|
async componentWillLoad() {
|
|
4730
4734
|
this.translations = await TranslationUtils.Translations.getValues();
|
|
4731
4735
|
this.buttonEnabled = false;
|
|
@@ -4767,7 +4771,7 @@ const CaptureError = class {
|
|
|
4767
4771
|
}
|
|
4768
4772
|
}
|
|
4769
4773
|
render() {
|
|
4770
|
-
return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("h1", { class: "color-red" }, this.titleR1), index.h("h1", { class: "color-red" }, this.titleR2), index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR1), index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR2), TranslationUtils.state.debug ? index.h("p", { class: "font-size-1" }, this.reason) : null), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
4774
|
+
return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("h1", { class: "color-red" }, this.titleR1), index.h("h1", { class: "color-red" }, this.titleR2), index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR1), index.h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR2), TranslationUtils.state.debug ? index.h("p", { class: "font-size-1" }, `${this.reason} ${this.error}`) : null), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
4771
4775
|
}
|
|
4772
4776
|
};
|
|
4773
4777
|
CaptureError.style = captureErrorCss;
|
|
@@ -4885,15 +4889,8 @@ const HowToInfo = class {
|
|
|
4885
4889
|
this.buttonText = this.translations.HowToValues.IdButton;
|
|
4886
4890
|
}
|
|
4887
4891
|
render() {
|
|
4888
|
-
let
|
|
4889
|
-
|
|
4890
|
-
let rowClass = 'row';
|
|
4891
|
-
if (TranslationUtils.state.flowStatus == TranslationUtils.FlowStatus.IDBACKHOWTO) {
|
|
4892
|
-
titleClass = 'color-white';
|
|
4893
|
-
bgDemo = 'container bg-black';
|
|
4894
|
-
rowClass = 'container-video';
|
|
4895
|
-
}
|
|
4896
|
-
return (index.h("div", { class: bgDemo }, index.h("div", { class: rowClass, hidden: this.imageLoaded == false }, index.h("div", { class: "div-ci align-center", hidden: this.showVideo }, index.h("img", { ref: el => (this.image = el) })), index.h("div", { hidden: this.showVideo == false }, index.h("video", { id: "howTo", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { class: "text-center" }, index.h("h1", { class: titleClass }, this.topTitle), index.h("p", { class: "font-size-2", hidden: this.subTitle == '' }, this.subTitle)), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick(), hidden: this.showVideo == true }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
4892
|
+
let howTo = this.showVideo == true ? (index.h("div", { class: "container bg-black" }, index.h("div", { class: "container-video" }, index.h("div", null, index.h("video", { id: "howTo", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { class: "capture-title" }, index.h("h1", { class: "color-white text-center" }, this.topTitle), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))) : (index.h("div", { class: "container" }, index.h("div", { class: "row", hidden: this.imageLoaded == false }, index.h("div", { class: "div-ci align-center" }, index.h("img", { ref: el => (this.image = el) })), index.h("div", { class: "text-center" }, index.h("h1", { class: "color-black-2" }, this.topTitle), index.h("p", { class: "font-size-2", hidden: this.subTitle == '' }, this.subTitle)), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
4893
|
+
return howTo;
|
|
4897
4894
|
}
|
|
4898
4895
|
};
|
|
4899
4896
|
HowToInfo.style = howToInfoCss;
|
|
@@ -5252,7 +5249,7 @@ function v4(options, buf, offset) {
|
|
|
5252
5249
|
}
|
|
5253
5250
|
|
|
5254
5251
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
5255
|
-
const version$1 = "3.6.
|
|
5252
|
+
const version$1 = "3.6.85";
|
|
5256
5253
|
const description = "Person Identification Component";
|
|
5257
5254
|
const main = "./dist/index.cjs.js";
|
|
5258
5255
|
const module$1 = "./dist/index.js";
|
|
@@ -8719,6 +8716,8 @@ const ProcessId = class {
|
|
|
8719
8716
|
recName: 'idVideo.',
|
|
8720
8717
|
photoType: CaptureUploadTypes.IdFront,
|
|
8721
8718
|
recType: CaptureUploadTypes.IdFrontVideo,
|
|
8719
|
+
imageSize: 0,
|
|
8720
|
+
videoSize: 0,
|
|
8722
8721
|
};
|
|
8723
8722
|
}
|
|
8724
8723
|
else if (this.mode == 'back') {
|
|
@@ -8728,6 +8727,8 @@ const ProcessId = class {
|
|
|
8728
8727
|
recName: 'idBackVideo.',
|
|
8729
8728
|
photoType: CaptureUploadTypes.IdBack,
|
|
8730
8729
|
recType: CaptureUploadTypes.IdBackVideo,
|
|
8730
|
+
imageSize: 0,
|
|
8731
|
+
videoSize: 0,
|
|
8731
8732
|
};
|
|
8732
8733
|
}
|
|
8733
8734
|
else if (this.mode == 'tilt') {
|
|
@@ -8737,6 +8738,8 @@ const ProcessId = class {
|
|
|
8737
8738
|
recName: 'idTiltVideo.',
|
|
8738
8739
|
photoType: CaptureUploadTypes.None,
|
|
8739
8740
|
recType: CaptureUploadTypes.TiltVideo,
|
|
8741
|
+
imageSize: 0,
|
|
8742
|
+
videoSize: 0,
|
|
8740
8743
|
};
|
|
8741
8744
|
}
|
|
8742
8745
|
if (TranslationUtils.state.debug)
|
|
@@ -8769,7 +8772,9 @@ const ProcessId = class {
|
|
|
8769
8772
|
}
|
|
8770
8773
|
try {
|
|
8771
8774
|
let frontCapture = new File([idPhoto], this.flow.fileName, { type: 'image/png' });
|
|
8772
|
-
|
|
8775
|
+
let b64Data = await blobToBase64(frontCapture);
|
|
8776
|
+
this.flow.imageSize = base64Size(b64Data);
|
|
8777
|
+
var uploadResult = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.photoType, b64Data);
|
|
8773
8778
|
if (TranslationUtils.state.debug)
|
|
8774
8779
|
console.log('process-id | captureIdImage | uploadResult: ' + uploadResult);
|
|
8775
8780
|
if (uploadResult.isValid) {
|
|
@@ -8801,7 +8806,9 @@ const ProcessId = class {
|
|
|
8801
8806
|
}
|
|
8802
8807
|
let mimeType = idRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
8803
8808
|
let captureRec = new File([idRecording], this.flow.recName + mimeType.extension, { type: mimeType.type });
|
|
8804
|
-
|
|
8809
|
+
let b64Data = await blobToBase64(captureRec);
|
|
8810
|
+
this.flow.videoSize = base64Size(b64Data);
|
|
8811
|
+
var uploadResult = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.recType, b64Data);
|
|
8805
8812
|
if (TranslationUtils.state.debug)
|
|
8806
8813
|
console.log('process-id | capturedIdRecording | uploadResult: ' + uploadResult);
|
|
8807
8814
|
if (uploadResult.saved) {
|
|
@@ -8855,7 +8862,7 @@ const ProcessId = class {
|
|
|
8855
8862
|
}
|
|
8856
8863
|
}
|
|
8857
8864
|
render() {
|
|
8858
|
-
let error = index.h("capture-error", { type: "ID", reason: this.errorReason });
|
|
8865
|
+
let error = index.h("capture-error", { type: "ID", reason: this.errorReason, error: `image:${this.flow.imageSize}mb video:${this.flow.videoSize}mb` });
|
|
8859
8866
|
let capture = index.h("id-capture", null);
|
|
8860
8867
|
if (this.showInvalid || this.showTimeout) {
|
|
8861
8868
|
return error;
|
|
@@ -9116,6 +9123,8 @@ const UserLiveness = class {
|
|
|
9116
9123
|
recName: 'selfieVideo.',
|
|
9117
9124
|
photoType: CaptureUploadTypes.Selfie,
|
|
9118
9125
|
recType: CaptureUploadTypes.SelfieVideo,
|
|
9126
|
+
imageSize: 0,
|
|
9127
|
+
videoSize: 0,
|
|
9119
9128
|
};
|
|
9120
9129
|
}
|
|
9121
9130
|
else if (this.mode == 'selfieGesture') {
|
|
@@ -9125,6 +9134,8 @@ const UserLiveness = class {
|
|
|
9125
9134
|
recName: 'selfieTiltVideo.',
|
|
9126
9135
|
photoType: CaptureUploadTypes.None,
|
|
9127
9136
|
recType: CaptureUploadTypes.SelfieGestureVideo,
|
|
9137
|
+
imageSize: 0,
|
|
9138
|
+
videoSize: 0,
|
|
9128
9139
|
};
|
|
9129
9140
|
}
|
|
9130
9141
|
}
|
|
@@ -9151,7 +9162,9 @@ const UserLiveness = class {
|
|
|
9151
9162
|
}
|
|
9152
9163
|
try {
|
|
9153
9164
|
var uploadPhoto = new File([selfiePhoto], this.flow.fileName, { type: 'image/png' });
|
|
9154
|
-
let
|
|
9165
|
+
let b64Data = await blobToBase64(uploadPhoto);
|
|
9166
|
+
this.flow.imageSize = base64Size(b64Data);
|
|
9167
|
+
let photoUploaded = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.photoType, b64Data);
|
|
9155
9168
|
if (photoUploaded.isValid) {
|
|
9156
9169
|
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[photoUploaded.state];
|
|
9157
9170
|
}
|
|
@@ -9178,7 +9191,9 @@ const UserLiveness = class {
|
|
|
9178
9191
|
let mimeType = selfieRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
9179
9192
|
try {
|
|
9180
9193
|
let uploadRec = new File([selfieRecording], this.flow.recName + mimeType.extension, { type: mimeType.type });
|
|
9181
|
-
let
|
|
9194
|
+
let b64Data = await blobToBase64(uploadRec);
|
|
9195
|
+
this.flow.videoSize = base64Size(b64Data);
|
|
9196
|
+
let uplodDone = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.recType, b64Data);
|
|
9182
9197
|
if (uplodDone.saved) {
|
|
9183
9198
|
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[uplodDone.state];
|
|
9184
9199
|
}
|
|
@@ -9222,7 +9237,7 @@ const UserLiveness = class {
|
|
|
9222
9237
|
}
|
|
9223
9238
|
render() {
|
|
9224
9239
|
let capture = index.h("selfie-capture", null);
|
|
9225
|
-
let error = index.h("capture-error", { type: "LIVENESS", reason: this.errorReason });
|
|
9240
|
+
let error = index.h("capture-error", { type: "LIVENESS", reason: this.errorReason, error: `image:${this.flow.imageSize}mb video:${this.flow.videoSize}mb` });
|
|
9226
9241
|
if (this.showError || this.showTimeout) {
|
|
9227
9242
|
return error;
|
|
9228
9243
|
}
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["random-actions.cjs",[[0,"random-actions"]]],["agreement-check_18.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"lang_iso":[1537],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{"mode":[1],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"user-liveness",{"mode":[1],"showError":[32],"showTimeout":[32],"flow":[32]},[[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32],"buttonDisabled":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"how-to-info",{"showVideo":[32],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32],"demoVideo":[32],"image":[32],"imageLoaded":[32]}],[0,"landing-validation",{"warningText":[32],"buttonDisabled":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"code":[32],"canSend":[32]}],[0,"sms-send",{"buttonText":[32],"title":[32],"details":[32],"phoneNumber":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"state-transition"],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32],"scrollClass":[32]}],[0,"capture-error",{"type":[1],"reason":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
|
|
17
|
+
return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["random-actions.cjs",[[0,"random-actions"]]],["agreement-check_18.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"lang_iso":[1537],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{"mode":[1],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"user-liveness",{"mode":[1],"showError":[32],"showTimeout":[32],"flow":[32]},[[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32],"buttonDisabled":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"how-to-info",{"showVideo":[32],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32],"demoVideo":[32],"image":[32],"imageLoaded":[32]}],[0,"landing-validation",{"warningText":[32],"buttonDisabled":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"code":[32],"canSend":[32]}],[0,"sms-send",{"buttonText":[32],"title":[32],"details":[32],"phoneNumber":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"state-transition"],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32],"scrollClass":[32]}],[0,"capture-error",{"type":[1],"reason":[1],"error":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["random-actions.cjs",[[0,"random-actions"]]],["agreement-check_18.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"lang_iso":[1537],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{"mode":[1],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"user-liveness",{"mode":[1],"showError":[32],"showTimeout":[32],"flow":[32]},[[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32],"buttonDisabled":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"how-to-info",{"showVideo":[32],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32],"demoVideo":[32],"image":[32],"imageLoaded":[32]}],[0,"landing-validation",{"warningText":[32],"buttonDisabled":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"code":[32],"canSend":[32]}],[0,"sms-send",{"buttonText":[32],"title":[32],"details":[32],"phoneNumber":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"state-transition"],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32],"scrollClass":[32]}],[0,"capture-error",{"type":[1],"reason":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
|
|
20
|
+
return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["random-actions.cjs",[[0,"random-actions"]]],["agreement-check_18.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"phone_number":[1537],"lang_iso":[1537],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{"mode":[1],"showTimeout":[32],"showInvalid":[32],"flow":[32]},[[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"user-liveness",{"mode":[1],"showError":[32],"showTimeout":[32],"flow":[32]},[[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-info",{"agreementsChecked":[32],"termsChecked":[32],"openAgreements":[32],"openTerms":[32],"buttonDisabled":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{"title":[32],"description":[32],"buttonDisabled":[32],"demoVideo":[32]}],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"how-to-info",{"showVideo":[32],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32],"buttonEnabled":[32],"demoVideo":[32],"image":[32],"imageLoaded":[32]}],[0,"landing-validation",{"warningText":[32],"buttonDisabled":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32],"prefilledPhone":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"code":[32],"canSend":[32]}],[0,"sms-send",{"buttonText":[32],"title":[32],"details":[32],"phoneNumber":[32],"prefilledPhone":[32],"canSend":[32]}],[0,"state-transition"],[0,"id-capture",{"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32],"buttonEnabled":[32],"scrollClass":[32]}],[0,"capture-error",{"type":[1],"reason":[1],"error":[1],"buttonEnabled":[32],"buttonText":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-41696e0e.js');
|
|
6
|
-
const TranslationUtils = require('./TranslationUtils-
|
|
6
|
+
const TranslationUtils = require('./TranslationUtils-48d56242.js');
|
|
7
7
|
|
|
8
8
|
const randomActionsCss = "";
|
|
9
9
|
|
|
@@ -7,7 +7,7 @@ import store from '../../../helpers/store';
|
|
|
7
7
|
import { ApiCall } from '../../../helpers/ApiCall';
|
|
8
8
|
import { FlowStatus } from '../../../models/FlowStatus';
|
|
9
9
|
export class CaptureError {
|
|
10
|
-
constructor() { this.type = undefined; this.reason = undefined; this.buttonEnabled = undefined; this.buttonText = undefined; }
|
|
10
|
+
constructor() { this.type = undefined; this.reason = undefined; this.error = undefined; this.buttonEnabled = undefined; this.buttonText = undefined; }
|
|
11
11
|
async componentWillLoad() {
|
|
12
12
|
this.translations = await Translations.getValues();
|
|
13
13
|
this.buttonEnabled = false;
|
|
@@ -49,7 +49,7 @@ export class CaptureError {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
render() {
|
|
52
|
-
return (h("div", { class: "container" }, h("div", { class: "row" }, h("h1", { class: "color-red" }, this.titleR1), h("h1", { class: "color-red" }, this.titleR2), h("div", null, h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR1), h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR2), store.debug ? h("p", { class: "font-size-1" }, this.reason) : null), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
52
|
+
return (h("div", { class: "container" }, h("div", { class: "row" }, h("h1", { class: "color-red" }, this.titleR1), h("h1", { class: "color-red" }, this.titleR2), h("div", null, h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR1), h("p", { class: "color-red font-weight-bold font-size-25 mt-5" }, this.descriptionR2), store.debug ? h("p", { class: "font-size-1" }, `${this.reason} ${this.error}`) : null), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
53
53
|
}
|
|
54
54
|
static get is() { return "capture-error"; }
|
|
55
55
|
static get originalStyleUrls() {
|
|
@@ -97,6 +97,23 @@ export class CaptureError {
|
|
|
97
97
|
},
|
|
98
98
|
"attribute": "reason",
|
|
99
99
|
"reflect": false
|
|
100
|
+
},
|
|
101
|
+
"error": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"mutable": false,
|
|
104
|
+
"complexType": {
|
|
105
|
+
"original": "string",
|
|
106
|
+
"resolved": "string",
|
|
107
|
+
"references": {}
|
|
108
|
+
},
|
|
109
|
+
"required": false,
|
|
110
|
+
"optional": false,
|
|
111
|
+
"docs": {
|
|
112
|
+
"tags": [],
|
|
113
|
+
"text": ""
|
|
114
|
+
},
|
|
115
|
+
"attribute": "error",
|
|
116
|
+
"reflect": false
|
|
100
117
|
}
|
|
101
118
|
};
|
|
102
119
|
}
|
|
@@ -72,15 +72,8 @@ export class HowToInfo {
|
|
|
72
72
|
this.buttonText = this.translations.HowToValues.IdButton;
|
|
73
73
|
}
|
|
74
74
|
render() {
|
|
75
|
-
let
|
|
76
|
-
|
|
77
|
-
let rowClass = 'row';
|
|
78
|
-
if (store.flowStatus == FlowStatus.IDBACKHOWTO) {
|
|
79
|
-
titleClass = 'color-white';
|
|
80
|
-
bgDemo = 'container bg-black';
|
|
81
|
-
rowClass = 'container-video';
|
|
82
|
-
}
|
|
83
|
-
return (h("div", { class: bgDemo }, h("div", { class: rowClass, hidden: this.imageLoaded == false }, h("div", { class: "div-ci align-center", hidden: this.showVideo }, h("img", { ref: el => (this.image = el) })), h("div", { hidden: this.showVideo == false }, h("video", { id: "howTo", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { class: "text-center" }, h("h1", { class: titleClass }, this.topTitle), h("p", { class: "font-size-2", hidden: this.subTitle == '' }, this.subTitle)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick(), hidden: this.showVideo == true }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
75
|
+
let howTo = this.showVideo == true ? (h("div", { class: "container bg-black" }, h("div", { class: "container-video" }, h("div", null, h("video", { id: "howTo", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { class: "capture-title" }, h("h1", { class: "color-white text-center" }, this.topTitle), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))) : (h("div", { class: "container" }, h("div", { class: "row", hidden: this.imageLoaded == false }, h("div", { class: "div-ci align-center" }, h("img", { ref: el => (this.image = el) })), h("div", { class: "text-center" }, h("h1", { class: "color-black-2" }, this.topTitle), h("p", { class: "font-size-2", hidden: this.subTitle == '' }, this.subTitle)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick() }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
|
|
76
|
+
return howTo;
|
|
84
77
|
}
|
|
85
78
|
static get is() { return "how-to-info"; }
|
|
86
79
|
static get originalStyleUrls() {
|
|
@@ -3,7 +3,7 @@ import store from '../../../helpers/store';
|
|
|
3
3
|
import { Stream } from '../../../helpers/Stream';
|
|
4
4
|
import { FlowStatus } from '../../../models/FlowStatus';
|
|
5
5
|
import { FlowSteps } from '../../../models/FlowSteps';
|
|
6
|
-
import { delay, getLogMessage } from '../../../utils/utils';
|
|
6
|
+
import { base64Size, blobToBase64, delay, getLogMessage } from '../../../utils/utils';
|
|
7
7
|
import { BaseComponent } from '../../base-component';
|
|
8
8
|
import { CaptureUploadTypes } from '../../../models/CaptureFlow';
|
|
9
9
|
import { ApiCall } from '../../../helpers/ApiCall';
|
|
@@ -29,6 +29,8 @@ export class ProcessId {
|
|
|
29
29
|
recName: 'idVideo.',
|
|
30
30
|
photoType: CaptureUploadTypes.IdFront,
|
|
31
31
|
recType: CaptureUploadTypes.IdFrontVideo,
|
|
32
|
+
imageSize: 0,
|
|
33
|
+
videoSize: 0,
|
|
32
34
|
};
|
|
33
35
|
}
|
|
34
36
|
else if (this.mode == 'back') {
|
|
@@ -38,6 +40,8 @@ export class ProcessId {
|
|
|
38
40
|
recName: 'idBackVideo.',
|
|
39
41
|
photoType: CaptureUploadTypes.IdBack,
|
|
40
42
|
recType: CaptureUploadTypes.IdBackVideo,
|
|
43
|
+
imageSize: 0,
|
|
44
|
+
videoSize: 0,
|
|
41
45
|
};
|
|
42
46
|
}
|
|
43
47
|
else if (this.mode == 'tilt') {
|
|
@@ -47,6 +51,8 @@ export class ProcessId {
|
|
|
47
51
|
recName: 'idTiltVideo.',
|
|
48
52
|
photoType: CaptureUploadTypes.None,
|
|
49
53
|
recType: CaptureUploadTypes.TiltVideo,
|
|
54
|
+
imageSize: 0,
|
|
55
|
+
videoSize: 0,
|
|
50
56
|
};
|
|
51
57
|
}
|
|
52
58
|
if (store.debug)
|
|
@@ -79,7 +85,9 @@ export class ProcessId {
|
|
|
79
85
|
}
|
|
80
86
|
try {
|
|
81
87
|
let frontCapture = new File([idPhoto], this.flow.fileName, { type: 'image/png' });
|
|
82
|
-
|
|
88
|
+
let b64Data = await blobToBase64(frontCapture);
|
|
89
|
+
this.flow.imageSize = base64Size(b64Data);
|
|
90
|
+
var uploadResult = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.photoType, b64Data);
|
|
83
91
|
if (store.debug)
|
|
84
92
|
console.log('process-id | captureIdImage | uploadResult: ' + uploadResult);
|
|
85
93
|
if (uploadResult.isValid) {
|
|
@@ -111,7 +119,9 @@ export class ProcessId {
|
|
|
111
119
|
}
|
|
112
120
|
let mimeType = idRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
113
121
|
let captureRec = new File([idRecording], this.flow.recName + mimeType.extension, { type: mimeType.type });
|
|
114
|
-
|
|
122
|
+
let b64Data = await blobToBase64(captureRec);
|
|
123
|
+
this.flow.videoSize = base64Size(b64Data);
|
|
124
|
+
var uploadResult = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.recType, b64Data);
|
|
115
125
|
if (store.debug)
|
|
116
126
|
console.log('process-id | capturedIdRecording | uploadResult: ' + uploadResult);
|
|
117
127
|
if (uploadResult.saved) {
|
|
@@ -165,7 +175,7 @@ export class ProcessId {
|
|
|
165
175
|
}
|
|
166
176
|
}
|
|
167
177
|
render() {
|
|
168
|
-
let error = h("capture-error", { type: "ID", reason: this.errorReason });
|
|
178
|
+
let error = h("capture-error", { type: "ID", reason: this.errorReason, error: `image:${this.flow.imageSize}mb video:${this.flow.videoSize}mb` });
|
|
169
179
|
let capture = h("id-capture", null);
|
|
170
180
|
if (this.showInvalid || this.showTimeout) {
|
|
171
181
|
return error;
|
|
@@ -3,7 +3,7 @@ import store from '../../../helpers/store';
|
|
|
3
3
|
import { Stream } from '../../../helpers/Stream';
|
|
4
4
|
import { FlowStatus } from '../../../models/FlowStatus';
|
|
5
5
|
import { FlowSteps } from '../../../models/FlowSteps';
|
|
6
|
-
import { delay, getLogMessage } from '../../../utils/utils';
|
|
6
|
+
import { base64Size, blobToBase64, delay, getLogMessage } from '../../../utils/utils';
|
|
7
7
|
import { BaseComponent } from '../../base-component';
|
|
8
8
|
import { CaptureUploadTypes } from '../../../models/CaptureFlow';
|
|
9
9
|
import { ApiCall } from '../../../helpers/ApiCall';
|
|
@@ -25,6 +25,8 @@ export class UserLiveness {
|
|
|
25
25
|
recName: 'selfieVideo.',
|
|
26
26
|
photoType: CaptureUploadTypes.Selfie,
|
|
27
27
|
recType: CaptureUploadTypes.SelfieVideo,
|
|
28
|
+
imageSize: 0,
|
|
29
|
+
videoSize: 0,
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
32
|
else if (this.mode == 'selfieGesture') {
|
|
@@ -34,6 +36,8 @@ export class UserLiveness {
|
|
|
34
36
|
recName: 'selfieTiltVideo.',
|
|
35
37
|
photoType: CaptureUploadTypes.None,
|
|
36
38
|
recType: CaptureUploadTypes.SelfieGestureVideo,
|
|
39
|
+
imageSize: 0,
|
|
40
|
+
videoSize: 0,
|
|
37
41
|
};
|
|
38
42
|
}
|
|
39
43
|
}
|
|
@@ -60,7 +64,9 @@ export class UserLiveness {
|
|
|
60
64
|
}
|
|
61
65
|
try {
|
|
62
66
|
var uploadPhoto = new File([selfiePhoto], this.flow.fileName, { type: 'image/png' });
|
|
63
|
-
let
|
|
67
|
+
let b64Data = await blobToBase64(uploadPhoto);
|
|
68
|
+
this.flow.imageSize = base64Size(b64Data);
|
|
69
|
+
let photoUploaded = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.photoType, b64Data);
|
|
64
70
|
if (photoUploaded.isValid) {
|
|
65
71
|
store.flowStatus = FlowStatus[photoUploaded.state];
|
|
66
72
|
}
|
|
@@ -87,7 +93,9 @@ export class UserLiveness {
|
|
|
87
93
|
let mimeType = selfieRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
88
94
|
try {
|
|
89
95
|
let uploadRec = new File([selfieRecording], this.flow.recName + mimeType.extension, { type: mimeType.type });
|
|
90
|
-
let
|
|
96
|
+
let b64Data = await blobToBase64(uploadRec);
|
|
97
|
+
this.flow.videoSize = base64Size(b64Data);
|
|
98
|
+
let uplodDone = await ApiCall.instance.UploadFileForRequestB64(store.requestId, this.flow.recType, b64Data);
|
|
91
99
|
if (uplodDone.saved) {
|
|
92
100
|
store.flowStatus = FlowStatus[uplodDone.state];
|
|
93
101
|
}
|
|
@@ -131,7 +139,7 @@ export class UserLiveness {
|
|
|
131
139
|
}
|
|
132
140
|
render() {
|
|
133
141
|
let capture = h("selfie-capture", null);
|
|
134
|
-
let error = h("capture-error", { type: "LIVENESS", reason: this.errorReason });
|
|
142
|
+
let error = h("capture-error", { type: "LIVENESS", reason: this.errorReason, error: `image:${this.flow.imageSize}mb video:${this.flow.videoSize}mb` });
|
|
135
143
|
if (this.showError || this.showTimeout) {
|
|
136
144
|
return error;
|
|
137
145
|
}
|
|
@@ -12,12 +12,6 @@ export class ApiCall {
|
|
|
12
12
|
}
|
|
13
13
|
constructor() {
|
|
14
14
|
this.serviceErrors = ['Service Unavailable', 'Unauthorized'];
|
|
15
|
-
this.toBase64 = (file) => new Promise((resolve, reject) => {
|
|
16
|
-
const reader = new FileReader();
|
|
17
|
-
reader.readAsDataURL(file);
|
|
18
|
-
reader.onload = () => resolve(reader.result);
|
|
19
|
-
reader.onerror = error => reject(error);
|
|
20
|
-
});
|
|
21
15
|
this.urls = new ApiUrls();
|
|
22
16
|
}
|
|
23
17
|
// private async http2<T>(method: string, url: string, data: string): Promise<T> {
|
|
@@ -169,11 +163,11 @@ export class ApiCall {
|
|
|
169
163
|
store.modelsPath = jsonResp.modelsPath;
|
|
170
164
|
return true;
|
|
171
165
|
}
|
|
172
|
-
async UploadFileForRequestB64(requestId, type,
|
|
166
|
+
async UploadFileForRequestB64(requestId, type, b64Data) {
|
|
173
167
|
let data = {
|
|
174
168
|
requestId: requestId,
|
|
175
169
|
type: type,
|
|
176
|
-
data:
|
|
170
|
+
data: b64Data,
|
|
177
171
|
};
|
|
178
172
|
let respJson = await this.post(this.urls.UploadCapture, JSON.stringify(data));
|
|
179
173
|
if (store.debug)
|
|
@@ -10,6 +10,10 @@ export const blobToBase64 = (blob) => {
|
|
|
10
10
|
reader.readAsDataURL(blob);
|
|
11
11
|
});
|
|
12
12
|
};
|
|
13
|
+
export const base64Size = (base64Data) => {
|
|
14
|
+
const kb = Math.ceil((base64Data.length * 6) / 8 / 1000);
|
|
15
|
+
return kb / 1000;
|
|
16
|
+
};
|
|
13
17
|
export const delay = ms => new Promise(res => setTimeout(res, ms));
|
|
14
18
|
export const getLogMessage = (param_req_id = '', param_redirect_id = '', param_token = '') => {
|
|
15
19
|
return {
|
|
@@ -348,12 +348,6 @@ class ApiCall {
|
|
|
348
348
|
}
|
|
349
349
|
constructor() {
|
|
350
350
|
this.serviceErrors = ['Service Unavailable', 'Unauthorized'];
|
|
351
|
-
this.toBase64 = (file) => new Promise((resolve, reject) => {
|
|
352
|
-
const reader = new FileReader();
|
|
353
|
-
reader.readAsDataURL(file);
|
|
354
|
-
reader.onload = () => resolve(reader.result);
|
|
355
|
-
reader.onerror = error => reject(error);
|
|
356
|
-
});
|
|
357
351
|
this.urls = new ApiUrls();
|
|
358
352
|
}
|
|
359
353
|
// private async http2<T>(method: string, url: string, data: string): Promise<T> {
|
|
@@ -505,11 +499,11 @@ class ApiCall {
|
|
|
505
499
|
state.modelsPath = jsonResp.modelsPath;
|
|
506
500
|
return true;
|
|
507
501
|
}
|
|
508
|
-
async UploadFileForRequestB64(requestId, type,
|
|
502
|
+
async UploadFileForRequestB64(requestId, type, b64Data) {
|
|
509
503
|
let data = {
|
|
510
504
|
requestId: requestId,
|
|
511
505
|
type: type,
|
|
512
|
-
data:
|
|
506
|
+
data: b64Data,
|
|
513
507
|
};
|
|
514
508
|
let respJson = await this.post(this.urls.UploadCapture, JSON.stringify(data));
|
|
515
509
|
if (state.debug)
|