cat-documents-ng 0.1.30 → 0.1.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/{src/Shared/constant/ERROR.ts → Shared/constant/ERROR.d.ts} +43 -38
- package/Shared/constant/PERMISSIONS.d.ts +20 -0
- package/Shared/constant/SHARED.d.ts +215 -0
- package/{src/Shared/constant/URLS.ts → Shared/constant/URLS.d.ts} +60 -65
- package/Shared/services/app-config.service.d.ts +51 -0
- package/{src/Shared/services/global-error.handler.ts → Shared/services/global-error.handler.d.ts} +27 -29
- package/Shared/services/session.service.d.ts +46 -0
- package/fesm2022/cat-documents-ng.mjs +2623 -0
- package/fesm2022/cat-documents-ng.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/document/components/document-container/document-container.component.d.ts +101 -0
- package/lib/document/components/document-list/document-list.component.d.ts +193 -0
- package/lib/document/components/document-list-item/document-list-item.component.d.ts +28 -0
- package/lib/document/components/document-upload/document-upload.component.d.ts +120 -0
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +77 -0
- package/{src/lib/document/components/folder-block/folder-block.component.ts → lib/document/components/folder-block/folder-block.component.d.ts} +37 -53
- package/lib/document/components/folder-container/folder-container.component.d.ts +29 -0
- package/lib/document/components/linked-document/linked-document.component.d.ts +38 -0
- package/lib/document/directives/document.directive.d.ts +20 -0
- package/lib/document/directives/permission.directive.d.ts +38 -0
- package/lib/document/document.module.d.ts +40 -0
- package/{src/lib/document/models/document-alert.model.ts → lib/document/models/document-alert.model.d.ts} +38 -45
- package/lib/document/models/document-type.model.d.ts +37 -0
- package/lib/document/models/document.model.d.ts +44 -0
- package/{src/lib/document/models/folder.model.ts → lib/document/models/folder.model.d.ts} +29 -35
- package/lib/document/services/document-http.service.d.ts +69 -0
- package/lib/document/services/document-upload.service.d.ts +67 -0
- package/lib/document/services/document.service.d.ts +20 -0
- package/lib/document/services/file-format.service.d.ts +23 -0
- package/lib/document/state/document.query.d.ts +50 -0
- package/{src/lib/document/state/document.service.ts → lib/document/state/document.service.d.ts} +64 -95
- package/{src/lib/document/state/document.state.ts → lib/document/state/document.state.d.ts} +36 -52
- package/lib/document/state/document.store.d.ts +29 -0
- package/package.json +25 -20
- package/{src/public-api.ts → public-api.d.ts} +6 -10
- package/ng-package.json +0 -11
- package/src/Shared/constant/PERMISSIONS.ts +0 -16
- package/src/Shared/constant/SHARED.ts +0 -312
- package/src/Shared/services/app-config.service.spec.ts +0 -19
- package/src/Shared/services/app-config.service.ts +0 -73
- package/src/Shared/services/session.service.spec.ts +0 -16
- package/src/Shared/services/session.service.ts +0 -76
- package/src/assets/config/api.config.json +0 -20
- package/src/lib/document/components/document-container/document-container.component.html +0 -14
- package/src/lib/document/components/document-container/document-container.component.scss +0 -8
- package/src/lib/document/components/document-container/document-container.component.spec.ts +0 -110
- package/src/lib/document/components/document-container/document-container.component.ts +0 -173
- package/src/lib/document/components/document-list/document-list.component.html +0 -81
- package/src/lib/document/components/document-list/document-list.component.scss +0 -82
- package/src/lib/document/components/document-list/document-list.component.spec.ts +0 -96
- package/src/lib/document/components/document-list/document-list.component.ts +0 -244
- package/src/lib/document/components/document-list-item/document-list-item.component.html +0 -36
- package/src/lib/document/components/document-list-item/document-list-item.component.scss +0 -34
- package/src/lib/document/components/document-list-item/document-list-item.component.spec.ts +0 -75
- package/src/lib/document/components/document-list-item/document-list-item.component.ts +0 -40
- package/src/lib/document/components/document-upload/document-upload.component.html +0 -56
- package/src/lib/document/components/document-upload/document-upload.component.scss +0 -32
- package/src/lib/document/components/document-upload/document-upload.component.spec.ts +0 -95
- package/src/lib/document/components/document-upload/document-upload.component.ts +0 -162
- package/src/lib/document/components/document-viewer/document-viewer.component.html +0 -98
- package/src/lib/document/components/document-viewer/document-viewer.component.scss +0 -54
- package/src/lib/document/components/document-viewer/document-viewer.component.spec.ts +0 -79
- package/src/lib/document/components/document-viewer/document-viewer.component.ts +0 -106
- package/src/lib/document/components/folder-block/folder-block.component.html +0 -46
- package/src/lib/document/components/folder-block/folder-block.component.scss +0 -9
- package/src/lib/document/components/folder-block/folder-block.component.spec.ts +0 -70
- package/src/lib/document/components/folder-container/folder-container.component.html +0 -2
- package/src/lib/document/components/folder-container/folder-container.component.scss +0 -0
- package/src/lib/document/components/folder-container/folder-container.component.spec.ts +0 -27
- package/src/lib/document/components/folder-container/folder-container.component.ts +0 -37
- package/src/lib/document/components/linked-document/linked-document.component.html +0 -23
- package/src/lib/document/components/linked-document/linked-document.component.scss +0 -10
- package/src/lib/document/components/linked-document/linked-document.component.spec.ts +0 -61
- package/src/lib/document/components/linked-document/linked-document.component.ts +0 -49
- package/src/lib/document/directives/document.directive.ts +0 -32
- package/src/lib/document/directives/permission.directive.spec.ts +0 -0
- package/src/lib/document/directives/permission.directive.ts +0 -66
- package/src/lib/document/document.module.ts +0 -241
- package/src/lib/document/models/document-type.model.ts +0 -44
- package/src/lib/document/models/document.model.ts +0 -53
- package/src/lib/document/services/document-http.service.spec.ts +0 -119
- package/src/lib/document/services/document-http.service.ts +0 -125
- package/src/lib/document/services/document-upload.service.spec.ts +0 -99
- package/src/lib/document/services/document-upload.service.ts +0 -127
- package/src/lib/document/services/document.service.ts +0 -29
- package/src/lib/document/services/file-format.service.spec.ts +0 -16
- package/src/lib/document/services/file-format.service.ts +0 -41
- package/src/lib/document/state/document.query.ts +0 -52
- package/src/lib/document/state/document.store.ts +0 -51
- package/tsconfig.lib.json +0 -15
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -15
package/{src/lib/document/state/document.service.ts → lib/document/state/document.service.d.ts}
RENAMED
|
@@ -1,95 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*
|
|
22
|
-
* @param {
|
|
23
|
-
* @param {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @
|
|
35
|
-
* @
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
*
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
* @returns {Observable<any>} Observable that emits the retrieved document.
|
|
66
|
-
*/
|
|
67
|
-
getById(id: string): Observable<any> {
|
|
68
|
-
return this.http.get<any>(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${id}`).pipe(
|
|
69
|
-
tap((entity: any) => this.documentStore.upsert(id, entity))
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Updates an existing document by its ID.
|
|
75
|
-
* @param {string} id - The unique identifier of the document.
|
|
76
|
-
* @param {DocumentModel} entity - The updated data of the document.
|
|
77
|
-
* @returns {Observable<DocumentModel>} Observable that emits the updated document.
|
|
78
|
-
*/
|
|
79
|
-
update(id: string, entity: DocumentModel): Observable<DocumentModel> {
|
|
80
|
-
return this.http.put<DocumentModel>(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${id}`, entity).pipe(
|
|
81
|
-
tap((updatedEntity: DocumentModel) => this.documentStore.update(id, updatedEntity))
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Deletes a document by its ID.
|
|
87
|
-
* @param {string} id - The unique identifier of the document to be deleted.
|
|
88
|
-
* @returns {Observable<void>} Observable that completes when the document is deleted.
|
|
89
|
-
*/
|
|
90
|
-
delete(id: string): Observable<void> {
|
|
91
|
-
return this.http.delete<void>(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${id}`).pipe(
|
|
92
|
-
tap(() => this.documentStore.remove(id))
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { DocumentStore } from './document.store';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { AppConfigService } from '../../../Shared/services/app-config.service';
|
|
5
|
+
import { DocumentModel } from '../models/document.model';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Service for managing document-related operations.
|
|
9
|
+
* The `DocumentService` acts as a bridge between the application and the backend API for handling document-related data.
|
|
10
|
+
* It interacts with the `DocumentStore` for state management and uses `HttpClient` for making HTTP requests.
|
|
11
|
+
* Creates an instance of `DocumentService`.
|
|
12
|
+
* @param {DocumentStore} documentStore - The store that manages the state of documents.
|
|
13
|
+
* @param {HttpClient} http - The Angular HTTP client for making API requests.
|
|
14
|
+
*/
|
|
15
|
+
export declare class DocumentService {
|
|
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
|
+
* Sends a request to create a new document.
|
|
34
|
+
* @param {*} entity - The data of the document to be created.
|
|
35
|
+
* @returns {Observable<any>} Observable that emits the newly created document.
|
|
36
|
+
*/
|
|
37
|
+
create(entity: any): Observable<any>;
|
|
38
|
+
/**
|
|
39
|
+
* Fetches all documents from the backend.
|
|
40
|
+
* @returns {Observable<DocumentModel[]>} Observable that emits an array of documents.
|
|
41
|
+
*/
|
|
42
|
+
getAll(): Observable<DocumentModel[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Fetches a document by its ID.
|
|
45
|
+
* @param {string} id - The unique identifier of the document.
|
|
46
|
+
* @returns {Observable<any>} Observable that emits the retrieved document.
|
|
47
|
+
*/
|
|
48
|
+
getById(id: string): Observable<any>;
|
|
49
|
+
/**
|
|
50
|
+
* Updates an existing document by its ID.
|
|
51
|
+
* @param {string} id - The unique identifier of the document.
|
|
52
|
+
* @param {DocumentModel} entity - The updated data of the document.
|
|
53
|
+
* @returns {Observable<DocumentModel>} Observable that emits the updated document.
|
|
54
|
+
*/
|
|
55
|
+
update(id: string, entity: DocumentModel): Observable<DocumentModel>;
|
|
56
|
+
/**
|
|
57
|
+
* Deletes a document by its ID.
|
|
58
|
+
* @param {string} id - The unique identifier of the document to be deleted.
|
|
59
|
+
* @returns {Observable<void>} Observable that completes when the document is deleted.
|
|
60
|
+
*/
|
|
61
|
+
delete(id: string): Observable<void>;
|
|
62
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentService, never>;
|
|
63
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DocumentService>;
|
|
64
|
+
}
|
|
@@ -1,52 +1,36 @@
|
|
|
1
|
-
import { EntityState } from '@datorama/akita';
|
|
2
|
-
import { DocumentModel } from '../models/document.model';
|
|
3
|
-
import { DocumentTypeModel } from '../models/document-type.model';
|
|
4
|
-
import { DocumentAlertModel } from '../models/document-alert.model';
|
|
5
|
-
import { FolderBlockModel } from '../models/folder.model';
|
|
6
|
-
import { Message } from 'primeng/api';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @
|
|
13
|
-
* @property {any[]}
|
|
14
|
-
* @property {
|
|
15
|
-
* @property {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*/
|
|
38
|
-
export function createInitialState(): DocumentState {
|
|
39
|
-
return {
|
|
40
|
-
records: [],
|
|
41
|
-
filteredRecords: [],
|
|
42
|
-
folderId: null,
|
|
43
|
-
isDialogOpen: false,
|
|
44
|
-
dropdownOptions: [],
|
|
45
|
-
uploadedDocumentFiles: [],
|
|
46
|
-
parentDocumentTypeId: null,
|
|
47
|
-
documentAlert: {_id:''},
|
|
48
|
-
folders:[],
|
|
49
|
-
messages:[],
|
|
50
|
-
documentList : []
|
|
51
|
-
};
|
|
52
|
-
}
|
|
1
|
+
import { EntityState } from '@datorama/akita';
|
|
2
|
+
import { DocumentModel } from '../models/document.model';
|
|
3
|
+
import { DocumentTypeModel } from '../models/document-type.model';
|
|
4
|
+
import { DocumentAlertModel } from '../models/document-alert.model';
|
|
5
|
+
import { FolderBlockModel } from '../models/folder.model';
|
|
6
|
+
import { Message } from 'primeng/api';
|
|
7
|
+
/**
|
|
8
|
+
* Represents the state of the documents in the application.
|
|
9
|
+
* This interface extends Akita's `EntityState` to include additional properties
|
|
10
|
+
* for managing document-specific data, such as `records`, `filteredRecords` and `folderId`.
|
|
11
|
+
* @interface DocumentState
|
|
12
|
+
* @property {any[]} records - A collection of records related to documents.
|
|
13
|
+
* @property {any[]} filteredRecords - A collection of filteredRecords related to documents.
|
|
14
|
+
* @property {string | null} folderId - The ID of the currently selected folder, or `null` if no folder is selected.
|
|
15
|
+
* @property {boolean} isDialogOpen - A flag indicating whether a dialog is open.
|
|
16
|
+
*/
|
|
17
|
+
export interface DocumentState extends EntityState<DocumentModel, string> {
|
|
18
|
+
records: DocumentModel[];
|
|
19
|
+
folderId: string | null;
|
|
20
|
+
isDialogOpen: boolean;
|
|
21
|
+
filteredRecords: DocumentModel[];
|
|
22
|
+
dropdownOptions: DocumentTypeModel[];
|
|
23
|
+
uploadedDocumentFiles: DocumentModel[];
|
|
24
|
+
parentDocumentTypeId: string | null;
|
|
25
|
+
documentAlert: DocumentAlertModel;
|
|
26
|
+
folders: FolderBlockModel[];
|
|
27
|
+
messages: Message[];
|
|
28
|
+
documentList: DocumentModel[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Creates the initial state for the `DocumentState` store.
|
|
32
|
+
* This function provides default values for all properties in the `DocumentState` interface,
|
|
33
|
+
* ensuring the store starts with a consistent initial structure.
|
|
34
|
+
* @returns {DocumentState} The initial state of the document store.
|
|
35
|
+
*/
|
|
36
|
+
export declare function createInitialState(): DocumentState;
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cat-documents-ng",
|
|
3
|
-
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
"@angular/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "cat-documents-ng",
|
|
3
|
+
"version": "0.1.32",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^19.0.0",
|
|
6
|
+
"@angular/core": "^19.0.0"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"tslib": "^2.3.0"
|
|
10
|
+
},
|
|
11
|
+
"typings": "index.d.ts",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"main": "bundles/cat-document-lib.umd.js",
|
|
14
|
+
"module": "fesm2022/cat-documents-ng.mjs",
|
|
15
|
+
"es2015": "fesm2015/cat-document-lib.js",
|
|
16
|
+
"exports": {
|
|
17
|
+
"./package.json": {
|
|
18
|
+
"default": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./index.d.ts",
|
|
22
|
+
"default": "./fesm2022/cat-documents-ng.mjs"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export * from './lib/document/document.
|
|
6
|
-
export * from './lib/document/
|
|
7
|
-
export * from './lib/document/components/document-viewer/document-viewer.component';
|
|
8
|
-
export * from './lib/document/components/document-list/document-list.component';
|
|
9
|
-
export * from './lib/document/directives/document.directive';
|
|
10
|
-
export * from './lib/document/directives/permission.directive';
|
|
1
|
+
export * from './lib/document/document.module';
|
|
2
|
+
export * from './lib/document/components/document-container/document-container.component';
|
|
3
|
+
export * from './lib/document/components/document-viewer/document-viewer.component';
|
|
4
|
+
export * from './lib/document/components/document-list/document-list.component';
|
|
5
|
+
export * from './lib/document/directives/document.directive';
|
|
6
|
+
export * from './lib/document/directives/permission.directive';
|
package/ng-package.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Storing all permission properties.
|
|
4
|
-
* @export
|
|
5
|
-
* @class PERMISSIONS
|
|
6
|
-
* @typedef {PERMISSIONS}
|
|
7
|
-
*/
|
|
8
|
-
export class PERMISSIONS{
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Access permission.
|
|
12
|
-
* @static
|
|
13
|
-
* @type {string}
|
|
14
|
-
*/
|
|
15
|
-
static DOCUMENT_POST = 'Documents-POST'
|
|
16
|
-
}
|