@zeniai/client-epic-state 4.17.9 → 4.17.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/entity/accountRecon/accountReconPayload.d.ts +0 -2
- package/lib/entity/accountRecon/accountReconPayload.js +1 -6
- package/lib/entity/accountRecon/accountReconState.d.ts +0 -2
- package/lib/entity/{aiCfo/aiCfoPayload.d.ts → aiController/aiControllerPayload.d.ts} +3 -3
- package/lib/entity/aiController/aiControllerReducer.d.ts +46 -0
- package/lib/entity/{aiCfo/aiCfoReducer.js → aiController/aiControllerReducer.js} +42 -40
- package/lib/entity/aiController/aiControllerSelector.d.ts +14 -0
- package/lib/entity/{aiCfo/aiCfoSelector.js → aiController/aiControllerSelector.js} +6 -6
- package/lib/entity/aiController/aiControllerState.d.ts +88 -0
- package/lib/entity/aiController/aiControllerState.js +49 -0
- package/lib/entity/chargeCard/chargeCard.d.ts +1 -1
- package/lib/entity/chargeCard/chargeCard.js +0 -1
- package/lib/entity/tenant/clearAllEpic.d.ts +4 -4
- package/lib/entity/tenant/clearAllEpic.js +4 -4
- package/lib/epic.d.ts +7 -7
- package/lib/epic.js +7 -7
- package/lib/index.d.ts +10 -9
- package/lib/index.js +57 -55
- package/lib/reducer.d.ts +6 -6
- package/lib/reducer.js +6 -6
- package/lib/view/{aiCfoView/aiCfoViewPayload.d.ts → aiControllerView/aiControllerViewPayload.d.ts} +2 -2
- package/lib/view/aiControllerView/aiControllerViewReducer.d.ts +73 -0
- package/lib/view/{aiCfoView/aiCfoViewReducer.js → aiControllerView/aiControllerViewReducer.js} +10 -10
- package/lib/view/{aiCfoView/aiCfoViewSelector.d.ts → aiControllerView/aiControllerViewSelector.d.ts} +5 -5
- package/lib/view/{aiCfoView/aiCfoViewSelector.js → aiControllerView/aiControllerViewSelector.js} +6 -6
- package/lib/view/{aiCfoView/aiCfoViewState.d.ts → aiControllerView/aiControllerViewState.d.ts} +3 -3
- package/lib/view/{aiCfoView → aiControllerView}/epics/createSessionAndSubmitEpic.d.ts +2 -2
- package/lib/view/{aiCfoView → aiControllerView}/epics/createSessionAndSubmitEpic.js +9 -9
- package/lib/view/{aiCfoView → aiControllerView}/epics/createSessionEpic.d.ts +2 -2
- package/lib/view/{aiCfoView → aiControllerView}/epics/createSessionEpic.js +8 -8
- package/lib/view/{aiCfoView → aiControllerView}/epics/fetchChatHistoryEpic.d.ts +2 -2
- package/lib/view/{aiCfoView → aiControllerView}/epics/fetchChatHistoryEpic.js +9 -9
- package/lib/view/{aiCfoView → aiControllerView}/epics/fetchChatSessionsForUserEpic.d.ts +2 -2
- package/lib/view/{aiCfoView → aiControllerView}/epics/fetchChatSessionsForUserEpic.js +9 -8
- package/lib/view/{aiCfoView → aiControllerView}/epics/stopSubmitEpic.d.ts +2 -2
- package/lib/view/{aiCfoView → aiControllerView}/epics/stopSubmitEpic.js +11 -11
- package/lib/view/{aiCfoView → aiControllerView}/epics/stopSubmitQuestionEpic.d.ts +2 -2
- package/lib/view/{aiCfoView → aiControllerView}/epics/stopSubmitQuestionEpic.js +8 -8
- package/lib/view/{aiCfoView → aiControllerView}/epics/submitQuestionEpic.d.ts +2 -2
- package/lib/view/{aiCfoView → aiControllerView}/epics/submitQuestionEpic.js +10 -10
- package/lib/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js +0 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +5 -4
- package/lib/zeniAPI.d.ts +1 -1
- package/package.json +1 -1
- package/lib/entity/aiCfo/aiCfoReducer.d.ts +0 -45
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +0 -14
- package/lib/entity/aiCfo/aiCfoState.d.ts +0 -88
- package/lib/entity/aiCfo/aiCfoState.js +0 -46
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +0 -73
- /package/lib/entity/{aiCfo/aiCfoPayload.js → aiController/aiControllerPayload.js} +0 -0
- /package/lib/view/{aiCfoView/aiCfoViewPayload.js → aiControllerView/aiControllerViewPayload.js} +0 -0
- /package/lib/view/{aiCfoView/aiCfoViewState.js → aiControllerView/aiControllerViewState.js} +0 -0
|
@@ -3,24 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.submitQuestionEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const
|
|
6
|
+
const aiControllerReducer_1 = require("../../../entity/aiController/aiControllerReducer");
|
|
7
7
|
const responsePayload_1 = require("../../../responsePayload");
|
|
8
|
-
const
|
|
9
|
-
const submitQuestionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(
|
|
8
|
+
const aiControllerViewReducer_1 = require("../aiControllerViewReducer");
|
|
9
|
+
const submitQuestionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiControllerViewReducer_1.submitQuestion.match), (0, operators_1.mergeMap)((action) => {
|
|
10
10
|
const { questionAnswerId, userId, sessionId, questionId, createdAt, question, } = action.payload;
|
|
11
|
-
const {
|
|
12
|
-
const { uiState } =
|
|
11
|
+
const { aiControllerViewState } = state$.value;
|
|
12
|
+
const { uiState } = aiControllerViewState;
|
|
13
13
|
const agentId = uiState.agentId;
|
|
14
14
|
const payload = { chat_session_id: sessionId, message: question };
|
|
15
15
|
if (agentId == null || Boolean(question) == false) {
|
|
16
16
|
throw new Error('Invalid State');
|
|
17
17
|
}
|
|
18
18
|
return zeniAPI
|
|
19
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.
|
|
19
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.aiControllerMicroServiceBaseUrl}/1.0/agents/${agentId}`, payload)
|
|
20
20
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
21
21
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
22
22
|
const actions = [];
|
|
23
|
-
actions.push((0,
|
|
23
|
+
actions.push((0, aiControllerReducer_1.upsertOrAddQuestionAnswerPayload)({
|
|
24
24
|
chatSessionId: sessionId,
|
|
25
25
|
questionAnswerId: questionAnswerId,
|
|
26
26
|
question: {
|
|
@@ -31,16 +31,16 @@ const submitQuestionEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, oper
|
|
|
31
31
|
answerPayload: response.data,
|
|
32
32
|
userId,
|
|
33
33
|
insertQuestionAnswer: false, // Don't insert the Q/A here after stopSubmitSuccess
|
|
34
|
-
}), (0,
|
|
34
|
+
}), (0, aiControllerViewReducer_1.submitQuestionSuccess)(sessionId));
|
|
35
35
|
return (0, rxjs_1.of)(...actions);
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
|
-
return (0, rxjs_1.of)((0,
|
|
38
|
+
return (0, rxjs_1.of)((0, aiControllerViewReducer_1.submitQuestionFailure)({
|
|
39
39
|
sessionId,
|
|
40
40
|
error: response.status,
|
|
41
41
|
}));
|
|
42
42
|
}
|
|
43
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0,
|
|
43
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiControllerViewReducer_1.submitQuestionFailure)({
|
|
44
44
|
sessionId,
|
|
45
45
|
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Submit question REST API call errored out' +
|
|
46
46
|
JSON.stringify(error)),
|
|
@@ -62,8 +62,6 @@ const saveReconciliationReviewEpic = (actions$, state$, zeniAPI) => actions$.pip
|
|
|
62
62
|
break;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
payload = Object.assign(Object.assign({}, payload), { is_recommendation_operation_selected: queryParam.review_action ===
|
|
66
|
-
(updatedTransaction === null || updatedTransaction === void 0 ? void 0 : updatedTransaction.recommendedAction.action) });
|
|
67
65
|
const messageSection = getToastMessageSection(updatedTransaction);
|
|
68
66
|
return zeniAPI
|
|
69
67
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.reconciliationMicroServiceBaseUrl}/1.0/reconciliation/review?query=${encodeURIComponent(JSON.stringify(queryParam))}`, payload)
|
|
@@ -47,7 +47,7 @@ export interface ChargeCardListWithShippingAddressSelectorView extends SelectorV
|
|
|
47
47
|
}
|
|
48
48
|
export declare const getChargeCardListView: (state: RootState, includeCreditAccountDebitSummaryAndCashbackInfo: boolean, isDebitCardEnabled: boolean, isCreditCardEnabled: boolean) => ChargeCardListSelectorView;
|
|
49
49
|
export declare const getMyPendingActivationChargeCardListView: (state: RootState) => MyPendingActivationChargeCardListSelectorView;
|
|
50
|
-
export declare const
|
|
50
|
+
export declare const getMyRequestOnHoldChargeCardListWithShippingAddress: (state: RootState) => ChargeCardListWithShippingAddressSelectorView;
|
|
51
51
|
/**
|
|
52
52
|
* helpers
|
|
53
53
|
*/
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getCreditAccount = exports.anyCardOnHold = exports.
|
|
6
|
+
exports.getCreditAccount = exports.anyCardOnHold = exports.getMyRequestOnHoldChargeCardListWithShippingAddress = exports.getMyPendingActivationChargeCardListView = exports.getChargeCardListView = void 0;
|
|
7
7
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
8
8
|
const sortOrderPayload_1 = require("../../../../commonPayloadTypes/sortOrderPayload");
|
|
9
9
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
@@ -106,12 +106,13 @@ const getMyPendingActivationChargeCardListView = (state) => {
|
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
108
|
exports.getMyPendingActivationChargeCardListView = getMyPendingActivationChargeCardListView;
|
|
109
|
-
const
|
|
109
|
+
const getMyRequestOnHoldChargeCardListWithShippingAddress = (state) => {
|
|
110
110
|
var _a, _b;
|
|
111
111
|
const { tenantState, addressState, chargeCardListState, chargeCardState, chargeCardConfigState, } = state;
|
|
112
112
|
const userId = (_b = (_a = tenantState.loggedInUser) === null || _a === void 0 ? void 0 : _a.userId) !== null && _b !== void 0 ? _b : '';
|
|
113
113
|
const cards = (0, chargeCardSelector_1.getChargeCardsByIds)(chargeCardState, chargeCardListState.cardIds);
|
|
114
|
-
const myChargeCardsWithUser = getChargeCardsWithUser(cards, state).filter((chargeCard) => chargeCard.cardHolderUserId === userId
|
|
114
|
+
const myChargeCardsWithUser = getChargeCardsWithUser(cards, state).filter((chargeCard) => chargeCard.cardHolderUserId === userId &&
|
|
115
|
+
chargeCard.status.code === 'request_on_hold');
|
|
115
116
|
const myChargeCardsWithUserAndShippingAddress = myChargeCardsWithUser.map((card) => {
|
|
116
117
|
const shippingAddress = card.shippingAddressId != null
|
|
117
118
|
? (0, addressSelector_1.getAddressByAddressId)(addressState, card.shippingAddressId)
|
|
@@ -129,7 +130,7 @@ const getMyChargeCardListWithShippingAddress = (state) => {
|
|
|
129
130
|
version: '1.0',
|
|
130
131
|
};
|
|
131
132
|
};
|
|
132
|
-
exports.
|
|
133
|
+
exports.getMyRequestOnHoldChargeCardListWithShippingAddress = getMyRequestOnHoldChargeCardListWithShippingAddress;
|
|
133
134
|
/**
|
|
134
135
|
* helpers
|
|
135
136
|
*/
|
package/lib/zeniAPI.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface RESTAPIEndpoints {
|
|
|
19
19
|
readonly taskMicroServiceBaseUrl: string;
|
|
20
20
|
readonly notificationMicroServiceBaseUrl: string;
|
|
21
21
|
readonly reconciliationMicroServiceBaseUrl: string;
|
|
22
|
-
readonly
|
|
22
|
+
readonly aiControllerMicroServiceBaseUrl: string;
|
|
23
23
|
readonly agentPerfBaseUrl: string;
|
|
24
24
|
}
|
|
25
25
|
export interface ZeniAPI<ResponseType = FetchResponse> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.17.
|
|
3
|
+
"version": "4.17.11",
|
|
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
|
"types": "lib/index.d.ts",
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { ZeniDate } from '../../zeniDayJS';
|
|
3
|
-
import { AiCfoAnswerPayload, AiCfoVisualizationPayload, ChatSessionPayload, MessagePayload } from './aiCfoPayload';
|
|
4
|
-
import { AiCfoState, AiCfoVisualization } from './aiCfoState';
|
|
5
|
-
export declare const initialAiCfoState: AiCfoState;
|
|
6
|
-
export declare const toAiCfoVisualization: (visualization: AiCfoVisualizationPayload) => AiCfoVisualization | undefined;
|
|
7
|
-
export declare const setNewSession: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
8
|
-
chatSessionId: ID;
|
|
9
|
-
userId: ID;
|
|
10
|
-
createdAt: ZeniDate;
|
|
11
|
-
}, "aiCfo/setNewSession">, clearSession: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "aiCfo/clearSession">, setSessions: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChatSessionPayload[], "aiCfo/setSessions">, setChatHistory: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
12
|
-
chatSessionId: ID;
|
|
13
|
-
history: MessagePayload[];
|
|
14
|
-
isPaginationComplete?: boolean;
|
|
15
|
-
}, "aiCfo/setChatHistory">, upsertAnswerPayload: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
|
-
chatSessionId: ID;
|
|
17
|
-
answerPayload: AiCfoAnswerPayload;
|
|
18
|
-
userId: ID;
|
|
19
|
-
questionAnswerId?: ID;
|
|
20
|
-
}, "aiCfo/upsertAnswerPayload">, upsertOrAddQuestionAnswerPayload: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
21
|
-
chatSessionId: ID;
|
|
22
|
-
questionAnswerId: ID;
|
|
23
|
-
question: {
|
|
24
|
-
questionId: ID;
|
|
25
|
-
text: string;
|
|
26
|
-
createdAt: ZeniDate;
|
|
27
|
-
};
|
|
28
|
-
answerPayload: AiCfoAnswerPayload;
|
|
29
|
-
userId: ID;
|
|
30
|
-
insertQuestionAnswer?: boolean;
|
|
31
|
-
}, "aiCfo/upsertOrAddQuestionAnswerPayload">, addQuestionPayload: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
32
|
-
chatSessionId: ID;
|
|
33
|
-
questionAnswerId: ID;
|
|
34
|
-
question: {
|
|
35
|
-
questionId: ID;
|
|
36
|
-
text: string;
|
|
37
|
-
createdAt: ZeniDate;
|
|
38
|
-
};
|
|
39
|
-
userId: ID;
|
|
40
|
-
}, "aiCfo/addQuestionPayload">, clearAiCfo: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"aiCfo/clearAiCfo">, deleteQuestion: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
41
|
-
chatSessionId: ID;
|
|
42
|
-
questionAnswerId: ID;
|
|
43
|
-
}, "aiCfo/deleteQuestion">;
|
|
44
|
-
declare const _default: import("redux").Reducer<AiCfoState>;
|
|
45
|
-
export default _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { AiCfoQuestionWithAnswer, AiCfoState } from './aiCfoState';
|
|
3
|
-
import { ChatSession } from './aiCfoState';
|
|
4
|
-
export declare function getAllQuestionAnswersForChatSession(state: AiCfoState, chatSessionId: ID): AiCfoQuestionWithAnswer[];
|
|
5
|
-
export declare function getQuestionAnswerByIdForChatSession(state: AiCfoState, chatSessionId: ID, questionAnswerId: ID): AiCfoQuestionWithAnswer | undefined;
|
|
6
|
-
export declare function getAllQuestionsForChatSession(state: AiCfoState, chatSessionId: ID): string[];
|
|
7
|
-
export interface AiCfoSelectorView {
|
|
8
|
-
allSessionsWithOrderedQuestionAnswers: ChatSessionWithOrderedQuestionAnswers[];
|
|
9
|
-
}
|
|
10
|
-
export interface ChatSessionWithOrderedQuestionAnswers {
|
|
11
|
-
chatSession: ChatSession;
|
|
12
|
-
questionAnswers: AiCfoQuestionWithAnswer[];
|
|
13
|
-
}
|
|
14
|
-
export declare function getAiCfoSelectorView(state: AiCfoState): AiCfoSelectorView;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { ZeniDate } from '../../zeniDayJS';
|
|
3
|
-
export interface AiCfoAnswerParagraph {
|
|
4
|
-
text: string;
|
|
5
|
-
orderedList?: Array<{
|
|
6
|
-
text: string;
|
|
7
|
-
subText?: string;
|
|
8
|
-
unorderedList?: string[];
|
|
9
|
-
}>;
|
|
10
|
-
}
|
|
11
|
-
export declare const ALL_AI_CFO_CHARTS_TYPES: readonly ["bar_chart", "pie_chart", "line_chart"];
|
|
12
|
-
export declare const ALL_AI_CFO_VISUALIZATION_TYPES: readonly ["bar_chart", "pie_chart", "line_chart", "table"];
|
|
13
|
-
export declare const toAiCfoVisualizationType: (v: string) => "bar_chart" | "pie_chart" | "line_chart" | "table";
|
|
14
|
-
export declare const toAiCfoVisualizationTypeStrict: (v: string) => "bar_chart" | "pie_chart" | "line_chart" | "table" | undefined;
|
|
15
|
-
export type AiCfoVisualizationType = ReturnType<typeof toAiCfoVisualizationType>;
|
|
16
|
-
export declare const toAiCfoChartType: (v: string) => "bar_chart" | "pie_chart" | "line_chart";
|
|
17
|
-
export declare const toAiCfoChartTypeStrict: (v: string) => "bar_chart" | "pie_chart" | "line_chart" | undefined;
|
|
18
|
-
export type AiCfoChartType = ReturnType<typeof toAiCfoChartType>;
|
|
19
|
-
export declare const ALL_AI_CFO_ANSWER_STATE_TYPES: readonly ["complete", "partial"];
|
|
20
|
-
export declare const ALL_AI_CFO_ANSWER_RESPONSE_TYPES: readonly ["analysis", "answer", "reasoning", "thought"];
|
|
21
|
-
export declare const toAiCfoAnswerStateType: (v: string) => "complete" | "partial";
|
|
22
|
-
export declare const toAiCfoAnswerResponseType: (v: string) => "analysis" | "answer" | "reasoning" | "thought";
|
|
23
|
-
export declare const toAiCfoAnswerStateTypeStrict: (v: string) => "complete" | "partial" | undefined;
|
|
24
|
-
export declare const toAiCfoAnswerResponseTypeStrict: (v: string) => "analysis" | "answer" | "reasoning" | "thought" | undefined;
|
|
25
|
-
export type AiCfoAnswerStateType = ReturnType<typeof toAiCfoAnswerStateType>;
|
|
26
|
-
export type AiCfoAnswerResponseType = ReturnType<typeof toAiCfoAnswerResponseType>;
|
|
27
|
-
export interface TableVisualization {
|
|
28
|
-
rows: string[][];
|
|
29
|
-
columns: string[];
|
|
30
|
-
}
|
|
31
|
-
export interface ChartVisualization {
|
|
32
|
-
values: Array<Record<string, string | number>>;
|
|
33
|
-
x: string;
|
|
34
|
-
y: string[];
|
|
35
|
-
lines?: string[];
|
|
36
|
-
}
|
|
37
|
-
export interface AiCfoVisualization {
|
|
38
|
-
type: AiCfoVisualizationType;
|
|
39
|
-
data: TableVisualization | ChartVisualization;
|
|
40
|
-
}
|
|
41
|
-
export declare const toMessageSender: (v: string) => "user" | "agent";
|
|
42
|
-
export declare const toMessageType: (v: string) => "plain_text" | "json";
|
|
43
|
-
export declare const toMessageSenderStrict: (v: string) => "user" | "agent" | undefined;
|
|
44
|
-
export declare const toMessageTypeStrict: (v: string) => "plain_text" | "json" | undefined;
|
|
45
|
-
export type MessageSender = ReturnType<typeof toMessageSender>;
|
|
46
|
-
export type MessageType = ReturnType<typeof toMessageType>;
|
|
47
|
-
export interface ResponseBlockBase {
|
|
48
|
-
messageId: ID;
|
|
49
|
-
state: AiCfoAnswerStateType;
|
|
50
|
-
createdAt: ZeniDate;
|
|
51
|
-
chatSessionId: ID;
|
|
52
|
-
userId: ID;
|
|
53
|
-
sender: MessageSender;
|
|
54
|
-
}
|
|
55
|
-
export interface AnswerContentBlockBase {
|
|
56
|
-
text: string;
|
|
57
|
-
followUpQuestions: string[];
|
|
58
|
-
assumptions: string;
|
|
59
|
-
insights: string;
|
|
60
|
-
summarizedTitle?: string;
|
|
61
|
-
visualization?: AiCfoVisualization;
|
|
62
|
-
}
|
|
63
|
-
export interface QuestionContentBlockBase extends ResponseBlockBase {
|
|
64
|
-
questionText: string;
|
|
65
|
-
}
|
|
66
|
-
export interface ResponseBlockType extends ResponseBlockBase {
|
|
67
|
-
content: AnswerContentBlockBase;
|
|
68
|
-
type: AiCfoAnswerResponseType;
|
|
69
|
-
}
|
|
70
|
-
export interface AiCfoQuestionWithAnswer {
|
|
71
|
-
questionAnswerId: ID;
|
|
72
|
-
question: QuestionContentBlockBase;
|
|
73
|
-
responses: Partial<Record<AiCfoAnswerResponseType, ResponseBlockType>>;
|
|
74
|
-
}
|
|
75
|
-
export interface ChatSession {
|
|
76
|
-
chatSessionId: ID;
|
|
77
|
-
userId: ID;
|
|
78
|
-
createdAt: ZeniDate;
|
|
79
|
-
chatSessionSummary?: string;
|
|
80
|
-
}
|
|
81
|
-
export interface ChatSessionWithMessages {
|
|
82
|
-
chatSession: ChatSession;
|
|
83
|
-
questionAnswers: AiCfoQuestionWithAnswer[];
|
|
84
|
-
}
|
|
85
|
-
export interface AiCfoState {
|
|
86
|
-
aiCfoByChatSessionId: Record<ID, ChatSessionWithMessages>;
|
|
87
|
-
partialQuestionAnswers: Record<ID, AiCfoQuestionWithAnswer | undefined>;
|
|
88
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toMessageTypeStrict = exports.toMessageSenderStrict = exports.toMessageType = exports.toMessageSender = exports.toAiCfoAnswerResponseTypeStrict = exports.toAiCfoAnswerStateTypeStrict = exports.toAiCfoAnswerResponseType = exports.toAiCfoAnswerStateType = exports.ALL_AI_CFO_ANSWER_RESPONSE_TYPES = exports.ALL_AI_CFO_ANSWER_STATE_TYPES = exports.toAiCfoChartTypeStrict = exports.toAiCfoChartType = exports.toAiCfoVisualizationTypeStrict = exports.toAiCfoVisualizationType = exports.ALL_AI_CFO_VISUALIZATION_TYPES = exports.ALL_AI_CFO_CHARTS_TYPES = void 0;
|
|
4
|
-
const stringToUnion_1 = require("../../commonStateTypes/stringToUnion");
|
|
5
|
-
exports.ALL_AI_CFO_CHARTS_TYPES = [
|
|
6
|
-
'bar_chart',
|
|
7
|
-
'pie_chart',
|
|
8
|
-
'line_chart',
|
|
9
|
-
];
|
|
10
|
-
exports.ALL_AI_CFO_VISUALIZATION_TYPES = [
|
|
11
|
-
...exports.ALL_AI_CFO_CHARTS_TYPES,
|
|
12
|
-
'table',
|
|
13
|
-
];
|
|
14
|
-
const toAiCfoVisualizationType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_AI_CFO_VISUALIZATION_TYPES);
|
|
15
|
-
exports.toAiCfoVisualizationType = toAiCfoVisualizationType;
|
|
16
|
-
const toAiCfoVisualizationTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, exports.ALL_AI_CFO_VISUALIZATION_TYPES);
|
|
17
|
-
exports.toAiCfoVisualizationTypeStrict = toAiCfoVisualizationTypeStrict;
|
|
18
|
-
const toAiCfoChartType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_AI_CFO_CHARTS_TYPES);
|
|
19
|
-
exports.toAiCfoChartType = toAiCfoChartType;
|
|
20
|
-
const toAiCfoChartTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, exports.ALL_AI_CFO_CHARTS_TYPES);
|
|
21
|
-
exports.toAiCfoChartTypeStrict = toAiCfoChartTypeStrict;
|
|
22
|
-
exports.ALL_AI_CFO_ANSWER_STATE_TYPES = ['complete', 'partial'];
|
|
23
|
-
exports.ALL_AI_CFO_ANSWER_RESPONSE_TYPES = [
|
|
24
|
-
'analysis',
|
|
25
|
-
'answer',
|
|
26
|
-
'reasoning',
|
|
27
|
-
'thought',
|
|
28
|
-
];
|
|
29
|
-
const toAiCfoAnswerStateType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_AI_CFO_ANSWER_STATE_TYPES);
|
|
30
|
-
exports.toAiCfoAnswerStateType = toAiCfoAnswerStateType;
|
|
31
|
-
const toAiCfoAnswerResponseType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_AI_CFO_ANSWER_RESPONSE_TYPES);
|
|
32
|
-
exports.toAiCfoAnswerResponseType = toAiCfoAnswerResponseType;
|
|
33
|
-
const toAiCfoAnswerStateTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, exports.ALL_AI_CFO_ANSWER_STATE_TYPES);
|
|
34
|
-
exports.toAiCfoAnswerStateTypeStrict = toAiCfoAnswerStateTypeStrict;
|
|
35
|
-
const toAiCfoAnswerResponseTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, exports.ALL_AI_CFO_ANSWER_RESPONSE_TYPES);
|
|
36
|
-
exports.toAiCfoAnswerResponseTypeStrict = toAiCfoAnswerResponseTypeStrict;
|
|
37
|
-
const ALL_MESSAGE_SENDERS = ['user', 'agent'];
|
|
38
|
-
const ALL_MESSAGE_TYPES = ['plain_text', 'json'];
|
|
39
|
-
const toMessageSender = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_MESSAGE_SENDERS);
|
|
40
|
-
exports.toMessageSender = toMessageSender;
|
|
41
|
-
const toMessageType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_MESSAGE_TYPES);
|
|
42
|
-
exports.toMessageType = toMessageType;
|
|
43
|
-
const toMessageSenderStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, ALL_MESSAGE_SENDERS);
|
|
44
|
-
exports.toMessageSenderStrict = toMessageSenderStrict;
|
|
45
|
-
const toMessageTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, ALL_MESSAGE_TYPES);
|
|
46
|
-
exports.toMessageTypeStrict = toMessageTypeStrict;
|
|
@@ -1,73 +0,0 @@
|
|
|
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;
|
|
File without changes
|
/package/lib/view/{aiCfoView/aiCfoViewPayload.js → aiControllerView/aiControllerViewPayload.js}
RENAMED
|
File without changes
|
|
File without changes
|