@tap-payments/auth-jsconnect 2.8.55-beta → 2.8.55-development

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.
Files changed (189) hide show
  1. package/build/@types/app.d.ts +1 -0
  2. package/build/@types/form.d.ts +1 -0
  3. package/build/@types/redux.d.ts +1 -0
  4. package/build/api/entity.d.ts +2 -2
  5. package/build/api/entity.js +12 -4
  6. package/build/api/index.d.ts +2 -2
  7. package/build/constants/api.d.ts +0 -1
  8. package/build/constants/api.js +0 -2
  9. package/build/constants/app.d.ts +0 -2
  10. package/build/constants/app.js +0 -2
  11. package/build/features/app/bank/bankStore.d.ts +13 -18
  12. package/build/features/app/bank/bankStore.js +184 -165
  13. package/build/features/app/board/boardStore.js +52 -30
  14. package/build/features/app/brand/brandStore.d.ts +16 -33
  15. package/build/features/app/brand/brandStore.js +239 -242
  16. package/build/features/app/business/businessStore.d.ts +0 -5
  17. package/build/features/app/business/businessStore.js +76 -87
  18. package/build/features/app/connectExpress/connectExpressStore.d.ts +15 -6
  19. package/build/features/app/connectExpress/connectExpressStore.js +110 -52
  20. package/build/features/app/entity/entityStore.d.ts +20 -36
  21. package/build/features/app/entity/entityStore.js +196 -246
  22. package/build/features/app/individual/individualStore.d.ts +22 -38
  23. package/build/features/app/individual/individualStore.js +263 -266
  24. package/build/features/app/password/passwordStore.d.ts +40 -23
  25. package/build/features/app/password/passwordStore.js +226 -233
  26. package/build/features/app/tax/taxStore.d.ts +13 -7
  27. package/build/features/app/tax/taxStore.js +168 -147
  28. package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +13 -1
  29. package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +7 -1
  30. package/build/features/bank/Bank.d.ts +1 -0
  31. package/build/features/bank/Bank.js +7 -4
  32. package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
  33. package/build/features/bank/screens/OperatorError/OperatorError.d.ts +5 -0
  34. package/build/features/bank/screens/OperatorError/OperatorError.js +9 -0
  35. package/build/features/bank/screens/OperatorError/index.d.ts +3 -0
  36. package/build/features/bank/screens/OperatorError/index.js +2 -0
  37. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  38. package/build/features/bank/screens/Verify/Verify.js +5 -5
  39. package/build/features/board/Board.js +8 -4
  40. package/build/features/board/screens/OperatorError/OperatorError.d.ts +5 -0
  41. package/build/features/board/screens/OperatorError/OperatorError.js +9 -0
  42. package/build/features/board/screens/OperatorError/index.d.ts +3 -0
  43. package/build/features/board/screens/OperatorError/index.js +2 -0
  44. package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -4
  45. package/build/features/brand/Brand.d.ts +1 -0
  46. package/build/features/brand/Brand.js +7 -4
  47. package/build/features/brand/screens/BrandActivities/BrandActivities.js +49 -12
  48. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +6 -3
  49. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
  50. package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
  51. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
  52. package/build/features/brand/screens/BrandInfo/BrandInfo.js +23 -5
  53. package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +23 -7
  54. package/build/features/brand/screens/OperatorError/OperatorError.d.ts +5 -0
  55. package/build/features/brand/screens/OperatorError/OperatorError.js +9 -0
  56. package/build/features/brand/screens/OperatorError/index.d.ts +3 -0
  57. package/build/features/brand/screens/OperatorError/index.js +2 -0
  58. package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  59. package/build/features/brand/screens/Verify/Verify.js +1 -1
  60. package/build/features/business/Business.js +9 -4
  61. package/build/features/business/screens/Activities/Activities.js +12 -3
  62. package/build/features/business/screens/BusinessType/BusinessType.js +10 -2
  63. package/build/features/business/screens/CivilID/CivilID.js +1 -1
  64. package/build/features/business/screens/Customers/Customers.js +12 -3
  65. package/build/features/business/screens/Customers/ExpectedSalesRange.js +6 -3
  66. package/build/features/business/screens/IDBOD/IDBOD.js +10 -2
  67. package/build/features/business/screens/OTP/OTP.js +1 -1
  68. package/build/features/business/screens/OperatorError/OperatorError.d.ts +5 -0
  69. package/build/features/business/screens/OperatorError/OperatorError.js +9 -0
  70. package/build/features/business/screens/OperatorError/index.d.ts +3 -0
  71. package/build/features/business/screens/OperatorError/index.js +2 -0
  72. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -3
  73. package/build/features/business/screens/Verify/Verify.js +13 -3
  74. package/build/features/connect/Connect.js +3 -2
  75. package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
  76. package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +9 -2
  77. package/build/features/connect/screens/CivilID/CivilID.js +1 -1
  78. package/build/features/connect/screens/Individual/Email.js +3 -1
  79. package/build/features/connect/screens/Individual/Individual.js +1 -1
  80. package/build/features/connect/screens/Merchant/BrandList.js +3 -3
  81. package/build/features/connect/screens/Merchant/Merchant.js +1 -1
  82. package/build/features/connect/screens/Merchant/SalesChannels.js +1 -1
  83. package/build/features/connect/screens/Mobile/Mobile.js +11 -8
  84. package/build/features/connect/screens/NID/NID.js +1 -1
  85. package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
  86. package/build/features/connectExpress/ConnectExpress.js +2 -1
  87. package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +5 -2
  88. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +9 -0
  89. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +90 -0
  90. package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +6 -1
  91. package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +3 -0
  92. package/build/features/connectExpress/screens/AuthenticationList/validation.js +10 -0
  93. package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +7 -1
  94. package/build/features/connectExpress/screens/CivilID/CivilID.js +1 -1
  95. package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +1 -1
  96. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -1
  97. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +1 -1
  98. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +3 -1
  99. package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +14 -24
  100. package/build/features/connectExpress/screens/Mobile/Mobile.js +9 -2
  101. package/build/features/connectExpress/screens/NID/NID.js +1 -1
  102. package/build/features/connectExpress/screens/NIDMissed/NID.js +1 -1
  103. package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +5 -0
  104. package/build/features/connectExpress/screens/OperatorError/OperatorError.js +9 -0
  105. package/build/features/connectExpress/screens/OperatorError/index.d.ts +3 -0
  106. package/build/features/connectExpress/screens/OperatorError/index.js +2 -0
  107. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +5 -0
  108. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +34 -0
  109. package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +2 -0
  110. package/build/features/connectExpress/screens/PrepareDataLoading/index.js +2 -0
  111. package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  112. package/build/features/entity/Entity.d.ts +1 -0
  113. package/build/features/entity/Entity.js +7 -4
  114. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +8 -4
  115. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +8 -4
  116. package/build/features/entity/screens/EntityCapital/EntityCapital.js +34 -10
  117. package/build/features/entity/screens/EntityName/EntityName.js +32 -15
  118. package/build/features/entity/screens/OperatorError/OperatorError.d.ts +5 -0
  119. package/build/features/entity/screens/OperatorError/OperatorError.js +9 -0
  120. package/build/features/entity/screens/OperatorError/index.d.ts +3 -0
  121. package/build/features/entity/screens/OperatorError/index.js +2 -0
  122. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  123. package/build/features/entity/screens/Verify/Verify.js +1 -1
  124. package/build/features/featuresScreens.js +67 -7
  125. package/build/features/individual/Individual.d.ts +1 -0
  126. package/build/features/individual/Individual.js +7 -4
  127. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +54 -14
  128. package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +14 -0
  129. package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.js +76 -0
  130. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +5 -2
  131. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +8 -3
  132. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +4 -1
  133. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +3 -2
  134. package/build/features/individual/screens/IndividualList/Email.js +3 -2
  135. package/build/features/individual/screens/IndividualList/IndividualList.js +18 -5
  136. package/build/features/individual/screens/IndividualList/UserList.js +13 -9
  137. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +4 -2
  138. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +76 -20
  139. package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
  140. package/build/features/individual/screens/OperatorError/OperatorError.d.ts +5 -0
  141. package/build/features/individual/screens/OperatorError/OperatorError.js +9 -0
  142. package/build/features/individual/screens/OperatorError/index.d.ts +3 -0
  143. package/build/features/individual/screens/OperatorError/index.js +2 -0
  144. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  145. package/build/features/individual/screens/Verify/Verify.js +1 -1
  146. package/build/features/password/Password.d.ts +1 -0
  147. package/build/features/password/Password.js +75 -28
  148. package/build/features/password/screens/CreatePassword/CreatePassword.js +8 -4
  149. package/build/features/password/screens/OTP/OTP.js +1 -1
  150. package/build/features/password/screens/OperatorError/OperatorError.d.ts +5 -0
  151. package/build/features/password/screens/OperatorError/OperatorError.js +9 -0
  152. package/build/features/password/screens/OperatorError/index.d.ts +3 -0
  153. package/build/features/password/screens/OperatorError/index.js +2 -0
  154. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
  155. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
  156. package/build/features/password/screens/PrepareDataLoading/index.d.ts +2 -0
  157. package/build/features/password/screens/PrepareDataLoading/index.js +2 -0
  158. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  159. package/build/features/password/screens/Verify/Verify.js +5 -5
  160. package/build/features/shared/Button/FlowsButtons.js +13 -3
  161. package/build/features/shared/Containers/FeatureContainer.d.ts +1 -0
  162. package/build/features/shared/Containers/FeatureContainer.js +3 -3
  163. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +5 -1
  164. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +3 -3
  165. package/build/features/signIn/SignIn.js +12 -3
  166. package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +5 -0
  167. package/build/features/signIn/screens/OperatorError/OperatorError.js +9 -0
  168. package/build/features/signIn/screens/OperatorError/index.d.ts +3 -0
  169. package/build/features/signIn/screens/OperatorError/index.js +2 -0
  170. package/build/features/tax/Tax.d.ts +1 -0
  171. package/build/features/tax/Tax.js +7 -4
  172. package/build/features/tax/screens/OperatorError/OperatorError.d.ts +5 -0
  173. package/build/features/tax/screens/OperatorError/OperatorError.js +9 -0
  174. package/build/features/tax/screens/OperatorError/index.d.ts +3 -0
  175. package/build/features/tax/screens/OperatorError/index.js +2 -0
  176. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  177. package/build/features/tax/screens/TaxDetails/TaxDetails.js +7 -2
  178. package/build/features/tax/screens/Verify/Verify.js +5 -5
  179. package/build/hooks/index.d.ts +1 -0
  180. package/build/hooks/index.js +1 -0
  181. package/build/hooks/useFormDirtyCheck.d.ts +10 -0
  182. package/build/hooks/useFormDirtyCheck.js +66 -0
  183. package/build/hooks/useVerifyToken.d.ts +5 -2
  184. package/build/hooks/useVerifyToken.js +10 -5
  185. package/build/utils/common.js +4 -4
  186. package/build/utils/locale.js +2 -1
  187. package/build/utils/string.d.ts +5 -2
  188. package/build/utils/string.js +34 -5
  189. package/package.json +2 -2
