@cimulate/copilot-sdk 3.8.0 → 3.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.
- package/dist/{bundle.cimulate.copilot-sdk.4785f073.umd.js → bundle.cimulate.copilot-sdk.3dd9816e.umd.js} +2 -2
- package/dist/{bundle.cimulate.copilot-sdk.beae54c9.cjs.js.map → bundle.cimulate.copilot-sdk.3dd9816e.umd.js.map} +1 -1
- package/dist/{bundle.cimulate.copilot-sdk.270124b4.esm.js → bundle.cimulate.copilot-sdk.6b5f7916.esm.js} +2 -2
- package/dist/{bundle.cimulate.copilot-sdk.270124b4.esm.js.map → bundle.cimulate.copilot-sdk.6b5f7916.esm.js.map} +1 -1
- package/dist/{bundle.cimulate.copilot-sdk.beae54c9.cjs.js → bundle.cimulate.copilot-sdk.d76caf1d.cjs.js} +2 -2
- package/dist/{bundle.cimulate.copilot-sdk.4785f073.umd.js.map → bundle.cimulate.copilot-sdk.d76caf1d.cjs.js.map} +1 -1
- 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 +4 -1
- package/dist/types/model/ConversationEvents.d.ts +8 -0
- package/dist/types/model/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/copilot.ts +23 -0
- package/src/model/ConversationEvents.ts +9 -0
- package/src/model/index.ts +1 -0
|
@@ -7,6 +7,7 @@ export * from './CommonRequiredFields';
|
|
|
7
7
|
export * from './ConnectAck';
|
|
8
8
|
export * from './ConnectAckMetadata';
|
|
9
9
|
export * from './ConnectError';
|
|
10
|
+
export * from './ConversationEvents';
|
|
10
11
|
export * from './ConversationReset';
|
|
11
12
|
export * from './ConversationResetAck';
|
|
12
13
|
export * from './CopilotApiAck';
|
package/package.json
CHANGED
package/src/copilot.ts
CHANGED
|
@@ -9,7 +9,9 @@ import type {
|
|
|
9
9
|
CopilotBrowse,
|
|
10
10
|
CopilotBrowseAck,
|
|
11
11
|
ConnectError,
|
|
12
|
+
ConversationEvents,
|
|
12
13
|
CopilotAPIEvent,
|
|
14
|
+
CopilotEvent,
|
|
13
15
|
CopilotEventName,
|
|
14
16
|
CopilotSearch,
|
|
15
17
|
CopilotSearchAck,
|
|
@@ -38,6 +40,7 @@ interface CommonOptions {
|
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
type CimulateCopilotOptions = (ApiKeyAuth | ApiTokenAuth) & CommonOptions;
|
|
43
|
+
type CopilotEvents = CopilotEvent[]
|
|
41
44
|
|
|
42
45
|
const socketDefaults: SocketIOOptions = {
|
|
43
46
|
path: "/api/v1/socket.io",
|
|
@@ -328,6 +331,26 @@ export default class CimulateCopilot<
|
|
|
328
331
|
});
|
|
329
332
|
}
|
|
330
333
|
|
|
334
|
+
async getConversationEvents(
|
|
335
|
+
args: ConversationEvents
|
|
336
|
+
): Promise<CopilotEvents>;
|
|
337
|
+
async getConversationEvents(
|
|
338
|
+
args: ConversationEvents,
|
|
339
|
+
callback?: (events: CopilotEvents) => void
|
|
340
|
+
): Promise<void>;
|
|
341
|
+
async getConversationEvents(
|
|
342
|
+
args: ConversationEvents,
|
|
343
|
+
callback?: (events: CopilotEvents) => void
|
|
344
|
+
): Promise<CopilotEvents | void> {
|
|
345
|
+
return new Promise((resolve) => {
|
|
346
|
+
this.socket.emit("conversation_events", args, (response: CopilotEvents) => {
|
|
347
|
+
if (callback) callback(response);
|
|
348
|
+
// TODO - error handling
|
|
349
|
+
resolve(response as CopilotEvents);
|
|
350
|
+
});
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
|
|
331
354
|
on<E extends CopilotEventName>(
|
|
332
355
|
name: E,
|
|
333
356
|
handler: (event: Extract<CopilotAPIEvent<T>, { name: E }>) => void
|
package/src/model/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './CommonRequiredFields';
|
|
|
7
7
|
export * from './ConnectAck';
|
|
8
8
|
export * from './ConnectAckMetadata';
|
|
9
9
|
export * from './ConnectError';
|
|
10
|
+
export * from './ConversationEvents';
|
|
10
11
|
export * from './ConversationReset';
|
|
11
12
|
export * from './ConversationResetAck';
|
|
12
13
|
export * from './CopilotApiAck';
|