@zeniai/client-epic-state 4.8.42 → 4.8.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  2. package/lib/entity/snackbar/snackbarTypes.js +0 -1
  3. package/lib/epic.d.ts +1 -3
  4. package/lib/epic.js +1 -3
  5. package/lib/index.d.ts +4 -5
  6. package/lib/index.js +15 -22
  7. package/lib/view/commonVendorView/vendorView/epics/saveVendorEpic.js +4 -31
  8. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  9. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  10. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  11. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  12. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  13. package/lib/view/scheduleView/scheduleDetailView/scheduleDetailPayload.js +4 -2
  14. package/lib/view/settingsView/settingsViewPayload.d.ts +0 -7
  15. package/lib/view/settingsView/settingsViewReducer.d.ts +2 -7
  16. package/lib/view/settingsView/settingsViewReducer.js +2 -115
  17. package/lib/view/settingsView/settingsViewSelector.d.ts +0 -2
  18. package/lib/view/settingsView/settingsViewSelector.js +1 -4
  19. package/lib/view/settingsView/settingsViewState.d.ts +0 -18
  20. package/lib/view/settingsView/settingsViewState.js +0 -15
  21. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +0 -1
  22. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +22 -24
  23. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +0 -1
  24. package/lib/view/spendManagement/billPay/editBillView/editBillViewState.js +0 -1
  25. package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js +0 -1
  26. package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.d.ts +1 -1
  27. package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +2 -7
  28. package/lib/view/spendManagement/helpers.js +4 -11
  29. package/lib/zeniAPI.d.ts +0 -1
  30. package/package.json +1 -1
  31. package/lib/view/settingsView/epic/fetchNotificationSettingsEpic.d.ts +0 -17
  32. package/lib/view/settingsView/epic/fetchNotificationSettingsEpic.js +0 -23
  33. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +0 -31
  34. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.js +0 -70
  35. package/lib/view/settingsView/settingsViewHelpers.d.ts +0 -2
  36. package/lib/view/settingsView/settingsViewHelpers.js +0 -11
