@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.
Files changed (151) hide show
  1. package/chat/charts/chart/chart.component.d.ts +13 -13
  2. package/chat/chat-message/chat-message.component.d.ts +85 -81
  3. package/chat/chat-message/i18n/en.json +11 -0
  4. package/chat/chat-message/i18n/fr.json +11 -0
  5. package/chat/chat-reference/chat-reference.component.d.ts +14 -14
  6. package/chat/chat-reference/i18n/en.json +4 -0
  7. package/chat/chat-reference/i18n/fr.json +4 -0
  8. package/chat/chat-settings-v3/chat-settings-v3.component.d.ts +48 -50
  9. package/chat/chat-settings-v3/i18n/en.json +14 -0
  10. package/chat/chat-settings-v3/i18n/fr.json +14 -0
  11. package/chat/chat.component.d.ts +388 -1405
  12. package/chat/chat.service.d.ts +247 -228
  13. package/chat/debug-message/debug-message.component.d.ts +17 -17
  14. package/chat/debug-message/i18n/en.json +3 -0
  15. package/chat/debug-message/i18n/fr.json +3 -0
  16. package/chat/dialogs/delete-saved-chat.component.d.ts +22 -0
  17. package/chat/dialogs/i18n/en.json +19 -0
  18. package/chat/dialogs/i18n/fr.json +19 -0
  19. package/chat/dialogs/rename-saved-chat.component.d.ts +21 -0
  20. package/chat/dialogs/updates.component.d.ts +15 -0
  21. package/chat/documents-upload/document-list/document-list.component.d.ts +68 -77
  22. package/chat/documents-upload/document-overview/document-overview.component.d.ts +31 -41
  23. package/chat/documents-upload/document-upload/document-upload.component.d.ts +96 -98
  24. package/chat/documents-upload/documents-upload.model.d.ts +66 -66
  25. package/chat/documents-upload/documents-upload.service.d.ts +170 -174
  26. package/chat/documents-upload/i18n/en.json +24 -0
  27. package/chat/documents-upload/i18n/fr.json +24 -0
  28. package/chat/format-icon/format-icon.component.d.ts +10 -10
  29. package/chat/format-icon/icons.d.ts +5 -5
  30. package/chat/i18n/en.json +42 -0
  31. package/chat/i18n/fr.json +42 -0
  32. package/chat/index.d.ts +5 -5
  33. package/chat/initials-avatar/initials-avatar.component.d.ts +35 -35
  34. package/chat/instance-manager.service.d.ts +28 -28
  35. package/chat/pipes/message-content.pipe.d.ts +16 -0
  36. package/chat/prompt.component.d.ts +25 -21
  37. package/chat/public-api.d.ts +17 -17
  38. package/chat/references/i18n/en.json +6 -0
  39. package/chat/references/i18n/fr.json +6 -0
  40. package/chat/references/inline-image-reference.d.ts +21 -0
  41. package/chat/references/inline-page-reference.d.ts +21 -0
  42. package/chat/rest-chat.service.d.ts +31 -33
  43. package/chat/saved-chats/i18n/en.json +4 -0
  44. package/chat/saved-chats/i18n/fr.json +4 -0
  45. package/chat/saved-chats/saved-chats.component.d.ts +30 -36
  46. package/chat/services/app.service.d.ts +8 -0
  47. package/chat/services/dialog.service.d.ts +12 -0
  48. package/chat/services/notification.service.d.ts +10 -0
  49. package/chat/services/principal.service.d.ts +7 -0
  50. package/chat/services/search.service.d.ts +7 -0
  51. package/chat/services/signalR.web.service.d.ts +45 -0
  52. package/chat/services/ui.service.d.ts +13 -0
  53. package/chat/services/user-settings.service.d.ts +7 -0
  54. package/chat/token-progress-bar/i18n/en.json +4 -0
  55. package/chat/token-progress-bar/i18n/fr.json +4 -0
  56. package/chat/token-progress-bar/token-progress-bar.component.d.ts +24 -27
  57. package/chat/tooltip/tooltip.component.d.ts +12 -0
  58. package/chat/tooltip/tooltip.directive.d.ts +81 -0
  59. package/chat/types/message-content.types.d.ts +54 -0
  60. package/chat/types/message-reference.types.d.ts +11 -0
  61. package/chat/types.d.ts +913 -873
  62. package/chat/unified-plugins/embedded-image-reference.plugin.d.ts +3 -0
  63. package/chat/unified-plugins/embedded-page-reference.plugin.d.ts +3 -0
  64. package/chat/utils/assistant-json.d.ts +2 -0
  65. package/chat/websocket-chat.service.d.ts +102 -103
  66. package/esm2022/chat/charts/chart/chart.component.mjs +40 -0
  67. package/esm2022/chat/chat-message/chat-message.component.mjs +351 -0
  68. package/esm2022/chat/chat-reference/chat-reference.component.mjs +40 -0
  69. package/esm2022/chat/chat-settings-v3/chat-settings-v3.component.mjs +118 -0
  70. package/esm2022/chat/chat.component.mjs +1090 -0
  71. package/esm2022/chat/chat.service.mjs +417 -0
  72. package/esm2022/chat/debug-message/debug-message.component.mjs +43 -0
  73. package/esm2022/chat/dialogs/delete-saved-chat.component.mjs +81 -0
  74. package/esm2022/chat/dialogs/rename-saved-chat.component.mjs +84 -0
  75. package/esm2022/chat/dialogs/updates.component.mjs +61 -0
  76. package/esm2022/chat/documents-upload/document-list/document-list.component.mjs +140 -0
  77. package/esm2022/chat/documents-upload/document-overview/document-overview.component.mjs +65 -0
  78. package/esm2022/chat/documents-upload/document-upload/document-upload.component.mjs +256 -0
  79. package/{esm2020 → esm2022}/chat/documents-upload/documents-upload.model.mjs +1 -1
  80. package/esm2022/chat/documents-upload/documents-upload.service.mjs +291 -0
  81. package/{esm2020 → esm2022}/chat/format-icon/format-icon.component.mjs +23 -23
  82. package/{esm2020 → esm2022}/chat/format-icon/icons.mjs +137 -137
  83. package/{esm2020 → esm2022}/chat/initials-avatar/initials-avatar.component.mjs +60 -60
  84. package/esm2022/chat/instance-manager.service.mjs +46 -0
  85. package/esm2022/chat/pipes/message-content.pipe.mjs +34 -0
  86. package/esm2022/chat/prompt.component.mjs +88 -0
  87. package/{esm2020 → esm2022}/chat/public-api.mjs +18 -18
  88. package/esm2022/chat/references/inline-image-reference.mjs +110 -0
  89. package/esm2022/chat/references/inline-page-reference.mjs +110 -0
  90. package/esm2022/chat/rest-chat.service.mjs +296 -0
  91. package/esm2022/chat/saved-chats/saved-chats.component.mjs +82 -0
  92. package/esm2022/chat/services/app.service.mjs +19 -0
  93. package/esm2022/chat/services/dialog.service.mjs +40 -0
  94. package/esm2022/chat/services/notification.service.mjs +25 -0
  95. package/esm2022/chat/services/principal.service.mjs +16 -0
  96. package/esm2022/chat/services/search.service.mjs +13 -0
  97. package/esm2022/chat/services/signalR.web.service.mjs +79 -0
  98. package/esm2022/chat/services/ui.service.mjs +61 -0
  99. package/esm2022/chat/services/user-settings.service.mjs +22 -0
  100. package/{esm2020 → esm2022}/chat/sinequa-assistant-chat.mjs +4 -4
  101. package/esm2022/chat/token-progress-bar/token-progress-bar.component.mjs +52 -0
  102. package/esm2022/chat/tooltip/tooltip.component.mjs +44 -0
  103. package/esm2022/chat/tooltip/tooltip.directive.mjs +203 -0
  104. package/esm2022/chat/types/message-content.types.mjs +2 -0
  105. package/esm2022/chat/types/message-reference.types.mjs +2 -0
  106. package/esm2022/chat/types.mjs +130 -0
  107. package/esm2022/chat/unified-plugins/embedded-image-reference.plugin.mjs +57 -0
  108. package/esm2022/chat/unified-plugins/embedded-page-reference.plugin.mjs +57 -0
  109. package/esm2022/chat/utils/assistant-json.mjs +12 -0
  110. package/esm2022/chat/websocket-chat.service.mjs +654 -0
  111. package/{esm2020 → esm2022}/public-api.mjs +2 -2
  112. package/{esm2020 → esm2022}/sinequa-assistant.mjs +4 -4
  113. package/fesm2022/sinequa-assistant-chat.mjs +5340 -0
  114. package/fesm2022/sinequa-assistant-chat.mjs.map +1 -0
  115. package/{fesm2015 → fesm2022}/sinequa-assistant.mjs +3 -3
  116. package/index.d.ts +5 -5
  117. package/package.json +52 -25
  118. package/public-api.d.ts +1 -1
  119. package/chat/messages/de.d.ts +0 -4
  120. package/chat/messages/en.d.ts +0 -4
  121. package/chat/messages/fr.d.ts +0 -4
  122. package/chat/messages/index.d.ts +0 -4
  123. package/esm2020/chat/charts/chart/chart.component.mjs +0 -40
  124. package/esm2020/chat/chat-message/chat-message.component.mjs +0 -263
  125. package/esm2020/chat/chat-reference/chat-reference.component.mjs +0 -40
  126. package/esm2020/chat/chat-settings-v3/chat-settings-v3.component.mjs +0 -117
  127. package/esm2020/chat/chat.component.mjs +0 -1069
  128. package/esm2020/chat/chat.service.mjs +0 -333
  129. package/esm2020/chat/debug-message/debug-message.component.mjs +0 -43
  130. package/esm2020/chat/documents-upload/document-list/document-list.component.mjs +0 -191
  131. package/esm2020/chat/documents-upload/document-overview/document-overview.component.mjs +0 -80
  132. package/esm2020/chat/documents-upload/document-upload/document-upload.component.mjs +0 -258
  133. package/esm2020/chat/documents-upload/documents-upload.service.mjs +0 -289
  134. package/esm2020/chat/instance-manager.service.mjs +0 -46
  135. package/esm2020/chat/messages/de.mjs +0 -4
  136. package/esm2020/chat/messages/en.mjs +0 -4
  137. package/esm2020/chat/messages/fr.mjs +0 -4
  138. package/esm2020/chat/messages/index.mjs +0 -9
  139. package/esm2020/chat/prompt.component.mjs +0 -88
  140. package/esm2020/chat/rest-chat.service.mjs +0 -241
  141. package/esm2020/chat/saved-chats/saved-chats.component.mjs +0 -175
  142. package/esm2020/chat/token-progress-bar/token-progress-bar.component.mjs +0 -54
  143. package/esm2020/chat/types.mjs +0 -112
  144. package/esm2020/chat/websocket-chat.service.mjs +0 -641
  145. package/fesm2015/sinequa-assistant-chat.mjs +0 -4200
  146. package/fesm2015/sinequa-assistant-chat.mjs.map +0 -1
  147. package/fesm2020/sinequa-assistant-chat.mjs +0 -4171
  148. package/fesm2020/sinequa-assistant-chat.mjs.map +0 -1
  149. package/fesm2020/sinequa-assistant.mjs +0 -9
  150. package/fesm2020/sinequa-assistant.mjs.map +0 -1
  151. /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 { LoginService } from "@sinequa/core/login";
