@tstdl/base 0.92.142 → 0.92.143

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.
Files changed (223) hide show
  1. package/ai/ai-file.service.js +1 -1
  2. package/ai/ai.service.js +3 -3
  3. package/ai/types.d.ts +1 -1
  4. package/api/client/client.d.ts +1 -1
  5. package/api/client/client.js +10 -4
  6. package/api/server/middlewares/content-type.middleware.js +8 -7
  7. package/api/types.js +1 -1
  8. package/authentication/client/authentication.service.js +3 -3
  9. package/authentication/server/authentication-ancillary.service.d.ts +11 -1
  10. package/authentication/server/authentication-ancillary.service.js +1 -1
  11. package/authentication/server/authentication-secret-requirements.validator.js +1 -1
  12. package/authentication/server/authentication.api-controller.js +22 -10
  13. package/authentication/server/authentication.service.d.ts +11 -5
  14. package/authentication/server/authentication.service.js +97 -49
  15. package/authentication/server/drizzle.config.js +2 -2
  16. package/authentication/server/module.js +1 -1
  17. package/cancellation/token.d.ts +2 -2
  18. package/cancellation/token.js +4 -4
  19. package/cookie/cookie.js +2 -2
  20. package/document-management/api/document-management.api.d.ts +122 -24
  21. package/document-management/api/document-management.api.js +17 -0
  22. package/document-management/{server/services → authorization}/document-management-authorization.service.d.ts +7 -7
  23. package/document-management/authorization/document-management-authorization.service.js +2 -0
  24. package/document-management/authorization/index.d.ts +2 -0
  25. package/document-management/authorization/index.js +2 -0
  26. package/document-management/authorization/policies.d.ts +38 -0
  27. package/document-management/authorization/policies.js +2 -0
  28. package/document-management/index.d.ts +1 -0
  29. package/document-management/index.js +1 -0
  30. package/document-management/models/document-assignment-scope.model.d.ts +1 -0
  31. package/document-management/models/document-assignment-scope.model.js +10 -3
  32. package/document-management/models/document-assignment-task.model.d.ts +1 -0
  33. package/document-management/models/document-assignment-task.model.js +8 -2
  34. package/document-management/models/document-category.model.d.ts +1 -0
  35. package/document-management/models/document-category.model.js +7 -1
  36. package/document-management/models/document-collection-assignment.model.d.ts +1 -0
  37. package/document-management/models/document-collection-assignment.model.js +12 -4
  38. package/document-management/models/document-collection.model.d.ts +2 -0
  39. package/document-management/models/document-collection.model.js +8 -2
  40. package/document-management/models/document-management-table.d.ts +3 -1
  41. package/document-management/models/document-management-table.js +2 -2
  42. package/document-management/models/document-property-value.model.d.ts +1 -0
  43. package/document-management/models/document-property-value.model.js +9 -3
  44. package/document-management/models/document-property.model.d.ts +1 -0
  45. package/document-management/models/document-property.model.js +8 -2
  46. package/document-management/models/document-request-collection-assignment.model.d.ts +1 -0
  47. package/document-management/models/document-request-collection-assignment.model.js +12 -4
  48. package/document-management/models/document-request-template.d.ts +1 -0
  49. package/document-management/models/document-request-template.js +6 -1
  50. package/document-management/models/document-request.model.d.ts +1 -0
  51. package/document-management/models/document-request.model.js +10 -1
  52. package/document-management/models/document-requests-template.d.ts +1 -0
  53. package/document-management/models/document-requests-template.js +7 -3
  54. package/document-management/models/document-tag-assignment.model.d.ts +8 -0
  55. package/document-management/models/document-tag-assignment.model.js +40 -0
  56. package/document-management/models/document-tag.model.d.ts +6 -0
  57. package/document-management/models/{document-request-submission.model.js → document-tag.model.js} +14 -18
  58. package/document-management/models/document-type-property.model.d.ts +1 -0
  59. package/document-management/models/document-type-property.model.js +7 -2
  60. package/document-management/models/document-type-validation.model.d.ts +1 -0
  61. package/document-management/models/document-type-validation.model.js +8 -2
  62. package/document-management/models/document-type.model.d.ts +1 -0
  63. package/document-management/models/document-type.model.js +7 -2
  64. package/document-management/models/document-validation-definition.model.d.ts +1 -0
  65. package/document-management/models/document-validation-definition.model.js +7 -2
  66. package/document-management/models/document-validation-execution-related-document.model.d.ts +1 -0
  67. package/document-management/models/document-validation-execution-related-document.model.js +10 -3
  68. package/document-management/models/document-validation-execution.model.d.ts +1 -0
  69. package/document-management/models/document-validation-execution.model.js +9 -3
  70. package/document-management/models/document-workflow.model.d.ts +4 -1
  71. package/document-management/models/document-workflow.model.js +16 -4
  72. package/document-management/models/document.model.d.ts +2 -2
  73. package/document-management/models/document.model.js +9 -8
  74. package/document-management/models/index.d.ts +2 -1
  75. package/document-management/models/index.js +2 -1
  76. package/document-management/server/api/document-management.api.d.ts +4 -1
  77. package/document-management/server/api/document-management.api.js +113 -22
  78. package/document-management/server/configure.d.ts +2 -2
  79. package/document-management/server/configure.js +7 -7
  80. package/document-management/server/drizzle/0000_parallel_mantis.sql +359 -0
  81. package/document-management/server/drizzle/meta/0000_snapshot.json +784 -260
  82. package/document-management/server/drizzle/meta/_journal.json +2 -2
  83. package/document-management/server/module.d.ts +2 -2
  84. package/document-management/server/module.js +2 -2
  85. package/document-management/server/schemas.d.ts +6 -5
  86. package/document-management/server/schemas.js +12 -11
  87. package/document-management/server/services/document-category-type.service.d.ts +19 -10
  88. package/document-management/server/services/document-category-type.service.js +34 -27
  89. package/document-management/server/services/document-collection.service.d.ts +13 -6
  90. package/document-management/server/services/document-collection.service.js +36 -12
  91. package/document-management/server/services/document-file.service.d.ts +8 -7
  92. package/document-management/server/services/document-file.service.js +28 -33
  93. package/document-management/server/services/document-management-ai.service.d.ts +5 -4
  94. package/document-management/server/services/document-management-ai.service.js +51 -28
  95. package/document-management/server/services/document-management-ancillary.service.d.ts +3 -21
  96. package/document-management/server/services/document-management-ancillary.service.js +0 -24
  97. package/document-management/server/services/document-management-observation.service.d.ts +15 -0
  98. package/document-management/server/services/document-management-observation.service.js +160 -0
  99. package/document-management/server/services/document-management.service.d.ts +6 -5
  100. package/document-management/server/services/document-management.service.js +112 -86
  101. package/document-management/server/services/document-property.service.d.ts +15 -7
  102. package/document-management/server/services/document-property.service.js +52 -20
  103. package/document-management/server/services/document-request.service.d.ts +13 -24
  104. package/document-management/server/services/document-request.service.js +39 -62
  105. package/document-management/server/services/document-tag.service.d.ts +10 -0
  106. package/document-management/server/services/document-tag.service.js +59 -0
  107. package/document-management/server/services/document-validation.service.d.ts +8 -8
  108. package/document-management/server/services/document-validation.service.js +41 -40
  109. package/document-management/server/services/document-workflow.service.d.ts +6 -5
  110. package/document-management/server/services/document-workflow.service.js +54 -43
  111. package/document-management/server/services/document.service.d.ts +12 -11
  112. package/document-management/server/services/document.service.js +64 -40
  113. package/document-management/server/services/index.d.ts +2 -1
  114. package/document-management/server/services/index.js +2 -1
  115. package/document-management/server/services/singleton.js +2 -2
  116. package/document-management/server/validators/ai-validation-executor.js +4 -4
  117. package/document-management/service-models/document-collection-metadata.service-model.d.ts +14 -0
  118. package/document-management/service-models/document-collection-metadata.service-model.js +1 -0
  119. package/document-management/service-models/document-folders.view-model.d.ts +1 -7
  120. package/document-management/service-models/document-folders.view-model.js +3 -15
  121. package/document-management/service-models/document-management.view-model.d.ts +20 -6
  122. package/document-management/service-models/document-management.view-model.js +62 -8
  123. package/document-management/service-models/document.service-model.d.ts +14 -11
  124. package/document-management/service-models/document.service-model.js +11 -2
  125. package/document-management/service-models/enriched/enriched-document-assignment.view.d.ts +1 -1
  126. package/document-management/service-models/enriched/enriched-document-assignment.view.js +0 -2
  127. package/document-management/service-models/enriched/enriched-document-category.view.d.ts +11 -1
  128. package/document-management/service-models/enriched/enriched-document-category.view.js +44 -1
  129. package/document-management/service-models/enriched/enriched-document-collection.view.d.ts +4 -2
  130. package/document-management/service-models/enriched/enriched-document-collection.view.js +13 -3
  131. package/document-management/service-models/enriched/enriched-document-management-data.view.d.ts +2 -0
  132. package/document-management/service-models/enriched/enriched-document-management-data.view.js +4 -2
  133. package/document-management/service-models/enriched/enriched-document-request.view.d.ts +1 -0
  134. package/document-management/service-models/enriched/enriched-document-request.view.js +2 -0
  135. package/document-management/service-models/enriched/enriched-document-type.view.d.ts +9 -1
  136. package/document-management/service-models/enriched/enriched-document-type.view.js +28 -1
  137. package/document-management/service-models/enriched/enriched-document.view.d.ts +7 -6
  138. package/document-management/service-models/enriched/enriched-document.view.js +29 -6
  139. package/document-management/service-models/{normalized-requests-template-data.model.d.ts → enriched/enriched-requests-template-data.model.d.ts} +6 -6
  140. package/document-management/service-models/{normalized-requests-template-data.model.js → enriched/enriched-requests-template-data.model.js} +1 -1
  141. package/document-management/service-models/enriched/index.d.ts +1 -0
  142. package/document-management/service-models/enriched/index.js +1 -0
  143. package/document-management/service-models/index.d.ts +2 -2
  144. package/document-management/service-models/index.js +2 -2
  145. package/examples/document-management/categories-and-types.d.ts +33 -31
  146. package/examples/document-management/categories-and-types.js +33 -0
  147. package/examples/document-management/main.d.ts +5 -4
  148. package/examples/document-management/main.js +13 -7
  149. package/function/log.js +2 -2
  150. package/http/server/node/module.d.ts +4 -1
  151. package/http/server/node/module.js +10 -1
  152. package/http/server/node/node-http-server.d.ts +3 -6
  153. package/http/server/node/node-http-server.js +68 -67
  154. package/injector/inject.js +6 -6
  155. package/injector/injector.js +3 -3
  156. package/jsx/is-component-class.js +1 -1
  157. package/key-value-store/key-value.store.d.ts +38 -7
  158. package/key-value-store/key-value.store.js +2 -1
  159. package/key-value-store/mongo/mongo-key-value.store.d.ts +1 -0
  160. package/key-value-store/mongo/mongo-key-value.store.js +14 -5
  161. package/key-value-store/postgres/drizzle/0000_shocking_slipstream.sql +12 -0
  162. package/key-value-store/postgres/drizzle/meta/0000_snapshot.json +97 -0
  163. package/key-value-store/postgres/drizzle/meta/_journal.json +13 -0
  164. package/key-value-store/postgres/drizzle.config.d.ts +2 -0
  165. package/key-value-store/postgres/drizzle.config.js +11 -0
  166. package/key-value-store/postgres/index.d.ts +2 -0
  167. package/key-value-store/postgres/index.js +2 -0
  168. package/key-value-store/postgres/key-value-store.service.d.ts +17 -0
  169. package/key-value-store/postgres/key-value-store.service.js +65 -0
  170. package/key-value-store/postgres/models/index.d.ts +2 -0
  171. package/key-value-store/postgres/models/index.js +2 -0
  172. package/key-value-store/postgres/models/key-value.model.d.ts +7 -0
  173. package/key-value-store/postgres/models/key-value.model.js +35 -0
  174. package/key-value-store/postgres/models/schemas.d.ts +3 -0
  175. package/key-value-store/postgres/models/schemas.js +4 -0
  176. package/key-value-store/postgres/module.d.ts +6 -0
  177. package/key-value-store/postgres/module.js +23 -0
  178. package/lock/web/web-lock.d.ts +0 -1
  179. package/lock/web/web-lock.js +6 -13
  180. package/orm/data-types/timestamp.js +1 -1
  181. package/orm/decorators.d.ts +37 -29
  182. package/orm/decorators.js +44 -24
  183. package/orm/entity.d.ts +1 -0
  184. package/orm/query.d.ts +10 -2
  185. package/orm/repository.types.d.ts +2 -1
  186. package/orm/schemas/json.d.ts +12 -6
  187. package/orm/schemas/json.js +12 -5
  188. package/orm/server/database.js +5 -2
  189. package/orm/server/drizzle/schema-converter.js +40 -11
  190. package/orm/server/query-converter.d.ts +2 -1
  191. package/orm/server/query-converter.js +57 -34
  192. package/orm/server/repository.d.ts +26 -43
  193. package/orm/server/repository.js +106 -39
  194. package/orm/server/transaction.d.ts +2 -1
  195. package/orm/server/transaction.js +3 -0
  196. package/orm/server/transactional.d.ts +5 -1
  197. package/orm/server/transactional.js +34 -4
  198. package/package.json +14 -11
  199. package/process/spawn.js +0 -1
  200. package/promise/deferred-promise.d.ts +4 -3
  201. package/promise/deferred-promise.js +13 -5
  202. package/queue/postgres/queue.js +8 -8
  203. package/reflection/utils.js +3 -3
  204. package/schema/decorators/class.js +0 -1
  205. package/schema/decorators/schema.js +1 -1
  206. package/schema/schemas/boolean.d.ts +1 -1
  207. package/schema/schemas/boolean.js +2 -2
  208. package/schema/schemas/number.js +3 -3
  209. package/schema/schemas/object.js +5 -6
  210. package/sse/server-sent-events-source.js +4 -1
  211. package/utils/compression.js +9 -9
  212. package/utils/date-time.d.ts +1 -0
  213. package/utils/date-time.js +18 -4
  214. package/utils/equals.d.ts +7 -0
  215. package/utils/equals.js +17 -2
  216. package/utils/function/memoize.js +10 -2
  217. package/utils/jwt.js +3 -3
  218. package/utils/object/property-name.d.ts +2 -2
  219. package/utils/timing.d.ts +2 -2
  220. package/utils/timing.js +12 -12
  221. package/document-management/models/document-request-submission.model.d.ts +0 -7
  222. package/document-management/server/drizzle/0000_moaning_luckman.sql +0 -305
  223. 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(documentOrId: Document | string): Promise<Uint8Array>;
