@zeniai/client-epic-state 4.19.31-betaAK1 → 4.19.32
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/esm/init.js +2 -15
- package/lib/init.d.ts +1 -7
- package/lib/init.js +2 -48
- package/lib/view/companyView/epic/companyPassport/saveCompanyPassportDetailsEpic.d.ts +6 -6
- package/lib/view/financeStatement/financeStatementEpic.d.ts +4 -4
- package/lib/view/insightsCard/insightsCardEpic.d.ts +4 -4
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +5 -5
- package/lib/view/people/invitePeopleEpic.d.ts +3 -3
- package/lib/view/reportUIOptions/updateReportUIOptionThisPeriodEpic.d.ts +7 -7
- package/lib/view/spendManagement/billPay/billDetailView/epics/fetchBillDetailEpic.d.ts +6 -6
- package/lib/view/tagView/epics/createTagEpic.d.ts +4 -4
- package/package.json +1 -1
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
package/lib/esm/init.js
CHANGED
|
@@ -105,29 +105,16 @@ export function zeniAPIClientConfig() {
|
|
|
105
105
|
/**
|
|
106
106
|
* Initialize client-epic-state with new store.
|
|
107
107
|
* Should be used in the node server.
|
|
108
|
-
*
|
|
109
|
-
* Loads the full epic tree (~526 epics) so that server-side handlers
|
|
110
|
-
* (report generation, data fetching, etc.) have all feature epics
|
|
111
|
-
* available. The browser app uses `initialize()` + `injectFeatureModules()`
|
|
112
|
-
* instead to enable lazy loading.
|
|
113
|
-
*
|
|
114
108
|
* @param restEndPoints rest endpoints for the micro services
|
|
115
109
|
* @param userId user id
|
|
116
110
|
* @param sessionId session id
|
|
117
111
|
* @param tenantId tenant id
|
|
118
112
|
*/
|
|
119
|
-
export
|
|
113
|
+
export function initializeWithNewStore(restEndPoints, userId, sessionId, tenantId) {
|
|
120
114
|
console.info(`initializeWithNewStore with ${JSON.stringify(restEndPoints)}`);
|
|
121
115
|
initialize3rdPartyExtensions();
|
|
122
116
|
const zeniHttpClient = new ZeniAPIClient(restEndPoints, userId, sessionId, tenantId);
|
|
123
|
-
|
|
124
|
-
// Server-side stores need the full epic tree, not just the 24 core epics.
|
|
125
|
-
// Feature epics handle report generation, data fetching, etc. that the
|
|
126
|
-
// download server relies on. We use the store's own epicManager (not the
|
|
127
|
-
// module-level variable) so each store gets its own full epic subscription.
|
|
128
|
-
const epicModule = await import('./epic');
|
|
129
|
-
store.epicManager.setEpic(epicModule.default);
|
|
130
|
-
return store;
|
|
117
|
+
return configureNewStore(zeniHttpClient, false);
|
|
131
118
|
}
|
|
132
119
|
/**
|
|
133
120
|
* Exported for testing purpose. Not intended to be used in any other place!
|
package/lib/init.d.ts
CHANGED
|
@@ -49,16 +49,10 @@ export declare function zeniAPIClientConfig(): {
|
|
|
49
49
|
/**
|
|
50
50
|
* Initialize client-epic-state with new store.
|
|
51
51
|
* Should be used in the node server.
|
|
52
|
-
*
|
|
53
|
-
* Loads the full epic tree (~526 epics) so that server-side handlers
|
|
54
|
-
* (report generation, data fetching, etc.) have all feature epics
|
|
55
|
-
* available. The browser app uses `initialize()` + `injectFeatureModules()`
|
|
56
|
-
* instead to enable lazy loading.
|
|
57
|
-
*
|
|
58
52
|
* @param restEndPoints rest endpoints for the micro services
|
|
59
53
|
* @param userId user id
|
|
60
54
|
* @param sessionId session id
|
|
61
55
|
* @param tenantId tenant id
|
|
62
56
|
*/
|
|
63
|
-
export declare function initializeWithNewStore(restEndPoints: RESTAPIEndpoints, userId: string, sessionId: string, tenantId: string):
|
|
57
|
+
export declare function initializeWithNewStore(restEndPoints: RESTAPIEndpoints, userId: string, sessionId: string, tenantId: string): ZeniStore;
|
|
64
58
|
export declare function initialize3rdPartyExtensions(): void;
|
package/lib/init.js
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
@@ -150,29 +117,16 @@ function zeniAPIClientConfig() {
|
|
|
150
117
|
/**
|
|
151
118
|
* Initialize client-epic-state with new store.
|
|
152
119
|
* Should be used in the node server.
|
|
153
|
-
*
|
|
154
|
-
* Loads the full epic tree (~526 epics) so that server-side handlers
|
|
155
|
-
* (report generation, data fetching, etc.) have all feature epics
|
|
156
|
-
* available. The browser app uses `initialize()` + `injectFeatureModules()`
|
|
157
|
-
* instead to enable lazy loading.
|
|
158
|
-
*
|
|
159
120
|
* @param restEndPoints rest endpoints for the micro services
|
|
160
121
|
* @param userId user id
|
|
161
122
|
* @param sessionId session id
|
|
162
123
|
* @param tenantId tenant id
|
|
163
124
|
*/
|
|
164
|
-
|
|
125
|
+
function initializeWithNewStore(restEndPoints, userId, sessionId, tenantId) {
|
|
165
126
|
console.info(`initializeWithNewStore with ${JSON.stringify(restEndPoints)}`);
|
|
166
127
|
initialize3rdPartyExtensions();
|
|
167
128
|
const zeniHttpClient = new zeniAPI_1.ZeniAPIClient(restEndPoints, userId, sessionId, tenantId);
|
|
168
|
-
|
|
169
|
-
// Server-side stores need the full epic tree, not just the 24 core epics.
|
|
170
|
-
// Feature epics handle report generation, data fetching, etc. that the
|
|
171
|
-
// download server relies on. We use the store's own epicManager (not the
|
|
172
|
-
// module-level variable) so each store gets its own full epic subscription.
|
|
173
|
-
const epicModule = await Promise.resolve().then(() => __importStar(require('./epic')));
|
|
174
|
-
store.epicManager.setEpic(epicModule.default);
|
|
175
|
-
return store;
|
|
129
|
+
return (0, configureStore_1.default)(zeniHttpClient, false);
|
|
176
130
|
}
|
|
177
131
|
/**
|
|
178
132
|
* Exported for testing purpose. Not intended to be used in any other place!
|
|
@@ -6,19 +6,19 @@ export type ActionType = ReturnType<typeof saveCompanyPassportDetails> | ReturnT
|
|
|
6
6
|
export declare const saveCompanyPassportDetailsEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => import("rxjs").Observable<{
|
|
7
7
|
payload: {
|
|
8
8
|
companyId: string;
|
|
9
|
-
|
|
9
|
+
primaryContact: import("../../types/companyPassport/companyUsersLocalData").PrimaryContactLocalData;
|
|
10
10
|
};
|
|
11
|
-
type: "companyView/
|
|
11
|
+
type: "companyView/companyPassportUpdatePrimaryContact";
|
|
12
12
|
} | {
|
|
13
13
|
payload: {
|
|
14
14
|
companyId: string;
|
|
15
|
-
|
|
15
|
+
officers: CompanyOfficerLocalData[];
|
|
16
16
|
};
|
|
17
|
-
type: "companyView/
|
|
17
|
+
type: "companyView/companyPassportCreateCompanyOfficers";
|
|
18
18
|
} | {
|
|
19
19
|
payload: {
|
|
20
20
|
companyId: string;
|
|
21
|
-
|
|
21
|
+
companyDetails: import("../../../..").CompanyDetailsLocalData;
|
|
22
22
|
};
|
|
23
|
-
type: "companyView/
|
|
23
|
+
type: "companyView/companyPassportUpdateCompanyDetails";
|
|
24
24
|
}>;
|
|
@@ -39,15 +39,15 @@ export declare const fetchFinanceStatementEpic: (actions$: ActionsObservable<Act
|
|
|
39
39
|
} | {
|
|
40
40
|
payload: {
|
|
41
41
|
forecastId: string | undefined;
|
|
42
|
+
timeframe: "month" | "year" | "quarter";
|
|
43
|
+
fetchFullReport: boolean;
|
|
42
44
|
cacheOverride: boolean;
|
|
43
45
|
};
|
|
44
|
-
type: "profitAndLoss/
|
|
46
|
+
type: "profitAndLoss/fetchProfitAndLossForTimeframe";
|
|
45
47
|
} | {
|
|
46
48
|
payload: {
|
|
47
49
|
forecastId: string | undefined;
|
|
48
|
-
timeframe: "month" | "year" | "quarter";
|
|
49
|
-
fetchFullReport: boolean;
|
|
50
50
|
cacheOverride: boolean;
|
|
51
51
|
};
|
|
52
|
-
type: "profitAndLoss/
|
|
52
|
+
type: "profitAndLoss/fetchProfitAndLoss";
|
|
53
53
|
}>;
|
|
@@ -4,12 +4,12 @@ import { RootState } from '../../reducer';
|
|
|
4
4
|
import { ZeniAPI } from '../../zeniAPI';
|
|
5
5
|
import { clearInsightsCard, fetchInsightsCard, updateInsightsCard, updateInsightsCardFailure } from './insightsCardReducer';
|
|
6
6
|
export type ActionType = ReturnType<typeof fetchInsightsCard> | ReturnType<typeof updateInsightsCard> | ReturnType<typeof updateInsightsCardFailure> | ReturnType<typeof clearInsightsCard> | ReturnType<typeof updateInsights>;
|
|
7
|
-
export declare const fetchInsightsCardEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<
|
|
8
|
-
updateType: import("../..").UpdateType;
|
|
9
|
-
}, never> | {
|
|
7
|
+
export declare const fetchInsightsCardEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
10
8
|
payload: import("../../responsePayload").ZeniAPIResponse<import("./insightsCardPayload").InsightsCardPayload, Record<string, unknown>>;
|
|
11
9
|
type: "insightsCard/updateInsightsCard";
|
|
12
10
|
} | {
|
|
13
11
|
payload: import("../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
|
|
14
12
|
type: "insightsCard/updateInsightsCardFailure";
|
|
15
|
-
}
|
|
13
|
+
} | import("@reduxjs/toolkit").PayloadAction<import("../../entity/insights/insightPayload").InsightPayload[], "insights/updateInsights", {
|
|
14
|
+
updateType: import("../..").UpdateType;
|
|
15
|
+
}, never>>;
|
|
@@ -18,11 +18,6 @@ export declare const changeZeniPersonRolesEpic: (actions$: ActionsObservable<Act
|
|
|
18
18
|
} | {
|
|
19
19
|
payload: UserRolePayload[];
|
|
20
20
|
type: "userRole/updateUserRoles";
|
|
21
|
-
} | {
|
|
22
|
-
payload: {
|
|
23
|
-
companyId: string;
|
|
24
|
-
};
|
|
25
|
-
type: "people/changeZeniPersonRoles";
|
|
26
21
|
} | {
|
|
27
22
|
payload: {
|
|
28
23
|
id: import("../..").ID;
|
|
@@ -35,6 +30,11 @@ export declare const changeZeniPersonRolesEpic: (actions$: ActionsObservable<Act
|
|
|
35
30
|
userType: import("../userListView/userListViewState").UserListType;
|
|
36
31
|
};
|
|
37
32
|
type: "userListView/removeUserId";
|
|
33
|
+
} | {
|
|
34
|
+
payload: {
|
|
35
|
+
companyId: string;
|
|
36
|
+
};
|
|
37
|
+
type: "people/changeZeniPersonRoles";
|
|
38
38
|
} | {
|
|
39
39
|
payload: undefined;
|
|
40
40
|
type: "people/changePersonRoleSuccess";
|
|
@@ -24,6 +24,9 @@ export declare const invitePeopleEpic: (actions$: ActionsObservable<ActionType>,
|
|
|
24
24
|
} | {
|
|
25
25
|
payload: UserRolePayload[];
|
|
26
26
|
type: "userRole/updateUserRoles";
|
|
27
|
+
} | {
|
|
28
|
+
payload: undefined;
|
|
29
|
+
type: "people/invitePeople";
|
|
27
30
|
} | {
|
|
28
31
|
payload: {
|
|
29
32
|
id: import("../..").ID;
|
|
@@ -36,9 +39,6 @@ export declare const invitePeopleEpic: (actions$: ActionsObservable<ActionType>,
|
|
|
36
39
|
userType: import("../userListView/userListViewState").UserListType;
|
|
37
40
|
};
|
|
38
41
|
type: "userListView/removeUserId";
|
|
39
|
-
} | {
|
|
40
|
-
payload: undefined;
|
|
41
|
-
type: "people/invitePeople";
|
|
42
42
|
} | {
|
|
43
43
|
payload: import("./peoplePayload").PeoplePayload;
|
|
44
44
|
type: "people/invitePeopleSuccess";
|
|
@@ -10,27 +10,27 @@ export declare const updateReportUIOptionThisPeriodEpic: (actions$: ActionsObser
|
|
|
10
10
|
payload: {
|
|
11
11
|
thisPeriod: import("../..").TimeframeTick | undefined;
|
|
12
12
|
};
|
|
13
|
-
type: "
|
|
13
|
+
type: "cashInCashOut/updateCashInCashOutThisPeriod";
|
|
14
14
|
} | {
|
|
15
15
|
payload: {
|
|
16
|
-
thisPeriod
|
|
16
|
+
thisPeriod: import("../..").TimeframeTick | undefined;
|
|
17
17
|
};
|
|
18
|
-
type: "
|
|
18
|
+
type: "cashPosition/updateCashPositionThisPeriod";
|
|
19
19
|
} | {
|
|
20
20
|
payload: {
|
|
21
21
|
thisPeriod: import("../..").TimeframeTick | undefined;
|
|
22
22
|
};
|
|
23
|
-
type: "
|
|
23
|
+
type: "net_burn_or_income/updateNetBurnOrIncomeThisPeriod";
|
|
24
24
|
} | {
|
|
25
25
|
payload: {
|
|
26
|
-
thisPeriod
|
|
26
|
+
thisPeriod?: import("../..").TimeframeTick;
|
|
27
27
|
};
|
|
28
|
-
type: "
|
|
28
|
+
type: "operatingExpenses/updateOpExThisPeriod";
|
|
29
29
|
} | {
|
|
30
30
|
payload: {
|
|
31
31
|
thisPeriod: import("../..").TimeframeTick | undefined;
|
|
32
32
|
};
|
|
33
|
-
type: "
|
|
33
|
+
type: "revenue/updateRevenueThisPeriod";
|
|
34
34
|
} | {
|
|
35
35
|
payload: {
|
|
36
36
|
coaBalances: import("../..").COABalance[];
|
|
@@ -26,12 +26,6 @@ import { fetchBillDetail, fetchEligibleActionsForBill, removeBillDetail, updateB
|
|
|
26
26
|
export type ActionType = ReturnType<typeof fetchBillDetail> | ReturnType<typeof updateBillTransaction> | ReturnType<typeof updateBankAccounts> | ReturnType<typeof updatePaymentInstruments> | ReturnType<typeof updateBillDetailFetchState> | ReturnType<typeof removeBillTransaction> | ReturnType<typeof removeBillDetail> | ReturnType<typeof updatePaymentAccounts> | ReturnType<typeof updateAccounts> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateApprovalRules> | ReturnType<typeof updateEntityApprovalStatus> | ReturnType<typeof fetchPreviousBills> | ReturnType<typeof updateBillDetail> | ReturnType<typeof updateClasses> | ReturnType<typeof updateVendors> | ReturnType<typeof updateContacts> | ReturnType<typeof updateAddresses> | ReturnType<typeof fetchEntityHistory> | ReturnType<typeof fetchVendorsList> | ReturnType<typeof fetchDuplicateBill> | ReturnType<typeof convertAmountToHomeCurrency> | ReturnType<typeof waitForVendorByNameThenUpdateBillDetail> | ReturnType<typeof updateRecurringBillConfigs> | ReturnType<typeof updateRecurringBills> | ReturnType<typeof updateDepositAccounts> | ReturnType<typeof fetchEligibleActionsForBill>;
|
|
27
27
|
export declare const fetchBillDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
28
28
|
export declare const waitForVendorByNameThenUpdateBillDetailEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>) => Observable<{
|
|
29
|
-
payload: {
|
|
30
|
-
billDetail: import("../billDetailViewPayload").BillDetailViewPayload;
|
|
31
|
-
billId: ID;
|
|
32
|
-
};
|
|
33
|
-
type: "billDetailView/updateBillDetail";
|
|
34
|
-
} | {
|
|
35
29
|
payload: {
|
|
36
30
|
billId: string;
|
|
37
31
|
fetchState: import("../../../../../commonStateTypes/common").FetchState;
|
|
@@ -39,4 +33,10 @@ export declare const waitForVendorByNameThenUpdateBillDetailEpic: (actions$: Act
|
|
|
39
33
|
vendorId: string | undefined;
|
|
40
34
|
};
|
|
41
35
|
type: "billDetailView/updateBillDetailFetchState";
|
|
36
|
+
} | {
|
|
37
|
+
payload: {
|
|
38
|
+
billDetail: import("../billDetailViewPayload").BillDetailViewPayload;
|
|
39
|
+
billId: ID;
|
|
40
|
+
};
|
|
41
|
+
type: "billDetailView/updateBillDetail";
|
|
42
42
|
}>;
|
|
@@ -19,7 +19,9 @@ export declare const createTagEpic: (actions$: ActionsObservable<ActionType>, _s
|
|
|
19
19
|
}[];
|
|
20
20
|
};
|
|
21
21
|
type: "snackbar/openSnackbar";
|
|
22
|
-
} | {
|
|
22
|
+
} | import("@reduxjs/toolkit").PayloadAction<import("../../../entity/tag/tagPayload").TagPayload[], "tag/updateTags", {
|
|
23
|
+
updateType: import("../../../commonStateTypes/common").UpdateType;
|
|
24
|
+
}, never> | {
|
|
23
25
|
payload: {
|
|
24
26
|
fetchState: import("../../../commonStateTypes/common").FetchState;
|
|
25
27
|
tagsId: ID[];
|
|
@@ -32,6 +34,4 @@ export declare const createTagEpic: (actions$: ActionsObservable<ActionType>, _s
|
|
|
32
34
|
taskId?: ID;
|
|
33
35
|
};
|
|
34
36
|
type: "taskDetailView/updateCreatedTagToLocalStore";
|
|
35
|
-
}
|
|
36
|
-
updateType: import("../../../commonStateTypes/common").UpdateType;
|
|
37
|
-
}, never>>;
|
|
37
|
+
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.19.
|
|
3
|
+
"version": "4.19.32",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|