cat-documents-ng 1.0.30 → 1.0.32
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/Shared/constant/ERROR.d.ts +0 -2
- package/Shared/constant/URLS.d.ts +0 -2
- package/fesm2022/cat-documents-ng.mjs +24 -185
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/components/document-history/document-history.component.d.ts +8 -3
- package/lib/document/services/document-history-ai.service.d.ts +5 -93
- package/lib/document/services/document-http.service.d.ts +1 -22
- package/package.json +1 -1
|
@@ -33,6 +33,11 @@ export declare class DocumentHistoryComponent implements OnChanges {
|
|
|
33
33
|
* The selected document for actions
|
|
34
34
|
*/
|
|
35
35
|
selectedDocument?: any;
|
|
36
|
+
/**
|
|
37
|
+
* When true, shows AI dropdown (Summary / Query / Insights) and sidebar.
|
|
38
|
+
* Set false to hide document intelligence UI (default off until enabled).
|
|
39
|
+
*/
|
|
40
|
+
isDocumentIntelligence: boolean;
|
|
36
41
|
/**
|
|
37
42
|
* Event emitted when delete task is requested
|
|
38
43
|
*/
|
|
@@ -119,9 +124,9 @@ export declare class DocumentHistoryComponent implements OnChanges {
|
|
|
119
124
|
closeActionsMenu(): void;
|
|
120
125
|
/**
|
|
121
126
|
* Open AI sidebar with selected section
|
|
122
|
-
* @param {'
|
|
127
|
+
* @param {'Query'} section - AI section (Query only).
|
|
123
128
|
*/
|
|
124
|
-
openAiPanel(section: '
|
|
129
|
+
openAiPanel(section: 'Query'): void;
|
|
125
130
|
/**
|
|
126
131
|
* Handle delete task action
|
|
127
132
|
*/
|
|
@@ -203,5 +208,5 @@ export declare class DocumentHistoryComponent implements OnChanges {
|
|
|
203
208
|
*/
|
|
204
209
|
onDocumentClickOutside(event: Event): void;
|
|
205
210
|
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHistoryComponent, never>;
|
|
206
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentHistoryComponent, "document-history", never, { "historyData": { "alias": "historyData"; "required": false; }; "showHistory": { "alias": "showHistory"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; "selectedDocument": { "alias": "selectedDocument"; "required": false; }; }, { "deleteTaskRequested": "deleteTaskRequested"; "documentSelected": "documentSelected"; }, never, ["*", "[actions-component]"], false, never>;
|
|
211
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentHistoryComponent, "document-history", never, { "historyData": { "alias": "historyData"; "required": false; }; "showHistory": { "alias": "showHistory"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; "selectedDocument": { "alias": "selectedDocument"; "required": false; }; "isDocumentIntelligence": { "alias": "isDocumentIntelligence"; "required": false; }; }, { "deleteTaskRequested": "deleteTaskRequested"; "documentSelected": "documentSelected"; }, never, ["*", "[actions-component]"], false, never>;
|
|
207
212
|
}
|
|
@@ -9,7 +9,7 @@ export interface AiChatMessage {
|
|
|
9
9
|
export interface DocumentHistoryAiState {
|
|
10
10
|
showAiMenu: boolean;
|
|
11
11
|
showAiSidebar: boolean;
|
|
12
|
-
aiSidebarHeader: '
|
|
12
|
+
aiSidebarHeader: 'Query';
|
|
13
13
|
aiContent: string;
|
|
14
14
|
aiContentHtml: string;
|
|
15
15
|
aiLoading: boolean;
|
|
@@ -41,11 +41,11 @@ export declare class DocumentHistoryAiService {
|
|
|
41
41
|
*/
|
|
42
42
|
closeAiMenu(): void;
|
|
43
43
|
/**
|
|
44
|
-
* Opens AI sidebar
|
|
45
|
-
* @param {'
|
|
44
|
+
* Opens AI sidebar for Query panel.
|
|
45
|
+
* @param {'Query'} section - AI section (Query only).
|
|
46
46
|
* @param {any} selectedDocument - Selected document object.
|
|
47
47
|
*/
|
|
48
|
-
openAiPanel(section: '
|
|
48
|
+
openAiPanel(section: 'Query', selectedDocument: any): void;
|
|
49
49
|
/**
|
|
50
50
|
* Sends query using current query text in state.
|
|
51
51
|
* @param {any} selectedDocument - Selected document object.
|
|
@@ -63,23 +63,6 @@ export declare class DocumentHistoryAiService {
|
|
|
63
63
|
* @returns {string | undefined} Selected document id.
|
|
64
64
|
*/
|
|
65
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
66
|
/**
|
|
84
67
|
* Sends question against a document.
|
|
85
68
|
* @param {string} documentId - Document identifier.
|
|
@@ -97,54 +80,18 @@ export declare class DocumentHistoryAiService {
|
|
|
97
80
|
answer: string;
|
|
98
81
|
html: string;
|
|
99
82
|
}>;
|
|
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
83
|
/**
|
|
107
84
|
* Converts markdown-like output to presentable HTML.
|
|
108
85
|
* @param {string} content - Raw AI response content.
|
|
109
86
|
* @returns {string} Formatted HTML string.
|
|
110
87
|
*/
|
|
111
88
|
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
89
|
/**
|
|
137
90
|
* Extracts answer text from question API response.
|
|
138
91
|
* @param {any} response - Question API response.
|
|
139
92
|
* @returns {string} Answer text.
|
|
140
93
|
*/
|
|
141
94
|
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
95
|
/**
|
|
149
96
|
* Maps answer text to answer payload.
|
|
150
97
|
* @param {string} answer - Plain answer text.
|
|
@@ -152,16 +99,9 @@ export declare class DocumentHistoryAiService {
|
|
|
152
99
|
*/
|
|
153
100
|
private toAnswerResult;
|
|
154
101
|
/**
|
|
155
|
-
* Initializes panel state for
|
|
156
|
-
* @param {'Summary' | 'Query' | 'Insights'} section - Selected section.
|
|
102
|
+
* Initializes panel state for Query.
|
|
157
103
|
*/
|
|
158
104
|
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
105
|
/**
|
|
166
106
|
* Resets query-specific UI state.
|
|
167
107
|
*/
|
|
@@ -171,18 +111,6 @@ export declare class DocumentHistoryAiService {
|
|
|
171
111
|
* @param {string} question - User question text.
|
|
172
112
|
*/
|
|
173
113
|
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
114
|
/**
|
|
187
115
|
* Handles successful question response and updates state.
|
|
188
116
|
* @param {{ answer: string; html: string }} result - Formatted answer result.
|
|
@@ -195,22 +123,6 @@ export declare class DocumentHistoryAiService {
|
|
|
195
123
|
* @param {Error} error - Error object.
|
|
196
124
|
*/
|
|
197
125
|
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
126
|
/**
|
|
215
127
|
* Converts ask-question request errors.
|
|
216
128
|
* @returns {Observable<never>} Error observable.
|
|
@@ -11,16 +11,6 @@ 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
14
|
export interface AiQuestionResponse {
|
|
25
15
|
success: boolean;
|
|
26
16
|
document_id: string;
|
|
@@ -57,20 +47,9 @@ export declare class DocumentHttpService {
|
|
|
57
47
|
* @returns {string} Base URL for AI endpoints.
|
|
58
48
|
*/
|
|
59
49
|
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
50
|
/**
|
|
73
51
|
* Calls AI question endpoint for chat answers.
|
|
52
|
+
* Uses same HttpClient as getDocumentHistoryByDocumentId; host app interceptor supplies Authorization Bearer.
|
|
74
53
|
* @param {string} documentId - The document ID used for context.
|
|
75
54
|
* @param {string} question - The question asked by the user.
|
|
76
55
|
* @returns {Observable<AiQuestionResponse>} AI question answer response.
|