19
- getContentStream(documentOrId: Document | string): ReadableStream<Uint8Array>;
20
- getContentUrl(documentOrId: Document | string, download?: boolean): Promise<string>;
21
- getPreview(documentOrId: Document | string, page?: number): Promise<Uint8Array>;
22
- getPreviewStream(documentOrId: Document | string, page?: number): ReadableStream<Uint8Array>;
23
- getPreviewUrl(documentOrId: Document | string, page?: number): Promise<string>;
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 = inject(DocumentFileService);
31
- #requestService = inject(DocumentRequestService);
32
- #workflowService = inject(DocumentWorkflowService);
33
- #documentPropertyService = inject(DocumentPropertyService);
34
- #documentCollectionService = inject(DocumentCollectionService);
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).withSession(this.session);
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,7 @@ let DocumentService = DocumentService_1 = class DocumentService extends Transact
56
64
  size: -1,
57
65
  metadata,
58
66
  });
67
+ await this.#documentTagService.withTransaction(tx).assignTags(document, tags);
59
68
  const [documentMetadata, content] = isUpload
60
69
  ? await this.#documentFileService.withTransaction(tx).store(document.id, contentSource)
61
70
  : [await this.#documentFileService.withTransaction(tx).store(document.id, contentSource), contentSource];
@@ -67,17 +76,18 @@ let DocumentService = DocumentService_1 = class DocumentService extends Transact
67
76
  pages,
68
77
  });
