@cimulate/copilot-sdk 1.0.0 → 1.1.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 (96) hide show
  1. package/README.md +60 -27
  2. package/dist/bundle.cimulate.copilot-sdk.65f7195a.esm.js +2 -0
  3. package/dist/bundle.cimulate.copilot-sdk.65f7195a.esm.js.map +1 -0
  4. package/dist/bundle.cimulate.copilot-sdk.a2e829d8.cjs.js +2 -0
  5. package/dist/bundle.cimulate.copilot-sdk.a2e829d8.cjs.js.map +1 -0
  6. package/dist/bundle.cimulate.copilot-sdk.c68ae11d.umd.js +2 -0
  7. package/dist/bundle.cimulate.copilot-sdk.c68ae11d.umd.js.map +1 -0
  8. package/dist/index.cjs.js +2 -1
  9. package/dist/index.cjs.js.map +1 -0
  10. package/dist/index.esm.js +2 -1
  11. package/dist/index.esm.js.map +1 -0
  12. package/dist/index.umd.js +2 -1
  13. package/dist/index.umd.js.map +1 -0
  14. package/dist/types/copilot.d.ts +44 -0
  15. package/dist/types/index.d.ts +2 -0
  16. package/dist/types/model/Cancel.d.ts +5 -0
  17. package/dist/types/model/CommonEventFields.d.ts +5 -0
  18. package/dist/types/model/CommonFields.d.ts +9 -0
  19. package/dist/types/model/CommonRequiredFields.d.ts +7 -0
  20. package/dist/types/model/ConnectAck.d.ts +11 -0
  21. package/dist/types/model/ConnectAckMetadata.d.ts +5 -0
  22. package/dist/types/model/ConnectionAcknowledgmentMessageFields.d.ts +7 -0
  23. package/dist/types/model/CopilotSearch.d.ts +6 -0
  24. package/dist/types/model/DisplayProducts.d.ts +10 -0
  25. package/dist/types/model/DisplayProductsMessageFields.d.ts +4 -0
  26. package/dist/types/model/Done.d.ts +9 -0
  27. package/dist/types/model/Error.d.ts +11 -0
  28. package/dist/types/model/ErrorMessageFields.d.ts +5 -0
  29. package/dist/types/model/EventAck.d.ts +12 -0
  30. package/dist/types/model/EventAcknowledgmentMessageFields.d.ts +6 -0
  31. package/dist/types/model/Facet.d.ts +7 -0
  32. package/dist/types/model/FacetValue.d.ts +5 -0
  33. package/dist/types/model/FacetedNavigation.d.ts +5 -0
  34. package/dist/types/model/FollowMinusUpMessageFields.d.ts +5 -0
  35. package/dist/types/model/FollowUp.d.ts +11 -0
  36. package/dist/types/model/Inquiry.d.ts +9 -0
  37. package/dist/types/model/PartialInquiry.d.ts +11 -0
  38. package/dist/types/model/PartialInquiryMessageFields.d.ts +5 -0
  39. package/dist/types/model/RefinedSearch.d.ts +15 -0
  40. package/dist/types/model/RefinedSearchMessageFields.d.ts +9 -0
  41. package/dist/types/model/ReservedEvent.d.ts +10 -0
  42. package/dist/types/model/Root.d.ts +54 -0
  43. package/dist/types/model/SearchParameters.d.ts +5 -0
  44. package/dist/types/model/SessionData.d.ts +6 -0
  45. package/dist/types/model/SessionEventInformationReply.d.ts +5 -0
  46. package/dist/types/model/SessionEventStatusReply.d.ts +5 -0
  47. package/dist/types/model/SessionInformation.d.ts +10 -0
  48. package/dist/types/model/Suggestion.d.ts +6 -0
  49. package/dist/types/model/index.d.ts +33 -0
  50. package/package.json +10 -2
  51. package/rollup.config.js +7 -5
  52. package/src/copilot.ts +154 -0
  53. package/src/index.ts +2 -0
  54. package/src/model/Cancel.ts +6 -0
  55. package/src/model/CommonEventFields.ts +6 -0
  56. package/src/model/CommonFields.ts +10 -0
  57. package/src/model/CommonRequiredFields.ts +8 -0
  58. package/src/model/ConnectAck.ts +11 -0
  59. package/src/model/ConnectAckMetadata.ts +6 -0
  60. package/src/model/ConnectionAcknowledgmentMessageFields.ts +7 -0
  61. package/src/model/CopilotSearch.ts +6 -0
  62. package/src/model/DisplayProducts.ts +11 -0
  63. package/src/model/DisplayProductsMessageFields.ts +5 -0
  64. package/src/model/Done.ts +10 -0
  65. package/src/model/Error.ts +12 -0
  66. package/src/model/ErrorMessageFields.ts +6 -0
  67. package/src/model/EventAck.ts +12 -0
  68. package/src/model/EventAcknowledgmentMessageFields.ts +6 -0
  69. package/src/model/Facet.ts +7 -0
  70. package/src/model/FacetValue.ts +6 -0
  71. package/src/model/FacetedNavigation.ts +5 -0
  72. package/src/model/FollowMinusUpMessageFields.ts +5 -0
  73. package/src/model/FollowUp.ts +11 -0
  74. package/src/model/Inquiry.ts +10 -0
  75. package/src/model/PartialInquiry.ts +12 -0
  76. package/src/model/PartialInquiryMessageFields.ts +6 -0
  77. package/src/model/RefinedSearch.ts +15 -0
  78. package/src/model/RefinedSearchMessageFields.ts +9 -0
  79. package/src/model/ReservedEvent.ts +11 -0
  80. package/src/model/Root.ts +54 -0
  81. package/src/model/SearchParameters.ts +6 -0
  82. package/src/model/SessionData.ts +6 -0
  83. package/src/model/SessionEventInformationReply.ts +6 -0
  84. package/src/model/SessionEventStatusReply.ts +6 -0
  85. package/src/model/SessionInformation.ts +10 -0
  86. package/src/model/Suggestion.ts +7 -0
  87. package/src/model/index.ts +33 -0
  88. package/tsconfig.json +18 -0
  89. package/dist/bundle.cimulate.copilot-sdk.0bb38412.esm.js +0 -2
  90. package/dist/bundle.cimulate.copilot-sdk.0bb38412.esm.js.map +0 -1
  91. package/dist/bundle.cimulate.copilot-sdk.a100b7fd.umd.js +0 -2
  92. package/dist/bundle.cimulate.copilot-sdk.a100b7fd.umd.js.map +0 -1
  93. package/dist/bundle.cimulate.copilot-sdk.f5a7df44.cjs.js +0 -2
  94. package/dist/bundle.cimulate.copilot-sdk.f5a7df44.cjs.js.map +0 -1
  95. package/src/copilot.js +0 -116
  96. package/src/index.js +0 -2
