@zeniai/client-epic-state 5.0.25-beta0ND → 5.0.25-betaRD1
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/coreEpics.js +4 -1
- 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 +2 -0
- package/lib/entity/tenant/tenantReducer.d.ts +60 -1
- package/lib/entity/tenant/tenantReducer.js +143 -4
- package/lib/entity/tenant/tenantState.d.ts +8 -0
- package/lib/epic.js +4 -1
- package/lib/esm/coreEpics.js +4 -1
- 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 +139 -2
- package/lib/esm/epic.js +4 -1
- package/lib/esm/index.js +3 -4
- package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +0 -42
- package/lib/index.d.ts +3 -4
- package/lib/index.js +42 -32
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.d.ts +1 -15
- package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +0 -43
- package/package.json +1 -1
package/lib/coreEpics.js
CHANGED
|
@@ -21,7 +21,10 @@ const fetchExcludedResourcesEpic_1 = require("./entity/tenant/epic/fetchExcluded
|
|
|
21
21
|
const fetchExternalConnectionsEpic_1 = require("./entity/tenant/epic/fetchExternalConnectionsEpic");
|
|
22
22
|
const fetchSubscriptionSummaryForTenantEpic_1 = require("./entity/tenant/epic/fetchSubscriptionSummaryForTenantEpic");
|
|
23
23
|
const resendVerifyDeviceOTPEpic_1 = require("./entity/tenant/epic/resendVerifyDeviceOTPEpic");
|
|
24
|
+
const deleteConnectionEpic_1 = require("./entity/tenant/epic/deleteConnectionEpic");
|
|
25
|
+
const saveAPIKeyConnectionEpic_1 = require("./entity/tenant/epic/saveAPIKeyConnectionEpic");
|
|
24
26
|
const saveExternalConnectionEpic_1 = require("./entity/tenant/epic/saveExternalConnectionEpic");
|
|
27
|
+
const saveOAuthConnectionEpic_1 = require("./entity/tenant/epic/saveOAuthConnectionEpic");
|
|
25
28
|
const sendEmailMagicLinkToUserEpic_1 = require("./entity/tenant/epic/sendEmailMagicLinkToUserEpic");
|
|
26
29
|
const signInUserEpic_1 = require("./entity/tenant/epic/signInUserEpic");
|
|
27
30
|
const sessionHeartbeatEpic_1 = require("./entity/tenant/epic/sessionHeartbeatEpic");
|
|
@@ -49,7 +52,7 @@ const verifyOtpEpic_1 = require("./view/twoFactorAuthentication/verifyOtpEpic");
|
|
|
49
52
|
// RootActionType is only available in the dynamically imported epic.ts.
|
|
50
53
|
const coreRootEpic = (0, redux_observable_1.combineEpics)(
|
|
51
54
|
// Auth & tenant
|
|
52
|
-
clearAllEpic_1.clearAllEpic, doMagicLinkSignInEpic_1.doMagicLinkSignInEpic, signInUserEpic_1.doSignInEpic, signOutUserEpic_1.doSignOutEpic, sessionHeartbeatEpic_1.sessionHeartbeatEpic, fetchActiveTenantEpic_1.fetchActiveTenantEpic, fetchAllTenantsEpic_1.fetchAllTenantsEpic, fetchExcludedResourcesEpic_1.fetchExcludedResourcesEpic, fetchExternalConnectionsEpic_1.fetchExternalConnectionsEpic, fetchSubscriptionSummaryForTenantEpic_1.fetchSubscriptionSummaryForTenantEpic, resendVerifyDeviceOTPEpic_1.resendVerifyDeviceOTPEpic, saveExternalConnectionEpic_1.saveExternalConnectionEpic, sendEmailMagicLinkToUserEpic_1.sendEmailMagicLinkToUserEpic, verifyDeviceWithTwoFAEpic_1.verifyDeviceWithTwoFAEpic,
|
|
55
|
+
clearAllEpic_1.clearAllEpic, doMagicLinkSignInEpic_1.doMagicLinkSignInEpic, signInUserEpic_1.doSignInEpic, signOutUserEpic_1.doSignOutEpic, sessionHeartbeatEpic_1.sessionHeartbeatEpic, fetchActiveTenantEpic_1.fetchActiveTenantEpic, fetchAllTenantsEpic_1.fetchAllTenantsEpic, fetchExcludedResourcesEpic_1.fetchExcludedResourcesEpic, fetchExternalConnectionsEpic_1.fetchExternalConnectionsEpic, fetchSubscriptionSummaryForTenantEpic_1.fetchSubscriptionSummaryForTenantEpic, resendVerifyDeviceOTPEpic_1.resendVerifyDeviceOTPEpic, deleteConnectionEpic_1.deleteConnectionEpic, saveAPIKeyConnectionEpic_1.saveAPIKeyConnectionEpic, saveExternalConnectionEpic_1.saveExternalConnectionEpic, saveOAuthConnectionEpic_1.saveOAuthConnectionEpic, sendEmailMagicLinkToUserEpic_1.sendEmailMagicLinkToUserEpic, verifyDeviceWithTwoFAEpic_1.verifyDeviceWithTwoFAEpic,
|
|
53
56
|
// Toast
|
|
54
57
|
pushToastNotificationEpic_1.pushToastNotificationEpic,
|
|
55
58
|
// Collaboration
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { RootState } from '../../../reducer';
|
|
3
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
|
+
import { deleteConnection, deleteConnectionFailure, deleteConnectionSuccess } from '../tenantReducer';
|
|
5
|
+
export type ActionType = ReturnType<typeof deleteConnection> | ReturnType<typeof deleteConnectionSuccess> | ReturnType<typeof deleteConnectionFailure>;
|
|
6
|
+
export declare const deleteConnectionEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
7
|
+
payload: {
|
|
8
|
+
tenantId: string;
|
|
9
|
+
connectionId: string;
|
|
10
|
+
connectionType: "analytics" | "crm";
|
|
11
|
+
};
|
|
12
|
+
type: "tenant/deleteConnectionSuccess";
|
|
13
|
+
} | {
|
|
14
|
+
payload: {
|
|
15
|
+
tenantId: string;
|
|
16
|
+
status: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
17
|
+
};
|
|
18
|
+
type: "tenant/deleteConnectionFailure";
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteConnectionEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
+
const tenantReducer_1 = require("../tenantReducer");
|
|
8
|
+
const deleteConnectionEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(tenantReducer_1.deleteConnection.match), (0, operators_1.switchMap)((action) => zeniAPI
|
|
9
|
+
.deleteAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/connections/${action.payload.connectionId}`, undefined, Object.assign({ 'zeni-tenant-id': action.payload.tenantId }))
|
|
10
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
11
|
+
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
12
|
+
return (0, rxjs_1.from)([
|
|
13
|
+
(0, tenantReducer_1.deleteConnectionSuccess)(action.payload.tenantId, action.payload.connectionId, action.payload.connectionType),
|
|
14
|
+
]);
|
|
15
|
+
}
|
|
16
|
+
const status = response.status ??
|
|
17
|
+
(0, responsePayload_1.createZeniAPIStatus)('Failed to delete connection. Please try again.');
|
|
18
|
+
return (0, rxjs_1.from)([
|
|
19
|
+
(0, tenantReducer_1.deleteConnectionFailure)(action.payload.tenantId, status),
|
|
20
|
+
]);
|
|
21
|
+
}), (0, operators_1.catchError)((error) => {
|
|
22
|
+
const message = error instanceof Error
|
|
23
|
+
? error.message
|
|
24
|
+
: 'Unexpected error deleting connection.';
|
|
25
|
+
return (0, rxjs_1.from)([
|
|
26
|
+
(0, tenantReducer_1.deleteConnectionFailure)(action.payload.tenantId, (0, responsePayload_1.createZeniAPIStatus)(message)),
|
|
27
|
+
]);
|
|
28
|
+
}))));
|
|
29
|
+
exports.deleteConnectionEpic = deleteConnectionEpic;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { RootState } from '../../../reducer';
|
|
3
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
|
+
import { saveAPIKeyConnection, saveAPIKeyConnectionFailure, saveAPIKeyConnectionSuccess } from '../tenantReducer';
|
|
5
|
+
export type ActionType = ReturnType<typeof saveAPIKeyConnection> | ReturnType<typeof saveAPIKeyConnectionSuccess> | ReturnType<typeof saveAPIKeyConnectionFailure>;
|
|
6
|
+
export declare const saveAPIKeyConnectionEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
7
|
+
payload: {
|
|
8
|
+
tenantId: string;
|
|
9
|
+
connectionType: "analytics" | "crm";
|
|
10
|
+
connectionPayload: import("../tenantPayload").ConnectionDataPayload;
|
|
11
|
+
};
|
|
12
|
+
type: "tenant/saveAPIKeyConnectionSuccess";
|
|
13
|
+
} | {
|
|
14
|
+
payload: {
|
|
15
|
+
tenantId: string;
|
|
16
|
+
status: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
17
|
+
};
|
|
18
|
+
type: "tenant/saveAPIKeyConnectionFailure";
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.saveAPIKeyConnectionEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
+
const tenantReducer_1 = require("../tenantReducer");
|
|
8
|
+
const saveAPIKeyConnectionEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(tenantReducer_1.saveAPIKeyConnection.match), (0, operators_1.switchMap)((action) => zeniAPI
|
|
9
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/connections/${action.payload.connectionId}`, {
|
|
10
|
+
api_key: action.payload.credentials.api_key,
|
|
11
|
+
connection_name: action.payload.connectionName,
|
|
12
|
+
connection_type: action.payload.connectionType,
|
|
13
|
+
site: action.payload.credentials.site,
|
|
14
|
+
}, Object.assign({ 'zeni-tenant-id': action.payload.tenantId }))
|
|
15
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
16
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
17
|
+
return (0, rxjs_1.from)([
|
|
18
|
+
(0, tenantReducer_1.saveAPIKeyConnectionSuccess)(action.payload.tenantId, action.payload.connectionType, response.data // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
19
|
+
),
|
|
20
|
+
]);
|
|
21
|
+
}
|
|
22
|
+
const status = response.status ??
|
|
23
|
+
(0, responsePayload_1.createZeniAPIStatus)('Failed to save connection. Please try again.');
|
|
24
|
+
return (0, rxjs_1.from)([(0, tenantReducer_1.saveAPIKeyConnectionFailure)(action.payload.tenantId, status)]);
|
|
25
|
+
}), (0, operators_1.catchError)((error) => {
|
|
26
|
+
const message = error instanceof Error ? error.message : 'Unexpected error saving connection.';
|
|
27
|
+
return (0, rxjs_1.from)([
|
|
28
|
+
(0, tenantReducer_1.saveAPIKeyConnectionFailure)(action.payload.tenantId, (0, responsePayload_1.createZeniAPIStatus)(message)),
|
|
29
|
+
]);
|
|
30
|
+
}))));
|
|
31
|
+
exports.saveAPIKeyConnectionEpic = saveAPIKeyConnectionEpic;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { RootState } from '../../../reducer';
|
|
3
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
|
+
import { saveOAuthConnection, saveOAuthConnectionFailure, saveOAuthConnectionSuccess } from '../tenantReducer';
|
|
5
|
+
export type ActionType = ReturnType<typeof saveOAuthConnection> | ReturnType<typeof saveOAuthConnectionSuccess> | ReturnType<typeof saveOAuthConnectionFailure>;
|
|
6
|
+
export declare const saveOAuthConnectionEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
7
|
+
payload: {
|
|
8
|
+
tenantId: string;
|
|
9
|
+
connectionType: "analytics" | "crm";
|
|
10
|
+
connectionPayload: import("../tenantPayload").ConnectionDataPayload;
|
|
11
|
+
};
|
|
12
|
+
type: "tenant/saveOAuthConnectionSuccess";
|
|
13
|
+
} | {
|
|
14
|
+
payload: {
|
|
15
|
+
tenantId: string;
|
|
16
|
+
status: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
17
|
+
};
|
|
18
|
+
type: "tenant/saveOAuthConnectionFailure";
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.saveOAuthConnectionEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
+
const tenantReducer_1 = require("../tenantReducer");
|
|
8
|
+
const saveOAuthConnectionEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(tenantReducer_1.saveOAuthConnection.match), (0, operators_1.switchMap)((action) => zeniAPI
|
|
9
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/connections/${action.payload.connectionId}`, {
|
|
10
|
+
authorization_code: action.payload.credentials.authorization_code,
|
|
11
|
+
client_id: action.payload.credentials.client_id,
|
|
12
|
+
client_secret: action.payload.credentials.client_secret,
|
|
13
|
+
connection_name: action.payload.connectionName,
|
|
14
|
+
connection_type: action.payload.connectionType,
|
|
15
|
+
redirect_uri: action.payload.credentials.redirect_uri,
|
|
16
|
+
}, Object.assign({ 'zeni-tenant-id': action.payload.tenantId }))
|
|
17
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
18
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
19
|
+
return (0, rxjs_1.from)([
|
|
20
|
+
(0, tenantReducer_1.saveOAuthConnectionSuccess)(action.payload.tenantId, action.payload.connectionType, response.data // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
21
|
+
),
|
|
22
|
+
]);
|
|
23
|
+
}
|
|
24
|
+
const status = response.status ??
|
|
25
|
+
(0, responsePayload_1.createZeniAPIStatus)('Failed to save connection. Please try again.');
|
|
26
|
+
return (0, rxjs_1.from)([(0, tenantReducer_1.saveOAuthConnectionFailure)(action.payload.tenantId, status)]);
|
|
27
|
+
}), (0, operators_1.catchError)((error) => {
|
|
28
|
+
const message = error instanceof Error ? error.message : 'Unexpected error saving connection.';
|
|
29
|
+
return (0, rxjs_1.from)([
|
|
30
|
+
(0, tenantReducer_1.saveOAuthConnectionFailure)(action.payload.tenantId, (0, responsePayload_1.createZeniAPIStatus)(message)),
|
|
31
|
+
]);
|
|
32
|
+
}))));
|
|
33
|
+
exports.saveOAuthConnectionEpic = saveOAuthConnectionEpic;
|
|
@@ -139,7 +139,9 @@ type RoleResourcesResponse = ZeniAPIResponse<RoleResourcesData>;
|
|
|
139
139
|
interface ConnectionsPayload {
|
|
140
140
|
connections: {
|
|
141
141
|
accounting: ConnectionDataPayload[];
|
|
142
|
+
analytics: ConnectionDataPayload[];
|
|
142
143
|
payments: ConnectionDataPayload[];
|
|
144
|
+
crm?: ConnectionDataPayload[];
|
|
143
145
|
};
|
|
144
146
|
}
|
|
145
147
|
interface ConnectionWithMetaPayload {
|
|
@@ -13,6 +13,10 @@ export interface DoSignInPayload {
|
|
|
13
13
|
redirectUri: ZeniUrl;
|
|
14
14
|
sourceUri: ZeniUrl;
|
|
15
15
|
}
|
|
16
|
+
export declare const toExternalIntegrationType: (v: string) => "analytics" | "crm";
|
|
17
|
+
export type ExternalIntegrationType = ReturnType<typeof toExternalIntegrationType>;
|
|
18
|
+
export declare const toExternalSupportedTool: (v: string) => "chargebee" | "hubspot";
|
|
19
|
+
export type ExternalSupportedTool = ReturnType<typeof toExternalSupportedTool>;
|
|
16
20
|
export declare const initialState: TenantState;
|
|
17
21
|
export declare const updateTenants: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenants: TenantPayload[], userTenantPayload?: TenantUserPayload | undefined, tenantUpdated?: any], {
|
|
18
22
|
tenants: TenantPayload[];
|
|
@@ -80,7 +84,60 @@ export declare const updateTenants: import("@reduxjs/toolkit").ActionCreatorWith
|
|
|
80
84
|
}, "tenant/fetchExternalConnectionsFailure", never, never>, fetchExternalConnectionsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, externalConnections: ConnectionsPayload], {
|
|
81
85
|
tenantId: string;
|
|
82
86
|
externalConnections: ConnectionsPayload;
|
|
83
|
-
}, "tenant/fetchExternalConnectionsSuccess", never, never>,
|
|
87
|
+
}, "tenant/fetchExternalConnectionsSuccess", never, never>, saveAPIKeyConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "analytics" | "crm", connectionName: "chargebee" | "hubspot", credentials: {
|
|
88
|
+
api_key: string;
|
|
89
|
+
site: string;
|
|
90
|
+
}], {
|
|
91
|
+
tenantId: string;
|
|
92
|
+
connectionId: string;
|
|
93
|
+
connectionType: "analytics" | "crm";
|
|
94
|
+
connectionName: "chargebee" | "hubspot";
|
|
95
|
+
credentials: {
|
|
96
|
+
api_key: string;
|
|
97
|
+
site: string;
|
|
98
|
+
};
|
|
99
|
+
}, "tenant/saveAPIKeyConnection", never, never>, saveAPIKeyConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "analytics" | "crm", connectionPayload: ConnectionDataPayload], {
|
|
100
|
+
tenantId: string;
|
|
101
|
+
connectionType: "analytics" | "crm";
|
|
102
|
+
connectionPayload: ConnectionDataPayload;
|
|
103
|
+
}, "tenant/saveAPIKeyConnectionSuccess", never, never>, saveAPIKeyConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
104
|
+
tenantId: string;
|
|
105
|
+
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
106
|
+
}, "tenant/saveAPIKeyConnectionFailure", never, never>, saveOAuthConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "analytics" | "crm", connectionName: "chargebee" | "hubspot", credentials: {
|
|
107
|
+
authorization_code: string;
|
|
108
|
+
client_id: string;
|
|
109
|
+
client_secret: string;
|
|
110
|
+
redirect_uri: string;
|
|
111
|
+
}], {
|
|
112
|
+
tenantId: string;
|
|
113
|
+
connectionId: string;
|
|
114
|
+
connectionType: "analytics" | "crm";
|
|
115
|
+
connectionName: "chargebee" | "hubspot";
|
|
116
|
+
credentials: {
|
|
117
|
+
authorization_code: string;
|
|
118
|
+
client_id: string;
|
|
119
|
+
client_secret: string;
|
|
120
|
+
redirect_uri: string;
|
|
121
|
+
};
|
|
122
|
+
}, "tenant/saveOAuthConnection", never, never>, saveOAuthConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "analytics" | "crm", connectionPayload: ConnectionDataPayload], {
|
|
123
|
+
tenantId: string;
|
|
124
|
+
connectionType: "analytics" | "crm";
|
|
125
|
+
connectionPayload: ConnectionDataPayload;
|
|
126
|
+
}, "tenant/saveOAuthConnectionSuccess", never, never>, saveOAuthConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
127
|
+
tenantId: string;
|
|
128
|
+
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
129
|
+
}, "tenant/saveOAuthConnectionFailure", never, never>, deleteConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "analytics" | "crm"], {
|
|
130
|
+
tenantId: string;
|
|
131
|
+
connectionId: string;
|
|
132
|
+
connectionType: "analytics" | "crm";
|
|
133
|
+
}, "tenant/deleteConnection", never, never>, deleteConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "analytics" | "crm"], {
|
|
134
|
+
tenantId: string;
|
|
135
|
+
connectionId: string;
|
|
136
|
+
connectionType: "analytics" | "crm";
|
|
137
|
+
}, "tenant/deleteConnectionSuccess", never, never>, deleteConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
138
|
+
tenantId: string;
|
|
139
|
+
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
140
|
+
}, "tenant/deleteConnectionFailure", never, never>, clearAll: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[keepTenantCompanyState?: boolean | undefined], {
|
|
84
141
|
keepTenantCompanyState: boolean;
|
|
85
142
|
}, "tenant/clearAll", never, never>, fetchSubscriptionSummaryForTenant: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string], {
|
|
86
143
|
tenantId: string;
|
|
@@ -127,6 +184,8 @@ export declare const toRoleResource: (payload: RoleResourcePayload) => RoleResou
|
|
|
127
184
|
*/
|
|
128
185
|
export declare function mapConnectionsPayloadToState(connectionsPayload: ConnectionsPayload): {
|
|
129
186
|
accounting: Connection[];
|
|
187
|
+
analytics: Connection[];
|
|
188
|
+
crm: Connection[];
|
|
130
189
|
payments: Connection[];
|
|
131
190
|
};
|
|
132
191
|
export declare const toConnection: (payload: ConnectionDataPayload) => Connection;
|
|
@@ -4,19 +4,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
8
|
-
exports.toConnection = exports.toRoleResource = exports.resendVerifyDeviceOTPFailure = void 0;
|
|
7
|
+
exports.updateTenantReimbursementInfo = exports.removeOnboardingTenant = exports.updateOnboardingTenants = exports.updateSubscriptionSummaryForTenantFailure = exports.updateSubscriptionSummaryForTenantSuccess = exports.fetchSubscriptionSummaryForTenant = exports.clearAll = exports.deleteConnectionFailure = exports.deleteConnectionSuccess = exports.deleteConnection = exports.saveOAuthConnectionFailure = exports.saveOAuthConnectionSuccess = exports.saveOAuthConnection = exports.saveAPIKeyConnectionFailure = exports.saveAPIKeyConnectionSuccess = exports.saveAPIKeyConnection = exports.fetchExternalConnectionsSuccess = exports.fetchExternalConnectionsFailure = exports.saveExternalConnectionFailure = exports.saveExternalConnectionSuccess = exports.saveExternalConnection = exports.fetchExternalConnections = exports.updateLoggedInUser = exports.sessionHeartbeatFailure = exports.sessionHeartbeatSuccess = exports.sendSessionHeartbeat = exports.signOutSuccess = exports.doSignOut = exports.updateSignInState = exports.sendEmailMagicLinkToUserFailure = exports.sendEmailMagicLinkToUserSuccess = exports.sendEmailMagicLinkToUser = exports.magicLinkSignInFailure = exports.magicLinkSignInSuccess = exports.doMagicLinkSignIn = exports.doSignIn = exports.updateExcludedResourcesFailure = exports.updateExcludedResourcesSuccess = exports.fetchExcludedResources = exports.updateCurrentTenant = exports.updateTenantFailure = exports.updateTenantSuccess = exports.fetchActiveTenant = exports.updateTenantsFailure = exports.updateTenantsSuccess = exports.fetchAllTenants = exports.updateTenants = exports.initialState = exports.toExternalSupportedTool = exports.toExternalIntegrationType = void 0;
|
|
8
|
+
exports.toConnection = exports.toRoleResource = exports.resendVerifyDeviceOTPFailure = exports.resendVerifyDeviceOTPSuccess = exports.resendVerifyDeviceOTP = exports.verifyDeviceWithTwoFAFailure = exports.verifyDeviceWithTwoFASuccess = exports.verifyDeviceWithTwoFA = exports.updateTenantMasterTOSInfo = exports.updateTenantAccountingClassesEnabled = exports.trigger2FA = exports.resetSignInState = exports.updateTreasuryVideoViewedForLoggedInUser = exports.updateReferViewedForLoggedInUser = void 0;
|
|
9
9
|
exports.mapConnectionsPayloadToState = mapConnectionsPayloadToState;
|
|
10
10
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
11
11
|
const js_base64_1 = require("js-base64");
|
|
12
12
|
const assignWith_1 = __importDefault(require("lodash/assignWith"));
|
|
13
13
|
const urlPayload_1 = require("../../commonPayloadTypes/urlPayload");
|
|
14
|
+
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
14
15
|
const timePeriod_1 = require("../../commonStateTypes/timePeriod");
|
|
15
16
|
const netBurnOrIncomeStoryCardSelectorTypes_1 = require("../../view/netBurnOrIncomeStoryCard/netBurnOrIncomeStoryCardSelectorTypes");
|
|
16
17
|
const netBurnOrIncomeStoryCardState_1 = require("../../view/netBurnOrIncomeStoryCard/netBurnOrIncomeStoryCardState");
|
|
17
18
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
18
19
|
const subscriptionSummaryReducer_1 = require("../subscription/subscriptionSummary/subscriptionSummaryReducer");
|
|
19
20
|
const userRolePayload_1 = require("../userRole/userRolePayload");
|
|
21
|
+
const EXTERNAL_INTEGRATIONS_TYPES = ['analytics', 'crm'];
|
|
22
|
+
const toExternalIntegrationType = (v) => (0, stringToUnion_1.stringToUnion)(v, EXTERNAL_INTEGRATIONS_TYPES);
|
|
23
|
+
exports.toExternalIntegrationType = toExternalIntegrationType;
|
|
24
|
+
const EXTERNAL_SUPPORTED_TOOLS = ['chargebee', 'hubspot'];
|
|
25
|
+
const toExternalSupportedTool = (v) => (0, stringToUnion_1.stringToUnion)(v, EXTERNAL_SUPPORTED_TOOLS);
|
|
26
|
+
exports.toExternalSupportedTool = toExternalSupportedTool;
|
|
20
27
|
exports.initialState = {
|
|
21
28
|
fetchState: 'Not-Started',
|
|
22
29
|
error: undefined,
|
|
@@ -340,8 +347,13 @@ const tenant = (0, toolkit_1.createSlice)({
|
|
|
340
347
|
draft.externalConnectionsByTenant[action.payload.tenantId] = {
|
|
341
348
|
fetchState: 'In-Progress',
|
|
342
349
|
accounting: [],
|
|
350
|
+
analytics: [],
|
|
351
|
+
crm: [],
|
|
343
352
|
payments: [],
|
|
344
353
|
saveConnectionState: 'Not-Started',
|
|
354
|
+
saveAPIKeyConnectionState: 'Not-Started',
|
|
355
|
+
saveOAuthConnectionState: 'Not-Started',
|
|
356
|
+
deleteConnectionState: 'Not-Started',
|
|
345
357
|
error: undefined,
|
|
346
358
|
};
|
|
347
359
|
},
|
|
@@ -351,12 +363,17 @@ const tenant = (0, toolkit_1.createSlice)({
|
|
|
351
363
|
return { payload: { tenantId, externalConnections } };
|
|
352
364
|
},
|
|
353
365
|
reducer(draft, action) {
|
|
354
|
-
const { accounting, payments } = mapConnectionsPayloadToState(action.payload.externalConnections);
|
|
366
|
+
const { accounting, analytics, crm, payments } = mapConnectionsPayloadToState(action.payload.externalConnections);
|
|
355
367
|
draft.externalConnectionsByTenant[action.payload.tenantId] = {
|
|
356
368
|
fetchState: 'Completed',
|
|
357
369
|
accounting,
|
|
370
|
+
analytics,
|
|
371
|
+
crm,
|
|
358
372
|
payments,
|
|
359
373
|
saveConnectionState: 'Completed',
|
|
374
|
+
saveAPIKeyConnectionState: 'Not-Started',
|
|
375
|
+
saveOAuthConnectionState: 'Not-Started',
|
|
376
|
+
deleteConnectionState: 'Not-Started',
|
|
360
377
|
error: undefined,
|
|
361
378
|
};
|
|
362
379
|
},
|
|
@@ -370,8 +387,13 @@ const tenant = (0, toolkit_1.createSlice)({
|
|
|
370
387
|
draft.externalConnectionsByTenant[tenantId] = {
|
|
371
388
|
fetchState: 'Error',
|
|
372
389
|
accounting: [],
|
|
390
|
+
analytics: [],
|
|
391
|
+
crm: [],
|
|
373
392
|
payments: [],
|
|
374
393
|
saveConnectionState: 'Error',
|
|
394
|
+
saveAPIKeyConnectionState: 'Not-Started',
|
|
395
|
+
saveOAuthConnectionState: 'Not-Started',
|
|
396
|
+
deleteConnectionState: 'Not-Started',
|
|
375
397
|
error: status,
|
|
376
398
|
};
|
|
377
399
|
},
|
|
@@ -417,6 +439,121 @@ const tenant = (0, toolkit_1.createSlice)({
|
|
|
417
439
|
});
|
|
418
440
|
},
|
|
419
441
|
},
|
|
442
|
+
saveAPIKeyConnection: {
|
|
443
|
+
prepare(tenantId, connectionId, connectionType, connectionName, credentials) {
|
|
444
|
+
return { payload: { tenantId, connectionId, connectionType, connectionName, credentials } };
|
|
445
|
+
},
|
|
446
|
+
reducer(draft, action) {
|
|
447
|
+
const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
|
|
448
|
+
if (existing != null) {
|
|
449
|
+
existing.saveAPIKeyConnectionState = 'In-Progress';
|
|
450
|
+
existing.saveAPIKeyConnectionError = undefined;
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
},
|
|
454
|
+
saveAPIKeyConnectionSuccess: {
|
|
455
|
+
prepare(tenantId, connectionType, connectionPayload) {
|
|
456
|
+
return { payload: { tenantId, connectionType, connectionPayload } };
|
|
457
|
+
},
|
|
458
|
+
reducer(draft, action) {
|
|
459
|
+
const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
|
|
460
|
+
if (existing != null) {
|
|
461
|
+
existing.saveAPIKeyConnectionState = 'Completed';
|
|
462
|
+
existing[action.payload.connectionType] = [(0, exports.toConnection)(action.payload.connectionPayload)];
|
|
463
|
+
existing.saveAPIKeyConnectionError = undefined;
|
|
464
|
+
}
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
saveAPIKeyConnectionFailure: {
|
|
468
|
+
prepare(tenantId, status) {
|
|
469
|
+
return { payload: { tenantId, status } };
|
|
470
|
+
},
|
|
471
|
+
reducer(draft, action) {
|
|
472
|
+
const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
|
|
473
|
+
if (existing != null) {
|
|
474
|
+
existing.saveAPIKeyConnectionState = 'Error';
|
|
475
|
+
existing.saveAPIKeyConnectionError = action.payload.status;
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
},
|
|
479
|
+
saveOAuthConnection: {
|
|
480
|
+
prepare(tenantId, connectionId, connectionType, connectionName, credentials) {
|
|
481
|
+
return { payload: { tenantId, connectionId, connectionType, connectionName, credentials } };
|
|
482
|
+
},
|
|
483
|
+
reducer(draft, action) {
|
|
484
|
+
const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
|
|
485
|
+
if (existing != null) {
|
|
486
|
+
existing.saveOAuthConnectionState = 'In-Progress';
|
|
487
|
+
existing.saveOAuthConnectionError = undefined;
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
},
|
|
491
|
+
saveOAuthConnectionSuccess: {
|
|
492
|
+
prepare(tenantId, connectionType, connectionPayload) {
|
|
493
|
+
return { payload: { tenantId, connectionType, connectionPayload } };
|
|
494
|
+
},
|
|
495
|
+
reducer(draft, action) {
|
|
496
|
+
const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
|
|
497
|
+
if (existing != null) {
|
|
498
|
+
existing.saveOAuthConnectionState = 'Completed';
|
|
499
|
+
existing[action.payload.connectionType] = [(0, exports.toConnection)(action.payload.connectionPayload)];
|
|
500
|
+
existing.saveOAuthConnectionError = undefined;
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
},
|
|
504
|
+
saveOAuthConnectionFailure: {
|
|
505
|
+
prepare(tenantId, status) {
|
|
506
|
+
return { payload: { tenantId, status } };
|
|
507
|
+
},
|
|
508
|
+
reducer(draft, action) {
|
|
509
|
+
const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
|
|
510
|
+
if (existing != null) {
|
|
511
|
+
existing.saveOAuthConnectionState = 'Error';
|
|
512
|
+
existing.saveOAuthConnectionError = action.payload.status;
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
},
|
|
516
|
+
deleteConnection: {
|
|
517
|
+
prepare(tenantId, connectionId, connectionType) {
|
|
518
|
+
return { payload: { tenantId, connectionId, connectionType } };
|
|
519
|
+
},
|
|
520
|
+
reducer(draft, action) {
|
|
521
|
+
const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
|
|
522
|
+
if (existing != null) {
|
|
523
|
+
existing.deleteConnectionState = 'In-Progress';
|
|
524
|
+
existing.deleteConnectionError = undefined;
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
},
|
|
528
|
+
deleteConnectionSuccess: {
|
|
529
|
+
prepare(tenantId, connectionId, connectionType) {
|
|
530
|
+
return { payload: { tenantId, connectionId, connectionType } };
|
|
531
|
+
},
|
|
532
|
+
reducer(draft, action) {
|
|
533
|
+
const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
|
|
534
|
+
if (existing != null) {
|
|
535
|
+
existing.deleteConnectionState = 'Completed';
|
|
536
|
+
existing.deleteConnectionError = undefined;
|
|
537
|
+
const arr = existing[action.payload.connectionType];
|
|
538
|
+
const idx = arr.findIndex((c) => c.connectionId === action.payload.connectionId);
|
|
539
|
+
if (idx !== -1) {
|
|
540
|
+
arr[idx] = { ...arr[idx], isValid: false };
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
},
|
|
545
|
+
deleteConnectionFailure: {
|
|
546
|
+
prepare(tenantId, status) {
|
|
547
|
+
return { payload: { tenantId, status } };
|
|
548
|
+
},
|
|
549
|
+
reducer(draft, action) {
|
|
550
|
+
const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
|
|
551
|
+
if (existing != null) {
|
|
552
|
+
existing.deleteConnectionState = 'Error';
|
|
553
|
+
existing.deleteConnectionError = action.payload.status;
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
},
|
|
420
557
|
doSignOut(draft) {
|
|
421
558
|
draft.fetchState = 'Not-Started';
|
|
422
559
|
draft.signInState = 'Not-Started';
|
|
@@ -564,7 +701,7 @@ const tenant = (0, toolkit_1.createSlice)({
|
|
|
564
701
|
},
|
|
565
702
|
},
|
|
566
703
|
});
|
|
567
|
-
_a = tenant.actions, exports.updateTenants = _a.updateTenants, exports.fetchAllTenants = _a.fetchAllTenants, exports.updateTenantsSuccess = _a.updateTenantsSuccess, exports.updateTenantsFailure = _a.updateTenantsFailure, exports.fetchActiveTenant = _a.fetchActiveTenant, exports.updateTenantSuccess = _a.updateTenantSuccess, exports.updateTenantFailure = _a.updateTenantFailure, exports.updateCurrentTenant = _a.updateCurrentTenant, exports.fetchExcludedResources = _a.fetchExcludedResources, exports.updateExcludedResourcesSuccess = _a.updateExcludedResourcesSuccess, exports.updateExcludedResourcesFailure = _a.updateExcludedResourcesFailure, exports.doSignIn = _a.doSignIn, exports.doMagicLinkSignIn = _a.doMagicLinkSignIn, exports.magicLinkSignInSuccess = _a.magicLinkSignInSuccess, exports.magicLinkSignInFailure = _a.magicLinkSignInFailure, exports.sendEmailMagicLinkToUser = _a.sendEmailMagicLinkToUser, exports.sendEmailMagicLinkToUserSuccess = _a.sendEmailMagicLinkToUserSuccess, exports.sendEmailMagicLinkToUserFailure = _a.sendEmailMagicLinkToUserFailure, exports.updateSignInState = _a.updateSignInState, exports.doSignOut = _a.doSignOut, exports.signOutSuccess = _a.signOutSuccess, exports.sendSessionHeartbeat = _a.sendSessionHeartbeat, exports.sessionHeartbeatSuccess = _a.sessionHeartbeatSuccess, exports.sessionHeartbeatFailure = _a.sessionHeartbeatFailure, exports.updateLoggedInUser = _a.updateLoggedInUser, exports.fetchExternalConnections = _a.fetchExternalConnections, exports.saveExternalConnection = _a.saveExternalConnection, exports.saveExternalConnectionSuccess = _a.saveExternalConnectionSuccess, exports.saveExternalConnectionFailure = _a.saveExternalConnectionFailure, exports.fetchExternalConnectionsFailure = _a.fetchExternalConnectionsFailure, exports.fetchExternalConnectionsSuccess = _a.fetchExternalConnectionsSuccess, exports.clearAll = _a.clearAll, exports.fetchSubscriptionSummaryForTenant = _a.fetchSubscriptionSummaryForTenant, exports.updateSubscriptionSummaryForTenantSuccess = _a.updateSubscriptionSummaryForTenantSuccess, exports.updateSubscriptionSummaryForTenantFailure = _a.updateSubscriptionSummaryForTenantFailure, exports.updateOnboardingTenants = _a.updateOnboardingTenants, exports.removeOnboardingTenant = _a.removeOnboardingTenant, exports.updateTenantReimbursementInfo = _a.updateTenantReimbursementInfo, exports.updateReferViewedForLoggedInUser = _a.updateReferViewedForLoggedInUser, exports.updateTreasuryVideoViewedForLoggedInUser = _a.updateTreasuryVideoViewedForLoggedInUser, exports.resetSignInState = _a.resetSignInState, exports.trigger2FA = _a.trigger2FA, exports.updateTenantAccountingClassesEnabled = _a.updateTenantAccountingClassesEnabled, exports.updateTenantMasterTOSInfo = _a.updateTenantMasterTOSInfo, exports.verifyDeviceWithTwoFA = _a.verifyDeviceWithTwoFA, exports.verifyDeviceWithTwoFASuccess = _a.verifyDeviceWithTwoFASuccess, exports.verifyDeviceWithTwoFAFailure = _a.verifyDeviceWithTwoFAFailure, exports.resendVerifyDeviceOTP = _a.resendVerifyDeviceOTP, exports.resendVerifyDeviceOTPSuccess = _a.resendVerifyDeviceOTPSuccess, exports.resendVerifyDeviceOTPFailure = _a.resendVerifyDeviceOTPFailure;
|
|
704
|
+
_a = tenant.actions, exports.updateTenants = _a.updateTenants, exports.fetchAllTenants = _a.fetchAllTenants, exports.updateTenantsSuccess = _a.updateTenantsSuccess, exports.updateTenantsFailure = _a.updateTenantsFailure, exports.fetchActiveTenant = _a.fetchActiveTenant, exports.updateTenantSuccess = _a.updateTenantSuccess, exports.updateTenantFailure = _a.updateTenantFailure, exports.updateCurrentTenant = _a.updateCurrentTenant, exports.fetchExcludedResources = _a.fetchExcludedResources, exports.updateExcludedResourcesSuccess = _a.updateExcludedResourcesSuccess, exports.updateExcludedResourcesFailure = _a.updateExcludedResourcesFailure, exports.doSignIn = _a.doSignIn, exports.doMagicLinkSignIn = _a.doMagicLinkSignIn, exports.magicLinkSignInSuccess = _a.magicLinkSignInSuccess, exports.magicLinkSignInFailure = _a.magicLinkSignInFailure, exports.sendEmailMagicLinkToUser = _a.sendEmailMagicLinkToUser, exports.sendEmailMagicLinkToUserSuccess = _a.sendEmailMagicLinkToUserSuccess, exports.sendEmailMagicLinkToUserFailure = _a.sendEmailMagicLinkToUserFailure, exports.updateSignInState = _a.updateSignInState, exports.doSignOut = _a.doSignOut, exports.signOutSuccess = _a.signOutSuccess, exports.sendSessionHeartbeat = _a.sendSessionHeartbeat, exports.sessionHeartbeatSuccess = _a.sessionHeartbeatSuccess, exports.sessionHeartbeatFailure = _a.sessionHeartbeatFailure, exports.updateLoggedInUser = _a.updateLoggedInUser, exports.fetchExternalConnections = _a.fetchExternalConnections, exports.saveExternalConnection = _a.saveExternalConnection, exports.saveExternalConnectionSuccess = _a.saveExternalConnectionSuccess, exports.saveExternalConnectionFailure = _a.saveExternalConnectionFailure, exports.fetchExternalConnectionsFailure = _a.fetchExternalConnectionsFailure, exports.fetchExternalConnectionsSuccess = _a.fetchExternalConnectionsSuccess, exports.saveAPIKeyConnection = _a.saveAPIKeyConnection, exports.saveAPIKeyConnectionSuccess = _a.saveAPIKeyConnectionSuccess, exports.saveAPIKeyConnectionFailure = _a.saveAPIKeyConnectionFailure, exports.saveOAuthConnection = _a.saveOAuthConnection, exports.saveOAuthConnectionSuccess = _a.saveOAuthConnectionSuccess, exports.saveOAuthConnectionFailure = _a.saveOAuthConnectionFailure, exports.deleteConnection = _a.deleteConnection, exports.deleteConnectionSuccess = _a.deleteConnectionSuccess, exports.deleteConnectionFailure = _a.deleteConnectionFailure, exports.clearAll = _a.clearAll, exports.fetchSubscriptionSummaryForTenant = _a.fetchSubscriptionSummaryForTenant, exports.updateSubscriptionSummaryForTenantSuccess = _a.updateSubscriptionSummaryForTenantSuccess, exports.updateSubscriptionSummaryForTenantFailure = _a.updateSubscriptionSummaryForTenantFailure, exports.updateOnboardingTenants = _a.updateOnboardingTenants, exports.removeOnboardingTenant = _a.removeOnboardingTenant, exports.updateTenantReimbursementInfo = _a.updateTenantReimbursementInfo, exports.updateReferViewedForLoggedInUser = _a.updateReferViewedForLoggedInUser, exports.updateTreasuryVideoViewedForLoggedInUser = _a.updateTreasuryVideoViewedForLoggedInUser, exports.resetSignInState = _a.resetSignInState, exports.trigger2FA = _a.trigger2FA, exports.updateTenantAccountingClassesEnabled = _a.updateTenantAccountingClassesEnabled, exports.updateTenantMasterTOSInfo = _a.updateTenantMasterTOSInfo, exports.verifyDeviceWithTwoFA = _a.verifyDeviceWithTwoFA, exports.verifyDeviceWithTwoFASuccess = _a.verifyDeviceWithTwoFASuccess, exports.verifyDeviceWithTwoFAFailure = _a.verifyDeviceWithTwoFAFailure, exports.resendVerifyDeviceOTP = _a.resendVerifyDeviceOTP, exports.resendVerifyDeviceOTPSuccess = _a.resendVerifyDeviceOTPSuccess, exports.resendVerifyDeviceOTPFailure = _a.resendVerifyDeviceOTPFailure;
|
|
568
705
|
exports.default = tenant.reducer;
|
|
569
706
|
/**
|
|
570
707
|
* Converts tenants payload to Tenant and User State
|
|
@@ -692,6 +829,8 @@ function mapConnectionsPayloadToState(connectionsPayload) {
|
|
|
692
829
|
const { connections } = connectionsPayload;
|
|
693
830
|
return {
|
|
694
831
|
accounting: connections.accounting.map((payload) => (0, exports.toConnection)(payload)),
|
|
832
|
+
analytics: (connections.analytics ?? []).map((payload) => (0, exports.toConnection)(payload)),
|
|
833
|
+
crm: (connections.crm ?? []).map((payload) => (0, exports.toConnection)(payload)),
|
|
695
834
|
payments: connections.payments.map((payload) => (0, exports.toConnection)(payload)),
|
|
696
835
|
};
|
|
697
836
|
}
|
|
@@ -12,10 +12,18 @@ import { UserRoleType } from '../userRole/userRoleType';
|
|
|
12
12
|
import { AuthProvider } from './tenantReducer';
|
|
13
13
|
export interface TenantExternalConnections {
|
|
14
14
|
accounting: Connection[];
|
|
15
|
+
analytics: Connection[];
|
|
16
|
+
crm: Connection[];
|
|
17
|
+
deleteConnectionState: FetchState;
|
|
15
18
|
fetchState: FetchState;
|
|
16
19
|
payments: Connection[];
|
|
20
|
+
saveAPIKeyConnectionState: FetchState;
|
|
17
21
|
saveConnectionState: FetchState;
|
|
22
|
+
saveOAuthConnectionState: FetchState;
|
|
23
|
+
deleteConnectionError?: ZeniAPIStatus;
|
|
18
24
|
error?: ZeniAPIStatus;
|
|
25
|
+
saveAPIKeyConnectionError?: ZeniAPIStatus;
|
|
26
|
+
saveOAuthConnectionError?: ZeniAPIStatus;
|
|
19
27
|
}
|
|
20
28
|
export interface TenantState extends FetchedState {
|
|
21
29
|
accountLocked: boolean;
|