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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./components/document-container/document-container.component";
|
|
3
|
+
import * as i2 from "./components/folder-container/folder-container.component";
|
|
4
|
+
import * as i3 from "./components/folder-block/folder-block.component";
|
|
5
|
+
import * as i4 from "./components/document-list/document-list.component";
|
|
6
|
+
import * as i5 from "./components/document-list-item/document-list-item.component";
|
|
7
|
+
import * as i6 from "./components/document-upload/document-upload.component";
|
|
8
|
+
import * as i7 from "./components/document-viewer/document-viewer.component";
|
|
9
|
+
import * as i8 from "./directives/document.directive";
|
|
10
|
+
import * as i9 from "./directives/permission.directive";
|
|
11
|
+
import * as i10 from "./components/linked-document/linked-document.component";
|
|
12
|
+
import * as i11 from "@angular/common";
|
|
13
|
+
import * as i12 from "primeng/accordion";
|
|
14
|
+
import * as i13 from "@angular/common/http";
|
|
15
|
+
import * as i14 from "primeng/button";
|
|
16
|
+
import * as i15 from "primeng/sidebar";
|
|
17
|
+
import * as i16 from "primeng/fileupload";
|
|
18
|
+
import * as i17 from "primeng/progressbar";
|
|
19
|
+
import * as i18 from "primeng/badge";
|
|
20
|
+
import * as i19 from "primeng/listbox";
|
|
21
|
+
import * as i20 from "primeng/checkbox";
|
|
22
|
+
import * as i21 from "primeng/timeline";
|
|
23
|
+
import * as i22 from "primeng/inputtextarea";
|
|
24
|
+
import * as i23 from "@angular/forms";
|
|
25
|
+
import * as i24 from "ng2-pdf-viewer";
|
|
26
|
+
import * as i25 from "primeng/dialog";
|
|
27
|
+
import * as i26 from "primeng/dropdown";
|
|
28
|
+
import * as i27 from "primeng/inputtext";
|
|
29
|
+
/**
|
|
30
|
+
* @module DocumentModule
|
|
31
|
+
*
|
|
32
|
+
* The `DocumentModule` handles the organization and display of document and folder components
|
|
33
|
+
* in the application. This module is designed to support features like folder containers,
|
|
34
|
+
* document lists, and individual document items.
|
|
35
|
+
*/
|
|
36
|
+
export declare class DocumentModule {
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentModule, never>;
|
|
38
|
+
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.DocumentDirective, typeof i9.HasPermissionDirective, typeof i10.LinkedDocumentComponent], [typeof i11.CommonModule, typeof i12.AccordionModule, typeof i13.HttpClientModule, typeof i14.ButtonModule, typeof i15.SidebarModule, typeof i16.FileUploadModule, typeof i17.ProgressBarModule, typeof i18.BadgeModule, typeof i19.ListboxModule, typeof i20.CheckboxModule, typeof i21.TimelineModule, typeof i22.InputTextareaModule, typeof i23.FormsModule, typeof i24.PdfViewerModule, typeof i25.DialogModule, typeof i26.DropdownModule, typeof i27.InputTextModule], [typeof i9.HasPermissionDirective, typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent, typeof i4.DocumentListComponent, typeof i8.DocumentDirective]>;
|
|
39
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DocumentModule>;
|
|
40
|
+
}
|
|
@@ -1,45 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* @
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* The
|
|
30
|
-
* @type {?string}
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
*
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* The alert type for the document.
|
|
42
|
-
* @type {?string}
|
|
43
|
-
*/
|
|
44
|
-
status?: string;
|
|
45
|
-
}
|
|
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,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DocumentTypeModel
|
|
3
|
+
* @interface DocumentTypeModel Model for document types.
|
|
4
|
+
* @typedef {DocumentTypeModel} Model for document types.
|
|
5
|
+
*/
|
|
6
|
+
export interface DocumentTypeModel {
|
|
7
|
+
/**
|
|
8
|
+
* The label for the document type.
|
|
9
|
+
* @type {string}
|
|
10
|
+
* @memberof DocumentTypeModel
|
|
11
|
+
*/
|
|
12
|
+
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The match rules for the document type.
|
|
15
|
+
* @type {string}
|
|
16
|
+
* @memberof DocumentTypeModel
|
|
17
|
+
*/
|
|
18
|
+
matchRules?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The name of the document type.
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @memberof DocumentTypeModel
|
|
23
|
+
*/
|
|
24
|
+
name?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The parent document type ID.
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @memberof DocumentTypeModel
|
|
29
|
+
*/
|
|
30
|
+
parentDocumentTypeId?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The document type ID.
|
|
33
|
+
* @type {string}
|
|
34
|
+
* @memberof DocumentTypeModel
|
|
35
|
+
*/
|
|
36
|
+
_id: string;
|
|
37
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a document model.
|
|
3
|
+
*
|
|
4
|
+
* This class contains the structure for document-related data, including file name,
|
|
5
|
+
* status, and document URL.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DocumentModel {
|
|
8
|
+
/**
|
|
9
|
+
* The unique identifier for the document.
|
|
10
|
+
* @type {string}
|
|
11
|
+
*/
|
|
12
|
+
_id: string;
|
|
13
|
+
/**
|
|
14
|
+
* The name of the document file.
|
|
15
|
+
* @type {?string}
|
|
16
|
+
*/
|
|
17
|
+
fileName?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The current status of the document.
|
|
20
|
+
* @type {?string}
|
|
21
|
+
*/
|
|
22
|
+
status?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The URL where the document is hosted or stored.
|
|
25
|
+
* @type {?string}
|
|
26
|
+
*/
|
|
27
|
+
documentUrl?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Date of document get uploaded
|
|
30
|
+
* @type {?Date}
|
|
31
|
+
*/
|
|
32
|
+
createdAt?: Date;
|
|
33
|
+
/**
|
|
34
|
+
* Shows the type of document
|
|
35
|
+
* @type {?string}
|
|
36
|
+
*/
|
|
37
|
+
documentTypeName?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Shows the type of content
|
|
40
|
+
* @type {?string}
|
|
41
|
+
*/
|
|
42
|
+
contentType?: string;
|
|
43
|
+
documentName?: string;
|
|
44
|
+
}
|
|
@@ -1,35 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Number of files marked as pending in the folder block.
|
|
33
|
-
*/
|
|
34
|
-
pendingFiles?: number;
|
|
35
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Represents the model for a folder block.
|
|
3
|
+
*
|
|
4
|
+
* This class provides the structure for folder block data, including properties
|
|
5
|
+
* for ID, file counts, descriptive text, and counts for missing and pending files.
|
|
6
|
+
*/
|
|
7
|
+
export declare class FolderBlockModel {
|
|
8
|
+
/**
|
|
9
|
+
* Unique identifier for the folder block.
|
|
10
|
+
* Defaults to an empty string sourced from `SHARED.EMPTY`.
|
|
11
|
+
*/
|
|
12
|
+
_id: string;
|
|
13
|
+
/**
|
|
14
|
+
* Total number of document within the folder block.
|
|
15
|
+
*/
|
|
16
|
+
documentCount?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Descriptive text associated with the folder block.
|
|
19
|
+
*/
|
|
20
|
+
folderName?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Number of files marked as missing in the folder block.
|
|
23
|
+
*/
|
|
24
|
+
missingFiles?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Number of files marked as pending in the folder block.
|
|
27
|
+
*/
|
|
28
|
+
pendingFiles?: number;
|
|
29
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
/**
|
|
39
|
+
* Retrieves the currently selected document from the store state.
|
|
40
|
+
* @returns {Observable<any>} Observable that emits the selected document.
|
|
41
|
+
*/
|
|
42
|
+
getSelectedDocument(): Observable<any>;
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves the flag indicating whether a document has been updated.
|
|
45
|
+
* @returns {Observable<any>} Observable that emits a boolean or status flag.
|
|
46
|
+
*/
|
|
47
|
+
getIsDocumentUpdated(): Observable<any>;
|
|
48
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentQuery, never>;
|
|
49
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DocumentQuery>;
|
|
50
|
+
}
|