cat-documents-ng 0.0.22 → 0.0.23

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,8 +1,8 @@
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 { FolderBlockModel } from '../../models/folder.model';
4
5
  import { DocumentHttpService } from '../../services/document-http.service';
5
- import { ParentFolderData } from '../../models/document-type.model';
6
6
  import { DocumentQuery } from '../../state/document.query';
7
7
  import * as i0 from "@angular/core";
8
8
  /**
@@ -16,8 +16,9 @@ export declare class DocumentContainerComponent implements OnInit {
16
16
  documentHttpService: DocumentHttpService;
17
17
  /**
18
18
  * Creates an instance of DocumentContainerComponent.
19
- * @class
20
19
  * @param {DocumentService} documentService - Service to manage document-related operations.
20
+ * @param {DocumentQuery} documentQuery - Query service to manage document-related state.
21
+ * @param {DocumentHttpService} documentHttpService - Service to make HTTP requests related to documents.
21
22
  */
22
23
  constructor(documentService: DocumentService, documentQuery: DocumentQuery, documentHttpService: DocumentHttpService);
23
24
  /**
@@ -34,7 +35,7 @@ export declare class DocumentContainerComponent implements OnInit {
34
35
  * The list of folders.
35
36
  * @type {Array}
36
37
  */
37
- folderList: ParentFolderData[];
38
+ folderList: FolderBlockModel[];
38
39
  /**
39
40
  * Holds the subscription to manage observable cleanup.
40
41
  * @private
@@ -53,7 +54,7 @@ export declare class DocumentContainerComponent implements OnInit {
53
54
  private fetchFolder;
54
55
  /**
55
56
  * Fetches the document data from the API.
56
- * @param folderBlockId - The folder ID to fetch the document.
57
+ * @param {string} folderBlockId - The folder ID to fetch the document.
57
58
  * @returns {void}
58
59
  */
59
60
  private fetchDocuments;
@@ -1,5 +1,5 @@
1
1
  import { DocumentStore } from '../../state/document.store';
2
- import { ParentFolderData } from '../../models/document-type.model';
2
+ import { FolderBlockModel } from '../../models/folder.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
- folderList: ParentFolderData[];
17
+ folderList: FolderBlockModel[];
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. */
@@ -1,5 +1,5 @@
1
1
  import { DocumentModel } from '../../models/document.model';
2
- import { ParentFolderData } from '../../models/document-type.model';
2
+ import { FolderBlockModel } from '../../models/folder.model';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * The `FolderContainerComponent` is responsible for rendering a container
@@ -18,22 +18,12 @@ export declare class FolderContainerComponent {
18
18
  * A list of documents passed as input to the component.
19
19
  * Represents the document data to be displayed in the folder container.
20
20
  */
21
- folderList: ParentFolderData[];
21
+ folderList: FolderBlockModel[];
22
22
  /**
23
23
  * The context ID for the folder container.
24
24
  * @type {string}
25
25
  */
26
26
  contextId: string;
27
- /**
28
- * Folder blocks data, sourced from the `SHARED` constants.
29
- */
30
- folderBlocks: {
31
- _id: string;
32
- fileCount: number;
33
- text: string;
34
- missingFiles: number;
35
- pendingFiles: number;
36
- }[];
37
27
  static ɵfac: i0.ɵɵFactoryDeclaration<FolderContainerComponent, never>;
38
28
  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>;
39
29
  }
