@zeniai/client-epic-state 4.19.77-betaSS2 → 4.19.77-betaSS3

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.
Files changed (42) hide show
  1. package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +35 -0
  2. package/lib/entity/jeSchedules/jeSchedulesPayload.js +44 -0
  3. package/lib/entity/jeSchedules/jeSchedulesSelector.d.ts +2 -1
  4. package/lib/entity/jeSchedules/jeSchedulesSelector.js +2 -1
  5. package/lib/entity/jeSchedules/jeSchedulesState.d.ts +13 -0
  6. package/lib/epic.d.ts +1 -5
  7. package/lib/epic.js +1 -5
  8. package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +44 -0
  9. package/lib/esm/entity/jeSchedules/jeSchedulesSelector.js +2 -1
  10. package/lib/esm/epic.js +1 -5
  11. package/lib/esm/index.js +0 -2
  12. package/lib/esm/reducer.js +0 -3
  13. package/lib/index.d.ts +2 -4
  14. package/lib/index.js +1 -20
  15. package/lib/reducer.d.ts +0 -3
  16. package/lib/reducer.js +0 -3
  17. package/package.json +28 -54
  18. package/lib/esm/view/creditAgentView/creditAgentViewPayload.js +0 -1
  19. package/lib/esm/view/creditAgentView/creditAgentViewReducer.js +0 -113
  20. package/lib/esm/view/creditAgentView/creditAgentViewSelector.js +0 -3
  21. package/lib/esm/view/creditAgentView/creditAgentViewState.js +0 -18
  22. package/lib/esm/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +0 -16
  23. package/lib/esm/view/creditAgentView/epics/fetchTenantCreditScoreReportEpic.js +0 -16
  24. package/lib/esm/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +0 -23
  25. package/lib/esm/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.js +0 -19
  26. package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
  27. package/lib/view/creditAgentView/creditAgentViewPayload.d.ts +0 -64
  28. package/lib/view/creditAgentView/creditAgentViewPayload.js +0 -2
  29. package/lib/view/creditAgentView/creditAgentViewReducer.d.ts +0 -11
  30. package/lib/view/creditAgentView/creditAgentViewReducer.js +0 -117
  31. package/lib/view/creditAgentView/creditAgentViewSelector.d.ts +0 -17
  32. package/lib/view/creditAgentView/creditAgentViewSelector.js +0 -9
  33. package/lib/view/creditAgentView/creditAgentViewState.d.ts +0 -58
  34. package/lib/view/creditAgentView/creditAgentViewState.js +0 -21
  35. package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.d.ts +0 -12
  36. package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +0 -20
  37. package/lib/view/creditAgentView/epics/fetchTenantCreditScoreReportEpic.d.ts +0 -12
  38. package/lib/view/creditAgentView/epics/fetchTenantCreditScoreReportEpic.js +0 -20
  39. package/lib/view/creditAgentView/epics/saveCreditAgentMacroEpic.d.ts +0 -12
  40. package/lib/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +0 -27
  41. package/lib/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.d.ts +0 -12
  42. package/lib/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.js +0 -23
