@tap-payments/auth-jsconnect 2.6.19-test → 2.6.23-test
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/build/@types/app.d.ts +2 -1
- package/build/@types/app.js +1 -0
- package/build/api/auth.d.ts +1 -0
- package/build/api/auth.js +5 -1
- package/build/api/index.d.ts +2 -0
- package/build/api/lead.d.ts +1 -0
- package/build/api/lead.js +50 -1
- package/build/app/rootReducer.d.ts +1 -0
- package/build/app/rootReducer.js +3 -1
- package/build/app/store.d.ts +2 -0
- package/build/components/AnimationFlow/AnimationFlow.d.ts +2 -1
- package/build/components/AnimationFlow/AnimationFlow.js +3 -3
- package/build/components/AnimationFlow/Dialog.d.ts +2 -1
- package/build/components/AnimationFlow/Dialog.js +2 -2
- package/build/constants/api.d.ts +2 -0
- package/build/constants/api.js +4 -0
- package/build/constants/app.d.ts +5 -0
- package/build/constants/app.js +24 -0
- package/build/constants/dummy.js +0 -19
- package/build/features/app/board/boardStore.d.ts +30 -0
- package/build/features/app/board/boardStore.js +223 -0
- package/build/features/app/connect/connectStore.d.ts +3 -1
- package/build/features/app/connect/connectStore.js +6 -2
- package/build/features/app/connectExpress/connectExpressStore.d.ts +4 -2
- package/build/features/app/connectExpress/connectExpressStore.js +93 -8
- package/build/features/board/Board.d.ts +9 -0
- package/build/features/board/Board.js +73 -0
- package/build/features/board/index.d.ts +1 -0
- package/build/features/board/index.js +1 -0
- package/build/features/board/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/board/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +21 -0
- package/build/features/board/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/board/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
- package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +27 -0
- package/build/features/board/screens/SuccessWithFlowButtons/index.d.ts +2 -0
- package/build/features/board/screens/SuccessWithFlowButtons/index.js +2 -0
- package/build/features/board/screens/Verify/OTPInput.d.ts +7 -0
- package/build/features/board/screens/Verify/OTPInput.js +51 -0
- package/build/features/board/screens/Verify/Verify.d.ts +5 -0
- package/build/features/board/screens/Verify/Verify.js +74 -0
- package/build/features/board/screens/Verify/index.d.ts +2 -0
- package/build/features/board/screens/Verify/index.js +2 -0
- package/build/features/board/screens/Verify/validation.d.ts +8 -0
- package/build/features/board/screens/Verify/validation.js +4 -0
- package/build/features/connect/Connect.js +1 -1
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +4 -1
- package/build/features/connect/screens/CivilID/CivilID.js +5 -2
- package/build/features/connect/screens/Mobile/Mobile.js +5 -2
- package/build/features/connect/screens/NID/NID.js +5 -2
- package/build/features/connectExpress/ConnectExpress.js +8 -7
- package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +4 -1
- package/build/features/connectExpress/screens/CivilID/CivilID.js +9 -3
- package/build/features/connectExpress/screens/CivilID/IDNumber.js +7 -2
- package/build/features/connectExpress/screens/Mobile/Mobile.js +6 -3
- package/build/features/connectExpress/screens/Mobile/TAC.js +1 -1
- package/build/features/connectExpress/screens/NID/NID.js +5 -2
- package/build/features/featuresScreens.d.ts +1 -0
- package/build/features/featuresScreens.js +17 -0
- package/build/features/shared/BusinessCountry/BusinessCountry.js +11 -10
- package/build/hooks/useAppDispatch.d.ts +1 -0
- package/build/index.d.ts +3 -2
- package/build/index.js +4 -2
- package/package.json +1 -1
package/build/@types/app.d.ts
CHANGED
package/build/@types/app.js
CHANGED
package/build/api/auth.d.ts
CHANGED
|
@@ -89,5 +89,6 @@ declare const authService: {
|
|
|
89
89
|
createExpressAuth: (data: CreateAuthBody, config?: AxiosRequestConfig) => Promise<any>;
|
|
90
90
|
verifyExpressLeadIdentity: (data: VerifyAuthExpressOTPBody) => Promise<any>;
|
|
91
91
|
createExpressLeadIdentityAuth: (data: CreateAuthBody) => Promise<any>;
|
|
92
|
+
getVerifyExpressAuth: (token: string, config?: AxiosRequestConfig) => Promise<any>;
|
|
92
93
|
};
|
|
93
94
|
export { authService };
|
package/build/api/auth.js
CHANGED
|
@@ -40,6 +40,9 @@ var verifyExpressAuth = function (data) {
|
|
|
40
40
|
data: data
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
|
+
var getVerifyExpressAuth = function (token, config) {
|
|
44
|
+
return httpClient(__assign({ method: 'get', url: "".concat(ENDPOINT_PATHS.Verify_Express_Auth_PACI_PATH, "/").concat(token) }, config));
|
|
45
|
+
};
|
|
43
46
|
var verifyExpressLeadIdentity = function (data) {
|
|
44
47
|
return httpClient({
|
|
45
48
|
method: 'put',
|
|
@@ -71,6 +74,7 @@ var authService = {
|
|
|
71
74
|
createAuthKitNID: createAuthKitNID,
|
|
72
75
|
createExpressAuth: createExpressAuth,
|
|
73
76
|
verifyExpressLeadIdentity: verifyExpressLeadIdentity,
|
|
74
|
-
createExpressLeadIdentityAuth: createExpressLeadIdentityAuth
|
|
77
|
+
createExpressLeadIdentityAuth: createExpressLeadIdentityAuth,
|
|
78
|
+
getVerifyExpressAuth: getVerifyExpressAuth
|
|
75
79
|
};
|
|
76
80
|
export { authService };
|
package/build/api/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ declare const API: {
|
|
|
40
40
|
createExpressAuth: (data: CreateAuthBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
41
41
|
verifyExpressLeadIdentity: (data: VerifyAuthExpressOTPBody) => Promise<any>;
|
|
42
42
|
createExpressLeadIdentityAuth: (data: CreateAuthBody) => Promise<any>;
|
|
43
|
+
getVerifyExpressAuth: (token: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
43
44
|
};
|
|
44
45
|
leadService: {
|
|
45
46
|
createLead: (data: CreateLeadBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
@@ -52,6 +53,7 @@ declare const API: {
|
|
|
52
53
|
retrieveLeadIdentity: (leadId: string) => Promise<any>;
|
|
53
54
|
updateLeadExpress: ({ id, ...data }: UpdateLeadBody) => Promise<any>;
|
|
54
55
|
verifyExpressLeadToken: (data: ExpressLeadVerifyBody) => Promise<any>;
|
|
56
|
+
createVerifyTokenByLeadId: (leadId: string) => Promise<any>;
|
|
55
57
|
};
|
|
56
58
|
entityService: {
|
|
57
59
|
createEntityInfo: ({ id, ...data }: EntityInfoBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
package/build/api/lead.d.ts
CHANGED
|
@@ -105,5 +105,6 @@ declare const leadService: {
|
|
|
105
105
|
retrieveLeadIdentity: (leadId: string) => Promise<any>;
|
|
106
106
|
updateLeadExpress: ({ id, ...data }: UpdateLeadBody) => Promise<any>;
|
|
107
107
|
verifyExpressLeadToken: (data: ExpressLeadVerifyBody) => Promise<any>;
|
|
108
|
+
createVerifyTokenByLeadId: (leadId: string) => Promise<any>;
|
|
108
109
|
};
|
|
109
110
|
export { leadService };
|
package/build/api/lead.js
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (_) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
1
37
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
38
|
var t = {};
|
|
3
39
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -61,6 +97,18 @@ var retrieveLeadIdentity = function (leadId) {
|
|
|
61
97
|
url: "".concat(ENDPOINT_PATHS.LEAD, "/").concat(leadId, "/identity")
|
|
62
98
|
});
|
|
63
99
|
};
|
|
100
|
+
var createVerifyTokenByLeadId = function (leadId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
101
|
+
return __generator(this, function (_a) {
|
|
102
|
+
return [2, httpClient({
|
|
103
|
+
method: 'post',
|
|
104
|
+
url: "".concat(ENDPOINT_PATHS.CREATE_TOKEN_PATH),
|
|
105
|
+
data: {
|
|
106
|
+
service_name: 'tap_email',
|
|
107
|
+
lead_id: leadId
|
|
108
|
+
}
|
|
109
|
+
})];
|
|
110
|
+
});
|
|
111
|
+
}); };
|
|
64
112
|
var leadService = {
|
|
65
113
|
createLead: createLead,
|
|
66
114
|
updateLead: updateLead,
|
|
@@ -71,6 +119,7 @@ var leadService = {
|
|
|
71
119
|
retrieveEntityList: retrieveEntityList,
|
|
72
120
|
retrieveLeadIdentity: retrieveLeadIdentity,
|
|
73
121
|
updateLeadExpress: updateLeadExpress,
|
|
74
|
-
verifyExpressLeadToken: verifyExpressLeadToken
|
|
122
|
+
verifyExpressLeadToken: verifyExpressLeadToken,
|
|
123
|
+
createVerifyTokenByLeadId: createVerifyTokenByLeadId
|
|
75
124
|
};
|
|
76
125
|
export { leadService };
|
|
@@ -10,5 +10,6 @@ declare const rootReducer: {
|
|
|
10
10
|
entity: import("redux").Reducer<import("../features/app/entity/entityStore").EntityState, import("redux").AnyAction>;
|
|
11
11
|
brand: import("redux").Reducer<import("../features/app/brand/brandStore").BrandState, import("redux").AnyAction>;
|
|
12
12
|
connectExpress: import("redux").Reducer<import("../features/app/connectExpress/connectExpressStore").ConnectExpressState, import("redux").AnyAction>;
|
|
13
|
+
board: import("redux").Reducer<import("../features/app/board/boardStore").BoardState, import("redux").AnyAction>;
|
|
13
14
|
};
|
|
14
15
|
export default rootReducer;
|
package/build/app/rootReducer.js
CHANGED
|
@@ -9,6 +9,7 @@ import signIn from '../features/app/signIn/signInStore';
|
|
|
9
9
|
import entity from '../features/app/entity/entityStore';
|
|
10
10
|
import brand from '../features/app/brand/brandStore';
|
|
11
11
|
import connectExpress from '../features/app/connectExpress/connectExpressStore';
|
|
12
|
+
import board from '../features/app/board/boardStore';
|
|
12
13
|
var rootReducer = {
|
|
13
14
|
settings: settings,
|
|
14
15
|
connect: connect,
|
|
@@ -20,6 +21,7 @@ var rootReducer = {
|
|
|
20
21
|
signIn: signIn,
|
|
21
22
|
entity: entity,
|
|
22
23
|
brand: brand,
|
|
23
|
-
connectExpress: connectExpress
|
|
24
|
+
connectExpress: connectExpress,
|
|
25
|
+
board: board
|
|
24
26
|
};
|
|
25
27
|
export default rootReducer;
|
package/build/app/store.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
|
11
11
|
entity: import("../features/app/entity/entityStore").EntityState;
|
|
12
12
|
brand: import("../features/app/brand/brandStore").BrandState;
|
|
13
13
|
connectExpress: import("../features/app/connectExpress/connectExpressStore").ConnectExpressState;
|
|
14
|
+
board: import("../features/app/board/boardStore").BoardState;
|
|
14
15
|
}, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<[import("@reduxjs/toolkit").ThunkMiddleware<{
|
|
15
16
|
settings: import("./settings").SettingsState;
|
|
16
17
|
connect: import("../features/app/connect/connectStore").ConnectState;
|
|
@@ -23,6 +24,7 @@ export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
|
23
24
|
entity: import("../features/app/entity/entityStore").EntityState;
|
|
24
25
|
brand: import("../features/app/brand/brandStore").BrandState;
|
|
25
26
|
connectExpress: import("../features/app/connectExpress/connectExpressStore").ConnectExpressState;
|
|
27
|
+
board: import("../features/app/board/boardStore").BoardState;
|
|
26
28
|
}, import("redux").AnyAction, undefined>]>>;
|
|
27
29
|
export declare type AppDispatch = typeof store.dispatch;
|
|
28
30
|
export declare type RootState = ReturnType<typeof store.getState>;
|
|
@@ -15,5 +15,6 @@ export interface AnimationFlowProps {
|
|
|
15
15
|
pointerEvents?: 'auto' | 'none';
|
|
16
16
|
merchantInfo?: MerchantInfo;
|
|
17
17
|
isMaturityExpress?: boolean;
|
|
18
|
+
showTextLogo?: boolean;
|
|
18
19
|
}
|
|
19
|
-
export default function AnimationFlow({ open, children, breakpoint, type, loading, error, isTapOrigin, screenId, animationType, onClose, onConfirm, pointerEvents, merchantInfo, isMaturityExpress }: AnimationFlowProps): JSX.Element;
|
|
20
|
+
export default function AnimationFlow({ open, children, breakpoint, type, loading, error, isTapOrigin, screenId, animationType, onClose, onConfirm, pointerEvents, merchantInfo, isMaturityExpress, showTextLogo }: AnimationFlowProps): JSX.Element;
|
|
@@ -16,7 +16,7 @@ import BottomSheet from './BottomSheet';
|
|
|
16
16
|
import Loader from './Loader';
|
|
17
17
|
import Error from './Error';
|
|
18
18
|
export default function AnimationFlow(_a) {
|
|
19
|
-
var open = _a.open, children = _a.children, breakpoint = _a.breakpoint, type = _a.type, loading = _a.loading, error = _a.error, isTapOrigin = _a.isTapOrigin, screenId = _a.screenId, animationType = _a.animationType, onClose = _a.onClose, onConfirm = _a.onConfirm, _b = _a.pointerEvents, pointerEvents = _b === void 0 ? 'auto' : _b, merchantInfo = _a.merchantInfo, isMaturityExpress = _a.isMaturityExpress;
|
|
19
|
+
var open = _a.open, children = _a.children, breakpoint = _a.breakpoint, type = _a.type, loading = _a.loading, error = _a.error, isTapOrigin = _a.isTapOrigin, screenId = _a.screenId, animationType = _a.animationType, onClose = _a.onClose, onConfirm = _a.onConfirm, _b = _a.pointerEvents, pointerEvents = _b === void 0 ? 'auto' : _b, merchantInfo = _a.merchantInfo, isMaturityExpress = _a.isMaturityExpress, showTextLogo = _a.showTextLogo;
|
|
20
20
|
var small = useScreen(breakpoint).small;
|
|
21
21
|
if (loading) {
|
|
22
22
|
return _jsx(Loader, {});
|
|
@@ -25,10 +25,10 @@ export default function AnimationFlow(_a) {
|
|
|
25
25
|
return _jsx(Error, { error: error });
|
|
26
26
|
}
|
|
27
27
|
if (type === 'PUPOP') {
|
|
28
|
-
return (_jsx(Dialog, __assign({ pointerEvents: pointerEvents, onClose: onClose, onConfirm: onConfirm, open: open, isTapOrigin: isTapOrigin, animationType: animationType, merchantInfo: merchantInfo, isMaturityExpress: isMaturityExpress }, { children: children })));
|
|
28
|
+
return (_jsx(Dialog, __assign({ pointerEvents: pointerEvents, onClose: onClose, onConfirm: onConfirm, open: open, isTapOrigin: isTapOrigin, animationType: animationType, merchantInfo: merchantInfo, isMaturityExpress: isMaturityExpress, showTextLogo: showTextLogo }, { children: children })));
|
|
29
29
|
}
|
|
30
30
|
if (type === 'BOTTOMSHEET') {
|
|
31
31
|
return (_jsx(BottomSheet, __assign({ pointerEvents: pointerEvents, open: open, isMaturityExpress: isMaturityExpress, merchantInfo: merchantInfo }, { children: children })));
|
|
32
32
|
}
|
|
33
|
-
return small ? (_jsx(BottomSheet, __assign({ pointerEvents: pointerEvents, open: open, screenId: screenId, isMaturityExpress: isMaturityExpress, merchantInfo: merchantInfo }, { children: children }))) : (_jsx(Dialog, __assign({ pointerEvents: pointerEvents, onClose: onClose, onConfirm: onConfirm, open: open, isTapOrigin: isTapOrigin, animationType: animationType, merchantInfo: merchantInfo, isMaturityExpress: isMaturityExpress }, { children: children })));
|
|
33
|
+
return small ? (_jsx(BottomSheet, __assign({ pointerEvents: pointerEvents, open: open, screenId: screenId, isMaturityExpress: isMaturityExpress, merchantInfo: merchantInfo }, { children: children }))) : (_jsx(Dialog, __assign({ pointerEvents: pointerEvents, onClose: onClose, onConfirm: onConfirm, open: open, isTapOrigin: isTapOrigin, animationType: animationType, merchantInfo: merchantInfo, isMaturityExpress: isMaturityExpress, showTextLogo: showTextLogo }, { children: children })));
|
|
34
34
|
}
|
|
@@ -12,6 +12,7 @@ export interface DialogProps extends MUIDialogProps {
|
|
|
12
12
|
pointerEvents?: 'none' | 'auto';
|
|
13
13
|
merchantInfo?: MerchantInfo;
|
|
14
14
|
isMaturityExpress?: boolean;
|
|
15
|
+
showTextLogo?: boolean;
|
|
15
16
|
}
|
|
16
|
-
declare const _default: React.MemoExoticComponent<({ open, children, transitionDuration, isTapOrigin, animationType, onClose, onConfirm, pointerEvents, merchantInfo, isMaturityExpress, ...rest }: DialogProps) => JSX.Element>;
|
|
17
|
+
declare const _default: React.MemoExoticComponent<({ open, children, transitionDuration, isTapOrigin, animationType, onClose, onConfirm, pointerEvents, merchantInfo, isMaturityExpress, showTextLogo, ...rest }: DialogProps) => JSX.Element>;
|
|
17
18
|
export default _default;
|
|
@@ -104,7 +104,7 @@ var LanguageFooterStyled = styled(Box, { shouldForwardProp: function (prop) { re
|
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
106
|
var Dialog = function (_a) {
|
|
107
|
-
var open = _a.open, children = _a.children, transitionDuration = _a.transitionDuration, isTapOrigin = _a.isTapOrigin, _b = _a.animationType, animationType = _b === void 0 ? 'slide' : _b, onClose = _a.onClose, onConfirm = _a.onConfirm, _c = _a.pointerEvents, pointerEvents = _c === void 0 ? 'auto' : _c, merchantInfo = _a.merchantInfo, isMaturityExpress = _a.isMaturityExpress, rest = __rest(_a, ["open", "children", "transitionDuration", "isTapOrigin", "animationType", "onClose", "onConfirm", "pointerEvents", "merchantInfo", "isMaturityExpress"]);
|
|
107
|
+
var open = _a.open, children = _a.children, transitionDuration = _a.transitionDuration, isTapOrigin = _a.isTapOrigin, _b = _a.animationType, animationType = _b === void 0 ? 'slide' : _b, onClose = _a.onClose, onConfirm = _a.onConfirm, _c = _a.pointerEvents, pointerEvents = _c === void 0 ? 'auto' : _c, merchantInfo = _a.merchantInfo, isMaturityExpress = _a.isMaturityExpress, showTextLogo = _a.showTextLogo, rest = __rest(_a, ["open", "children", "transitionDuration", "isTapOrigin", "animationType", "onClose", "onConfirm", "pointerEvents", "merchantInfo", "isMaturityExpress", "showTextLogo"]);
|
|
108
108
|
var isAr = useLanguage().isAr;
|
|
109
109
|
var animation = {};
|
|
110
110
|
if (animationType === 'slide') {
|
|
@@ -129,6 +129,6 @@ var Dialog = function (_a) {
|
|
|
129
129
|
marginBottom: isMaturityExpress ? '60px' : '0px'
|
|
130
130
|
},
|
|
131
131
|
pointerEvents: pointerEvents
|
|
132
|
-
}, hideBackdrop: true, PaperComponent: PaperStyled, open: open, transitionDuration: transitionDuration || 500, keepMounted: true, "aria-describedby": 'dialog-slide-description' }, rest, animation, { children: [_jsx(DialogContainer, __assign({ isTapOrigin: isTapOrigin, onClose: onClose, onConfirm: onConfirm }, { children: _jsxs(DialogContentStyled, __assign({ isTapOrigin: isTapOrigin }, { children: [_jsxs(Collapse, __assign({ in: !isTapOrigin }, { children: [_jsx(LogoBadge, { src: isMaturityExpress ? logo || ICONS_NAMES.LOGO_ICON : ICONS_NAMES.LOGO_ICON }), !isMaturityExpress && (_jsx(LogoIconBoxStyled, { children: _jsx(LogoIconStyled, { src: isAr ? ICONS_NAMES.TAP_AR : ICONS_NAMES.TAP_EN, alt: 'tap logo' }) }))] })), children] })) })), isMaturityExpress ? _jsx(PoweredByFooter, {}) : _jsx(CustomFooter, {}), _jsx(LanguageFooterStyled, __assign({ showLanguage: showLanguage }, { children: _jsx(CustomFooter, {}) }))] })));
|
|
132
|
+
}, hideBackdrop: true, PaperComponent: PaperStyled, open: open, transitionDuration: transitionDuration || 500, keepMounted: true, "aria-describedby": 'dialog-slide-description' }, rest, animation, { children: [_jsx(DialogContainer, __assign({ isTapOrigin: isTapOrigin, onClose: onClose, onConfirm: onConfirm }, { children: _jsxs(DialogContentStyled, __assign({ isTapOrigin: isTapOrigin }, { children: [_jsxs(Collapse, __assign({ in: !isTapOrigin }, { children: [_jsx(LogoBadge, { src: isMaturityExpress ? logo || ICONS_NAMES.LOGO_ICON : ICONS_NAMES.LOGO_ICON }), !isMaturityExpress && showTextLogo && (_jsx(LogoIconBoxStyled, { children: _jsx(LogoIconStyled, { src: isAr ? ICONS_NAMES.TAP_AR : ICONS_NAMES.TAP_EN, alt: 'tap logo' }) }))] })), children] })) })), isMaturityExpress ? _jsx(PoweredByFooter, {}) : _jsx(CustomFooter, {}), _jsx(LanguageFooterStyled, __assign({ showLanguage: showLanguage }, { children: _jsx(CustomFooter, {}) }))] })));
|
|
133
133
|
};
|
|
134
134
|
export default React.memo(Dialog);
|
package/build/constants/api.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare const ENDPOINT_PATHS: {
|
|
2
|
+
CREATE_TOKEN_PATH: string;
|
|
2
3
|
CREATE_EXPRESS_AUTH_PATH: string;
|
|
3
4
|
Verify_Express_Auth_OTP_PATH: string;
|
|
5
|
+
Verify_Express_Auth_PACI_PATH: string;
|
|
4
6
|
EXPRESS_LEAD_IDENTITY_AUTH_PATH: string;
|
|
5
7
|
EXPRESS_UPDATE_LEAD: string;
|
|
6
8
|
EXPRESS_CREATE_ACCOUNT: string;
|
package/build/constants/api.js
CHANGED
|
@@ -38,6 +38,7 @@ var RETRIEVE_USER_INFO_PATH = '/user';
|
|
|
38
38
|
var BOARD_PATH = '/board';
|
|
39
39
|
var CREATE_EXPRESS_AUTH_PATH = '/express/auth';
|
|
40
40
|
var Verify_Express_Auth_OTP_PATH = '/express/auth';
|
|
41
|
+
var Verify_Express_Auth_PACI_PATH = '/express/auth';
|
|
41
42
|
var EXPRESS_LEAD_IDENTITY_AUTH_PATH = '/express/token/verify';
|
|
42
43
|
var EXPRESS_UPDATE_LEAD_PATH = '/express/lead';
|
|
43
44
|
var EXPRESS_CREATE_ACCOUNT = '/express/account';
|
|
@@ -55,9 +56,12 @@ var TERMINAL_PATH = '/terminal';
|
|
|
55
56
|
var SEGMENT_LOCATION_PATH = "".concat(BRAND_PATH, "/segment/location");
|
|
56
57
|
var SEGMENT_PROFIT_PATH = "".concat(BRAND_PATH, "/segment/profit");
|
|
57
58
|
var SEGMENT_TECH_PATH = "".concat(BRAND_PATH, "/segment/tech");
|
|
59
|
+
var CREATE_TOKEN_PATH = '/token';
|
|
58
60
|
export var ENDPOINT_PATHS = {
|
|
61
|
+
CREATE_TOKEN_PATH: CREATE_TOKEN_PATH,
|
|
59
62
|
CREATE_EXPRESS_AUTH_PATH: CREATE_EXPRESS_AUTH_PATH,
|
|
60
63
|
Verify_Express_Auth_OTP_PATH: Verify_Express_Auth_OTP_PATH,
|
|
64
|
+
Verify_Express_Auth_PACI_PATH: Verify_Express_Auth_PACI_PATH,
|
|
61
65
|
EXPRESS_LEAD_IDENTITY_AUTH_PATH: EXPRESS_LEAD_IDENTITY_AUTH_PATH,
|
|
62
66
|
EXPRESS_UPDATE_LEAD: EXPRESS_UPDATE_LEAD_PATH,
|
|
63
67
|
EXPRESS_CREATE_ACCOUNT: EXPRESS_CREATE_ACCOUNT,
|
package/build/constants/app.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare const BUSINESS_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
|
|
|
23
23
|
export declare const INDIVIDUAL_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
|
|
24
24
|
export declare const PASSWORD_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
|
|
25
25
|
export declare const BANK_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
|
|
26
|
+
export declare const BOARD_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
|
|
26
27
|
export declare const TAX_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
|
|
27
28
|
export declare const SigIn_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
|
|
28
29
|
export declare const ENTITY_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
|
|
@@ -163,6 +164,10 @@ export declare const BRAND_STEP_NAMES: {
|
|
|
163
164
|
BRAND_ACTIVITIES: string;
|
|
164
165
|
BRAND_SUCCESS: string;
|
|
165
166
|
};
|
|
167
|
+
export declare const BOARD_STEP_STEPS: {
|
|
168
|
+
PHONE_AUTH: string;
|
|
169
|
+
BOARD_INFO: string;
|
|
170
|
+
};
|
|
166
171
|
export declare const RSA_FRONTEND_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgC9kH1SQvjbXAUXd0PbrDUG8P\nLhRig9pJNBmdQBZjihuaxfkzYu6ToMbIMAfmYgVgQw338/y7aQ8X3m03CXNIlkxo\nOwxKCA8ymKsZQptXJn9IxlPO7yjoFgTFBrpmTgvcC4XO1uoUYTAPq3szK8kj4zgT\nucWG1hSKsOdRU7sl/wIDAQAB\n-----END PUBLIC KEY-----";
|
|
167
172
|
export declare const ENCRYPTION_FLAG = "encryption_contract";
|
|
168
173
|
export declare const BACKEND_ENCRYPTION_FLAG = "backend_encryption_contract";
|
package/build/constants/app.js
CHANGED
|
@@ -414,6 +414,26 @@ export var BANK_SCREENS_NAVIGATION = [
|
|
|
414
414
|
order: 5
|
|
415
415
|
}
|
|
416
416
|
];
|
|
417
|
+
export var BOARD_SCREENS_NAVIGATION = [
|
|
418
|
+
{
|
|
419
|
+
name: 'BOARD_VERIFY_STEP',
|
|
420
|
+
next: ['BOARD_SUCCESS_STEP', 'BOARD_SUCCESS_FLOWS_BUTTONS_STEP'],
|
|
421
|
+
prev: '',
|
|
422
|
+
order: 1
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
name: 'BOARD_SUCCESS_FLOWS_BUTTONS_STEP',
|
|
426
|
+
next: 'BOARD_RESET_PASSWORD_SUCCESS',
|
|
427
|
+
prev: '',
|
|
428
|
+
order: 2
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
name: 'BOARD_RESET_PASSWORD_SUCCESS',
|
|
432
|
+
next: '',
|
|
433
|
+
prev: 'BOARD_SUCCESS_FLOWS_BUTTONS_STEP',
|
|
434
|
+
order: 3
|
|
435
|
+
}
|
|
436
|
+
];
|
|
417
437
|
export var TAX_SCREENS_NAVIGATION = [
|
|
418
438
|
{
|
|
419
439
|
name: 'TAX_VERIFY_STEP',
|
|
@@ -708,6 +728,10 @@ export var BRAND_STEP_NAMES = {
|
|
|
708
728
|
BRAND_ACTIVITIES: 'brand_activities',
|
|
709
729
|
BRAND_SUCCESS: 'brand_completed'
|
|
710
730
|
};
|
|
731
|
+
export var BOARD_STEP_STEPS = {
|
|
732
|
+
PHONE_AUTH: 'board_phone_auth',
|
|
733
|
+
BOARD_INFO: 'board_info'
|
|
734
|
+
};
|
|
711
735
|
export var RSA_FRONTEND_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgC9kH1SQvjbXAUXd0PbrDUG8P\nLhRig9pJNBmdQBZjihuaxfkzYu6ToMbIMAfmYgVgQw338/y7aQ8X3m03CXNIlkxo\nOwxKCA8ymKsZQptXJn9IxlPO7yjoFgTFBrpmTgvcC4XO1uoUYTAPq3szK8kj4zgT\nucWG1hSKsOdRU7sl/wIDAQAB\n-----END PUBLIC KEY-----";
|
|
712
736
|
export var ENCRYPTION_FLAG = 'encryption_contract';
|
|
713
737
|
export var BACKEND_ENCRYPTION_FLAG = 'backend_encryption_contract';
|
package/build/constants/dummy.js
CHANGED
|
@@ -7017,25 +7017,6 @@ export var BUSINESS_COUNTRIES = [
|
|
|
7017
7017
|
}
|
|
7018
7018
|
]
|
|
7019
7019
|
},
|
|
7020
|
-
{
|
|
7021
|
-
id: 4,
|
|
7022
|
-
title: 'East Asia',
|
|
7023
|
-
countries: [
|
|
7024
|
-
{
|
|
7025
|
-
id: 8,
|
|
7026
|
-
label: 'hk',
|
|
7027
|
-
country: {
|
|
7028
|
-
id: 45,
|
|
7029
|
-
name_en: 'China, Hong Kong Special Administrative Region',
|
|
7030
|
-
name_ar: 'منطقة هونغ كونغ الصينية الإدارية الخاصة',
|
|
7031
|
-
iso2: 'HK',
|
|
7032
|
-
iso3: 'HKG',
|
|
7033
|
-
idd_prefix: '852',
|
|
7034
|
-
logo: 'https://tap-assets.b-cdn.net/icons/dashboard/light/country/HK.svg'
|
|
7035
|
-
}
|
|
7036
|
-
}
|
|
7037
|
-
]
|
|
7038
|
-
},
|
|
7039
7020
|
{
|
|
7040
7021
|
id: 5,
|
|
7041
7022
|
title: 'South East Asia',
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RootState } from '../../../app/store';
|
|
2
|
+
import { FlowsTypes, OTPFormValues, ResponseData, SharedState } from '../../../@types';
|
|
3
|
+
export declare const createVerifyTokenBy: import("@reduxjs/toolkit").AsyncThunk<any, string, {}>;
|
|
4
|
+
export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
5
|
+
data: any;
|
|
6
|
+
}, void, {}>;
|
|
7
|
+
export declare const verifyBoardLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
8
|
+
data: any;
|
|
9
|
+
formData: OTPFormValues;
|
|
10
|
+
}, OTPFormValues, {}>;
|
|
11
|
+
export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk<{
|
|
12
|
+
data: any;
|
|
13
|
+
}, string, {}>;
|
|
14
|
+
export interface BoardData {
|
|
15
|
+
verify: ResponseData;
|
|
16
|
+
otpData: OTPFormValues & ResponseData;
|
|
17
|
+
flowName: FlowsTypes;
|
|
18
|
+
}
|
|
19
|
+
export interface BoardState extends SharedState<BoardData> {
|
|
20
|
+
customLoading?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const boardSlice: import("@reduxjs/toolkit").Slice<BoardState, {
|
|
23
|
+
clearError: (state: BoardState) => void;
|
|
24
|
+
stopLoader: (state: BoardState) => void;
|
|
25
|
+
resetOTPScreen: (state: BoardState) => void;
|
|
26
|
+
}, "bank/store">;
|
|
27
|
+
export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
28
|
+
declare const _default: import("redux").Reducer<BoardState, import("redux").AnyAction>;
|
|
29
|
+
export default _default;
|
|
30
|
+
export declare const boardSelector: (state: RootState) => BoardState;
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var _a;
|
|
49
|
+
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
|
+
import API from '../../../api';
|
|
51
|
+
import { FlowsTypes } from '../../../@types';
|
|
52
|
+
import { handleCurrentActiveScreen, handleNextScreenStep } from '../../../app/settings';
|
|
53
|
+
import { BOARD_STEP_STEPS } from '../../../constants';
|
|
54
|
+
import { sleep } from '../../../utils';
|
|
55
|
+
export var createVerifyTokenBy = createAsyncThunk('board/createTokenByLeadId', function (leadId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
+
var settings, data, step_name;
|
|
57
|
+
var _a, _b;
|
|
58
|
+
return __generator(this, function (_c) {
|
|
59
|
+
switch (_c.label) {
|
|
60
|
+
case 0:
|
|
61
|
+
settings = thunkApi.getState().settings;
|
|
62
|
+
return [4, API.leadService.createVerifyTokenByLeadId(leadId)];
|
|
63
|
+
case 1:
|
|
64
|
+
data = _c.sent();
|
|
65
|
+
step_name = data.step_name;
|
|
66
|
+
if (step_name == BOARD_STEP_STEPS.PHONE_AUTH) {
|
|
67
|
+
sleep(0).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('BOARD_VERIFY_STEP')); });
|
|
68
|
+
return [2, __assign(__assign({}, data), { lead_id: leadId })];
|
|
69
|
+
}
|
|
70
|
+
return [4, thunkApi.dispatch(retrieveBoardDetails(data.id))];
|
|
71
|
+
case 2:
|
|
72
|
+
_c.sent();
|
|
73
|
+
(_b = (_a = settings.data.appConfig).onFlowCompleted) === null || _b === void 0 ? void 0 : _b.call(_a, { boardId: data.id, boardInfoId: data.board_info_id, leadId: leadId });
|
|
74
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('BOARD_SUCCESS_FLOWS_BUTTONS_STEP')); });
|
|
75
|
+
return [2, __assign(__assign({}, data), { lead_id: leadId })];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}); });
|
|
79
|
+
export var resendOTP = createAsyncThunk('board/resendOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
80
|
+
var board, leadId, data;
|
|
81
|
+
var _a, _b;
|
|
82
|
+
return __generator(this, function (_c) {
|
|
83
|
+
switch (_c.label) {
|
|
84
|
+
case 0:
|
|
85
|
+
board = thunkApi.getState().board;
|
|
86
|
+
leadId = (_b = (_a = board.data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.lead_id) !== null && _b !== void 0 ? _b : '';
|
|
87
|
+
return [4, API.leadService.createVerifyTokenByLeadId(leadId)];
|
|
88
|
+
case 1:
|
|
89
|
+
data = _c.sent();
|
|
90
|
+
return [2, { data: data }];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}); });
|
|
94
|
+
export var verifyBoardLeadOTP = createAsyncThunk('board/verifyBoardLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
95
|
+
var _a, board, settings, responseBody, payload, data;
|
|
96
|
+
var _b, _c, _d, _e, _f;
|
|
97
|
+
return __generator(this, function (_g) {
|
|
98
|
+
switch (_g.label) {
|
|
99
|
+
case 0:
|
|
100
|
+
_a = thunkApi.getState(), board = _a.board, settings = _a.settings;
|
|
101
|
+
responseBody = board.data.verify.responseBody;
|
|
102
|
+
payload = {
|
|
103
|
+
data: params.otp,
|
|
104
|
+
service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
|
|
105
|
+
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
106
|
+
step_name: BOARD_STEP_STEPS.PHONE_AUTH,
|
|
107
|
+
encryption_contract: ['data']
|
|
108
|
+
};
|
|
109
|
+
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
110
|
+
case 1:
|
|
111
|
+
data = (_g.sent()).data;
|
|
112
|
+
if (data.errors)
|
|
113
|
+
throw new Error(data.errors[0].description);
|
|
114
|
+
return [4, thunkApi.dispatch(retrieveBoardDetails(data.id))];
|
|
115
|
+
case 2:
|
|
116
|
+
_g.sent();
|
|
117
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
|
|
118
|
+
(_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { boardId: responseBody === null || responseBody === void 0 ? void 0 : responseBody.id, boardInfoId: responseBody === null || responseBody === void 0 ? void 0 : responseBody.board_info_id, leadId: responseBody === null || responseBody === void 0 ? void 0 : responseBody.lead_id });
|
|
119
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('BOARD_SUCCESS_FLOWS_BUTTONS_STEP')); });
|
|
120
|
+
return [2, { data: data, formData: params }];
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}); });
|
|
124
|
+
export var retrieveBoardDetails = createAsyncThunk('board/retrieveBoardDetails', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
125
|
+
var _a, boardInfoData, data;
|
|
126
|
+
var _b, _c;
|
|
127
|
+
return __generator(this, function (_d) {
|
|
128
|
+
switch (_d.label) {
|
|
129
|
+
case 0: return [4, Promise.all([API.boardService.retrieveBoardInfoStatus(boardId), API.boardService.retrieveBoardDetails(boardId)])];
|
|
130
|
+
case 1:
|
|
131
|
+
_a = _d.sent(), boardInfoData = _a[0], data = _a[1];
|
|
132
|
+
return [2, {
|
|
133
|
+
data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.names, business: data === null || data === void 0 ? void 0 : data.business, individuals: data === null || data === void 0 ? void 0 : data.individuals, contact: (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.contact, flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [] })
|
|
134
|
+
}];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}); });
|
|
138
|
+
var initialState = {
|
|
139
|
+
error: null,
|
|
140
|
+
loading: false,
|
|
141
|
+
customLoading: false,
|
|
142
|
+
data: {
|
|
143
|
+
flowName: FlowsTypes.BOARD,
|
|
144
|
+
verify: {},
|
|
145
|
+
otpData: {
|
|
146
|
+
otp: ''
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
export var boardSlice = createSlice({
|
|
151
|
+
name: 'bank/store',
|
|
152
|
+
initialState: initialState,
|
|
153
|
+
reducers: {
|
|
154
|
+
clearError: function (state) {
|
|
155
|
+
state.error = null;
|
|
156
|
+
},
|
|
157
|
+
stopLoader: function (state) {
|
|
158
|
+
state.loading = false;
|
|
159
|
+
},
|
|
160
|
+
resetOTPScreen: function (state) {
|
|
161
|
+
state.data.otpData.otp = '';
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
extraReducers: function (builder) {
|
|
165
|
+
builder
|
|
166
|
+
.addCase(createVerifyTokenBy.pending, function (state) {
|
|
167
|
+
state.error = null;
|
|
168
|
+
state.customLoading = true;
|
|
169
|
+
})
|
|
170
|
+
.addCase(createVerifyTokenBy.fulfilled, function (state, action) {
|
|
171
|
+
state.error = null;
|
|
172
|
+
state.customLoading = false;
|
|
173
|
+
state.data.verify = __assign(__assign({}, state.data.verify), { responseBody: __assign(__assign({}, state.data.verify.responseBody), action.payload) });
|
|
174
|
+
})
|
|
175
|
+
.addCase(createVerifyTokenBy.rejected, function (state, action) {
|
|
176
|
+
state.error = action.error.message;
|
|
177
|
+
state.customLoading = false;
|
|
178
|
+
})
|
|
179
|
+
.addCase(resendOTP.pending, function (state) {
|
|
180
|
+
state.error = null;
|
|
181
|
+
})
|
|
182
|
+
.addCase(resendOTP.fulfilled, function (state, action) {
|
|
183
|
+
state.error = null;
|
|
184
|
+
var data = action.payload.data;
|
|
185
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
186
|
+
})
|
|
187
|
+
.addCase(resendOTP.rejected, function (state, action) {
|
|
188
|
+
state.error = action.error.message;
|
|
189
|
+
})
|
|
190
|
+
.addCase(verifyBoardLeadOTP.pending, function (state) {
|
|
191
|
+
state.loading = true;
|
|
192
|
+
state.error = null;
|
|
193
|
+
})
|
|
194
|
+
.addCase(verifyBoardLeadOTP.fulfilled, function (state, action) {
|
|
195
|
+
state.loading = false;
|
|
196
|
+
state.error = null;
|
|
197
|
+
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
198
|
+
state.data.otpData = formData;
|
|
199
|
+
state.data.otpData.responseBody = data;
|
|
200
|
+
})
|
|
201
|
+
.addCase(verifyBoardLeadOTP.rejected, function (state, action) {
|
|
202
|
+
state.loading = false;
|
|
203
|
+
state.error = action.error.message;
|
|
204
|
+
})
|
|
205
|
+
.addCase(retrieveBoardDetails.pending, function (state) {
|
|
206
|
+
state.error = null;
|
|
207
|
+
state.loading = true;
|
|
208
|
+
})
|
|
209
|
+
.addCase(retrieveBoardDetails.fulfilled, function (state, action) {
|
|
210
|
+
state.error = null;
|
|
211
|
+
state.loading = false;
|
|
212
|
+
var data = action.payload.data;
|
|
213
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
214
|
+
})
|
|
215
|
+
.addCase(retrieveBoardDetails.rejected, function (state, action) {
|
|
216
|
+
state.error = action.error.message;
|
|
217
|
+
state.loading = false;
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
export var clearError = (_a = boardSlice.actions, _a.clearError), stopLoader = _a.stopLoader, resetOTPScreen = _a.resetOTPScreen;
|
|
222
|
+
export default boardSlice.reducer;
|
|
223
|
+
export var boardSelector = function (state) { return state.board; };
|