cat-documents-ng 0.1.28 → 0.1.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.
Files changed (92) hide show
  1. package/ng-package.json +11 -0
  2. package/package.json +20 -25
  3. package/{Shared/constant/ERROR.d.ts → src/Shared/constant/ERROR.ts} +38 -36
  4. package/src/Shared/constant/PERMISSIONS.ts +16 -0
  5. package/src/Shared/constant/SHARED.ts +312 -0
  6. package/{Shared/constant/URLS.d.ts → src/Shared/constant/URLS.ts} +65 -60
  7. package/src/Shared/services/app-config.service.spec.ts +19 -0
  8. package/src/Shared/services/app-config.service.ts +73 -0
  9. package/{Shared/services/global-error.handler.d.ts → src/Shared/services/global-error.handler.ts} +29 -27
  10. package/src/Shared/services/session.service.spec.ts +16 -0
  11. package/src/Shared/services/session.service.ts +76 -0
  12. package/src/assets/config/api.config.json +20 -0
  13. package/src/lib/document/components/document-container/document-container.component.html +14 -0
  14. package/src/lib/document/components/document-container/document-container.component.scss +8 -0
  15. package/src/lib/document/components/document-container/document-container.component.spec.ts +110 -0
  16. package/src/lib/document/components/document-container/document-container.component.ts +173 -0
  17. package/src/lib/document/components/document-list/document-list.component.html +81 -0
  18. package/src/lib/document/components/document-list/document-list.component.scss +82 -0
  19. package/src/lib/document/components/document-list/document-list.component.spec.ts +96 -0
  20. package/src/lib/document/components/document-list/document-list.component.ts +244 -0
  21. package/src/lib/document/components/document-list-item/document-list-item.component.html +36 -0
  22. package/src/lib/document/components/document-list-item/document-list-item.component.scss +34 -0
  23. package/src/lib/document/components/document-list-item/document-list-item.component.spec.ts +75 -0
  24. package/src/lib/document/components/document-list-item/document-list-item.component.ts +40 -0
  25. package/src/lib/document/components/document-upload/document-upload.component.html +56 -0
  26. package/src/lib/document/components/document-upload/document-upload.component.scss +32 -0
  27. package/src/lib/document/components/document-upload/document-upload.component.spec.ts +95 -0
  28. package/src/lib/document/components/document-upload/document-upload.component.ts +162 -0
  29. package/src/lib/document/components/document-viewer/document-viewer.component.html +98 -0
  30. package/src/lib/document/components/document-viewer/document-viewer.component.scss +54 -0
  31. package/src/lib/document/components/document-viewer/document-viewer.component.spec.ts +79 -0
  32. package/src/lib/document/components/document-viewer/document-viewer.component.ts +106 -0
  33. package/src/lib/document/components/folder-block/folder-block.component.html +46 -0
  34. package/src/lib/document/components/folder-block/folder-block.component.scss +9 -0
  35. package/src/lib/document/components/folder-block/folder-block.component.spec.ts +70 -0
  36. package/{lib/document/components/folder-block/folder-block.component.d.ts → src/lib/document/components/folder-block/folder-block.component.ts} +53 -37
  37. package/src/lib/document/components/folder-container/folder-container.component.html +2 -0
  38. package/src/lib/document/components/folder-container/folder-container.component.scss +0 -0
  39. package/src/lib/document/components/folder-container/folder-container.component.spec.ts +27 -0
  40. package/src/lib/document/components/folder-container/folder-container.component.ts +37 -0
  41. package/src/lib/document/components/linked-document/linked-document.component.html +23 -0
  42. package/src/lib/document/components/linked-document/linked-document.component.scss +10 -0
  43. package/src/lib/document/components/linked-document/linked-document.component.spec.ts +61 -0
  44. package/src/lib/document/components/linked-document/linked-document.component.ts +49 -0
  45. package/src/lib/document/directives/document.directive.ts +32 -0
  46. package/src/lib/document/directives/permission.directive.spec.ts +0 -0
  47. package/src/lib/document/directives/permission.directive.ts +66 -0
  48. package/src/lib/document/document.module.ts +241 -0
  49. package/{lib/document/models/document-alert.model.d.ts → src/lib/document/models/document-alert.model.ts} +45 -38
  50. package/src/lib/document/models/document-type.model.ts +44 -0
  51. package/src/lib/document/models/document.model.ts +53 -0
  52. package/{lib/document/models/folder.model.d.ts → src/lib/document/models/folder.model.ts} +35 -29
  53. package/src/lib/document/services/document-http.service.spec.ts +119 -0
  54. package/src/lib/document/services/document-http.service.ts +125 -0
  55. package/src/lib/document/services/document-upload.service.spec.ts +99 -0
  56. package/src/lib/document/services/document-upload.service.ts +127 -0
  57. package/src/lib/document/services/document.service.ts +29 -0
  58. package/src/lib/document/services/file-format.service.spec.ts +16 -0
  59. package/src/lib/document/services/file-format.service.ts +41 -0
  60. package/src/lib/document/state/document.query.ts +52 -0
  61. package/{lib/document/state/document.service.d.ts → src/lib/document/state/document.service.ts} +95 -64
  62. package/{lib/document/state/document.state.d.ts → src/lib/document/state/document.state.ts} +52 -36
  63. package/src/lib/document/state/document.store.ts +51 -0
  64. package/{public-api.d.ts → src/public-api.ts} +10 -6
  65. package/tsconfig.lib.json +15 -0
  66. package/tsconfig.lib.prod.json +11 -0
  67. package/tsconfig.spec.json +15 -0
  68. package/Shared/constant/PERMISSIONS.d.ts +0 -15
  69. package/Shared/constant/SHARED.d.ts +0 -209
  70. package/Shared/services/app-config.service.d.ts +0 -51
  71. package/Shared/services/session.service.d.ts +0 -46
  72. package/fesm2022/cat-documents-ng.mjs +0 -2538
  73. package/fesm2022/cat-documents-ng.mjs.map +0 -1
  74. package/index.d.ts +0 -5
  75. package/lib/document/components/document-container/document-container.component.d.ts +0 -85
  76. package/lib/document/components/document-list/document-list.component.d.ts +0 -160
  77. package/lib/document/components/document-list-item/document-list-item.component.d.ts +0 -28
  78. package/lib/document/components/document-upload/document-upload.component.d.ts +0 -120
  79. package/lib/document/components/document-viewer/document-viewer.component.d.ts +0 -73
  80. package/lib/document/components/folder-container/folder-container.component.d.ts +0 -29
  81. package/lib/document/components/linked-document/linked-document.component.d.ts +0 -38
  82. package/lib/document/directives/document.directive.d.ts +0 -20
  83. package/lib/document/directives/permission.directive.d.ts +0 -38
  84. package/lib/document/document.module.d.ts +0 -40
  85. package/lib/document/models/document-type.model.d.ts +0 -37
  86. package/lib/document/models/document.model.d.ts +0 -44
  87. package/lib/document/services/document-http.service.d.ts +0 -69
  88. package/lib/document/services/document-upload.service.d.ts +0 -67
  89. package/lib/document/services/document.service.d.ts +0 -20
  90. package/lib/document/services/file-format.service.d.ts +0 -23
  91. package/lib/document/state/document.query.d.ts +0 -42
  92. package/lib/document/state/document.store.d.ts +0 -29