@@ -49,79 +49,58 @@ var _a;
49
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
50
  import API from '../../../api';
51
51
  import { FlowsTypes } from '../../../@types';
52
- import { handleCurrentActiveScreen, handleNextScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
52
+ import { handleCurrentActiveScreen, handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
53
53
  import { PASSWORD_OPERATION_TYPE, PASSWORD_STEP_NAMES } from '../../../constants';
54
- import { retrieveIndividualData } from '../../../utils';
55
- export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
56
- var payload, data, boardStatusData, boardInfoData, boardData, individualData, countryIso2, _a, board_id, board_info_id, config, country_code, publicKey, _b, id_1, type_1, serviceCallBack, _c, boardRes, individualRes, info, hasPasswordCompleted;
57
- var _d, _e, _f, _g, _h;
58
- return __generator(this, function (_j) {
59
- switch (_j.label) {
60
- case 0:
61
- payload = {
62
- service_name: 'tap_email',
63
- verify_token: token
64
- };
65
- return [4, API.leadService.verifyLeadToken(payload)];
66
- case 1:
67
- data = (_j.sent()).data;
68
- countryIso2 = undefined;
69
- if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 8];
70
- _a = data || {}, board_id = _a.id, board_info_id = _a.board_info_id, config = _a.config, country_code = _a.country_code;
71
- publicKey = config === null || config === void 0 ? void 0 : config.public_key;
72
- if (publicKey) {
73
- thunkApi.dispatch(handlePublicKey(publicKey));
74
- }
75
- if (country_code) {
54
+ import { retrieveIndividualData, sleep } from '../../../utils';
55
+ export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', function (_a, thunkApi) {
56
+ var token = _a.token, isInternally = _a.isInternally;
57
+ return __awaiter(void 0, void 0, void 0, function () {
58
+ var payload, data, _b, config, board_info_password_status, country_code, board_id, countryIso2, publicKey, data_1;
59
+ var _c, _d;
60
+ return __generator(this, function (_e) {
61
+ switch (_e.label) {
62
+ case 0:
63
+ payload = __assign({ service_name: 'tap_email', verify_token: token }, (isInternally && {
64
+ notification: {
65
+ sms: false
66
+ }
67
+ }));
68
+ return [4, API.leadService.verifyLeadToken(payload)];
69
+ case 1:
70
+ data = (_e.sent()).data;
71
+ if (((_c = data === null || data === void 0 ? void 0 : data.errors) === null || _c === void 0 ? void 0 : _c.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
72
+ throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
73
+ if (isInternally)
74
+ 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
76
  countryIso2 = country_code;
77
- thunkApi.dispatch(handleSetCountryByIso2(country_code));
78
- }
79
- if (!board_id) return [3, 7];
80
- if (!board_info_id) return [3, 3];
81
- return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
82
- case 2:
83
- boardInfoData = _j.sent();
84
- _j.label = 3;
85
- case 3: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
86
- case 4:
87
- boardStatusData = _j.sent();
88
- return [4, API.boardService.retrieveBoardDetails(board_id)];
89
- case 5:
90
- boardData = _j.sent();
91
- _b = ((_d = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _d === void 0 ? void 0 : _d.recipient) || {}, id_1 = _b.id, type_1 = _b.type;
92
- serviceCallBack = function () { return API.individualService.retrieveIndividual(id_1, type_1); };
93
- return [4, retrieveIndividualData(type_1, boardData, serviceCallBack)];
94
- case 6:
95
- _c = _j.sent(), boardRes = _c.boardRes, individualRes = _c.individualRes;
96
- boardData = boardRes;
97
- individualData = individualRes;
98
- _j.label = 7;
99
- case 7:
100
- if (!country_code && ((_e = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _e === void 0 ? void 0 : _e.country)) {
101
- countryIso2 = boardData.entity.country;
102
- thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
103
- }
104
- info = (boardStatusData || {}).info;
105
- hasPasswordCompleted = ((_f = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'password'; })) === null || _f === void 0 ? void 0 : _f.status) === 'completed';
106
- if (data.step_name === PASSWORD_STEP_NAMES.PHONE_AUTH) {
107
- thunkApi.dispatch(handleCurrentActiveScreen('PASSWORD_VERIFY_STEP'));
108
- }
109
- else if (hasPasswordCompleted) {
110
- thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
111
- }
112
- else if (data.step_name === PASSWORD_STEP_NAMES.PASSWORD_INFO) {
113
- thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
114
- }
115
- _j.label = 8;
116
- case 8: return [2, {
117
- data: data,
118
- individualData: individualData,
119
- 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: (_g = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _g === void 0 ? void 0 : _g.names, contact: (_h = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _h === void 0 ? void 0 : _h.contact, business: boardData === null || boardData === void 0 ? void 0 : boardData.business, notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification }),
120
- token: token
121
- }];
122
- }
77
+ if (countryIso2)
78
+ thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
79
+ publicKey = config === null || config === void 0 ? void 0 : config.public_key;
80
+ if (publicKey)
81
+ thunkApi.dispatch(handlePublicKey(publicKey));
82
+ if (!!country_code) return [3, 3];
83
+ return [4, API.boardService.retrieveBoardDetails(board_id)];
84
+ case 2:
85
+ data_1 = _e.sent();
86
+ if ((_d = data_1 === null || data_1 === void 0 ? void 0 : data_1.entity) === null || _d === void 0 ? void 0 : _d.country)
87
+ thunkApi.dispatch(handleSetCountryByIso2(data_1.entity.country));
88
+ _e.label = 3;
89
+ case 3:
90
+ if (data.step_name === PASSWORD_STEP_NAMES.PHONE_AUTH) {
91
+ thunkApi.dispatch(handleCurrentActiveScreen('PASSWORD_VERIFY_STEP'));
92
+ }
93
+ else if (board_info_password_status === 'completed') {
94
+ thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
95
+ }
96
+ else if (data.step_name === PASSWORD_STEP_NAMES.PASSWORD_INFO) {
97
+ thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
98
+ }
99
+ return [2, { data: data, token: token }];
100
+ }
101
+ });
123
102
  });
124
- }); });
103
+ });
125
104
  export var resendOTP = createAsyncThunk('resendOTPPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
126
105
  var password, payload, data;
127
106
  return __generator(this, function (_a) {
@@ -139,54 +118,74 @@ export var resendOTP = createAsyncThunk('resendOTPPassword', function (params, t
139
118
  }
140
119
  });
141
120
  }); });
