@zeniai/client-epic-state 4.19.96-betaRD11 → 4.19.96-betaRD3

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.

Potentially problematic release.


This version of @zeniai/client-epic-state might be problematic. Click here for more details.

Files changed (63) hide show
  1. package/lib/coreEpics.js +4 -1
  2. package/lib/entity/tenant/clearAllEpic.d.ts +1 -2
  3. package/lib/entity/tenant/clearAllEpic.js +0 -2
  4. package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +19 -0
  5. package/lib/entity/tenant/epic/deleteConnectionEpic.js +29 -0
  6. package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +19 -0
  7. package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.js +31 -0
  8. package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +19 -0
  9. package/lib/entity/tenant/epic/saveOAuthConnectionEpic.js +33 -0
  10. package/lib/entity/tenant/tenantPayload.d.ts +2 -0
  11. package/lib/entity/tenant/tenantReducer.d.ts +60 -1
  12. package/lib/entity/tenant/tenantReducer.js +143 -3
  13. package/lib/entity/tenant/tenantState.d.ts +8 -0
  14. package/lib/epic.d.ts +1 -5
  15. package/lib/epic.js +3 -5
  16. package/lib/esm/coreEpics.js +4 -1
  17. package/lib/esm/entity/tenant/clearAllEpic.js +0 -2
  18. package/lib/esm/entity/tenant/epic/deleteConnectionEpic.js +25 -0
  19. package/lib/esm/entity/tenant/epic/saveAPIKeyConnectionEpic.js +27 -0
  20. package/lib/esm/entity/tenant/epic/saveOAuthConnectionEpic.js +29 -0
  21. package/lib/esm/entity/tenant/tenantReducer.js +139 -2
  22. package/lib/esm/epic.js +3 -5
  23. package/lib/esm/index.js +2 -5
  24. package/lib/esm/reducer.js +0 -3
  25. package/lib/index.d.ts +2 -6
  26. package/lib/index.js +40 -50
  27. package/lib/reducer.d.ts +0 -3
  28. package/lib/reducer.js +0 -3
  29. package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
  30. package/lib/view/companyView/types/cockpitTypes.d.ts +3 -3
  31. package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
  32. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  33. package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
  34. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  35. package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
  36. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +3 -3
  37. package/lib/view/subscriptionView/types/subscriptionTypes.d.ts +1 -1
  38. package/lib/zeniAPI.d.ts +0 -1
  39. package/package.json +1 -1
  40. package/lib/esm/view/aiAccountantView/aiAccountantViewPayload.js +0 -43
  41. package/lib/esm/view/aiAccountantView/aiAccountantViewReducer.js +0 -121
  42. package/lib/esm/view/aiAccountantView/aiAccountantViewSelector.js +0 -69
  43. package/lib/esm/view/aiAccountantView/aiAccountantViewState.js +0 -11
  44. package/lib/esm/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +0 -33
  45. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +0 -23
  46. package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +0 -29
  47. package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +0 -39
  48. package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +0 -66
  49. package/lib/view/aiAccountantView/aiAccountantViewPayload.js +0 -49
  50. package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +0 -49
  51. package/lib/view/aiAccountantView/aiAccountantViewReducer.js +0 -125
  52. package/lib/view/aiAccountantView/aiAccountantViewSelector.d.ts +0 -13
  53. package/lib/view/aiAccountantView/aiAccountantViewSelector.js +0 -77
  54. package/lib/view/aiAccountantView/aiAccountantViewState.d.ts +0 -63
  55. package/lib/view/aiAccountantView/aiAccountantViewState.js +0 -13
  56. package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.d.ts +0 -20
  57. package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +0 -37
  58. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.d.ts +0 -14
  59. package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +0 -27
  60. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.d.ts +0 -15
  61. package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +0 -33
  62. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.d.ts +0 -20
  63. package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +0 -43