@@ -1,17 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { fetchNotificationSettings, updateNotificationSettingsOnSuccess, updateNotificationSettingsOnFailure } from '../settingsViewReducer';
3
- import { ZeniAPI } from '../../../zeniAPI';
4
- import { RootState } from '../../../reducer';
5
- export declare type ActionType = ReturnType<typeof fetchNotificationSettings> | ReturnType<typeof updateNotificationSettingsOnSuccess> | ReturnType<typeof updateNotificationSettingsOnFailure>;
6
- export declare const fetchNotificationSettingsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
- payload: undefined;
8
- type: string;
9
- } | {
10
- payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
11
- type: string;
12
- } | {
13
- payload: {
14
- data: import("../settingsViewPayload").NotificationSettingsPayload;
15
- };
16
- type: string;
17
- }>;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchNotificationSettingsEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const settingsViewReducer_1 = require("../settingsViewReducer");
7
- const responsePayload_1 = require("../../../responsePayload");
8
- const fetchNotificationSettingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.fetchNotificationSettings.match), (0, operators_1.switchMap)(() => {
9
- const URL = `${zeniAPI.apiEndPoints.notificationMicroServiceBaseUrl}/1.0/notification-preferences`;
10
- return zeniAPI.getJSON(URL).pipe((0, operators_1.mergeMap)((response) => {
11
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
12
- const updateActions = [
13
- (0, settingsViewReducer_1.updateNotificationSettingsOnSuccess)(response.data),
14
- ];
15
- return (0, rxjs_1.of)(...updateActions);
16
- }
17
- else {
18
- return (0, rxjs_1.of)((0, settingsViewReducer_1.updateNotificationSettingsOnFailure)(response.status));
19
- }
20
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, settingsViewReducer_1.updateNotificationSettingsOnFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Fetch Notification Settings REST API call errored out' +
21
- JSON.stringify(error))))));
22
- }));
23
- exports.fetchNotificationSettingsEpic = fetchNotificationSettingsEpic;
@@ -1,31 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { saveNotificationSettings, updateNotificationSettingsOnSaveFailure, updateNotificationSettingsOnSaveSuccess } from '../settingsViewReducer';
3
- import { ZeniAPI } from '../../../zeniAPI';
4
- import { RootState } from '../../../reducer';
5
- import { NotificationSettingsPayload } from '../settingsViewPayload';
6
- import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
7
- export declare type ActionType = ReturnType<typeof saveNotificationSettings> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateNotificationSettingsOnSaveSuccess> | ReturnType<typeof updateNotificationSettingsOnSaveFailure>;
8
- export declare const saveNotificationSettingsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
9
- payload: undefined;
10
- type: string;
11
- } | {
12
- payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
13
- type: string;
14
- } | {
15
- payload: {
16
- data: NotificationSettingsPayload;
17
- };
18
- type: string;
19
- } | {
20
- payload: {
21
- messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_monthEndEmailSent" | "cockpit_monthEndEmailSave" | "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" | "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" | "zeni_account_accept_term" | "update_vendor" | "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" | "charge_card_setup" | "charge_card_accept_term" | "create_schedule" | "save_schedule" | "save_task_detail" | "delete_task" | "archive_task" | "update_charge_card" | "notification_settings_saved";
22
- messageText: "failed" | "success";
23
- type: import("../../..").SnackbarMessageType;
24
- showStatusIcon?: boolean | undefined;
25
- variables?: {
26
- variableName: string;
27
- variableValue: string;
28
- }[] | undefined;
29
- };
30
- type: string;
31
- }>;
@@ -1,70 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.saveNotificationSettingsEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const settingsViewReducer_1 = require("../settingsViewReducer");
7
- const responsePayload_1 = require("../../../responsePayload");
8
- const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
9
- const saveNotificationSettingsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.saveNotificationSettings.match), (0, operators_1.switchMap)(() => {
10
- const URL = `${zeniAPI.apiEndPoints.notificationMicroServiceBaseUrl}/1.0/notification-preferences`;
11
- const { notificationSettings, notificationSettingsLocalData } = state$.value.settingsViewState.notification;
12
- const payload = toSaveNotificationSettingsPayload(notificationSettingsLocalData, notificationSettings);
13
- return zeniAPI
14
- .putAndGetJSON(URL, payload)
15
- .pipe((0, operators_1.mergeMap)((response) => {
16
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
17
- const updateActions = [
18
- (0, settingsViewReducer_1.updateNotificationSettingsOnSaveSuccess)({ data: response.data }),
19
- (0, snackbarReducer_1.openSnackbar)({
20
- messageSection: 'notification_settings_saved',
21
- messageText: 'success',
22
- type: 'success',
23
- }),
24
- ];
25
- return (0, rxjs_1.of)(...updateActions);
26
- }
27
- else {
28
- return (0, rxjs_1.of)((0, settingsViewReducer_1.updateNotificationSettingsOnSaveFailure)(response.status));
29
- }
30
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, settingsViewReducer_1.updateNotificationSettingsOnSaveFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Save Notification Settings REST API call errored out' +
31
- JSON.stringify(error))))));
32
- }));
33
- exports.saveNotificationSettingsEpic = saveNotificationSettingsEpic;
34
- function toSaveNotificationSettingsPayload(localData, notificationSettingsData) {
35
- const payload = {};
36
- if (localData.reminders.isMissingReceiptNotificationActive != null &&
37
- notificationSettingsData.missingReceiptNotification != null) {
38
- payload.is_missing_receipt_notification_active =
39
- localData.reminders.isMissingReceiptNotificationActive;
40
- payload.missing_receipt_notification = {
41
- preferred_mode: ['email'],
42
- };
43
- }
44
- if (localData.reminders.isPendingBillApprovalNotificationActive != null &&
45
- notificationSettingsData.pendingBillApprovalNotification != null) {
46
- payload.is_pending_bill_approval_notification_active =
47
- localData.reminders.isPendingBillApprovalNotificationActive;
48
- payload.pending_bill_approval_notification = {
49
- preferred_mode: ['email'],
50
- };
51
- }
52
- if (localData.reminders.isUncategorizedTransactionNotificationActive != null &&
53
- notificationSettingsData.uncategorizedTransactionNotification != null) {
54
- payload.is_uncategorized_transaction_notification_active =
55
- localData.reminders.isUncategorizedTransactionNotificationActive;
56
- payload.uncategorized_transaction_notification = {
57
- preferred_mode: ['email'],
58
- };
59
- }
60
- if (localData.reminders.isPendingReimbursementApprovalNotificationActive !=
61
- null &&
62
- notificationSettingsData.pendingReimbursementApprovalNotification != null) {
63
- payload.is_pending_reimbursement_approval_notification_active =
64
- localData.reminders.isPendingReimbursementApprovalNotificationActive;
65
- payload.pending_reimbursement_approval_notification = {
66
- preferred_mode: ['email'],
67
- };
68
- }
69
- return payload;
70
- }
@@ -1,2 +0,0 @@
1
- import { NotificationSettings } from './settingsViewState';
2
- export declare const isNotificationsTabVisible: (notificationSettingsView: NotificationSettings) => boolean;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isNotificationsTabVisible = void 0;
4
- const isNotificationsTabVisible = (notificationSettingsView) => {
5
- const { notificationSettings } = notificationSettingsView;
6
- return (notificationSettings.missingReceiptNotification != null ||
7
- notificationSettings.pendingBillApprovalNotification != null ||
8
- notificationSettings.pendingReimbursementApprovalNotification != null ||
9
- notificationSettings.uncategorizedTransactionNotification != null);
10
- };
11
- exports.isNotificationsTabVisible = isNotificationsTabVisible;