@tstdl/base 0.92.138 → 0.92.140
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.js +1 -1
- package/css/css-variables.d.ts +14 -0
- package/css/css-variables.js +55 -0
- package/css/index.d.ts +1 -0
- package/css/index.js +1 -0
- package/document-management/api/document-management.api.d.ts +59 -0
- package/document-management/api/document-management.api.js +28 -0
- package/document-management/server/api/document-management.api.d.ts +4 -1
- package/document-management/server/api/document-management.api.js +61 -28
- package/document-management/server/configure.d.ts +2 -0
- package/document-management/server/configure.js +9 -0
- package/document-management/server/drizzle/{0000_magical_madame_hydra.sql → 0000_moaning_luckman.sql} +4 -15
- package/document-management/server/drizzle/meta/0000_snapshot.json +25 -96
- package/document-management/server/drizzle/meta/_journal.json +2 -2
- package/document-management/server/index.d.ts +1 -0
- package/document-management/server/index.js +1 -0
- package/document-management/server/module.d.ts +3 -2
- package/document-management/server/module.js +2 -6
- package/document-management/server/services/document-category-type.service.d.ts +0 -1
- package/document-management/server/services/document-category-type.service.js +7 -7
- package/document-management/server/services/document-file.service.js +2 -2
- package/document-management/server/services/document-management-ai.service.js +5 -1
- package/document-management/server/services/document-management-ancillary.service.d.ts +2 -83
- package/document-management/server/services/document-management-ancillary.service.js +1 -23
- package/document-management/server/services/document-management-authorization.service.d.ts +85 -0
- package/document-management/server/services/document-management-authorization.service.js +28 -0
- package/document-management/server/services/document-management.service.d.ts +10 -2
- package/document-management/server/services/document-management.service.js +69 -6
- package/document-management/server/services/document-property.service.d.ts +7 -3
- package/document-management/server/services/document-property.service.js +8 -4
- package/document-management/server/services/document-workflow.service.js +2 -2
- package/document-management/server/services/enum-type-key.d.ts +1 -0
- package/document-management/server/services/enum-type-key.js +1 -0
- package/document-management/server/services/index.d.ts +1 -0
- package/document-management/server/services/index.js +1 -0
- package/document-management/service-models/enriched/enriched-document-category.view.d.ts +1 -0
- package/document-management/service-models/enriched/enriched-document-category.view.js +8 -0
- package/document-management/service-models/enriched/enriched-document.view.d.ts +3 -1
- package/document-management/service-models/enriched/enriched-document.view.js +2 -0
- package/examples/api/streaming.js +8 -8
- package/examples/document-management/categories-and-types.d.ts +357 -312
- package/examples/document-management/categories-and-types.js +690 -350
- package/examples/document-management/main.d.ts +18 -16
- package/examples/document-management/main.js +29 -20
- package/file/mime-type.d.ts +2 -1
- package/file/mime-type.js +10 -18
- package/file/mime-types.js +1 -2
- package/http/server/http-server-response.js +2 -2
- package/package.json +5 -3
- package/schema/converters/openapi-converter.js +15 -12
- package/sse/server-sent-events-source.js +2 -2
- package/utils/object/object.js +1 -1
|
@@ -89,8 +89,8 @@ let DocumentWorkflowService = DocumentWorkflowService_1 = class DocumentWorkflow
|
|
|
89
89
|
await this.repository.update(id, { state, failReason });
|
|
90
90
|
}
|
|
91
91
|
async processWorkflowJob(job) {
|
|
92
|
-
this.#logger.verbose(`Processing workflow job for workflow "${job.data.workflowId}"`);
|
|
93
92
|
const workflow = await this.repository.load(job.data.workflowId);
|
|
93
|
+
this.#logger.verbose(`Processing workflow "${workflow.step}" for document "${workflow.documentId}"`);
|
|
94
94
|
try {
|
|
95
95
|
await this.setWorkflowState(workflow.id, DocumentWorkflowState.Running);
|
|
96
96
|
await match(workflow.step)
|
|
@@ -106,11 +106,11 @@ let DocumentWorkflowService = DocumentWorkflowService_1 = class DocumentWorkflow
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
catch (error) {
|
|
109
|
-
this.#logger.error(error);
|
|
110
109
|
const isLastTry = job.tries == this.#queue.maxTries;
|
|
111
110
|
if (isLastTry) {
|
|
112
111
|
await this.repository.update(workflow.id, { state: DocumentWorkflowState.Error });
|
|
113
112
|
}
|
|
113
|
+
throw error;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
async processClassificationWorkflow(workflow) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const enumTypeKey = "enum-type";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const enumTypeKey = 'enum-type';
|
|
@@ -3,6 +3,7 @@ export * from './document-collection.service.js';
|
|
|
3
3
|
export * from './document-file.service.js';
|
|
4
4
|
export * from './document-management-ai.service.js';
|
|
5
5
|
export * from './document-management-ancillary.service.js';
|
|
6
|
+
export * from './document-management-authorization.service.js';
|
|
6
7
|
export * from './document-management.service.js';
|
|
7
8
|
export * from './document-property.service.js';
|
|
8
9
|
export * from './document-request.service.js';
|
|
@@ -3,6 +3,7 @@ export * from './document-collection.service.js';
|
|
|
3
3
|
export * from './document-file.service.js';
|
|
4
4
|
export * from './document-management-ai.service.js';
|
|
5
5
|
export * from './document-management-ancillary.service.js';
|
|
6
|
+
export * from './document-management-authorization.service.js';
|
|
6
7
|
export * from './document-management.service.js';
|
|
7
8
|
export * from './document-property.service.js';
|
|
8
9
|
export * from './document-request.service.js';
|
|
@@ -6,6 +6,7 @@ export declare class EnrichedDocumentCategory implements Pick<DocumentCategory,
|
|
|
6
6
|
readonly id: string;
|
|
7
7
|
readonly label: string;
|
|
8
8
|
readonly parent: EnrichedDocumentCategory | null;
|
|
9
|
+
get rootCategory(): EnrichedDocumentCategory;
|
|
9
10
|
get children(): EnrichedDocumentCategory[];
|
|
10
11
|
get childrenDeep(): EnrichedDocumentCategory[];
|
|
11
12
|
get types(): EnrichedDocumentType[];
|
|
@@ -14,6 +14,9 @@ export class EnrichedDocumentCategory {
|
|
|
14
14
|
id;
|
|
15
15
|
label;
|
|
16
16
|
parent;
|
|
17
|
+
get rootCategory() {
|
|
18
|
+
return (this.parent?.rootCategory ?? this);
|
|
19
|
+
}
|
|
17
20
|
get children() {
|
|
18
21
|
return this.#data.rawData.categories.filter((category) => category.parentId == this.id).map((category) => new EnrichedDocumentCategory(this.#data, category, this));
|
|
19
22
|
}
|
|
@@ -30,6 +33,11 @@ export class EnrichedDocumentCategory {
|
|
|
30
33
|
this.parent = parent;
|
|
31
34
|
}
|
|
32
35
|
}
|
|
36
|
+
__decorate([
|
|
37
|
+
Memoize(),
|
|
38
|
+
__metadata("design:type", EnrichedDocumentCategory),
|
|
39
|
+
__metadata("design:paramtypes", [])
|
|
40
|
+
], EnrichedDocumentCategory.prototype, "rootCategory", null);
|
|
33
41
|
__decorate([
|
|
34
42
|
Memoize(),
|
|
35
43
|
__metadata("design:type", Array),
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { EntityMetadata } from '../../../orm/entity.js';
|
|
1
2
|
import type { TypedOmit } from '../../../types.js';
|
|
2
3
|
import type { DocumentApproval, DocumentValidationExecution, DocumentWorkflow } from '../../models/index.js';
|
|
3
4
|
import type { DocumentPropertyValueView, DocumentView } from '../document-management.view-model.js';
|
|
4
5
|
import { EnrichedDocumentAssignment } from './enriched-document-assignment.view.js';
|
|
5
6
|
import type { EnrichedDocumentManagementData } from './enriched-document-management-data.view.js';
|
|
6
7
|
import type { EnrichedDocumentType } from './enriched-document-type.view.js';
|
|
7
|
-
export declare class EnrichedDocument implements TypedOmit<DocumentView, 'typeId' | 'assignment' | 'createUserId'
|
|
8
|
+
export declare class EnrichedDocument implements TypedOmit<DocumentView, 'typeId' | 'assignment' | 'createUserId'> {
|
|
8
9
|
#private;
|
|
9
10
|
readonly id: string;
|
|
10
11
|
readonly title: string | null;
|
|
@@ -22,6 +23,7 @@ export declare class EnrichedDocument implements TypedOmit<DocumentView, 'typeId
|
|
|
22
23
|
readonly properties: DocumentPropertyValueView[];
|
|
23
24
|
readonly currentWorkflow: DocumentWorkflow | null;
|
|
24
25
|
readonly validations: DocumentValidationExecution[] | null;
|
|
26
|
+
readonly metadata: EntityMetadata;
|
|
25
27
|
get type(): EnrichedDocumentType | null;
|
|
26
28
|
get assignments(): EnrichedDocumentAssignment;
|
|
27
29
|
constructor(data: EnrichedDocumentManagementData, document: DocumentView);
|
|
@@ -29,6 +29,7 @@ export class EnrichedDocument {
|
|
|
29
29
|
properties;
|
|
30
30
|
currentWorkflow;
|
|
31
31
|
validations;
|
|
32
|
+
metadata;
|
|
32
33
|
get type() {
|
|
33
34
|
if (isNull(this.#documentView.typeId)) {
|
|
34
35
|
return null;
|
|
@@ -57,6 +58,7 @@ export class EnrichedDocument {
|
|
|
57
58
|
this.properties = document.properties;
|
|
58
59
|
this.currentWorkflow = document.currentWorkflow;
|
|
59
60
|
this.validations = document.validations;
|
|
61
|
+
this.metadata = document.metadata;
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
__decorate([
|
|
@@ -34,7 +34,7 @@ const streamingApiDefinition = defineApi({
|
|
|
34
34
|
method: 'POST',
|
|
35
35
|
resource: 'echo',
|
|
36
36
|
body: ReadableStream,
|
|
37
|
-
result: ReadableStream
|
|
37
|
+
result: ReadableStream,
|
|
38
38
|
},
|
|
39
39
|
events: {
|
|
40
40
|
method: 'GET',
|
|
@@ -42,21 +42,21 @@ const streamingApiDefinition = defineApi({
|
|
|
42
42
|
result: ServerSentEvents,
|
|
43
43
|
cors: {
|
|
44
44
|
accessControlAllowOrigin: '*',
|
|
45
|
-
accessControlAllowMethods: 'GET'
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
45
|
+
accessControlAllowMethods: 'GET',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
49
|
});
|
|
50
50
|
let StreamingApi = class StreamingApi {
|
|
51
51
|
echo({ request, body }) {
|
|
52
52
|
return HttpServerResponse.fromObject({
|
|
53
53
|
headers: {
|
|
54
54
|
'Content-Type': request.headers.contentType,
|
|
55
|
-
'Content-Length': request.headers.contentLength
|
|
55
|
+
'Content-Length': request.headers.contentLength,
|
|
56
56
|
},
|
|
57
57
|
body: {
|
|
58
|
-
stream: body
|
|
59
|
-
}
|
|
58
|
+
stream: body,
|
|
59
|
+
},
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
events(_data) {
|