@tstdl/base 0.93.125 → 0.93.126
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/genkit/tests/multi-region.test.js +6 -6
- package/ai/index.d.ts +2 -6
- package/ai/index.js +2 -6
- package/ai/parser/index.d.ts +1 -0
- package/ai/parser/index.js +1 -0
- package/ai/parser/parser.d.ts +12 -0
- package/ai/parser/parser.js +28 -0
- package/ai/prompts/build.d.ts +21 -0
- package/ai/prompts/build.js +25 -0
- package/ai/prompts/index.d.ts +2 -0
- package/ai/prompts/index.js +2 -0
- package/ai/prompts/instructions-formatter.d.ts +9 -22
- package/ai/prompts/instructions-formatter.js +20 -7
- package/ai/prompts/instructions.js +1 -1
- package/ai/prompts/steering.d.ts +27 -0
- package/ai/prompts/steering.js +54 -0
- package/ai/tests/instructions-formatter.test.js +115 -0
- package/ai/tests/steering.test.js +37 -0
- package/application/application.d.ts +2 -1
- package/application/application.js +3 -0
- package/authentication/client/module.d.ts +1 -1
- package/authentication/client/module.js +4 -5
- package/authentication/tests/authentication-ancillary.service.test.js +1 -1
- package/authentication/tests/authentication.api-controller.test.js +3 -1
- package/authentication/tests/authentication.api-request-token.provider.test.js +1 -1
- package/authentication/tests/authentication.client-service.test.js +1 -1
- package/authentication/tests/authentication.service.test.js +1 -1
- package/authentication/tests/subject.service.test.js +1 -1
- package/circuit-breaker/tests/circuit-breaker.test.js +1 -1
- package/document-management/api/document-management.api.d.ts +16 -16
- package/document-management/api/document-management.api.js +12 -12
- package/document-management/models/ai-configuration.d.ts +59 -0
- package/document-management/models/ai-configuration.js +1 -0
- package/document-management/models/document-assignment-scope.model.js +2 -4
- package/document-management/models/document-assignment-task.model.js +2 -4
- package/document-management/models/document-collection-assignment.model.js +2 -4
- package/document-management/models/document-collection.model.js +2 -3
- package/document-management/models/document-content.model.d.ts +6 -0
- package/document-management/models/document-content.model.js +32 -0
- package/document-management/models/document-property-value.model.js +1 -2
- package/document-management/models/document-request-collection-assignment.model.js +2 -4
- package/document-management/models/document-request.model.js +2 -4
- package/document-management/models/document-tag-assignment.model.js +2 -3
- package/document-management/models/document-validation-execution-related-document.model.js +2 -4
- package/document-management/models/document-validation-execution.model.js +2 -5
- package/document-management/models/document-workflow.model.d.ts +2 -1
- package/document-management/models/document-workflow.model.js +4 -5
- package/document-management/models/document.model.js +2 -3
- package/document-management/models/index.d.ts +2 -0
- package/document-management/models/index.js +2 -0
- package/document-management/server/api/document-management.api.d.ts +7 -7
- package/document-management/server/api/document-management.api.js +9 -9
- package/document-management/server/configure.d.ts +4 -1
- package/document-management/server/configure.js +9 -4
- package/document-management/server/drizzle/{0000_complex_black_bird.sql → 0000_curious_nighthawk.sql} +7 -27
- package/document-management/server/drizzle/meta/0000_snapshot.json +12 -284
- package/document-management/server/drizzle/meta/_journal.json +2 -2
- package/document-management/server/module.d.ts +2 -0
- package/document-management/server/module.js +1 -0
- package/document-management/server/schemas.d.ts +2 -1
- package/document-management/server/services/document-file.service.d.ts +6 -6
- package/document-management/server/services/document-file.service.js +7 -81
- package/document-management/server/services/document-management-ai-provider.service.d.ts +66 -0
- package/document-management/server/services/document-management-ai-provider.service.js +2 -0
- package/document-management/server/services/document-management-ai.service.d.ts +44 -7
- package/document-management/server/services/document-management-ai.service.js +332 -329
- package/document-management/server/services/document-validation.service.d.ts +1 -1
- package/document-management/server/services/document-workflow.service.d.ts +4 -3
- package/document-management/server/services/document-workflow.service.js +26 -9
- package/document-management/server/services/document.service.d.ts +7 -3
- package/document-management/server/services/document.service.js +13 -4
- package/document-management/server/services/index.d.ts +1 -0
- package/document-management/server/services/index.js +1 -0
- package/document-management/server/validators/ai-validation-executor.d.ts +419 -12
- package/document-management/server/validators/ai-validation-executor.js +51 -46
- package/document-management/server/validators/single-document-validation-executor.d.ts +1 -3
- package/document-management/server/validators/single-document-validation-executor.js +2 -4
- package/document-management/service-models/document.service-model.d.ts +3 -3
- package/document-management/service-models/document.service-model.js +1 -1
- package/document-management/tests/ai-config-hierarchy.test.d.ts +1 -0
- package/document-management/tests/ai-config-hierarchy.test.js +64 -0
- package/document-management/tests/ai-config-integration.test.d.ts +1 -0
- package/document-management/tests/ai-config-integration.test.js +125 -0
- package/document-management/tests/ai-config-merge.test.d.ts +1 -0
- package/document-management/tests/ai-config-merge.test.js +38 -0
- package/document-management/tests/document-management-ai-overrides.test.d.ts +1 -0
- package/document-management/tests/document-management-ai-overrides.test.js +64 -0
- package/document-management/tests/document-management-core.test.js +6 -6
- package/document-management/tests/document-management.api.test.js +5 -5
- package/document-management/tests/document-statistics.service.test.js +10 -6
- package/document-management/tests/document-validation-ai-overrides.test.d.ts +1 -0
- package/document-management/tests/document-validation-ai-overrides.test.js +85 -0
- package/document-management/tests/document.service.test.js +15 -11
- package/document-management/tests/enum-helpers.test.js +5 -5
- package/examples/document-management/ai-provider.d.ts +20 -0
- package/examples/document-management/ai-provider.js +74 -0
- package/examples/document-management/main.js +9 -6
- package/examples/injector/graph-example.d.ts +1 -0
- package/examples/injector/graph-example.js +340 -0
- package/injector/decorators.d.ts +4 -4
- package/injector/decorators.js +5 -6
- package/injector/forward-ref.d.ts +15 -0
- package/injector/forward-ref.js +20 -0
- package/injector/graph.d.ts +113 -0
- package/injector/graph.js +631 -0
- package/injector/index.d.ts +2 -0
- package/injector/index.js +2 -0
- package/injector/inject.d.ts +15 -15
- package/injector/injector.d.ts +101 -13
- package/injector/injector.js +103 -59
- package/injector/resolve-chain.d.ts +20 -6
- package/injector/resolve-chain.js +39 -14
- package/injector/tests/advanced.test.d.ts +1 -0
- package/injector/tests/advanced.test.js +116 -0
- package/injector/tests/async-init.test.d.ts +1 -0
- package/injector/tests/async-init.test.js +77 -0
- package/injector/tests/basic.test.d.ts +1 -0
- package/injector/tests/basic.test.js +114 -0
- package/injector/tests/hierarchical.test.d.ts +1 -0
- package/injector/tests/hierarchical.test.js +59 -0
- package/injector/tests/lifecycles.test.d.ts +1 -0
- package/injector/tests/lifecycles.test.js +109 -0
- package/injector/token.d.ts +2 -1
- package/injector/token.js +4 -1
- package/injector/type-info.d.ts +1 -5
- package/injector/types.d.ts +4 -10
- package/logger/tests/pretty-print.test.d.ts +1 -0
- package/logger/{formatters → tests}/pretty-print.test.js +1 -1
- package/logger/transports/console.d.ts +3 -2
- package/logger/transports/console.js +4 -3
- package/notification/tests/notification-api.test.js +8 -5
- package/notification/tests/notification-client.test.d.ts +1 -0
- package/notification/tests/{unit/notification-client.test.js → notification-client.test.js} +5 -5
- package/notification/tests/notification-flow.test.js +6 -5
- package/notification/tests/notification-sse.service.test.js +1 -1
- package/notification/tests/notification-type.service.test.js +1 -1
- package/object-storage/s3/s3.object-storage.js +3 -0
- package/object-storage/s3/tests/s3.object-storage.integration.test.js +1 -1
- package/orm/tests/repository-attributes.test.js +10 -17
- package/orm/tests/repository-cti-mapping.test.js +2 -2
- package/orm/tests/repository-cti-soft-delete.test.js +1 -1
- package/orm/tests/repository-cti.test.js +19 -33
- package/orm/tests/repository-extra-coverage.test.js +1 -1
- package/orm/tests/repository-search.test.js +5 -2
- package/orm/tests/transaction-safety.test.js +1 -1
- package/package.json +7 -9
- package/rate-limit/tests/postgres-rate-limiter.test.js +6 -16
- package/renderer/d2.d.ts +77 -0
- package/renderer/d2.js +68 -0
- package/renderer/graphviz.d.ts +47 -0
- package/renderer/graphviz.js +58 -0
- package/renderer/index.d.ts +4 -0
- package/renderer/index.js +4 -0
- package/renderer/typst.d.ts +57 -0
- package/renderer/typst.js +62 -0
- package/rpc/adapters/readable-stream.adapter.d.ts +3 -0
- package/rpc/adapters/readable-stream.adapter.js +5 -1
- package/rpc/rpc.js +28 -3
- package/rpc/tests/rpc.integration.test.js +3 -1
- package/schema/schemas/nullable.js +1 -1
- package/task-queue/task-queue.d.ts +2 -0
- package/task-queue/task-queue.js +6 -2
- package/task-queue/tests/complex.test.js +1 -1
- package/task-queue/tests/dependencies.test.js +3 -3
- package/task-queue/tests/extensive-dependencies.test.js +1 -1
- package/task-queue/tests/queue.test.js +1 -1
- package/task-queue/tests/worker.test.js +4 -7
- package/test5.js +52 -8
- package/{unit-test → testing}/integration-setup.d.ts +1 -0
- package/{unit-test → testing}/integration-setup.js +13 -0
- package/utils/base64.d.ts +7 -0
- package/utils/base64.js +10 -1
- package/utils/noop.d.ts +7 -1
- package/utils/noop.js +7 -1
- package/ai/ai-file.service.d.ts +0 -57
- package/ai/ai-file.service.js +0 -233
- package/ai/ai-session.d.ts +0 -38
- package/ai/ai-session.js +0 -50
- package/ai/ai.service.d.ts +0 -126
- package/ai/ai.service.js +0 -481
- package/ai/functions.d.ts +0 -9
- package/ai/functions.js +0 -38
- package/ai/module.d.ts +0 -26
- package/ai/module.js +0 -25
- package/ai/types.d.ts +0 -229
- package/ai/types.js +0 -33
- package/latex/index.d.ts +0 -1
- package/latex/index.js +0 -1
- package/typst/index.d.ts +0 -1
- package/typst/index.js +0 -1
- package/typst/render.d.ts +0 -23
- package/typst/render.js +0 -32
- /package/{logger/formatters/pretty-print.test.d.ts → ai/tests/instructions-formatter.test.d.ts} +0 -0
- /package/{notification/tests/unit/notification-client.test.d.ts → ai/tests/steering.test.d.ts} +0 -0
- /package/{latex/render.d.ts → renderer/latex.d.ts} +0 -0
- /package/{latex/render.js → renderer/latex.js} +0 -0
- /package/{unit-test → testing}/index.d.ts +0 -0
- /package/{unit-test → testing}/index.js +0 -0
|
@@ -4,7 +4,7 @@ import { AuthenticationAncillaryService, AuthenticationService as Authentication
|
|
|
4
4
|
import { HttpClientOptions } from '../../http/client/index.js';
|
|
5
5
|
import { HttpServer } from '../../http/server/index.js';
|
|
6
6
|
import { runInInjectionContext } from '../../injector/index.js';
|
|
7
|
-
import { clearTenantData, setupIntegrationTest } from '../../
|
|
7
|
+
import { clearTenantData, setupIntegrationTest } from '../../testing/index.js';
|
|
8
8
|
import { SubjectService } from '../server/subject.service.js';
|
|
9
9
|
import { DefaultAuthenticationAncillaryService } from './authentication.test-ancillary-service.js';
|
|
10
10
|
describe('AuthenticationApiController Integration', () => {
|
|
@@ -74,6 +74,8 @@ describe('AuthenticationApiController Integration', () => {
|
|
|
74
74
|
const admin = await subjectService.createUser({ tenantId, email: 'api-admin@example.com', firstName: 'A', lastName: 'D' });
|
|
75
75
|
const user = await subjectService.createUser({ tenantId, email: 'api-user@example.com', firstName: 'U', lastName: 'S' });
|
|
76
76
|
await serverService.setCredentials(admin, 'Admin-Pass-123!');
|
|
77
|
+
expect(await subjectService.exists(tenantId, admin.id)).toBe(true);
|
|
78
|
+
expect(await subjectService.exists(tenantId, user.id)).toBe(true);
|
|
77
79
|
await service.login({ tenantId, subject: admin.id }, 'Admin-Pass-123!');
|
|
78
80
|
await service.impersonate(user.id);
|
|
79
81
|
expect(service.subjectId()).toBe(user.id);
|
|
@@ -2,7 +2,7 @@ import { afterAll, beforeAll, describe, expect, test } from 'vitest';
|
|
|
2
2
|
import { AuthenticationApiRequestTokenProvider } from '../../authentication/server/authentication-api-request-token.provider.js';
|
|
3
3
|
import { AuthenticationService } from '../../authentication/server/index.js';
|
|
4
4
|
import { runInInjectionContext } from '../../injector/index.js';
|
|
5
|
-
import { setupIntegrationTest } from '../../
|
|
5
|
+
import { setupIntegrationTest } from '../../testing/index.js';
|
|
6
6
|
import { SubjectService } from '../server/subject.service.js';
|
|
7
7
|
describe('AuthenticationApiRequestTokenProvider', () => {
|
|
8
8
|
let injector;
|
|
@@ -4,7 +4,7 @@ import { AuthenticationService as AuthenticationServerService } from '../../auth
|
|
|
4
4
|
import { HttpClientOptions } from '../../http/client/index.js';
|
|
5
5
|
import { HttpServer } from '../../http/server/index.js';
|
|
6
6
|
import { runInInjectionContext } from '../../injector/index.js';
|
|
7
|
-
import { clearTenantData, setupIntegrationTest } from '../../
|
|
7
|
+
import { clearTenantData, setupIntegrationTest } from '../../testing/index.js';
|
|
8
8
|
import { SubjectService } from '../server/subject.service.js';
|
|
9
9
|
import { DefaultAuthenticationAncillaryService } from './authentication.test-ancillary-service.js';
|
|
10
10
|
describe('AuthenticationClientService Integration', () => {
|
|
@@ -2,7 +2,7 @@ import { afterAll, beforeAll, beforeEach, describe, expect, test } from 'vitest'
|
|
|
2
2
|
import { ActorType, Auditor } from '../../audit/index.js';
|
|
3
3
|
import { NIL_UUID } from '../../constants.js';
|
|
4
4
|
import { runInInjectionContext } from '../../injector/index.js';
|
|
5
|
-
import { clearTenantData, setupIntegrationTest } from '../../
|
|
5
|
+
import { clearTenantData, setupIntegrationTest } from '../../testing/index.js';
|
|
6
6
|
import { AuthenticationAncillaryService } from '../server/authentication-ancillary.service.js';
|
|
7
7
|
import { AuthenticationService } from '../server/authentication.service.js';
|
|
8
8
|
import { SubjectService } from '../server/subject.service.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { beforeAll, beforeEach, describe, expect, test } from 'vitest';
|
|
2
2
|
import { NIL_UUID } from '../../constants.js';
|
|
3
3
|
import { runInInjectionContext } from '../../injector/index.js';
|
|
4
|
-
import { clearTenantData, setupIntegrationTest } from '../../
|
|
4
|
+
import { clearTenantData, setupIntegrationTest } from '../../testing/index.js';
|
|
5
5
|
import { SubjectStatus } from '../models/index.js';
|
|
6
6
|
import { SubjectService } from '../server/subject.service.js';
|
|
7
7
|
describe('SubjectService', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
|
|
2
2
|
import { CircuitBreakerState } from '../../circuit-breaker/index.js';
|
|
3
3
|
import { CircuitBreakerProvider } from '../../circuit-breaker/provider.js';
|
|
4
|
-
import { setupIntegrationTest } from '../../
|
|
4
|
+
import { setupIntegrationTest } from '../../testing/index.js';
|
|
5
5
|
import { timeout } from '../../utils/timing.js';
|
|
6
6
|
describe('Circuit Breaker (Standalone) Tests', () => {
|
|
7
7
|
let injector;
|
|
@@ -5,7 +5,7 @@ export type DocumentManagementApiDefinition = typeof documentManagementApiDefini
|
|
|
5
5
|
export declare const documentManagementApiDefinition: {
|
|
6
6
|
resource: string;
|
|
7
7
|
endpoints: {
|
|
8
|
-
|
|
8
|
+
getData: {
|
|
9
9
|
resource: string;
|
|
10
10
|
method: "GET";
|
|
11
11
|
parameters: import("../../schema/index.js").ObjectSchema<{
|
|
@@ -27,7 +27,7 @@ export declare const documentManagementApiDefinition: {
|
|
|
27
27
|
result: typeof CategoriesAndTypesData;
|
|
28
28
|
credentials: true;
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
getDataStream: {
|
|
31
31
|
resource: string;
|
|
32
32
|
method: "GET";
|
|
33
33
|
parameters: import("../../schema/index.js").ObjectSchema<{
|
|
@@ -45,19 +45,19 @@ export declare const documentManagementApiDefinition: {
|
|
|
45
45
|
accessControlAllowHeaders: string;
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
|
|
48
|
+
getDocumentRequestsTemplateData: {
|
|
49
49
|
resource: string;
|
|
50
50
|
method: "GET";
|
|
51
51
|
result: typeof DocumentRequestsTemplateData;
|
|
52
52
|
credentials: true;
|
|
53
53
|
};
|
|
54
|
-
|
|
54
|
+
getAvailableCategories: {
|
|
55
55
|
resource: string;
|
|
56
56
|
method: "GET";
|
|
57
57
|
result: import("../../schema/index.js").ArraySchema<DocumentCategoryView>;
|
|
58
58
|
credentials: true;
|
|
59
59
|
};
|
|
60
|
-
|
|
60
|
+
getFileContent: {
|
|
61
61
|
resource: string;
|
|
62
62
|
method: "GET";
|
|
63
63
|
parameters: import("../../schema/index.js").ObjectSchema<{
|
|
@@ -67,7 +67,7 @@ export declare const documentManagementApiDefinition: {
|
|
|
67
67
|
result: Uint8ArrayConstructor;
|
|
68
68
|
credentials: true;
|
|
69
69
|
};
|
|
70
|
-
|
|
70
|
+
getFileContentUrl: {
|
|
71
71
|
resource: string;
|
|
72
72
|
method: "GET";
|
|
73
73
|
parameters: import("../../schema/index.js").ObjectSchema<{
|
|
@@ -77,7 +77,7 @@ export declare const documentManagementApiDefinition: {
|
|
|
77
77
|
result: import("../../schema/index.js").StringSchema;
|
|
78
78
|
credentials: true;
|
|
79
79
|
};
|
|
80
|
-
|
|
80
|
+
getPreview: {
|
|
81
81
|
resource: string;
|
|
82
82
|
method: "GET";
|
|
83
83
|
parameters: import("../../schema/index.js").ObjectSchema<{
|
|
@@ -369,7 +369,7 @@ export declare const documentManagementApiDefinition: {
|
|
|
369
369
|
method: "POST";
|
|
370
370
|
parameters: import("../../schema/index.js").ObjectSchema<{
|
|
371
371
|
id: string;
|
|
372
|
-
state: "error" | "pending" | "running" | "completed" | "
|
|
372
|
+
state: "error" | "pending" | "running" | "completed" | "review" | "failed";
|
|
373
373
|
}>;
|
|
374
374
|
result: import("../../schema/index.js").LiteralSchema<"ok">;
|
|
375
375
|
credentials: true;
|
|
@@ -421,7 +421,7 @@ export declare const documentManagementApiDefinition: {
|
|
|
421
421
|
declare const _DocumentManagementApi: import("../../api/client/index.js").ApiClient<{
|
|
422
422
|
resource: string;
|
|
423
423
|
endpoints: {
|
|
424
|
-
|
|
424
|
+
getData: {
|
|
425
425
|
resource: string;
|
|
426
426
|
method: "GET";
|
|
427
427
|
parameters: import("../../schema/index.js").ObjectSchema<{
|
|
@@ -443,7 +443,7 @@ declare const _DocumentManagementApi: import("../../api/client/index.js").ApiCli
|
|
|
443
443
|
result: typeof CategoriesAndTypesData;
|
|
444
444
|
credentials: true;
|
|
445
445
|
};
|
|
446
|
-
|
|
446
|
+
getDataStream: {
|
|
447
447
|
resource: string;
|
|
448
448
|
method: "GET";
|
|
449
449
|
parameters: import("../../schema/index.js").ObjectSchema<{
|
|
@@ -461,19 +461,19 @@ declare const _DocumentManagementApi: import("../../api/client/index.js").ApiCli
|
|
|
461
461
|
accessControlAllowHeaders: string;
|
|
462
462
|
};
|
|
463
463
|
};
|
|
464
|
-
|
|
464
|
+
getDocumentRequestsTemplateData: {
|
|
465
465
|
resource: string;
|
|
466
466
|
method: "GET";
|
|
467
467
|
result: typeof DocumentRequestsTemplateData;
|
|
468
468
|
credentials: true;
|
|
469
469
|
};
|
|
470
|
-
|
|
470
|
+
getAvailableCategories: {
|
|
471
471
|
resource: string;
|
|
472
472
|
method: "GET";
|
|
473
473
|
result: import("../../schema/index.js").ArraySchema<DocumentCategoryView>;
|
|
474
474
|
credentials: true;
|
|
475
475
|
};
|
|
476
|
-
|
|
476
|
+
getFileContent: {
|
|
477
477
|
resource: string;
|
|
478
478
|
method: "GET";
|
|
479
479
|
parameters: import("../../schema/index.js").ObjectSchema<{
|
|
@@ -483,7 +483,7 @@ declare const _DocumentManagementApi: import("../../api/client/index.js").ApiCli
|
|
|
483
483
|
result: Uint8ArrayConstructor;
|
|
484
484
|
credentials: true;
|
|
485
485
|
};
|
|
486
|
-
|
|
486
|
+
getFileContentUrl: {
|
|
487
487
|
resource: string;
|
|
488
488
|
method: "GET";
|
|
489
489
|
parameters: import("../../schema/index.js").ObjectSchema<{
|
|
@@ -493,7 +493,7 @@ declare const _DocumentManagementApi: import("../../api/client/index.js").ApiCli
|
|
|
493
493
|
result: import("../../schema/index.js").StringSchema;
|
|
494
494
|
credentials: true;
|
|
495
495
|
};
|
|
496
|
-
|
|
496
|
+
getPreview: {
|
|
497
497
|
resource: string;
|
|
498
498
|
method: "GET";
|
|
499
499
|
parameters: import("../../schema/index.js").ObjectSchema<{
|
|
@@ -785,7 +785,7 @@ declare const _DocumentManagementApi: import("../../api/client/index.js").ApiCli
|
|
|
785
785
|
method: "POST";
|
|
786
786
|
parameters: import("../../schema/index.js").ObjectSchema<{
|
|
787
787
|
id: string;
|
|
788
|
-
state: "error" | "pending" | "running" | "completed" | "
|
|
788
|
+
state: "error" | "pending" | "running" | "completed" | "review" | "failed";
|
|
789
789
|
}>;
|
|
790
790
|
result: import("../../schema/index.js").LiteralSchema<"ok">;
|
|
791
791
|
credentials: true;
|
|
@@ -13,14 +13,14 @@ import { array, boolean, literal, number, object, optional, string } from '../..
|
|
|
13
13
|
import { DataStream } from '../../sse/index.js';
|
|
14
14
|
import { policy } from '../authorization/index.js';
|
|
15
15
|
import { Document, DocumentCategory, DocumentRequest, DocumentRequestsTemplate, DocumentRequestTemplate, DocumentType } from '../models/index.js';
|
|
16
|
-
import { addOrArchiveDocumentToOrFromCollectionParametersSchema, applyDocumentRequestsTemplateParametersSchema, CategoriesAndTypesData, createDocumentCategoryParametersSchema, createDocumentParametersSchema, createDocumentRequestParametersSchema, createDocumentRequestsTemplateParametersSchema, createDocumentRequestTemplateParametersSchema, createDocumentTypeParametersSchema, deleteDocumentRequestParametersSchema, deleteDocumentRequestsTemplateParametersSchema, deleteDocumentRequestTemplateParametersSchema, DocumentCategoryView, DocumentManagementData, DocumentRequestsTemplateData, DocumentStatistics,
|
|
16
|
+
import { addOrArchiveDocumentToOrFromCollectionParametersSchema, applyDocumentRequestsTemplateParametersSchema, CategoriesAndTypesData, createDocumentCategoryParametersSchema, createDocumentParametersSchema, createDocumentRequestParametersSchema, createDocumentRequestsTemplateParametersSchema, createDocumentRequestTemplateParametersSchema, createDocumentTypeParametersSchema, deleteDocumentRequestParametersSchema, deleteDocumentRequestsTemplateParametersSchema, deleteDocumentRequestTemplateParametersSchema, DocumentCategoryView, DocumentManagementData, DocumentRequestsTemplateData, DocumentStatistics, getDataParametersSchema, GetDocumentStatisticsOptions, proceedDocumentWorkflowParametersSchema, updateDocumentParametersSchema, updateDocumentRequestParametersSchema, updateDocumentRequestsTemplateParametersSchema, updateDocumentRequestTemplateParametersSchema } from '../service-models/index.js';
|
|
17
17
|
export const documentManagementApiDefinition = defineApi({
|
|
18
18
|
resource: 'document-management',
|
|
19
19
|
endpoints: {
|
|
20
|
-
|
|
20
|
+
getData: {
|
|
21
21
|
resource: 'data',
|
|
22
22
|
method: 'GET',
|
|
23
|
-
parameters:
|
|
23
|
+
parameters: getDataParametersSchema,
|
|
24
24
|
result: DocumentManagementData,
|
|
25
25
|
credentials: true,
|
|
26
26
|
},
|
|
@@ -37,29 +37,29 @@ export const documentManagementApiDefinition = defineApi({
|
|
|
37
37
|
result: CategoriesAndTypesData,
|
|
38
38
|
credentials: true,
|
|
39
39
|
},
|
|
40
|
-
|
|
40
|
+
getDataStream: {
|
|
41
41
|
resource: 'data/stream',
|
|
42
42
|
method: 'GET',
|
|
43
|
-
parameters:
|
|
43
|
+
parameters: getDataParametersSchema,
|
|
44
44
|
result: (DataStream),
|
|
45
45
|
credentials: true,
|
|
46
46
|
data: { [bustCache]: true },
|
|
47
47
|
cors: { accessControlAllowHeaders: `${defaultAccessControlAllowHeaders}, Cache-Control` },
|
|
48
48
|
},
|
|
49
|
-
|
|
49
|
+
getDocumentRequestsTemplateData: {
|
|
50
50
|
resource: 'views/document-requests-template-data',
|
|
51
51
|
method: 'GET',
|
|
52
52
|
result: DocumentRequestsTemplateData,
|
|
53
53
|
credentials: true,
|
|
54
54
|
},
|
|
55
|
-
|
|
55
|
+
getAvailableCategories: {
|
|
56
56
|
resource: 'views/categories',
|
|
57
57
|
method: 'GET',
|
|
58
58
|
result: array(DocumentCategoryView),
|
|
59
59
|
credentials: true,
|
|
60
60
|
},
|
|
61
|
-
|
|
62
|
-
resource: 'documents/:id/content',
|
|
61
|
+
getFileContent: {
|
|
62
|
+
resource: 'documents/:id/file/content',
|
|
63
63
|
method: 'GET',
|
|
64
64
|
parameters: object({
|
|
65
65
|
id: string(),
|
|
@@ -68,8 +68,8 @@ export const documentManagementApiDefinition = defineApi({
|
|
|
68
68
|
result: Uint8Array,
|
|
69
69
|
credentials: true,
|
|
70
70
|
},
|
|
71
|
-
|
|
72
|
-
resource: 'documents/:id/content/url',
|
|
71
|
+
getFileContentUrl: {
|
|
72
|
+
resource: 'documents/:id/file/content/url',
|
|
73
73
|
method: 'GET',
|
|
74
74
|
parameters: object({
|
|
75
75
|
id: string(),
|
|
@@ -78,7 +78,7 @@ export const documentManagementApiDefinition = defineApi({
|
|
|
78
78
|
result: string(),
|
|
79
79
|
credentials: true,
|
|
80
80
|
},
|
|
81
|
-
|
|
81
|
+
getPreview: {
|
|
82
82
|
resource: 'documents/:id/preview/:page',
|
|
83
83
|
method: 'GET',
|
|
84
84
|
parameters: object({
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ModelReference } from 'genkit';
|
|
2
|
+
import type { Instructions } from '../../ai/prompts/instructions-formatter.js';
|
|
3
|
+
import type { DocumentWorkflowStep } from './document-workflow.model.js';
|
|
4
|
+
export type InstructionStrategy = 'replace' | 'append';
|
|
5
|
+
export type InstructionOverride = string | {
|
|
6
|
+
/**
|
|
7
|
+
* Simple way: Provide a specific format pattern.
|
|
8
|
+
* This will be used with a default instruction template for the field.
|
|
9
|
+
*/
|
|
10
|
+
format?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Advanced way: Provide full custom instructions.
|
|
13
|
+
*/
|
|
14
|
+
content?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Strategy for 'content'. Defaults to 'append'.
|
|
17
|
+
*/
|
|
18
|
+
strategy?: InstructionStrategy;
|
|
19
|
+
};
|
|
20
|
+
export type AiConfiguration = {
|
|
21
|
+
/** The model to use. */
|
|
22
|
+
model?: ModelReference<any>;
|
|
23
|
+
/** The language to use for AI outputs. */
|
|
24
|
+
language?: string;
|
|
25
|
+
/** Prompt overrides. */
|
|
26
|
+
prompt?: {
|
|
27
|
+
/** Addition to the system prompt. */
|
|
28
|
+
systemAddition?: Instructions | string;
|
|
29
|
+
/** Addition to the user prompt. */
|
|
30
|
+
userAddition?: Instructions | string;
|
|
31
|
+
/** Expert override for the system prompt. Receives the base prompt. */
|
|
32
|
+
systemOverride?: (base: Instructions) => Instructions | string;
|
|
33
|
+
/** Expert override for the user prompt. Receives the base prompt. */
|
|
34
|
+
userOverride?: (base: Instructions) => Instructions | string;
|
|
35
|
+
};
|
|
36
|
+
/** Granular extraction instructions. */
|
|
37
|
+
extraction?: {
|
|
38
|
+
title?: InstructionOverride;
|
|
39
|
+
subtitle?: InstructionOverride;
|
|
40
|
+
date?: InstructionOverride;
|
|
41
|
+
summary?: InstructionOverride;
|
|
42
|
+
tags?: InstructionOverride;
|
|
43
|
+
properties?: Record<string, InstructionOverride>;
|
|
44
|
+
};
|
|
45
|
+
/** Granular classification instructions. */
|
|
46
|
+
classification?: InstructionOverride;
|
|
47
|
+
};
|
|
48
|
+
export type DocumentManagementAiConfiguration = {
|
|
49
|
+
/** Global defaults. */
|
|
50
|
+
defaults?: AiConfiguration;
|
|
51
|
+
/** Step-specific configurations. */
|
|
52
|
+
steps?: Partial<Record<DocumentWorkflowStep, AiConfiguration>>;
|
|
53
|
+
/** Document category specific configurations. Key is Category Key. */
|
|
54
|
+
categories?: Record<string, AiConfiguration>;
|
|
55
|
+
/** Document type specific configurations. Key is Document Type Key. */
|
|
56
|
+
documentTypes?: Record<string, AiConfiguration>;
|
|
57
|
+
/** Validation specific configurations. Key is Validation Identifier. */
|
|
58
|
+
validations?: Record<string, AiConfiguration>;
|
|
59
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 {
|
|
10
|
+
import { 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';
|
|
@@ -32,8 +32,6 @@ __decorate([
|
|
|
32
32
|
], DocumentAssignmentScope.prototype, "collectionId", void 0);
|
|
33
33
|
DocumentAssignmentScope = __decorate([
|
|
34
34
|
DocumentManagementTable({ name: 'assignment_scope' }),
|
|
35
|
-
Unique(['taskId', 'collectionId'])
|
|
36
|
-
ForeignKey(() => DocumentAssignmentTask, ['tenantId', 'taskId'], ['tenantId', 'id']),
|
|
37
|
-
ForeignKey(() => DocumentCollection, ['tenantId', 'collectionId'], ['tenantId', 'id'])
|
|
35
|
+
Unique(['taskId', 'collectionId'])
|
|
38
36
|
], DocumentAssignmentScope);
|
|
39
37
|
export { DocumentAssignmentScope };
|
|
@@ -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 {
|
|
11
|
+
import { 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';
|
|
@@ -24,7 +24,6 @@ let DocumentAssignmentTask = class DocumentAssignmentTask extends TenantEntity {
|
|
|
24
24
|
__decorate([
|
|
25
25
|
UuidProperty(),
|
|
26
26
|
TenantReference(() => Document),
|
|
27
|
-
Unique(),
|
|
28
27
|
__metadata("design:type", String)
|
|
29
28
|
], DocumentAssignmentTask.prototype, "documentId", void 0);
|
|
30
29
|
__decorate([
|
|
@@ -33,7 +32,6 @@ __decorate([
|
|
|
33
32
|
], DocumentAssignmentTask.prototype, "target", void 0);
|
|
34
33
|
DocumentAssignmentTask = __decorate([
|
|
35
34
|
DocumentManagementTable({ name: 'assignment_task' }),
|
|
36
|
-
Unique(['tenantId', '
|
|
37
|
-
ForeignKey(() => Document, ['tenantId', 'documentId'], ['tenantId', 'id'])
|
|
35
|
+
Unique(['tenantId', 'documentId'])
|
|
38
36
|
], DocumentAssignmentTask);
|
|
39
37
|
export { DocumentAssignmentTask };
|
|
@@ -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 {
|
|
10
|
+
import { 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';
|
|
@@ -33,8 +33,6 @@ __decorate([
|
|
|
33
33
|
], DocumentCollectionAssignment.prototype, "archiveTimestamp", void 0);
|
|
34
34
|
DocumentCollectionAssignment = __decorate([
|
|
35
35
|
DocumentManagementTable({ name: 'collection_assignment' }),
|
|
36
|
-
Unique(['tenantId', 'collectionId', 'documentId'])
|
|
37
|
-
ForeignKey(() => DocumentCollection, ['tenantId', 'collectionId'], ['tenantId', 'id']),
|
|
38
|
-
ForeignKey(() => Document, ['tenantId', 'documentId'], ['tenantId', 'id'])
|
|
36
|
+
Unique(['tenantId', 'collectionId', 'documentId'])
|
|
39
37
|
], DocumentCollectionAssignment);
|
|
40
38
|
export { DocumentCollectionAssignment };
|
|
@@ -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 { TenantEntity, TenantReference,
|
|
10
|
+
import { TenantEntity, TenantReference, UuidProperty } from '../../orm/index.js';
|
|
11
11
|
import { DocumentManagementTable } from './document-management-table.js';
|
|
12
12
|
let DocumentCollection = class DocumentCollection extends TenantEntity {
|
|
13
13
|
static entityName = 'DocumentCollection';
|
|
@@ -19,7 +19,6 @@ __decorate([
|
|
|
19
19
|
__metadata("design:type", Object)
|
|
20
20
|
], DocumentCollection.prototype, "parentId", void 0);
|
|
21
21
|
DocumentCollection = __decorate([
|
|
22
|
-
DocumentManagementTable({ name: 'collection' })
|
|
23
|
-
Unique(['tenantId', 'id'])
|
|
22
|
+
DocumentManagementTable({ name: 'collection' })
|
|
24
23
|
], DocumentCollection);
|
|
25
24
|
export { DocumentCollection };
|
|
@@ -0,0 +1,32 @@
|
|
|
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 { TenantEntity, TenantReference, Unique, UuidProperty } from '../../orm/index.js';
|
|
11
|
+
import { StringProperty } from '../../schema/index.js';
|
|
12
|
+
import { DocumentManagementTable } from './document-management-table.js';
|
|
13
|
+
import { Document } from './document.model.js';
|
|
14
|
+
let DocumentContent = class DocumentContent extends TenantEntity {
|
|
15
|
+
static entityName = 'DocumentContent';
|
|
16
|
+
documentId;
|
|
17
|
+
content;
|
|
18
|
+
};
|
|
19
|
+
__decorate([
|
|
20
|
+
UuidProperty(),
|
|
21
|
+
TenantReference(() => Document),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], DocumentContent.prototype, "documentId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
StringProperty(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], DocumentContent.prototype, "content", void 0);
|
|
28
|
+
DocumentContent = __decorate([
|
|
29
|
+
DocumentManagementTable(),
|
|
30
|
+
Unique(['tenantId', 'documentId'])
|
|
31
|
+
], DocumentContent);
|
|
32
|
+
export { DocumentContent };
|
|
@@ -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 { Check,
|
|
11
|
+
import { Check, 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';
|
|
@@ -56,7 +56,6 @@ __decorate([
|
|
|
56
56
|
DocumentPropertyValue = __decorate([
|
|
57
57
|
DocumentManagementTable({ name: 'property_value' }),
|
|
58
58
|
Unique(['tenantId', 'documentId', 'propertyId']),
|
|
59
|
-
ForeignKey(() => Document, ['tenantId', 'documentId'], ['tenantId', 'id']),
|
|
60
59
|
Check('only_one_value', (table) => eq(numNonNulls(table.text, table.integer, table.decimal, table.boolean, table.date), sql.raw('1')))
|
|
61
60
|
], DocumentPropertyValue);
|
|
62
61
|
export { DocumentPropertyValue };
|
|
@@ -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 {
|
|
10
|
+
import { 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';
|
|
@@ -29,8 +29,6 @@ __decorate([
|
|
|
29
29
|
], DocumentRequestCollectionAssignment.prototype, "collectionId", void 0);
|
|
30
30
|
DocumentRequestCollectionAssignment = __decorate([
|
|
31
31
|
DocumentManagementTable({ name: 'request_collection_assignment' }),
|
|
32
|
-
Unique(['tenantId', 'requestId', 'collectionId'])
|
|
33
|
-
ForeignKey(() => DocumentRequest, ['tenantId', 'requestId'], ['tenantId', 'id']),
|
|
34
|
-
ForeignKey(() => DocumentCollection, ['tenantId', 'collectionId'], ['tenantId', 'id'])
|
|
32
|
+
Unique(['tenantId', 'requestId', 'collectionId'])
|
|
35
33
|
], DocumentRequestCollectionAssignment);
|
|
36
34
|
export { DocumentRequestCollectionAssignment };
|
|
@@ -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 {
|
|
11
|
+
import { 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';
|
|
@@ -37,7 +37,6 @@ __decorate([
|
|
|
37
37
|
__decorate([
|
|
38
38
|
UuidProperty({ nullable: true }),
|
|
39
39
|
TenantReference(() => Document),
|
|
40
|
-
Unique(),
|
|
41
40
|
__metadata("design:type", Object)
|
|
42
41
|
], DocumentRequest.prototype, "documentId", void 0);
|
|
43
42
|
__decorate([
|
|
@@ -51,7 +50,6 @@ __decorate([
|
|
|
51
50
|
], DocumentRequest.prototype, "state", void 0);
|
|
52
51
|
DocumentRequest = __decorate([
|
|
53
52
|
DocumentManagementTable({ name: 'request' }),
|
|
54
|
-
Unique(['tenantId', '
|
|
55
|
-
ForeignKey(() => Document, ['tenantId', 'documentId'], ['tenantId', 'id'])
|
|
53
|
+
Unique(['tenantId', 'documentId'])
|
|
56
54
|
], DocumentRequest);
|
|
57
55
|
export { DocumentRequest };
|
|
@@ -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 {
|
|
10
|
+
import { TenantEntity, TenantReference, Unique, UuidProperty } from '../../orm/index.js';
|
|
11
11
|
import { DocumentManagementTable } from './document-management-table.js';
|
|
12
12
|
import { DocumentTag } from './document-tag.model.js';
|
|
13
13
|
import { Document } from './document.model.js';
|
|
@@ -28,7 +28,6 @@ __decorate([
|
|
|
28
28
|
], DocumentTagAssignment.prototype, "tagId", void 0);
|
|
29
29
|
DocumentTagAssignment = __decorate([
|
|
30
30
|
DocumentManagementTable({ name: 'tag_assignment' }),
|
|
31
|
-
Unique(['tenantId', 'documentId', 'tagId'])
|
|
32
|
-
ForeignKey(() => Document, ['tenantId', 'documentId'], ['tenantId', 'id'])
|
|
31
|
+
Unique(['tenantId', 'documentId', 'tagId'])
|
|
33
32
|
], DocumentTagAssignment);
|
|
34
33
|
export { DocumentTagAssignment };
|
|
@@ -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 {
|
|
10
|
+
import { TenantEntity, TenantReference, Unique, UuidProperty } from '../../orm/index.js';
|
|
11
11
|
import { DocumentManagementTable } from './document-management-table.js';
|
|
12
12
|
import { DocumentValidationExecution } from './document-validation-execution.model.js';
|
|
13
13
|
import { Document } from './document.model.js';
|
|
@@ -28,8 +28,6 @@ __decorate([
|
|
|
28
28
|
], DocumentValidationExecutionRelatedDocument.prototype, "documentId", void 0);
|
|
29
29
|
DocumentValidationExecutionRelatedDocument = __decorate([
|
|
30
30
|
DocumentManagementTable({ name: 'validation_execution_related_document' }),
|
|
31
|
-
Unique(['tenantId', 'executionId', 'documentId'])
|
|
32
|
-
ForeignKey(() => DocumentValidationExecution, ['tenantId', 'executionId'], ['tenantId', 'id']),
|
|
33
|
-
ForeignKey(() => Document, ['tenantId', 'documentId'], ['tenantId', 'id'])
|
|
31
|
+
Unique(['tenantId', 'executionId', 'documentId'])
|
|
34
32
|
], DocumentValidationExecutionRelatedDocument);
|
|
35
33
|
export { DocumentValidationExecutionRelatedDocument };
|
|
@@ -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 {
|
|
11
|
+
import { TenantEntity, TenantReference, TimestampProperty, 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 { DocumentValidationDefinition } from './document-validation-definition.model.js';
|
|
@@ -66,9 +66,6 @@ __decorate([
|
|
|
66
66
|
], DocumentValidationExecution.prototype, "completedAt", void 0);
|
|
67
67
|
DocumentValidationExecution = __decorate([
|
|
68
68
|
DocumentManagementTable({ name: 'validation_execution' }),
|
|
69
|
-
Unique(['tenantId', '
|
|
70
|
-
,
|
|
71
|
-
Unique(['tenantId', 'workflowId', 'definitionId']),
|
|
72
|
-
ForeignKey(() => DocumentWorkflow, ['tenantId', 'workflowId'], ['tenantId', 'id'])
|
|
69
|
+
Unique(['tenantId', 'workflowId', 'definitionId'])
|
|
73
70
|
], DocumentValidationExecution);
|
|
74
71
|
export { DocumentValidationExecution };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type EnumType } from '../../enumeration/enumeration.js';
|
|
2
2
|
import { TenantEntity, type Timestamp, type Uuid } from '../../orm/index.js';
|
|
3
3
|
export declare const DocumentWorkflowStep: {
|
|
4
|
+
readonly ContentExtraction: "content-extraction";
|
|
4
5
|
readonly Classification: "classification";
|
|
5
|
-
readonly
|
|
6
|
+
readonly DataExtraction: "data-extraction";
|
|
6
7
|
readonly Assignment: "assignment";
|
|
7
8
|
readonly Validation: "validation";
|
|
8
9
|
};
|
|
@@ -8,13 +8,14 @@ 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 {
|
|
11
|
+
import { Index, TenantEntity, TenantReference, TimestampProperty, UuidProperty } from '../../orm/index.js';
|
|
12
12
|
import { BooleanProperty, Enumeration } from '../../schema/index.js';
|
|
13
13
|
import { DocumentManagementTable } from './document-management-table.js';
|
|
14
14
|
import { Document } from './document.model.js';
|
|
15
15
|
export const DocumentWorkflowStep = defineEnum('DocumentWorkflowStep', {
|
|
16
|
+
ContentExtraction: 'content-extraction',
|
|
16
17
|
Classification: 'classification',
|
|
17
|
-
|
|
18
|
+
DataExtraction: 'data-extraction',
|
|
18
19
|
Assignment: 'assignment',
|
|
19
20
|
Validation: 'validation',
|
|
20
21
|
});
|
|
@@ -75,8 +76,6 @@ __decorate([
|
|
|
75
76
|
], DocumentWorkflow.prototype, "completeUserId", void 0);
|
|
76
77
|
DocumentWorkflow = __decorate([
|
|
77
78
|
DocumentManagementTable({ name: 'workflow' }),
|
|
78
|
-
Index(['documentId'], { unique: true, where: () => ({ state: { $neq: DocumentWorkflowState.Completed } }) })
|
|
79
|
-
ForeignKey(() => Document, ['tenantId', 'documentId'], ['tenantId', 'id']),
|
|
80
|
-
Unique(['tenantId', 'id'])
|
|
79
|
+
Index(['documentId'], { unique: true, where: () => ({ state: { $neq: DocumentWorkflowState.Completed } }) })
|
|
81
80
|
], DocumentWorkflow);
|
|
82
81
|
export { DocumentWorkflow };
|