@ekyc_qoobiss/qbs-ect-cmp 3.6.82 → 3.6.84
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 -12
- 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/flow/process-id/process-id.js +15 -5
- package/dist/collection/components/flow/user-liveness/user-liveness.js +13 -5
- 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 -12
- 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-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/{p-9c1b41d1.entry.js → p-9bd43e2c.entry.js} +2 -2
- 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;
|
|
@@ -5252,7 +5256,7 @@ function v4(options, buf, offset) {
|
|
|
5252
5256
|
}
|
|
5253
5257
|
|
|
5254
5258
|
const name = "@ekyc_qoobiss/qbs-ect-cmp";
|
|
5255
|
-
const version$1 = "3.6.
|
|
5259
|
+
const version$1 = "3.6.84";
|
|
5256
5260
|
const description = "Person Identification Component";
|
|
5257
5261
|
const main = "./dist/index.cjs.js";
|
|
5258
5262
|
const module$1 = "./dist/index.js";
|
|
@@ -8719,6 +8723,8 @@ const ProcessId = class {
|
|
|
8719
8723
|
recName: 'idVideo.',
|
|
8720
8724
|
photoType: CaptureUploadTypes.IdFront,
|
|
8721
8725
|
recType: CaptureUploadTypes.IdFrontVideo,
|
|
8726
|
+
imageSize: 0,
|
|
8727
|
+
videoSize: 0,
|
|
8722
8728
|
};
|
|
8723
8729
|
}
|
|
8724
8730
|
else if (this.mode == 'back') {
|
|
@@ -8728,6 +8734,8 @@ const ProcessId = class {
|
|
|
8728
8734
|
recName: 'idBackVideo.',
|
|
8729
8735
|
photoType: CaptureUploadTypes.IdBack,
|
|
8730
8736
|
recType: CaptureUploadTypes.IdBackVideo,
|
|
8737
|
+
imageSize: 0,
|
|
8738
|
+
videoSize: 0,
|
|
8731
8739
|
};
|
|
8732
8740
|
}
|
|
8733
8741
|
else if (this.mode == 'tilt') {
|
|
@@ -8737,6 +8745,8 @@ const ProcessId = class {
|
|
|
8737
8745
|
recName: 'idTiltVideo.',
|
|
8738
8746
|
photoType: CaptureUploadTypes.None,
|
|
8739
8747
|
recType: CaptureUploadTypes.TiltVideo,
|
|
8748
|
+
imageSize: 0,
|
|
8749
|
+
videoSize: 0,
|
|
8740
8750
|
};
|
|
8741
8751
|
}
|
|
8742
8752
|
if (TranslationUtils.state.debug)
|
|
@@ -8769,7 +8779,9 @@ const ProcessId = class {
|
|
|
8769
8779
|
}
|
|
8770
8780
|
try {
|
|
8771
8781
|
let frontCapture = new File([idPhoto], this.flow.fileName, { type: 'image/png' });
|
|
8772
|
-
|
|
8782
|
+
let b64Data = await blobToBase64(frontCapture);
|
|
8783
|
+
this.flow.imageSize = base64Size(b64Data);
|
|
8784
|
+
var uploadResult = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.photoType, b64Data);
|
|
8773
8785
|
if (TranslationUtils.state.debug)
|
|
8774
8786
|
console.log('process-id | captureIdImage | uploadResult: ' + uploadResult);
|
|
8775
8787
|
if (uploadResult.isValid) {
|
|
@@ -8801,7 +8813,9 @@ const ProcessId = class {
|
|
|
8801
8813
|
}
|
|
8802
8814
|
let mimeType = idRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
8803
8815
|
let captureRec = new File([idRecording], this.flow.recName + mimeType.extension, { type: mimeType.type });
|
|
8804
|
-
|
|
8816
|
+
let b64Data = await blobToBase64(captureRec);
|
|
8817
|
+
this.flow.videoSize = base64Size(b64Data);
|
|
8818
|
+
var uploadResult = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.recType, b64Data);
|
|
8805
8819
|
if (TranslationUtils.state.debug)
|
|
8806
8820
|
console.log('process-id | capturedIdRecording | uploadResult: ' + uploadResult);
|
|
8807
8821
|
if (uploadResult.saved) {
|
|
@@ -8816,7 +8830,7 @@ const ProcessId = class {
|
|
|
8816
8830
|
if (TranslationUtils.state.debug)
|
|
8817
8831
|
console.log('process-id | verificationFinished');
|
|
8818
8832
|
this.verificationReceived = Date.now();
|
|
8819
|
-
while (Date.now() - this.verificationReceived <
|
|
8833
|
+
while (Date.now() - this.verificationReceived < 90000) {
|
|
8820
8834
|
await delay(2000);
|
|
8821
8835
|
if (this.showInvalid || this.showTimeout)
|
|
8822
8836
|
return;
|
|
@@ -8855,7 +8869,7 @@ const ProcessId = class {
|
|
|
8855
8869
|
}
|
|
8856
8870
|
}
|
|
8857
8871
|
render() {
|
|
8858
|
-
let error = index.h("capture-error", { type: "ID", reason: this.errorReason });
|
|
8872
|
+
let error = index.h("capture-error", { type: "ID", reason: this.errorReason, error: `image:${this.flow.imageSize}mb video:${this.flow.videoSize}mb` });
|
|
8859
8873
|
let capture = index.h("id-capture", null);
|
|
8860
8874
|
if (this.showInvalid || this.showTimeout) {
|
|
8861
8875
|
return error;
|
|
@@ -9116,6 +9130,8 @@ const UserLiveness = class {
|
|
|
9116
9130
|
recName: 'selfieVideo.',
|
|
9117
9131
|
photoType: CaptureUploadTypes.Selfie,
|
|
9118
9132
|
recType: CaptureUploadTypes.SelfieVideo,
|
|
9133
|
+
imageSize: 0,
|
|
9134
|
+
videoSize: 0,
|
|
9119
9135
|
};
|
|
9120
9136
|
}
|
|
9121
9137
|
else if (this.mode == 'selfieGesture') {
|
|
@@ -9125,6 +9141,8 @@ const UserLiveness = class {
|
|
|
9125
9141
|
recName: 'selfieTiltVideo.',
|
|
9126
9142
|
photoType: CaptureUploadTypes.None,
|
|
9127
9143
|
recType: CaptureUploadTypes.SelfieGestureVideo,
|
|
9144
|
+
imageSize: 0,
|
|
9145
|
+
videoSize: 0,
|
|
9128
9146
|
};
|
|
9129
9147
|
}
|
|
9130
9148
|
}
|
|
@@ -9151,7 +9169,9 @@ const UserLiveness = class {
|
|
|
9151
9169
|
}
|
|
9152
9170
|
try {
|
|
9153
9171
|
var uploadPhoto = new File([selfiePhoto], this.flow.fileName, { type: 'image/png' });
|
|
9154
|
-
let
|
|
9172
|
+
let b64Data = await blobToBase64(uploadPhoto);
|
|
9173
|
+
this.flow.imageSize = base64Size(b64Data);
|
|
9174
|
+
let photoUploaded = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.photoType, b64Data);
|
|
9155
9175
|
if (photoUploaded.isValid) {
|
|
9156
9176
|
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[photoUploaded.state];
|
|
9157
9177
|
}
|
|
@@ -9178,7 +9198,9 @@ const UserLiveness = class {
|
|
|
9178
9198
|
let mimeType = selfieRecording.type == Stream.mp4MimeType.type ? Stream.mp4MimeType : Stream.webmMimeType;
|
|
9179
9199
|
try {
|
|
9180
9200
|
let uploadRec = new File([selfieRecording], this.flow.recName + mimeType.extension, { type: mimeType.type });
|
|
9181
|
-
let
|
|
9201
|
+
let b64Data = await blobToBase64(uploadRec);
|
|
9202
|
+
this.flow.videoSize = base64Size(b64Data);
|
|
9203
|
+
let uplodDone = await TranslationUtils.ApiCall.instance.UploadFileForRequestB64(TranslationUtils.state.requestId, this.flow.recType, b64Data);
|
|
9182
9204
|
if (uplodDone.saved) {
|
|
9183
9205
|
TranslationUtils.state.flowStatus = TranslationUtils.FlowStatus[uplodDone.state];
|
|
9184
9206
|
}
|
|
@@ -9200,7 +9222,7 @@ const UserLiveness = class {
|
|
|
9200
9222
|
if (TranslationUtils.state.debug)
|
|
9201
9223
|
console.log('user-liveness | verificationFinished');
|
|
9202
9224
|
this.verificationReceived = Date.now();
|
|
9203
|
-
while (Date.now() - this.verificationReceived <
|
|
9225
|
+
while (Date.now() - this.verificationReceived < 90000) {
|
|
9204
9226
|
await delay(2000);
|
|
9205
9227
|
if (this.showError || this.showTimeout)
|
|
9206
9228
|
return;
|
|
@@ -9222,7 +9244,7 @@ const UserLiveness = class {
|
|
|
9222
9244
|
}
|
|
9223
9245
|
render() {
|
|
9224
9246
|
let capture = index.h("selfie-capture", null);
|
|
9225
|
-
let error = index.h("capture-error", { type: "LIVENESS", reason: this.errorReason });
|
|
9247
|
+
let error = index.h("capture-error", { type: "LIVENESS", reason: this.errorReason, error: `image:${this.flow.imageSize}mb video:${this.flow.videoSize}mb` });
|
|
9226
9248
|
if (this.showError || this.showTimeout) {
|
|
9227
9249
|
return error;
|
|
9228
9250
|
}
|
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
|
}
|
|
@@ -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) {
|
|
@@ -126,7 +136,7 @@ export class ProcessId {
|
|
|
126
136
|
if (store.debug)
|
|
127
137
|
console.log('process-id | verificationFinished');
|
|
128
138
|
this.verificationReceived = Date.now();
|
|
129
|
-
while (Date.now() - this.verificationReceived <
|
|
139
|
+
while (Date.now() - this.verificationReceived < 90000) {
|
|
130
140
|
await delay(2000);
|
|
131
141
|
if (this.showInvalid || this.showTimeout)
|
|
132
142
|
return;
|
|
@@ -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
|
}
|
|
@@ -109,7 +117,7 @@ export class UserLiveness {
|
|
|
109
117
|
if (store.debug)
|
|
110
118
|
console.log('user-liveness | verificationFinished');
|
|
111
119
|
this.verificationReceived = Date.now();
|
|
112
|
-
while (Date.now() - this.verificationReceived <
|
|
120
|
+
while (Date.now() - this.verificationReceived < 90000) {
|
|
113
121
|
await delay(2000);
|
|
114
122
|
if (this.showError || this.showTimeout)
|
|
115
123
|
return;
|
|
@@ -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)
|