@tstdl/base 0.92.142 → 0.92.144
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/ai-file.service.js +1 -1
- package/ai/ai.service.js +3 -3
- package/ai/types.d.ts +1 -1
- package/api/client/client.d.ts +1 -1
- package/api/client/client.js +10 -4
- package/api/server/middlewares/content-type.middleware.js +8 -7
- package/api/types.js +1 -1
- package/authentication/client/authentication.service.js +3 -3
- package/authentication/server/authentication-ancillary.service.d.ts +11 -1
- package/authentication/server/authentication-ancillary.service.js +1 -1
- package/authentication/server/authentication-secret-requirements.validator.js +1 -1
- package/authentication/server/authentication.api-controller.js +22 -10
- package/authentication/server/authentication.service.d.ts +11 -5
- package/authentication/server/authentication.service.js +97 -49
- package/authentication/server/drizzle.config.js +2 -2
- package/authentication/server/module.js +1 -1
- package/cancellation/token.d.ts +2 -2
- package/cancellation/token.js +4 -4
- package/cookie/cookie.js +2 -2
- package/document-management/api/document-management.api.d.ts +122 -24
- package/document-management/api/document-management.api.js +17 -0
- package/document-management/{server/services → authorization}/document-management-authorization.service.d.ts +7 -7
- package/document-management/authorization/document-management-authorization.service.js +2 -0
- package/document-management/authorization/index.d.ts +2 -0
- package/document-management/authorization/index.js +2 -0
- package/document-management/authorization/policies.d.ts +38 -0
- package/document-management/authorization/policies.js +2 -0
- package/document-management/index.d.ts +1 -0
- package/document-management/index.js +1 -0
- package/document-management/models/document-assignment-scope.model.d.ts +1 -0
- package/document-management/models/document-assignment-scope.model.js +10 -3
- package/document-management/models/document-assignment-task.model.d.ts +1 -0
- package/document-management/models/document-assignment-task.model.js +8 -2
- package/document-management/models/document-category.model.d.ts +1 -0
- package/document-management/models/document-category.model.js +7 -1
- package/document-management/models/document-collection-assignment.model.d.ts +1 -0
- package/document-management/models/document-collection-assignment.model.js +12 -4
- package/document-management/models/document-collection.model.d.ts +2 -0
- package/document-management/models/document-collection.model.js +8 -2
- package/document-management/models/document-management-table.d.ts +3 -1
- package/document-management/models/document-management-table.js +2 -2
- package/document-management/models/document-property-value.model.d.ts +1 -0
- package/document-management/models/document-property-value.model.js +9 -3
- package/document-management/models/document-property.model.d.ts +1 -0
- package/document-management/models/document-property.model.js +8 -2
- package/document-management/models/document-request-collection-assignment.model.d.ts +1 -0
- package/document-management/models/document-request-collection-assignment.model.js +12 -4
- package/document-management/models/document-request-template.d.ts +1 -0
- package/document-management/models/document-request-template.js +6 -1
- package/document-management/models/document-request.model.d.ts +1 -0
- package/document-management/models/document-request.model.js +10 -1
- package/document-management/models/document-requests-template.d.ts +1 -0
- package/document-management/models/document-requests-template.js +7 -3
- package/document-management/models/document-tag-assignment.model.d.ts +8 -0
- package/document-management/models/document-tag-assignment.model.js +40 -0
- package/document-management/models/document-tag.model.d.ts +6 -0
- package/document-management/models/{document-request-submission.model.js → document-tag.model.js} +14 -18
- package/document-management/models/document-type-property.model.d.ts +1 -0
- package/document-management/models/document-type-property.model.js +7 -2
- package/document-management/models/document-type-validation.model.d.ts +1 -0
- package/document-management/models/document-type-validation.model.js +8 -2
- package/document-management/models/document-type.model.d.ts +1 -0
- package/document-management/models/document-type.model.js +7 -2
- package/document-management/models/document-validation-definition.model.d.ts +1 -0
- package/document-management/models/document-validation-definition.model.js +7 -2
- package/document-management/models/document-validation-execution-related-document.model.d.ts +1 -0
- package/document-management/models/document-validation-execution-related-document.model.js +10 -3
- package/document-management/models/document-validation-execution.model.d.ts +1 -0
- package/document-management/models/document-validation-execution.model.js +9 -3
- package/document-management/models/document-workflow.model.d.ts +4 -1
- package/document-management/models/document-workflow.model.js +16 -4
- package/document-management/models/document.model.d.ts +2 -2
- package/document-management/models/document.model.js +9 -8
- package/document-management/models/index.d.ts +2 -1
- package/document-management/models/index.js +2 -1
- package/document-management/server/api/document-management.api.d.ts +4 -1
- package/document-management/server/api/document-management.api.js +113 -22
- package/document-management/server/configure.d.ts +2 -2
- package/document-management/server/configure.js +7 -7
- package/document-management/server/drizzle/0000_parallel_mantis.sql +359 -0
- package/document-management/server/drizzle/meta/0000_snapshot.json +784 -260
- package/document-management/server/drizzle/meta/_journal.json +2 -2
- package/document-management/server/module.d.ts +2 -2
- package/document-management/server/module.js +2 -2
- package/document-management/server/schemas.d.ts +6 -5
- package/document-management/server/schemas.js +12 -11
- package/document-management/server/services/document-category-type.service.d.ts +19 -10
- package/document-management/server/services/document-category-type.service.js +34 -27
- package/document-management/server/services/document-collection.service.d.ts +13 -6
- package/document-management/server/services/document-collection.service.js +36 -12
- package/document-management/server/services/document-file.service.d.ts +8 -7
- package/document-management/server/services/document-file.service.js +28 -33
- package/document-management/server/services/document-management-ai.service.d.ts +5 -4
- package/document-management/server/services/document-management-ai.service.js +51 -28
- package/document-management/server/services/document-management-ancillary.service.d.ts +3 -21
- package/document-management/server/services/document-management-ancillary.service.js +0 -24
- package/document-management/server/services/document-management-observation.service.d.ts +15 -0
- package/document-management/server/services/document-management-observation.service.js +160 -0
- package/document-management/server/services/document-management.service.d.ts +6 -5
- package/document-management/server/services/document-management.service.js +112 -86
- package/document-management/server/services/document-property.service.d.ts +15 -7
- package/document-management/server/services/document-property.service.js +52 -20
- package/document-management/server/services/document-request.service.d.ts +13 -24
- package/document-management/server/services/document-request.service.js +39 -62
- package/document-management/server/services/document-tag.service.d.ts +10 -0
- package/document-management/server/services/document-tag.service.js +59 -0
- package/document-management/server/services/document-validation.service.d.ts +8 -8
- package/document-management/server/services/document-validation.service.js +41 -40
- package/document-management/server/services/document-workflow.service.d.ts +6 -5
- package/document-management/server/services/document-workflow.service.js +54 -43
- package/document-management/server/services/document.service.d.ts +12 -11
- package/document-management/server/services/document.service.js +66 -40
- package/document-management/server/services/index.d.ts +2 -1
- package/document-management/server/services/index.js +2 -1
- package/document-management/server/services/singleton.js +2 -2
- package/document-management/server/validators/ai-validation-executor.js +4 -4
- package/document-management/service-models/document-collection-metadata.service-model.d.ts +14 -0
- package/document-management/service-models/document-collection-metadata.service-model.js +1 -0
- package/document-management/service-models/document-folders.view-model.d.ts +1 -7
- package/document-management/service-models/document-folders.view-model.js +3 -15
- package/document-management/service-models/document-management.view-model.d.ts +20 -6
- package/document-management/service-models/document-management.view-model.js +62 -8
- package/document-management/service-models/document.service-model.d.ts +14 -11
- package/document-management/service-models/document.service-model.js +11 -2
- package/document-management/service-models/enriched/enriched-document-assignment.view.d.ts +1 -1
- package/document-management/service-models/enriched/enriched-document-assignment.view.js +0 -2
- package/document-management/service-models/enriched/enriched-document-category.view.d.ts +11 -1
- package/document-management/service-models/enriched/enriched-document-category.view.js +44 -1
- package/document-management/service-models/enriched/enriched-document-collection.view.d.ts +4 -2
- package/document-management/service-models/enriched/enriched-document-collection.view.js +13 -3
- package/document-management/service-models/enriched/enriched-document-management-data.view.d.ts +2 -0
- package/document-management/service-models/enriched/enriched-document-management-data.view.js +4 -2
- package/document-management/service-models/enriched/enriched-document-request.view.d.ts +1 -0
- package/document-management/service-models/enriched/enriched-document-request.view.js +2 -0
- package/document-management/service-models/enriched/enriched-document-type.view.d.ts +9 -1
- package/document-management/service-models/enriched/enriched-document-type.view.js +28 -1
- package/document-management/service-models/enriched/enriched-document.view.d.ts +7 -6
- package/document-management/service-models/enriched/enriched-document.view.js +29 -6
- package/document-management/service-models/{normalized-requests-template-data.model.d.ts → enriched/enriched-requests-template-data.model.d.ts} +6 -6
- package/document-management/service-models/{normalized-requests-template-data.model.js → enriched/enriched-requests-template-data.model.js} +1 -1
- package/document-management/service-models/enriched/index.d.ts +1 -0
- package/document-management/service-models/enriched/index.js +1 -0
- package/document-management/service-models/index.d.ts +2 -2
- package/document-management/service-models/index.js +2 -2
- package/examples/document-management/categories-and-types.d.ts +33 -31
- package/examples/document-management/categories-and-types.js +33 -0
- package/examples/document-management/main.d.ts +5 -4
- package/examples/document-management/main.js +13 -7
- package/function/log.js +2 -2
- package/http/server/node/module.d.ts +4 -1
- package/http/server/node/module.js +10 -1
- package/http/server/node/node-http-server.d.ts +3 -6
- package/http/server/node/node-http-server.js +68 -67
- package/injector/inject.js +6 -6
- package/injector/injector.js +3 -3
- package/jsx/is-component-class.js +1 -1
- package/key-value-store/key-value.store.d.ts +38 -7
- package/key-value-store/key-value.store.js +2 -1
- package/key-value-store/mongo/mongo-key-value.store.d.ts +1 -0
- package/key-value-store/mongo/mongo-key-value.store.js +14 -5
- package/key-value-store/postgres/drizzle/0000_shocking_slipstream.sql +12 -0
- package/key-value-store/postgres/drizzle/meta/0000_snapshot.json +97 -0
- package/key-value-store/postgres/drizzle/meta/_journal.json +13 -0
- package/key-value-store/postgres/drizzle.config.d.ts +2 -0
- package/key-value-store/postgres/drizzle.config.js +11 -0
- package/key-value-store/postgres/index.d.ts +2 -0
- package/key-value-store/postgres/index.js +2 -0
- package/key-value-store/postgres/key-value-store.service.d.ts +17 -0
- package/key-value-store/postgres/key-value-store.service.js +65 -0
- package/key-value-store/postgres/models/index.d.ts +2 -0
- package/key-value-store/postgres/models/index.js +2 -0
- package/key-value-store/postgres/models/key-value.model.d.ts +7 -0
- package/key-value-store/postgres/models/key-value.model.js +35 -0
- package/key-value-store/postgres/models/schemas.d.ts +3 -0
- package/key-value-store/postgres/models/schemas.js +4 -0
- package/key-value-store/postgres/module.d.ts +6 -0
- package/key-value-store/postgres/module.js +23 -0
- package/lock/web/web-lock.d.ts +0 -1
- package/lock/web/web-lock.js +6 -13
- package/orm/data-types/timestamp.js +1 -1
- package/orm/decorators.d.ts +37 -29
- package/orm/decorators.js +44 -24
- package/orm/entity.d.ts +1 -0
- package/orm/query.d.ts +10 -2
- package/orm/repository.types.d.ts +2 -1
- package/orm/schemas/json.d.ts +12 -6
- package/orm/schemas/json.js +12 -5
- package/orm/server/database.js +5 -2
- package/orm/server/drizzle/schema-converter.js +40 -11
- package/orm/server/query-converter.d.ts +2 -1
- package/orm/server/query-converter.js +57 -34
- package/orm/server/repository.d.ts +26 -43
- package/orm/server/repository.js +106 -39
- package/orm/server/transaction.d.ts +2 -1
- package/orm/server/transaction.js +3 -0
- package/orm/server/transactional.d.ts +5 -1
- package/orm/server/transactional.js +34 -4
- package/package.json +14 -11
- package/process/spawn.js +0 -1
- package/promise/deferred-promise.d.ts +4 -3
- package/promise/deferred-promise.js +13 -5
- package/queue/postgres/queue.js +8 -8
- package/reflection/utils.js +3 -3
- package/schema/decorators/class.js +0 -1
- package/schema/decorators/schema.js +1 -1
- package/schema/schemas/boolean.d.ts +1 -1
- package/schema/schemas/boolean.js +2 -2
- package/schema/schemas/number.js +3 -3
- package/schema/schemas/object.js +5 -6
- package/sse/server-sent-events-source.js +4 -1
- package/utils/compression.js +9 -9
- package/utils/date-time.d.ts +1 -0
- package/utils/date-time.js +18 -4
- package/utils/equals.d.ts +7 -0
- package/utils/equals.js +17 -2
- package/utils/function/memoize.js +10 -2
- package/utils/jwt.js +3 -3
- package/utils/object/property-name.d.ts +2 -2
- package/utils/timing.d.ts +2 -2
- package/utils/timing.js +12 -12
- package/document-management/models/document-request-submission.model.d.ts +0 -7
- package/document-management/server/drizzle/0000_moaning_luckman.sql +0 -305
- package/document-management/server/services/document-management-authorization.service.js +0 -28
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { type UpdatableDocumentProperties } from '../../../document-management/models/index.js';
|
|
2
|
-
import type { CreateDocumentParameters, SetDocumentPropertyParameters } from '../../../document-management/service-models/index.js';
|
|
3
1
|
import { Transactional } from '../../../orm/server/index.js';
|
|
4
2
|
import type { TypedOmit } from '../../../types.js';
|
|
5
|
-
import { Document } from '../../models/index.js';
|
|
3
|
+
import { Document, type UpdatableDocumentProperties } from '../../models/index.js';
|
|
4
|
+
import type { CreateDocumentParameters, SetDocumentPropertyParameters, UpdateDocumentCollectionsParameters } from '../../service-models/index.js';
|
|
6
5
|
export declare class DocumentService extends Transactional {
|
|
7
6
|
#private;
|
|
8
7
|
readonly repository: import("../../../orm/server/repository.js").EntityRepository<Document>;
|
|
9
|
-
create({ typeId, title, subtitle, date, summary, tags, approval, comment, originalFileName, assignment, properties, metadata }: TypedOmit<CreateDocumentParameters, 'uploadId'>, contentSource: Uint8Array | ReadableStream<Uint8Array> | {
|
|
8
|
+
create(tenantId: string, { typeId, title, subtitle, date, summary, tags, approval, comment, originalFileName, assignment, properties, metadata }: TypedOmit<CreateDocumentParameters, 'uploadId'>, contentSource: Uint8Array | ReadableStream<Uint8Array> | {
|
|
10
9
|
uploadId: string;
|
|
11
10
|
uploadKey: string;
|
|
12
11
|
}, { createUserId }: {
|
|
13
12
|
createUserId?: string;
|
|
14
13
|
}): Promise<Document>;
|
|
15
|
-
update(id: string, update: Partial<Pick<Document, UpdatableDocumentProperties>> & {
|
|
14
|
+
update(tenantId: string, id: string, update: Partial<Pick<Document, UpdatableDocumentProperties>> & {
|
|
15
|
+
tags?: string[];
|
|
16
16
|
properties?: SetDocumentPropertyParameters[];
|
|
17
|
+
collections?: UpdateDocumentCollectionsParameters;
|
|
17
18
|
}): Promise<void>;
|
|
18
|
-
getContent(
|
|
19
|
-
getContentStream(
|
|
20
|
-
getContentUrl(
|
|
21
|
-
getPreview(
|
|
22
|
-
getPreviewStream(
|
|
23
|
-
getPreviewUrl(
|
|
19
|
+
getContent(tenantId: string, documentId: string): Promise<Uint8Array>;
|
|
20
|
+
getContentStream(tenantId: string, documentId: string): ReadableStream<Uint8Array>;
|
|
21
|
+
getContentUrl(tenantId: string, documentId: string, download?: boolean): Promise<string>;
|
|
22
|
+
getPreview(tenantId: string, documentId: string, page?: number): Promise<Uint8Array>;
|
|
23
|
+
getPreviewStream(tenantId: string, documentId: string, page?: number): ReadableStream<Uint8Array>;
|
|
24
|
+
getPreviewUrl(tenantId: string, documentId: string, page?: number): Promise<string>;
|
|
24
25
|
/**
|
|
25
26
|
* @returns collectionIds from either direct assignment or automatic assignment scope
|
|
26
27
|
*/
|
|
@@ -7,11 +7,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var _a;
|
|
8
8
|
var DocumentService_1;
|
|
9
9
|
import { match, P } from 'ts-pattern';
|
|
10
|
-
import { DocumentApproval, DocumentAssignmentScope, DocumentAssignmentTask, DocumentWorkflowStep } from '../../../document-management/models/index.js';
|
|
11
10
|
import { BadRequestError } from '../../../errors/bad-request.error.js';
|
|
12
11
|
import { inject } from '../../../injector/inject.js';
|
|
13
12
|
import { Logger } from '../../../logger/logger.js';
|
|
14
|
-
import { Transactional } from '../../../orm/server/index.js';
|
|
13
|
+
import { injectTransactional, Transactional } from '../../../orm/server/index.js';
|
|
15
14
|
import { injectRepository } from '../../../orm/server/repository.js';
|
|
16
15
|
import { getPdfPageCount } from '../../../pdf/utils.js';
|
|
17
16
|
import { toArray } from '../../../utils/array/index.js';
|
|
@@ -19,34 +18,43 @@ import { objectKeys } from '../../../utils/object/object.js';
|
|
|
19
18
|
import { readableStreamFromPromise } from '../../../utils/stream/from-promise.js';
|
|
20
19
|
import { tryIgnoreLogAsync } from '../../../utils/try-ignore.js';
|
|
21
20
|
import { isDefined, isNotReadableStream, isNotUint8Array, isString, isUndefined } from '../../../utils/type-guards.js';
|
|
22
|
-
import { Document } from '../../models/index.js';
|
|
21
|
+
import { Document, DocumentApproval, DocumentAssignmentScope, DocumentAssignmentTask, DocumentType, DocumentWorkflowStep } from '../../models/index.js';
|
|
23
22
|
import { DocumentCollectionService } from './document-collection.service.js';
|
|
24
23
|
import { DocumentFileService } from './document-file.service.js';
|
|
24
|
+
import { DocumentManagementObservationService } from './document-management-observation.service.js';
|
|
25
25
|
import { DocumentPropertyService } from './document-property.service.js';
|
|
26
26
|
import { DocumentRequestService } from './document-request.service.js';
|
|
27
|
+
import { DocumentTagService } from './document-tag.service.js';
|
|
27
28
|
import { DocumentWorkflowService } from './document-workflow.service.js';
|
|
28
29
|
import { DocumentManagementSingleton } from './singleton.js';
|
|
29
30
|
let DocumentService = DocumentService_1 = class DocumentService extends Transactional {
|
|
30
|
-
#documentFileService =
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
31
|
+
#documentFileService = injectTransactional(DocumentFileService);
|
|
32
|
+
#documentTagService = injectTransactional(DocumentTagService);
|
|
33
|
+
#requestService = injectTransactional(DocumentRequestService);
|
|
34
|
+
#workflowService = injectTransactional(DocumentWorkflowService);
|
|
35
|
+
#documentPropertyService = injectTransactional(DocumentPropertyService);
|
|
36
|
+
#collectionService = injectTransactional(DocumentCollectionService);
|
|
37
|
+
#documentTypeRepository = injectRepository(DocumentType);
|
|
35
38
|
#documentAssignmentTaskRepository = injectRepository(DocumentAssignmentTask);
|
|
36
39
|
#documentAssignmentScopeRepository = injectRepository(DocumentAssignmentScope);
|
|
40
|
+
#observationService = inject(DocumentManagementObservationService);
|
|
37
41
|
#logger = inject(Logger, DocumentService_1.name);
|
|
38
|
-
repository = injectRepository(Document)
|
|
39
|
-
async create({ typeId, title, subtitle, date, summary, tags, approval, comment, originalFileName, assignment, properties, metadata }, contentSource, { createUserId }) {
|
|
42
|
+
repository = injectRepository(Document);
|
|
43
|
+
async create(tenantId, { typeId, title, subtitle, date, summary, tags, approval, comment, originalFileName, assignment, properties, metadata }, contentSource, { createUserId }) {
|
|
40
44
|
const document = await this.transaction(async (tx) => {
|
|
41
45
|
const isUpload = isNotUint8Array(contentSource) && isNotReadableStream(contentSource);
|
|
46
|
+
if (isString(typeId)) {
|
|
47
|
+
// verify that the type exists for the tenant
|
|
48
|
+
await this.#documentTypeRepository.loadByQuery({ tenantId: { $or: [null, tenantId] }, id: typeId });
|
|
49
|
+
}
|
|
42
50
|
const document = await this.repository.withTransaction(tx).insert({
|
|
51
|
+
tenantId,
|
|
43
52
|
typeId: typeId ?? null,
|
|
44
53
|
title: title ?? null,
|
|
45
54
|
subtitle: subtitle ?? null,
|
|
46
55
|
pages: -1,
|
|
47
56
|
date: date ?? null,
|
|
48
57
|
summary: summary ?? null,
|
|
49
|
-
tags: tags ?? null,
|
|
50
58
|
approval: approval ?? DocumentApproval.Pending,
|
|
51
59
|
comment: comment ?? null,
|
|
52
60
|
createUserId: createUserId ?? null,
|
|
@@ -56,6 +64,9 @@ let DocumentService = DocumentService_1 = class DocumentService extends Transact
|
|
|
56
64
|
size: -1,
|
|
57
65
|
metadata,
|
|
58
66
|
});
|
|
67
|
+
if (isDefined(tags)) {
|
|
68
|
+
await this.#documentTagService.withTransaction(tx).assignTags(document, tags);
|
|
69
|
+
}
|
|
59
70
|
const [documentMetadata, content] = isUpload
|
|
60
71
|
? await this.#documentFileService.withTransaction(tx).store(document.id, contentSource)
|
|
61
72
|
: [await this.#documentFileService.withTransaction(tx).store(document.id, contentSource), contentSource];
|
|
@@ -67,17 +78,18 @@ let DocumentService = DocumentService_1 = class DocumentService extends Transact
|
|
|
67
78
|
pages,
|
|
68
79
|
});
|
|
69
80
|
if (isDefined(properties)) {
|
|
70
|
-
await this.#documentPropertyService.withTransaction(tx).setPropertyValues(document
|
|
81
|
+
await this.#documentPropertyService.withTransaction(tx).setPropertyValues(document, properties);
|
|
71
82
|
}
|
|
72
|
-
await this.withTransaction(tx).createAssignment(document
|
|
73
|
-
await this.#workflowService.withTransaction(tx).initiateWorkflow(document.id, DocumentWorkflowStep.Classification);
|
|
83
|
+
await this.withTransaction(tx).createAssignment(document, assignment, tx);
|
|
84
|
+
await this.#workflowService.withTransaction(tx).initiateWorkflow(tenantId, document.id, DocumentWorkflowStep.Classification);
|
|
74
85
|
return document;
|
|
75
86
|
});
|
|
87
|
+
this.#observationService.documentChange(document.id);
|
|
76
88
|
return document;
|
|
77
89
|
}
|
|
78
|
-
async update(id, update) {
|
|
90
|
+
async update(tenantId, id, update) {
|
|
79
91
|
await this.transaction(async (tx) => {
|
|
80
|
-
const document = await this.repository.withTransaction(tx).
|
|
92
|
+
const document = await this.repository.withTransaction(tx).loadByQuery({ tenantId, id });
|
|
81
93
|
if (document.approval == DocumentApproval.Approved) {
|
|
82
94
|
throw new BadRequestError('Cannot update approved documents.');
|
|
83
95
|
}
|
|
@@ -85,59 +97,73 @@ let DocumentService = DocumentService_1 = class DocumentService extends Transact
|
|
|
85
97
|
if ((updateKeyLength > 1) || (isUndefined(update.properties) && (updateKeyLength > 0))) {
|
|
86
98
|
await this.repository.withTransaction(tx).update(id, update);
|
|
87
99
|
}
|
|
100
|
+
if (isDefined(update.tags)) {
|
|
101
|
+
await this.#documentTagService.withTransaction(tx).assignTags(document, update.tags);
|
|
102
|
+
}
|
|
88
103
|
if (isDefined(update.properties)) {
|
|
89
|
-
await this.#documentPropertyService.withTransaction(tx).setPropertyValues(
|
|
104
|
+
await this.#documentPropertyService.withTransaction(tx).setPropertyValues(document, update.properties);
|
|
105
|
+
}
|
|
106
|
+
if (isDefined(update.collections)) {
|
|
107
|
+
const { assign, archive } = update.collections;
|
|
108
|
+
if (isDefined(assign)) {
|
|
109
|
+
await this.#collectionService.withTransaction(tx).assignDocument(document, assign);
|
|
110
|
+
}
|
|
111
|
+
if (isDefined(archive)) {
|
|
112
|
+
await this.#collectionService.withTransaction(tx).archiveDocument(document, archive);
|
|
113
|
+
}
|
|
90
114
|
}
|
|
115
|
+
this.#observationService.documentChange(id, tx);
|
|
91
116
|
});
|
|
92
117
|
}
|
|
93
|
-
async getContent(
|
|
94
|
-
const document =
|
|
95
|
-
return await this.#documentFileService.getContent(document
|
|
118
|
+
async getContent(tenantId, documentId) {
|
|
119
|
+
const document = await this.repository.loadByQuery({ tenantId, id: documentId });
|
|
120
|
+
return await this.#documentFileService.getContent(document);
|
|
96
121
|
}
|
|
97
|
-
getContentStream(
|
|
122
|
+
getContentStream(tenantId, documentId) {
|
|
98
123
|
return readableStreamFromPromise(async () => {
|
|
99
|
-
const document =
|
|
100
|
-
return this.#documentFileService.getContentStream(document
|
|
124
|
+
const document = await this.repository.loadByQuery({ tenantId, id: documentId });
|
|
125
|
+
return this.#documentFileService.getContentStream(document);
|
|
101
126
|
});
|
|
102
127
|
}
|
|
103
|
-
async getContentUrl(
|
|
104
|
-
const document =
|
|
105
|
-
return await this.#documentFileService.getContentUrl(document
|
|
128
|
+
async getContentUrl(tenantId, documentId, download = false) {
|
|
129
|
+
const document = await this.repository.loadByQuery({ tenantId, id: documentId });
|
|
130
|
+
return await this.#documentFileService.getContentUrl(document, download);
|
|
106
131
|
}
|
|
107
|
-
async getPreview(
|
|
108
|
-
const document =
|
|
109
|
-
return await this.#documentFileService.getPreview(document
|
|
132
|
+
async getPreview(tenantId, documentId, page = 1) {
|
|
133
|
+
const document = await this.repository.loadByQuery({ tenantId, id: documentId });
|
|
134
|
+
return await this.#documentFileService.getPreview(document, page);
|
|
110
135
|
}
|
|
111
|
-
getPreviewStream(
|
|
136
|
+
getPreviewStream(tenantId, documentId, page = 1) {
|
|
112
137
|
return readableStreamFromPromise(async () => {
|
|
113
|
-
const document =
|
|
114
|
-
return this.#documentFileService.getPreviewStream(document
|
|
138
|
+
const document = await this.repository.loadByQuery({ tenantId, id: documentId });
|
|
139
|
+
return this.#documentFileService.getPreviewStream(document, page);
|
|
115
140
|
});
|
|
116
141
|
}
|
|
117
|
-
async getPreviewUrl(
|
|
118
|
-
const document =
|
|
119
|
-
return await this.#documentFileService.getPreviewUrl(document
|
|
142
|
+
async getPreviewUrl(tenantId, documentId, page = 1) {
|
|
143
|
+
const document = await this.repository.loadByQuery({ tenantId, id: documentId });
|
|
144
|
+
return await this.#documentFileService.getPreviewUrl(document, page);
|
|
120
145
|
}
|
|
121
146
|
/**
|
|
122
147
|
* @returns collectionIds from either direct assignment or automatic assignment scope
|
|
123
148
|
*/
|
|
124
|
-
async createAssignment(
|
|
149
|
+
async createAssignment(document, assignment, transaction) {
|
|
125
150
|
await match(assignment)
|
|
126
151
|
.with({ collections: P.select() }, async (collectionIds) => {
|
|
127
152
|
const collectionIdsArray = toArray(collectionIds);
|
|
128
|
-
await this.#
|
|
153
|
+
await this.#collectionService.withTransaction(transaction).assignDocument(document, collectionIdsArray);
|
|
129
154
|
})
|
|
130
155
|
.with({ request: P.select() }, async (requestId) => {
|
|
131
|
-
await this.#requestService.withTransaction(transaction).assignDocument(
|
|
156
|
+
await this.#requestService.withTransaction(transaction).assignDocument(document, requestId);
|
|
132
157
|
})
|
|
133
158
|
.with({ automatic: P.select() }, async ({ target, scope }) => {
|
|
134
159
|
const collectionIdsArray = toArray(scope);
|
|
135
|
-
const assignmentTask = await this.#documentAssignmentTaskRepository.withTransaction(transaction).insert({ documentId:
|
|
160
|
+
const assignmentTask = await this.#documentAssignmentTaskRepository.withTransaction(transaction).insert({ tenantId: document.tenantId, documentId: document.id, target });
|
|
136
161
|
for (const collectionId of collectionIdsArray) {
|
|
137
|
-
await this.#documentAssignmentScopeRepository.withTransaction(transaction).insert({ taskId: assignmentTask.id, collectionId });
|
|
162
|
+
await this.#documentAssignmentScopeRepository.withTransaction(transaction).insert({ tenantId: document.tenantId, taskId: assignmentTask.id, collectionId });
|
|
138
163
|
}
|
|
139
164
|
})
|
|
140
165
|
.exhaustive();
|
|
166
|
+
this.#observationService.documentChange(document.id, this.session);
|
|
141
167
|
}
|
|
142
168
|
};
|
|
143
169
|
DocumentService = DocumentService_1 = __decorate([
|
|
@@ -3,10 +3,11 @@ export * from './document-collection.service.js';
|
|
|
3
3
|
export * from './document-file.service.js';
|
|
4
4
|
export * from './document-management-ai.service.js';
|
|
5
5
|
export * from './document-management-ancillary.service.js';
|
|
6
|
-
export * from './document-management-
|
|
6
|
+
export * from './document-management-observation.service.js';
|
|
7
7
|
export * from './document-management.service.js';
|
|
8
8
|
export * from './document-property.service.js';
|
|
9
9
|
export * from './document-request.service.js';
|
|
10
|
+
export * from './document-tag.service.js';
|
|
10
11
|
export * from './document-validation.service.js';
|
|
11
12
|
export * from './document-workflow.service.js';
|
|
12
13
|
export * from './document.service.js';
|
|
@@ -3,10 +3,11 @@ export * from './document-collection.service.js';
|
|
|
3
3
|
export * from './document-file.service.js';
|
|
4
4
|
export * from './document-management-ai.service.js';
|
|
5
5
|
export * from './document-management-ancillary.service.js';
|
|
6
|
-
export * from './document-management-
|
|
6
|
+
export * from './document-management-observation.service.js';
|
|
7
7
|
export * from './document-management.service.js';
|
|
8
8
|
export * from './document-property.service.js';
|
|
9
9
|
export * from './document-request.service.js';
|
|
10
|
+
export * from './document-tag.service.js';
|
|
10
11
|
export * from './document-validation.service.js';
|
|
11
12
|
export * from './document-workflow.service.js';
|
|
12
13
|
export * from './document.service.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Singleton } from '../../../injector/decorators.js';
|
|
2
2
|
import { factoryProvider } from '../../../injector/provider.js';
|
|
3
3
|
import { DatabaseConfig } from '../../../orm/server/module.js';
|
|
4
|
-
import {
|
|
5
|
-
export const documentManagementDatabaseConfigFactoryProvider = factoryProvider((_, context) => context.resolve(
|
|
4
|
+
import { DocumentManagementConfiguration } from '../module.js';
|
|
5
|
+
export const documentManagementDatabaseConfigFactoryProvider = factoryProvider((_, context) => context.resolve(DocumentManagementConfiguration).database ?? context.resolve(DatabaseConfig, undefined, { skipSelf: true }));
|
|
6
6
|
export const documentManagementDatabaseConfigProvider = {
|
|
7
7
|
provide: DatabaseConfig,
|
|
8
8
|
...documentManagementDatabaseConfigFactoryProvider,
|
|
@@ -21,10 +21,10 @@ let AiValidationExecutor = class AiValidationExecutor extends DocumentValidation
|
|
|
21
21
|
async execute(context) {
|
|
22
22
|
const validationPrompt = await this.getPrompt(context);
|
|
23
23
|
const model = match(this.difficulty)
|
|
24
|
-
.with('easy', () => 'gemini-2.
|
|
25
|
-
.with('medium-low', () => 'gemini-2.5-flash-
|
|
26
|
-
.with('medium-high', () => 'gemini-2.5-flash-
|
|
27
|
-
.with('hard', () => 'gemini-2.5-pro-
|
|
24
|
+
.with('easy', () => 'gemini-2.5-flash-preview-05-20')
|
|
25
|
+
.with('medium-low', () => 'gemini-2.5-flash-preview-05-20')
|
|
26
|
+
.with('medium-high', () => 'gemini-2.5-flash-preview-05-20')
|
|
27
|
+
.with('hard', () => 'gemini-2.5-pro-preview-05-06')
|
|
28
28
|
.exhaustive();
|
|
29
29
|
const prompt = `Deine Aufgabe ist es ein Dokument zu validieren.
|
|
30
30
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type DocumentCollectionMetadata = {
|
|
2
|
+
/**
|
|
3
|
+
* User-friendly name of the collection
|
|
4
|
+
* @example <name of person>
|
|
5
|
+
* @example <address of real estate>
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* Group of the collection, used to group multiple collections to the same "type"
|
|
10
|
+
* @example 'Applicants'
|
|
11
|
+
* @example 'Real estates'
|
|
12
|
+
*/
|
|
13
|
+
group: string | null;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import type { EnrichedDocumentManagementData } from './enriched/enriched-document-management-data.view.js';
|
|
2
|
-
import type { EnrichedDocument } from './enriched/enriched-document.view.js';
|
|
3
2
|
export type DocumentManagementFolder = {
|
|
4
3
|
id: string;
|
|
5
4
|
type: 'collection' | 'category' | 'virtual';
|
|
6
5
|
label: string;
|
|
7
6
|
subFolders: DocumentManagementFolder[];
|
|
8
|
-
documents: EnrichedDocument[];
|
|
9
7
|
};
|
|
10
|
-
export
|
|
11
|
-
includeChildCategoryDocuments?: boolean;
|
|
12
|
-
includeAllFolder?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export declare function getDocumentManagementFolders(data: EnrichedDocumentManagementData, options?: GetDocumentManagementFoldersOptions): DocumentManagementFolder[];
|
|
8
|
+
export declare function getDocumentManagementFolders(data: EnrichedDocumentManagementData): DocumentManagementFolder[];
|
|
15
9
|
export declare function getFlatFolders(folders: DocumentManagementFolder[]): DocumentManagementFolder[];
|
|
@@ -1,31 +1,19 @@
|
|
|
1
1
|
import { isNotNull } from '../../utils/type-guards.js';
|
|
2
|
-
export function getDocumentManagementFolders(data
|
|
3
|
-
const allFolder = (options.includeAllFolder == true)
|
|
4
|
-
? []
|
|
5
|
-
: [{
|
|
6
|
-
id: 'all',
|
|
7
|
-
type: 'virtual',
|
|
8
|
-
label: 'Alle',
|
|
9
|
-
documents: data.documents,
|
|
10
|
-
subFolders: [],
|
|
11
|
-
}];
|
|
2
|
+
export function getDocumentManagementFolders(data) {
|
|
12
3
|
function getCategoryFolder(category) {
|
|
13
4
|
const subFolders = category.children.map(getCategoryFolder).filter(isNotNull);
|
|
14
|
-
const documents = data.documents.filter((document) => document.type?.category.id == category.id);
|
|
15
5
|
const categoryFolder = {
|
|
16
6
|
id: category.id,
|
|
17
7
|
type: 'category',
|
|
18
8
|
label: category.label,
|
|
19
9
|
subFolders,
|
|
20
|
-
documents: (options.includeChildCategoryDocuments == true) ? [...documents, ...subFolders.flatMap((folder) => folder.documents)] : documents,
|
|
21
10
|
};
|
|
22
|
-
if ((
|
|
11
|
+
if ((category.documents.length + categoryFolder.subFolders.length) == 0) {
|
|
23
12
|
return null;
|
|
24
13
|
}
|
|
25
14
|
return categoryFolder;
|
|
26
15
|
}
|
|
27
|
-
|
|
28
|
-
return [...allFolder, ...rootCategoryFolders];
|
|
16
|
+
return data.rootCategories.map(getCategoryFolder).filter(isNotNull);
|
|
29
17
|
}
|
|
30
18
|
export function getFlatFolders(folders) {
|
|
31
19
|
return [...folders, ...folders.flatMap((folder) => getFlatFolders(folder.subFolders))];
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { TypedOmit } from '../../types.js';
|
|
2
|
-
import { Document, DocumentAssignmentTarget, DocumentAssignmentTask, DocumentCategory, DocumentCollection, DocumentCollectionAssignment, DocumentPropertyDataType, DocumentRequest, DocumentType, DocumentValidationExecution, DocumentWorkflow } from '../models/index.js';
|
|
2
|
+
import { Document, DocumentAssignmentTarget, DocumentAssignmentTask, DocumentCategory, DocumentCollection, DocumentCollectionAssignment, DocumentPropertyDataType, DocumentRequest, DocumentTag, DocumentType, DocumentValidationExecution, DocumentWorkflow, type DocumentProperty } from '../models/index.js';
|
|
3
3
|
export declare class DocumentCollectionView extends DocumentCollection {
|
|
4
4
|
name: string;
|
|
5
5
|
group: string | null;
|
|
6
6
|
}
|
|
7
|
+
export declare class LightDocumentPropertyValueView {
|
|
8
|
+
propertyId: string;
|
|
9
|
+
value: string | number | boolean | null;
|
|
10
|
+
}
|
|
7
11
|
export declare class DocumentPropertyValueView {
|
|
8
12
|
documentId: string;
|
|
9
13
|
propertyId: string;
|
|
@@ -11,11 +15,11 @@ export declare class DocumentPropertyValueView {
|
|
|
11
15
|
dataType: DocumentPropertyDataType;
|
|
12
16
|
value: string | number | boolean | null;
|
|
13
17
|
}
|
|
14
|
-
export declare class DocumentCollectionAssignmentView implements TypedOmit<DocumentCollectionAssignment, 'id' | 'documentId' | 'metadata'> {
|
|
18
|
+
export declare class DocumentCollectionAssignmentView implements TypedOmit<DocumentCollectionAssignment, 'id' | 'tenantId' | 'documentId' | 'metadata'> {
|
|
15
19
|
collectionId: string;
|
|
16
20
|
archiveTimestamp: number | null;
|
|
17
21
|
}
|
|
18
|
-
export declare class DocumentAssignmentTaskView implements TypedOmit<DocumentAssignmentTask, 'id' | 'documentId' | 'metadata'> {
|
|
22
|
+
export declare class DocumentAssignmentTaskView implements TypedOmit<DocumentAssignmentTask, 'id' | 'tenantId' | 'documentId' | 'metadata'> {
|
|
19
23
|
target: DocumentAssignmentTarget;
|
|
20
24
|
scope: string[];
|
|
21
25
|
}
|
|
@@ -25,18 +29,28 @@ export declare class DocumentAssignmentView {
|
|
|
25
29
|
}
|
|
26
30
|
export declare class DocumentView extends Document {
|
|
27
31
|
assignment: DocumentAssignmentView;
|
|
28
|
-
|
|
32
|
+
tagIds: string[];
|
|
33
|
+
properties: LightDocumentPropertyValueView[];
|
|
29
34
|
/** available as long as the document is neither approved nor rejected */
|
|
30
|
-
|
|
31
|
-
validations: DocumentValidationExecution[]
|
|
35
|
+
workflows: DocumentWorkflow[];
|
|
36
|
+
validations: DocumentValidationExecution[];
|
|
32
37
|
}
|
|
33
38
|
export declare class DocumentRequestView extends DocumentRequest {
|
|
34
39
|
collectionIds: string[];
|
|
35
40
|
}
|
|
41
|
+
export declare class DocumentPropertyView implements TypedOmit<DocumentProperty, 'metadata'> {
|
|
42
|
+
id: string;
|
|
43
|
+
tenantId: string | null;
|
|
44
|
+
label: string;
|
|
45
|
+
dataType: DocumentPropertyDataType;
|
|
46
|
+
typeIds: string[];
|
|
47
|
+
}
|
|
36
48
|
export declare class DocumentManagementData {
|
|
37
49
|
collections: DocumentCollectionView[];
|
|
38
50
|
documents: DocumentView[];
|
|
39
51
|
requests: DocumentRequestView[];
|
|
40
52
|
categories: DocumentCategory[];
|
|
41
53
|
types: DocumentType[];
|
|
54
|
+
tags: DocumentTag[];
|
|
55
|
+
properties: DocumentPropertyView[];
|
|
42
56
|
}
|
|
@@ -8,7 +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 { Array, Enumeration, Property, string, StringProperty, Union } from '../../schema/index.js';
|
|
11
|
-
import { Document, DocumentAssignmentTarget, DocumentAssignmentTask, DocumentCategory, DocumentCollection, DocumentCollectionAssignment, DocumentPropertyDataType, DocumentRequest, DocumentType, DocumentValidationExecution, DocumentWorkflow } from '../models/index.js';
|
|
11
|
+
import { Document, DocumentAssignmentTarget, DocumentAssignmentTask, DocumentCategory, DocumentCollection, DocumentCollectionAssignment, DocumentPropertyDataType, DocumentRequest, DocumentTag, DocumentType, DocumentTypeProperty, DocumentValidationExecution, DocumentWorkflow } from '../models/index.js';
|
|
12
12
|
export class DocumentCollectionView extends DocumentCollection {
|
|
13
13
|
name;
|
|
14
14
|
group;
|
|
@@ -21,6 +21,18 @@ __decorate([
|
|
|
21
21
|
StringProperty({ nullable: true }),
|
|
22
22
|
__metadata("design:type", Object)
|
|
23
23
|
], DocumentCollectionView.prototype, "group", void 0);
|
|
24
|
+
export class LightDocumentPropertyValueView {
|
|
25
|
+
propertyId;
|
|
26
|
+
value;
|
|
27
|
+
}
|
|
28
|
+
__decorate([
|
|
29
|
+
StringProperty(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], LightDocumentPropertyValueView.prototype, "propertyId", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
Union(String, Number, Boolean, { nullable: true }),
|
|
34
|
+
__metadata("design:type", Object)
|
|
35
|
+
], LightDocumentPropertyValueView.prototype, "value", void 0);
|
|
24
36
|
export class DocumentPropertyValueView {
|
|
25
37
|
documentId;
|
|
26
38
|
propertyId;
|
|
@@ -86,9 +98,10 @@ __decorate([
|
|
|
86
98
|
], DocumentAssignmentView.prototype, "assignmentTask", void 0);
|
|
87
99
|
export class DocumentView extends Document {
|
|
88
100
|
assignment;
|
|
101
|
+
tagIds;
|
|
89
102
|
properties;
|
|
90
103
|
/** available as long as the document is neither approved nor rejected */
|
|
91
|
-
|
|
104
|
+
workflows;
|
|
92
105
|
validations;
|
|
93
106
|
}
|
|
94
107
|
__decorate([
|
|
@@ -96,16 +109,20 @@ __decorate([
|
|
|
96
109
|
__metadata("design:type", DocumentAssignmentView)
|
|
97
110
|
], DocumentView.prototype, "assignment", void 0);
|
|
98
111
|
__decorate([
|
|
99
|
-
Array(
|
|
112
|
+
Array(string()),
|
|
113
|
+
__metadata("design:type", Array)
|
|
114
|
+
], DocumentView.prototype, "tagIds", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
Array(LightDocumentPropertyValueView),
|
|
100
117
|
__metadata("design:type", Array)
|
|
101
118
|
], DocumentView.prototype, "properties", void 0);
|
|
102
119
|
__decorate([
|
|
103
|
-
|
|
104
|
-
__metadata("design:type",
|
|
105
|
-
], DocumentView.prototype, "
|
|
120
|
+
Array(DocumentWorkflow),
|
|
121
|
+
__metadata("design:type", Array)
|
|
122
|
+
], DocumentView.prototype, "workflows", void 0);
|
|
106
123
|
__decorate([
|
|
107
|
-
Array(DocumentValidationExecution
|
|
108
|
-
__metadata("design:type",
|
|
124
|
+
Array(DocumentValidationExecution),
|
|
125
|
+
__metadata("design:type", Array)
|
|
109
126
|
], DocumentView.prototype, "validations", void 0);
|
|
110
127
|
export class DocumentRequestView extends DocumentRequest {
|
|
111
128
|
collectionIds;
|
|
@@ -114,12 +131,41 @@ __decorate([
|
|
|
114
131
|
Array(String),
|
|
115
132
|
__metadata("design:type", Array)
|
|
116
133
|
], DocumentRequestView.prototype, "collectionIds", void 0);
|
|
134
|
+
export class DocumentPropertyView {
|
|
135
|
+
id;
|
|
136
|
+
tenantId;
|
|
137
|
+
label;
|
|
138
|
+
dataType;
|
|
139
|
+
typeIds;
|
|
140
|
+
}
|
|
141
|
+
__decorate([
|
|
142
|
+
StringProperty(),
|
|
143
|
+
__metadata("design:type", String)
|
|
144
|
+
], DocumentPropertyView.prototype, "id", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
StringProperty({ nullable: true }),
|
|
147
|
+
__metadata("design:type", Object)
|
|
148
|
+
], DocumentPropertyView.prototype, "tenantId", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
StringProperty(),
|
|
151
|
+
__metadata("design:type", String)
|
|
152
|
+
], DocumentPropertyView.prototype, "label", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
Enumeration(DocumentPropertyDataType),
|
|
155
|
+
__metadata("design:type", String)
|
|
156
|
+
], DocumentPropertyView.prototype, "dataType", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
Array(String),
|
|
159
|
+
__metadata("design:type", Array)
|
|
160
|
+
], DocumentPropertyView.prototype, "typeIds", void 0);
|
|
117
161
|
export class DocumentManagementData {
|
|
118
162
|
collections;
|
|
119
163
|
documents;
|
|
120
164
|
requests;
|
|
121
165
|
categories;
|
|
122
166
|
types;
|
|
167
|
+
tags;
|
|
168
|
+
properties;
|
|
123
169
|
}
|
|
124
170
|
__decorate([
|
|
125
171
|
Array(DocumentCollectionView),
|
|
@@ -141,3 +187,11 @@ __decorate([
|
|
|
141
187
|
Array(DocumentType),
|
|
142
188
|
__metadata("design:type", Array)
|
|
143
189
|
], DocumentManagementData.prototype, "types", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
Array(DocumentTag),
|
|
192
|
+
__metadata("design:type", Array)
|
|
193
|
+
], DocumentManagementData.prototype, "tags", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
Array(DocumentTypeProperty),
|
|
196
|
+
__metadata("design:type", Array)
|
|
197
|
+
], DocumentManagementData.prototype, "properties", void 0);
|
|
@@ -14,13 +14,16 @@ export declare const setDocumentPropertyParametersSchema: import("../../schema/i
|
|
|
14
14
|
attributes: import("../../orm/types.js").HasDefault<import("../../orm/schemas/json.js").Json<import("../../orm/entity.js").EntityMetadataAttributes>>;
|
|
15
15
|
}> | undefined;
|
|
16
16
|
}>;
|
|
17
|
+
export declare const updateDocumentCollectionsParametersSchema: import("../../schema/index.js").ObjectSchema<{
|
|
18
|
+
assign?: string[] | undefined;
|
|
19
|
+
archive?: string[] | undefined;
|
|
20
|
+
}>;
|
|
17
21
|
export declare const createDocumentParametersSchema: import("../../schema/index.js").ObjectSchema<{
|
|
18
22
|
date?: import("../../orm/types.js").NumericDate | null | undefined;
|
|
19
23
|
summary?: string | null | undefined;
|
|
20
24
|
title?: string | null | undefined;
|
|
21
25
|
typeId?: import("../../orm/types.js").Uuid | null | undefined;
|
|
22
26
|
subtitle?: string | null | undefined;
|
|
23
|
-
tags?: string[] | null | undefined;
|
|
24
27
|
comment?: string | null | undefined;
|
|
25
28
|
approval?: import("../models/document.model.js").DocumentApproval | undefined;
|
|
26
29
|
originalFileName?: string | null | undefined;
|
|
@@ -42,6 +45,7 @@ export declare const createDocumentParametersSchema: import("../../schema/index.
|
|
|
42
45
|
attributes: import("../../orm/types.js").HasDefault<import("../../orm/schemas/json.js").Json<import("../../orm/entity.js").EntityMetadataAttributes>>;
|
|
43
46
|
}> | undefined;
|
|
44
47
|
}[] | undefined;
|
|
48
|
+
tags?: string[] | undefined;
|
|
45
49
|
metadata?: Partial<{
|
|
46
50
|
attributes: import("../../orm/types.js").HasDefault<import("../../orm/schemas/json.js").Json<import("../../orm/entity.js").EntityMetadataAttributes>>;
|
|
47
51
|
}> | undefined;
|
|
@@ -49,19 +53,10 @@ export declare const createDocumentParametersSchema: import("../../schema/index.
|
|
|
49
53
|
export declare const updateDocumentParametersSchema: import("../../schema/index.js").ObjectSchema<{
|
|
50
54
|
id: import("../../orm/types.js").IsPrimaryKey<import("../../orm/types.js").HasDefault<import("../../orm/schemas/uuid.js").Uuid>>;
|
|
51
55
|
date?: import("../../orm/types.js").NumericDate | null | undefined;
|
|
52
|
-
size?: number | undefined;
|
|
53
|
-
hash?: string | undefined;
|
|
54
|
-
summary?: string | null | undefined;
|
|
55
56
|
title?: string | null | undefined;
|
|
56
|
-
mimeType?: string | undefined;
|
|
57
57
|
typeId?: import("../../orm/types.js").Uuid | null | undefined;
|
|
58
58
|
subtitle?: string | null | undefined;
|
|
59
|
-
tags?: string[] | null | undefined;
|
|
60
59
|
comment?: string | null | undefined;
|
|
61
|
-
pages?: number | null | undefined;
|
|
62
|
-
approval?: import("../models/document.model.js").DocumentApproval | undefined;
|
|
63
|
-
originalFileName?: string | null | undefined;
|
|
64
|
-
createUserId?: import("../../orm/types.js").Uuid | null | undefined;
|
|
65
60
|
properties?: {
|
|
66
61
|
propertyId: import("../../orm/schemas/uuid.js").Uuid;
|
|
67
62
|
value: string | number | boolean | null;
|
|
@@ -69,6 +64,11 @@ export declare const updateDocumentParametersSchema: import("../../schema/index.
|
|
|
69
64
|
attributes: import("../../orm/types.js").HasDefault<import("../../orm/schemas/json.js").Json<import("../../orm/entity.js").EntityMetadataAttributes>>;
|
|
70
65
|
}> | undefined;
|
|
71
66
|
}[] | undefined;
|
|
67
|
+
collections?: {
|
|
68
|
+
assign?: string[] | undefined;
|
|
69
|
+
archive?: string[] | undefined;
|
|
70
|
+
} | undefined;
|
|
71
|
+
tags?: string[] | undefined;
|
|
72
72
|
metadata?: Partial<{
|
|
73
73
|
attributes: import("../../orm/types.js").HasDefault<import("../../orm/schemas/json.js").Json<import("../../orm/entity.js").EntityMetadataAttributes>>;
|
|
74
74
|
}> | undefined;
|
|
@@ -98,6 +98,7 @@ export declare const updateDocumentRequestsTemplateParametersSchema: import("../
|
|
|
98
98
|
id: import("../../orm/types.js").IsPrimaryKey<import("../../orm/types.js").HasDefault<import("../../orm/schemas/uuid.js").Uuid>>;
|
|
99
99
|
description?: string | null | undefined;
|
|
100
100
|
label?: string | undefined;
|
|
101
|
+
tenantId?: string | null | undefined;
|
|
101
102
|
metadata?: Partial<{
|
|
102
103
|
attributes: import("../../orm/types.js").HasDefault<import("../../orm/schemas/json.js").Json<import("../../orm/entity.js").EntityMetadataAttributes>>;
|
|
103
104
|
}> | undefined;
|
|
@@ -125,6 +126,7 @@ export declare const createDocumentRequestTemplateParametersSchema: import("../.
|
|
|
125
126
|
}>;
|
|
126
127
|
export declare const updateDocumentRequestTemplateParametersSchema: import("../../schema/index.js").ObjectSchema<{
|
|
127
128
|
id: import("../../orm/types.js").IsPrimaryKey<import("../../orm/types.js").HasDefault<import("../../orm/schemas/uuid.js").Uuid>>;
|
|
129
|
+
tenantId?: string | null | undefined;
|
|
128
130
|
typeId?: import("../../orm/types.js").Uuid | undefined;
|
|
129
131
|
comment?: string | null | undefined;
|
|
130
132
|
metadata?: Partial<{
|
|
@@ -224,8 +226,8 @@ export declare const assignPropertyToTypeParametersSchema: import("../../schema/
|
|
|
224
226
|
}> | undefined;
|
|
225
227
|
}>;
|
|
226
228
|
export declare const addOrArchiveDocumentToOrFromCollectionParametersSchema: import("../../schema/index.js").ObjectSchema<{
|
|
227
|
-
documentId: import("../../orm/schemas/uuid.js").Uuid;
|
|
228
229
|
collectionId: import("../../orm/schemas/uuid.js").Uuid;
|
|
230
|
+
documentId: import("../../orm/schemas/uuid.js").Uuid;
|
|
229
231
|
metadata?: Partial<{
|
|
230
232
|
attributes: import("../../orm/types.js").HasDefault<import("../../orm/schemas/json.js").Json<import("../../orm/entity.js").EntityMetadataAttributes>>;
|
|
231
233
|
}> | undefined;
|
|
@@ -249,6 +251,7 @@ export type DeleteDocumentRequestTemplateParameters = SchemaOutput<typeof delete
|
|
|
249
251
|
export type CreateDocumentPropertyParameters = SchemaOutput<typeof createDocumentPropertyParametersSchema>;
|
|
250
252
|
export type AssignPropertyToTypeParameters = SchemaOutput<typeof assignPropertyToTypeParametersSchema>;
|
|
251
253
|
export type SetDocumentPropertyParameters = SchemaOutput<typeof setDocumentPropertyParametersSchema>;
|
|
254
|
+
export type UpdateDocumentCollectionsParameters = SchemaOutput<typeof updateDocumentCollectionsParametersSchema>;
|
|
252
255
|
export type SetDocumentPropertiesParameters = SchemaOutput<typeof setDocumentPropertiesParametersSchema>;
|
|
253
256
|
export type AddOrArchiveDocumentToOrFromCollectionParameters = SchemaOutput<typeof addOrArchiveDocumentToOrFromCollectionParametersSchema>;
|
|
254
257
|
export type UpdateDocumentParameters = SchemaOutput<typeof updateDocumentParametersSchema>;
|