@zeniai/client-epic-state 4.17.16 → 4.17.18
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 -10
- package/lib/entity/aiController/aiControllerReducer.d.ts +46 -0
- package/lib/entity/{aiCfo/aiCfoReducer.js → aiController/aiControllerReducer.js} +45 -53
- 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/tenant/clearAllEpic.d.ts +4 -4
- package/lib/entity/tenant/clearAllEpic.js +4 -4
- package/lib/epic.d.ts +8 -10
- package/lib/epic.js +8 -10
- package/lib/index.d.ts +13 -15
- package/lib/index.js +74 -83
- 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/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +34 -49
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailPayload.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +0 -11
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailSelector.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailSelector.js +0 -1
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailState.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailState.js +1 -7
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +0 -19
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +1 -33
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +0 -13
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +2 -11
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +2 -18
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +0 -13
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -14
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +0 -14
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +2 -26
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +3 -17
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +4 -34
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.js +1 -0
- package/lib/view/transactionDetail/transactionDetailLocalDataHelper.js +36 -40
- 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 -107
- package/lib/entity/aiCfo/aiCfoState.js +0 -81
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +0 -73
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionStatisticsEpic.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionStatisticsEpic.js +0 -39
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchCreditAccountRepaymentEpic.d.ts +0 -7
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchCreditAccountRepaymentEpic.js +0 -23
- /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
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ID } from '../../../../commonStateTypes/common';
|
|
2
2
|
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
3
3
|
import { ChargeCardListState, ChargeCardListUIState } from './chargeCardList';
|
|
4
|
-
import { ChargeCardListPayload, CreditAccountPayload,
|
|
4
|
+
import { ChargeCardListPayload, CreditAccountPayload, DebitCardSummariesPayload } from './chargeCardListPayload';
|
|
5
5
|
export declare const initialState: ChargeCardListState;
|
|
6
6
|
export declare const fetchChargeCardListPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[doFetchCreditAccountsDebitSummaryAndCashback: boolean, isDebitCardEnabled: boolean, isCreditCardEnabled: boolean, cacheOverride?: any], {
|
|
7
7
|
doFetchCreditAccountsDebitSummaryAndCashback: boolean;
|
|
8
8
|
isDebitCardEnabled: boolean;
|
|
9
9
|
isCreditCardEnabled: boolean;
|
|
10
10
|
cacheOverride: any;
|
|
11
|
-
}, "chargeCardList/fetchChargeCardListPage", never, never>,
|
|
11
|
+
}, "chargeCardList/fetchChargeCardListPage", never, never>, fetchCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchCreditAccount">, updateCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreditAccountPayload[], "chargeCardList/updateCreditAccount">, updateCreditAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateCreditAccountFailure">, fetchDebitCardSummary: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchDebitCardSummary">, updateDebitCardSummary: import("@reduxjs/toolkit").ActionCreatorWithPayload<DebitCardSummariesPayload, "chargeCardList/updateDebitCardSummary">, updateDebitCardSummaryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateDebitCardSummaryFailure">, fetchChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchChargeCardList">, updateChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
12
12
|
chargeCardListPayload: ChargeCardListPayload;
|
|
13
13
|
keepExistingListItems?: boolean;
|
|
14
14
|
}, "chargeCardList/updateChargeCardList">, updateChargeCardListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateChargeCardListFailure">, updateSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCardList/updateSearchText">, updateChargeCardListUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.revokeCardInviteFailure = exports.revokeCardInviteSuccess = exports.revokeCardInvite = exports.resendCardInviteFailure = exports.resendCardInviteSuccess = exports.resendCardInvite = exports.clearChargeCardList = exports.updateChargeCardListUIState = exports.updateSearchText = exports.updateChargeCardListFailure = exports.updateChargeCardList = exports.fetchChargeCardList = exports.updateDebitCardSummaryFailure = exports.updateDebitCardSummary = exports.fetchDebitCardSummary = exports.updateCreditAccountFailure = exports.updateCreditAccount = exports.fetchCreditAccount = exports.
|
|
4
|
+
exports.revokeCardInviteFailure = exports.revokeCardInviteSuccess = exports.revokeCardInvite = exports.resendCardInviteFailure = exports.resendCardInviteSuccess = exports.resendCardInvite = exports.clearChargeCardList = exports.updateChargeCardListUIState = exports.updateSearchText = exports.updateChargeCardListFailure = exports.updateChargeCardList = exports.fetchChargeCardList = exports.updateDebitCardSummaryFailure = exports.updateDebitCardSummary = exports.fetchDebitCardSummary = exports.updateCreditAccountFailure = exports.updateCreditAccount = exports.fetchCreditAccount = exports.fetchChargeCardListPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const amount_1 = require("../../../../commonStateTypes/amount");
|
|
7
7
|
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
@@ -23,7 +23,6 @@ exports.initialState = {
|
|
|
23
23
|
},
|
|
24
24
|
resendCardInvite: chargeCardList_1.initialResendRevokeCardInvite,
|
|
25
25
|
revokeCardInvite: chargeCardList_1.initialResendRevokeCardInvite,
|
|
26
|
-
creditAccountRepayment: chargeCardList_1.initialCreditAccountRepayment,
|
|
27
26
|
};
|
|
28
27
|
const chargeCardList = (0, toolkit_1.createSlice)({
|
|
29
28
|
name: 'chargeCardList',
|
|
@@ -44,16 +43,6 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
44
43
|
};
|
|
45
44
|
},
|
|
46
45
|
},
|
|
47
|
-
fetchCreditAccountRepayment(draft) {
|
|
48
|
-
draft.creditAccountRepayment.fetchState = 'In-Progress';
|
|
49
|
-
draft.creditAccountRepayment.error = undefined;
|
|
50
|
-
},
|
|
51
|
-
updateCreditAccountRepayment(draft, action) {
|
|
52
|
-
draft.creditAccountRepayment = toCreditAccountRepayment(action.payload);
|
|
53
|
-
},
|
|
54
|
-
updateCreditAccountRepaymentFailure(draft, action) {
|
|
55
|
-
draft.creditAccountRepayment = Object.assign(Object.assign({}, chargeCardList_1.initialCreditAccountRepayment), { fetchState: 'Error', error: action.payload });
|
|
56
|
-
},
|
|
57
46
|
fetchCreditAccount(draft) {
|
|
58
47
|
draft.creditAccount.fetchState = 'In-Progress';
|
|
59
48
|
draft.creditAccount.error = undefined;
|
|
@@ -156,7 +145,7 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
156
145
|
},
|
|
157
146
|
},
|
|
158
147
|
});
|
|
159
|
-
_a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.
|
|
148
|
+
_a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccount = _a.fetchCreditAccount, exports.updateCreditAccount = _a.updateCreditAccount, exports.updateCreditAccountFailure = _a.updateCreditAccountFailure, exports.fetchDebitCardSummary = _a.fetchDebitCardSummary, exports.updateDebitCardSummary = _a.updateDebitCardSummary, exports.updateDebitCardSummaryFailure = _a.updateDebitCardSummaryFailure, exports.fetchChargeCardList = _a.fetchChargeCardList, exports.updateChargeCardList = _a.updateChargeCardList, exports.updateChargeCardListFailure = _a.updateChargeCardListFailure, exports.updateSearchText = _a.updateSearchText, exports.updateChargeCardListUIState = _a.updateChargeCardListUIState, exports.clearChargeCardList = _a.clearChargeCardList, exports.resendCardInvite = _a.resendCardInvite, exports.resendCardInviteSuccess = _a.resendCardInviteSuccess, exports.resendCardInviteFailure = _a.resendCardInviteFailure, exports.revokeCardInvite = _a.revokeCardInvite, exports.revokeCardInviteSuccess = _a.revokeCardInviteSuccess, exports.revokeCardInviteFailure = _a.revokeCardInviteFailure;
|
|
160
149
|
exports.default = chargeCardList.reducer;
|
|
161
150
|
// helper
|
|
162
151
|
const toCreditAccount = (payload) => ({
|
|
@@ -181,16 +170,3 @@ const toDebitCardSummaries = (payload) => ({
|
|
|
181
170
|
fetchState: 'Completed',
|
|
182
171
|
error: undefined,
|
|
183
172
|
});
|
|
184
|
-
const toCreditAccountRepayment = (payload) => ({
|
|
185
|
-
creditAccountId: payload.credit_account_id,
|
|
186
|
-
currentBalance: (0, amount_1.toAmount)(payload.current_balance, payload.currency_code, payload.currency_symbol),
|
|
187
|
-
initiatedRepayments: (0, amount_1.toAmount)(payload.initiated_repayments, payload.currency_code, payload.currency_symbol),
|
|
188
|
-
nextRepaymentDueDate: (0, zeniDayJS_1.date)(payload.next_repayment_due_date),
|
|
189
|
-
providerCreditAccountId: payload.provider_credit_account_id,
|
|
190
|
-
remainingAmountDue: (0, amount_1.toAmount)(payload.remaining_amount_due, payload.currency_code, payload.currency_symbol),
|
|
191
|
-
remainingAmountOverdue: (0, amount_1.toAmount)(payload.remaining_amount_overdue, payload.currency_code, payload.currency_symbol),
|
|
192
|
-
statementPeriodEnd: (0, zeniDayJS_1.date)(payload.statement_period_end),
|
|
193
|
-
statementPeriodStart: (0, zeniDayJS_1.date)(payload.statement_period_start),
|
|
194
|
-
fetchState: 'Completed',
|
|
195
|
-
error: undefined,
|
|
196
|
-
});
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { Amount } from '../../../../commonStateTypes/amount';
|
|
2
|
-
import { FetchStateAndError
|
|
2
|
+
import { FetchStateAndError } from '../../../../commonStateTypes/common';
|
|
3
3
|
import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
4
|
import { Address } from '../../../../entity/address/addressState';
|
|
5
5
|
import { ChargeCard } from '../../../../entity/chargeCard/chargeCard';
|
|
6
6
|
import { Class, ClassBase } from '../../../../entity/class/classState';
|
|
7
|
-
import { DepositAccountWithLimit } from '../../../../entity/depositAccount/depositAccount';
|
|
8
7
|
import { User } from '../../../../entity/user/userState';
|
|
9
8
|
import { UserRole } from '../../../../entity/userRole/userRoleState';
|
|
10
9
|
import { RootState } from '../../../../reducer';
|
|
11
10
|
import { Person } from '../../../people/peopleSelectorTypes';
|
|
12
11
|
import { ChargeCardConfigState } from '../chargeCardConfig/chargeCardConfigState';
|
|
13
|
-
import { ChargeCardListUIState, CreditAccount,
|
|
12
|
+
import { ChargeCardListUIState, CreditAccount, DebitCardSummaries, ResendRevokeCardInvite } from './chargeCardList';
|
|
14
13
|
export interface ChargeCardWithUser extends ChargeCard {
|
|
15
14
|
cardCreatedByUser: User;
|
|
16
15
|
cardHolderUser: User;
|
|
@@ -26,7 +25,6 @@ export interface ChargeCardListSelectorView extends SelectorView {
|
|
|
26
25
|
totalCashback: Amount;
|
|
27
26
|
cards: ChargeCardWithUser[];
|
|
28
27
|
creditAccount: CreditAccount;
|
|
29
|
-
creditAccountRepayment: CreditAccountRepayment;
|
|
30
28
|
chargeCardConfig: ChargeCardConfigState;
|
|
31
29
|
userList: Person[];
|
|
32
30
|
allAccountingClasses: Class[];
|
|
@@ -54,16 +52,4 @@ export declare const getMyRequestOnHoldChargeCardListWithShippingAddress: (state
|
|
|
54
52
|
* helpers
|
|
55
53
|
*/
|
|
56
54
|
export declare const anyCardOnHold: (cards: ChargeCardWithUser[]) => boolean;
|
|
57
|
-
export declare const
|
|
58
|
-
creditAccount: CreditAccount;
|
|
59
|
-
creditAccountRepayment: CreditAccountRepayment;
|
|
60
|
-
};
|
|
61
|
-
export interface DepositAccountListWithDebitCardIssued extends FetchStateAndError {
|
|
62
|
-
depositAccounts: DepositAccountWithLimit[];
|
|
63
|
-
}
|
|
64
|
-
export declare const getDepositAccountListWithDebitCardIssued: (state: RootState, depositAccountIds: ID[]) => DepositAccountListWithDebitCardIssued;
|
|
65
|
-
export interface DebitCardListSelectorView extends FetchStateAndError {
|
|
66
|
-
cards: ChargeCard[];
|
|
67
|
-
}
|
|
68
|
-
export declare const getDebitCardList: (state: RootState) => DebitCardListSelectorView;
|
|
69
|
-
export declare const getDebitCardSummary: (state: RootState) => DebitCardSummaries;
|
|
55
|
+
export declare const getCreditAccount: (state: RootState) => CreditAccount;
|
|
@@ -3,14 +3,13 @@ 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.
|
|
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");
|
|
10
10
|
const addressSelector_1 = require("../../../../entity/address/addressSelector");
|
|
11
11
|
const chargeCardSelector_1 = require("../../../../entity/chargeCard/chargeCardSelector");
|
|
12
12
|
const classSelector_1 = require("../../../../entity/class/classSelector");
|
|
13
|
-
const depositAccountSelector_1 = require("../../../../entity/depositAccount/depositAccountSelector");
|
|
14
13
|
const userSelector_1 = require("../../../../entity/user/userSelector");
|
|
15
14
|
const userRoleSelector_1 = require("../../../../entity/userRole/userRoleSelector");
|
|
16
15
|
const userListViewSelector_1 = require("../../../userListView/userListViewSelector");
|
|
@@ -71,7 +70,6 @@ const getChargeCardListView = (state, includeCreditAccountDebitSummaryAndCashbac
|
|
|
71
70
|
cards: cardsInOrder,
|
|
72
71
|
unAssignedCredits: chargeCardListState.unAssignedCredits,
|
|
73
72
|
creditAccount: chargeCardListState.creditAccount,
|
|
74
|
-
creditAccountRepayment: chargeCardListState.creditAccountRepayment,
|
|
75
73
|
chargeCardConfig: chargeCardConfigState,
|
|
76
74
|
userList,
|
|
77
75
|
allAccountingClasses,
|
|
@@ -142,39 +140,11 @@ const anyCardOnHold = (cards) => {
|
|
|
142
140
|
}, true);
|
|
143
141
|
};
|
|
144
142
|
exports.anyCardOnHold = anyCardOnHold;
|
|
145
|
-
const
|
|
143
|
+
const getCreditAccount = (state) => {
|
|
146
144
|
const { chargeCardListState } = state;
|
|
147
|
-
return
|
|
148
|
-
creditAccount: chargeCardListState.creditAccount,
|
|
149
|
-
creditAccountRepayment: chargeCardListState.creditAccountRepayment,
|
|
150
|
-
};
|
|
151
|
-
};
|
|
152
|
-
exports.getCreditAccountDetails = getCreditAccountDetails;
|
|
153
|
-
const getDepositAccountListWithDebitCardIssued = (state, depositAccountIds) => {
|
|
154
|
-
const { issueChargeCardState, depositAccountState } = state;
|
|
155
|
-
return {
|
|
156
|
-
fetchState: issueChargeCardState.depositAccountsFetchState.fetchState,
|
|
157
|
-
error: issueChargeCardState.depositAccountsFetchState.error,
|
|
158
|
-
depositAccounts: (0, depositAccountSelector_1.getDepositAccountLimitsForChargeCardByDepositAccountIds)(depositAccountState, depositAccountIds),
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
exports.getDepositAccountListWithDebitCardIssued = getDepositAccountListWithDebitCardIssued;
|
|
162
|
-
const getDebitCardList = (state) => {
|
|
163
|
-
const { chargeCardListState, chargeCardState } = state;
|
|
164
|
-
const cards = (0, chargeCardSelector_1.getChargeCardsByIds)(chargeCardState, chargeCardListState.cardIds);
|
|
165
|
-
const debitCards = cards.filter((card) => card.type.code.includes('debit'));
|
|
166
|
-
return {
|
|
167
|
-
fetchState: chargeCardListState.fetchState,
|
|
168
|
-
error: chargeCardListState.error,
|
|
169
|
-
cards: debitCards,
|
|
170
|
-
};
|
|
171
|
-
};
|
|
172
|
-
exports.getDebitCardList = getDebitCardList;
|
|
173
|
-
const getDebitCardSummary = (state) => {
|
|
174
|
-
const { chargeCardListState } = state;
|
|
175
|
-
return chargeCardListState.debitCardSummaries;
|
|
145
|
+
return chargeCardListState.creditAccount;
|
|
176
146
|
};
|
|
177
|
-
exports.
|
|
147
|
+
exports.getCreditAccount = getCreditAccount;
|
|
178
148
|
const getChargeCardsWithUser = (cards, { userState, userRoleState, classState, addressState }) => {
|
|
179
149
|
const chargeCardsWithUser = [];
|
|
180
150
|
cards.forEach((chargeCard) => {
|
|
@@ -14,6 +14,7 @@ const getTransferDetail = (state) => {
|
|
|
14
14
|
const transferMoneyPartiesFetchState = (0, reduceFetchState_1.reduceAllFetchState)([
|
|
15
15
|
depositAccountsView,
|
|
16
16
|
paymentAccountsView,
|
|
17
|
+
...Object.values(paymentAccountListState.paymentAccountBalanceFetchStatus),
|
|
17
18
|
]).fetchState;
|
|
18
19
|
if (depositAccountsView.fetchState === 'Completed' &&
|
|
19
20
|
paymentAccountsView.fetchState === 'Completed') {
|
|
@@ -6,7 +6,7 @@ const customerTransaction_1 = require("../../entity/transaction/stateTypes/custo
|
|
|
6
6
|
const vendorTransaction_1 = require("../../entity/transaction/stateTypes/vendorTransaction");
|
|
7
7
|
const transactionDetailState_1 = require("./transactionDetailState");
|
|
8
8
|
const toTransactionDetailLocalData = (transaction, vendorId, uncategorizedIncomeExpense) => {
|
|
9
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
9
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
10
10
|
const transactionLocal = Object.assign({}, transactionDetailState_1.initialSupportedTransactionDetail.transactionDetailLocalData);
|
|
11
11
|
const customerId = (_a = transaction.customer) === null || _a === void 0 ? void 0 : _a.id;
|
|
12
12
|
transactionLocal.memo = transaction.memo;
|
|
@@ -19,7 +19,7 @@ const toTransactionDetailLocalData = (transaction, vendorId, uncategorizedIncome
|
|
|
19
19
|
}
|
|
20
20
|
: undefined;
|
|
21
21
|
transactionLocal.customerUpdates =
|
|
22
|
-
(0, vendorTransaction_1.isVendorTransactionWithCustomer)(transaction) &&
|
|
22
|
+
(0, vendorTransaction_1.isVendorTransactionWithCustomer)(transaction) && customerId != null
|
|
23
23
|
? {
|
|
24
24
|
id: customerId,
|
|
25
25
|
name: (_f = (_e = transaction.customer) === null || _e === void 0 ? void 0 : _e.name) !== null && _f !== void 0 ? _f : '',
|
|
@@ -29,58 +29,54 @@ const toTransactionDetailLocalData = (transaction, vendorId, uncategorizedIncome
|
|
|
29
29
|
const vendorName = (_k = (_j = transaction.vendor) === null || _j === void 0 ? void 0 : _j.name) !== null && _k !== void 0 ? _k : '';
|
|
30
30
|
const customerName = (_m = (_l = transaction.customer) === null || _l === void 0 ? void 0 : _l.name) !== null && _m !== void 0 ? _m : '';
|
|
31
31
|
if ((0, vendorTransaction_1.isVendorTransactionWithCustomer)(transaction) === true &&
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
customerId != null &&
|
|
33
|
+
customerName != null &&
|
|
34
|
+
Boolean(customerName) === true) {
|
|
35
35
|
transactionLocal.selectedEntity = {
|
|
36
|
-
id:
|
|
36
|
+
id: customerId,
|
|
37
37
|
name: customerName,
|
|
38
38
|
type: (0, entity_1.toEntityType)('customer'),
|
|
39
|
-
qboId:
|
|
40
|
-
zeniId:
|
|
39
|
+
qboId: customerId,
|
|
40
|
+
zeniId: customerId,
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
else if ((0, vendorTransaction_1.isVendorTransaction)(transaction) === true &&
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
vendorId != null &&
|
|
45
|
+
vendorName &&
|
|
46
|
+
Boolean(vendorName) === true) {
|
|
47
47
|
transactionLocal.selectedEntity = {
|
|
48
|
-
id:
|
|
48
|
+
id: vendorId,
|
|
49
49
|
name: vendorName,
|
|
50
50
|
type: (0, entity_1.toEntityType)('vendor'),
|
|
51
|
-
qboId: id,
|
|
52
|
-
zeniId: id,
|
|
51
|
+
qboId: (_p = (_o = transaction.vendor) === null || _o === void 0 ? void 0 : _o.id) !== null && _p !== void 0 ? _p : '',
|
|
52
|
+
zeniId: (_r = (_q = transaction.vendor) === null || _q === void 0 ? void 0 : _q.id) !== null && _r !== void 0 ? _r : '',
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
56
|
transactionLocal.selectedEntity = undefined;
|
|
57
57
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
transactionLocal.customerDetails = undefined;
|
|
83
|
-
}
|
|
58
|
+
transactionLocal.vendorDetails =
|
|
59
|
+
(0, vendorTransaction_1.isVendorTransaction)(transaction) &&
|
|
60
|
+
vendorId != null &&
|
|
61
|
+
vendorName != null &&
|
|
62
|
+
Boolean(vendorName) === true
|
|
63
|
+
? {
|
|
64
|
+
id: vendorId,
|
|
65
|
+
qboId: vendorId,
|
|
66
|
+
name: vendorName,
|
|
67
|
+
}
|
|
68
|
+
: undefined;
|
|
69
|
+
transactionLocal.customerDetails =
|
|
70
|
+
(0, vendorTransaction_1.isVendorTransactionWithCustomer)(transaction) &&
|
|
71
|
+
customerId != null &&
|
|
72
|
+
customerName != null &&
|
|
73
|
+
Boolean(customerName) === true
|
|
74
|
+
? {
|
|
75
|
+
id: customerId,
|
|
76
|
+
qboId: customerId,
|
|
77
|
+
name: customerName,
|
|
78
|
+
}
|
|
79
|
+
: undefined;
|
|
84
80
|
transactionLocal.lineItemById =
|
|
85
81
|
transaction.lines != null && transaction.lines.length > 0
|
|
86
82
|
? buildLineItemById(transaction, uncategorizedIncomeExpense, transaction.recommendations)
|
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.18",
|
|
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,107 +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 ALL_Y_FORMAT_TYPES: readonly ["currency", "number"];
|
|
22
|
-
export declare const ALL_Y_FORMAT_NON_CURRENCY_UNITS: readonly ["percentage", "unit", "ratio"];
|
|
23
|
-
export declare const ALL_Y_FORMAT_SCALES: readonly ["raw", "K", "M", "B", "T"];
|
|
24
|
-
export declare const toYFormatType: (v: string) => "number" | "currency";
|
|
25
|
-
export declare const toYFormatUnit: (v: string) => string;
|
|
26
|
-
export declare const toYFormatScale: (v: string) => "M" | "raw" | "K" | "B" | "T";
|
|
27
|
-
export declare const toYFormatTypeStrict: (v: string) => "number" | "currency" | undefined;
|
|
28
|
-
export declare const toYFormatUnitStrict: (v: string) => string;
|
|
29
|
-
export declare const toYFormatScaleStrict: (v: string) => "M" | "raw" | "K" | "B" | "T" | undefined;
|
|
30
|
-
export type YFormatType = ReturnType<typeof toYFormatType>;
|
|
31
|
-
export type YFormatUnit = ReturnType<typeof toYFormatUnit>;
|
|
32
|
-
export type YFormatScale = ReturnType<typeof toYFormatScale>;
|
|
33
|
-
export interface YFormat {
|
|
34
|
-
type: YFormatType;
|
|
35
|
-
unit: YFormatUnit;
|
|
36
|
-
scale: YFormatScale;
|
|
37
|
-
symbol?: string;
|
|
38
|
-
}
|
|
39
|
-
export declare const toAiCfoAnswerStateType: (v: string) => "complete" | "partial";
|
|
40
|
-
export declare const toAiCfoAnswerResponseType: (v: string) => "analysis" | "answer" | "reasoning" | "thought";
|
|
41
|
-
export declare const toAiCfoAnswerStateTypeStrict: (v: string) => "complete" | "partial" | undefined;
|
|
42
|
-
export declare const toAiCfoAnswerResponseTypeStrict: (v: string) => "analysis" | "answer" | "reasoning" | "thought" | undefined;
|
|
43
|
-
export type AiCfoAnswerStateType = ReturnType<typeof toAiCfoAnswerStateType>;
|
|
44
|
-
export type AiCfoAnswerResponseType = ReturnType<typeof toAiCfoAnswerResponseType>;
|
|
45
|
-
export interface TableVisualization {
|
|
46
|
-
rows: string[][];
|
|
47
|
-
columns: string[];
|
|
48
|
-
}
|
|
49
|
-
export interface ChartVisualization {
|
|
50
|
-
values: Array<Record<string, string | number>>;
|
|
51
|
-
x: string;
|
|
52
|
-
y: string[];
|
|
53
|
-
yFormat?: YFormat;
|
|
54
|
-
lines?: string[];
|
|
55
|
-
}
|
|
56
|
-
export interface AiCfoVisualization {
|
|
57
|
-
type: AiCfoVisualizationType;
|
|
58
|
-
data: TableVisualization | ChartVisualization;
|
|
59
|
-
}
|
|
60
|
-
export declare const toMessageSender: (v: string) => "user" | "agent";
|
|
61
|
-
export declare const toMessageType: (v: string) => "plain_text" | "json";
|
|
62
|
-
export declare const toMessageSenderStrict: (v: string) => "user" | "agent" | undefined;
|
|
63
|
-
export declare const toMessageTypeStrict: (v: string) => "plain_text" | "json" | undefined;
|
|
64
|
-
export type MessageSender = ReturnType<typeof toMessageSender>;
|
|
65
|
-
export type MessageType = ReturnType<typeof toMessageType>;
|
|
66
|
-
export interface ResponseBlockBase {
|
|
67
|
-
messageId: ID;
|
|
68
|
-
state: AiCfoAnswerStateType;
|
|
69
|
-
createdAt: ZeniDate;
|
|
70
|
-
chatSessionId: ID;
|
|
71
|
-
userId: ID;
|
|
72
|
-
sender: MessageSender;
|
|
73
|
-
}
|
|
74
|
-
export interface AnswerContentBlockBase {
|
|
75
|
-
text: string;
|
|
76
|
-
followUpQuestions: string[];
|
|
77
|
-
assumptions: string;
|
|
78
|
-
insights: string;
|
|
79
|
-
summarizedTitle?: string;
|
|
80
|
-
visualization?: AiCfoVisualization;
|
|
81
|
-
}
|
|
82
|
-
export interface QuestionContentBlockBase extends ResponseBlockBase {
|
|
83
|
-
questionText: string;
|
|
84
|
-
}
|
|
85
|
-
export interface ResponseBlockType extends ResponseBlockBase {
|
|
86
|
-
content: AnswerContentBlockBase;
|
|
87
|
-
type: AiCfoAnswerResponseType;
|
|
88
|
-
}
|
|
89
|
-
export interface AiCfoQuestionWithAnswer {
|
|
90
|
-
questionAnswerId: ID;
|
|
91
|
-
question: QuestionContentBlockBase;
|
|
92
|
-
responses: Partial<Record<AiCfoAnswerResponseType, ResponseBlockType>>;
|
|
93
|
-
}
|
|
94
|
-
export interface ChatSession {
|
|
95
|
-
chatSessionId: ID;
|
|
96
|
-
userId: ID;
|
|
97
|
-
createdAt: ZeniDate;
|
|
98
|
-
chatSessionSummary?: string;
|
|
99
|
-
}
|
|
100
|
-
export interface ChatSessionWithMessages {
|
|
101
|
-
chatSession: ChatSession;
|
|
102
|
-
questionAnswers: AiCfoQuestionWithAnswer[];
|
|
103
|
-
}
|
|
104
|
-
export interface AiCfoState {
|
|
105
|
-
aiCfoByChatSessionId: Record<ID, ChatSessionWithMessages>;
|
|
106
|
-
partialQuestionAnswers: Record<ID, AiCfoQuestionWithAnswer | undefined>;
|
|
107
|
-
}
|
|
@@ -1,81 +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.toYFormatScaleStrict = exports.toYFormatUnitStrict = exports.toYFormatTypeStrict = exports.toYFormatScale = exports.toYFormatUnit = exports.toYFormatType = exports.ALL_Y_FORMAT_SCALES = exports.ALL_Y_FORMAT_NON_CURRENCY_UNITS = exports.ALL_Y_FORMAT_TYPES = 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
|
-
exports.ALL_Y_FORMAT_TYPES = ['currency', 'number'];
|
|
30
|
-
exports.ALL_Y_FORMAT_NON_CURRENCY_UNITS = [
|
|
31
|
-
'percentage',
|
|
32
|
-
'unit',
|
|
33
|
-
'ratio',
|
|
34
|
-
];
|
|
35
|
-
exports.ALL_Y_FORMAT_SCALES = ['raw', 'K', 'M', 'B', 'T'];
|
|
36
|
-
const toYFormatType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_Y_FORMAT_TYPES);
|
|
37
|
-
exports.toYFormatType = toYFormatType;
|
|
38
|
-
const toYFormatUnit = (v) => {
|
|
39
|
-
// Check if it's one of the non-currency units
|
|
40
|
-
const nonCurrencyUnit = (0, stringToUnion_1.stringToUnion)(v, exports.ALL_Y_FORMAT_NON_CURRENCY_UNITS);
|
|
41
|
-
if (nonCurrencyUnit) {
|
|
42
|
-
return nonCurrencyUnit;
|
|
43
|
-
}
|
|
44
|
-
// If not a non-currency unit, assume it's a currency code and return it.
|
|
45
|
-
return v;
|
|
46
|
-
};
|
|
47
|
-
exports.toYFormatUnit = toYFormatUnit;
|
|
48
|
-
const toYFormatScale = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_Y_FORMAT_SCALES);
|
|
49
|
-
exports.toYFormatScale = toYFormatScale;
|
|
50
|
-
const toYFormatTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, exports.ALL_Y_FORMAT_TYPES);
|
|
51
|
-
exports.toYFormatTypeStrict = toYFormatTypeStrict;
|
|
52
|
-
const toYFormatUnitStrict = (v) => {
|
|
53
|
-
// Check if it's one of the non-currency units
|
|
54
|
-
const nonCurrencyUnit = (0, stringToUnion_1.stringToUnionStrict)(v, exports.ALL_Y_FORMAT_NON_CURRENCY_UNITS);
|
|
55
|
-
if (nonCurrencyUnit) {
|
|
56
|
-
return nonCurrencyUnit;
|
|
57
|
-
}
|
|
58
|
-
// If not a non-currency unit, assume it's a currency code and return it.
|
|
59
|
-
return v;
|
|
60
|
-
};
|
|
61
|
-
exports.toYFormatUnitStrict = toYFormatUnitStrict;
|
|
62
|
-
const toYFormatScaleStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, exports.ALL_Y_FORMAT_SCALES);
|
|
63
|
-
exports.toYFormatScaleStrict = toYFormatScaleStrict;
|
|
64
|
-
const toAiCfoAnswerStateType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_AI_CFO_ANSWER_STATE_TYPES);
|
|
65
|
-
exports.toAiCfoAnswerStateType = toAiCfoAnswerStateType;
|
|
66
|
-
const toAiCfoAnswerResponseType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.ALL_AI_CFO_ANSWER_RESPONSE_TYPES);
|
|
67
|
-
exports.toAiCfoAnswerResponseType = toAiCfoAnswerResponseType;
|
|
68
|
-
const toAiCfoAnswerStateTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, exports.ALL_AI_CFO_ANSWER_STATE_TYPES);
|
|
69
|
-
exports.toAiCfoAnswerStateTypeStrict = toAiCfoAnswerStateTypeStrict;
|
|
70
|
-
const toAiCfoAnswerResponseTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, exports.ALL_AI_CFO_ANSWER_RESPONSE_TYPES);
|
|
71
|
-
exports.toAiCfoAnswerResponseTypeStrict = toAiCfoAnswerResponseTypeStrict;
|
|
72
|
-
const ALL_MESSAGE_SENDERS = ['user', 'agent'];
|
|
73
|
-
const ALL_MESSAGE_TYPES = ['plain_text', 'json'];
|
|
74
|
-
const toMessageSender = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_MESSAGE_SENDERS);
|
|
75
|
-
exports.toMessageSender = toMessageSender;
|
|
76
|
-
const toMessageType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_MESSAGE_TYPES);
|
|
77
|
-
exports.toMessageType = toMessageType;
|
|
78
|
-
const toMessageSenderStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, ALL_MESSAGE_SENDERS);
|
|
79
|
-
exports.toMessageSenderStrict = toMessageSenderStrict;
|
|
80
|
-
const toMessageTypeStrict = (v) => (0, stringToUnion_1.stringToUnionStrict)(v, ALL_MESSAGE_TYPES);
|
|
81
|
-
exports.toMessageTypeStrict = toMessageTypeStrict;
|