@tstdl/base 0.93.60 → 0.93.62

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 (72) hide show
  1. package/authentication/client/authentication.service.d.ts +0 -1
  2. package/authentication/client/authentication.service.js +2 -3
  3. package/document-management/api/document-management.api.d.ts +8 -8
  4. package/document-management/models/document-assignment-scope.model.d.ts +3 -4
  5. package/document-management/models/document-assignment-scope.model.js +5 -9
  6. package/document-management/models/document-assignment-task.model.d.ts +3 -4
  7. package/document-management/models/document-assignment-task.model.js +4 -8
  8. package/document-management/models/document-category.model.d.ts +3 -4
  9. package/document-management/models/document-category.model.js +4 -8
  10. package/document-management/models/document-collection-assignment.model.d.ts +2 -3
  11. package/document-management/models/document-collection-assignment.model.js +4 -9
  12. package/document-management/models/document-collection.model.d.ts +3 -4
  13. package/document-management/models/document-collection.model.js +4 -8
  14. package/document-management/models/document-property-value.model.d.ts +3 -4
  15. package/document-management/models/document-property-value.model.js +5 -9
  16. package/document-management/models/document-property.model.d.ts +3 -4
  17. package/document-management/models/document-property.model.js +3 -7
  18. package/document-management/models/document-request-collection-assignment.model.d.ts +3 -4
  19. package/document-management/models/document-request-collection-assignment.model.js +5 -9
  20. package/document-management/models/document-request-template.d.ts +2 -3
  21. package/document-management/models/document-request-template.js +4 -9
  22. package/document-management/models/document-request.model.d.ts +3 -4
  23. package/document-management/models/document-request.model.js +5 -9
  24. package/document-management/models/document-requests-template.d.ts +2 -3
  25. package/document-management/models/document-requests-template.js +2 -7
  26. package/document-management/models/document-tag-assignment.model.d.ts +3 -4
  27. package/document-management/models/document-tag-assignment.model.js +5 -9
  28. package/document-management/models/document-tag.model.d.ts +3 -4
  29. package/document-management/models/document-tag.model.js +3 -7
  30. package/document-management/models/document-type-property.model.d.ts +2 -3
  31. package/document-management/models/document-type-property.model.js +4 -9
  32. package/document-management/models/document-type-validation.model.d.ts +2 -3
  33. package/document-management/models/document-type-validation.model.js +4 -9
  34. package/document-management/models/document-type.model.d.ts +3 -4
  35. package/document-management/models/document-type.model.js +4 -8
  36. package/document-management/models/document-validation-definition.model.d.ts +3 -4
  37. package/document-management/models/document-validation-definition.model.js +3 -7
  38. package/document-management/models/document-validation-execution-related-document.model.d.ts +3 -4
  39. package/document-management/models/document-validation-execution-related-document.model.js +5 -9
  40. package/document-management/models/document-validation-execution.model.d.ts +3 -4
  41. package/document-management/models/document-validation-execution.model.js +5 -9
  42. package/document-management/models/document-workflow.model.d.ts +3 -4
  43. package/document-management/models/document-workflow.model.js +4 -8
  44. package/document-management/models/document.model.d.ts +3 -4
  45. package/document-management/models/document.model.js +4 -8
  46. package/document-management/server/drizzle/0001_lyrical_wong.sql +123 -0
  47. package/document-management/server/drizzle/meta/0001_snapshot.json +2728 -0
  48. package/document-management/server/drizzle/meta/_journal.json +7 -0
  49. package/document-management/server/services/document-category-type.service.d.ts +6 -6
  50. package/document-management/server/services/document-category-type.service.js +6 -6
  51. package/document-management/server/services/document-management-ai.service.js +2 -2
  52. package/document-management/server/services/document-management.service.d.ts +2 -2
  53. package/document-management/server/services/document-property.service.d.ts +4 -4
  54. package/document-management/server/services/document-property.service.js +3 -3
  55. package/document-management/server/services/document-request.service.d.ts +2 -2
  56. package/document-management/server/services/document-request.service.js +1 -1
  57. package/document-management/server/services/document-tag.service.d.ts +1 -1
  58. package/document-management/server/services/document-tag.service.js +2 -2
  59. package/document-management/server/services/document-validation.service.js +6 -6
  60. package/document-management/server/services/document.service.js +1 -5
  61. package/document-management/service-models/document-management.view-model.d.ts +1 -1
  62. package/document-management/service-models/document-management.view-model.js +1 -1
  63. package/document-management/service-models/document.service-model.d.ts +4 -4
  64. package/document-management/service-models/enriched/enriched-document-category.view.d.ts +1 -1
  65. package/document-management/service-models/enriched/enriched-document-type.view.d.ts +1 -1
  66. package/orm/decorators.d.ts +18 -7
  67. package/orm/decorators.js +10 -2
  68. package/orm/entity.d.ts +2 -2
  69. package/orm/entity.js +2 -0
  70. package/orm/server/drizzle/schema-converter.d.ts +3 -3
  71. package/orm/server/drizzle/schema-converter.js +22 -5
  72. package/package.json +3 -3
