@sinequa/assistant 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/chat/charts/chart/chart.component.d.ts +13 -13
- package/chat/chat-message/chat-message.component.d.ts +85 -81
- package/chat/chat-message/i18n/en.json +11 -0
- package/chat/chat-message/i18n/fr.json +11 -0
- package/chat/chat-reference/chat-reference.component.d.ts +14 -14
- package/chat/chat-reference/i18n/en.json +4 -0
- package/chat/chat-reference/i18n/fr.json +4 -0
- package/chat/chat-settings-v3/chat-settings-v3.component.d.ts +48 -50
- package/chat/chat-settings-v3/i18n/en.json +14 -0
- package/chat/chat-settings-v3/i18n/fr.json +14 -0
- package/chat/chat.component.d.ts +388 -1405
- package/chat/chat.service.d.ts +247 -228
- package/chat/debug-message/debug-message.component.d.ts +17 -17
- package/chat/debug-message/i18n/en.json +3 -0
- package/chat/debug-message/i18n/fr.json +3 -0
- package/chat/dialogs/delete-saved-chat.component.d.ts +22 -0
- package/chat/dialogs/i18n/en.json +19 -0
- package/chat/dialogs/i18n/fr.json +19 -0
- package/chat/dialogs/rename-saved-chat.component.d.ts +21 -0
- package/chat/dialogs/updates.component.d.ts +15 -0
- package/chat/documents-upload/document-list/document-list.component.d.ts +68 -77
- package/chat/documents-upload/document-overview/document-overview.component.d.ts +31 -41
- package/chat/documents-upload/document-upload/document-upload.component.d.ts +96 -98
- package/chat/documents-upload/documents-upload.model.d.ts +66 -66
- package/chat/documents-upload/documents-upload.service.d.ts +170 -174
- package/chat/documents-upload/i18n/en.json +24 -0
- package/chat/documents-upload/i18n/fr.json +24 -0
- package/chat/format-icon/format-icon.component.d.ts +10 -10
- package/chat/format-icon/icons.d.ts +5 -5
- package/chat/i18n/en.json +42 -0
- package/chat/i18n/fr.json +42 -0
- package/chat/index.d.ts +5 -5
- package/chat/initials-avatar/initials-avatar.component.d.ts +35 -35
- package/chat/instance-manager.service.d.ts +28 -28
- package/chat/pipes/message-content.pipe.d.ts +16 -0
- package/chat/prompt.component.d.ts +25 -21
- package/chat/public-api.d.ts +17 -17
- package/chat/references/i18n/en.json +6 -0
- package/chat/references/i18n/fr.json +6 -0
- package/chat/references/inline-image-reference.d.ts +21 -0
- package/chat/references/inline-page-reference.d.ts +21 -0
- package/chat/rest-chat.service.d.ts +31 -33
- package/chat/saved-chats/i18n/en.json +4 -0
- package/chat/saved-chats/i18n/fr.json +4 -0
- package/chat/saved-chats/saved-chats.component.d.ts +30 -36
- package/chat/services/app.service.d.ts +8 -0
- package/chat/services/dialog.service.d.ts +12 -0
- package/chat/services/notification.service.d.ts +10 -0
- package/chat/services/principal.service.d.ts +7 -0
- package/chat/services/search.service.d.ts +7 -0
- package/chat/services/signalR.web.service.d.ts +45 -0
- package/chat/services/ui.service.d.ts +13 -0
- package/chat/services/user-settings.service.d.ts +7 -0
- package/chat/token-progress-bar/i18n/en.json +4 -0
- package/chat/token-progress-bar/i18n/fr.json +4 -0
- package/chat/token-progress-bar/token-progress-bar.component.d.ts +24 -27
- package/chat/tooltip/tooltip.component.d.ts +12 -0
- package/chat/tooltip/tooltip.directive.d.ts +81 -0
- package/chat/types/message-content.types.d.ts +54 -0
- package/chat/types/message-reference.types.d.ts +11 -0
- package/chat/types.d.ts +913 -873
- package/chat/unified-plugins/embedded-image-reference.plugin.d.ts +3 -0
- package/chat/unified-plugins/embedded-page-reference.plugin.d.ts +3 -0
- package/chat/utils/assistant-json.d.ts +2 -0
- package/chat/websocket-chat.service.d.ts +102 -103
- package/esm2022/chat/charts/chart/chart.component.mjs +40 -0
- package/esm2022/chat/chat-message/chat-message.component.mjs +351 -0
- package/esm2022/chat/chat-reference/chat-reference.component.mjs +40 -0
- package/esm2022/chat/chat-settings-v3/chat-settings-v3.component.mjs +118 -0
- package/esm2022/chat/chat.component.mjs +1090 -0
- package/esm2022/chat/chat.service.mjs +417 -0
- package/esm2022/chat/debug-message/debug-message.component.mjs +43 -0
- package/esm2022/chat/dialogs/delete-saved-chat.component.mjs +81 -0
- package/esm2022/chat/dialogs/rename-saved-chat.component.mjs +84 -0
- package/esm2022/chat/dialogs/updates.component.mjs +61 -0
- package/esm2022/chat/documents-upload/document-list/document-list.component.mjs +140 -0
- package/esm2022/chat/documents-upload/document-overview/document-overview.component.mjs +65 -0
- package/esm2022/chat/documents-upload/document-upload/document-upload.component.mjs +256 -0
- package/{esm2020 → esm2022}/chat/documents-upload/documents-upload.model.mjs +1 -1
- package/esm2022/chat/documents-upload/documents-upload.service.mjs +291 -0
- package/{esm2020 → esm2022}/chat/format-icon/format-icon.component.mjs +23 -23
- package/{esm2020 → esm2022}/chat/format-icon/icons.mjs +137 -137
- package/{esm2020 → esm2022}/chat/initials-avatar/initials-avatar.component.mjs +60 -60
- package/esm2022/chat/instance-manager.service.mjs +46 -0
- package/esm2022/chat/pipes/message-content.pipe.mjs +34 -0
- package/esm2022/chat/prompt.component.mjs +88 -0
- package/{esm2020 → esm2022}/chat/public-api.mjs +18 -18
- package/esm2022/chat/references/inline-image-reference.mjs +110 -0
- package/esm2022/chat/references/inline-page-reference.mjs +110 -0
- package/esm2022/chat/rest-chat.service.mjs +296 -0
- package/esm2022/chat/saved-chats/saved-chats.component.mjs +82 -0
- package/esm2022/chat/services/app.service.mjs +19 -0
- package/esm2022/chat/services/dialog.service.mjs +40 -0
- package/esm2022/chat/services/notification.service.mjs +25 -0
- package/esm2022/chat/services/principal.service.mjs +16 -0
- package/esm2022/chat/services/search.service.mjs +13 -0
- package/esm2022/chat/services/signalR.web.service.mjs +79 -0
- package/esm2022/chat/services/ui.service.mjs +61 -0
- package/esm2022/chat/services/user-settings.service.mjs +22 -0
- package/{esm2020 → esm2022}/chat/sinequa-assistant-chat.mjs +4 -4
- package/esm2022/chat/token-progress-bar/token-progress-bar.component.mjs +52 -0
- package/esm2022/chat/tooltip/tooltip.component.mjs +44 -0
- package/esm2022/chat/tooltip/tooltip.directive.mjs +203 -0
- package/esm2022/chat/types/message-content.types.mjs +2 -0
- package/esm2022/chat/types/message-reference.types.mjs +2 -0
- package/esm2022/chat/types.mjs +130 -0
- package/esm2022/chat/unified-plugins/embedded-image-reference.plugin.mjs +57 -0
- package/esm2022/chat/unified-plugins/embedded-page-reference.plugin.mjs +57 -0
- package/esm2022/chat/utils/assistant-json.mjs +12 -0
- package/esm2022/chat/websocket-chat.service.mjs +654 -0
- package/{esm2020 → esm2022}/public-api.mjs +2 -2
- package/{esm2020 → esm2022}/sinequa-assistant.mjs +4 -4
- package/fesm2022/sinequa-assistant-chat.mjs +5340 -0
- package/fesm2022/sinequa-assistant-chat.mjs.map +1 -0
- package/{fesm2015 → fesm2022}/sinequa-assistant.mjs +3 -3
- package/index.d.ts +5 -5
- package/package.json +52 -25
- package/public-api.d.ts +1 -1
- package/chat/messages/de.d.ts +0 -4
- package/chat/messages/en.d.ts +0 -4
- package/chat/messages/fr.d.ts +0 -4
- package/chat/messages/index.d.ts +0 -4
- package/esm2020/chat/charts/chart/chart.component.mjs +0 -40
- package/esm2020/chat/chat-message/chat-message.component.mjs +0 -263
- package/esm2020/chat/chat-reference/chat-reference.component.mjs +0 -40
- package/esm2020/chat/chat-settings-v3/chat-settings-v3.component.mjs +0 -117
- package/esm2020/chat/chat.component.mjs +0 -1069
- package/esm2020/chat/chat.service.mjs +0 -333
- package/esm2020/chat/debug-message/debug-message.component.mjs +0 -43
- package/esm2020/chat/documents-upload/document-list/document-list.component.mjs +0 -191
- package/esm2020/chat/documents-upload/document-overview/document-overview.component.mjs +0 -80
- package/esm2020/chat/documents-upload/document-upload/document-upload.component.mjs +0 -258
- package/esm2020/chat/documents-upload/documents-upload.service.mjs +0 -289
- package/esm2020/chat/instance-manager.service.mjs +0 -46
- package/esm2020/chat/messages/de.mjs +0 -4
- package/esm2020/chat/messages/en.mjs +0 -4
- package/esm2020/chat/messages/fr.mjs +0 -4
- package/esm2020/chat/messages/index.mjs +0 -9
- package/esm2020/chat/prompt.component.mjs +0 -88
- package/esm2020/chat/rest-chat.service.mjs +0 -241
- package/esm2020/chat/saved-chats/saved-chats.component.mjs +0 -175
- package/esm2020/chat/token-progress-bar/token-progress-bar.component.mjs +0 -54
- package/esm2020/chat/types.mjs +0 -112
- package/esm2020/chat/websocket-chat.service.mjs +0 -641
- package/fesm2015/sinequa-assistant-chat.mjs +0 -4200
- package/fesm2015/sinequa-assistant-chat.mjs.map +0 -1
- package/fesm2020/sinequa-assistant-chat.mjs +0 -4171
- package/fesm2020/sinequa-assistant-chat.mjs.map +0 -1
- package/fesm2020/sinequa-assistant.mjs +0 -9
- package/fesm2020/sinequa-assistant.mjs.map +0 -1
- /package/{fesm2015 → fesm2022}/sinequa-assistant.mjs.map +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ElementRef } from "@angular/core";
|
|
2
|
+
import { Subscription } from "rxjs";
|
|
3
|
+
import { ChatService } from "../chat.service";
|
|
4
|
+
import { NotificationsService } from "../services/notification.service";
|
|
5
|
+
import { SavedChat } from "../types";
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export type SavedChatEdit = SavedChat & {
|
|
8
|
+
currentTitle: string;
|
|
9
|
+
};
|
|
10
|
+
export declare class DialogRenameSavedChatComponent {
|
|
11
|
+
renameDialog: import("@angular/core").Signal<ElementRef<HTMLDialogElement> | undefined>;
|
|
12
|
+
notificationsService: NotificationsService;
|
|
13
|
+
private readonly transloco;
|
|
14
|
+
chatService: import("@angular/core").InputSignal<ChatService>;
|
|
15
|
+
savedChat: import("@angular/core").WritableSignal<SavedChatEdit>;
|
|
16
|
+
subscription: Subscription;
|
|
17
|
+
showModal(event: Event, savedChat: SavedChat): void;
|
|
18
|
+
protected onRename(event: Event, savedChat: SavedChatEdit): void;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogRenameSavedChatComponent, never>;
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DialogRenameSavedChatComponent, "sq-dialog-rename-saved-chat", never, { "chatService": { "alias": "chatService"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ElementRef } from "@angular/core";
|
|
2
|
+
import { DialogEvent } from "../services/dialog.service";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class DialogUpdatesComponent {
|
|
5
|
+
protected dialogRef: import("@angular/core").Signal<ElementRef<any> | undefined>;
|
|
6
|
+
protected dialog: import("@angular/core").Signal<HTMLDialogElement>;
|
|
7
|
+
closed: import("@angular/core").OutputEmitterRef<DialogEvent>;
|
|
8
|
+
open(): void;
|
|
9
|
+
close(eventType?: DialogEvent): void;
|
|
10
|
+
seeNoMore(): void;
|
|
11
|
+
remindMeLater(): void;
|
|
12
|
+
update(): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogUpdatesComponent, never>;
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DialogUpdatesComponent, "sq-dialog-updates", never, {}, { "closed": "closed"; }, never, never, true, never>;
|
|
15
|
+
}
|
|
@@ -1,77 +1,68 @@
|
|
|
1
|
-
import { OnDestroy, OnInit } from "@angular/core";
|
|
2
|
-
import { BehaviorSubject } from "rxjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
private
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
* - Shows a success notification upon successful deletion.
|
|
70
|
-
* - Logs and notifies the user of any errors encountered during the deletion process.
|
|
71
|
-
*/
|
|
72
|
-
performDeleteAllDocuments(): void;
|
|
73
|
-
private _groupUploadedDocumentsByDate;
|
|
74
|
-
private _getTimeKey;
|
|
75
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentListComponent, never>;
|
|
76
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentListComponent, "sq-document-list", never, { "instanceId": "instanceId"; }, {}, never, never, true>;
|
|
77
|
-
}
|
|
1
|
+
import { OnDestroy, OnInit } from "@angular/core";
|
|
2
|
+
import { BehaviorSubject } from "rxjs";
|
|
3
|
+
import { InstanceManagerService } from "../../instance-manager.service";
|
|
4
|
+
import { ChatService } from "../../chat.service";
|
|
5
|
+
import { DocumentsUploadService } from "../documents-upload.service";
|
|
6
|
+
import { UploadedDocument } from "../documents-upload.model";
|
|
7
|
+
import { NotificationsService } from "../../services/notification.service";
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class DocumentListComponent implements OnInit, OnDestroy {
|
|
10
|
+
/** Define the key based on it, the appropriate chatService instance will be returned from instanceManagerService */
|
|
11
|
+
instanceId: string;
|
|
12
|
+
chatService: ChatService;
|
|
13
|
+
groupedUploadedDocuments$: BehaviorSubject<{
|
|
14
|
+
key: string;
|
|
15
|
+
value: UploadedDocument[];
|
|
16
|
+
}[]>;
|
|
17
|
+
documentToDelete?: UploadedDocument;
|
|
18
|
+
deletingAll: boolean;
|
|
19
|
+
private _subscription;
|
|
20
|
+
instanceManagerService: InstanceManagerService;
|
|
21
|
+
documentsUploadService: DocumentsUploadService;
|
|
22
|
+
notificationsService: NotificationsService;
|
|
23
|
+
private readonly transloco;
|
|
24
|
+
ngOnInit(): void;
|
|
25
|
+
ngOnDestroy(): void;
|
|
26
|
+
instantiateChatService(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Updates the list of uploaded documents by fetching the latest data from the service.
|
|
29
|
+
* The fetched documents are grouped by date.
|
|
30
|
+
*
|
|
31
|
+
* @returns {void}
|
|
32
|
+
*/
|
|
33
|
+
updateUploadedDocumentsList(): void;
|
|
34
|
+
deleteDocument(event: Event, doc: UploadedDocument): void;
|
|
35
|
+
/**
|
|
36
|
+
* Handles the deletion of an uploaded document. This method triggers a confirmation modal
|
|
37
|
+
* to ensure the user wants to proceed with the deletion. If confirmed, it sends a request
|
|
38
|
+
* to delete the document and provides feedback to the user upon success or failure.
|
|
39
|
+
*
|
|
40
|
+
* @param event - The event object associated with the delete action, used to stop propagation.
|
|
41
|
+
* @param doc - The document to be deleted, represented as an instance of `UploadedDocument`.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* - Displays a confirmation modal with a warning message.
|
|
45
|
+
* - On confirmation, deletes the document.
|
|
46
|
+
* - Shows a success notification upon successful deletion.
|
|
47
|
+
* - Logs and notifies the user of any errors encountered during the deletion process.
|
|
48
|
+
*/
|
|
49
|
+
performDeleteDocument(): void;
|
|
50
|
+
deleteAllDocuments(event?: Event): void;
|
|
51
|
+
/**
|
|
52
|
+
* Handles the deletion of all uploaded documents. This method triggers a confirmation modal
|
|
53
|
+
* to ensure the user wants to proceed with the deletion. If confirmed, it sends a request
|
|
54
|
+
* to delete the whole list of documents and provides feedback to the user upon success or failure.
|
|
55
|
+
*
|
|
56
|
+
* @param event - (Optional) The event object associated with the delete action, used to stop propagation.
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* - Displays a confirmation modal with a warning message.
|
|
60
|
+
* - On confirmation, deletes all documents.
|
|
61
|
+
* - Shows a success notification upon successful deletion.
|
|
62
|
+
* - Logs and notifies the user of any errors encountered during the deletion process.
|
|
63
|
+
*/
|
|
64
|
+
performDeleteAllDocuments(): void;
|
|
65
|
+
private _groupUploadedDocumentsByDate;
|
|
66
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentListComponent, never>;
|
|
67
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentListComponent, "sq-document-list", never, { "instanceId": { "alias": "instanceId"; "required": false; }; }, {}, never, never, true, never>;
|
|
68
|
+
}
|
|
@@ -1,41 +1,31 @@
|
|
|
1
|
-
import { EventEmitter, OnDestroy, OnInit } from "@angular/core";
|
|
2
|
-
import { BehaviorSubject } from "rxjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
instantiateChatService(): void;
|
|
33
|
-
/**
|
|
34
|
-
* Updates the list of uploaded documents by fetching the latest data from the service.
|
|
35
|
-
*
|
|
36
|
-
* @returns {void}
|
|
37
|
-
*/
|
|
38
|
-
updateUploadedDocumentsList(): void;
|
|
39
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentOverviewComponent, never>;
|
|
40
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentOverviewComponent, "sq-document-overview", never, { "instanceId": "instanceId"; "disabledUpload": "disabledUpload"; }, { "onUpload": "onUpload"; }, never, never, true>;
|
|
41
|
-
}
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit } from "@angular/core";
|
|
2
|
+
import { BehaviorSubject } from "rxjs";
|
|
3
|
+
import { InstanceManagerService } from "../../instance-manager.service";
|
|
4
|
+
import { ChatService } from "../../chat.service";
|
|
5
|
+
import { DocumentsUploadService } from "../documents-upload.service";
|
|
6
|
+
import { UploadedDocument } from "../documents-upload.model";
|
|
7
|
+
import { NotificationsService } from "../../services/notification.service";
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class DocumentOverviewComponent implements OnInit, OnDestroy {
|
|
10
|
+
/** Define the key based on it, the appropriate chatService instance will be returned from instanceManagerService */
|
|
11
|
+
instanceId: string;
|
|
12
|
+
disabledUpload: boolean;
|
|
13
|
+
onUpload: EventEmitter<any>;
|
|
14
|
+
chatService: ChatService;
|
|
15
|
+
uploadedDocuments$: BehaviorSubject<UploadedDocument[]>;
|
|
16
|
+
private _subscription;
|
|
17
|
+
instanceManagerService: InstanceManagerService;
|
|
18
|
+
documentsUploadService: DocumentsUploadService;
|
|
19
|
+
notificationsService: NotificationsService;
|
|
20
|
+
ngOnInit(): void;
|
|
21
|
+
ngOnDestroy(): void;
|
|
22
|
+
instantiateChatService(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Updates the list of uploaded documents by fetching the latest data from the service.
|
|
25
|
+
*
|
|
26
|
+
* @returns {void}
|
|
27
|
+
*/
|
|
28
|
+
updateUploadedDocumentsList(): void;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentOverviewComponent, never>;
|
|
30
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentOverviewComponent, "sq-document-overview", never, { "instanceId": { "alias": "instanceId"; "required": false; }; "disabledUpload": { "alias": "disabledUpload"; "required": false; }; }, { "onUpload": "onUpload"; }, never, never, true, never>;
|
|
31
|
+
}
|
|
@@ -1,98 +1,96 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
*
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* -
|
|
70
|
-
* -
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* @
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* -
|
|
82
|
-
* -
|
|
83
|
-
* -
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentUploadComponent, "sq-document-upload", never, { "instanceId": "instanceId"; "pollingInterval": "pollingInterval"; }, {}, never, never, true>;
|
|
98
|
-
}
|
|
1
|
+
import { OnDestroy, OnInit } from "@angular/core";
|
|
2
|
+
import { FlowDirective, Transfer } from "@flowjs/ngx-flow";
|
|
3
|
+
import { BehaviorSubject } from "rxjs";
|
|
4
|
+
import { InstanceManagerService } from "../../instance-manager.service";
|
|
5
|
+
import { ChatService } from "../../chat.service";
|
|
6
|
+
import { DocumentsUploadService } from "../documents-upload.service";
|
|
7
|
+
import { IndexingInfos, UploadingInfos } from "../documents-upload.model";
|
|
8
|
+
import { NotificationsService } from "../../services/notification.service";
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export declare class DocumentUploadComponent implements OnInit, OnDestroy {
|
|
11
|
+
/** Define the key based on it, the appropriate chatService instance will be returned from instanceManagerService */
|
|
12
|
+
instanceId: string;
|
|
13
|
+
/** Polling interval in milliseconds to update the indexing status of the uploaded documents */
|
|
14
|
+
pollingInterval: number;
|
|
15
|
+
flow: FlowDirective;
|
|
16
|
+
chatService: ChatService;
|
|
17
|
+
readonly flowConfig: flowjs.FlowOptions;
|
|
18
|
+
errorAlerts: string[];
|
|
19
|
+
dragging$: BehaviorSubject<boolean>;
|
|
20
|
+
indexing$: BehaviorSubject<boolean>;
|
|
21
|
+
indexingInfos$: BehaviorSubject<IndexingInfos | undefined>;
|
|
22
|
+
uploading$: BehaviorSubject<boolean>;
|
|
23
|
+
uploadingInfos$: BehaviorSubject<UploadingInfos | undefined>;
|
|
24
|
+
private _subscription;
|
|
25
|
+
instanceManagerService: InstanceManagerService;
|
|
26
|
+
documentsUploadService: DocumentsUploadService;
|
|
27
|
+
notificationsService: NotificationsService;
|
|
28
|
+
private readonly transloco;
|
|
29
|
+
ngOnInit(): void;
|
|
30
|
+
ngOnDestroy(): void;
|
|
31
|
+
instantiateChatService(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Handles the submission of files.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* This method performs the following checks on the submitted files:
|
|
37
|
+
*
|
|
38
|
+
* 1. Checks if the number of files submitted exceeds the remainingFileCount defined in the constraints.
|
|
39
|
+
* - If the number of files exceeds the allowed count, all files are removed from the flow.
|
|
40
|
+
* - An error message is added to the error alerts.
|
|
41
|
+
*
|
|
42
|
+
* 2. Checks if the total size of the files submitted exceeds the remainingFileSize defined in the constraints.
|
|
43
|
+
* - If the total size exceeds the allowed size, all files are removed from the flow.
|
|
44
|
+
* - An error message is added to the error alerts.
|
|
45
|
+
*
|
|
46
|
+
* 3. Checks if the file extension of the files submitted is not allowed.
|
|
47
|
+
* - If the file extension is not allowed, the file is removed from the flow.
|
|
48
|
+
* - An error message is added to the error alerts.
|
|
49
|
+
*/
|
|
50
|
+
private _onFilesSubmitted;
|
|
51
|
+
private _onFilesAdded;
|
|
52
|
+
onDragenter(): void;
|
|
53
|
+
onDragleave(event: DragEvent): void;
|
|
54
|
+
onDrop(): void;
|
|
55
|
+
trackTransfer(transfer: Transfer): string;
|
|
56
|
+
/**
|
|
57
|
+
* Initiates the upload process by invoking the `upload` method
|
|
58
|
+
* of the `flow` instance.
|
|
59
|
+
* The `upload` method is overridden in the `ngOnInit` method to match the requirements of the assistant API.
|
|
60
|
+
*/
|
|
61
|
+
upload(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Initiates the file upload process by preparing the form data,
|
|
64
|
+
* setting the uploading flag, and making an API call to upload the files.
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
* - Collects all files from the `flowJs` instance and appends them to a `FormData` object.
|
|
68
|
+
* - Subscribes to the upload process to handle progress updates, completion, and errors.
|
|
69
|
+
* - Triggers tracking the indexing process upon successful upload completion.
|
|
70
|
+
* - Cleans up the `flow` instance after the upload process is finalized.
|
|
71
|
+
*/
|
|
72
|
+
private startUpload;
|
|
73
|
+
/**
|
|
74
|
+
* Tracks the indexing process for a single documents upload session by polling the API for its status.
|
|
75
|
+
*
|
|
76
|
+
* @param token - A unique token representing the single documents upload session.
|
|
77
|
+
*
|
|
78
|
+
* @remarks
|
|
79
|
+
* - Clears the uploading flags and sets the indexing flag to true before starting the process.
|
|
80
|
+
* - Polls the API every (pollingInterval: default = 1 second) to retrieve the current indexing status.
|
|
81
|
+
* - Updates the `indexingInfos` property with the latest status.
|
|
82
|
+
* - Stops polling when the indexing process is completed or an error occurs.
|
|
83
|
+
* - Cleans up by resetting the indexing flags and clearing the `indexingInfos` property when the process is finalized.
|
|
84
|
+
*/
|
|
85
|
+
trackIndexingProcess(token: string): void;
|
|
86
|
+
/**
|
|
87
|
+
* Calculates the indexing progress as a percentage of completed documents.
|
|
88
|
+
*
|
|
89
|
+
* @param infos - The indexing information containing the list of documents and their statuses.
|
|
90
|
+
* @returns The progress as a number between 0 and 1, where 0 indicates no progress and 1 indicates all documents are processed (processed means either indexed or errored).
|
|
91
|
+
* Returns 0 if the input is invalid or there are no documents.
|
|
92
|
+
*/
|
|
93
|
+
getIndexingProgress(infos: IndexingInfos | undefined): number;
|
|
94
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentUploadComponent, never>;
|
|
95
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentUploadComponent, "sq-document-upload", never, { "instanceId": { "alias": "instanceId"; "required": false; }; "pollingInterval": { "alias": "pollingInterval"; "required": false; }; }, {}, never, never, true, never>;
|
|
96
|
+
}
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
export
|
|
2
|
-
documentsUploadEnabled: boolean;
|
|
3
|
-
constraints: {
|
|
4
|
-
maxTotalFileSizeMB: number;
|
|
5
|
-
remainingFileSizeMB: number;
|
|
6
|
-
maxTotalFileCount: number;
|
|
7
|
-
remainingFileCount: number;
|
|
8
|
-
supportedFileExtensions: string[];
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export
|
|
12
|
-
statusToken: string;
|
|
13
|
-
executionTime: string;
|
|
14
|
-
connectorResponse?: {
|
|
15
|
-
collection: string;
|
|
16
|
-
action: string;
|
|
17
|
-
stats: {
|
|
18
|
-
nbDocUpdated: number;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export
|
|
23
|
-
loaded: number;
|
|
24
|
-
total: number;
|
|
25
|
-
progress: number;
|
|
26
|
-
};
|
|
27
|
-
export
|
|
28
|
-
type: 'uploadProgress';
|
|
29
|
-
} & UploadingInfos;
|
|
30
|
-
export interface UploadResponseEvent {
|
|
31
|
-
type: 'response';
|
|
32
|
-
body: UploadResponse;
|
|
33
|
-
}
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
docs: {
|
|
37
|
-
id: string;
|
|
38
|
-
fileName: string;
|
|
39
|
-
operation: "Add" | "Update";
|
|
40
|
-
status: "Indexing" | "Indexed" | "Error";
|
|
41
|
-
previousIndexationTime: string | null;
|
|
42
|
-
currentIndexationTime: string | null;
|
|
43
|
-
}[];
|
|
44
|
-
isCompleted: boolean;
|
|
45
|
-
executionTime: string;
|
|
46
|
-
};
|
|
47
|
-
export interface UploadedDocuments {
|
|
48
|
-
docs: UploadedDocument[];
|
|
49
|
-
count: number;
|
|
50
|
-
totalCount: number;
|
|
51
|
-
executionTime: string;
|
|
52
|
-
}
|
|
53
|
-
export interface UploadedDocument {
|
|
54
|
-
id: string;
|
|
55
|
-
fileName: string;
|
|
56
|
-
title: string;
|
|
57
|
-
fileExt: string;
|
|
58
|
-
indexationTime: string;
|
|
59
|
-
size: string;
|
|
60
|
-
sizeDisplay: string;
|
|
61
|
-
[key: string]: any;
|
|
62
|
-
}
|
|
63
|
-
export interface deleteDocumentsResponse {
|
|
64
|
-
deletedCount: number;
|
|
65
|
-
executionTime: string;
|
|
66
|
-
}
|
|
1
|
+
export type UploadConfig = {
|
|
2
|
+
documentsUploadEnabled: boolean;
|
|
3
|
+
constraints: {
|
|
4
|
+
maxTotalFileSizeMB: number;
|
|
5
|
+
remainingFileSizeMB: number;
|
|
6
|
+
maxTotalFileCount: number;
|
|
7
|
+
remainingFileCount: number;
|
|
8
|
+
supportedFileExtensions: string[];
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export type UploadResponse = {
|
|
12
|
+
statusToken: string;
|
|
13
|
+
executionTime: string;
|
|
14
|
+
connectorResponse?: {
|
|
15
|
+
collection: string;
|
|
16
|
+
action: string;
|
|
17
|
+
stats: {
|
|
18
|
+
nbDocUpdated: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type UploadingInfos = {
|
|
23
|
+
loaded: number;
|
|
24
|
+
total: number;
|
|
25
|
+
progress: number;
|
|
26
|
+
};
|
|
27
|
+
export type UploadProgressEvent = {
|
|
28
|
+
type: 'uploadProgress';
|
|
29
|
+
} & UploadingInfos;
|
|
30
|
+
export interface UploadResponseEvent {
|
|
31
|
+
type: 'response';
|
|
32
|
+
body: UploadResponse;
|
|
33
|
+
}
|
|
34
|
+
export type UploadEvent = UploadProgressEvent | UploadResponseEvent;
|
|
35
|
+
export type IndexingInfos = {
|
|
36
|
+
docs: {
|
|
37
|
+
id: string;
|
|
38
|
+
fileName: string;
|
|
39
|
+
operation: "Add" | "Update";
|
|
40
|
+
status: "Indexing" | "Indexed" | "Error";
|
|
41
|
+
previousIndexationTime: string | null;
|
|
42
|
+
currentIndexationTime: string | null;
|
|
43
|
+
}[];
|
|
44
|
+
isCompleted: boolean;
|
|
45
|
+
executionTime: string;
|
|
46
|
+
};
|
|
47
|
+
export interface UploadedDocuments {
|
|
48
|
+
docs: UploadedDocument[];
|
|
49
|
+
count: number;
|
|
50
|
+
totalCount: number;
|
|
51
|
+
executionTime: string;
|
|
52
|
+
}
|
|
53
|
+
export interface UploadedDocument {
|
|
54
|
+
id: string;
|
|
55
|
+
fileName: string;
|
|
56
|
+
title: string;
|
|
57
|
+
fileExt: string;
|
|
58
|
+
indexationTime: string;
|
|
59
|
+
size: string;
|
|
60
|
+
sizeDisplay: string;
|
|
61
|
+
[key: string]: any;
|
|
62
|
+
}
|
|
63
|
+
export interface deleteDocumentsResponse {
|
|
64
|
+
deletedCount: number;
|
|
65
|
+
executionTime: string;
|
|
66
|
+
}
|