@zeniai/client-epic-state 4.17.19 → 4.17.20

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 (73) hide show
  1. package/lib/entity/accountRecon/accountReconPayload.d.ts +2 -0
  2. package/lib/entity/accountRecon/accountReconPayload.js +6 -1
  3. package/lib/entity/accountRecon/accountReconState.d.ts +2 -0
  4. package/lib/entity/{aiController/aiControllerPayload.d.ts → aiCfo/aiCfoPayload.d.ts} +10 -3
  5. package/lib/entity/aiCfo/aiCfoReducer.d.ts +45 -0
  6. package/lib/entity/{aiController/aiControllerReducer.js → aiCfo/aiCfoReducer.js} +53 -45
  7. package/lib/entity/aiCfo/aiCfoSelector.d.ts +14 -0
  8. package/lib/entity/{aiController/aiControllerSelector.js → aiCfo/aiCfoSelector.js} +6 -6
  9. package/lib/entity/aiCfo/aiCfoState.d.ts +107 -0
  10. package/lib/entity/aiCfo/aiCfoState.js +81 -0
  11. package/lib/entity/tenant/clearAllEpic.d.ts +4 -4
  12. package/lib/entity/tenant/clearAllEpic.js +4 -4
  13. package/lib/epic.d.ts +10 -8
  14. package/lib/epic.js +10 -8
  15. package/lib/index.d.ts +15 -13
  16. package/lib/index.js +83 -74
  17. package/lib/reducer.d.ts +6 -6
  18. package/lib/reducer.js +6 -6
  19. package/lib/view/{aiControllerView/aiControllerViewPayload.d.ts → aiCfoView/aiCfoViewPayload.d.ts} +2 -2
  20. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +73 -0
  21. package/lib/view/{aiControllerView/aiControllerViewReducer.js → aiCfoView/aiCfoViewReducer.js} +10 -10
  22. package/lib/view/{aiControllerView/aiControllerViewSelector.d.ts → aiCfoView/aiCfoViewSelector.d.ts} +5 -5
  23. package/lib/view/{aiControllerView/aiControllerViewSelector.js → aiCfoView/aiCfoViewSelector.js} +6 -6
  24. package/lib/view/{aiControllerView/aiControllerViewState.d.ts → aiCfoView/aiCfoViewState.d.ts} +3 -3
  25. package/lib/view/{aiControllerView → aiCfoView}/epics/createSessionAndSubmitEpic.d.ts +2 -2
  26. package/lib/view/{aiControllerView → aiCfoView}/epics/createSessionAndSubmitEpic.js +9 -9
  27. package/lib/view/{aiControllerView → aiCfoView}/epics/createSessionEpic.d.ts +2 -2
  28. package/lib/view/{aiControllerView → aiCfoView}/epics/createSessionEpic.js +8 -8
  29. package/lib/view/{aiControllerView → aiCfoView}/epics/fetchChatHistoryEpic.d.ts +2 -2
  30. package/lib/view/{aiControllerView → aiCfoView}/epics/fetchChatHistoryEpic.js +9 -9
  31. package/lib/view/{aiControllerView → aiCfoView}/epics/fetchChatSessionsForUserEpic.d.ts +2 -2
  32. package/lib/view/{aiControllerView → aiCfoView}/epics/fetchChatSessionsForUserEpic.js +8 -9
  33. package/lib/view/{aiControllerView → aiCfoView}/epics/stopSubmitEpic.d.ts +2 -2
  34. package/lib/view/{aiControllerView → aiCfoView}/epics/stopSubmitEpic.js +11 -11
  35. package/lib/view/{aiControllerView → aiCfoView}/epics/stopSubmitQuestionEpic.d.ts +2 -2
  36. package/lib/view/{aiControllerView → aiCfoView}/epics/stopSubmitQuestionEpic.js +8 -8
  37. package/lib/view/{aiControllerView → aiCfoView}/epics/submitQuestionEpic.d.ts +2 -2
  38. package/lib/view/{aiControllerView → aiCfoView}/epics/submitQuestionEpic.js +10 -10
  39. package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +2 -0
  40. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailPayload.d.ts +7 -0
  41. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +11 -0
  42. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailSelector.d.ts +2 -1
  43. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailSelector.js +1 -0
  44. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailState.d.ts +8 -0
  45. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailState.js +7 -1
  46. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +19 -0
  47. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +33 -1
  48. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +13 -0
  49. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +11 -2
  50. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -2
  51. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +2 -1
  52. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +2 -1
  53. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionStatisticsEpic.d.ts +7 -0
  54. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionStatisticsEpic.js +39 -0
  55. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +13 -0
  56. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +14 -1
  57. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +14 -0
  58. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +2 -2
  59. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +26 -2
  60. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +17 -3
  61. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +34 -4
  62. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchCreditAccountRepaymentEpic.d.ts +7 -0
  63. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchCreditAccountRepaymentEpic.js +23 -0
  64. package/lib/zeniAPI.d.ts +1 -1
  65. package/package.json +1 -1
  66. package/lib/entity/aiController/aiControllerReducer.d.ts +0 -46
  67. package/lib/entity/aiController/aiControllerSelector.d.ts +0 -14
  68. package/lib/entity/aiController/aiControllerState.d.ts +0 -88
  69. package/lib/entity/aiController/aiControllerState.js +0 -49
  70. package/lib/view/aiControllerView/aiControllerViewReducer.d.ts +0 -73
  71. /package/lib/entity/{aiController/aiControllerPayload.js → aiCfo/aiCfoPayload.js} +0 -0
  72. /package/lib/view/{aiControllerView/aiControllerViewPayload.js → aiCfoView/aiCfoViewPayload.js} +0 -0
  73. /package/lib/view/{aiControllerView/aiControllerViewState.js → aiCfoView/aiCfoViewState.js} +0 -0
