@zeniai/client-epic-state 4.19.87-beta2AD → 4.19.87

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 (39) hide show
  1. package/lib/entity/aiCfo/aiCfoSelector.d.ts +2 -1
  2. package/lib/epic.d.ts +1 -2
  3. package/lib/epic.js +1 -2
  4. package/lib/esm/epic.js +1 -2
  5. package/lib/esm/index.js +2 -2
  6. package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +1 -83
  7. package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +2 -8
  8. package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +0 -10
  9. package/lib/esm/view/spendManagement/billPay/billList/billListState.js +0 -1
  10. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
  11. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
  12. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
  13. package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
  14. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  15. package/lib/index.d.ts +3 -5
  16. package/lib/index.js +2 -8
  17. package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
  18. package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +0 -11
  19. package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +1 -15
  20. package/lib/view/aiCfoView/aiCfoViewReducer.js +2 -84
  21. package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +1 -4
  22. package/lib/view/aiCfoView/aiCfoViewSelector.js +2 -9
  23. package/lib/view/aiCfoView/aiCfoViewState.d.ts +0 -22
  24. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  25. package/lib/view/spendManagement/billPay/billList/billListSelector.js +0 -10
  26. package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
  27. package/lib/view/spendManagement/billPay/billList/billListState.js +0 -1
  28. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
  29. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +0 -1
  30. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +0 -2
  31. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +0 -1
  32. package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +0 -12
  33. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
  34. package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +0 -1
  35. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
  36. package/package.json +1 -1
  37. package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -26
  38. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +0 -8
  39. package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +0 -30
@@ -1,7 +1,6 @@
1
1
  import { AiCfoAnswerPayload, ChatSessionPayload } from '../../entity/aiCfo/aiCfoPayload';
2
2
  import { UserRolePayload } from '../../entity/userRole/userRolePayload';
3
3
  import { ZeniAPIResponse } from '../../responsePayload';
4
- import { AiCfoSuggestedQuestionsPageContext } from './aiCfoViewState';
5
4
  export type ContextStatus = 'NONE' | 'NOT_FOUND' | 'PERMISSION_DENIED' | 'SUCCESS';
6
5
  export interface CreateSessionResponseData {
7
6
  chat_session_id: string;
@@ -24,14 +23,4 @@ interface AcceptMasterTOSPayload {
24
23
  user_roles: UserRolePayload[];
25
24
  }
26
25
  export type AcceptMasterTOSResponse = ZeniAPIResponse<AcceptMasterTOSPayload>;
27
- /**
28
- * Payload returned in `data` for GET .../suggested-questions?page_context=...
29
- * Field names match the REST API (snake_case).
30
- */
31
- export interface SuggestedQuestionsDataPayload {
32
- generated_at: string;
33
- page_context: AiCfoSuggestedQuestionsPageContext;
34
- suggested_questions: string[];
35
- }
36
- export type FetchSuggestedQuestionsResponse = ZeniAPIResponse<SuggestedQuestionsDataPayload>;
37
26
  export {};
@@ -4,7 +4,6 @@ import { ChatSessionPayload } from '../../entity/aiCfo/aiCfoPayload';
4
4
  import { AiCfoAnswerResponseType } from '../../entity/aiCfo/aiCfoState';
5
5
  import { ZeniAPIStatus } from '../../responsePayload';
6
6
  import { ContextStatus } from './aiCfoViewPayload';
7
- import { AiCfoSuggestedQuestionsPageContext } from './aiCfoViewState';
8
7
  import { AiCfoViewState } from './aiCfoViewState';
9
8
  export declare const initialAiCfoViewState: AiCfoViewState;
10
9
  export declare const submitQuestion: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[sessionId: string, questionAnswerId: string, userId: string, questionId: string, createdAt: import("dayjs").Dayjs, question: string, files?: File[] | undefined], {
@@ -90,19 +89,6 @@ export declare const submitQuestion: import("@reduxjs/toolkit").ActionCreatorWit
90
89
  }, "aiCfoView/clearDeleteChatSessionStatus">, clearAiCfoView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"aiCfoView/clearAiCfoView">, updateCotCollapsedState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
91
90
  isCollapsed: boolean;
92
91
  questionAnswerId: ID;
93
- }, "aiCfoView/updateCotCollapsedState">, fetchSuggestedQuestions: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
94
- pageContext: AiCfoSuggestedQuestionsPageContext;
95
- }, "aiCfoView/fetchSuggestedQuestions">, fetchSuggestedQuestionsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
96
- generatedAt: string;
97
- pageContext: AiCfoSuggestedQuestionsPageContext;
98
- suggestedQuestions: string[];
99
- }, "aiCfoView/fetchSuggestedQuestionsSuccess">, fetchSuggestedQuestionsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
100
- error: ZeniAPIStatus;
101
- pageContext: AiCfoSuggestedQuestionsPageContext;
102
- }, "aiCfoView/fetchSuggestedQuestionsFailure">, applyEmbeddingPageTransition: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
103
- newPageKey: string;
104
- /** When omitted or null, clears the active session (empty / suggested questions). */
105
- nextCurrentChatSessionId?: ID | null;
106
- }, "aiCfoView/applyEmbeddingPageTransition">, clearEmbeddingPageContext: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"aiCfoView/clearEmbeddingPageContext">;
92
+ }, "aiCfoView/updateCotCollapsedState">;
107
93
  declare const _default: import("redux").Reducer<AiCfoViewState>;