4
- import { NotificationsService } from "@sinequa/core/notification";
5
- import { AbstractFacet } from "@sinequa/components/facet";
6
- import { Action } from "@sinequa/components/action";
7
- import { InstanceManagerService } from "../../instance-manager.service";
8
- import { ChatService } from "../../chat.service";
9
- import { DocumentsUploadService } from "../documents-upload.service";
10
- import { UploadedDocument } from "../documents-upload.model";
11
- import * as i0 from "@angular/core";
12
- export declare class DocumentListComponent extends AbstractFacet implements OnInit, OnDestroy {
13
- /** Define the key based on it, the appropriate chatService instance will be returned from instanceManagerService */
14
- instanceId: string;
15
- chatService: ChatService;
16
- groupedUploadedDocuments$: BehaviorSubject<{
17
- key: string;
18
- value: UploadedDocument[];
19
- }[]>;
20
- documentToDelete?: UploadedDocument;
21
- deletingAll: boolean;
22
- private _subscription;
23
- private _actions;
24
- private _updateDocumentsListAction;
25
- private _deleteAllDocumentsAction;
26
- loginService: LoginService;
27
- instanceManagerService: InstanceManagerService;
28
- documentsUploadService: DocumentsUploadService;
29
- notificationsService: NotificationsService;
30
- constructor();
31
- ngOnInit(): void;
32
- ngOnDestroy(): void;
33
- get actions(): Action[];
34
- instantiateChatService(): void;
35
- /**
36
- * Updates the list of uploaded documents by fetching the latest data from the service.
37
- * The fetched documents are grouped by date.
38
- *
39
- * @returns {void}
40
- */
41
- updateUploadedDocumentsList(): void;
42
- deleteDocument(event: Event, doc: UploadedDocument): void;
43
- /**
44
- * Handles the deletion of an uploaded document. This method triggers a confirmation modal
45
- * to ensure the user wants to proceed with the deletion. If confirmed, it sends a request
46
- * to delete the document and provides feedback to the user upon success or failure.
47
- *
48
- * @param event - The event object associated with the delete action, used to stop propagation.
49
- * @param doc - The document to be deleted, represented as an instance of `UploadedDocument`.
50
- *
51
- * @remarks
52
- * - Displays a confirmation modal with a warning message.
53
- * - On confirmation, deletes the document.
54
- * - Shows a success notification upon successful deletion.
55
- * - Logs and notifies the user of any errors encountered during the deletion process.
56
- */
57
- performDeleteDocument(): void;
58
- deleteAllDocuments(event?: Event): void;
59
- /**
60
- * Handles the deletion of all uploaded documents. This method triggers a confirmation modal
61
- * to ensure the user wants to proceed with the deletion. If confirmed, it sends a request
62
- * to delete the whole list of documents and provides feedback to the user upon success or failure.
63
- *
64
- * @param event - (Optional) The event object associated with the delete action, used to stop propagation.
65
- *
66
- * @remarks
67
- * - Displays a confirmation modal with a warning message.
68
- * - On confirmation, deletes all documents.
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 { LoginService } from "@sinequa/core/login";
4
- import { NotificationsService } from "@sinequa/core/notification";
5
- import { AbstractFacet } from "@sinequa/components/facet";
6
- import { Action } from "@sinequa/components/action";
7
- import { ModalService } from "@sinequa/core/modal";
8
- import { InstanceManagerService } from "../../instance-manager.service";
9
- import { ChatService } from "../../chat.service";
10
- import { DocumentsUploadService } from "../documents-upload.service";
11
- import { UploadedDocument } from "../documents-upload.model";
12
- import * as i0 from "@angular/core";
13
- export declare class DocumentOverviewComponent extends AbstractFacet implements OnInit, OnDestroy {
14
- /** Define the key based on it, the appropriate chatService instance will be returned from instanceManagerService */
15
- instanceId: string;
16
- disabledUpload: boolean;
17
- onUpload: EventEmitter<any>;
18
- chatService: ChatService;
19
- uploadedDocuments$: BehaviorSubject<UploadedDocument[]>;
20
- private _subscription;
21
- private _actions;
22
- private _updateDocumentsListAction;
23
- loginService: LoginService;
24
- instanceManagerService: InstanceManagerService;
25
- documentsUploadService: DocumentsUploadService;
26
- notificationsService: NotificationsService;
27
- modalService: ModalService;
28
- constructor();
29
- ngOnInit(): void;
30
- ngOnDestroy(): void;
31
- get actions(): Action[];
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
- /// <reference types="flowjs" />
2
- import { OnDestroy, OnInit } from "@angular/core";
3
- import { FlowDirective, Transfer } from "@flowjs/ngx-flow";
4
- import { BehaviorSubject } from "rxjs";
5
- import { LoginService } from "@sinequa/core/login";
6
- import { NotificationsService } from "@sinequa/core/notification";
7
- import { InstanceManagerService } from "../../instance-manager.service";
8
- import { ChatService } from "../../chat.service";
9
- import { DocumentsUploadService } from "../documents-upload.service";
10
- import { IndexingInfos, UploadingInfos } from "../documents-upload.model";
11
- import * as i0 from "@angular/core";
12
- export declare class DocumentUploadComponent implements OnInit, OnDestroy {
13
- /** Define the key based on it, the appropriate chatService instance will be returned from instanceManagerService */
14
- instanceId: string;
15
- /** Polling interval in milliseconds to update the indexing status of the uploaded documents */
16
- pollingInterval: number;
17
- flow: FlowDirective;
18
- chatService: ChatService;
19
- readonly flowConfig: flowjs.FlowOptions;
20
- errorAlerts: string[];
21
- dragging$: BehaviorSubject<boolean>;
22
- indexing$: BehaviorSubject<boolean>;
23
- indexingInfos$: BehaviorSubject<IndexingInfos | undefined>;
24
- uploading$: BehaviorSubject<boolean>;
25
- uploadingInfos$: BehaviorSubject<UploadingInfos | undefined>;
26
- private _subscription;
27
- loginService: LoginService;
28
- instanceManagerService: InstanceManagerService;
29
- documentsUploadService: DocumentsUploadService;
30
- notificationsService: NotificationsService;
31
- ngOnInit(): void;
32
- ngOnDestroy(): void;
33
- instantiateChatService(): void;
34
- /**
35
- * Handles the submission of files.
36
- *
37
- * @remarks
38
- * This method performs the following checks on the submitted files:
39
- *
40
- * 1. Checks if the number of files submitted exceeds the remainingFileCount defined in the constraints.
41
- * - If the number of files exceeds the allowed count, all files are removed from the flow.
42
- * - An error message is added to the error alerts.
43
- *
44
- * 2. Checks if the total size of the files submitted exceeds the remainingFileSize defined in the constraints.
45
- * - If the total size exceeds the allowed size, all files are removed from the flow.
46
- * - An error message is added to the error alerts.
47
- *
48
- * 3. Checks if the file extension of the files submitted is not allowed.
49
- * - If the file extension is not allowed, the file is removed from the flow.
50
- * - An error message is added to the error alerts.
51
- */
52
- private _onFilesSubmitted;
53
- private _onFilesAdded;
54
- onDragenter(): void;
55
- onDragleave(event: DragEvent): void;
56
- onDrop(): void;
57
- trackTransfer(transfer: Transfer): string;
58
- /**
59
- * Initiates the upload process by invoking the `upload` method
60
- * of the `flow` instance.
61
- * The `upload` method is overridden in the `ngOnInit` method to match the requirements of the assistant API.
62
- */
63
- upload(): void;
64
- /**
65
- * Initiates the file upload process by preparing the form data,
66
- * setting the uploading flag, and making an API call to upload the files.
67
- *
68
- * @remarks
69
- * - Collects all files from the `flowJs` instance and appends them to a `FormData` object.
70
- * - Subscribes to the upload process to handle progress updates, completion, and errors.
71
- * - Triggers tracking the indexing process upon successful upload completion.
72
- * - Cleans up the `flow` instance after the upload process is finalized.
73
- */
74
- private startUpload;
75
- /**
76
- * Tracks the indexing process for a single documents upload session by polling the API for its status.
77
- *
78
- * @param token - A unique token representing the single documents upload session.
79
- *
80
- * @remarks
81
- * - Clears the uploading flags and sets the indexing flag to true before starting the process.
82
- * - Polls the API every second to retrieve the current indexing status.
83
- * - Updates the `indexingInfos` property with the latest status.
84
- * - Stops polling when the indexing process is completed or an error occurs.
85
- * - Cleans up by resetting the indexing flags and clearing the `indexingInfos` property when the process is finalized.
86
- */
87
- trackIndexingProcess(token: string): void;
88
- /**
89
- * Calculates the indexing progress as a percentage of completed documents.
90
- *
91
- * @param infos - The indexing information containing the list of documents and their statuses.
92
- * @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).
93
- * Returns 0 if the input is invalid or there are no documents.
94
- */
95
- getIndexingProgress(infos: IndexingInfos | undefined): number;
96
- static ɵfac: i0.ɵɵFactoryDeclaration<DocumentUploadComponent, never>;
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 declare 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 declare 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 declare type UploadingInfos = {
23
- loaded: number;
24
- total: number;
25
- progress: number;
26
- };
27
- export declare type UploadProgressEvent = {
28
- type: 'uploadProgress';
29
- } & UploadingInfos;
30
- export interface UploadResponseEvent {
31
- type: 'response';
32
- body: UploadResponse;
33
- }
34
- export declare type UploadEvent = UploadProgressEvent | UploadResponseEvent;
35
- export declare 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
- }
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
+ }