@@ -0,0 +1,73 @@
1
+ import { FetchStateAndError, ID } from '../../commonStateTypes/common';
2
+ import { PageToken } from '../../commonStateTypes/viewAndReport/viewAndReport';
3
+ import { ChatSessionPayload } from '../../entity/aiCfo/aiCfoPayload';
4
+ import { AiCfoAnswerResponseType } from '../../entity/aiCfo/aiCfoState';
5
+ import { ZeniAPIStatus } from '../../responsePayload';
6
+ import { AiCfoViewState } from './aiCfoViewState';
7
+ export declare const initialAiCfoViewState: AiCfoViewState;
8
+ export declare const submitQuestion: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[sessionId: string, questionAnswerId: string, userId: string, questionId: string, createdAt: import("dayjs").Dayjs, question: string], {
9
+ sessionId: string;
10
+ questionAnswerId: string;
11
+ userId: string;
12
+ questionId: string;
13
+ createdAt: import("dayjs").Dayjs;
14
+ question: string;
15
+ }, "aiCfoView/submitQuestion", never, never>, submitQuestionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "aiCfoView/submitQuestionSuccess">, submitQuestionFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
16
+ sessionId: ID;
17
+ error: ZeniAPIStatus;
18
+ }, "aiCfoView/submitQuestionFailure">, updateResponseState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
19
+ chatSessionId: ID;
20
+ responseType: AiCfoAnswerResponseType;
21
+ fetchState: FetchStateAndError;
22
+ }, "aiCfoView/updateResponseState">, updateAiCfoViewScrollPosition: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, "aiCfoView/updateAiCfoViewScrollPosition">, updateCurrentInput: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "aiCfoView/updateCurrentInput">, clearInput: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"aiCfoView/clearInput">, setSession: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
23
+ sessionId: string;
24
+ agentId: string;
25
+ }, "aiCfoView/setSession">, createSession: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[agentId: string, userId: string], {
26
+ agentId: string;
27
+ userId: string;
28
+ }, "aiCfoView/createSession", never, never>, createSessionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
29
+ agentId: string;
30
+ sessionId: ID;
31
+ }, "aiCfoView/createSessionSuccess">, createSessionFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "aiCfoView/createSessionFailure">, createSessionAndSubmit: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[agentId: string, userId: string, questionAnswerId: string, questionId: string, createdAt: import("dayjs").Dayjs, question: string], {
32
+ agentId: string;
33
+ userId: string;
34
+ questionAnswerId: string;
35
+ questionId: string;
36
+ createdAt: import("dayjs").Dayjs;
37
+ question: string;
38
+ }, "aiCfoView/createSessionAndSubmit", never, never>, createSessionAndSubmitSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
39
+ agentId: string;
40
+ sessionId: ID;
41
+ }, "aiCfoView/createSessionAndSubmitSuccess">, createSessionAndSubmitFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "aiCfoView/createSessionAndSubmitFailure">, fetchChatSessionsForUser: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"aiCfoView/fetchChatSessionsForUser">, fetchChatSessionsForUserSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
42
+ nextPageToken: PageToken;
43
+ sessions: ChatSessionPayload[];
44
+ }, "aiCfoView/fetchChatSessionsForUserSuccess">, fetchChatSessionsForUserFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "aiCfoView/fetchChatSessionsForUserFailure">, fetchChatHistory: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[chatSessionId: string, userId: string], {
45
+ chatSessionId: string;
46
+ userId: string;
47
+ }, "aiCfoView/fetchChatHistory", never, never>, fetchChatHistorySuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
48
+ chatSessionId: ID;
49
+ nextPageToken: PageToken;
50
+ }, "aiCfoView/fetchChatHistorySuccess">, fetchChatHistoryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
51
+ chatSessionId: ID;
52
+ error: ZeniAPIStatus;
53
+ }, "aiCfoView/fetchChatHistoryFailure">, clearCurrentSessionId: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"aiCfoView/clearCurrentSessionId">, stopSubmit: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[chatSessionId: string], {
54
+ chatSessionId: string;
55
+ }, "aiCfoView/stopSubmit", never, never>, stopSubmitSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
56
+ chatSessionId: ID;
57
+ question: string;
58
+ isOnlyQuestionInSession: boolean;
59
+ }, "aiCfoView/stopSubmitSuccess">, stopSubmitFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
60
+ chatSessionId: ID;
61
+ error: ZeniAPIStatus;
62
+ }, "aiCfoView/stopSubmitFailure">, stopSubmitQuestion: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[chatSessionId: string], {
63
+ chatSessionId: string;
64
+ }, "aiCfoView/stopSubmitQuestion", never, never>, stopSubmitQuestionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
65
+ chatSessionId: ID;
66
+ question: string;
67
+ isOnlyQuestionInSession: boolean;
68
+ }, "aiCfoView/stopSubmitQuestionSuccess">, stopSubmitQuestionFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
69
+ chatSessionId: ID;
70
+ error: ZeniAPIStatus;
71
+ }, "aiCfoView/stopSubmitQuestionFailure">, clearAiCfoView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"aiCfoView/clearAiCfoView">;
72
+ declare const _default: import("redux").Reducer<AiCfoViewState>;
73
+ export default _default;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearAIControllerView = exports.stopSubmitQuestionFailure = exports.stopSubmitQuestionSuccess = exports.stopSubmitQuestion = exports.stopSubmitFailure = exports.stopSubmitSuccess = exports.stopSubmit = exports.clearCurrentSessionId = exports.fetchChatHistoryFailure = exports.fetchChatHistorySuccess = exports.fetchChatHistory = exports.fetchChatSessionsForUserFailure = exports.fetchChatSessionsForUserSuccess = exports.fetchChatSessionsForUser = exports.createSessionAndSubmitFailure = exports.createSessionAndSubmitSuccess = exports.createSessionAndSubmit = exports.createSessionFailure = exports.createSessionSuccess = exports.createSession = exports.setSession = exports.clearInput = exports.updateCurrentInput = exports.updateAIControllerViewScrollPosition = exports.updateResponseState = exports.submitQuestionFailure = exports.submitQuestionSuccess = exports.submitQuestion = exports.initialAIControllerViewState = void 0;
4
+ exports.clearAiCfoView = exports.stopSubmitQuestionFailure = exports.stopSubmitQuestionSuccess = exports.stopSubmitQuestion = exports.stopSubmitFailure = exports.stopSubmitSuccess = exports.stopSubmit = exports.clearCurrentSessionId = exports.fetchChatHistoryFailure = exports.fetchChatHistorySuccess = exports.fetchChatHistory = exports.fetchChatSessionsForUserFailure = exports.fetchChatSessionsForUserSuccess = exports.fetchChatSessionsForUser = exports.createSessionAndSubmitFailure = exports.createSessionAndSubmitSuccess = exports.createSessionAndSubmit = exports.createSessionFailure = exports.createSessionSuccess = exports.createSession = exports.setSession = exports.clearInput = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.updateResponseState = exports.submitQuestionFailure = exports.submitQuestionSuccess = exports.submitQuestion = exports.initialAiCfoViewState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
- exports.initialAIControllerViewState = {
6
+ exports.initialAiCfoViewState = {
7
7
  fetchState: 'Not-Started',
8
8
  error: undefined,
9
9
  uiState: {
@@ -28,9 +28,9 @@ exports.initialAIControllerViewState = {
28
28
  responseStateByChatSessionId: {},
29
29
  stopSubmitStateByChatSessionId: {},
30
30
  };
31
- const aiControllerView = (0, toolkit_1.createSlice)({
32
- name: 'aiControllerView',
33
- initialState: exports.initialAIControllerViewState,
31
+ const aiCfoView = (0, toolkit_1.createSlice)({
32
+ name: 'aiCfoView',
33
+ initialState: exports.initialAiCfoViewState,
34
34
  reducers: {
35
35
  submitQuestion: {
36
36
  reducer(draft, action) {
@@ -88,7 +88,7 @@ const aiControllerView = (0, toolkit_1.createSlice)({
88
88
  draft.responseStateByChatSessionId[chatSessionId][responseType] =
89
89
  fetchState;
90
90
  },
91
- updateAIControllerViewScrollPosition(draft, action) {
91
+ updateAiCfoViewScrollPosition(draft, action) {
92
92
  if (draft.uiState.currentChatSessionId != null) {
93
93
  draft.uiState.scrollPositionByChatSessionId[draft.uiState.currentChatSessionId] = {
94
94
  scrollTop: action.payload,
@@ -290,10 +290,10 @@ const aiControllerView = (0, toolkit_1.createSlice)({
290
290
  clearCurrentSessionId(draft) {
291
291
  draft.uiState.currentChatSessionId = undefined;
292
292
  },
293
- clearAIControllerView(draft) {
294
- Object.assign(draft, exports.initialAIControllerViewState);
293
+ clearAiCfoView(draft) {
294
+ Object.assign(draft, exports.initialAiCfoViewState);
295
295
  },
296
296
  },
297
297
  });
298
- _a = aiControllerView.actions, exports.submitQuestion = _a.submitQuestion, exports.submitQuestionSuccess = _a.submitQuestionSuccess, exports.submitQuestionFailure = _a.submitQuestionFailure, exports.updateResponseState = _a.updateResponseState, exports.updateAIControllerViewScrollPosition = _a.updateAIControllerViewScrollPosition, exports.updateCurrentInput = _a.updateCurrentInput, exports.clearInput = _a.clearInput, exports.setSession = _a.setSession, exports.createSession = _a.createSession, exports.createSessionSuccess = _a.createSessionSuccess, exports.createSessionFailure = _a.createSessionFailure, exports.createSessionAndSubmit = _a.createSessionAndSubmit, exports.createSessionAndSubmitSuccess = _a.createSessionAndSubmitSuccess, exports.createSessionAndSubmitFailure = _a.createSessionAndSubmitFailure, exports.fetchChatSessionsForUser = _a.fetchChatSessionsForUser, exports.fetchChatSessionsForUserSuccess = _a.fetchChatSessionsForUserSuccess, exports.fetchChatSessionsForUserFailure = _a.fetchChatSessionsForUserFailure, exports.fetchChatHistory = _a.fetchChatHistory, exports.fetchChatHistorySuccess = _a.fetchChatHistorySuccess, exports.fetchChatHistoryFailure = _a.fetchChatHistoryFailure, exports.clearCurrentSessionId = _a.clearCurrentSessionId, exports.stopSubmit = _a.stopSubmit, exports.stopSubmitSuccess = _a.stopSubmitSuccess, exports.stopSubmitFailure = _a.stopSubmitFailure, exports.stopSubmitQuestion = _a.stopSubmitQuestion, exports.stopSubmitQuestionSuccess = _a.stopSubmitQuestionSuccess, exports.stopSubmitQuestionFailure = _a.stopSubmitQuestionFailure, exports.clearAIControllerView = _a.clearAIControllerView;
299
- exports.default = aiControllerView.reducer;
298
+ _a = aiCfoView.actions, exports.submitQuestion = _a.submitQuestion, exports.submitQuestionSuccess = _a.submitQuestionSuccess, exports.submitQuestionFailure = _a.submitQuestionFailure, exports.updateResponseState = _a.updateResponseState, exports.updateAiCfoViewScrollPosition = _a.updateAiCfoViewScrollPosition, exports.updateCurrentInput = _a.updateCurrentInput, exports.clearInput = _a.clearInput, exports.setSession = _a.setSession, exports.createSession = _a.createSession, exports.createSessionSuccess = _a.createSessionSuccess, exports.createSessionFailure = _a.createSessionFailure, exports.createSessionAndSubmit = _a.createSessionAndSubmit, exports.createSessionAndSubmitSuccess = _a.createSessionAndSubmitSuccess, exports.createSessionAndSubmitFailure = _a.createSessionAndSubmitFailure, exports.fetchChatSessionsForUser = _a.fetchChatSessionsForUser, exports.fetchChatSessionsForUserSuccess = _a.fetchChatSessionsForUserSuccess, exports.fetchChatSessionsForUserFailure = _a.fetchChatSessionsForUserFailure, exports.fetchChatHistory = _a.fetchChatHistory, exports.fetchChatHistorySuccess = _a.fetchChatHistorySuccess, exports.fetchChatHistoryFailure = _a.fetchChatHistoryFailure, exports.clearCurrentSessionId = _a.clearCurrentSessionId, exports.stopSubmit = _a.stopSubmit, exports.stopSubmitSuccess = _a.stopSubmitSuccess, exports.stopSubmitFailure = _a.stopSubmitFailure, exports.stopSubmitQuestion = _a.stopSubmitQuestion, exports.stopSubmitQuestionSuccess = _a.stopSubmitQuestionSuccess, exports.stopSubmitQuestionFailure = _a.stopSubmitQuestionFailure, exports.clearAiCfoView = _a.clearAiCfoView;
299
+ exports.default = aiCfoView.reducer;
@@ -1,10 +1,10 @@
1
1
  import { ID } from '../../commonStateTypes/common';
2
2
  import { FetchStateAndError } from '../../commonStateTypes/common';
3
3
  import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
4
- import { AIControllerSelectorView } from '../../entity/aiController/aiControllerSelector';
4
+ import { AiCfoSelectorView } from '../../entity/aiCfo/aiCfoSelector';
5
5
  import { RootState } from '../../reducer';
6
- import { AIControllerViewUIState } from './aiControllerViewState';
7
- export interface AIControllerViewSelector extends SelectorView, AIControllerSelectorView {
6
+ import { AiCfoViewUIState } from './aiCfoViewState';
7
+ export interface AiCfoViewSelector extends SelectorView, AiCfoSelectorView {
8
8
  createSessionState: FetchStateAndError;
9
9
  createSessionAndSubmitState: FetchStateAndError;
10
10
  stopSubmitStateByChatSessionId: Record<ID, FetchStateAndError>;
@@ -15,6 +15,6 @@ export interface AIControllerViewSelector extends SelectorView, AIControllerSele
15
15
  reasoning: FetchStateAndError;
16
16
  answer: FetchStateAndError;
17
17
  }>;
18
- uiState: AIControllerViewUIState;
18
+ uiState: AiCfoViewUIState;
19
19
  }
20
- export declare const getAIControllerView: (state: RootState) => AIControllerViewSelector;
20
+ export declare const getAiCfoView: (state: RootState) => AiCfoViewSelector;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAIControllerView = void 0;
4
- const aiControllerSelector_1 = require("../../entity/aiController/aiControllerSelector");
5
- const getAIControllerView = (state) => {
6
- const { fetchState, error, uiState, createSessionState, createSessionAndSubmitState, stopSubmitStateByChatSessionId, responseStateByChatSessionId, fetchChatSessionHistoryByChatSessionId, } = state.aiControllerViewState;
3
+ exports.getAiCfoView = void 0;
4
+ const aiCfoSelector_1 = require("../../entity/aiCfo/aiCfoSelector");
5
+ const getAiCfoView = (state) => {
6
+ const { fetchState, error, uiState, createSessionState, createSessionAndSubmitState, stopSubmitStateByChatSessionId, responseStateByChatSessionId, fetchChatSessionHistoryByChatSessionId, } = state.aiCfoViewState;
7
7
  return Object.assign(Object.assign({ fetchState,
8
8
  error,
9
9
  createSessionState,
@@ -11,6 +11,6 @@ const getAIControllerView = (state) => {
11
11
  stopSubmitStateByChatSessionId,
12
12
  responseStateByChatSessionId,
13
13
  uiState,
14
- fetchChatSessionHistoryByChatSessionId }, (0, aiControllerSelector_1.getAIControllerSelectorView)(state.aiControllerState)), { version: 1 });
14
+ fetchChatSessionHistoryByChatSessionId }, (0, aiCfoSelector_1.getAiCfoSelectorView)(state.aiCfoState)), { version: 1 });
15
15
  };
16
- exports.getAIControllerView = getAIControllerView;
16
+ exports.getAiCfoView = getAiCfoView;
@@ -4,7 +4,7 @@ export interface PageTokenState {
4
4
  nextPageToken: PageToken;
5
5
  hasMore: boolean;
6
6
  }
7
- export interface AIControllerViewUIState {
7
+ export interface AiCfoViewUIState {
8
8
  currentInput: string;
9
9
  scrollPositionByChatSessionId: {
10
10
  [chatSessionId: ID]: {
@@ -19,8 +19,8 @@ export interface AIControllerViewUIState {
19
19
  currentChatSessionId?: ID;
20
20
  agentId?: ID;
21
21
  }
22
- export interface AIControllerViewState extends FetchStateAndError {
23
- uiState: AIControllerViewUIState;
22
+ export interface AiCfoViewState extends FetchStateAndError {
23
+ uiState: AiCfoViewUIState;
24
24
  allChatSessionIds: ID[];
25
25
  createSessionState: FetchStateAndError;
26
26
  createSessionAndSubmitState: FetchStateAndError;
@@ -1,9 +1,9 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
- import { addQuestionPayload, setNewSession } from '../../../entity/aiController/aiControllerReducer';
3
+ import { addQuestionPayload, setNewSession } from '../../../entity/aiCfo/aiCfoReducer';
4
4
  import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
5
5
  import { RootState } from '../../../reducer';
6
6
  import { ZeniAPI } from '../../../zeniAPI';
7
- import { createSessionAndSubmit, createSessionAndSubmitFailure, createSessionAndSubmitSuccess, submitQuestion } from '../aiControllerViewReducer';
7
+ import { createSessionAndSubmit, createSessionAndSubmitFailure, createSessionAndSubmitSuccess, submitQuestion } from '../aiCfoViewReducer';
8
8
  export type ActionType = ReturnType<typeof createSessionAndSubmit> | ReturnType<typeof setNewSession> | ReturnType<typeof submitQuestion> | ReturnType<typeof createSessionAndSubmitSuccess> | ReturnType<typeof createSessionAndSubmitFailure> | ReturnType<typeof openSnackbar> | ReturnType<typeof addQuestionPayload>;
9
9
  export declare const createSessionAndSubmitEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -3,27 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createSessionAndSubmitEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
- const aiControllerReducer_1 = require("../../../entity/aiController/aiControllerReducer");
6
+ const aiCfoReducer_1 = require("../../../entity/aiCfo/aiCfoReducer");
7
7
  const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
8
8
  const responsePayload_1 = require("../../../responsePayload");
9
9
  const zeniDayJS_1 = require("../../../zeniDayJS");
10
- const aiControllerViewReducer_1 = require("../aiControllerViewReducer");
11
- const createSessionAndSubmitEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiControllerViewReducer_1.createSessionAndSubmit.match), (0, operators_1.switchMap)((action) => {
10
+ const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
11
+ const createSessionAndSubmitEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.createSessionAndSubmit.match), (0, operators_1.switchMap)((action) => {
12
12
  const { agentId, userId, questionAnswerId, questionId, createdAt, question, } = action.payload;
13
13
  const payload = { agent_id: agentId };
14
14
  return zeniAPI
15
- .postAndGetJSON(`${zeniAPI.apiEndPoints.aiControllerMicroServiceBaseUrl}/1.0/sessions`, payload)
15
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/sessions`, payload)
16
16
  .pipe((0, operators_1.mergeMap)((response) => {
17
17
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
18
18
  const sessionId = response.data.chat_session_id;
19
- return (0, rxjs_1.of)((0, aiControllerReducer_1.setNewSession)({
19
+ return (0, rxjs_1.of)((0, aiCfoReducer_1.setNewSession)({
20
20
  chatSessionId: sessionId,
21
21
  userId,
22
22
  createdAt: (0, zeniDayJS_1.date)(response.data.created_at),
23
- }), (0, aiControllerViewReducer_1.createSessionAndSubmitSuccess)({
23
+ }), (0, aiCfoViewReducer_1.createSessionAndSubmitSuccess)({
24
24
  agentId,
25
25
  sessionId,
26
- }), (0, aiControllerViewReducer_1.submitQuestion)(sessionId, questionAnswerId, userId, questionId, createdAt, question), (0, aiControllerReducer_1.addQuestionPayload)({
26
+ }), (0, aiCfoViewReducer_1.submitQuestion)(sessionId, questionAnswerId, userId, questionId, createdAt, question), (0, aiCfoReducer_1.addQuestionPayload)({
27
27
  chatSessionId: sessionId,
28
28
  questionAnswerId: questionAnswerId,
29
29
  question: {
@@ -39,8 +39,8 @@ const createSessionAndSubmitEpic = (actions$, _, zeniAPI) => actions$.pipe((0, o
39
39
  messageSection: 'ai_cfo_create_session_and_submit',
40
40
  messageText: 'failed',
41
41
  type: 'error',
42
- }), (0, aiControllerViewReducer_1.createSessionAndSubmitFailure)(response.status));
42
+ }), (0, aiCfoViewReducer_1.createSessionAndSubmitFailure)(response.status));
43
43
  }
44
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiControllerViewReducer_1.createSessionAndSubmitFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Create and Submit Session REST API call errored out: ${JSON.stringify(error)}`)))));
44
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiCfoViewReducer_1.createSessionAndSubmitFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Create and Submit Session REST API call errored out: ${JSON.stringify(error)}`)))));
45
45
  }));
46
46
  exports.createSessionAndSubmitEpic = createSessionAndSubmitEpic;
@@ -1,8 +1,8 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
- import { setNewSession } from '../../../entity/aiController/aiControllerReducer';
3
+ import { setNewSession } from '../../../entity/aiCfo/aiCfoReducer';
4
4
  import { RootState } from '../../../reducer';
5
5
  import { ZeniAPI } from '../../../zeniAPI';
6
- import { createSession, createSessionFailure, createSessionSuccess } from '../aiControllerViewReducer';
6
+ import { createSession, createSessionFailure, createSessionSuccess } from '../aiCfoViewReducer';
7
7
  export type ActionType = ReturnType<typeof createSession> | ReturnType<typeof setNewSession> | ReturnType<typeof createSessionSuccess> | ReturnType<typeof createSessionFailure>;
8
8
  export declare const createSessionEpic: (actions$: ActionsObservable<ActionType>, _: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -3,29 +3,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createSessionEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
- const aiControllerReducer_1 = require("../../../entity/aiController/aiControllerReducer");
6
+ const aiCfoReducer_1 = require("../../../entity/aiCfo/aiCfoReducer");
7
7
  const responsePayload_1 = require("../../../responsePayload");
8
8
  const zeniDayJS_1 = require("../../../zeniDayJS");
9
- const aiControllerViewReducer_1 = require("../aiControllerViewReducer");
10
- const createSessionEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiControllerViewReducer_1.createSession.match), (0, operators_1.switchMap)((action) => {
9
+ const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
10
+ const createSessionEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.createSession.match), (0, operators_1.switchMap)((action) => {
11
11
  const { agentId, userId } = action.payload;
12
12
  const payload = { agent_id: agentId };
13
13
  return zeniAPI
14
- .postAndGetJSON(`${zeniAPI.apiEndPoints.aiControllerMicroServiceBaseUrl}/1.0/sessions`, payload)
14
+ .postAndGetJSON(`${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/sessions`, payload)
15
15
  .pipe((0, operators_1.mergeMap)((response) => {
16
16
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
17
- return (0, rxjs_1.of)((0, aiControllerReducer_1.setNewSession)({
17
+ return (0, rxjs_1.of)((0, aiCfoReducer_1.setNewSession)({
18
18
  chatSessionId: response.data.chat_session_id,
19
19
  userId,
20
20
  createdAt: (0, zeniDayJS_1.date)(response.data.created_at),
21
- }), (0, aiControllerViewReducer_1.createSessionSuccess)({
21
+ }), (0, aiCfoViewReducer_1.createSessionSuccess)({
22
22
  agentId,
23
23
  sessionId: response.data.chat_session_id,
24
24
  }));
25
25
  }
26
26
  else {
27
- return (0, rxjs_1.of)((0, aiControllerViewReducer_1.createSessionFailure)(response.status));
27
+ return (0, rxjs_1.of)((0, aiCfoViewReducer_1.createSessionFailure)(response.status));
28
28
  }
29
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiControllerViewReducer_1.createSessionFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Create Session REST API call errored out: ${JSON.stringify(error)}`)))));
29
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiCfoViewReducer_1.createSessionFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Create Session REST API call errored out: ${JSON.stringify(error)}`)))));
30
30
  }));
31
31
  exports.createSessionEpic = createSessionEpic;
@@ -1,8 +1,8 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
- import { setChatHistory } from '../../../entity/aiController/aiControllerReducer';
3
+ import { setChatHistory } from '../../../entity/aiCfo/aiCfoReducer';
4
4
  import { RootState } from '../../../reducer';
5
5
  import { ZeniAPI } from '../../../zeniAPI';
6
- import { fetchChatHistory, fetchChatHistoryFailure, fetchChatHistorySuccess } from '../aiControllerViewReducer';
6
+ import { fetchChatHistory, fetchChatHistoryFailure, fetchChatHistorySuccess } from '../aiCfoViewReducer';
7
7
  export type ActionType = ReturnType<typeof fetchChatHistory> | ReturnType<typeof setChatHistory> | ReturnType<typeof fetchChatHistorySuccess> | ReturnType<typeof fetchChatHistoryFailure>;
8
8
  export declare const fetchChatHistoryEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fetchChatHistoryEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
- const aiControllerReducer_1 = require("../../../entity/aiController/aiControllerReducer");
6
+ const aiCfoReducer_1 = require("../../../entity/aiCfo/aiCfoReducer");
7
7
  const responsePayload_1 = require("../../../responsePayload");
8
- const aiControllerViewReducer_1 = require("../aiControllerViewReducer");
9
- const fetchChatHistoryEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiControllerViewReducer_1.fetchChatHistory.match), (0, operators_1.mergeMap)((action) => {
8
+ const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
9
+ const fetchChatHistoryEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.fetchChatHistory.match), (0, operators_1.mergeMap)((action) => {
10
10
  var _a, _b;
11
11
  const { chatSessionId, userId } = action.payload;
12
12
  const state = state$.value;
13
- const pageToken = (_b = (_a = state.aiControllerViewState.uiState.chatHistoryNextPageToken[chatSessionId]) === null || _a === void 0 ? void 0 : _a.nextPageToken) !== null && _b !== void 0 ? _b : null;
13
+ const pageToken = (_b = (_a = state.aiCfoViewState.uiState.chatHistoryNextPageToken[chatSessionId]) === null || _a === void 0 ? void 0 : _a.nextPageToken) !== null && _b !== void 0 ? _b : null;
14
14
  const queryParams = new URLSearchParams();
15
15
  queryParams.append('page_size', '20');
16
16
  queryParams.append('chat_session_id', chatSessionId);
@@ -19,26 +19,26 @@ const fetchChatHistoryEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
19
19
  queryParams.append('page_token', pageToken);
20
20
  }
21
21
  return zeniAPI
22
- .getJSON(`${zeniAPI.apiEndPoints.aiControllerMicroServiceBaseUrl}/1.0/history?${queryParams.toString()}`)
22
+ .getJSON(`${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/history?${queryParams.toString()}`)
23
23
  .pipe((0, operators_1.mergeMap)((response) => {
24
24
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
25
25
  const isPaginationComplete = response.data.next_page_token == null;
26
- return (0, rxjs_1.of)((0, aiControllerReducer_1.setChatHistory)({
26
+ return (0, rxjs_1.of)((0, aiCfoReducer_1.setChatHistory)({
27
27
  chatSessionId,
28
28
  history: response.data.messages,
29
29
  isPaginationComplete,
30
- }), (0, aiControllerViewReducer_1.fetchChatHistorySuccess)({
30
+ }), (0, aiCfoViewReducer_1.fetchChatHistorySuccess)({
31
31
  chatSessionId,
32
32
  nextPageToken: response.data.next_page_token,
33
33
  }));
34
34
  }
35
35
  else {
36
- return (0, rxjs_1.of)((0, aiControllerViewReducer_1.fetchChatHistoryFailure)({
36
+ return (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchChatHistoryFailure)({
37
37
  chatSessionId,
38
38
  error: response.status,
39
39
  }));
40
40
  }
41
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiControllerViewReducer_1.fetchChatHistoryFailure)({
41
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchChatHistoryFailure)({
42
42
  chatSessionId,
43
43
  error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Chat History REST API call errored out' +
44
44
  JSON.stringify(error)),
@@ -1,8 +1,8 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
- import { setSessions } from '../../../entity/aiController/aiControllerReducer';
3
+ import { setSessions } from '../../../entity/aiCfo/aiCfoReducer';
4
4
  import { RootState } from '../../../reducer';
5
5
  import { ZeniAPI } from '../../../zeniAPI';
6
- import { fetchChatSessionsForUser, fetchChatSessionsForUserFailure, fetchChatSessionsForUserSuccess } from '../aiControllerViewReducer';
6
+ import { fetchChatSessionsForUser, fetchChatSessionsForUserFailure, fetchChatSessionsForUserSuccess } from '../aiCfoViewReducer';
7
7
  export type ActionType = ReturnType<typeof fetchChatSessionsForUser> | ReturnType<typeof setSessions> | ReturnType<typeof fetchChatSessionsForUserSuccess> | ReturnType<typeof fetchChatSessionsForUserFailure>;
8
8
  export declare const fetchChatSessionsForUserEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -3,34 +3,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fetchChatSessionsForUserEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
- const aiControllerReducer_1 = require("../../../entity/aiController/aiControllerReducer");
6
+ const aiCfoReducer_1 = require("../../../entity/aiCfo/aiCfoReducer");
7
7
  const responsePayload_1 = require("../../../responsePayload");
8
- const aiControllerViewReducer_1 = require("../aiControllerViewReducer");
9
- const fetchChatSessionsForUserEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiControllerViewReducer_1.fetchChatSessionsForUser.match), (0, operators_1.switchMap)(() => {
8
+ const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
9
+ const fetchChatSessionsForUserEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.fetchChatSessionsForUser.match), (0, operators_1.switchMap)(() => {
10
10
  var _a;
11
11
  const state = state$.value;
12
- const pageToken = (_a = state.aiControllerViewState.uiState.chatSessionsNextPageToken
13
- .nextPageToken) !== null && _a !== void 0 ? _a : null;
12
+ const pageToken = (_a = state.aiCfoViewState.uiState.chatSessionsNextPageToken.nextPageToken) !== null && _a !== void 0 ? _a : null;
14
13
  const queryParams = new URLSearchParams();
15
14
  queryParams.append('page_size', '50');
16
15
  if (pageToken != null) {
17
16
  queryParams.append('page_token', pageToken);
18
17
  }
19
18
  return zeniAPI
20
- .getJSON(`${zeniAPI.apiEndPoints.aiControllerMicroServiceBaseUrl}/1.0/sessions?${queryParams.toString()}`)
19
+ .getJSON(`${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/sessions?${queryParams.toString()}`)
21
20
  .pipe((0, operators_1.mergeMap)((response) => {
22
21
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
23
22
  // Filter out empty sessions that don't have a summary
24
23
  const sessions = response.data.sessions.filter((session) => Boolean(session.chat_session_summary) === true);
25
- return (0, rxjs_1.of)((0, aiControllerReducer_1.setSessions)(sessions), (0, aiControllerViewReducer_1.fetchChatSessionsForUserSuccess)({
24
+ return (0, rxjs_1.of)((0, aiCfoReducer_1.setSessions)(sessions), (0, aiCfoViewReducer_1.fetchChatSessionsForUserSuccess)({
26
25
  sessions,
27
26
  nextPageToken: response.data.next_page_token,
28
27
  }));
29
28
  }
30
29
  else {
31
- return (0, rxjs_1.of)((0, aiControllerViewReducer_1.fetchChatSessionsForUserFailure)(response.status));
30
+ return (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchChatSessionsForUserFailure)(response.status));
32
31
  }
33
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiControllerViewReducer_1.fetchChatSessionsForUserFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Chat Sessions for User REST API call errored out' +
32
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchChatSessionsForUserFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Chat Sessions for User REST API call errored out' +
34
33
  JSON.stringify(error))))));
35
34
  }));
36
35
  exports.fetchChatSessionsForUserEpic = fetchChatSessionsForUserEpic;
@@ -1,8 +1,8 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
- import { deleteQuestion } from '../../../entity/aiController/aiControllerReducer';
3
+ import { deleteQuestion } from '../../../entity/aiCfo/aiCfoReducer';
4
4
  import { RootState } from '../../../reducer';
5
5
  import { ZeniAPI } from '../../../zeniAPI';
6
- import { stopSubmit, stopSubmitFailure, stopSubmitSuccess } from '../aiControllerViewReducer';
6
+ import { stopSubmit, stopSubmitFailure, stopSubmitSuccess } from '../aiCfoViewReducer';
7
7
  export type ActionType = ReturnType<typeof stopSubmit> | ReturnType<typeof deleteQuestion> | ReturnType<typeof stopSubmitSuccess> | ReturnType<typeof stopSubmitFailure>;
8
8
  export declare const stopSubmitEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -3,16 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.stopSubmitEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
- const aiControllerReducer_1 = require("../../../entity/aiController/aiControllerReducer");
6
+ const aiCfoReducer_1 = require("../../../entity/aiCfo/aiCfoReducer");
7
7
  const responsePayload_1 = require("../../../responsePayload");
8
- const aiControllerViewReducer_1 = require("../aiControllerViewReducer");
9
- const stopSubmitEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiControllerViewReducer_1.stopSubmit.match), (0, operators_1.switchMap)((action) => {
8
+ const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
9
+ const stopSubmitEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.stopSubmit.match), (0, operators_1.switchMap)((action) => {
10
10
  const { chatSessionId } = action.payload;
11
11
  // Find the questionId: last Q/A with no responses
12
12
  const state = state$.value;
13
- const session = state.aiControllerState.aiControllerByChatSessionId[chatSessionId];
13
+ const session = state.aiCfoState.aiCfoByChatSessionId[chatSessionId];
14
14
  if (session == null) {
15
- return (0, rxjs_1.of)((0, aiControllerViewReducer_1.stopSubmitFailure)({
15
+ return (0, rxjs_1.of)((0, aiCfoViewReducer_1.stopSubmitFailure)({
16
16
  chatSessionId,
17
17
  error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Session not found'),
18
18
  }));
@@ -24,29 +24,29 @@ const stopSubmitEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operator
24
24
  questionAnswer.responses.answer == null);
25
25
  const isOnlyQuestionInSession = session.questionAnswers.length <= 1;
26
26
  if (!qa) {
27
- return (0, rxjs_1.of)((0, aiControllerViewReducer_1.stopSubmitFailure)({
27
+ return (0, rxjs_1.of)((0, aiCfoViewReducer_1.stopSubmitFailure)({
28
28
  chatSessionId,
29
29
  error: { code: 404, message: 'No pending question found' },
30
30
  }));
31
31
  }
32
32
  const questionId = qa.question.messageId;
33
33
  return zeniAPI
34
- .deleteAndGetJSON(`${zeniAPI.apiEndPoints.aiControllerMicroServiceBaseUrl}/1.0/messages/${questionId}`)
34
+ .deleteAndGetJSON(`${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/messages/${questionId}`)
35
35
  .pipe((0, operators_1.mergeMap)((response) => {
36
36
  if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
37
- return (0, rxjs_1.of)((0, aiControllerReducer_1.deleteQuestion)({
37
+ return (0, rxjs_1.of)((0, aiCfoReducer_1.deleteQuestion)({
38
38
  chatSessionId,
39
39
  questionAnswerId: qa.questionAnswerId,
40
- }), (0, aiControllerViewReducer_1.stopSubmitSuccess)({
40
+ }), (0, aiCfoViewReducer_1.stopSubmitSuccess)({
41
41
  chatSessionId,
42
42
  question: qa.question.questionText,
43
43
  isOnlyQuestionInSession,
44
44
  }));
45
45
  }
46
46
  else {
47
- return (0, rxjs_1.of)((0, aiControllerViewReducer_1.stopSubmitFailure)({ chatSessionId, error: response.status }));
47
+ return (0, rxjs_1.of)((0, aiCfoViewReducer_1.stopSubmitFailure)({ chatSessionId, error: response.status }));
48
48
  }
49
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiControllerViewReducer_1.stopSubmitFailure)({
49
+ }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiCfoViewReducer_1.stopSubmitFailure)({
50
50
  chatSessionId,
51
51
  error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Stop submit REST API call errored out' +
52
52
  JSON.stringify(error)),
@@ -1,7 +1,7 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
- import { deleteQuestion } from '../../../entity/aiController/aiControllerReducer';
3
+ import { deleteQuestion } from '../../../entity/aiCfo/aiCfoReducer';
4
4
  import { RootState } from '../../../reducer';
5
- import { stopSubmitQuestion, stopSubmitQuestionFailure, stopSubmitQuestionSuccess } from '../aiControllerViewReducer';
5
+ import { stopSubmitQuestion, stopSubmitQuestionFailure, stopSubmitQuestionSuccess } from '../aiCfoViewReducer';
6
6
  export type ActionType = ReturnType<typeof stopSubmitQuestion> | ReturnType<typeof deleteQuestion> | ReturnType<typeof stopSubmitQuestionSuccess> | ReturnType<typeof stopSubmitQuestionFailure>;
7
7
  export declare const stopSubmitQuestionEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -3,16 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.stopSubmitQuestionEpic = void 0;
4
4
  const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
- const aiControllerReducer_1 = require("../../../entity/aiController/aiControllerReducer");
6
+ const aiCfoReducer_1 = require("../../../entity/aiCfo/aiCfoReducer");
7
7
  const responsePayload_1 = require("../../../responsePayload");
8
- const aiControllerViewReducer_1 = require("../aiControllerViewReducer");
9
- const stopSubmitQuestionEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(aiControllerViewReducer_1.stopSubmitQuestion.match), (0, operators_1.delay)(500), (0, operators_1.switchMap)((action) => {
8
+ const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
9
+ const stopSubmitQuestionEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.stopSubmitQuestion.match), (0, operators_1.delay)(500), (0, operators_1.switchMap)((action) => {
10
10
  const { chatSessionId } = action.payload;
11
11
  // Find the questionId: last Q/A with no responses
12
12
  const state = state$.value;
13
- const session = state.aiControllerState.aiControllerByChatSessionId[chatSessionId];
13
+ const session = state.aiCfoState.aiCfoByChatSessionId[chatSessionId];
14
14
  if (session == null) {
15
- return (0, rxjs_1.of)((0, aiControllerViewReducer_1.stopSubmitQuestionFailure)({
15
+ return (0, rxjs_1.of)((0, aiCfoViewReducer_1.stopSubmitQuestionFailure)({
16
16
  chatSessionId,
17
17
  error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Session not found'),
18
18
  }));
@@ -24,15 +24,15 @@ const stopSubmitQuestionEpic = (actions$, state$) => actions$.pipe((0, operators
24
24
  questionAnswer.responses.answer == null);
25
25
  const isOnlyQuestionInSession = session.questionAnswers.length <= 1;
26
26
  if (!qa) {
27
- return (0, rxjs_1.of)((0, aiControllerViewReducer_1.stopSubmitQuestionFailure)({
27
+ return (0, rxjs_1.of)((0, aiCfoViewReducer_1.stopSubmitQuestionFailure)({
28
28
  chatSessionId,
29
29
  error: { code: 404, message: 'No pending question found' },
30
30
  }));
31
31
  }
32
- return (0, rxjs_1.of)((0, aiControllerReducer_1.deleteQuestion)({
32
+ return (0, rxjs_1.of)((0, aiCfoReducer_1.deleteQuestion)({
33
33
  chatSessionId,
34
34
  questionAnswerId: qa.questionAnswerId,
35
- }), (0, aiControllerViewReducer_1.stopSubmitQuestionSuccess)({
35
+ }), (0, aiCfoViewReducer_1.stopSubmitQuestionSuccess)({
36
36
  chatSessionId,
37
37
  question: qa.question.questionText,
38
38
  isOnlyQuestionInSession,
@@ -1,8 +1,8 @@
1
1
  import { ActionsObservable, StateObservable } from 'redux-observable';
2
2
  import { Observable } from 'rxjs';
3
- import { upsertOrAddQuestionAnswerPayload } from '../../../entity/aiController/aiControllerReducer';
3
+ import { upsertOrAddQuestionAnswerPayload } from '../../../entity/aiCfo/aiCfoReducer';
4
4
  import { RootState } from '../../../reducer';
5
5
  import { ZeniAPI } from '../../../zeniAPI';
6
- import { submitQuestion, submitQuestionFailure, submitQuestionSuccess } from '../aiControllerViewReducer';
6
+ import { submitQuestion, submitQuestionFailure, submitQuestionSuccess } from '../aiCfoViewReducer';
7
7
  export type ActionType = ReturnType<typeof submitQuestion> | ReturnType<typeof submitQuestionSuccess> | ReturnType<typeof submitQuestionFailure> | ReturnType<typeof upsertOrAddQuestionAnswerPayload>;
8
8
  export declare const submitQuestionEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;