@@ -0,0 +1,54 @@
1
+ import { CommonRequiredFields } from './CommonRequiredFields';
2
+ import { CommonFields } from './CommonFields';
3
+ import { ConnectAckMetadata } from './ConnectAckMetadata';
4
+ import { ConnectAck } from './ConnectAck';
5
+ import { SearchParameters } from './SearchParameters';
6
+ import { FacetValue } from './FacetValue';
7
+ import { Facet } from './Facet';
8
+ import { CopilotSearch } from './CopilotSearch';
9
+ import { FacetedNavigation } from './FacetedNavigation';
10
+ import { EventAck } from './EventAck';
11
+ import { RefinedSearch } from './RefinedSearch';
12
+ import { DisplayProducts } from './DisplayProducts';
13
+ import { Suggestion } from './Suggestion';
14
+ import { FollowUp } from './FollowUp';
15
+ import { PartialInquiry } from './PartialInquiry';
16
+ import { Inquiry } from './Inquiry';
17
+ import { Done } from './Done';
18
+ import { Error } from './Error';
19
+ import { ReservedEvent } from './ReservedEvent';
20
+ import { SessionData } from './SessionData';
21
+ import { SessionInformation } from './SessionInformation';
22
+ import { SessionEventInformationReply } from './SessionEventInformationReply';
23
+ import { SessionEventStatusReply } from './SessionEventStatusReply';
24
+ import { Cancel } from './Cancel';
25
+ interface Root {
26
+ commonFields?: CommonRequiredFields;
27
+ commonEventFields?: CommonFields;
28
+ connectAckMetadata?: ConnectAckMetadata;
29
+ connectAck?: ConnectAck;
30
+ searchParams?: SearchParameters;
31
+ facetValue?: FacetValue;
32
+ facets?: Facet[];
33
+ copilotSearch?: CopilotSearch;
34
+ facetedNavigation?: FacetedNavigation;
35
+ eventAck?: EventAck;
36
+ refinedSearch?: RefinedSearch;
37
+ displayProducts?: DisplayProducts;
38
+ suggestions?: Suggestion[];
39
+ followUp?: FollowUp;
40
+ partialInquiry?: PartialInquiry;
41
+ inquiry?: Inquiry;
42
+ done?: Done;
43
+ error?: Error;
44
+ reservedEvent?: ReservedEvent;
45
+ sessionData?: SessionData;
46
+ sessionInfoReply?: SessionInformation;
47
+ sessionEventsReply?: Map<string, any>[];
48
+ sessionEventInfo?: string;
49
+ sessionEventInfoReply?: SessionEventInformationReply;
50
+ sessionEventStatus?: string;
51
+ sessionEventStatusReply?: SessionEventStatusReply;
52
+ cancel?: Cancel;
53
+ }
54
+ export { Root };
@@ -0,0 +1,5 @@
1
+ interface SearchParameters {
2
+ query: string;
3
+ facetFilters?: Map<string, string[]>;
4
+ }
5
+ export { SearchParameters };
@@ -0,0 +1,6 @@
1
+ import { ReservedEvent } from './ReservedEvent';
2
+ interface SessionData {
3
+ events?: Map<string, ReservedEvent>;
4
+ eventSourceMap?: Map<string, string[]>;
5
+ }
6
+ export { SessionData };
@@ -0,0 +1,5 @@
1
+ interface SessionEventInformationReply {
2
+ reservedType?: any;
3
+ additionalProperties?: Map<string, any>;
4
+ }
5
+ export { SessionEventInformationReply };
@@ -0,0 +1,5 @@
1
+ interface SessionEventStatusReply {
2
+ reservedStatus?: string;
3
+ additionalProperties?: Map<string, any>;
4
+ }
5
+ export { SessionEventStatusReply };
@@ -0,0 +1,10 @@
1
+ import { SessionData } from './SessionData';
2
+ interface SessionInformation {
3
+ sessionId?: string;
4
+ createdAt?: string;
5
+ lastActiveAt?: string;
6
+ reservedStatus?: string;
7
+ data?: SessionData;
8
+ metadata?: Map<string, any>;
9
+ }
10
+ export { SessionInformation };
@@ -0,0 +1,6 @@
1
+ interface Suggestion {
2
+ displayText?: string;
3
+ action?: string;
4
+ params?: Map<string, any>;
5
+ }
6
+ export { Suggestion };
@@ -0,0 +1,33 @@
1
+ export * from './Root';
2
+ export * from './CommonRequiredFields';
3
+ export * from './CommonFields';
4
+ export * from './CommonEventFields';
5
+ export * from './ConnectAckMetadata';
6
+ export * from './ConnectAck';
7
+ export * from './ConnectionAcknowledgmentMessageFields';
8
+ export * from './SearchParameters';
9
+ export * from './FacetValue';
10
+ export * from './Facet';
11
+ export * from './CopilotSearch';
12
+ export * from './FacetedNavigation';
13
+ export * from './EventAck';
14
+ export * from './EventAcknowledgmentMessageFields';
15
+ export * from './RefinedSearch';
16
+ export * from './RefinedSearchMessageFields';
17
+ export * from './DisplayProducts';
18
+ export * from './DisplayProductsMessageFields';
19
+ export * from './Suggestion';
20
+ export * from './FollowUp';
21
+ export * from './FollowMinusUpMessageFields';
22
+ export * from './PartialInquiry';
23
+ export * from './PartialInquiryMessageFields';
24
+ export * from './Inquiry';
25
+ export * from './Done';
26
+ export * from './Error';
27
+ export * from './ErrorMessageFields';
28
+ export * from './ReservedEvent';
29
+ export * from './SessionData';
30
+ export * from './SessionInformation';
31
+ export * from './SessionEventInformationReply';
32
+ export * from './SessionEventStatusReply';
33
+ export * from './Cancel';
package/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "@cimulate/copilot-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "A lightweight API client SDK for Cimulate Copilot",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
7
7
  "browser": "dist/index.umd.js",
