@ekyc_qoobiss/qbs-ect-cmp 1.2.10 → 1.2.12
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 +41 -10
- package/dist/collection/components/flow/landing-validation/landing-validation.js +28 -2
- package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +7 -0
- package/dist/collection/components/identification-component/identification-component.js +16 -7
- package/dist/collection/helpers/ApiCall.js +5 -0
- package/dist/collection/helpers/textValues.js +2 -0
- package/dist/collection/models/IAbortResult.js +1 -0
- package/dist/collection/models/OrderStatuses.js +1 -0
- package/dist/esm/agreement-check_17.entry.js +41 -10
- package/dist/qbs-ect-cmp/{p-bb997539.entry.js → p-0a9dc428.entry.js} +2 -2
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/flow/landing-validation/landing-validation.d.ts +3 -0
- package/dist/types/components/identification-component/identification-component.d.ts +1 -1
- package/dist/types/components.d.ts +5 -0
- package/dist/types/helpers/ApiCall.d.ts +1 -0
- package/dist/types/helpers/textValues.d.ts +2 -0
- package/dist/types/models/IAbortResult.d.ts +3 -0
- package/dist/types/models/OrderStatuses.d.ts +2 -1
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ var OrderStatuses;
|
|
|
10
10
|
OrderStatuses[OrderStatuses["FinishedCapturing"] = 1] = "FinishedCapturing";
|
|
11
11
|
OrderStatuses[OrderStatuses["Waiting"] = 2] = "Waiting";
|
|
12
12
|
OrderStatuses[OrderStatuses["NotFound"] = 3] = "NotFound";
|
|
13
|
+
OrderStatuses[OrderStatuses["Aborted"] = 4] = "Aborted";
|
|
13
14
|
})(OrderStatuses || (OrderStatuses = {}));
|
|
14
15
|
|
|
15
16
|
const appendToMap = (map, propName, value) => {
|
|
@@ -336,6 +337,7 @@ class ApiUrls {
|
|
|
336
337
|
this.SendLink = this.uriEnv + 'validation/otp/sendlink';
|
|
337
338
|
this.GetStatus = this.uriEnv + 'validation/identity/status';
|
|
338
339
|
this.AddLog = this.uriEnv + 'validation/logs/add';
|
|
340
|
+
this.AbortRequest = this.uriEnv + 'validation/identity/abort';
|
|
339
341
|
}
|
|
340
342
|
}
|
|
341
343
|
class MobileRedirectValues extends GlobalValues {
|
|
@@ -343,7 +345,8 @@ class MobileRedirectValues extends GlobalValues {
|
|
|
343
345
|
MobileRedirectValues.InfoTop = 'Pentru a continua scanați codul de mai jos cu un smartphone.';
|
|
344
346
|
MobileRedirectValues.InfoBottom = 'Sau introduceți un număr de telefon pentru a primi link-ul pe smartphone.';
|
|
345
347
|
MobileRedirectValues.Validation = 'Număr de telefon invalid!';
|
|
346
|
-
MobileRedirectValues.InfoWaiting = 'Așteptăm finalizarea procesului pe smartphone.';
|
|
348
|
+
MobileRedirectValues.InfoWaiting = 'Așteptăm finalizarea procesului pe smartphone.';
|
|
349
|
+
MobileRedirectValues.InfoAborted = 'Procesului de pe smartphone a fost amanat.';
|
|
347
350
|
|
|
348
351
|
const { state, onChange } = createStore({
|
|
349
352
|
flowStatus: FlowStatus.LANDING,
|
|
@@ -435,6 +438,7 @@ class ApiCall {
|
|
|
435
438
|
return jsonResp.valid;
|
|
436
439
|
}
|
|
437
440
|
async AddIdentificationRequest(deviceInfo) {
|
|
441
|
+
console.log('Calling identity request with store:' + JSON.stringify(state));
|
|
438
442
|
let data = {
|
|
439
443
|
requestId: state.requestId,
|
|
440
444
|
clientDeviceInfo: JSON.stringify(deviceInfo),
|
|
@@ -492,6 +496,10 @@ class ApiCall {
|
|
|
492
496
|
}
|
|
493
497
|
catch (_a) { }
|
|
494
498
|
}
|
|
499
|
+
async AbortRequest() {
|
|
500
|
+
let result = await this.post(this.urls.AbortRequest, JSON.stringify({ requestId: state.requestId }));
|
|
501
|
+
return result.saved;
|
|
502
|
+
}
|
|
495
503
|
}
|
|
496
504
|
|
|
497
505
|
const agreementCheckCss = "";
|
|
@@ -6000,6 +6008,7 @@ const identificationComponentCss = "@font-face{font-family:'Inter';font-style:no
|
|
|
6000
6008
|
|
|
6001
6009
|
const IdentificationComponent = class {
|
|
6002
6010
|
async onTokenChange(newValue, _oldValue) {
|
|
6011
|
+
console.log('Token change called with value: ' + newValue);
|
|
6003
6012
|
if (newValue == '') {
|
|
6004
6013
|
newValue = state.token;
|
|
6005
6014
|
return;
|
|
@@ -6010,6 +6019,7 @@ const IdentificationComponent = class {
|
|
|
6010
6019
|
}
|
|
6011
6020
|
}
|
|
6012
6021
|
async onOrderIdChange(newValue, _oldValue) {
|
|
6022
|
+
console.log('OrderId change called with value: ' + newValue);
|
|
6013
6023
|
if (state.requestId !== newValue && newValue != '') {
|
|
6014
6024
|
state.requestId = newValue;
|
|
6015
6025
|
state.initialised = false;
|
|
@@ -6038,6 +6048,7 @@ const IdentificationComponent = class {
|
|
|
6038
6048
|
}
|
|
6039
6049
|
}
|
|
6040
6050
|
async onRedirectIdChange(newValue, _oldValue) {
|
|
6051
|
+
console.log('RedirectId change called with value: ' + newValue);
|
|
6041
6052
|
if (state.redirectId != '') {
|
|
6042
6053
|
newValue = state.redirectId;
|
|
6043
6054
|
return;
|
|
@@ -6061,12 +6072,12 @@ const IdentificationComponent = class {
|
|
|
6061
6072
|
this.apiCall.GenerateAgreement(data.detail.agreementType);
|
|
6062
6073
|
}
|
|
6063
6074
|
catch (e) {
|
|
6064
|
-
this.apiErrorEmitter(e);
|
|
6075
|
+
this.apiErrorEmitter(e, 'Agreement Acceptance');
|
|
6065
6076
|
}
|
|
6066
6077
|
}
|
|
6067
|
-
async apiErrorEmitter(data) {
|
|
6078
|
+
async apiErrorEmitter(data, zone) {
|
|
6068
6079
|
var _a, _b;
|
|
6069
|
-
let apiLogData = { message: '', stack: '' };
|
|
6080
|
+
let apiLogData = { message: '', stack: '', zone };
|
|
6070
6081
|
if (data.detail) {
|
|
6071
6082
|
this.errorTitle = (_a = data.detail.message) !== null && _a !== void 0 ? _a : '';
|
|
6072
6083
|
this.errorMessage = (_b = data.detail.stack) !== null && _b !== void 0 ? _b : '';
|
|
@@ -6103,10 +6114,13 @@ const IdentificationComponent = class {
|
|
|
6103
6114
|
state.apiBaseUrl = this.api_url;
|
|
6104
6115
|
state.environment = this.env;
|
|
6105
6116
|
if (this.token) {
|
|
6117
|
+
console.log('Store Token set with property value: ' + this.token);
|
|
6106
6118
|
state.token = this.token;
|
|
6107
6119
|
}
|
|
6108
|
-
else {
|
|
6120
|
+
else if (state.token == '') {
|
|
6109
6121
|
state.token = sessionStorage.getItem(SessionKeys.TokenKey);
|
|
6122
|
+
this.token = state.token;
|
|
6123
|
+
console.log('Store Token set with session value: ' + state.token);
|
|
6110
6124
|
}
|
|
6111
6125
|
if (this.redirect_id) {
|
|
6112
6126
|
state.redirectId = this.redirect_id;
|
|
@@ -6138,16 +6152,19 @@ const IdentificationComponent = class {
|
|
|
6138
6152
|
state.phoneValidation = true;
|
|
6139
6153
|
}
|
|
6140
6154
|
const savedRequest = sessionStorage.getItem(SessionKeys.RequestIdKey);
|
|
6141
|
-
if (this.order_id) {
|
|
6155
|
+
if (this.order_id && this.order_id != '') {
|
|
6156
|
+
console.log('Current RequestId has value: ' + this.order_id);
|
|
6142
6157
|
if (savedRequest && savedRequest != '' && savedRequest != this.order_id) {
|
|
6143
|
-
|
|
6158
|
+
console.log('Session RequestId: ' + savedRequest + ' has different value than property one: ' + this.order_id);
|
|
6144
6159
|
state.flowStatus = FlowStatus.LANDING;
|
|
6145
6160
|
state.initialised = false;
|
|
6146
6161
|
}
|
|
6147
6162
|
state.requestId = this.order_id;
|
|
6148
6163
|
}
|
|
6149
6164
|
else if (savedRequest) {
|
|
6165
|
+
console.log('Current RequestId has no value, setting with session value: ' + savedRequest);
|
|
6150
6166
|
state.requestId = savedRequest;
|
|
6167
|
+
this.order_id = savedRequest;
|
|
6151
6168
|
}
|
|
6152
6169
|
this.apiCall = new ApiCall();
|
|
6153
6170
|
await this.initializeRequest();
|
|
@@ -6174,7 +6191,7 @@ const IdentificationComponent = class {
|
|
|
6174
6191
|
}
|
|
6175
6192
|
}
|
|
6176
6193
|
catch (e) {
|
|
6177
|
-
this.apiErrorEmitter(e);
|
|
6194
|
+
this.apiErrorEmitter(e, 'Request Initialisation RequestId:' + state.requestId + ' RedirectId:' + state.redirectId);
|
|
6178
6195
|
}
|
|
6179
6196
|
}
|
|
6180
6197
|
render() {
|
|
@@ -6240,11 +6257,12 @@ const landingValidationCss = "";
|
|
|
6240
6257
|
const LandingValidation = class {
|
|
6241
6258
|
constructor(hostRef) {
|
|
6242
6259
|
index.registerInstance(this, hostRef);
|
|
6260
|
+
this.apiErrorEvent = index.createEvent(this, "apiError", 7);
|
|
6243
6261
|
this.device = undefined;
|
|
6244
6262
|
this.warningText = undefined;
|
|
6245
6263
|
}
|
|
6246
6264
|
async componentWillLoad() {
|
|
6247
|
-
|
|
6265
|
+
this.apiCall = new ApiCall();
|
|
6248
6266
|
await this.initRequest();
|
|
6249
6267
|
}
|
|
6250
6268
|
componentDidLoad() {
|
|
@@ -6274,7 +6292,14 @@ const LandingValidation = class {
|
|
|
6274
6292
|
}
|
|
6275
6293
|
async leaveFlow() {
|
|
6276
6294
|
state.initialised = false;
|
|
6277
|
-
|
|
6295
|
+
try {
|
|
6296
|
+
await this.apiCall.AbortRequest();
|
|
6297
|
+
Events.flowAborted();
|
|
6298
|
+
}
|
|
6299
|
+
catch (e) {
|
|
6300
|
+
Events.flowAborted();
|
|
6301
|
+
this.apiErrorEvent.emit(e);
|
|
6302
|
+
}
|
|
6278
6303
|
}
|
|
6279
6304
|
render() {
|
|
6280
6305
|
return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", null, index.h("h1", { class: "text-center" }, LandingValues.Title), index.h("div", { class: "d-flex space-between align-center" }, index.h("p", { class: "main-text font-size-2" }, LandingValues.Description), index.h("div", { class: "img-info" }, index.h("div", { class: "i-effect" }), index.h("img", { src: infoSvg })))), index.h("div", { class: "info-container" }, index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: idSvg })), index.h("h3", null, LandingValues.IdInfo)), index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: deviceSvg })), index.h("h3", null, LandingValues.DeviceInfo)), index.h("div", { class: "img-text" }, index.h("div", { class: "bg-img" }, index.h("img", { src: validationSvg })), index.h("h3", null, LandingValues.SmsInfo))), index.h("div", { class: "terms-container" }, index.h("h3", { class: "font-size-2 mb-1 text-center" }, this.warningText)), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", type: "button", disabled: !state.initialised, onClick: () => this.startFlow() }, LandingValues.Button), index.h("p", { class: "main-text font-size-2 link-text mb-0", onClick: () => this.leaveFlow() }, LandingValues.ButtonLeave), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, LandingValues.FooterText))))));
|
|
@@ -9214,6 +9239,12 @@ const MobileRedirect = class {
|
|
|
9214
9239
|
this.infoTextTop = MobileRedirectValues.InfoWaiting;
|
|
9215
9240
|
this.waitingMobile = true;
|
|
9216
9241
|
}
|
|
9242
|
+
if (this.orderStatus == OrderStatuses.Aborted) {
|
|
9243
|
+
this.waitingMobile = false;
|
|
9244
|
+
this.infoTextTop = MobileRedirectValues.InfoAborted;
|
|
9245
|
+
Events.init(window);
|
|
9246
|
+
Events.flowAborted();
|
|
9247
|
+
}
|
|
9217
9248
|
}
|
|
9218
9249
|
async buttonClick() {
|
|
9219
9250
|
if (this.contact == '' || this.contact.length != 10) {
|
|
@@ -8,13 +8,14 @@ import idValidation from '../../../assets/landing/validation.svg';
|
|
|
8
8
|
import store from '../../../helpers/store';
|
|
9
9
|
import Events from '../../../helpers/Events';
|
|
10
10
|
import { FlowStatus } from '../../../models/FlowStatus';
|
|
11
|
+
import { ApiCall } from '../../../helpers/ApiCall';
|
|
11
12
|
export class LandingValidation {
|
|
12
13
|
constructor() {
|
|
13
14
|
this.device = undefined;
|
|
14
15
|
this.warningText = undefined;
|
|
15
16
|
}
|
|
16
17
|
async componentWillLoad() {
|
|
17
|
-
|
|
18
|
+
this.apiCall = new ApiCall();
|
|
18
19
|
await this.initRequest();
|
|
19
20
|
}
|
|
20
21
|
componentDidLoad() {
|
|
@@ -44,7 +45,14 @@ export class LandingValidation {
|
|
|
44
45
|
}
|
|
45
46
|
async leaveFlow() {
|
|
46
47
|
store.initialised = false;
|
|
47
|
-
|
|
48
|
+
try {
|
|
49
|
+
await this.apiCall.AbortRequest();
|
|
50
|
+
Events.flowAborted();
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
Events.flowAborted();
|
|
54
|
+
this.apiErrorEvent.emit(e);
|
|
55
|
+
}
|
|
48
56
|
}
|
|
49
57
|
render() {
|
|
50
58
|
return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", null, h("h1", { class: "text-center" }, LandingValues.Title), h("div", { class: "d-flex space-between align-center" }, h("p", { class: "main-text font-size-2" }, LandingValues.Description), h("div", { class: "img-info" }, h("div", { class: "i-effect" }), h("img", { src: info })))), h("div", { class: "info-container" }, h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idSvg })), h("h3", null, LandingValues.IdInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idDevice })), h("h3", null, LandingValues.DeviceInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idValidation })), h("h3", null, LandingValues.SmsInfo))), h("div", { class: "terms-container" }, h("h3", { class: "font-size-2 mb-1 text-center" }, this.warningText)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: !store.initialised, onClick: () => this.startFlow() }, LandingValues.Button), h("p", { class: "main-text font-size-2 link-text mb-0", onClick: () => this.leaveFlow() }, LandingValues.ButtonLeave), h("p", { class: "main-text font-size-18 text-right mb-0" }, LandingValues.FooterText))))));
|
|
@@ -89,4 +97,22 @@ export class LandingValidation {
|
|
|
89
97
|
"warningText": {}
|
|
90
98
|
};
|
|
91
99
|
}
|
|
100
|
+
static get events() {
|
|
101
|
+
return [{
|
|
102
|
+
"method": "apiErrorEvent",
|
|
103
|
+
"name": "apiError",
|
|
104
|
+
"bubbles": true,
|
|
105
|
+
"cancelable": true,
|
|
106
|
+
"composed": true,
|
|
107
|
+
"docs": {
|
|
108
|
+
"tags": [],
|
|
109
|
+
"text": ""
|
|
110
|
+
},
|
|
111
|
+
"complexType": {
|
|
112
|
+
"original": "any",
|
|
113
|
+
"resolved": "any",
|
|
114
|
+
"references": {}
|
|
115
|
+
}
|
|
116
|
+
}];
|
|
117
|
+
}
|
|
92
118
|
}
|
|
@@ -3,6 +3,7 @@ import { MobileRedirectValues } from '../../../helpers/textValues';
|
|
|
3
3
|
import QRCode from 'qrcode';
|
|
4
4
|
import store from '../../../helpers/store';
|
|
5
5
|
import { ApiCall } from '../../../helpers/ApiCall';
|
|
6
|
+
import Events from '../../../helpers/Events';
|
|
6
7
|
import { OrderStatuses } from '../../../models/OrderStatuses';
|
|
7
8
|
import { FlowStatus } from '../../../models/FlowStatus';
|
|
8
9
|
export class MobileRedirect {
|
|
@@ -60,6 +61,12 @@ export class MobileRedirect {
|
|
|
60
61
|
this.infoTextTop = MobileRedirectValues.InfoWaiting;
|
|
61
62
|
this.waitingMobile = true;
|
|
62
63
|
}
|
|
64
|
+
if (this.orderStatus == OrderStatuses.Aborted) {
|
|
65
|
+
this.waitingMobile = false;
|
|
66
|
+
this.infoTextTop = MobileRedirectValues.InfoAborted;
|
|
67
|
+
Events.init(window);
|
|
68
|
+
Events.flowAborted();
|
|
69
|
+
}
|
|
63
70
|
}
|
|
64
71
|
async buttonClick() {
|
|
65
72
|
if (this.contact == '' || this.contact.length != 10) {
|
|
@@ -9,6 +9,7 @@ import Events from '../../helpers/Events';
|
|
|
9
9
|
import * as uuid from 'uuid';
|
|
10
10
|
export class IdentificationComponent {
|
|
11
11
|
async onTokenChange(newValue, _oldValue) {
|
|
12
|
+
console.log('Token change called with value: ' + newValue);
|
|
12
13
|
if (newValue == '') {
|
|
13
14
|
newValue = store.token;
|
|
14
15
|
return;
|
|
@@ -19,6 +20,7 @@ export class IdentificationComponent {
|
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
async onOrderIdChange(newValue, _oldValue) {
|
|
23
|
+
console.log('OrderId change called with value: ' + newValue);
|
|
22
24
|
if (store.requestId !== newValue && newValue != '') {
|
|
23
25
|
store.requestId = newValue;
|
|
24
26
|
store.initialised = false;
|
|
@@ -47,6 +49,7 @@ export class IdentificationComponent {
|
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
async onRedirectIdChange(newValue, _oldValue) {
|
|
52
|
+
console.log('RedirectId change called with value: ' + newValue);
|
|
50
53
|
if (store.redirectId != '') {
|
|
51
54
|
newValue = store.redirectId;
|
|
52
55
|
return;
|
|
@@ -70,12 +73,12 @@ export class IdentificationComponent {
|
|
|
70
73
|
this.apiCall.GenerateAgreement(data.detail.agreementType);
|
|
71
74
|
}
|
|
72
75
|
catch (e) {
|
|
73
|
-
this.apiErrorEmitter(e);
|
|
76
|
+
this.apiErrorEmitter(e, 'Agreement Acceptance');
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
|
-
async apiErrorEmitter(data) {
|
|
79
|
+
async apiErrorEmitter(data, zone) {
|
|
77
80
|
var _a, _b;
|
|
78
|
-
let apiLogData = { message: '', stack: '' };
|
|
81
|
+
let apiLogData = { message: '', stack: '', zone };
|
|
79
82
|
if (data.detail) {
|
|
80
83
|
this.errorTitle = (_a = data.detail.message) !== null && _a !== void 0 ? _a : '';
|
|
81
84
|
this.errorMessage = (_b = data.detail.stack) !== null && _b !== void 0 ? _b : '';
|
|
@@ -111,10 +114,13 @@ export class IdentificationComponent {
|
|
|
111
114
|
store.apiBaseUrl = this.api_url;
|
|
112
115
|
store.environment = this.env;
|
|
113
116
|
if (this.token) {
|
|
117
|
+
console.log('Store Token set with property value: ' + this.token);
|
|
114
118
|
store.token = this.token;
|
|
115
119
|
}
|
|
116
|
-
else {
|
|
120
|
+
else if (store.token == '') {
|
|
117
121
|
store.token = sessionStorage.getItem(SessionKeys.TokenKey);
|
|
122
|
+
this.token = store.token;
|
|
123
|
+
console.log('Store Token set with session value: ' + store.token);
|
|
118
124
|
}
|
|
119
125
|
if (this.redirect_id) {
|
|
120
126
|
store.redirectId = this.redirect_id;
|
|
@@ -146,16 +152,19 @@ export class IdentificationComponent {
|
|
|
146
152
|
store.phoneValidation = true;
|
|
147
153
|
}
|
|
148
154
|
const savedRequest = sessionStorage.getItem(SessionKeys.RequestIdKey);
|
|
149
|
-
if (this.order_id) {
|
|
155
|
+
if (this.order_id && this.order_id != '') {
|
|
156
|
+
console.log('Current RequestId has value: ' + this.order_id);
|
|
150
157
|
if (savedRequest && savedRequest != '' && savedRequest != this.order_id) {
|
|
151
|
-
|
|
158
|
+
console.log('Session RequestId: ' + savedRequest + ' has different value than property one: ' + this.order_id);
|
|
152
159
|
store.flowStatus = FlowStatus.LANDING;
|
|
153
160
|
store.initialised = false;
|
|
154
161
|
}
|
|
155
162
|
store.requestId = this.order_id;
|
|
156
163
|
}
|
|
157
164
|
else if (savedRequest) {
|
|
165
|
+
console.log('Current RequestId has no value, setting with session value: ' + savedRequest);
|
|
158
166
|
store.requestId = savedRequest;
|
|
167
|
+
this.order_id = savedRequest;
|
|
159
168
|
}
|
|
160
169
|
this.apiCall = new ApiCall();
|
|
161
170
|
await this.initializeRequest();
|
|
@@ -182,7 +191,7 @@ export class IdentificationComponent {
|
|
|
182
191
|
}
|
|
183
192
|
}
|
|
184
193
|
catch (e) {
|
|
185
|
-
this.apiErrorEmitter(e);
|
|
194
|
+
this.apiErrorEmitter(e, 'Request Initialisation RequestId:' + store.requestId + ' RedirectId:' + store.redirectId);
|
|
186
195
|
}
|
|
187
196
|
}
|
|
188
197
|
render() {
|
|
@@ -55,6 +55,7 @@ export class ApiCall {
|
|
|
55
55
|
return jsonResp.valid;
|
|
56
56
|
}
|
|
57
57
|
async AddIdentificationRequest(deviceInfo) {
|
|
58
|
+
console.log('Calling identity request with store:' + JSON.stringify(store));
|
|
58
59
|
let data = {
|
|
59
60
|
requestId: store.requestId,
|
|
60
61
|
clientDeviceInfo: JSON.stringify(deviceInfo),
|
|
@@ -112,4 +113,8 @@ export class ApiCall {
|
|
|
112
113
|
}
|
|
113
114
|
catch (_a) { }
|
|
114
115
|
}
|
|
116
|
+
async AbortRequest() {
|
|
117
|
+
let result = await this.post(this.urls.AbortRequest, JSON.stringify({ requestId: store.requestId }));
|
|
118
|
+
return result.saved;
|
|
119
|
+
}
|
|
115
120
|
}
|
|
@@ -119,6 +119,7 @@ export class ApiUrls {
|
|
|
119
119
|
this.SendLink = this.uriEnv + 'validation/otp/sendlink';
|
|
120
120
|
this.GetStatus = this.uriEnv + 'validation/identity/status';
|
|
121
121
|
this.AddLog = this.uriEnv + 'validation/logs/add';
|
|
122
|
+
this.AbortRequest = this.uriEnv + 'validation/identity/abort';
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
export class MobileRedirectValues extends GlobalValues {
|
|
@@ -127,3 +128,4 @@ MobileRedirectValues.InfoTop = 'Pentru a continua scanați codul de mai jos cu u
|
|
|
127
128
|
MobileRedirectValues.InfoBottom = 'Sau introduceți un număr de telefon pentru a primi link-ul pe smartphone.';
|
|
128
129
|
MobileRedirectValues.Validation = 'Număr de telefon invalid!';
|
|
129
130
|
MobileRedirectValues.InfoWaiting = 'Așteptăm finalizarea procesului pe smartphone.';
|
|
131
|
+
MobileRedirectValues.InfoAborted = 'Procesului de pe smartphone a fost amanat.';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,4 +4,5 @@ export var OrderStatuses;
|
|
|
4
4
|
OrderStatuses[OrderStatuses["FinishedCapturing"] = 1] = "FinishedCapturing";
|
|
5
5
|
OrderStatuses[OrderStatuses["Waiting"] = 2] = "Waiting";
|
|
6
6
|
OrderStatuses[OrderStatuses["NotFound"] = 3] = "NotFound";
|
|
7
|
+
OrderStatuses[OrderStatuses["Aborted"] = 4] = "Aborted";
|
|
7
8
|
})(OrderStatuses || (OrderStatuses = {}));
|
|
@@ -6,6 +6,7 @@ var OrderStatuses;
|
|
|
6
6
|
OrderStatuses[OrderStatuses["FinishedCapturing"] = 1] = "FinishedCapturing";
|
|
7
7
|
OrderStatuses[OrderStatuses["Waiting"] = 2] = "Waiting";
|
|
8
8
|
OrderStatuses[OrderStatuses["NotFound"] = 3] = "NotFound";
|
|
9
|
+
OrderStatuses[OrderStatuses["Aborted"] = 4] = "Aborted";
|
|
9
10
|
})(OrderStatuses || (OrderStatuses = {}));
|
|
10
11
|
|
|
11
12
|
const appendToMap = (map, propName, value) => {
|
|
@@ -332,6 +333,7 @@ class ApiUrls {
|
|
|
332
333
|
this.SendLink = this.uriEnv + 'validation/otp/sendlink';
|
|
333
334
|
this.GetStatus = this.uriEnv + 'validation/identity/status';
|
|
334
335
|
this.AddLog = this.uriEnv + 'validation/logs/add';
|
|
336
|
+
this.AbortRequest = this.uriEnv + 'validation/identity/abort';
|
|
335
337
|
}
|
|
336
338
|
}
|
|
337
339
|
class MobileRedirectValues extends GlobalValues {
|
|
@@ -339,7 +341,8 @@ class MobileRedirectValues extends GlobalValues {
|
|
|
339
341
|
MobileRedirectValues.InfoTop = 'Pentru a continua scanați codul de mai jos cu un smartphone.';
|
|
340
342
|
MobileRedirectValues.InfoBottom = 'Sau introduceți un număr de telefon pentru a primi link-ul pe smartphone.';
|
|
341
343
|
MobileRedirectValues.Validation = 'Număr de telefon invalid!';
|
|
342
|
-
MobileRedirectValues.InfoWaiting = 'Așteptăm finalizarea procesului pe smartphone.';
|
|
344
|
+
MobileRedirectValues.InfoWaiting = 'Așteptăm finalizarea procesului pe smartphone.';
|
|
345
|
+
MobileRedirectValues.InfoAborted = 'Procesului de pe smartphone a fost amanat.';
|
|
343
346
|
|
|
344
347
|
const { state, onChange } = createStore({
|
|
345
348
|
flowStatus: FlowStatus.LANDING,
|
|
@@ -431,6 +434,7 @@ class ApiCall {
|
|
|
431
434
|
return jsonResp.valid;
|
|
432
435
|
}
|
|
433
436
|
async AddIdentificationRequest(deviceInfo) {
|
|
437
|
+
console.log('Calling identity request with store:' + JSON.stringify(state));
|
|
434
438
|
let data = {
|
|
435
439
|
requestId: state.requestId,
|
|
436
440
|
clientDeviceInfo: JSON.stringify(deviceInfo),
|
|
@@ -488,6 +492,10 @@ class ApiCall {
|
|
|
488
492
|
}
|
|
489
493
|
catch (_a) { }
|
|
490
494
|
}
|
|
495
|
+
async AbortRequest() {
|
|
496
|
+
let result = await this.post(this.urls.AbortRequest, JSON.stringify({ requestId: state.requestId }));
|
|
497
|
+
return result.saved;
|
|
498
|
+
}
|
|
491
499
|
}
|
|
492
500
|
|
|
493
501
|
const agreementCheckCss = "";
|
|
@@ -5996,6 +6004,7 @@ const identificationComponentCss = "@font-face{font-family:'Inter';font-style:no
|
|
|
5996
6004
|
|
|
5997
6005
|
const IdentificationComponent = class {
|
|
5998
6006
|
async onTokenChange(newValue, _oldValue) {
|
|
6007
|
+
console.log('Token change called with value: ' + newValue);
|
|
5999
6008
|
if (newValue == '') {
|
|
6000
6009
|
newValue = state.token;
|
|
6001
6010
|
return;
|
|
@@ -6006,6 +6015,7 @@ const IdentificationComponent = class {
|
|
|
6006
6015
|
}
|
|
6007
6016
|
}
|
|
6008
6017
|
async onOrderIdChange(newValue, _oldValue) {
|
|
6018
|
+
console.log('OrderId change called with value: ' + newValue);
|
|
6009
6019
|
if (state.requestId !== newValue && newValue != '') {
|
|
6010
6020
|
state.requestId = newValue;
|
|
6011
6021
|
state.initialised = false;
|
|
@@ -6034,6 +6044,7 @@ const IdentificationComponent = class {
|
|
|
6034
6044
|
}
|
|
6035
6045
|
}
|
|
6036
6046
|
async onRedirectIdChange(newValue, _oldValue) {
|
|
6047
|
+
console.log('RedirectId change called with value: ' + newValue);
|
|
6037
6048
|
if (state.redirectId != '') {
|
|
6038
6049
|
newValue = state.redirectId;
|
|
6039
6050
|
return;
|
|
@@ -6057,12 +6068,12 @@ const IdentificationComponent = class {
|
|
|
6057
6068
|
this.apiCall.GenerateAgreement(data.detail.agreementType);
|
|
6058
6069
|
}
|
|
6059
6070
|
catch (e) {
|
|
6060
|
-
this.apiErrorEmitter(e);
|
|
6071
|
+
this.apiErrorEmitter(e, 'Agreement Acceptance');
|
|
6061
6072
|
}
|
|
6062
6073
|
}
|
|
6063
|
-
async apiErrorEmitter(data) {
|
|
6074
|
+
async apiErrorEmitter(data, zone) {
|
|
6064
6075
|
var _a, _b;
|
|
6065
|
-
let apiLogData = { message: '', stack: '' };
|
|
6076
|
+
let apiLogData = { message: '', stack: '', zone };
|
|
6066
6077
|
if (data.detail) {
|
|
6067
6078
|
this.errorTitle = (_a = data.detail.message) !== null && _a !== void 0 ? _a : '';
|
|
6068
6079
|
this.errorMessage = (_b = data.detail.stack) !== null && _b !== void 0 ? _b : '';
|
|
@@ -6099,10 +6110,13 @@ const IdentificationComponent = class {
|
|
|
6099
6110
|
state.apiBaseUrl = this.api_url;
|
|
6100
6111
|
state.environment = this.env;
|
|
6101
6112
|
if (this.token) {
|
|
6113
|
+
console.log('Store Token set with property value: ' + this.token);
|
|
6102
6114
|
state.token = this.token;
|
|
6103
6115
|
}
|
|
6104
|
-
else {
|
|
6116
|
+
else if (state.token == '') {
|
|
6105
6117
|
state.token = sessionStorage.getItem(SessionKeys.TokenKey);
|
|
6118
|
+
this.token = state.token;
|
|
6119
|
+
console.log('Store Token set with session value: ' + state.token);
|
|
6106
6120
|
}
|
|
6107
6121
|
if (this.redirect_id) {
|
|
6108
6122
|
state.redirectId = this.redirect_id;
|
|
@@ -6134,16 +6148,19 @@ const IdentificationComponent = class {
|
|
|
6134
6148
|
state.phoneValidation = true;
|
|
6135
6149
|
}
|
|
6136
6150
|
const savedRequest = sessionStorage.getItem(SessionKeys.RequestIdKey);
|
|
6137
|
-
if (this.order_id) {
|
|
6151
|
+
if (this.order_id && this.order_id != '') {
|
|
6152
|
+
console.log('Current RequestId has value: ' + this.order_id);
|
|
6138
6153
|
if (savedRequest && savedRequest != '' && savedRequest != this.order_id) {
|
|
6139
|
-
|
|
6154
|
+
console.log('Session RequestId: ' + savedRequest + ' has different value than property one: ' + this.order_id);
|
|
6140
6155
|
state.flowStatus = FlowStatus.LANDING;
|
|
6141
6156
|
state.initialised = false;
|
|
6142
6157
|
}
|
|
6143
6158
|
state.requestId = this.order_id;
|
|
6144
6159
|
}
|
|
6145
6160
|
else if (savedRequest) {
|
|
6161
|
+
console.log('Current RequestId has no value, setting with session value: ' + savedRequest);
|
|
6146
6162
|
state.requestId = savedRequest;
|
|
6163
|
+
this.order_id = savedRequest;
|
|
6147
6164
|
}
|
|
6148
6165
|
this.apiCall = new ApiCall();
|
|
6149
6166
|
await this.initializeRequest();
|
|
@@ -6170,7 +6187,7 @@ const IdentificationComponent = class {
|
|
|
6170
6187
|
}
|
|
6171
6188
|
}
|
|
6172
6189
|
catch (e) {
|
|
6173
|
-
this.apiErrorEmitter(e);
|
|
6190
|
+
this.apiErrorEmitter(e, 'Request Initialisation RequestId:' + state.requestId + ' RedirectId:' + state.redirectId);
|
|
6174
6191
|
}
|
|
6175
6192
|
}
|
|
6176
6193
|
render() {
|
|
@@ -6236,11 +6253,12 @@ const landingValidationCss = "";
|
|
|
6236
6253
|
const LandingValidation = class {
|
|
6237
6254
|
constructor(hostRef) {
|
|
6238
6255
|
registerInstance(this, hostRef);
|
|
6256
|
+
this.apiErrorEvent = createEvent(this, "apiError", 7);
|
|
6239
6257
|
this.device = undefined;
|
|
6240
6258
|
this.warningText = undefined;
|
|
6241
6259
|
}
|
|
6242
6260
|
async componentWillLoad() {
|
|
6243
|
-
|
|
6261
|
+
this.apiCall = new ApiCall();
|
|
6244
6262
|
await this.initRequest();
|
|
6245
6263
|
}
|
|
6246
6264
|
componentDidLoad() {
|
|
@@ -6270,7 +6288,14 @@ const LandingValidation = class {
|
|
|
6270
6288
|
}
|
|
6271
6289
|
async leaveFlow() {
|
|
6272
6290
|
state.initialised = false;
|
|
6273
|
-
|
|
6291
|
+
try {
|
|
6292
|
+
await this.apiCall.AbortRequest();
|
|
6293
|
+
Events.flowAborted();
|
|
6294
|
+
}
|
|
6295
|
+
catch (e) {
|
|
6296
|
+
Events.flowAborted();
|
|
6297
|
+
this.apiErrorEvent.emit(e);
|
|
6298
|
+
}
|
|
6274
6299
|
}
|
|
6275
6300
|
render() {
|
|
6276
6301
|
return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", null, h("h1", { class: "text-center" }, LandingValues.Title), h("div", { class: "d-flex space-between align-center" }, h("p", { class: "main-text font-size-2" }, LandingValues.Description), h("div", { class: "img-info" }, h("div", { class: "i-effect" }), h("img", { src: infoSvg })))), h("div", { class: "info-container" }, h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: idSvg })), h("h3", null, LandingValues.IdInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: deviceSvg })), h("h3", null, LandingValues.DeviceInfo)), h("div", { class: "img-text" }, h("div", { class: "bg-img" }, h("img", { src: validationSvg })), h("h3", null, LandingValues.SmsInfo))), h("div", { class: "terms-container" }, h("h3", { class: "font-size-2 mb-1 text-center" }, this.warningText)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", type: "button", disabled: !state.initialised, onClick: () => this.startFlow() }, LandingValues.Button), h("p", { class: "main-text font-size-2 link-text mb-0", onClick: () => this.leaveFlow() }, LandingValues.ButtonLeave), h("p", { class: "main-text font-size-18 text-right mb-0" }, LandingValues.FooterText))))));
|
|
@@ -9210,6 +9235,12 @@ const MobileRedirect = class {
|
|
|
9210
9235
|
this.infoTextTop = MobileRedirectValues.InfoWaiting;
|
|
9211
9236
|
this.waitingMobile = true;
|
|
9212
9237
|
}
|
|
9238
|
+
if (this.orderStatus == OrderStatuses.Aborted) {
|
|
9239
|
+
this.waitingMobile = false;
|
|
9240
|
+
this.infoTextTop = MobileRedirectValues.InfoAborted;
|
|
9241
|
+
Events.init(window);
|
|
9242
|
+
Events.flowAborted();
|
|
9243
|
+
}
|
|
9213
9244
|
}
|
|
9214
9245
|
async buttonClick() {
|
|
9215
9246
|
if (this.contact == '' || this.contact.length != 10) {
|