@tstdl/base 0.91.50 → 0.91.52
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/ai/data-extracting.d.ts +1 -0
- package/ai/data-extracting.js +62 -0
- package/authentication/server/authentication.api-controller.js +4 -4
- package/cancellation/token.d.ts +1 -2
- package/cancellation/token.js +1 -1
- package/core.d.ts +1 -1
- package/core.js +1 -1
- package/document-management/api/document-management.api.d.ts +753 -0
- package/document-management/api/document-management.api.js +222 -0
- package/document-management/api/index.d.ts +1 -0
- package/document-management/api/index.js +1 -0
- package/document-management/drizzle/0000_wakeful_firebrand.sql +228 -0
- package/document-management/drizzle/meta/0000_snapshot.json +1538 -0
- package/document-management/drizzle/meta/_journal.json +13 -0
- package/document-management/drizzle.config.d.ts +2 -0
- package/document-management/drizzle.config.js +11 -0
- package/document-management/index.d.ts +5 -0
- package/document-management/index.js +5 -0
- package/document-management/localizations/english.d.ts +2 -0
- package/document-management/localizations/english.js +9 -0
- package/document-management/localizations/german.d.ts +2 -0
- package/document-management/localizations/german.js +9 -0
- package/document-management/localizations/index.d.ts +5 -0
- package/document-management/localizations/index.js +9 -0
- package/document-management/localizations/localization.d.ts +9 -0
- package/document-management/localizations/localization.js +2 -0
- package/document-management/models/document-category.model.d.ts +4 -0
- package/document-management/models/document-category.model.js +18 -0
- package/document-management/models/document-collection-document.model.d.ts +7 -0
- package/document-management/models/document-collection-document.model.js +33 -0
- package/document-management/models/document-collection.model.d.ts +3 -0
- package/document-management/models/document-collection.model.js +14 -0
- package/document-management/models/document-file.model.d.ts +7 -0
- package/document-management/models/document-file.model.js +33 -0
- package/document-management/models/document-property-value.model.d.ts +21 -0
- package/document-management/models/document-property-value.model.js +58 -0
- package/document-management/models/document-property.model.d.ts +11 -0
- package/document-management/models/document-property.model.js +30 -0
- package/document-management/models/document-request-collection.model.d.ts +6 -0
- package/document-management/models/document-request-collection.model.js +28 -0
- package/document-management/models/document-request-file.model.d.ts +11 -0
- package/document-management/models/document-request-file.model.js +56 -0
- package/document-management/models/document-request-template.d.ts +10 -0
- package/document-management/models/document-request-template.js +39 -0
- package/document-management/models/document-request.model.d.ts +9 -0
- package/document-management/models/document-request.model.js +37 -0
- package/document-management/models/document-requests-template.d.ts +5 -0
- package/document-management/models/document-requests-template.js +23 -0
- package/document-management/models/document-type-property.model.d.ts +6 -0
- package/document-management/models/document-type-property.model.js +28 -0
- package/document-management/models/document-type.model.d.ts +7 -0
- package/document-management/models/document-type.model.js +32 -0
- package/document-management/models/document.model.d.ts +9 -0
- package/document-management/models/document.model.js +44 -0
- package/document-management/models/index.d.ts +15 -0
- package/document-management/models/index.js +15 -0
- package/document-management/models/schemas.d.ts +33 -0
- package/document-management/models/schemas.js +34 -0
- package/document-management/models/service-models/categories-and-types.view-model.d.ts +6 -0
- package/document-management/models/service-models/categories-and-types.view-model.js +24 -0
- package/document-management/models/service-models/document-folders.view-model.d.ts +22 -0
- package/document-management/models/service-models/document-folders.view-model.js +56 -0
- package/document-management/models/service-models/document-requests-template.view-model.d.ts +8 -0
- package/document-management/models/service-models/document-requests-template.view-model.js +26 -0
- package/document-management/models/service-models/document.service-model.d.ts +262 -0
- package/document-management/models/service-models/document.service-model.js +50 -0
- package/document-management/models/service-models/document.view-model.d.ts +33 -0
- package/document-management/models/service-models/document.view-model.js +99 -0
- package/document-management/models/service-models/index.d.ts +8 -0
- package/document-management/models/service-models/index.js +8 -0
- package/document-management/models/service-models/normalized-document-collection-view.model.d.ts +73 -0
- package/document-management/models/service-models/normalized-document-collection-view.model.js +110 -0
- package/document-management/models/service-models/normalized-requests-template-data.model.d.ts +16 -0
- package/document-management/models/service-models/normalized-requests-template-data.model.js +13 -0
- package/document-management/models/service-models/stats.view-model.d.ts +6 -0
- package/document-management/models/service-models/stats.view-model.js +32 -0
- package/document-management/module.d.ts +11 -0
- package/document-management/module.js +27 -0
- package/document-management/services/document-management.service.d.ts +65 -0
- package/document-management/services/document-management.service.js +376 -0
- package/document-management/services/index.d.ts +1 -0
- package/document-management/services/index.js +1 -0
- package/examples/document-management/main.d.ts +1 -0
- package/examples/document-management/main.js +30 -0
- package/examples/orm/drizzle.config.js +2 -1
- package/examples/orm/schemas.d.ts +1 -1
- package/examples/orm/user.model.d.ts +1 -2
- package/examples/orm/user.model.js +0 -1
- package/http/server/node/node-http-server.js +5 -5
- package/injector/injector.d.ts +4 -1
- package/injector/injector.js +4 -1
- package/injector/interfaces.d.ts +3 -3
- package/json-path/json-path.d.ts +2 -0
- package/json-path/json-path.js +7 -0
- package/message-bus/message-bus.d.ts +4 -6
- package/orm/database-schema.d.ts +3 -0
- package/orm/database-schema.js +6 -2
- package/orm/database.d.ts +6 -0
- package/orm/database.js +14 -0
- package/orm/decorators.d.ts +25 -2
- package/orm/decorators.js +15 -0
- package/orm/drizzle/index.d.ts +1 -0
- package/orm/drizzle/index.js +1 -0
- package/orm/drizzle/schema-converter.d.ts +37 -8
- package/orm/drizzle/schema-converter.js +121 -40
- package/orm/entity.d.ts +15 -12
- package/orm/entity.js +24 -11
- package/orm/index.d.ts +3 -2
- package/orm/index.js +3 -2
- package/orm/module.d.ts +6 -0
- package/orm/module.js +15 -0
- package/orm/query-converter.d.ts +5 -0
- package/orm/query-converter.js +114 -0
- package/orm/query.d.ts +15 -13
- package/orm/repository.d.ts +90 -31
- package/orm/repository.js +357 -55
- package/orm/schemas/index.d.ts +3 -0
- package/orm/schemas/index.js +3 -0
- package/orm/schemas/json.d.ts +9 -0
- package/orm/schemas/json.js +19 -0
- package/orm/schemas/numeric-date.d.ts +8 -0
- package/orm/schemas/numeric-date.js +13 -0
- package/orm/schemas/timestamp.d.ts +10 -0
- package/orm/schemas/timestamp.js +20 -0
- package/orm/transaction.d.ts +29 -0
- package/orm/transaction.js +73 -0
- package/orm/types.d.ts +15 -8
- package/orm/types.js +3 -2
- package/package.json +23 -12
- package/{rxjs → rxjs-utils}/reject-error.d.ts +1 -1
- package/{rxjs → rxjs-utils}/retry-backoff.d.ts +2 -2
- package/{rxjs → rxjs-utils}/slow-array.d.ts +7 -7
- package/{rxjs → rxjs-utils}/slow-array.js +2 -2
- package/{rxjs → rxjs-utils}/start-with-provider.d.ts +1 -1
- package/{rxjs → rxjs-utils}/teardown.d.ts +1 -1
- package/{rxjs → rxjs-utils}/untrack.d.ts +1 -1
- package/schema/decorators/types.d.ts +2 -2
- package/schema/schemas/number.d.ts +1 -1
- package/signals/pipe.d.ts +1 -1
- package/signals/pipe.js +1 -2
- package/sse/server-sent-events.d.ts +54 -0
- package/sse/server-sent-events.js +54 -0
- package/types.d.ts +5 -1
- package/utils/comparison.d.ts +2 -1
- package/utils/comparison.js +4 -3
- package/utils/compression.d.ts +4 -4
- package/utils/compression.js +35 -43
- package/utils/object/dereference.d.ts +6 -4
- package/utils/object/dereference.js +20 -8
- package/utils/object/object.d.ts +2 -0
- package/utils/object/object.js +20 -0
- /package/{rxjs → rxjs-utils}/cast.d.ts +0 -0
- /package/{rxjs → rxjs-utils}/cast.js +0 -0
- /package/{rxjs → rxjs-utils}/index.d.ts +0 -0
- /package/{rxjs → rxjs-utils}/index.js +0 -0
- /package/{rxjs → rxjs-utils}/noop.d.ts +0 -0
- /package/{rxjs → rxjs-utils}/noop.js +0 -0
- /package/{rxjs → rxjs-utils}/reject-error.js +0 -0
- /package/{rxjs → rxjs-utils}/retry-backoff.js +0 -0
- /package/{rxjs → rxjs-utils}/start-with-provider.js +0 -0
- /package/{rxjs → rxjs-utils}/teardown.js +0 -0
- /package/{rxjs → rxjs-utils}/timing.d.ts +0 -0
- /package/{rxjs → rxjs-utils}/timing.js +0 -0
- /package/{rxjs → rxjs-utils}/untrack.js +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { References } from '../../orm/decorators.js';
|
|
11
|
+
import { Entity } from '../../orm/entity.js';
|
|
12
|
+
import { Uuid } from '../../orm/types.js';
|
|
13
|
+
import { DocumentProperty } from './document-property.model.js';
|
|
14
|
+
import { DocumentType } from './document-type.model.js';
|
|
15
|
+
export class DocumentTypeProperty extends Entity {
|
|
16
|
+
typeId;
|
|
17
|
+
propertyId;
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
Uuid(),
|
|
21
|
+
References(() => DocumentType),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], DocumentTypeProperty.prototype, "typeId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
Uuid(),
|
|
26
|
+
References(() => DocumentProperty),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], DocumentTypeProperty.prototype, "propertyId", void 0);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { References } from '../../orm/decorators.js';
|
|
11
|
+
import { Entity } from '../../orm/entity.js';
|
|
12
|
+
import { Uuid } from '../../orm/types.js';
|
|
13
|
+
import { StringProperty } from '../../schema/index.js';
|
|
14
|
+
import { DocumentCategory } from './document-category.model.js';
|
|
15
|
+
export class DocumentType extends Entity {
|
|
16
|
+
categoryId;
|
|
17
|
+
group;
|
|
18
|
+
label;
|
|
19
|
+
}
|
|
20
|
+
__decorate([
|
|
21
|
+
Uuid(),
|
|
22
|
+
References(() => DocumentCategory),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], DocumentType.prototype, "categoryId", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
StringProperty({ nullable: true }),
|
|
27
|
+
__metadata("design:type", Object)
|
|
28
|
+
], DocumentType.prototype, "group", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
StringProperty(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], DocumentType.prototype, "label", void 0);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Entity } from '../../orm/entity.js';
|
|
2
|
+
import { NumericDate, Uuid } from '../../orm/types.js';
|
|
3
|
+
export declare class Document extends Entity {
|
|
4
|
+
fileId: Uuid;
|
|
5
|
+
typeId: Uuid | null;
|
|
6
|
+
addition: string | null;
|
|
7
|
+
date: NumericDate | null;
|
|
8
|
+
expiration: NumericDate | null;
|
|
9
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { References } from '../../orm/decorators.js';
|
|
11
|
+
import { Entity } from '../../orm/entity.js';
|
|
12
|
+
import { NumericDate, Uuid } from '../../orm/types.js';
|
|
13
|
+
import { StringProperty } from '../../schema/index.js';
|
|
14
|
+
import { DocumentFile } from './document-file.model.js';
|
|
15
|
+
import { DocumentType } from './document-type.model.js';
|
|
16
|
+
export class Document extends Entity {
|
|
17
|
+
fileId;
|
|
18
|
+
typeId;
|
|
19
|
+
addition;
|
|
20
|
+
date;
|
|
21
|
+
expiration;
|
|
22
|
+
}
|
|
23
|
+
__decorate([
|
|
24
|
+
Uuid(),
|
|
25
|
+
References(() => DocumentFile),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], Document.prototype, "fileId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
Uuid({ nullable: true }),
|
|
30
|
+
References(() => DocumentType),
|
|
31
|
+
__metadata("design:type", Object)
|
|
32
|
+
], Document.prototype, "typeId", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
StringProperty({ nullable: true }),
|
|
35
|
+
__metadata("design:type", Object)
|
|
36
|
+
], Document.prototype, "addition", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
NumericDate({ nullable: true }),
|
|
39
|
+
__metadata("design:type", Object)
|
|
40
|
+
], Document.prototype, "date", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
NumericDate({ nullable: true }),
|
|
43
|
+
__metadata("design:type", Object)
|
|
44
|
+
], Document.prototype, "expiration", void 0);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './document-category.model.js';
|
|
2
|
+
export * from './document-collection-document.model.js';
|
|
3
|
+
export * from './document-collection.model.js';
|
|
4
|
+
export * from './document-file.model.js';
|
|
5
|
+
export * from './document-property-value.model.js';
|
|
6
|
+
export * from './document-property.model.js';
|
|
7
|
+
export * from './document-request-collection.model.js';
|
|
8
|
+
export * from './document-request-file.model.js';
|
|
9
|
+
export * from './document-request-template.js';
|
|
10
|
+
export * from './document-request.model.js';
|
|
11
|
+
export * from './document-requests-template.js';
|
|
12
|
+
export * from './document-type-property.model.js';
|
|
13
|
+
export * from './document-type.model.js';
|
|
14
|
+
export * from './document.model.js';
|
|
15
|
+
export * from './service-models/index.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './document-category.model.js';
|
|
2
|
+
export * from './document-collection-document.model.js';
|
|
3
|
+
export * from './document-collection.model.js';
|
|
4
|
+
export * from './document-file.model.js';
|
|
5
|
+
export * from './document-property-value.model.js';
|
|
6
|
+
export * from './document-property.model.js';
|
|
7
|
+
export * from './document-request-collection.model.js';
|
|
8
|
+
export * from './document-request-file.model.js';
|
|
9
|
+
export * from './document-request-template.js';
|
|
10
|
+
export * from './document-request.model.js';
|
|
11
|
+
export * from './document-requests-template.js';
|
|
12
|
+
export * from './document-type-property.model.js';
|
|
13
|
+
export * from './document-type.model.js';
|
|
14
|
+
export * from './document.model.js';
|
|
15
|
+
export * from './service-models/index.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DocumentCategory } from './document-category.model.js';
|
|
2
|
+
import { DocumentCollectionDocument } from './document-collection-document.model.js';
|
|
3
|
+
import { DocumentCollection } from './document-collection.model.js';
|
|
4
|
+
import { DocumentFile } from './document-file.model.js';
|
|
5
|
+
import { DocumentPropertyBooleanValue, DocumentPropertyDecimalValue, DocumentPropertyIntegerValue, DocumentPropertyTextValue } from './document-property-value.model.js';
|
|
6
|
+
import { DocumentProperty } from './document-property.model.js';
|
|
7
|
+
import { DocumentRequestCollection } from './document-request-collection.model.js';
|
|
8
|
+
import { DocumentRequestFile } from './document-request-file.model.js';
|
|
9
|
+
import { DocumentRequestTemplate } from './document-request-template.js';
|
|
10
|
+
import { DocumentRequest } from './document-request.model.js';
|
|
11
|
+
import { DocumentRequestsTemplate } from './document-requests-template.js';
|
|
12
|
+
import { DocumentTypeProperty } from './document-type-property.model.js';
|
|
13
|
+
import { DocumentType } from './document-type.model.js';
|
|
14
|
+
import { Document } from './document.model.js';
|
|
15
|
+
export declare const documentManagementSchema: import("../../orm/database-schema.js").DatabaseSchema<"document_management">;
|
|
16
|
+
export declare const dataType: import("drizzle-orm/pg-core").PgEnum<["0", "1", "3", "2"]>;
|
|
17
|
+
export declare const documentCategory: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof DocumentCategory>;
|
|
18
|
+
export declare const documentCollectionDocument: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof DocumentCollectionDocument>;
|
|
19
|
+
export declare const documentCollection: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof DocumentCollection>;
|
|
20
|
+
export declare const documentFile: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof DocumentFile>;
|
|
21
|
+
export declare const documentPropertyTextValue: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof DocumentPropertyTextValue>;
|
|
22
|
+
export declare const documentPropertyIntegerValue: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof DocumentPropertyIntegerValue>;
|
|
23
|
+
export declare const documentPropertyDecimalValue: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof DocumentPropertyDecimalValue>;
|
|
24
|
+
export declare const documentPropertyBooleanValue: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof DocumentPropertyBooleanValue>;
|
|
25
|
+
export declare const documentProperty: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof DocumentProperty>;
|
|
26
|
+
export declare const documentRequestCollection: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof DocumentRequestCollection>;
|
|
27
|
+
export declare const documentRequestFile: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof DocumentRequestFile>;
|
|
28
|
+
export declare const documentRequestTemplate: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof DocumentRequestTemplate>;
|
|
29
|
+
export declare const documentRequest: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof DocumentRequest>;
|
|
30
|
+
export declare const documentRequestsTemplate: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof DocumentRequestsTemplate>;
|
|
31
|
+
export declare const documentTypeProperty: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof DocumentTypeProperty>;
|
|
32
|
+
export declare const documentType: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof DocumentType>;
|
|
33
|
+
export declare const document: import("../../orm/drizzle/schema-converter.js").PgTableFromType<"document_management", typeof Document>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { databaseSchema } from '../../orm/database-schema.js';
|
|
2
|
+
import { DocumentCategory } from './document-category.model.js';
|
|
3
|
+
import { DocumentCollectionDocument } from './document-collection-document.model.js';
|
|
4
|
+
import { DocumentCollection } from './document-collection.model.js';
|
|
5
|
+
import { DocumentFile } from './document-file.model.js';
|
|
6
|
+
import { DocumentPropertyBooleanValue, DocumentPropertyDecimalValue, DocumentPropertyIntegerValue, DocumentPropertyTextValue } from './document-property-value.model.js';
|
|
7
|
+
import { DocumentProperty, DocumentPropertyDataType } from './document-property.model.js';
|
|
8
|
+
import { DocumentRequestCollection } from './document-request-collection.model.js';
|
|
9
|
+
import { DocumentRequestFile } from './document-request-file.model.js';
|
|
10
|
+
import { DocumentRequestTemplate } from './document-request-template.js';
|
|
11
|
+
import { DocumentRequest } from './document-request.model.js';
|
|
12
|
+
import { DocumentRequestsTemplate } from './document-requests-template.js';
|
|
13
|
+
import { DocumentTypeProperty } from './document-type-property.model.js';
|
|
14
|
+
import { DocumentType } from './document-type.model.js';
|
|
15
|
+
import { Document } from './document.model.js';
|
|
16
|
+
export const documentManagementSchema = databaseSchema('document_management');
|
|
17
|
+
export const dataType = documentManagementSchema.getEnum(DocumentPropertyDataType, 'DocumentPropertyDataType');
|
|
18
|
+
export const documentCategory = documentManagementSchema.getTable(DocumentCategory);
|
|
19
|
+
export const documentCollectionDocument = documentManagementSchema.getTable(DocumentCollectionDocument);
|
|
20
|
+
export const documentCollection = documentManagementSchema.getTable(DocumentCollection);
|
|
21
|
+
export const documentFile = documentManagementSchema.getTable(DocumentFile);
|
|
22
|
+
export const documentPropertyTextValue = documentManagementSchema.getTable(DocumentPropertyTextValue);
|
|
23
|
+
export const documentPropertyIntegerValue = documentManagementSchema.getTable(DocumentPropertyIntegerValue);
|
|
24
|
+
export const documentPropertyDecimalValue = documentManagementSchema.getTable(DocumentPropertyDecimalValue);
|
|
25
|
+
export const documentPropertyBooleanValue = documentManagementSchema.getTable(DocumentPropertyBooleanValue);
|
|
26
|
+
export const documentProperty = documentManagementSchema.getTable(DocumentProperty);
|
|
27
|
+
export const documentRequestCollection = documentManagementSchema.getTable(DocumentRequestCollection);
|
|
28
|
+
export const documentRequestFile = documentManagementSchema.getTable(DocumentRequestFile);
|
|
29
|
+
export const documentRequestTemplate = documentManagementSchema.getTable(DocumentRequestTemplate);
|
|
30
|
+
export const documentRequest = documentManagementSchema.getTable(DocumentRequest);
|
|
31
|
+
export const documentRequestsTemplate = documentManagementSchema.getTable(DocumentRequestsTemplate);
|
|
32
|
+
export const documentTypeProperty = documentManagementSchema.getTable(DocumentTypeProperty);
|
|
33
|
+
export const documentType = documentManagementSchema.getTable(DocumentType);
|
|
34
|
+
export const document = documentManagementSchema.getTable(Document);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Array } from '../../../schema/index.js';
|
|
11
|
+
import { DocumentCategory } from '../document-category.model.js';
|
|
12
|
+
import { DocumentType } from '../document-type.model.js';
|
|
13
|
+
export class CategoryAndTypesView {
|
|
14
|
+
categories;
|
|
15
|
+
types;
|
|
16
|
+
}
|
|
17
|
+
__decorate([
|
|
18
|
+
Array(DocumentCategory),
|
|
19
|
+
__metadata("design:type", Array)
|
|
20
|
+
], CategoryAndTypesView.prototype, "categories", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
Array(DocumentType),
|
|
23
|
+
__metadata("design:type", Array)
|
|
24
|
+
], CategoryAndTypesView.prototype, "types", void 0);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DocumentManagementData, DocumentView } from './document.view-model.js';
|
|
2
|
+
import type { NormalizedDocumentManagementData, NormalizedDocumentView } from './normalized-document-collection-view.model.js';
|
|
3
|
+
export type DocumentManagementFolder = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
subFolders: DocumentManagementFolder[];
|
|
7
|
+
documents: DocumentView[];
|
|
8
|
+
};
|
|
9
|
+
export type NormalizedDocumentManagementFolder = {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
subFolders: NormalizedDocumentManagementFolder[];
|
|
13
|
+
documents: NormalizedDocumentView[];
|
|
14
|
+
};
|
|
15
|
+
export type GetDocumentManagementFoldersOptions = {
|
|
16
|
+
primaryCollectionId?: string | null;
|
|
17
|
+
includeAllFolder?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare function getDocumentManagementFolders(data: DocumentManagementData, options?: GetDocumentManagementFoldersOptions): DocumentManagementFolder[];
|
|
20
|
+
export declare function toNormalizedDocumentManagementFolders(folders: DocumentManagementFolder[], normalizedData: NormalizedDocumentManagementData): NormalizedDocumentManagementFolder[];
|
|
21
|
+
export declare function toNormalizedDocumentManagementFolder(folder: DocumentManagementFolder, normalizedData: NormalizedDocumentManagementData): NormalizedDocumentManagementFolder;
|
|
22
|
+
export declare function getFlatFolders(folders: NormalizedDocumentManagementFolder[]): NormalizedDocumentManagementFolder[];
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { distinct } from '../../../utils/array/array.js';
|
|
2
|
+
import { groupToSingleMap } from '../../../utils/iterable-helpers/group-to-single-map.js';
|
|
3
|
+
import { assertDefinedPass } from '../../../utils/type-guards.js';
|
|
4
|
+
export function getDocumentManagementFolders(data, options = {}) {
|
|
5
|
+
const categories = [...data.categories, { id: null, label: 'Sonstiges' }];
|
|
6
|
+
const typeMap = groupToSingleMap(data.types, (t) => t.id);
|
|
7
|
+
function getType(document) {
|
|
8
|
+
return typeMap.get(document.typeId) ?? null;
|
|
9
|
+
}
|
|
10
|
+
const allFolder = (options.includeAllFolder == true)
|
|
11
|
+
? []
|
|
12
|
+
: [{
|
|
13
|
+
id: 'all',
|
|
14
|
+
label: 'Alle',
|
|
15
|
+
documents: data.documents,
|
|
16
|
+
subFolders: []
|
|
17
|
+
}];
|
|
18
|
+
const categoryFolders = categories.map((category) => ({
|
|
19
|
+
id: `${category.id}`,
|
|
20
|
+
label: category.label,
|
|
21
|
+
subFolders: data.collections.map((collection) => {
|
|
22
|
+
const collectionDocuments = (collection.id == options.primaryCollectionId)
|
|
23
|
+
? data.documents.filter((document) => (document.collectionAssignments.length == 1) && document.collectionAssignments.some((assignment) => assignment.collectionId == collection.id))
|
|
24
|
+
: data.documents.filter((document) => document.collectionAssignments.some((assignment) => assignment.collectionId == collection.id));
|
|
25
|
+
const categoryCollectionDocuments = collectionDocuments.filter((document) => (getType(document)?.categoryId ?? null) == category.id);
|
|
26
|
+
const categoryCollectionDocumentTypeGroups = distinct(categoryCollectionDocuments.map((document) => getType(document)?.group ?? 'Unkategorisiert'));
|
|
27
|
+
return {
|
|
28
|
+
id: `${category.id}:${collection.id}`,
|
|
29
|
+
label: collection.name ?? 'Unbenannt',
|
|
30
|
+
subFolders: categoryCollectionDocumentTypeGroups.map((group) => ({
|
|
31
|
+
id: `${category.id}:${collection.id}:${group}`,
|
|
32
|
+
label: group,
|
|
33
|
+
subFolders: [],
|
|
34
|
+
documents: categoryCollectionDocuments.filter((document) => (getType(document)?.group ?? 'Unkategorisiert') == group)
|
|
35
|
+
})).filter((folder) => folder.documents.length > 0),
|
|
36
|
+
documents: categoryCollectionDocuments
|
|
37
|
+
};
|
|
38
|
+
}).filter((folder) => (folder.documents.length > 0) || (folder.subFolders.length > 0)),
|
|
39
|
+
documents: data.documents.filter((document) => (getType(document)?.categoryId ?? null) == category.id)
|
|
40
|
+
})).filter((folder) => (folder.documents.length > 0) || (folder.subFolders.length > 0));
|
|
41
|
+
return [...allFolder, ...categoryFolders];
|
|
42
|
+
}
|
|
43
|
+
export function toNormalizedDocumentManagementFolders(folders, normalizedData) {
|
|
44
|
+
return folders.map((folder) => toNormalizedDocumentManagementFolder(folder, normalizedData));
|
|
45
|
+
}
|
|
46
|
+
export function toNormalizedDocumentManagementFolder(folder, normalizedData) {
|
|
47
|
+
return {
|
|
48
|
+
id: folder.id,
|
|
49
|
+
label: folder.label,
|
|
50
|
+
subFolders: folder.subFolders.map((subFolder) => toNormalizedDocumentManagementFolder(subFolder, normalizedData)),
|
|
51
|
+
documents: folder.documents.map((document) => assertDefinedPass(normalizedData.documents.find((normalizedDocument) => normalizedDocument.id == document.id)))
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export function getFlatFolders(folders) {
|
|
55
|
+
return [...folders, ...folders.flatMap((folder) => getFlatFolders(folder.subFolders))];
|
|
56
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DocumentRequestTemplate } from '../document-request-template.js';
|
|
2
|
+
import { DocumentRequestsTemplate } from '../document-requests-template.js';
|
|
3
|
+
export declare class DocumentRequestsTemplateView extends DocumentRequestsTemplate {
|
|
4
|
+
requestTemplates: DocumentRequestTemplate[];
|
|
5
|
+
}
|
|
6
|
+
export declare class DocumentRequestsTemplateData {
|
|
7
|
+
templates: DocumentRequestsTemplateView[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Array } from '../../../schema/index.js';
|
|
11
|
+
import { DocumentRequestTemplate } from '../document-request-template.js';
|
|
12
|
+
import { DocumentRequestsTemplate } from '../document-requests-template.js';
|
|
13
|
+
export class DocumentRequestsTemplateView extends DocumentRequestsTemplate {
|
|
14
|
+
requestTemplates;
|
|
15
|
+
}
|
|
16
|
+
__decorate([
|
|
17
|
+
Array(DocumentRequestTemplate),
|
|
18
|
+
__metadata("design:type", Array)
|
|
19
|
+
], DocumentRequestsTemplateView.prototype, "requestTemplates", void 0);
|
|
20
|
+
export class DocumentRequestsTemplateData {
|
|
21
|
+
templates;
|
|
22
|
+
}
|
|
23
|
+
__decorate([
|
|
24
|
+
Array(DocumentRequestsTemplateView),
|
|
25
|
+
__metadata("design:type", Array)
|
|
26
|
+
], DocumentRequestsTemplateData.prototype, "templates", void 0);
|