@zeniai/client-epic-state 4.8.71 → 4.8.72
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/viewAndReport/viewAndReport.d.ts +0 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +3 -3
- package/lib/epic.d.ts +1 -3
- package/lib/epic.js +1 -3
- package/lib/index.d.ts +7 -11
- package/lib/index.js +12 -20
- package/lib/reducer.d.ts +0 -3
- package/lib/reducer.js +0 -3
- package/lib/view/companyView/types/cockpitTypes.d.ts +0 -2
- package/lib/view/companyView/types/cockpitTypes.js +1 -9
- package/lib/view/reviewCompanyView/reviewCompanyPayload.d.ts +1 -25
- package/lib/view/reviewCompanyView/reviewCompanyViewSelector.d.ts +0 -1
- package/lib/view/reviewCompanyView/reviewCompanyViewSelector.js +8 -31
- package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +4 -12
- package/lib/view/reviewCompanyView/reviewCompanyViewState.js +5 -15
- package/package.json +1 -1
- package/lib/view/auditReportView/auditReportViewHelper.d.ts +0 -12
- package/lib/view/auditReportView/auditReportViewHelper.js +0 -79
- package/lib/view/auditReportView/auditReportViewPayload.d.ts +0 -53
- package/lib/view/auditReportView/auditReportViewPayload.js +0 -2
- package/lib/view/auditReportView/auditReportViewReducer.d.ts +0 -27
- package/lib/view/auditReportView/auditReportViewReducer.js +0 -121
- package/lib/view/auditReportView/auditReportViewSelector.d.ts +0 -22
- package/lib/view/auditReportView/auditReportViewSelector.js +0 -34
- package/lib/view/auditReportView/auditReportViewState.d.ts +0 -71
- package/lib/view/auditReportView/auditReportViewState.js +0 -22
- package/lib/view/auditReportView/epics/fetchAuditReportGroupViewEpic.d.ts +0 -7
- package/lib/view/auditReportView/epics/fetchAuditReportGroupViewEpic.js +0 -54
- package/lib/view/auditReportView/epics/fetchAuditRuleGroupViewEpic.d.ts +0 -7
- package/lib/view/auditReportView/epics/fetchAuditRuleGroupViewEpic.js +0 -39
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchAuditReportGroupViewEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
-
const auditReportViewReducer_1 = require("../auditReportViewReducer");
|
|
8
|
-
const fetchAuditReportGroupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(auditReportViewReducer_1.fetchAuditReportGroupView.match), (0, operators_1.mergeMap)((action) => {
|
|
9
|
-
const { companyId, fetchAction, reportGroupId } = action.payload;
|
|
10
|
-
const state = state$.value;
|
|
11
|
-
const company = state.companyState.companiesById[companyId];
|
|
12
|
-
const tenantId = company.companyInfo.tenantId;
|
|
13
|
-
if (tenantId != null) {
|
|
14
|
-
const query = toQueryPayload(fetchAction, reportGroupId);
|
|
15
|
-
const { userId, sessionId } = zeniAPI;
|
|
16
|
-
const headers = {
|
|
17
|
-
'zeni-user-id': userId,
|
|
18
|
-
'zeni-tenant-id': tenantId,
|
|
19
|
-
'zeni-session-id': sessionId,
|
|
20
|
-
};
|
|
21
|
-
return zeniAPI
|
|
22
|
-
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/reports/audit?query=${encodeURIComponent(JSON.stringify(query))}`, headers)
|
|
23
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
24
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
25
|
-
const actions = [
|
|
26
|
-
(0, auditReportViewReducer_1.updateAuditReportGroupViewOnSuccess)(companyId, reportGroupId, response.data),
|
|
27
|
-
];
|
|
28
|
-
return (0, rxjs_1.from)(actions);
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
const actions = [
|
|
32
|
-
(0, auditReportViewReducer_1.updateAuditReportGroupViewOnFailure)(companyId, reportGroupId, response.status),
|
|
33
|
-
];
|
|
34
|
-
return (0, rxjs_1.from)(actions);
|
|
35
|
-
}
|
|
36
|
-
}), (0, operators_1.catchError)((error) => {
|
|
37
|
-
const actions = [
|
|
38
|
-
(0, auditReportViewReducer_1.updateAuditReportGroupViewOnFailure)(companyId, reportGroupId, (0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Audit Report Group view errored out' +
|
|
39
|
-
JSON.stringify(error))),
|
|
40
|
-
];
|
|
41
|
-
return (0, rxjs_1.from)(actions);
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
return (0, rxjs_1.from)([]);
|
|
46
|
-
}
|
|
47
|
-
}));
|
|
48
|
-
exports.fetchAuditReportGroupViewEpic = fetchAuditReportGroupViewEpic;
|
|
49
|
-
const toQueryPayload = (action, groupId) => {
|
|
50
|
-
return {
|
|
51
|
-
action,
|
|
52
|
-
audit_rule_group_ids: [groupId],
|
|
53
|
-
};
|
|
54
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
3
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
4
|
-
import { RootState } from '../../../reducer';
|
|
5
|
-
import { fetchAuditRuleGroupView, updateAuditRuleGroupViewOnFailure, updateAuditRuleGroupViewOnSuccess } from '../auditReportViewReducer';
|
|
6
|
-
export declare type ActionType = ReturnType<typeof fetchAuditRuleGroupView> | ReturnType<typeof updateAuditRuleGroupViewOnSuccess> | ReturnType<typeof updateAuditRuleGroupViewOnFailure>;
|
|
7
|
-
export declare const fetchAuditRuleGroupViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchAuditRuleGroupViewEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
-
const auditReportViewReducer_1 = require("../auditReportViewReducer");
|
|
8
|
-
const fetchAuditRuleGroupViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(auditReportViewReducer_1.fetchAuditRuleGroupView.match), (0, operators_1.switchMap)((action) => {
|
|
9
|
-
const { cacheOverride } = action.payload;
|
|
10
|
-
const state = state$.value;
|
|
11
|
-
const { fetchState } = state.auditReportViewState.auditRuleGroupView;
|
|
12
|
-
if (cacheOverride === true || fetchState !== 'In-Progress') {
|
|
13
|
-
return zeniAPI
|
|
14
|
-
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/audit-rule-groups`)
|
|
15
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
16
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
17
|
-
const actions = [
|
|
18
|
-
(0, auditReportViewReducer_1.updateAuditRuleGroupViewOnSuccess)(response.data.audit_rule_groups),
|
|
19
|
-
];
|
|
20
|
-
return (0, rxjs_1.from)(actions);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
const actions = [
|
|
24
|
-
(0, auditReportViewReducer_1.updateAuditRuleGroupViewOnFailure)(response.status),
|
|
25
|
-
];
|
|
26
|
-
return (0, rxjs_1.from)(actions);
|
|
27
|
-
}
|
|
28
|
-
}), (0, operators_1.catchError)((error) => {
|
|
29
|
-
const actions = [
|
|
30
|
-
(0, auditReportViewReducer_1.updateAuditRuleGroupViewOnFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Audit rule group view errored out' + JSON.stringify(error))),
|
|
31
|
-
];
|
|
32
|
-
return (0, rxjs_1.from)(actions);
|
|
33
|
-
}));
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
return (0, rxjs_1.from)([]);
|
|
37
|
-
}
|
|
38
|
-
}));
|
|
39
|
-
exports.fetchAuditRuleGroupViewEpic = fetchAuditRuleGroupViewEpic;
|