@ekyc_qoobiss/qbs-ect-cmp 1.12.5 → 1.12.7
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/agreement-check_17.cjs.entry.js +67 -23
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/qbs-ect-cmp.cjs.js +1 -1
- package/dist/collection/components/flow/error-end/error-end.js +20 -2
- package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +7 -2
- package/dist/collection/components/identification-component/identification-component.js +35 -16
- package/dist/collection/helpers/ApiCall.js +1 -2
- package/dist/collection/helpers/Events.js +2 -4
- package/dist/collection/helpers/store.js +18 -0
- package/dist/collection/helpers/textValues.js +4 -0
- package/dist/esm/agreement-check_17.entry.js +67 -23
- package/dist/esm/loader.js +1 -1
- package/dist/esm/qbs-ect-cmp.js +1 -1
- package/dist/qbs-ect-cmp/{p-657aa895.entry.js → p-1497c772.entry.js} +2 -2
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/flow/error-end/error-end.d.ts +1 -0
- package/dist/types/components/identification-component/identification-component.d.ts +1 -0
- package/dist/types/components.d.ts +2 -0
- package/dist/types/helpers/textValues.d.ts +4 -0
- package/package.json +1 -1
|
@@ -262,6 +262,10 @@ class SessionKeys {
|
|
|
262
262
|
SessionKeys.FlowStatusKey = 'qbs-ect-flowstatus';
|
|
263
263
|
SessionKeys.RequestIdKey = 'qbs-ect-requestid';
|
|
264
264
|
SessionKeys.TokenKey = 'qbs-ect-token';
|
|
265
|
+
SessionKeys.InitialisedKey = 'qbs-ect-initialised';
|
|
266
|
+
SessionKeys.HasIdBackKey = 'qbs-ect-has-id-back';
|
|
267
|
+
SessionKeys.AgreementValidationKey = 'qbs-ect-agreement-validation';
|
|
268
|
+
SessionKeys.PhoneValidationKey = 'qbs-ect-phone-validation';
|
|
265
269
|
class IdCaptureValues extends GlobalValues {
|
|
266
270
|
}
|
|
267
271
|
IdCaptureValues.Button = 'Încerc din nou';
|
|
@@ -356,6 +360,24 @@ const { state, onChange } = createStore({
|
|
|
356
360
|
});
|
|
357
361
|
onChange('flowStatus', value => {
|
|
358
362
|
sessionStorage.setItem(SessionKeys.FlowStatusKey, FlowStatus[value]);
|
|
363
|
+
});
|
|
364
|
+
onChange('token', value => {
|
|
365
|
+
sessionStorage.setItem(SessionKeys.TokenKey, value);
|
|
366
|
+
});
|
|
367
|
+
onChange('requestId', value => {
|
|
368
|
+
sessionStorage.setItem(SessionKeys.RequestIdKey, value);
|
|
369
|
+
});
|
|
370
|
+
onChange('initialised', value => {
|
|
371
|
+
sessionStorage.setItem(SessionKeys.InitialisedKey, String(value));
|
|
372
|
+
});
|
|
373
|
+
onChange('hasIdBack', value => {
|
|
374
|
+
sessionStorage.setItem(SessionKeys.HasIdBackKey, String(value));
|
|
375
|
+
});
|
|
376
|
+
onChange('agreementsValidation', value => {
|
|
377
|
+
sessionStorage.setItem(SessionKeys.AgreementValidationKey, String(value));
|
|
378
|
+
});
|
|
379
|
+
onChange('phoneValidation', value => {
|
|
380
|
+
sessionStorage.setItem(SessionKeys.PhoneValidationKey, String(value));
|
|
359
381
|
});
|
|
360
382
|
|
|
361
383
|
class ApiCall {
|
|
@@ -419,7 +441,6 @@ class ApiCall {
|
|
|
419
441
|
let jsonResp = await this.post(this.urls.IdentityInsert, JSON.stringify(data));
|
|
420
442
|
if (state.requestId == '') {
|
|
421
443
|
state.requestId = jsonResp.requestId;
|
|
422
|
-
sessionStorage.setItem(SessionKeys.RequestIdKey, jsonResp.requestId);
|
|
423
444
|
}
|
|
424
445
|
state.hasIdBack = jsonResp.hasIdBack;
|
|
425
446
|
state.agreementsValidation = jsonResp.agreementsValidation;
|
|
@@ -5122,9 +5143,7 @@ class Events {
|
|
|
5122
5143
|
}));
|
|
5123
5144
|
}
|
|
5124
5145
|
static flowCompleted() {
|
|
5125
|
-
sessionStorage.
|
|
5126
|
-
sessionStorage.removeItem(SessionKeys.FlowStatusKey);
|
|
5127
|
-
sessionStorage.removeItem(SessionKeys.TokenKey);
|
|
5146
|
+
sessionStorage.clear();
|
|
5128
5147
|
this.cameraModule.dispatchEvent(new CustomEvent('ect-completed', {
|
|
5129
5148
|
detail: {},
|
|
5130
5149
|
bubbles: true,
|
|
@@ -5133,6 +5152,7 @@ class Events {
|
|
|
5133
5152
|
}));
|
|
5134
5153
|
}
|
|
5135
5154
|
static flowError(error) {
|
|
5155
|
+
sessionStorage.clear();
|
|
5136
5156
|
this.cameraModule.dispatchEvent(new CustomEvent('ect-error', {
|
|
5137
5157
|
detail: { error },
|
|
5138
5158
|
bubbles: true,
|
|
@@ -5172,13 +5192,14 @@ const ErrorEnd = class {
|
|
|
5172
5192
|
constructor(hostRef) {
|
|
5173
5193
|
index.registerInstance(this, hostRef);
|
|
5174
5194
|
this.message = undefined;
|
|
5195
|
+
this.errorTitle = undefined;
|
|
5175
5196
|
}
|
|
5176
5197
|
componentDidLoad() {
|
|
5177
5198
|
Events.init(window);
|
|
5178
|
-
Events.flowError(this.message);
|
|
5199
|
+
Events.flowError(this.errorTitle + ' ' + this.message);
|
|
5179
5200
|
}
|
|
5180
5201
|
render() {
|
|
5181
|
-
return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-2 text-center mt-10" }, this.message)))));
|
|
5202
|
+
return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", { class: "text-center" }, index.h("h1", null, this.errorTitle)), index.h("div", null, index.h("p", { class: "color-red font-weight-bold font-size-2 text-center mt-10" }, this.message)))));
|
|
5182
5203
|
}
|
|
5183
5204
|
};
|
|
5184
5205
|
ErrorEnd.style = errorEndCss;
|
|
@@ -5973,18 +5994,15 @@ const IdentificationComponent = class {
|
|
|
5973
5994
|
}
|
|
5974
5995
|
if (state.token !== newValue) {
|
|
5975
5996
|
state.token = newValue;
|
|
5976
|
-
sessionStorage.setItem(SessionKeys.TokenKey, state.token);
|
|
5977
5997
|
await this.initializeRequest();
|
|
5978
5998
|
}
|
|
5979
5999
|
}
|
|
5980
6000
|
async onOrderIdChange(newValue, _oldValue) {
|
|
5981
6001
|
if (state.requestId !== newValue) {
|
|
5982
6002
|
state.requestId = newValue;
|
|
5983
|
-
sessionStorage.setItem(SessionKeys.RequestIdKey, state.requestId);
|
|
5984
6003
|
state.initialised = false;
|
|
5985
6004
|
if (state.flowStatus != FlowStatus.LANDING) {
|
|
5986
6005
|
state.flowStatus = FlowStatus.LANDING;
|
|
5987
|
-
sessionStorage.setItem(SessionKeys.FlowStatusKey, FlowStatus[state.flowStatus]);
|
|
5988
6006
|
}
|
|
5989
6007
|
await this.initializeRequest();
|
|
5990
6008
|
}
|
|
@@ -6026,20 +6044,20 @@ const IdentificationComponent = class {
|
|
|
6026
6044
|
}
|
|
6027
6045
|
}
|
|
6028
6046
|
async apiErrorEmitter(data) {
|
|
6047
|
+
var _a, _b;
|
|
6029
6048
|
let apiLogData = { message: '', stack: '' };
|
|
6030
6049
|
if (data.detail) {
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
}
|
|
6050
|
+
this.errorTitle = (_a = data.detail.message) !== null && _a !== void 0 ? _a : '';
|
|
6051
|
+
this.errorMessage = (_b = data.detail.stack) !== null && _b !== void 0 ? _b : '';
|
|
6034
6052
|
apiLogData.message = data.detail.message;
|
|
6035
6053
|
apiLogData.stack = data.detail.stack;
|
|
6036
6054
|
}
|
|
6037
6055
|
else if (data.message) {
|
|
6038
|
-
this.
|
|
6056
|
+
this.errorTitle = data.message;
|
|
6039
6057
|
apiLogData.message = data.message;
|
|
6040
6058
|
}
|
|
6041
6059
|
else {
|
|
6042
|
-
this.
|
|
6060
|
+
this.errorTitle = data;
|
|
6043
6061
|
}
|
|
6044
6062
|
await this.apiCall.AddLog(apiLogData);
|
|
6045
6063
|
Events.flowError(data);
|
|
@@ -6054,6 +6072,7 @@ const IdentificationComponent = class {
|
|
|
6054
6072
|
this.redirect_id = undefined;
|
|
6055
6073
|
this.idSide = '';
|
|
6056
6074
|
this.errorMessage = undefined;
|
|
6075
|
+
this.errorTitle = undefined;
|
|
6057
6076
|
ML5.getInstance();
|
|
6058
6077
|
this.device = initDevice();
|
|
6059
6078
|
}
|
|
@@ -6062,24 +6081,44 @@ const IdentificationComponent = class {
|
|
|
6062
6081
|
if (this.token) {
|
|
6063
6082
|
state.token = this.token;
|
|
6064
6083
|
}
|
|
6084
|
+
else {
|
|
6085
|
+
state.token = sessionStorage.getItem(SessionKeys.TokenKey);
|
|
6086
|
+
}
|
|
6065
6087
|
if (this.order_id) {
|
|
6066
6088
|
state.requestId = this.order_id;
|
|
6067
|
-
sessionStorage.setItem(SessionKeys.RequestIdKey, state.requestId);
|
|
6068
6089
|
}
|
|
6069
6090
|
if (this.redirect_id) {
|
|
6070
6091
|
state.redirectId = this.redirect_id;
|
|
6071
6092
|
}
|
|
6093
|
+
var flowSt = sessionStorage.getItem(SessionKeys.FlowStatusKey);
|
|
6094
|
+
if (flowSt) {
|
|
6095
|
+
state.flowStatus = FlowStatus[flowSt];
|
|
6096
|
+
}
|
|
6097
|
+
if (!state.flowStatus) {
|
|
6098
|
+
state.flowStatus = FlowStatus.LANDING;
|
|
6099
|
+
}
|
|
6100
|
+
var ini = sessionStorage.getItem(SessionKeys.InitialisedKey);
|
|
6101
|
+
if (ini && ini.toLowerCase() == 'true') {
|
|
6102
|
+
state.initialised = true;
|
|
6103
|
+
}
|
|
6104
|
+
var hasIdBk = sessionStorage.getItem(SessionKeys.HasIdBackKey);
|
|
6105
|
+
if (hasIdBk && hasIdBk.toLowerCase() == 'true') {
|
|
6106
|
+
state.hasIdBack = true;
|
|
6107
|
+
}
|
|
6108
|
+
var agrVal = sessionStorage.getItem(SessionKeys.AgreementValidationKey);
|
|
6109
|
+
if (agrVal && agrVal.toLowerCase() == 'true') {
|
|
6110
|
+
state.agreementsValidation = true;
|
|
6111
|
+
}
|
|
6112
|
+
var phoneVal = sessionStorage.getItem(SessionKeys.PhoneValidationKey);
|
|
6113
|
+
if (phoneVal && phoneVal.toLowerCase() == 'true') {
|
|
6114
|
+
state.phoneValidation = true;
|
|
6115
|
+
}
|
|
6072
6116
|
state.apiBaseUrl = this.api_url;
|
|
6073
6117
|
state.environment = this.env;
|
|
6074
6118
|
this.apiCall = new ApiCall();
|
|
6075
6119
|
await this.initializeRequest();
|
|
6076
6120
|
}
|
|
6077
6121
|
componentWillRender() {
|
|
6078
|
-
state.flowStatus = FlowStatus[sessionStorage.getItem(SessionKeys.FlowStatusKey)];
|
|
6079
|
-
if (!state.flowStatus) {
|
|
6080
|
-
state.flowStatus = FlowStatus.LANDING;
|
|
6081
|
-
sessionStorage.setItem(SessionKeys.FlowStatusKey, FlowStatus[state.flowStatus]);
|
|
6082
|
-
}
|
|
6083
6122
|
if (this.idSide == '') {
|
|
6084
6123
|
this.idSide = state.hasIdBack ? 'front' : '';
|
|
6085
6124
|
}
|
|
@@ -6139,7 +6178,7 @@ const IdentificationComponent = class {
|
|
|
6139
6178
|
currentBlock = index.h("end-redirect", null);
|
|
6140
6179
|
}
|
|
6141
6180
|
if (state.flowStatus == FlowStatus.ERROREND) {
|
|
6142
|
-
currentBlock = index.h("error-end", { message: this.errorMessage });
|
|
6181
|
+
currentBlock = index.h("error-end", { errorTitle: this.errorTitle, message: this.errorMessage });
|
|
6143
6182
|
}
|
|
6144
6183
|
return index.h("div", null, currentBlock);
|
|
6145
6184
|
}
|
|
@@ -9125,7 +9164,7 @@ const MobileRedirect = class {
|
|
|
9125
9164
|
state.flowStatus = FlowStatus.COMPLETE;
|
|
9126
9165
|
}
|
|
9127
9166
|
if (this.orderStatus == OrderStatuses.NotFound) {
|
|
9128
|
-
this.apiErrorEvent.emit('No order was started for this process.');
|
|
9167
|
+
this.apiErrorEvent.emit({ message: 'No order was started for this process.' });
|
|
9129
9168
|
}
|
|
9130
9169
|
if (this.orderStatus == OrderStatuses.Capturing) {
|
|
9131
9170
|
this.infoTextTop = MobileRedirectValues.InfoWaiting;
|
|
@@ -9138,7 +9177,12 @@ const MobileRedirect = class {
|
|
|
9138
9177
|
}
|
|
9139
9178
|
this.waitingMobile = true;
|
|
9140
9179
|
this.infoTextTop = MobileRedirectValues.InfoWaiting;
|
|
9141
|
-
|
|
9180
|
+
try {
|
|
9181
|
+
await this.apiCall.SendLink(this.redirectLink, this.contact);
|
|
9182
|
+
}
|
|
9183
|
+
catch (e) {
|
|
9184
|
+
this.apiErrorEvent.emit(e);
|
|
9185
|
+
}
|
|
9142
9186
|
}
|
|
9143
9187
|
handleChangeContact(ev) {
|
|
9144
9188
|
let value = ev.target ? ev.target.value : '';
|
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"]]],["agreement-check_17.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"idSide":[32],"errorMessage":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"]]],[0,"id-double-side",{"device":[16],"showTimeout":[32],"showInvalid":[32],"showHowTo":[32],"front":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"photoIdBackCapture","captureIdBackImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"id-single-side",{"device":[16],"showTimeout":[32],"showHowTo":[32],"idFlow":[32]},[[0,"captureErrorDone","captureErrorDone"],[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"photoIdCapture","captureIdImage"],[0,"verificationFinished","verificationFinished"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"device":[16],"showError":[32],"showHowTo":[32],"selfieFlow":[32]},[[0,"howToInfoDone","howToDone"],[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]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"end-redirect"],[0,"error-end",{"message":[1]}],[0,"landing-validation",{"device":[16],"warningText":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"phoneNumber":[32],"code":[32]}],[0,"id-back-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"verificationFinished","verificationFinished"],[0,"takePhoto","takePhoto"]]],[0,"selfie-capture",{"device":[16],"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32]}],[0,"id-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"capture-error",{"type":[1]}],[0,"how-to-info",{"idSide":[1,"id-side"],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"device":[16],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
|
|
17
|
+
return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["agreement-check_17.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"idSide":[32],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"]]],[0,"id-double-side",{"device":[16],"showTimeout":[32],"showInvalid":[32],"showHowTo":[32],"front":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"photoIdBackCapture","captureIdBackImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"id-single-side",{"device":[16],"showTimeout":[32],"showHowTo":[32],"idFlow":[32]},[[0,"captureErrorDone","captureErrorDone"],[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"photoIdCapture","captureIdImage"],[0,"verificationFinished","verificationFinished"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"device":[16],"showError":[32],"showHowTo":[32],"selfieFlow":[32]},[[0,"howToInfoDone","howToDone"],[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]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"device":[16],"warningText":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"phoneNumber":[32],"code":[32]}],[0,"id-back-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"verificationFinished","verificationFinished"],[0,"takePhoto","takePhoto"]]],[0,"selfie-capture",{"device":[16],"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32]}],[0,"id-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"capture-error",{"type":[1]}],[0,"how-to-info",{"idSide":[1,"id-side"],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"device":[16],"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"]]],["agreement-check_17.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"idSide":[32],"errorMessage":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"]]],[0,"id-double-side",{"device":[16],"showTimeout":[32],"showInvalid":[32],"showHowTo":[32],"front":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"photoIdBackCapture","captureIdBackImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"id-single-side",{"device":[16],"showTimeout":[32],"showHowTo":[32],"idFlow":[32]},[[0,"captureErrorDone","captureErrorDone"],[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"photoIdCapture","captureIdImage"],[0,"verificationFinished","verificationFinished"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"device":[16],"showError":[32],"showHowTo":[32],"selfieFlow":[32]},[[0,"howToInfoDone","howToDone"],[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]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"end-redirect"],[0,"error-end",{"message":[1]}],[0,"landing-validation",{"device":[16],"warningText":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"phoneNumber":[32],"code":[32]}],[0,"id-back-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"verificationFinished","verificationFinished"],[0,"takePhoto","takePhoto"]]],[0,"selfie-capture",{"device":[16],"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32]}],[0,"id-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"capture-error",{"type":[1]}],[0,"how-to-info",{"idSide":[1,"id-side"],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"device":[16],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
|
|
20
|
+
return index.bootstrapLazy([["loader-dots.cjs",[[1,"loader-dots"]]],["agreement-check_17.cjs",[[1,"identification-component",{"token":[1537],"order_id":[1537],"api_url":[1537],"env":[1537],"redirect_id":[1537],"idSide":[32],"errorMessage":[32],"errorTitle":[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"]]],[0,"id-double-side",{"device":[16],"showTimeout":[32],"showInvalid":[32],"showHowTo":[32],"front":[32],"flow":[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"photoIdBackCapture","captureIdBackImage"],[0,"recordingIdCapture","capturedIdRecording"],[0,"verificationFinished","verificationFinished"]]],[0,"id-single-side",{"device":[16],"showTimeout":[32],"showHowTo":[32],"idFlow":[32]},[[0,"captureErrorDone","captureErrorDone"],[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"photoIdCapture","captureIdImage"],[0,"verificationFinished","verificationFinished"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{"device":[16],"showError":[32],"showHowTo":[32],"selfieFlow":[32]},[[0,"howToInfoDone","howToDone"],[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]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"end-redirect"],[0,"error-end",{"message":[1],"errorTitle":[1,"error-title"]}],[0,"landing-validation",{"device":[16],"warningText":[32]}],[0,"mobile-redirect",{"infoTextTop":[32],"infoTextBottom":[32],"contact":[32],"invalidValue":[32],"waitingMobile":[32],"orderStatus":[32],"redirectLink":[32],"qrCode":[32]}],[0,"sms-code-validation",{"title":[32],"details":[32],"buttonText":[32],"phoneNumber":[32],"code":[32]}],[0,"id-back-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"verificationFinished","verificationFinished"],[0,"takePhoto","takePhoto"]]],[0,"selfie-capture",{"device":[16],"videoStarted":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"demoEnded":[32],"demoVideo":[32],"uploadingLink":[32],"captureHeight":[32],"captureWidth":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{"agreementType":[1,"agreement-type"],"htmlContent":[32]}],[0,"id-capture",{"device":[16],"videoStarted":[32],"cameraSize":[32],"captureTaken":[32],"verified":[32],"titleMesage":[32],"showDemo":[32],"demoVideo":[32]},[[0,"changeTitle","eventChangeTitle"],[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"capture-error",{"type":[1]}],[0,"how-to-info",{"idSide":[1,"id-side"],"topTitle":[32],"subTitle":[32],"imagePath":[32],"buttonText":[32]}],[0,"camera-comp",{"modelPath":[1,"model-path"],"device":[16],"probabilityThreshold":[2,"probability-threshold"],"captureMode":[1,"capture-mode"]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -3,13 +3,14 @@ import Events from '../../../helpers/Events';
|
|
|
3
3
|
export class ErrorEnd {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.message = undefined;
|
|
6
|
+
this.errorTitle = undefined;
|
|
6
7
|
}
|
|
7
8
|
componentDidLoad() {
|
|
8
9
|
Events.init(window);
|
|
9
|
-
Events.flowError(this.message);
|
|
10
|
+
Events.flowError(this.errorTitle + ' ' + this.message);
|
|
10
11
|
}
|
|
11
12
|
render() {
|
|
12
|
-
return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", null, h("p", { class: "color-red font-weight-bold font-size-2 text-center mt-10" }, this.message)))));
|
|
13
|
+
return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", { class: "text-center" }, h("h1", null, this.errorTitle)), h("div", null, h("p", { class: "color-red font-weight-bold font-size-2 text-center mt-10" }, this.message)))));
|
|
13
14
|
}
|
|
14
15
|
static get is() { return "error-end"; }
|
|
15
16
|
static get originalStyleUrls() {
|
|
@@ -40,6 +41,23 @@ export class ErrorEnd {
|
|
|
40
41
|
},
|
|
41
42
|
"attribute": "message",
|
|
42
43
|
"reflect": false
|
|
44
|
+
},
|
|
45
|
+
"errorTitle": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"mutable": false,
|
|
48
|
+
"complexType": {
|
|
49
|
+
"original": "string",
|
|
50
|
+
"resolved": "string",
|
|
51
|
+
"references": {}
|
|
52
|
+
},
|
|
53
|
+
"required": false,
|
|
54
|
+
"optional": false,
|
|
55
|
+
"docs": {
|
|
56
|
+
"tags": [],
|
|
57
|
+
"text": ""
|
|
58
|
+
},
|
|
59
|
+
"attribute": "error-title",
|
|
60
|
+
"reflect": false
|
|
43
61
|
}
|
|
44
62
|
};
|
|
45
63
|
}
|
|
@@ -49,7 +49,7 @@ export class MobileRedirect {
|
|
|
49
49
|
store.flowStatus = FlowStatus.COMPLETE;
|
|
50
50
|
}
|
|
51
51
|
if (this.orderStatus == OrderStatuses.NotFound) {
|
|
52
|
-
this.apiErrorEvent.emit('No order was started for this process.');
|
|
52
|
+
this.apiErrorEvent.emit({ message: 'No order was started for this process.' });
|
|
53
53
|
}
|
|
54
54
|
if (this.orderStatus == OrderStatuses.Capturing) {
|
|
55
55
|
this.infoTextTop = MobileRedirectValues.InfoWaiting;
|
|
@@ -63,7 +63,12 @@ export class MobileRedirect {
|
|
|
63
63
|
}
|
|
64
64
|
this.waitingMobile = true;
|
|
65
65
|
this.infoTextTop = MobileRedirectValues.InfoWaiting;
|
|
66
|
-
|
|
66
|
+
try {
|
|
67
|
+
await this.apiCall.SendLink(this.redirectLink, this.contact);
|
|
68
|
+
}
|
|
69
|
+
catch (e) {
|
|
70
|
+
this.apiErrorEvent.emit(e);
|
|
71
|
+
}
|
|
67
72
|
}
|
|
68
73
|
handleChangeContact(ev) {
|
|
69
74
|
let value = ev.target ? ev.target.value : '';
|
|
@@ -15,18 +15,15 @@ export class IdentificationComponent {
|
|
|
15
15
|
}
|
|
16
16
|
if (store.token !== newValue) {
|
|
17
17
|
store.token = newValue;
|
|
18
|
-
sessionStorage.setItem(SessionKeys.TokenKey, store.token);
|
|
19
18
|
await this.initializeRequest();
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
21
|
async onOrderIdChange(newValue, _oldValue) {
|
|
23
22
|
if (store.requestId !== newValue) {
|
|
24
23
|
store.requestId = newValue;
|
|
25
|
-
sessionStorage.setItem(SessionKeys.RequestIdKey, store.requestId);
|
|
26
24
|
store.initialised = false;
|
|
27
25
|
if (store.flowStatus != FlowStatus.LANDING) {
|
|
28
26
|
store.flowStatus = FlowStatus.LANDING;
|
|
29
|
-
sessionStorage.setItem(SessionKeys.FlowStatusKey, FlowStatus[store.flowStatus]);
|
|
30
27
|
}
|
|
31
28
|
await this.initializeRequest();
|
|
32
29
|
}
|
|
@@ -68,20 +65,20 @@ export class IdentificationComponent {
|
|
|
68
65
|
}
|
|
69
66
|
}
|
|
70
67
|
async apiErrorEmitter(data) {
|
|
68
|
+
var _a, _b;
|
|
71
69
|
let apiLogData = { message: '', stack: '' };
|
|
72
70
|
if (data.detail) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
71
|
+
this.errorTitle = (_a = data.detail.message) !== null && _a !== void 0 ? _a : '';
|
|
72
|
+
this.errorMessage = (_b = data.detail.stack) !== null && _b !== void 0 ? _b : '';
|
|
76
73
|
apiLogData.message = data.detail.message;
|
|
77
74
|
apiLogData.stack = data.detail.stack;
|
|
78
75
|
}
|
|
79
76
|
else if (data.message) {
|
|
80
|
-
this.
|
|
77
|
+
this.errorTitle = data.message;
|
|
81
78
|
apiLogData.message = data.message;
|
|
82
79
|
}
|
|
83
80
|
else {
|
|
84
|
-
this.
|
|
81
|
+
this.errorTitle = data;
|
|
85
82
|
}
|
|
86
83
|
await this.apiCall.AddLog(apiLogData);
|
|
87
84
|
Events.flowError(data);
|
|
@@ -95,6 +92,7 @@ export class IdentificationComponent {
|
|
|
95
92
|
this.redirect_id = undefined;
|
|
96
93
|
this.idSide = '';
|
|
97
94
|
this.errorMessage = undefined;
|
|
95
|
+
this.errorTitle = undefined;
|
|
98
96
|
ML5.getInstance();
|
|
99
97
|
this.device = initDevice();
|
|
100
98
|
}
|
|
@@ -103,24 +101,44 @@ export class IdentificationComponent {
|
|
|
103
101
|
if (this.token) {
|
|
104
102
|
store.token = this.token;
|
|
105
103
|
}
|
|
104
|
+
else {
|
|
105
|
+
store.token = sessionStorage.getItem(SessionKeys.TokenKey);
|
|
106
|
+
}
|
|
106
107
|
if (this.order_id) {
|
|
107
108
|
store.requestId = this.order_id;
|
|
108
|
-
sessionStorage.setItem(SessionKeys.RequestIdKey, store.requestId);
|
|
109
109
|
}
|
|
110
110
|
if (this.redirect_id) {
|
|
111
111
|
store.redirectId = this.redirect_id;
|
|
112
112
|
}
|
|
113
|
+
var flowSt = sessionStorage.getItem(SessionKeys.FlowStatusKey);
|
|
114
|
+
if (flowSt) {
|
|
115
|
+
store.flowStatus = FlowStatus[flowSt];
|
|
116
|
+
}
|
|
117
|
+
if (!store.flowStatus) {
|
|
118
|
+
store.flowStatus = FlowStatus.LANDING;
|
|
119
|
+
}
|
|
120
|
+
var ini = sessionStorage.getItem(SessionKeys.InitialisedKey);
|
|
121
|
+
if (ini && ini.toLowerCase() == 'true') {
|
|
122
|
+
store.initialised = true;
|
|
123
|
+
}
|
|
124
|
+
var hasIdBk = sessionStorage.getItem(SessionKeys.HasIdBackKey);
|
|
125
|
+
if (hasIdBk && hasIdBk.toLowerCase() == 'true') {
|
|
126
|
+
store.hasIdBack = true;
|
|
127
|
+
}
|
|
128
|
+
var agrVal = sessionStorage.getItem(SessionKeys.AgreementValidationKey);
|
|
129
|
+
if (agrVal && agrVal.toLowerCase() == 'true') {
|
|
130
|
+
store.agreementsValidation = true;
|
|
131
|
+
}
|
|
132
|
+
var phoneVal = sessionStorage.getItem(SessionKeys.PhoneValidationKey);
|
|
133
|
+
if (phoneVal && phoneVal.toLowerCase() == 'true') {
|
|
134
|
+
store.phoneValidation = true;
|
|
135
|
+
}
|
|
113
136
|
store.apiBaseUrl = this.api_url;
|
|
114
137
|
store.environment = this.env;
|
|
115
138
|
this.apiCall = new ApiCall();
|
|
116
139
|
await this.initializeRequest();
|
|
117
140
|
}
|
|
118
141
|
componentWillRender() {
|
|
119
|
-
store.flowStatus = FlowStatus[sessionStorage.getItem(SessionKeys.FlowStatusKey)];
|
|
120
|
-
if (!store.flowStatus) {
|
|
121
|
-
store.flowStatus = FlowStatus.LANDING;
|
|
122
|
-
sessionStorage.setItem(SessionKeys.FlowStatusKey, FlowStatus[store.flowStatus]);
|
|
123
|
-
}
|
|
124
142
|
if (this.idSide == '') {
|
|
125
143
|
this.idSide = store.hasIdBack ? 'front' : '';
|
|
126
144
|
}
|
|
@@ -180,7 +198,7 @@ export class IdentificationComponent {
|
|
|
180
198
|
currentBlock = h("end-redirect", null);
|
|
181
199
|
}
|
|
182
200
|
if (store.flowStatus == FlowStatus.ERROREND) {
|
|
183
|
-
currentBlock = h("error-end", { message: this.errorMessage });
|
|
201
|
+
currentBlock = h("error-end", { errorTitle: this.errorTitle, message: this.errorMessage });
|
|
184
202
|
}
|
|
185
203
|
return h("div", null, currentBlock);
|
|
186
204
|
}
|
|
@@ -288,7 +306,8 @@ export class IdentificationComponent {
|
|
|
288
306
|
static get states() {
|
|
289
307
|
return {
|
|
290
308
|
"idSide": {},
|
|
291
|
-
"errorMessage": {}
|
|
309
|
+
"errorMessage": {},
|
|
310
|
+
"errorTitle": {}
|
|
292
311
|
};
|
|
293
312
|
}
|
|
294
313
|
static get watchers() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OrderStatuses } from '../models/OrderStatuses';
|
|
2
2
|
import store from './store';
|
|
3
|
-
import { ApiUrls
|
|
3
|
+
import { ApiUrls } from './textValues';
|
|
4
4
|
import { FlowStatus } from '../models/FlowStatus';
|
|
5
5
|
export class ApiCall {
|
|
6
6
|
constructor() {
|
|
@@ -63,7 +63,6 @@ export class ApiCall {
|
|
|
63
63
|
let jsonResp = await this.post(this.urls.IdentityInsert, JSON.stringify(data));
|
|
64
64
|
if (store.requestId == '') {
|
|
65
65
|
store.requestId = jsonResp.requestId;
|
|
66
|
-
sessionStorage.setItem(SessionKeys.RequestIdKey, jsonResp.requestId);
|
|
67
66
|
}
|
|
68
67
|
store.hasIdBack = jsonResp.hasIdBack;
|
|
69
68
|
store.agreementsValidation = jsonResp.agreementsValidation;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SessionKeys } from './textValues';
|
|
2
1
|
export default class Events {
|
|
3
2
|
static init(element) {
|
|
4
3
|
this.cameraModule = element;
|
|
@@ -12,9 +11,7 @@ export default class Events {
|
|
|
12
11
|
}));
|
|
13
12
|
}
|
|
14
13
|
static flowCompleted() {
|
|
15
|
-
sessionStorage.
|
|
16
|
-
sessionStorage.removeItem(SessionKeys.FlowStatusKey);
|
|
17
|
-
sessionStorage.removeItem(SessionKeys.TokenKey);
|
|
14
|
+
sessionStorage.clear();
|
|
18
15
|
this.cameraModule.dispatchEvent(new CustomEvent('ect-completed', {
|
|
19
16
|
detail: {},
|
|
20
17
|
bubbles: true,
|
|
@@ -23,6 +20,7 @@ export default class Events {
|
|
|
23
20
|
}));
|
|
24
21
|
}
|
|
25
22
|
static flowError(error) {
|
|
23
|
+
sessionStorage.clear();
|
|
26
24
|
this.cameraModule.dispatchEvent(new CustomEvent('ect-error', {
|
|
27
25
|
detail: { error },
|
|
28
26
|
bubbles: true,
|
|
@@ -18,4 +18,22 @@ const { state, onChange } = createStore({
|
|
|
18
18
|
onChange('flowStatus', value => {
|
|
19
19
|
sessionStorage.setItem(SessionKeys.FlowStatusKey, FlowStatus[value]);
|
|
20
20
|
});
|
|
21
|
+
onChange('token', value => {
|
|
22
|
+
sessionStorage.setItem(SessionKeys.TokenKey, value);
|
|
23
|
+
});
|
|
24
|
+
onChange('requestId', value => {
|
|
25
|
+
sessionStorage.setItem(SessionKeys.RequestIdKey, value);
|
|
26
|
+
});
|
|
27
|
+
onChange('initialised', value => {
|
|
28
|
+
sessionStorage.setItem(SessionKeys.InitialisedKey, String(value));
|
|
29
|
+
});
|
|
30
|
+
onChange('hasIdBack', value => {
|
|
31
|
+
sessionStorage.setItem(SessionKeys.HasIdBackKey, String(value));
|
|
32
|
+
});
|
|
33
|
+
onChange('agreementsValidation', value => {
|
|
34
|
+
sessionStorage.setItem(SessionKeys.AgreementValidationKey, String(value));
|
|
35
|
+
});
|
|
36
|
+
onChange('phoneValidation', value => {
|
|
37
|
+
sessionStorage.setItem(SessionKeys.PhoneValidationKey, String(value));
|
|
38
|
+
});
|
|
21
39
|
export default state;
|
|
@@ -45,6 +45,10 @@ export class SessionKeys {
|
|
|
45
45
|
SessionKeys.FlowStatusKey = 'qbs-ect-flowstatus';
|
|
46
46
|
SessionKeys.RequestIdKey = 'qbs-ect-requestid';
|
|
47
47
|
SessionKeys.TokenKey = 'qbs-ect-token';
|
|
48
|
+
SessionKeys.InitialisedKey = 'qbs-ect-initialised';
|
|
49
|
+
SessionKeys.HasIdBackKey = 'qbs-ect-has-id-back';
|
|
50
|
+
SessionKeys.AgreementValidationKey = 'qbs-ect-agreement-validation';
|
|
51
|
+
SessionKeys.PhoneValidationKey = 'qbs-ect-phone-validation';
|
|
48
52
|
export class IdCaptureValues extends GlobalValues {
|
|
49
53
|
}
|
|
50
54
|
IdCaptureValues.Button = 'Încerc din nou';
|