@@ -26,7 +26,6 @@ export declare class AuthenticationClientService<AdditionalTokenPayload extends
26
26
  private readonly logger;
27
27
  private readonly disposeToken;
28
28
  private clockOffset;
29
- private get localStorage();
30
29
  /**
31
30
  * Observable for authentication errors.
32
31
  * Emits when a refresh fails.
@@ -9,6 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  };
10
10
  import { Subject, filter, firstValueFrom, race, timer } from 'rxjs';
11
11
  import { CancellationToken } from '../../cancellation/token.js';
12
+ import { isNode } from '../../environment.js';
12
13
  import { BadRequestError } from '../../errors/bad-request.error.js';
13
14
  import { ForbiddenError } from '../../errors/forbidden.error.js';
14
15
  import { InvalidTokenError } from '../../errors/invalid-token.error.js';
@@ -43,6 +44,7 @@ const unrecoverableErrors = [
43
44
  NotSupportedError,
44
45
  UnauthorizedError,
45
46
  ];
47
+ const localStorage = isNode ? undefined : globalThis.localStorage;
46
48
  /**
47
49
  * Handles authentication on client side.
48
50
  *
@@ -67,9 +69,6 @@ let AuthenticationClientService = class AuthenticationClientService {
67
69
  logger = inject(Logger, 'AuthenticationService');
68
70
  disposeToken = new CancellationToken();
69
71
  clockOffset = 0;
70
- get localStorage() {
71
- return globalThis.localStorage;
72
- }
73
72
  /**
74
73
  * Observable for authentication errors.
75
74
  * Emits when a refresh fails.
@@ -88,8 +88,8 @@ export declare const documentManagementApiDefinition: {
88
88
  resource: string;
89
89
  method: "POST";
90
90
  parameters: import("../../schema/index.js").ObjectSchema<{
91
- parentId: import("../../orm/types.js").Uuid | null;
92
91
  label: string;
92
+ parentId: import("../../orm/types.js").Uuid | null;
93
93
  metadata?: Partial<{
94
94
  attributes: import("../../orm/types.js").HasDefault<import("../../orm/types.js").Json<import("../../orm/entity.js").EntityMetadataAttributes>>;
95
95
  }> | undefined;
@@ -127,10 +127,10 @@ export declare const documentManagementApiDefinition: {
127
127
  method: "POST";
128
128
  parameters: import("../../schema/index.js").ObjectSchema<{
129
129
  date?: import("../../orm/types.js").NumericDate | null | undefined;
130
+ summary?: string | null | undefined;
130
131
  title?: string | null | undefined;
131
132
  typeId?: import("../../orm/types.js").Uuid | null | undefined;
132
133
  subtitle?: string | null | undefined;
133
- summary?: string | null | undefined;
134
134
  comment?: string | null | undefined;
135
135
  approval?: import("../models/document.model.js").DocumentApproval | undefined;
136
136
  originalFileName?: string | null | undefined;
@@ -179,7 +179,7 @@ export declare const documentManagementApiDefinition: {
179
179
  parameters: import("../../schema/index.js").ObjectSchema<{
180
180
  id: import("../../orm/types.js").IsPrimaryKey<import("../../orm/types.js").HasDefault<import("../../orm/types.js").Uuid>>;
181
181
  description?: string | null | undefined;
182
- tenantId?: string | null | undefined;
182
+ tenantId?: import("../../orm/types.js").Uuid | undefined;
183
183
  label?: string | undefined;
184
184
  metadata?: Partial<{
185
185
  attributes: import("../../orm/types.js").HasDefault<import("../../orm/types.js").Json<import("../../orm/entity.js").EntityMetadataAttributes>>;
@@ -232,7 +232,7 @@ export declare const documentManagementApiDefinition: {
232
232
  method: "PATCH";
233
233
  parameters: import("../../schema/index.js").ObjectSchema<{
234
234
  id: import("../../orm/types.js").IsPrimaryKey<import("../../orm/types.js").HasDefault<import("../../orm/types.js").Uuid>>;
235
- tenantId?: string | null | undefined;
235
+ tenantId?: import("../../orm/types.js").Uuid | undefined;
236
236
  typeId?: import("../../orm/types.js").Uuid | undefined;
237
237
  comment?: string | null | undefined;
238
238
  metadata?: Partial<{
@@ -488,8 +488,8 @@ declare const _DocumentManagementApi: import("../../api/client/index.js").ApiCli
488
488
  resource: string;
489
489
  method: "POST";
490
490
  parameters: import("../../schema/index.js").ObjectSchema<{
491
- parentId: import("../../orm/types.js").Uuid | null;
492
491
  label: string;
492
+ parentId: import("../../orm/types.js").Uuid | null;
493
493
  metadata?: Partial<{
494
494
  attributes: import("../../orm/types.js").HasDefault<import("../../orm/types.js").Json<import("../../orm/entity.js").EntityMetadataAttributes>>;
495
495
  }> | undefined;
@@ -527,10 +527,10 @@ declare const _DocumentManagementApi: import("../../api/client/index.js").ApiCli
527
527
  method: "POST";
528
528
  parameters: import("../../schema/index.js").ObjectSchema<{
529
529
  date?: import("../../orm/types.js").NumericDate | null | undefined;
530
+ summary?: string | null | undefined;
530
531
  title?: string | null | undefined;
531
532
  typeId?: import("../../orm/types.js").Uuid | null | undefined;
532
533
  subtitle?: string | null | undefined;
533
- summary?: string | null | undefined;
534
534
  comment?: string | null | undefined;
535
535
  approval?: import("../models/document.model.js").DocumentApproval | undefined;
536
536
  originalFileName?: string | null | undefined;
@@ -579,7 +579,7 @@ declare const _DocumentManagementApi: import("../../api/client/index.js").ApiCli
579
579
  parameters: import("../../schema/index.js").ObjectSchema<{
580
580
  id: import("../../orm/types.js").IsPrimaryKey<import("../../orm/types.js").HasDefault<import("../../orm/types.js").Uuid>>;
581
581
  description?: string | null | undefined;
582
- tenantId?: string | null | undefined;
582
+ tenantId?: import("../../orm/types.js").Uuid | undefined;
583
583
  label?: string | undefined;
584
584
  metadata?: Partial<{
585
585
  attributes: import("../../orm/types.js").HasDefault<import("../../orm/types.js").Json<import("../../orm/entity.js").EntityMetadataAttributes>>;
@@ -632,7 +632,7 @@ declare const _DocumentManagementApi: import("../../api/client/index.js").ApiCli
632
632
  method: "PATCH";
633
633
  parameters: import("../../schema/index.js").ObjectSchema<{
634
634
  id: import("../../orm/types.js").IsPrimaryKey<import("../../orm/types.js").HasDefault<import("../../orm/types.js").Uuid>>;
635
- tenantId?: string | null | undefined;
635
+ tenantId?: import("../../orm/types.js").Uuid | undefined;
636
636
  typeId?: import("../../orm/types.js").Uuid | undefined;
637
637
  comment?: string | null | undefined;
638
638
  metadata?: Partial<{
@@ -1,11 +1,10 @@
1
- import { Entity, type Uuid } from '../../orm/index.js';
1
+ import { TenantEntity, type Uuid } from '../../orm/index.js';
2
2
  /**
3
3
  * Defines which collections or requests in these collections (depends on assignment task) are allowed to be assigned to a document in the assignment workflow.
4
4
  * This is used to prevent documents from being assigned to collections/requests that are out of scope/context.
5
5
  */
