@zeniai/client-epic-state 5.0.81-beta0ND → 5.0.81-betaAD01
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/entity/aiCfo/aiCfoPayload.d.ts +2 -0
- package/lib/entity/aiCfo/aiCfoReducer.d.ts +1 -1
- package/lib/entity/aiCfo/aiCfoReducer.js +33 -3
- package/lib/entity/aiCfo/aiCfoSelector.js +13 -1
- package/lib/entity/aiCfo/aiCfoState.d.ts +2 -0
- package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +0 -1
- package/lib/entity/paymentAccount/paymentAccountSelector.js +0 -4
- package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.d.ts +3 -3
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.d.ts +25 -38
- package/lib/entity/tenant/tenantReducer.js +5 -65
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/epic.d.ts +2 -3
- package/lib/epic.js +2 -4
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +32 -2
- package/lib/esm/entity/aiCfo/aiCfoSelector.js +13 -1
- package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +0 -3
- package/lib/esm/entity/tenant/tenantReducer.js +3 -63
- package/lib/esm/epic.js +2 -4
- package/lib/esm/index.js +6 -9
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +11 -1
- package/lib/esm/view/aiCfoView/epics/updateChatSessionPinEpic.js +46 -0
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +50 -61
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +52 -71
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +0 -2
- package/lib/index.d.ts +6 -10
- package/lib/index.js +18 -29
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +4 -1
- package/lib/view/aiCfoView/aiCfoViewReducer.js +12 -2
- package/lib/view/aiCfoView/epics/updateChatSessionPinEpic.d.ts +8 -0
- package/lib/view/aiCfoView/epics/updateChatSessionPinEpic.js +50 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +2 -25
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +51 -62
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +0 -10
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +2 -24
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +53 -72
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +0 -4
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +0 -2
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -12
- package/package.json +1 -2
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +0 -21
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -54
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -50
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -49
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -58
- package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -12
- package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -205
- package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -28
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +0 -8
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -53
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +0 -8
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -62
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +0 -27
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -15
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +0 -24
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -213
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +0 -125
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -32
|
@@ -8,7 +8,7 @@ export declare const setNewSession: import("@reduxjs/toolkit").ActionCreatorWith
|
|
|
8
8
|
chatSessionId: ID;
|
|
9
9
|
createdAt: ZeniDate;
|
|
10
10
|
userId: ID;
|
|
11
|
-
}, "aiCfo/setNewSession">, clearSession: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "aiCfo/clearSession">, setSessions: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChatSessionPayload[], "aiCfo/setSessions">, setChatHistory: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
11
|
+
}, "aiCfo/setNewSession">, clearSession: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "aiCfo/clearSession">, setSessions: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChatSessionPayload[], "aiCfo/setSessions">, mergeChatSessionFromPutResponse: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChatSessionPayload, "aiCfo/mergeChatSessionFromPutResponse">, setChatHistory: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
12
12
|
chatSessionId: ID;
|
|
13
13
|
history: MessagePayload[];
|
|
14
14
|
isPaginationComplete?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.deleteQuestion = exports.clearAiCfo = exports.addQuestionPayload = exports.upsertOrAddQuestionAnswerPayload = exports.upsertAnswerPayload = exports.setChatHistory = exports.setSessions = exports.clearSession = exports.setNewSession = exports.toAiCfoVisualization = exports.initialAiCfoState = void 0;
|
|
4
|
+
exports.deleteQuestion = exports.clearAiCfo = exports.addQuestionPayload = exports.upsertOrAddQuestionAnswerPayload = exports.upsertAnswerPayload = exports.setChatHistory = exports.mergeChatSessionFromPutResponse = exports.setSessions = exports.clearSession = exports.setNewSession = exports.toAiCfoVisualization = exports.initialAiCfoState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
7
7
|
const aiCfoState_1 = require("./aiCfoState");
|
|
@@ -241,8 +241,20 @@ const aiCfo = (0, toolkit_1.createSlice)({
|
|
|
241
241
|
// Clear any existing partial Q&A for this session
|
|
242
242
|
draft.partialQuestionAnswers[chat_session_id] = undefined;
|
|
243
243
|
}
|
|
244
|
+
else {
|
|
245
|
+
const row = draft.aiCfoByChatSessionId[chat_session_id];
|
|
246
|
+
row.chatSession = mergeChatSessionFromPayload(row.chatSession, chatSessionPayload);
|
|
247
|
+
}
|
|
244
248
|
});
|
|
245
249
|
},
|
|
250
|
+
mergeChatSessionFromPutResponse(draft, action) {
|
|
251
|
+
const id = action.payload.chat_session_id;
|
|
252
|
+
const row = draft.aiCfoByChatSessionId[id];
|
|
253
|
+
if (row == null) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
row.chatSession = mergeChatSessionFromPayload(row.chatSession, action.payload);
|
|
257
|
+
},
|
|
246
258
|
setChatHistory(draft, action) {
|
|
247
259
|
const { chatSessionId, history, isPaginationComplete = false, } = action.payload;
|
|
248
260
|
if (draft.aiCfoByChatSessionId[chatSessionId] == null) {
|
|
@@ -484,14 +496,32 @@ const aiCfo = (0, toolkit_1.createSlice)({
|
|
|
484
496
|
},
|
|
485
497
|
},
|
|
486
498
|
});
|
|
499
|
+
const mergeChatSessionFromPayload = (prev, payload) => {
|
|
500
|
+
const next = { ...prev };
|
|
501
|
+
next.chatSessionSummary =
|
|
502
|
+
payload.chat_session_summary !== undefined
|
|
503
|
+
? (payload.chat_session_summary ?? undefined)
|
|
504
|
+
: prev.chatSessionSummary;
|
|
505
|
+
if (payload.is_pinned !== undefined) {
|
|
506
|
+
next.isPinned = payload.is_pinned;
|
|
507
|
+
}
|
|
508
|
+
if (payload.pinned_at != null) {
|
|
509
|
+
next.pinnedAt = (0, zeniDayJS_1.date)(payload.pinned_at);
|
|
510
|
+
}
|
|
511
|
+
else if (payload.is_pinned === false) {
|
|
512
|
+
next.pinnedAt = undefined;
|
|
513
|
+
}
|
|
514
|
+
return next;
|
|
515
|
+
};
|
|
487
516
|
const toChatSession = (chatSessionPayload) => {
|
|
488
517
|
const { chat_session_id, user_id, created_at, chat_session_summary } = chatSessionPayload;
|
|
489
|
-
|
|
518
|
+
const base = {
|
|
490
519
|
chatSessionId: chat_session_id,
|
|
491
520
|
userId: user_id,
|
|
492
521
|
chatSessionSummary: chat_session_summary ?? undefined,
|
|
493
522
|
createdAt: (0, zeniDayJS_1.date)(created_at),
|
|
494
523
|
};
|
|
524
|
+
return mergeChatSessionFromPayload(base, chatSessionPayload);
|
|
495
525
|
};
|
|
496
|
-
_a = aiCfo.actions, exports.setNewSession = _a.setNewSession, exports.clearSession = _a.clearSession, exports.setSessions = _a.setSessions, exports.setChatHistory = _a.setChatHistory, exports.upsertAnswerPayload = _a.upsertAnswerPayload, exports.upsertOrAddQuestionAnswerPayload = _a.upsertOrAddQuestionAnswerPayload, exports.addQuestionPayload = _a.addQuestionPayload, exports.clearAiCfo = _a.clearAiCfo, exports.deleteQuestion = _a.deleteQuestion;
|
|
526
|
+
_a = aiCfo.actions, exports.setNewSession = _a.setNewSession, exports.clearSession = _a.clearSession, exports.setSessions = _a.setSessions, exports.mergeChatSessionFromPutResponse = _a.mergeChatSessionFromPutResponse, exports.setChatHistory = _a.setChatHistory, exports.upsertAnswerPayload = _a.upsertAnswerPayload, exports.upsertOrAddQuestionAnswerPayload = _a.upsertOrAddQuestionAnswerPayload, exports.addQuestionPayload = _a.addQuestionPayload, exports.clearAiCfo = _a.clearAiCfo, exports.deleteQuestion = _a.deleteQuestion;
|
|
497
527
|
exports.default = aiCfo.reducer;
|
|
@@ -37,6 +37,18 @@ function getAiCfoSelectorView(state) {
|
|
|
37
37
|
.sort((a, b) => a.question.createdAt.valueOf() - b.question.createdAt.valueOf())
|
|
38
38
|
: [],
|
|
39
39
|
}))
|
|
40
|
-
.sort((a, b) =>
|
|
40
|
+
.sort((a, b) => {
|
|
41
|
+
const aPinned = a.chatSession.isPinned === true;
|
|
42
|
+
const bPinned = b.chatSession.isPinned === true;
|
|
43
|
+
if (aPinned !== bPinned) {
|
|
44
|
+
return aPinned ? -1 : 1;
|
|
45
|
+
}
|
|
46
|
+
if (aPinned && bPinned) {
|
|
47
|
+
const aPinKey = (a.chatSession.pinnedAt ?? a.chatSession.createdAt).valueOf();
|
|
48
|
+
const bPinKey = (b.chatSession.pinnedAt ?? b.chatSession.createdAt).valueOf();
|
|
49
|
+
return bPinKey - aPinKey;
|
|
50
|
+
}
|
|
51
|
+
return (b.chatSession.createdAt.valueOf() - a.chatSession.createdAt.valueOf());
|
|
52
|
+
});
|
|
41
53
|
return { allSessionsWithOrderedQuestionAnswers };
|
|
42
54
|
}
|
|
@@ -4,4 +4,3 @@ export declare function getPaymentAccountsByPaymentAccountIds(paymentAccountStat
|
|
|
4
4
|
export declare function getPaymentAccountByPaymentAccountId(paymentAccountState: PaymentAccountState, PaymentAccountId: ID): PaymentAccount | undefined;
|
|
5
5
|
export declare function getPaymentAccountByBankAccountId(paymentAccountState: PaymentAccountState, bankAccountId: ID): PaymentAccount | undefined;
|
|
6
6
|
export declare function getPaymentAccountsByBankAccountIds(paymentAccountState: PaymentAccountState, bankAccountIds: ID[]): PaymentAccount[];
|
|
7
|
-
export declare function getPlaidPaymentAccounts(paymentAccountState: PaymentAccountState): PaymentAccount[];
|
|
@@ -7,7 +7,6 @@ exports.getPaymentAccountsByPaymentAccountIds = getPaymentAccountsByPaymentAccou
|
|
|
7
7
|
exports.getPaymentAccountByPaymentAccountId = getPaymentAccountByPaymentAccountId;
|
|
8
8
|
exports.getPaymentAccountByBankAccountId = getPaymentAccountByBankAccountId;
|
|
9
9
|
exports.getPaymentAccountsByBankAccountIds = getPaymentAccountsByBankAccountIds;
|
|
10
|
-
exports.getPlaidPaymentAccounts = getPlaidPaymentAccounts;
|
|
11
10
|
const get_1 = __importDefault(require("lodash/get"));
|
|
12
11
|
const values_1 = __importDefault(require("lodash/values"));
|
|
13
12
|
function getPaymentAccountsByPaymentAccountIds(paymentAccountState, paymentAccountIds) {
|
|
@@ -29,6 +28,3 @@ function getPaymentAccountsByBankAccountIds(paymentAccountState, bankAccountIds)
|
|
|
29
28
|
.filter((value) => value != null);
|
|
30
29
|
return paymentAccounts;
|
|
31
30
|
}
|
|
32
|
-
function getPlaidPaymentAccounts(paymentAccountState) {
|
|
33
|
-
return (0, values_1.default)(paymentAccountState.paymentAccountByID).filter((account) => account.provider === 'plaid');
|
|
34
|
-
}
|
|
@@ -7,7 +7,7 @@ export declare const deleteConnectionEpic: (actions$: ActionsObservable<ActionTy
|
|
|
7
7
|
payload: {
|
|
8
8
|
tenantId: string;
|
|
9
9
|
connectionId: string;
|
|
10
|
-
connectionType: "revenue" | "
|
|
10
|
+
connectionType: "revenue" | "payments";
|
|
11
11
|
};
|
|
12
12
|
type: "tenant/deleteConnectionSuccess";
|
|
13
13
|
} | {
|
|
@@ -6,7 +6,7 @@ export type ActionType = ReturnType<typeof saveAPIKeyConnection> | ReturnType<ty
|
|
|
6
6
|
export declare const saveAPIKeyConnectionEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
7
7
|
payload: {
|
|
8
8
|
tenantId: string;
|
|
9
|
-
connectionType: "revenue" | "
|
|
9
|
+
connectionType: "revenue" | "payments";
|
|
10
10
|
connectionPayload: import("../tenantPayload").ConnectionDataPayload;
|
|
11
11
|
};
|
|
12
12
|
type: "tenant/saveAPIKeyConnectionSuccess";
|
|
@@ -6,15 +6,15 @@ export type ActionType = ReturnType<typeof saveConnectorCredentials> | ReturnTyp
|
|
|
6
6
|
export declare const saveConnectorCredentialsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
7
7
|
payload: {
|
|
8
8
|
tenantId: string;
|
|
9
|
-
connectionType: "revenue" | "
|
|
10
|
-
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal"
|
|
9
|
+
connectionType: "revenue" | "payments";
|
|
10
|
+
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal";
|
|
11
11
|
connectionPayload: import("../tenantPayload").ConnectionDataPayload;
|
|
12
12
|
};
|
|
13
13
|
type: "tenant/saveConnectorCredentialsSuccess";
|
|
14
14
|
} | {
|
|
15
15
|
payload: {
|
|
16
16
|
tenantId: string;
|
|
17
|
-
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal"
|
|
17
|
+
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal";
|
|
18
18
|
status: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
19
19
|
};
|
|
20
20
|
type: "tenant/saveConnectorCredentialsFailure";
|
|
@@ -6,7 +6,7 @@ export type ActionType = ReturnType<typeof saveOAuthConnection> | ReturnType<typ
|
|
|
6
6
|
export declare const saveOAuthConnectionEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
7
7
|
payload: {
|
|
8
8
|
tenantId: string;
|
|
9
|
-
connectionType: "revenue" | "
|
|
9
|
+
connectionType: "revenue" | "payments";
|
|
10
10
|
connectionPayload: import("../tenantPayload").ConnectionDataPayload;
|
|
11
11
|
};
|
|
12
12
|
type: "tenant/saveOAuthConnectionSuccess";
|
|
@@ -13,9 +13,9 @@ export interface DoSignInPayload {
|
|
|
13
13
|
redirectUri: ZeniUrl;
|
|
14
14
|
sourceUri: ZeniUrl;
|
|
15
15
|
}
|
|
16
|
-
export declare const toExternalIntegrationType: (v: string) => "revenue" | "
|
|
16
|
+
export declare const toExternalIntegrationType: (v: string) => "revenue" | "payments";
|
|
17
17
|
export type ExternalIntegrationType = ReturnType<typeof toExternalIntegrationType>;
|
|
18
|
-
export declare const toExternalSupportedTool: (v: string) => "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal"
|
|
18
|
+
export declare const toExternalSupportedTool: (v: string) => "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal";
|
|
19
19
|
export type ExternalSupportedTool = ReturnType<typeof toExternalSupportedTool>;
|
|
20
20
|
export type ConnectorCredentialsBySlug = {
|
|
21
21
|
connectionName: 'stripe';
|
|
@@ -101,26 +101,26 @@ export declare const updateTenants: import("@reduxjs/toolkit").ActionCreatorWith
|
|
|
101
101
|
}, "tenant/fetchExternalConnectionsFailure", never, never>, fetchExternalConnectionsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, externalConnections: ConnectionsPayload], {
|
|
102
102
|
tenantId: string;
|
|
103
103
|
externalConnections: ConnectionsPayload;
|
|
104
|
-
}, "tenant/fetchExternalConnectionsSuccess", never, never>, saveAPIKeyConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "
|
|
104
|
+
}, "tenant/fetchExternalConnectionsSuccess", never, never>, saveAPIKeyConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "payments", connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal", credentials: {
|
|
105
105
|
api_key: string;
|
|
106
106
|
site: string;
|
|
107
107
|
}], {
|
|
108
108
|
tenantId: string;
|
|
109
109
|
connectionId: string;
|
|
110
|
-
connectionType: "revenue" | "
|
|
111
|
-
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal"
|
|
110
|
+
connectionType: "revenue" | "payments";
|
|
111
|
+
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal";
|
|
112
112
|
credentials: {
|
|
113
113
|
api_key: string;
|
|
114
114
|
site: string;
|
|
115
115
|
};
|
|
116
|
-
}, "tenant/saveAPIKeyConnection", never, never>, saveAPIKeyConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "
|
|
116
|
+
}, "tenant/saveAPIKeyConnection", never, never>, saveAPIKeyConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "payments", connectionPayload: ConnectionDataPayload], {
|
|
117
117
|
tenantId: string;
|
|
118
|
-
connectionType: "revenue" | "
|
|
118
|
+
connectionType: "revenue" | "payments";
|
|
119
119
|
connectionPayload: ConnectionDataPayload;
|
|
120
120
|
}, "tenant/saveAPIKeyConnectionSuccess", never, never>, saveAPIKeyConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
121
121
|
tenantId: string;
|
|
122
122
|
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
123
|
-
}, "tenant/saveAPIKeyConnectionFailure", never, never>, saveOAuthConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "
|
|
123
|
+
}, "tenant/saveAPIKeyConnectionFailure", never, never>, saveOAuthConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "payments", connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal", credentials: {
|
|
124
124
|
authorization_code: string;
|
|
125
125
|
client_id: string;
|
|
126
126
|
client_secret: string;
|
|
@@ -128,35 +128,35 @@ export declare const updateTenants: import("@reduxjs/toolkit").ActionCreatorWith
|
|
|
128
128
|
}], {
|
|
129
129
|
tenantId: string;
|
|
130
130
|
connectionId: string;
|
|
131
|
-
connectionType: "revenue" | "
|
|
132
|
-
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal"
|
|
131
|
+
connectionType: "revenue" | "payments";
|
|
132
|
+
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal";
|
|
133
133
|
credentials: {
|
|
134
134
|
authorization_code: string;
|
|
135
135
|
client_id: string;
|
|
136
136
|
client_secret: string;
|
|
137
137
|
redirect_uri: string;
|
|
138
138
|
};
|
|
139
|
-
}, "tenant/saveOAuthConnection", never, never>, saveOAuthConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "
|
|
139
|
+
}, "tenant/saveOAuthConnection", never, never>, saveOAuthConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "payments", connectionPayload: ConnectionDataPayload], {
|
|
140
140
|
tenantId: string;
|
|
141
|
-
connectionType: "revenue" | "
|
|
141
|
+
connectionType: "revenue" | "payments";
|
|
142
142
|
connectionPayload: ConnectionDataPayload;
|
|
143
143
|
}, "tenant/saveOAuthConnectionSuccess", never, never>, saveOAuthConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
144
144
|
tenantId: string;
|
|
145
145
|
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
146
|
-
}, "tenant/saveOAuthConnectionFailure", never, never>, saveConnectorCredentials: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "
|
|
146
|
+
}, "tenant/saveOAuthConnectionFailure", never, never>, saveConnectorCredentials: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "payments", args: ConnectorCredentialsBySlug], {
|
|
147
147
|
connectionName: "stripe";
|
|
148
148
|
credentials: {
|
|
149
149
|
api_key: string;
|
|
150
150
|
};
|
|
151
151
|
tenantId: string;
|
|
152
|
-
connectionType: "revenue" | "
|
|
152
|
+
connectionType: "revenue" | "payments";
|
|
153
153
|
} | {
|
|
154
154
|
connectionName: "mercury";
|
|
155
155
|
credentials: {
|
|
156
156
|
api_key: string;
|
|
157
157
|
};
|
|
158
158
|
tenantId: string;
|
|
159
|
-
connectionType: "revenue" | "
|
|
159
|
+
connectionType: "revenue" | "payments";
|
|
160
160
|
} | {
|
|
161
161
|
connectionName: "paypal";
|
|
162
162
|
credentials: {
|
|
@@ -164,36 +164,24 @@ export declare const updateTenants: import("@reduxjs/toolkit").ActionCreatorWith
|
|
|
164
164
|
client_secret: string;
|
|
165
165
|
};
|
|
166
166
|
tenantId: string;
|
|
167
|
-
connectionType: "revenue" | "
|
|
168
|
-
}, "tenant/saveConnectorCredentials", never, never>, saveConnectorCredentialsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "
|
|
167
|
+
connectionType: "revenue" | "payments";
|
|
168
|
+
}, "tenant/saveConnectorCredentials", never, never>, saveConnectorCredentialsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "payments", connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal", connectionPayload: ConnectionDataPayload], {
|
|
169
169
|
tenantId: string;
|
|
170
|
-
connectionType: "revenue" | "
|
|
171
|
-
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal"
|
|
170
|
+
connectionType: "revenue" | "payments";
|
|
171
|
+
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal";
|
|
172
172
|
connectionPayload: ConnectionDataPayload;
|
|
173
|
-
}, "tenant/saveConnectorCredentialsSuccess", never, never>, saveConnectorCredentialsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal"
|
|
173
|
+
}, "tenant/saveConnectorCredentialsSuccess", never, never>, saveConnectorCredentialsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal", status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
174
174
|
tenantId: string;
|
|
175
|
-
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal"
|
|
175
|
+
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal";
|
|
176
176
|
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
177
|
-
}, "tenant/saveConnectorCredentialsFailure", never, never>,
|
|
178
|
-
tenantId: string;
|
|
179
|
-
provider: "gmail" | "outlook";
|
|
180
|
-
redirectAfterUrl: string;
|
|
181
|
-
}, "tenant/initEmailConnectOAuth", never, never>, initEmailConnectOAuthSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, provider: "gmail" | "outlook", authorizationUrl: string], {
|
|
182
|
-
tenantId: string;
|
|
183
|
-
provider: "gmail" | "outlook";
|
|
184
|
-
authorizationUrl: string;
|
|
185
|
-
}, "tenant/initEmailConnectOAuthSuccess", never, never>, initEmailConnectOAuthFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, provider: "gmail" | "outlook", status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
186
|
-
tenantId: string;
|
|
187
|
-
provider: "gmail" | "outlook";
|
|
188
|
-
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
189
|
-
}, "tenant/initEmailConnectOAuthFailure", never, never>, deleteConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payments"], {
|
|
177
|
+
}, "tenant/saveConnectorCredentialsFailure", never, never>, deleteConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "payments"], {
|
|
190
178
|
tenantId: string;
|
|
191
179
|
connectionId: string;
|
|
192
|
-
connectionType: "revenue" | "
|
|
193
|
-
}, "tenant/deleteConnection", never, never>, deleteConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "
|
|
180
|
+
connectionType: "revenue" | "payments";
|
|
181
|
+
}, "tenant/deleteConnection", never, never>, deleteConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "payments"], {
|
|
194
182
|
tenantId: string;
|
|
195
183
|
connectionId: string;
|
|
196
|
-
connectionType: "revenue" | "
|
|
184
|
+
connectionType: "revenue" | "payments";
|
|
197
185
|
}, "tenant/deleteConnectionSuccess", never, never>, deleteConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
198
186
|
tenantId: string;
|
|
199
187
|
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
@@ -244,7 +232,6 @@ export declare const toRoleResource: (payload: RoleResourcePayload) => RoleResou
|
|
|
244
232
|
*/
|
|
245
233
|
export declare function mapConnectionsPayloadToState(connectionsPayload: ConnectionsPayload): {
|
|
246
234
|
accounting: Connection[];
|
|
247
|
-
email: Connection[];
|
|
248
235
|
payments: Connection[];
|
|
249
236
|
revenue: Connection[];
|
|
250
237
|
};
|
|
@@ -4,8 +4,8 @@ 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 = exports.resendVerifyDeviceOTPSuccess = exports.resendVerifyDeviceOTP = exports.verifyDeviceWithTwoFAFailure = exports.verifyDeviceWithTwoFASuccess = exports.verifyDeviceWithTwoFA = exports.updateTenantMasterTOSInfo = exports.updateTenantAccountingClassesEnabled = exports.trigger2FA = exports.resetSignInState = exports.updateTreasuryVideoViewedForLoggedInUser = exports.updateReferViewedForLoggedInUser = exports.updateTenantReimbursementInfo = exports.removeOnboardingTenant = exports.updateOnboardingTenants =
|
|
7
|
+
exports.updateSubscriptionSummaryForTenantFailure = exports.updateSubscriptionSummaryForTenantSuccess = exports.fetchSubscriptionSummaryForTenant = exports.clearAll = exports.deleteConnectionFailure = exports.deleteConnectionSuccess = exports.deleteConnection = exports.saveConnectorCredentialsFailure = exports.saveConnectorCredentialsSuccess = exports.saveConnectorCredentials = 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 = exports.updateTenantReimbursementInfo = exports.removeOnboardingTenant = exports.updateOnboardingTenants = void 0;
|
|
9
9
|
exports.mapConnectionsPayloadToState = mapConnectionsPayloadToState;
|
|
10
10
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
11
11
|
const js_base64_1 = require("js-base64");
|
|
@@ -18,7 +18,7 @@ const netBurnOrIncomeStoryCardState_1 = require("../../view/netBurnOrIncomeStory
|
|
|
18
18
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
19
19
|
const subscriptionSummaryReducer_1 = require("../subscription/subscriptionSummary/subscriptionSummaryReducer");
|
|
20
20
|
const userRolePayload_1 = require("../userRole/userRolePayload");
|
|
21
|
-
const EXTERNAL_INTEGRATION_TYPES = ['revenue', 'payments'
|
|
21
|
+
const EXTERNAL_INTEGRATION_TYPES = ['revenue', 'payments'];
|
|
22
22
|
const toExternalIntegrationType = (v) => (0, stringToUnion_1.stringToUnion)(v, EXTERNAL_INTEGRATION_TYPES);
|
|
23
23
|
exports.toExternalIntegrationType = toExternalIntegrationType;
|
|
24
24
|
const EXTERNAL_SUPPORTED_TOOLS = [
|
|
@@ -27,8 +27,6 @@ const EXTERNAL_SUPPORTED_TOOLS = [
|
|
|
27
27
|
'stripe',
|
|
28
28
|
'mercury',
|
|
29
29
|
'paypal',
|
|
30
|
-
'gmail',
|
|
31
|
-
'outlook',
|
|
32
30
|
];
|
|
33
31
|
const toExternalSupportedTool = (v) => (0, stringToUnion_1.stringToUnion)(v, EXTERNAL_SUPPORTED_TOOLS);
|
|
34
32
|
exports.toExternalSupportedTool = toExternalSupportedTool;
|
|
@@ -355,7 +353,6 @@ const tenant = (0, toolkit_1.createSlice)({
|
|
|
355
353
|
draft.externalConnectionsByTenant[action.payload.tenantId] = {
|
|
356
354
|
fetchState: 'In-Progress',
|
|
357
355
|
accounting: [],
|
|
358
|
-
email: [],
|
|
359
356
|
payments: [],
|
|
360
357
|
revenue: [],
|
|
361
358
|
saveConnectionState: 'Not-Started',
|
|
@@ -373,11 +370,10 @@ const tenant = (0, toolkit_1.createSlice)({
|
|
|
373
370
|
return { payload: { tenantId, externalConnections } };
|
|
374
371
|
},
|
|
375
372
|
reducer(draft, action) {
|
|
376
|
-
const { accounting,
|
|
373
|
+
const { accounting, payments, revenue } = mapConnectionsPayloadToState(action.payload.externalConnections);
|
|
377
374
|
draft.externalConnectionsByTenant[action.payload.tenantId] = {
|
|
378
375
|
fetchState: 'Completed',
|
|
379
376
|
accounting,
|
|
380
|
-
email,
|
|
381
377
|
payments,
|
|
382
378
|
revenue,
|
|
383
379
|
saveConnectionState: 'Completed',
|
|
@@ -399,7 +395,6 @@ const tenant = (0, toolkit_1.createSlice)({
|
|
|
399
395
|
draft.externalConnectionsByTenant[tenantId] = {
|
|
400
396
|
fetchState: 'Error',
|
|
401
397
|
accounting: [],
|
|
402
|
-
email: [],
|
|
403
398
|
payments: [],
|
|
404
399
|
revenue: [],
|
|
405
400
|
saveConnectionState: 'Error',
|
|
@@ -613,56 +608,6 @@ const tenant = (0, toolkit_1.createSlice)({
|
|
|
613
608
|
}
|
|
614
609
|
},
|
|
615
610
|
},
|
|
616
|
-
// Email-connect (Gmail / Outlook) OAuth init. Distinct from the other
|
|
617
|
-
// connector saves because the FE never sees the access_token — the
|
|
618
|
-
// user-facing redirect lands on the auth service's callback, auth
|
|
619
|
-
// exchanges code → tokens and posts them to tenant, then redirects the
|
|
620
|
-
// browser back to ``redirectAfterUrl`` with ``?email_connect_result=...``.
|
|
621
|
-
// The success action carries the provider's authorization_url so the
|
|
622
|
-
// epic can drive a full-page redirect, mirroring the legacy HubSpot
|
|
623
|
-
// flow in zeni-web-app-ui/IntegrationsScreen.
|
|
624
|
-
initEmailConnectOAuth: {
|
|
625
|
-
prepare(tenantId, provider, redirectAfterUrl) {
|
|
626
|
-
return { payload: { tenantId, provider, redirectAfterUrl } };
|
|
627
|
-
},
|
|
628
|
-
reducer(draft, action) {
|
|
629
|
-
const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
|
|
630
|
-
if (existing != null) {
|
|
631
|
-
// Reuse the per-slug saveConnectorCredentialsStateBySlug bucket so
|
|
632
|
-
// the IntegrationsSettingsPage shows the same loading affordance
|
|
633
|
-
// it already uses for Stripe/Mercury/PayPal connect flows.
|
|
634
|
-
existing.saveConnectorCredentialsStateBySlug[action.payload.provider] = 'In-Progress';
|
|
635
|
-
delete existing.saveConnectorCredentialsErrorBySlug[action.payload.provider];
|
|
636
|
-
}
|
|
637
|
-
},
|
|
638
|
-
},
|
|
639
|
-
initEmailConnectOAuthSuccess: {
|
|
640
|
-
prepare(tenantId, provider, authorizationUrl) {
|
|
641
|
-
return { payload: { tenantId, provider, authorizationUrl } };
|
|
642
|
-
},
|
|
643
|
-
reducer(draft, action) {
|
|
644
|
-
// Intentionally leave state as 'In-Progress' — the epic is about to
|
|
645
|
-
// do a full-page redirect, so any UI state we set here would be
|
|
646
|
-
// overwritten by the navigation anyway. Setting Completed would
|
|
647
|
-
// briefly flash a success state before the redirect, which reads
|
|
648
|
-
// wrong because the connection isn't actually saved yet at this
|
|
649
|
-
// point (it lands after the OAuth round-trip).
|
|
650
|
-
void draft;
|
|
651
|
-
void action;
|
|
652
|
-
},
|
|
653
|
-
},
|
|
654
|
-
initEmailConnectOAuthFailure: {
|
|
655
|
-
prepare(tenantId, provider, status) {
|
|
656
|
-
return { payload: { tenantId, provider, status } };
|
|
657
|
-
},
|
|
658
|
-
reducer(draft, action) {
|
|
659
|
-
const existing = draft.externalConnectionsByTenant[action.payload.tenantId];
|
|
660
|
-
if (existing != null) {
|
|
661
|
-
existing.saveConnectorCredentialsStateBySlug[action.payload.provider] = 'Error';
|
|
662
|
-
existing.saveConnectorCredentialsErrorBySlug[action.payload.provider] = action.payload.status;
|
|
663
|
-
}
|
|
664
|
-
},
|
|
665
|
-
},
|
|
666
611
|
deleteConnection: {
|
|
667
612
|
prepare(tenantId, connectionId, connectionType) {
|
|
668
613
|
return { payload: { tenantId, connectionId, connectionType } };
|
|
@@ -851,7 +796,7 @@ const tenant = (0, toolkit_1.createSlice)({
|
|
|
851
796
|
},
|
|
852
797
|
},
|
|
853
798
|
});
|
|
854
|
-
_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.saveConnectorCredentials = _a.saveConnectorCredentials, exports.saveConnectorCredentialsSuccess = _a.saveConnectorCredentialsSuccess, exports.saveConnectorCredentialsFailure = _a.saveConnectorCredentialsFailure, exports.
|
|
799
|
+
_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.saveConnectorCredentials = _a.saveConnectorCredentials, exports.saveConnectorCredentialsSuccess = _a.saveConnectorCredentialsSuccess, exports.saveConnectorCredentialsFailure = _a.saveConnectorCredentialsFailure, 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;
|
|
855
800
|
exports.default = tenant.reducer;
|
|
856
801
|
/**
|
|
857
802
|
* Converts tenants payload to Tenant and User State
|
|
@@ -979,11 +924,6 @@ function mapConnectionsPayloadToState(connectionsPayload) {
|
|
|
979
924
|
const { connections } = connectionsPayload;
|
|
980
925
|
return {
|
|
981
926
|
accounting: connections.accounting.map((payload) => (0, exports.toConnection)(payload)),
|
|
982
|
-
// Tenant materializes gmail/outlook under the `email` bucket via
|
|
983
|
-
// _THIRD_PARTY_CONNECTORS_TO_MATERIALIZE when their slugs are enabled in
|
|
984
|
-
// third_party_enabled_connectors Statsig config. Default to [] so older
|
|
985
|
-
// tenant deploys (or disabled-everywhere envs) don't blow up here.
|
|
986
|
-
email: (connections.email ?? []).map((payload) => (0, exports.toConnection)(payload)),
|
|
987
927
|
payments: connections.payments.map((payload) => (0, exports.toConnection)(payload)),
|
|
988
928
|
revenue: (connections.revenue ?? []).map((payload) => (0, exports.toConnection)(payload)),
|
|
989
929
|
};
|
|
@@ -13,7 +13,6 @@ import { AuthProvider, ExternalSupportedTool } from './tenantReducer';
|
|
|
13
13
|
export interface TenantExternalConnections {
|
|
14
14
|
accounting: Connection[];
|
|
15
15
|
deleteConnectionState: FetchState;
|
|
16
|
-
email: Connection[];
|
|
17
16
|
fetchState: FetchState;
|
|
18
17
|
payments: Connection[];
|
|
19
18
|
revenue: Connection[];
|