142
- export var retrieveBoardDetails = createAsyncThunk('retrievePasswordBoardDetails', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
143
- var data;
144
- var _a, _b;
145
- return __generator(this, function (_c) {
146
- switch (_c.label) {
147
- case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
148
- case 1:
149
- data = _c.sent();
150
- return [2, {
151
- 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 })
152
- }];
153
- }
121
+ export var retrieveBoardDetails = createAsyncThunk('retrievePasswordBoardDetails', function (_a) {
122
+ var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
123
+ return __awaiter(void 0, void 0, void 0, function () {
124
+ var data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
125
+ var _c, _d, _e;
126
+ return __generator(this, function (_f) {
127
+ switch (_f.label) {
128
+ case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
129
+ case 1:
130
+ data = _f.sent();
131
+ individualData = data === null || data === void 0 ? void 0 : data.user;
132
+ boardData = data;
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 })];
142
+ }
143
+ });
154
144
  });
155
- }); });
145
+ });
156
146
  export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
157
- var _a, password, settings, responseBody, payload, data, publicKey, flows, hasPasswordCompleted;
158
- var _b, _c, _d, _e, _f;
159
- return __generator(this, function (_g) {
160
- switch (_g.label) {
147
+ var _a, password, settings, responseBody, payload, data, _b, config, board_info_password_status, country_code, board_id, countryIso2, publicKey, data_2;
148
+ var _c, _d, _e, _f, _g;
149
+ return __generator(this, function (_h) {
150
+ switch (_h.label) {
161
151
  case 0:
162
152
  _a = thunkApi.getState(), password = _a.password, settings = _a.settings;
163
153
  responseBody = password.data.verify.responseBody;
164
154
  payload = {
165
155
  data: params.otp,
166
- service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
156
+ service_name: (_c = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _c === void 0 ? void 0 : _c.service_name,
167
157
  verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
168
158
  step_name: PASSWORD_STEP_NAMES.PHONE_AUTH,
169
159
  encryption_contract: ['data']
170
160
  };
171
161
  return [4, API.leadService.verifyLeadOTP(payload)];
172
162
  case 1:
173
- data = (_g.sent()).data;
174
- if (!data.errors) {
175
- publicKey = (_c = data === null || data === void 0 ? void 0 : data.config) === null || _c === void 0 ? void 0 : _c.public_key;
176
- if (publicKey) {
177
- thunkApi.dispatch(handlePublicKey(publicKey));
178
- }
179
- (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, { otp: params.otp });
180
- flows = (responseBody || {}).flows;
181
- 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';
182
- if (hasPasswordCompleted) {
183
- thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
184
- }
185
- else {
186
- thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
187
- }
188
- }
189
- return [2, { data: data, formData: __assign({}, params) }];
163
+ data = (_h.sent()).data;
164
+ if ((_d = data === null || data === void 0 ? void 0 : data.errors) === null || _d === void 0 ? void 0 : _d.length)
165
+ throw new Error(data.errors[0].description);
166
+ _b = data || {}, config = _b.config, board_info_password_status = _b.board_info_password_status, country_code = _b.country_code, board_id = _b.board_id;
167
+ countryIso2 = country_code;
168
+ if (countryIso2)
169
+ thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
170
+ publicKey = config === null || config === void 0 ? void 0 : config.public_key;
171
+ if (publicKey)
172
+ thunkApi.dispatch(handlePublicKey(publicKey));
173
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, { otp: params.otp });
174
+ if (!(board_info_password_status === 'completed')) return [3, 2];
175
+ thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
176
+ return [3, 5];
177
+ case 2:
178
+ if (!!country_code) return [3, 4];
179
+ return [4, API.boardService.retrieveBoardDetails(board_id)];
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) }];
190
189
  }
191
190
  });
