@zeniai/client-epic-state 5.0.37 → 5.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.d.ts +1 -0
- package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +2 -1
- package/lib/entity/file/fileState.d.ts +4 -4
- package/lib/entity/file/fileState.js +4 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +4 -0
- package/lib/entity/task/taskPayload.d.ts +3 -0
- package/lib/entity/task/taskPayload.js +5 -0
- package/lib/entity/task/taskState.d.ts +3 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +5 -2
- package/lib/entity/tenant/clearAllEpic.js +6 -0
- package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +19 -0
- package/lib/entity/tenant/epic/deleteConnectionEpic.js +29 -0
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +19 -0
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.js +31 -0
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +19 -0
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.js +33 -0
- package/lib/entity/tenant/tenantPayload.d.ts +1 -0
- package/lib/entity/tenant/tenantReducer.d.ts +59 -1
- package/lib/entity/tenant/tenantReducer.js +139 -4
- package/lib/entity/tenant/tenantState.d.ts +7 -0
- package/lib/entity/transaction/stateTypes/attachment.d.ts +2 -2
- package/lib/epic.d.ts +9 -1
- package/lib/epic.js +12 -1
- package/lib/esm/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +1 -0
- package/lib/esm/entity/file/fileState.js +4 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +4 -0
- package/lib/esm/entity/task/taskPayload.js +5 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +6 -0
- package/lib/esm/entity/tenant/epic/deleteConnectionEpic.js +25 -0
- package/lib/esm/entity/tenant/epic/saveAPIKeyConnectionEpic.js +27 -0
- package/lib/esm/entity/tenant/epic/saveOAuthConnectionEpic.js +29 -0
- package/lib/esm/entity/tenant/tenantReducer.js +135 -2
- package/lib/esm/epic.js +12 -1
- package/lib/esm/index.js +15 -6
- package/lib/esm/init.js +71 -16
- package/lib/esm/reducer.js +9 -0
- package/lib/esm/view/featureNotificationView/epics/fetchRegisteredInterestsEpic.js +23 -0
- package/lib/esm/view/featureNotificationView/epics/notifyMeForFeatureEpic.js +25 -0
- package/lib/esm/view/featureNotificationView/featureNotificationViewPayload.js +11 -0
- package/lib/esm/view/featureNotificationView/featureNotificationViewReducer.js +106 -0
- package/lib/esm/view/featureNotificationView/featureNotificationViewSelector.js +4 -0
- package/lib/esm/view/featureNotificationView/featureNotificationViewState.js +1 -0
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponses.js +1 -0
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponsesPayload.js +12 -0
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponsesReducer.js +64 -0
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponsesSelector.js +3 -0
- package/lib/esm/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.js +17 -0
- package/lib/esm/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +21 -0
- package/lib/esm/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +29 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +3 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +5 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +1 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +1 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +66 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +57 -0
- package/lib/esm/view/taskManager/taskDetailView/taskDetail.js +4 -0
- package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +60 -7
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +12 -0
- package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +56 -21
- package/lib/esm/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +1 -0
- package/lib/esm/view/taskManager/taskListView/epics/fetchTaskListEpic.js +13 -4
- package/lib/esm/view/taskManager/taskListView/epics/updateTaskFromListViewEpic.js +3 -2
- package/lib/esm/view/taskManager/taskListView/taskList.js +7 -0
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +106 -12
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +48 -39
- package/lib/esm/view/zeniOAuthView/epics/approveOAuthConsentEpic.js +65 -0
- package/lib/esm/view/zeniOAuthView/zeniOAuthParamsParser.js +41 -0
- package/lib/esm/view/zeniOAuthView/zeniOAuthReducer.js +49 -0
- package/lib/esm/view/zeniOAuthView/zeniOAuthSelector.js +3 -0
- package/lib/esm/view/zeniOAuthView/zeniOAuthState.js +1 -0
- package/lib/index.d.ts +18 -6
- package/lib/index.js +67 -30
- package/lib/init.d.ts +5 -3
- package/lib/init.js +71 -16
- package/lib/reducer.d.ts +9 -0
- package/lib/reducer.js +9 -0
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/featureNotificationView/epics/fetchRegisteredInterestsEpic.d.ts +16 -0
- package/lib/view/featureNotificationView/epics/fetchRegisteredInterestsEpic.js +27 -0
- package/lib/view/featureNotificationView/epics/notifyMeForFeatureEpic.d.ts +14 -0
- package/lib/view/featureNotificationView/epics/notifyMeForFeatureEpic.js +29 -0
- package/lib/view/featureNotificationView/featureNotificationViewPayload.d.ts +23 -0
- package/lib/view/featureNotificationView/featureNotificationViewPayload.js +15 -0
- package/lib/view/featureNotificationView/featureNotificationViewReducer.d.ts +19 -0
- package/lib/view/featureNotificationView/featureNotificationViewReducer.js +110 -0
- package/lib/view/featureNotificationView/featureNotificationViewSelector.d.ts +6 -0
- package/lib/view/featureNotificationView/featureNotificationViewSelector.js +11 -0
- package/lib/view/featureNotificationView/featureNotificationViewState.d.ts +26 -0
- package/lib/view/featureNotificationView/featureNotificationViewState.js +2 -0
- package/lib/view/taskManager/cannedResponsesView/cannedResponses.d.ts +19 -0
- package/lib/view/taskManager/cannedResponsesView/cannedResponses.js +2 -0
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesPayload.d.ts +21 -0
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesPayload.js +15 -0
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesReducer.d.ts +30 -0
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesReducer.js +68 -0
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesSelector.d.ts +3 -0
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesSelector.js +6 -0
- package/lib/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.d.ts +7 -0
- package/lib/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.js +21 -0
- package/lib/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.d.ts +7 -0
- package/lib/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +25 -0
- package/lib/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.d.ts +7 -0
- package/lib/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +33 -0
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.d.ts +2 -1
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +3 -0
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.d.ts +2 -1
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +5 -0
- package/lib/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +1 -0
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +1 -0
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.d.ts +9 -0
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +70 -0
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.d.ts +9 -0
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +61 -0
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +2 -0
- package/lib/view/taskManager/taskDetailView/taskDetail.js +4 -0
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +10 -1
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +61 -8
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +5 -0
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +12 -0
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +6 -7
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +56 -22
- package/lib/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +1 -0
- package/lib/view/taskManager/taskListView/epics/fetchTaskListEpic.js +13 -4
- package/lib/view/taskManager/taskListView/epics/updateTaskFromListViewEpic.js +3 -2
- package/lib/view/taskManager/taskListView/taskList.d.ts +14 -1
- package/lib/view/taskManager/taskListView/taskList.js +8 -1
- package/lib/view/taskManager/taskListView/taskListPayload.d.ts +3 -0
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +9 -6
- package/lib/view/taskManager/taskListView/taskListReducer.js +107 -13
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +9 -3
- package/lib/view/taskManager/taskListView/taskListSelector.js +48 -39
- package/lib/view/zeniOAuthView/epics/approveOAuthConsentEpic.d.ts +27 -0
- package/lib/view/zeniOAuthView/epics/approveOAuthConsentEpic.js +69 -0
- package/lib/view/zeniOAuthView/zeniOAuthParamsParser.d.ts +16 -0
- package/lib/view/zeniOAuthView/zeniOAuthParamsParser.js +44 -0
- package/lib/view/zeniOAuthView/zeniOAuthReducer.d.ts +29 -0
- package/lib/view/zeniOAuthView/zeniOAuthReducer.js +53 -0
- package/lib/view/zeniOAuthView/zeniOAuthSelector.d.ts +5 -0
- package/lib/view/zeniOAuthView/zeniOAuthSelector.js +9 -0
- package/lib/view/zeniOAuthView/zeniOAuthState.d.ts +4 -0
- package/lib/view/zeniOAuthView/zeniOAuthState.js +2 -0
- package/package.json +1 -1
package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: S
|
|
|
37
37
|
export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
|
|
38
38
|
export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
|
|
39
39
|
export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
|
|
40
|
-
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "ai_accountant_trigger_job";
|
|
40
|
+
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request";
|
|
41
41
|
messageText: "notification" | "failed" | "success";
|
|
42
42
|
type: "error" | "success" | "info";
|
|
43
43
|
variables: {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { RootState } from '../../../reducer';
|
|
3
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
|
+
import { fetchRegisteredInterests, fetchRegisteredInterestsFailure, fetchRegisteredInterestsSuccess } from '../featureNotificationViewReducer';
|
|
5
|
+
export type ActionType = ReturnType<typeof fetchRegisteredInterests> | ReturnType<typeof fetchRegisteredInterestsSuccess> | ReturnType<typeof fetchRegisteredInterestsFailure>;
|
|
6
|
+
export declare const fetchRegisteredInterestsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
7
|
+
payload: {
|
|
8
|
+
interests: import("../featureNotificationViewState").FeatureInterest[];
|
|
9
|
+
};
|
|
10
|
+
type: "featureNotificationView/fetchRegisteredInterestsSuccess";
|
|
11
|
+
} | {
|
|
12
|
+
payload: {
|
|
13
|
+
status: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
14
|
+
};
|
|
15
|
+
type: "featureNotificationView/fetchRegisteredInterestsFailure";
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchRegisteredInterestsEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
+
const featureNotificationViewPayload_1 = require("../featureNotificationViewPayload");
|
|
8
|
+
const featureNotificationViewReducer_1 = require("../featureNotificationViewReducer");
|
|
9
|
+
const fetchRegisteredInterestsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(featureNotificationViewReducer_1.fetchRegisteredInterests.match), (0, operators_1.switchMap)((action) => zeniAPI
|
|
10
|
+
.getJSON(`${zeniAPI.apiEndPoints.notificationMicroServiceBaseUrl}/1.0/feature-interests?feature=${encodeURIComponent(action.payload.feature)}`)
|
|
11
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
12
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
13
|
+
const interests = response.data.feature_interests.map(featureNotificationViewPayload_1.toFeatureInterest);
|
|
14
|
+
return (0, rxjs_1.from)([(0, featureNotificationViewReducer_1.fetchRegisteredInterestsSuccess)(interests)]);
|
|
15
|
+
}
|
|
16
|
+
const status = response.status ??
|
|
17
|
+
(0, responsePayload_1.createZeniAPIStatus)('Failed to fetch registered interests. Please try again.');
|
|
18
|
+
return (0, rxjs_1.from)([(0, featureNotificationViewReducer_1.fetchRegisteredInterestsFailure)(status)]);
|
|
19
|
+
}), (0, operators_1.catchError)((error) => {
|
|
20
|
+
const message = error instanceof Error
|
|
21
|
+
? error.message
|
|
22
|
+
: 'Unexpected error fetching registered interests.';
|
|
23
|
+
return (0, rxjs_1.from)([
|
|
24
|
+
(0, featureNotificationViewReducer_1.fetchRegisteredInterestsFailure)((0, responsePayload_1.createZeniAPIStatus)(message)),
|
|
25
|
+
]);
|
|
26
|
+
}))));
|
|
27
|
+
exports.fetchRegisteredInterestsEpic = fetchRegisteredInterestsEpic;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { RootState } from '../../../reducer';
|
|
3
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
|
+
import { notifyMeForFeature, notifyMeForFeatureFailure, notifyMeForFeatureSuccess } from '../featureNotificationViewReducer';
|
|
5
|
+
export type ActionType = ReturnType<typeof notifyMeForFeature> | ReturnType<typeof notifyMeForFeatureSuccess> | ReturnType<typeof notifyMeForFeatureFailure>;
|
|
6
|
+
export declare const notifyMeForFeatureEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
7
|
+
payload: import("../featureNotificationViewPayload").FeatureInterestDataPayload;
|
|
8
|
+
type: "featureNotificationView/notifyMeForFeatureSuccess";
|
|
9
|
+
} | {
|
|
10
|
+
payload: {
|
|
11
|
+
status: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
12
|
+
};
|
|
13
|
+
type: "featureNotificationView/notifyMeForFeatureFailure";
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.notifyMeForFeatureEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
+
const featureNotificationViewReducer_1 = require("../featureNotificationViewReducer");
|
|
8
|
+
const notifyMeForFeatureEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(featureNotificationViewReducer_1.notifyMeForFeature.match), (0, operators_1.switchMap)((action) => zeniAPI
|
|
9
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.notificationMicroServiceBaseUrl}/1.0/feature-interests`, {
|
|
10
|
+
additional_info: action.payload.additionalInfo,
|
|
11
|
+
email: action.payload.email,
|
|
12
|
+
feature: action.payload.feature,
|
|
13
|
+
})
|
|
14
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
15
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
16
|
+
return (0, rxjs_1.from)([(0, featureNotificationViewReducer_1.notifyMeForFeatureSuccess)(response.data)]);
|
|
17
|
+
}
|
|
18
|
+
const status = response.status ??
|
|
19
|
+
(0, responsePayload_1.createZeniAPIStatus)('Failed to register interest. Please try again.');
|
|
20
|
+
return (0, rxjs_1.from)([(0, featureNotificationViewReducer_1.notifyMeForFeatureFailure)(status)]);
|
|
21
|
+
}), (0, operators_1.catchError)((error) => {
|
|
22
|
+
const message = error instanceof Error
|
|
23
|
+
? error.message
|
|
24
|
+
: 'Unexpected error registering interest.';
|
|
25
|
+
return (0, rxjs_1.from)([
|
|
26
|
+
(0, featureNotificationViewReducer_1.notifyMeForFeatureFailure)((0, responsePayload_1.createZeniAPIStatus)(message)),
|
|
27
|
+
]);
|
|
28
|
+
}))));
|
|
29
|
+
exports.notifyMeForFeatureEpic = notifyMeForFeatureEpic;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ZeniAPIResponse } from '../../responsePayload';
|
|
2
|
+
import { FeatureInterest } from './featureNotificationViewState';
|
|
3
|
+
/**
|
|
4
|
+
* Backend payload shapes for the FeatureInterest API exposed by
|
|
5
|
+
* `@repo:notifications`. snake_case is preserved here verbatim; the
|
|
6
|
+
* `toFeatureInterest` mapper converts to the camelCase state shape.
|
|
7
|
+
*/
|
|
8
|
+
export interface FeatureInterestDataPayload {
|
|
9
|
+
create_time: string;
|
|
10
|
+
feature: string;
|
|
11
|
+
interest_id: string;
|
|
12
|
+
notified: boolean;
|
|
13
|
+
update_time: string;
|
|
14
|
+
additional_info?: string | null;
|
|
15
|
+
email?: string | null;
|
|
16
|
+
notified_time?: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface FeatureInterestListPayload {
|
|
19
|
+
feature_interests: FeatureInterestDataPayload[];
|
|
20
|
+
}
|
|
21
|
+
export type FeatureInterestResponse = ZeniAPIResponse<FeatureInterestDataPayload>;
|
|
22
|
+
export type FeatureInterestListResponse = ZeniAPIResponse<FeatureInterestListPayload>;
|
|
23
|
+
export declare const toFeatureInterest: (payload: FeatureInterestDataPayload) => FeatureInterest;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toFeatureInterest = void 0;
|
|
4
|
+
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
5
|
+
const toFeatureInterest = (payload) => ({
|
|
6
|
+
interestId: payload.interest_id,
|
|
7
|
+
feature: payload.feature,
|
|
8
|
+
notified: payload.notified,
|
|
9
|
+
createTime: (0, zeniDayJS_1.date)(payload.create_time),
|
|
10
|
+
updateTime: (0, zeniDayJS_1.date)(payload.update_time),
|
|
11
|
+
additionalInfo: payload.additional_info ?? undefined,
|
|
12
|
+
email: payload.email ?? undefined,
|
|
13
|
+
notifiedTime: payload.notified_time != null ? (0, zeniDayJS_1.date)(payload.notified_time) : undefined,
|
|
14
|
+
});
|
|
15
|
+
exports.toFeatureInterest = toFeatureInterest;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ZeniAPIStatus } from '../../responsePayload';
|
|
2
|
+
import { FeatureInterestDataPayload } from './featureNotificationViewPayload';
|
|
3
|
+
import { FeatureInterest, FeatureNotificationViewState } from './featureNotificationViewState';
|
|
4
|
+
export declare const initialState: FeatureNotificationViewState;
|
|
5
|
+
export declare const clearFeatureNotificationView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"featureNotificationView/clearFeatureNotificationView">, fetchRegisteredInterests: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[feature: string], {
|
|
6
|
+
feature: string;
|
|
7
|
+
}, "featureNotificationView/fetchRegisteredInterests", never, never>, fetchRegisteredInterestsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
8
|
+
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
9
|
+
}, "featureNotificationView/fetchRegisteredInterestsFailure", never, never>, fetchRegisteredInterestsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[interests: FeatureInterest[]], {
|
|
10
|
+
interests: FeatureInterest[];
|
|
11
|
+
}, "featureNotificationView/fetchRegisteredInterestsSuccess", never, never>, notifyMeForFeature: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[feature: string, additionalInfo: string, email: string], {
|
|
12
|
+
feature: string;
|
|
13
|
+
additionalInfo: string;
|
|
14
|
+
email: string;
|
|
15
|
+
}, "featureNotificationView/notifyMeForFeature", never, never>, notifyMeForFeatureFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
16
|
+
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
17
|
+
}, "featureNotificationView/notifyMeForFeatureFailure", never, never>, notifyMeForFeatureSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: FeatureInterestDataPayload], FeatureInterestDataPayload, "featureNotificationView/notifyMeForFeatureSuccess", never, never>;
|
|
18
|
+
declare const _default: import("redux").Reducer<FeatureNotificationViewState>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.notifyMeForFeatureSuccess = exports.notifyMeForFeatureFailure = exports.notifyMeForFeature = exports.fetchRegisteredInterestsSuccess = exports.fetchRegisteredInterestsFailure = exports.fetchRegisteredInterests = exports.clearFeatureNotificationView = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const featureNotificationViewPayload_1 = require("./featureNotificationViewPayload");
|
|
7
|
+
exports.initialState = {
|
|
8
|
+
fetchRegisteredInterestsState: {
|
|
9
|
+
fetchState: 'Not-Started',
|
|
10
|
+
error: undefined,
|
|
11
|
+
},
|
|
12
|
+
notifyMeForFeatureState: {
|
|
13
|
+
fetchState: 'Not-Started',
|
|
14
|
+
error: undefined,
|
|
15
|
+
},
|
|
16
|
+
registeredInterests: [],
|
|
17
|
+
};
|
|
18
|
+
const featureNotificationView = (0, toolkit_1.createSlice)({
|
|
19
|
+
name: 'featureNotificationView',
|
|
20
|
+
initialState: exports.initialState,
|
|
21
|
+
reducers: {
|
|
22
|
+
notifyMeForFeature: {
|
|
23
|
+
prepare(feature, additionalInfo, email) {
|
|
24
|
+
return { payload: { feature, additionalInfo, email } };
|
|
25
|
+
},
|
|
26
|
+
reducer(draft,
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28
|
+
_action) {
|
|
29
|
+
draft.notifyMeForFeatureState = {
|
|
30
|
+
fetchState: 'In-Progress',
|
|
31
|
+
error: undefined,
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
notifyMeForFeatureSuccess: {
|
|
36
|
+
prepare(payload) {
|
|
37
|
+
return { payload };
|
|
38
|
+
},
|
|
39
|
+
reducer(draft, action) {
|
|
40
|
+
draft.notifyMeForFeatureState = {
|
|
41
|
+
fetchState: 'Completed',
|
|
42
|
+
error: undefined,
|
|
43
|
+
};
|
|
44
|
+
const interest = (0, featureNotificationViewPayload_1.toFeatureInterest)(action.payload);
|
|
45
|
+
// Idempotent: if a row for this (feature, additional_info) already
|
|
46
|
+
// exists in the slice, replace it; otherwise append.
|
|
47
|
+
const existingIndex = draft.registeredInterests.findIndex((r) => r.feature === interest.feature &&
|
|
48
|
+
r.additionalInfo === interest.additionalInfo);
|
|
49
|
+
if (existingIndex >= 0) {
|
|
50
|
+
draft.registeredInterests[existingIndex] = interest;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
draft.registeredInterests.push(interest);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
notifyMeForFeatureFailure: {
|
|
58
|
+
prepare(status) {
|
|
59
|
+
return { payload: { status } };
|
|
60
|
+
},
|
|
61
|
+
reducer(draft, action) {
|
|
62
|
+
draft.notifyMeForFeatureState = {
|
|
63
|
+
fetchState: 'Error',
|
|
64
|
+
error: action.payload.status,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
fetchRegisteredInterests: {
|
|
69
|
+
prepare(feature) {
|
|
70
|
+
return { payload: { feature } };
|
|
71
|
+
},
|
|
72
|
+
reducer(draft,
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
74
|
+
_action) {
|
|
75
|
+
draft.fetchRegisteredInterestsState = {
|
|
76
|
+
fetchState: 'In-Progress',
|
|
77
|
+
error: undefined,
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
fetchRegisteredInterestsSuccess: {
|
|
82
|
+
prepare(interests) {
|
|
83
|
+
return { payload: { interests } };
|
|
84
|
+
},
|
|
85
|
+
reducer(draft, action) {
|
|
86
|
+
draft.fetchRegisteredInterestsState = {
|
|
87
|
+
fetchState: 'Completed',
|
|
88
|
+
error: undefined,
|
|
89
|
+
};
|
|
90
|
+
draft.registeredInterests = action.payload.interests;
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
fetchRegisteredInterestsFailure: {
|
|
94
|
+
prepare(status) {
|
|
95
|
+
return { payload: { status } };
|
|
96
|
+
},
|
|
97
|
+
reducer(draft, action) {
|
|
98
|
+
draft.fetchRegisteredInterestsState = {
|
|
99
|
+
fetchState: 'Error',
|
|
100
|
+
error: action.payload.status,
|
|
101
|
+
};
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
clearFeatureNotificationView(draft) {
|
|
105
|
+
Object.assign(draft, exports.initialState);
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
_a = featureNotificationView.actions, exports.clearFeatureNotificationView = _a.clearFeatureNotificationView, exports.fetchRegisteredInterests = _a.fetchRegisteredInterests, exports.fetchRegisteredInterestsFailure = _a.fetchRegisteredInterestsFailure, exports.fetchRegisteredInterestsSuccess = _a.fetchRegisteredInterestsSuccess, exports.notifyMeForFeature = _a.notifyMeForFeature, exports.notifyMeForFeatureFailure = _a.notifyMeForFeatureFailure, exports.notifyMeForFeatureSuccess = _a.notifyMeForFeatureSuccess;
|
|
110
|
+
exports.default = featureNotificationView.reducer;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RootState } from '../../reducer';
|
|
2
|
+
import { FeatureInterest } from './featureNotificationViewState';
|
|
3
|
+
export declare const getFeatureNotificationView: (state: RootState) => import("./featureNotificationViewState").FeatureNotificationViewState;
|
|
4
|
+
export declare const getRegisteredInterests: (state: RootState) => FeatureInterest[];
|
|
5
|
+
export declare const getRegisteredInterestsByFeature: (state: RootState, feature: string) => FeatureInterest[];
|
|
6
|
+
export declare const isFeatureInterestRegistered: (state: RootState, feature: string, additionalInfo: string) => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isFeatureInterestRegistered = exports.getRegisteredInterestsByFeature = exports.getRegisteredInterests = exports.getFeatureNotificationView = void 0;
|
|
4
|
+
const getFeatureNotificationView = (state) => state.featureNotificationViewState;
|
|
5
|
+
exports.getFeatureNotificationView = getFeatureNotificationView;
|
|
6
|
+
const getRegisteredInterests = (state) => state.featureNotificationViewState.registeredInterests;
|
|
7
|
+
exports.getRegisteredInterests = getRegisteredInterests;
|
|
8
|
+
const getRegisteredInterestsByFeature = (state, feature) => state.featureNotificationViewState.registeredInterests.filter((interest) => interest.feature === feature);
|
|
9
|
+
exports.getRegisteredInterestsByFeature = getRegisteredInterestsByFeature;
|
|
10
|
+
const isFeatureInterestRegistered = (state, feature, additionalInfo) => state.featureNotificationViewState.registeredInterests.some((interest) => interest.feature === feature && interest.additionalInfo === additionalInfo);
|
|
11
|
+
exports.isFeatureInterestRegistered = isFeatureInterestRegistered;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FetchStateAndError, ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { ZeniDate } from '../../zeniDayJS';
|
|
3
|
+
/**
|
|
4
|
+
* A single user-feature interest record returned by
|
|
5
|
+
* `GET /1.0/feature-interests` and `POST /1.0/feature-interests`.
|
|
6
|
+
*
|
|
7
|
+
* Used by the Integrations page "Notify me" buttons to register that the
|
|
8
|
+
* user wants an email when a not-yet-shipped connector becomes available.
|
|
9
|
+
* Generic enough to drive any future "Notify me" UI by adding a slug to
|
|
10
|
+
* the backend allowlist (FEATURE_INTEREST_ALLOWED_VALUES).
|
|
11
|
+
*/
|
|
12
|
+
export interface FeatureInterest {
|
|
13
|
+
createTime: ZeniDate;
|
|
14
|
+
feature: string;
|
|
15
|
+
interestId: ID;
|
|
16
|
+
notified: boolean;
|
|
17
|
+
updateTime: ZeniDate;
|
|
18
|
+
additionalInfo?: string;
|
|
19
|
+
email?: string;
|
|
20
|
+
notifiedTime?: ZeniDate;
|
|
21
|
+
}
|
|
22
|
+
export interface FeatureNotificationViewState {
|
|
23
|
+
fetchRegisteredInterestsState: FetchStateAndError;
|
|
24
|
+
notifyMeForFeatureState: FetchStateAndError;
|
|
25
|
+
registeredInterests: FeatureInterest[];
|
|
26
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FetchState, ID } from '../../../commonStateTypes/common';
|
|
2
|
+
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
3
|
+
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
|
+
export interface CannedResponse {
|
|
5
|
+
cannedResponseId: ID;
|
|
6
|
+
content: string;
|
|
7
|
+
createdBy: ID;
|
|
8
|
+
createTime: ZeniDate;
|
|
9
|
+
isDeleted: boolean;
|
|
10
|
+
name: string;
|
|
11
|
+
updateTime: ZeniDate;
|
|
12
|
+
}
|
|
13
|
+
export interface CannedResponsesViewState {
|
|
14
|
+
cannedResponses: CannedResponse[];
|
|
15
|
+
deleteFetchState: FetchState;
|
|
16
|
+
fetchState: FetchState;
|
|
17
|
+
saveFetchState: FetchState;
|
|
18
|
+
error?: ZeniAPIStatus;
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
2
|
+
import { CannedResponse } from './cannedResponses';
|
|
3
|
+
export interface CannedResponsePayload {
|
|
4
|
+
canned_response_id: string;
|
|
5
|
+
content: string;
|
|
6
|
+
create_time: string;
|
|
7
|
+
created_by: string;
|
|
8
|
+
is_deleted: boolean;
|
|
9
|
+
name: string;
|
|
10
|
+
update_time: string;
|
|
11
|
+
}
|
|
12
|
+
interface FetchCannedResponsesPayload {
|
|
13
|
+
canned_responses: CannedResponsePayload[];
|
|
14
|
+
}
|
|
15
|
+
export type FetchCannedResponsesResponse = ZeniAPIResponse<FetchCannedResponsesPayload>;
|
|
16
|
+
export type SaveCannedResponseResponse = ZeniAPIResponse<{
|
|
17
|
+
canned_response: CannedResponsePayload;
|
|
18
|
+
}>;
|
|
19
|
+
export type DeleteCannedResponseResponse = ZeniAPIResponse<unknown>;
|
|
20
|
+
export declare function mapCannedResponsePayloadToCannedResponse(payload: CannedResponsePayload): CannedResponse;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapCannedResponsePayloadToCannedResponse = mapCannedResponsePayloadToCannedResponse;
|
|
4
|
+
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
5
|
+
function mapCannedResponsePayloadToCannedResponse(payload) {
|
|
6
|
+
return {
|
|
7
|
+
cannedResponseId: payload.canned_response_id,
|
|
8
|
+
content: payload.content,
|
|
9
|
+
createTime: (0, zeniDayJS_1.date)(payload.create_time),
|
|
10
|
+
createdBy: payload.created_by,
|
|
11
|
+
isDeleted: payload.is_deleted,
|
|
12
|
+
name: payload.name,
|
|
13
|
+
updateTime: (0, zeniDayJS_1.date)(payload.update_time),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FetchState, ID } from '../../../commonStateTypes/common';
|
|
2
|
+
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
3
|
+
import { CannedResponse, CannedResponsesViewState } from './cannedResponses';
|
|
4
|
+
export declare const initialState: CannedResponsesViewState;
|
|
5
|
+
export declare const fetchCannedResponses: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cannedResponsesView/fetchCannedResponses">, updateCannedResponses: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
6
|
+
cannedResponses: CannedResponse[];
|
|
7
|
+
}, "cannedResponsesView/updateCannedResponses">, updateCannedResponsesFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
8
|
+
fetchState: FetchState;
|
|
9
|
+
error?: ZeniAPIStatus;
|
|
10
|
+
}, "cannedResponsesView/updateCannedResponsesFetchStatus">, saveCannedResponse: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
11
|
+
content: string;
|
|
12
|
+
name: string;
|
|
13
|
+
cannedResponseId?: ID;
|
|
14
|
+
}], {
|
|
15
|
+
content: string;
|
|
16
|
+
name: string;
|
|
17
|
+
cannedResponseId?: ID;
|
|
18
|
+
}, "cannedResponsesView/saveCannedResponse", never, never>, saveCannedResponseSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cannedResponsesView/saveCannedResponseSuccess">, saveCannedResponseFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
19
|
+
error?: ZeniAPIStatus;
|
|
20
|
+
}, "cannedResponsesView/saveCannedResponseFailure">, deleteCannedResponse: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
21
|
+
cannedResponseId: ID;
|
|
22
|
+
}], {
|
|
23
|
+
cannedResponseId: ID;
|
|
24
|
+
}, "cannedResponsesView/deleteCannedResponse", never, never>, deleteCannedResponseSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
25
|
+
cannedResponseId: ID;
|
|
26
|
+
}, "cannedResponsesView/deleteCannedResponseSuccess">, deleteCannedResponseFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
27
|
+
error?: ZeniAPIStatus;
|
|
28
|
+
}, "cannedResponsesView/deleteCannedResponseFailure">, clearCannedResponses: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cannedResponsesView/clearCannedResponses">;
|
|
29
|
+
declare const _default: import("redux").Reducer<CannedResponsesViewState>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clearCannedResponses = exports.deleteCannedResponseFailure = exports.deleteCannedResponseSuccess = exports.deleteCannedResponse = exports.saveCannedResponseFailure = exports.saveCannedResponseSuccess = exports.saveCannedResponse = exports.updateCannedResponsesFetchStatus = exports.updateCannedResponses = exports.fetchCannedResponses = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
exports.initialState = {
|
|
7
|
+
cannedResponses: [],
|
|
8
|
+
fetchState: 'Not-Started',
|
|
9
|
+
saveFetchState: 'Not-Started',
|
|
10
|
+
deleteFetchState: 'Not-Started',
|
|
11
|
+
error: undefined,
|
|
12
|
+
};
|
|
13
|
+
const cannedResponsesView = (0, toolkit_1.createSlice)({
|
|
14
|
+
name: 'cannedResponsesView',
|
|
15
|
+
initialState: exports.initialState,
|
|
16
|
+
reducers: {
|
|
17
|
+
fetchCannedResponses(draft) {
|
|
18
|
+
draft.fetchState =
|
|
19
|
+
draft.cannedResponses.length > 0 ? 'Completed' : 'In-Progress';
|
|
20
|
+
draft.error = undefined;
|
|
21
|
+
},
|
|
22
|
+
updateCannedResponses(draft, action) {
|
|
23
|
+
draft.cannedResponses = action.payload.cannedResponses;
|
|
24
|
+
draft.fetchState = 'Completed';
|
|
25
|
+
draft.error = undefined;
|
|
26
|
+
},
|
|
27
|
+
updateCannedResponsesFetchStatus(draft, action) {
|
|
28
|
+
draft.fetchState = action.payload.fetchState;
|
|
29
|
+
draft.error = action.payload.error;
|
|
30
|
+
},
|
|
31
|
+
saveCannedResponse: {
|
|
32
|
+
reducer(draft) {
|
|
33
|
+
draft.saveFetchState = 'In-Progress';
|
|
34
|
+
},
|
|
35
|
+
prepare(payload) {
|
|
36
|
+
return { payload };
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
saveCannedResponseSuccess(draft) {
|
|
40
|
+
draft.saveFetchState = 'Completed';
|
|
41
|
+
},
|
|
42
|
+
saveCannedResponseFailure(draft, action) {
|
|
43
|
+
draft.saveFetchState = 'Error';
|
|
44
|
+
draft.error = action.payload.error;
|
|
45
|
+
},
|
|
46
|
+
deleteCannedResponse: {
|
|
47
|
+
reducer(draft) {
|
|
48
|
+
draft.deleteFetchState = 'In-Progress';
|
|
49
|
+
},
|
|
50
|
+
prepare(payload) {
|
|
51
|
+
return { payload };
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
deleteCannedResponseSuccess(draft, action) {
|
|
55
|
+
draft.deleteFetchState = 'Completed';
|
|
56
|
+
draft.cannedResponses = draft.cannedResponses.filter((r) => r.cannedResponseId !== action.payload.cannedResponseId);
|
|
57
|
+
},
|
|
58
|
+
deleteCannedResponseFailure(draft, action) {
|
|
59
|
+
draft.deleteFetchState = 'Error';
|
|
60
|
+
draft.error = action.payload.error;
|
|
61
|
+
},
|
|
62
|
+
clearCannedResponses() {
|
|
63
|
+
return exports.initialState;
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
_a = cannedResponsesView.actions, exports.fetchCannedResponses = _a.fetchCannedResponses, exports.updateCannedResponses = _a.updateCannedResponses, exports.updateCannedResponsesFetchStatus = _a.updateCannedResponsesFetchStatus, exports.saveCannedResponse = _a.saveCannedResponse, exports.saveCannedResponseSuccess = _a.saveCannedResponseSuccess, exports.saveCannedResponseFailure = _a.saveCannedResponseFailure, exports.deleteCannedResponse = _a.deleteCannedResponse, exports.deleteCannedResponseSuccess = _a.deleteCannedResponseSuccess, exports.deleteCannedResponseFailure = _a.deleteCannedResponseFailure, exports.clearCannedResponses = _a.clearCannedResponses;
|
|
68
|
+
exports.default = cannedResponsesView.reducer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
+
import { deleteCannedResponse, deleteCannedResponseFailure, deleteCannedResponseSuccess } from '../cannedResponsesReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof deleteCannedResponse> | ReturnType<typeof deleteCannedResponseSuccess> | ReturnType<typeof deleteCannedResponseFailure>;
|
|
7
|
+
export declare const deleteCannedResponseEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteCannedResponseEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
+
const cannedResponsesReducer_1 = require("../cannedResponsesReducer");
|
|
8
|
+
const deleteCannedResponseEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(cannedResponsesReducer_1.deleteCannedResponse.match), (0, operators_1.mergeMap)((action) => {
|
|
9
|
+
const { cannedResponseId } = action.payload;
|
|
10
|
+
return zeniAPI
|
|
11
|
+
.deleteAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/canned-responses/${cannedResponseId}`)
|
|
12
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
13
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
14
|
+
return (0, rxjs_1.of)((0, cannedResponsesReducer_1.deleteCannedResponseSuccess)({ cannedResponseId }));
|
|
15
|
+
}
|
|
16
|
+
return (0, rxjs_1.of)((0, cannedResponsesReducer_1.deleteCannedResponseFailure)({ error: response.status }));
|
|
17
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, cannedResponsesReducer_1.deleteCannedResponseFailure)({
|
|
18
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Delete Canned Response errored: ' + JSON.stringify(error)),
|
|
19
|
+
}))));
|
|
20
|
+
}));
|
|
21
|
+
exports.deleteCannedResponseEpic = deleteCannedResponseEpic;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
+
import { fetchCannedResponses, updateCannedResponses, updateCannedResponsesFetchStatus } from '../cannedResponsesReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof fetchCannedResponses> | ReturnType<typeof updateCannedResponses> | ReturnType<typeof updateCannedResponsesFetchStatus>;
|
|
7
|
+
export declare const fetchCannedResponsesEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchCannedResponsesEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
+
const cannedResponsesPayload_1 = require("../cannedResponsesPayload");
|
|
8
|
+
const cannedResponsesReducer_1 = require("../cannedResponsesReducer");
|
|
9
|
+
const fetchCannedResponsesEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(cannedResponsesReducer_1.fetchCannedResponses.match), (0, operators_1.switchMap)(() => zeniAPI
|
|
10
|
+
.getJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/canned-responses`)
|
|
11
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
12
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
13
|
+
return (0, rxjs_1.of)((0, cannedResponsesReducer_1.updateCannedResponses)({
|
|
14
|
+
cannedResponses: (response.data.canned_responses ?? []).map(cannedResponsesPayload_1.mapCannedResponsePayloadToCannedResponse),
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
return (0, rxjs_1.of)((0, cannedResponsesReducer_1.updateCannedResponsesFetchStatus)({
|
|
18
|
+
fetchState: 'Error',
|
|
19
|
+
error: response.status,
|
|
20
|
+
}));
|
|
21
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, cannedResponsesReducer_1.updateCannedResponsesFetchStatus)({
|
|
22
|
+
fetchState: 'Error',
|
|
23
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Canned Responses errored: ' + JSON.stringify(error)),
|
|
24
|
+
}))))));
|
|
25
|
+
exports.fetchCannedResponsesEpic = fetchCannedResponsesEpic;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
+
import { fetchCannedResponses, saveCannedResponse, saveCannedResponseFailure, saveCannedResponseSuccess } from '../cannedResponsesReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof saveCannedResponse> | ReturnType<typeof saveCannedResponseSuccess> | ReturnType<typeof saveCannedResponseFailure> | ReturnType<typeof fetchCannedResponses>;
|
|
7
|
+
export declare const saveCannedResponseEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|