@zeniai/client-epic-state 5.2.75 → 5.2.76-betaGS1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonStateTypes/common.d.ts +3 -0
- package/lib/commonStateTypes/common.js +10 -1
- package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +3 -3
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +2 -2
- 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 +1 -0
- package/lib/entity/tenant/tenantReducer.d.ts +32 -30
- package/lib/entity/tenant/tenantReducer.js +13 -2
- package/lib/entity/tenant/tenantState.d.ts +1 -0
- package/lib/entity/tenant/tenantTypes.d.ts +1 -1
- package/lib/entity/tenant/tenantTypes.js +1 -0
- package/lib/esm/commonStateTypes/common.js +8 -0
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +2 -2
- package/lib/esm/entity/tenant/tenantReducer.js +13 -2
- package/lib/esm/entity/tenant/tenantTypes.js +1 -0
- package/lib/esm/index.js +2 -2
- package/lib/esm/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +140 -9
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +70 -19
- package/lib/index.d.ts +2 -2
- package/lib/index.js +16 -15
- package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.d.ts +1 -1
- package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +140 -9
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +13 -2
- package/lib/view/taskManager/taskListView/taskListSelector.js +70 -19
- package/package.json +1 -1
|
@@ -29,3 +29,6 @@ export interface FullName {
|
|
|
29
29
|
lastName: string;
|
|
30
30
|
}
|
|
31
31
|
export declare const getUnderScoreKey: (keys: string[]) => string;
|
|
32
|
+
/** Early-exit emptiness check: `Object.keys(x).length > 0` allocates an array
|
|
33
|
+
* on every call, and this one runs inside selector inputs. */
|
|
34
|
+
export declare const hasAnyKey: (record: object) => boolean;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getUnderScoreKey = exports.toCompletionStatusType = void 0;
|
|
3
|
+
exports.hasAnyKey = exports.getUnderScoreKey = exports.toCompletionStatusType = void 0;
|
|
4
4
|
const stringToUnion_1 = require("./stringToUnion");
|
|
5
5
|
const COMPLETION_STATUS_TYPES = ['incomplete', 'complete'];
|
|
6
6
|
const toCompletionStatusType = (v) => (0, stringToUnion_1.stringToUnion)(v, COMPLETION_STATUS_TYPES);
|
|
7
7
|
exports.toCompletionStatusType = toCompletionStatusType;
|
|
8
8
|
const getUnderScoreKey = (keys) => keys.join('_');
|
|
9
9
|
exports.getUnderScoreKey = getUnderScoreKey;
|
|
10
|
+
/** Early-exit emptiness check: `Object.keys(x).length > 0` allocates an array
|
|
11
|
+
* on every call, and this one runs inside selector inputs. */
|
|
12
|
+
const hasAnyKey = (record) => {
|
|
13
|
+
for (const _key in record) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
};
|
|
18
|
+
exports.hasAnyKey = hasAnyKey;
|
|
@@ -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" | "email" | "payments";
|
|
10
|
+
connectionType: "revenue" | "email" | "payroll" | "payments";
|
|
11
11
|
};
|
|
12
12
|
type: "tenant/deleteConnectionSuccess";
|
|
13
13
|
} | {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { RootState } from '../../../rootStateTypes';
|
|
3
3
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
|
-
import { initEmailConnectOAuth, initEmailConnectOAuthFailure, initEmailConnectOAuthSuccess } from '../tenantReducer';
|
|
4
|
+
import { ConnectorOAuthProvider, initEmailConnectOAuth, initEmailConnectOAuthFailure, initEmailConnectOAuthSuccess } from '../tenantReducer';
|
|
5
5
|
export type ActionType = ReturnType<typeof initEmailConnectOAuth> | ReturnType<typeof initEmailConnectOAuthSuccess> | ReturnType<typeof initEmailConnectOAuthFailure>;
|
|
6
6
|
export type NavigateFn = (url: string) => void;
|
|
7
7
|
export declare const initEmailConnectOAuthEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI, navigate?: NavigateFn) => import("rxjs").Observable<{
|
|
8
8
|
payload: {
|
|
9
9
|
tenantId: string;
|
|
10
|
-
provider:
|
|
10
|
+
provider: ConnectorOAuthProvider;
|
|
11
11
|
authorizationUrl: string;
|
|
12
12
|
};
|
|
13
13
|
type: "tenant/initEmailConnectOAuthSuccess";
|
|
14
14
|
} | {
|
|
15
15
|
payload: {
|
|
16
16
|
tenantId: string;
|
|
17
|
-
provider:
|
|
17
|
+
provider: ConnectorOAuthProvider;
|
|
18
18
|
status: import("../../../zeniAPIStatus").ZeniAPIStatus<Record<string, unknown>>;
|
|
19
19
|
};
|
|
20
20
|
type: "tenant/initEmailConnectOAuthFailure";
|
|
@@ -14,7 +14,7 @@ const defaultNavigate = (url) => {
|
|
|
14
14
|
window.location.href = url;
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
// Backs the
|
|
17
|
+
// Backs the POST /1.0/connectors/<provider>/init endpoint on the
|
|
18
18
|
// auth service. The endpoint creates a CSRF state token in the auth NDB
|
|
19
19
|
// store and returns the provider's authorization_url; this epic then drives
|
|
20
20
|
// a full-page redirect so the user lands on Google's / Microsoft's consent
|
|
@@ -31,7 +31,7 @@ navigate = defaultNavigate) => actions$.pipe((0, operators_1.filter)(tenantReduc
|
|
|
31
31
|
// the gmail provider's `saveConnectorCredentialsStateBySlug` in
|
|
32
32
|
// `In-Progress` forever. groupBy gives each provider its own stream.
|
|
33
33
|
(0, operators_1.groupBy)((action) => action.payload.provider), (0, operators_1.mergeMap)((perProvider$) => perProvider$.pipe((0, operators_1.switchMap)((action) => zeniAPI
|
|
34
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/connectors
|
|
34
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/connectors/${action.payload.provider}/init`, { redirect_after_url: action.payload.redirectAfterUrl }, { 'zeni-tenant-id': action.payload.tenantId })
|
|
35
35
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
36
36
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
37
37
|
// Fire-and-forget side effect — once the browser navigates,
|
|
@@ -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" | "email" | "payments";
|
|
9
|
+
connectionType: "revenue" | "email" | "payroll" | "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" | "email" | "payments";
|
|
10
|
-
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
|
|
9
|
+
connectionType: "revenue" | "email" | "payroll" | "payments";
|
|
10
|
+
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook" | "gusto";
|
|
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" | "gmail" | "outlook";
|
|
17
|
+
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook" | "gusto";
|
|
18
18
|
status: import("../../../zeniAPIStatus").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" | "email" | "payments";
|
|
9
|
+
connectionType: "revenue" | "email" | "payroll" | "payments";
|
|
10
10
|
connectionPayload: import("../tenantPayload").ConnectionDataPayload;
|
|
11
11
|
};
|
|
12
12
|
type: "tenant/saveOAuthConnectionSuccess";
|
|
@@ -13,8 +13,9 @@ export interface DoSignInPayload {
|
|
|
13
13
|
redirectUri: ZeniUrl;
|
|
14
14
|
sourceUri: ZeniUrl;
|
|
15
15
|
}
|
|
16
|
-
export declare const toExternalIntegrationType: (v: string) => "revenue" | "email" | "payments";
|
|
16
|
+
export declare const toExternalIntegrationType: (v: string) => "revenue" | "email" | "payroll" | "payments";
|
|
17
17
|
export type ExternalIntegrationType = ReturnType<typeof toExternalIntegrationType>;
|
|
18
|
+
export type ConnectorOAuthProvider = 'gmail' | 'outlook' | 'gusto';
|
|
18
19
|
export type ConnectorCredentialsBySlug = {
|
|
19
20
|
connectionName: 'stripe';
|
|
20
21
|
credentials: {
|
|
@@ -99,26 +100,26 @@ export declare const updateTenants: import("@reduxjs/toolkit").ActionCreatorWith
|
|
|
99
100
|
}, "tenant/fetchExternalConnectionsFailure", never, never>, fetchExternalConnectionsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, externalConnections: ConnectionsPayload], {
|
|
100
101
|
tenantId: string;
|
|
101
102
|
externalConnections: ConnectionsPayload;
|
|
102
|
-
}, "tenant/fetchExternalConnectionsSuccess", never, never>, saveAPIKeyConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payments", connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook", credentials: {
|
|
103
|
+
}, "tenant/fetchExternalConnectionsSuccess", never, never>, saveAPIKeyConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payroll" | "payments", connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook" | "gusto", credentials: {
|
|
103
104
|
api_key: string;
|
|
104
105
|
site: string;
|
|
105
106
|
}], {
|
|
106
107
|
tenantId: string;
|
|
107
108
|
connectionId: string;
|
|
108
|
-
connectionType: "revenue" | "email" | "payments";
|
|
109
|
-
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
|
|
109
|
+
connectionType: "revenue" | "email" | "payroll" | "payments";
|
|
110
|
+
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook" | "gusto";
|
|
110
111
|
credentials: {
|
|
111
112
|
api_key: string;
|
|
112
113
|
site: string;
|
|
113
114
|
};
|
|
114
|
-
}, "tenant/saveAPIKeyConnection", never, never>, saveAPIKeyConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "email" | "payments", connectionPayload: ConnectionDataPayload], {
|
|
115
|
+
}, "tenant/saveAPIKeyConnection", never, never>, saveAPIKeyConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "email" | "payroll" | "payments", connectionPayload: ConnectionDataPayload], {
|
|
115
116
|
tenantId: string;
|
|
116
|
-
connectionType: "revenue" | "email" | "payments";
|
|
117
|
+
connectionType: "revenue" | "email" | "payroll" | "payments";
|
|
117
118
|
connectionPayload: ConnectionDataPayload;
|
|
118
119
|
}, "tenant/saveAPIKeyConnectionSuccess", never, never>, saveAPIKeyConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
119
120
|
tenantId: string;
|
|
120
121
|
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
121
|
-
}, "tenant/saveAPIKeyConnectionFailure", never, never>, saveOAuthConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payments", connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook", credentials: {
|
|
122
|
+
}, "tenant/saveAPIKeyConnectionFailure", never, never>, saveOAuthConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payroll" | "payments", connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook" | "gusto", credentials: {
|
|
122
123
|
authorization_code: string;
|
|
123
124
|
client_id: string;
|
|
124
125
|
client_secret: string;
|
|
@@ -126,35 +127,35 @@ export declare const updateTenants: import("@reduxjs/toolkit").ActionCreatorWith
|
|
|
126
127
|
}], {
|
|
127
128
|
tenantId: string;
|
|
128
129
|
connectionId: string;
|
|
129
|
-
connectionType: "revenue" | "email" | "payments";
|
|
130
|
-
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
|
|
130
|
+
connectionType: "revenue" | "email" | "payroll" | "payments";
|
|
131
|
+
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook" | "gusto";
|
|
131
132
|
credentials: {
|
|
132
133
|
authorization_code: string;
|
|
133
134
|
client_id: string;
|
|
134
135
|
client_secret: string;
|
|
135
136
|
redirect_uri: string;
|
|
136
137
|
};
|
|
137
|
-
}, "tenant/saveOAuthConnection", never, never>, saveOAuthConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "email" | "payments", connectionPayload: ConnectionDataPayload], {
|
|
138
|
+
}, "tenant/saveOAuthConnection", never, never>, saveOAuthConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "email" | "payroll" | "payments", connectionPayload: ConnectionDataPayload], {
|
|
138
139
|
tenantId: string;
|
|
139
|
-
connectionType: "revenue" | "email" | "payments";
|
|
140
|
+
connectionType: "revenue" | "email" | "payroll" | "payments";
|
|
140
141
|
connectionPayload: ConnectionDataPayload;
|
|
141
142
|
}, "tenant/saveOAuthConnectionSuccess", never, never>, saveOAuthConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
142
143
|
tenantId: string;
|
|
143
144
|
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
144
|
-
}, "tenant/saveOAuthConnectionFailure", never, never>, saveConnectorCredentials: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "email" | "payments", args: ConnectorCredentialsBySlug], {
|
|
145
|
+
}, "tenant/saveOAuthConnectionFailure", never, never>, saveConnectorCredentials: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "email" | "payroll" | "payments", args: ConnectorCredentialsBySlug], {
|
|
145
146
|
connectionName: "stripe";
|
|
146
147
|
credentials: {
|
|
147
148
|
api_key: string;
|
|
148
149
|
};
|
|
149
150
|
tenantId: string;
|
|
150
|
-
connectionType: "revenue" | "email" | "payments";
|
|
151
|
+
connectionType: "revenue" | "email" | "payroll" | "payments";
|
|
151
152
|
} | {
|
|
152
153
|
connectionName: "mercury";
|
|
153
154
|
credentials: {
|
|
154
155
|
api_key: string;
|
|
155
156
|
};
|
|
156
157
|
tenantId: string;
|
|
157
|
-
connectionType: "revenue" | "email" | "payments";
|
|
158
|
+
connectionType: "revenue" | "email" | "payroll" | "payments";
|
|
158
159
|
} | {
|
|
159
160
|
connectionName: "paypal";
|
|
160
161
|
credentials: {
|
|
@@ -162,36 +163,36 @@ export declare const updateTenants: import("@reduxjs/toolkit").ActionCreatorWith
|
|
|
162
163
|
client_secret: string;
|
|
163
164
|
};
|
|
164
165
|
tenantId: string;
|
|
165
|
-
connectionType: "revenue" | "email" | "payments";
|
|
166
|
-
}, "tenant/saveConnectorCredentials", never, never>, saveConnectorCredentialsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "email" | "payments", connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook", connectionPayload: ConnectionDataPayload], {
|
|
166
|
+
connectionType: "revenue" | "email" | "payroll" | "payments";
|
|
167
|
+
}, "tenant/saveConnectorCredentials", never, never>, saveConnectorCredentialsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionType: "revenue" | "email" | "payroll" | "payments", connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook" | "gusto", connectionPayload: ConnectionDataPayload], {
|
|
167
168
|
tenantId: string;
|
|
168
|
-
connectionType: "revenue" | "email" | "payments";
|
|
169
|
-
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
|
|
169
|
+
connectionType: "revenue" | "email" | "payroll" | "payments";
|
|
170
|
+
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook" | "gusto";
|
|
170
171
|
connectionPayload: ConnectionDataPayload;
|
|
171
|
-
}, "tenant/saveConnectorCredentialsSuccess", never, never>, saveConnectorCredentialsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook", status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
172
|
+
}, "tenant/saveConnectorCredentialsSuccess", never, never>, saveConnectorCredentialsFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook" | "gusto", status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
172
173
|
tenantId: string;
|
|
173
|
-
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
|
|
174
|
+
connectionName: "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook" | "gusto";
|
|
174
175
|
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
175
|
-
}, "tenant/saveConnectorCredentialsFailure", never, never>, initEmailConnectOAuth: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, provider:
|
|
176
|
+
}, "tenant/saveConnectorCredentialsFailure", never, never>, initEmailConnectOAuth: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, provider: ConnectorOAuthProvider, redirectAfterUrl: string], {
|
|
176
177
|
tenantId: string;
|
|
177
|
-
provider:
|
|
178
|
+
provider: ConnectorOAuthProvider;
|
|
178
179
|
redirectAfterUrl: string;
|
|
179
|
-
}, "tenant/initEmailConnectOAuth", never, never>, initEmailConnectOAuthSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, provider:
|
|
180
|
+
}, "tenant/initEmailConnectOAuth", never, never>, initEmailConnectOAuthSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, provider: ConnectorOAuthProvider, authorizationUrl: string], {
|
|
180
181
|
tenantId: string;
|
|
181
|
-
provider:
|
|
182
|
+
provider: ConnectorOAuthProvider;
|
|
182
183
|
authorizationUrl: string;
|
|
183
|
-
}, "tenant/initEmailConnectOAuthSuccess", never, never>, initEmailConnectOAuthFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, provider:
|
|
184
|
+
}, "tenant/initEmailConnectOAuthSuccess", never, never>, initEmailConnectOAuthFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, provider: ConnectorOAuthProvider, status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
184
185
|
tenantId: string;
|
|
185
|
-
provider:
|
|
186
|
+
provider: ConnectorOAuthProvider;
|
|
186
187
|
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
187
|
-
}, "tenant/initEmailConnectOAuthFailure", never, never>, deleteConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payments"], {
|
|
188
|
+
}, "tenant/initEmailConnectOAuthFailure", never, never>, deleteConnection: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payroll" | "payments"], {
|
|
188
189
|
tenantId: string;
|
|
189
190
|
connectionId: string;
|
|
190
|
-
connectionType: "revenue" | "email" | "payments";
|
|
191
|
-
}, "tenant/deleteConnection", never, never>, deleteConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payments"], {
|
|
191
|
+
connectionType: "revenue" | "email" | "payroll" | "payments";
|
|
192
|
+
}, "tenant/deleteConnection", never, never>, deleteConnectionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, connectionId: string, connectionType: "revenue" | "email" | "payroll" | "payments"], {
|
|
192
193
|
tenantId: string;
|
|
193
194
|
connectionId: string;
|
|
194
|
-
connectionType: "revenue" | "email" | "payments";
|
|
195
|
+
connectionType: "revenue" | "email" | "payroll" | "payments";
|
|
195
196
|
}, "tenant/deleteConnectionSuccess", never, never>, deleteConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[tenantId: string, status: ZeniAPIStatus<Record<string, unknown>>], {
|
|
196
197
|
tenantId: string;
|
|
197
198
|
status: ZeniAPIStatus<Record<string, unknown>>;
|
|
@@ -258,6 +259,7 @@ export declare function mapConnectionsPayloadToState(connectionsPayload: Connect
|
|
|
258
259
|
accounting: Connection[];
|
|
259
260
|
email: Connection[];
|
|
260
261
|
payments: Connection[];
|
|
262
|
+
payroll: Connection[];
|
|
261
263
|
revenue: Connection[];
|
|
262
264
|
};
|
|
263
265
|
export declare const toConnection: (payload: ConnectionDataPayload) => Connection;
|
|
@@ -20,7 +20,12 @@ const netBurnOrIncomeStoryCardState_1 = require("../../view/netBurnOrIncomeStory
|
|
|
20
20
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
21
21
|
const subscriptionSummaryReducer_1 = require("../subscription/subscriptionSummary/subscriptionSummaryReducer");
|
|
22
22
|
const userRolePayload_1 = require("../userRole/userRolePayload");
|
|
23
|
-
const EXTERNAL_INTEGRATION_TYPES = [
|
|
23
|
+
const EXTERNAL_INTEGRATION_TYPES = [
|
|
24
|
+
'revenue',
|
|
25
|
+
'payments',
|
|
26
|
+
'email',
|
|
27
|
+
'payroll',
|
|
28
|
+
];
|
|
24
29
|
const toExternalIntegrationType = (v) => (0, stringToUnion_1.stringToUnion)(v, EXTERNAL_INTEGRATION_TYPES);
|
|
25
30
|
exports.toExternalIntegrationType = toExternalIntegrationType;
|
|
26
31
|
exports.initialState = {
|
|
@@ -433,6 +438,7 @@ const tenant = (0, toolkit_1.createSlice)({
|
|
|
433
438
|
accounting: [],
|
|
434
439
|
email: [],
|
|
435
440
|
payments: [],
|
|
441
|
+
payroll: [],
|
|
436
442
|
revenue: [],
|
|
437
443
|
saveConnectionState: 'Not-Started',
|
|
438
444
|
saveAPIKeyConnectionState: 'Not-Started',
|
|
@@ -449,12 +455,13 @@ const tenant = (0, toolkit_1.createSlice)({
|
|
|
449
455
|
return { payload: { tenantId, externalConnections } };
|
|
450
456
|
},
|
|
451
457
|
reducer(draft, action) {
|
|
452
|
-
const { accounting, email, payments, revenue } = mapConnectionsPayloadToState(action.payload.externalConnections);
|
|
458
|
+
const { accounting, email, payments, payroll, revenue } = mapConnectionsPayloadToState(action.payload.externalConnections);
|
|
453
459
|
draft.externalConnectionsByTenant[action.payload.tenantId] = {
|
|
454
460
|
fetchState: 'Completed',
|
|
455
461
|
accounting,
|
|
456
462
|
email,
|
|
457
463
|
payments,
|
|
464
|
+
payroll,
|
|
458
465
|
revenue,
|
|
459
466
|
saveConnectionState: 'Completed',
|
|
460
467
|
saveAPIKeyConnectionState: 'Not-Started',
|
|
@@ -477,6 +484,7 @@ const tenant = (0, toolkit_1.createSlice)({
|
|
|
477
484
|
accounting: [],
|
|
478
485
|
email: [],
|
|
479
486
|
payments: [],
|
|
487
|
+
payroll: [],
|
|
480
488
|
revenue: [],
|
|
481
489
|
saveConnectionState: 'Error',
|
|
482
490
|
saveAPIKeyConnectionState: 'Not-Started',
|
|
@@ -1125,6 +1133,9 @@ function mapConnectionsPayloadToState(connectionsPayload) {
|
|
|
1125
1133
|
// tenant deploys (or disabled-everywhere envs) don't blow up here.
|
|
1126
1134
|
email: (connections.email ?? []).map((payload) => (0, exports.toConnection)(payload)),
|
|
1127
1135
|
payments: connections.payments.map((payload) => (0, exports.toConnection)(payload)),
|
|
1136
|
+
// Same back-compat shape as `email`: tenant materializes gusto under
|
|
1137
|
+
// `payroll` only when the slug is enabled in third_party_enabled_connectors.
|
|
1138
|
+
payroll: (connections.payroll ?? []).map((payload) => (0, exports.toConnection)(payload)),
|
|
1128
1139
|
revenue: (connections.revenue ?? []).map((payload) => (0, exports.toConnection)(payload)),
|
|
1129
1140
|
};
|
|
1130
1141
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type AuthProvider = 'google' | 'microsoft' | 'email';
|
|
2
|
-
export declare const toExternalSupportedTool: (v: string) => "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook";
|
|
2
|
+
export declare const toExternalSupportedTool: (v: string) => "chargebee" | "hubspot" | "stripe" | "mercury" | "paypal" | "gmail" | "outlook" | "gusto";
|
|
3
3
|
export type ExternalSupportedTool = ReturnType<typeof toExternalSupportedTool>;
|
|
@@ -2,3 +2,11 @@ import { stringToUnion } from './stringToUnion';
|
|
|
2
2
|
const COMPLETION_STATUS_TYPES = ['incomplete', 'complete'];
|
|
3
3
|
export const toCompletionStatusType = (v) => stringToUnion(v, COMPLETION_STATUS_TYPES);
|
|
4
4
|
export const getUnderScoreKey = (keys) => keys.join('_');
|
|
5
|
+
/** Early-exit emptiness check: `Object.keys(x).length > 0` allocates an array
|
|
6
|
+
* on every call, and this one runs inside selector inputs. */
|
|
7
|
+
export const hasAnyKey = (record) => {
|
|
8
|
+
for (const _key in record) {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
return false;
|
|
12
|
+
};
|
|
@@ -11,7 +11,7 @@ const defaultNavigate = (url) => {
|
|
|
11
11
|
window.location.href = url;
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
-
// Backs the
|
|
14
|
+
// Backs the POST /1.0/connectors/<provider>/init endpoint on the
|
|
15
15
|
// auth service. The endpoint creates a CSRF state token in the auth NDB
|
|
16
16
|
// store and returns the provider's authorization_url; this epic then drives
|
|
17
17
|
// a full-page redirect so the user lands on Google's / Microsoft's consent
|
|
@@ -28,7 +28,7 @@ navigate = defaultNavigate) => actions$.pipe(filter(initEmailConnectOAuth.match)
|
|
|
28
28
|
// the gmail provider's `saveConnectorCredentialsStateBySlug` in
|
|
29
29
|
// `In-Progress` forever. groupBy gives each provider its own stream.
|
|
30
30
|
groupBy((action) => action.payload.provider), mergeMap((perProvider$) => perProvider$.pipe(switchMap((action) => zeniAPI
|
|
31
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/connectors
|
|
31
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/connectors/${action.payload.provider}/init`, { redirect_after_url: action.payload.redirectAfterUrl }, { 'zeni-tenant-id': action.payload.tenantId })
|
|
32
32
|
.pipe(mergeMap((response) => {
|
|
33
33
|
if (isSuccessResponse(response) && response.data != null) {
|
|
34
34
|
// Fire-and-forget side effect — once the browser navigates,
|
|
@@ -10,7 +10,12 @@ import { toNumberOfMonthForAverage, toTimeSpanIdForAverage, } from '../../view/n
|
|
|
10
10
|
import { date, dateNow } from '../../zeniDayJS';
|
|
11
11
|
import { toSubscriptionSummary } from '../subscription/subscriptionSummary/subscriptionSummaryReducer';
|
|
12
12
|
import { getInvitationStatus, getUserRoles, toMasterTOSInfo, toUserReimbursementInfo, } from '../userRole/userRolePayload';
|
|
13
|
-
const EXTERNAL_INTEGRATION_TYPES = [
|
|
13
|
+
const EXTERNAL_INTEGRATION_TYPES = [
|
|
14
|
+
'revenue',
|
|
15
|
+
'payments',
|
|
16
|
+
'email',
|
|
17
|
+
'payroll',
|
|
18
|
+
];
|
|
14
19
|
export const toExternalIntegrationType = (v) => stringToUnion(v, EXTERNAL_INTEGRATION_TYPES);
|
|
15
20
|
export const initialState = {
|
|
16
21
|
fetchState: 'Not-Started',
|
|
@@ -422,6 +427,7 @@ const tenant = createSlice({
|
|
|
422
427
|
accounting: [],
|
|
423
428
|
email: [],
|
|
424
429
|
payments: [],
|
|
430
|
+
payroll: [],
|
|
425
431
|
revenue: [],
|
|
426
432
|
saveConnectionState: 'Not-Started',
|
|
427
433
|
saveAPIKeyConnectionState: 'Not-Started',
|
|
@@ -438,12 +444,13 @@ const tenant = createSlice({
|
|
|
438
444
|
return { payload: { tenantId, externalConnections } };
|
|
439
445
|
},
|
|
440
446
|
reducer(draft, action) {
|
|
441
|
-
const { accounting, email, payments, revenue } = mapConnectionsPayloadToState(action.payload.externalConnections);
|
|
447
|
+
const { accounting, email, payments, payroll, revenue } = mapConnectionsPayloadToState(action.payload.externalConnections);
|
|
442
448
|
draft.externalConnectionsByTenant[action.payload.tenantId] = {
|
|
443
449
|
fetchState: 'Completed',
|
|
444
450
|
accounting,
|
|
445
451
|
email,
|
|
446
452
|
payments,
|
|
453
|
+
payroll,
|
|
447
454
|
revenue,
|
|
448
455
|
saveConnectionState: 'Completed',
|
|
449
456
|
saveAPIKeyConnectionState: 'Not-Started',
|
|
@@ -466,6 +473,7 @@ const tenant = createSlice({
|
|
|
466
473
|
accounting: [],
|
|
467
474
|
email: [],
|
|
468
475
|
payments: [],
|
|
476
|
+
payroll: [],
|
|
469
477
|
revenue: [],
|
|
470
478
|
saveConnectionState: 'Error',
|
|
471
479
|
saveAPIKeyConnectionState: 'Not-Started',
|
|
@@ -1113,6 +1121,9 @@ export function mapConnectionsPayloadToState(connectionsPayload) {
|
|
|
1113
1121
|
// tenant deploys (or disabled-everywhere envs) don't blow up here.
|
|
1114
1122
|
email: (connections.email ?? []).map((payload) => toConnection(payload)),
|
|
1115
1123
|
payments: connections.payments.map((payload) => toConnection(payload)),
|
|
1124
|
+
// Same back-compat shape as `email`: tenant materializes gusto under
|
|
1125
|
+
// `payroll` only when the slug is enabled in third_party_enabled_connectors.
|
|
1126
|
+
payroll: (connections.payroll ?? []).map((payload) => toConnection(payload)),
|
|
1116
1127
|
revenue: (connections.revenue ?? []).map((payload) => toConnection(payload)),
|
|
1117
1128
|
};
|
|
1118
1129
|
}
|
package/lib/esm/index.js
CHANGED
|
@@ -416,7 +416,7 @@ import { allTaskPriority, allTaskStatus, getTaskDetail, } from './view/taskManag
|
|
|
416
416
|
import { createTaskFromTaskGroupTemplate } from './view/taskManager/taskGroupTemplateView/taskGroupTemplateViewReducer';
|
|
417
417
|
import { createNewTaskGroup, deleteTaskGroup, fetchAllTaskGroups, updateTaskGroupName, } from './view/taskManager/taskGroupView/taskGroupViewReducer';
|
|
418
418
|
import { ALL_TASK_LIST_TABS, TASK_LIST_FILTER_CATEGORIES, TASK_LIST_GROUP_BY_CATEGORIES, toDueDateGroupKeyType, toTaskListGroupByKeyType, toTaskListGroupByKeyTypeStrict, } from './view/taskManager/taskListView/taskList';
|
|
419
|
-
import { bulkUpdateTaskList, dragNDropTasks, fetchTaskListPage, initiateTaskListLocalData, removeTaskFromList, updateTaskFilters, updateTaskFromListView, updateTaskListLocalData, updateTaskListSearchText, updateTaskListTab, updateTaskListUIState, } from './view/taskManager/taskListView/taskListReducer';
|
|
419
|
+
import { bulkUpdateTaskList, dragNDropTasks, fetchTaskList, fetchTaskListPage, initiateTaskListLocalData, removeTaskFromList, updateTaskFilters, updateTaskFromListView, updateTaskListLocalData, updateTaskListSearchText, updateTaskListTab, updateTaskListUIState, } from './view/taskManager/taskListView/taskListReducer';
|
|
420
420
|
import { getAllTasks, } from './view/taskManager/taskListView/taskListSelector';
|
|
421
421
|
import { getDueDateValueFromDueDateGroupId, getTaskUpdates, sortSubtasks, } from './view/taskManager/taskListView/taskListViewHelpers';
|
|
422
422
|
import { fetchTasksCard } from './view/tasksCard/tasksCardReducer';
|
|
@@ -671,7 +671,7 @@ export { fetchGlobalMerchantRecommendation, createGlobalMerchant, updateCreateGl
|
|
|
671
671
|
export { approveVendorGlobalReview, rejectVendorGlobalReview, fetchVendorGlobalReviewView, updateSelectedGlobalMerchant, updateVendorGlobalReviewViewUIState, getVendorGlobalReviewView, getTenantMerchantByMerchantId, toVendorGlobalReviewColumnSortKeyType, updateVendorGlobalReviewViewLocalData, };
|
|
672
672
|
export { fetchArAging, updateArAgingUIState, fetchArAgingDetail, updateArAgingDetailUIState, getArAgingReport, getArAgingDetailForCustomer, updateArAgingNodeCollapseState, };
|
|
673
673
|
export { toRecurringBillFrequency, toRecurringBillFrequencyStrict, };
|
|
674
|
-
export { getTaskGroupById, getAllTasks, fetchTaskListPage, getTaskDetail, fetchTaskDetailPage, saveTaskUpdatesToLocalStore, saveTaskDetail, createSubTask, resetSubTaskCreateStatus, fetchSubTasks, archiveTask, fetchCannedResponses, saveCannedResponse, deleteCannedResponse, getCannedResponsesView, updateTaskListSearchText, updateTaskListUIState, allTaskStatus, allTaskPriority, updateTaskFilters, TASK_LIST_FILTER_CATEGORIES, TASK_LIST_GROUP_BY_CATEGORIES, deleteTask, discardTaskUpdatesInLocalStore, bulkUpdateTaskList, createNewTaskGroup, initiateTaskListLocalData, deleteTaskGroup, updateTaskListLocalData, dragNDropTasks, updateTaskGroupName, toTaskListGroupByKeyType, toTaskListGroupByKeyTypeStrict, getTaskUpdates, sortSubtasks, fetchAllTaskGroups, initialTaskDetail, getDueDateValueFromDueDateGroupId, toPriorityCodeType, toTaskStatusCodeType, toDueDateGroupKeyType, updateTaskFromListView, updateTaskListTab, removeTaskFromList, snoozeTask, unsnoozeTask, convertHHMMStrToMinutes, initialTaskDetailLocalData, ALL_TASK_LIST_TABS, };
|
|
674
|
+
export { getTaskGroupById, getAllTasks, fetchTaskList, fetchTaskListPage, getTaskDetail, fetchTaskDetailPage, saveTaskUpdatesToLocalStore, saveTaskDetail, createSubTask, resetSubTaskCreateStatus, fetchSubTasks, archiveTask, fetchCannedResponses, saveCannedResponse, deleteCannedResponse, getCannedResponsesView, updateTaskListSearchText, updateTaskListUIState, allTaskStatus, allTaskPriority, updateTaskFilters, TASK_LIST_FILTER_CATEGORIES, TASK_LIST_GROUP_BY_CATEGORIES, deleteTask, discardTaskUpdatesInLocalStore, bulkUpdateTaskList, createNewTaskGroup, initiateTaskListLocalData, deleteTaskGroup, updateTaskListLocalData, dragNDropTasks, updateTaskGroupName, toTaskListGroupByKeyType, toTaskListGroupByKeyTypeStrict, getTaskUpdates, sortSubtasks, fetchAllTaskGroups, initialTaskDetail, getDueDateValueFromDueDateGroupId, toPriorityCodeType, toTaskStatusCodeType, toDueDateGroupKeyType, updateTaskFromListView, updateTaskListTab, removeTaskFromList, snoozeTask, unsnoozeTask, convertHHMMStrToMinutes, initialTaskDetailLocalData, ALL_TASK_LIST_TABS, };
|
|
675
675
|
export { getAllTags, fetchTagList, createTag, deleteTag, };
|
|
676
676
|
export { getAllCardsAndBankPaymentMethods, createCardSetupIntent, confirmCardSetupIntent, addCardPaymentSource, fetchPaymentSources, resetCardPaymentErrorStatuses, clearCardPaymentView, };
|
|
677
677
|
export { getAuditReportGroupViewSelectorView, getAuditRuleGroupViewSelectorView, getUserFromAllUsers, fetchAuditRuleGroupView, fetchAuditReportGroupView, saveReasonForAuditRule, clearAuditReportGroupViewByCompanyId, };
|