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

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 (35) hide show
  1. package/lib/epic.d.ts +1 -5
  2. package/lib/epic.js +1 -5
  3. package/lib/esm/epic.js +1 -5
  4. package/lib/esm/index.js +0 -2
  5. package/lib/esm/reducer.js +0 -3
  6. package/lib/index.d.ts +0 -3
  7. package/lib/index.js +1 -20
  8. package/lib/reducer.d.ts +0 -3
  9. package/lib/reducer.js +0 -3
  10. package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
  11. package/package.json +28 -54
  12. package/lib/esm/view/creditAgentView/creditAgentViewPayload.js +0 -1
  13. package/lib/esm/view/creditAgentView/creditAgentViewReducer.js +0 -113
  14. package/lib/esm/view/creditAgentView/creditAgentViewSelector.js +0 -3
  15. package/lib/esm/view/creditAgentView/creditAgentViewState.js +0 -18
  16. package/lib/esm/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +0 -16
  17. package/lib/esm/view/creditAgentView/epics/fetchTenantCreditScoreReportEpic.js +0 -16
  18. package/lib/esm/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +0 -23
  19. package/lib/esm/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.js +0 -19
  20. package/lib/view/creditAgentView/creditAgentViewPayload.d.ts +0 -64
  21. package/lib/view/creditAgentView/creditAgentViewPayload.js +0 -2
  22. package/lib/view/creditAgentView/creditAgentViewReducer.d.ts +0 -11
  23. package/lib/view/creditAgentView/creditAgentViewReducer.js +0 -117
  24. package/lib/view/creditAgentView/creditAgentViewSelector.d.ts +0 -17
  25. package/lib/view/creditAgentView/creditAgentViewSelector.js +0 -9
  26. package/lib/view/creditAgentView/creditAgentViewState.d.ts +0 -58
  27. package/lib/view/creditAgentView/creditAgentViewState.js +0 -21
  28. package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.d.ts +0 -12
  29. package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +0 -20
  30. package/lib/view/creditAgentView/epics/fetchTenantCreditScoreReportEpic.d.ts +0 -12
  31. package/lib/view/creditAgentView/epics/fetchTenantCreditScoreReportEpic.js +0 -20
  32. package/lib/view/creditAgentView/epics/saveCreditAgentMacroEpic.d.ts +0 -12
  33. package/lib/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +0 -27
  34. package/lib/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.d.ts +0 -12
  35. package/lib/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.js +0 -23
@@ -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;