@cimulate/copilot-widget 0.7.0 → 0.9.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.
|
@@ -1,11 +1,34 @@
|
|
|
1
1
|
import { ConnectAck } from '@cimulate/copilot-sdk';
|
|
2
|
+
import { CopilotError } from '@cimulate/copilot-sdk';
|
|
3
|
+
import { CopilotEvent } from '@cimulate/copilot-sdk';
|
|
4
|
+
import { CopilotSearch } from '@cimulate/copilot-sdk';
|
|
5
|
+
import { CopilotSearchSuggestion } from '@cimulate/copilot-sdk';
|
|
2
6
|
import { DialogPosition } from './models';
|
|
7
|
+
import { DisplayProducts } from '@cimulate/copilot-sdk';
|
|
8
|
+
import { FacetedNavigationSuggestion } from '@cimulate/copilot-sdk';
|
|
3
9
|
import { FacetFilters } from './models';
|
|
10
|
+
import { FollowUp } from '@cimulate/copilot-sdk';
|
|
11
|
+
import { Inquiry } from '@cimulate/copilot-sdk';
|
|
4
12
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
13
|
+
import { PartialInquiry } from '@cimulate/copilot-sdk';
|
|
14
|
+
import { Progress } from '@cimulate/copilot-sdk';
|
|
5
15
|
import { ReactNode } from 'react';
|
|
16
|
+
import { RefinedSearch } from '@cimulate/copilot-sdk';
|
|
17
|
+
import { SearchParams } from '@cimulate/copilot-sdk';
|
|
6
18
|
import { SearchPayload as SearchPayload_2 } from './models';
|
|
7
19
|
import { SocketSdkContextType } from './SocketSdkContext';
|
|
8
20
|
|
|
21
|
+
declare type AllCopilotEvents = {
|
|
22
|
+
isUserAction?: boolean;
|
|
23
|
+
isInitialSearch?: boolean;
|
|
24
|
+
message: string;
|
|
25
|
+
request?: CopilotSearch;
|
|
26
|
+
searchParams?: SearchParams;
|
|
27
|
+
suggestions?: Suggestion[];
|
|
28
|
+
toolName?: string;
|
|
29
|
+
thought?: string;
|
|
30
|
+
} & (CopilotEvent | Inquiry | DisplayProducts | FollowUp | PartialInquiry | RefinedSearch | Progress | CopilotError);
|
|
31
|
+
|
|
9
32
|
declare type CimCopilotSdkConfig = {
|
|
10
33
|
apiKey?: string;
|
|
11
34
|
apiToken?: string;
|
|
@@ -47,6 +70,8 @@ export declare interface CopilotWidgetProps extends CimCopilotSdkConfig {
|
|
|
47
70
|
headerText?: string;
|
|
48
71
|
theme?: ThemeConfig;
|
|
49
72
|
onConnect?: (event: ConnectAck) => void;
|
|
73
|
+
onCopilotEvent?: (event: AllCopilotEvents) => void;
|
|
74
|
+
onRefinedSearch?: (event: AllCopilotEvents) => void;
|
|
50
75
|
}
|
|
51
76
|
|
|
52
77
|
export declare const eventHandlers: {
|
|
@@ -89,15 +114,25 @@ declare type RangeFilters = Array<{
|
|
|
89
114
|
|
|
90
115
|
export declare interface SearchPayload {
|
|
91
116
|
userPrompt?: string;
|
|
92
|
-
searchParams: {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
rangeFilters?: RangeFilters;
|
|
96
|
-
catalogSegment?: string | null;
|
|
97
|
-
pricebooks?: string[] | null;
|
|
117
|
+
searchParams: Omit<SearchState, "page" | "pageSize" | "includeFacets"> & {
|
|
118
|
+
catalogSegment?: string;
|
|
119
|
+
pricebooks?: string[];
|
|
98
120
|
};
|
|
99
121
|
}
|
|
100
122
|
|
|
123
|
+
declare interface SearchState {
|
|
124
|
+
query: string;
|
|
125
|
+
page?: number | null;
|
|
126
|
+
pageSize?: number | null;
|
|
127
|
+
includeFacets?: boolean;
|
|
128
|
+
facetFilters?: FacetFilters_2;
|
|
129
|
+
rangeFilters?: RangeFilters;
|
|
130
|
+
catalogSegment?: string | null;
|
|
131
|
+
pricebooks?: string[] | null;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
declare type Suggestion = CopilotSearchSuggestion | FacetedNavigationSuggestion;
|
|
135
|
+
|
|
101
136
|
declare interface ThemeConfig {
|
|
102
137
|
primaryColor?: string;
|
|
103
138
|
secondaryColor?: string;
|
|
@@ -120,7 +155,7 @@ export declare const useCopilot: () => SocketSdkContextType;
|
|
|
120
155
|
* CopilotDispatch (redux dispatch) >
|
|
121
156
|
* SocketSdk (copilot-sdk)
|
|
122
157
|
*/
|
|
123
|
-
export declare const WidgetProvider: ({ apiKey, apiToken, baseUrl, logoUrl, headerText, theme, globalClassName, isDevelopment, onConnect, children, }: CopilotWidgetProps & {
|
|
158
|
+
export declare const WidgetProvider: ({ apiKey, apiToken, baseUrl, logoUrl, headerText, theme, globalClassName, isDevelopment, onConnect, onCopilotEvent, onRefinedSearch, children, }: CopilotWidgetProps & {
|
|
124
159
|
children: ReactNode;
|
|
125
160
|
}) => JSX_2.Element;
|
|
126
161
|
|