@@ -1,64 +0,0 @@
1
- export interface TenantCreditScoreRowPayload {
2
- burn_rate_monthly: number;
3
- cards: string;
4
- confidence: number;
5
- cons: string;
6
- conservative_limit_rationale: string;
7
- controller_name: string;
8
- credit_amount: number;
9
- credit_limit: number;
10
- credit_score: string;
11
- customer_name: string;
12
- going_concern_analysis: string;
13
- health_monitor_score: number;
14
- key_ratios: Record<string, unknown>;
15
- liberal_credit_limit: number;
16
- liberal_limit_rationale: string;
17
- period: string;
18
- pros: string;
19
- reasoning: string;
20
- run_date: string;
21
- runway: number;
22
- status: string;
23
- total_card_balance: number;
24
- total_cash_balance: number;
25
- }
26
- export interface TenantCreditScoreReportPayload {
27
- count: number;
28
- report: TenantCreditScoreRowPayload[];
29
- }
30
- export interface TenantCreditScoreReportResponse {
31
- data: TenantCreditScoreReportPayload;
32
- status: {
33
- code: number;
34
- message: string;
35
- };
36
- }
37
- export interface ScheduleCreditScoreCronResponse {
38
- data: string;
39
- status: {
40
- code: number;
41
- message: string;
42
- };
43
- }
44
- export interface MacroPayload {
45
- created_at: string;
46
- creator_id: string;
47
- description: string;
48
- instructions: string;
49
- is_active: boolean;
50
- is_latest: boolean;
51
- macro_id: string;
52
- name: string;
53
- parameters_schema: Record<string, unknown> | null;
54
- tenant_id: string | null;
55
- updated_at: string;
56
- version: number;
57
- }
58
- export interface MacroResponse {
59
- data: MacroPayload;
60
- status: {
61
- code: number;
62
- message: string;
63
- };
64
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +0,0 @@
1
- import { ZeniAPIStatus } from '../../responsePayload';
2
- import { MacroPayload, TenantCreditScoreReportPayload } from './creditAgentViewPayload';
3
- import { CreditAgentViewState, initialCreditAgentViewState } from './creditAgentViewState';
4
- export declare const fetchTenantCreditScoreReport: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"creditAgentView/fetchTenantCreditScoreReport">, updateTenantCreditScoreReport: import("@reduxjs/toolkit").ActionCreatorWithPayload<TenantCreditScoreReportPayload, "creditAgentView/updateTenantCreditScoreReport">, updateTenantCreditScoreReportFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "creditAgentView/updateTenantCreditScoreReportFailure">, scheduleTenantCreditScoreCron: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
5
- tenantId?: string;
6
- }, "creditAgentView/scheduleTenantCreditScoreCron">, scheduleTenantCreditScoreCronSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"creditAgentView/scheduleTenantCreditScoreCronSuccess">, scheduleTenantCreditScoreCronFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "creditAgentView/scheduleTenantCreditScoreCronFailure">, resetScheduleCronState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"creditAgentView/resetScheduleCronState">, fetchCreditAgentMacro: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"creditAgentView/fetchCreditAgentMacro">, updateCreditAgentMacro: import("@reduxjs/toolkit").ActionCreatorWithPayload<MacroPayload, "creditAgentView/updateCreditAgentMacro">, updateCreditAgentMacroFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "creditAgentView/updateCreditAgentMacroFailure">, saveCreditAgentMacro: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
7
- instructions: string;
8
- }, "creditAgentView/saveCreditAgentMacro">, saveCreditAgentMacroSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<MacroPayload, "creditAgentView/saveCreditAgentMacroSuccess">, saveCreditAgentMacroFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "creditAgentView/saveCreditAgentMacroFailure">, resetSaveMacroState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"creditAgentView/resetSaveMacroState">;
9
- export { initialCreditAgentViewState as initialState, CreditAgentViewState };
10
- declare const _default: import("redux").Reducer<CreditAgentViewState>;
11
- export default _default;
@@ -1,117 +0,0 @@
1
- "use strict";
2
- var _a;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.initialState = exports.resetSaveMacroState = exports.saveCreditAgentMacroFailure = exports.saveCreditAgentMacroSuccess = exports.saveCreditAgentMacro = exports.updateCreditAgentMacroFailure = exports.updateCreditAgentMacro = exports.fetchCreditAgentMacro = exports.resetScheduleCronState = exports.scheduleTenantCreditScoreCronFailure = exports.scheduleTenantCreditScoreCronSuccess = exports.scheduleTenantCreditScoreCron = exports.updateTenantCreditScoreReportFailure = exports.updateTenantCreditScoreReport = exports.fetchTenantCreditScoreReport = void 0;
5
- const toolkit_1 = require("@reduxjs/toolkit");
6
- const creditAgentViewState_1 = require("./creditAgentViewState");
7
- Object.defineProperty(exports, "initialState", { enumerable: true, get: function () { return creditAgentViewState_1.initialCreditAgentViewState; } });
8
- const creditAgentView = (0, toolkit_1.createSlice)({
9
- name: 'creditAgentView',
10
- initialState: creditAgentViewState_1.initialCreditAgentViewState,
11
- reducers: {
12
- fetchTenantCreditScoreReport(draft) {
13
- draft.report.fetchState = 'In-Progress';
14
- draft.report.error = undefined;
15
- },
16
- updateTenantCreditScoreReport(draft, action) {
17
- draft.report.fetchState = 'Completed';
18
- draft.report.error = undefined;
19
- draft.report.rows = action.payload.report.map((row) => ({
20
- customerName: row.customer_name,
21
- totalCashBalance: row.total_cash_balance,
22
- totalCardBalance: row.total_card_balance,
23
- cards: row.cards,
24
- controllerName: row.controller_name,
25
- period: row.period,
26
- runway: row.runway,
27
- burnRateMonthly: row.burn_rate_monthly,
28
- healthMonitorScore: row.health_monitor_score,
29
- creditScore: row.credit_score,
30
- confidence: row.confidence,
31
- creditAmount: row.credit_amount,
32
- creditLimit: row.credit_limit,
33
- conservativeLimitRationale: row.conservative_limit_rationale,
34
- liberalCreditLimit: row.liberal_credit_limit,
35
- liberalLimitRationale: row.liberal_limit_rationale,
36
- pros: row.pros,
37
- cons: row.cons,
38
- reasoning: row.reasoning,
39
- goingConcernAnalysis: row.going_concern_analysis,
40
- keyRatios: row.key_ratios,
41
- runDate: row.run_date,
42
- status: row.status,
43
- }));
44
- draft.report.count = action.payload.count;
45
- },
46
- updateTenantCreditScoreReportFailure(draft, action) {
47
- draft.report.fetchState = 'Error';
48
- draft.report.error = action.payload;
49
- },
50
- scheduleTenantCreditScoreCron(draft,
51
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
52
- _action) {
53
- draft.scheduleCron.fetchState = 'In-Progress';
54
- draft.scheduleCron.error = undefined;
55
- },
56
- scheduleTenantCreditScoreCronSuccess(draft) {
57
- draft.scheduleCron.fetchState = 'Completed';
58
- draft.scheduleCron.error = undefined;
59
- },
60
- scheduleTenantCreditScoreCronFailure(draft, action) {
61
- draft.scheduleCron.fetchState = 'Error';
62
- draft.scheduleCron.error = action.payload;
63
- },
64
- resetScheduleCronState(draft) {
65
- draft.scheduleCron.fetchState = 'Not-Started';
66
- draft.scheduleCron.error = undefined;
67
- },
68
- fetchCreditAgentMacro(draft) {
69
- draft.macro.fetchState = 'In-Progress';
70
- draft.macro.error = undefined;
71
- },
72
- updateCreditAgentMacro(draft, action) {
73
- draft.macro.fetchState = 'Completed';
74
- draft.macro.error = undefined;
75
- draft.macro.data = mapMacroPayload(action.payload);
76
- },
77
- updateCreditAgentMacroFailure(draft, action) {
78
- draft.macro.fetchState = 'Error';
79
- draft.macro.error = action.payload;
80
- },
81
- saveCreditAgentMacro(draft,
82
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
83
- _action) {
84
- draft.macro.updateState = 'In-Progress';
85
- draft.macro.error = undefined;
86
- },
87
- saveCreditAgentMacroSuccess(draft, action) {
88
- draft.macro.updateState = 'Completed';
89
- draft.macro.error = undefined;
90
- draft.macro.data = mapMacroPayload(action.payload);
91
- },
92
- saveCreditAgentMacroFailure(draft, action) {
93
- draft.macro.updateState = 'Error';
94
- draft.macro.error = action.payload;
95
- },
96
- resetSaveMacroState(draft) {
97
- draft.macro.updateState = 'Not-Started';
98
- draft.macro.error = undefined;
99
- },
100
- },
101
- });
102
- function mapMacroPayload(payload) {
103
- return {
104
- macroId: payload.macro_id,
105
- version: payload.version,
106
- isLatest: payload.is_latest,
107
- isActive: payload.is_active,
108
- name: payload.name,
109
- description: payload.description,
110
- instructions: payload.instructions,
111
- tenantId: payload.tenant_id,
112
- createdAt: payload.created_at,
113
- updatedAt: payload.updated_at,
114
- };
115
- }
116
- _a = creditAgentView.actions, exports.fetchTenantCreditScoreReport = _a.fetchTenantCreditScoreReport, exports.updateTenantCreditScoreReport = _a.updateTenantCreditScoreReport, exports.updateTenantCreditScoreReportFailure = _a.updateTenantCreditScoreReportFailure, exports.scheduleTenantCreditScoreCron = _a.scheduleTenantCreditScoreCron, exports.scheduleTenantCreditScoreCronSuccess = _a.scheduleTenantCreditScoreCronSuccess, exports.scheduleTenantCreditScoreCronFailure = _a.scheduleTenantCreditScoreCronFailure, exports.resetScheduleCronState = _a.resetScheduleCronState, exports.fetchCreditAgentMacro = _a.fetchCreditAgentMacro, exports.updateCreditAgentMacro = _a.updateCreditAgentMacro, exports.updateCreditAgentMacroFailure = _a.updateCreditAgentMacroFailure, exports.saveCreditAgentMacro = _a.saveCreditAgentMacro, exports.saveCreditAgentMacroSuccess = _a.saveCreditAgentMacroSuccess, exports.saveCreditAgentMacroFailure = _a.saveCreditAgentMacroFailure, exports.resetSaveMacroState = _a.resetSaveMacroState;
117
- exports.default = creditAgentView.reducer;
@@ -1,17 +0,0 @@
1
- import { RootState } from '../../reducer';
2
- export declare const getCreditAgentReport: (state: RootState) => {
3
- count: number;
4
- fetchState: import("../..").FetchState;
5
- rows: import("./creditAgentViewState").TenantCreditScoreRow[];
6
- error?: import("../..").ZeniAPIStatus;
7
- };
8
- export declare const getCreditAgentMacro: (state: RootState) => {
9
- data: import("./creditAgentViewState").CreditAgentMacro | null;
10
- fetchState: import("../..").FetchState;
11
- updateState: import("../..").FetchState;
12
- error?: import("../..").ZeniAPIStatus;
13
- };
14
- export declare const getScheduleCronState: (state: RootState) => {
15
- fetchState: import("../..").FetchState;
16
- error?: import("../..").ZeniAPIStatus;
17
- };
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getScheduleCronState = exports.getCreditAgentMacro = exports.getCreditAgentReport = void 0;
4
- const getCreditAgentReport = (state) => state.creditAgentViewState.report;
5
- exports.getCreditAgentReport = getCreditAgentReport;
6
- const getCreditAgentMacro = (state) => state.creditAgentViewState.macro;
7
- exports.getCreditAgentMacro = getCreditAgentMacro;
8
- const getScheduleCronState = (state) => state.creditAgentViewState.scheduleCron;
9
- exports.getScheduleCronState = getScheduleCronState;
@@ -1,58 +0,0 @@
1
- import { FetchState } from '../../commonStateTypes/common';
2
- import { ZeniAPIStatus } from '../../responsePayload';
3
- export interface TenantCreditScoreRow {
4
- burnRateMonthly: number;
5
- cards: string;
6
- confidence: number;
7
- cons: string;
8
- conservativeLimitRationale: string;
9
- controllerName: string;
10
- creditAmount: number;
11
- creditLimit: number;
12
- creditScore: string;
13
- customerName: string;
14
- goingConcernAnalysis: string;
15
- healthMonitorScore: number;
16
- keyRatios: Record<string, unknown>;
17
- liberalCreditLimit: number;
18
- liberalLimitRationale: string;
19
- period: string;
20
- pros: string;
21
- reasoning: string;
22
- runDate: string;
23
- runway: number;
24
- status: string;
25
- totalCardBalance: number;
26
- totalCashBalance: number;
27
- }
28
- export interface CreditAgentMacro {
29
- createdAt: string;
30
- description: string;
31
- instructions: string;
32
- isActive: boolean;
33
- isLatest: boolean;
34
- macroId: string;
35
- name: string;
36
- tenantId: string | null;
37
- updatedAt: string;
38
- version: number;
39
- }
40
- export interface CreditAgentViewState {
41
- macro: {
42
- data: CreditAgentMacro | null;
43
- fetchState: FetchState;
44
- updateState: FetchState;
45
- error?: ZeniAPIStatus;
46
- };
47
- report: {
48
- count: number;
49
- fetchState: FetchState;
50
- rows: TenantCreditScoreRow[];
51
- error?: ZeniAPIStatus;
52
- };
53
- scheduleCron: {
54
- fetchState: FetchState;
55
- error?: ZeniAPIStatus;
56
- };
57
- }
58
- export declare const initialCreditAgentViewState: CreditAgentViewState;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initialCreditAgentViewState = void 0;
4
- exports.initialCreditAgentViewState = {
5
- report: {
6
- fetchState: 'Not-Started',
7
- error: undefined,
8
- rows: [],
9
- count: 0,
10
- },
11
- scheduleCron: {
12
- fetchState: 'Not-Started',
13
- error: undefined,
14
- },
15
- macro: {
16
- fetchState: 'Not-Started',
17
- updateState: 'Not-Started',
18
- error: undefined,
19
- data: null,
20
- },
21
- };
@@ -1,12 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { RootState } from '../../../reducer';
3
- import { ZeniAPI } from '../../../zeniAPI';
4
- import { fetchCreditAgentMacro, updateCreditAgentMacro, updateCreditAgentMacroFailure } from '../creditAgentViewReducer';
5
- export type ActionType = ReturnType<typeof fetchCreditAgentMacro> | ReturnType<typeof updateCreditAgentMacro> | ReturnType<typeof updateCreditAgentMacroFailure>;
6
- export declare const fetchCreditAgentMacroEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
- payload: import("../creditAgentViewPayload").MacroPayload;
8
- type: "creditAgentView/updateCreditAgentMacro";
9
- } | {
10
- payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
11
- type: "creditAgentView/updateCreditAgentMacroFailure";
12
- }>;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchCreditAgentMacroEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../../responsePayload");
7
- const creditAgentViewReducer_1 = require("../creditAgentViewReducer");
8
- const fetchCreditAgentMacroEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(creditAgentViewReducer_1.fetchCreditAgentMacro.match), (0, operators_1.switchMap)(() => {
9
- const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/macros/credit-agent`;
10
- return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
11
- if ((0, responsePayload_1.isSuccessResponse)(response)) {
12
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.updateCreditAgentMacro)(response.data // eslint-disable-line @typescript-eslint/no-non-null-assertion
13
- ));
14
- }
15
- else {
16
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.updateCreditAgentMacroFailure)(response.status));
17
- }
18
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, creditAgentViewReducer_1.updateCreditAgentMacroFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
19
- }));
20
- exports.fetchCreditAgentMacroEpic = fetchCreditAgentMacroEpic;
@@ -1,12 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { RootState } from '../../../reducer';
3
- import { ZeniAPI } from '../../../zeniAPI';
4
- import { fetchTenantCreditScoreReport, updateTenantCreditScoreReport, updateTenantCreditScoreReportFailure } from '../creditAgentViewReducer';
5
- export type ActionType = ReturnType<typeof fetchTenantCreditScoreReport> | ReturnType<typeof updateTenantCreditScoreReport> | ReturnType<typeof updateTenantCreditScoreReportFailure>;
6
- export declare const fetchTenantCreditScoreReportEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
- payload: import("../creditAgentViewPayload").TenantCreditScoreReportPayload;
8
- type: "creditAgentView/updateTenantCreditScoreReport";
9
- } | {
10
- payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
11
- type: "creditAgentView/updateTenantCreditScoreReportFailure";
12
- }>;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchTenantCreditScoreReportEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../../responsePayload");
7
- const creditAgentViewReducer_1 = require("../creditAgentViewReducer");
8
- const fetchTenantCreditScoreReportEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(creditAgentViewReducer_1.fetchTenantCreditScoreReport.match), (0, operators_1.switchMap)(() => {
9
- const url = `${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/admin/tenant-credit-score-report`;
10
- return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
11
- if ((0, responsePayload_1.isSuccessResponse)(response)) {
12
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.updateTenantCreditScoreReport)(response.data // eslint-disable-line @typescript-eslint/no-non-null-assertion
13
- ));
14
- }
15
- else {
16
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.updateTenantCreditScoreReportFailure)(response.status));
17
- }
18
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, creditAgentViewReducer_1.updateTenantCreditScoreReportFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
19
- }));
20
- exports.fetchTenantCreditScoreReportEpic = fetchTenantCreditScoreReportEpic;
@@ -1,12 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { RootState } from '../../../reducer';
3
- import { ZeniAPI } from '../../../zeniAPI';
4
- import { saveCreditAgentMacro, saveCreditAgentMacroFailure, saveCreditAgentMacroSuccess } from '../creditAgentViewReducer';
5
- export type ActionType = ReturnType<typeof saveCreditAgentMacro> | ReturnType<typeof saveCreditAgentMacroSuccess> | ReturnType<typeof saveCreditAgentMacroFailure>;
6
- export declare const saveCreditAgentMacroEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
- payload: import("../creditAgentViewPayload").MacroPayload;
8
- type: "creditAgentView/saveCreditAgentMacroSuccess";
9
- } | {
10
- payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
11
- type: "creditAgentView/saveCreditAgentMacroFailure";
12
- }>;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.saveCreditAgentMacroEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../../responsePayload");
7
- const creditAgentViewReducer_1 = require("../creditAgentViewReducer");
8
- const saveCreditAgentMacroEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(creditAgentViewReducer_1.saveCreditAgentMacro.match), (0, operators_1.switchMap)((action) => {
9
- const { instructions } = action.payload;
10
- const existingMacro = state$.value.creditAgentViewState.macro.data;
11
- const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/macros/credit-agent`;
12
- const body = {
13
- instructions,
14
- name: existingMacro?.name ?? 'credit-agent',
15
- description: existingMacro?.description ?? '',
16
- };
17
- return zeniAPI.putAndGetJSON(url, body).pipe((0, operators_1.mergeMap)((response) => {
18
- if ((0, responsePayload_1.isSuccessResponse)(response)) {
19
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.saveCreditAgentMacroSuccess)(response.data // eslint-disable-line @typescript-eslint/no-non-null-assertion
20
- ));
21
- }
22
- else {
23
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.saveCreditAgentMacroFailure)(response.status));
24
- }
25
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, creditAgentViewReducer_1.saveCreditAgentMacroFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
26
- }));
27
- exports.saveCreditAgentMacroEpic = saveCreditAgentMacroEpic;
@@ -1,12 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { RootState } from '../../../reducer';
3
- import { ZeniAPI } from '../../../zeniAPI';
4
- import { scheduleTenantCreditScoreCron, scheduleTenantCreditScoreCronFailure, scheduleTenantCreditScoreCronSuccess } from '../creditAgentViewReducer';
5
- export type ActionType = ReturnType<typeof scheduleTenantCreditScoreCron> | ReturnType<typeof scheduleTenantCreditScoreCronSuccess> | ReturnType<typeof scheduleTenantCreditScoreCronFailure>;
6
- export declare const scheduleTenantCreditScoreCronEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
7
- payload: undefined;
8
- type: "creditAgentView/scheduleTenantCreditScoreCronSuccess";
9
- } | {
10
- payload: import("../../../responsePayload").ZeniAPIStatus<Record<string, unknown>>;
11
- type: "creditAgentView/scheduleTenantCreditScoreCronFailure";
12
- }>;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.scheduleTenantCreditScoreCronEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../../responsePayload");
7
- const creditAgentViewReducer_1 = require("../creditAgentViewReducer");
8
- const scheduleTenantCreditScoreCronEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(creditAgentViewReducer_1.scheduleTenantCreditScoreCron.match), (0, operators_1.switchMap)((action) => {
9
- const { tenantId } = action.payload;
10
- const url = `${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/crons/cards/tenant-credit-score`;
11
- const body = tenantId != null ? { tenant_id: tenantId } : {};
12
- return zeniAPI
13
- .postAndGetJSON(url, body)
14
- .pipe((0, operators_1.mergeMap)((response) => {
15
- if ((0, responsePayload_1.isSuccessResponse)(response)) {
16
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.scheduleTenantCreditScoreCronSuccess)());
17
- }
18
- else {
19
- return (0, rxjs_1.of)((0, creditAgentViewReducer_1.scheduleTenantCreditScoreCronFailure)(response.status));
20
- }
21
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, creditAgentViewReducer_1.scheduleTenantCreditScoreCronFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'REST API call errored out: ' + JSON.stringify(error))))));
22
- }));
23
- exports.scheduleTenantCreditScoreCronEpic = scheduleTenantCreditScoreCronEpic;