@tstdl/base 0.92.84 → 0.92.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/ai.service.d.ts +1 -1
- package/ai/ai.service.js +34 -16
- package/ai/types.d.ts +1 -1
- package/authentication/authentication.api.d.ts +9 -9
- package/authentication/models/schemas.d.ts +2 -2
- package/cancellation/token.d.ts +1 -1
- package/document-management/api/document-management.api.d.ts +94 -94
- package/document-management/models/document-category.model.d.ts +1 -0
- package/document-management/models/document-index.model.d.ts +7 -0
- package/document-management/models/document-index.model.js +32 -0
- package/document-management/models/document-request-file.model.d.ts +1 -1
- package/document-management/models/document-request-file.model.js +2 -2
- package/document-management/models/document-type.model.d.ts +1 -0
- package/document-management/models/document.model.d.ts +1 -1
- package/document-management/models/document.model.js +2 -2
- package/document-management/models/service-models/document.service-model.d.ts +51 -51
- package/document-management/models/service-models/document.service-model.js +2 -2
- package/document-management/server/drizzle/{0000_sloppy_fenris.sql → 0000_useful_overlord.sql} +2 -2
- package/document-management/server/drizzle/meta/0000_snapshot.json +5 -5
- package/document-management/server/drizzle/meta/_journal.json +2 -2
- package/document-management/server/drizzle.config.js +1 -1
- package/document-management/server/module.d.ts +1 -1
- package/document-management/server/module.js +1 -1
- package/document-management/server/schemas.d.ts +33 -0
- package/document-management/{models → server}/schemas.js +14 -14
- package/document-management/server/services/document-management.service.d.ts +17 -3
- package/document-management/server/services/document-management.service.js +65 -17
- package/examples/orm/schemas.d.ts +1 -1
- package/mail/drizzle.config.js +1 -1
- package/mail/models/schemas.d.ts +1 -1
- package/orm/decorators.d.ts +4 -4
- package/orm/entity.d.ts +5 -7
- package/orm/entity.js +9 -1
- package/orm/index.d.ts +1 -0
- package/orm/index.js +1 -0
- package/orm/query.d.ts +1 -3
- package/orm/query.js +0 -1
- package/orm/repository.types.d.ts +32 -0
- package/orm/repository.types.js +1 -0
- package/orm/server/database-schema.d.ts +4 -4
- package/orm/server/drizzle/schema-converter.d.ts +1 -1
- package/orm/server/index.d.ts +1 -0
- package/orm/server/index.js +1 -0
- package/orm/server/query-converter.d.ts +1 -2
- package/orm/server/query-converter.js +66 -61
- package/orm/server/repository.d.ts +78 -42
- package/orm/server/repository.js +202 -106
- package/orm/server/sqls.d.ts +7 -0
- package/orm/server/sqls.js +6 -0
- package/orm/server/types.d.ts +3 -3
- package/orm/types.d.ts +1 -1
- package/package.json +13 -11
- package/process-shutdown.js +0 -3
- package/queue/enqueue-batch.d.ts +1 -0
- package/queue/enqueue-batch.js +1 -1
- package/queue/mongo/queue.d.ts +9 -4
- package/queue/mongo/queue.js +5 -6
- package/queue/postgres/drizzle/0000_zippy_moondragon.sql +11 -0
- package/queue/postgres/drizzle/meta/0000_snapshot.json +90 -0
- package/queue/postgres/drizzle/meta/_journal.json +13 -0
- package/queue/postgres/drizzle.config.d.ts +2 -0
- package/queue/postgres/drizzle.config.js +11 -0
- package/queue/postgres/index.d.ts +4 -0
- package/queue/postgres/index.js +4 -0
- package/queue/postgres/job.model.d.ts +13 -0
- package/queue/postgres/job.model.js +55 -0
- package/queue/postgres/module.d.ts +9 -0
- package/queue/postgres/module.js +29 -0
- package/queue/postgres/queue.d.ts +28 -0
- package/queue/postgres/queue.js +149 -0
- package/queue/postgres/queue.provider.d.ts +7 -0
- package/queue/postgres/queue.provider.js +21 -0
- package/queue/postgres/schemas.d.ts +3 -0
- package/queue/postgres/schemas.js +4 -0
- package/queue/provider.d.ts +2 -1
- package/queue/queue.d.ts +18 -6
- package/schema/schemas/object.d.ts +1 -1
- package/utils/timing.d.ts +4 -3
- package/utils/timing.js +3 -1
- package/document-management/models/schemas.d.ts +0 -33
|
@@ -17,7 +17,7 @@ import { Document } from './document.model.js';
|
|
|
17
17
|
export class DocumentRequestFile extends Entity {
|
|
18
18
|
requestId;
|
|
19
19
|
fileId;
|
|
20
|
-
|
|
20
|
+
title;
|
|
21
21
|
createdDocumentId;
|
|
22
22
|
approval;
|
|
23
23
|
approvalComment;
|
|
@@ -36,7 +36,7 @@ __decorate([
|
|
|
36
36
|
__decorate([
|
|
37
37
|
StringProperty({ nullable: true }),
|
|
38
38
|
__metadata("design:type", Object)
|
|
39
|
-
], DocumentRequestFile.prototype, "
|
|
39
|
+
], DocumentRequestFile.prototype, "title", void 0);
|
|
40
40
|
__decorate([
|
|
41
41
|
Uuid({ nullable: true }),
|
|
42
42
|
References(() => Document),
|
|
@@ -16,7 +16,7 @@ import { DocumentType } from './document-type.model.js';
|
|
|
16
16
|
export class Document extends Entity {
|
|
17
17
|
fileId;
|
|
18
18
|
typeId;
|
|
19
|
-
|
|
19
|
+
title;
|
|
20
20
|
date;
|
|
21
21
|
expiration;
|
|
22
22
|
}
|
|
@@ -33,7 +33,7 @@ __decorate([
|
|
|
33
33
|
__decorate([
|
|
34
34
|
StringProperty({ nullable: true }),
|
|
35
35
|
__metadata("design:type", Object)
|
|
36
|
-
], Document.prototype, "
|
|
36
|
+
], Document.prototype, "title", void 0);
|
|
37
37
|
__decorate([
|
|
38
38
|
NumericDate({ nullable: true }),
|
|
39
39
|
__metadata("design:type", Object)
|
|
@@ -3,58 +3,58 @@ export declare const metadataParameterSchema: import("../../../schema/index.js")
|
|
|
3
3
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
4
4
|
}>>;
|
|
5
5
|
export declare const metadataParameterObjectSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
6
|
-
|
|
6
|
+
metadata?: Partial<{
|
|
7
7
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
8
8
|
}> | undefined;
|
|
9
9
|
}>;
|
|
10
10
|
export declare const setDocumentPropertyParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
11
11
|
documentId: import("../../../orm/schemas/uuid.js").Uuid;
|
|
12
12
|
propertyId: import("../../../orm/schemas/uuid.js").Uuid;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
value: unknown;
|
|
14
|
+
metadata?: Partial<{
|
|
15
15
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
16
16
|
}> | undefined;
|
|
17
17
|
}>;
|
|
18
18
|
export declare const createDocumentParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
19
19
|
date: import("../../../orm/schemas/numeric-date.js").NumericDate | null;
|
|
20
|
+
title: string | null;
|
|
20
21
|
expiration: import("../../../orm/schemas/numeric-date.js").NumericDate | null;
|
|
21
22
|
typeId: import("../../../orm/schemas/uuid.js").Uuid | null;
|
|
22
|
-
addition: string | null;
|
|
23
23
|
originalFileName: string | null;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
collectionIds: string | string[];
|
|
25
|
+
properties?: {
|
|
26
|
+
value: unknown;
|
|
27
|
+
metadata?: Partial<{
|
|
28
28
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
29
29
|
}> | undefined;
|
|
30
30
|
propertyId: import("../../../orm/schemas/uuid.js").Uuid;
|
|
31
31
|
}[] | undefined;
|
|
32
|
-
|
|
32
|
+
metadata?: Partial<{
|
|
33
33
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
34
34
|
}> | undefined;
|
|
35
35
|
}>;
|
|
36
36
|
export declare const updateDocumentParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
37
37
|
id: import("../../../orm/types.js").IsPrimaryKey<import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/uuid.js").Uuid>>;
|
|
38
38
|
date?: import("../../../orm/types.js").NumericDate | null | undefined;
|
|
39
|
+
title?: string | null | undefined;
|
|
39
40
|
expiration?: import("../../../orm/types.js").NumericDate | null | undefined;
|
|
40
41
|
fileId?: import("../../../orm/types.js").Uuid | undefined;
|
|
41
42
|
typeId?: import("../../../orm/types.js").Uuid | null | undefined;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
readonly metadata?: Partial<{
|
|
43
|
+
properties?: {
|
|
44
|
+
value: unknown;
|
|
45
|
+
metadata?: Partial<{
|
|
46
46
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
47
47
|
}> | undefined;
|
|
48
48
|
propertyId: import("../../../orm/schemas/uuid.js").Uuid;
|
|
49
49
|
}[] | undefined;
|
|
50
|
-
|
|
50
|
+
metadata?: Partial<{
|
|
51
51
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
52
52
|
}> | undefined;
|
|
53
53
|
}>;
|
|
54
54
|
export declare const createDocumentRequestsTemplateParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
55
55
|
description: string | null;
|
|
56
56
|
label: string;
|
|
57
|
-
|
|
57
|
+
metadata?: Partial<{
|
|
58
58
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
59
59
|
}> | undefined;
|
|
60
60
|
}>;
|
|
@@ -62,20 +62,20 @@ export declare const updateDocumentRequestsTemplateParametersSchema: import("../
|
|
|
62
62
|
id: import("../../../orm/types.js").IsPrimaryKey<import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/uuid.js").Uuid>>;
|
|
63
63
|
description?: string | null | undefined;
|
|
64
64
|
label?: string | undefined;
|
|
65
|
-
|
|
65
|
+
metadata?: Partial<{
|
|
66
66
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
67
67
|
}> | undefined;
|
|
68
68
|
}>;
|
|
69
69
|
export declare const applyDocumentRequestsTemplateParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
70
70
|
id: import("../../../orm/types.js").IsPrimaryKey<import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/uuid.js").Uuid>>;
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
collectionIds: string[];
|
|
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;
|
|
75
75
|
}>;
|
|
76
76
|
export declare const deleteDocumentRequestsTemplateParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
77
77
|
id: import("../../../orm/types.js").IsPrimaryKey<import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/uuid.js").Uuid>>;
|
|
78
|
-
|
|
78
|
+
metadata?: Partial<{
|
|
79
79
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
80
80
|
}> | undefined;
|
|
81
81
|
}>;
|
|
@@ -84,7 +84,7 @@ export declare const createDocumentRequestTemplateParametersSchema: import("../.
|
|
|
84
84
|
typeId: import("../../../orm/schemas/uuid.js").Uuid | null;
|
|
85
85
|
requiredFilesCount: number;
|
|
86
86
|
requestsTemplateId: import("../../../orm/schemas/uuid.js").Uuid;
|
|
87
|
-
|
|
87
|
+
metadata?: Partial<{
|
|
88
88
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
89
89
|
}> | undefined;
|
|
90
90
|
}>;
|
|
@@ -93,13 +93,13 @@ export declare const updateDocumentRequestTemplateParametersSchema: import("../.
|
|
|
93
93
|
comment?: string | null | undefined;
|
|
94
94
|
typeId?: import("../../../orm/types.js").Uuid | null | undefined;
|
|
95
95
|
requiredFilesCount?: number | undefined;
|
|
96
|
-
|
|
96
|
+
metadata?: Partial<{
|
|
97
97
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
98
98
|
}> | undefined;
|
|
99
99
|
}>;
|
|
100
100
|
export declare const deleteDocumentRequestTemplateParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
101
101
|
id: import("../../../orm/types.js").IsPrimaryKey<import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/uuid.js").Uuid>>;
|
|
102
|
-
|
|
102
|
+
metadata?: Partial<{
|
|
103
103
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
104
104
|
}> | undefined;
|
|
105
105
|
}>;
|
|
@@ -107,8 +107,8 @@ export declare const createDocumentRequestParametersSchema: import("../../../sch
|
|
|
107
107
|
comment: string | null;
|
|
108
108
|
typeId: import("../../../orm/schemas/uuid.js").Uuid | null;
|
|
109
109
|
requiredFilesCount: number;
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
collectionIds: string[];
|
|
111
|
+
metadata?: Partial<{
|
|
112
112
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
113
113
|
}> | undefined;
|
|
114
114
|
}>;
|
|
@@ -118,62 +118,62 @@ export declare const updateDocumentRequestParametersSchema: import("../../../sch
|
|
|
118
118
|
typeId?: import("../../../orm/types.js").Uuid | null | undefined;
|
|
119
119
|
requiredFilesCount?: number | undefined;
|
|
120
120
|
completed?: boolean | undefined;
|
|
121
|
-
|
|
121
|
+
metadata?: Partial<{
|
|
122
122
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
123
123
|
}> | undefined;
|
|
124
124
|
}>;
|
|
125
125
|
export declare const deleteDocumentRequestParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
126
126
|
id: import("../../../orm/types.js").IsPrimaryKey<import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/uuid.js").Uuid>>;
|
|
127
|
-
|
|
127
|
+
metadata?: Partial<{
|
|
128
128
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
129
129
|
}> | undefined;
|
|
130
130
|
}>;
|
|
131
131
|
export declare const updateDocumentRequestFileParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
132
132
|
id: import("../../../orm/types.js").IsPrimaryKey<import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/uuid.js").Uuid>>;
|
|
133
|
-
|
|
133
|
+
title?: string | null | undefined;
|
|
134
134
|
approvalComment?: string | null | undefined;
|
|
135
135
|
approvalTimestamp?: import("../../../orm/types.js").Timestamp | null | undefined;
|
|
136
|
-
|
|
136
|
+
metadata?: Partial<{
|
|
137
137
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
138
138
|
}> | undefined;
|
|
139
139
|
}>;
|
|
140
140
|
export declare const deleteDocumentRequestFileParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
141
141
|
id: import("../../../orm/types.js").IsPrimaryKey<import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/uuid.js").Uuid>>;
|
|
142
|
-
|
|
142
|
+
metadata?: Partial<{
|
|
143
143
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
144
144
|
}> | undefined;
|
|
145
145
|
}>;
|
|
146
146
|
export declare const loadDataCollectionMetadataParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
name?: string | null | undefined;
|
|
148
|
+
group?: string | null | undefined;
|
|
149
149
|
}>;
|
|
150
150
|
export declare const loadDataCollectionsMetadataParametersSchema: import("../../../schema/index.js").ObjectSchema<Partial<import("../../../schema/index.js").Record<string, {
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
name?: string | null | undefined;
|
|
152
|
+
group?: string | null | undefined;
|
|
153
153
|
}>>>;
|
|
154
154
|
export declare const loadDataParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
collectionIds: string | string[];
|
|
156
|
+
collectionsMetadata: Partial<import("../../../schema/index.js").Record<string, {
|
|
157
|
+
name?: string | null | undefined;
|
|
158
|
+
group?: string | null | undefined;
|
|
159
159
|
}>>;
|
|
160
160
|
}>;
|
|
161
161
|
export declare const createCollectionParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
162
|
-
|
|
162
|
+
metadata?: Partial<{
|
|
163
163
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
164
164
|
}> | undefined;
|
|
165
165
|
}>;
|
|
166
166
|
export declare const setDocumentPropertiesParametersSchema: import("../../../schema/index.js").ArraySchema<{
|
|
167
167
|
documentId: import("../../../orm/schemas/uuid.js").Uuid;
|
|
168
168
|
propertyId: import("../../../orm/schemas/uuid.js").Uuid;
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
value: unknown;
|
|
170
|
+
metadata?: Partial<{
|
|
171
171
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
172
172
|
}> | undefined;
|
|
173
173
|
}>;
|
|
174
174
|
export declare const createDocumentCategoryParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
175
175
|
label: string;
|
|
176
|
-
|
|
176
|
+
metadata?: Partial<{
|
|
177
177
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
178
178
|
}> | undefined;
|
|
179
179
|
}>;
|
|
@@ -181,53 +181,53 @@ export declare const createDocumentTypeParametersSchema: import("../../../schema
|
|
|
181
181
|
group: string | null;
|
|
182
182
|
label: string;
|
|
183
183
|
categoryId: import("../../../orm/schemas/uuid.js").Uuid;
|
|
184
|
-
|
|
184
|
+
metadata?: Partial<{
|
|
185
185
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
186
186
|
}> | undefined;
|
|
187
187
|
}>;
|
|
188
188
|
export declare const createDocumentRequestFileParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
requestId: string;
|
|
190
|
+
title: string | null;
|
|
191
191
|
originalFileName: string | null;
|
|
192
|
-
|
|
192
|
+
metadata?: Partial<{
|
|
193
193
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
194
194
|
}> | undefined;
|
|
195
195
|
}>;
|
|
196
196
|
export declare const approveDocumentRequestFileParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
197
197
|
id: import("../../../orm/types.js").IsPrimaryKey<import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/uuid.js").Uuid>>;
|
|
198
198
|
approvalComment: string | null;
|
|
199
|
-
|
|
199
|
+
documentMetadata?: Partial<{
|
|
200
200
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
201
201
|
}> | undefined;
|
|
202
|
-
|
|
202
|
+
requestFileMetadata?: Partial<{
|
|
203
203
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
204
204
|
}> | undefined;
|
|
205
205
|
}>;
|
|
206
206
|
export declare const rejectDocumentRequestFileParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
207
207
|
id: import("../../../orm/types.js").IsPrimaryKey<import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/uuid.js").Uuid>>;
|
|
208
208
|
approvalComment: string | null;
|
|
209
|
-
|
|
209
|
+
metadata?: Partial<{
|
|
210
210
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
211
211
|
}> | undefined;
|
|
212
212
|
}>;
|
|
213
213
|
export declare const createDocumentPropertyParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
214
214
|
label: string;
|
|
215
215
|
dataType: import("../document-property.model.js").DocumentPropertyDataType;
|
|
216
|
-
|
|
216
|
+
metadata?: Partial<{
|
|
217
217
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
218
218
|
}> | undefined;
|
|
219
219
|
}>;
|
|
220
220
|
export declare const assignPropertyToTypeParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
221
221
|
typeId: import("../../../orm/schemas/uuid.js").Uuid;
|
|
222
222
|
propertyId: import("../../../orm/schemas/uuid.js").Uuid;
|
|
223
|
-
|
|
223
|
+
metadata?: Partial<{
|
|
224
224
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
225
225
|
}> | undefined;
|
|
226
226
|
}>;
|
|
227
227
|
export declare const addOrArchiveDocumentToOrFromCollectionParametersSchema: import("../../../schema/index.js").ObjectSchema<{
|
|
228
228
|
collectionId: import("../../../orm/schemas/uuid.js").Uuid;
|
|
229
229
|
documentId: import("../../../orm/schemas/uuid.js").Uuid;
|
|
230
|
-
|
|
230
|
+
metadata?: Partial<{
|
|
231
231
|
attributes: import("../../../orm/types.js").HasDefault<import("../../../orm/schemas/json.js").Json<import("../../../orm/entity.js").EntityMetadataAttributes>>;
|
|
232
232
|
}> | undefined;
|
|
233
233
|
}>;
|
|
@@ -15,7 +15,7 @@ import { Document } from '../document.model.js';
|
|
|
15
15
|
export const metadataParameterSchema = optional(partial(pick(EntityMetadata, 'attributes')));
|
|
16
16
|
export const metadataParameterObjectSchema = object({ metadata: metadataParameterSchema });
|
|
17
17
|
export const setDocumentPropertyParametersSchema = assign(pick(DocumentPropertyValueBase, ['documentId', 'propertyId']), object({ value: unknown() }), metadataParameterObjectSchema);
|
|
18
|
-
export const createDocumentParametersSchema = assign(pick(Document, ['typeId', '
|
|
18
|
+
export const createDocumentParametersSchema = assign(pick(Document, ['typeId', 'title', 'date', 'expiration']), pick(DocumentFile, ['originalFileName']), object({
|
|
19
19
|
collectionIds: oneOrMany(string()),
|
|
20
20
|
properties: optional(array(omit(setDocumentPropertyParametersSchema, ['documentId'])))
|
|
21
21
|
}), metadataParameterObjectSchema);
|
|
@@ -39,7 +39,7 @@ export const createCollectionParametersSchema = metadataParameterObjectSchema;
|
|
|
39
39
|
export const setDocumentPropertiesParametersSchema = array(setDocumentPropertyParametersSchema);
|
|
40
40
|
export const createDocumentCategoryParametersSchema = assign(pick(DocumentCategory, ['label']), metadataParameterObjectSchema);
|
|
41
41
|
export const createDocumentTypeParametersSchema = assign(pick(DocumentType, ['categoryId', 'group', 'label']), metadataParameterObjectSchema);
|
|
42
|
-
export const createDocumentRequestFileParametersSchema = assign(object({ requestId: string() }), pick(DocumentRequestFile, ['
|
|
42
|
+
export const createDocumentRequestFileParametersSchema = assign(object({ requestId: string() }), pick(DocumentRequestFile, ['title']), pick(DocumentFile, ['originalFileName']), metadataParameterObjectSchema);
|
|
43
43
|
export const approveDocumentRequestFileParametersSchema = assign(pick(DocumentRequestFile, ['id', 'approvalComment']), object({
|
|
44
44
|
documentMetadata: metadataParameterSchema,
|
|
45
45
|
requestFileMetadata: metadataParameterSchema
|
package/document-management/server/drizzle/{0000_sloppy_fenris.sql → 0000_useful_overlord.sql}
RENAMED
|
@@ -3,7 +3,7 @@ CREATE TABLE "document_management"."document" (
|
|
|
3
3
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
4
4
|
"file_id" uuid NOT NULL,
|
|
5
5
|
"type_id" uuid,
|
|
6
|
-
"
|
|
6
|
+
"title" text,
|
|
7
7
|
"date" date,
|
|
8
8
|
"expiration" date,
|
|
9
9
|
"revision" integer NOT NULL,
|
|
@@ -144,7 +144,7 @@ CREATE TABLE "document_management"."document_request_file" (
|
|
|
144
144
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
145
145
|
"request_id" uuid NOT NULL,
|
|
146
146
|
"file_id" uuid NOT NULL,
|
|
147
|
-
"
|
|
147
|
+
"title" text,
|
|
148
148
|
"created_document_id" uuid,
|
|
149
149
|
"approval" boolean,
|
|
150
150
|
"approval_comment" text,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
2
|
+
"id": "5bbb423e-43f3-4595-912c-b8bb87b136d8",
|
|
3
3
|
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
4
4
|
"version": "7",
|
|
5
5
|
"dialect": "postgresql",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"primaryKey": false,
|
|
28
28
|
"notNull": false
|
|
29
29
|
},
|
|
30
|
-
"
|
|
31
|
-
"name": "
|
|
30
|
+
"title": {
|
|
31
|
+
"name": "title",
|
|
32
32
|
"type": "text",
|
|
33
33
|
"primaryKey": false,
|
|
34
34
|
"notNull": false
|
|
@@ -1056,8 +1056,8 @@
|
|
|
1056
1056
|
"primaryKey": false,
|
|
1057
1057
|
"notNull": true
|
|
1058
1058
|
},
|
|
1059
|
-
"
|
|
1060
|
-
"name": "
|
|
1059
|
+
"title": {
|
|
1060
|
+
"name": "title",
|
|
1061
1061
|
"type": "text",
|
|
1062
1062
|
"primaryKey": false,
|
|
1063
1063
|
"notNull": false
|
|
@@ -3,7 +3,7 @@ import { defineConfig } from 'drizzle-kit';
|
|
|
3
3
|
export default defineConfig({
|
|
4
4
|
dialect: 'postgresql',
|
|
5
5
|
out: relative('./', resolve(__dirname, './drizzle/').replace('dist', 'source')),
|
|
6
|
-
schema: resolve(__dirname, '
|
|
6
|
+
schema: resolve(__dirname, './schemas.js'),
|
|
7
7
|
migrations: {
|
|
8
8
|
schema: 'document_management',
|
|
9
9
|
table: '_migrations'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import './schemas.js';
|
|
2
2
|
import { type InjectionToken } from '../../injector/index.js';
|
|
3
3
|
import type { DatabaseConfig } from '../../orm/server/module.js';
|
|
4
4
|
import { DocumentManagementService } from './services/document-management.service.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DocumentCategory } from '../models/document-category.model.js';
|
|
2
|
+
import { DocumentCollectionDocument } from '../models/document-collection-document.model.js';
|
|
3
|
+
import { DocumentCollection } from '../models/document-collection.model.js';
|
|
4
|
+
import { DocumentFile } from '../models/document-file.model.js';
|
|
5
|
+
import { DocumentPropertyBooleanValue, DocumentPropertyDecimalValue, DocumentPropertyIntegerValue, DocumentPropertyTextValue } from '../models/document-property-value.model.js';
|
|
6
|
+
import { DocumentProperty } from '../models/document-property.model.js';
|
|
7
|
+
import { DocumentRequestCollection } from '../models/document-request-collection.model.js';
|
|
8
|
+
import { DocumentRequestFile } from '../models/document-request-file.model.js';
|
|
9
|
+
import { DocumentRequestTemplate } from '../models/document-request-template.js';
|
|
10
|
+
import { DocumentRequest } from '../models/document-request.model.js';
|
|
11
|
+
import { DocumentRequestsTemplate } from '../models/document-requests-template.js';
|
|
12
|
+
import { DocumentTypeProperty } from '../models/document-type-property.model.js';
|
|
13
|
+
import { DocumentType } from '../models/document-type.model.js';
|
|
14
|
+
import { Document } from '../models/document.model.js';
|
|
15
|
+
export declare const documentManagementSchema: import("../../orm/server/database-schema.js").DatabaseSchema<"document_management">;
|
|
16
|
+
export declare const dataType: import("drizzle-orm/pg-core").PgEnum<["boolean", "decimal", "text", "integer"]>;
|
|
17
|
+
export declare const documentCategory: import("../../orm/server/types.js").PgTableFromType<typeof DocumentCategory, "document_management">;
|
|
18
|
+
export declare const documentCollectionDocument: import("../../orm/server/types.js").PgTableFromType<typeof DocumentCollectionDocument, "document_management">;
|
|
19
|
+
export declare const documentCollection: import("../../orm/server/types.js").PgTableFromType<typeof DocumentCollection, "document_management">;
|
|
20
|
+
export declare const documentFile: import("../../orm/server/types.js").PgTableFromType<typeof DocumentFile, "document_management">;
|
|
21
|
+
export declare const documentPropertyTextValue: import("../../orm/server/types.js").PgTableFromType<typeof DocumentPropertyTextValue, "document_management">;
|
|
22
|
+
export declare const documentPropertyIntegerValue: import("../../orm/server/types.js").PgTableFromType<typeof DocumentPropertyIntegerValue, "document_management">;
|
|
23
|
+
export declare const documentPropertyDecimalValue: import("../../orm/server/types.js").PgTableFromType<typeof DocumentPropertyDecimalValue, "document_management">;
|
|
24
|
+
export declare const documentPropertyBooleanValue: import("../../orm/server/types.js").PgTableFromType<typeof DocumentPropertyBooleanValue, "document_management">;
|
|
25
|
+
export declare const documentProperty: import("../../orm/server/types.js").PgTableFromType<typeof DocumentProperty, "document_management">;
|
|
26
|
+
export declare const documentRequestCollection: import("../../orm/server/types.js").PgTableFromType<typeof DocumentRequestCollection, "document_management">;
|
|
27
|
+
export declare const documentRequestFile: import("../../orm/server/types.js").PgTableFromType<typeof DocumentRequestFile, "document_management">;
|
|
28
|
+
export declare const documentRequestTemplate: import("../../orm/server/types.js").PgTableFromType<typeof DocumentRequestTemplate, "document_management">;
|
|
29
|
+
export declare const documentRequest: import("../../orm/server/types.js").PgTableFromType<typeof DocumentRequest, "document_management">;
|
|
30
|
+
export declare const documentRequestsTemplate: import("../../orm/server/types.js").PgTableFromType<typeof DocumentRequestsTemplate, "document_management">;
|
|
31
|
+
export declare const documentTypeProperty: import("../../orm/server/types.js").PgTableFromType<typeof DocumentTypeProperty, "document_management">;
|
|
32
|
+
export declare const documentType: import("../../orm/server/types.js").PgTableFromType<typeof DocumentType, "document_management">;
|
|
33
|
+
export declare const document: import("../../orm/server/types.js").PgTableFromType<typeof Document, "document_management">;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { databaseSchema } from '../../orm/server/database-schema.js';
|
|
2
|
-
import { DocumentCategory } from '
|
|
3
|
-
import { DocumentCollectionDocument } from '
|
|
4
|
-
import { DocumentCollection } from '
|
|
5
|
-
import { DocumentFile } from '
|
|
6
|
-
import { DocumentPropertyBooleanValue, DocumentPropertyDecimalValue, DocumentPropertyIntegerValue, DocumentPropertyTextValue } from '
|
|
7
|
-
import { DocumentProperty, DocumentPropertyDataType } from '
|
|
8
|
-
import { DocumentRequestCollection } from '
|
|
9
|
-
import { DocumentRequestFile } from '
|
|
10
|
-
import { DocumentRequestTemplate } from '
|
|
11
|
-
import { DocumentRequest } from '
|
|
12
|
-
import { DocumentRequestsTemplate } from '
|
|
13
|
-
import { DocumentTypeProperty } from '
|
|
14
|
-
import { DocumentType } from '
|
|
15
|
-
import { Document } from '
|
|
2
|
+
import { DocumentCategory } from '../models/document-category.model.js';
|
|
3
|
+
import { DocumentCollectionDocument } from '../models/document-collection-document.model.js';
|
|
4
|
+
import { DocumentCollection } from '../models/document-collection.model.js';
|
|
5
|
+
import { DocumentFile } from '../models/document-file.model.js';
|
|
6
|
+
import { DocumentPropertyBooleanValue, DocumentPropertyDecimalValue, DocumentPropertyIntegerValue, DocumentPropertyTextValue } from '../models/document-property-value.model.js';
|
|
7
|
+
import { DocumentProperty, DocumentPropertyDataType } from '../models/document-property.model.js';
|
|
8
|
+
import { DocumentRequestCollection } from '../models/document-request-collection.model.js';
|
|
9
|
+
import { DocumentRequestFile } from '../models/document-request-file.model.js';
|
|
10
|
+
import { DocumentRequestTemplate } from '../models/document-request-template.js';
|
|
11
|
+
import { DocumentRequest } from '../models/document-request.model.js';
|
|
12
|
+
import { DocumentRequestsTemplate } from '../models/document-requests-template.js';
|
|
13
|
+
import { DocumentTypeProperty } from '../models/document-type-property.model.js';
|
|
14
|
+
import { DocumentType } from '../models/document-type.model.js';
|
|
15
|
+
import { Document } from '../models/document.model.js';
|
|
16
16
|
export const documentManagementSchema = databaseSchema('document_management');
|
|
17
17
|
export const dataType = documentManagementSchema.getEnum(DocumentPropertyDataType, 'DocumentPropertyDataType');
|
|
18
18
|
export const documentCategory = documentManagementSchema.getTable(DocumentCategory);
|
|
@@ -6,7 +6,20 @@ import type { OneOrMany } from '../../../types.js';
|
|
|
6
6
|
import { type AddOrArchiveDocumentToOrFromCollectionParameters, type ApplyDocumentRequestsTemplateParameters, type ApproveDocumentRequestFileParameters, type AssignPropertyToTypeParameters, type CategoryAndTypesView, type CreateCollectionParameters, type CreateDocumentCategoryParameters, type CreateDocumentParameters, type CreateDocumentPropertyParameters, type CreateDocumentRequestFileParameters, type CreateDocumentRequestParameters, type CreateDocumentRequestTemplateParameters, type CreateDocumentRequestsTemplateParameters, type CreateDocumentTypeParameters, type DeleteDocumentRequestFileParameters, type DeleteDocumentRequestParameters, type DeleteDocumentRequestTemplateParameters, type DeleteDocumentRequestsTemplateParameters, Document, DocumentCategory, DocumentCollection, DocumentCollectionDocument, DocumentFile, type DocumentManagementData, DocumentProperty, DocumentPropertyBooleanValue, DocumentPropertyDataType, DocumentPropertyDecimalValue, DocumentPropertyIntegerValue, DocumentPropertyTextValue, DocumentRequest, DocumentRequestCollection, DocumentRequestFile, DocumentRequestTemplate, DocumentRequestsTemplate, type DocumentRequestsTemplateData, DocumentType, DocumentTypeProperty, type LoadDataCollectionsMetadataParameters, type RejectDocumentRequestFileParameters, type RequestFilesStats, type SetDocumentPropertiesParameters, type UpdateDocumentParameters, type UpdateDocumentRequestFileParameters, type UpdateDocumentRequestParameters, type UpdateDocumentRequestTemplateParameters, type UpdateDocumentRequestsTemplateParameters } from '../../models/index.js';
|
|
7
7
|
import { DocumentManagementConfig } from '../module.js';
|
|
8
8
|
export type DocumentServiceArgument = DocumentManagementConfig;
|
|
9
|
+
export type DocumentInformationExtractionResult = {
|
|
10
|
+
title: string;
|
|
11
|
+
subtitle: string | null;
|
|
12
|
+
types: DocumentType[];
|
|
13
|
+
summary: string;
|
|
14
|
+
tags: string[];
|
|
15
|
+
date: {
|
|
16
|
+
year: number;
|
|
17
|
+
month: number;
|
|
18
|
+
day: number;
|
|
19
|
+
} | null;
|
|
20
|
+
};
|
|
9
21
|
export declare class DocumentManagementService implements Resolvable<DocumentServiceArgument> {
|
|
22
|
+
#private;
|
|
10
23
|
protected readonly documentService: import("../../../orm/server/index.js").EntityRepository<Document>;
|
|
11
24
|
protected readonly documentFileService: import("../../../orm/server/index.js").EntityRepository<DocumentFile>;
|
|
12
25
|
protected readonly documentCollectionService: import("../../../orm/server/index.js").EntityRepository<DocumentCollection>;
|
|
@@ -45,13 +58,13 @@ export declare class DocumentManagementService implements Resolvable<DocumentSer
|
|
|
45
58
|
createDocumentRequestTemplate(parameters: CreateDocumentRequestTemplateParameters): Promise<DocumentRequestTemplate>;
|
|
46
59
|
updateDocumentRequestTemplate({ id, typeId, requiredFilesCount, comment, metadata }: UpdateDocumentRequestTemplateParameters): Promise<DocumentRequestTemplate>;
|
|
47
60
|
deleteDocumentRequestTemplate(parameters: DeleteDocumentRequestTemplateParameters): Promise<DocumentRequestTemplate>;
|
|
48
|
-
createDocument({ typeId,
|
|
61
|
+
createDocument({ typeId, title, date, expiration, originalFileName, collectionIds, properties, metadata }: CreateDocumentParameters, content: Uint8Array | ReadableStream<Uint8Array>): Promise<Document>;
|
|
49
62
|
approveDocumentRequestFile({ id, approvalComment, documentMetadata, requestFileMetadata }: ApproveDocumentRequestFileParameters): Promise<Document>;
|
|
50
63
|
rejectDocumentRequestFile({ id, approvalComment, metadata }: RejectDocumentRequestFileParameters): Promise<void>;
|
|
51
|
-
updateDocumentRequestFile({ id,
|
|
64
|
+
updateDocumentRequestFile({ id, title, approvalComment, metadata }: UpdateDocumentRequestFileParameters): Promise<DocumentRequestFile>;
|
|
52
65
|
deleteDocumentRequestFile({ id, metadata }: DeleteDocumentRequestFileParameters): Promise<void>;
|
|
53
66
|
createDocumentFile(content: Uint8Array | ReadableStream<Uint8Array>, originalFileName: string | null, dbTransaction?: Transaction): Promise<DocumentFile>;
|
|
54
|
-
createDocumentRequestFile({ requestId,
|
|
67
|
+
createDocumentRequestFile({ requestId, title, originalFileName, metadata }: CreateDocumentRequestFileParameters, content: Uint8Array | ReadableStream<Uint8Array>): Promise<DocumentRequestFile>;
|
|
55
68
|
createDocumentRequest(parameters: CreateDocumentRequestParameters, transaction?: Transaction): Promise<DocumentRequest>;
|
|
56
69
|
updateDocument(parameters: UpdateDocumentParameters, transaction?: Transaction): Promise<void>;
|
|
57
70
|
updateDocumentRequest(parameters: UpdateDocumentRequestParameters, transaction?: Transaction): Promise<void>;
|
|
@@ -61,6 +74,7 @@ export declare class DocumentManagementService implements Resolvable<DocumentSer
|
|
|
61
74
|
archiveDocument({ collectionId, documentId, metadata }: AddOrArchiveDocumentToOrFromCollectionParameters): Promise<void>;
|
|
62
75
|
createProperty(parameters: CreateDocumentPropertyParameters): Promise<DocumentProperty>;
|
|
63
76
|
assignPropertyToType(parameters: AssignPropertyToTypeParameters): Promise<void>;
|
|
77
|
+
protected extractDocumentInformation(): Promise<DocumentInformationExtractionResult>;
|
|
64
78
|
protected getDocumentPropertyValueService(dataType: DocumentPropertyDataType): import("../../../orm/server/index.js").EntityRepository<DocumentPropertyTextValue> | import("../../../orm/server/index.js").EntityRepository<DocumentPropertyIntegerValue> | import("../../../orm/server/index.js").EntityRepository<DocumentPropertyBooleanValue>;
|
|
65
79
|
protected getDocumentFileContentObjectUrl(title: string, file: DocumentFile, download: boolean): Promise<string>;
|
|
66
80
|
}
|