cat-documents-ng 1.0.28 → 1.0.30
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 +322 -322
- package/Shared/constant/ERROR.d.ts +3 -0
- package/Shared/constant/URLS.d.ts +3 -0
- package/Shared/services/app-config.service.d.ts +7 -1
- package/fesm2022/cat-documents-ng.mjs +699 -117
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-history/document-history.component.d.ts +56 -9
- package/lib/document/services/document-history-ai.service.d.ts +275 -0
- package/lib/document/services/document-http.service.d.ts +51 -9
- package/lib/document/services/document-scroll.service.d.ts +24 -10
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import { DocumentViewerService } from '../../services/document-viewer.service';
|
|
|
5
5
|
import { DocumentActionsService } from '../../services/document-actions.service';
|
|
6
6
|
import { ConfirmationService } from 'primeng/api';
|
|
7
7
|
import { DocumentHttpService } from '../../services/document-http.service';
|
|
8
|
+
import { DocumentHistoryAiService } from '../../services/document-history-ai.service';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
/**
|
|
10
11
|
* Component for displaying document history in a timeline format.
|
|
@@ -15,6 +16,7 @@ export declare class DocumentHistoryComponent implements OnChanges {
|
|
|
15
16
|
private documentActionsService;
|
|
16
17
|
private confirmationService;
|
|
17
18
|
private documentHttpService;
|
|
19
|
+
documentHistoryAiService: DocumentHistoryAiService;
|
|
18
20
|
/**
|
|
19
21
|
* Input data for document history sections
|
|
20
22
|
*/
|
|
@@ -55,9 +57,10 @@ export declare class DocumentHistoryComponent implements OnChanges {
|
|
|
55
57
|
* Whether the actions dropdown menu is visible
|
|
56
58
|
*/
|
|
57
59
|
showActionsMenu: boolean;
|
|
58
|
-
constructor(documentHistoryService: DocumentHistoryService, documentViewerService: DocumentViewerService, documentActionsService: DocumentActionsService, confirmationService: ConfirmationService, documentHttpService: DocumentHttpService);
|
|
60
|
+
constructor(documentHistoryService: DocumentHistoryService, documentViewerService: DocumentViewerService, documentActionsService: DocumentActionsService, confirmationService: ConfirmationService, documentHttpService: DocumentHttpService, documentHistoryAiService: DocumentHistoryAiService);
|
|
59
61
|
/**
|
|
60
62
|
* Handles changes to input properties
|
|
63
|
+
* @param {SimpleChanges} changes - Changed input values.
|
|
61
64
|
*/
|
|
62
65
|
ngOnChanges(changes: SimpleChanges): void;
|
|
63
66
|
/**
|
|
@@ -74,29 +77,35 @@ export declare class DocumentHistoryComponent implements OnChanges {
|
|
|
74
77
|
toggleAccordion(): void;
|
|
75
78
|
/**
|
|
76
79
|
* Process history data to add computed properties
|
|
80
|
+
* @returns {any[]} Processed history sections for rendering.
|
|
77
81
|
*/
|
|
78
82
|
get processedHistoryData(): any[];
|
|
79
83
|
/**
|
|
80
84
|
* Downloads a document when clicked
|
|
81
|
-
* @param documentUrl - The URL of the document to download
|
|
82
|
-
* @param docName - The name of the document
|
|
85
|
+
* @param {string} documentUrl - The URL of the document to download.
|
|
86
|
+
* @param {string} docName - The name of the document.
|
|
83
87
|
*/
|
|
84
88
|
downloadDocument(documentUrl: string, docName?: string): void;
|
|
85
89
|
/**
|
|
86
90
|
* Get alert count for the alerts section
|
|
91
|
+
* @returns {number} Alert count value.
|
|
87
92
|
*/
|
|
88
93
|
getAlertCount(): number;
|
|
89
94
|
/**
|
|
90
95
|
* Get CSS class for event card based on action type
|
|
96
|
+
* @param {string} label - Event label text.
|
|
97
|
+
* @returns {string} CSS class name for event card.
|
|
91
98
|
*/
|
|
92
99
|
getEventCardClass(label: string): string;
|
|
93
100
|
/**
|
|
94
101
|
* Get CSS class for event icon based on action type
|
|
102
|
+
* @param {string} label - Event label text.
|
|
103
|
+
* @returns {string} CSS class name for event icon.
|
|
95
104
|
*/
|
|
96
105
|
getEventIconClass(label: string): string;
|
|
97
106
|
/**
|
|
98
107
|
* Get the appropriate icon for the event
|
|
99
|
-
* @param label - The event label
|
|
108
|
+
* @param {string} label - The event label.
|
|
100
109
|
* @returns {string} The icon class
|
|
101
110
|
*/
|
|
102
111
|
getEventIcon(label: string): string;
|
|
@@ -108,15 +117,42 @@ export declare class DocumentHistoryComponent implements OnChanges {
|
|
|
108
117
|
* Close the actions dropdown menu
|
|
109
118
|
*/
|
|
110
119
|
closeActionsMenu(): void;
|
|
120
|
+
/**
|
|
121
|
+
* Open AI sidebar with selected section
|
|
122
|
+
* @param {'Summary' | 'Query' | 'Insights'} section - AI section selected from menu.
|
|
123
|
+
*/
|
|
124
|
+
openAiPanel(section: 'Summary' | 'Query' | 'Insights'): void;
|
|
111
125
|
/**
|
|
112
126
|
* Handle delete task action
|
|
113
127
|
*/
|
|
114
128
|
onDeleteTask(): void;
|
|
115
129
|
/**
|
|
116
130
|
* Shows standard delete confirmation dialog
|
|
131
|
+
* @param {string} documentName - Document display name for confirmation message.
|
|
117
132
|
* @private
|
|
118
133
|
*/
|
|
119
134
|
private showStandardDeleteConfirmation;
|
|
135
|
+
/**
|
|
136
|
+
* Handles valuation report lookup success before delete confirmation.
|
|
137
|
+
* @param {string} documentId - Selected document id.
|
|
138
|
+
* @param {string} documentName - Document display name.
|
|
139
|
+
* @returns {(valuationReportData: any) => void} Callback for valuation report response.
|
|
140
|
+
*/
|
|
141
|
+
private handleValuationReportCheckSuccess;
|
|
142
|
+
/**
|
|
143
|
+
* Handles valuation report lookup error before delete confirmation.
|
|
144
|
+
* @param {string} documentName - Document display name.
|
|
145
|
+
* @returns {(error: any) => void} Error callback.
|
|
146
|
+
*/
|
|
147
|
+
private handleValuationReportCheckError;
|
|
148
|
+
/**
|
|
149
|
+
* Handles confirm action for delete dialog.
|
|
150
|
+
*/
|
|
151
|
+
private handleConfirmDelete;
|
|
152
|
+
/**
|
|
153
|
+
* Handles cancel action for delete dialog.
|
|
154
|
+
*/
|
|
155
|
+
private handleCancelDelete;
|
|
120
156
|
/**
|
|
121
157
|
* Performs the actual delete operation
|
|
122
158
|
* @private
|
|
@@ -124,11 +160,12 @@ export declare class DocumentHistoryComponent implements OnChanges {
|
|
|
124
160
|
private performDelete;
|
|
125
161
|
/**
|
|
126
162
|
* Set reference to document actions component
|
|
163
|
+
* @param {any} component - Document actions component reference.
|
|
127
164
|
*/
|
|
128
165
|
setDocumentActionsComponent(component: any): void;
|
|
129
166
|
/**
|
|
130
167
|
* Handles document selection from history
|
|
131
|
-
* @param document - The selected document from history
|
|
168
|
+
* @param {HistoryDocument} document - The selected document from history.
|
|
132
169
|
*/
|
|
133
170
|
onDocumentClick(document: HistoryDocument): void;
|
|
134
171
|
/**
|
|
@@ -141,18 +178,28 @@ export declare class DocumentHistoryComponent implements OnChanges {
|
|
|
141
178
|
private processHistoryData;
|
|
142
179
|
/**
|
|
143
180
|
* Gets the list of valid documents for a history item
|
|
144
|
-
* @param item - The history item
|
|
145
|
-
* @returns Array of valid documents
|
|
181
|
+
* @param {any} item - The history item.
|
|
182
|
+
* @returns {HistoryDocument[]} Array of valid documents.
|
|
146
183
|
*/
|
|
147
184
|
private getValidDocuments;
|
|
148
185
|
/**
|
|
149
186
|
* Determines if a timeline item should be hidden
|
|
150
|
-
* @param item - The history item
|
|
151
|
-
* @returns True if the item should be hidden
|
|
187
|
+
* @param {any} item - The history item.
|
|
188
|
+
* @returns {boolean} True if the item should be hidden.
|
|
152
189
|
*/
|
|
153
190
|
private shouldHideItem;
|
|
191
|
+
/**
|
|
192
|
+
* Sends a query to AI chat API and appends response in chat format.
|
|
193
|
+
*/
|
|
194
|
+
sendQuery(): void;
|
|
195
|
+
/**
|
|
196
|
+
* Sends query when user presses Enter (without Shift).
|
|
197
|
+
* @param {KeyboardEvent} event - Keyboard event from textarea.
|
|
198
|
+
*/
|
|
199
|
+
onQueryEnter(event: KeyboardEvent): void;
|
|
154
200
|
/**
|
|
155
201
|
* Listen for clicks outside the dropdown to close it
|
|
202
|
+
* @param {Event} event - Click event from document.
|
|
156
203
|
*/
|
|
157
204
|
onDocumentClickOutside(event: Event): void;
|
|
158
205
|
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHistoryComponent, never>;
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { DocumentHttpService } from './document-http.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export interface AiChatMessage {
|
|
5
|
+
role: 'user' | 'assistant';
|
|
6
|
+
content: string;
|
|
7
|
+
htmlContent?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DocumentHistoryAiState {
|
|
10
|
+
showAiMenu: boolean;
|
|
11
|
+
showAiSidebar: boolean;
|
|
12
|
+
aiSidebarHeader: 'Summary' | 'Query' | 'Insights';
|
|
13
|
+
aiContent: string;
|
|
14
|
+
aiContentHtml: string;
|
|
15
|
+
aiLoading: boolean;
|
|
16
|
+
aiError: string;
|
|
17
|
+
queryText: string;
|
|
18
|
+
queryLoading: boolean;
|
|
19
|
+
queryMessages: AiChatMessage[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Handles AI-related document history workflows and formatting.
|
|
23
|
+
*/
|
|
24
|
+
export declare class DocumentHistoryAiService {
|
|
25
|
+
private documentHttpService;
|
|
26
|
+
/**
|
|
27
|
+
* UI state for AI panel and query chat.
|
|
28
|
+
*/
|
|
29
|
+
state: DocumentHistoryAiState;
|
|
30
|
+
/**
|
|
31
|
+
* Creates an instance of DocumentHistoryAiService.
|
|
32
|
+
* @param {DocumentHttpService} documentHttpService - Service for AI API calls.
|
|
33
|
+
*/
|
|
34
|
+
constructor(documentHttpService: DocumentHttpService);
|
|
35
|
+
/**
|
|
36
|
+
* Toggles AI dropdown visibility.
|
|
37
|
+
*/
|
|
38
|
+
toggleAiMenu(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Closes AI dropdown menu.
|
|
41
|
+
*/
|
|
42
|
+
closeAiMenu(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Opens AI sidebar and loads selected section data.
|
|
45
|
+
* @param {'Summary' | 'Query' | 'Insights'} section - Selected AI section.
|
|
46
|
+
* @param {any} selectedDocument - Selected document object.
|
|
47
|
+
*/
|
|
48
|
+
openAiPanel(section: 'Summary' | 'Query' | 'Insights', selectedDocument: any): void;
|
|
49
|
+
/**
|
|
50
|
+
* Sends query using current query text in state.
|
|
51
|
+
* @param {any} selectedDocument - Selected document object.
|
|
52
|
+
*/
|
|
53
|
+
sendQuery(selectedDocument: any): void;
|
|
54
|
+
/**
|
|
55
|
+
* Handles Enter key for query submission.
|
|
56
|
+
* @param {KeyboardEvent} event - Keyboard event from query textarea.
|
|
57
|
+
* @param {any} selectedDocument - Selected document object.
|
|
58
|
+
*/
|
|
59
|
+
onQueryEnter(event: KeyboardEvent, selectedDocument: any): void;
|
|
60
|
+
/**
|
|
61
|
+
* Returns selected document id.
|
|
62
|
+
* @param {any} selectedDocument - Selected document object.
|
|
63
|
+
* @returns {string | undefined} Selected document id.
|
|
64
|
+
*/
|
|
65
|
+
getCurrentDocumentId(selectedDocument: any): string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Fetches AI content for summary or insights.
|
|
68
|
+
* @param {'Summary' | 'Insights'} section - AI section to load.
|
|
69
|
+
* @param {string} documentId - Document identifier.
|
|
70
|
+
* @returns {Observable<string>} Resolved AI content text.
|
|
71
|
+
*/
|
|
72
|
+
fetchAiContent(section: 'Summary' | 'Insights', documentId: string): Observable<string>;
|
|
73
|
+
/**
|
|
74
|
+
* Fetches section content and returns text + formatted html.
|
|
75
|
+
* @param {'Summary' | 'Insights'} section - AI section to load.
|
|
76
|
+
* @param {any} selectedDocument - Selected document object.
|
|
77
|
+
* @returns {Observable<{ content: string; html: string }>} Content payload.
|
|
78
|
+
*/
|
|
79
|
+
getAiContentForSection(section: 'Summary' | 'Insights', selectedDocument: any): Observable<{
|
|
80
|
+
content: string;
|
|
81
|
+
html: string;
|
|
82
|
+
}>;
|
|
83
|
+
/**
|
|
84
|
+
* Sends question against a document.
|
|
85
|
+
* @param {string} documentId - Document identifier.
|
|
86
|
+
* @param {string} question - User question.
|
|
87
|
+
* @returns {Observable<string>} Answer text.
|
|
88
|
+
*/
|
|
89
|
+
askQuestion(documentId: string, question: string): Observable<string>;
|
|
90
|
+
/**
|
|
91
|
+
* Sends question and returns answer + formatted html.
|
|
92
|
+
* @param {any} selectedDocument - Selected document object.
|
|
93
|
+
* @param {string} question - User question.
|
|
94
|
+
* @returns {Observable<{ answer: string; html: string }>} Answer payload.
|
|
95
|
+
*/
|
|
96
|
+
askQuestionForDocument(selectedDocument: any, question: string): Observable<{
|
|
97
|
+
answer: string;
|
|
98
|
+
html: string;
|
|
99
|
+
}>;
|
|
100
|
+
/**
|
|
101
|
+
* Returns section-specific generation error.
|
|
102
|
+
* @param {'Summary' | 'Insights'} section - Section name.
|
|
103
|
+
* @returns {string} Error message.
|
|
104
|
+
*/
|
|
105
|
+
getSectionError(section: 'Summary' | 'Insights'): string;
|
|
106
|
+
/**
|
|
107
|
+
* Converts markdown-like output to presentable HTML.
|
|
108
|
+
* @param {string} content - Raw AI response content.
|
|
109
|
+
* @returns {string} Formatted HTML string.
|
|
110
|
+
*/
|
|
111
|
+
formatAiContent(content: string): string;
|
|
112
|
+
/**
|
|
113
|
+
* Fetches summary text by document id.
|
|
114
|
+
* @param {string} documentId - Document identifier.
|
|
115
|
+
* @returns {Observable<string>} Summary text.
|
|
116
|
+
*/
|
|
117
|
+
private fetchSummary;
|
|
118
|
+
/**
|
|
119
|
+
* Fetches insights text by document id.
|
|
120
|
+
* @param {string} documentId - Document identifier.
|
|
121
|
+
* @returns {Observable<string>} Insights text.
|
|
122
|
+
*/
|
|
123
|
+
private fetchInsights;
|
|
124
|
+
/**
|
|
125
|
+
* Extracts summary text from API response.
|
|
126
|
+
* @param {any} response - Summary API response.
|
|
127
|
+
* @returns {string} Summary text.
|
|
128
|
+
*/
|
|
129
|
+
private extractSummaryContent;
|
|
130
|
+
/**
|
|
131
|
+
* Extracts insights text from API response.
|
|
132
|
+
* @param {any} response - Insights API response.
|
|
133
|
+
* @returns {string} Insights text.
|
|
134
|
+
*/
|
|
135
|
+
private extractInsightsContent;
|
|
136
|
+
/**
|
|
137
|
+
* Extracts answer text from question API response.
|
|
138
|
+
* @param {any} response - Question API response.
|
|
139
|
+
* @returns {string} Answer text.
|
|
140
|
+
*/
|
|
141
|
+
private extractQuestionAnswer;
|
|
142
|
+
/**
|
|
143
|
+
* Maps content text to content payload.
|
|
144
|
+
* @param {string} content - Plain content text.
|
|
145
|
+
* @returns {{ content: string; html: string }} Content payload.
|
|
146
|
+
*/
|
|
147
|
+
private toContentResult;
|
|
148
|
+
/**
|
|
149
|
+
* Maps answer text to answer payload.
|
|
150
|
+
* @param {string} answer - Plain answer text.
|
|
151
|
+
* @returns {{ answer: string; html: string }} Answer payload.
|
|
152
|
+
*/
|
|
153
|
+
private toAnswerResult;
|
|
154
|
+
/**
|
|
155
|
+
* Initializes panel state for a selected section.
|
|
156
|
+
* @param {'Summary' | 'Query' | 'Insights'} section - Selected section.
|
|
157
|
+
*/
|
|
158
|
+
private initializePanel;
|
|
159
|
+
/**
|
|
160
|
+
* Loads summary/insights content into UI state.
|
|
161
|
+
* @param {'Summary' | 'Insights'} section - Content section to load.
|
|
162
|
+
* @param {any} selectedDocument - Selected document object.
|
|
163
|
+
*/
|
|
164
|
+
private loadAiContent;
|
|
165
|
+
/**
|
|
166
|
+
* Resets query-specific UI state.
|
|
167
|
+
*/
|
|
168
|
+
private resetQueryState;
|
|
169
|
+
/**
|
|
170
|
+
* Adds user question into chat history and sets loading.
|
|
171
|
+
* @param {string} question - User question text.
|
|
172
|
+
*/
|
|
173
|
+
private pushUserQuestion;
|
|
174
|
+
/**
|
|
175
|
+
* Handles successful summary/insights response and updates state.
|
|
176
|
+
* @param {{ content: string; html: string }} result - Formatted content result.
|
|
177
|
+
* @param {string} result.content - Raw AI content text.
|
|
178
|
+
* @param {string} result.html - Formatted AI HTML.
|
|
179
|
+
*/
|
|
180
|
+
private handleAiContentResult;
|
|
181
|
+
/**
|
|
182
|
+
* Handles summary/insights request errors.
|
|
183
|
+
* @param {Error} error - Error object.
|
|
184
|
+
*/
|
|
185
|
+
private handleAiContentRequestError;
|
|
186
|
+
/**
|
|
187
|
+
* Handles successful question response and updates state.
|
|
188
|
+
* @param {{ answer: string; html: string }} result - Formatted answer result.
|
|
189
|
+
* @param {string} result.answer - AI answer text.
|
|
190
|
+
* @param {string} result.html - Formatted AI answer HTML.
|
|
191
|
+
*/
|
|
192
|
+
private handleQuestionResult;
|
|
193
|
+
/**
|
|
194
|
+
* Handles question request errors.
|
|
195
|
+
* @param {Error} error - Error object.
|
|
196
|
+
*/
|
|
197
|
+
private handleQuestionRequestError;
|
|
198
|
+
/**
|
|
199
|
+
* Produces section-specific catchError handler.
|
|
200
|
+
* @param {'Summary' | 'Insights'} section - AI section.
|
|
201
|
+
* @returns {(error: any) => Observable<never>} Error handler.
|
|
202
|
+
*/
|
|
203
|
+
private handleSectionError;
|
|
204
|
+
/**
|
|
205
|
+
* Converts summary request errors.
|
|
206
|
+
* @returns {Observable<never>} Error observable.
|
|
207
|
+
*/
|
|
208
|
+
private handleSummaryError;
|
|
209
|
+
/**
|
|
210
|
+
* Converts insights request errors.
|
|
211
|
+
* @returns {Observable<never>} Error observable.
|
|
212
|
+
*/
|
|
213
|
+
private handleInsightsError;
|
|
214
|
+
/**
|
|
215
|
+
* Converts ask-question request errors.
|
|
216
|
+
* @returns {Observable<never>} Error observable.
|
|
217
|
+
*/
|
|
218
|
+
private handleAskQuestionError;
|
|
219
|
+
/**
|
|
220
|
+
* Converts ask-question-for-document errors.
|
|
221
|
+
* @returns {Observable<never>} Error observable.
|
|
222
|
+
*/
|
|
223
|
+
private handleQuestionGenerationError;
|
|
224
|
+
/**
|
|
225
|
+
* Renders escaped lines into HTML blocks.
|
|
226
|
+
* @param {string[]} lines - Escaped content lines.
|
|
227
|
+
* @returns {string} Rendered HTML.
|
|
228
|
+
*/
|
|
229
|
+
private renderMarkdownLines;
|
|
230
|
+
/**
|
|
231
|
+
* Pushes one markdown line into output.
|
|
232
|
+
* @param {string} line - Current line.
|
|
233
|
+
* @param {string[]} htmlParts - Output accumulator.
|
|
234
|
+
* @param {boolean} isInList - List tracking flag.
|
|
235
|
+
* @returns {boolean} Updated list tracking flag.
|
|
236
|
+
*/
|
|
237
|
+
private pushMarkdownLine;
|
|
238
|
+
/**
|
|
239
|
+
* Closes list if it is currently open.
|
|
240
|
+
* @param {string[]} htmlParts - Output accumulator.
|
|
241
|
+
* @param {boolean} isInList - List tracking flag.
|
|
242
|
+
* @returns {boolean} Updated list flag.
|
|
243
|
+
*/
|
|
244
|
+
private closeListIfNeeded;
|
|
245
|
+
/**
|
|
246
|
+
* Appends a bullet-list line.
|
|
247
|
+
* @param {string} line - Raw markdown line.
|
|
248
|
+
* @param {string[]} htmlParts - Output accumulator.
|
|
249
|
+
* @param {boolean} isInList - List tracking flag.
|
|
250
|
+
* @returns {boolean} Updated list flag.
|
|
251
|
+
*/
|
|
252
|
+
private pushListLine;
|
|
253
|
+
/**
|
|
254
|
+
* Appends a paragraph line.
|
|
255
|
+
* @param {string} line - Raw markdown line.
|
|
256
|
+
* @param {string[]} htmlParts - Output accumulator.
|
|
257
|
+
* @param {boolean} isInList - List tracking flag.
|
|
258
|
+
* @returns {boolean} Updated list flag.
|
|
259
|
+
*/
|
|
260
|
+
private pushParagraphLine;
|
|
261
|
+
/**
|
|
262
|
+
* Formats markdown bold markers.
|
|
263
|
+
* @param {string} text - Input text.
|
|
264
|
+
* @returns {string} Text with strong tags.
|
|
265
|
+
*/
|
|
266
|
+
private formatBold;
|
|
267
|
+
/**
|
|
268
|
+
* Escapes HTML-sensitive characters.
|
|
269
|
+
* @param {string} text - Input text.
|
|
270
|
+
* @returns {string} Escaped text.
|
|
271
|
+
*/
|
|
272
|
+
private escapeHtml;
|
|
273
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHistoryAiService, never>;
|
|
274
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DocumentHistoryAiService>;
|
|
275
|
+
}
|
|
@@ -11,6 +11,24 @@ import { UserListModel } from '../models/user-list.model';
|
|
|
11
11
|
import { StatusDataModel } from '../models/status-data.model';
|
|
12
12
|
import { DocumentHistorySection } from '../models/document-history.model';
|
|
13
13
|
import * as i0 from "@angular/core";
|
|
14
|
+
export interface AiSummaryResponse {
|
|
15
|
+
success: boolean;
|
|
16
|
+
document_id: string;
|
|
17
|
+
documentSummary: string;
|
|
18
|
+
}
|
|
19
|
+
export interface AiInsightsResponse {
|
|
20
|
+
success: boolean;
|
|
21
|
+
document_id: string;
|
|
22
|
+
documentInsight: string;
|
|
23
|
+
}
|
|
24
|
+
export interface AiQuestionResponse {
|
|
25
|
+
success: boolean;
|
|
26
|
+
document_id: string;
|
|
27
|
+
question: string;
|
|
28
|
+
answer: string;
|
|
29
|
+
question_number: number;
|
|
30
|
+
token_optimized: boolean;
|
|
31
|
+
}
|
|
14
32
|
/**
|
|
15
33
|
* Service for making HTTP requests related to documents.
|
|
16
34
|
* Authentication is handled automatically by the HTTP interceptor in the main project.
|
|
@@ -34,6 +52,30 @@ export declare class DocumentHttpService {
|
|
|
34
52
|
* @type {string}
|
|
35
53
|
*/
|
|
36
54
|
get apiUrl(): string;
|
|
55
|
+
/**
|
|
56
|
+
* Returns base URL for document intelligence APIs.
|
|
57
|
+
* @returns {string} Base URL for AI endpoints.
|
|
58
|
+
*/
|
|
59
|
+
get documentIntelligenceApiUrl(): string;
|
|
60
|
+
/**
|
|
61
|
+
* Calls AI summary endpoint for a document.
|
|
62
|
+
* @param {string} documentId - The document ID to summarize.
|
|
63
|
+
* @returns {Observable<AiSummaryResponse>} AI summary response.
|
|
64
|
+
*/
|
|
65
|
+
getAiSummary(documentId: string): Observable<AiSummaryResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* Calls AI insights endpoint for a document.
|
|
68
|
+
* @param {string} documentId - The document ID to generate insights for.
|
|
69
|
+
* @returns {Observable<AiInsightsResponse>} AI insights response.
|
|
70
|
+
*/
|
|
71
|
+
getAiInsights(documentId: string): Observable<AiInsightsResponse>;
|
|
72
|
+
/**
|
|
73
|
+
* Calls AI question endpoint for chat answers.
|
|
74
|
+
* @param {string} documentId - The document ID used for context.
|
|
75
|
+
* @param {string} question - The question asked by the user.
|
|
76
|
+
* @returns {Observable<AiQuestionResponse>} AI question answer response.
|
|
77
|
+
*/
|
|
78
|
+
askAiQuestion(documentId: string, question: string): Observable<AiQuestionResponse>;
|
|
37
79
|
/**
|
|
38
80
|
* Fetches a document by its path name and transforms the response for dropdown options.
|
|
39
81
|
* Includes error handling for failed API requests.
|
|
@@ -52,19 +94,19 @@ export declare class DocumentHttpService {
|
|
|
52
94
|
* Fetches a document by its path name and transforms the response for dropdown options.
|
|
53
95
|
* Includes error handling for failed API requests.
|
|
54
96
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
55
|
-
|
|
97
|
+
*/
|
|
56
98
|
/**
|
|
57
99
|
* Fetches a document by its path name and transforms the response for dropdown options.
|
|
58
100
|
* @param {string} documentId - The document ID to fetch the document.
|
|
59
101
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
60
|
-
|
|
102
|
+
*/
|
|
61
103
|
getAlertsByDocumentID(documentId: string): Observable<DocumentAlertModel>;
|
|
62
104
|
/**
|
|
63
105
|
* Fetches a document by its folder ID and transforms the response for dropdown options.
|
|
64
106
|
* @param {string} folderId - The folder ID to fetch the document.
|
|
65
107
|
* @param {string} contextId - The context ID to fetch the document.
|
|
66
108
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
67
|
-
|
|
109
|
+
*/
|
|
68
110
|
getDocumentByFolderID(folderId: string, contextId: string): Observable<DocumentModel[]>;
|
|
69
111
|
/**
|
|
70
112
|
* Updates the name of a document.
|
|
@@ -76,10 +118,10 @@ export declare class DocumentHttpService {
|
|
|
76
118
|
*/
|
|
77
119
|
updateDocumentName(documentId: string, payload: any): Observable<DocumentModel>;
|
|
78
120
|
/**
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
121
|
+
* Fetches a userlist by its path name.
|
|
122
|
+
* @param {string} contextId - The document ID to fetch the document.
|
|
123
|
+
* @returns {Observable<UserListModel[]>} Observable that emits the user list data.
|
|
124
|
+
*/
|
|
83
125
|
getUserListByContextId(contextId: string): Observable<UserListModel[]>;
|
|
84
126
|
/**
|
|
85
127
|
* Fetches document status count data by application ID with optional context ID and category parameters.
|
|
@@ -175,8 +217,8 @@ export declare class DocumentHttpService {
|
|
|
175
217
|
downloadCsvFile(documentUrl: string): Observable<string>;
|
|
176
218
|
/**
|
|
177
219
|
* Downloads an email file (EML) with appropriate handling for different storage types
|
|
178
|
-
* @param documentUrl - URL of the email file
|
|
179
|
-
* @returns Observable of file content as text
|
|
220
|
+
* @param {string} documentUrl - URL of the email file
|
|
221
|
+
* @returns {Observable<string>} Observable of file content as text
|
|
180
222
|
*/
|
|
181
223
|
downloadEmailFile(documentUrl: string): Observable<string>;
|
|
182
224
|
documentRequest(payload: any): Observable<any>;
|
|
@@ -5,25 +5,38 @@ export interface ScrollTarget {
|
|
|
5
5
|
element: Element;
|
|
6
6
|
menuItemId: string;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Service to observe section visibility and scroll state; deselects menu item when section scrolls out of view.
|
|
10
|
+
*/
|
|
8
11
|
export declare class DocumentScrollService implements OnDestroy {
|
|
9
12
|
private documentStore;
|
|
10
13
|
private sectionObserver;
|
|
11
14
|
private currentObservedSection;
|
|
12
15
|
private isScrolling;
|
|
16
|
+
/** @type {(() => void) | null} */
|
|
13
17
|
private scrollHandler;
|
|
14
18
|
private scrollTimeout;
|
|
19
|
+
/** Pending deselect scheduled on ratio=0. Cancelled when ratio>0 so we don't deselect after a stale ratio=0. */
|
|
20
|
+
private deselectTimeoutId;
|
|
15
21
|
constructor(documentStore: DocumentStore);
|
|
16
22
|
/**
|
|
17
|
-
* Sets up scroll event listeners to track scrolling state
|
|
18
|
-
* @param containerElement - The container element to monitor for scroll events
|
|
23
|
+
* Sets up scroll event listeners to track scrolling state.
|
|
24
|
+
* @param {HTMLElement} containerElement - The container element to monitor for scroll events
|
|
19
25
|
*/
|
|
20
26
|
setupScrollListeners(containerElement: HTMLElement): void;
|
|
21
27
|
/**
|
|
22
|
-
* Sets up intersection observer to
|
|
23
|
-
* @param sectionElement - The section element to observe
|
|
24
|
-
* @param menuItemId - The ID of the selected menu item
|
|
28
|
+
* Sets up intersection observer to deselect when the selected section scrolls out of view.
|
|
29
|
+
* @param {Element} sectionElement - The section element to observe
|
|
30
|
+
* @param {string} menuItemId - The ID of the selected menu item
|
|
25
31
|
*/
|
|
26
32
|
setupSectionObserver(sectionElement: Element, menuItemId: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Handles IntersectionObserver entries: cancel pending deselect when visible, schedule deselect when ratio=0.
|
|
35
|
+
* @param {IntersectionObserverEntry[]} entries - Observer entries
|
|
36
|
+
* @param {string} menuItemId - Selected menu item id
|
|
37
|
+
*/
|
|
38
|
+
private handleIntersectionEntries;
|
|
39
|
+
private cancelPendingDeselect;
|
|
27
40
|
/**
|
|
28
41
|
* Disconnects the section observer
|
|
29
42
|
*/
|
|
@@ -33,12 +46,13 @@ export declare class DocumentScrollService implements OnDestroy {
|
|
|
33
46
|
*/
|
|
34
47
|
setScrolling(): void;
|
|
35
48
|
/**
|
|
36
|
-
* Resets the scrolling flag after a specified delay
|
|
37
|
-
* @param delay - Delay in milliseconds before resetting the flag
|
|
49
|
+
* Resets the scrolling flag after a specified delay.
|
|
50
|
+
* @param {number} [delay=1200] - Delay in milliseconds before resetting the flag
|
|
38
51
|
*/
|
|
39
52
|
resetScrollingAfterDelay(delay?: number): void;
|
|
40
53
|
/**
|
|
41
|
-
* Gets the current scrolling state
|
|
54
|
+
* Gets the current scrolling state.
|
|
55
|
+
* @returns {boolean} True when a scroll is in progress
|
|
42
56
|
*/
|
|
43
57
|
get isCurrentlyScrolling(): boolean;
|
|
44
58
|
/**
|
|
@@ -46,8 +60,8 @@ export declare class DocumentScrollService implements OnDestroy {
|
|
|
46
60
|
*/
|
|
47
61
|
ngOnDestroy(): void;
|
|
48
62
|
/**
|
|
49
|
-
* Removes scroll event listeners
|
|
50
|
-
* @param containerElement - The container element to remove listeners from
|
|
63
|
+
* Removes scroll event listeners.
|
|
64
|
+
* @param {HTMLElement} [containerElement] - The container element to remove listeners from
|
|
51
65
|
*/
|
|
52
66
|
cleanupScrollListeners(containerElement?: HTMLElement): void;
|
|
53
67
|
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentScrollService, never>;
|