@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.
Files changed (110) hide show
  1. package/README.md +25 -17
  2. package/dist/bundle.cimulate.copilot-sdk.5e12bca4.cjs.js +2 -0
  3. package/dist/bundle.cimulate.copilot-sdk.5e12bca4.cjs.js.map +1 -0
  4. package/dist/bundle.cimulate.copilot-sdk.820437d6.esm.js +2 -0
  5. package/dist/bundle.cimulate.copilot-sdk.820437d6.esm.js.map +1 -0
  6. package/dist/bundle.cimulate.copilot-sdk.cc0f99da.umd.js +2 -0
  7. package/dist/bundle.cimulate.copilot-sdk.cc0f99da.umd.js.map +1 -0
  8. package/dist/index.cjs.js +1 -1
  9. package/dist/index.cjs.js.map +1 -1
  10. package/dist/index.esm.js +1 -1
  11. package/dist/index.esm.js.map +1 -1
  12. package/dist/index.umd.js +1 -1
  13. package/dist/index.umd.js.map +1 -1
  14. package/dist/types/copilot.d.ts +26 -29
  15. package/dist/types/generator.d.ts +7 -0
  16. package/dist/types/index.d.ts +2 -1
  17. package/dist/types/model/Cancel.d.ts +1 -1
  18. package/dist/types/model/CancelAck.d.ts +10 -0
  19. package/dist/types/model/CommonFields.d.ts +3 -3
  20. package/dist/types/model/CommonMetadata.d.ts +2 -2
  21. package/dist/types/model/CommonRequiredFields.d.ts +2 -2
  22. package/dist/types/model/ConnectAck.d.ts +3 -3
  23. package/dist/types/model/CopilotAPIEvent.d.ts +11 -0
  24. package/dist/types/model/CopilotEvent.d.ts +10 -11
  25. package/dist/types/model/CopilotSearch.d.ts +2 -2
  26. package/dist/types/model/CopilotSearchAck.d.ts +10 -0
  27. package/dist/types/model/CopilotSearchSuggestion.d.ts +1 -1
  28. package/dist/types/model/DisplayProducts.d.ts +7 -7
  29. package/dist/types/model/Done.d.ts +4 -4
  30. package/dist/types/model/Error.d.ts +4 -4
  31. package/dist/types/model/FacetedNavigation.d.ts +1 -1
  32. package/dist/types/model/FacetedNavigationAck.d.ts +10 -0
  33. package/dist/types/model/FacetedNavigationSuggestion.d.ts +1 -1
  34. package/dist/types/model/FollowUp.d.ts +4 -4
  35. package/dist/types/model/Inquiry.d.ts +4 -4
  36. package/dist/types/model/OperationAck.d.ts +9 -0
  37. package/dist/types/model/PartialInquiry.d.ts +5 -5
  38. package/dist/types/model/RefinedSearch.d.ts +10 -10
  39. package/dist/types/model/ReturnedFields.d.ts +6 -2
  40. package/dist/types/model/SearchParams.d.ts +3 -1
  41. package/dist/types/model/SessionData.d.ts +4 -4
  42. package/dist/types/model/SessionInformation.d.ts +6 -6
  43. package/dist/types/model/WorkflowMetadata.d.ts +2 -2
  44. package/dist/types/model/index.d.ts +21 -29
  45. package/dist/types/parser.d.ts +12 -0
  46. package/package.json +7 -3
  47. package/.babelrc +0 -3
  48. package/dist/bundle.cimulate.copilot-sdk.099d19fa.umd.js +0 -2
  49. package/dist/bundle.cimulate.copilot-sdk.099d19fa.umd.js.map +0 -1
  50. package/dist/bundle.cimulate.copilot-sdk.5716b677.cjs.js +0 -2
  51. package/dist/bundle.cimulate.copilot-sdk.5716b677.cjs.js.map +0 -1
  52. package/dist/bundle.cimulate.copilot-sdk.64883fd2.esm.js +0 -2
  53. package/dist/bundle.cimulate.copilot-sdk.64883fd2.esm.js.map +0 -1
  54. package/dist/types/model/CommonEventFields.d.ts +0 -5
  55. package/dist/types/model/ConnectAckMessageFields.d.ts +0 -8
  56. package/dist/types/model/DisplayProductsMessageFields.d.ts +0 -6
  57. package/dist/types/model/DoneMessageFields.d.ts +0 -4
  58. package/dist/types/model/ErrorMessageFields.d.ts +0 -6
  59. package/dist/types/model/EventAck.d.ts +0 -18
  60. package/dist/types/model/EventAckMessageFields.d.ts +0 -10
  61. package/dist/types/model/EventAckNames.d.ts +0 -6
  62. package/dist/types/model/FollowUpMessageFields.d.ts +0 -7
  63. package/dist/types/model/InquiryMessageFields.d.ts +0 -4
  64. package/dist/types/model/PartialInquiryMessageFields.d.ts +0 -6
  65. package/dist/types/model/RefinedSearchMessageFields.d.ts +0 -11
  66. package/dist/types/model/Root.d.ts +0 -62
  67. package/rollup.config.js +0 -70
  68. package/src/copilot.ts +0 -178
  69. package/src/index.ts +0 -2
  70. package/src/model/Cancel.ts +0 -6
  71. package/src/model/CommonEventFields.ts +0 -6
  72. package/src/model/CommonFields.ts +0 -9
  73. package/src/model/CommonMetadata.ts +0 -7
  74. package/src/model/CommonRequiredFields.ts +0 -7
  75. package/src/model/ConnectAck.ts +0 -11
  76. package/src/model/ConnectAckMessageFields.ts +0 -8
  77. package/src/model/ConnectAckMetadata.ts +0 -6
  78. package/src/model/CopilotEvent.ts +0 -20
  79. package/src/model/CopilotSearch.ts +0 -6
  80. package/src/model/CopilotSearchSuggestion.ts +0 -7
  81. package/src/model/DisplayProducts.ts +0 -11
  82. package/src/model/DisplayProductsMessageFields.ts +0 -6
  83. package/src/model/Done.ts +0 -10
  84. package/src/model/DoneMessageFields.ts +0 -5
  85. package/src/model/Error.ts +0 -12
  86. package/src/model/ErrorMessageFields.ts +0 -7
  87. package/src/model/EventAck.ts +0 -20
  88. package/src/model/EventAckMessageFields.ts +0 -10
  89. package/src/model/EventAckNames.ts +0 -7
  90. package/src/model/Facet.ts +0 -7
  91. package/src/model/FacetValue.ts +0 -6
  92. package/src/model/FacetedNavigation.ts +0 -5
  93. package/src/model/FacetedNavigationSuggestion.ts +0 -7
  94. package/src/model/FollowUp.ts +0 -12
  95. package/src/model/FollowUpMessageFields.ts +0 -7
  96. package/src/model/Inquiry.ts +0 -10
  97. package/src/model/InquiryMessageFields.ts +0 -5
  98. package/src/model/PartialInquiry.ts +0 -12
  99. package/src/model/PartialInquiryMessageFields.ts +0 -7
  100. package/src/model/RefinedSearch.ts +0 -16
  101. package/src/model/RefinedSearchMessageFields.ts +0 -11
  102. package/src/model/ReturnedFields.ts +0 -4
  103. package/src/model/Root.ts +0 -62
  104. package/src/model/SearchParams.ts +0 -6
  105. package/src/model/SessionData.ts +0 -7
  106. package/src/model/SessionEventStatusReply.ts +0 -5
  107. package/src/model/SessionInformation.ts +0 -10
  108. package/src/model/WorkflowMetadata.ts +0 -6
  109. package/src/model/index.ts +0 -39
  110. 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
