@tstdl/base 0.93.1 → 0.93.3
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/api/server/api-request-token.provider.d.ts +5 -3
- package/api/server/api-request-token.provider.js +12 -4
- package/api/server/gateway.d.ts +1 -9
- package/api/server/gateway.js +67 -36
- package/api/types.d.ts +5 -1
- package/application/application.d.ts +2 -0
- package/application/application.js +3 -1
- package/application/providers.d.ts +1 -1
- package/application/providers.js +1 -1
- package/audit/audit.model.d.ts +106 -6
- package/audit/audit.model.js +156 -13
- package/audit/auditor.d.ts +115 -30
- package/audit/auditor.js +160 -19
- package/audit/drizzle/0000_bored_stick.sql +26 -0
- package/audit/drizzle/meta/0000_snapshot.json +195 -0
- package/audit/drizzle/meta/_journal.json +13 -0
- package/audit/drizzle.config.d.ts +2 -0
- package/audit/drizzle.config.js +11 -0
- package/audit/index.d.ts +3 -1
- package/audit/index.js +3 -1
- package/audit/module.d.ts +22 -0
- package/audit/module.js +33 -0
- package/audit/schemas.d.ts +6 -0
- package/audit/schemas.js +8 -0
- package/audit/types.d.ts +2 -1
- package/audit/types.js +2 -1
- package/authentication/models/authentication-credentials.model.js +1 -2
- package/authentication/models/authentication-session.model.d.ts +2 -2
- package/authentication/models/authentication-session.model.js +3 -5
- package/authentication/models/index.d.ts +0 -1
- package/authentication/models/index.js +0 -1
- package/authentication/server/authentication-api-request-token.provider.d.ts +2 -2
- package/authentication/server/authentication-api-request-token.provider.js +8 -5
- package/authentication/server/authentication.api-controller.d.ts +8 -8
- package/authentication/server/authentication.api-controller.js +16 -16
- package/authentication/server/authentication.audit.d.ts +34 -0
- package/authentication/server/authentication.audit.js +1 -0
- package/authentication/server/authentication.service.d.ts +19 -10
- package/authentication/server/authentication.service.js +158 -43
- package/authentication/server/drizzle.config.js +1 -1
- package/authentication/server/index.d.ts +1 -0
- package/authentication/server/index.js +1 -0
- package/authentication/server/module.d.ts +1 -1
- package/authentication/{models → server}/schemas.d.ts +2 -3
- package/authentication/{models → server}/schemas.js +2 -3
- package/constants.d.ts +1 -0
- package/constants.js +1 -0
- package/document-management/api/document-management.api.d.ts +74 -74
- package/document-management/models/document-assignment-scope.model.d.ts +1 -2
- package/document-management/models/document-assignment-scope.model.js +4 -6
- package/document-management/models/document-assignment-task.model.d.ts +1 -2
- package/document-management/models/document-assignment-task.model.js +3 -5
- package/document-management/models/document-category.model.d.ts +1 -2
- package/document-management/models/document-category.model.js +3 -4
- package/document-management/models/document-collection-assignment.model.d.ts +1 -2
- package/document-management/models/document-collection-assignment.model.js +5 -7
- package/document-management/models/document-collection.model.d.ts +1 -2
- package/document-management/models/document-collection.model.js +3 -4
- package/document-management/models/document-management-table.d.ts +1 -1
- package/document-management/models/document-management-table.js +1 -1
- package/document-management/models/document-property-value.model.d.ts +1 -2
- package/document-management/models/document-property-value.model.js +5 -8
- package/document-management/models/document-property.model.d.ts +1 -2
- package/document-management/models/document-property.model.js +2 -3
- package/document-management/models/document-request-collection-assignment.model.d.ts +1 -2
- package/document-management/models/document-request-collection-assignment.model.js +4 -6
- package/document-management/models/document-request-template.d.ts +1 -2
- package/document-management/models/document-request-template.js +4 -6
- package/document-management/models/document-request.model.d.ts +1 -1
- package/document-management/models/document-request.model.js +4 -5
- package/document-management/models/document-requests-template.d.ts +1 -1
- package/document-management/models/document-requests-template.js +2 -3
- package/document-management/models/document-tag-assignment.model.d.ts +1 -2
- package/document-management/models/document-tag-assignment.model.js +4 -6
- package/document-management/models/document-tag.model.d.ts +1 -1
- package/document-management/models/document-tag.model.js +2 -3
- package/document-management/models/document-type-property.model.d.ts +1 -2
- package/document-management/models/document-type-property.model.js +4 -6
- package/document-management/models/document-type-validation.model.d.ts +1 -2
- package/document-management/models/document-type-validation.model.js +4 -6
- package/document-management/models/document-type.model.d.ts +1 -2
- package/document-management/models/document-type.model.js +3 -5
- package/document-management/models/document-validation-definition.model.d.ts +1 -2
- package/document-management/models/document-validation-definition.model.js +3 -4
- package/document-management/models/document-validation-execution-related-document.model.d.ts +1 -2
- package/document-management/models/document-validation-execution-related-document.model.js +4 -6
- package/document-management/models/document-validation-execution.model.d.ts +1 -2
- package/document-management/models/document-validation-execution.model.js +6 -8
- package/document-management/models/document-workflow.model.d.ts +1 -2
- package/document-management/models/document-workflow.model.js +5 -7
- package/document-management/models/document.model.d.ts +1 -2
- package/document-management/models/document.model.js +5 -7
- package/document-management/server/api/document-management.api.js +1 -1
- package/document-management/server/module.d.ts +1 -1
- package/document-management/server/module.js +1 -1
- package/document-management/server/schemas.d.ts +1 -1
- package/document-management/server/schemas.js +1 -1
- package/document-management/server/services/document-category-type.service.d.ts +2 -2
- package/document-management/server/services/document-category-type.service.js +1 -2
- package/document-management/server/services/document-collection.service.d.ts +1 -1
- package/document-management/server/services/document-collection.service.js +1 -2
- package/document-management/server/services/document-management.service.js +6 -6
- package/document-management/server/services/document-property.service.d.ts +1 -1
- package/document-management/server/services/document-property.service.js +1 -2
- package/document-management/server/services/document-validation.service.js +2 -2
- package/document-management/server/services/document-workflow.service.d.ts +2 -2
- package/document-management/server/services/document-workflow.service.js +1 -2
- package/document-management/server/services/document.service.d.ts +1 -1
- package/document-management/server/services/document.service.js +1 -2
- package/document-management/server/services/singleton.js +1 -1
- package/document-management/service-models/document.service-model.d.ts +62 -62
- package/document-management/service-models/document.service-model.js +1 -1
- package/document-management/service-models/enriched/enriched-document-management-data.view.js +1 -1
- package/document-management/service-models/enriched/enriched-document.view.d.ts +1 -1
- package/examples/api/authentication.js +2 -2
- package/examples/api/basic-overview.js +2 -2
- package/examples/api/custom-authentication.js +2 -2
- package/examples/api/streaming.js +2 -2
- package/examples/browser/basic.js +2 -2
- package/examples/document-management/main.js +2 -2
- package/examples/http/client.js +2 -2
- package/examples/mail/basic.js +2 -2
- package/examples/pdf/basic.js +2 -2
- package/examples/template/basic.js +2 -2
- package/http/server/http-server-request.d.ts +3 -3
- package/key-value-store/postgres/key-value-store.service.js +1 -2
- package/key-value-store/postgres/models/key-value.model.d.ts +1 -2
- package/key-value-store/postgres/models/key-value.model.js +2 -4
- package/key-value-store/postgres/models/schemas.d.ts +1 -1
- package/key-value-store/postgres/models/schemas.js +1 -1
- package/lock/postgres/lock.js +1 -1
- package/lock/postgres/models/lock.model.d.ts +1 -2
- package/lock/postgres/models/lock.model.js +3 -5
- package/lock/postgres/models/schemas.d.ts +1 -1
- package/lock/postgres/models/schemas.js +1 -1
- package/lock/postgres/provider.js +1 -2
- package/mail/models/mail-log.model.d.ts +1 -1
- package/mail/models/mail-log.model.js +4 -5
- package/mail/models/schemas.d.ts +1 -1
- package/mail/models/schemas.js +1 -1
- package/openid-connect/oidc-state.model.d.ts +1 -1
- package/openid-connect/oidc-state.model.js +2 -3
- package/openid-connect/oidc.service.js +1 -1
- package/orm/data-types/bytea.js +1 -1
- package/orm/data-types/numeric-date.js +1 -1
- package/orm/decorators.d.ts +65 -72
- package/orm/decorators.js +42 -40
- package/orm/entity.d.ts +7 -1
- package/orm/entity.js +25 -11
- package/orm/index.d.ts +2 -1
- package/orm/index.js +2 -1
- package/orm/schemas/json.d.ts +1 -1
- package/orm/schemas/json.js +1 -1
- package/orm/schemas/numeric-date.d.ts +1 -1
- package/orm/schemas/numeric-date.js +1 -1
- package/orm/schemas/timestamp.d.ts +1 -1
- package/orm/schemas/timestamp.js +1 -1
- package/orm/schemas/uuid.d.ts +2 -2
- package/orm/schemas/uuid.js +1 -1
- package/orm/server/drizzle/schema-converter.ts +408 -0
- package/orm/server/repository.d.ts +1 -1
- package/orm/server/repository.js +12 -9
- package/orm/sqls.d.ts +1 -1
- package/orm/sqls.js +1 -1
- package/orm/types.d.ts +2 -6
- package/orm/types.js +1 -4
- package/package.json +15 -24
- package/queue/postgres/job.model.d.ts +3 -3
- package/queue/postgres/job.model.js +5 -6
- package/queue/postgres/queue.js +2 -2
- package/queue/postgres/schemas.d.ts +1 -1
- package/queue/postgres/schemas.js +1 -1
- package/supports.d.ts +1 -0
- package/supports.js +2 -1
- package/types/types.d.ts +12 -1
- package/utils/object/object.d.ts +3 -1
- package/utils/object/object.js +7 -1
- package/orm/server/drizzle/index.js +0 -1
- package/orm/server/drizzle/schema-converter.d.ts +0 -15
- package/orm/server/drizzle/schema-converter.js +0 -300
- /package/orm/server/drizzle/{index.d.ts → index.ts} +0 -0
|
@@ -8,9 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { defineEnum } from '../../enumeration/enumeration.js';
|
|
11
|
-
import { ForeignKey, References } from '../../orm/
|
|
12
|
-
import { Entity } from '../../orm/entity.js';
|
|
13
|
-
import { Index, Timestamp, Unique, Uuid } from '../../orm/types.js';
|
|
11
|
+
import { Entity, ForeignKey, Index, References, TimestampProperty, Unique, UuidProperty } from '../../orm/index.js';
|
|
14
12
|
import { Enumeration } from '../../schema/index.js';
|
|
15
13
|
import { DocumentManagementTable } from './document-management-table.js';
|
|
16
14
|
import { Document } from './document.model.js';
|
|
@@ -46,11 +44,11 @@ let DocumentWorkflow = class DocumentWorkflow extends Entity {
|
|
|
46
44
|
completeUserId;
|
|
47
45
|
};
|
|
48
46
|
__decorate([
|
|
49
|
-
|
|
47
|
+
UuidProperty(),
|
|
50
48
|
__metadata("design:type", String)
|
|
51
49
|
], DocumentWorkflow.prototype, "tenantId", void 0);
|
|
52
50
|
__decorate([
|
|
53
|
-
|
|
51
|
+
UuidProperty(),
|
|
54
52
|
References(() => Document),
|
|
55
53
|
__metadata("design:type", String)
|
|
56
54
|
], DocumentWorkflow.prototype, "documentId", void 0);
|
|
@@ -67,11 +65,11 @@ __decorate([
|
|
|
67
65
|
__metadata("design:type", Object)
|
|
68
66
|
], DocumentWorkflow.prototype, "failReason", void 0);
|
|
69
67
|
__decorate([
|
|
70
|
-
|
|
68
|
+
TimestampProperty({ nullable: true }),
|
|
71
69
|
__metadata("design:type", Object)
|
|
72
70
|
], DocumentWorkflow.prototype, "completeTimestamp", void 0);
|
|
73
71
|
__decorate([
|
|
74
|
-
|
|
72
|
+
UuidProperty({ nullable: true }),
|
|
75
73
|
__metadata("design:type", Object)
|
|
76
74
|
], DocumentWorkflow.prototype, "completeUserId", void 0);
|
|
77
75
|
DocumentWorkflow = __decorate([
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type EnumType } from '../../enumeration/enumeration.js';
|
|
2
|
-
import { Entity } from '../../orm/
|
|
3
|
-
import { NumericDate, Uuid } from '../../orm/types.js';
|
|
2
|
+
import { Entity, type NumericDate, type Uuid } from '../../orm/index.js';
|
|
4
3
|
export declare const DocumentApproval: {
|
|
5
4
|
readonly Pending: "pending";
|
|
6
5
|
readonly Approved: "approved";
|
|
@@ -8,9 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { defineEnum } from '../../enumeration/enumeration.js';
|
|
11
|
-
import { References } from '../../orm/
|
|
12
|
-
import { Entity } from '../../orm/entity.js';
|
|
13
|
-
import { NumericDate, Unique, Uuid } from '../../orm/types.js';
|
|
11
|
+
import { Entity, NumericDateProperty, References, Unique, UuidProperty } from '../../orm/index.js';
|
|
14
12
|
import { Enumeration, Integer, StringProperty } from '../../schema/index.js';
|
|
15
13
|
import { DocumentManagementTable } from './document-management-table.js';
|
|
16
14
|
import { DocumentType } from './document-type.model.js';
|
|
@@ -36,11 +34,11 @@ let Document = class Document extends Entity {
|
|
|
36
34
|
createUserId;
|
|
37
35
|
};
|
|
38
36
|
__decorate([
|
|
39
|
-
|
|
37
|
+
UuidProperty(),
|
|
40
38
|
__metadata("design:type", String)
|
|
41
39
|
], Document.prototype, "tenantId", void 0);
|
|
42
40
|
__decorate([
|
|
43
|
-
|
|
41
|
+
UuidProperty({ nullable: true }),
|
|
44
42
|
References(() => DocumentType),
|
|
45
43
|
__metadata("design:type", Object)
|
|
46
44
|
], Document.prototype, "typeId", void 0);
|
|
@@ -57,7 +55,7 @@ __decorate([
|
|
|
57
55
|
__metadata("design:type", Object)
|
|
58
56
|
], Document.prototype, "pages", void 0);
|
|
59
57
|
__decorate([
|
|
60
|
-
|
|
58
|
+
NumericDateProperty({ nullable: true, coerce: true }),
|
|
61
59
|
__metadata("design:type", Object)
|
|
62
60
|
], Document.prototype, "date", void 0);
|
|
63
61
|
__decorate([
|
|
@@ -89,7 +87,7 @@ __decorate([
|
|
|
89
87
|
__metadata("design:type", Number)
|
|
90
88
|
], Document.prototype, "size", void 0);
|
|
91
89
|
__decorate([
|
|
92
|
-
|
|
90
|
+
UuidProperty({ nullable: true }),
|
|
93
91
|
__metadata("design:type", Object)
|
|
94
92
|
], Document.prototype, "createUserId", void 0);
|
|
95
93
|
Document = __decorate([
|
|
@@ -13,7 +13,7 @@ import { ForbiddenError, NotImplementedError } from '../../../errors/index.js';
|
|
|
13
13
|
import { HttpServerResponse } from '../../../http/index.js';
|
|
14
14
|
import { inject } from '../../../injector/index.js';
|
|
15
15
|
import { Logger } from '../../../logger/logger.js';
|
|
16
|
-
import { injectRepository } from '../../../orm/server/
|
|
16
|
+
import { injectRepository } from '../../../orm/server/index.js';
|
|
17
17
|
import { toArray } from '../../../utils/array/index.js';
|
|
18
18
|
import { documentManagementApiDefinition } from '../../api/index.js';
|
|
19
19
|
import { DocumentManagementAuthorizationService } from '../../authorization/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './schemas.js';
|
|
2
2
|
import { type InjectionToken } from '../../injector/index.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type DatabaseConfig } from '../../orm/server/index.js';
|
|
4
4
|
import type { DocumentManagementAuthorizationService } from '../authorization/document-management-authorization.service.js';
|
|
5
5
|
import type { DocumentManagementAncillaryService } from './services/document-management-ancillary.service.js';
|
|
6
6
|
export declare class DocumentManagementConfiguration {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './schemas.js';
|
|
2
2
|
import { inject } from '../../injector/index.js';
|
|
3
|
-
import { Database, migrate } from '../../orm/server/
|
|
3
|
+
import { Database, migrate } from '../../orm/server/index.js';
|
|
4
4
|
export class DocumentManagementConfiguration {
|
|
5
5
|
ancillaryService;
|
|
6
6
|
authorizationService;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document, DocumentAssignmentScope, DocumentAssignmentTask, DocumentCategory, DocumentCollection, DocumentCollectionAssignment, DocumentProperty, DocumentPropertyValue, DocumentRequest, DocumentRequestCollectionAssignment, DocumentRequestsTemplate, DocumentRequestTemplate, DocumentTag, DocumentTagAssignment, DocumentType, DocumentTypeProperty, DocumentTypeValidation, DocumentValidationDefinition, DocumentValidationExecution, DocumentValidationExecutionRelatedDocument, DocumentWorkflow } from '../models/index.js';
|
|
2
|
-
export declare const documentManagementSchema: import("../../orm/server/
|
|
2
|
+
export declare const documentManagementSchema: import("../../orm/server/index.js").DatabaseSchema<"document_management">;
|
|
3
3
|
export declare const documentApproval: import("drizzle-orm/pg-core").PgEnum<["pending", "approved", "rejected"]>;
|
|
4
4
|
export declare const documentAssignmentTarget: import("drizzle-orm/pg-core").PgEnum<["request", "collection"]>;
|
|
5
5
|
export declare const documentPropertyDataType: import("drizzle-orm/pg-core").PgEnum<["boolean", "date", "text", "decimal", "integer"]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { databaseSchema } from '../../orm/server/
|
|
1
|
+
import { databaseSchema } from '../../orm/server/index.js';
|
|
2
2
|
import { Document, DocumentApproval, DocumentAssignmentScope, DocumentAssignmentTarget, DocumentAssignmentTask, DocumentCategory, DocumentCollection, DocumentCollectionAssignment, DocumentProperty, DocumentPropertyDataType, DocumentPropertyValue, DocumentRequest, DocumentRequestCollectionAssignment, DocumentRequestState, DocumentRequestsTemplate, DocumentRequestTemplate, DocumentTag, DocumentTagAssignment, DocumentType, DocumentTypeProperty, DocumentTypeValidation, DocumentValidationDefinition, DocumentValidationExecution, DocumentValidationExecutionRelatedDocument, DocumentValidationExecutionState, DocumentValidationResultStatus, DocumentWorkflow, DocumentWorkflowFailReason, DocumentWorkflowState, DocumentWorkflowStep } from '../models/index.js';
|
|
3
3
|
export const documentManagementSchema = databaseSchema('document_management');
|
|
4
4
|
export const documentApproval = documentManagementSchema.getEnum(DocumentApproval);
|
|
@@ -2,8 +2,8 @@ import { Transactional } from '../../../orm/server/index.js';
|
|
|
2
2
|
import { DocumentCategory, DocumentType } from '../../models/index.js';
|
|
3
3
|
import type { DocumentCategoryView } from '../../service-models/index.js';
|
|
4
4
|
export declare class DocumentCategoryTypeService extends Transactional {
|
|
5
|
-
readonly categoryRepository: import("../../../orm/server/
|
|
6
|
-
readonly typeRepository: import("../../../orm/server/
|
|
5
|
+
readonly categoryRepository: import("../../../orm/server/index.js").EntityRepository<DocumentCategory>;
|
|
6
|
+
readonly typeRepository: import("../../../orm/server/index.js").EntityRepository<DocumentType>;
|
|
7
7
|
loadCategory(tenantId: string, id: string): Promise<DocumentCategory>;
|
|
8
8
|
loadType(tenantId: string, id: string): Promise<DocumentType>;
|
|
9
9
|
createCategory(data: {
|
|
@@ -4,8 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { Transactional } from '../../../orm/server/index.js';
|
|
8
|
-
import { injectRepository } from '../../../orm/server/repository.js';
|
|
7
|
+
import { injectRepository, Transactional } from '../../../orm/server/index.js';
|
|
9
8
|
import { groupToMap } from '../../../utils/iterable-helpers/group-to-map.js';
|
|
10
9
|
import { isUndefined } from '../../../utils/type-guards.js';
|
|
11
10
|
import { DocumentCategory, DocumentType } from '../../models/index.js';
|
|
@@ -5,7 +5,7 @@ import { Document, DocumentCollection } from '../../models/index.js';
|
|
|
5
5
|
import type { DocumentCollectionMetadata } from '../../service-models/index.js';
|
|
6
6
|
export declare class DocumentCollectionService extends Transactional {
|
|
7
7
|
#private;
|
|
8
|
-
readonly repository: import("../../../orm/server/
|
|
8
|
+
readonly repository: import("../../../orm/server/index.js").EntityRepository<DocumentCollection>;
|
|
9
9
|
resolveMetadata<const T extends (DocumentCollection | string)[]>(tenantId: string, collectionsOrIds: T): Promise<{
|
|
10
10
|
[K in keyof T]: DocumentCollectionMetadata;
|
|
11
11
|
}>;
|
|
@@ -7,8 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { and, eq, sql } from 'drizzle-orm';
|
|
8
8
|
import { inject } from '../../../injector/inject.js';
|
|
9
9
|
import { TRANSACTION_TIMESTAMP } from '../../../orm/index.js';
|
|
10
|
-
import { Transactional } from '../../../orm/server/index.js';
|
|
11
|
-
import { injectRepository } from '../../../orm/server/repository.js';
|
|
10
|
+
import { injectRepository, Transactional } from '../../../orm/server/index.js';
|
|
12
11
|
import { toArray } from '../../../utils/array/index.js';
|
|
13
12
|
import { fromEntries } from '../../../utils/object/index.js';
|
|
14
13
|
import { assertDefinedPass, isString } from '../../../utils/type-guards.js';
|
|
@@ -198,12 +198,12 @@ let DocumentManagementService = DocumentManagementService_1 = class DocumentMana
|
|
|
198
198
|
if (isUndefined(category)) {
|
|
199
199
|
const category = await this.#documentCategoryTypeService.withTransaction(tx).createCategory({ tenantId, label, parentId: parentCategoryId, enumKey });
|
|
200
200
|
enumKeyCategoryMap.set(enumKey, category);
|
|
201
|
-
this.#logger.info(`Created category ${category.label}`);
|
|
201
|
+
this.#logger.info(`Created category "${category.label}"`);
|
|
202
202
|
}
|
|
203
203
|
else if ((category.label != label) || (category.parentId != parentCategoryId)) {
|
|
204
204
|
const updatedCategory = await this.#documentCategoryTypeService.withTransaction(tx).updateCategory(tenantId, category.id, { label, parentId: parentCategoryId });
|
|
205
205
|
enumKeyCategoryMap.set(enumKey, updatedCategory);
|
|
206
|
-
this.#logger.info(`Updated category ${updatedCategory.label}`);
|
|
206
|
+
this.#logger.info(`Updated category "${updatedCategory.label}"`);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
for (const [enumKey, label] of typeEntries) {
|
|
@@ -213,12 +213,12 @@ let DocumentManagementService = DocumentManagementService_1 = class DocumentMana
|
|
|
213
213
|
if (isUndefined(type)) {
|
|
214
214
|
const type = await this.#documentCategoryTypeService.withTransaction(tx).createType({ tenantId, label, categoryId: category.id, enumKey });
|
|
215
215
|
enumKeyTypeMap.set(enumKey, type);
|
|
216
|
-
this.#logger.info(`Created type ${type.label} in category ${category.label}`);
|
|
216
|
+
this.#logger.info(`Created type "${type.label}" in category "${category.label}"`);
|
|
217
217
|
}
|
|
218
218
|
else if ((type.categoryId != category.id) || (type.label != label)) {
|
|
219
219
|
const updatedType = await this.#documentCategoryTypeService.withTransaction(tx).updateType(tenantId, type.id, { categoryId: category.id, label: label });
|
|
220
220
|
enumKeyTypeMap.set(enumKey, updatedType);
|
|
221
|
-
this.#logger.info(`Updated type ${updatedType.label} in category ${category.label}`);
|
|
221
|
+
this.#logger.info(`Updated type "${updatedType.label}" in category "${category.label}"`);
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
for (const [enumKey, [dataType, label]] of propertyEntries) {
|
|
@@ -226,12 +226,12 @@ let DocumentManagementService = DocumentManagementService_1 = class DocumentMana
|
|
|
226
226
|
if (isUndefined(property)) {
|
|
227
227
|
const newProperty = await this.#documentPropertyService.withTransaction(tx).createProperty({ tenantId, label, dataType, enumKey });
|
|
228
228
|
enumKeyPropertyMap.set(enumKey, newProperty);
|
|
229
|
-
this.#logger.info(`Created property ${newProperty.label} of type ${dataType}`);
|
|
229
|
+
this.#logger.info(`Created property "${newProperty.label}" of type "${dataType}"`);
|
|
230
230
|
}
|
|
231
231
|
else if ((property.label != label) || (property.dataType != dataType)) {
|
|
232
232
|
const updatedProperty = await this.#documentPropertyService.withTransaction(tx).updateProperty(tenantId, property.id, { label, dataType });
|
|
233
233
|
enumKeyPropertyMap.set(enumKey, updatedProperty);
|
|
234
|
-
this.#logger.info(`Updated property ${updatedProperty.label} of type ${updatedProperty.dataType}`);
|
|
234
|
+
this.#logger.info(`Updated property "${updatedProperty.label}" of type "${updatedProperty.dataType}"`);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
for (const [typeKey, propertyKeys] of objectEntries(data.typeProperties)) {
|
|
@@ -4,7 +4,7 @@ import { DocumentProperty, DocumentPropertyDataType, type Document } from '../..
|
|
|
4
4
|
import type { DocumentPropertyValueView, DocumentPropertyView, SetDocumentPropertyParameters } from '../../service-models/index.js';
|
|
5
5
|
export declare class DocumentPropertyService extends Transactional {
|
|
6
6
|
#private;
|
|
7
|
-
readonly repository: import("../../../orm/server/
|
|
7
|
+
readonly repository: import("../../../orm/server/index.js").EntityRepository<DocumentProperty>;
|
|
8
8
|
readonly documentProperties: import("drizzle-orm/pg-core").WithSubqueryWithSelection<{
|
|
9
9
|
documentId: import("drizzle-orm").SQL.Aliased<string>;
|
|
10
10
|
propertyId: import("drizzle-orm").SQL.Aliased<string>;
|
|
@@ -9,8 +9,7 @@ import { BadRequestError } from '../../../errors/bad-request.error.js';
|
|
|
9
9
|
import { NotFoundError } from '../../../errors/not-found.error.js';
|
|
10
10
|
import { inject } from '../../../injector/index.js';
|
|
11
11
|
import { autoAlias, coalesce, getEntityMap, toJsonb } from '../../../orm/index.js';
|
|
12
|
-
import { Transactional } from '../../../orm/server/index.js';
|
|
13
|
-
import { injectRepository } from '../../../orm/server/repository.js';
|
|
12
|
+
import { injectRepository, Transactional } from '../../../orm/server/index.js';
|
|
14
13
|
import { toArray } from '../../../utils/array/index.js';
|
|
15
14
|
import { assertBooleanPass, assertNumberPass, assertStringPass, isBoolean, isNotNull, isNull, isNumber, isString, isUndefined } from '../../../utils/type-guards.js';
|
|
16
15
|
import { DocumentProperty, DocumentPropertyDataType, DocumentPropertyValue, DocumentTypeProperty } from '../../models/index.js';
|
|
@@ -12,8 +12,8 @@ import { Injector } from '../../../injector/injector.js';
|
|
|
12
12
|
import { afterResolve } from '../../../injector/interfaces.js';
|
|
13
13
|
import { injectionToken } from '../../../injector/token.js';
|
|
14
14
|
import { Logger } from '../../../logger/logger.js';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { getEntityIds } from '../../../orm/index.js';
|
|
16
|
+
import { injectRepository } from '../../../orm/server/index.js';
|
|
17
17
|
import { Queue } from '../../../queue/queue.js';
|
|
18
18
|
import { currentTimestamp } from '../../../utils/date-time.js';
|
|
19
19
|
import { isNull, isUndefined } from '../../../utils/type-guards.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { AfterResolveContext } from '../../../injector/index.js';
|
|
2
2
|
import { afterResolve } from '../../../injector/interfaces.js';
|
|
3
|
-
import { Transactional } from '../../../orm/server/
|
|
3
|
+
import { Transactional } from '../../../orm/server/index.js';
|
|
4
4
|
import type { OneOrMany } from '../../../types/index.js';
|
|
5
5
|
import { DocumentWorkflow, DocumentWorkflowStep } from '../../models/document-workflow.model.js';
|
|
6
6
|
export declare class DocumentWorkflowService extends Transactional {
|
|
7
7
|
#private;
|
|
8
8
|
private readonly documentService;
|
|
9
|
-
readonly repository: import("../../../orm/server/
|
|
9
|
+
readonly repository: import("../../../orm/server/index.js").EntityRepository<DocumentWorkflow>;
|
|
10
10
|
[afterResolve](_: unknown, { cancellationSignal }: AfterResolveContext<any>): void;
|
|
11
11
|
loadLatestWorkflow(tenantId: string, documentId: string): Promise<DocumentWorkflow>;
|
|
12
12
|
loadLatestWorkflows(tenantId: string, documentIds: string[]): Promise<DocumentWorkflow[]>;
|
|
@@ -12,8 +12,7 @@ import { NotImplementedError } from '../../../errors/not-implemented.error.js';
|
|
|
12
12
|
import { inject } from '../../../injector/inject.js';
|
|
13
13
|
import { afterResolve } from '../../../injector/interfaces.js';
|
|
14
14
|
import { Logger } from '../../../logger/index.js';
|
|
15
|
-
import { injectRepository } from '../../../orm/server/
|
|
16
|
-
import { injectTransactional, Transactional } from '../../../orm/server/transactional.js';
|
|
15
|
+
import { injectRepository, injectTransactional, Transactional } from '../../../orm/server/index.js';
|
|
17
16
|
import { Queue } from '../../../queue/queue.js';
|
|
18
17
|
import { toArray } from '../../../utils/array/array.js';
|
|
19
18
|
import { currentTimestamp } from '../../../utils/date-time.js';
|
|
@@ -4,7 +4,7 @@ import { Document, type UpdatableDocumentProperties } from '../../models/index.j
|
|
|
4
4
|
import type { CreateDocumentParameters, SetDocumentPropertyParameters, UpdateDocumentCollectionsParameters } from '../../service-models/index.js';
|
|
5
5
|
export declare class DocumentService extends Transactional {
|
|
6
6
|
#private;
|
|
7
|
-
readonly repository: import("../../../orm/server/
|
|
7
|
+
readonly repository: import("../../../orm/server/index.js").EntityRepository<Document>;
|
|
8
8
|
create(tenantId: string, { typeId, title, subtitle, date, summary, tags, approval, comment, originalFileName, assignment, properties, metadata }: TypedOmit<CreateDocumentParameters, 'uploadId'>, contentSource: Uint8Array<ArrayBuffer> | ReadableStream<Uint8Array<ArrayBuffer>> | {
|
|
9
9
|
uploadId: string;
|
|
10
10
|
uploadKey: string;
|
|
@@ -10,8 +10,7 @@ import { match, P } from 'ts-pattern';
|
|
|
10
10
|
import { BadRequestError } from '../../../errors/bad-request.error.js';
|
|
11
11
|
import { inject } from '../../../injector/inject.js';
|
|
12
12
|
import { Logger } from '../../../logger/logger.js';
|
|
13
|
-
import { injectTransactional, Transactional } from '../../../orm/server/index.js';
|
|
14
|
-
import { injectRepository } from '../../../orm/server/repository.js';
|
|
13
|
+
import { injectRepository, injectTransactional, Transactional } from '../../../orm/server/index.js';
|
|
15
14
|
import { getPdfPageCount } from '../../../pdf/utils.js';
|
|
16
15
|
import { toArray } from '../../../utils/array/index.js';
|
|
17
16
|
import { objectKeys } from '../../../utils/object/object.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Singleton } from '../../../injector/decorators.js';
|
|
2
2
|
import { factoryProvider } from '../../../injector/provider.js';
|
|
3
|
-
import { DatabaseConfig } from '../../../orm/server/
|
|
3
|
+
import { DatabaseConfig } from '../../../orm/server/index.js';
|
|
4
4
|
import { DocumentManagementConfiguration } from '../module.js';
|
|
5
5
|
export const documentManagementDatabaseConfigFactoryProvider = factoryProvider((_, context) => context.resolve(DocumentManagementConfiguration).database ?? context.resolve(DatabaseConfig, undefined, { skipSelf: true }));
|
|
6
6
|
export const documentManagementDatabaseConfigProvider = {
|