cat-documents-ng 1.0.3 → 1.0.4

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 (142) hide show
  1. package/README.md +298 -35
  2. package/Shared/components/confirmation-dialog/confirmation-dialog.component.d.ts +44 -0
  3. package/Shared/components/table-primary/table-primary.component.d.ts +31 -0
  4. package/Shared/components/table-primary/table-primary.model.d.ts +19 -0
  5. package/Shared/constant/ERROR.d.ts +52 -0
  6. package/Shared/constant/SHARED.d.ts +546 -0
  7. package/Shared/constant/URLS.d.ts +123 -0
  8. package/Shared/services/app-config.service.d.ts +51 -0
  9. package/{projects/cat-document-lib/src/shared/services/global-error.handler.ts → Shared/services/global-error.handler.d.ts} +9 -11
  10. package/Shared/services/session.service.d.ts +46 -0
  11. package/Shared/shared.module.d.ts +14 -0
  12. package/fesm2022/cat-documents-ng.mjs +11392 -0
  13. package/fesm2022/cat-documents-ng.mjs.map +1 -0
  14. package/index.d.ts +5 -0
  15. package/lib/document/components/document-actions/document-actions.component.d.ts +78 -0
  16. package/lib/document/components/document-container/document-container.component.d.ts +162 -0
  17. package/lib/document/components/document-content-viewer/document-content-viewer.component.d.ts +291 -0
  18. package/lib/document/components/document-history/document-history.component.d.ts +160 -0
  19. package/lib/document/components/document-list/document-list.component.d.ts +299 -0
  20. package/lib/document/components/document-list-item/document-list-item.component.d.ts +28 -0
  21. package/lib/document/components/document-search/document-search.component.d.ts +77 -0
  22. package/lib/document/components/document-status/document-status.component.d.ts +24 -0
  23. package/lib/document/components/document-upload/document-upload.component.d.ts +321 -0
  24. package/lib/document/components/document-viewer/document-viewer.component.d.ts +137 -0
  25. package/lib/document/components/document-zoom-controls/document-zoom-controls.component.d.ts +33 -0
  26. package/lib/document/components/documents-menu/documents-menu.component.d.ts +110 -0
  27. package/{projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.ts → lib/document/components/folder-block/folder-block.component.d.ts} +12 -26
  28. package/lib/document/components/folder-container/folder-container.component.d.ts +162 -0
  29. package/lib/document/components/linked-document/linked-document.component.d.ts +39 -0
  30. package/lib/document/components/request-document/request-document.component.d.ts +69 -0
  31. package/lib/document/components/sidebar/sidebar.component.d.ts +109 -0
  32. package/lib/document/components/user-list/user-list.component.d.ts +34 -0
  33. package/lib/document/constant/DOCUMENT_HISTORY.d.ts +41 -0
  34. package/lib/document/directives/document.directive.d.ts +20 -0
  35. package/lib/document/directives/permission.directive.d.ts +38 -0
  36. package/lib/document/document.module.d.ts +60 -0
  37. package/lib/document/models/document-alert.model.d.ts +38 -0
  38. package/lib/document/models/document-category.model.d.ts +24 -0
  39. package/lib/document/models/document-history.model.d.ts +94 -0
  40. package/lib/document/models/document-list-response.model.d.ts +33 -0
  41. package/lib/document/models/document-type.model.d.ts +37 -0
  42. package/lib/document/models/document.model.d.ts +44 -0
  43. package/{projects/cat-document-lib/src/lib/document/models/folder.model.ts → lib/document/models/folder.model.d.ts} +7 -13
  44. package/lib/document/models/status-data.model.d.ts +27 -0
  45. package/lib/document/models/uploaded-file-response.model.d.ts +7 -0
  46. package/lib/document/models/user-list.model.d.ts +8 -0
  47. package/lib/document/services/csv-parser.service.d.ts +88 -0
  48. package/lib/document/services/document-actions.service.d.ts +48 -0
  49. package/lib/document/services/document-content-type.service.d.ts +85 -0
  50. package/lib/document/services/document-history-style.service.d.ts +34 -0
  51. package/lib/document/services/document-history.service.d.ts +42 -0
  52. package/lib/document/services/document-http.service.d.ts +179 -0
  53. package/lib/document/services/document-list.service.d.ts +74 -0
  54. package/lib/document/services/document-menu.service.d.ts +122 -0
  55. package/lib/document/services/document-scroll.service.d.ts +55 -0
  56. package/lib/document/services/document-table-builder.service.d.ts +38 -0
  57. package/lib/document/services/document-upload-business.service.d.ts +107 -0
  58. package/lib/document/services/document-upload-data.service.d.ts +40 -0
  59. package/lib/document/services/document-upload-form.service.d.ts +41 -0
  60. package/lib/document/services/document-upload.service.d.ts +99 -0
  61. package/lib/document/services/document-viewer.service.d.ts +97 -0
  62. package/lib/document/services/document-zoom.service.d.ts +81 -0
  63. package/lib/document/services/document.service.d.ts +161 -0
  64. package/lib/document/services/eml-parser.service.d.ts +116 -0
  65. package/lib/document/services/excel-parser.service.d.ts +169 -0
  66. package/lib/document/services/file-format.service.d.ts +34 -0
  67. package/lib/document/services/status-calculator.service.d.ts +20 -0
  68. package/lib/document/services/user-list.service.d.ts +29 -0
  69. package/lib/document/state/document.query.d.ts +243 -0
  70. package/{projects/cat-document-lib/src/lib/document/state/document.service.ts → lib/document/state/document.service.d.ts} +15 -46
  71. package/lib/document/state/document.state.d.ts +61 -0
  72. package/lib/document/state/document.store.d.ts +56 -0
  73. package/package.json +19 -57
  74. package/public-api.d.ts +27 -0
  75. package/src/assets/images/Document interface.png +0 -0
  76. package/src/assets/images/Document upload.png +0 -0
  77. package/src/assets/images/Pdf viewer dialog.png +0 -0
  78. package/.github/PULL_REQUEST_TEMPLATE.md +0 -32
  79. package/.husky/pre-commit +0 -4
  80. package/angular.json +0 -119
  81. package/eslint.config.cjs +0 -148
  82. package/projects/cat-document-lib/README.md +0 -63
  83. package/projects/cat-document-lib/ng-package.json +0 -11
  84. package/projects/cat-document-lib/package.json +0 -16
  85. package/projects/cat-document-lib/setup-jest.ts +0 -1
  86. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.html +0 -6
  87. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.scss +0 -0
  88. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.spec.ts +0 -0
  89. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.ts +0 -82
  90. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.html +0 -35
  91. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.scss +0 -12
  92. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.spec.ts +0 -0
  93. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.ts +0 -73
  94. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.html +0 -33
  95. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.scss +0 -22
  96. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.spec.ts +0 -23
  97. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.ts +0 -40
  98. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.html +0 -56
  99. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.scss +0 -26
  100. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.spec.ts +0 -24
  101. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.ts +0 -184
  102. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.html +0 -244
  103. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.scss +0 -36
  104. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.spec.ts +0 -21
  105. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.ts +0 -125
  106. package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.html +0 -46
  107. package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.scss +0 -0
  108. package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.spec.ts +0 -0
  109. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.html +0 -2
  110. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.scss +0 -0
  111. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.spec.ts +0 -0
  112. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.ts +0 -29
  113. package/projects/cat-document-lib/src/lib/document/document.module.ts +0 -187
  114. package/projects/cat-document-lib/src/lib/document/models/document.model.ts +0 -39
  115. package/projects/cat-document-lib/src/lib/document/services/file-format.service.spec.ts +0 -16
  116. package/projects/cat-document-lib/src/lib/document/services/file-format.service.ts +0 -41
  117. package/projects/cat-document-lib/src/lib/document/state/document.query.ts +0 -23
  118. package/projects/cat-document-lib/src/lib/document/state/document.state.ts +0 -39
  119. package/projects/cat-document-lib/src/lib/document/state/document.store.ts +0 -23
  120. package/projects/cat-document-lib/src/public-api.ts +0 -8
  121. package/projects/cat-document-lib/src/shared/constant/SHARED.ts +0 -232
  122. package/projects/cat-document-lib/src/shared/constant/URLS.ts +0 -31
  123. package/projects/cat-document-lib/src/shared/services/app-config.service.spec.ts +0 -16
  124. package/projects/cat-document-lib/src/shared/services/app-config.service.ts +0 -73
  125. package/projects/cat-document-lib/tsconfig.lib.json +0 -15
  126. package/projects/cat-document-lib/tsconfig.lib.prod.json +0 -11
  127. package/projects/cat-document-lib/tsconfig.spec.json +0 -15
  128. package/public/favicon.ico +0 -0
  129. package/src/app/app.component.html +0 -1
  130. package/src/app/app.component.scss +0 -0
  131. package/src/app/app.component.spec.ts +0 -29
  132. package/src/app/app.component.ts +0 -15
  133. package/src/app/app.module.ts +0 -60
  134. package/src/app/app.routing.module.ts +0 -19
  135. package/src/index.html +0 -13
  136. package/src/main.ts +0 -5
  137. package/src/styles.scss +0 -39
  138. package/tsconfig.app.json +0 -15
  139. package/tsconfig.json +0 -32
  140. /package/{projects/cat-document-lib/src → src}/assets/images/FolderImg.png +0 -0
  141. /package/{projects/cat-document-lib/src → src}/assets/images/Frame.png +0 -0
  142. /package/{projects/cat-document-lib/src → src}/assets/images/document.png +0 -0
