cat-documents-ng 0.0.21 → 0.0.22

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.
@@ -1,6 +1,9 @@
1
1
  import { OnInit } from '@angular/core';
2
2
  import { DocumentService } from '../../state/document.service';
3
3
  import { DocumentModel } from '../../models/document.model';
4
+ import { DocumentHttpService } from '../../services/document-http.service';
5
+ import { ParentFolderData } from '../../models/document-type.model';
6
+ import { DocumentQuery } from '../../state/document.query';
4
7
  import * as i0 from "@angular/core";
5
8
  /**
6
9
  *This component is responsible for managing and displaying a list of documents.
@@ -9,22 +12,29 @@ import * as i0 from "@angular/core";
9
12
  */
10
13
  export declare class DocumentContainerComponent implements OnInit {
11
14
  documentService: DocumentService;
15
+ documentQuery: DocumentQuery;
16
+ documentHttpService: DocumentHttpService;
12
17
  /**
13
18
  * Creates an instance of DocumentContainerComponent.
14
19
  * @class
15
20
  * @param {DocumentService} documentService - Service to manage document-related operations.
16
21
  */
17
- constructor(documentService: DocumentService);
22
+ constructor(documentService: DocumentService, documentQuery: DocumentQuery, documentHttpService: DocumentHttpService);
18
23
  /**
19
24
  * Get contextId in input.
20
25
  * @type {string}
21
26
  */
22
27
  contextId: string;
23
28
  /**
24
- * The list of dummy documents.
29
+ * The list of documents.
25
30
  * @type {Array}
26
31
  */
27
32
  documentList: DocumentModel[];
33
+ /**
34
+ * The list of folders.
35
+ * @type {Array}
36
+ */
37
+ folderList: ParentFolderData[];
28
38
  /**
29
39
  * Holds the subscription to manage observable cleanup.
30
40
  * @private
@@ -32,9 +42,21 @@ export declare class DocumentContainerComponent implements OnInit {
32
42
  */
33
43
  private subscription;
34
44
  /**
35
- * Call document service method to get the document by contextId.
45
+ * Fetches the folder and document data on initialization.
46
+ * @returns {void}
36
47
  */
37
48
  ngOnInit(): void;
49
+ /**
50
+ * Fetches the folder data from the API.
51
+ * @returns {void}
52
+ */
53
+ private fetchFolder;
54
+ /**
55
+ * Fetches the document data from the API.
56
+ * @param folderBlockId - The folder ID to fetch the document.
57
+ * @returns {void}
58
+ */
59
+ private fetchDocuments;
38
60
  /**
39
61
  * Unsubscribe subscription on destroy of component .
40
62
  */
@@ -1,47 +1,109 @@
1
+ import { OnInit } from '@angular/core';
1
2
  import { DocumentModel } from '../../models/document.model';
3
+ import { DocumentHttpService } from '../../services/document-http.service';
4
+ import { DocumentUploadService } from '../../services/document-upload.service';
2
5
  import * as i0 from "@angular/core";
3
6
  /**
4
- * This component is responsible for displaying a list of documents.
7
+ * This component is responsible for displaying and managing a list of documents.
8
+ * Provides functionality for file upload, document selection, and dialog management.
5
9
  * @class DocumentListComponent
6
- * @typedef {DocumentListComponent}
7
10
  */
8
- export declare class DocumentListComponent {
11
+ export declare class DocumentListComponent implements OnInit {
12
+ documentUploadService: DocumentUploadService;
13
+ documentHttpService: DocumentHttpService;
9
14
  /**
10
- * Represent contextId
15
+ * Represents the context ID for the document list.
16
+ * This value is passed from the parent component.
11
17
  * @type {string}
18
+ * @memberof DocumentListComponent
12
19
  */
13
20
  contextId: string;
21
+ /**
22
+ * The currently selected document.
23
+ * @type {DocumentModel}
24
+ * @memberof DocumentListComponent
25
+ */
14
26
  selectedDocument: DocumentModel;
15
27
  /**
16
- * Default visbility of sidebar
28
+ * Default visibility of the sidebar.
17
29
  * @type {boolean}
30
+ * @memberof DocumentListComponent
18
31
  */
19
32
  isSidebarVisible: boolean;
20
33
  /**
21
- * Default visbility of dialog
34
+ * Default visibility of the dialog.
22
35
  * @type {boolean}
36
+ * @memberof DocumentListComponent
23
37
  */
24
38
  isdialogVisible: boolean;
25
39
  /**
26
40
  * The list of documents to display.
41
+ * This value is passed from the parent component.
27
42
  * @type {DocumentModel[]}
43
+ * @memberof DocumentListComponent
28
44
  */
29
45
  documentList: DocumentModel[];
46
+ /**
47
+ * The name of the document being uploaded or managed.
48
+ * @type {string}
49
+ * @memberof DocumentListComponent
50
+ */
51
+ documentName: string;
52
+ /**
53
+ * Available document types for selection.
54
+ * @type {string[]}
55
+ * @memberof DocumentListComponent
56
+ */
57
+ options: any[];
58
+ /**
59
+ * The selected option for the document type.
60
+ * @type {(string | null)}
61
+ * @memberof DocumentListComponent
62
+ */
63
+ selectedOption: string | null;
64
+ /**
65
+ * Creates an instance of DocumentListComponent.
66
+ * @class
67
+ * @param {DocumentUploadService} documentUploadService - The service responsible for uploading documents.
68
+ * @param {DocumentHttpService} documentHttpService - The service responsible for fetching documents from the server.
69
+ */
70
+ constructor(documentUploadService: DocumentUploadService, documentHttpService: DocumentHttpService);
71
+ /**
72
+ * Initializes the component by fetching the document type list.
73
+ */
74
+ ngOnInit(): void;
30
75
  /**
31
76
  * Handles the click event for file upload.
32
77
  * Prevents event propagation and displays the sidebar.
33
78
  * @param {MouseEvent} event - The click event triggered by the user.
79
+ * @memberof DocumentListComponent
34
80
  */
35
81
  handleFileUploadClick(event: MouseEvent): void;
36
82
  /**
37
- * Select a individual document.
38
- * @param {*} docuemnt - The document that was clicked by the user.
83
+ * Handles the selection of an individual document.
84
+ * Opens a dialog to display or manage the selected document.
85
+ * @param {DocumentModel} document - The document that was clicked by the user.
86
+ * @memberof DocumentListComponent
39
87
  */
40
- handleClickForDocument(docuemnt: DocumentModel): void;
88
+ handleClickForDocument(document: DocumentModel): void;
41
89
  /**
42
- * Close dialog.
90
+ * Closes the dialog and resets the selected document.
91
+ * @memberof DocumentListComponent
43
92
  */
44
93
  handleCloseModel(): void;
94
+ /**
95
+ * Handles the upload action for a document.
96
+ * Validates if a document type is selected and logs the result.
97
+ * @memberof DocumentListComponent
98
+ */
99
+ handleUploadDocument(): void;
100
+ /**
101
+ * Fetches the list of document types from the server.
102
+ * Updates the options array with the available document types.
103
+ * @memberof DocumentListComponent
104
+ * @returns {void}
105
+ */
106
+ getDocumentTypeList(): void;
45
107
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentListComponent, never>;
46
108
  static ɵcmp: i0.ɵɵComponentDeclaration<DocumentListComponent, "lib-document-list", never, { "contextId": { "alias": "contextId"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; }, {}, never, never, false, never>;
47
109
  }
@@ -1,30 +1,32 @@
1
- import { ChangeDetectorRef, EventEmitter } from '@angular/core';
1
+ import { ChangeDetectorRef } from '@angular/core';
2
2
  import { FileUpload } from 'primeng/fileupload';
3
3
  import { MessageService } from 'primeng/api';
4
4
  import { PrimeNGConfig } from 'primeng/api';
5
5
  import { FileFormatService } from '../../services/file-format.service';
6
6
  import { DocumentService } from '../../state/document.service';
7
+ import { DocumentUploadService } from '../../services/document-upload.service';
7
8
  import * as i0 from "@angular/core";
8
9
  /**
9
10
  * A component for handling document uploads, including file selection, removal, and progress tracking.
10
11
  * @class DocumentUploadComponent
11
12
  */
12
13
  export declare class DocumentUploadComponent {
14
+ documentUpload: DocumentUploadService;
13
15
  uploadService: DocumentService;
14
16
  private config;
15
17
  fileFormatService: FileFormatService;
16
18
  messageService: MessageService;
17
19
  cdr: ChangeDetectorRef;
20
+ /**
21
+ * Represents the file size.
22
+ * @type {number}
23
+ */
24
+ fileSize: string;
18
25
  /**
19
26
  * Represent contextId
20
27
  * @type {string}
21
28
  */
22
29
  contextId: string;
23
- /**
24
- * Provide id of file after upload.
25
- * @type {*}
26
- */
27
- onInput: EventEmitter<any>;
28
30
  /**
29
31
  * To make file explorer visible.
30
32
  * @type {!FileUpload}
@@ -35,7 +37,11 @@ export declare class DocumentUploadComponent {
35
37
  * List of files selected for upload.
36
38
  * @type {File[]}
37
39
  */
38
- uploadedFiles: any[];
40
+ uploadedFiles: {
41
+ file: File;
42
+ formattedSize: string;
43
+ progress: number;
44
+ }[];
39
45
  /**
40
46
  * Percentage of the total size calculated for displaying upload progress.
41
47
  * @type {number}
@@ -49,13 +55,14 @@ export declare class DocumentUploadComponent {
49
55
  /**
50
56
  * Creates an instance of DocumentUploadComponent.
51
57
  * @class
58
+ * @param {DocumentUploadService} documentUpload - Service for handling document upload.
52
59
  * @param {DocumentService} uploadService - Service for handling document upload.
53
60
  * @param {PrimeNGConfig} config - PrimeNG configuration.
54
61
  * @param {FileFormatService} fileFormatService - Service for formatting file sizes.
55
62
  * @param {MessageService} messageService - Service for displaying messages.
56
63
  * @param {ChangeDetectorRef} cdr - Service for detecting changes.
57
64
  */
58
- constructor(uploadService: DocumentService, config: PrimeNGConfig, fileFormatService: FileFormatService, messageService: MessageService, cdr: ChangeDetectorRef);
65
+ constructor(documentUpload: DocumentUploadService, uploadService: DocumentService, config: PrimeNGConfig, fileFormatService: FileFormatService, messageService: MessageService, cdr: ChangeDetectorRef);
59
66
  /**
60
67
  * Open the file explorer.
61
68
  * @param {*} event - The triggering event.
@@ -73,14 +80,14 @@ export declare class DocumentUploadComponent {
73
80
  /**
74
81
  * Handle the creation of formdata.
75
82
  * @param {File} file - The file to append in formdata.
76
- * @returns {*}
83
+ * @returns {*} - The formdata object.
77
84
  */
78
85
  handleCreateFormData(file: File): FormData;
79
86
  /**
80
- * Handles the event when new files are selected.
81
- * @param { { currentFiles: File[] } } event - The event containing the newly selected files.
82
- * @returns {void}
83
- */
87
+ * Handles the event when new files are selected.
88
+ * @param { { currentFiles: File[] } } event - The event containing the newly selected files.
89
+ * @returns {void} - No return value.
90
+ */
84
91
  onSelectedFiles(event: {
85
92
  currentFiles: File[];
86
93
  }): void;
@@ -89,7 +96,7 @@ export declare class DocumentUploadComponent {
89
96
  * @param {number} bytes - The size of the file in bytes.
90
97
  * @returns {string} The formatted file size (e.g., '1.2 KB', '2.3 MB').
91
98
  */
92
- formatSize(bytes: number): string;
99
+ formatSize(bytes: number): void;
93
100
  /**
94
101
  * Handles the removal of a file from the uploaded files list.
95
102
  * @param {File} file - The file to be removed.
@@ -109,5 +116,5 @@ export declare class DocumentUploadComponent {
109
116
  */
110
117
  triggerFileUpload(): void;
111
118
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentUploadComponent, never>;
112
- static ɵcmp: i0.ɵɵComponentDeclaration<DocumentUploadComponent, "lib-document-upload", never, { "contextId": { "alias": "contextId"; "required": false; }; }, { "onInput": "onInput"; }, never, never, false, never>;
119
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentUploadComponent, "lib-document-upload", never, { "contextId": { "alias": "contextId"; "required": false; }; }, {}, never, never, false, never>;
113
120
  }
@@ -1,35 +1,15 @@
1
- import { OnInit } from '@angular/core';
1
+ import { OnChanges, OnDestroy } from '@angular/core';
2
2
  import { DynamicDialogRef } from 'primeng/dynamicdialog';
3
+ import { DocumentHttpService } from '../../services/document-http.service';
3
4
  import * as i0 from "@angular/core";
4
- /**
5
- * For list box data.
6
- * @interface Country
7
- * @typedef {Country}
8
- */
9
- interface Country {
10
- /**
11
- * For the name of the property.
12
- * @type {string}
13
- */
14
- name: string;
15
- /**
16
- * For the unique code of country.
17
- * @type {string}
18
- */
19
- code: string;
20
- /**
21
- * Mark check or unchecked.
22
- * @type {?boolean}
23
- */
24
- checked?: boolean;
25
- }
26
5
  /**
27
6
  * Component for viewing and managing document details.
28
7
  * @class DocumentViewerComponent
29
8
  * @typedef {DocumentViewerComponent}
30
9
  * @implements {OnInit}
31
10
  */
32
- export declare class DocumentViewerComponent implements OnInit {
11
+ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
12
+ documentHttpService: DocumentHttpService;
33
13
  /**
34
14
  * Get the selected document by user.
35
15
  * @type {*}
@@ -40,21 +20,11 @@ export declare class DocumentViewerComponent implements OnInit {
40
20
  * @type {!string}
41
21
  */
42
22
  notes: string;
43
- /**
44
- * Country data according to Country model.
45
- * @type {!Country[]}
46
- */
47
- countries: Country[];
48
23
  /**
49
24
  * Indicates whether a checkbox is selected.
50
25
  * @type {boolean}
51
26
  */
52
27
  checked: boolean;
53
- /**
54
- * The currently selected country.
55
- * @type {Country}
56
- */
57
- selectedCountry: Country;
58
28
  /**
59
29
  * Reference to the dynamic dialog used for displaying additional details.
60
30
  * @type {(DynamicDialogRef | undefined)}
@@ -92,22 +62,28 @@ export declare class DocumentViewerComponent implements OnInit {
92
62
  * @type {any}
93
63
  */
94
64
  alertData: any;
65
+ /**
66
+ * Holds the subscription to manage observable cleanup.
67
+ * @private
68
+ * @type {Subscription}
69
+ */
70
+ private subscription;
95
71
  /**
96
72
  * Initializes a new instance of the DocumentViewerComponent.
97
73
  */
98
- constructor();
74
+ constructor(documentHttpService: DocumentHttpService);
99
75
  /**
100
- * Lifecycle hook that is called after data-bound properties are initialized.
101
- * Initializes the list of countries.
76
+ * Fetches the alerts for the selected document.
77
+ * @returns {void}
102
78
  */
103
- ngOnInit(): void;
79
+ ngOnChanges(): void;
104
80
  /**
105
81
  * Determines if the given content type is an image.
106
82
  * @param {string} contentType - The MIME type of the content.
107
83
  * @returns {boolean} `true` if the content type is an image; otherwise, `false`.
108
84
  */
109
85
  isImage(contentType: string): boolean;
86
+ ngOnDestroy(): void;
110
87
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentViewerComponent, never>;
111
88
  static ɵcmp: i0.ɵɵComponentDeclaration<DocumentViewerComponent, "document-viewer", never, { "selectedDocument": { "alias": "selectedDocument"; "required": false; }; }, {}, never, never, false, never>;
112
89
  }
113
- export {};
@@ -1,5 +1,5 @@
1
1
  import { DocumentStore } from '../../state/document.store';
2
- import { FolderBlockModel } from '../../models/folder.model';
2
+ import { ParentFolderData } from '../../models/document-type.model';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * The `FolderBlockComponent` is responsible for displaying a block of folders and
@@ -14,7 +14,7 @@ export declare class FolderBlockComponent {
14
14
  * Array of folder blocks data to display.
15
15
  * Each folder is represented as a `FolderBlockModel`.
16
16
  */
17
- folderBlocks: FolderBlockModel[];
17
+ folderList: ParentFolderData[];
18
18
  /** Number of missing files, sourced from the `SHARED` constants. */
19
19
  missingFileCount: number;
20
20
  /** Number of pending files, sourced from the `SHARED` constants. */
@@ -33,5 +33,5 @@ export declare class FolderBlockComponent {
33
33
  */
34
34
  handleClickForFilter(folderBlockId: string): string;
35
35
  static ɵfac: i0.ɵɵFactoryDeclaration<FolderBlockComponent, never>;
36
- static ɵcmp: i0.ɵɵComponentDeclaration<FolderBlockComponent, "lib-folder-block", never, { "folderBlocks": { "alias": "folderBlocks"; "required": false; }; }, {}, never, never, false, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<FolderBlockComponent, "lib-folder-block", never, { "folderList": { "alias": "folderList"; "required": false; }; }, {}, never, never, false, never>;
37
37
  }
@@ -1,4 +1,5 @@
1
1
  import { DocumentModel } from '../../models/document.model';
2
+ import { ParentFolderData } from '../../models/document-type.model';
2
3
  import * as i0 from "@angular/core";
3
4
  /**
4
5
  * The `FolderContainerComponent` is responsible for rendering a container
@@ -13,6 +14,16 @@ export declare class FolderContainerComponent {
13
14
  * Represents the document data to be displayed in the folder container.
14
15
  */
15
16
  documentList?: DocumentModel[];
17
+ /**
18
+ * A list of documents passed as input to the component.
19
+ * Represents the document data to be displayed in the folder container.
20
+ */
21
+ folderList: ParentFolderData[];
22
+ /**
23
+ * The context ID for the folder container.
24
+ * @type {string}
25
+ */
26
+ contextId: string;
16
27
  /**
17
28
  * Folder blocks data, sourced from the `SHARED` constants.
18
29
  */
@@ -24,5 +35,5 @@ export declare class FolderContainerComponent {
24
35
  pendingFiles: number;
25
36
  }[];
26
37
  static ɵfac: i0.ɵɵFactoryDeclaration<FolderContainerComponent, never>;
27
- static ɵcmp: i0.ɵɵComponentDeclaration<FolderContainerComponent, "lib-folder-container", never, { "documentList": { "alias": "documentList"; "required": false; }; }, {}, never, never, false, never>;
38
+ static ɵcmp: i0.ɵɵComponentDeclaration<FolderContainerComponent, "lib-folder-container", never, { "documentList": { "alias": "documentList"; "required": false; }; "folderList": { "alias": "folderList"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; }, {}, never, never, false, never>;
28
39
  }
@@ -21,6 +21,8 @@ import * as i19 from "primeng/inputtextarea";
21
21
  import * as i20 from "@angular/forms";
22
22
  import * as i21 from "ng2-pdf-viewer";
23
23
  import * as i22 from "primeng/dialog";
24
+ import * as i23 from "primeng/dropdown";
25
+ import * as i24 from "primeng/inputtext";
24
26
  /**
25
27
  * @module DocumentModule
26
28
  *
@@ -30,6 +32,6 @@ import * as i22 from "primeng/dialog";
30
32
  */
31
33
  export declare class DocumentModule {
32
34
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentModule, never>;
33
- static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentModule, [typeof i1.DocumentContainerComponent, typeof i2.FolderContainerComponent, typeof i3.FolderBlockComponent, typeof i4.DocumentListComponent, typeof i5.DocumentListItemComponent, typeof i6.DocumentUploadComponent, typeof i7.DocumentViewerComponent], [typeof i8.CommonModule, typeof i9.AccordionModule, typeof i10.HttpClientModule, typeof i11.ButtonModule, typeof i12.SidebarModule, typeof i13.FileUploadModule, typeof i14.ProgressBarModule, typeof i15.BadgeModule, typeof i16.ListboxModule, typeof i17.CheckboxModule, typeof i18.TimelineModule, typeof i19.InputTextareaModule, typeof i20.FormsModule, typeof i21.PdfViewerModule, typeof i22.DialogModule], [typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent]>;
35
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentModule, [typeof i1.DocumentContainerComponent, typeof i2.FolderContainerComponent, typeof i3.FolderBlockComponent, typeof i4.DocumentListComponent, typeof i5.DocumentListItemComponent, typeof i6.DocumentUploadComponent, typeof i7.DocumentViewerComponent], [typeof i8.CommonModule, typeof i9.AccordionModule, typeof i10.HttpClientModule, typeof i11.ButtonModule, typeof i12.SidebarModule, typeof i13.FileUploadModule, typeof i14.ProgressBarModule, typeof i15.BadgeModule, typeof i16.ListboxModule, typeof i17.CheckboxModule, typeof i18.TimelineModule, typeof i19.InputTextareaModule, typeof i20.FormsModule, typeof i21.PdfViewerModule, typeof i22.DialogModule, typeof i23.DropdownModule, typeof i24.InputTextModule], [typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent]>;
34
36
  static ɵinj: i0.ɵɵInjectorDeclaration<DocumentModule>;
35
37
  }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * The `DocumentAlertModel` is responsible for managing and displaying alert messages for documents.
3
+ * @export
4
+ * @class DocumentAlertModel
5
+ * @typedef {DocumentAlertModel} - Represents the document alert model.
6
+ */
7
+ export declare class DocumentAlertModel {
8
+ /**
9
+ * The unique identifier for the document alert.
10
+ * @type {string}
11
+ */
12
+ _id: string;
13
+ /**
14
+ * The alert status for the document.
15
+ * @type {string}
16
+ */
17
+ alertStatus?: string;
18
+ /**
19
+ * The context ID for the document.
20
+ * @type {?string}
21
+ */
22
+ contextId?: string;
23
+ /**
24
+ * The document ID for the document.
25
+ * @type {?string}
26
+ */
27
+ documentId?: string;
28
+ /**
29
+ * The alert message for the document.
30
+ * @type {?string}
31
+ */
32
+ alertMessage?: string;
33
+ /**
34
+ * The alert type for the document.
35
+ * @type {?string}
36
+ */
37
+ status?: string;
38
+ }
@@ -0,0 +1,74 @@
1
+ /**
2
+ * ParentFolderData
3
+ * @export
4
+ * @interface ParentFolderData - Model for parent folder data.
5
+ * @typedef {ParentFolderData} - Model for parent folder data.
6
+ */
7
+ export interface ParentFolderData {
8
+ /**
9
+ * The unique identifier for the parent folder.
10
+ * @type {string}
11
+ */
12
+ _id: string;
13
+ /**
14
+ * The number of documents in the folder.
15
+ * @type {number}
16
+ */
17
+ documentCount: number;
18
+ /**
19
+ * The name of the folder.
20
+ * @type {string}
21
+ */
22
+ folderName: string;
23
+ }
24
+ /**
25
+ * DocumentType
26
+ * @export
27
+ * @interface DocumentType - Model for document types.
28
+ * @typedef {DocumentType} - Model for document types.
29
+ */
30
+ export interface DocumentType {
31
+ /**
32
+ * The unique identifier for the document type.
33
+ * @type {string}
34
+ */
35
+ _id: string;
36
+ /**
37
+ * The name of the document type.
38
+ * @type {string}
39
+ */
40
+ name: string;
41
+ /**
42
+ * The label for the document type.
43
+ * @type {string}
44
+ */
45
+ label?: string;
46
+ /**
47
+ * The description of the document type.
48
+ * @type {string}
49
+ */
50
+ matchRules?: string;
51
+ /**
52
+ * parentDocumentTypeId - The unique identifier for the parent document type.
53
+ * @type {string}
54
+ */
55
+ parentDocumentTypeId: string | null;
56
+ }
57
+ /**
58
+ * DocumentTypeModel
59
+ * @export
60
+ * @interface DocumentTypeModel - Model for document types.
61
+ * @typedef {DocumentTypeModel} - Model for document types.
62
+ */
63
+ export interface DocumentTypeModel {
64
+ /**
65
+ * The list of parent folder data.
66
+ * @type {ParentFolderData[]}
67
+ */
68
+ parentFolderData: ParentFolderData[];
69
+ /**
70
+ * The list of all document types.
71
+ * @type {DocumentType[]}
72
+ */
73
+ allDocumentTypes: DocumentType[];
74
+ }
@@ -0,0 +1,51 @@
1
+ import { Observable } from 'rxjs';
2
+ import { AppConfigService } from '../../../Shared/services/app-config.service';
3
+ import { DocumentStore } from '../state/document.store';
4
+ import { HttpClient } from '@angular/common/http';
5
+ import { DocumentTypeModel } from '../models/document-type.model';
6
+ import { DocumentAlertModel } from '../models/document-alert.model';
7
+ import { DocumentModel } from '../models/document.model';
8
+ import * as i0 from "@angular/core";
9
+ /**
10
+ * Service for making HTTP requests related to documents.
11
+ * @class DocumentHttpService
12
+ * @typedef {DocumentHttpService}
13
+ */
14
+ export declare class DocumentHttpService {
15
+ documentStore: DocumentStore;
16
+ private http;
17
+ appConfigService: AppConfigService;
18
+ /**
19
+ * Creates an instance of DocumentService.
20
+ * @param {DocumentStore} documentStore - Store managing the state of documents.
21
+ * @param {HttpClient} http - Angular HTTP client for making API requests.
22
+ * @param {AppConfigService} appConfigService - Service for retrieving application configuration, such as API base URL.
23
+ */
24
+ constructor(documentStore: DocumentStore, http: HttpClient, appConfigService: AppConfigService);
25
+ /**
26
+ * Get api url from appConfigService.
27
+ * @readonly
28
+ * @type {string}
29
+ */
30
+ get apiUrl(): string;
31
+ /**
32
+ * Fetches a document by its path name and transforms the response for dropdown options.
33
+ * Includes error handling for failed API requests.
34
+ * @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
35
+ */
36
+ getDocumentTypes(): Observable<DocumentTypeModel>;
37
+ /**
38
+ * Fetches a document by its path name and transforms the response for dropdown options.
39
+ * @param documentId - The document ID to fetch the document.
40
+ * @returns
41
+ */
42
+ getAlertsByDocumentID(documentId: string): Observable<DocumentAlertModel>;
43
+ /**
44
+ * Fetches a document by its folder ID and transforms the response for dropdown options.
45
+ * @param folderId - The folder ID to fetch the document.
46
+ * @returns
47
+ */
48
+ getDocumentByFolderID(folderId: string): Observable<DocumentModel[]>;
49
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHttpService, never>;
50
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentHttpService>;
51
+ }