8
+ "types": "src/model/index.ts",
8
9
  "scripts": {
10
+ "generate-models": "tsx scripts/generate-model.ts ../../python/cimulate-copilot-api/asyncapi.yaml src/model",
9
11
  "build": "rollup -c"
10
12
  },
11
13
  "keywords": [],
12
14
  "author": "support@cimulate.ai",
13
15
  "license": "MIT",
14
16
  "dependencies": {
15
- "socket.io-client": "^4.7.5"
17
+ "socket.io-client": "^4.7.5",
18
+ "ts-deepmerge": "^7.0.2"
16
19
  },
17
20
  "peerDependencies": {
18
21
  "react": "^18.2.0",
@@ -26,12 +29,17 @@
26
29
  "@rollup/plugin-commonjs": "^21.0.0",
27
30
  "@rollup/plugin-json": "^6.1.0",
28
31
  "@rollup/plugin-node-resolve": "^13.0.0",
32
+ "@rollup/plugin-typescript": "^9.0.0",
33
+ "@types/js-yaml": "^4.0.9",
29
34
  "babel-loader": "^9.2.1",
35
+ "js-yaml": "^4.1.0",
30
36
  "rollup": "^2.42.0",
31
37
  "rollup-plugin-hash": "^1.3.0",
32
38
  "rollup-plugin-output": "^1.0.1",
33
39
  "rollup-plugin-terser": "^7.0.2",
34
40
  "source-map-explorer": "^2.5.3",
41
+ "tsx": "^4.19.2",
42
+ "typescript": "^5.7.3",
35
43
  "webpack": "^5.97.1",
36
44
  "webpack-cli": "^6.0.1",
37
45
  "webpack-node-externals": "^3.0.0"
package/rollup.config.js CHANGED
@@ -4,10 +4,11 @@ import commonjs from '@rollup/plugin-commonjs';
4
4
  import json from '@rollup/plugin-json';
5
5
  import outputHash from 'rollup-plugin-output';
6
6
  import { terser } from 'rollup-plugin-terser';
7
+ import typescript from "@rollup/plugin-typescript";
7
8
  // import polyfillNode from 'rollup-plugin-polyfill-node';
8
9
 
9
10
  export default defineConfig({
10
- input: 'src/index.js',
11
+ input: 'src/index.ts',
11
12
  output: [
12
13
  {
13
14
  dir: 'dist',
@@ -35,20 +36,20 @@ export default defineConfig({
35
36
  dir: 'dist',
36
37
  entryFileNames: `index.esm.js`,
37
38
  format: 'esm',
38
- sourcemap: false,
39
+ sourcemap: true,
39
40
  },
40
41
  {
41
42
  dir: 'dist',
42
43
  entryFileNames: `index.cjs.js`,
43
44
  format: 'cjs',
44
- sourcemap: false,
45
+ sourcemap: true,
45
46
  },
46
47
  {
47
48
  dir: 'dist',
48
49
  entryFileNames: `index.umd.js`,
49
50
  format: 'umd',
50
51
  name: 'CimulateCopilot',
51
- sourcemap: false,
52
+ sourcemap: true,
52
53
  globals: {
53
54
  'socket.io-client': 'io',
54
55
  },
@@ -59,9 +60,10 @@ export default defineConfig({
59
60
  commonjs(),
60
61
  json(),
61
62
  terser(),
63
+ typescript({ tsconfig: "./tsconfig.json" }),
62
64
  outputHash({
63
65
  hashLength: 8,
64
- include: ['**/*.js'],
66
+ include: ['**/*.ts'],
65
67
  }),
66
68
  ],
67
69
  external: ['socket.io-client'],
package/src/copilot.ts ADDED
@@ -0,0 +1,154 @@
1
+ import io, { ManagerOptions, Socket, SocketOptions } from "socket.io-client";
2
+ import { merge } from "ts-deepmerge";
3
+
4
+ import type * as Event from "./model/index"
5
+
6
+ type SocketIOOptions = Partial<ManagerOptions & SocketOptions>;
7
+
8
+ interface CimulateCopilotOptions {
9
+ apiKey: string;
10
+ baseUrl: string;
11
+ namespace?: string;
12
+ socketOptions?: Omit<SocketIOOptions, "withCredentials">;
13
+ }
14
+
15
+ interface SearchParams {
16
+ query: string;
17
+ facet_filters?: Record<string, string[]>;
18
+ page_size?: bigint;
19
+ page?: bigint;
20
+ }
21
+
22
+ const socketDefaults: SocketIOOptions = {
23
+ path: "/api/v1/socket.io",
24
+ autoConnect: false,
25
+ transports: ["polling", "websocket"],
26
+ upgrade: true,
27
+ timeout: 10000,
28
+ };
29
+
30
+ class CimulateCopilot {
31
+ private socket: Socket;
32
+
33
+ constructor({
34
+ apiKey,
35
+ baseUrl,
36
+ namespace = "/copilot",
37
+ socketOptions = {},
38
+ }: CimulateCopilotOptions) {
39
+ const socketioEndpoint = `${baseUrl}${namespace}`;
40
+
41
+ this.socket = io(
42
+ socketioEndpoint,
43
+ merge(socketDefaults, socketOptions, {
44
+ withCredentials: true, // enables cookies
45
+ transportOptions: {
46
+ polling: {
47
+ extraHeaders: {
48
+ "x-cimulate-api-key": apiKey,
49
+ },
50
+ },
51
+ },
52
+ })
53
+ );
54
+ }
55
+
56
+ connect() {
57
+ this.socket.connect();
58
+ }
59
+
60
+ search(
61
+ { userPrompt, searchParams }: { userPrompt: string; searchParams: SearchParams },
62
+ callback?: (searchAck: Event.EventAck) => void
63
+ ) {
64
+ const payload = {
65
+ user_prompt: userPrompt,
66
+ search_params: searchParams,
67
+ };
68
+ if (callback) {
69
+ this.socket.emit("copilot_search", payload, callback);
70
+ return;
71
+ }
72
+ this.socket.emit("copilot_search", payload);
73
+ }
74
+
75
+ facetedNavigation(
76
+ { searchParams }: { searchParams: SearchParams },
77
+ callback?: (facetedNavigation: Event.FacetedNavigation) => void
78
+ ) {
79
+ const payload = {
80
+ search_params: searchParams,
81
+ };
82
+ if (callback) {
83
+ this.socket.emit("faceted_navigation", payload, callback);
84
+ return;
85
+ }
86
+ this.socket.emit("faceted_navigation", payload);
87
+ }
88
+
89
+ cancelRequest(
90
+ { eventId, reason }: { eventId: string; reason: string },
91
+ callback?: (cancelAck: Event.EventAck) => void
92
+ ) {
93
+ const payload = {
94
+ event_id: eventId,
95
+ reason,
96
+ };
97
+ if (callback) {
98
+ this.socket.emit("cancel", payload, callback);
99
+ return;
100
+ }
101
+ this.socket.emit("cancel", payload);
102
+ }
103
+
104
+ requestSessionData(callback: (sessionData: Event.SessionData) => void) {
105
+ this.socket.emit("session_info", callback);
106
+ }
107
+
108
+ onConnectAck(callback: (connectAck: Event.ConnectAck) => void) {
109
+ this.socket.on("connect_ack", callback);
110
+ }
111
+
112
+ onSearchAck(callback: (searchAck: Event.EventAck) => void) {
113
+ this.socket.on("search_ack", callback);
114
+ }
115
+
116
+ onRefinedSearch(callback: (refinedSearch: Event.RefinedSearch) => void) {
117
+ this.socket.on("refined_search", callback);
118
+ }
119
+
120
+ onFollowUp(callback: (followUp: Event.FollowUp) => void) {
121
+ this.socket.on("follow_up", callback);
122
+ }
123
+
124
+ onInquiry(callback: (inquiry: Event.Inquiry) => void) {
125
+ this.socket.on("inquiry", callback);
126
+ }
127
+
128
+ onPartialInquiry(callback: (partialInquiry: Event.PartialInquiry) => void) {
129
+ this.socket.on("partial_inquiry", callback);
130
+ }
131
+
132
+ onDisplayProducts(callback: (displayProducts: Event.DisplayProducts) => void) {
133
+ this.socket.on("display_products", callback);
134
+ }
135
+
136
+ onDone(callback: (done: Event.Done) => void) {
137
+ this.socket.on("done", callback);
138
+ }
139
+
140
+ onError(callback: (error: Event.Error) => void) {
141
+ this.socket.on("error", callback);
142
+ }
143
+
144
+ disconnect() {
145
+ this.socket.disconnect();
146
+ }
147
+
148
+ onDisconnect(callback: (reason: string) => void) {
149
+ this.socket.on("disconnect", callback);
150
+ }
151
+
152
+ }
153
+
154
+ export default CimulateCopilot;
package/src/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ import CimulateCopilot from './copilot';
2
+ export { CimulateCopilot };
@@ -0,0 +1,6 @@
1
+
2
+ interface Cancel {
3
+ eventId: string;
4
+ reason?: string;
5
+ }
6
+ export { Cancel };
@@ -0,0 +1,6 @@
1
+
2
+ interface CommonEventFields {
3
+ eventSourceId: string;
4
+ message: string;
5
+ }
6
+ export { CommonEventFields };
@@ -0,0 +1,10 @@
1
+
2
+ interface CommonFields {
3
+ sessionId: string;
4
+ eventId: string;
5
+ eventName: string;
6
+ timestamp: string;
7
+ eventSourceId: string;
8
+ message: string;
9
+ }
10
+ export { CommonFields };
@@ -0,0 +1,8 @@
1
+
2
+ interface CommonRequiredFields {
3
+ sessionId: string;
4
+ eventId: string;
5
+ eventName: string;
6
+ timestamp: string;
7
+ }
8
+ export { CommonRequiredFields };
@@ -0,0 +1,11 @@
1
+ import {ConnectAckMetadata} from './ConnectAckMetadata';
2
+ interface ConnectAck {
3
+ sessionId: string;
4
+ eventId: string;
5
+ eventName: string;
6
+ timestamp: string;
7
+ reservedStatus: number;
8
+ message: string;
9
+ metadata: ConnectAckMetadata;
10
+ }
11
+ export { ConnectAck };
@@ -0,0 +1,6 @@
1
+
2
+ interface ConnectAckMetadata {
3
+ version: string;
4
+ server: string;
5
+ }
6
+ export { ConnectAckMetadata };
@@ -0,0 +1,7 @@
1
+ import {ConnectAckMetadata} from './ConnectAckMetadata';
2
+ interface ConnectionAcknowledgmentMessageFields {
3
+ reservedStatus: number;
4
+ message: string;
5
+ metadata: ConnectAckMetadata;
6
+ }
7
+ export { ConnectionAcknowledgmentMessageFields };
@@ -0,0 +1,6 @@
1
+ import {SearchParameters} from './SearchParameters';
2
+ interface CopilotSearch {
3
+ searchParams: SearchParameters;
4
+ userPrompt?: string;
5
+ }
6
+ export { CopilotSearch };
@@ -0,0 +1,11 @@
1
+
2
+ interface DisplayProducts {
3
+ sessionId: string;
4
+ eventId: string;
5
+ eventName: string;
6
+ timestamp: string;
7
+ eventSourceId: string;
8
+ message: string;
9
+ products: Map<string, any>[];
10
+ }
11
+ export { DisplayProducts };
@@ -0,0 +1,5 @@
1
+
2
+ interface DisplayProductsMessageFields {
3
+ products: Map<string, any>[];
4
+ }
5
+ export { DisplayProductsMessageFields };
@@ -0,0 +1,10 @@
1
+
2
+ interface Done {
3
+ sessionId: string;
4
+ eventId: string;
5
+ eventName: string;
6
+ timestamp: string;
7
+ eventSourceId: string;
8
+ message: string;
9
+ }
10
+ export { Done };
@@ -0,0 +1,12 @@
1
+
2
+ interface Error {
3
+ sessionId: string;
4
+ eventId: string;
5
+ eventName: string;
6
+ timestamp: string;
7
+ eventSourceId: string;
8
+ message: string;
9
+ reservedStatus: number;
10
+ error: string;
11
+ }
12
+ export { Error };
@@ -0,0 +1,6 @@
1
+
2
+ interface ErrorMessageFields {
3
+ reservedStatus: number;
4
+ error: string;
5
+ }
6
+ export { ErrorMessageFields };
@@ -0,0 +1,12 @@
1
+ import {CopilotSearch} from './CopilotSearch';
2
+ interface EventAck {
3
+ sessionId: string;
4
+ eventId: string;
5
+ eventName: string;
6
+ timestamp: string;
7
+ eventSourceId: string;
8
+ message: string;
9
+ reservedStatus: string;
10
+ request: CopilotSearch;
11
+ }
12
+ export { EventAck };
@@ -0,0 +1,6 @@
1
+ import {CopilotSearch} from './CopilotSearch';
2
+ interface EventAcknowledgmentMessageFields {
3
+ reservedStatus: string;
4
+ request: CopilotSearch;
5
+ }
6
+ export { EventAcknowledgmentMessageFields };
@@ -0,0 +1,7 @@
1
+ import {FacetValue} from './FacetValue';
2
+ interface Facet {
3
+ field?: string;
4
+ label?: string;
5
+ values?: FacetValue[];
6
+ }
7
+ export { Facet };
@@ -0,0 +1,6 @@
1
+
2
+ interface FacetValue {
3
+ reservedName?: string;
4
+ count?: number;
5
+ }
6
+ export { FacetValue };
@@ -0,0 +1,5 @@
1
+ import {SearchParameters} from './SearchParameters';
2
+ interface FacetedNavigation {
3
+ searchParams: SearchParameters;
4
+ }
5
+ export { FacetedNavigation };
@@ -0,0 +1,5 @@
1
+ import {Suggestion} from './Suggestion';
2
+ interface FollowMinusUpMessageFields {
3
+ suggestions: Suggestion[];
4
+ }
5
+ export { FollowMinusUpMessageFields };
@@ -0,0 +1,11 @@
1
+ import {Suggestion} from './Suggestion';
2
+ interface FollowUp {
3
+ sessionId: string;
4
+ eventId: string;
5
+ eventName: string;
6
+ timestamp: string;
7
+ eventSourceId: string;
8
+ message: string;
9
+ suggestions: Suggestion[];
10
+ }
11
+ export { FollowUp };
@@ -0,0 +1,10 @@
1
+
2
+ interface Inquiry {
3
+ sessionId: string;
4
+ eventId: string;
5
+ eventName: string;
6
+ timestamp: string;
7
+ eventSourceId: string;
8
+ message: string;
9
+ }
10
+ export { Inquiry };
@@ -0,0 +1,12 @@
1
+
2
+ interface PartialInquiry {
3
+ sessionId: string;
4
+ eventId: string;
5
+ eventName: string;
6
+ timestamp: string;
7
+ eventSourceId: string;
8
+ message: string;
9
+ inquiryEventId: string;
10
+ index: number;
11
+ }
12
+ export { PartialInquiry };
@@ -0,0 +1,6 @@
1
+
2
+ interface PartialInquiryMessageFields {
3
+ inquiryEventId: string;
4
+ index: number;
5
+ }
6
+ export { PartialInquiryMessageFields };
@@ -0,0 +1,15 @@
1
+ import {SearchParameters} from './SearchParameters';
2
+ import {Facet} from './Facet';
3
+ interface RefinedSearch {
4
+ sessionId: string;
5
+ eventId: string;
6
+ eventName: string;
7
+ timestamp: string;
8
+ eventSourceId: string;
9
+ message: string;
10
+ searchParams: SearchParameters;
11
+ hits?: Map<string, any>[];
12
+ totalHits?: number;
13
+ facets?: Facet[];
14
+ }
15
+ export { RefinedSearch };
@@ -0,0 +1,9 @@
1
+ import {SearchParameters} from './SearchParameters';
2
+ import {Facet} from './Facet';
3
+ interface RefinedSearchMessageFields {
4
+ searchParams: SearchParameters;
5
+ hits?: Map<string, any>[];
6
+ totalHits?: number;
7
+ facets?: Facet[];
8
+ }
9
+ export { RefinedSearchMessageFields };
@@ -0,0 +1,11 @@
1
+
2
+ interface ReservedEvent {
3
+ id?: string;
4
+ sessionId?: string;
5
+ reservedName?: string;
6
+ eventSourceId?: string;
7
+ data?: any;
8
+ createdAt?: string;
9
+ metadata?: Map<string, any>;
10
+ }
11
+ export { ReservedEvent };