@@ -0,0 +1,99 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { DocumentService } from '../state/document.service';
3
+ import { DocumentStore } from '../state/document.store';
4
+ import { MessageService } from 'primeng/api';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Service for handling document uploads.
8
+ * @class DocumentUploadService
9
+ * @typedef {DocumentUploadService}
10
+ */
11
+ export declare class DocumentUploadService {
12
+ documentService: DocumentService;
13
+ documentUploadStore: DocumentStore;
14
+ messageService: MessageService;
15
+ /**
16
+ * Event emitter for upload completion
17
+ */
18
+ uploadCompleted: EventEmitter<{
19
+ file: File;
20
+ response: any;
21
+ }>;
22
+ /**
23
+ * The file to upload.
24
+ * @type {*}
25
+ */
26
+ uploadedFile: any;
27
+ /**
28
+ * Represent contextId
29
+ * @type {string}
30
+ */
31
+ contextId: string;
32
+ /**
33
+ * Represent document name
34
+ * @type {string}
35
+ */
36
+ docName: string;
37
+ /**
38
+ * Represent document id
39
+ * @type {string}
40
+ */
41
+ docTypeId: string;
42
+ /**
43
+ * Creates an instance of DocumentUploadService.
44
+ * @param {DocumentService} documentService - Service for handling document uploads.
45
+ * @param {DocumentStore} documentUploadStore - Store for managing uploaded documents.
46
+ * @param {MessageService} messageService - Service for displaying messages.
47
+ * @returns {void}
48
+ */
49
+ constructor(documentService: DocumentService, documentUploadStore: DocumentStore, messageService: MessageService);
50
+ /**
51
+ * Prepares the files for upload by creating a FormData object.
52
+ * This method appends each file to the FormData for submission.
53
+ * @returns {Promise<any>} Promise that resolves when upload completes
54
+ */
55
+ handleTemplatedUpload(file: File, contextId: string): Promise<any>;
56
+ /**
57
+ * Uploads multiple files sequentially using promises
58
+ * @param files - Array of files to upload
59
+ * @param contextId - The context ID for upload
60
+ * @returns {Promise<any[]>} Promise that resolves with all upload responses
61
+ */
62
+ uploadFilesSequentially(files: File[], contextId: string): Promise<any[]>;
63
+ /**
64
+ * Alternative method to upload files sequentially with progress tracking
65
+ * @param files - Array of files to upload
66
+ * @param contextId - The context ID for upload
67
+ * @param onProgress - Optional callback for progress updates
68
+ * @returns {Promise<any[]>} Promise that resolves with all upload responses
69
+ */
70
+ uploadFilesSequentiallyWithProgress(files: File[], contextId: string, onProgress?: (currentFile: File, currentIndex: number, totalFiles: number) => void): Promise<any[]>;
71
+ /**
72
+ * Get the file and contextId
73
+ * @param file - The file to upload.
74
+ * @param contextId - The contextId to upload.
75
+ */
76
+ getUploadFileData(file: File, contextId: string): void;
77
+ /**
78
+ * Get the document name and document type id
79
+ * @param documentName - The document name to upload.
80
+ * @param documentTypeId - The document type id to upload.
81
+ */
82
+ getDocumentNameAndType(documentTypeId: string): void;
83
+ /**
84
+ * Handle the creation of formdata.
85
+ * @returns {*} - The formdata object.
86
+ */
87
+ handleCreateFormData(uploadedFile?: File, contextId?: string): FormData | null;
88
+ /**
89
+ * Generic method to sort any list of objects by a specified property.
90
+ * Supports fallback properties if the primary property is undefined.
91
+ * @param list - Array of objects to sort
92
+ * @param primaryProperty - Primary property to sort by
93
+ * @param fallbackProperty - Optional fallback property if primary is undefined
94
+ * @returns Sorted array
95
+ */
96
+ sortListByProperty<T>(list: T[], primaryProperty: keyof T, fallbackProperty?: keyof T): T[];
97
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentUploadService, never>;
98
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentUploadService>;
99
+ }
@@ -0,0 +1,97 @@
1
+ import { Observable } from 'rxjs';
2
+ import { DocumentHttpService } from './document-http.service';
3
+ import { DocumentHelperService } from './document.service';
4
+ import { DocumentListItem } from '../models/document-list-response.model';
5
+ import { DocumentHistorySection } from '../models/document-history.model';
6
+ import { DocumentAction } from './document-actions.service';
7
+ import { MessageService } from 'primeng/api';
8
+ import { DocumentStore } from '../state/document.store';
9
+ import { DocumentQuery } from '../state/document.query';
10
+ import * as i0 from "@angular/core";
11
+ export interface DocumentViewerState {
12
+ selectedDocument?: DocumentListItem;
13
+ documentHistory: DocumentHistorySection[];
14
+ showDocumentHistory: boolean;
15
+ isActionLoading: boolean;
16
+ documentStatus: 'pending' | 'accepted' | 'rejected';
17
+ documentIsUploaded: boolean;
18
+ alertData: any;
19
+ deleteError: any;
20
+ deleteSuccess: boolean;
21
+ }
22
+ export declare class DocumentViewerService {
23
+ private documentHttpService;
24
+ private documentService;
25
+ private messageService;
26
+ private documentStore;
27
+ private documentQuery;
28
+ constructor(documentHttpService: DocumentHttpService, documentService: DocumentHelperService, messageService: MessageService, documentStore: DocumentStore, documentQuery: DocumentQuery);
29
+ /**
30
+ * Gets the current document viewer state as an observable
31
+ */
32
+ get state$(): Observable<DocumentViewerState>;
33
+ /**
34
+ * Gets the current document viewer state synchronously
35
+ */
36
+ getCurrentState(): DocumentViewerState;
37
+ /**
38
+ * Updates the selected document and recalculates all computed properties
39
+ * @param document The selected document
40
+ */
41
+ updateSelectedDocument(document: DocumentListItem, skipLoadDocumentHistory?: boolean): void;
42
+ /**
43
+ * Loads document history data
44
+ * @param documentId The document ID
45
+ */
46
+ loadDocumentHistory(documentId: string): void;
47
+ /**
48
+ * Determines if the given content type is an image
49
+ * @param contentType The MIME type of the content
50
+ * @returns True if the content type is an image
51
+ */
52
+ isImage(contentType?: string): boolean;
53
+ /**
54
+ * Handles document actions and updates status
55
+ * @param action The action performed
56
+ * @param contextId The context ID for API calls
57
+ */
58
+ handleDocumentAction(action: DocumentAction, contextId?: string): void;
59
+ /**
60
+ * Updates the document status via API call and refreshes all related data
61
+ * @param status The new status (Approved, Rejected)
62
+ * @param description The status update description
63
+ * @param contextId The context ID for API calls
64
+ */
65
+ private updateDocumentStatus;
66
+ /**
67
+ * Deletes a document without immediate refresh - refresh will happen when viewer is closed
68
+ * @param documentId The ID of the document to delete
69
+ * @param contextId The context ID for API calls
70
+ */
71
+ private deleteDocument;
72
+ /**
73
+ * Refreshes all related data after document status update
74
+ * @param contextId The context ID for API calls
75
+ */
76
+ private refreshAllData;
77
+ /**
78
+ * Gets alert data for the document
79
+ * @param document The document
80
+ * @returns Alert data
81
+ */
82
+ private getAlertData;
83
+ /**
84
+ * Calculates the current status of the document for the actions component
85
+ * @param document The document
86
+ * @returns The current document status
87
+ */
88
+ private calculateDocumentStatus;
89
+ /**
90
+ * Calculates if the document is uploaded and ready for actions
91
+ * @param document The document
92
+ * @returns True if document is uploaded
93
+ */
94
+ private calculateIsDocumentUploaded;
95
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentViewerService, never>;
96
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentViewerService>;
97
+ }
@@ -0,0 +1,81 @@
1
+ import { Observable } from 'rxjs';
2
+ import * as i0 from "@angular/core";
3
+ export interface ZoomConfig {
4
+ defaultZoom: number;
5
+ zoomStep: number;
6
+ minZoom: number;
7
+ maxZoom: number;
8
+ }
9
+ export declare class DocumentZoomService {
10
+ private readonly DEFAULT_CONFIG;
11
+ private zoomLevelSubject;
12
+ private config;
13
+ /**
14
+ * Gets the current zoom level as an observable
15
+ */
16
+ get zoomLevel$(): Observable<number>;
17
+ /**
18
+ * Gets the current zoom level value
19
+ */
20
+ get currentZoom(): number;
21
+ /**
22
+ * Gets the current zoom configuration
23
+ */
24
+ get zoomConfig(): ZoomConfig;
25
+ /**
26
+ * Sets custom zoom configuration
27
+ */
28
+ setZoomConfig(config: Partial<ZoomConfig>): void;
29
+ /**
30
+ * Zooms in by the configured step
31
+ */
32
+ zoomIn(): void;
33
+ /**
34
+ * Zooms out by the configured step
35
+ */
36
+ zoomOut(): void;
37
+ /**
38
+ * Sets zoom to a specific level
39
+ */
40
+ setZoom(zoom: number): void;
41
+ /**
42
+ * Resets zoom to default level
43
+ */
44
+ resetZoom(): void;
45
+ /**
46
+ * Handles mouse wheel zoom
47
+ */
48
+ handleWheelZoom(event: WheelEvent, zoomFactor?: number): void;
49
+ /**
50
+ * Applies zoom transform to an iframe element
51
+ * @param iframe - The iframe element to apply zoom to
52
+ * @param zoomLevel - The zoom level to apply (defaults to current zoom)
53
+ */
54
+ applyIframeZoom(iframe: HTMLIFrameElement, zoomLevel?: number): void;
55
+ /**
56
+ * Applies zoom transform to multiple iframe elements
57
+ * @param iframes - Array of iframe elements to apply zoom to
58
+ * @param zoomLevel - The zoom level to apply (defaults to current zoom)
59
+ */
60
+ applyIframeZoomToMultiple(iframes: HTMLIFrameElement[], zoomLevel?: number): void;
61
+ /**
62
+ * Applies zoom transform to iframes within a container element
63
+ * @param container - The container element to search for iframes
64
+ * @param zoomLevel - The zoom level to apply (defaults to current zoom)
65
+ */
66
+ applyIframeZoomToContainer(container: HTMLElement, zoomLevel?: number): void;
67
+ /**
68
+ * Applies zoom transform to iframes within multiple container elements
69
+ * @param containers - Array of container elements to search for iframes
70
+ * @param zoomLevel - The zoom level to apply (defaults to current zoom)
71
+ */
72
+ applyIframeZoomToContainers(containers: HTMLElement[], zoomLevel?: number): void;
73
+ /**
74
+ * Applies zoom transform to iframes by CSS selector
75
+ * @param selector - CSS selector to find iframe containers
76
+ * @param zoomLevel - The zoom level to apply (defaults to current zoom)
77
+ */
78
+ applyIframeZoomBySelector(selector: string, zoomLevel?: number): void;
79
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentZoomService, never>;
80
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentZoomService>;
81
+ }
@@ -0,0 +1,161 @@
1
+ import { Observable } from "rxjs";
2
+ import { DocumentModel } from "../models/document.model";
3
+ import { DocumentStore } from "../state/document.store";
4
+ import { DocumentQuery } from "../state/document.query";
5
+ import { DocumentHttpService } from "./document-http.service";
6
+ import { DocumentMenuService } from "./document-menu.service";
7
+ import * as i0 from "@angular/core";
8
+ /**
9
+ * Service to manage the document data and selection state
10
+ */
11
+ export declare class DocumentHelperService {
12
+ private documentStore;
13
+ private documentQuery;
14
+ private documentHttpService;
15
+ private documentMenuService;
16
+ private selectionWatcherSubscription;
17
+ constructor(documentStore: DocumentStore, documentQuery: DocumentQuery, documentHttpService: DocumentHttpService, documentMenuService: DocumentMenuService);
18
+ /**
19
+ * Initialize watcher for selection state changes
20
+ * @param contextId - The context ID to use for API calls
21
+ */
22
+ initializeSelectionWatcher(contextId: string): void;
23
+ /**
24
+ * Initialize watcher for selection state changes with initial load
25
+ * @param contextId - The context ID to use for API calls
26
+ */
27
+ initializeSelectionWatcherWithInitialLoad(contextId: string): void;
28
+ /**
29
+ * Clean up the selection watcher subscription
30
+ */
31
+ cleanupSelectionWatcher(): void;
32
+ /**
33
+ * Set the document data
34
+ * @param document the document data
35
+ */
36
+ set(document: DocumentModel | null): void;
37
+ /**
38
+ * Get the document data
39
+ * @returns the document data
40
+ */
41
+ get(): Observable<DocumentModel | null>;
42
+ /**
43
+ * Get the current document value synchronously
44
+ * @returns the current document value
45
+ */
46
+ getValue(): DocumentModel | null;
47
+ /**
48
+ * Set the selected menu item
49
+ * @param menuItem the selected menu item _id (not the label)
50
+ */
51
+ setSelectedMenuItem(menuItem: string | null): void;
52
+ /**
53
+ * Set the selected user ID
54
+ * @param userId the selected user ID
55
+ */
56
+ setSelectedUserId(userId: string | null): void;
57
+ /**
58
+ * Set the selected status
59
+ * @param status the selected status
60
+ */
61
+ setSelectedStatus(status: string | null): void;
62
+ /**
63
+ * Set the search key
64
+ * @param searchKey the search term
65
+ */
66
+ setSearchKey(searchKey: string | null): void;
67
+ /**
68
+ * Set all selection state at once
69
+ * @param menuItem the selected menu item _id (not the label)
70
+ * @param userId the selected user ID
71
+ * @param status the selected status
72
+ * @param searchKey the search term
73
+ */
74
+ setSelectionState(menuItem: string | null, userId: string | null, status: string | null, searchKey?: string | null): void;
75
+ /**
76
+ * Clear all selection state
77
+ */
78
+ clearSelectionState(): void;
79
+ /**
80
+ * Set user list visibility
81
+ * @param show whether to show the user list
82
+ */
83
+ setShowUserList(show: boolean): void;
84
+ /**
85
+ * Get the current selection state
86
+ * @returns observable of the current selection state
87
+ */
88
+ getSelectionState(): Observable<{
89
+ menuItem: string | null;
90
+ userId: string | null;
91
+ status: string | null;
92
+ }>;
93
+ /**
94
+ * Get the current selection state value synchronously
95
+ * @returns the current selection state value
96
+ */
97
+ getSelectionStateValue(): {
98
+ menuItem: string | null;
99
+ userId: string | null;
100
+ status: string | null;
101
+ };
102
+ /**
103
+ * Set status data in the store
104
+ * @param statusData the status data to set
105
+ */
106
+ setStatusData(statusData: any[]): void;
107
+ /**
108
+ * Set user list in the store
109
+ * @param userList the user list to set
110
+ */
111
+ setUserList(userList: any[]): void;
112
+ /**
113
+ * Get observable for filtered documents
114
+ * @returns Observable that emits filtered document responses
115
+ */
116
+ getFilteredDocuments(): Observable<any>;
117
+ /**
118
+ * Manually trigger API call with current selection state
119
+ * @param contextId - The context ID to use for the API call
120
+ */
121
+ refreshDocumentsWithCurrentSelection(contextId: string): void;
122
+ /**
123
+ * Force refresh documents with no filters
124
+ * @param contextId - The context ID to use for the API call
125
+ */
126
+ refreshDocumentsWithoutFilters(contextId: string): void;
127
+ /**
128
+ * Refresh status data for a specific context
129
+ * @param contextId - The context ID to use for the API call
130
+ * @param statusContextId - The status context ID (usually userId)
131
+ * @param categoryId - The category ID (usually menuItem)
132
+ */
133
+ refreshStatusData(contextId: string, statusContextId: string | null, categoryId: string | null): void;
134
+ /**
135
+ * Refresh all data with current filters after accept/reject/delete operations
136
+ * This includes document categories, status data, user list, and document list
137
+ *
138
+ * This method ensures that after a document action (accept/reject/delete):
139
+ * 1. Document categories are refreshed
140
+ * 2. Status counts are refreshed with current user filters
141
+ * 3. User list is refreshed with current filters (if applicable)
142
+ * 4. Document list is refreshed with current filters (user, status, search)
143
+ *
144
+ * Filter application:
145
+ * - Document categories: Uses base contextId
146
+ * - Status data: Uses userId as contextId (no category filtering)
147
+ * - User list: Uses base contextId (can be enhanced with additional filters if API supports)
148
+ * - Document list: Uses current filters (userId, status, searchKey)
149
+ *
150
+ * @param contextId - The context ID to use for the API calls
151
+ */
152
+ refreshAllDataWithCurrentFilters(contextId: string): void;
153
+ /**
154
+ * Checks if the currently selected menu item's section is visible in the filtered document list
155
+ * and deselects it if not visible
156
+ * @param contextId - The context ID to use for API calls
157
+ */
158
+ checkAndDeselectMenuItemIfSectionNotVisible(contextId: string): void;
159
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHelperService, never>;
160
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentHelperService>;
161
+ }
@@ -0,0 +1,116 @@
1
+ import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
2
+ import { Observable } from 'rxjs';
3
+ import { HttpClient } from '@angular/common/http';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Interface for parsed email data
7
+ */
8
+ export interface ParsedEmailData {
9
+ from: string;
10
+ to: string;
11
+ cc?: string;
12
+ subject: string;
13
+ date: string;
14
+ body: string;
15
+ isHtml: boolean;
16
+ attachments?: EmailAttachment[];
17
+ }
18
+ /**
19
+ * Interface for email attachments
20
+ */
21
+ export interface EmailAttachment {
22
+ filename: string;
23
+ contentType: string;
24
+ size: number;
25
+ }
26
+ /**
27
+ * Service for parsing EML (email message) files
28
+ * Handles both plain text and HTML email content
29
+ */
30
+ export declare class EmlParserService {
31
+ private sanitizer;
32
+ private http;
33
+ constructor(sanitizer: DomSanitizer, http: HttpClient);
34
+ /**
35
+ * Parses EML file content
36
+ * @param emlContent - Raw EML file content as string
37
+ * @returns Parsed email data
38
+ */
39
+ parseEmlData(emlContent: string): ParsedEmailData | null;
40
+ /**
41
+ * Parses email headers from EML content
42
+ * @param lines - Lines of the EML file
43
+ * @returns Object containing parsed headers
44
+ */
45
+ private parseHeaders;
46
+ /**
47
+ * Parses the email body from EML content
48
+ * @param lines - Lines of the EML file
49
+ * @returns Object containing body content and format information
50
+ */
51
+ private parseBody;
52
+ /**
53
+ * Extracts body from multipart email
54
+ * @param content - Email content
55
+ * @param boundary - Multipart boundary string
56
+ * @param preferredType - Preferred content type
57
+ * @returns Array of body lines
58
+ */
59
+ private extractMultipartBody;
60
+ /**
61
+ * Decodes quoted-printable encoded content
62
+ * @param content - Quoted-printable encoded string
63
+ * @returns Decoded string
64
+ */
65
+ private decodeQuotedPrintable;
66
+ /**
67
+ * Sanitizes HTML content for safe display
68
+ * @param html - Raw HTML content
69
+ * @returns Sanitized HTML
70
+ */
71
+ private sanitizeHtmlContent;
72
+ /**
73
+ * Parses attachment information from EML content
74
+ * @param emlContent - Raw EML content
75
+ * @returns Array of attachment information
76
+ */
77
+ private parseAttachments;
78
+ /**
79
+ * Cleans and formats email addresses
80
+ * @param email - Raw email address string
81
+ * @returns Cleaned email address
82
+ */
83
+ private cleanEmailAddress;
84
+ /**
85
+ * Decodes encoded email headers (RFC 2047)
86
+ * @param header - Encoded header string
87
+ * @returns Decoded header string
88
+ */
89
+ private decodeHeader;
90
+ /**
91
+ * Formats email date to readable format
92
+ * @param dateStr - Raw date string from email
93
+ * @returns Formatted date string
94
+ */
95
+ private formatDate;
96
+ /**
97
+ * Sanitizes HTML for Angular display
98
+ * @param html - HTML string
99
+ * @returns SafeHtml for Angular templates
100
+ */
101
+ getSafeHtml(html: string): SafeHtml;
102
+ /**
103
+ * Downloads and parses an EML file from a URL
104
+ * @param documentUrl - URL of the EML file
105
+ * @returns Observable of parsed email data
106
+ */
107
+ loadAndParseEmail(documentUrl: string): Observable<ParsedEmailData>;
108
+ /**
109
+ * Downloads an email file with appropriate authentication handling
110
+ * @param documentUrl - URL of the email file
111
+ * @returns Observable of file content as text
112
+ */
113
+ private downloadEmailFile;
114
+ static ɵfac: i0.ɵɵFactoryDeclaration<EmlParserService, never>;
115
+ static ɵprov: i0.ɵɵInjectableDeclaration<EmlParserService>;
116
+ }