@zeniai/client-epic-state 4.20.3-betaSS12 → 4.20.3-betaSS13
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/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +19 -0
- package/lib/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +2 -0
- package/lib/commonPayloadTypes/subAccountView/reportBySubAccountPayload.d.ts +2 -0
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +4 -0
- package/lib/commonStateTypes/coaBalance/coaBalancesFilterProjectView.d.ts +13 -0
- package/lib/commonStateTypes/coaBalance/coaBalancesFilterProjectView.js +9 -0
- package/lib/commonStateTypes/common.d.ts +1 -1
- package/lib/commonStateTypes/projectView/projectViewParentID.d.ts +5 -0
- package/lib/commonStateTypes/projectView/projectViewParentID.js +2 -0
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.d.ts +1 -0
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +3 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/entity/account/accountPayload.d.ts +2 -0
- package/lib/entity/account/accountReducer.d.ts +5 -2
- package/lib/entity/account/accountReducer.js +13 -5
- package/lib/entity/account/accountSelector.d.ts +7 -0
- package/lib/entity/account/accountSelector.js +4 -2
- package/lib/entity/account/accountState.d.ts +3 -1
- package/lib/entity/account/accountState.js +4 -1
- package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +1 -0
- package/lib/entity/account/subAccountSelector.d.ts +2 -0
- package/lib/entity/account/subAccountSelector.js +2 -0
- package/lib/entity/accountGroup/accountGroupSelector.d.ts +22 -0
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconPayload.d.ts +1 -1
- package/lib/entity/accountRecon/accountReconPayload.js +4 -2
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.d.ts +52 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +70 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.d.ts +10 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +51 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +48 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +66 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.d.ts +52 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.js +37 -0
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +4 -4
- package/lib/entity/chargeCard/chargeCard.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
- package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +2 -2
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +38 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +78 -0
- package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +4 -1
- package/lib/entity/jeSchedules/jeSchedulesSelector.js +5 -1
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +37 -0
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
- package/lib/entity/project/projectPayload.d.ts +13 -0
- package/lib/entity/project/projectPayload.js +30 -0
- package/lib/entity/project/projectReducer.d.ts +10 -0
- package/lib/entity/project/projectReducer.js +31 -0
- package/lib/entity/project/projectSelector.d.ts +5 -0
- package/lib/entity/project/projectSelector.js +12 -0
- package/lib/entity/project/projectState.d.ts +13 -0
- package/lib/entity/project/projectState.js +2 -0
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +13 -0
- package/lib/entity/sectionProjectView/sectionProjectView.js +6 -0
- package/lib/entity/sectionProjectView/sectionProjectViewEpic.d.ts +6 -0
- package/lib/entity/sectionProjectView/sectionProjectViewEpic.js +56 -0
- package/lib/entity/sectionProjectView/sectionProjectViewHelper.d.ts +11 -0
- package/lib/entity/sectionProjectView/sectionProjectViewHelper.js +15 -0
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +15 -0
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.js +64 -0
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.d.ts +11 -0
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +57 -0
- package/lib/entity/sectionProjectView/sectionProjectViewSelectorTypes.d.ts +16 -0
- package/lib/entity/sectionProjectView/sectionProjectViewSelectorTypes.js +2 -0
- package/lib/entity/sectionProjectView/sectionProjectViewState.d.ts +4 -0
- package/lib/entity/sectionProjectView/sectionProjectViewState.js +2 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.js +10 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +7 -2
- package/lib/entity/tenant/clearAllEpic.js +10 -0
- package/lib/entity/tenant/tenantPayload.d.ts +2 -0
- package/lib/entity/tenant/tenantReducer.d.ts +5 -2
- package/lib/entity/tenant/tenantReducer.js +10 -2
- package/lib/entity/tenant/tenantSelector.d.ts +2 -0
- package/lib/entity/tenant/tenantSelector.js +17 -1
- package/lib/entity/tenant/tenantState.d.ts +2 -0
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.d.ts +4 -1
- package/lib/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.d.ts +11 -0
- package/lib/entity/transaction/payloadTypes/transactionPayload.js +114 -1
- package/lib/entity/transaction/stateTypes/scheduleTransaction.d.ts +1 -0
- package/lib/entity/transaction/stateTypes/transaction.d.ts +11 -0
- package/lib/entity/transaction/stateTypes/transactionLine.d.ts +1 -1
- package/lib/entity/userRole/userRoleType.d.ts +2 -2
- package/lib/epic.d.ts +22 -2
- package/lib/epic.js +22 -2
- package/lib/esm/common/aiCfo/aiCfoSuggestedQuestionsPageContext.js +1 -0
- package/lib/esm/commonStateTypes/animations.js +4 -0
- package/lib/esm/commonStateTypes/coaBalance/coaBalancesFilterProjectView.js +5 -0
- package/lib/esm/commonStateTypes/projectView/projectViewParentID.js +1 -0
- package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +1 -0
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/esm/entity/account/accountReducer.js +12 -4
- package/lib/esm/entity/account/accountSelector.js +4 -2
- package/lib/esm/entity/account/accountState.js +4 -1
- package/lib/esm/entity/account/subAccountSelector.js +2 -0
- package/lib/esm/entity/accountRecon/accountReconPayload.js +4 -2
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +64 -0
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +47 -0
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +62 -0
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerState.js +31 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +78 -0
- package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +5 -1
- package/lib/esm/entity/project/projectPayload.js +26 -0
- package/lib/esm/entity/project/projectReducer.js +27 -0
- package/lib/esm/entity/project/projectSelector.js +8 -0
- package/lib/esm/entity/project/projectState.js +1 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectView.js +3 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewEpic.js +52 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewHelper.js +11 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewReducer.js +60 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +50 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelectorTypes.js +1 -0
- package/lib/esm/entity/sectionProjectView/sectionProjectViewState.js +1 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +10 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +10 -0
- package/lib/esm/entity/tenant/tenantReducer.js +9 -1
- package/lib/esm/entity/tenant/tenantSelector.js +14 -0
- package/lib/esm/entity/transaction/payloadTypes/scheduleTransactionPayload.js +1 -0
- package/lib/esm/entity/transaction/payloadTypes/transactionPayload.js +114 -1
- package/lib/esm/epic.js +22 -2
- package/lib/esm/index.js +32 -19
- package/lib/esm/reducer.js +20 -2
- package/lib/esm/view/aiAccountantView/aiAccountantViewPayload.js +2 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewReducer.js +152 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewSelector.js +77 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewState.js +11 -0
- package/lib/esm/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +46 -0
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +27 -0
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +47 -0
- package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +76 -0
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +82 -1
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +8 -2
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +29 -0
- package/lib/esm/view/classList/fetchClassListEpic.js +9 -2
- package/lib/esm/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
- package/lib/esm/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewReducer.js +19 -1
- package/lib/esm/view/companyTaskManagerView/companyTaskManagerViewSelector.js +3 -1
- package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +17 -0
- package/lib/esm/view/companyView/companyViewReducer.js +26 -1
- package/lib/esm/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +61 -0
- package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
- package/lib/esm/view/creditAgentView/creditAgentViewReducer.js +1 -39
- package/lib/esm/view/creditAgentView/creditAgentViewSelector.js +0 -1
- package/lib/esm/view/creditAgentView/creditAgentViewState.js +0 -6
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +63 -0
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
- package/lib/esm/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +65 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js +33 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +3 -3
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +6 -4
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +20 -5
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +12 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +98 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -13
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +21 -5
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
- package/lib/esm/view/expenseAutomationView/helpers/bulkUploadTiming.js +16 -0
- package/lib/esm/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +13 -0
- package/lib/esm/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +9 -0
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +21 -1
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +29 -6
- package/lib/esm/view/expenseAutomationView/reducers/reconciliationViewReducer.js +167 -3
- package/lib/esm/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +1 -2
- package/lib/esm/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +14 -4
- package/lib/esm/view/expenseAutomationView/selectors/reconciliationViewSelector.js +136 -9
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +15 -5
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +24 -1
- package/lib/esm/view/financeStatement/financeStatementSelector.js +12 -1
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +47 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +30 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +1 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +113 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +65 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +1 -0
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewState.js +1 -0
- package/lib/esm/view/reportsResync/reportsClassViewRefetchingEpic.js +4 -0
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +26 -0
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +199 -0
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +52 -0
- package/lib/esm/view/spendManagement/autotransferRules/autoTransferRulesState.js +1 -0
- package/lib/esm/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +100 -0
- package/lib/esm/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +48 -0
- package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +36 -0
- package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +45 -0
- package/lib/esm/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +50 -0
- package/lib/esm/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +69 -0
- package/lib/esm/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +5 -5
- package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
- package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
- package/lib/esm/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
- package/lib/esm/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +7 -4
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
- package/lib/esm/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
- package/lib/esm/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/esm/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +9 -2
- package/lib/esm/view/twoFactorAuthentication/resendOtpEpic.js +16 -2
- package/lib/index.d.ts +49 -26
- package/lib/index.js +107 -39
- package/lib/reducer.d.ts +20 -2
- package/lib/reducer.js +20 -2
- package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +33 -0
- package/lib/view/aiAccountantView/aiAccountantViewPayload.js +8 -0
- package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +29 -0
- package/lib/view/aiAccountantView/aiAccountantViewReducer.js +156 -0
- package/lib/view/aiAccountantView/aiAccountantViewSelector.d.ts +16 -0
- package/lib/view/aiAccountantView/aiAccountantViewSelector.js +83 -0
- package/lib/view/aiAccountantView/aiAccountantViewState.d.ts +26 -0
- package/lib/view/aiAccountantView/aiAccountantViewState.js +13 -0
- package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.d.ts +33 -0
- package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +50 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.d.ts +23 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +31 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.d.ts +33 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +51 -0
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.d.ts +28 -0
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +80 -0
- package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +7 -0
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +15 -1
- package/lib/view/aiCfoView/aiCfoViewReducer.js +83 -2
- package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
- package/lib/view/aiCfoView/aiCfoViewSelector.js +9 -2
- package/lib/view/aiCfoView/aiCfoViewState.d.ts +15 -1
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +33 -0
- package/lib/view/auditReportView/auditReportViewState.d.ts +2 -2
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +2 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +2 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.d.ts +1 -1
- package/lib/view/classList/fetchClassListEpic.js +8 -1
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -0
- package/lib/view/commonVendorView/vendorView/vendorViewSelector.js +18 -5
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +1 -0
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +6 -2
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.js +20 -2
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.d.ts +4 -1
- package/lib/view/companyTaskManagerView/companyTaskManagerViewSelector.js +3 -1
- package/lib/view/companyTaskManagerView/companyTaskManagerViewState.d.ts +9 -1
- package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.d.ts +7 -0
- package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +21 -0
- package/lib/view/companyView/companyViewReducer.d.ts +6 -1
- package/lib/view/companyView/companyViewReducer.js +28 -2
- package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.d.ts +10 -0
- package/lib/view/companyView/epic/companyPassport/updateAccountingClassesEnabledEpic.js +65 -0
- package/lib/view/companyView/types/cockpitTypes.d.ts +6 -5
- package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +1 -0
- package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +4 -0
- package/lib/view/creditAgentView/creditAgentViewPayload.d.ts +0 -36
- package/lib/view/creditAgentView/creditAgentViewReducer.d.ts +2 -2
- package/lib/view/creditAgentView/creditAgentViewReducer.js +2 -40
- package/lib/view/creditAgentView/creditAgentViewSelector.d.ts +0 -1
- package/lib/view/creditAgentView/creditAgentViewSelector.js +1 -2
- package/lib/view/creditAgentView/creditAgentViewState.d.ts +0 -31
- package/lib/view/creditAgentView/creditAgentViewState.js +0 -6
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/excludeAccountFromReconciliationEpic.js +67 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/fetchReconciliationViewEpic.js +4 -9
- package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.d.ts +10 -0
- package/lib/view/expenseAutomationView/epics/accountRecon/includeAccountInReconciliationEpic.js +69 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulesEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.d.ts +13 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadMatchResultToastEpic.js +37 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +5 -3
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +20 -5
- package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.d.ts +10 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/refetchCompletedTransactionsOnBulkUploadSortEpic.js +16 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.d.ts +18 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +102 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +7 -13
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +20 -4
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +0 -1
- package/lib/view/expenseAutomationView/helpers/bulkUploadTiming.d.ts +16 -0
- package/lib/view/expenseAutomationView/helpers/bulkUploadTiming.js +19 -0
- package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.d.ts +7 -0
- package/lib/view/expenseAutomationView/helpers/rollingCalendarDateRangeInclusive.js +16 -0
- package/lib/view/expenseAutomationView/helpers/saveTransactionHelper.js +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +2 -2
- package/lib/view/expenseAutomationView/payload/jeSchedulesPayload.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +5 -0
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +10 -0
- package/lib/view/expenseAutomationView/payload/reconciliationPayload.d.ts +45 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +22 -2
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +18 -2
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +30 -7
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.d.ts +18 -4
- package/lib/view/expenseAutomationView/reducers/reconciliationViewReducer.js +168 -4
- package/lib/view/expenseAutomationView/selectorTypes/jeSchedulesSelectorTypes.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.d.ts +7 -2
- package/lib/view/expenseAutomationView/selectorTypes/reconciliationViewSelectorTypes.js +2 -2
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +10 -2
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +63 -6
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +14 -4
- package/lib/view/expenseAutomationView/selectors/reconciliationViewSelector.js +136 -9
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +13 -3
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +8 -0
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +27 -0
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +5 -1
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +14 -0
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/financeStatement/financeStatementSelector.d.ts +2 -0
- package/lib/view/financeStatement/financeStatementSelector.js +12 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +3 -0
- package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.d.ts +9 -0
- package/lib/view/profitAndLossProjectView/profitAndLossForTimeframeProjectViewEpic.js +51 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.d.ts +6 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewEpic.js +34 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.d.ts +33 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewPayload.js +2 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.d.ts +33 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +117 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.d.ts +9 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelector.js +69 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.d.ts +19 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewSelectorTypes.js +2 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.d.ts +22 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewState.js +2 -0
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsClassViewRefetchingEpic.d.ts +2 -1
- package/lib/view/reportsResync/reportsClassViewRefetchingEpic.js +4 -0
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.d.ts +75 -0
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesPayload.js +30 -0
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.d.ts +50 -0
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesReducer.js +206 -0
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.d.ts +24 -0
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesSelector.js +61 -0
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.d.ts +38 -0
- package/lib/view/spendManagement/autotransferRules/autoTransferRulesState.js +2 -0
- package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.d.ts +12 -0
- package/lib/view/spendManagement/autotransferRules/epics/createAutoTransferRuleEpic.js +106 -0
- package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.d.ts +8 -0
- package/lib/view/spendManagement/autotransferRules/epics/deleteAutoTransferRuleEpic.js +52 -0
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.d.ts +7 -0
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferReviewDetailEpic.js +40 -0
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.d.ts +7 -0
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRuleHistory.js +52 -0
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.d.ts +10 -0
- package/lib/view/spendManagement/autotransferRules/epics/fetchAutoTransferRulesEpic.js +54 -0
- package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.d.ts +8 -0
- package/lib/view/spendManagement/autotransferRules/epics/updateAutoTransferRuleEpic.js +73 -0
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.js +5 -5
- package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +2 -2
- package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +7 -3
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +13 -6
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -4
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewSelector.js +6 -3
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +4 -4
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
- package/lib/view/spendManagement/treasury/treasuryList/epics/fetchTreasuryDetailEpic.js +2 -2
- package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.d.ts +2 -1
- package/lib/view/spendManagement/treasury/treasuryList/treasuryDetailReducer.js +2 -1
- package/lib/view/subscriptionView/types/subscriptionTypes.d.ts +1 -1
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +2 -2
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +16 -14
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +1 -0
- package/lib/view/transactionDetail/transactionDetailSelector.js +9 -2
- package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +1 -1
- package/lib/view/twoFactorAuthentication/resendOtpEpic.js +15 -1
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FetchStateAndError, ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { SortOrder } from '../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
|
+
import { CockpitFilters } from '../companyView/types/cockpitTypes';
|
|
4
|
+
export type { AiAccountantCustomer, AiAccountantEnrollment, AiAccountantEnrollmentStatus, AiAccountantJob, AiAccountantJobStatus, AiAccountantOperationType, } from '../../entity/aiAccountantCustomer/aiAccountantCustomerState';
|
|
5
|
+
declare const toAiAccountantSortKeyType: (v: string) => "status" | "companyName" | "bookcloseDate" | "accuracy" | "latestTraining" | "latestSync";
|
|
6
|
+
export type AiAccountantSortKey = ReturnType<typeof toAiAccountantSortKeyType>;
|
|
7
|
+
export interface AiAccountantUIState {
|
|
8
|
+
filters: CockpitFilters;
|
|
9
|
+
filterText: string;
|
|
10
|
+
selectedCustomerTenantId: string;
|
|
11
|
+
sortKey: AiAccountantSortKey;
|
|
12
|
+
sortOrder: SortOrder;
|
|
13
|
+
}
|
|
14
|
+
export interface AiAccountantCustomerViewState {
|
|
15
|
+
cancelOnboardingStatus: FetchStateAndError;
|
|
16
|
+
jobsFetchStatus: FetchStateAndError;
|
|
17
|
+
jobsPageToken: string | null;
|
|
18
|
+
tenantId: ID;
|
|
19
|
+
}
|
|
20
|
+
export interface AiAccountantViewState {
|
|
21
|
+
customersByTenantId: Record<ID, AiAccountantCustomerViewState>;
|
|
22
|
+
customersFetchStatus: FetchStateAndError;
|
|
23
|
+
selectedTenantIdsForJobTrigger: ID[];
|
|
24
|
+
triggerJobStatus: FetchStateAndError;
|
|
25
|
+
uiState: AiAccountantUIState;
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
4
|
+
const ALL_AI_ACCOUNTANT_SORT_KEYS = [
|
|
5
|
+
'companyName',
|
|
6
|
+
'status',
|
|
7
|
+
'bookcloseDate',
|
|
8
|
+
'latestTraining',
|
|
9
|
+
'latestSync',
|
|
10
|
+
'accuracy',
|
|
11
|
+
];
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
|
+
const toAiAccountantSortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_AI_ACCOUNTANT_SORT_KEYS);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
3
|
+
import { RootState } from '../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
+
import { cancelAiAccountantOnboarding, cancelAiAccountantOnboardingFailure, cancelAiAccountantOnboardingSuccess, fetchAiAccountantCustomers } from '../aiAccountantViewReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof cancelAiAccountantOnboarding> | ReturnType<typeof cancelAiAccountantOnboardingSuccess> | ReturnType<typeof cancelAiAccountantOnboardingFailure> | ReturnType<typeof fetchAiAccountantCustomers> | ReturnType<typeof openSnackbar>;
|
|
7
|
+
export declare const cancelAiAccountantOnboardingEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
8
|
+
payload: {
|
|
9
|
+
messageSection: import("../../..").SnackbarMessageSections;
|
|
10
|
+
messageText: import("../../..").SnackbarMessageSectionTexts;
|
|
11
|
+
type: import("../../..").SnackbarMessageType;
|
|
12
|
+
showStatusIcon?: boolean;
|
|
13
|
+
variables?: {
|
|
14
|
+
variableName: string;
|
|
15
|
+
variableValue: string;
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
type: "snackbar/openSnackbar";
|
|
19
|
+
} | {
|
|
20
|
+
payload: {
|
|
21
|
+
tenantId: string;
|
|
22
|
+
};
|
|
23
|
+
type: "aiAccountantView/cancelAiAccountantOnboardingSuccess";
|
|
24
|
+
} | {
|
|
25
|
+
payload: {
|
|
26
|
+
tenantId: string;
|
|
27
|
+
error: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
28
|
+
};
|
|
29
|
+
type: "aiAccountantView/cancelAiAccountantOnboardingFailure";
|
|
30
|
+
} | {
|
|
31
|
+
payload: undefined;
|
|
32
|
+
type: "aiAccountantView/fetchAiAccountantCustomers";
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cancelAiAccountantOnboardingEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
8
|
+
const aiAccountantViewReducer_1 = require("../aiAccountantViewReducer");
|
|
9
|
+
const cancelAiAccountantOnboardingEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiAccountantViewReducer_1.cancelAiAccountantOnboarding.match), (0, operators_1.mergeMap)((action) => {
|
|
10
|
+
const { tenantId, companyId } = action.payload;
|
|
11
|
+
const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
|
|
12
|
+
const url = `${base}/ai-accountant/cancel-onboarding`;
|
|
13
|
+
return zeniAPI
|
|
14
|
+
.postAndGetJSON(url, {
|
|
15
|
+
tenant_id: tenantId,
|
|
16
|
+
company_id: companyId,
|
|
17
|
+
})
|
|
18
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
19
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
20
|
+
return (0, rxjs_1.from)([
|
|
21
|
+
(0, aiAccountantViewReducer_1.cancelAiAccountantOnboardingSuccess)(tenantId),
|
|
22
|
+
(0, aiAccountantViewReducer_1.fetchAiAccountantCustomers)(),
|
|
23
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
24
|
+
messageSection: 'common',
|
|
25
|
+
messageText: 'success',
|
|
26
|
+
type: 'success',
|
|
27
|
+
}),
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
return (0, rxjs_1.from)([
|
|
32
|
+
(0, aiAccountantViewReducer_1.cancelAiAccountantOnboardingFailure)(tenantId, response.status),
|
|
33
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
34
|
+
messageSection: 'common',
|
|
35
|
+
messageText: 'failed',
|
|
36
|
+
type: 'error',
|
|
37
|
+
}),
|
|
38
|
+
]);
|
|
39
|
+
}
|
|
40
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
41
|
+
(0, aiAccountantViewReducer_1.cancelAiAccountantOnboardingFailure)(tenantId, (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant cancel onboarding failed: ' +
|
|
42
|
+
JSON.stringify(error))),
|
|
43
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
44
|
+
messageSection: 'common',
|
|
45
|
+
messageText: 'failed',
|
|
46
|
+
type: 'error',
|
|
47
|
+
}),
|
|
48
|
+
])));
|
|
49
|
+
}));
|
|
50
|
+
exports.cancelAiAccountantOnboardingEpic = cancelAiAccountantOnboardingEpic;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { updateAiAccountantCustomers as updateAiAccountantCustomerEntities } from '../../../entity/aiAccountantCustomer/aiAccountantCustomerReducer';
|
|
3
|
+
import { updateAllUsers } from '../../../entity/user/userReducer';
|
|
4
|
+
import { RootState } from '../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
6
|
+
import { fetchAiAccountantCustomers, updateAiAccountantCustomers, updateAiAccountantCustomersFailure } from '../aiAccountantViewReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof fetchAiAccountantCustomers> | ReturnType<typeof updateAiAccountantCustomers> | ReturnType<typeof updateAiAccountantCustomersFailure> | ReturnType<typeof updateAiAccountantCustomerEntities> | ReturnType<typeof updateAllUsers>;
|
|
8
|
+
export declare const fetchAiAccountantCustomersEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
9
|
+
payload: {
|
|
10
|
+
users: import("../../..").UserPayload[];
|
|
11
|
+
updateType?: import("../../..").UpdateType;
|
|
12
|
+
};
|
|
13
|
+
type: "user/updateAllUsers";
|
|
14
|
+
} | {
|
|
15
|
+
payload: import("../aiAccountantViewPayload").AiAccountantCustomerPayload[];
|
|
16
|
+
type: "aiAccountantView/updateAiAccountantCustomers";
|
|
17
|
+
} | {
|
|
18
|
+
payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
19
|
+
type: "aiAccountantView/updateAiAccountantCustomersFailure";
|
|
20
|
+
} | {
|
|
21
|
+
payload: import("../aiAccountantViewPayload").AiAccountantCustomerPayload[];
|
|
22
|
+
type: "aiAccountantCustomer/updateAiAccountantCustomers";
|
|
23
|
+
}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchAiAccountantCustomersEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const aiAccountantCustomerReducer_1 = require("../../../entity/aiAccountantCustomer/aiAccountantCustomerReducer");
|
|
7
|
+
const userReducer_1 = require("../../../entity/user/userReducer");
|
|
8
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
9
|
+
const aiAccountantViewReducer_1 = require("../aiAccountantViewReducer");
|
|
10
|
+
const fetchAiAccountantCustomersEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiAccountantViewReducer_1.fetchAiAccountantCustomers.match), (0, operators_1.switchMap)(() => {
|
|
11
|
+
const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
|
|
12
|
+
const url = `${base}/ai-accountant/customers`;
|
|
13
|
+
return zeniAPI
|
|
14
|
+
.getJSON(url)
|
|
15
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
16
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
17
|
+
const customers = response.data?.customers ?? [];
|
|
18
|
+
const users = response.data?.users ?? [];
|
|
19
|
+
return (0, rxjs_1.from)([
|
|
20
|
+
(0, aiAccountantCustomerReducer_1.updateAiAccountantCustomers)(customers),
|
|
21
|
+
(0, userReducer_1.updateAllUsers)({ users }),
|
|
22
|
+
(0, aiAccountantViewReducer_1.updateAiAccountantCustomers)(customers),
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantCustomersFailure)(response.status));
|
|
27
|
+
}
|
|
28
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantCustomersFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant customers fetch failed: ' +
|
|
29
|
+
JSON.stringify(error))))));
|
|
30
|
+
}));
|
|
31
|
+
exports.fetchAiAccountantCustomersEpic = fetchAiAccountantCustomersEpic;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { updateAiAccountantJobs as updateAiAccountantJobEntities } from '../../../entity/aiAccountantCustomer/aiAccountantCustomerReducer';
|
|
3
|
+
import { updateAllUsers } from '../../../entity/user/userReducer';
|
|
4
|
+
import { RootState } from '../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
6
|
+
import { fetchAiAccountantJobs, updateAiAccountantJobs, updateAiAccountantJobsFailure } from '../aiAccountantViewReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof fetchAiAccountantJobs> | ReturnType<typeof updateAiAccountantJobs> | ReturnType<typeof updateAiAccountantJobEntities> | ReturnType<typeof updateAiAccountantJobsFailure> | ReturnType<typeof updateAllUsers>;
|
|
8
|
+
export declare const fetchAiAccountantJobsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
9
|
+
payload: {
|
|
10
|
+
users: import("../../..").UserPayload[];
|
|
11
|
+
updateType?: import("../../..").UpdateType;
|
|
12
|
+
};
|
|
13
|
+
type: "user/updateAllUsers";
|
|
14
|
+
} | {
|
|
15
|
+
payload: {
|
|
16
|
+
tenantId: string;
|
|
17
|
+
nextPageToken: string | null;
|
|
18
|
+
};
|
|
19
|
+
type: "aiAccountantView/updateAiAccountantJobs";
|
|
20
|
+
} | {
|
|
21
|
+
payload: {
|
|
22
|
+
tenantId: string;
|
|
23
|
+
jobs: import("../aiAccountantViewPayload").AiAccountantJobPayload[];
|
|
24
|
+
append: boolean;
|
|
25
|
+
};
|
|
26
|
+
type: "aiAccountantCustomer/updateAiAccountantJobs";
|
|
27
|
+
} | {
|
|
28
|
+
payload: {
|
|
29
|
+
error: import("../../../responsePayload").ZeniAPIStatus;
|
|
30
|
+
tenantId: import("../../..").ID;
|
|
31
|
+
};
|
|
32
|
+
type: "aiAccountantView/updateAiAccountantJobsFailure";
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchAiAccountantJobsEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const aiAccountantCustomerReducer_1 = require("../../../entity/aiAccountantCustomer/aiAccountantCustomerReducer");
|
|
7
|
+
const userReducer_1 = require("../../../entity/user/userReducer");
|
|
8
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
9
|
+
const aiAccountantViewReducer_1 = require("../aiAccountantViewReducer");
|
|
10
|
+
const fetchAiAccountantJobsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiAccountantViewReducer_1.fetchAiAccountantJobs.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
+
const { tenantId, fetchNextPage } = action.payload;
|
|
12
|
+
const rootState = state$.value;
|
|
13
|
+
const customerView = rootState.aiAccountantViewState.customersByTenantId[tenantId];
|
|
14
|
+
const pageToken = fetchNextPage && customerView?.jobsPageToken != null
|
|
15
|
+
? customerView.jobsPageToken
|
|
16
|
+
: null;
|
|
17
|
+
const params = new URLSearchParams({
|
|
18
|
+
page_size: '50',
|
|
19
|
+
tenant_id: tenantId,
|
|
20
|
+
});
|
|
21
|
+
if (pageToken != null) {
|
|
22
|
+
params.set('page_token', pageToken);
|
|
23
|
+
}
|
|
24
|
+
const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
|
|
25
|
+
const url = `${base}/ai-accountant/jobs?${params.toString()}`;
|
|
26
|
+
return zeniAPI
|
|
27
|
+
.getJSON(url)
|
|
28
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
29
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
30
|
+
const jobs = response.data?.jobs ?? [];
|
|
31
|
+
const users = response.data?.users ?? [];
|
|
32
|
+
const nextPageToken = response.data?.next_page_token ?? null;
|
|
33
|
+
return (0, rxjs_1.from)([
|
|
34
|
+
(0, userReducer_1.updateAllUsers)({ users }),
|
|
35
|
+
(0, aiAccountantCustomerReducer_1.updateAiAccountantJobs)(tenantId, jobs, fetchNextPage),
|
|
36
|
+
(0, aiAccountantViewReducer_1.updateAiAccountantJobs)(tenantId, nextPageToken),
|
|
37
|
+
]);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantJobsFailure)({
|
|
41
|
+
tenantId,
|
|
42
|
+
error: response.status,
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiAccountantViewReducer_1.updateAiAccountantJobsFailure)({
|
|
46
|
+
tenantId,
|
|
47
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant jobs fetch failed: ' +
|
|
48
|
+
JSON.stringify(error)),
|
|
49
|
+
}))));
|
|
50
|
+
}));
|
|
51
|
+
exports.fetchAiAccountantJobsEpic = fetchAiAccountantJobsEpic;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
3
|
+
import { RootState } from '../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
+
import { fetchAiAccountantCustomers, triggerAiAccountantJob, triggerAiAccountantJobFailure, triggerAiAccountantJobSuccess } from '../aiAccountantViewReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof triggerAiAccountantJob> | ReturnType<typeof triggerAiAccountantJobSuccess> | ReturnType<typeof triggerAiAccountantJobFailure> | ReturnType<typeof fetchAiAccountantCustomers> | ReturnType<typeof openSnackbar>;
|
|
7
|
+
export declare const triggerAiAccountantJobEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
8
|
+
payload: {
|
|
9
|
+
messageSection: import("../../..").SnackbarMessageSections;
|
|
10
|
+
messageText: import("../../..").SnackbarMessageSectionTexts;
|
|
11
|
+
type: import("../../..").SnackbarMessageType;
|
|
12
|
+
showStatusIcon?: boolean;
|
|
13
|
+
variables?: {
|
|
14
|
+
variableName: string;
|
|
15
|
+
variableValue: string;
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
type: "snackbar/openSnackbar";
|
|
19
|
+
} | {
|
|
20
|
+
payload: undefined;
|
|
21
|
+
type: "aiAccountantView/fetchAiAccountantCustomers";
|
|
22
|
+
} | {
|
|
23
|
+
payload: undefined;
|
|
24
|
+
type: "aiAccountantView/triggerAiAccountantJobSuccess";
|
|
25
|
+
} | {
|
|
26
|
+
payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
27
|
+
type: "aiAccountantView/triggerAiAccountantJobFailure";
|
|
28
|
+
}>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.triggerAiAccountantJobEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
8
|
+
const aiAccountantViewReducer_1 = require("../aiAccountantViewReducer");
|
|
9
|
+
const triggerAiAccountantJobEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiAccountantViewReducer_1.triggerAiAccountantJob.match), (0, operators_1.mergeMap)((action) => {
|
|
10
|
+
const { operationType, startDate, endDate } = action.payload;
|
|
11
|
+
const rootState = state$.value;
|
|
12
|
+
const selectedTenantIds = rootState.aiAccountantViewState.selectedTenantIdsForJobTrigger;
|
|
13
|
+
const base = `${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/cockpit-panels`;
|
|
14
|
+
const url = `${base}/ai-accountant/jobs`;
|
|
15
|
+
const params = operationType === 'offboard'
|
|
16
|
+
? {}
|
|
17
|
+
: { start_date: startDate, end_date: endDate };
|
|
18
|
+
return zeniAPI
|
|
19
|
+
.postAndGetJSON(url, {
|
|
20
|
+
tenant_ids: selectedTenantIds,
|
|
21
|
+
operation_type: operationType,
|
|
22
|
+
params,
|
|
23
|
+
})
|
|
24
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
25
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
26
|
+
return (0, rxjs_1.from)([
|
|
27
|
+
(0, aiAccountantViewReducer_1.triggerAiAccountantJobSuccess)(),
|
|
28
|
+
(0, aiAccountantViewReducer_1.fetchAiAccountantCustomers)(),
|
|
29
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
30
|
+
messageSection: 'ai_accountant_trigger_job',
|
|
31
|
+
messageText: 'success',
|
|
32
|
+
type: 'success',
|
|
33
|
+
}),
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
const reason = resolveTriggerFailureReason(response);
|
|
38
|
+
return (0, rxjs_1.from)([
|
|
39
|
+
(0, aiAccountantViewReducer_1.triggerAiAccountantJobFailure)(response.status),
|
|
40
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
41
|
+
messageSection: 'ai_accountant_trigger_job',
|
|
42
|
+
messageText: 'failed',
|
|
43
|
+
type: 'error',
|
|
44
|
+
variables: [
|
|
45
|
+
{ variableName: '__reason__', variableValue: reason },
|
|
46
|
+
],
|
|
47
|
+
}),
|
|
48
|
+
]);
|
|
49
|
+
}
|
|
50
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
51
|
+
(0, aiAccountantViewReducer_1.triggerAiAccountantJobFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'AI Accountant trigger job failed: ' + JSON.stringify(error))),
|
|
52
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
53
|
+
messageSection: 'ai_accountant_trigger_job',
|
|
54
|
+
messageText: 'failed',
|
|
55
|
+
type: 'error',
|
|
56
|
+
variables: [
|
|
57
|
+
{ variableName: '__reason__', variableValue: 'Unexpected error' },
|
|
58
|
+
],
|
|
59
|
+
}),
|
|
60
|
+
])));
|
|
61
|
+
}));
|
|
62
|
+
exports.triggerAiAccountantJobEpic = triggerAiAccountantJobEpic;
|
|
63
|
+
/**
|
|
64
|
+
* Pick the most useful failure reason from the trigger response:
|
|
65
|
+
* prefer the first `skipped[].reason`, then `data.error`, then the
|
|
66
|
+
* status message. Falls back to empty so the snackbar template can
|
|
67
|
+
* still render.
|
|
68
|
+
*/
|
|
69
|
+
const resolveTriggerFailureReason = (response) => {
|
|
70
|
+
if (response.data?.skipped != null && response.data.skipped.length > 0) {
|
|
71
|
+
return response.data.skipped[0].reason;
|
|
72
|
+
}
|
|
73
|
+
if (response.data?.error != null && response.data.error.length > 0) {
|
|
74
|
+
return response.data.error;
|
|
75
|
+
}
|
|
76
|
+
if (response.status.message.length > 0) {
|
|
77
|
+
return response.status.message;
|
|
78
|
+
}
|
|
79
|
+
return '';
|
|
80
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AiCfoSuggestedQuestionsPageContext } from '../../common/aiCfo/aiCfoSuggestedQuestionsPageContext';
|
|
1
2
|
import { AiCfoAnswerPayload, ChatSessionPayload } from '../../entity/aiCfo/aiCfoPayload';
|
|
2
3
|
import { UserRolePayload } from '../../entity/userRole/userRolePayload';
|
|
3
4
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
@@ -23,4 +24,10 @@ interface AcceptMasterTOSPayload {
|
|
|
23
24
|
user_roles: UserRolePayload[];
|
|
24
25
|
}
|
|
25
26
|
export type AcceptMasterTOSResponse = ZeniAPIResponse<AcceptMasterTOSPayload>;
|
|
27
|
+
export interface SuggestedQuestionsDataPayload {
|
|
28
|
+
generated_at: string;
|
|
29
|
+
page_context: AiCfoSuggestedQuestionsPageContext;
|
|
30
|
+
suggested_questions: string[];
|
|
31
|
+
}
|
|
32
|
+
export type FetchSuggestedQuestionsResponse = ZeniAPIResponse<SuggestedQuestionsDataPayload>;
|
|
26
33
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AiCfoSuggestedQuestionsPageContext } from '../../common/aiCfo/aiCfoSuggestedQuestionsPageContext';
|
|
1
2
|
import { FetchStateAndError, ID } from '../../commonStateTypes/common';
|
|
2
3
|
import { PageToken } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
4
|
import { ChatSessionPayload } from '../../entity/aiCfo/aiCfoPayload';
|
|
@@ -89,6 +90,19 @@ export declare const submitQuestion: import("@reduxjs/toolkit").ActionCreatorWit
|
|
|
89
90
|
}, "aiCfoView/clearDeleteChatSessionStatus">, clearAiCfoView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"aiCfoView/clearAiCfoView">, updateCotCollapsedState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
90
91
|
isCollapsed: boolean;
|
|
91
92
|
questionAnswerId: ID;
|
|
92
|
-
}, "aiCfoView/updateCotCollapsedState"
|
|
93
|
+
}, "aiCfoView/updateCotCollapsedState">, fetchSuggestedQuestions: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
94
|
+
pageContext: AiCfoSuggestedQuestionsPageContext;
|
|
95
|
+
}, "aiCfoView/fetchSuggestedQuestions">, fetchSuggestedQuestionsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
96
|
+
generatedAt: string;
|
|
97
|
+
pageContext: AiCfoSuggestedQuestionsPageContext;
|
|
98
|
+
suggestedQuestions: string[];
|
|
99
|
+
}, "aiCfoView/fetchSuggestedQuestionsSuccess">, fetchSuggestedQuestionsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
100
|
+
error: ZeniAPIStatus;
|
|
101
|
+
pageContext: AiCfoSuggestedQuestionsPageContext;
|
|
102
|
+
}, "aiCfoView/fetchSuggestedQuestionsFailure">, applyAiCfoSidePanelHostPageTransition: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
103
|
+
newAiCfoSidePanelHostPageKey: string;
|
|
104
|
+
/** When omitted or null, clears the active session (empty / suggested questions). */
|
|
105
|
+
nextCurrentChatSessionId?: ID | null;
|
|
106
|
+
}, "aiCfoView/applyAiCfoSidePanelHostPageTransition">, clearAiCfoSidePanelHostPageContext: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"aiCfoView/clearAiCfoSidePanelHostPageContext">;
|
|
93
107
|
declare const _default: import("redux").Reducer<AiCfoViewState>;
|
|
94
108
|
export default _default;
|
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.updateCotCollapsedState = exports.clearAiCfoView = exports.clearDeleteChatSessionStatus = exports.deleteChatSessionFailure = exports.deleteChatSessionSuccess = exports.deleteChatSession = exports.acceptMasterTOSFailure = exports.acceptMasterTOSSuccess = exports.acceptMasterTOS = exports.stopSubmitQuestionFailure = exports.stopSubmitQuestionSuccess = exports.stopSubmitQuestion = exports.stopSubmitFailure = exports.stopSubmitSuccess = exports.stopSubmit = exports.clearLastContextMessage = exports.clearCurrentSessionId = exports.fetchChatHistoryFailure = exports.fetchChatHistorySuccess = exports.fetchChatHistory = exports.fetchChatSessionsForUserFailure = exports.fetchChatSessionsForUserSuccess = exports.fetchChatSessionsForUser = exports.createSessionAndSubmitFailure = exports.createSessionAndSubmitSuccess = exports.initializeNewSessionState = exports.createSessionAndSubmit = exports.createSessionFailure = exports.createSessionSuccess = exports.createSession = exports.setSession = exports.clearInput = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.updateResponseState = exports.submitQuestionFailure = exports.submitQuestionSuccess = exports.submitQuestion = exports.initialAiCfoViewState = void 0;
|
|
4
|
+
exports.clearAiCfoSidePanelHostPageContext = exports.applyAiCfoSidePanelHostPageTransition = exports.fetchSuggestedQuestionsFailure = exports.fetchSuggestedQuestionsSuccess = exports.fetchSuggestedQuestions = exports.updateCotCollapsedState = exports.clearAiCfoView = exports.clearDeleteChatSessionStatus = exports.deleteChatSessionFailure = exports.deleteChatSessionSuccess = exports.deleteChatSession = exports.acceptMasterTOSFailure = exports.acceptMasterTOSSuccess = exports.acceptMasterTOS = exports.stopSubmitQuestionFailure = exports.stopSubmitQuestionSuccess = exports.stopSubmitQuestion = exports.stopSubmitFailure = exports.stopSubmitSuccess = exports.stopSubmit = exports.clearLastContextMessage = exports.clearCurrentSessionId = exports.fetchChatHistoryFailure = exports.fetchChatHistorySuccess = exports.fetchChatHistory = exports.fetchChatSessionsForUserFailure = exports.fetchChatSessionsForUserSuccess = exports.fetchChatSessionsForUser = exports.createSessionAndSubmitFailure = exports.createSessionAndSubmitSuccess = exports.initializeNewSessionState = exports.createSessionAndSubmit = exports.createSessionFailure = exports.createSessionSuccess = exports.createSession = exports.setSession = exports.clearInput = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.updateResponseState = exports.submitQuestionFailure = exports.submitQuestionSuccess = exports.submitQuestion = exports.initialAiCfoViewState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
function removeSessionIdFromPageKeyMap(draft, sessionId) {
|
|
7
|
+
const map = draft.uiState.chatSessionIdByPageKey;
|
|
8
|
+
for (const key of Object.keys(map)) {
|
|
9
|
+
if (map[key] === sessionId) {
|
|
10
|
+
delete map[key];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function mirrorCurrentSessionToPageKeyMapIfActive(draft) {
|
|
15
|
+
const key = draft.uiState.aiCfoSidePanelHostPageKey;
|
|
16
|
+
const sessionId = draft.uiState.currentChatSessionId;
|
|
17
|
+
if (key != null && sessionId != null) {
|
|
18
|
+
draft.uiState.chatSessionIdByPageKey[key] = sessionId;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
6
21
|
exports.initialAiCfoViewState = {
|
|
7
22
|
fetchState: 'Not-Started',
|
|
8
23
|
error: undefined,
|
|
@@ -10,6 +25,8 @@ exports.initialAiCfoViewState = {
|
|
|
10
25
|
currentInput: '',
|
|
11
26
|
scrollPositionByChatSessionId: {},
|
|
12
27
|
currentChatSessionId: undefined,
|
|
28
|
+
aiCfoSidePanelHostPageKey: undefined,
|
|
29
|
+
chatSessionIdByPageKey: {},
|
|
13
30
|
agentId: undefined,
|
|
14
31
|
chatHistoryNextPageToken: {},
|
|
15
32
|
chatSessionsNextPageToken: { nextPageToken: null, hasMore: false },
|
|
@@ -33,6 +50,7 @@ exports.initialAiCfoViewState = {
|
|
|
33
50
|
fetchChatSessionHistoryByChatSessionId: {},
|
|
34
51
|
responseStateByChatSessionId: {},
|
|
35
52
|
stopSubmitStateByChatSessionId: {},
|
|
53
|
+
suggestedQuestionsByPageContext: {},
|
|
36
54
|
};
|
|
37
55
|
const aiCfoView = (0, toolkit_1.createSlice)({
|
|
38
56
|
name: 'aiCfoView',
|
|
@@ -166,6 +184,7 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
166
184
|
setSession(draft, action) {
|
|
167
185
|
draft.uiState.currentChatSessionId = action.payload.sessionId;
|
|
168
186
|
draft.uiState.agentId = action.payload.agentId;
|
|
187
|
+
mirrorCurrentSessionToPageKeyMapIfActive(draft);
|
|
169
188
|
},
|
|
170
189
|
createSession: {
|
|
171
190
|
reducer(draft, action) {
|
|
@@ -189,6 +208,7 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
189
208
|
nextPageToken: null,
|
|
190
209
|
hasMore: false,
|
|
191
210
|
};
|
|
211
|
+
mirrorCurrentSessionToPageKeyMapIfActive(draft);
|
|
192
212
|
},
|
|
193
213
|
createSessionFailure(draft, action) {
|
|
194
214
|
draft.createSessionState.fetchState = 'Error';
|
|
@@ -226,6 +246,7 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
226
246
|
nextPageToken: null,
|
|
227
247
|
hasMore: false,
|
|
228
248
|
};
|
|
249
|
+
mirrorCurrentSessionToPageKeyMapIfActive(draft);
|
|
229
250
|
},
|
|
230
251
|
createSessionAndSubmitSuccess(draft) {
|
|
231
252
|
// Note: currentChatSessionId, agentId, and chatHistoryNextPageToken are set by initializeNewSessionState
|
|
@@ -342,6 +363,7 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
342
363
|
draft.uiState.currentChatSessionId = undefined;
|
|
343
364
|
draft.uiState.agentId = undefined;
|
|
344
365
|
}
|
|
366
|
+
removeSessionIdFromPageKeyMap(draft, chatSessionId);
|
|
345
367
|
delete draft.uiState.chatHistoryNextPageToken[chatSessionId];
|
|
346
368
|
delete draft.uiState.scrollPositionByChatSessionId[chatSessionId];
|
|
347
369
|
delete draft.fetchChatSessionHistoryByChatSessionId[chatSessionId];
|
|
@@ -364,6 +386,65 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
364
386
|
},
|
|
365
387
|
clearCurrentSessionId(draft) {
|
|
366
388
|
draft.uiState.currentChatSessionId = undefined;
|
|
389
|
+
const key = draft.uiState.aiCfoSidePanelHostPageKey;
|
|
390
|
+
if (key != null) {
|
|
391
|
+
delete draft.uiState.chatSessionIdByPageKey[key];
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
applyAiCfoSidePanelHostPageTransition(draft, action) {
|
|
395
|
+
const { newAiCfoSidePanelHostPageKey, nextCurrentChatSessionId } = action.payload;
|
|
396
|
+
const prevKey = draft.uiState.aiCfoSidePanelHostPageKey;
|
|
397
|
+
const curId = draft.uiState.currentChatSessionId;
|
|
398
|
+
if (prevKey != null &&
|
|
399
|
+
prevKey !== newAiCfoSidePanelHostPageKey &&
|
|
400
|
+
curId != null) {
|
|
401
|
+
draft.uiState.chatSessionIdByPageKey[prevKey] = curId;
|
|
402
|
+
}
|
|
403
|
+
draft.uiState.aiCfoSidePanelHostPageKey = newAiCfoSidePanelHostPageKey;
|
|
404
|
+
draft.uiState.currentChatSessionId =
|
|
405
|
+
nextCurrentChatSessionId != null ? nextCurrentChatSessionId : undefined;
|
|
406
|
+
draft.uiState.currentInput = '';
|
|
407
|
+
mirrorCurrentSessionToPageKeyMapIfActive(draft);
|
|
408
|
+
},
|
|
409
|
+
clearAiCfoSidePanelHostPageContext(draft) {
|
|
410
|
+
const key = draft.uiState.aiCfoSidePanelHostPageKey;
|
|
411
|
+
const curId = draft.uiState.currentChatSessionId;
|
|
412
|
+
if (key != null && curId != null) {
|
|
413
|
+
draft.uiState.chatSessionIdByPageKey[key] = curId;
|
|
414
|
+
}
|
|
415
|
+
draft.uiState.aiCfoSidePanelHostPageKey = undefined;
|
|
416
|
+
},
|
|
417
|
+
fetchSuggestedQuestions(draft, action) {
|
|
418
|
+
const { pageContext } = action.payload;
|
|
419
|
+
const prev = draft.suggestedQuestionsByPageContext[pageContext];
|
|
420
|
+
draft.suggestedQuestionsByPageContext[pageContext] = {
|
|
421
|
+
fetchState: 'In-Progress',
|
|
422
|
+
pageContext,
|
|
423
|
+
suggestedQuestions: prev?.suggestedQuestions ?? [],
|
|
424
|
+
generatedAt: prev?.generatedAt,
|
|
425
|
+
error: undefined,
|
|
426
|
+
};
|
|
427
|
+
},
|
|
428
|
+
fetchSuggestedQuestionsSuccess(draft, action) {
|
|
429
|
+
const { pageContext, generatedAt, suggestedQuestions } = action.payload;
|
|
430
|
+
draft.suggestedQuestionsByPageContext[pageContext] = {
|
|
431
|
+
fetchState: 'Completed',
|
|
432
|
+
pageContext,
|
|
433
|
+
generatedAt,
|
|
434
|
+
suggestedQuestions,
|
|
435
|
+
error: undefined,
|
|
436
|
+
};
|
|
437
|
+
},
|
|
438
|
+
fetchSuggestedQuestionsFailure(draft, action) {
|
|
439
|
+
const { pageContext, error } = action.payload;
|
|
440
|
+
const prev = draft.suggestedQuestionsByPageContext[pageContext];
|
|
441
|
+
draft.suggestedQuestionsByPageContext[pageContext] = {
|
|
442
|
+
fetchState: 'Error',
|
|
443
|
+
pageContext,
|
|
444
|
+
suggestedQuestions: prev?.suggestedQuestions ?? [],
|
|
445
|
+
generatedAt: prev?.generatedAt,
|
|
446
|
+
error,
|
|
447
|
+
};
|
|
367
448
|
},
|
|
368
449
|
clearAiCfoView(draft) {
|
|
369
450
|
Object.assign(draft, exports.initialAiCfoViewState);
|
|
@@ -375,5 +456,5 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
375
456
|
},
|
|
376
457
|
},
|
|
377
458
|
});
|
|
378
|
-
_a = aiCfoView.actions, exports.submitQuestion = _a.submitQuestion, exports.submitQuestionSuccess = _a.submitQuestionSuccess, exports.submitQuestionFailure = _a.submitQuestionFailure, exports.updateResponseState = _a.updateResponseState, exports.updateAiCfoViewScrollPosition = _a.updateAiCfoViewScrollPosition, exports.updateCurrentInput = _a.updateCurrentInput, exports.clearInput = _a.clearInput, exports.setSession = _a.setSession, exports.createSession = _a.createSession, exports.createSessionSuccess = _a.createSessionSuccess, exports.createSessionFailure = _a.createSessionFailure, exports.createSessionAndSubmit = _a.createSessionAndSubmit, exports.initializeNewSessionState = _a.initializeNewSessionState, exports.createSessionAndSubmitSuccess = _a.createSessionAndSubmitSuccess, exports.createSessionAndSubmitFailure = _a.createSessionAndSubmitFailure, exports.fetchChatSessionsForUser = _a.fetchChatSessionsForUser, exports.fetchChatSessionsForUserSuccess = _a.fetchChatSessionsForUserSuccess, exports.fetchChatSessionsForUserFailure = _a.fetchChatSessionsForUserFailure, exports.fetchChatHistory = _a.fetchChatHistory, exports.fetchChatHistorySuccess = _a.fetchChatHistorySuccess, exports.fetchChatHistoryFailure = _a.fetchChatHistoryFailure, exports.clearCurrentSessionId = _a.clearCurrentSessionId, exports.clearLastContextMessage = _a.clearLastContextMessage, exports.stopSubmit = _a.stopSubmit, exports.stopSubmitSuccess = _a.stopSubmitSuccess, exports.stopSubmitFailure = _a.stopSubmitFailure, exports.stopSubmitQuestion = _a.stopSubmitQuestion, exports.stopSubmitQuestionSuccess = _a.stopSubmitQuestionSuccess, exports.stopSubmitQuestionFailure = _a.stopSubmitQuestionFailure, exports.acceptMasterTOS = _a.acceptMasterTOS, exports.acceptMasterTOSSuccess = _a.acceptMasterTOSSuccess, exports.acceptMasterTOSFailure = _a.acceptMasterTOSFailure, exports.deleteChatSession = _a.deleteChatSession, exports.deleteChatSessionSuccess = _a.deleteChatSessionSuccess, exports.deleteChatSessionFailure = _a.deleteChatSessionFailure, exports.clearDeleteChatSessionStatus = _a.clearDeleteChatSessionStatus, exports.clearAiCfoView = _a.clearAiCfoView, exports.updateCotCollapsedState = _a.updateCotCollapsedState;
|
|
459
|
+
_a = aiCfoView.actions, exports.submitQuestion = _a.submitQuestion, exports.submitQuestionSuccess = _a.submitQuestionSuccess, exports.submitQuestionFailure = _a.submitQuestionFailure, exports.updateResponseState = _a.updateResponseState, exports.updateAiCfoViewScrollPosition = _a.updateAiCfoViewScrollPosition, exports.updateCurrentInput = _a.updateCurrentInput, exports.clearInput = _a.clearInput, exports.setSession = _a.setSession, exports.createSession = _a.createSession, exports.createSessionSuccess = _a.createSessionSuccess, exports.createSessionFailure = _a.createSessionFailure, exports.createSessionAndSubmit = _a.createSessionAndSubmit, exports.initializeNewSessionState = _a.initializeNewSessionState, exports.createSessionAndSubmitSuccess = _a.createSessionAndSubmitSuccess, exports.createSessionAndSubmitFailure = _a.createSessionAndSubmitFailure, exports.fetchChatSessionsForUser = _a.fetchChatSessionsForUser, exports.fetchChatSessionsForUserSuccess = _a.fetchChatSessionsForUserSuccess, exports.fetchChatSessionsForUserFailure = _a.fetchChatSessionsForUserFailure, exports.fetchChatHistory = _a.fetchChatHistory, exports.fetchChatHistorySuccess = _a.fetchChatHistorySuccess, exports.fetchChatHistoryFailure = _a.fetchChatHistoryFailure, exports.clearCurrentSessionId = _a.clearCurrentSessionId, exports.clearLastContextMessage = _a.clearLastContextMessage, exports.stopSubmit = _a.stopSubmit, exports.stopSubmitSuccess = _a.stopSubmitSuccess, exports.stopSubmitFailure = _a.stopSubmitFailure, exports.stopSubmitQuestion = _a.stopSubmitQuestion, exports.stopSubmitQuestionSuccess = _a.stopSubmitQuestionSuccess, exports.stopSubmitQuestionFailure = _a.stopSubmitQuestionFailure, exports.acceptMasterTOS = _a.acceptMasterTOS, exports.acceptMasterTOSSuccess = _a.acceptMasterTOSSuccess, exports.acceptMasterTOSFailure = _a.acceptMasterTOSFailure, exports.deleteChatSession = _a.deleteChatSession, exports.deleteChatSessionSuccess = _a.deleteChatSessionSuccess, exports.deleteChatSessionFailure = _a.deleteChatSessionFailure, exports.clearDeleteChatSessionStatus = _a.clearDeleteChatSessionStatus, exports.clearAiCfoView = _a.clearAiCfoView, exports.updateCotCollapsedState = _a.updateCotCollapsedState, exports.fetchSuggestedQuestions = _a.fetchSuggestedQuestions, exports.fetchSuggestedQuestionsSuccess = _a.fetchSuggestedQuestionsSuccess, exports.fetchSuggestedQuestionsFailure = _a.fetchSuggestedQuestionsFailure, exports.applyAiCfoSidePanelHostPageTransition = _a.applyAiCfoSidePanelHostPageTransition, exports.clearAiCfoSidePanelHostPageContext = _a.clearAiCfoSidePanelHostPageContext;
|
|
379
460
|
exports.default = aiCfoView.reducer;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { AiCfoSuggestedQuestionsPageContext } from '../../common/aiCfo/aiCfoSuggestedQuestionsPageContext';
|
|
1
2
|
import { ID } from '../../commonStateTypes/common';
|
|
2
3
|
import { FetchStateAndError } from '../../commonStateTypes/common';
|
|
3
4
|
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
5
|
import { AiCfoSelectorView } from '../../entity/aiCfo/aiCfoSelector';
|
|
5
6
|
import { RootState } from '../../reducer';
|
|
6
|
-
import { AiCfoViewUIState } from './aiCfoViewState';
|
|
7
|
+
import { AiCfoViewUIState, SuggestedQuestionsForPageContext } from './aiCfoViewState';
|
|
7
8
|
export interface AiCfoViewSelector extends SelectorView, AiCfoSelectorView {
|
|
8
9
|
createSessionAndSubmitState: FetchStateAndError;
|
|
9
10
|
createSessionState: FetchStateAndError;
|
|
@@ -17,6 +18,8 @@ export interface AiCfoViewSelector extends SelectorView, AiCfoSelectorView {
|
|
|
17
18
|
thought: FetchStateAndError;
|
|
18
19
|
}>;
|
|
19
20
|
stopSubmitStateByChatSessionId: Record<ID, FetchStateAndError>;
|
|
21
|
+
suggestedQuestionsByPageContext: Partial<Record<AiCfoSuggestedQuestionsPageContext, SuggestedQuestionsForPageContext>>;
|
|
20
22
|
uiState: AiCfoViewUIState;
|
|
21
23
|
}
|
|
22
24
|
export declare const getAiCfoView: (state: RootState) => AiCfoViewSelector;
|
|
25
|
+
export declare function getSuggestedQuestionsForPageContext(state: RootState, pageContext: AiCfoSuggestedQuestionsPageContext): SuggestedQuestionsForPageContext | undefined;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAiCfoView = void 0;
|
|
4
|
+
exports.getSuggestedQuestionsForPageContext = getSuggestedQuestionsForPageContext;
|
|
5
|
+
const aiCfoReducer_1 = require("../../entity/aiCfo/aiCfoReducer");
|
|
4
6
|
const aiCfoSelector_1 = require("../../entity/aiCfo/aiCfoSelector");
|
|
7
|
+
const aiCfoViewReducer_1 = require("./aiCfoViewReducer");
|
|
5
8
|
const getAiCfoView = (state) => {
|
|
6
|
-
const { fetchState, error, uiState, createSessionState, createSessionAndSubmitState, deleteChatSessionStateByChatSessionId, stopSubmitStateByChatSessionId, responseStateByChatSessionId, fetchChatSessionHistoryByChatSessionId, masterTOSAcceptanceState, } = state.aiCfoViewState;
|
|
9
|
+
const { fetchState, error, uiState, createSessionState, createSessionAndSubmitState, deleteChatSessionStateByChatSessionId, stopSubmitStateByChatSessionId, responseStateByChatSessionId, fetchChatSessionHistoryByChatSessionId, masterTOSAcceptanceState, suggestedQuestionsByPageContext, } = state.aiCfoViewState ?? aiCfoViewReducer_1.initialAiCfoViewState;
|
|
7
10
|
return {
|
|
8
11
|
fetchState,
|
|
9
12
|
error,
|
|
@@ -15,8 +18,12 @@ const getAiCfoView = (state) => {
|
|
|
15
18
|
uiState,
|
|
16
19
|
fetchChatSessionHistoryByChatSessionId,
|
|
17
20
|
masterTOSAcceptanceState,
|
|
18
|
-
|
|
21
|
+
suggestedQuestionsByPageContext,
|
|
22
|
+
...(0, aiCfoSelector_1.getAiCfoSelectorView)(state.aiCfoState ?? aiCfoReducer_1.initialAiCfoState),
|
|
19
23
|
version: 1,
|
|
20
24
|
};
|
|
21
25
|
};
|
|
22
26
|
exports.getAiCfoView = getAiCfoView;
|
|
27
|
+
function getSuggestedQuestionsForPageContext(state, pageContext) {
|
|
28
|
+
return state.aiCfoViewState?.suggestedQuestionsByPageContext?.[pageContext];
|
|
29
|
+
}
|