192
191
  }); });
@@ -206,98 +205,108 @@ export var createPassword = createAsyncThunk('createPassword', function (params,
206
205
  return [4, API.authService.createPassword(requestBody)];
207
206
  case 1:
208
207
  data = _f.sent();
209
- thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_STEP'));
208
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_STEP')); });
210
209
  (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
211
210
  return [2, { data: data, formData: params }];
212
211
  }
213
212
  });
214
213
  }); });
215
214
  export var updateBoardSuccess = createAsyncThunk('passwordUpdateBoardSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
216
- var _a, settings, password, _b, id, infoId, _c, showBoard, mode, payload, data, boardInfoData;
217
- var _d, _e, _f, _g, _h, _j, _k, _l;
218
- return __generator(this, function (_m) {
219
- switch (_m.label) {
215
+ var _a, settings, password, _b, board_id, infoId, _c, showBoard, mode, payload, data, _d, id, type, boardInfoStatusData;
216
+ var _e, _f, _g, _h, _j, _k, _l, _m, _o;
217
+ return __generator(this, function (_p) {
218
+ switch (_p.label) {
220
219
  case 0:
221
220
  _a = thunkApi.getState(), settings = _a.settings, password = _a.password;
222
- _b = password.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id;
221
+ _b = password.data.verify.responseBody || {}, board_id = _b.board_id, infoId = _b.board_info_id;
223
222
  _c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
224
- if (!id)
223
+ if (!board_id)
225
224
  return [2];
226
225
  payload = {
227
226
  lang: settings.data.language,
228
- step_name: PASSWORD_STEP_NAMES.PASSWORD_SUCCESS,
229
- id: id
227
+ step_name: PASSWORD_STEP_NAMES.PASSWORD_SUCCESS
230
228
  };
231
- return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
229
+ return [4, API.boardService.updateBoardInfo(__assign({ id: board_id, infoId: infoId }, payload))];
232
230
  case 1:
233
- data = _m.sent();
231
+ data = _p.sent();
234
232
  if (!showBoard && mode === 'content') {
235
- (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
236
- (_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: data });
237
- return [2, { response: __assign({}, data), formData: params }];
233
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
234
+ (_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: data });
235
+ return [2, { data: data }];
238
236
  }
239
- return [4, API.boardService.retrieveBoardInfoStatus(id)];
237
+ _d = ((_j = data === null || data === void 0 ? void 0 : data.notification) === null || _j === void 0 ? void 0 : _j.recipient) || {}, id = _d.id, type = _d.type;
238
+ return [4, Promise.all([
239
+ API.boardService.retrieveBoardInfoStatus(board_id),
240
+ thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
241
+ ])];
240
242
  case 2:
241
- boardInfoData = _m.sent();
242
- return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
243
- case 3:
244
- _m.sent();
245
- (_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, {});
246
- (_l = (_k = settings.data.appConfig).onFlowCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, { data: data });
243
+ boardInfoStatusData = (_p.sent())[0];
244
+ (_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, {});
245
+ (_o = (_m = settings.data.appConfig).onFlowCompleted) === null || _o === void 0 ? void 0 : _o.call(_m, { data: data });
247
246
  thunkApi.dispatch(handleNextScreenStep());
248
- return [2, { response: __assign(__assign({}, data), { flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [] }), formData: params }];
247
+ return [2, { data: data, flows: (boardInfoStatusData === null || boardInfoStatusData === void 0 ? void 0 : boardInfoStatusData.info) || [] }];
248
+ }
249
+ });
250
+ }); });
251
+ export var retrieveBoardStatus = createAsyncThunk('password/retrieveBoardStatus', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
252
+ var password, _a, board_id, board_info_id, recipient, _b, id, type, data;
253
+ return __generator(this, function (_c) {
254
+ switch (_c.label) {
255
+ case 0:
256
+ password = thunkApi.getState().password;
257
+ _a = password.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id, recipient = _a.recipient;
258
+ if (!board_id || !board_info_id)
259
+ throw new Error('Internal server error');
260
+ _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
+ ])];
265
+ case 1:
266
+ data = (_c.sent())[0];
267
+ thunkApi.dispatch(handlePrevScreenStep());
268
+ return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
249
269
  }
