@cimulate/copilot-sdk 1.2.0 → 2.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/README.md +25 -17
- package/dist/bundle.cimulate.copilot-sdk.5e12bca4.cjs.js +2 -0
- package/dist/bundle.cimulate.copilot-sdk.5e12bca4.cjs.js.map +1 -0
- package/dist/bundle.cimulate.copilot-sdk.820437d6.esm.js +2 -0
- package/dist/bundle.cimulate.copilot-sdk.820437d6.esm.js.map +1 -0
- package/dist/bundle.cimulate.copilot-sdk.cc0f99da.umd.js +2 -0
- package/dist/bundle.cimulate.copilot-sdk.cc0f99da.umd.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types/copilot.d.ts +26 -29
- package/dist/types/generator.d.ts +7 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/model/Cancel.d.ts +1 -1
- package/dist/types/model/CancelAck.d.ts +10 -0
- package/dist/types/model/CommonFields.d.ts +3 -3
- package/dist/types/model/CommonMetadata.d.ts +2 -2
- package/dist/types/model/CommonRequiredFields.d.ts +2 -2
- package/dist/types/model/ConnectAck.d.ts +3 -3
- package/dist/types/model/CopilotAPIEvent.d.ts +11 -0
- package/dist/types/model/CopilotEvent.d.ts +10 -11
- package/dist/types/model/CopilotSearch.d.ts +2 -2
- package/dist/types/model/CopilotSearchAck.d.ts +10 -0
- package/dist/types/model/CopilotSearchSuggestion.d.ts +1 -1
- package/dist/types/model/DisplayProducts.d.ts +7 -7
- package/dist/types/model/Done.d.ts +4 -4
- package/dist/types/model/Error.d.ts +4 -4
- package/dist/types/model/FacetedNavigation.d.ts +1 -1
- package/dist/types/model/FacetedNavigationAck.d.ts +10 -0
- package/dist/types/model/FacetedNavigationSuggestion.d.ts +1 -1
- package/dist/types/model/FollowUp.d.ts +4 -4
- package/dist/types/model/Inquiry.d.ts +4 -4
- package/dist/types/model/OperationAck.d.ts +9 -0
- package/dist/types/model/PartialInquiry.d.ts +5 -5
- package/dist/types/model/RefinedSearch.d.ts +10 -10
- package/dist/types/model/ReturnedFields.d.ts +6 -2
- package/dist/types/model/SearchParams.d.ts +3 -1
- package/dist/types/model/SessionData.d.ts +4 -4
- package/dist/types/model/SessionInformation.d.ts +6 -6
- package/dist/types/model/WorkflowMetadata.d.ts +2 -2
- package/dist/types/model/index.d.ts +21 -29
- package/dist/types/parser.d.ts +12 -0
- package/package.json +7 -3
- package/.babelrc +0 -3
- package/dist/bundle.cimulate.copilot-sdk.099d19fa.umd.js +0 -2
- package/dist/bundle.cimulate.copilot-sdk.099d19fa.umd.js.map +0 -1
- package/dist/bundle.cimulate.copilot-sdk.5716b677.cjs.js +0 -2
- package/dist/bundle.cimulate.copilot-sdk.5716b677.cjs.js.map +0 -1
- package/dist/bundle.cimulate.copilot-sdk.64883fd2.esm.js +0 -2
- package/dist/bundle.cimulate.copilot-sdk.64883fd2.esm.js.map +0 -1
- package/dist/types/model/CommonEventFields.d.ts +0 -5
- package/dist/types/model/ConnectAckMessageFields.d.ts +0 -8
- package/dist/types/model/DisplayProductsMessageFields.d.ts +0 -6
- package/dist/types/model/DoneMessageFields.d.ts +0 -4
- package/dist/types/model/ErrorMessageFields.d.ts +0 -6
- package/dist/types/model/EventAck.d.ts +0 -18
- package/dist/types/model/EventAckMessageFields.d.ts +0 -10
- package/dist/types/model/EventAckNames.d.ts +0 -6
- package/dist/types/model/FollowUpMessageFields.d.ts +0 -7
- package/dist/types/model/InquiryMessageFields.d.ts +0 -4
- package/dist/types/model/PartialInquiryMessageFields.d.ts +0 -6
- package/dist/types/model/RefinedSearchMessageFields.d.ts +0 -11
- package/dist/types/model/Root.d.ts +0 -62
- package/rollup.config.js +0 -70
- package/src/copilot.ts +0 -178
- package/src/index.ts +0 -2
- package/src/model/Cancel.ts +0 -6
- package/src/model/CommonEventFields.ts +0 -6
- package/src/model/CommonFields.ts +0 -9
- package/src/model/CommonMetadata.ts +0 -7
- package/src/model/CommonRequiredFields.ts +0 -7
- package/src/model/ConnectAck.ts +0 -11
- package/src/model/ConnectAckMessageFields.ts +0 -8
- package/src/model/ConnectAckMetadata.ts +0 -6
- package/src/model/CopilotEvent.ts +0 -20
- package/src/model/CopilotSearch.ts +0 -6
- package/src/model/CopilotSearchSuggestion.ts +0 -7
- package/src/model/DisplayProducts.ts +0 -11
- package/src/model/DisplayProductsMessageFields.ts +0 -6
- package/src/model/Done.ts +0 -10
- package/src/model/DoneMessageFields.ts +0 -5
- package/src/model/Error.ts +0 -12
- package/src/model/ErrorMessageFields.ts +0 -7
- package/src/model/EventAck.ts +0 -20
- package/src/model/EventAckMessageFields.ts +0 -10
- package/src/model/EventAckNames.ts +0 -7
- package/src/model/Facet.ts +0 -7
- package/src/model/FacetValue.ts +0 -6
- package/src/model/FacetedNavigation.ts +0 -5
- package/src/model/FacetedNavigationSuggestion.ts +0 -7
- package/src/model/FollowUp.ts +0 -12
- package/src/model/FollowUpMessageFields.ts +0 -7
- package/src/model/Inquiry.ts +0 -10
- package/src/model/InquiryMessageFields.ts +0 -5
- package/src/model/PartialInquiry.ts +0 -12
- package/src/model/PartialInquiryMessageFields.ts +0 -7
- package/src/model/RefinedSearch.ts +0 -16
- package/src/model/RefinedSearchMessageFields.ts +0 -11
- package/src/model/ReturnedFields.ts +0 -4
- package/src/model/Root.ts +0 -62
- package/src/model/SearchParams.ts +0 -6
- package/src/model/SessionData.ts +0 -7
- package/src/model/SessionEventStatusReply.ts +0 -5
- package/src/model/SessionInformation.ts +0 -10
- package/src/model/WorkflowMetadata.ts +0 -6
- package/src/model/index.ts +0 -39
- package/tsconfig.json +0 -19
package/src/copilot.ts
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import io, { ManagerOptions, Socket, SocketOptions } from "socket.io-client";
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
ConnectAck,
|
|
5
|
-
DisplayProducts,
|
|
6
|
-
Done,
|
|
7
|
-
Error,
|
|
8
|
-
EventAck,
|
|
9
|
-
EventAckNames,
|
|
10
|
-
FollowUp,
|
|
11
|
-
Inquiry,
|
|
12
|
-
PartialInquiry,
|
|
13
|
-
RefinedSearch,
|
|
14
|
-
ReturnedFields,
|
|
15
|
-
SessionInformation,
|
|
16
|
-
} from "./model";
|
|
17
|
-
import deepmerge from "deepmerge";
|
|
18
|
-
|
|
19
|
-
type SocketIOOptions = Partial<ManagerOptions & SocketOptions>;
|
|
20
|
-
|
|
21
|
-
interface CimulateCopilotOptions {
|
|
22
|
-
apiKey: string;
|
|
23
|
-
baseUrl: string;
|
|
24
|
-
namespace?: string;
|
|
25
|
-
socketOptions?: Omit<SocketIOOptions, "withCredentials">;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
interface SearchParams {
|
|
29
|
-
query: string;
|
|
30
|
-
facet_filters?: Record<string, string[]>;
|
|
31
|
-
page_size?: bigint;
|
|
32
|
-
page?: bigint;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const socketDefaults: SocketIOOptions = {
|
|
36
|
-
path: "/api/v1/socket.io",
|
|
37
|
-
autoConnect: false,
|
|
38
|
-
transports: ["polling", "websocket"],
|
|
39
|
-
upgrade: true,
|
|
40
|
-
timeout: 10000,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default class CimulateCopilot<
|
|
44
|
-
T extends ReturnedFields = ReturnedFields
|
|
45
|
-
> {
|
|
46
|
-
private socket: Socket;
|
|
47
|
-
|
|
48
|
-
constructor({
|
|
49
|
-
apiKey,
|
|
50
|
-
baseUrl,
|
|
51
|
-
namespace = "/copilot",
|
|
52
|
-
socketOptions = {},
|
|
53
|
-
}: CimulateCopilotOptions) {
|
|
54
|
-
const socketioEndpoint = `${baseUrl}${namespace}`;
|
|
55
|
-
|
|
56
|
-
const options: SocketIOOptions[] = [
|
|
57
|
-
socketDefaults,
|
|
58
|
-
socketOptions,
|
|
59
|
-
{
|
|
60
|
-
withCredentials: true, // enables cookies
|
|
61
|
-
transportOptions: {
|
|
62
|
-
polling: {
|
|
63
|
-
extraHeaders: {
|
|
64
|
-
"x-cimulate-api-key": apiKey,
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
];
|
|
70
|
-
|
|
71
|
-
this.socket = io(socketioEndpoint, deepmerge.all(options));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
connect() {
|
|
75
|
-
this.socket.connect();
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
search(
|
|
79
|
-
{
|
|
80
|
-
userPrompt,
|
|
81
|
-
searchParams,
|
|
82
|
-
}: { userPrompt?: string; searchParams: SearchParams },
|
|
83
|
-
callback?: (searchAck: EventAck<EventAckNames.COPILOT_SEARCH_ACK>) => void
|
|
84
|
-
) {
|
|
85
|
-
const payload = {
|
|
86
|
-
user_prompt: userPrompt,
|
|
87
|
-
search_params: searchParams,
|
|
88
|
-
};
|
|
89
|
-
if (callback) {
|
|
90
|
-
this.socket.emit("copilot_search", payload, callback);
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
this.socket.emit("copilot_search", payload);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
facetedNavigation(
|
|
97
|
-
{ searchParams }: { searchParams: SearchParams },
|
|
98
|
-
callback?: (
|
|
99
|
-
facetedNavigationAck: EventAck<EventAckNames.FACETED_NAVIGATION_ACK>
|
|
100
|
-
) => void
|
|
101
|
-
) {
|
|
102
|
-
const payload = {
|
|
103
|
-
search_params: searchParams,
|
|
104
|
-
};
|
|
105
|
-
if (callback) {
|
|
106
|
-
this.socket.emit("faceted_navigation", payload, callback);
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
this.socket.emit("faceted_navigation", payload);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
cancelRequest(
|
|
113
|
-
{ eventId, reason }: { eventId: string; reason: string },
|
|
114
|
-
callback?: (cancelAck: EventAck<EventAckNames.CANCEL_ACK>) => void
|
|
115
|
-
) {
|
|
116
|
-
const payload = {
|
|
117
|
-
event_id: eventId,
|
|
118
|
-
reason,
|
|
119
|
-
};
|
|
120
|
-
if (callback) {
|
|
121
|
-
this.socket.emit("cancel", payload, callback);
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
this.socket.emit("cancel", payload);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
requestSessionInformation(
|
|
128
|
-
callback: (sessionInformation: SessionInformation<T>) => void
|
|
129
|
-
) {
|
|
130
|
-
this.socket.emit("session_info", callback);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
onConnectAck(callback: (connectAck: ConnectAck) => void) {
|
|
134
|
-
this.socket.on("connect_ack", callback);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
onSearchAck(
|
|
138
|
-
callback: (searchAck: EventAck<EventAckNames.COPILOT_SEARCH_ACK>) => void
|
|
139
|
-
) {
|
|
140
|
-
this.socket.on("search_ack", callback);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
onRefinedSearch(callback: (refinedSearch: RefinedSearch<T>) => void) {
|
|
144
|
-
this.socket.on("refined_search", callback);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
onFollowUp(callback: (followUp: FollowUp) => void) {
|
|
148
|
-
this.socket.on("follow_up", callback);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
onInquiry(callback: (inquiry: Inquiry) => void) {
|
|
152
|
-
this.socket.on("inquiry", callback);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
onPartialInquiry(callback: (partialInquiry: PartialInquiry) => void) {
|
|
156
|
-
this.socket.on("partial_inquiry", callback);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
onDisplayProducts(callback: (displayProducts: DisplayProducts<T>) => void) {
|
|
160
|
-
this.socket.on("display_products", callback);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
onDone(callback: (done: Done) => void) {
|
|
164
|
-
this.socket.on("done", callback);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
onError(callback: (error: Error) => void) {
|
|
168
|
-
this.socket.on("error", callback);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
disconnect() {
|
|
172
|
-
this.socket.disconnect();
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
onDisconnect(callback: (reason: string) => void) {
|
|
176
|
-
this.socket.on("disconnect", callback);
|
|
177
|
-
}
|
|
178
|
-
}
|
package/src/index.ts
DELETED
package/src/model/Cancel.ts
DELETED
package/src/model/ConnectAck.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {ConnectAckMetadata} from './ConnectAckMetadata';
|
|
2
|
-
interface ConnectAck {
|
|
3
|
-
session_id: string;
|
|
4
|
-
event_id: string;
|
|
5
|
-
timestamp: string;
|
|
6
|
-
status: number;
|
|
7
|
-
message: string;
|
|
8
|
-
metadata: ConnectAckMetadata;
|
|
9
|
-
event_name: 'connect_ack';
|
|
10
|
-
}
|
|
11
|
-
export { ConnectAck };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {ConnectAck} from './ConnectAck';
|
|
2
|
-
import {EventAck} from './EventAck';
|
|
3
|
-
import {FollowUp} from './FollowUp';
|
|
4
|
-
import {Inquiry} from './Inquiry';
|
|
5
|
-
import {DisplayProducts} from './DisplayProducts';
|
|
6
|
-
import {RefinedSearch} from './RefinedSearch';
|
|
7
|
-
import {Done} from './Done';
|
|
8
|
-
import {Error} from './Error';
|
|
9
|
-
import {CommonMetadata} from './CommonMetadata';
|
|
10
|
-
import type { ReturnedFields } from './ReturnedFields';
|
|
11
|
-
interface CopilotEvent<T extends object = ReturnedFields> {
|
|
12
|
-
id: string;
|
|
13
|
-
session_id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
event_source_id: string;
|
|
16
|
-
data: ConnectAck | EventAck | FollowUp | Inquiry | DisplayProducts<T> | RefinedSearch<T> | Done | Error;
|
|
17
|
-
created_at: string;
|
|
18
|
-
metadata: CommonMetadata;
|
|
19
|
-
}
|
|
20
|
-
export { CopilotEvent };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type {ReturnedFields} from './ReturnedFields';
|
|
2
|
-
interface DisplayProducts<T extends object = ReturnedFields> {
|
|
3
|
-
session_id: string;
|
|
4
|
-
event_id: string;
|
|
5
|
-
timestamp: string;
|
|
6
|
-
event_source_id: string;
|
|
7
|
-
message: string;
|
|
8
|
-
event_name: 'display_products';
|
|
9
|
-
products: T[];
|
|
10
|
-
}
|
|
11
|
-
export { DisplayProducts };
|
package/src/model/Done.ts
DELETED
package/src/model/Error.ts
DELETED
package/src/model/EventAck.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {CopilotSearch} from './CopilotSearch';
|
|
2
|
-
import {FacetedNavigation} from './FacetedNavigation';
|
|
3
|
-
import {Cancel} from './Cancel';
|
|
4
|
-
import {EventAckNames} from './EventAckNames';
|
|
5
|
-
|
|
6
|
-
type EventRequestMap = {
|
|
7
|
-
copilot_search_ack: CopilotSearch;
|
|
8
|
-
faceted_navigation_ack: FacetedNavigation;
|
|
9
|
-
cancel_ack: Cancel;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface EventAck<T extends EventAckNames = EventAckNames> {
|
|
13
|
-
session_id: string;
|
|
14
|
-
event_id: string;
|
|
15
|
-
timestamp: string;
|
|
16
|
-
status: string;
|
|
17
|
-
request: EventRequestMap[T];
|
|
18
|
-
event_name: T;
|
|
19
|
-
}
|
|
20
|
-
export { EventAck };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import {CopilotSearch} from './CopilotSearch';
|
|
2
|
-
import {FacetedNavigation} from './FacetedNavigation';
|
|
3
|
-
import {Cancel} from './Cancel';
|
|
4
|
-
import {EventAckNames} from './EventAckNames';
|
|
5
|
-
interface EventAckMessageFields {
|
|
6
|
-
status: string;
|
|
7
|
-
request: CopilotSearch | FacetedNavigation | Cancel;
|
|
8
|
-
event_name: EventAckNames;
|
|
9
|
-
}
|
|
10
|
-
export { EventAckMessageFields };
|
package/src/model/Facet.ts
DELETED
package/src/model/FacetValue.ts
DELETED
package/src/model/FollowUp.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {CopilotSearchSuggestion} from './CopilotSearchSuggestion';
|
|
2
|
-
import {FacetedNavigationSuggestion} from './FacetedNavigationSuggestion';
|
|
3
|
-
interface FollowUp {
|
|
4
|
-
session_id: string;
|
|
5
|
-
event_id: string;
|
|
6
|
-
timestamp: string;
|
|
7
|
-
event_source_id: string;
|
|
8
|
-
message: string;
|
|
9
|
-
suggestions: (CopilotSearchSuggestion | FacetedNavigationSuggestion)[];
|
|
10
|
-
event_name: 'follow_up';
|
|
11
|
-
}
|
|
12
|
-
export { FollowUp };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import {CopilotSearchSuggestion} from './CopilotSearchSuggestion';
|
|
2
|
-
import {FacetedNavigationSuggestion} from './FacetedNavigationSuggestion';
|
|
3
|
-
interface FollowUpMessageFields {
|
|
4
|
-
suggestions: (CopilotSearchSuggestion | FacetedNavigationSuggestion)[];
|
|
5
|
-
event_name: 'follow_up';
|
|
6
|
-
}
|
|
7
|
-
export { FollowUpMessageFields };
|
package/src/model/Inquiry.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {SearchParams} from './SearchParams';
|
|
2
|
-
import {Facet} from './Facet';
|
|
3
|
-
import type {ReturnedFields} from './ReturnedFields';
|
|
4
|
-
interface RefinedSearch<T extends object = ReturnedFields> {
|
|
5
|
-
session_id: string;
|
|
6
|
-
event_id: string;
|
|
7
|
-
timestamp: string;
|
|
8
|
-
event_source_id: string;
|
|
9
|
-
message: string;
|
|
10
|
-
event_name: 'refined_search';
|
|
11
|
-
search_params: SearchParams;
|
|
12
|
-
hits?: T[];
|
|
13
|
-
total_hits?: number;
|
|
14
|
-
facets?: Facet[];
|
|
15
|
-
}
|
|
16
|
-
export { RefinedSearch };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {SearchParams} from './SearchParams';
|
|
2
|
-
import {Facet} from './Facet';
|
|
3
|
-
import type {ReturnedFields} from './ReturnedFields';
|
|
4
|
-
interface RefinedSearchMessageFields<T extends object = ReturnedFields> {
|
|
5
|
-
event_name: 'refined_search';
|
|
6
|
-
search_params: SearchParams;
|
|
7
|
-
hits?: T[];
|
|
8
|
-
total_hits?: number;
|
|
9
|
-
facets?: Facet[];
|
|
10
|
-
}
|
|
11
|
-
export { RefinedSearchMessageFields };
|
package/src/model/Root.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import {CommonRequiredFields} from './CommonRequiredFields';
|
|
2
|
-
import {CommonFields} from './CommonFields';
|
|
3
|
-
import {CommonMetadata} from './CommonMetadata';
|
|
4
|
-
import {ConnectAckMetadata} from './ConnectAckMetadata';
|
|
5
|
-
import {ConnectAck} from './ConnectAck';
|
|
6
|
-
import {SearchParams} from './SearchParams';
|
|
7
|
-
import {FacetValue} from './FacetValue';
|
|
8
|
-
import {Facet} from './Facet';
|
|
9
|
-
import {CopilotSearch} from './CopilotSearch';
|
|
10
|
-
import {FacetedNavigation} from './FacetedNavigation';
|
|
11
|
-
import {EventAckNames} from './EventAckNames';
|
|
12
|
-
import {EventAck} from './EventAck';
|
|
13
|
-
import {RefinedSearch} from './RefinedSearch';
|
|
14
|
-
import {DisplayProducts} from './DisplayProducts';
|
|
15
|
-
import {CopilotSearchSuggestion} from './CopilotSearchSuggestion';
|
|
16
|
-
import {FacetedNavigationSuggestion} from './FacetedNavigationSuggestion';
|
|
17
|
-
import {FollowUp} from './FollowUp';
|
|
18
|
-
import {PartialInquiry} from './PartialInquiry';
|
|
19
|
-
import {Inquiry} from './Inquiry';
|
|
20
|
-
import {Done} from './Done';
|
|
21
|
-
import {Error} from './Error';
|
|
22
|
-
import {CopilotEvent} from './CopilotEvent';
|
|
23
|
-
import {SessionData} from './SessionData';
|
|
24
|
-
import {SessionInformation} from './SessionInformation';
|
|
25
|
-
import {SessionEventStatusReply} from './SessionEventStatusReply';
|
|
26
|
-
import {Cancel} from './Cancel';
|
|
27
|
-
import type {ReturnedFields} from './ReturnedFields';
|
|
28
|
-
interface Root {
|
|
29
|
-
common_fields?: CommonRequiredFields;
|
|
30
|
-
common_event_fields?: CommonFields;
|
|
31
|
-
common_metadata?: CommonMetadata;
|
|
32
|
-
connect_ack_metadata?: ConnectAckMetadata;
|
|
33
|
-
connect_ack?: ConnectAck;
|
|
34
|
-
search_params?: SearchParams;
|
|
35
|
-
facet_value?: FacetValue;
|
|
36
|
-
facets?: Facet[];
|
|
37
|
-
copilot_search?: CopilotSearch;
|
|
38
|
-
faceted_navigation?: FacetedNavigation;
|
|
39
|
-
event_ack_names?: EventAckNames;
|
|
40
|
-
event_ack?: EventAck;
|
|
41
|
-
refined_search?: RefinedSearch;
|
|
42
|
-
display_products?: DisplayProducts;
|
|
43
|
-
copilot_search_suggestion?: CopilotSearchSuggestion;
|
|
44
|
-
faceted_navigation_suggestion?: FacetedNavigationSuggestion;
|
|
45
|
-
suggestions?: (CopilotSearchSuggestion | FacetedNavigationSuggestion)[];
|
|
46
|
-
follow_up?: FollowUp;
|
|
47
|
-
partial_inquiry?: PartialInquiry;
|
|
48
|
-
inquiry?: Inquiry;
|
|
49
|
-
done?: Done;
|
|
50
|
-
error?: Error;
|
|
51
|
-
event?: CopilotEvent;
|
|
52
|
-
session_data?: SessionData;
|
|
53
|
-
session_info_reply?: SessionInformation;
|
|
54
|
-
session_events_reply?: CopilotEvent[];
|
|
55
|
-
session_event_info?: string;
|
|
56
|
-
session_event_info_reply?: ConnectAck | EventAck | FollowUp | Inquiry | DisplayProducts | RefinedSearch | Done | Error;
|
|
57
|
-
session_event_status?: string;
|
|
58
|
-
session_event_status_reply?: SessionEventStatusReply;
|
|
59
|
-
cancel?: Cancel;
|
|
60
|
-
return_fields?: ReturnedFields;
|
|
61
|
-
}
|
|
62
|
-
export { Root };
|
package/src/model/SessionData.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import {CopilotEvent} from './CopilotEvent';
|
|
2
|
-
import type { RefinedSearch } from './RefinedSearch';
|
|
3
|
-
interface SessionData<T extends object = RefinedSearch> {
|
|
4
|
-
events?: Record<string, CopilotEvent<T>>;
|
|
5
|
-
event_source_map?: Record<string, string[]>;
|
|
6
|
-
}
|
|
7
|
-
export { SessionData };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import {SessionData} from './SessionData';
|
|
2
|
-
import type { RefinedSearch } from './RefinedSearch';
|
|
3
|
-
interface SessionInformation<T extends object = RefinedSearch> {
|
|
4
|
-
session_id?: string;
|
|
5
|
-
created_at?: string;
|
|
6
|
-
last_active_at?: string;
|
|
7
|
-
status?: string;
|
|
8
|
-
data?: SessionData<T>;
|
|
9
|
-
}
|
|
10
|
-
export { SessionInformation };
|