@tap-payments/auth-jsconnect 2.8.62-development → 2.8.63-beta
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/redux.d.ts +0 -1
- package/build/api/entity.d.ts +2 -2
- package/build/api/entity.js +4 -12
- package/build/api/index.d.ts +2 -2
- package/build/app/settings.js +2 -3
- package/build/components/Providers/ThemeProvider.js +1 -1
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +3 -0
- package/build/constants/app.js +3 -0
- package/build/features/app/bank/bankStore.d.ts +19 -13
- package/build/features/app/bank/bankStore.js +165 -183
- package/build/features/app/board/boardStore.js +10 -16
- package/build/features/app/brand/brandStore.d.ts +31 -16
- package/build/features/app/brand/brandStore.js +239 -243
- package/build/features/app/business/businessStore.js +1 -7
- package/build/features/app/entity/entityStore.d.ts +34 -20
- package/build/features/app/entity/entityStore.js +249 -204
- package/build/features/app/individual/individualStore.d.ts +36 -17
- package/build/features/app/individual/individualStore.js +270 -221
- package/build/features/app/password/passwordStore.d.ts +25 -19
- package/build/features/app/password/passwordStore.js +216 -170
- package/build/features/app/tax/taxStore.d.ts +7 -13
- package/build/features/app/tax/taxStore.js +147 -168
- package/build/features/bank/screens/BankDetails/BankDetails.js +4 -17
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +11 -48
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +4 -22
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +6 -22
- package/build/features/business/screens/Activities/Activities.js +1 -9
- package/build/features/business/screens/Customers/Customers.js +1 -9
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +1 -7
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +9 -33
- package/build/features/entity/screens/EntityName/EntityName.js +14 -31
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +10 -43
- package/build/features/individual/screens/IndividualList/IndividualList.js +0 -7
- package/build/features/individual/screens/IndividualList/UserList.js +3 -3
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +18 -73
- package/build/features/password/Password.js +1 -1
- package/build/features/shared/Button/FlowsButtons.js +1 -7
- package/build/features/signIn/SignIn.js +2 -10
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -7
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.js +0 -1
- package/build/utils/common.js +4 -4
- package/package.json +2 -2
- package/build/hooks/useFormDirtyCheck.d.ts +0 -10
- package/build/hooks/useFormDirtyCheck.js +0 -66
|
@@ -55,10 +55,10 @@ import { retrieveIndividualData, sleep } from '../../../utils';
|
|
|
55
55
|
export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', function (_a, thunkApi) {
|
|
56
56
|
var token = _a.token, isInternally = _a.isInternally;
|
|
57
57
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
-
var payload, data, _b, config, board_info_password_status, country_code, board_id,
|
|
59
|
-
var
|
|
60
|
-
return __generator(this, function (
|
|
61
|
-
switch (
|
|
58
|
+
var payload, data, boardStatusData, boardInfoData, boardData, individualData, countryIso2, _b, config, board_info_password_status, country_code, board_id, board_info_id, publicKey, _c, id_1, type_1, serviceCallBack, _d, boardRes, individualRes, info, hasPasswordCompleted;
|
|
59
|
+
var _e, _f, _g, _h, _j, _k;
|
|
60
|
+
return __generator(this, function (_l) {
|
|
61
|
+
switch (_l.label) {
|
|
62
62
|
case 0:
|
|
63
63
|
payload = __assign({ service_name: 'tap_email', verify_token: token }, (isInternally && {
|
|
64
64
|
notification: {
|
|
@@ -67,36 +67,63 @@ export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', functio
|
|
|
67
67
|
}));
|
|
68
68
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
69
69
|
case 1:
|
|
70
|
-
data = (
|
|
71
|
-
|
|
70
|
+
data = (_l.sent()).data;
|
|
71
|
+
countryIso2 = undefined;
|
|
72
|
+
if (((_e = data === null || data === void 0 ? void 0 : data.errors) === null || _e === void 0 ? void 0 : _e.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
|
|
72
73
|
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
73
74
|
if (isInternally)
|
|
74
75
|
data.step_name = PASSWORD_STEP_NAMES.PASSWORD_INFO;
|
|
75
|
-
_b = data || {}, config = _b.config, board_info_password_status = _b.board_info_password_status, country_code = _b.country_code, board_id = _b.board_id;
|
|
76
|
-
countryIso2 = country_code;
|
|
77
|
-
if (countryIso2)
|
|
78
|
-
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
76
|
+
_b = data || {}, config = _b.config, board_info_password_status = _b.board_info_password_status, country_code = _b.country_code, board_id = _b.board_id, board_info_id = _b.board_info_id;
|
|
79
77
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
80
|
-
if (publicKey)
|
|
78
|
+
if (publicKey) {
|
|
81
79
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
}
|
|
81
|
+
if (country_code) {
|
|
82
|
+
countryIso2 = country_code;
|
|
83
|
+
thunkApi.dispatch(handleSetCountryByIso2(country_code));
|
|
84
|
+
}
|
|
85
|
+
if (!board_id) return [3, 7];
|
|
86
|
+
if (!board_info_id) return [3, 3];
|
|
87
|
+
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
84
88
|
case 2:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
boardInfoData = _l.sent();
|
|
90
|
+
_l.label = 3;
|
|
91
|
+
case 3: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
92
|
+
case 4:
|
|
93
|
+
boardStatusData = _l.sent();
|
|
94
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
95
|
+
case 5:
|
|
96
|
+
boardData = _l.sent();
|
|
97
|
+
_c = ((_f = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _f === void 0 ? void 0 : _f.recipient) || {}, id_1 = _c.id, type_1 = _c.type;
|
|
98
|
+
serviceCallBack = function () { return API.individualService.retrieveIndividual(id_1, type_1); };
|
|
99
|
+
return [4, retrieveIndividualData(type_1, boardData, serviceCallBack)];
|
|
100
|
+
case 6:
|
|
101
|
+
_d = _l.sent(), boardRes = _d.boardRes, individualRes = _d.individualRes;
|
|
102
|
+
boardData = boardRes;
|
|
103
|
+
individualData = individualRes;
|
|
104
|
+
_l.label = 7;
|
|
105
|
+
case 7:
|
|
106
|
+
if (!country_code && ((_g = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _g === void 0 ? void 0 : _g.country)) {
|
|
107
|
+
countryIso2 = boardData.entity.country;
|
|
108
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
109
|
+
}
|
|
110
|
+
info = (boardStatusData || {}).info;
|
|
111
|
+
hasPasswordCompleted = ((_h = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'password'; })) === null || _h === void 0 ? void 0 : _h.status) === 'completed';
|
|
90
112
|
if (data.step_name === PASSWORD_STEP_NAMES.PHONE_AUTH) {
|
|
91
113
|
thunkApi.dispatch(handleCurrentActiveScreen('PASSWORD_VERIFY_STEP'));
|
|
92
114
|
}
|
|
93
|
-
else if (
|
|
115
|
+
else if (hasPasswordCompleted) {
|
|
94
116
|
thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
95
117
|
}
|
|
96
118
|
else if (data.step_name === PASSWORD_STEP_NAMES.PASSWORD_INFO) {
|
|
97
119
|
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
98
120
|
}
|
|
99
|
-
return [2, {
|
|
121
|
+
return [2, {
|
|
122
|
+
data: data,
|
|
123
|
+
individualData: individualData,
|
|
124
|
+
boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), { flows: (boardStatusData === null || boardStatusData === void 0 ? void 0 : boardStatusData.info) || [], user: boardData === null || boardData === void 0 ? void 0 : boardData.user, brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, name: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.names, contact: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.contact, business: boardData === null || boardData === void 0 ? void 0 : boardData.business, notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification }),
|
|
125
|
+
token: token
|
|
126
|
+
}];
|
|
100
127
|
}
|
|
101
128
|
});
|
|
102
129
|
});
|
|
@@ -118,74 +145,54 @@ export var resendOTP = createAsyncThunk('resendOTPPassword', function (params, t
|
|
|
118
145
|
}
|
|
119
146
|
});
|
|
120
147
|
}); });
|
|
121
|
-
export var retrieveBoardDetails = createAsyncThunk('retrievePasswordBoardDetails', function (
|
|
122
|
-
var
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
if (!(((_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.id) !== id && id)) return [3, 3];
|
|
134
|
-
serviceCallBack = function () { return API.individualService.retrieveIndividual(id, type); };
|
|
135
|
-
return [4, retrieveIndividualData(type, data, serviceCallBack)];
|
|
136
|
-
case 2:
|
|
137
|
-
_b = _f.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
|
|
138
|
-
individualData = individualRes;
|
|
139
|
-
boardData = boardRes;
|
|
140
|
-
_f.label = 3;
|
|
141
|
-
case 3: return [2, __assign(__assign({}, boardData), { brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, name: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.names, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, contact: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.contact, user: individualData, board_status: boardData === null || boardData === void 0 ? void 0 : boardData.status })];
|
|
142
|
-
}
|
|
143
|
-
});
|
|
148
|
+
export var retrieveBoardDetails = createAsyncThunk('retrievePasswordBoardDetails', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
149
|
+
var data;
|
|
150
|
+
var _a, _b;
|
|
151
|
+
return __generator(this, function (_c) {
|
|
152
|
+
switch (_c.label) {
|
|
153
|
+
case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
154
|
+
case 1:
|
|
155
|
+
data = _c.sent();
|
|
156
|
+
return [2, {
|
|
157
|
+
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: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.names, individuals: data === null || data === void 0 ? void 0 : data.individuals, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact, board_status: data === null || data === void 0 ? void 0 : data.status })
|
|
158
|
+
}];
|
|
159
|
+
}
|
|
144
160
|
});
|
|
145
|
-
});
|
|
161
|
+
}); });
|
|
146
162
|
export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
147
|
-
var _a, password, settings, responseBody, payload, data,
|
|
148
|
-
var _c, _d, _e, _f
|
|
149
|
-
return __generator(this, function (
|
|
150
|
-
switch (
|
|
163
|
+
var _a, password, settings, responseBody, payload, data, publicKey, flows, hasPasswordCompleted;
|
|
164
|
+
var _b, _c, _d, _e, _f;
|
|
165
|
+
return __generator(this, function (_g) {
|
|
166
|
+
switch (_g.label) {
|
|
151
167
|
case 0:
|
|
152
168
|
_a = thunkApi.getState(), password = _a.password, settings = _a.settings;
|
|
153
169
|
responseBody = password.data.verify.responseBody;
|
|
154
170
|
payload = {
|
|
155
171
|
data: params.otp,
|
|
156
|
-
service_name: (
|
|
172
|
+
service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
|
|
157
173
|
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
158
174
|
step_name: PASSWORD_STEP_NAMES.PHONE_AUTH,
|
|
159
175
|
encryption_contract: ['data']
|
|
160
176
|
};
|
|
161
177
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
162
178
|
case 1:
|
|
163
|
-
data = (
|
|
164
|
-
if (
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
return [
|
|
180
|
-
case 3:
|
|
181
|
-
data_2 = _h.sent();
|
|
182
|
-
if ((_g = data_2 === null || data_2 === void 0 ? void 0 : data_2.entity) === null || _g === void 0 ? void 0 : _g.country)
|
|
183
|
-
thunkApi.dispatch(handleSetCountryByIso2(data_2.entity.country));
|
|
184
|
-
_h.label = 4;
|
|
185
|
-
case 4:
|
|
186
|
-
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
187
|
-
_h.label = 5;
|
|
188
|
-
case 5: return [2, { data: data, formData: __assign({}, params) }];
|
|
179
|
+
data = (_g.sent()).data;
|
|
180
|
+
if (!data.errors) {
|
|
181
|
+
publicKey = (_c = data === null || data === void 0 ? void 0 : data.config) === null || _c === void 0 ? void 0 : _c.public_key;
|
|
182
|
+
if (publicKey) {
|
|
183
|
+
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
184
|
+
}
|
|
185
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, { otp: params.otp });
|
|
186
|
+
flows = (responseBody || {}).flows;
|
|
187
|
+
hasPasswordCompleted = ((_f = flows === null || flows === void 0 ? void 0 : flows.find(function (flow) { return flow.name === 'password'; })) === null || _f === void 0 ? void 0 : _f.status) === 'completed';
|
|
188
|
+
if (hasPasswordCompleted) {
|
|
189
|
+
thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return [2, { data: data, formData: __assign({}, params) }];
|
|
189
196
|
}
|
|
190
197
|
});
|
|
191
198
|
}); });
|
|
@@ -212,39 +219,38 @@ export var createPassword = createAsyncThunk('createPassword', function (params,
|
|
|
212
219
|
});
|
|
213
220
|
}); });
|
|
214
221
|
export var updateBoardSuccess = createAsyncThunk('passwordUpdateBoardSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
215
|
-
var _a, settings, password, _b,
|
|
216
|
-
var _e, _f, _g, _h, _j, _k, _l
|
|
217
|
-
return __generator(this, function (
|
|
218
|
-
switch (
|
|
222
|
+
var _a, settings, password, _b, id, infoId, _c, showBoard, mode, payload, data, boardInfoData;
|
|
223
|
+
var _d, _e, _f, _g, _h, _j, _k, _l;
|
|
224
|
+
return __generator(this, function (_m) {
|
|
225
|
+
switch (_m.label) {
|
|
219
226
|
case 0:
|
|
220
227
|
_a = thunkApi.getState(), settings = _a.settings, password = _a.password;
|
|
221
|
-
_b = password.data.verify.responseBody || {},
|
|
228
|
+
_b = password.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id;
|
|
222
229
|
_c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
|
|
223
|
-
if (!
|
|
230
|
+
if (!id)
|
|
224
231
|
return [2];
|
|
225
232
|
payload = {
|
|
226
233
|
lang: settings.data.language,
|
|
227
234
|
step_name: PASSWORD_STEP_NAMES.PASSWORD_SUCCESS
|
|
228
235
|
};
|
|
229
|
-
return [4, API.boardService.updateBoardInfo(__assign({ id:
|
|
236
|
+
return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
|
|
230
237
|
case 1:
|
|
231
|
-
data =
|
|
238
|
+
data = _m.sent();
|
|
232
239
|
if (!showBoard && mode === 'content') {
|
|
233
|
-
(
|
|
234
|
-
(
|
|
235
|
-
return [2, {
|
|
240
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
|
|
241
|
+
(_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: data });
|
|
242
|
+
return [2, { response: __assign({}, data), formData: params }];
|
|
236
243
|
}
|
|
237
|
-
|
|
238
|
-
return [4, Promise.all([
|
|
239
|
-
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
240
|
-
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
241
|
-
])];
|
|
244
|
+
return [4, API.boardService.retrieveBoardInfoStatus(id)];
|
|
242
245
|
case 2:
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
+
boardInfoData = _m.sent();
|
|
247
|
+
return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
|
|
248
|
+
case 3:
|
|
249
|
+
_m.sent();
|
|
250
|
+
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, {});
|
|
251
|
+
(_l = (_k = settings.data.appConfig).onFlowCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, { data: data });
|
|
246
252
|
thunkApi.dispatch(handleNextScreenStep());
|
|
247
|
-
return [2, { data: data, flows: (
|
|
253
|
+
return [2, { data: data, flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [] }];
|
|
248
254
|
}
|
|
249
255
|
});
|
|
250
256
|
}); });
|
|
@@ -258,10 +264,7 @@ export var retrieveBoardStatus = createAsyncThunk('password/retrieveBoardStatus'
|
|
|
258
264
|
if (!board_id || !board_info_id)
|
|
259
265
|
throw new Error('Internal server error');
|
|
260
266
|
_b = recipient || {}, id = _b.id, type = _b.type;
|
|
261
|
-
return [4, Promise.all([
|
|
262
|
-
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
263
|
-
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
264
|
-
])];
|
|
267
|
+
return [4, Promise.all([API.boardService.retrieveBoardInfoStatus(board_id), thunkApi.dispatch(retrieveBoardDetails(board_id)).unwrap()])];
|
|
265
268
|
case 1:
|
|
266
269
|
data = (_c.sent())[0];
|
|
267
270
|
thunkApi.dispatch(handlePrevScreenStep());
|
|
@@ -270,43 +273,54 @@ export var retrieveBoardStatus = createAsyncThunk('password/retrieveBoardStatus'
|
|
|
270
273
|
});
|
|
271
274
|
}); });
|
|
272
275
|
export var verifyOperationToken = createAsyncThunk('verifyOperationToken', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
273
|
-
var token, boardId, boardInfoId,
|
|
274
|
-
var
|
|
275
|
-
return __generator(this, function (
|
|
276
|
-
switch (
|
|
276
|
+
var token, boardId, boardInfoId, boardInfoData, boardStatusData, individualData, boardData, payload, data, _a, id_2, type_2, serviceCallBack, _b, boardRes, individualRes;
|
|
277
|
+
var _c, _d, _e, _f;
|
|
278
|
+
return __generator(this, function (_g) {
|
|
279
|
+
switch (_g.label) {
|
|
277
280
|
case 0:
|
|
278
|
-
token = params.token, boardId = params.boardId, boardInfoId = params.boardInfoId
|
|
281
|
+
token = params.token, boardId = params.boardId, boardInfoId = params.boardInfoId;
|
|
282
|
+
boardData = undefined;
|
|
279
283
|
payload = {
|
|
280
284
|
auth_type: 7,
|
|
281
285
|
auth_token: token
|
|
282
286
|
};
|
|
283
287
|
return [4, API.authService.verifyAuth(payload)];
|
|
284
288
|
case 1:
|
|
285
|
-
data = (
|
|
286
|
-
if (
|
|
287
|
-
|
|
288
|
-
countryIso2 = data === null || data === void 0 ? void 0 : data.country;
|
|
289
|
-
if (countryIso2)
|
|
290
|
-
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
291
|
-
publicKey = (_b = data === null || data === void 0 ? void 0 : data.config) === null || _b === void 0 ? void 0 : _b.public_key;
|
|
292
|
-
if (publicKey)
|
|
293
|
-
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
294
|
-
if (!!(data === null || data === void 0 ? void 0 : data.country)) return [3, 3];
|
|
295
|
-
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
289
|
+
data = (_g.sent()).data;
|
|
290
|
+
if (!boardId) return [3, 7];
|
|
291
|
+
return [4, API.boardService.retrieveBoardInfoStatus(boardId)];
|
|
296
292
|
case 2:
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
thunkApi.dispatch(handleSetCountryByIso2(data_3.entity.country));
|
|
300
|
-
_d.label = 3;
|
|
293
|
+
boardStatusData = _g.sent();
|
|
294
|
+
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
301
295
|
case 3:
|
|
296
|
+
boardData = _g.sent();
|
|
297
|
+
if ((_c = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _c === void 0 ? void 0 : _c.country)
|
|
298
|
+
thunkApi.dispatch(handleSetCountryByIso2(boardData.entity.country));
|
|
299
|
+
if (!boardInfoId) return [3, 5];
|
|
300
|
+
return [4, API.boardService.retrieveBoardInfo({ id: boardId, infoId: boardInfoId })];
|
|
301
|
+
case 4:
|
|
302
|
+
boardInfoData = _g.sent();
|
|
303
|
+
_g.label = 5;
|
|
304
|
+
case 5:
|
|
305
|
+
_a = ((_d = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _d === void 0 ? void 0 : _d.recipient) || {}, id_2 = _a.id, type_2 = _a.type;
|
|
306
|
+
serviceCallBack = function () { return API.individualService.retrieveIndividual(id_2, type_2); };
|
|
307
|
+
return [4, retrieveIndividualData(type_2, boardData, serviceCallBack)];
|
|
308
|
+
case 6:
|
|
309
|
+
_b = _g.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
|
|
310
|
+
boardData = boardRes;
|
|
311
|
+
individualData = individualRes;
|
|
312
|
+
_g.label = 7;
|
|
313
|
+
case 7:
|
|
302
314
|
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
303
|
-
return [2,
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
315
|
+
return [2, {
|
|
316
|
+
data: data,
|
|
317
|
+
token: token,
|
|
318
|
+
boardId: boardId,
|
|
319
|
+
boardInfoId: boardInfoId,
|
|
320
|
+
individualData: individualData,
|
|
321
|
+
boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), { user: boardData === null || boardData === void 0 ? void 0 : boardData.user, brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, name: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.names, contact: (_f = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _f === void 0 ? void 0 : _f.contact, business: boardData === null || boardData === void 0 ? void 0 : boardData.business, notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification }),
|
|
322
|
+
flows: (boardStatusData === null || boardStatusData === void 0 ? void 0 : boardStatusData.info) || []
|
|
323
|
+
}];
|
|
310
324
|
}
|
|
311
325
|
});
|
|
312
326
|
}); });
|
|
@@ -360,30 +374,29 @@ export var resetPassword = createAsyncThunk('resetPassword', function (params, t
|
|
|
360
374
|
});
|
|
361
375
|
}); });
|
|
362
376
|
export var retrieveBoardResetPasswordSuccess = createAsyncThunk('retrieveBoardResetPasswordSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
363
|
-
var _a, password, settings, _b,
|
|
364
|
-
var _e, _f, _g, _h, _j, _k, _l
|
|
365
|
-
return __generator(this, function (
|
|
366
|
-
switch (
|
|
377
|
+
var _a, password, settings, _b, id, boardResponse, _c, showBoard, mode, boardInfoData;
|
|
378
|
+
var _d, _e, _f, _g, _h, _j, _k, _l;
|
|
379
|
+
return __generator(this, function (_m) {
|
|
380
|
+
switch (_m.label) {
|
|
367
381
|
case 0:
|
|
368
382
|
_a = thunkApi.getState(), password = _a.password, settings = _a.settings;
|
|
369
|
-
_b = password.data.verify.responseBody || { board_id: '' },
|
|
383
|
+
_b = password.data.verify.responseBody || { board_id: '' }, id = _b.board_id, boardResponse = _b.boardResponse;
|
|
370
384
|
_c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
|
|
371
385
|
if (!showBoard && mode === 'content') {
|
|
372
|
-
(
|
|
373
|
-
(
|
|
374
|
-
return [2, { id:
|
|
386
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
|
|
387
|
+
(_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: boardResponse });
|
|
388
|
+
return [2, { id: id, response: {} }];
|
|
375
389
|
}
|
|
376
|
-
|
|
377
|
-
return [4, Promise.all([
|
|
378
|
-
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
379
|
-
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
380
|
-
])];
|
|
390
|
+
return [4, API.boardService.retrieveBoardInfoStatus(id)];
|
|
381
391
|
case 1:
|
|
382
|
-
|
|
392
|
+
boardInfoData = _m.sent();
|
|
393
|
+
return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
|
|
394
|
+
case 2:
|
|
395
|
+
_m.sent();
|
|
383
396
|
thunkApi.dispatch(handleNextScreenStep());
|
|
384
|
-
(
|
|
385
|
-
(
|
|
386
|
-
return [2, { id:
|
|
397
|
+
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, { id: id });
|
|
398
|
+
(_l = (_k = settings.data.appConfig).onFlowCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, id);
|
|
399
|
+
return [2, { id: id, response: { flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [] } }];
|
|
387
400
|
}
|
|
388
401
|
});
|
|
389
402
|
}); });
|
|
@@ -438,11 +451,17 @@ export var passwordSlice = createSlice({
|
|
|
438
451
|
extraReducers: function (builder) {
|
|
439
452
|
builder
|
|
440
453
|
.addCase(verifyLeadToken.fulfilled, function (state, action) {
|
|
454
|
+
var _a;
|
|
441
455
|
state.data.verify.operationType = PASSWORD_OPERATION_TYPE.SET_PASSWORD;
|
|
442
456
|
state.error = null;
|
|
443
457
|
state.customLoading = false;
|
|
444
|
-
var
|
|
445
|
-
|
|
458
|
+
var _b = action.payload, data = _b.data, token = _b.token, boardResponse = _b.boardResponse;
|
|
459
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
460
|
+
if (description) {
|
|
461
|
+
state.error = description;
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), boardResponse), state.data.verify.responseBody), { board_id: data.id });
|
|
446
465
|
state.data.verify.token = token;
|
|
447
466
|
})
|
|
448
467
|
.addCase(verifyLeadToken.pending, function (state) {
|
|
@@ -475,12 +494,17 @@ export var passwordSlice = createSlice({
|
|
|
475
494
|
state.error = null;
|
|
476
495
|
})
|
|
477
496
|
.addCase(verifyPasswordLeadOTP.fulfilled, function (state, action) {
|
|
497
|
+
var _a;
|
|
478
498
|
state.loading = false;
|
|
479
499
|
state.error = null;
|
|
480
|
-
var
|
|
500
|
+
var _b = action.payload, data = _b.data, formData = _b.formData;
|
|
501
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
502
|
+
if (description) {
|
|
503
|
+
state.error = description;
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
481
506
|
state.data.otpData = formData;
|
|
482
507
|
state.data.otpData.responseBody = data;
|
|
483
|
-
state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { board_id: data.id });
|
|
484
508
|
})
|
|
485
509
|
.addCase(verifyPasswordLeadOTP.rejected, function (state, action) {
|
|
486
510
|
state.loading = false;
|
|
@@ -514,7 +538,7 @@ export var passwordSlice = createSlice({
|
|
|
514
538
|
.addCase(retrieveBoardDetails.fulfilled, function (state, action) {
|
|
515
539
|
state.error = null;
|
|
516
540
|
state.loading = false;
|
|
517
|
-
var data = action.payload || {};
|
|
541
|
+
var data = (action.payload || {}).data;
|
|
518
542
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
519
543
|
})
|
|
520
544
|
.addCase(retrieveBoardDetails.rejected, function (state, action) {
|
|
@@ -522,11 +546,15 @@ export var passwordSlice = createSlice({
|
|
|
522
546
|
state.loading = false;
|
|
523
547
|
})
|
|
524
548
|
.addCase(updateBoardSuccess.fulfilled, function (state, action) {
|
|
525
|
-
var _a;
|
|
526
549
|
state.loading = false;
|
|
527
550
|
state.error = null;
|
|
528
|
-
var
|
|
529
|
-
|
|
551
|
+
var response = (action.payload || {}).response;
|
|
552
|
+
var flows = response.flows;
|
|
553
|
+
var _a = state.data.verify.responseBody || {}, individuals = _a.individuals, individualData = _a.individualData;
|
|
554
|
+
var data_state = (individualData || {}).data_state;
|
|
555
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
|
|
556
|
+
individuals: __assign(__assign({}, individuals), { data_state: data_state })
|
|
557
|
+
}));
|
|
530
558
|
})
|
|
531
559
|
.addCase(updateBoardSuccess.pending, function (state) {
|
|
532
560
|
state.loading = true;
|
|
@@ -535,27 +563,20 @@ export var passwordSlice = createSlice({
|
|
|
535
563
|
.addCase(updateBoardSuccess.rejected, function (state, action) {
|
|
536
564
|
state.loading = false;
|
|
537
565
|
state.error = action.error.message;
|
|
538
|
-
})
|
|
539
|
-
.addCase(retrieveBoardStatus.pending, function (state) {
|
|
540
|
-
state.error = null;
|
|
541
|
-
state.loading = true;
|
|
542
|
-
})
|
|
543
|
-
.addCase(retrieveBoardStatus.fulfilled, function (state, action) {
|
|
544
|
-
state.error = null;
|
|
545
|
-
state.loading = false;
|
|
546
|
-
var flows = (action.payload || {}).flows;
|
|
547
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
|
|
548
|
-
})
|
|
549
|
-
.addCase(retrieveBoardStatus.rejected, function (state, action) {
|
|
550
|
-
state.error = action.error.message;
|
|
551
|
-
state.loading = false;
|
|
552
566
|
})
|
|
553
567
|
.addCase(verifyOperationToken.fulfilled, function (state, action) {
|
|
568
|
+
var _a;
|
|
554
569
|
state.data.verify.operationType = PASSWORD_OPERATION_TYPE.RESET_PASSWORD;
|
|
555
570
|
state.error = null;
|
|
556
571
|
state.customLoading = false;
|
|
557
|
-
var
|
|
558
|
-
state.data.verify.responseBody = __assign(__assign(__assign(
|
|
572
|
+
var _b = action.payload, data = _b.data, token = _b.token, boardId = _b.boardId, flows = _b.flows, boardResponse = _b.boardResponse, boardInfoId = _b.boardInfoId;
|
|
573
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, boardResponse), state.data.verify.responseBody), { board_id: boardId, board_info_id: boardInfoId, flows: flows });
|
|
574
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
575
|
+
if (description) {
|
|
576
|
+
state.error = description;
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), boardResponse), state.data.verify.responseBody), { board_id: boardId, board_info_id: boardInfoId, flows: flows });
|
|
559
580
|
state.data.verify.token = token;
|
|
560
581
|
})
|
|
561
582
|
.addCase(verifyOperationToken.pending, function (state) {
|
|
@@ -584,10 +605,16 @@ export var passwordSlice = createSlice({
|
|
|
584
605
|
state.error = action.error.message;
|
|
585
606
|
})
|
|
586
607
|
.addCase(resetPassword.fulfilled, function (state, action) {
|
|
608
|
+
var _a;
|
|
587
609
|
state.data.verify.operationType = PASSWORD_OPERATION_TYPE.RESET_PASSWORD;
|
|
588
610
|
state.error = null;
|
|
589
611
|
state.loading = false;
|
|
590
|
-
var
|
|
612
|
+
var _b = action.payload, data = _b.data, formData = _b.formData;
|
|
613
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
614
|
+
if (description) {
|
|
615
|
+
state.error = description;
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
591
618
|
state.data.passwordData = formData;
|
|
592
619
|
state.data.passwordData.responseBody = data;
|
|
593
620
|
})
|
|
@@ -602,8 +629,13 @@ export var passwordSlice = createSlice({
|
|
|
602
629
|
.addCase(retrieveBoardResetPasswordSuccess.fulfilled, function (state, action) {
|
|
603
630
|
state.loading = false;
|
|
604
631
|
state.error = null;
|
|
605
|
-
var
|
|
606
|
-
|
|
632
|
+
var response = (action.payload || {}).response;
|
|
633
|
+
var flows = response.flows;
|
|
634
|
+
var _a = state.data.verify.responseBody || {}, individuals = _a.individuals, individualData = _a.individualData;
|
|
635
|
+
var data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? individuals : individualData) || {}).data_state;
|
|
636
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
|
|
637
|
+
individuals: __assign(__assign({}, individuals), { data_state: data_state })
|
|
638
|
+
}));
|
|
607
639
|
})
|
|
608
640
|
.addCase(retrieveBoardResetPasswordSuccess.pending, function (state) {
|
|
609
641
|
state.loading = true;
|
|
@@ -624,6 +656,20 @@ export var passwordSlice = createSlice({
|
|
|
624
656
|
.addCase(onCloseCompletePassword.rejected, function (state, action) {
|
|
625
657
|
state.loading = false;
|
|
626
658
|
state.error = action.error.message;
|
|
659
|
+
})
|
|
660
|
+
.addCase(retrieveBoardStatus.pending, function (state) {
|
|
661
|
+
state.error = null;
|
|
662
|
+
state.loading = true;
|
|
663
|
+
})
|
|
664
|
+
.addCase(retrieveBoardStatus.fulfilled, function (state, action) {
|
|
665
|
+
state.error = null;
|
|
666
|
+
state.loading = false;
|
|
667
|
+
var flows = action.payload.flows;
|
|
668
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
|
|
669
|
+
})
|
|
670
|
+
.addCase(retrieveBoardStatus.rejected, function (state, action) {
|
|
671
|
+
state.error = action.error.message;
|
|
672
|
+
state.loading = false;
|
|
627
673
|
});
|
|
628
674
|
}
|
|
629
675
|
});
|
|
@@ -6,7 +6,8 @@ interface VerifyLeadTokenProps {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
8
8
|
data: any;
|
|
9
|
-
|
|
9
|
+
individualData: any;
|
|
10
|
+
boardResponse: any;
|
|
10
11
|
token: string;
|
|
11
12
|
}, VerifyLeadTokenProps, {
|
|
12
13
|
state?: unknown;
|
|
@@ -42,12 +43,9 @@ export declare const retrieveBoardStatus: import("@reduxjs/toolkit").AsyncThunk<
|
|
|
42
43
|
fulfilledMeta?: unknown;
|
|
43
44
|
rejectedMeta?: unknown;
|
|
44
45
|
}>;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
individualType: string;
|
|
49
|
-
};
|
|
50
|
-
export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk<any, RetrieveBoardProps, {
|
|
46
|
+
export declare const retrieveEntityInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
47
|
+
data: any;
|
|
48
|
+
}, string, {
|
|
51
49
|
state?: unknown;
|
|
52
50
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
53
51
|
extra?: unknown;
|
|
@@ -59,7 +57,6 @@ export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk
|
|
|
59
57
|
}>;
|
|
60
58
|
export declare const verifyTaxLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
61
59
|
data: any;
|
|
62
|
-
entityData: any;
|
|
63
60
|
formData: OTPFormValues;
|
|
64
61
|
}, OTPFormValues, {
|
|
65
62
|
state?: unknown;
|
|
@@ -85,11 +82,8 @@ export declare const updateTaxInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
85
82
|
rejectedMeta?: unknown;
|
|
86
83
|
}>;
|
|
87
84
|
export declare const updateLeadSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} | {
|
|
91
|
-
data: any;
|
|
92
|
-
flows: any;
|
|
85
|
+
response: any;
|
|
86
|
+
formData: void;
|
|
93
87
|
} | undefined, void, {
|
|
94
88
|
state?: unknown;
|
|
95
89
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|