@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.
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 +66 -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
@@ -7,20 +7,26 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
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
- import { References } from '../../orm/decorators.js';
10
+ import { ForeignKey, References } from '../../orm/decorators.js';
11
11
  import { Entity } from '../../orm/entity.js';
12
- import { Timestamp, Unique, Uuid } from '../../orm/types.js';
12
+ import { Index, Timestamp, Unique, Uuid } from '../../orm/types.js';
13
13
  import { DocumentCollection } from './document-collection.model.js';
14
14
  import { DocumentManagementTable } from './document-management-table.js';
15
15
  import { Document } from './document.model.js';
16
16
  let DocumentCollectionAssignment = class DocumentCollectionAssignment extends Entity {
17
+ tenantId;
17
18
  collectionId;
18
19
  documentId;
19
20
  archiveTimestamp;
20
21
  };
22
+ __decorate([
23
+ Uuid(),
24
+ __metadata("design:type", String)
25
+ ], DocumentCollectionAssignment.prototype, "tenantId", void 0);
21
26
  __decorate([
22
27
  Uuid(),
23
28
  References(() => DocumentCollection),
29
+ Index(),
24
30
  __metadata("design:type", String)
25
31
  ], DocumentCollectionAssignment.prototype, "collectionId", void 0);
26
32
  __decorate([
@@ -33,7 +39,9 @@ __decorate([
33
39
  __metadata("design:type", Object)
34
40
  ], DocumentCollectionAssignment.prototype, "archiveTimestamp", void 0);
35
41
  DocumentCollectionAssignment = __decorate([
36
- DocumentManagementTable(),
37
- Unique(['collectionId', 'documentId'])
42
+ DocumentManagementTable({ name: 'collection_assignment' }),
43
+ Unique(['tenantId', 'collectionId', 'documentId']),
44
+ ForeignKey(() => DocumentCollection, ['tenantId', 'collectionId'], ['tenantId', 'id']),
45
+ ForeignKey(() => Document, ['tenantId', 'documentId'], ['tenantId', 'id'])
38
46
  ], DocumentCollectionAssignment);
39
47
  export { DocumentCollectionAssignment };
@@ -1,5 +1,7 @@
1
1
  import { Entity } from '../../orm/entity.js';
2
2
  import { Uuid } from '../../orm/types.js';
3
3
  export declare class DocumentCollection extends Entity {
4
+ static readonly entityName: 'DocumentCollection';
5
+ tenantId: Uuid;
4
6
  parentId: Uuid | null;
5
7
  }
@@ -8,17 +8,23 @@ 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 { Entity } from '../../orm/entity.js';
11
- import { References, Uuid } from '../../orm/types.js';
11
+ import { References, Unique, Uuid } from '../../orm/types.js';
12
12
  import { DocumentManagementTable } from './document-management-table.js';
13
13
  let DocumentCollection = class DocumentCollection extends Entity {
14
+ tenantId;
14
15
  parentId;
15
16
  };
17
+ __decorate([
18
+ Uuid(),
19
+ __metadata("design:type", String)
20
+ ], DocumentCollection.prototype, "tenantId", void 0);
16
21
  __decorate([
17
22
  Uuid({ nullable: true }),
18
23
  References(() => DocumentCollection),
19
24
  __metadata("design:type", Object)
20
25
  ], DocumentCollection.prototype, "parentId", void 0);
21
26
  DocumentCollection = __decorate([
22
- DocumentManagementTable()
27
+ DocumentManagementTable({ name: 'collection' }),
28
+ Unique(['tenantId', 'id'])
23
29
  ], DocumentCollection);
24
30
  export { DocumentCollection };
@@ -1 +1,3 @@
1
- export declare function DocumentManagementTable(): ClassDecorator;
1
+ import { type TableOptions } from '../../orm/decorators.js';
2
+ import type { TypedOmit } from '../../types.js';
3
+ export declare function DocumentManagementTable(options?: TypedOmit<TableOptions, 'schema'>): ClassDecorator;
@@ -1,4 +1,4 @@
1
1
  import { Table } from '../../orm/decorators.js';
2
- export function DocumentManagementTable() {
3
- return Table({ schema: 'document_management' });
2
+ export function DocumentManagementTable(options) {
3
+ return Table({ ...options, schema: 'document_management' });
4
4
  }
@@ -2,6 +2,7 @@ import { Entity } from '../../orm/entity.js';
2
2
  import { NumericDate, Uuid } from '../../orm/types.js';
3
3
  export declare class DocumentPropertyValue extends Entity {
4
4
  static readonly entityName: 'DocumentPropertyValue';
5
+ tenantId: Uuid;
5
6
  documentId: Uuid;
6
7
  propertyId: Uuid;
7
8
  text: string | null;
@@ -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 { eq, sql } from 'drizzle-orm';
11
- import { References } from '../../orm/decorators.js';
11
+ import { ForeignKey, References } from '../../orm/decorators.js';
12
12
  import { Entity } from '../../orm/entity.js';
13
13
  import { numNonNulls } from '../../orm/sqls.js';
14
14
  import { Check, NumericDate, Unique, Uuid } from '../../orm/types.js';
@@ -17,6 +17,7 @@ import { DocumentManagementTable } from './document-management-table.js';
17
17
  import { DocumentProperty } from './document-property.model.js';
18
18
  import { Document } from './document.model.js';
19
19
  let DocumentPropertyValue = class DocumentPropertyValue extends Entity {
20
+ tenantId;
20
21
  documentId;
21
22
  propertyId;
22
23
  text;
@@ -25,6 +26,10 @@ let DocumentPropertyValue = class DocumentPropertyValue extends Entity {
25
26
  boolean;
26
27
  date;
27
28
  };
29
+ __decorate([
30
+ Uuid(),
31
+ __metadata("design:type", String)
32
+ ], DocumentPropertyValue.prototype, "tenantId", void 0);
28
33
  __decorate([
29
34
  Uuid(),
30
35
  References(() => Document),
@@ -56,8 +61,9 @@ __decorate([
56
61
  __metadata("design:type", Object)
57
62
  ], DocumentPropertyValue.prototype, "date", void 0);
58
63
  DocumentPropertyValue = __decorate([
59
- DocumentManagementTable(),
60
- Unique(['documentId', 'propertyId']),
64
+ DocumentManagementTable({ name: 'property_value' }),
65
+ Unique(['tenantId', 'documentId', 'propertyId']),
66
+ ForeignKey(() => Document, ['tenantId', 'documentId'], ['tenantId', 'id']),
61
67
  Check('only_one_value', (table) => eq(numNonNulls(table.text, table.integer, table.decimal, table.boolean, table.date), sql.raw('1')))
62
68
  ], DocumentPropertyValue);
63
69
  export { DocumentPropertyValue };
@@ -11,6 +11,7 @@ export declare const DocumentPropertyDataType: {
11
11
  export type DocumentPropertyDataType = EnumType<typeof DocumentPropertyDataType>;
12
12
  export declare class DocumentProperty extends Entity {
13
13
  static readonly entityName: 'DocumentProperty';
14
+ tenantId: string | null;
14
15
  label: string;
15
16
  dataType: Enum<DocumentPropertyDataType>;
16
17
  }
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  };
10
10
  import { defineEnum } from '../../enumeration/enumeration.js';
11
11
  import { Entity } from '../../orm/entity.js';
12
- import { Unique } from '../../orm/types.js';
12
+ import { Unique, Uuid } from '../../orm/types.js';
13
13
  import { Enumeration, StringProperty } from '../../schema/index.js';
14
14
  import { DocumentManagementTable } from './document-management-table.js';
15
15
  export const DocumentPropertyDataType = defineEnum('DocumentPropertyDataType', {
@@ -20,9 +20,14 @@ export const DocumentPropertyDataType = defineEnum('DocumentPropertyDataType', {
20
20
  Date: 'date',
21
21
  });
22
22
  let DocumentProperty = class DocumentProperty extends Entity {
23
+ tenantId;
23
24
  label;
24
25
  dataType;
25
26
  };
27
+ __decorate([
28
+ Uuid({ nullable: true }),
29
+ __metadata("design:type", Object)
30
+ ], DocumentProperty.prototype, "tenantId", void 0);
26
31
  __decorate([
27
32
  StringProperty(),
28
33
  Unique(),
@@ -33,6 +38,7 @@ __decorate([
33
38
  __metadata("design:type", Object)
34
39
  ], DocumentProperty.prototype, "dataType", void 0);
35
40
  DocumentProperty = __decorate([
36
- DocumentManagementTable()
41
+ DocumentManagementTable({ name: 'property' }),
42
+ Unique(['tenantId', 'label'])
37
43
  ], DocumentProperty);
38
44
  export { DocumentProperty };
@@ -2,6 +2,7 @@ import { Entity } from '../../orm/entity.js';
2
2
  import { Uuid } from '../../orm/types.js';
3
3
  export declare class DocumentRequestCollectionAssignment extends Entity {
4
4
  static readonly entityName: 'DocumentRequestCollectionAssignment';
5
+ tenantId: Uuid;
5
6
  requestId: Uuid;
6
7
  collectionId: Uuid;
7
8
  }
@@ -7,16 +7,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
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
- import { References } from '../../orm/decorators.js';
10
+ import { ForeignKey, References } from '../../orm/decorators.js';
11
11
  import { Entity } from '../../orm/entity.js';
12
- import { Unique, Uuid } from '../../orm/types.js';
12
+ import { Index, Unique, Uuid } from '../../orm/types.js';
13
13
  import { DocumentCollection } from './document-collection.model.js';
14
14
  import { DocumentManagementTable } from './document-management-table.js';
15
15
  import { DocumentRequest } from './document-request.model.js';
16
16
  let DocumentRequestCollectionAssignment = class DocumentRequestCollectionAssignment extends Entity {
17
+ tenantId;
17
18
  requestId;
18
19
  collectionId;
19
20
  };
21
+ __decorate([
22
+ Uuid(),
23
+ __metadata("design:type", String)
24
+ ], DocumentRequestCollectionAssignment.prototype, "tenantId", void 0);
20
25
  __decorate([
21
26
  Uuid(),
22
27
  References(() => DocumentRequest),
@@ -25,10 +30,13 @@ __decorate([
25
30
  __decorate([
26
31
  Uuid(),
27
32
  References(() => DocumentCollection),
33
+ Index(),
28
34
  __metadata("design:type", String)
29
35
  ], DocumentRequestCollectionAssignment.prototype, "collectionId", void 0);
30
36
  DocumentRequestCollectionAssignment = __decorate([
31
- DocumentManagementTable(),
32
- Unique(['requestId', 'collectionId'])
37
+ DocumentManagementTable({ name: 'request_collection_assignment' }),
38
+ Unique(['tenantId', 'requestId', 'collectionId']),
39
+ ForeignKey(() => DocumentRequest, ['tenantId', 'requestId'], ['tenantId', 'id']),
40
+ ForeignKey(() => DocumentCollection, ['tenantId', 'collectionId'], ['tenantId', 'id'])
33
41
  ], DocumentRequestCollectionAssignment);
34
42
  export { DocumentRequestCollectionAssignment };
@@ -2,6 +2,7 @@ import { Entity } from '../../orm/entity.js';
2
2
  import { Uuid } from '../../orm/types.js';
3
3
  import type { DocumentRequest } from './document-request.model.js';
4
4
  export declare class DocumentRequestTemplate extends Entity implements Pick<DocumentRequest, 'typeId' | 'comment'> {
5
+ tenantId: string | null;
5
6
  requestsTemplateId: Uuid;
6
7
  typeId: Uuid;
7
8
  comment: string | null;
@@ -15,10 +15,15 @@ import { DocumentManagementTable } from './document-management-table.js';
15
15
  import { DocumentRequestsTemplate } from './document-requests-template.js';
16
16
  import { DocumentType } from './document-type.model.js';
17
17
  let DocumentRequestTemplate = class DocumentRequestTemplate extends Entity {
18
+ tenantId;
18
19
  requestsTemplateId;
19
20
  typeId;
20
21
  comment;
21
22
  };
23
+ __decorate([
24
+ Uuid({ nullable: true }),
25
+ __metadata("design:type", Object)
26
+ ], DocumentRequestTemplate.prototype, "tenantId", void 0);
22
27
  __decorate([
23
28
  Uuid(),
24
29
  References(() => DocumentRequestsTemplate),
@@ -34,6 +39,6 @@ __decorate([
34
39
  __metadata("design:type", Object)
35
40
  ], DocumentRequestTemplate.prototype, "comment", void 0);
36
41
  DocumentRequestTemplate = __decorate([
37
- DocumentManagementTable()
42
+ DocumentManagementTable({ name: 'request_template' })
38
43
  ], DocumentRequestTemplate);
39
44
  export { DocumentRequestTemplate };
@@ -11,6 +11,7 @@ export declare const DocumentRequestState: {
11
11
  export type DocumentRequestState = EnumType<typeof DocumentRequestState>;
12
12
  export declare class DocumentRequest extends Entity {
13
13
  static readonly entityName: 'DocumentRequest';
14
+ tenantId: Uuid;
14
15
  typeId: Uuid | null;
15
16
  documentId: Uuid | null;
16
17
  comment: string | null;
@@ -8,6 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { defineEnum } from '../../enumeration/enumeration.js';
11
+ import { ForeignKey } from '../../orm/decorators.js';
11
12
  import { Entity, Index, References, Unique, Uuid } from '../../orm/index.js';
12
13
  import { Enumeration, StringProperty } from '../../schema/index.js';
13
14
  import { DocumentManagementTable } from './document-management-table.js';
@@ -22,14 +23,20 @@ export const DocumentRequestState = defineEnum('DocumentRequestState', {
22
23
  Closed: 'closed',
23
24
  });
24
25
  let DocumentRequest = class DocumentRequest extends Entity {
26
+ tenantId;
25
27
  typeId;
26
28
  documentId;
27
29
  comment;
28
30
  state;
29
31
  };
32
+ __decorate([
33
+ Uuid(),
34
+ __metadata("design:type", String)
35
+ ], DocumentRequest.prototype, "tenantId", void 0);
30
36
  __decorate([
31
37
  Uuid({ nullable: true }),
32
38
  References(() => DocumentType),
39
+ Index(),
33
40
  __metadata("design:type", Object)
34
41
  ], DocumentRequest.prototype, "typeId", void 0);
35
42
  __decorate([
@@ -48,6 +55,8 @@ __decorate([
48
55
  __metadata("design:type", String)
49
56
  ], DocumentRequest.prototype, "state", void 0);
50
57
  DocumentRequest = __decorate([
51
- DocumentManagementTable()
58
+ DocumentManagementTable({ name: 'request' }),
59
+ Unique(['tenantId', 'id']),
60
+ ForeignKey(() => Document, ['tenantId', 'documentId'], ['tenantId', 'id'])
52
61
  ], DocumentRequest);
53
62
  export { DocumentRequest };
@@ -1,5 +1,6 @@
1
1
  import { Entity } from '../../orm/entity.js';
2
2
  export declare class DocumentRequestsTemplate extends Entity {
3
+ tenantId: string | null;
3
4
  label: string;
4
5
  description: string | null;
5
6
  }
@@ -8,16 +8,20 @@ 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 { Entity } from '../../orm/entity.js';
11
- import { Unique } from '../../orm/types.js';
11
+ import { Uuid } from '../../orm/types.js';
12
12
  import { StringProperty } from '../../schema/index.js';
13
13
  import { DocumentManagementTable } from './document-management-table.js';
14
14
  let DocumentRequestsTemplate = class DocumentRequestsTemplate extends Entity {
15
+ tenantId;
15
16
  label;
16
17
  description;
17
18
  };
19
+ __decorate([
20
+ Uuid({ nullable: true }),
21
+ __metadata("design:type", Object)
22
+ ], DocumentRequestsTemplate.prototype, "tenantId", void 0);
18
23
  __decorate([
19
24
  StringProperty(),
20
- Unique(),
21
25
  __metadata("design:type", String)
22
26
  ], DocumentRequestsTemplate.prototype, "label", void 0);
23
27
  __decorate([
@@ -25,6 +29,6 @@ __decorate([
25
29
  __metadata("design:type", Object)
26
30
  ], DocumentRequestsTemplate.prototype, "description", void 0);
27
31
  DocumentRequestsTemplate = __decorate([
28
- DocumentManagementTable()
32
+ DocumentManagementTable({ name: 'requests_template' })
29
33
  ], DocumentRequestsTemplate);
30
34
  export { DocumentRequestsTemplate };
@@ -0,0 +1,8 @@
1
+ import { Entity } from '../../orm/entity.js';
2
+ import { Uuid } from '../../orm/types.js';
3
+ export declare class DocumentTagAssignment extends Entity {
4
+ static readonly entityName: 'DocumentTagAssignment';
5
+ tenantId: Uuid;
6
+ documentId: Uuid;
7
+ tagId: Uuid;
8
+ }
@@ -0,0 +1,40 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { ForeignKey } from '../../orm/decorators.js';
11
+ import { Entity } from '../../orm/entity.js';
12
+ import { References, Unique, Uuid } from '../../orm/types.js';
13
+ import { DocumentManagementTable } from './document-management-table.js';
14
+ import { DocumentTag } from './document-tag.model.js';
15
+ import { Document } from './document.model.js';
16
+ let DocumentTagAssignment = class DocumentTagAssignment extends Entity {
17
+ tenantId;
18
+ documentId;
19
+ tagId;
20
+ };
21
+ __decorate([
22
+ Uuid(),
23
+ __metadata("design:type", String)
24
+ ], DocumentTagAssignment.prototype, "tenantId", void 0);
25
+ __decorate([
26
+ Uuid(),
27
+ References(() => Document),
28
+ __metadata("design:type", String)
29
+ ], DocumentTagAssignment.prototype, "documentId", void 0);
30
+ __decorate([
31
+ Uuid(),
32
+ References(() => DocumentTag),
33
+ __metadata("design:type", String)
34
+ ], DocumentTagAssignment.prototype, "tagId", void 0);
35
+ DocumentTagAssignment = __decorate([
36
+ DocumentManagementTable({ name: 'tag_assignment' }),
37
+ Unique(['tenantId', 'documentId', 'tagId']),
38
+ ForeignKey(() => Document, ['tenantId', 'documentId'], ['tenantId', 'id'])
39
+ ], DocumentTagAssignment);
40
+ export { DocumentTagAssignment };
@@ -0,0 +1,6 @@
1
+ import { Entity } from '../../orm/entity.js';
2
+ export declare class DocumentTag extends Entity {
3
+ static readonly entityName: 'DocumentTag';
4
+ tenantId: string | null;
5
+ label: string;
6
+ }
@@ -7,28 +7,24 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
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
- import { References } from '../../orm/decorators.js';
11
10
  import { Entity } from '../../orm/entity.js';
12
11
  import { Unique, Uuid } from '../../orm/types.js';
12
+ import { StringProperty } from '../../schema/index.js';
13
13
  import { DocumentManagementTable } from './document-management-table.js';
14
- import { DocumentRequest } from './document-request.model.js';
15
- import { Document } from './document.model.js';
16
- let DocumentRequestSubmission = class DocumentRequestSubmission extends Entity {
17
- requestId;
18
- documentId;
14
+ let DocumentTag = class DocumentTag extends Entity {
15
+ tenantId;
16
+ label;
19
17
  };
20
18
  __decorate([
21
- Uuid(),
22
- References(() => DocumentRequest),
23
- __metadata("design:type", String)
24
- ], DocumentRequestSubmission.prototype, "requestId", void 0);
19
+ Uuid({ nullable: true }),
20
+ __metadata("design:type", Object)
21
+ ], DocumentTag.prototype, "tenantId", void 0);
25
22
  __decorate([
26
- Uuid(),
27
- References(() => Document),
23
+ StringProperty(),
28
24
  __metadata("design:type", String)
29
- ], DocumentRequestSubmission.prototype, "documentId", void 0);
30
- DocumentRequestSubmission = __decorate([
31
- DocumentManagementTable(),
32
- Unique(['requestId', 'documentId'])
33
- ], DocumentRequestSubmission);
34
- export { DocumentRequestSubmission };
25
+ ], DocumentTag.prototype, "label", void 0);
26
+ DocumentTag = __decorate([
27
+ DocumentManagementTable({ name: 'tag' }),
28
+ Unique(['tenantId', 'label'])
29
+ ], DocumentTag);
30
+ export { DocumentTag };
@@ -1,6 +1,7 @@
1
1
  import { Entity } from '../../orm/entity.js';
2
2
  import { Uuid } from '../../orm/types.js';
3
3
  export declare class DocumentTypeProperty extends Entity {
4
+ tenantId: string | null;
4
5
  typeId: Uuid;
5
6
  propertyId: Uuid;
6
7
  }
@@ -14,9 +14,14 @@ import { DocumentManagementTable } from './document-management-table.js';
14
14
  import { DocumentProperty } from './document-property.model.js';
15
15
  import { DocumentType } from './document-type.model.js';
16
16
  let DocumentTypeProperty = class DocumentTypeProperty extends Entity {
17
+ tenantId;
17
18
  typeId;
18
19
  propertyId;
19
20
  };
21
+ __decorate([
22
+ Uuid({ nullable: true }),
23
+ __metadata("design:type", Object)
24
+ ], DocumentTypeProperty.prototype, "tenantId", void 0);
20
25
  __decorate([
21
26
  Uuid(),
22
27
  References(() => DocumentType),
@@ -28,7 +33,7 @@ __decorate([
28
33
  __metadata("design:type", String)
29
34
  ], DocumentTypeProperty.prototype, "propertyId", void 0);
30
35
  DocumentTypeProperty = __decorate([
31
- DocumentManagementTable(),
32
- Unique(['typeId', 'propertyId'])
36
+ DocumentManagementTable({ name: 'type_property' }),
37
+ Unique(['tenantId', 'typeId', 'propertyId'])
33
38
  ], DocumentTypeProperty);
34
39
  export { DocumentTypeProperty };
@@ -1,6 +1,7 @@
1
1
  import { Entity } from '../../orm/entity.js';
2
2
  import { Uuid } from '../../orm/types.js';
3
3
  export declare class DocumentTypeValidation extends Entity {
4
+ tenantId: string | null;
4
5
  typeId: Uuid;
5
6
  validationId: Uuid;
6
7
  }
@@ -9,17 +9,23 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  };
10
10
  import { References } from '../../orm/decorators.js';
11
11
  import { Entity } from '../../orm/entity.js';
12
- import { Unique, Uuid } from '../../orm/types.js';
12
+ import { Index, Unique, Uuid } from '../../orm/types.js';
13
13
  import { DocumentManagementTable } from './document-management-table.js';
14
14
  import { DocumentType } from './document-type.model.js';
15
15
  import { DocumentValidationDefinition } from './document-validation-definition.model.js';
16
16
  let DocumentTypeValidation = class DocumentTypeValidation extends Entity {
17
+ tenantId;
17
18
  typeId;
18
19
  validationId;
19
20
  };
21
+ __decorate([
22
+ Uuid({ nullable: true }),
23
+ __metadata("design:type", Object)
24
+ ], DocumentTypeValidation.prototype, "tenantId", void 0);
20
25
  __decorate([
21
26
  Uuid(),
22
27
  References(() => DocumentType),
28
+ Index(),
23
29
  __metadata("design:type", String)
24
30
  ], DocumentTypeValidation.prototype, "typeId", void 0);
25
31
  __decorate([
@@ -29,6 +35,6 @@ __decorate([
29
35
  ], DocumentTypeValidation.prototype, "validationId", void 0);
30
36
  DocumentTypeValidation = __decorate([
31
37
  DocumentManagementTable(),
32
- Unique(['typeId', 'validationId'])
38
+ Unique(['tenantId', 'typeId', 'validationId'])
33
39
  ], DocumentTypeValidation);
34
40
  export { DocumentTypeValidation };
@@ -2,6 +2,7 @@ import { Entity } from '../../orm/entity.js';
2
2
  import { Uuid } from '../../orm/types.js';
3
3
  export declare class DocumentType extends Entity {
4
4
  static readonly entityName: 'DocumentType';
5
+ tenantId: string | null;
5
6
  categoryId: Uuid;
6
7
  label: string;
7
8
  }
@@ -14,9 +14,14 @@ import { StringProperty } from '../../schema/index.js';
14
14
  import { DocumentCategory } from './document-category.model.js';
15
15
  import { DocumentManagementTable } from './document-management-table.js';
16
16
  let DocumentType = class DocumentType extends Entity {
17
+ tenantId;
17
18
  categoryId;
18
19
  label;
19
20
  };
21
+ __decorate([
22
+ Uuid({ nullable: true }),
23
+ __metadata("design:type", Object)
24
+ ], DocumentType.prototype, "tenantId", void 0);
20
25
  __decorate([
21
26
  Uuid(),
22
27
  References(() => DocumentCategory),
@@ -27,7 +32,7 @@ __decorate([
27
32
  __metadata("design:type", String)
28
33
  ], DocumentType.prototype, "label", void 0);
29
34
  DocumentType = __decorate([
30
- DocumentManagementTable(),
31
- Unique(['categoryId', 'label'])
35
+ DocumentManagementTable({ name: 'type' }),
36
+ Unique(['tenantId', 'categoryId', 'label'])
32
37
  ], DocumentType);
33
38
  export { DocumentType };
@@ -3,6 +3,7 @@ import { Json } from '../../orm/types.js';
3
3
  import type { Record } from '../../types.js';
4
4
  export declare class DocumentValidationDefinition extends Entity {
5
5
  static readonly entityName: 'DocumentValidationDefinition';
6
+ tenantId: string | null;
6
7
  identifier: string;
7
8
  label: string;
8
9
  description: string | null;
@@ -8,15 +8,20 @@ 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 { Entity } from '../../orm/entity.js';
11
- import { Json } from '../../orm/types.js';
11
+ import { Json, Uuid } from '../../orm/types.js';
12
12
  import { StringProperty } from '../../schema/index.js';
13
13
  import { DocumentManagementTable } from './document-management-table.js';
14
14
  let DocumentValidationDefinition = class DocumentValidationDefinition extends Entity {
15
+ tenantId;
15
16
  identifier;
16
17
  label;
17
18
  description;
18
19
  configuration;
19
20
  };
21
+ __decorate([
22
+ Uuid({ nullable: true }),
23
+ __metadata("design:type", Object)
24
+ ], DocumentValidationDefinition.prototype, "tenantId", void 0);
20
25
  __decorate([
21
26
  StringProperty(),
22
27
  __metadata("design:type", String)
@@ -34,6 +39,6 @@ __decorate([
34
39
  __metadata("design:type", Object)
35
40
  ], DocumentValidationDefinition.prototype, "configuration", void 0);
36
41
  DocumentValidationDefinition = __decorate([
37
- DocumentManagementTable()
42
+ DocumentManagementTable({ name: 'validation_definition' })
38
43
  ], DocumentValidationDefinition);
39
44
  export { DocumentValidationDefinition };
@@ -2,6 +2,7 @@ import { Entity } from '../../orm/entity.js';
2
2
  import { Uuid } from '../../orm/types.js';
3
3
  export declare class DocumentValidationExecutionRelatedDocument extends Entity {
4
4
  static readonly entityName: 'DocumentValidationExecutionRelatedDocument';
5
+ tenantId: Uuid;
5
6
  executionId: Uuid;
6
7
  documentId: Uuid;
7
8
  }