@@ -1,2 +0,0 @@
1
- import CimulateCopilot from './copilot';
2
- export { CimulateCopilot };
@@ -1,6 +0,0 @@
1
-
2
- interface Cancel {
3
- event_id: string;
4
- reason?: string;
5
- }
6
- export { Cancel };
@@ -1,6 +0,0 @@
1
-
2
- interface CommonEventFields {
3
- event_source_id: string;
4
- message: string;
5
- }
6
- export { CommonEventFields };
@@ -1,9 +0,0 @@
1
-
2
- interface CommonFields {
3
- session_id: string;
4
- event_id: string;
5
- timestamp: string;
6
- event_source_id: string;
7
- message: string;
8
- }
9
- export { CommonFields };
@@ -1,7 +0,0 @@
1
- import {WorkflowMetadata} from './WorkflowMetadata';
2
- interface CommonMetadata {
3
- sio_session_id?: string;
4
- session_id?: string;
5
- workflow?: WorkflowMetadata;
6
- }
7
- export { CommonMetadata };
@@ -1,7 +0,0 @@
1
-
2
- interface CommonRequiredFields {
3
- session_id: string;
4
- event_id: string;
5
- timestamp: string;
6
- }
7
- export { CommonRequiredFields };
@@ -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,8 +0,0 @@
1
- import {ConnectAckMetadata} from './ConnectAckMetadata';
2
- interface ConnectAckMessageFields {
3
- status: number;
4
- message: string;
5
- metadata: ConnectAckMetadata;
6
- event_name: 'connect_ack';
7
- }
8
- export { ConnectAckMessageFields };
@@ -1,6 +0,0 @@
1
-
2
- interface ConnectAckMetadata {
3
- version: string;
4
- server: string;
5
- }
6
- export { ConnectAckMetadata };
@@ -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,6 +0,0 @@
1
- import {SearchParams} from './SearchParams';
2
- interface CopilotSearch {
3
- search_params: SearchParams;
4
- user_prompt?: string;
5
- }
6
- export { CopilotSearch };
@@ -1,7 +0,0 @@
1
- import {CopilotSearch} from './CopilotSearch';
2
- interface CopilotSearchSuggestion {
3
- display_text: string;
4
- action: 'copilot_search';
5
- params: CopilotSearch;
6
- }
7
- export { CopilotSearchSuggestion };
@@ -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 };
@@ -1,6 +0,0 @@
1
- import type {ReturnedFields} from './ReturnedFields';
2
- interface DisplayProductsMessageFields<T extends object = ReturnedFields> {
3
- event_name: 'display_products';
4
- products: T[];
5
- }
6
- export { DisplayProductsMessageFields };
package/src/model/Done.ts DELETED
@@ -1,10 +0,0 @@
1
-
2
- interface Done {
3
- session_id: string;
4
- event_id: string;
5
- timestamp: string;
6
- event_source_id: string;
7
- message: string;
8
- event_name: 'done';
9
- }
10
- export { Done };
@@ -1,5 +0,0 @@
1
-
2
- interface DoneMessageFields {
3
- event_name: 'done';
4
- }
5
- export { DoneMessageFields };
@@ -1,12 +0,0 @@
1
-
2
- interface Error {
3
- session_id: string;
4
- event_id: string;
5
- timestamp: string;
6
- event_source_id: string;
7
- message: string;
8
- status: number;
9
- error: string;
10
- event_name: 'error';
11
- }
12
- export { Error };
@@ -1,7 +0,0 @@
1
-
2
- interface ErrorMessageFields {
3
- status: number;
4
- error: string;
5
- event_name: 'error';
6
- }
7
- export { ErrorMessageFields };
@@ -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 };
@@ -1,7 +0,0 @@
1
-
2
- enum EventAckNames {
3
- COPILOT_SEARCH_ACK = "copilot_search_ack",
4
- FACETED_NAVIGATION_ACK = "faceted_navigation_ack",
5
- CANCEL_ACK = "cancel_ack",
6
- }
7
- export { EventAckNames };
@@ -1,7 +0,0 @@
1
- import {FacetValue} from './FacetValue';
2
- interface Facet {
3
- field?: string;
4
- label?: string;
5
- values?: FacetValue[];
6
- }
7
- export { Facet };
@@ -1,6 +0,0 @@
1
-
2
- interface FacetValue {
3
- name?: string;
4
- count?: number;
5
- }
6
- export { FacetValue };
@@ -1,5 +0,0 @@
1
- import {SearchParams} from './SearchParams';
2
- interface FacetedNavigation {
3
- search_params: SearchParams;
4
- }
5
- export { FacetedNavigation };
@@ -1,7 +0,0 @@
1
- import {FacetedNavigation} from './FacetedNavigation';
2
- interface FacetedNavigationSuggestion {
3
- display_text: string;
4
- action: 'faceted_navigation';
5
- params: FacetedNavigation;
6
- }
7
- export { FacetedNavigationSuggestion };
@@ -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 };
@@ -1,10 +0,0 @@
1
-
2
- interface Inquiry {
3
- session_id: string;
4
- event_id: string;
5
- timestamp: string;
6
- event_source_id: string;
7
- message: string;
8
- event_name: 'inquiry';
9
- }
10
- export { Inquiry };
@@ -1,5 +0,0 @@
1
-
2
- interface InquiryMessageFields {
3
- event_name: 'inquiry';
4
- }
5
- export { InquiryMessageFields };
@@ -1,12 +0,0 @@
1
-
2
- interface PartialInquiry {
3
- session_id: string;
4
- event_id: string;
5
- timestamp: string;
6
- event_source_id: string;
7
- message: string;
8
- inquiry_event_id: string;
9
- index: number;
10
- event_name: 'partial_inquiry';
11
- }
12
- export { PartialInquiry };
@@ -1,7 +0,0 @@
1
-
2
- interface PartialInquiryMessageFields {
3
- inquiry_event_id: string;
4
- index: number;
5
- event_name: 'partial_inquiry';
6
- }
7
- export { PartialInquiryMessageFields };
@@ -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 };
@@ -1,4 +0,0 @@
1
- // This is added manually
2
- type ReturnedFields<T = unknown> = Record<string, T>;
3
-
4
- export type { ReturnedFields };
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 };
@@ -1,6 +0,0 @@
1
-
2
- interface SearchParams {
3
- query: string;
4
- facet_filters?: Record<string, string[]>;
5
- }
6
- export { SearchParams };
@@ -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,5 +0,0 @@
1
-
2
- interface SessionEventStatusReply {
3
- status?: string;
4
- }
5
- export { SessionEventStatusReply };
@@ -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 };
@@ -1,6 +0,0 @@
1
-
2
- interface WorkflowMetadata {
3
- session_id?: string;
4
- task_id?: string;
5
- }
6
- export { WorkflowMetadata };