250
270
  });
251
271
  }); });
252
272
  export var verifyOperationToken = createAsyncThunk('verifyOperationToken', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
253
- var token, boardId, boardInfoId, boardInfoData, boardStatusData, individualData, boardData, payload, data, _a, id_2, type_2, serviceCallBack, _b, boardRes, individualRes;
254
- var _c, _d, _e, _f;
255
- return __generator(this, function (_g) {
256
- switch (_g.label) {
273
+ var token, boardId, boardInfoId, userId, userType, payload, data, countryIso2, publicKey, data_3;
274
+ var _a, _b, _c;
275
+ return __generator(this, function (_d) {
276
+ switch (_d.label) {
257
277
  case 0:
258
- token = params.token, boardId = params.boardId, boardInfoId = params.boardInfoId;
259
- boardData = undefined;
278
+ token = params.token, boardId = params.boardId, boardInfoId = params.boardInfoId, userId = params.userId, userType = params.userType;
260
279
  payload = {
261
280
  auth_type: 7,
262
281
  auth_token: token
263
282
  };
264
283
  return [4, API.authService.verifyAuth(payload)];
265
284
  case 1:
266
- data = (_g.sent()).data;
267
- if (!boardId) return [3, 7];
268
- return [4, API.boardService.retrieveBoardInfoStatus(boardId)];
269
- case 2:
270
- boardStatusData = _g.sent();
285
+ data = (_d.sent()).data;
286
+ if ((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a.length)
287
+ throw new Error(data.errors[0].description);
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];
271
295
  return [4, API.boardService.retrieveBoardDetails(boardId)];
296
+ case 2:
297
+ data_3 = _d.sent();
298
+ if ((_c = data_3 === null || data_3 === void 0 ? void 0 : data_3.entity) === null || _c === void 0 ? void 0 : _c.country)
299
+ thunkApi.dispatch(handleSetCountryByIso2(data_3.entity.country));
300
+ _d.label = 3;
272
301
  case 3:
273
- boardData = _g.sent();
274
- if ((_c = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _c === void 0 ? void 0 : _c.country)
275
- thunkApi.dispatch(handleSetCountryByIso2(boardData.entity.country));
276
- if (!boardInfoId) return [3, 5];
277
- return [4, API.boardService.retrieveBoardInfo({ id: boardId, infoId: boardInfoId })];
278
- case 4:
279
- boardInfoData = _g.sent();
280
- _g.label = 5;
281
- case 5:
282
- _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;
283
- serviceCallBack = function () { return API.individualService.retrieveIndividual(id_2, type_2); };
284
- return [4, retrieveIndividualData(type_2, boardData, serviceCallBack)];
285
- case 6:
286
- _b = _g.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
287
- boardData = boardRes;
288
- individualData = individualRes;
289
- _g.label = 7;
290
- case 7:
291
302
  thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
292
- return [2, {
293
- data: data,
294
- token: token,
295
- boardId: boardId,
296
- boardInfoId: boardInfoId,
297
- individualData: individualData,
298
- 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 }),
299
- flows: (boardStatusData === null || boardStatusData === void 0 ? void 0 : boardStatusData.info) || []
300
- }];
303
+ return [2, __assign({ data: data, token: token, boardId: boardId, boardInfoId: boardInfoId }, (userId &&
304
+ userType && {
305
+ recipient: {
306
+ id: userId,
307
+ type: userType
308
+ }
309
+ }))];
301
310
  }
302
311
  });
303
312
  }); });