package/lib/coreEpics.js CHANGED
@@ -21,7 +21,10 @@ const fetchExcludedResourcesEpic_1 = require("./entity/tenant/epic/fetchExcluded
21
21
  const fetchExternalConnectionsEpic_1 = require("./entity/tenant/epic/fetchExternalConnectionsEpic");
22
22
  const fetchSubscriptionSummaryForTenantEpic_1 = require("./entity/tenant/epic/fetchSubscriptionSummaryForTenantEpic");
23
23
  const resendVerifyDeviceOTPEpic_1 = require("./entity/tenant/epic/resendVerifyDeviceOTPEpic");
24
+ const deleteConnectionEpic_1 = require("./entity/tenant/epic/deleteConnectionEpic");
25
+ const saveAPIKeyConnectionEpic_1 = require("./entity/tenant/epic/saveAPIKeyConnectionEpic");
24
26
  const saveExternalConnectionEpic_1 = require("./entity/tenant/epic/saveExternalConnectionEpic");
27
+ const saveOAuthConnectionEpic_1 = require("./entity/tenant/epic/saveOAuthConnectionEpic");
25
28
  const sendEmailMagicLinkToUserEpic_1 = require("./entity/tenant/epic/sendEmailMagicLinkToUserEpic");
26
29
  const signInUserEpic_1 = require("./entity/tenant/epic/signInUserEpic");
27
30
  const signOutUserEpic_1 = require("./entity/tenant/epic/signOutUserEpic");
@@ -48,7 +51,7 @@ const verifyOtpEpic_1 = require("./view/twoFactorAuthentication/verifyOtpEpic");
48
51
  // RootActionType is only available in the dynamically imported epic.ts.
49
52
  const coreRootEpic = (0, redux_observable_1.combineEpics)(
50
53
  // Auth & tenant
51
- clearAllEpic_1.clearAllEpic, doMagicLinkSignInEpic_1.doMagicLinkSignInEpic, signInUserEpic_1.doSignInEpic, signOutUserEpic_1.doSignOutEpic, fetchActiveTenantEpic_1.fetchActiveTenantEpic, fetchAllTenantsEpic_1.fetchAllTenantsEpic, fetchExcludedResourcesEpic_1.fetchExcludedResourcesEpic, fetchExternalConnectionsEpic_1.fetchExternalConnectionsEpic, fetchSubscriptionSummaryForTenantEpic_1.fetchSubscriptionSummaryForTenantEpic, resendVerifyDeviceOTPEpic_1.resendVerifyDeviceOTPEpic, saveExternalConnectionEpic_1.saveExternalConnectionEpic, sendEmailMagicLinkToUserEpic_1.sendEmailMagicLinkToUserEpic, verifyDeviceWithTwoFAEpic_1.verifyDeviceWithTwoFAEpic,
54
+ clearAllEpic_1.clearAllEpic, doMagicLinkSignInEpic_1.doMagicLinkSignInEpic, signInUserEpic_1.doSignInEpic, signOutUserEpic_1.doSignOutEpic, fetchActiveTenantEpic_1.fetchActiveTenantEpic, fetchAllTenantsEpic_1.fetchAllTenantsEpic, fetchExcludedResourcesEpic_1.fetchExcludedResourcesEpic, fetchExternalConnectionsEpic_1.fetchExternalConnectionsEpic, fetchSubscriptionSummaryForTenantEpic_1.fetchSubscriptionSummaryForTenantEpic, resendVerifyDeviceOTPEpic_1.resendVerifyDeviceOTPEpic, deleteConnectionEpic_1.deleteConnectionEpic, saveAPIKeyConnectionEpic_1.saveAPIKeyConnectionEpic, saveExternalConnectionEpic_1.saveExternalConnectionEpic, saveOAuthConnectionEpic_1.saveOAuthConnectionEpic, sendEmailMagicLinkToUserEpic_1.sendEmailMagicLinkToUserEpic, verifyDeviceWithTwoFAEpic_1.verifyDeviceWithTwoFAEpic,
52
55
  // Toast
53
56
  pushToastNotificationEpic_1.pushToastNotificationEpic,
54
57
  // Collaboration
@@ -11,7 +11,6 @@ import { clearAccountList } from '../../view/accountList/accountListReducer';
11
11
  import { clearAccountMappingView } from '../../view/accountMappingView/accountMappingReducer';
12
12
  import { clearAddressView } from '../../view/addressView/addressViewReducer';
13
13
  import { clearAggregatedReport } from '../../view/aiAgentPerformance/aggregatedReportViewReducer';
14
- import { clearAiAccountantView } from '../../view/aiAccountantView/aiAccountantViewReducer';
15
14
  import { clearAiCfoView } from '../../view/aiCfoView/aiCfoViewReducer';
16
15
  import { clearApAgingDetail } from '../../view/apAgingView/apAgingDetail/apAgingDetailReducer';
17
16
  import { clearApAging } from '../../view/apAgingView/apAgingReport/apAgingReducer';
@@ -198,7 +197,7 @@ import { clearAllUserRoles } from '../userRole/userRoleReducer';
198
197
  import { clearAllVendors } from '../vendor/vendorReducer';
199
198
  import { clearAllVendorExpenseTrends } from '../vendorExpense/vendorExpenseReducer';
200
199
  import { clearAll } from './tenantReducer';
201
- type clearActionTypeForViews = ReturnType<typeof clearAccountList> | ReturnType<typeof clearAccountMappingView> | ReturnType<typeof clearActivityHistory> | ReturnType<typeof clearActivityRealTimeApproval> | ReturnType<typeof clearAddressView> | ReturnType<typeof clearAiAccountantView> | ReturnType<typeof clearAiCfoView> | ReturnType<typeof clearAllClasses> | ReturnType<typeof clearAllMonthEndCloseChecksView> | ReturnType<typeof clearApAging> | ReturnType<typeof clearApAgingDetail> | ReturnType<typeof clearArAging> | ReturnType<typeof clearArAgingDetail> | ReturnType<typeof clearAuthenticationView> | ReturnType<typeof clearBalanceSheet> | ReturnType<typeof clearBankAccountView> | ReturnType<typeof clearBillDetailView> | ReturnType<typeof clearBillList> | ReturnType<typeof clearBillPayBulkActionView> | ReturnType<typeof clearBillPayCard> | ReturnType<typeof clearBillPayConfig> | ReturnType<typeof clearBillPayReview> | ReturnType<typeof clearBillPaySetupApproverView> | ReturnType<typeof clearBillPaySetupView> | ReturnType<typeof clearCardBalance> | ReturnType<typeof clearCardPaymentView> | ReturnType<typeof clearCardUserOnboarding> | ReturnType<typeof clearCashbackDetail> | ReturnType<typeof clearCashBalance> | ReturnType<typeof clearCashFlow> | ReturnType<typeof clearCashInCashOut> | ReturnType<typeof clearCashPosition> | ReturnType<typeof clearChargeCardConfig> | ReturnType<typeof clearChargeCardDetail> | ReturnType<typeof clearChargeCardList> | ReturnType<typeof clearChargeCardRepaymentDetail> | ReturnType<typeof clearChargeCardSetupView> | ReturnType<typeof clearChargeCardStatementList> | ReturnType<typeof clearCheckDeposit> | ReturnType<typeof clearCompanyConfigView> | ReturnType<typeof clearCompanyHealthMetric> | ReturnType<typeof clearCompanyHealthMetricView> | ReturnType<typeof clearCompanyMonthEndReportView> | ReturnType<typeof clearCompanyTaskManagerView> | ReturnType<typeof clearCompanyView> | ReturnType<typeof clearDashboard> | ReturnType<typeof clearDashboardLayout> | ReturnType<typeof clearDepositAccountDetail> | ReturnType<typeof clearDepositAccountList> | ReturnType<typeof clearDepositAccountTransactionList> | ReturnType<typeof clearEditBillViewDetail> | ReturnType<typeof clearEditRemiViewDetail> | ReturnType<typeof clearAllEntityAutoCompleteResults> | ReturnType<typeof clearExpenseAutomationFluxAnalysisView> | ReturnType<typeof clearExpenseAutomationJESchedulesView> | ReturnType<typeof clearExpenseAutomationMissingReceiptsView> | ReturnType<typeof clearExpenseAutomationReconciliationView> | ReturnType<typeof clearExpenseAutomationTransactionsView> | ReturnType<typeof clearExpenseAutomationView> | ReturnType<typeof clearExpressPayView> | ReturnType<typeof clearFileViewList> | ReturnType<typeof clearFinanceStatement> | ReturnType<typeof clearForecastList> | ReturnType<typeof clearGlobalMerchantAutoCompleteResults> | ReturnType<typeof clearGlobalMerchantView> | ReturnType<typeof clearInsightsCard> | ReturnType<typeof clearInternationalWire> | ReturnType<typeof clearInternationalVerificationView> | ReturnType<typeof clearIssueChargeCard> | ReturnType<typeof clearMerchantList> | ReturnType<typeof clearNetBurnOrIncome> | ReturnType<typeof clearNetBurnOrIncomeClassesView> | ReturnType<typeof clearNetBurnOrIncomeStoryCard> | ReturnType<typeof clearNotificationView> | ReturnType<typeof clearOnboardingCockpitView> | ReturnType<typeof clearOnboardingCustomerView> | ReturnType<typeof clearOpEx> | ReturnType<typeof clearOpExByVendor> | ReturnType<typeof clearOpExClassesView> | ReturnType<typeof clearOwnerList> | ReturnType<typeof clearPaymentAccountList> | ReturnType<typeof clearPeople> | ReturnType<typeof clearAggregatedReport> | ReturnType<typeof clearPreviousBills> | ReturnType<typeof clearProfitAndLoss> | ReturnType<typeof clearProfitAndLossClassesView> | ReturnType<typeof clearRecommendation> | ReturnType<typeof clearReferrals> | ReturnType<typeof clearReimbursementCard> | ReturnType<typeof clearReimbursementConfig> | ReturnType<typeof clearRemiBulkActionView> | ReturnType<typeof clearRemiDetailView> | ReturnType<typeof clearRemiList> | ReturnType<typeof clearRemiSetupApproverView> | ReturnType<typeof clearRemiSetupView> | ReturnType<typeof clearReportUIOption> | ReturnType<typeof clearRevenue> | ReturnType<typeof clearRevenueClassesView> | ReturnType<typeof clearReviewCompany> | ReturnType<typeof clearScheduleDetailView> | ReturnType<typeof clearScheduleAccruedDetailView> | ReturnType<typeof clearScheduleList> | ReturnType<typeof clearSettingsView> | ReturnType<typeof clearSetupView> | ReturnType<typeof clearPlaidAccountView> | ReturnType<typeof clearSubscriptionView> | ReturnType<typeof clearTagView> | ReturnType<typeof clearTaskDetail> | ReturnType<typeof clearTaskGroupTemplatesView> | ReturnType<typeof clearTaskGroupView> | ReturnType<typeof clearTaskList> | ReturnType<typeof clearTasksCard> | ReturnType<typeof clearTopEx> | ReturnType<typeof clearTransactionDetail> | ReturnType<typeof clearTransactionList> | ReturnType<typeof clearTransferDetail> | ReturnType<typeof clearTreasuryOverviewDetail> | ReturnType<typeof clearTreasurySetupView> | ReturnType<typeof clearTreasuryStatementList> | ReturnType<typeof clearTreasuryTaxLetterList> | ReturnType<typeof clearTreasuryTransferMoney> | ReturnType<typeof clearTrendData> | ReturnType<typeof clearTrendWithTransactions> | ReturnType<typeof clearTwoFactorAuthentication> | ReturnType<typeof clearUserFinancialAccount> | ReturnType<typeof clearUserListView> | ReturnType<typeof clearUserRoleConfigView> | ReturnType<typeof clearVendorGlobalReviewView> | ReturnType<typeof clearVendorReviewView> | ReturnType<typeof clearVendorTypeList> | ReturnType<typeof clearVendor1099TypeList> | ReturnType<typeof clearVendorView> | ReturnType<typeof clearVendorsFiling1099List> | ReturnType<typeof clearVendorsList> | ReturnType<typeof clearVendorsTabVendorView> | ReturnType<typeof clearWiseRedirectStatus> | ReturnType<typeof clearZeniAccStatementList> | ReturnType<typeof clearZeniAccountList> | ReturnType<typeof clearZeniAccountSetupView> | ReturnType<typeof clearZeniAccountsConfig> | ReturnType<typeof clearZeniAccountsPromoCard>;
200
+ type clearActionTypeForViews = ReturnType<typeof clearAccountList> | ReturnType<typeof clearAccountMappingView> | ReturnType<typeof clearActivityHistory> | ReturnType<typeof clearActivityRealTimeApproval> | ReturnType<typeof clearAddressView> | ReturnType<typeof clearAiCfoView> | ReturnType<typeof clearAllClasses> | ReturnType<typeof clearAllMonthEndCloseChecksView> | ReturnType<typeof clearApAging> | ReturnType<typeof clearApAgingDetail> | ReturnType<typeof clearArAging> | ReturnType<typeof clearArAgingDetail> | ReturnType<typeof clearAuthenticationView> | ReturnType<typeof clearBalanceSheet> | ReturnType<typeof clearBankAccountView> | ReturnType<typeof clearBillDetailView> | ReturnType<typeof clearBillList> | ReturnType<typeof clearBillPayBulkActionView> | ReturnType<typeof clearBillPayCard> | ReturnType<typeof clearBillPayConfig> | ReturnType<typeof clearBillPayReview> | ReturnType<typeof clearBillPaySetupApproverView> | ReturnType<typeof clearBillPaySetupView> | ReturnType<typeof clearCardBalance> | ReturnType<typeof clearCardPaymentView> | ReturnType<typeof clearCardUserOnboarding> | ReturnType<typeof clearCashbackDetail> | ReturnType<typeof clearCashBalance> | ReturnType<typeof clearCashFlow> | ReturnType<typeof clearCashInCashOut> | ReturnType<typeof clearCashPosition> | ReturnType<typeof clearChargeCardConfig> | ReturnType<typeof clearChargeCardDetail> | ReturnType<typeof clearChargeCardList> | ReturnType<typeof clearChargeCardRepaymentDetail> | ReturnType<typeof clearChargeCardSetupView> | ReturnType<typeof clearChargeCardStatementList> | ReturnType<typeof clearCheckDeposit> | ReturnType<typeof clearCompanyConfigView> | ReturnType<typeof clearCompanyHealthMetric> | ReturnType<typeof clearCompanyHealthMetricView> | ReturnType<typeof clearCompanyMonthEndReportView> | ReturnType<typeof clearCompanyTaskManagerView> | ReturnType<typeof clearCompanyView> | ReturnType<typeof clearDashboard> | ReturnType<typeof clearDashboardLayout> | ReturnType<typeof clearDepositAccountDetail> | ReturnType<typeof clearDepositAccountList> | ReturnType<typeof clearDepositAccountTransactionList> | ReturnType<typeof clearEditBillViewDetail> | ReturnType<typeof clearEditRemiViewDetail> | ReturnType<typeof clearAllEntityAutoCompleteResults> | ReturnType<typeof clearExpenseAutomationFluxAnalysisView> | ReturnType<typeof clearExpenseAutomationJESchedulesView> | ReturnType<typeof clearExpenseAutomationMissingReceiptsView> | ReturnType<typeof clearExpenseAutomationReconciliationView> | ReturnType<typeof clearExpenseAutomationTransactionsView> | ReturnType<typeof clearExpenseAutomationView> | ReturnType<typeof clearExpressPayView> | ReturnType<typeof clearFileViewList> | ReturnType<typeof clearFinanceStatement> | ReturnType<typeof clearForecastList> | ReturnType<typeof clearGlobalMerchantAutoCompleteResults> | ReturnType<typeof clearGlobalMerchantView> | ReturnType<typeof clearInsightsCard> | ReturnType<typeof clearInternationalWire> | ReturnType<typeof clearInternationalVerificationView> | ReturnType<typeof clearIssueChargeCard> | ReturnType<typeof clearMerchantList> | ReturnType<typeof clearNetBurnOrIncome> | ReturnType<typeof clearNetBurnOrIncomeClassesView> | ReturnType<typeof clearNetBurnOrIncomeStoryCard> | ReturnType<typeof clearNotificationView> | ReturnType<typeof clearOnboardingCockpitView> | ReturnType<typeof clearOnboardingCustomerView> | ReturnType<typeof clearOpEx> | ReturnType<typeof clearOpExByVendor> | ReturnType<typeof clearOpExClassesView> | ReturnType<typeof clearOwnerList> | ReturnType<typeof clearPaymentAccountList> | ReturnType<typeof clearPeople> | ReturnType<typeof clearAggregatedReport> | ReturnType<typeof clearPreviousBills> | ReturnType<typeof clearProfitAndLoss> | ReturnType<typeof clearProfitAndLossClassesView> | ReturnType<typeof clearRecommendation> | ReturnType<typeof clearReferrals> | ReturnType<typeof clearReimbursementCard> | ReturnType<typeof clearReimbursementConfig> | ReturnType<typeof clearRemiBulkActionView> | ReturnType<typeof clearRemiDetailView> | ReturnType<typeof clearRemiList> | ReturnType<typeof clearRemiSetupApproverView> | ReturnType<typeof clearRemiSetupView> | ReturnType<typeof clearReportUIOption> | ReturnType<typeof clearRevenue> | ReturnType<typeof clearRevenueClassesView> | ReturnType<typeof clearReviewCompany> | ReturnType<typeof clearScheduleDetailView> | ReturnType<typeof clearScheduleAccruedDetailView> | ReturnType<typeof clearScheduleList> | ReturnType<typeof clearSettingsView> | ReturnType<typeof clearSetupView> | ReturnType<typeof clearPlaidAccountView> | ReturnType<typeof clearSubscriptionView> | ReturnType<typeof clearTagView> | ReturnType<typeof clearTaskDetail> | ReturnType<typeof clearTaskGroupTemplatesView> | ReturnType<typeof clearTaskGroupView> | ReturnType<typeof clearTaskList> | ReturnType<typeof clearTasksCard> | ReturnType<typeof clearTopEx> | ReturnType<typeof clearTransactionDetail> | ReturnType<typeof clearTransactionList> | ReturnType<typeof clearTransferDetail> | ReturnType<typeof clearTreasuryOverviewDetail> | ReturnType<typeof clearTreasurySetupView> | ReturnType<typeof clearTreasuryStatementList> | ReturnType<typeof clearTreasuryTaxLetterList> | ReturnType<typeof clearTreasuryTransferMoney> | ReturnType<typeof clearTrendData> | ReturnType<typeof clearTrendWithTransactions> | ReturnType<typeof clearTwoFactorAuthentication> | ReturnType<typeof clearUserFinancialAccount> | ReturnType<typeof clearUserListView> | ReturnType<typeof clearUserRoleConfigView> | ReturnType<typeof clearVendorGlobalReviewView> | ReturnType<typeof clearVendorReviewView> | ReturnType<typeof clearVendorTypeList> | ReturnType<typeof clearVendor1099TypeList> | ReturnType<typeof clearVendorView> | ReturnType<typeof clearVendorsFiling1099List> | ReturnType<typeof clearVendorsList> | ReturnType<typeof clearVendorsTabVendorView> | ReturnType<typeof clearWiseRedirectStatus> | ReturnType<typeof clearZeniAccStatementList> | ReturnType<typeof clearZeniAccountList> | ReturnType<typeof clearZeniAccountSetupView> | ReturnType<typeof clearZeniAccountsConfig> | ReturnType<typeof clearZeniAccountsPromoCard>;
202
201
  type clearActionTypeForEntities = ReturnType<typeof clearAiCfo> | ReturnType<typeof clearAllAccountGroups> | ReturnType<typeof clearAllAccountRecon> | ReturnType<typeof clearAllAccountingSummary> | ReturnType<typeof clearAllAccounts> | ReturnType<typeof clearAllAddresses> | ReturnType<typeof clearAllApprovalRules> | ReturnType<typeof clearAllBankAccounts> | ReturnType<typeof clearAllBillTransactions> | ReturnType<typeof clearAllCardPayments> | ReturnType<typeof clearAllChargeCardRepayments> | ReturnType<typeof clearAllChargeCardTransactions> | ReturnType<typeof clearAllChargeCards> | ReturnType<typeof clearAllCompanies> | ReturnType<typeof clearAllConnectedAccounts> | ReturnType<typeof clearAllCurrencies> | ReturnType<typeof clearAllCustomerIncomeTrend> | ReturnType<typeof clearAllCustomers> | ReturnType<typeof clearAllDepositAccounts> | ReturnType<typeof clearAllEntities> | ReturnType<typeof clearAllEntityApprovalStatus> | ReturnType<typeof clearAllFiles> | ReturnType<typeof clearAllForecasts> | ReturnType<typeof clearAllGlobalMerchants> | ReturnType<typeof clearAllInsights> | ReturnType<typeof clearAllAccruedJESchedules> | ReturnType<typeof clearAllJEScheduleTransactions> | ReturnType<typeof clearAllMerchants> | ReturnType<typeof clearAllMonthEndCloseChecks> | ReturnType<typeof clearAllNotifications> | ReturnType<typeof clearAllOnboardingCustomersInfo> | ReturnType<typeof clearAllPaymentAccounts> | ReturnType<typeof clearAllPaymentInstruments> | ReturnType<typeof clearAllRecurringBills> | ReturnType<typeof clearAllReimbursements> | ReturnType<typeof clearAllSectionsAccountsView> | ReturnType<typeof clearAllSectionsClassesViewV2> | ReturnType<typeof clearAllSubscriptionAddOns> | ReturnType<typeof clearAllSubscriptionCoupons> | ReturnType<typeof clearAllSubscriptionPlans> | ReturnType<typeof clearAllSubscriptionSummary> | ReturnType<typeof clearAllSubscriptions> | ReturnType<typeof clearAllTags> | ReturnType<typeof clearAllTaskGroups> | ReturnType<typeof clearAllTaskGroupTemplates> | ReturnType<typeof clearAllTaskSummary> | ReturnType<typeof clearAllTasks> | ReturnType<typeof clearAllToastNotifications> | ReturnType<typeof clearAllTransactions> | ReturnType<typeof clearAllUserRoles> | ReturnType<typeof clearAllUsers> | ReturnType<typeof clearAllVendorExpenseTrends> | ReturnType<typeof clearAllVendors> | ReturnType<typeof clearClassList> | ReturnType<typeof clearContacts> | ReturnType<typeof clearCountryList> | ReturnType<typeof clearDepositAccountTransaction> | ReturnType<typeof clearSnackbar>;
203
202
  export type ActionType = clearActionTypeForViews | clearActionTypeForEntities | ReturnType<typeof clearAll>;
204
203
  export declare const clearAllEpic: (actions$: ActionsObservable<ActionType>) => import("rxjs").Observable<ActionType>;
@@ -15,7 +15,6 @@ const accountListReducer_1 = require("../../view/accountList/accountListReducer"
15
15
  const accountMappingReducer_1 = require("../../view/accountMappingView/accountMappingReducer");
16
16
  const addressViewReducer_1 = require("../../view/addressView/addressViewReducer");
17
17
  const aggregatedReportViewReducer_1 = require("../../view/aiAgentPerformance/aggregatedReportViewReducer");
18
- const aiAccountantViewReducer_1 = require("../../view/aiAccountantView/aiAccountantViewReducer");
19
18
  const aiCfoViewReducer_1 = require("../../view/aiCfoView/aiCfoViewReducer");
20
19
  const apAgingDetailReducer_1 = require("../../view/apAgingView/apAgingDetail/apAgingDetailReducer");
21
20
  const apAgingReducer_1 = require("../../view/apAgingView/apAgingReport/apAgingReducer");
@@ -211,7 +210,6 @@ const clearAllEpic = (actions$) => actions$.pipe((0, operators_1.filter)(tenantR
211
210
  (0, commonHistoryReducer_1.clearActivityHistory)(),
212
211
  (0, realTimeApprovalReducer_1.clearActivityRealTimeApproval)(),
213
212
  (0, addressViewReducer_1.clearAddressView)(),
214
- (0, aiAccountantViewReducer_1.clearAiAccountantView)(),
215
213
  (0, aiCfoViewReducer_1.clearAiCfoView)(),
216
214
  (0, classReducer_1.clearAllClasses)(),
217
215
  (0, monthEndCloseChecksViewReducer_1.clearAllMonthEndCloseChecksView)(),
@@ -0,0 +1,19 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { RootState } from '../../../reducer';
3
+ import { ZeniAPI } from '../../../zeniAPI';
4
+ import { deleteConnection, deleteConnectionFailure, deleteConnectionSuccess } from '../tenantReducer';
5
+ export type ActionType = ReturnType<typeof deleteConnection> | ReturnType<typeof deleteConnectionSuccess> | ReturnType<typeof deleteConnectionFailure>;
6
+ export declare const deleteConnectionEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
+ payload: {
8
+ tenantId: string;
9
+ connectionId: string;
10
+ connectionType: "analytics" | "crm";
11
+ };
12
+ type: "tenant/deleteConnectionSuccess";
13
+ } | {
14
+ payload: {
15
+ tenantId: string;
16
+ status: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
17
+ };
18
+ type: "tenant/deleteConnectionFailure";
19
+ }>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteConnectionEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../responsePayload");
7
+ const tenantReducer_1 = require("../tenantReducer");
8
+ const deleteConnectionEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(tenantReducer_1.deleteConnection.match), (0, operators_1.switchMap)((action) => zeniAPI
9
+ .deleteAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/connections/${action.payload.connectionId}`, undefined, Object.assign({ 'zeni-tenant-id': action.payload.tenantId }))
10
+ .pipe((0, operators_1.mergeMap)((response) => {
11
+ if ((0, responsePayload_1.isSuccessStatus)(response)) {
12
+ return (0, rxjs_1.from)([
13
+ (0, tenantReducer_1.deleteConnectionSuccess)(action.payload.tenantId, action.payload.connectionId, action.payload.connectionType),
14
+ ]);
15
+ }
16
+ const status = response.status ??
17
+ (0, responsePayload_1.createZeniAPIStatus)('Failed to delete connection. Please try again.');
18
+ return (0, rxjs_1.from)([
19
+ (0, tenantReducer_1.deleteConnectionFailure)(action.payload.tenantId, status),
20
+ ]);
21
+ }), (0, operators_1.catchError)((error) => {
22
+ const message = error instanceof Error
23
+ ? error.message
24
+ : 'Unexpected error deleting connection.';
25
+ return (0, rxjs_1.from)([
26
+ (0, tenantReducer_1.deleteConnectionFailure)(action.payload.tenantId, (0, responsePayload_1.createZeniAPIStatus)(message)),
27
+ ]);
28
+ }))));
29
+ exports.deleteConnectionEpic = deleteConnectionEpic;
@@ -0,0 +1,19 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { RootState } from '../../../reducer';
3
+ import { ZeniAPI } from '../../../zeniAPI';
4
+ import { saveAPIKeyConnection, saveAPIKeyConnectionFailure, saveAPIKeyConnectionSuccess } from '../tenantReducer';
5
+ export type ActionType = ReturnType<typeof saveAPIKeyConnection> | ReturnType<typeof saveAPIKeyConnectionSuccess> | ReturnType<typeof saveAPIKeyConnectionFailure>;
6
+ export declare const saveAPIKeyConnectionEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
+ payload: {
8
+ tenantId: string;
9
+ connectionType: "analytics" | "crm";
10
+ connectionPayload: import("../tenantPayload").ConnectionDataPayload;
11
+ };
12
+ type: "tenant/saveAPIKeyConnectionSuccess";
13
+ } | {
14
+ payload: {
15
+ tenantId: string;
16
+ status: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
17
+ };
18
+ type: "tenant/saveAPIKeyConnectionFailure";
19
+ }>;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.saveAPIKeyConnectionEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../responsePayload");
7
+ const tenantReducer_1 = require("../tenantReducer");
8
+ const saveAPIKeyConnectionEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(tenantReducer_1.saveAPIKeyConnection.match), (0, operators_1.switchMap)((action) => zeniAPI
9
+ .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/connections/${action.payload.connectionId}`, {
10
+ api_key: action.payload.credentials.api_key,
11
+ connection_name: action.payload.connectionName,
12
+ connection_type: action.payload.connectionType,
13
+ site: action.payload.credentials.site,
14
+ }, Object.assign({ 'zeni-tenant-id': action.payload.tenantId }))
15
+ .pipe((0, operators_1.mergeMap)((response) => {
16
+ if ((0, responsePayload_1.isSuccessResponse)(response)) {
17
+ return (0, rxjs_1.from)([
18
+ (0, tenantReducer_1.saveAPIKeyConnectionSuccess)(action.payload.tenantId, action.payload.connectionType, response.data // eslint-disable-line @typescript-eslint/no-non-null-assertion
19
+ ),
20
+ ]);
21
+ }
22
+ const status = response.status ??
23
+ (0, responsePayload_1.createZeniAPIStatus)('Failed to save connection. Please try again.');
24
+ return (0, rxjs_1.from)([(0, tenantReducer_1.saveAPIKeyConnectionFailure)(action.payload.tenantId, status)]);
25
+ }), (0, operators_1.catchError)((error) => {
26
+ const message = error instanceof Error ? error.message : 'Unexpected error saving connection.';
27
+ return (0, rxjs_1.from)([
28
+ (0, tenantReducer_1.saveAPIKeyConnectionFailure)(action.payload.tenantId, (0, responsePayload_1.createZeniAPIStatus)(message)),
29
+ ]);
30
+ }))));
31
+ exports.saveAPIKeyConnectionEpic = saveAPIKeyConnectionEpic;
@@ -0,0 +1,19 @@
1
+ import { ActionsObservable, StateObservable } from 'redux-observable';
2
+ import { RootState } from '../../../reducer';
3
+ import { ZeniAPI } from '../../../zeniAPI';
4
+ import { saveOAuthConnection, saveOAuthConnectionFailure, saveOAuthConnectionSuccess } from '../tenantReducer';
5
+ export type ActionType = ReturnType<typeof saveOAuthConnection> | ReturnType<typeof saveOAuthConnectionSuccess> | ReturnType<typeof saveOAuthConnectionFailure>;
6
+ export declare const saveOAuthConnectionEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
+ payload: {
8
+ tenantId: string;
9
+ connectionType: "analytics" | "crm";
10
+ connectionPayload: import("../tenantPayload").ConnectionDataPayload;
11
+ };
12
+ type: "tenant/saveOAuthConnectionSuccess";
13
+ } | {
14
+ payload: {
15
+ tenantId: string;
16
+ status: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
17
+ };
18
+ type: "tenant/saveOAuthConnectionFailure";
19
+ }>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.saveOAuthConnectionEpic = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const responsePayload_1 = require("../../../responsePayload");
7
+ const tenantReducer_1 = require("../tenantReducer");
8
+ const saveOAuthConnectionEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(tenantReducer_1.saveOAuthConnection.match), (0, operators_1.switchMap)((action) => zeniAPI
9
+ .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/connections/${action.payload.connectionId}`, {
10
+ authorization_code: action.payload.credentials.authorization_code,
11
+ client_id: action.payload.credentials.client_id,
12
+ client_secret: action.payload.credentials.client_secret,
13
+ connection_name: action.payload.connectionName,
14
+ connection_type: action.payload.connectionType,
15
+ redirect_uri: action.payload.credentials.redirect_uri,
16
+ }, Object.assign({ 'zeni-tenant-id': action.payload.tenantId }))
17
+ .pipe((0, operators_1.mergeMap)((response) => {
18
+ if ((0, responsePayload_1.isSuccessResponse)(response)) {
19
+ return (0, rxjs_1.from)([
20
+ (0, tenantReducer_1.saveOAuthConnectionSuccess)(action.payload.tenantId, action.payload.connectionType, response.data // eslint-disable-line @typescript-eslint/no-non-null-assertion
21
+ ),
22
+ ]);
23
+ }
24
+ const status = response.status ??
25
+ (0, responsePayload_1.createZeniAPIStatus)('Failed to save connection. Please try again.');
26
+ return (0, rxjs_1.from)([(0, tenantReducer_1.saveOAuthConnectionFailure)(action.payload.tenantId, status)]);
27
+ }), (0, operators_1.catchError)((error) => {
28
+ const message = error instanceof Error ? error.message : 'Unexpected error saving connection.';
29
+ return (0, rxjs_1.from)([
30
+ (0, tenantReducer_1.saveOAuthConnectionFailure)(action.payload.tenantId, (0, responsePayload_1.createZeniAPIStatus)(message)),
31
+ ]);
32
+ }))));
33
+ exports.saveOAuthConnectionEpic = saveOAuthConnectionEpic;
@@ -138,7 +138,9 @@ type RoleResourcesResponse = ZeniAPIResponse<RoleResourcesData>;
138
138
  interface ConnectionsPayload {
139
139
  connections: {
140
140
  accounting: ConnectionDataPayload[];
141
+ analytics: ConnectionDataPayload[];
141
142
  payments: ConnectionDataPayload[];
143
+ crm?: ConnectionDataPayload[];
142
144
  };
143
145
  }
144
146
  interface ConnectionWithMetaPayload {
@@ -13,6 +13,10 @@ export interface DoSignInPayload {
13
13
  redirectUri: ZeniUrl;
14
14
  sourceUri: ZeniUrl;
15
15
  }
16
+ export declare const toExternalIntegrationType: (v: string) => "analytics" | "crm";
17
+ export type ExternalIntegrationType = ReturnType<typeof toExternalIntegrationType>;
18
+ export declare const toExternalSupportedTool: (v: string) => "chargebee" | "hubspot";
19
+ export type ExternalSupportedTool = ReturnType<typeof toExternalSupportedTool>;
16
20
  export declare const initialState: TenantState;
17
21
  export declare const updateTenants: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenants: TenantPayload[], userTenantPayload?: TenantUserPayload | undefined, tenantUpdated?: any], {
18
22
  tenants: TenantPayload[];
@@ -76,7 +80,60 @@ export declare const updateTenants: import("@reduxjs/toolkit").ActionCreatorWith
76
80
  }, "tenant/fetchExternalConnectionsFailure", never, never>, fetchExternalConnectionsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, externalConnections: ConnectionsPayload], {
77
81
  tenantId: string;
78
82
  externalConnections: ConnectionsPayload;
79
- }, "tenant/fetchExternalConnectionsSuccess", never, never>, clearAll: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[keepTenantCompanyState?: boolean | undefined], {
83
+ }, "tenant/fetchExternalConnectionsSuccess", never, never>, saveAPIKeyConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "analytics" | "crm", connectionName: "chargebee" | "hubspot", credentials: {
84
+ api_key: string;
85
+ site: string;
86
+ }], {
87
+ tenantId: string;
88
+ connectionId: string;
89
+ connectionType: "analytics" | "crm";
90
+ connectionName: "chargebee" | "hubspot";
91
+ credentials: {
92
+ api_key: string;
93
+ site: string;
94
+ };
95
+ }, "tenant/saveAPIKeyConnection", never, never>, saveAPIKeyConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "analytics" | "crm", connectionPayload: ConnectionDataPayload], {
96
+ tenantId: string;
97
+ connectionType: "analytics" | "crm";
98
+ connectionPayload: ConnectionDataPayload;
99
+ }, "tenant/saveAPIKeyConnectionSuccess", never, never>, saveAPIKeyConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
100
+ tenantId: string;
101
+ status: ZeniAPIStatus<Record<string, unknown>>;
102
+ }, "tenant/saveAPIKeyConnectionFailure", never, never>, saveOAuthConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "analytics" | "crm", connectionName: "chargebee" | "hubspot", credentials: {
103
+ authorization_code: string;
104
+ client_id: string;
105
+ client_secret: string;
106
+ redirect_uri: string;
107
+ }], {
108
+ tenantId: string;
109
+ connectionId: string;
110
+ connectionType: "analytics" | "crm";
111
+ connectionName: "chargebee" | "hubspot";
112
+ credentials: {
113
+ authorization_code: string;
114
+ client_id: string;
115
+ client_secret: string;
116
+ redirect_uri: string;
117
+ };
118
+ }, "tenant/saveOAuthConnection", never, never>, saveOAuthConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "analytics" | "crm", connectionPayload: ConnectionDataPayload], {
119
+ tenantId: string;
120
+ connectionType: "analytics" | "crm";
121
+ connectionPayload: ConnectionDataPayload;
122
+ }, "tenant/saveOAuthConnectionSuccess", never, never>, saveOAuthConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
123
+ tenantId: string;
124
+ status: ZeniAPIStatus<Record<string, unknown>>;
125
+ }, "tenant/saveOAuthConnectionFailure", never, never>, deleteConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "analytics" | "crm"], {
126
+ tenantId: string;
127
+ connectionId: string;
128
+ connectionType: "analytics" | "crm";
129
+ }, "tenant/deleteConnection", never, never>, deleteConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "analytics" | "crm"], {
130
+ tenantId: string;
131
+ connectionId: string;
132
+ connectionType: "analytics" | "crm";
133
+ }, "tenant/deleteConnectionSuccess", never, never>, deleteConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
134
+ tenantId: string;
135
+ status: ZeniAPIStatus<Record<string, unknown>>;
136
+ }, "tenant/deleteConnectionFailure", never, never>, clearAll: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[keepTenantCompanyState?: boolean | undefined], {
80
137
  keepTenantCompanyState: boolean;
81
138
  }, "tenant/clearAll", never, never>, fetchSubscriptionSummaryForTenant: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string], {
82
139
  tenantId: string;
@@ -120,6 +177,8 @@ export declare const toRoleResource: (payload: RoleResourcePayload) => RoleResou
120
177
  */
121
178
  export declare function mapConnectionsPayloadToState(connectionsPayload: ConnectionsPayload): {
122
179
  accounting: Connection[];
180
+ analytics: Connection[];
181
+ crm: Connection[];
123
182
  payments: Connection[];
124
183
  };
125
184
  export declare const toConnection: (payload: ConnectionDataPayload) => Connection;
@@ -4,18 +4,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  var _a;
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.toConnection = exports.toRoleResource = exports.resendVerifyDeviceOTPFailure = exports.resendVerifyDeviceOTPSuccess = exports.resendVerifyDeviceOTP = exports.verifyDeviceWithTwoFAFailure = exports.verifyDeviceWithTwoFASuccess = exports.verifyDeviceWithTwoFA = exports.updateTenantMasterTOSInfo = exports.trigger2FA = exports.resetSignInState = exports.updateTreasuryVideoViewedForLoggedInUser = exports.updateReferViewedForLoggedInUser = exports.updateTenantReimbursementInfo = exports.removeOnboardingTenant = exports.updateOnboardingTenants = exports.updateSubscriptionSummaryForTenantFailure = exports.updateSubscriptionSummaryForTenantSuccess = exports.fetchSubscriptionSummaryForTenant = exports.clearAll = exports.fetchExternalConnectionsSuccess = exports.fetchExternalConnectionsFailure = exports.saveExternalConnectionFailure = exports.saveExternalConnectionSuccess = exports.saveExternalConnection = exports.fetchExternalConnections = exports.updateLoggedInUser = exports.signOutSuccess = exports.doSignOut = exports.updateSignInState = exports.sendEmailMagicLinkToUserFailure = exports.sendEmailMagicLinkToUserSuccess = exports.sendEmailMagicLinkToUser = exports.magicLinkSignInFailure = exports.magicLinkSignInSuccess = exports.doMagicLinkSignIn = exports.doSignIn = exports.updateExcludedResourcesFailure = exports.updateExcludedResourcesSuccess = exports.fetchExcludedResources = exports.updateCurrentTenant = exports.updateTenantFailure = exports.updateTenantSuccess = exports.fetchActiveTenant = exports.updateTenantsFailure = exports.updateTenantsSuccess = exports.fetchAllTenants = exports.updateTenants = exports.initialState = void 0;
7
+ exports.resetSignInState = exports.updateTreasuryVideoViewedForLoggedInUser = exports.updateReferViewedForLoggedInUser = exports.updateTenantReimbursementInfo = exports.removeOnboardingTenant = exports.updateOnboardingTenants = exports.updateSubscriptionSummaryForTenantFailure = exports.updateSubscriptionSummaryForTenantSuccess = exports.fetchSubscriptionSummaryForTenant = exports.clearAll = exports.deleteConnectionFailure = exports.deleteConnectionSuccess = exports.deleteConnection = exports.saveOAuthConnectionFailure = exports.saveOAuthConnectionSuccess = exports.saveOAuthConnection = exports.saveAPIKeyConnectionFailure = exports.saveAPIKeyConnectionSuccess = exports.saveAPIKeyConnection = exports.fetchExternalConnectionsSuccess = exports.fetchExternalConnectionsFailure = exports.saveExternalConnectionFailure = exports.saveExternalConnectionSuccess = exports.saveExternalConnection = exports.fetchExternalConnections = exports.updateLoggedInUser = exports.signOutSuccess = exports.doSignOut = exports.updateSignInState = exports.sendEmailMagicLinkToUserFailure = exports.sendEmailMagicLinkToUserSuccess = exports.sendEmailMagicLinkToUser = exports.magicLinkSignInFailure = exports.magicLinkSignInSuccess = exports.doMagicLinkSignIn = exports.doSignIn = exports.updateExcludedResourcesFailure = exports.updateExcludedResourcesSuccess = exports.fetchExcludedResources = exports.updateCurrentTenant = exports.updateTenantFailure = exports.updateTenantSuccess = exports.fetchActiveTenant = exports.updateTenantsFailure = exports.updateTenantsSuccess = exports.fetchAllTenants = exports.updateTenants = exports.initialState = exports.toExternalSupportedTool = exports.toExternalIntegrationType = void 0;
8
+ exports.toConnection = exports.toRoleResource = exports.resendVerifyDeviceOTPFailure = exports.resendVerifyDeviceOTPSuccess = exports.resendVerifyDeviceOTP = exports.verifyDeviceWithTwoFAFailure = exports.verifyDeviceWithTwoFASuccess = exports.verifyDeviceWithTwoFA = exports.updateTenantMasterTOSInfo = exports.trigger2FA = void 0;
8
9
  exports.mapConnectionsPayloadToState = mapConnectionsPayloadToState;
9
10
  const toolkit_1 = require("@reduxjs/toolkit");
10
11
  const js_base64_1 = require("js-base64");
11
12
  const assignWith_1 = __importDefault(require("lodash/assignWith"));
12
13
  const urlPayload_1 = require("../../commonPayloadTypes/urlPayload");
14
+ const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
13
15
  const timePeriod_1 = require("../../commonStateTypes/timePeriod");
14
16
  const netBurnOrIncomeStoryCardSelectorTypes_1 = require("../../view/netBurnOrIncomeStoryCard/netBurnOrIncomeStoryCardSelectorTypes");
15
17
  const netBurnOrIncomeStoryCardState_1 = require("../../view/netBurnOrIncomeStoryCard/netBurnOrIncomeStoryCardState");
16
18
  const zeniDayJS_1 = require("../../zeniDayJS");
17
19
  const subscriptionSummaryReducer_1 = require("../subscription/subscriptionSummary/subscriptionSummaryReducer");
18
20
  const userRolePayload_1 = require("../userRole/userRolePayload");
21
+ const EXTERNAL_INTEGRATIONS_TYPES = ['analytics', 'crm'];
22
+ const toExternalIntegrationType = (v) => (0, stringToUnion_1.stringToUnion)(v, EXTERNAL_INTEGRATIONS_TYPES);
23
+ exports.toExternalIntegrationType = toExternalIntegrationType;
24
+ const EXTERNAL_SUPPORTED_TOOLS = ['chargebee', 'hubspot'];
25
+ const toExternalSupportedTool = (v) => (0, stringToUnion_1.stringToUnion)(v, EXTERNAL_SUPPORTED_TOOLS);
26
+ exports.toExternalSupportedTool = toExternalSupportedTool;
19
27
  exports.initialState = {
20
28
  fetchState: 'Not-Started',
21
29
  error: undefined,
@@ -333,8 +341,13 @@ const tenant = (0, toolkit_1.createSlice)({
333
341
  draft.externalConnectionsByTenant[action.payload.tenantId] = {
334
342
  fetchState: 'In-Progress',
335
343
  accounting: [],
344
+ analytics: [],
345
+ crm: [],
336
346
  payments: [],
337
347
  saveConnectionState: 'Not-Started',
348
+ saveAPIKeyConnectionState: 'Not-Started',
349
+ saveOAuthConnectionState: 'Not-Started',
350
+ deleteConnectionState: 'Not-Started',
338
351
  error: undefined,
339
352
  };
340
353
  },
@@ -344,12 +357,17 @@ const tenant = (0, toolkit_1.createSlice)({
344
357
  return { payload: { tenantId, externalConnections } };
345
358
  },
346
359
  reducer(draft, action) {
347
- const { accounting, payments } = mapConnectionsPayloadToState(action.payload.externalConnections);
360
+ const { accounting, analytics, crm, payments } = mapConnectionsPayloadToState(action.payload.externalConnections);
348
361
  draft.externalConnectionsByTenant[action.payload.tenantId] = {
349
362
  fetchState: 'Completed',
350
363
  accounting,
364
+ analytics,
365
+ crm,
351
366
  payments,
352
367
  saveConnectionState: 'Completed',
368
+ saveAPIKeyConnectionState: 'Not-Started',
369
+ saveOAuthConnectionState: 'Not-Started',
370
+ deleteConnectionState: 'Not-Started',
353
371
  error: undefined,
354
372
  };
355
373
  },
@@ -363,8 +381,13 @@ const tenant = (0, toolkit_1.createSlice)({
363
381
  draft.externalConnectionsByTenant[tenantId] = {
364
382
  fetchState: 'Error',
365
383
  accounting: [],
384
+ analytics: [],
385
+ crm: [],
366
386
  payments: [],
367
387
  saveConnectionState: 'Error',
388
+ saveAPIKeyConnectionState: 'Not-Started',
389
+ saveOAuthConnectionState: 'Not-Started',
390
+ deleteConnectionState: 'Not-Started',
368
391
  error: status,
369
392
  };
370
393
  },
@@ -410,6 +433,121 @@ const tenant = (0, toolkit_1.createSlice)({
410
433
  });
411
434
  },
412
435
  },
436
+ saveAPIKeyConnection: {
437
+ prepare(tenantId, connectionId, connectionType, connectionName, credentials) {
438
+ return { payload: { tenantId, connectionId, connectionType, connectionName, credentials } };
439
+ },
440
+ reducer(draft, action) {
441
+ const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
442
+ if (existing != null) {
443
+ existing.saveAPIKeyConnectionState = 'In-Progress';
444
+ existing.saveAPIKeyConnectionError = undefined;
445
+ }
446
+ },
447
+ },
448
+ saveAPIKeyConnectionSuccess: {
449
+ prepare(tenantId, connectionType, connectionPayload) {
450
+ return { payload: { tenantId, connectionType, connectionPayload } };
451
+ },
452
+ reducer(draft, action) {
453
+ const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
454
+ if (existing != null) {
455
+ existing.saveAPIKeyConnectionState = 'Completed';
456
+ existing[action.payload.connectionType] = [(0, exports.toConnection)(action.payload.connectionPayload)];
457
+ existing.saveAPIKeyConnectionError = undefined;
458
+ }
459
+ },
460
+ },
461
+ saveAPIKeyConnectionFailure: {
462
+ prepare(tenantId, status) {
463
+ return { payload: { tenantId, status } };
464
+ },
465
+ reducer(draft, action) {
466
+ const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
467
+ if (existing != null) {
468
+ existing.saveAPIKeyConnectionState = 'Error';
469
+ existing.saveAPIKeyConnectionError = action.payload.status;
470
+ }
471
+ },
472
+ },
473
+ saveOAuthConnection: {
474
+ prepare(tenantId, connectionId, connectionType, connectionName, credentials) {
475
+ return { payload: { tenantId, connectionId, connectionType, connectionName, credentials } };
476
+ },
477
+ reducer(draft, action) {
478
+ const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
479
+ if (existing != null) {
480
+ existing.saveOAuthConnectionState = 'In-Progress';
481
+ existing.saveOAuthConnectionError = undefined;
482
+ }
483
+ },
484
+ },
485
+ saveOAuthConnectionSuccess: {
486
+ prepare(tenantId, connectionType, connectionPayload) {
487
+ return { payload: { tenantId, connectionType, connectionPayload } };
488
+ },
489
+ reducer(draft, action) {
490
+ const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
491
+ if (existing != null) {
492
+ existing.saveOAuthConnectionState = 'Completed';
493
+ existing[action.payload.connectionType] = [(0, exports.toConnection)(action.payload.connectionPayload)];
494
+ existing.saveOAuthConnectionError = undefined;
495
+ }
496
+ },
497
+ },
498
+ saveOAuthConnectionFailure: {
499
+ prepare(tenantId, status) {
500
+ return { payload: { tenantId, status } };
501
+ },
502
+ reducer(draft, action) {
503
+ const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
504
+ if (existing != null) {
505
+ existing.saveOAuthConnectionState = 'Error';
506
+ existing.saveOAuthConnectionError = action.payload.status;
507
+ }
508
+ },
509
+ },
510
+ deleteConnection: {
511
+ prepare(tenantId, connectionId, connectionType) {
512
+ return { payload: { tenantId, connectionId, connectionType } };
513
+ },
514
+ reducer(draft, action) {
515
+ const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
516
+ if (existing != null) {
517
+ existing.deleteConnectionState = 'In-Progress';
518
+ existing.deleteConnectionError = undefined;
519
+ }
520
+ },
521
+ },
522
+ deleteConnectionSuccess: {
523
+ prepare(tenantId, connectionId, connectionType) {
524
+ return { payload: { tenantId, connectionId, connectionType } };
525
+ },
526
+ reducer(draft, action) {
527
+ const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
528
+ if (existing != null) {
529
+ existing.deleteConnectionState = 'Completed';
530
+ existing.deleteConnectionError = undefined;
531
+ const arr = existing[action.payload.connectionType];
532
+ const idx = arr.findIndex((c) => c.connectionId === action.payload.connectionId);
533
+ if (idx !== -1) {
534
+ arr[idx] = { ...arr[idx], isValid: false };
535
+ }
536
+ }
537
+ },
538
+ },
539
+ deleteConnectionFailure: {
540
+ prepare(tenantId, status) {
541
+ return { payload: { tenantId, status } };
542
+ },
543
+ reducer(draft, action) {
544
+ const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
545
+ if (existing != null) {
546
+ existing.deleteConnectionState = 'Error';
547
+ existing.deleteConnectionError = action.payload.status;
548
+ }
549
+ },
550
+ },
413
551
  doSignOut(draft) {
414
552
  draft.fetchState = 'Not-Started';
415
553
  draft.signInState = 'Not-Started';
@@ -537,7 +675,7 @@ const tenant = (0, toolkit_1.createSlice)({
537
675
  },
538
676
  },
539
677
  });
540
- _a = tenant.actions, exports.updateTenants = _a.updateTenants, exports.fetchAllTenants = _a.fetchAllTenants, exports.updateTenantsSuccess = _a.updateTenantsSuccess, exports.updateTenantsFailure = _a.updateTenantsFailure, exports.fetchActiveTenant = _a.fetchActiveTenant, exports.updateTenantSuccess = _a.updateTenantSuccess, exports.updateTenantFailure = _a.updateTenantFailure, exports.updateCurrentTenant = _a.updateCurrentTenant, exports.fetchExcludedResources = _a.fetchExcludedResources, exports.updateExcludedResourcesSuccess = _a.updateExcludedResourcesSuccess, exports.updateExcludedResourcesFailure = _a.updateExcludedResourcesFailure, exports.doSignIn = _a.doSignIn, exports.doMagicLinkSignIn = _a.doMagicLinkSignIn, exports.magicLinkSignInSuccess = _a.magicLinkSignInSuccess, exports.magicLinkSignInFailure = _a.magicLinkSignInFailure, exports.sendEmailMagicLinkToUser = _a.sendEmailMagicLinkToUser, exports.sendEmailMagicLinkToUserSuccess = _a.sendEmailMagicLinkToUserSuccess, exports.sendEmailMagicLinkToUserFailure = _a.sendEmailMagicLinkToUserFailure, exports.updateSignInState = _a.updateSignInState, exports.doSignOut = _a.doSignOut, exports.signOutSuccess = _a.signOutSuccess, exports.updateLoggedInUser = _a.updateLoggedInUser, exports.fetchExternalConnections = _a.fetchExternalConnections, exports.saveExternalConnection = _a.saveExternalConnection, exports.saveExternalConnectionSuccess = _a.saveExternalConnectionSuccess, exports.saveExternalConnectionFailure = _a.saveExternalConnectionFailure, exports.fetchExternalConnectionsFailure = _a.fetchExternalConnectionsFailure, exports.fetchExternalConnectionsSuccess = _a.fetchExternalConnectionsSuccess, exports.clearAll = _a.clearAll, exports.fetchSubscriptionSummaryForTenant = _a.fetchSubscriptionSummaryForTenant, exports.updateSubscriptionSummaryForTenantSuccess = _a.updateSubscriptionSummaryForTenantSuccess, exports.updateSubscriptionSummaryForTenantFailure = _a.updateSubscriptionSummaryForTenantFailure, exports.updateOnboardingTenants = _a.updateOnboardingTenants, exports.removeOnboardingTenant = _a.removeOnboardingTenant, exports.updateTenantReimbursementInfo = _a.updateTenantReimbursementInfo, exports.updateReferViewedForLoggedInUser = _a.updateReferViewedForLoggedInUser, exports.updateTreasuryVideoViewedForLoggedInUser = _a.updateTreasuryVideoViewedForLoggedInUser, exports.resetSignInState = _a.resetSignInState, exports.trigger2FA = _a.trigger2FA, exports.updateTenantMasterTOSInfo = _a.updateTenantMasterTOSInfo, exports.verifyDeviceWithTwoFA = _a.verifyDeviceWithTwoFA, exports.verifyDeviceWithTwoFASuccess = _a.verifyDeviceWithTwoFASuccess, exports.verifyDeviceWithTwoFAFailure = _a.verifyDeviceWithTwoFAFailure, exports.resendVerifyDeviceOTP = _a.resendVerifyDeviceOTP, exports.resendVerifyDeviceOTPSuccess = _a.resendVerifyDeviceOTPSuccess, exports.resendVerifyDeviceOTPFailure = _a.resendVerifyDeviceOTPFailure;
678
+ _a = tenant.actions, exports.updateTenants = _a.updateTenants, exports.fetchAllTenants = _a.fetchAllTenants, exports.updateTenantsSuccess = _a.updateTenantsSuccess, exports.updateTenantsFailure = _a.updateTenantsFailure, exports.fetchActiveTenant = _a.fetchActiveTenant, exports.updateTenantSuccess = _a.updateTenantSuccess, exports.updateTenantFailure = _a.updateTenantFailure, exports.updateCurrentTenant = _a.updateCurrentTenant, exports.fetchExcludedResources = _a.fetchExcludedResources, exports.updateExcludedResourcesSuccess = _a.updateExcludedResourcesSuccess, exports.updateExcludedResourcesFailure = _a.updateExcludedResourcesFailure, exports.doSignIn = _a.doSignIn, exports.doMagicLinkSignIn = _a.doMagicLinkSignIn, exports.magicLinkSignInSuccess = _a.magicLinkSignInSuccess, exports.magicLinkSignInFailure = _a.magicLinkSignInFailure, exports.sendEmailMagicLinkToUser = _a.sendEmailMagicLinkToUser, exports.sendEmailMagicLinkToUserSuccess = _a.sendEmailMagicLinkToUserSuccess, exports.sendEmailMagicLinkToUserFailure = _a.sendEmailMagicLinkToUserFailure, exports.updateSignInState = _a.updateSignInState, exports.doSignOut = _a.doSignOut, exports.signOutSuccess = _a.signOutSuccess, exports.updateLoggedInUser = _a.updateLoggedInUser, exports.fetchExternalConnections = _a.fetchExternalConnections, exports.saveExternalConnection = _a.saveExternalConnection, exports.saveExternalConnectionSuccess = _a.saveExternalConnectionSuccess, exports.saveExternalConnectionFailure = _a.saveExternalConnectionFailure, exports.fetchExternalConnectionsFailure = _a.fetchExternalConnectionsFailure, exports.fetchExternalConnectionsSuccess = _a.fetchExternalConnectionsSuccess, exports.saveAPIKeyConnection = _a.saveAPIKeyConnection, exports.saveAPIKeyConnectionSuccess = _a.saveAPIKeyConnectionSuccess, exports.saveAPIKeyConnectionFailure = _a.saveAPIKeyConnectionFailure, exports.saveOAuthConnection = _a.saveOAuthConnection, exports.saveOAuthConnectionSuccess = _a.saveOAuthConnectionSuccess, exports.saveOAuthConnectionFailure = _a.saveOAuthConnectionFailure, exports.deleteConnection = _a.deleteConnection, exports.deleteConnectionSuccess = _a.deleteConnectionSuccess, exports.deleteConnectionFailure = _a.deleteConnectionFailure, exports.clearAll = _a.clearAll, exports.fetchSubscriptionSummaryForTenant = _a.fetchSubscriptionSummaryForTenant, exports.updateSubscriptionSummaryForTenantSuccess = _a.updateSubscriptionSummaryForTenantSuccess, exports.updateSubscriptionSummaryForTenantFailure = _a.updateSubscriptionSummaryForTenantFailure, exports.updateOnboardingTenants = _a.updateOnboardingTenants, exports.removeOnboardingTenant = _a.removeOnboardingTenant, exports.updateTenantReimbursementInfo = _a.updateTenantReimbursementInfo, exports.updateReferViewedForLoggedInUser = _a.updateReferViewedForLoggedInUser, exports.updateTreasuryVideoViewedForLoggedInUser = _a.updateTreasuryVideoViewedForLoggedInUser, exports.resetSignInState = _a.resetSignInState, exports.trigger2FA = _a.trigger2FA, exports.updateTenantMasterTOSInfo = _a.updateTenantMasterTOSInfo, exports.verifyDeviceWithTwoFA = _a.verifyDeviceWithTwoFA, exports.verifyDeviceWithTwoFASuccess = _a.verifyDeviceWithTwoFASuccess, exports.verifyDeviceWithTwoFAFailure = _a.verifyDeviceWithTwoFAFailure, exports.resendVerifyDeviceOTP = _a.resendVerifyDeviceOTP, exports.resendVerifyDeviceOTPSuccess = _a.resendVerifyDeviceOTPSuccess, exports.resendVerifyDeviceOTPFailure = _a.resendVerifyDeviceOTPFailure;
541
679
  exports.default = tenant.reducer;
542
680
  /**
543
681
  * Converts tenants payload to Tenant and User State
@@ -664,6 +802,8 @@ function mapConnectionsPayloadToState(connectionsPayload) {
664
802
  const { connections } = connectionsPayload;
665
803
  return {
666
804
  accounting: connections.accounting.map((payload) => (0, exports.toConnection)(payload)),
805
+ analytics: (connections.analytics ?? []).map((payload) => (0, exports.toConnection)(payload)),
806
+ crm: (connections.crm ?? []).map((payload) => (0, exports.toConnection)(payload)),
667
807
  payments: connections.payments.map((payload) => (0, exports.toConnection)(payload)),
668
808
  };
669
809
  }
@@ -12,10 +12,18 @@ import { UserRoleType } from '../userRole/userRoleType';
12
12
  import { AuthProvider } from './tenantReducer';
13
13
  export interface TenantExternalConnections {
14
14
  accounting: Connection[];
15
+ analytics: Connection[];
16
+ crm: Connection[];
17
+ deleteConnectionState: FetchState;
15
18
  fetchState: FetchState;
16
19
  payments: Connection[];
20
+ saveAPIKeyConnectionState: FetchState;
17
21
  saveConnectionState: FetchState;
22
+ saveOAuthConnectionState: FetchState;
23
+ deleteConnectionError?: ZeniAPIStatus;
18
24
  error?: ZeniAPIStatus;
25
+ saveAPIKeyConnectionError?: ZeniAPIStatus;
26
+ saveOAuthConnectionError?: ZeniAPIStatus;
19
27
  }
20
28
  export interface TenantState extends FetchedState {
21
29
  accountLocked: boolean;