6
- export declare class DocumentAssignmentScope extends Entity {
7
- static readonly entityName: 'DocumentAssignmentScope';
8
- tenantId: Uuid;
6
+ export declare class DocumentAssignmentScope extends TenantEntity {
7
+ static readonly entityName = "DocumentAssignmentScope";
9
8
  taskId: Uuid;
10
9
  collectionId: Uuid;
11
10
  }
@@ -7,7 +7,7 @@ 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 { Entity, ForeignKey, References, Unique, UuidProperty } from '../../orm/index.js';
10
+ import { ForeignKey, TenantEntity, TenantReference, Unique, UuidProperty } from '../../orm/index.js';
11
11
  import { DocumentAssignmentTask } from './document-assignment-task.model.js';
12
12
  import { DocumentCollection } from './document-collection.model.js';
13
13
  import { DocumentManagementTable } from './document-management-table.js';
@@ -15,23 +15,19 @@ import { DocumentManagementTable } from './document-management-table.js';
15
15
  * Defines which collections or requests in these collections (depends on assignment task) are allowed to be assigned to a document in the assignment workflow.
16
16
  * This is used to prevent documents from being assigned to collections/requests that are out of scope/context.
17
17
  */
18
- let DocumentAssignmentScope = class DocumentAssignmentScope extends Entity {
19
- tenantId;
18
+ let DocumentAssignmentScope = class DocumentAssignmentScope extends TenantEntity {
19
+ static entityName = 'DocumentAssignmentScope';
20
20
  taskId;
21
21
  collectionId;
22
22
  };
23
23
  __decorate([
24
24
  UuidProperty(),
25
- __metadata("design:type", String)
26
- ], DocumentAssignmentScope.prototype, "tenantId", void 0);
27
- __decorate([
28
- UuidProperty(),
29
- References(() => DocumentAssignmentTask),
25
+ TenantReference(() => DocumentAssignmentTask),
30
26
  __metadata("design:type", String)
31
27
  ], DocumentAssignmentScope.prototype, "taskId", void 0);
32
28
  __decorate([
33
29
  UuidProperty(),
34
- References(() => DocumentCollection),
30
+ TenantReference(() => DocumentCollection),
35
31
  __metadata("design:type", String)
36
32
  ], DocumentAssignmentScope.prototype, "collectionId", void 0);
37
33
  DocumentAssignmentScope = __decorate([
@@ -1,13 +1,12 @@
1
1
  import { type EnumType } from '../../enumeration/enumeration.js';
2
- import { Entity, type Uuid } from '../../orm/index.js';
2
+ import { TenantEntity, type Uuid } from '../../orm/index.js';
3
3
  export declare const DocumentAssignmentTarget: {
4
4
  readonly Collection: "collection";
5
5
  readonly Request: "request";
6
6
  };
7
7
  export type DocumentAssignmentTarget = EnumType<typeof DocumentAssignmentTarget>;
8
- export declare class DocumentAssignmentTask extends Entity {
9
- static readonly entityName: 'DocumentAssignmentTask';
10
- tenantId: Uuid;
8
+ export declare class DocumentAssignmentTask extends TenantEntity {
9
+ static readonly entityName = "DocumentAssignmentTask";
11
10
  documentId: Uuid;
12
11
  target: DocumentAssignmentTarget;
13
12
  }
@@ -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 { defineEnum } from '../../enumeration/enumeration.js';
11
- import { Entity, ForeignKey, References, Unique, UuidProperty } from '../../orm/index.js';
11
+ import { ForeignKey, TenantEntity, TenantReference, Unique, UuidProperty } from '../../orm/index.js';
12
12
  import { Enumeration } from '../../schema/index.js';
13
13
  import { DocumentManagementTable } from './document-management-table.js';
14
14
  import { Document } from './document.model.js';
@@ -16,18 +16,14 @@ export const DocumentAssignmentTarget = defineEnum('DocumentAssignmentTarget', {
16
16
  Collection: 'collection',
17
17
  Request: 'request',
18
18
  });
19
- let DocumentAssignmentTask = class DocumentAssignmentTask extends Entity {
20
- tenantId;
19
+ let DocumentAssignmentTask = class DocumentAssignmentTask extends TenantEntity {
20
+ static entityName = 'DocumentAssignmentTask';
21
21
  documentId;
22
22
  target;
23
23
  };
24
24
  __decorate([
25
25
  UuidProperty(),
26
- __metadata("design:type", String)
27
- ], DocumentAssignmentTask.prototype, "tenantId", void 0);
28
- __decorate([
29
- UuidProperty(),
30
- References(() => Document),
26
+ TenantReference(() => Document),
31
27
  Unique(),
32
28
  __metadata("design:type", String)
33
29
  ], DocumentAssignmentTask.prototype, "documentId", void 0);
@@ -1,7 +1,6 @@
1
- import { Entity, type Uuid } from '../../orm/index.js';
2
- export declare class DocumentCategory extends Entity {
3
- static readonly entityName: 'DocumentCategory';
4
- tenantId: string | null;
1
+ import { TenantEntity, type Uuid } from '../../orm/index.js';
2
+ export declare class DocumentCategory extends TenantEntity {
3
+ static readonly entityName = "DocumentCategory";
5
4
  parentId: Uuid | null;
6
5
  label: string;
7
6
  }
@@ -7,21 +7,17 @@ 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 { Entity, References, Unique, UuidProperty } from '../../orm/index.js';
10
+ import { TenantEntity, TenantReference, Unique, UuidProperty } from '../../orm/index.js';
11
11
  import { StringProperty } from '../../schema/index.js';
12
12
  import { DocumentManagementTable } from './document-management-table.js';
13
- let DocumentCategory = class DocumentCategory extends Entity {
14
- tenantId;
13
+ let DocumentCategory = class DocumentCategory extends TenantEntity {
14
+ static entityName = 'DocumentCategory';
15
15
  parentId;
16
16
  label;
17
17
  };
18
18
  __decorate([
19
19
  UuidProperty({ nullable: true }),
20
- __metadata("design:type", Object)
21
- ], DocumentCategory.prototype, "tenantId", void 0);
22
- __decorate([
23
- UuidProperty({ nullable: true }),
24
- References(() => DocumentCategory),
20
+ TenantReference(() => DocumentCategory),
25
21
  __metadata("design:type", Object)
26
22
  ], DocumentCategory.prototype, "parentId", void 0);
27
23
  __decorate([
@@ -1,6 +1,5 @@
1
- import { Entity, type Timestamp, type Uuid } from '../../orm/index.js';
2
- export declare class DocumentCollectionAssignment extends Entity {
3
- tenantId: Uuid;
1
+ import { TenantEntity, type Timestamp, type Uuid } from '../../orm/index.js';
2
+ export declare class DocumentCollectionAssignment extends TenantEntity {
4
3
  collectionId: Uuid;
5
4
  documentId: Uuid;
6
5
  archiveTimestamp: Timestamp | null;
@@ -7,29 +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 { Entity, ForeignKey, Index, References, TimestampProperty, Unique, UuidProperty } from '../../orm/index.js';
10
+ import { ForeignKey, Index, TenantEntity, TenantReference, TimestampProperty, Unique, UuidProperty } from '../../orm/index.js';
11
11
  import { DocumentCollection } from './document-collection.model.js';
12
12
  import { DocumentManagementTable } from './document-management-table.js';
13
13
  import { Document } from './document.model.js';
14
- let DocumentCollectionAssignment = class DocumentCollectionAssignment extends Entity {
15
- tenantId;
14
+ let DocumentCollectionAssignment = class DocumentCollectionAssignment extends TenantEntity {
16
15
  collectionId;
17
16
  documentId;
18
17
  archiveTimestamp;
19
18
  };
20
19
  __decorate([
21
20
  UuidProperty(),
22
- __metadata("design:type", String)
23
- ], DocumentCollectionAssignment.prototype, "tenantId", void 0);
24
- __decorate([
25
- UuidProperty(),
26
- References(() => DocumentCollection),
21
+ TenantReference(() => DocumentCollection),
27
22
  Index(),
28
23
  __metadata("design:type", String)
29
24
  ], DocumentCollectionAssignment.prototype, "collectionId", void 0);
30
25
  __decorate([
31
26
  UuidProperty(),
32
- References(() => Document),
27
+ TenantReference(() => Document),
33
28
  __metadata("design:type", String)
34
29
  ], DocumentCollectionAssignment.prototype, "documentId", void 0);
35
30
  __decorate([
@@ -1,6 +1,5 @@
1
- import { Entity, type Uuid } from '../../orm/index.js';
2
- export declare class DocumentCollection extends Entity {
3
- static readonly entityName: 'DocumentCollection';
4
- tenantId: Uuid;
1
+ import { TenantEntity, type Uuid } from '../../orm/index.js';
2
+ export declare class DocumentCollection extends TenantEntity {
3
+ static readonly entityName = "DocumentCollection";
5
4
  parentId: Uuid | null;
6
5
  }
@@ -7,19 +7,15 @@ 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 { Entity, References, Unique, UuidProperty } from '../../orm/index.js';
10
+ import { TenantEntity, TenantReference, Unique, UuidProperty } from '../../orm/index.js';
11
11
  import { DocumentManagementTable } from './document-management-table.js';
12
- let DocumentCollection = class DocumentCollection extends Entity {
13
- tenantId;
12
+ let DocumentCollection = class DocumentCollection extends TenantEntity {
13
+ static entityName = 'DocumentCollection';
14
14
  parentId;
15
15
  };
16
- __decorate([
17
- UuidProperty(),
18
- __metadata("design:type", String)
19
- ], DocumentCollection.prototype, "tenantId", void 0);
20
16
  __decorate([
21
17
  UuidProperty({ nullable: true }),
22
- References(() => DocumentCollection),
18
+ TenantReference(() => DocumentCollection),
23
19
  __metadata("design:type", Object)
24
20
  ], DocumentCollection.prototype, "parentId", void 0);
25
21
  DocumentCollection = __decorate([
@@ -1,7 +1,6 @@
1
- import { Entity, type NumericDate, type Uuid } from '../../orm/index.js';
2
- export declare class DocumentPropertyValue extends Entity {
3
- static readonly entityName: 'DocumentPropertyValue';
4
- tenantId: Uuid;
1
+ import { type NumericDate, TenantEntity, type Uuid } from '../../orm/index.js';
2
+ export declare class DocumentPropertyValue extends TenantEntity {
3
+ static readonly entityName = "DocumentPropertyValue";
5
4
  documentId: Uuid;
6
5
  propertyId: Uuid;
7
6
  text: string | null;
@@ -8,13 +8,13 @@ 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 { Check, Entity, ForeignKey, NumericDateProperty, numNonNulls, References, Unique, UuidProperty } from '../../orm/index.js';
11
+ import { Check, ForeignKey, NumericDateProperty, numNonNulls, TenantEntity, TenantReference, Unique, UuidProperty } from '../../orm/index.js';
12
12
  import { BooleanProperty, Integer, NumberProperty, StringProperty } from '../../schema/index.js';
13
13
  import { DocumentManagementTable } from './document-management-table.js';
14
14
  import { DocumentProperty } from './document-property.model.js';
15
15
  import { Document } from './document.model.js';
16
- let DocumentPropertyValue = class DocumentPropertyValue extends Entity {
17
- tenantId;
16
+ let DocumentPropertyValue = class DocumentPropertyValue extends TenantEntity {
17
+ static entityName = 'DocumentPropertyValue';
18
18
  documentId;
19
19
  propertyId;
20
20
  text;
@@ -25,16 +25,12 @@ let DocumentPropertyValue = class DocumentPropertyValue extends Entity {
25
25
  };
26
26
  __decorate([
27
27
  UuidProperty(),
28
- __metadata("design:type", String)
29
- ], DocumentPropertyValue.prototype, "tenantId", void 0);
30
- __decorate([
31
- UuidProperty(),
32
- References(() => Document),
28
+ TenantReference(() => Document),
33
29
  __metadata("design:type", String)
34
30
  ], DocumentPropertyValue.prototype, "documentId", void 0);
35
31
  __decorate([
36
32
  UuidProperty(),
37
- References(() => DocumentProperty),
33
+ TenantReference(() => DocumentProperty),
38
34
  __metadata("design:type", String)
39
35
  ], DocumentPropertyValue.prototype, "propertyId", void 0);
40
36
  __decorate([
@@ -1,5 +1,5 @@
1
1
  import { type EnumType } from '../../enumeration/enumeration.js';
2
- import { Entity, type Enum } from '../../orm/index.js';
2
+ import { type Enum, TenantEntity } from '../../orm/index.js';
3
3
  export declare const DocumentPropertyDataType: {
4
4
  readonly Text: "text";
5
5
  readonly Integer: "integer";
@@ -8,9 +8,8 @@ export declare const DocumentPropertyDataType: {
8
8
  readonly Date: "date";
9
9
  };
10
10
  export type DocumentPropertyDataType = EnumType<typeof DocumentPropertyDataType>;
11
- export declare class DocumentProperty extends Entity {
12
- static readonly entityName: 'DocumentProperty';
13
- tenantId: string | null;
11
+ export declare class DocumentProperty extends TenantEntity {
12
+ static readonly entityName = "DocumentProperty";
14
13
  label: string;
15
14
  dataType: Enum<DocumentPropertyDataType>;
16
15
  }
@@ -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 { defineEnum } from '../../enumeration/enumeration.js';
11
- import { Entity, Unique, UuidProperty } from '../../orm/index.js';
11
+ import { TenantEntity, Unique } from '../../orm/index.js';
12
12
  import { Enumeration, StringProperty } from '../../schema/index.js';
13
13
  import { DocumentManagementTable } from './document-management-table.js';
14
14
  export const DocumentPropertyDataType = defineEnum('DocumentPropertyDataType', {
@@ -18,15 +18,11 @@ export const DocumentPropertyDataType = defineEnum('DocumentPropertyDataType', {
18
18
  Boolean: 'boolean',
19
19
  Date: 'date',
20
20
  });
21
- let DocumentProperty = class DocumentProperty extends Entity {
22
- tenantId;
21
+ let DocumentProperty = class DocumentProperty extends TenantEntity {
22
+ static entityName = 'DocumentProperty';
23
23
  label;
24
24
  dataType;
25
25
  };
26
- __decorate([
27
- UuidProperty({ nullable: true }),
28
- __metadata("design:type", Object)
29
- ], DocumentProperty.prototype, "tenantId", void 0);
30
26
  __decorate([
31
27
  StringProperty(),
32
28
  Unique(),
@@ -1,7 +1,6 @@
1
- import { Entity, type Uuid } from '../../orm/index.js';
2
- export declare class DocumentRequestCollectionAssignment extends Entity {
3
- static readonly entityName: 'DocumentRequestCollectionAssignment';
4
- tenantId: Uuid;
1
+ import { TenantEntity, type Uuid } from '../../orm/index.js';
2
+ export declare class DocumentRequestCollectionAssignment extends TenantEntity {
3
+ static readonly entityName = "DocumentRequestCollectionAssignment";
5
4
  requestId: Uuid;
6
5
  collectionId: Uuid;
7
6
  }
@@ -7,27 +7,23 @@ 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 { Entity, ForeignKey, Index, References, Unique, UuidProperty } from '../../orm/index.js';
10
+ import { ForeignKey, Index, TenantEntity, TenantReference, Unique, UuidProperty } from '../../orm/index.js';
11
11
  import { DocumentCollection } from './document-collection.model.js';
12
12
  import { DocumentManagementTable } from './document-management-table.js';
13
13
  import { DocumentRequest } from './document-request.model.js';
14
- let DocumentRequestCollectionAssignment = class DocumentRequestCollectionAssignment extends Entity {
15
- tenantId;
14
+ let DocumentRequestCollectionAssignment = class DocumentRequestCollectionAssignment extends TenantEntity {
15
+ static entityName = 'DocumentRequestCollectionAssignment';
16
16
  requestId;
17
17
  collectionId;
18
18
  };
19
19
  __decorate([
20
20
  UuidProperty(),
21
- __metadata("design:type", String)
22
- ], DocumentRequestCollectionAssignment.prototype, "tenantId", void 0);
23
- __decorate([
24
- UuidProperty(),
25
- References(() => DocumentRequest),
21
+ TenantReference(() => DocumentRequest),
26
22
  __metadata("design:type", String)
27
23
  ], DocumentRequestCollectionAssignment.prototype, "requestId", void 0);
28
24
  __decorate([
29
25
  UuidProperty(),
30
- References(() => DocumentCollection),
26
+ TenantReference(() => DocumentCollection),
31
27
  Index(),
32
28
  __metadata("design:type", String)
33
29
  ], DocumentRequestCollectionAssignment.prototype, "collectionId", void 0);
@@ -1,7 +1,6 @@
1
- import { Entity, type Uuid } from '../../orm/index.js';
1
+ import { TenantEntity, type Uuid } from '../../orm/index.js';
2
2
  import type { DocumentRequest } from './document-request.model.js';
3
- export declare class DocumentRequestTemplate extends Entity implements Pick<DocumentRequest, 'typeId' | 'comment'> {
4
- tenantId: string | null;
3
+ export declare class DocumentRequestTemplate extends TenantEntity implements Pick<DocumentRequest, 'typeId' | 'comment'> {
5
4
  requestsTemplateId: Uuid;
6
5
  typeId: Uuid;
7
6
  comment: string | null;
@@ -7,29 +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 { Entity, References, UuidProperty } from '../../orm/index.js';
10
+ import { TenantEntity, TenantReference, UuidProperty } from '../../orm/index.js';
11
11
  import { StringProperty } from '../../schema/index.js';
12
12
  import { DocumentManagementTable } from './document-management-table.js';
13
13
  import { DocumentRequestsTemplate } from './document-requests-template.js';
14
14
  import { DocumentType } from './document-type.model.js';
15
- let DocumentRequestTemplate = class DocumentRequestTemplate extends Entity {
16
- tenantId;
15
+ let DocumentRequestTemplate = class DocumentRequestTemplate extends TenantEntity {
17
16
  requestsTemplateId;
18
17
  typeId;
19
18
  comment;
20
19
  };
21
- __decorate([
22
- UuidProperty({ nullable: true }),
23
- __metadata("design:type", Object)
24
- ], DocumentRequestTemplate.prototype, "tenantId", void 0);
25
20
  __decorate([
26
21
  UuidProperty(),
27
- References(() => DocumentRequestsTemplate),
22
+ TenantReference(() => DocumentRequestsTemplate),
28
23
  __metadata("design:type", String)
29
24
  ], DocumentRequestTemplate.prototype, "requestsTemplateId", void 0);
30
25
  __decorate([
31
26
  UuidProperty(),
32
- References(() => DocumentType),
27
+ TenantReference(() => DocumentType),
33
28
  __metadata("design:type", String)
34
29
  ], DocumentRequestTemplate.prototype, "typeId", void 0);
35
30
  __decorate([
@@ -1,5 +1,5 @@
1
1
  import { type EnumType } from '../../enumeration/enumeration.js';
2
- import { Entity, type Uuid } from '../../orm/index.js';
2
+ import { TenantEntity, type Uuid } from '../../orm/index.js';
3
3
  export declare const DocumentRequestState: {
4
4
  /** No document or pending document */
5
5
  readonly Open: "open";
@@ -9,9 +9,8 @@ export declare const DocumentRequestState: {
9
9
  readonly Closed: "closed";
10
10
  };
11
11
  export type DocumentRequestState = EnumType<typeof DocumentRequestState>;
12
- export declare class DocumentRequest extends Entity {
13
- static readonly entityName: 'DocumentRequest';
14
- tenantId: Uuid;
12
+ export declare class DocumentRequest extends TenantEntity {
13
+ static readonly entityName = "DocumentRequest";
15
14
  typeId: Uuid | null;
16
15
  documentId: Uuid | null;
17
16
  comment: 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 { defineEnum } from '../../enumeration/enumeration.js';
11
- import { Entity, ForeignKey, Index, References, Unique, UuidProperty } from '../../orm/index.js';
11
+ import { ForeignKey, Index, TenantEntity, TenantReference, Unique, UuidProperty } from '../../orm/index.js';
12
12
  import { Enumeration, StringProperty } from '../../schema/index.js';
13
13
  import { DocumentManagementTable } from './document-management-table.js';
14
14
  import { DocumentType } from './document-type.model.js';
@@ -21,26 +21,22 @@ export const DocumentRequestState = defineEnum('DocumentRequestState', {
21
21
  /** Request canceled without document or with rejected document */
22
22
  Closed: 'closed',
23
23
  });
24
- let DocumentRequest = class DocumentRequest extends Entity {
25
- tenantId;
24
+ let DocumentRequest = class DocumentRequest extends TenantEntity {
25
+ static entityName = 'DocumentRequest';
26
26
  typeId;
27
27
  documentId;
28
28
  comment;
29
29
  state;
30
30
  };
31
- __decorate([
32
- UuidProperty(),
33
- __metadata("design:type", String)
34
- ], DocumentRequest.prototype, "tenantId", void 0);
35
31
  __decorate([
36
32
  UuidProperty({ nullable: true }),
37
- References(() => DocumentType),
33
+ TenantReference(() => DocumentType),
38
34
  Index(),
39
35
  __metadata("design:type", Object)
40
36
  ], DocumentRequest.prototype, "typeId", void 0);
41
37
  __decorate([
42
38
  UuidProperty({ nullable: true }),
43
- References(() => Document),
39
+ TenantReference(() => Document),
44
40
  Unique(),
45
41
  __metadata("design:type", Object)
46
42
  ], DocumentRequest.prototype, "documentId", void 0);
@@ -1,6 +1,5 @@
1
- import { Entity } from '../../orm/index.js';
2
- export declare class DocumentRequestsTemplate extends Entity {
3
- tenantId: string | null;
1
+ import { TenantEntity } from '../../orm/index.js';
2
+ export declare class DocumentRequestsTemplate extends TenantEntity {
4
3
  label: string;
5
4
  description: string | null;
6
5
  }
@@ -7,18 +7,13 @@ 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 { Entity, UuidProperty } from '../../orm/index.js';
10
+ import { TenantEntity } from '../../orm/index.js';
11
11
  import { StringProperty } from '../../schema/index.js';
12
12
  import { DocumentManagementTable } from './document-management-table.js';
13
- let DocumentRequestsTemplate = class DocumentRequestsTemplate extends Entity {
14
- tenantId;
13
+ let DocumentRequestsTemplate = class DocumentRequestsTemplate extends TenantEntity {
15
14
  label;
16
15
  description;
17
16
  };
18
- __decorate([
19
- UuidProperty({ nullable: true }),
20
- __metadata("design:type", Object)
21
- ], DocumentRequestsTemplate.prototype, "tenantId", void 0);
22
17
  __decorate([
23
18
  StringProperty(),
24
19
  __metadata("design:type", String)
@@ -1,7 +1,6 @@
1
- import { Entity, type Uuid } from '../../orm/index.js';
2
- export declare class DocumentTagAssignment extends Entity {
3
- static readonly entityName: 'DocumentTagAssignment';
4
- tenantId: Uuid;
1
+ import { TenantEntity, type Uuid } from '../../orm/index.js';
2
+ export declare class DocumentTagAssignment extends TenantEntity {
3
+ static readonly entityName = "DocumentTagAssignment";
5
4
  documentId: Uuid;
6
5
  tagId: Uuid;
7
6
  }