@@ -320,9 +329,9 @@ export var resendOperationOTP = createAsyncThunk('resendOperationOTPPassword', f
320
329
  }); });
321
330
  export var resetPassword = createAsyncThunk('resetPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
322
331
  var _a, password, settings, responseBody, passwordData, payload, data;
323
- var _b, _c;
324
- return __generator(this, function (_d) {
325
- switch (_d.label) {
332
+ var _b, _c, _d;
333
+ return __generator(this, function (_e) {
334
+ switch (_e.label) {
326
335
  case 0:
327
336
  _a = thunkApi.getState(), password = _a.password, settings = _a.settings;
328
337
  responseBody = password.data.verify.responseBody;
@@ -339,39 +348,42 @@ export var resetPassword = createAsyncThunk('resetPassword', function (params, t
339
348
  };
340
349
  return [4, API.authService.verifyAuth(payload)];
341
350
  case 1:
342
- data = (_d.sent()).data;
351
+ data = (_e.sent()).data;
352
+ if ((_b = data === null || data === void 0 ? void 0 : data.errors) === null || _b === void 0 ? void 0 : _b.length)
353
+ throw new Error(data.errors[0].description);
343
354
  if (!(data === null || data === void 0 ? void 0 : data.errors)) {
344
- thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_STEP'));
345
- (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, payload);
355
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_STEP')); });
356
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, payload);
346
357
  }
347
358
  return [2, { data: data, formData: __assign(__assign({}, params), passwordData) }];
348
359
  }
349
360
  });
350
361
  }); });