@@ -1,74 +1,37 @@
1
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.
2
+ * DocumentTypeModel
3
+ * @interface DocumentTypeModel Model for document types.
4
+ * @typedef {DocumentTypeModel} Model for document types.
29
5
  */
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;
6
+ export interface DocumentTypeModel {
41
7
  /**
42
8
  * The label for the document type.
43
9
  * @type {string}
10
+ * @memberof DocumentTypeModel
44
11
  */
45
12
  label?: string;
46
13
  /**
47
- * The description of the document type.
14
+ * The match rules for the document type.
48
15
  * @type {string}
16
+ * @memberof DocumentTypeModel
49
17
  */
50
18
  matchRules?: string;
51
19
  /**
52
- * parentDocumentTypeId - The unique identifier for the parent document type.
20
+ * The name of the document type.
53
21
  * @type {string}
22
+ * @memberof DocumentTypeModel
54
23
  */
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 {
24
+ name?: string;
64
25
  /**
65
- * The list of parent folder data.
66
- * @type {ParentFolderData[]}
26
+ * The parent document type ID.
27
+ * @type {string}
28
+ * @memberof DocumentTypeModel
67
29
  */
68
- parentFolderData: ParentFolderData[];
30
+ parentDocumentTypeId?: string;
69
31
  /**
70
- * The list of all document types.
71
- * @type {DocumentType[]}
32
+ * The document type ID.
33
+ * @type {string}
34
+ * @memberof DocumentTypeModel
72
35
  */
73
- allDocumentTypes: DocumentType[];
36
+ _id: string;
74
37
  }
@@ -30,4 +30,9 @@ export declare class DocumentModel {
30
30
  * @type {?Date}
31
31
  */
32
32
  createdAt?: Date;
33
+ /**
34
+ * Shows the type of document
35
+ * @type {?string}
36
+ */
37
+ documentTypeName?: string;
33
38
  }
@@ -11,13 +11,13 @@ export declare class FolderBlockModel {
11
11
  */
12
12
  _id: string;
13
13
  /**
14
- * Total number of files within the folder block.
14
+ * Total number of document within the folder block.
15
15
  */
16
- fileCount?: number;
16
+ documentCount?: number;
17
17
  /**
18
18
  * Descriptive text associated with the folder block.
19
19
  */
20
- text?: string;
20
+ folderName?: string;
21
21
  /**
22
22
  * Number of files marked as missing in the folder block.
23
23
  */
@@ -5,6 +5,7 @@ import { HttpClient } from '@angular/common/http';
5
5
  import { DocumentTypeModel } from '../models/document-type.model';
6
6
  import { DocumentAlertModel } from '../models/document-alert.model';
7
7
  import { DocumentModel } from '../models/document.model';
8
+ import { FolderBlockModel } from '../models/folder.model';
8
9
  import * as i0 from "@angular/core";
9
10
  /**
10
11
  * Service for making HTTP requests related to documents.
@@ -31,21 +32,29 @@ export declare class DocumentHttpService {
31
32
  /**
32
33
  * Fetches a document by its path name and transforms the response for dropdown options.
33
34
  * Includes error handling for failed API requests.
35
+ * @param {string} contextId - The context ID to fetch the document.
34
36
  * @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
35
37
  */
36
- getDocumentTypes(): Observable<DocumentTypeModel>;
38
+ getFoldersData(contextId: string): Observable<FolderBlockModel[]>;
37
39
  /**
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
- */
40
+ * Fetches a document by its path name and transforms the response for dropdown options.
41
+ * Includes error handling for failed API requests.
42
+ * @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
43
+ */
44
+ getDocumentTypes(): Observable<DocumentTypeModel[]>;
45
+ /**
46
+ * Fetches a document by its path name and transforms the response for dropdown options.
47
+ * @param {string} documentId - The document ID to fetch the document.
48
+ * @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
49
+ */
42
50
  getAlertsByDocumentID(documentId: string): Observable<DocumentAlertModel>;
43
51
  /**
44
52
  * 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
53
+ * @param {string} folderId - The folder ID to fetch the document.
54
+ * @param {string} contextId - The context ID to fetch the document.
55
+ * @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
47
56
  */
48
- getDocumentByFolderID(folderId: string): Observable<DocumentModel[]>;
57
+ getDocumentByFolderID(folderId: string, contextId: string): Observable<DocumentModel[]>;
49
58
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHttpService, never>;
50
59
  static ɵprov: i0.ɵɵInjectableDeclaration<DocumentHttpService>;
51
60
  }
@@ -2,6 +2,7 @@ import { EntityState } from '@datorama/akita';
2
2
  import { DocumentModel } from '../models/document.model';
3
3
  import { DocumentTypeModel } from '../models/document-type.model';
4
4
  import { DocumentAlertModel } from '../models/document-alert.model';
5
+ import { FolderBlockModel } from '../models/folder.model';
5
6
  /**
6
7
  * Represents the state of the documents in the application.
7
8
  * This interface extends Akita's `EntityState` to include additional properties
@@ -21,6 +22,7 @@ export interface DocumentState extends EntityState<DocumentModel, string> {
21
22
  uploadedDocumentFiles: DocumentModel[];
22
23
  parentDocumentTypeId: string | null;
23
24
  documentAlert: DocumentAlertModel;
25
+ folders: FolderBlockModel[];
24
26
  }
25
27
  /**
26
28
  * Creates the initial state for the `DocumentState` store.
@@ -14,6 +14,7 @@ export declare class DocumentStore extends EntityStore<DocumentState> {
14
14
  */
15
15
  constructor();
16
16
  setUploadedDocumentFiles(files: any[]): void;
17
+ setFolders(folders: any): void;
17
18
  setDocumentTypes(documentType: any): void;
18
19
  setDocumentAlert(documentAlert: any): void;
19
20
  setParentDocumentTypeId(parentDocumentTypeId: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"