@zeniai/client-epic-state 5.1.84-beta4ND → 5.1.84

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 (61) hide show
  1. package/lib/entity/company/companyPayload.d.ts +0 -4
  2. package/lib/entity/company/companyPayload.js +0 -4
  3. package/lib/entity/company/companyStateTypes.d.ts +0 -4
  4. package/lib/entity/customerSatisfaction/customerSatisfactionReducer.d.ts +1 -1
  5. package/lib/entity/customerSatisfaction/customerSatisfactionReducer.js +6 -2
  6. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  7. package/lib/entity/snackbar/snackbarTypes.js +0 -2
  8. package/lib/entity/tenant/clearAllEpic.d.ts +15 -2
  9. package/lib/entity/tenant/clearAllEpic.js +27 -0
  10. package/lib/entity/tenant/tenantReducer.d.ts +1 -5
  11. package/lib/entity/tenant/tenantReducer.js +2 -19
  12. package/lib/entity/userRole/userRoleType.d.ts +2 -2
  13. package/lib/entity/vendor/vendorType.d.ts +1 -1
  14. package/lib/epic.d.ts +1 -3
  15. package/lib/epic.js +1 -3
  16. package/lib/esm/entity/company/companyPayload.js +0 -4
  17. package/lib/esm/entity/customerSatisfaction/customerSatisfactionReducer.js +4 -1
  18. package/lib/esm/entity/snackbar/snackbarTypes.js +0 -2
  19. package/lib/esm/entity/tenant/clearAllEpic.js +27 -0
  20. package/lib/esm/entity/tenant/tenantReducer.js +1 -18
  21. package/lib/esm/epic.js +1 -3
  22. package/lib/esm/index.js +2 -3
  23. package/lib/esm/view/companyHealthMetricView/companyHealthMetricConfigReducer.js +4 -1
  24. package/lib/esm/view/companyView/companyViewReducer.js +1 -55
  25. package/lib/esm/view/companyView/selector/companyManagementViewSelector.js +0 -31
  26. package/lib/esm/view/companyView/types/cockpitTypes.js +0 -2
  27. package/lib/esm/view/companyView/types/companyManagementViewState.js +0 -7
  28. package/lib/esm/view/companyView/types/companyPassport/companyPassportViewState.js +0 -4
  29. package/lib/esm/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +4 -1
  30. package/lib/esm/view/vendorTabView/vendorTabViewReducer.js +4 -1
  31. package/lib/index.d.ts +3 -3
  32. package/lib/index.js +33 -37
  33. package/lib/view/companyHealthMetricView/companyHealthMetricConfigReducer.d.ts +1 -1
  34. package/lib/view/companyHealthMetricView/companyHealthMetricConfigReducer.js +5 -2
  35. package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
  36. package/lib/view/companyView/companyViewReducer.d.ts +1 -19
  37. package/lib/view/companyView/companyViewReducer.js +3 -57
  38. package/lib/view/companyView/selector/companyManagementViewSelector.js +0 -31
  39. package/lib/view/companyView/types/cockpitTypes.d.ts +5 -5
  40. package/lib/view/companyView/types/cockpitTypes.js +0 -2
  41. package/lib/view/companyView/types/companyManagementViewState.d.ts +0 -2
  42. package/lib/view/companyView/types/companyManagementViewState.js +0 -8
  43. package/lib/view/companyView/types/companyPassport/companyPassportViewState.d.ts +0 -1
  44. package/lib/view/companyView/types/companyPassport/companyPassportViewState.js +0 -4
  45. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  46. package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
  47. package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewState.d.ts +1 -1
  48. package/lib/view/spendManagement/reimbursement/remisBulkActionView/remisBulkActionViewState.d.ts +1 -1
  49. package/lib/view/subscriptionView/types/subscriptionTypes.d.ts +1 -1
  50. package/lib/view/taskManager/taskListView/taskList.d.ts +1 -1
  51. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.d.ts +1 -1
  52. package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +5 -2
  53. package/lib/view/vendorTabView/vendorTabViewReducer.d.ts +1 -1
  54. package/lib/view/vendorTabView/vendorTabViewReducer.js +5 -2
  55. package/package.json +1 -1
  56. package/lib/esm/view/companyView/epic/companyPassport/updateCompanyProductServicesEpic.js +0 -81
  57. package/lib/esm/view/companyView/epic/updateCompanyQboRealmIdEpic.js +0 -62
  58. package/lib/view/companyView/epic/companyPassport/updateCompanyProductServicesEpic.d.ts +0 -10
  59. package/lib/view/companyView/epic/companyPassport/updateCompanyProductServicesEpic.js +0 -85
  60. package/lib/view/companyView/epic/updateCompanyQboRealmIdEpic.d.ts +0 -8
  61. package/lib/view/companyView/epic/updateCompanyQboRealmIdEpic.js +0 -66
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateCompanyQboRealmIdEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const companySelector_1 = require("../../../entity/company/companySelector");
7
- const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
8
- const responsePayload_1 = require("../../../responsePayload");
9
- const companyViewReducer_1 = require("../companyViewReducer");
10
- const updateCompanyQboRealmIdEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(companyViewReducer_1.updateCompanyQboRealmId.match),
11
- // Per-row admin action: several rows can be in flight at once, so each
12
- // trigger keeps its own request instead of cancelling the previous one.
13
- (0, operators_1.mergeMap)((action) => {
14
- const { companyId, qboRealmId } = action.payload;
15
- // Cockpit populates companyState (with a companyId->tenantId mapping) but
16
- // not tenantState, so resolve from company first and fall back to tenant.
17
- const tenantId = (0, companySelector_1.getCompanyByCompanyId)(state$.value.companyState, companyId)?.company
18
- .companyInfo.tenantId ??
19
- Object.values(state$.value.tenantState.tenantsById).find((tenant) => tenant?.companyId === companyId)?.tenantId;
20
- if (tenantId == null) {
21
- return (0, rxjs_1.from)([
22
- (0, companyViewReducer_1.updateCompanyQboRealmIdFailure)(companyId, (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', `No tenant found for companyId: ${companyId}`)),
23
- (0, snackbarReducer_1.openSnackbar)({
24
- messageSection: 'qbo_realm_id_update',
25
- messageText: 'failed',
26
- type: 'error',
27
- }),
28
- ]);
29
- }
30
- // The FE route reads the target tenant from the zeni-tenant-id header,
31
- // which overrides the operator's ambient tenant for this request only.
32
- // qboRealmId omitted -> null clears the pin; a value overwrites it.
33
- return zeniAPI
34
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/qbo-realm-id`, { qbo_realm_id: qboRealmId ?? null }, { 'zeni-tenant-id': tenantId })
35
- .pipe((0, operators_1.mergeMap)((response) => {
36
- if ((0, responsePayload_1.isSuccessResponse)(response)) {
37
- return (0, rxjs_1.from)([
38
- (0, companyViewReducer_1.updateCompanyQboRealmIdSuccess)({ companyId }),
39
- (0, snackbarReducer_1.openSnackbar)({
40
- messageSection: 'qbo_realm_id_update',
41
- messageText: 'success',
42
- type: 'success',
43
- }),
44
- ]);
45
- }
46
- return (0, rxjs_1.from)([
47
- (0, companyViewReducer_1.updateCompanyQboRealmIdFailure)(companyId, response.status),
48
- (0, snackbarReducer_1.openSnackbar)({
49
- messageSection: 'qbo_realm_id_update',
50
- messageText: 'failed',
51
- type: 'error',
52
- }),
53
- ]);
54
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
55
- (0, companyViewReducer_1.updateCompanyQboRealmIdFailure)(companyId, (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Update Company QBO realm id errored out' +
56
- (error instanceof Error
57
- ? error.message
58
- : JSON.stringify(error)))),
59
- (0, snackbarReducer_1.openSnackbar)({
60
- messageSection: 'qbo_realm_id_update',
61
- messageText: 'failed',
62
- type: 'error',
63
- }),
64
- ])));
65
- }));
66
- exports.updateCompanyQboRealmIdEpic = updateCompanyQboRealmIdEpic;