@zeniai/client-epic-state 4.15.98 → 4.16.0
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/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +1 -1
- package/lib/entity/chargeCard/chargeCard.d.ts +8 -26
- package/lib/entity/chargeCard/chargeCard.js +6 -25
- package/lib/entity/chargeCard/chargeCardPayload.d.ts +5 -41
- package/lib/entity/chargeCard/chargeCardPayload.js +8 -20
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.js +1 -5
- package/lib/entity/company/companyPayload.d.ts +1 -12
- package/lib/entity/company/companyPayload.js +0 -14
- package/lib/entity/company/companyStateTypes.d.ts +0 -11
- package/lib/entity/depositAccount/depositAccount.d.ts +2 -20
- package/lib/entity/depositAccount/depositAccountPayload.d.ts +1 -22
- package/lib/entity/depositAccount/depositAccountPayload.js +1 -39
- package/lib/entity/depositAccount/depositAccountReducer.d.ts +2 -2
- package/lib/entity/depositAccount/depositAccountReducer.js +2 -8
- package/lib/entity/depositAccount/depositAccountSelector.d.ts +1 -3
- package/lib/entity/depositAccount/depositAccountSelector.js +0 -10
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/entity/tenant/clearAllEpic.d.ts +1 -2
- package/lib/entity/tenant/clearAllEpic.js +0 -2
- package/lib/entity/tenant/tenantSelector.d.ts +2 -6
- package/lib/entity/tenant/tenantSelector.js +2 -10
- package/lib/epic.d.ts +1 -5
- package/lib/epic.js +1 -5
- package/lib/index.d.ts +18 -18
- package/lib/index.js +17 -26
- package/lib/reducer.d.ts +0 -3
- package/lib/reducer.js +0 -3
- package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +0 -8
- package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +0 -16
- package/lib/view/addressView/addressViewState.d.ts +1 -1
- package/lib/view/dashboard/dashboardSelector.js +6 -7
- package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.js +4 -5
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +2 -1
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic.js +6 -18
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/reviewFluxAnalysisEpic.js +4 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscatgorizedEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscatgorizedEpic.js +3 -3
- package/lib/view/expenseAutomationView/helpers/helpers.js +4 -4
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +23 -25
- package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.d.ts +9 -22
- package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.js +2 -2
- package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.d.ts +5 -13
- package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.js +115 -245
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +18 -12
- package/lib/view/expenseAutomationView/selectorTypes/fluxAnalysisViewSelectorTypes.d.ts +9 -29
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +40 -108
- package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.d.ts +15 -40
- package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.js +1 -1
- package/lib/view/onboardingView/cockpitView/epic/initializeOnboardingCustomerViewUpdateDataEpic.js +4 -4
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.d.ts +1 -2
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.js +2 -2
- package/lib/view/settingsView/settingsViewHelpers.d.ts +4 -4
- package/lib/view/settingsView/settingsViewHelpers.js +8 -9
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +1 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +1 -6
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +2 -20
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +0 -5
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -9
- package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +0 -1
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.js +3 -4
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.d.ts +3 -5
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.js +2 -4
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +3 -8
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState.d.ts +2 -4
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +0 -12
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +0 -26
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +0 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -43
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +9 -104
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +0 -15
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +16 -70
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +3 -12
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionListEpic.js +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardLimitEpic.js +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -11
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -20
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +1 -16
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +4 -6
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +4 -30
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +2 -5
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +14 -26
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +5 -20
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.js +2 -4
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +0 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/acceptChargeCardTermsEpic.js +2 -19
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.js +3 -15
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +25 -65
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +3 -11
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +11 -45
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +3 -6
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +18 -33
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +8 -41
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.js +21 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/enableSetupEpic.js +0 -9
- package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +3 -8
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +4 -4
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -2
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +1 -3
- package/lib/view/spendManagement/commonSetup/setupViewState.js +1 -13
- package/lib/view/spendManagement/helpers.d.ts +0 -3
- package/lib/view/spendManagement/helpers.js +1 -13
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/getPaymentAccountsEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +1 -2
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +1 -6
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +10 -10
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +0 -1
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
- package/lib/view/spendManagement/zeniAccounts/checkDeposit/checkDepositSelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.d.ts +1 -1
- package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.js +3 -3
- package/lib/view/spendManagement/zeniAccounts/expressPay/expressPaySelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +1 -1
- package/lib/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.d.ts +3 -4
- package/lib/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.js +1 -25
- package/lib/view/transactionDetail/epics/saveTransactionDetailEpic.js +1 -1
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +1 -1
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +2 -4
- package/lib/view/transactionDetail/transactionDetailReducer.js +2 -4
- package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +2 -3
- package/lib/view/twoFactorAuthentication/resendOtpEpic.js +19 -44
- package/lib/view/twoFactorAuthentication/sendOtpEpic.d.ts +1 -2
- package/lib/view/twoFactorAuthentication/sendOtpEpic.js +18 -45
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.d.ts +5 -17
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.js +0 -33
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.d.ts +7 -7
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.js +6 -6
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.d.ts +6 -22
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.js +60 -176
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.d.ts +3 -5
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.js +2 -13
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.d.ts +2 -5
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.js +5 -46
- package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +2 -2
- package/lib/view/userListView/fetchUserListByTypeEpic.js +3 -4
- package/lib/view/userListView/userListViewPayload.d.ts +0 -11
- package/package.json +4 -5
- package/lib/entity/connectedAccount/connectedAccount.d.ts +0 -19
- package/lib/entity/connectedAccount/connectedAccount.js +0 -10
- package/lib/entity/connectedAccount/connectedAccountPayload.d.ts +0 -11
- package/lib/entity/connectedAccount/connectedAccountPayload.js +0 -15
- package/lib/entity/connectedAccount/connectedAccountReducer.d.ts +0 -6
- package/lib/entity/connectedAccount/connectedAccountReducer.js +0 -27
- package/lib/entity/connectedAccount/connectedAccountSelector.d.ts +0 -4
- package/lib/entity/connectedAccount/connectedAccountSelector.js +0 -17
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.js +0 -41
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.d.ts +0 -11
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.js +0 -42
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.js +0 -23
- package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.d.ts +0 -6
- package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.js +0 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.js +0 -31
|
@@ -3,12 +3,19 @@ var _a;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.clearTwoFactorAuthentication = exports.verifyOtpFailure = exports.verifyOtpSuccess = exports.verifyOtp = exports.sendOtpFailure = exports.sendOtpSuccess = exports.resendOtp = exports.sendOtp = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const twoFactorAuthentication_1 = require("./twoFactorAuthentication");
|
|
7
6
|
const twoFactorAuthenticationPayload_1 = require("./twoFactorAuthenticationPayload");
|
|
8
7
|
exports.initialState = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
sendOtpStatus: {
|
|
9
|
+
fetchState: 'Not-Started',
|
|
10
|
+
error: undefined,
|
|
11
|
+
},
|
|
12
|
+
otpVerificationStatus: {
|
|
13
|
+
fetchState: 'Not-Started',
|
|
14
|
+
error: undefined,
|
|
15
|
+
},
|
|
16
|
+
customerToken: undefined,
|
|
17
|
+
phone: undefined,
|
|
18
|
+
otpChallenge: undefined,
|
|
12
19
|
};
|
|
13
20
|
const twoFactorAuthentication = (0, toolkit_1.createSlice)({
|
|
14
21
|
name: 'twoFactorAuthentication',
|
|
@@ -16,197 +23,74 @@ const twoFactorAuthentication = (0, toolkit_1.createSlice)({
|
|
|
16
23
|
reducers: {
|
|
17
24
|
sendOtp: {
|
|
18
25
|
reducer(draft, action) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
error: undefined,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
else if (twoFASource === 'ChargeCardHolder' && entityId != null) {
|
|
32
|
-
draft.chargeCardHolder[entityId] = Object.assign(Object.assign({}, draft.chargeCardHolder[entityId]), { phone: phoneNumber, sendOtpStatus: {
|
|
33
|
-
fetchState: 'In-Progress',
|
|
34
|
-
error: undefined,
|
|
35
|
-
}, otpVerificationStatus: {
|
|
36
|
-
fetchState: 'Not-Started',
|
|
37
|
-
error: undefined,
|
|
38
|
-
} });
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
draft.common.phone = phoneNumber;
|
|
42
|
-
draft.common.sendOtpStatus = {
|
|
43
|
-
fetchState: 'In-Progress',
|
|
44
|
-
error: undefined,
|
|
45
|
-
};
|
|
46
|
-
draft.common.otpVerificationStatus = {
|
|
47
|
-
fetchState: 'Not-Started',
|
|
48
|
-
error: undefined,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
26
|
+
draft.phone = action.payload.phoneNumber;
|
|
27
|
+
draft.sendOtpStatus = {
|
|
28
|
+
fetchState: 'In-Progress',
|
|
29
|
+
error: undefined,
|
|
30
|
+
};
|
|
31
|
+
draft.otpVerificationStatus = {
|
|
32
|
+
fetchState: 'Not-Started',
|
|
33
|
+
error: undefined,
|
|
34
|
+
};
|
|
51
35
|
},
|
|
52
|
-
prepare(phoneNumber, twoFASource
|
|
53
|
-
return { payload: { phoneNumber, twoFASource
|
|
36
|
+
prepare(phoneNumber, twoFASource) {
|
|
37
|
+
return { payload: { phoneNumber, twoFASource } };
|
|
54
38
|
},
|
|
55
39
|
},
|
|
56
40
|
resendOtp: {
|
|
57
|
-
reducer(draft
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
draft.cardUserOnboarding.sendOtpStatus = {
|
|
61
|
-
fetchState: 'In-Progress',
|
|
62
|
-
error: undefined,
|
|
63
|
-
};
|
|
64
|
-
draft.cardUserOnboarding.otpVerificationStatus = {
|
|
65
|
-
fetchState: 'Not-Started',
|
|
66
|
-
error: undefined,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
else if (twoFASource === 'ChargeCardHolder' && entityId != null) {
|
|
70
|
-
draft.chargeCardHolder[entityId] = Object.assign(Object.assign({}, draft.chargeCardHolder[entityId]), { sendOtpStatus: {
|
|
71
|
-
fetchState: 'In-Progress',
|
|
72
|
-
error: undefined,
|
|
73
|
-
}, otpVerificationStatus: {
|
|
74
|
-
fetchState: 'Not-Started',
|
|
75
|
-
error: undefined,
|
|
76
|
-
} });
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
draft.common.sendOtpStatus = {
|
|
80
|
-
fetchState: 'In-Progress',
|
|
81
|
-
error: undefined,
|
|
82
|
-
};
|
|
83
|
-
draft.common.otpVerificationStatus = {
|
|
84
|
-
fetchState: 'Not-Started',
|
|
85
|
-
error: undefined,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
prepare(otpChallenge, twoFASource, entityId) {
|
|
90
|
-
return { payload: { otpChallenge, twoFASource, entityId } };
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
sendOtpSuccess(draft, action) {
|
|
94
|
-
const { otpChallenge, twoFASource, entityId } = action.payload;
|
|
95
|
-
if (twoFASource === 'CardUserOnboarding') {
|
|
96
|
-
draft.cardUserOnboarding.otpChallenge = otpChallenge;
|
|
97
|
-
draft.cardUserOnboarding.sendOtpStatus = {
|
|
98
|
-
fetchState: 'Completed',
|
|
41
|
+
reducer(draft) {
|
|
42
|
+
draft.sendOtpStatus = {
|
|
43
|
+
fetchState: 'In-Progress',
|
|
99
44
|
error: undefined,
|
|
100
45
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
draft.chargeCardHolder[entityId] = Object.assign(Object.assign({}, draft.chargeCardHolder[entityId]), { otpChallenge: otpChallenge, sendOtpStatus: {
|
|
104
|
-
fetchState: 'Completed',
|
|
105
|
-
error: undefined,
|
|
106
|
-
} });
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
draft.common.otpChallenge = otpChallenge;
|
|
110
|
-
draft.common.sendOtpStatus = {
|
|
111
|
-
fetchState: 'Completed',
|
|
46
|
+
draft.otpVerificationStatus = {
|
|
47
|
+
fetchState: 'Not-Started',
|
|
112
48
|
error: undefined,
|
|
113
49
|
};
|
|
114
|
-
}
|
|
50
|
+
},
|
|
51
|
+
prepare(otpChallenge, twoFASource) {
|
|
52
|
+
return { payload: { otpChallenge, twoFASource } };
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
sendOtpSuccess(draft, action) {
|
|
56
|
+
draft.otpChallenge = action.payload.otpChallenge;
|
|
57
|
+
draft.sendOtpStatus = {
|
|
58
|
+
fetchState: 'Completed',
|
|
59
|
+
error: undefined,
|
|
60
|
+
};
|
|
115
61
|
},
|
|
116
62
|
sendOtpFailure(draft, action) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
error,
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
else if (twoFASource === 'ChargeCardHolder' && entityId != null) {
|
|
125
|
-
draft.chargeCardHolder[entityId] = Object.assign(Object.assign({}, draft.chargeCardHolder[entityId]), { sendOtpStatus: {
|
|
126
|
-
fetchState: 'Error',
|
|
127
|
-
error,
|
|
128
|
-
} });
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
draft.common.sendOtpStatus = {
|
|
132
|
-
fetchState: 'Error',
|
|
133
|
-
error,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
63
|
+
draft.sendOtpStatus = {
|
|
64
|
+
fetchState: 'Error',
|
|
65
|
+
error: action.payload,
|
|
66
|
+
};
|
|
136
67
|
},
|
|
137
68
|
verifyOtp: {
|
|
138
|
-
reducer(draft
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
error: undefined,
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
else if (twoFASource === 'ChargeCardHolder' && entityId != null) {
|
|
147
|
-
draft.chargeCardHolder[entityId] = Object.assign(Object.assign({}, draft.chargeCardHolder[entityId]), { otpVerificationStatus: {
|
|
148
|
-
fetchState: 'In-Progress',
|
|
149
|
-
error: undefined,
|
|
150
|
-
} });
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
draft.common.otpVerificationStatus = {
|
|
154
|
-
fetchState: 'In-Progress',
|
|
155
|
-
error: undefined,
|
|
156
|
-
};
|
|
157
|
-
}
|
|
69
|
+
reducer(draft) {
|
|
70
|
+
draft.otpVerificationStatus = {
|
|
71
|
+
fetchState: 'In-Progress',
|
|
72
|
+
error: undefined,
|
|
73
|
+
};
|
|
158
74
|
},
|
|
159
|
-
prepare(otpCode, otpChallenge, twoFASource
|
|
160
|
-
return { payload: { otpCode, otpChallenge, twoFASource
|
|
75
|
+
prepare(otpCode, otpChallenge, twoFASource) {
|
|
76
|
+
return { payload: { otpCode, otpChallenge, twoFASource } };
|
|
161
77
|
},
|
|
162
78
|
},
|
|
163
79
|
verifyOtpSuccess(draft, action) {
|
|
164
|
-
const {
|
|
165
|
-
if (
|
|
166
|
-
draft.
|
|
167
|
-
fetchState: 'Completed',
|
|
168
|
-
error: undefined,
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
else if (twoFASource === 'ChargeCardHolder' && entityId != null) {
|
|
172
|
-
draft.chargeCardHolder[entityId] = Object.assign(Object.assign({}, draft.chargeCardHolder[entityId]), { otpVerificationStatus: {
|
|
173
|
-
fetchState: 'Completed',
|
|
174
|
-
error: undefined,
|
|
175
|
-
} });
|
|
176
|
-
if (tokenPayload != null) {
|
|
177
|
-
draft.chargeCardHolder[entityId].token = (0, twoFactorAuthenticationPayload_1.toToken)(tokenPayload);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
draft.common.otpVerificationStatus = {
|
|
182
|
-
fetchState: 'Completed',
|
|
183
|
-
error: undefined,
|
|
184
|
-
};
|
|
185
|
-
if (tokenPayload != null) {
|
|
186
|
-
draft.common.token = (0, twoFactorAuthenticationPayload_1.toToken)(tokenPayload);
|
|
187
|
-
}
|
|
80
|
+
const { customerTokenPayload } = action.payload;
|
|
81
|
+
if (customerTokenPayload != null) {
|
|
82
|
+
draft.customerToken = (0, twoFactorAuthenticationPayload_1.toCustomerToken)(customerTokenPayload);
|
|
188
83
|
}
|
|
84
|
+
draft.otpVerificationStatus = {
|
|
85
|
+
fetchState: 'Completed',
|
|
86
|
+
error: undefined,
|
|
87
|
+
};
|
|
189
88
|
},
|
|
190
89
|
verifyOtpFailure(draft, action) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
error,
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
else if (twoFASource === 'ChargeCardHolder' && entityId != null) {
|
|
199
|
-
draft.chargeCardHolder[entityId] = Object.assign(Object.assign({}, draft.chargeCardHolder[entityId]), { otpVerificationStatus: {
|
|
200
|
-
fetchState: 'Error',
|
|
201
|
-
error,
|
|
202
|
-
} });
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
draft.common.otpVerificationStatus = {
|
|
206
|
-
fetchState: 'Error',
|
|
207
|
-
error,
|
|
208
|
-
};
|
|
209
|
-
}
|
|
90
|
+
draft.otpVerificationStatus = {
|
|
91
|
+
fetchState: 'Error',
|
|
92
|
+
error: action.payload,
|
|
93
|
+
};
|
|
210
94
|
},
|
|
211
95
|
clearTwoFactorAuthentication(draft) {
|
|
212
96
|
Object.assign(draft, exports.initialState);
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { FetchStateAndError
|
|
1
|
+
import { FetchStateAndError } from '../../commonStateTypes/common';
|
|
2
2
|
import { View } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
3
|
import { RootState } from '../../reducer';
|
|
4
|
-
import {
|
|
4
|
+
import { CustomerToken } from './twoFactorAuthentication';
|
|
5
5
|
export interface TwoFactorAuthenticationView extends View {
|
|
6
6
|
sendOtpStatus: FetchStateAndError;
|
|
7
7
|
otpVerificationStatus: FetchStateAndError;
|
|
8
|
-
|
|
8
|
+
customerToken?: CustomerToken;
|
|
9
9
|
phone?: string;
|
|
10
10
|
otpChallenge?: string;
|
|
11
11
|
}
|
|
12
12
|
export declare const getTwoFactorAuthenticationView: (state: RootState) => TwoFactorAuthenticationView;
|
|
13
|
-
export declare const getTwoFactorAuthenticationViewForChargeCardHolder: (state: RootState, entityId: ID) => TwoFactorAuthentication;
|
|
14
|
-
export declare const getTwoFactorAuthenticationViewForCardUserOnboarding: (state: RootState) => TwoFactorAuthenticationWithoutToken | undefined;
|
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getTwoFactorAuthenticationView = void 0;
|
|
4
4
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
|
-
const twoFactorAuthentication_1 = require("./twoFactorAuthentication");
|
|
6
5
|
exports.getTwoFactorAuthenticationView = (0, toolkit_1.createSelector)((state) => state.twoFactorAuthenticationState, (twoFAState) => {
|
|
7
|
-
return Object.assign({}, twoFAState
|
|
8
|
-
});
|
|
9
|
-
exports.getTwoFactorAuthenticationViewForChargeCardHolder = (0, toolkit_1.createSelector)((state) => state.twoFactorAuthenticationState, (_state, entityId) => entityId, (twoFAState, entityId) => {
|
|
10
|
-
const twoFA = twoFAState.chargeCardHolder[entityId];
|
|
11
|
-
if (twoFA != null) {
|
|
12
|
-
return twoFA;
|
|
13
|
-
}
|
|
14
|
-
return twoFactorAuthentication_1.initialTwoFactorAuthentication;
|
|
15
|
-
});
|
|
16
|
-
exports.getTwoFactorAuthenticationViewForCardUserOnboarding = (0, toolkit_1.createSelector)((state) => state.twoFactorAuthenticationState, (twoFAState) => {
|
|
17
|
-
return twoFAState.cardUserOnboarding;
|
|
6
|
+
return Object.assign({}, twoFAState);
|
|
18
7
|
});
|
|
@@ -6,10 +6,7 @@ import { verifyOtpVendorView, verifyOtpVendorViewFailure, verifyOtpVendorViewSuc
|
|
|
6
6
|
import { verifyOnboardingOfficerOtp, verifyOnboardingOfficerOtpFailure, verifyOnboardingOfficerOtpSuccess } from '../onboardingView/customerView/onboardingCustomerViewReducer';
|
|
7
7
|
import { verifyOtpMyProfile, verifyOtpMyProfileFailure, verifyOtpMyProfileSuccess } from '../settingsView/settingsViewReducer';
|
|
8
8
|
import { verifyOtpCardUserOnboarding, verifyOtpCardUserOnboardingFailure, verifyOtpCardUserOnboardingSuccess } from '../spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer';
|
|
9
|
-
import { verifyOtpCardHolderFailure } from '../spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer';
|
|
10
|
-
import { verifyOtpCardHolderSuccess } from '../spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer';
|
|
11
|
-
import { verifyOtpCardHolder } from '../spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer';
|
|
12
9
|
import { verifyOtpFailureSpendManagementSetUp, verifyOtpSpendManagementSetUp, verifyOtpSuccessSpendManagementSetUp } from '../spendManagement/commonSetup/setupViewReducer';
|
|
13
10
|
import { verifyOtp, verifyOtpFailure, verifyOtpSuccess } from './twoFactorAuthenticationReducer';
|
|
14
|
-
export type ActionType = ReturnType<typeof verifyOtp> | ReturnType<typeof verifyOtpSuccess> | ReturnType<typeof verifyOtpFailure> | ReturnType<typeof verifyOtpSpendManagementSetUp> | ReturnType<typeof verifyOtpSuccessSpendManagementSetUp> | ReturnType<typeof verifyOtpFailureSpendManagementSetUp> | ReturnType<typeof verifyOtpVendorView> | ReturnType<typeof verifyOtpVendorViewSuccess> | ReturnType<typeof verifyOtpVendorViewFailure> | ReturnType<typeof verifyOnboardingOfficerOtp> | ReturnType<typeof verifyOnboardingOfficerOtpSuccess> | ReturnType<typeof verifyOnboardingOfficerOtpFailure> | ReturnType<typeof verifyOtpCardUserOnboarding> | ReturnType<typeof verifyOtpCardUserOnboardingSuccess> | ReturnType<typeof verifyOtpCardUserOnboardingFailure> | ReturnType<typeof verifyOtpMyProfile> | ReturnType<typeof verifyOtpMyProfileFailure> | ReturnType<typeof verifyOtpMyProfileSuccess
|
|
15
|
-
export declare const verifyOtpEpic: (actions$: ActionsObservable<ActionType>,
|
|
11
|
+
export type ActionType = ReturnType<typeof verifyOtp> | ReturnType<typeof verifyOtpSuccess> | ReturnType<typeof verifyOtpFailure> | ReturnType<typeof verifyOtpSpendManagementSetUp> | ReturnType<typeof verifyOtpSuccessSpendManagementSetUp> | ReturnType<typeof verifyOtpFailureSpendManagementSetUp> | ReturnType<typeof verifyOtpVendorView> | ReturnType<typeof verifyOtpVendorViewSuccess> | ReturnType<typeof verifyOtpVendorViewFailure> | ReturnType<typeof verifyOnboardingOfficerOtp> | ReturnType<typeof verifyOnboardingOfficerOtpSuccess> | ReturnType<typeof verifyOnboardingOfficerOtpFailure> | ReturnType<typeof verifyOtpCardUserOnboarding> | ReturnType<typeof verifyOtpCardUserOnboardingSuccess> | ReturnType<typeof verifyOtpCardUserOnboardingFailure> | ReturnType<typeof verifyOtpMyProfile> | ReturnType<typeof verifyOtpMyProfileFailure> | ReturnType<typeof verifyOtpMyProfileSuccess>;
|
|
12
|
+
export declare const verifyOtpEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -8,22 +8,15 @@ const vendorViewReducer_1 = require("../commonVendorView/vendorView/vendorViewRe
|
|
|
8
8
|
const onboardingCustomerViewReducer_1 = require("../onboardingView/customerView/onboardingCustomerViewReducer");
|
|
9
9
|
const settingsViewReducer_1 = require("../settingsView/settingsViewReducer");
|
|
10
10
|
const cardUserOnboardingReducer_1 = require("../spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingReducer");
|
|
11
|
-
const chargeCardDetailReducer_1 = require("../spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer");
|
|
12
|
-
const chargeCardDetailReducer_2 = require("../spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer");
|
|
13
|
-
const chargeCardDetailReducer_3 = require("../spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer");
|
|
14
11
|
const setupViewReducer_1 = require("../spendManagement/commonSetup/setupViewReducer");
|
|
15
12
|
const twoFactorAuthenticationReducer_1 = require("./twoFactorAuthenticationReducer");
|
|
16
|
-
const verifyOtpEpic = (actions$,
|
|
13
|
+
const verifyOtpEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(twoFactorAuthenticationReducer_1.verifyOtp.match), (0, operators_1.mergeMap)((action) => {
|
|
17
14
|
const verifyOtpActions = [];
|
|
18
|
-
const { otpCode, otpChallenge, twoFASource
|
|
15
|
+
const { otpCode, otpChallenge, twoFASource } = action.payload;
|
|
19
16
|
const payload = {
|
|
20
17
|
otp_code: otpCode,
|
|
21
18
|
otp_challenge: otpChallenge,
|
|
22
19
|
};
|
|
23
|
-
if (twoFASource === 'ChargeCardHolder' && entityId != null) {
|
|
24
|
-
const chargeCardProviderId = state$.value.chargeCardState.chargeCardByID[entityId].cardProviderID;
|
|
25
|
-
payload.provider_card_id = chargeCardProviderId;
|
|
26
|
-
}
|
|
27
20
|
switch (twoFASource) {
|
|
28
21
|
case 'SpendManagementSetup':
|
|
29
22
|
verifyOtpActions.push((0, setupViewReducer_1.verifyOtpSpendManagementSetUp)());
|
|
@@ -40,11 +33,6 @@ const verifyOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators
|
|
|
40
33
|
case 'CardUserOnboarding':
|
|
41
34
|
verifyOtpActions.push((0, cardUserOnboardingReducer_1.verifyOtpCardUserOnboarding)());
|
|
42
35
|
break;
|
|
43
|
-
case 'ChargeCardHolder':
|
|
44
|
-
if (entityId != null) {
|
|
45
|
-
verifyOtpActions.push((0, chargeCardDetailReducer_3.verifyOtpCardHolder)({ chargeCardId: entityId }));
|
|
46
|
-
}
|
|
47
|
-
break;
|
|
48
36
|
}
|
|
49
37
|
const verifyOtp$ = zeniAPI
|
|
50
38
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/otp/verify`, payload)
|
|
@@ -54,9 +42,7 @@ const verifyOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators
|
|
|
54
42
|
response.data.is_verified === true) {
|
|
55
43
|
const updateActions = [
|
|
56
44
|
(0, twoFactorAuthenticationReducer_1.verifyOtpSuccess)({
|
|
57
|
-
|
|
58
|
-
tokenPayload: response.data.token_info,
|
|
59
|
-
entityId,
|
|
45
|
+
customerTokenPayload: response.data.customer_token_info,
|
|
60
46
|
}),
|
|
61
47
|
];
|
|
62
48
|
switch (twoFASource) {
|
|
@@ -75,23 +61,12 @@ const verifyOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators
|
|
|
75
61
|
case 'CardUserOnboarding':
|
|
76
62
|
updateActions.push((0, cardUserOnboardingReducer_1.verifyOtpCardUserOnboardingSuccess)());
|
|
77
63
|
break;
|
|
78
|
-
case 'ChargeCardHolder':
|
|
79
|
-
if (entityId != null) {
|
|
80
|
-
updateActions.push((0, chargeCardDetailReducer_2.verifyOtpCardHolderSuccess)({
|
|
81
|
-
chargeCardId: entityId,
|
|
82
|
-
}));
|
|
83
|
-
}
|
|
84
|
-
break;
|
|
85
64
|
}
|
|
86
65
|
return (0, rxjs_1.from)(updateActions);
|
|
87
66
|
}
|
|
88
67
|
else {
|
|
89
68
|
const updateActions = [
|
|
90
|
-
(0, twoFactorAuthenticationReducer_1.verifyOtpFailure)(
|
|
91
|
-
error: response.status,
|
|
92
|
-
twoFASource,
|
|
93
|
-
entityId,
|
|
94
|
-
}),
|
|
69
|
+
(0, twoFactorAuthenticationReducer_1.verifyOtpFailure)(response.status),
|
|
95
70
|
];
|
|
96
71
|
switch (twoFASource) {
|
|
97
72
|
case 'SpendManagementSetup':
|
|
@@ -109,21 +84,13 @@ const verifyOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators
|
|
|
109
84
|
case 'CardUserOnboarding':
|
|
110
85
|
updateActions.push((0, cardUserOnboardingReducer_1.verifyOtpCardUserOnboardingFailure)(response.status));
|
|
111
86
|
break;
|
|
112
|
-
case 'ChargeCardHolder':
|
|
113
|
-
if (entityId != null) {
|
|
114
|
-
updateActions.push((0, chargeCardDetailReducer_1.verifyOtpCardHolderFailure)({
|
|
115
|
-
error: response.status,
|
|
116
|
-
chargeCardId: entityId,
|
|
117
|
-
}));
|
|
118
|
-
}
|
|
119
|
-
break;
|
|
120
87
|
}
|
|
121
88
|
return (0, rxjs_1.from)(updateActions);
|
|
122
89
|
}
|
|
123
90
|
}), (0, operators_1.catchError)((error) => {
|
|
124
91
|
const zeniAPIStatus = (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Verify otp api errored out' + JSON.stringify(error));
|
|
125
92
|
const updateActions = [
|
|
126
|
-
(0, twoFactorAuthenticationReducer_1.verifyOtpFailure)(
|
|
93
|
+
(0, twoFactorAuthenticationReducer_1.verifyOtpFailure)(zeniAPIStatus),
|
|
127
94
|
];
|
|
128
95
|
switch (twoFASource) {
|
|
129
96
|
case 'SpendManagementSetup':
|
|
@@ -141,14 +108,6 @@ const verifyOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators
|
|
|
141
108
|
case 'CardUserOnboarding':
|
|
142
109
|
updateActions.push((0, cardUserOnboardingReducer_1.verifyOtpCardUserOnboardingFailure)(zeniAPIStatus));
|
|
143
110
|
break;
|
|
144
|
-
case 'ChargeCardHolder':
|
|
145
|
-
if (entityId != null) {
|
|
146
|
-
updateActions.push((0, chargeCardDetailReducer_1.verifyOtpCardHolderFailure)({
|
|
147
|
-
error: zeniAPIStatus,
|
|
148
|
-
chargeCardId: entityId,
|
|
149
|
-
}));
|
|
150
|
-
}
|
|
151
|
-
break;
|
|
152
111
|
}
|
|
153
112
|
return (0, rxjs_1.from)(updateActions);
|
|
154
113
|
}));
|
|
@@ -4,7 +4,7 @@ import { updateAllUsers } from '../../entity/user/userReducer';
|
|
|
4
4
|
import { updateUserRoles } from '../../entity/userRole/userRoleReducer';
|
|
5
5
|
import { RootState } from '../../reducer';
|
|
6
6
|
import { ZeniAPI } from '../../zeniAPI';
|
|
7
|
-
import {
|
|
7
|
+
import { updateCardCount } from '../spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer';
|
|
8
8
|
import { fetchUserListByType, updateUserIds, updateUserListFetchFailure } from './userListViewReducer';
|
|
9
|
-
export type ActionType = ReturnType<typeof fetchUserListByType> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateUserIds> | ReturnType<typeof
|
|
9
|
+
export type ActionType = ReturnType<typeof fetchUserListByType> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateUserIds> | ReturnType<typeof updateCardCount> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateUserListFetchFailure>;
|
|
10
10
|
export declare const fetchUserListByTypeEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -23,7 +23,7 @@ const fetchUserListByTypeEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
23
23
|
apiUrl =
|
|
24
24
|
apiUrl + `?query=${encodeURIComponent(JSON.stringify(queryParam))}`;
|
|
25
25
|
return zeniAPI.getJSON(apiUrl).pipe((0, operators_1.mergeMap)((response) => {
|
|
26
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
26
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
27
27
|
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
28
28
|
const userListAction = [
|
|
29
29
|
(0, userReducer_1.updateAllUsers)({ users: (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.users) !== null && _b !== void 0 ? _b : [] }),
|
|
@@ -34,9 +34,8 @@ const fetchUserListByTypeEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
34
34
|
}),
|
|
35
35
|
];
|
|
36
36
|
if (userType === 'cardHolderCandidate') {
|
|
37
|
-
userListAction.push((0, issueChargeCardReducer_1.
|
|
38
|
-
userListAction.push((0,
|
|
39
|
-
userListAction.push((0, addressReducer_1.updateAddresses)((_m = (_l = response.data) === null || _l === void 0 ? void 0 : _l.addresses) !== null && _m !== void 0 ? _m : []));
|
|
37
|
+
userListAction.push((0, issueChargeCardReducer_1.updateCardCount)((_h = (_g = response.data) === null || _g === void 0 ? void 0 : _g.cards_count_by_user_id) !== null && _h !== void 0 ? _h : []));
|
|
38
|
+
userListAction.push((0, addressReducer_1.updateAddresses)((_k = (_j = response.data) === null || _j === void 0 ? void 0 : _j.addresses) !== null && _k !== void 0 ? _k : []));
|
|
40
39
|
}
|
|
41
40
|
return (0, rxjs_1.concat)((0, rxjs_1.from)(userListAction));
|
|
42
41
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ID } from '../../commonStateTypes/common';
|
|
2
1
|
import { AddressPayload } from '../../entity/address/addressPayload';
|
|
3
2
|
import { UserPayload } from '../../entity/user/userPayload';
|
|
4
3
|
import { UserRolePayload } from '../../entity/userRole/userRolePayload';
|
|
@@ -7,7 +6,6 @@ interface UserListResponsePayload {
|
|
|
7
6
|
users: UserPayload[];
|
|
8
7
|
user_roles: UserRolePayload[];
|
|
9
8
|
cards_count_by_user_id?: ActiveChargeCardCountPayload[];
|
|
10
|
-
debit_cards_count_by_deposit_account_id?: Record<ID, ActiveDebitCardCountByUserIdPayload>;
|
|
11
9
|
addresses?: AddressPayload[];
|
|
12
10
|
}
|
|
13
11
|
export interface ActiveChargeCardCountPayload {
|
|
@@ -15,14 +13,5 @@ export interface ActiveChargeCardCountPayload {
|
|
|
15
13
|
business_virtual_credit_card_count: number;
|
|
16
14
|
user_id: string;
|
|
17
15
|
}
|
|
18
|
-
export interface ActiveDebitCardCountByUserIdPayload {
|
|
19
|
-
[userId: ID]: ActiveDebitCardCountPayload;
|
|
20
|
-
}
|
|
21
|
-
export interface ActiveDebitCardCountPayload {
|
|
22
|
-
business_physical_debit_card_count: number;
|
|
23
|
-
business_virtual_debit_card_count: number;
|
|
24
|
-
user_id: string;
|
|
25
|
-
connected_account_id: string;
|
|
26
|
-
}
|
|
27
16
|
export type UserListResponse = ZeniAPIResponse<UserListResponsePayload>;
|
|
28
17
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.16.0",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"cross-spawn": ">=7.0.5",
|
|
80
80
|
"@babel/runtime": ">=7.26.10",
|
|
81
81
|
"@babel/helpers": ">=7.26.10",
|
|
82
|
-
"minimatch": "
|
|
83
|
-
"
|
|
82
|
+
"minimatch": ">=10.0.1",
|
|
83
|
+
"minimatch@3.1.2": "3.1.2"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"clean": "rimraf lib",
|
|
@@ -103,7 +103,6 @@
|
|
|
103
103
|
"send-release-notes": "chmod +x ./scripts/send_release_notes.sh && ./scripts/send_release_notes.sh",
|
|
104
104
|
"update-slack-group-topic": "chmod +x ./scripts/update-slack-group-topic.sh && ./scripts/update-slack-group-topic.sh",
|
|
105
105
|
"build-beta-and-copy": "chmod +x ./scripts/build_and_copy.sh && ./scripts/build_and_copy.sh",
|
|
106
|
-
"pr-approvals-update": "chmod +x ./scripts/pr_approvals.sh && ./scripts/pr_approvals.sh"
|
|
107
|
-
"raise-pr-automation": "chmod +x ./scripts/raise_pr_automation.sh && ./scripts/raise_pr_automation.sh"
|
|
106
|
+
"pr-approvals-update": "chmod +x ./scripts/pr_approvals.sh && ./scripts/pr_approvals.sh"
|
|
108
107
|
}
|
|
109
108
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { ZeniDate } from '../../zeniDayJS';
|
|
3
|
-
export interface ConnectedAccount {
|
|
4
|
-
id: ID;
|
|
5
|
-
connectedAccountType: ConnectedAccountType;
|
|
6
|
-
accountStatus: ConnectedAccountStatusType;
|
|
7
|
-
accountName?: string;
|
|
8
|
-
maskedAccountNumber?: string;
|
|
9
|
-
createTime?: ZeniDate;
|
|
10
|
-
updateTime?: ZeniDate;
|
|
11
|
-
}
|
|
12
|
-
export interface ConnectedAccountState {
|
|
13
|
-
connectedAccountByID: Record<ID, ConnectedAccount>;
|
|
14
|
-
}
|
|
15
|
-
export declare const toConnectedAccountType: (v: string) => "deposit_account" | "credit_account";
|
|
16
|
-
type ConnectedAccountType = ReturnType<typeof toConnectedAccountType>;
|
|
17
|
-
export declare const toConnectedAccountStatusType: (v: string) => "Open" | "Frozen" | "Closed";
|
|
18
|
-
type ConnectedAccountStatusType = ReturnType<typeof toConnectedAccountStatusType>;
|
|
19
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toConnectedAccountStatusType = exports.toConnectedAccountType = void 0;
|
|
4
|
-
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
5
|
-
const CONNECTED_ACCOUNT_TYPE = ['credit_account', 'deposit_account'];
|
|
6
|
-
const toConnectedAccountType = (v) => (0, stringToUnion_1.stringToUnion)(v, CONNECTED_ACCOUNT_TYPE);
|
|
7
|
-
exports.toConnectedAccountType = toConnectedAccountType;
|
|
8
|
-
const CONNECTED_ACCOUNT_STATUS_TYPE = ['Open', 'Frozen', 'Closed'];
|
|
9
|
-
const toConnectedAccountStatusType = (v) => (0, stringToUnion_1.stringToUnion)(v, CONNECTED_ACCOUNT_STATUS_TYPE);
|
|
10
|
-
exports.toConnectedAccountStatusType = toConnectedAccountStatusType;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ConnectedAccount } from './connectedAccount';
|
|
2
|
-
export interface ConnectedAccountPayload {
|
|
3
|
-
connected_account_id: string;
|
|
4
|
-
connected_account_type: string;
|
|
5
|
-
account_status: string;
|
|
6
|
-
account_name?: string;
|
|
7
|
-
masked_account_number?: string;
|
|
8
|
-
create_time?: string;
|
|
9
|
-
update_time?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare const mapConnectedAccountPayloadToConnectedAccountState: (payload: ConnectedAccountPayload) => ConnectedAccount;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapConnectedAccountPayloadToConnectedAccountState = void 0;
|
|
4
|
-
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
5
|
-
const connectedAccount_1 = require("./connectedAccount");
|
|
6
|
-
const mapConnectedAccountPayloadToConnectedAccountState = (payload) => ({
|
|
7
|
-
id: payload.connected_account_id,
|
|
8
|
-
accountName: payload.account_name,
|
|
9
|
-
accountStatus: (0, connectedAccount_1.toConnectedAccountStatusType)(payload.account_status),
|
|
10
|
-
maskedAccountNumber: payload.masked_account_number,
|
|
11
|
-
connectedAccountType: (0, connectedAccount_1.toConnectedAccountType)(payload.connected_account_type),
|
|
12
|
-
createTime: payload.create_time != null ? (0, zeniDayJS_1.date)(payload.create_time) : undefined,
|
|
13
|
-
updateTime: payload.update_time != null ? (0, zeniDayJS_1.date)(payload.update_time) : undefined,
|
|
14
|
-
});
|
|
15
|
-
exports.mapConnectedAccountPayloadToConnectedAccountState = mapConnectedAccountPayloadToConnectedAccountState;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ConnectedAccountState } from './connectedAccount';
|
|
2
|
-
import { ConnectedAccountPayload } from './connectedAccountPayload';
|
|
3
|
-
export declare const initialState: ConnectedAccountState;
|
|
4
|
-
export declare const updateConnectedAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<ConnectedAccountPayload, "connectedAccount/updateConnectedAccount">, removeConnectedAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "connectedAccount/removeConnectedAccount">, clearAllConnectedAccounts: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"connectedAccount/clearAllConnectedAccounts">;
|
|
5
|
-
declare const _default: import("redux").Reducer<ConnectedAccountState>;
|
|
6
|
-
export default _default;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearAllConnectedAccounts = exports.removeConnectedAccount = exports.updateConnectedAccount = exports.initialState = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const connectedAccountPayload_1 = require("./connectedAccountPayload");
|
|
7
|
-
exports.initialState = {
|
|
8
|
-
connectedAccountByID: {},
|
|
9
|
-
};
|
|
10
|
-
const connectedAccount = (0, toolkit_1.createSlice)({
|
|
11
|
-
name: 'connectedAccount',
|
|
12
|
-
initialState: exports.initialState,
|
|
13
|
-
reducers: {
|
|
14
|
-
updateConnectedAccount(draft, action) {
|
|
15
|
-
const latestBankAccount = (0, connectedAccountPayload_1.mapConnectedAccountPayloadToConnectedAccountState)(action.payload);
|
|
16
|
-
draft.connectedAccountByID[latestBankAccount.id] = latestBankAccount;
|
|
17
|
-
},
|
|
18
|
-
removeConnectedAccount(draft, action) {
|
|
19
|
-
delete draft.connectedAccountByID[action.payload];
|
|
20
|
-
},
|
|
21
|
-
clearAllConnectedAccounts(draft) {
|
|
22
|
-
draft.connectedAccountByID = {};
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
_a = connectedAccount.actions, exports.updateConnectedAccount = _a.updateConnectedAccount, exports.removeConnectedAccount = _a.removeConnectedAccount, exports.clearAllConnectedAccounts = _a.clearAllConnectedAccounts;
|
|
27
|
-
exports.default = connectedAccount.reducer;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { ConnectedAccount, ConnectedAccountState } from '../connectedAccount/connectedAccount';
|
|
3
|
-
export declare function getConnectedAccountsByConnectedAccountIds(connectedAccountState: ConnectedAccountState, connectedAccountIds: ID[]): ConnectedAccount[];
|
|
4
|
-
export declare function getConnectedAccountByConnectedAccountId(connectedAccountState: ConnectedAccountState, connectedAccountId: ID): ConnectedAccount | undefined;
|