@epam/ai-dial-overlay 0.31.0-rc.4 → 0.31.0-rc.41
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 +9 -0
- package/index.esm.js +77 -0
- package/package.json +2 -2
- package/src/lib/ChatOverlay.d.ts +25 -1
- package/src/lib/ChatOverlayManager.d.ts +4 -0
package/README.md
CHANGED
|
@@ -67,6 +67,15 @@ const run = async () => {
|
|
|
67
67
|
overlayConversationId: 'some-conversation-id',
|
|
68
68
|
// optional, if DIAL should redirect to sign in the same browser window
|
|
69
69
|
signInInSameWindow: false,
|
|
70
|
+
// optional, auto-sign in options
|
|
71
|
+
signInOptions: {
|
|
72
|
+
// optional, If the DIAL should automatically sign in without user interaction (provided there is an active provider session)
|
|
73
|
+
autoSignIn: true,
|
|
74
|
+
//provider which will be used for the sign in
|
|
75
|
+
signInProvider: 'provider_name',
|
|
76
|
+
//optional, should be true if provider page couldn't be open in iframe and hostDomain and DIAL have different providers or application id within one provider
|
|
77
|
+
signInInNewWindow: true,
|
|
78
|
+
},
|
|
70
79
|
});
|
|
71
80
|
|
|
72
81
|
// overlay loaded application and ready to send and receive information from the application
|
package/index.esm.js
CHANGED
|
@@ -289,6 +289,59 @@ class ChatOverlay {
|
|
|
289
289
|
return this.send(OverlayRequests.selectConversation, request);
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
|
+
/**
|
|
293
|
+
* Delete conversation
|
|
294
|
+
* @param {string} id - id of conversation to delete
|
|
295
|
+
*/
|
|
296
|
+
deleteConversation(id) {
|
|
297
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
298
|
+
const request = {
|
|
299
|
+
id,
|
|
300
|
+
};
|
|
301
|
+
return this.send(OverlayRequests.deleteConversation, request);
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Rename conversation
|
|
306
|
+
* @param {string} id - id of conversation to rename
|
|
307
|
+
* @param {string} newName - new name of conversation
|
|
308
|
+
* @returns Returns renamed conversation info
|
|
309
|
+
*/
|
|
310
|
+
renameConversation(id, newName) {
|
|
311
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
312
|
+
const request = {
|
|
313
|
+
id,
|
|
314
|
+
newName,
|
|
315
|
+
};
|
|
316
|
+
return this.send(OverlayRequests.renameConversation, request);
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Create playback conversation
|
|
321
|
+
* @param {string} id - id of conversation from create playback
|
|
322
|
+
* @returns Returns newly created playback conversation info
|
|
323
|
+
*/
|
|
324
|
+
createPlaybackConversation(id) {
|
|
325
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
326
|
+
const request = {
|
|
327
|
+
id,
|
|
328
|
+
};
|
|
329
|
+
return this.send(OverlayRequests.createPlaybackConversation, request);
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Export conversation
|
|
334
|
+
* @param {string} id - id of conversation to export
|
|
335
|
+
* @returns Returns export conversation info
|
|
336
|
+
*/
|
|
337
|
+
exportConversation(id) {
|
|
338
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
339
|
+
const request = {
|
|
340
|
+
id,
|
|
341
|
+
};
|
|
342
|
+
return this.send(OverlayRequests.exportConversation, request);
|
|
343
|
+
});
|
|
344
|
+
}
|
|
292
345
|
/**
|
|
293
346
|
* Create conversation
|
|
294
347
|
* @param {string} parentPath - path to create conversation in. If not defined or null conversation will be created in user Root
|
|
@@ -668,12 +721,36 @@ class ChatOverlayManager {
|
|
|
668
721
|
return overlay.selectConversation(conversationId);
|
|
669
722
|
});
|
|
670
723
|
}
|
|
724
|
+
renameConversation(id, conversationId, newName) {
|
|
725
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
726
|
+
const { overlay } = this.getOverlay(id);
|
|
727
|
+
return overlay.renameConversation(conversationId, newName);
|
|
728
|
+
});
|
|
729
|
+
}
|
|
671
730
|
setOverlayOptions(id, options) {
|
|
672
731
|
return __awaiter(this, void 0, void 0, function* () {
|
|
673
732
|
const { overlay } = this.getOverlay(id);
|
|
674
733
|
return overlay.setOverlayOptions(options);
|
|
675
734
|
});
|
|
676
735
|
}
|
|
736
|
+
deleteConversation(id, conversationId) {
|
|
737
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
738
|
+
const { overlay } = this.getOverlay(id);
|
|
739
|
+
return overlay.deleteConversation(conversationId);
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
replayConversation(id, conversationId) {
|
|
743
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
744
|
+
const { overlay } = this.getOverlay(id);
|
|
745
|
+
return overlay.createPlaybackConversation(conversationId);
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
exportConversation(id, conversationId) {
|
|
749
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
750
|
+
const { overlay } = this.getOverlay(id);
|
|
751
|
+
return overlay.exportConversation(conversationId);
|
|
752
|
+
});
|
|
753
|
+
}
|
|
677
754
|
subscribe(id, eventType, callback) {
|
|
678
755
|
const { overlay } = this.getOverlay(id);
|
|
679
756
|
return overlay.subscribe(eventType, callback);
|
package/package.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@epam/ai-dial-overlay",
|
|
3
3
|
"description": "Package for opening dial in overlay",
|
|
4
4
|
"homepage": "https://epam-rail.com",
|
|
5
|
-
"version": "0.31.0-rc.
|
|
5
|
+
"version": "0.31.0-rc.41",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@epam/ai-dial-shared": "0.31.0-rc.
|
|
7
|
+
"@epam/ai-dial-shared": "0.31.0-rc.41"
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"bugs": {
|
package/src/lib/ChatOverlay.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChatOverlayOptions, CreateConversationResponse, DeferredRequest, GetConversationsResponse, GetMessagesResponse, OverlayRequest, OverlayRequests, SelectConversationResponse, SendMessageResponse, SetSystemPromptResponse, Styles, Task } from '@epam/ai-dial-shared';
|
|
1
|
+
import { ChatOverlayOptions, CreateConversationResponse, CreatePlaybackConversationResponse, DeferredRequest, ExportConversationResponse, GetConversationsResponse, GetMessagesResponse, OverlayRequest, OverlayRequests, RenameConversationResponse, SelectConversationResponse, SendMessageResponse, SetSystemPromptResponse, Styles, Task } from '@epam/ai-dial-shared';
|
|
2
2
|
interface Subscription {
|
|
3
3
|
eventType: string;
|
|
4
4
|
callback: (payload: unknown) => void;
|
|
@@ -100,6 +100,30 @@ export declare class ChatOverlay {
|
|
|
100
100
|
* @returns Returns selected conversation info
|
|
101
101
|
*/
|
|
102
102
|
selectConversation(id: string): Promise<SelectConversationResponse>;
|
|
103
|
+
/**
|
|
104
|
+
* Delete conversation
|
|
105
|
+
* @param {string} id - id of conversation to delete
|
|
106
|
+
*/
|
|
107
|
+
deleteConversation(id: string): Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Rename conversation
|
|
110
|
+
* @param {string} id - id of conversation to rename
|
|
111
|
+
* @param {string} newName - new name of conversation
|
|
112
|
+
* @returns Returns renamed conversation info
|
|
113
|
+
*/
|
|
114
|
+
renameConversation(id: string, newName: string): Promise<RenameConversationResponse>;
|
|
115
|
+
/**
|
|
116
|
+
* Create playback conversation
|
|
117
|
+
* @param {string} id - id of conversation from create playback
|
|
118
|
+
* @returns Returns newly created playback conversation info
|
|
119
|
+
*/
|
|
120
|
+
createPlaybackConversation(id: string): Promise<CreatePlaybackConversationResponse>;
|
|
121
|
+
/**
|
|
122
|
+
* Export conversation
|
|
123
|
+
* @param {string} id - id of conversation to export
|
|
124
|
+
* @returns Returns export conversation info
|
|
125
|
+
*/
|
|
126
|
+
exportConversation(id: string): Promise<ExportConversationResponse>;
|
|
103
127
|
/**
|
|
104
128
|
* Create conversation
|
|
105
129
|
* @param {string} parentPath - path to create conversation in. If not defined or null conversation will be created in user Root
|
|
@@ -89,7 +89,11 @@ export declare class ChatOverlayManager {
|
|
|
89
89
|
getConversations(id: string): Promise<import("@epam/ai-dial-shared").GetConversationsResponse>;
|
|
90
90
|
createConversation(id: string, parentPath?: string | null): Promise<import("@epam/ai-dial-shared").CreateConversationResponse>;
|
|
91
91
|
selectConversation(id: string, conversationId: string): Promise<import("@epam/ai-dial-shared").SelectConversationResponse>;
|
|
92
|
+
renameConversation(id: string, conversationId: string, newName: string): Promise<import("@epam/ai-dial-shared").RenameConversationResponse>;
|
|
92
93
|
setOverlayOptions(id: string, options: ChatOverlayOptions): Promise<void>;
|
|
94
|
+
deleteConversation(id: string, conversationId: string): Promise<void>;
|
|
95
|
+
replayConversation(id: string, conversationId: string): Promise<import("@epam/ai-dial-shared").CreatePlaybackConversationResponse>;
|
|
96
|
+
exportConversation(id: string, conversationId: string): Promise<import("@epam/ai-dial-shared").ExportConversationResponse>;
|
|
93
97
|
subscribe(id: string, eventType: string, callback: (payload?: unknown) => void): () => void;
|
|
94
98
|
/**
|
|
95
99
|
* Get reference to overlay from this.overlay with specified id
|