351
362
  export var retrieveBoardResetPasswordSuccess = createAsyncThunk('retrieveBoardResetPasswordSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
352
- var _a, password, settings, _b, id, boardResponse, _c, showBoard, mode, boardInfoData;
353
- var _d, _e, _f, _g, _h, _j, _k, _l;
354
- return __generator(this, function (_m) {
355
- switch (_m.label) {
363
+ var _a, password, settings, _b, board_id, boardResponse, recipient, _c, showBoard, mode, _d, id, type, data;
364
+ var _e, _f, _g, _h, _j, _k, _l, _m;
365
+ return __generator(this, function (_o) {
366
+ switch (_o.label) {
356
367
  case 0:
357
368
  _a = thunkApi.getState(), password = _a.password, settings = _a.settings;
358
- _b = password.data.verify.responseBody || { board_id: '' }, id = _b.board_id, boardResponse = _b.boardResponse;
369
+ _b = password.data.verify.responseBody || { board_id: '' }, board_id = _b.board_id, boardResponse = _b.boardResponse, recipient = _b.recipient;
359
370
  _c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
360
371
  if (!showBoard && mode === 'content') {
361
- (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
362
- (_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: boardResponse });
363
- return [2, { id: id, response: {} }];
372
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
373
+ (_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: boardResponse });
374
+ return [2, { id: board_id, flows: [] }];
364
375
  }
365
- return [4, API.boardService.retrieveBoardInfoStatus(id)];
376
+ _d = recipient || {}, id = _d.id, type = _d.type;
377
+ return [4, Promise.all([
378
+ API.boardService.retrieveBoardInfoStatus(board_id),
379
+ thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
380
+ ])];
366
381
  case 1:
367
- boardInfoData = _m.sent();
368
- return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
369
- case 2:
370
- _m.sent();
382
+ data = (_o.sent())[0];
371
383
  thunkApi.dispatch(handleNextScreenStep());
372
- (_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, { id: id });
373
- (_l = (_k = settings.data.appConfig).onFlowCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, id);
374
- return [2, { id: id, response: { flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [] } }];
384
+ (_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, { id: id });
385
+ (_m = (_l = settings.data.appConfig).onFlowCompleted) === null || _m === void 0 ? void 0 : _m.call(_l, board_id);
386
+ return [2, { id: board_id, flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
375
387
  }
376
388
  });
377
389
  }); });
@@ -426,17 +438,11 @@ export var passwordSlice = createSlice({
426
438
  extraReducers: function (builder) {
427
439
  builder
428
440
  .addCase(verifyLeadToken.fulfilled, function (state, action) {
429
- var _a;
430
441
  state.data.verify.operationType = PASSWORD_OPERATION_TYPE.SET_PASSWORD;
431
442
  state.error = null;
432
443
  state.customLoading = false;
433
- var _b = action.payload, data = _b.data, token = _b.token, boardResponse = _b.boardResponse;
434
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
435
- if (description) {
436
- state.error = description;
437
- return;
438
- }
439
- state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), boardResponse), state.data.verify.responseBody), { board_id: data.id });
444
+ var _a = action.payload, data = _a.data, token = _a.token;
445
+ state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { board_id: data.id });
440
446
  state.data.verify.token = token;
441
447
  })
