impact-chatbot 2.4.0 → 3.0.0
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/dist/components/ag-grid/AgGridComponent.d.ts +2 -0
- package/dist/components/ag-grid/columnFormatter.d.ts +10 -0
- package/dist/components/ag-grid/constants.d.ts +3 -0
- package/dist/components/ag-grid/formatters.d.ts +11 -0
- package/dist/components/ag-grid/index.d.ts +3 -0
- package/dist/components/core-chart/CoreChart.d.ts +22 -0
- package/dist/components/core-chart/index.d.ts +2 -0
- package/dist/components/date-range-picker/DateRangePickerComponent.d.ts +4 -0
- package/dist/components/date-range-picker/index.d.ts +2 -0
- package/dist/constants.d.ts +1 -0
- package/dist/hooks/useBotConfiguration.d.ts +1 -1
- package/dist/index.cjs.css +93 -0
- package/dist/index.cjs.js +2187 -1789
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.css +93 -0
- package/dist/index.esm.js +2050 -1669
- package/dist/index.esm.js.map +1 -1
- package/dist/provider/ChatbotProvider.d.ts +32 -0
- package/dist/provider/types.d.ts +49 -0
- package/dist/services/apiConstants.d.ts +14 -0
- package/dist/services/chatbot-services.d.ts +42 -9
- package/dist/services/http.d.ts +53 -0
- package/dist/store/actions.d.ts +13 -0
- package/dist/store/index.d.ts +3 -0
- package/dist/store/reducer.d.ts +205 -0
- package/dist/store/types.d.ts +18 -0
- package/dist/utils/coreUtils.d.ts +16 -9
- package/package.json +33 -5
- package/dist/components/allocation-detail-panel/AllocationDetailPanel.d.ts +0 -2
- package/dist/components/allocation-detail-panel/AllocationPlanCard.d.ts +0 -4
- package/dist/components/allocation-detail-panel/components/PanelHeader.d.ts +0 -8
- package/dist/components/allocation-detail-panel/components/PanelSection.d.ts +0 -4
- package/dist/components/allocation-detail-panel/components/ReportSummaryCard.d.ts +0 -4
- package/dist/components/allocation-detail-panel/components/StructuredComparison.d.ts +0 -4
- package/dist/components/allocation-detail-panel/styles.d.ts +0 -1
- package/dist/components/chatbot-input/index_new.d.ts +0 -3
- package/dist/components/chatbot-input/index_old_backup.d.ts +0 -3
- package/dist/components/chatbot-save-filter-component/ChatbotSaveFilterComponent.d.ts +0 -2
- package/dist/components/message-template/components/message-content/SurfaceFrameContent.d.ts +0 -37
- package/dist/components/message-template/components/message-content/surfaceWidgets.d.ts +0 -22
- package/dist/core/commonComponents/custom-group-accordion/index.d.ts +0 -5
- package/dist/core/constants/index.d.ts +0 -5
- package/dist/core/utils/functions.d.ts +0 -8
- package/dist/core/utils/replaceSpecialCharacter.d.ts +0 -1
- /package/dist/{core/styles → styles}/colours.d.ts +0 -0
- /package/dist/{core/styles → styles}/globalStyles.d.ts +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ChatbotDependencies } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Stable default selector references used as fallbacks when the consumer
|
|
5
|
+
* does not provide selectors via the provider. Module-level constants
|
|
6
|
+
* avoid creating new function references on every render (which would
|
|
7
|
+
* cause useSelector to re-subscribe and potentially loop).
|
|
8
|
+
*/
|
|
9
|
+
export declare const NULL_SELECTOR: () => null;
|
|
10
|
+
export declare const EMPTY_ARRAY_SELECTOR: () => any[];
|
|
11
|
+
/**
|
|
12
|
+
* Wrap <SmartBot> with this provider to inject host-level dependencies
|
|
13
|
+
* (HTTP client, API constants, actions, selectors, heavy components).
|
|
14
|
+
*
|
|
15
|
+
* On mount (and whenever the value changes) the provider also initializes
|
|
16
|
+
* the module-level HTTP client singleton so that service files can call
|
|
17
|
+
* `getHttpClient()` / `httpRequest()` without prop-drilling.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* <ChatbotProvider value={{ httpClient: axiosInstance, apiConstants: { BASE_API, COMBINED_CROSS_DIMENSIONAL_API } }}>
|
|
21
|
+
* <SmartBot userName={userName} />
|
|
22
|
+
* </ChatbotProvider>
|
|
23
|
+
*/
|
|
24
|
+
export declare const ChatbotProvider: React.FC<{
|
|
25
|
+
value: ChatbotDependencies;
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* Hook consumed by internal package components to access host dependencies.
|
|
30
|
+
* Throws if called outside a <ChatbotProvider>.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useChatbotDeps(): ChatbotDependencies;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChatbotDependencies — dependency injection interface for the impact-chatbot package.
|
|
3
|
+
*
|
|
4
|
+
* Consumers wrap <SmartBot> with <ChatbotProvider value={deps}> so the package
|
|
5
|
+
* can call host services without importing `core/` or `config/` paths directly.
|
|
6
|
+
*
|
|
7
|
+
* Only `httpClient` and `apiConstants` are required. Everything else is optional
|
|
8
|
+
* and the package degrades gracefully when omitted.
|
|
9
|
+
*/
|
|
10
|
+
/** Structural HTTP client type — any Axios-like instance satisfies this. */
|
|
11
|
+
export interface HttpClient {
|
|
12
|
+
get: (url: string, config?: any) => Promise<any>;
|
|
13
|
+
post: (url: string, data?: any, config?: any) => Promise<any>;
|
|
14
|
+
put: (url: string, data?: any, config?: any) => Promise<any>;
|
|
15
|
+
delete: (url: string, config?: any) => Promise<any>;
|
|
16
|
+
defaults?: {
|
|
17
|
+
baseURL?: string;
|
|
18
|
+
headers?: Record<string, any>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface ApiConstants {
|
|
22
|
+
COMBINED_CROSS_DIMENSIONAL_API: string;
|
|
23
|
+
BASE_API: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ChatbotCallbacks {
|
|
26
|
+
/** Show a snackbar/toast notification in the host app. */
|
|
27
|
+
onSnackbar?: (message: string, variant?: string) => void;
|
|
28
|
+
/** Apply selected filters in the host app's filter panel. */
|
|
29
|
+
onSetSelectedFilters?: (filters: any) => void;
|
|
30
|
+
/** Update filter dashboard configuration in the host app. */
|
|
31
|
+
onSetFilterConfiguration?: (config: any) => void;
|
|
32
|
+
}
|
|
33
|
+
export interface ChatbotSelectors {
|
|
34
|
+
getFilterState?: (state: any) => any;
|
|
35
|
+
getSavedFilterDashboard?: (state: any) => any;
|
|
36
|
+
getNotificationData?: (state: any) => any;
|
|
37
|
+
getDimensionHierarchies?: (state: any) => any;
|
|
38
|
+
}
|
|
39
|
+
export interface ChatbotComponents {
|
|
40
|
+
/** Consumer-provided filter component for saved filter management. */
|
|
41
|
+
FilterComponent?: React.ComponentType<any>;
|
|
42
|
+
}
|
|
43
|
+
export interface ChatbotDependencies {
|
|
44
|
+
httpClient: HttpClient;
|
|
45
|
+
apiConstants: ApiConstants;
|
|
46
|
+
callbacks?: ChatbotCallbacks;
|
|
47
|
+
selectors?: ChatbotSelectors;
|
|
48
|
+
components?: ChatbotComponents;
|
|
49
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API endpoint constants used by chatbot service functions.
|
|
3
|
+
*
|
|
4
|
+
* Previously scattered across `config/api`, `core/actions/tenantConfigActions`,
|
|
5
|
+
* and `core/actions/userAccessActions` in the host app. Now internalized so the
|
|
6
|
+
* package is fully self-contained.
|
|
7
|
+
*/
|
|
8
|
+
export declare const GET_TENANT_CONFIG = "core/tenant-config";
|
|
9
|
+
export declare const GET_APPLICATION_MASTER = "/core/applications";
|
|
10
|
+
export declare const GET_USERS_URL = "/core/user-mgmt/list";
|
|
11
|
+
export declare const GET_MODULE_LEVEL_ACCESS = "/master/user-management/module-hierarchy";
|
|
12
|
+
export declare const GET_USER_APP_ACCESS_HIERARCHY = "/master/user-management/app-role-hierarchy";
|
|
13
|
+
export declare const SAVE_FILTER_GET = "/core/filter/user-preference/screen";
|
|
14
|
+
export declare const GET_ALL_FILTER_URL = "/core/filter-configuration/screen";
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export declare const getCurrentUserId: () => Promise<any>;
|
|
2
|
+
export declare const fetchApplicationCodeFromConfig: () => Promise<{
|
|
3
|
+
applicationCode: any;
|
|
4
|
+
applicationCodesList: any;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const fetchBaseUrl: () => Promise<any>;
|
|
7
|
+
export declare const fetchLegacyAgentScreen: () => Promise<any>;
|
|
8
|
+
export declare const resolveChatQuery: (body: any, flowType: any) => Promise<any>;
|
|
9
|
+
export declare const fetchRelatedQuestions: (flowType: any, screen_name: any) => Promise<any>;
|
|
10
|
+
export declare const getSmartBotVisibilityData: () => Promise<any>;
|
|
11
|
+
export declare const getAgentVisibilityData: () => Promise<any>;
|
|
5
12
|
export declare const getHideNavbotData: (applicationCode: any) => Promise<any>;
|
|
6
13
|
export declare const getEnableMultiChatData: (applicationCode: any) => Promise<any>;
|
|
7
14
|
export declare const getMultiChatCfUrl: (applicationCode: any) => Promise<any>;
|
|
8
|
-
export declare const getAlanExceptionUserList: (applicationCode: any) => any
|
|
9
|
-
export declare const getAgentExceptionUserList: (applicationCode: any) => any
|
|
15
|
+
export declare const getAlanExceptionUserList: (applicationCode: any) => Promise<any>;
|
|
16
|
+
export declare const getAgentExceptionUserList: (applicationCode: any) => Promise<any>;
|
|
10
17
|
export declare const refreshAndUpdateUserManualApi: (body: any) => Promise<any>;
|
|
11
18
|
export declare const fetchScreensForModule: (flowType: any) => Promise<any>;
|
|
12
19
|
export declare const likeDislikeComment: (payload: any) => Promise<any>;
|
|
@@ -21,7 +28,33 @@ export declare const fetchChatbotFilterConfig: () => Promise<any>;
|
|
|
21
28
|
export declare const getFilterOptions: (postBody: any) => () => Promise<any>;
|
|
22
29
|
export declare const stopAgentFlow: (payload: any, baseUrl: any) => Promise<any>;
|
|
23
30
|
export declare const getTableRecords: (payload: any, baseUrl: any, tableName: any) => Promise<any>;
|
|
24
|
-
/** A read for a generated surface (frame protocol iui:query): the agent runs one read tool as the signed-in
|
|
25
|
-
* user and answers {rows, total}. */
|
|
26
|
-
export declare const postUiQuery: (payload: any, baseUrl: any) => Promise<any>;
|
|
27
31
|
export declare const getTableRecordsByUrl: (payload: any, url: any) => Promise<any>;
|
|
32
|
+
/**
|
|
33
|
+
* getModuleLevelAccessUtility — fetches both the access hierarchy and module
|
|
34
|
+
* permissions in parallel, then merges them into the legacy format.
|
|
35
|
+
* Mirrors core/actions/userAccessActions.getModuleLevelAccessUtility exactly.
|
|
36
|
+
*
|
|
37
|
+
* Unlike the original (which was a Redux thunk returning a function), this is
|
|
38
|
+
* a direct async function: `await getModuleLevelAccessUtility({...})`.
|
|
39
|
+
*/
|
|
40
|
+
export declare const getModuleLevelAccessUtility: ({ app, module: modules, }: {
|
|
41
|
+
app: string;
|
|
42
|
+
module: string[];
|
|
43
|
+
skipHierarchyCall?: boolean;
|
|
44
|
+
}) => Promise<Record<string, any>>;
|
|
45
|
+
/**
|
|
46
|
+
* getFilterUserConfiguration — fetches saved filter configurations for a screen.
|
|
47
|
+
* Mirrors core/actions/filterAction.getFilterUserConfiguration exactly.
|
|
48
|
+
*
|
|
49
|
+
* Unlike the original (which was a bare async function), the interface is the
|
|
50
|
+
* same: `const data = await getFilterUserConfiguration("Chatbot")`.
|
|
51
|
+
*/
|
|
52
|
+
export declare const getFilterUserConfiguration: (screenName: string) => Promise<any>;
|
|
53
|
+
/**
|
|
54
|
+
* getAllFilters — fetches all filter configurations for a screen.
|
|
55
|
+
* Mirrors core/actions/filterAction.getAllFilters exactly.
|
|
56
|
+
*
|
|
57
|
+
* Unlike the original (which was a Redux thunk `getAllFilters(screen)()`),
|
|
58
|
+
* this is a direct async function: `await getAllFilters(screen)`.
|
|
59
|
+
*/
|
|
60
|
+
export declare const getAllFilters: (screen: string) => Promise<any>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal HTTP client module for impact-chatbot.
|
|
3
|
+
*
|
|
4
|
+
* Instead of importing `axiosInstance` from `core/Utils/axios` (which ties the
|
|
5
|
+
* package to the host's core submodule), every service file in this package
|
|
6
|
+
* imports `getHttpClient()` from this module.
|
|
7
|
+
*
|
|
8
|
+
* The client is set once at startup via `initHttpClient()`, which is called
|
|
9
|
+
* from `ChatbotProvider` when the component tree mounts.
|
|
10
|
+
*
|
|
11
|
+
* Phase 3 of the segregation roadmap.
|
|
12
|
+
*/
|
|
13
|
+
import type { HttpClient, ApiConstants } from "../provider/types";
|
|
14
|
+
/**
|
|
15
|
+
* Called once when <ChatbotProvider> mounts.
|
|
16
|
+
* Stores the consumer-provided HTTP client and API constants so every
|
|
17
|
+
* internal service can access them without prop-drilling.
|
|
18
|
+
*/
|
|
19
|
+
export declare function initHttpClient(httpClient: HttpClient, apiConstants: ApiConstants): void;
|
|
20
|
+
/**
|
|
21
|
+
* Returns the HTTP client set by the consumer.
|
|
22
|
+
*
|
|
23
|
+
* All internal service files use this as a drop-in replacement for the old
|
|
24
|
+
* `import axiosInstance from "core/Utils/axios"`.
|
|
25
|
+
*
|
|
26
|
+
* The returned client is "callable" in the same way Axios instances are — it
|
|
27
|
+
* supports `.get()`, `.post()`, `.put()`, `.delete()` and can also be invoked
|
|
28
|
+
* directly as a function (Axios config object style). To support the latter
|
|
29
|
+
* pattern transparently we return a wrapper that delegates to the right method.
|
|
30
|
+
*/
|
|
31
|
+
export declare function getHttpClient(): HttpClient;
|
|
32
|
+
/**
|
|
33
|
+
* Callable wrapper that mimics `axiosInstance({ url, method, data, params, ... })`.
|
|
34
|
+
*
|
|
35
|
+
* The old code uses `axiosInstance(config)` everywhere (Axios request-config
|
|
36
|
+
* style). This function translates that call into the structural `HttpClient`
|
|
37
|
+
* interface (.get / .post / .put / .delete).
|
|
38
|
+
*/
|
|
39
|
+
export declare function httpRequest(config: {
|
|
40
|
+
url: string;
|
|
41
|
+
method?: string;
|
|
42
|
+
data?: any;
|
|
43
|
+
params?: any;
|
|
44
|
+
headers?: Record<string, any>;
|
|
45
|
+
signal?: AbortSignal;
|
|
46
|
+
responseType?: string;
|
|
47
|
+
onDownloadProgress?: (progressEvent: any) => void;
|
|
48
|
+
[key: string]: any;
|
|
49
|
+
}): Promise<any>;
|
|
50
|
+
/**
|
|
51
|
+
* Returns the API constants set by the consumer.
|
|
52
|
+
*/
|
|
53
|
+
export declare function getApiConstants(): ApiConstants;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const setSmartBotActive: (value: any) => (dispatch: any) => void;
|
|
2
|
+
export declare const setIsSmartBotRestricted: (value: any) => (dispatch: any) => void;
|
|
3
|
+
export declare const setChatbotContext: (value: any) => (dispatch: any) => void;
|
|
4
|
+
export declare const setThinkingContext: (value: any) => (dispatch: any) => void;
|
|
5
|
+
export declare const setHierarchyKeyValue: (value: any) => (dispatch: any) => void;
|
|
6
|
+
export declare const setCurrentAgentChatId: (value: any) => (dispatch: any) => void;
|
|
7
|
+
export declare const setPersistedFormValues: (value: any) => (dispatch: any) => void;
|
|
8
|
+
export declare const clearPersistedFormValues: () => (dispatch: any) => void;
|
|
9
|
+
export declare const setStepFormRestreamPayload: (value: any) => (dispatch: any) => void;
|
|
10
|
+
export declare const setSavedFilterSets: (value: any) => (dispatch: any) => void;
|
|
11
|
+
export declare const setStepFormStreamData: (value: any) => (dispatch: any) => void;
|
|
12
|
+
export declare const setMinimizedStreamData: (value: any) => (dispatch: any) => void;
|
|
13
|
+
export declare const setChatbotFilterOptions: (value: any) => (dispatch: any) => void;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
export declare const smartBotInitialState: {
|
|
2
|
+
smartBotActive: boolean;
|
|
3
|
+
isSmartBotRestricted: boolean;
|
|
4
|
+
chatbotContext: {};
|
|
5
|
+
thinkingContext: {
|
|
6
|
+
thinkingContent: string;
|
|
7
|
+
thinkingHeaderMessage: string;
|
|
8
|
+
streamStartTime: any;
|
|
9
|
+
isStreamCompleted: boolean;
|
|
10
|
+
finalElapsedSeconds: any;
|
|
11
|
+
};
|
|
12
|
+
heirarchyKeyValuePairs: {};
|
|
13
|
+
currentAgentChatId: string;
|
|
14
|
+
persistedFormValues: {};
|
|
15
|
+
savedFilterSets: any[];
|
|
16
|
+
stepFormRestreamPayload: any;
|
|
17
|
+
stepFormStreamData: any;
|
|
18
|
+
minimizedStreamData: any;
|
|
19
|
+
chatbotFilterOptions: any[];
|
|
20
|
+
};
|
|
21
|
+
export declare function smartBotReducer(state: {
|
|
22
|
+
smartBotActive: boolean;
|
|
23
|
+
isSmartBotRestricted: boolean;
|
|
24
|
+
chatbotContext: {};
|
|
25
|
+
thinkingContext: {
|
|
26
|
+
thinkingContent: string;
|
|
27
|
+
thinkingHeaderMessage: string;
|
|
28
|
+
streamStartTime: any;
|
|
29
|
+
isStreamCompleted: boolean;
|
|
30
|
+
finalElapsedSeconds: any;
|
|
31
|
+
};
|
|
32
|
+
heirarchyKeyValuePairs: {};
|
|
33
|
+
currentAgentChatId: string;
|
|
34
|
+
persistedFormValues: {};
|
|
35
|
+
savedFilterSets: any[];
|
|
36
|
+
stepFormRestreamPayload: any;
|
|
37
|
+
stepFormStreamData: any;
|
|
38
|
+
minimizedStreamData: any;
|
|
39
|
+
chatbotFilterOptions: any[];
|
|
40
|
+
}, action: any): {
|
|
41
|
+
smartBotActive: any;
|
|
42
|
+
isSmartBotRestricted: boolean;
|
|
43
|
+
chatbotContext: {};
|
|
44
|
+
thinkingContext: {
|
|
45
|
+
thinkingContent: string;
|
|
46
|
+
thinkingHeaderMessage: string;
|
|
47
|
+
streamStartTime: any;
|
|
48
|
+
isStreamCompleted: boolean;
|
|
49
|
+
finalElapsedSeconds: any;
|
|
50
|
+
};
|
|
51
|
+
heirarchyKeyValuePairs: {};
|
|
52
|
+
currentAgentChatId: string;
|
|
53
|
+
persistedFormValues: {};
|
|
54
|
+
savedFilterSets: any[];
|
|
55
|
+
stepFormRestreamPayload: any;
|
|
56
|
+
stepFormStreamData: any;
|
|
57
|
+
minimizedStreamData: any;
|
|
58
|
+
chatbotFilterOptions: any[];
|
|
59
|
+
} | {
|
|
60
|
+
isSmartBotRestricted: any;
|
|
61
|
+
smartBotActive: boolean;
|
|
62
|
+
chatbotContext: {};
|
|
63
|
+
thinkingContext: {
|
|
64
|
+
thinkingContent: string;
|
|
65
|
+
thinkingHeaderMessage: string;
|
|
66
|
+
streamStartTime: any;
|
|
67
|
+
isStreamCompleted: boolean;
|
|
68
|
+
finalElapsedSeconds: any;
|
|
69
|
+
};
|
|
70
|
+
heirarchyKeyValuePairs: {};
|
|
71
|
+
currentAgentChatId: string;
|
|
72
|
+
persistedFormValues: {};
|
|
73
|
+
savedFilterSets: any[];
|
|
74
|
+
stepFormRestreamPayload: any;
|
|
75
|
+
stepFormStreamData: any;
|
|
76
|
+
minimizedStreamData: any;
|
|
77
|
+
chatbotFilterOptions: any[];
|
|
78
|
+
} | {
|
|
79
|
+
chatbotContext: any;
|
|
80
|
+
smartBotActive: boolean;
|
|
81
|
+
isSmartBotRestricted: boolean;
|
|
82
|
+
thinkingContext: {
|
|
83
|
+
thinkingContent: string;
|
|
84
|
+
thinkingHeaderMessage: string;
|
|
85
|
+
streamStartTime: any;
|
|
86
|
+
isStreamCompleted: boolean;
|
|
87
|
+
finalElapsedSeconds: any;
|
|
88
|
+
};
|
|
89
|
+
heirarchyKeyValuePairs: {};
|
|
90
|
+
currentAgentChatId: string;
|
|
91
|
+
persistedFormValues: {};
|
|
92
|
+
savedFilterSets: any[];
|
|
93
|
+
stepFormRestreamPayload: any;
|
|
94
|
+
stepFormStreamData: any;
|
|
95
|
+
minimizedStreamData: any;
|
|
96
|
+
chatbotFilterOptions: any[];
|
|
97
|
+
} | {
|
|
98
|
+
thinkingContext: any;
|
|
99
|
+
smartBotActive: boolean;
|
|
100
|
+
isSmartBotRestricted: boolean;
|
|
101
|
+
chatbotContext: {};
|
|
102
|
+
heirarchyKeyValuePairs: {};
|
|
103
|
+
currentAgentChatId: string;
|
|
104
|
+
persistedFormValues: {};
|
|
105
|
+
savedFilterSets: any[];
|
|
106
|
+
stepFormRestreamPayload: any;
|
|
107
|
+
stepFormStreamData: any;
|
|
108
|
+
minimizedStreamData: any;
|
|
109
|
+
chatbotFilterOptions: any[];
|
|
110
|
+
} | {
|
|
111
|
+
heirarchyKeyValuePairs: any;
|
|
112
|
+
smartBotActive: boolean;
|
|
113
|
+
isSmartBotRestricted: boolean;
|
|
114
|
+
chatbotContext: {};
|
|
115
|
+
thinkingContext: {
|
|
116
|
+
thinkingContent: string;
|
|
117
|
+
thinkingHeaderMessage: string;
|
|
118
|
+
streamStartTime: any;
|
|
119
|
+
isStreamCompleted: boolean;
|
|
120
|
+
finalElapsedSeconds: any;
|
|
121
|
+
};
|
|
122
|
+
currentAgentChatId: string;
|
|
123
|
+
persistedFormValues: {};
|
|
124
|
+
savedFilterSets: any[];
|
|
125
|
+
stepFormRestreamPayload: any;
|
|
126
|
+
stepFormStreamData: any;
|
|
127
|
+
minimizedStreamData: any;
|
|
128
|
+
chatbotFilterOptions: any[];
|
|
129
|
+
} | {
|
|
130
|
+
currentAgentChatId: any;
|
|
131
|
+
smartBotActive: boolean;
|
|
132
|
+
isSmartBotRestricted: boolean;
|
|
133
|
+
chatbotContext: {};
|
|
134
|
+
thinkingContext: {
|
|
135
|
+
thinkingContent: string;
|
|
136
|
+
thinkingHeaderMessage: string;
|
|
137
|
+
streamStartTime: any;
|
|
138
|
+
isStreamCompleted: boolean;
|
|
139
|
+
finalElapsedSeconds: any;
|
|
140
|
+
};
|
|
141
|
+
heirarchyKeyValuePairs: {};
|
|
142
|
+
persistedFormValues: {};
|
|
143
|
+
savedFilterSets: any[];
|
|
144
|
+
stepFormRestreamPayload: any;
|
|
145
|
+
stepFormStreamData: any;
|
|
146
|
+
minimizedStreamData: any;
|
|
147
|
+
chatbotFilterOptions: any[];
|
|
148
|
+
} | {
|
|
149
|
+
persistedFormValues: any;
|
|
150
|
+
smartBotActive: boolean;
|
|
151
|
+
isSmartBotRestricted: boolean;
|
|
152
|
+
chatbotContext: {};
|
|
153
|
+
thinkingContext: {
|
|
154
|
+
thinkingContent: string;
|
|
155
|
+
thinkingHeaderMessage: string;
|
|
156
|
+
streamStartTime: any;
|
|
157
|
+
isStreamCompleted: boolean;
|
|
158
|
+
finalElapsedSeconds: any;
|
|
159
|
+
};
|
|
160
|
+
heirarchyKeyValuePairs: {};
|
|
161
|
+
currentAgentChatId: string;
|
|
162
|
+
savedFilterSets: any[];
|
|
163
|
+
stepFormRestreamPayload: any;
|
|
164
|
+
stepFormStreamData: any;
|
|
165
|
+
minimizedStreamData: any;
|
|
166
|
+
chatbotFilterOptions: any[];
|
|
167
|
+
} | {
|
|
168
|
+
savedFilterSets: any;
|
|
169
|
+
smartBotActive: boolean;
|
|
170
|
+
isSmartBotRestricted: boolean;
|
|
171
|
+
chatbotContext: {};
|
|
172
|
+
thinkingContext: {
|
|
173
|
+
thinkingContent: string;
|
|
174
|
+
thinkingHeaderMessage: string;
|
|
175
|
+
streamStartTime: any;
|
|
176
|
+
isStreamCompleted: boolean;
|
|
177
|
+
finalElapsedSeconds: any;
|
|
178
|
+
};
|
|
179
|
+
heirarchyKeyValuePairs: {};
|
|
180
|
+
currentAgentChatId: string;
|
|
181
|
+
persistedFormValues: {};
|
|
182
|
+
stepFormRestreamPayload: any;
|
|
183
|
+
stepFormStreamData: any;
|
|
184
|
+
minimizedStreamData: any;
|
|
185
|
+
chatbotFilterOptions: any[];
|
|
186
|
+
} | {
|
|
187
|
+
chatbotFilterOptions: any;
|
|
188
|
+
smartBotActive: boolean;
|
|
189
|
+
isSmartBotRestricted: boolean;
|
|
190
|
+
chatbotContext: {};
|
|
191
|
+
thinkingContext: {
|
|
192
|
+
thinkingContent: string;
|
|
193
|
+
thinkingHeaderMessage: string;
|
|
194
|
+
streamStartTime: any;
|
|
195
|
+
isStreamCompleted: boolean;
|
|
196
|
+
finalElapsedSeconds: any;
|
|
197
|
+
};
|
|
198
|
+
heirarchyKeyValuePairs: {};
|
|
199
|
+
currentAgentChatId: string;
|
|
200
|
+
persistedFormValues: {};
|
|
201
|
+
savedFilterSets: any[];
|
|
202
|
+
stepFormRestreamPayload: any;
|
|
203
|
+
stepFormStreamData: any;
|
|
204
|
+
minimizedStreamData: any;
|
|
205
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SmartBot Redux action type constants.
|
|
3
|
+
* These MUST match the consumer's core/actions/types.js values exactly
|
|
4
|
+
* so actions dispatched by the package are handled by the host reducer.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SET_SMART_BOT_ACTIVE = "SET_SMART_BOT_ACTIVE";
|
|
7
|
+
export declare const SET_IS_SMART_BOT_RESTRICTED = "SET_IS_SMART_BOT_RESTRICTED";
|
|
8
|
+
export declare const SET_CHATBOT_CONTEXT = "SET_CHATBOT_CONTEXT";
|
|
9
|
+
export declare const SET_THINKING_CONTEXT = "SET_THINKING_CONTEXT";
|
|
10
|
+
export declare const SET_HIERARCHY_KEY_VALUE_PAIR = "SET_HIERARCHY_KEY_VALUE_PAIR";
|
|
11
|
+
export declare const SET_CURRENT_AGENT_CHAT_ID = "SET_CURRENT_AGENT_CHAT_ID";
|
|
12
|
+
export declare const SET_PERSISTED_FORM_VALUES = "SET_PERSISTED_FORM_VALUES";
|
|
13
|
+
export declare const CLEAR_PERSISTED_FORM_VALUES = "CLEAR_PERSISTED_FORM_VALUES";
|
|
14
|
+
export declare const SET_SAVED_FILTER_SETS = "SET_SAVED_FILTER_SETS";
|
|
15
|
+
export declare const SET_STEP_FORM_RESTREAM_PAYLOAD = "SET_STEP_FORM_RESTREAM_PAYLOAD";
|
|
16
|
+
export declare const SET_STEP_FORM_STREAM_DATA = "SET_STEP_FORM_STREAM_DATA";
|
|
17
|
+
export declare const SET_MINIMIZED_STREAM_DATA = "SET_MINIMIZED_STREAM_DATA";
|
|
18
|
+
export declare const SET_CHATBOT_FILTER_OPTIONS = "SET_CHATBOT_FILTER_OPTIONS";
|
|
@@ -18,15 +18,22 @@ export declare const replaceSpecialCharacter: (str: any) => any;
|
|
|
18
18
|
*/
|
|
19
19
|
export declare const replaceSpecialCharToCharCode: (str: any) => any;
|
|
20
20
|
/**
|
|
21
|
-
* Fetch
|
|
22
|
-
*
|
|
21
|
+
* Fetch application code from URL path
|
|
22
|
+
* Matches core/Utils/functions/utils.fetchApplicationCode exactly
|
|
23
23
|
*/
|
|
24
|
-
export declare const
|
|
24
|
+
export declare const fetchApplicationCode: () => string;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
26
|
+
* Get user name from session storage
|
|
27
|
+
* Matches core/Utils/functions/utils.getUserName exactly
|
|
28
28
|
*/
|
|
29
|
-
export declare const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
export declare const getUserName: () => any;
|
|
30
|
+
/**
|
|
31
|
+
* Get formatted application name based on URL path segment
|
|
32
|
+
* Matches core/Utils/functions/utils.getFormattedApplicationName exactly
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Get application code from localStorage applicationCodesList by matching application name.
|
|
36
|
+
* Mirrors core/Utils/utils.getApplicationCodeFromURL exactly.
|
|
37
|
+
*/
|
|
38
|
+
export declare const getApplicationCodeFromURL: (applicationName: string) => string;
|
|
39
|
+
export declare const getFormattedApplicationName: (applicationURL: any) => "application access management" | "AssortSmart" | "module configurator" | "InventorySmart" | "ADA" | "PlanSmart" | "ADAConfigurator" | "ItemSmart" | "ItemSmart-New" | "SourceSmart" | "PriceSmart Markdown" | "PriceSmart Promo" | "SizeSmart" | "workflow input center";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "impact-chatbot",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Standalone chatbot
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Standalone chatbot widget — no core submodule required. Wrap with <ChatbotProvider> to inject dependencies.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -22,19 +22,47 @@
|
|
|
22
22
|
"build": "rollup -c rollup.config.mjs",
|
|
23
23
|
"build:types": "tsc --emitDeclarationOnly",
|
|
24
24
|
"clean": "rm -rf dist",
|
|
25
|
+
"dev": "rollup -c rollup.config.mjs --watch",
|
|
25
26
|
"prepublishOnly": "npm run clean && npm run build",
|
|
26
|
-
"typecheck": "tsc --noEmit"
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"verify": "bash scripts/verify-no-core-imports.sh"
|
|
27
29
|
},
|
|
28
30
|
"peerDependencies": {
|
|
29
31
|
"@mui/material": "^5.0.0",
|
|
30
32
|
"@mui/styles": "^5.0.0",
|
|
33
|
+
"ag-grid-community": "^36.0.0",
|
|
34
|
+
"ag-grid-enterprise": "^36.0.0",
|
|
35
|
+
"ag-grid-react": "^36.0.0",
|
|
31
36
|
"axios": "^1.0.0",
|
|
37
|
+
"classnames": "^2.0.0",
|
|
38
|
+
"dompurify": "^3.0.0",
|
|
39
|
+
"highcharts": "^11.0.0",
|
|
40
|
+
"highcharts-react-official": "^3.0.0",
|
|
41
|
+
"impact-ui-v3": "*",
|
|
32
42
|
"lodash": "^4.0.0",
|
|
43
|
+
"moment": "^2.29.0",
|
|
33
44
|
"react": "^17.0.0 || ^18.0.0",
|
|
45
|
+
"react-dates": "^21.0.0",
|
|
34
46
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
35
|
-
"react-
|
|
47
|
+
"react-markdown": "^9.0.0",
|
|
48
|
+
"react-redux": "^7.0.0 || ^8.0.0",
|
|
49
|
+
"react-router": "^5.0.0 || ^6.0.0",
|
|
50
|
+
"react-router-dom": "^5.0.0 || ^6.0.0",
|
|
51
|
+
"react-router-dom-v5-compat": "^6.0.0",
|
|
36
52
|
"redux": "^4.0.0",
|
|
37
|
-
"
|
|
53
|
+
"rehype-sanitize": "^6.0.0",
|
|
54
|
+
"remark-breaks": "^4.0.0",
|
|
55
|
+
"remark-gfm": "^4.0.0",
|
|
56
|
+
"styled-components": "^5.0.0 || ^6.0.0"
|
|
57
|
+
},
|
|
58
|
+
"peerDependenciesMeta": {
|
|
59
|
+
"ag-grid-community": { "optional": true },
|
|
60
|
+
"ag-grid-enterprise": { "optional": true },
|
|
61
|
+
"ag-grid-react": { "optional": true },
|
|
62
|
+
"highcharts": { "optional": true },
|
|
63
|
+
"highcharts-react-official": { "optional": true },
|
|
64
|
+
"react-dates": { "optional": true },
|
|
65
|
+
"classnames": { "optional": true }
|
|
38
66
|
},
|
|
39
67
|
"devDependencies": {
|
|
40
68
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const useAllocationPanelStyles: any;
|
package/dist/components/message-template/components/message-content/SurfaceFrameContent.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export { mergeSurfaceWidgets } from "./surfaceWidgets";
|
|
2
|
-
/** A follow-up's limits: longer ones are ignored. */
|
|
3
|
-
export declare const PROMPT_TEXT_MAX = 1000;
|
|
4
|
-
export declare const PROMPT_CONTEXT_MAX = 16000;
|
|
5
|
-
/** The window event the chat listens to for a follow-up asked from a surface. */
|
|
6
|
-
export declare const PROMPT_EVENT = "iris:prompt";
|
|
7
|
-
/** The source a surface names for this temp table, if it names it: the only tables its page may ask pages
|
|
8
|
-
* of, and the endpoint address the agent gave (the page's own copy of the source is not trusted for it). */
|
|
9
|
-
export declare const sourceOf: (surface: any, table: any) => any;
|
|
10
|
-
/** Whether the surface binds this tool: the only tools its page may ask to read again. */
|
|
11
|
-
export declare const bindsTool: (surface: any, tool: any) => boolean;
|
|
12
|
-
/** One page of a source, from the agent's paging endpoint (its pages hold at most 10 rows): at the address
|
|
13
|
-
* the agent gave, as TableContent does with temp_table_url, else under the stream's base URL. `search`: a
|
|
14
|
-
* filter Control over the kept rows (catalog 0.3), each `{field, value}` an exact match the endpoint applies. */
|
|
15
|
-
export declare const pageOf: ({ source, page, pageSize, sort, search }: any) => Promise<{
|
|
16
|
-
rows: any[];
|
|
17
|
-
total: number;
|
|
18
|
-
}>;
|
|
19
|
-
/** A read tool the surface binds, run again by the agent with these arguments. */
|
|
20
|
-
export declare const readOf: ({ surface, tool, args }: any) => Promise<{
|
|
21
|
-
rows: any[];
|
|
22
|
-
total: number;
|
|
23
|
-
}>;
|
|
24
|
-
/** The page's origin, for http(s) addresses only; anything else is refused. */
|
|
25
|
-
export declare const frameOrigin: (src: any) => string | null;
|
|
26
|
-
/** A follow-up within the limits, or null. */
|
|
27
|
-
export declare const promptOf: (data: any, surfaceId: string) => {
|
|
28
|
-
text: string;
|
|
29
|
-
uiContext: any;
|
|
30
|
-
} | null;
|
|
31
|
-
interface SurfaceFrameContentProps {
|
|
32
|
-
frame: any;
|
|
33
|
-
isFormDisabled?: boolean;
|
|
34
|
-
messageIndex?: number;
|
|
35
|
-
}
|
|
36
|
-
declare const SurfaceFrameContent: ({ frame, isFormDisabled, messageIndex }: SurfaceFrameContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
export default SurfaceFrameContent;
|