@@ -1,69 +0,0 @@
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 { FolderBlockModel } from '../models/folder.model';
9
- import * as i0 from "@angular/core";
10
- /**
11
- * Service for making HTTP requests related to documents.
12
- * @class DocumentHttpService
13
- * @typedef {DocumentHttpService}
14
- */
15
- export declare class DocumentHttpService {
16
- documentStore: DocumentStore;
17
- private http;
18
- appConfigService: AppConfigService;
19
- /**
20
- * Creates an instance of DocumentService.
21
- * @param {DocumentStore} documentStore - Store managing the state of documents.
22
- * @param {HttpClient} http - Angular HTTP client for making API requests.
23
- * @param {AppConfigService} appConfigService - Service for retrieving application configuration, such as API base URL.
24
- */
25
- constructor(documentStore: DocumentStore, http: HttpClient, appConfigService: AppConfigService);
26
- /**
27
- * Get api url from appConfigService.
28
- * @readonly
29
- * @type {string}
30
- */
31
- get apiUrl(): string;
32
- /**
33
- * Fetches a document by its path name and transforms the response for dropdown options.
34
- * Includes error handling for failed API requests.
35
- * @param {string} contextId - The context ID to fetch the document.
36
- * @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
37
- */
38
- getFoldersData(contextId: string | undefined): Observable<FolderBlockModel[]>;
39
- /**
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
- */
50
- getAlertsByDocumentID(documentId: string): Observable<DocumentAlertModel>;
51
- /**
52
- * Fetches a document by its folder ID and transforms the response for dropdown options.
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.
56
- */
57
- getDocumentByFolderID(folderId: string, contextId: string): Observable<DocumentModel[]>;
58
- /**
59
- * Updates the name of a document.
60
- * This method sends an HTTP PUT request to update the document's file name using the provided document ID and payload.
61
- * In case of an error, it will return an observable that throws an Error.
62
- * @param {string} documentId - The unique identifier of the document to update.
63
- * @param {any} payload - The payload containing the updated document data (e.g., fileName).
64
- * @returns {Observable<DocumentModel>} An observable that emits the updated DocumentModel.
65
- */
66
- updateDocumentName(documentId: string, payload: any): Observable<DocumentModel>;
67
- static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHttpService, never>;
68
- static ɵprov: i0.ɵɵInjectableDeclaration<DocumentHttpService>;
69
- }
@@ -1,67 +0,0 @@
1
- import { DocumentService } from '../state/document.service';
2
- import { DocumentStore } from '../state/document.store';
3
- import { MessageService } from 'primeng/api';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * Service for handling document uploads.
7
- * @class DocumentUploadService
8
- * @typedef {DocumentUploadService}
9
- */
10
- export declare class DocumentUploadService {
11
- documentService: DocumentService;
12
- documentUploadStore: DocumentStore;
13
- messageService: MessageService;
14
- /**
15
- * The file to upload.
16
- * @type {*}
17
- */
18
- uploadedFile: any;
19
- /**
20
- * Represent contextId
21
- * @type {string}
22
- */
23
- contextId: string;
24
- /**
25
- * Represent document name
26
- * @type {string}
27
- */
28
- docName: string;
29
- /**
30
- * Represent document id
31
- * @type {string}
32
- */
33
- docTypeId: string;
34
- /**
35
- * Creates an instance of DocumentUploadService.
36
- * @param {DocumentService} documentService - Service for handling document uploads.
37
- * @param {DocumentStore} documentUploadStore - Store for managing uploaded documents.
38
- * @param {MessageService} messageService - Service for displaying messages.
39
- * @returns {void}
40
- */
41
- constructor(documentService: DocumentService, documentUploadStore: DocumentStore, messageService: MessageService);
42
- /**
43
- * Prepares the files for upload by creating a FormData object.
44
- * This method appends each file to the FormData for submission.
45
- * @returns {void}
46
- */
47
- handleTemplatedUpload(): void;
48
- /**
49
- * Get the file and contextId
50
- * @param file - The file to upload.
51
- * @param contextId - The contextId to upload.
52
- */
53
- getUploadFileData(file: File, contextId: string): void;
54
- /**
55
- * Get the document name and document type id
56
- * @param documentName - The document name to upload.
57
- * @param documentTypeId - The document type id to upload.
58
- */
59
- getDocumentNameAndType(documentTypeId: string): void;
60
- /**
61
- * Handle the creation of formdata.
62
- * @returns {*} - The formdata object.
63
- */
64
- handleCreateFormData(): FormData | null;
65
- static ɵfac: i0.ɵɵFactoryDeclaration<DocumentUploadService, never>;
66
- static ɵprov: i0.ɵɵInjectableDeclaration<DocumentUploadService>;
67
- }
@@ -1,20 +0,0 @@
1
- import { DocumentModel } from "../models/document.model";
2
- import * as i0 from "@angular/core";
3
- /**
4
- * Service to manage the document data
5
- */
6
- export declare class DocumentService {
7
- private documentSubject$;
8
- /**
9
- * Set the document data
10
- * @param document the document data
11
- */
12
- set(document: DocumentModel | null): void;
13
- /**
14
- * Get the document data
15
- * @returns the document data
16
- */
17
- get(): import("rxjs").Observable<DocumentModel | null>;
18
- static ɵfac: i0.ɵɵFactoryDeclaration<DocumentService, never>;
19
- static ɵprov: i0.ɵɵInjectableDeclaration<DocumentService>;
20
- }
@@ -1,23 +0,0 @@
1
- import { PrimeNGConfig } from 'primeng/api';
2
- import * as i0 from "@angular/core";
3
- /**
4
- * Description placeholder
5
- * @class FileFormatService
6
- * @typedef {FileFormatService}
7
- */
8
- export declare class FileFormatService {
9
- /**
10
- * Creates an instance of FileFormatService.
11
- * @constructor
12
- */
13
- constructor();
14
- /**
15
- * Description placeholder
16
- * @param {number} bytes
17
- * @param {PrimeNGConfig} config
18
- * @returns {string}
19
- */
20
- formatFileSize(bytes: number, config: PrimeNGConfig): string;
21
- static ɵfac: i0.ɵɵFactoryDeclaration<FileFormatService, never>;
22
- static ɵprov: i0.ɵɵInjectableDeclaration<FileFormatService>;
23
- }
@@ -1,42 +0,0 @@
1
- import { QueryEntity } from '@datorama/akita';
2
- import { DocumentStore } from './document.store';
3
- import { DocumentState } from './document.state';
4
- import { Observable } from 'rxjs';
5
- import { Message } from 'primeng/api';
6
- import { DocumentModel } from '../models/document.model';
7
- import * as i0 from "@angular/core";
8
- /**
9
- * Query service for managing document state.
10
- * This class extends Akita's `QueryEntity` to provide additional functionality for querying document data.
11
- * @class DocumentQuery
12
- * @typedef {DocumentQuery}
13
- * @augments {QueryEntity<DocumentState>}
14
- */
15
- export declare class DocumentQuery extends QueryEntity<DocumentState> {
16
- protected store: DocumentStore;
17
- constructor(store: DocumentStore);
18
- /**
19
- * Selects the currently selected folder ID from the document state.
20
- * @returns {Observable<string | null>} Observable that emits the currently selected folder ID.
21
- */
22
- getParentDocumentTypeId(): string | null;
23
- /**
24
- * Selects the currently selected folder ID from the document state.
25
- * @returns {Observable<string | null>} Observable that emits the currently selected folder ID.
26
- */
27
- selectParentDocumentTypeId(): Observable<string | null>;
28
- /**
29
- * Selects the set messages.
30
- * @returns {Observable<Message>} Observable that emits the current Message.
31
- */
32
- selectMessages(): Observable<Message[]>;
33
- /**
34
- * Selects the set documents.
35
- * @returns {Observable<DocumentModel[]>} Observable that emits the documets.
36
- */
37
- selectDocumets(): Observable<DocumentModel[]>;
38
- getSelectedDocument(): Observable<any>;
39
- getIsDocumentUpdated(): Observable<any>;
40
- static ɵfac: i0.ɵɵFactoryDeclaration<DocumentQuery, never>;
41
- static ɵprov: i0.ɵɵInjectableDeclaration<DocumentQuery>;
42
- }
@@ -1,29 +0,0 @@
1
- import { EntityStore } from '@datorama/akita';
2
- import { DocumentState } from './document.state';
3
- import { Message } from 'primeng/api';
4
- import { DocumentModel } from '../models/document.model';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * Store that manages the state of documents in the application.
8
- * The `DocumentStore` class extends Akita's `EntityStore` to manage the entity state for documents.
9
- * It uses the `createInitialState` function to initialize the store with default values and
10
- * is configured with the name `'documents'`.
11
- * @augments EntityStore<DocumentState>
12
- */
13
- export declare class DocumentStore extends EntityStore<DocumentState> {
14
- /**
15
- * Creates an instance of `DocumentStore` with the initial state of the documents.
16
- */
17
- constructor();
18
- setUploadedDocumentFiles(files: any[]): void;
19
- setFolders(folders: any): void;
20
- setDocumentTypes(documentType: any): void;
21
- setDocumentAlert(documentAlert: any): void;
22
- setParentDocumentTypeId(parentDocumentTypeId: string): void;
23
- setMessage(message: Message[]): void;
24
- setDocumentList(documents: DocumentModel[]): void;
25
- setSelectedDocument(selectedDocument: any): void;
26
- setIsDocumentUpdated(isDocumentUpdated: any): void;
27
- static ɵfac: i0.ɵɵFactoryDeclaration<DocumentStore, never>;
28
- static ɵprov: i0.ɵɵInjectableDeclaration<DocumentStore>;
29
- }