108
94
  export default _default;
@@ -1,23 +1,8 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearEmbeddingPageContext = exports.applyEmbeddingPageTransition = exports.fetchSuggestedQuestionsFailure = exports.fetchSuggestedQuestionsSuccess = exports.fetchSuggestedQuestions = exports.updateCotCollapsedState = exports.clearAiCfoView = exports.clearDeleteChatSessionStatus = exports.deleteChatSessionFailure = exports.deleteChatSessionSuccess = exports.deleteChatSession = exports.acceptMasterTOSFailure = exports.acceptMasterTOSSuccess = exports.acceptMasterTOS = exports.stopSubmitQuestionFailure = exports.stopSubmitQuestionSuccess = exports.stopSubmitQuestion = exports.stopSubmitFailure = exports.stopSubmitSuccess = exports.stopSubmit = exports.clearLastContextMessage = exports.clearCurrentSessionId = exports.fetchChatHistoryFailure = exports.fetchChatHistorySuccess = exports.fetchChatHistory = exports.fetchChatSessionsForUserFailure = exports.fetchChatSessionsForUserSuccess = exports.fetchChatSessionsForUser = exports.createSessionAndSubmitFailure = exports.createSessionAndSubmitSuccess = exports.initializeNewSessionState = 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;
4
+ exports.updateCotCollapsedState = exports.clearAiCfoView = exports.clearDeleteChatSessionStatus = exports.deleteChatSessionFailure = exports.deleteChatSessionSuccess = exports.deleteChatSession = exports.acceptMasterTOSFailure = exports.acceptMasterTOSSuccess = exports.acceptMasterTOS = exports.stopSubmitQuestionFailure = exports.stopSubmitQuestionSuccess = exports.stopSubmitQuestion = exports.stopSubmitFailure = exports.stopSubmitSuccess = exports.stopSubmit = exports.clearLastContextMessage = exports.clearCurrentSessionId = exports.fetchChatHistoryFailure = exports.fetchChatHistorySuccess = exports.fetchChatHistory = exports.fetchChatSessionsForUserFailure = exports.fetchChatSessionsForUserSuccess = exports.fetchChatSessionsForUser = exports.createSessionAndSubmitFailure = exports.createSessionAndSubmitSuccess = exports.initializeNewSessionState = 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
- function removeSessionIdFromPageKeyMap(draft, sessionId) {
7
- const map = draft.uiState.chatSessionIdByPageKey;
8
- for (const key of Object.keys(map)) {
9
- if (map[key] === sessionId) {
10
- delete map[key];
11
- }
12
- }
13
- }
14
- function mirrorCurrentSessionToPageKeyMapIfActive(draft) {
15
- const key = draft.uiState.embeddingActivePageKey;
16
- const sessionId = draft.uiState.currentChatSessionId;
17
- if (key != null && sessionId != null) {
18
- draft.uiState.chatSessionIdByPageKey[key] = sessionId;
19
- }
20
- }
21
6
  exports.initialAiCfoViewState = {
22
7
  fetchState: 'Not-Started',
23
8
  error: undefined,
@@ -25,8 +10,6 @@ exports.initialAiCfoViewState = {
25
10
  currentInput: '',
26
11
  scrollPositionByChatSessionId: {},
27
12
  currentChatSessionId: undefined,
28
- embeddingActivePageKey: undefined,
29
- chatSessionIdByPageKey: {},
30
13
  agentId: undefined,
31
14
  chatHistoryNextPageToken: {},
32
15
  chatSessionsNextPageToken: { nextPageToken: null, hasMore: false },
@@ -50,7 +33,6 @@ exports.initialAiCfoViewState = {
50
33
  fetchChatSessionHistoryByChatSessionId: {},
51
34
  responseStateByChatSessionId: {},
52
35
  stopSubmitStateByChatSessionId: {},
53
- suggestedQuestionsByPageContext: {},
54
36
  };
55
37
  const aiCfoView = (0, toolkit_1.createSlice)({
56
38
  name: 'aiCfoView',
@@ -184,7 +166,6 @@ const aiCfoView = (0, toolkit_1.createSlice)({
184
166
  setSession(draft, action) {
185
167
  draft.uiState.currentChatSessionId = action.payload.sessionId;
186
168
  draft.uiState.agentId = action.payload.agentId;
187
- mirrorCurrentSessionToPageKeyMapIfActive(draft);
188
169
  },
189
170
  createSession: {
190
171
  reducer(draft, action) {
@@ -208,7 +189,6 @@ const aiCfoView = (0, toolkit_1.createSlice)({
208
189
  nextPageToken: null,
209
190
  hasMore: false,
210
191
  };
211
- mirrorCurrentSessionToPageKeyMapIfActive(draft);
212
192
  },
213
193
  createSessionFailure(draft, action) {
214
194
  draft.createSessionState.fetchState = 'Error';
@@ -246,7 +226,6 @@ const aiCfoView = (0, toolkit_1.createSlice)({
246
226
  nextPageToken: null,
247
227
  hasMore: false,
248
228
  };
249
- mirrorCurrentSessionToPageKeyMapIfActive(draft);
250
229
  },
251
230
  createSessionAndSubmitSuccess(draft) {
252
231
  // Note: currentChatSessionId, agentId, and chatHistoryNextPageToken are set by initializeNewSessionState
@@ -363,7 +342,6 @@ const aiCfoView = (0, toolkit_1.createSlice)({
363
342
  draft.uiState.currentChatSessionId = undefined;
364
343
  draft.uiState.agentId = undefined;
365
344
  }
366
- removeSessionIdFromPageKeyMap(draft, chatSessionId);
367
345
  delete draft.uiState.chatHistoryNextPageToken[chatSessionId];
368
346
  delete draft.uiState.scrollPositionByChatSessionId[chatSessionId];
369
347
  delete draft.fetchChatSessionHistoryByChatSessionId[chatSessionId];
@@ -386,66 +364,6 @@ const aiCfoView = (0, toolkit_1.createSlice)({
386
364
  },
387
365
  clearCurrentSessionId(draft) {
388
366
  draft.uiState.currentChatSessionId = undefined;
389
- const key = draft.uiState.embeddingActivePageKey;
390
- if (key != null) {
391
- delete draft.uiState.chatSessionIdByPageKey[key];
392
- }
393
- },
394
- applyEmbeddingPageTransition(draft, action) {
395
- const { newPageKey, nextCurrentChatSessionId } = action.payload;
396
- const prevKey = draft.uiState.embeddingActivePageKey;
397
- const curId = draft.uiState.currentChatSessionId;
398
- if (prevKey != null && prevKey !== newPageKey && curId != null) {
399
- draft.uiState.chatSessionIdByPageKey[prevKey] = curId;
400
- }
401
- draft.uiState.embeddingActivePageKey = newPageKey;
402
- if (nextCurrentChatSessionId == null) {
403
- draft.uiState.currentChatSessionId = undefined;
404
- }
405
- else {
406
- draft.uiState.currentChatSessionId = nextCurrentChatSessionId;
407
- }
408
- draft.uiState.currentInput = '';
409
- },
410
- clearEmbeddingPageContext(draft) {
411
- const key = draft.uiState.embeddingActivePageKey;
412
- const curId = draft.uiState.currentChatSessionId;
413
- if (key != null && curId != null) {
414
- draft.uiState.chatSessionIdByPageKey[key] = curId;
415
- }
416
- draft.uiState.embeddingActivePageKey = undefined;
417
- },
418
- fetchSuggestedQuestions(draft, action) {
419
- const { pageContext } = action.payload;
420
- const prev = draft.suggestedQuestionsByPageContext[pageContext];
421
- draft.suggestedQuestionsByPageContext[pageContext] = {
422
- fetchState: 'In-Progress',
423
- pageContext,
424
- suggestedQuestions: prev?.suggestedQuestions ?? [],
425
- generatedAt: prev?.generatedAt,
426
- error: undefined,
427
- };
428
- },
429
- fetchSuggestedQuestionsSuccess(draft, action) {
430
- const { pageContext, generatedAt, suggestedQuestions } = action.payload;
431
- draft.suggestedQuestionsByPageContext[pageContext] = {
432
- fetchState: 'Completed',
433
- pageContext,
434
- generatedAt,
435
- suggestedQuestions,
436
- error: undefined,
437
- };
438
- },
439
- fetchSuggestedQuestionsFailure(draft, action) {
440
- const { pageContext, error } = action.payload;
441
- const prev = draft.suggestedQuestionsByPageContext[pageContext];
442
- draft.suggestedQuestionsByPageContext[pageContext] = {
443
- fetchState: 'Error',
444
- pageContext,
445
- suggestedQuestions: prev?.suggestedQuestions ?? [],
446
- generatedAt: prev?.generatedAt,
447
- error,
448
- };
449
367
  },
450
368
  clearAiCfoView(draft) {
451
369
  Object.assign(draft, exports.initialAiCfoViewState);
@@ -457,5 +375,5 @@ const aiCfoView = (0, toolkit_1.createSlice)({
457
375
  },
458
376
  },
459
377
  });
460
- _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.initializeNewSessionState = _a.initializeNewSessionState, 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.clearLastContextMessage = _a.clearLastContextMessage, 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.acceptMasterTOS = _a.acceptMasterTOS, exports.acceptMasterTOSSuccess = _a.acceptMasterTOSSuccess, exports.acceptMasterTOSFailure = _a.acceptMasterTOSFailure, exports.deleteChatSession = _a.deleteChatSession, exports.deleteChatSessionSuccess = _a.deleteChatSessionSuccess, exports.deleteChatSessionFailure = _a.deleteChatSessionFailure, exports.clearDeleteChatSessionStatus = _a.clearDeleteChatSessionStatus, exports.clearAiCfoView = _a.clearAiCfoView, exports.updateCotCollapsedState = _a.updateCotCollapsedState, exports.fetchSuggestedQuestions = _a.fetchSuggestedQuestions, exports.fetchSuggestedQuestionsSuccess = _a.fetchSuggestedQuestionsSuccess, exports.fetchSuggestedQuestionsFailure = _a.fetchSuggestedQuestionsFailure, exports.applyEmbeddingPageTransition = _a.applyEmbeddingPageTransition, exports.clearEmbeddingPageContext = _a.clearEmbeddingPageContext;
378
+ _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.initializeNewSessionState = _a.initializeNewSessionState, 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.clearLastContextMessage = _a.clearLastContextMessage, 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.acceptMasterTOS = _a.acceptMasterTOS, exports.acceptMasterTOSSuccess = _a.acceptMasterTOSSuccess, exports.acceptMasterTOSFailure = _a.acceptMasterTOSFailure, exports.deleteChatSession = _a.deleteChatSession, exports.deleteChatSessionSuccess = _a.deleteChatSessionSuccess, exports.deleteChatSessionFailure = _a.deleteChatSessionFailure, exports.clearDeleteChatSessionStatus = _a.clearDeleteChatSessionStatus, exports.clearAiCfoView = _a.clearAiCfoView, exports.updateCotCollapsedState = _a.updateCotCollapsedState;
461
379
  exports.default = aiCfoView.reducer;
@@ -3,8 +3,7 @@ import { FetchStateAndError } from '../../commonStateTypes/common';
3
3
  import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
4
4
  import { AiCfoSelectorView } from '../../entity/aiCfo/aiCfoSelector';
5
5
  import { RootState } from '../../reducer';
6
- import { AiCfoSuggestedQuestionsPageContext } from './aiCfoViewState';
7
- import { AiCfoViewUIState, SuggestedQuestionsForPageContext } from './aiCfoViewState';
6
+ import { AiCfoViewUIState } from './aiCfoViewState';
8
7
  export interface AiCfoViewSelector extends SelectorView, AiCfoSelectorView {
9
8
  createSessionAndSubmitState: FetchStateAndError;
10
9
  createSessionState: FetchStateAndError;
@@ -18,8 +17,6 @@ export interface AiCfoViewSelector extends SelectorView, AiCfoSelectorView {
18
17
  thought: FetchStateAndError;
19
18
  }>;
20
19
  stopSubmitStateByChatSessionId: Record<ID, FetchStateAndError>;
21
- suggestedQuestionsByPageContext: Partial<Record<AiCfoSuggestedQuestionsPageContext, SuggestedQuestionsForPageContext>>;
22
20
  uiState: AiCfoViewUIState;
23
21
  }
24
22
  export declare const getAiCfoView: (state: RootState) => AiCfoViewSelector;
25
- export declare function getSuggestedQuestionsForPageContext(state: RootState, pageContext: AiCfoSuggestedQuestionsPageContext): SuggestedQuestionsForPageContext | undefined;
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAiCfoView = void 0;
4
- exports.getSuggestedQuestionsForPageContext = getSuggestedQuestionsForPageContext;
5
- const aiCfoReducer_1 = require("../../entity/aiCfo/aiCfoReducer");
6
4
  const aiCfoSelector_1 = require("../../entity/aiCfo/aiCfoSelector");
7
- const aiCfoViewReducer_1 = require("./aiCfoViewReducer");
8
5
  const getAiCfoView = (state) => {
9
- const { fetchState, error, uiState, createSessionState, createSessionAndSubmitState, deleteChatSessionStateByChatSessionId, stopSubmitStateByChatSessionId, responseStateByChatSessionId, fetchChatSessionHistoryByChatSessionId, masterTOSAcceptanceState, suggestedQuestionsByPageContext, } = state.aiCfoViewState ?? aiCfoViewReducer_1.initialAiCfoViewState;
6
+ const { fetchState, error, uiState, createSessionState, createSessionAndSubmitState, deleteChatSessionStateByChatSessionId, stopSubmitStateByChatSessionId, responseStateByChatSessionId, fetchChatSessionHistoryByChatSessionId, masterTOSAcceptanceState, } = state.aiCfoViewState;
10
7
  return {
11
8
  fetchState,
12
9
  error,
@@ -18,12 +15,8 @@ const getAiCfoView = (state) => {
18
15
  uiState,
19
16
  fetchChatSessionHistoryByChatSessionId,
20
17
  masterTOSAcceptanceState,
21
- suggestedQuestionsByPageContext,
22
- ...(0, aiCfoSelector_1.getAiCfoSelectorView)(state.aiCfoState ?? aiCfoReducer_1.initialAiCfoState),
18
+ ...(0, aiCfoSelector_1.getAiCfoSelectorView)(state.aiCfoState),
23
19
  version: 1,
24
20
  };
25
21
  };
26
22
  exports.getAiCfoView = getAiCfoView;
27
- function getSuggestedQuestionsForPageContext(state, pageContext) {
28
- return state.aiCfoViewState?.suggestedQuestionsByPageContext?.[pageContext];
29
- }
@@ -9,8 +9,6 @@ export interface AiCfoViewUIState {
9
9
  chatHistoryNextPageToken: {
10
10
  [chatSessionId: ID]: PageTokenState;
11
11
  };
12
- /** Last focused chat session id per embedded page key (e.g. `dashboard`, `reports:profit_loss`). */
13
- chatSessionIdByPageKey: Partial<Record<string, ID>>;
14
12
  chatSessionsFirstPageFetched: boolean;
15
13
  chatSessionsNextPageToken: PageTokenState;
16
14
  cotCollapsedByQuestionAnswerId: {
@@ -24,27 +22,9 @@ export interface AiCfoViewUIState {
24
22
  };
25
23
  agentId?: ID;
26
24
  currentChatSessionId?: ID;
27
- /**
28
- * When set, the embedded panel (e.g. dashboard/reports) is scoped to this **page key**;
29
- * session ids are mirrored into {@link chatSessionIdByPageKey}. Full `/ai-cfo/...` should clear this.
30
- */
31
- embeddingActivePageKey?: string;
32
25
  lastContextMessage?: string;
33
26
  lastContextStatus?: ContextStatus;
34
27
  }
35
- /**
36
- * Supported `page_context` values for GET .../suggested-questions and related UI state.
37
- */
38
- export type AiCfoSuggestedQuestionsPageContext = 'balance_sheet' | 'profit_loss' | 'vendors' | 'transactions' | 'cash_flow' | 'accounts_receivable' | 'accounts_payable' | 'transaction_details';
39
- /**
40
- * Suggested starter questions for AI CFO for a given page slug (e.g. balance_sheet).
41
- * Populated by {@link fetchSuggestedQuestionsEpic}; UI may fall back to Statsig defaults.
42
- */
43
- export interface SuggestedQuestionsForPageContext extends FetchStateAndError {
44
- pageContext: AiCfoSuggestedQuestionsPageContext;
45
- suggestedQuestions: string[];
46
- generatedAt?: string;
47
- }
48
28
  export interface AiCfoViewState extends FetchStateAndError {
49
29
  allChatSessionIds: ID[];
50
30
  createSessionAndSubmitState: FetchStateAndError;
@@ -59,7 +39,5 @@ export interface AiCfoViewState extends FetchStateAndError {
59
39
  thought: FetchStateAndError;
60
40
  }>;
61
41
  stopSubmitStateByChatSessionId: Record<ID, FetchStateAndError>;
62
- /** Keyed by `page_context` query value (e.g. balance_sheet). */
63
- suggestedQuestionsByPageContext: Partial<Record<AiCfoSuggestedQuestionsPageContext, SuggestedQuestionsForPageContext>>;
64
42
  uiState: AiCfoViewUIState;
65
43
  }
@@ -3,7 +3,7 @@ import { Status } from '../../commonStateTypes/status';
3
3
  import { View } from '../../commonStateTypes/viewAndReport/viewAndReport';
4
4
  import { ZeniDate } from '../../zeniDayJS';
5
5
  import { AuditSummary } from '../reviewCompanyView/reviewCompanyViewState';
6
- export declare const toAuditRuleEntityType: (v: string) => "dashboard" | "transactions" | "reports";
6
+ export declare const toAuditRuleEntityType: (v: string) => "dashboard" | "reports" | "transactions";
7
7
  export type AuditRuleEntityType = ReturnType<typeof toAuditRuleEntityType>;
8
8
  declare const toAuditRuleEntityIdType: (v: string) => "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "uncategorized-expense" | "uncategorized-income";
9
9
  export type AuditRuleEntityIdType = ReturnType<typeof toAuditRuleEntityIdType>;
@@ -424,14 +424,6 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
424
424
  transactionsWithNoSortKeyValue.push(transaction);
425
425
  }
426
426
  break;
427
- case 'invoiceNumber':
428
- if (transaction.documentId != null) {
429
- transactionsWithSortKeyValue.push(transaction);
430
- }
431
- else {
432
- transactionsWithNoSortKeyValue.push(transaction);
433
- }
434
- break;
435
427
  case 'dueDate':
436
428
  if (currentTab === 'draft') {
437
429
  if (Boolean(transaction.dueDate) === true) {
@@ -534,8 +526,6 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
534
526
  return transaction.totalAmountInUSD?.amount ?? 0;
535
527
  case 'paymentMethod':
536
528
  return transaction.billPayInfo.billPaymentMethodType.name;
537
- case 'invoiceNumber':
538
- return transaction.documentId;
539
529
  }
540
530
  }, getColumnWiseSortOrder(sortOrder));
541
531
  return [
@@ -37,7 +37,7 @@ declare const toBillTabType: (v: string) => "paid" | "pending_approval" | "sched
37
37
  export type BillTab = ReturnType<typeof toBillTabType>;
38
38
  declare const toBillsSubTabType: (v: string) => "rejected" | "failed" | "ach" | "wire" | "cancelled" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "offline";
39
39
  export type BillsSubTabType = ReturnType<typeof toBillsSubTabType>;
40
- declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceNumber" | "invoiceDate";
40
+ declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceDate";
41
41
  export declare type BillPayViewSortKey = ReturnType<typeof toBillPaySortKeyType>;
42
42
  export interface BillPayFilters {
43
43
  categories: BillPayFilterCategory[];
@@ -47,7 +47,6 @@ const ALL_BILL_PAY_SORT_KEYS = [
47
47
  'invoiceDate',
48
48
  'name',
49
49
  'paymentMethod',
50
- 'invoiceNumber',
51
50
  ];
52
51
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
53
52
  const toBillPaySortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_BILL_PAY_SORT_KEYS);
@@ -61,7 +61,7 @@ export declare const initialCreditAcc: CreditAccount;
61
61
  export declare const initialDebitCardSummaries: DebitCardSummaries;
62
62
  export declare const initialResendRevokeCardInvite: ResendRevokeCardInvite;
63
63
  export declare const initialCreditAccountRepayment: CreditAccountRepayment;
64
- export declare const toChargeCardSortKeyType: (v: string) => "status" | "accountType" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
64
+ export declare const toChargeCardSortKeyType: (v: string) => "status" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
65
65
  export declare type ChargeCardViewSortKey = ReturnType<typeof toChargeCardSortKeyType>;
66
66
  export declare const ALL_CASHBACK_SORT_KEYS: readonly ["month", "cashback"];
67
67
  export declare const toCashbackSortKeyType: (v: string) => "month" | "cashback";
@@ -78,7 +78,6 @@ const ALL_CHARGE_CARD_SORT_KEYS = [
78
78
  'cardName',
79
79
  'department',
80
80
  'cardType',
81
- 'accountType',
82
81
  'status',
83
82
  'utilisation',
84
83
  'limit',
@@ -233,8 +233,6 @@ const getCardsBySortKey = (card, sortKey) => {
233
233
  return card.cardName.toLowerCase();
234
234
  case 'cardType':
235
235
  return card.type.code;
236
- case 'accountType':
237
- return card.type.code.includes('credit') ? 'credit' : 'debit';
238
236
  case 'status':
239
237
  return card.status.code;
240
238
  case 'utilisation':
@@ -42,7 +42,6 @@ export interface ReimbursementView extends Reimbursement {
42
42
  approvers: Approvers;
43
43
  submittedBy: User | undefined;
44
44
  bulkSelectInfo?: RemiBulkSelectInfo;
45
- createdByUser?: User;
46
45
  }
47
46
  export declare const getRemiList: (state: RootState, currentTimePeriod: TimePeriod, isBulkActionFeatureEnabled: boolean) => RemiListReport;
48
47
  export declare const getApproversOrRejectors: (reimbursement: Reimbursement, entityApprovalStatusState: EntityApprovalStatusState, userState: UserState) => Approvers;
@@ -51,7 +51,6 @@ const getRemiList = (state, currentTimePeriod, isBulkActionFeatureEnabled) => {
51
51
  return {
52
52
  ...reimbursement,
53
53
  submittedBy: (0, userSelector_1.getUserByUserId)(userState, reimbursement.reimburseeUserId),
54
- createdByUser: (0, userSelector_1.getUserByUserId)(userState, reimbursement.createdBy),
55
54
  approvers: approvers,
56
55
  };
57
56
  });
@@ -424,14 +423,6 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
424
423
  reimbursementsWithNoSortKeyValue.push(reimbursement);
425
424
  }
426
425
  break;
427
- case 'createdBy':
428
- if (reimbursement.createdByUser != null) {
429
- reimbursementsWithSortKeyValue.push(reimbursement);
430
- }
431
- else {
432
- reimbursementsWithNoSortKeyValue.push(reimbursement);
433
- }
434
- break;
435
426
  }
436
427
  });
437
428
  const getColumnWiseSortOrder = (sortOrder) => {
@@ -439,7 +430,6 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
439
430
  case 'reportName':
440
431
  case 'type':
441
432
  case 'status':
442
- case 'createdBy':
443
433
  return sortOrder === 'ascending' ? 'asc' : 'desc';
444
434
  default:
445
435
  return sortOrder === 'ascending' ? 'desc' : 'asc';
@@ -459,8 +449,6 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
459
449
  return getStatusPerTab(reimbursement);
460
450
  case 'amount':
461
451
  return reimbursement.amount.amount ?? 0;
462
- case 'createdBy':
463
- return `${reimbursement.createdByUser?.firstName ?? ''} ${reimbursement.createdByUser?.lastName ?? ''}`.toLowerCase();
464
452
  }
465
453
  }, getColumnWiseSortOrder(sortOrder));
466
454
  return [
@@ -38,7 +38,7 @@ export declare const toRemiSubTabTypeStrict: (v: string) => "rejected" | "failed
38
38
  export type RemiSubTabType = ReturnType<typeof toRemiSubTabType>;
39
39
  export declare const toRemiSubTabUnderScoreType: (v: string) => "rejected" | "failed" | "ach" | "wire" | "cancelled" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "my_drafts" | "awaiting_all_approval";
40
40
  export type RemiSubTabUnderScoreType = ReturnType<typeof toRemiSubTabUnderScoreType>;
41
- declare const toReimbursementSortKeyType: (v: string) => "amount" | "status" | "type" | "createdBy" | "submittedOn" | "reportName";
41
+ declare const toReimbursementSortKeyType: (v: string) => "amount" | "status" | "type" | "submittedOn" | "reportName";
42
42
  export type ReimbursementViewSortKey = ReturnType<typeof toReimbursementSortKeyType>;
43
43
  export interface ReimbursementFilters {
44
44
  categories: ReimbursementFilterCategory[];
@@ -64,7 +64,6 @@ exports.toRemiSubTabUnderScoreType = toRemiSubTabUnderScoreType;
64
64
  const ALL_REIMBURSEMENT_SORT_KEYS = [
65
65
  'reportName',
66
66
  'submittedOn',
67
- 'createdBy',
68
67
  'type',
69
68
  'status',
70
69
  'amount',
@@ -98,11 +98,11 @@ exports.allTaskStatus = [
98
98
  },
99
99
  {
100
100
  code: 'done',
101
- name: 'In Review',
101
+ name: 'Done',
102
102
  },
103
103
  {
104
104
  code: 'resolved',
105
- name: 'Complete',
105
+ name: 'Resolved',
106
106
  },
107
107
  ];
108
108
  exports.allTaskPriority = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.19.87-beta2AD",
3
+ "version": "4.19.87",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",
@@ -1,26 +0,0 @@
1
- import { of } from 'rxjs';
2
- import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
3
- import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
4
- import { fetchSuggestedQuestions, fetchSuggestedQuestionsFailure, fetchSuggestedQuestionsSuccess, } from '../aiCfoViewReducer';
5
- /** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
6
- export const fetchSuggestedQuestionsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(fetchSuggestedQuestions.match), switchMap((action) => {
7
- const { pageContext } = action.payload;
8
- const query = new URLSearchParams({ page_context: pageContext });
9
- const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?${query.toString()}`;
10
- return zeniAPI.getJSON(url).pipe(mergeMap((response) => {
11
- if (isSuccessResponse(response) && response.data != null) {
12
- return of(fetchSuggestedQuestionsSuccess({
13
- pageContext: response.data.page_context,
14
- generatedAt: response.data.generated_at,
15
- suggestedQuestions: response.data.suggested_questions,
16
- }));
17
- }
18
- return of(fetchSuggestedQuestionsFailure({
19
- pageContext,
20
- error: response.status,
21
- }));
22
- }), catchError((error) => of(fetchSuggestedQuestionsFailure({
23
- pageContext,
24
- error: createZeniAPIStatus('Unexpected Error', 'Fetch suggested questions REST API call failed', error instanceof Error ? { message: error.message } : undefined),
25
- }))));
26
- }));
@@ -1,8 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { RootState } from '../../../reducer';
4
- import { ZeniAPI } from '../../../zeniAPI';
5
- import { fetchSuggestedQuestions, fetchSuggestedQuestionsFailure, fetchSuggestedQuestionsSuccess } from '../aiCfoViewReducer';
6
- export type ActionType = ReturnType<typeof fetchSuggestedQuestions> | ReturnType<typeof fetchSuggestedQuestionsSuccess> | ReturnType<typeof fetchSuggestedQuestionsFailure>;
7
- /** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
8
- export declare const fetchSuggestedQuestionsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchSuggestedQuestionsEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../../responsePayload");
7
- const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
8
- /** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
9
- const fetchSuggestedQuestionsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.fetchSuggestedQuestions.match), (0, operators_1.switchMap)((action) => {
10
- const { pageContext } = action.payload;
11
- const query = new URLSearchParams({ page_context: pageContext });
12
- const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?${query.toString()}`;
13
- return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
14
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
15
- return (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsSuccess)({
16
- pageContext: response.data.page_context,
17
- generatedAt: response.data.generated_at,
18
- suggestedQuestions: response.data.suggested_questions,
19
- }));
20
- }
21
- return (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsFailure)({
22
- pageContext,
23
- error: response.status,
24
- }));
25
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsFailure)({
26
- pageContext,
27
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch suggested questions REST API call failed', error instanceof Error ? { message: error.message } : undefined),
28
- }))));
29
- }));
30
- exports.fetchSuggestedQuestionsEpic = fetchSuggestedQuestionsEpic;