442
448
  .addCase(verifyLeadToken.pending, function (state) {
@@ -469,17 +475,12 @@ export var passwordSlice = createSlice({
469
475
  state.error = null;
470
476
  })
471
477
  .addCase(verifyPasswordLeadOTP.fulfilled, function (state, action) {
472
- var _a;
473
478
  state.loading = false;
474
479
  state.error = null;
475
- var _b = action.payload, data = _b.data, formData = _b.formData;
476
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
477
- if (description) {
478
- state.error = description;
479
- return;
480
- }
480
+ var _a = action.payload, data = _a.data, formData = _a.formData;
481
481
  state.data.otpData = formData;
482
482
  state.data.otpData.responseBody = data;
483
+ state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { board_id: data.id });
483
484
  })
484
485
  .addCase(verifyPasswordLeadOTP.rejected, function (state, action) {
485
486
  state.loading = false;
@@ -513,7 +514,7 @@ export var passwordSlice = createSlice({
513
514
  .addCase(retrieveBoardDetails.fulfilled, function (state, action) {
514
515
  state.error = null;
515
516
  state.loading = false;
516
- var data = (action.payload || {}).data;
517
+ var data = action.payload || {};
517
518
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
518
519
  })
519
520
  .addCase(retrieveBoardDetails.rejected, function (state, action) {
@@ -521,15 +522,11 @@ export var passwordSlice = createSlice({
521
522
  state.loading = false;
522
523
  })
523
524
  .addCase(updateBoardSuccess.fulfilled, function (state, action) {
525
+ var _a;
524
526
  state.loading = false;
525
527
  state.error = null;
526
- var response = (action.payload || {}).response;
527
- var flows = response.flows;
528
- var _a = state.data.verify.responseBody || {}, individuals = _a.individuals, individualData = _a.individualData;
529
- var data_state = (individualData || {}).data_state;
530
- state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
531
- individuals: __assign(__assign({}, individuals), { data_state: data_state })
532
- }));
528
+ var _b = action.payload || {}, flows = _b.flows, data = _b.data;
529
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, recipient: (_a = data === null || data === void 0 ? void 0 : data.notification) === null || _a === void 0 ? void 0 : _a.recipient });
533
530
  })
534
531
  .addCase(updateBoardSuccess.pending, function (state) {
535
532
  state.loading = true;
@@ -538,20 +535,27 @@ export var passwordSlice = createSlice({
538
535
  .addCase(updateBoardSuccess.rejected, function (state, action) {
539
536
  state.loading = false;
540
537
  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;
541
552
  })
542
553
  .addCase(verifyOperationToken.fulfilled, function (state, action) {
543
- var _a;
544
554
  state.data.verify.operationType = PASSWORD_OPERATION_TYPE.RESET_PASSWORD;
545
555
  state.error = null;
546
556
  state.customLoading = false;
547
- var _b = action.payload, data = _b.data, token = _b.token, boardId = _b.boardId, flows = _b.flows, boardResponse = _b.boardResponse, boardInfoId = _b.boardInfoId;
548
- state.data.verify.responseBody = __assign(__assign(__assign({}, boardResponse), state.data.verify.responseBody), { board_id: boardId, board_info_id: boardInfoId, flows: flows });
549
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
550
- if (description) {
551
- state.error = description;
552
- return;
553
- }
554
- state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), boardResponse), state.data.verify.responseBody), { board_id: boardId, board_info_id: boardInfoId, flows: flows });
557
+ var _a = action.payload, data = _a.data, token = _a.token, boardId = _a.boardId, boardInfoId = _a.boardInfoId, recipient = _a.recipient;
558
+ state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), { board_id: boardId, board_info_id: boardInfoId }), (recipient && { recipient: recipient }));
555
559
  state.data.verify.token = token;
556
560
  })
557
561
  .addCase(verifyOperationToken.pending, function (state) {
@@ -580,16 +584,10 @@ export var passwordSlice = createSlice({
580
584
  state.error = action.error.message;
581
585
  })
582
586
  .addCase(resetPassword.fulfilled, function (state, action) {
583
- var _a;
584
587
  state.data.verify.operationType = PASSWORD_OPERATION_TYPE.RESET_PASSWORD;
585
588
  state.error = null;
586
589
  state.loading = false;
587
- var _b = action.payload, data = _b.data, formData = _b.formData;
588
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
589
- if (description) {
590
- state.error = description;
591
- return;
592
- }
590
+ var _a = action.payload, data = _a.data, formData = _a.formData;
593
591
  state.data.passwordData = formData;
594
592
  state.data.passwordData.responseBody = data;
595
593
  })
@@ -604,13 +602,8 @@ export var passwordSlice = createSlice({
604
602
  .addCase(retrieveBoardResetPasswordSuccess.fulfilled, function (state, action) {
605
603
  state.loading = false;
606
604
  state.error = null;
607
- var response = (action.payload || {}).response;
608
- var flows = response.flows;
609
- var _a = state.data.verify.responseBody || {}, individuals = _a.individuals, individualData = _a.individualData;
610
- var data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? individuals : individualData) || {}).data_state;
611
- state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
612
- individuals: __assign(__assign({}, individuals), { data_state: data_state })
613
- }));
605
+ var flows = (action.payload || {}).flows;
606
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
614
607
  })
615
608
  .addCase(retrieveBoardResetPasswordSuccess.pending, function (state) {
616
609
  state.loading = true;