69
78
  if (isDefined(properties)) {
70
- await this.#documentPropertyService.withTransaction(tx).setPropertyValues(document.id, properties);
79
+ await this.#documentPropertyService.withTransaction(tx).setPropertyValues(document, properties);
71
80
  }
72
- await this.withTransaction(tx).createAssignment(document.id, assignment, tx);
73
- await this.#workflowService.withTransaction(tx).initiateWorkflow(document.id, DocumentWorkflowStep.Classification);
81
+ await this.withTransaction(tx).createAssignment(document, assignment, tx);
82
+ await this.#workflowService.withTransaction(tx).initiateWorkflow(tenantId, document.id, DocumentWorkflowStep.Classification);
74
83
  return document;
75
84
  });
85
+ this.#observationService.documentChange(document.id);
76
86
  return document;
77
87
  }
78
- async update(id, update) {
88
+ async update(tenantId, id, update) {
79
89
  await this.transaction(async (tx) => {
80
- const document = await this.repository.withTransaction(tx).load(id);
90
+ const document = await this.repository.withTransaction(tx).loadByQuery({ tenantId, id });
81
91
  if (document.approval == DocumentApproval.Approved) {
82
92
  throw new BadRequestError('Cannot update approved documents.');
83
93
  }
@@ -85,59 +95,73 @@ let DocumentService = DocumentService_1 = class DocumentService extends Transact
85
95
  if ((updateKeyLength > 1) || (isUndefined(update.properties) && (updateKeyLength > 0))) {
86
96
  await this.repository.withTransaction(tx).update(id, update);
87
97
  }
98
+ if (isDefined(update.tags)) {
99
+ await this.#documentTagService.withTransaction(tx).assignTags(document, update.tags);
100
+ }
88
101
  if (isDefined(update.properties)) {
89
- await this.#documentPropertyService.withTransaction(tx).setPropertyValues(id, update.properties);
102
+ await this.#documentPropertyService.withTransaction(tx).setPropertyValues(document, update.properties);
103
+ }
104
+ if (isDefined(update.collections)) {
105
+ const { assign, archive } = update.collections;
106
+ if (isDefined(assign)) {
107
+ await this.#collectionService.withTransaction(tx).assignDocument(document, assign);
108
+ }
109
+ if (isDefined(archive)) {
110
+ await this.#collectionService.withTransaction(tx).archiveDocument(document, archive);
111
+ }
90
112
  }
113
+ this.#observationService.documentChange(id, tx);
91
114
  });
92
115
  }
93
- async getContent(documentOrId) {
94
- const document = isString(documentOrId) ? await this.repository.load(documentOrId) : documentOrId;
95
- return await this.#documentFileService.getContent(document.id);
116
+ async getContent(tenantId, documentId) {
117
+ const document = await this.repository.loadByQuery({ tenantId, id: documentId });
118
+ return await this.#documentFileService.getContent(document);
96
119
  }
97
- getContentStream(documentOrId) {
120
+ getContentStream(tenantId, documentId) {
98
121
  return readableStreamFromPromise(async () => {
99
- const document = isString(documentOrId) ? await this.repository.load(documentOrId) : documentOrId;
100
- return this.#documentFileService.getContentStream(document.id);
122
+ const document = await this.repository.loadByQuery({ tenantId, id: documentId });
123
+ return this.#documentFileService.getContentStream(document);
101
124
  });
102
125
  }
103
- async getContentUrl(documentOrId, download = false) {
104
- const document = isString(documentOrId) ? await this.repository.load(documentOrId) : documentOrId;
105
- return await this.#documentFileService.getContentUrl(document.id, document.title, download);
126
+ async getContentUrl(tenantId, documentId, download = false) {
127
+ const document = await this.repository.loadByQuery({ tenantId, id: documentId });
128
+ return await this.#documentFileService.getContentUrl(document, download);
106
129
  }
107
- async getPreview(documentOrId, page = 1) {
108
- const document = isString(documentOrId) ? await this.repository.load(documentOrId) : documentOrId;
109
- return await this.#documentFileService.getPreview(document.id, page);
130
+ async getPreview(tenantId, documentId, page = 1) {
131
+ const document = await this.repository.loadByQuery({ tenantId, id: documentId });
132
+ return await this.#documentFileService.getPreview(document, page);
110
133
  }
111
- getPreviewStream(documentOrId, page = 1) {
134
+ getPreviewStream(tenantId, documentId, page = 1) {
112
135
  return readableStreamFromPromise(async () => {
113
- const document = isString(documentOrId) ? await this.repository.load(documentOrId) : documentOrId;
114
- return this.#documentFileService.getPreviewStream(document.id, page);
136
+ const document = await this.repository.loadByQuery({ tenantId, id: documentId });
137
+ return this.#documentFileService.getPreviewStream(document, page);
115
138
  });
116
139
  }
117
- async getPreviewUrl(documentOrId, page = 1) {
118
- const document = isString(documentOrId) ? await this.repository.load(documentOrId) : documentOrId;
119
- return await this.#documentFileService.getPreviewUrl(document.id, page);
140
+ async getPreviewUrl(tenantId, documentId, page = 1) {
141
+ const document = await this.repository.loadByQuery({ tenantId, id: documentId });
142
+ return await this.#documentFileService.getPreviewUrl(document, page);
120
143
  }
121
144
  /**
122
145
  * @returns collectionIds from either direct assignment or automatic assignment scope
123
146
  */
124
- async createAssignment(documentId, assignment, transaction) {
147
+ async createAssignment(document, assignment, transaction) {
125
148
  await match(assignment)
126
149
  .with({ collections: P.select() }, async (collectionIds) => {
127
150
  const collectionIdsArray = toArray(collectionIds);
128
- await this.#documentCollectionService.withTransaction(transaction).assignDocument(documentId, collectionIdsArray);
151
+ await this.#collectionService.withTransaction(transaction).assignDocument(document, collectionIdsArray);
129
152
  })
130
153
  .with({ request: P.select() }, async (requestId) => {
131
- await this.#requestService.withTransaction(transaction).assignDocument(requestId, documentId);
154
+ await this.#requestService.withTransaction(transaction).assignDocument(document, requestId);
132
155
  })
133
156
  .with({ automatic: P.select() }, async ({ target, scope }) => {
134
157
  const collectionIdsArray = toArray(scope);
135
- const assignmentTask = await this.#documentAssignmentTaskRepository.withTransaction(transaction).insert({ documentId: documentId, target });
158
+ const assignmentTask = await this.#documentAssignmentTaskRepository.withTransaction(transaction).insert({ tenantId: document.tenantId, documentId: document.id, target });
136
159
  for (const collectionId of collectionIdsArray) {
137
- await this.#documentAssignmentScopeRepository.withTransaction(transaction).insert({ taskId: assignmentTask.id, collectionId });
160
+ await this.#documentAssignmentScopeRepository.withTransaction(transaction).insert({ tenantId: document.tenantId, taskId: assignmentTask.id, collectionId });
138
161
  }
139
162
  })
140
163
  .exhaustive();
164
+ this.#observationService.documentChange(document.id, this.session);
141
165
  }
142
166
  };
143
167
  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-authorization.service.js';
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-authorization.service.js';
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 { DocumentManagementConfig } from '../module.js';
5
- export const documentManagementDatabaseConfigFactoryProvider = factoryProvider((_, context) => context.resolve(DocumentManagementConfig).database ?? context.resolve(DatabaseConfig, undefined, { skipSelf: true }));
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.0-flash-lite')
25
- .with('medium-low', () => 'gemini-2.5-flash-exp-04-17')
26
- .with('medium-high', () => 'gemini-2.5-flash-exp-04-17')
27
- .with('hard', () => 'gemini-2.5-pro-exp-03-25')
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
+ };
@@ -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 type GetDocumentManagementFoldersOptions = {
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, options = {}) {
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 ((categoryFolder.documents.length + categoryFolder.subFolders.length) == 0) {
11
+ if ((category.documents.length + categoryFolder.subFolders.length) == 0) {
23
12
  return null;
24
13
  }
25
14
  return categoryFolder;
26
15
  }
27
- const rootCategoryFolders = data.rootCategories.map(getCategoryFolder).filter(isNotNull);
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
- properties: DocumentPropertyValueView[];
32
+ tagIds: string[];
33
+ properties: LightDocumentPropertyValueView[];
29
34
  /** available as long as the document is neither approved nor rejected */
30
- currentWorkflow: DocumentWorkflow | null;
31
- validations: DocumentValidationExecution[] | null;
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
- currentWorkflow;
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(DocumentPropertyValueView),
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
- Property(DocumentWorkflow, { nullable: true }),
104
- __metadata("design:type", Object)
105
- ], DocumentView.prototype, "currentWorkflow", void 0);
120
+ Array(DocumentWorkflow),
121
+ __metadata("design:type", Array)
122
+ ], DocumentView.prototype, "workflows", void 0);
106
123
  __decorate([
107
- Array(DocumentValidationExecution, { nullable: true }),
108
- __metadata("design:type", Object)
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;
@@ -34,6 +37,7 @@ export declare const createDocumentParametersSchema: import("../../schema/index.
34
37
  scope: string | string[];
35
38
  };
36
39
  };
40
+ tags: string[];
37
41
  uploadId: string;
38
42
  properties?: {
39
43
  propertyId: import("../../orm/schemas/uuid.js").Uuid;
@@ -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>;