@tstdl/base 0.92.144 → 0.92.147
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-file.service.d.ts +29 -1
- package/ai/ai-file.service.js +66 -23
- package/ai/ai-session.d.ts +28 -1
- package/ai/ai-session.js +27 -0
- package/ai/ai.service.d.ts +89 -5
- package/ai/ai.service.js +130 -27
- package/ai/functions.d.ts +7 -1
- package/ai/functions.js +7 -1
- package/ai/module.d.ts +8 -0
- package/ai/module.js +4 -0
- package/ai/types.d.ts +115 -2
- package/ai/types.js +16 -0
- package/api/client/client.d.ts +1 -1
- package/api/client/client.js +1 -1
- package/api/default-error-handlers.d.ts +1 -1
- package/api/index.d.ts +1 -9
- package/api/index.js +1 -9
- package/api/response.d.ts +1 -1
- package/api/server/api-controller.d.ts +1 -1
- package/api/server/error-handler.d.ts +1 -1
- package/api/server/gateway.d.ts +1 -5
- package/api/server/gateway.js +0 -4
- package/api/server/middlewares/catch-error.middleware.d.ts +1 -1
- package/api/server/module.d.ts +1 -1
- package/api/types.d.ts +1 -1
- package/application/application.d.ts +1 -1
- package/authentication/authentication.api.d.ts +36 -1
- package/authentication/authentication.api.js +28 -0
- package/authentication/client/api.client.d.ts +14 -1
- package/authentication/client/api.client.js +13 -0
- package/authentication/client/authentication.service.d.ts +104 -1
- package/authentication/client/authentication.service.js +103 -0
- package/authentication/client/http-client.middleware.d.ts +5 -0
- package/authentication/client/http-client.middleware.js +6 -2
- package/authentication/client/module.d.ts +20 -1
- package/authentication/client/module.js +6 -1
- package/authentication/client/tokens.d.ts +6 -0
- package/authentication/client/tokens.js +6 -0
- package/authentication/models/authentication-credentials.model.d.ts +6 -0
- package/authentication/models/authentication-credentials.model.js +6 -0
- package/authentication/models/authentication-session.model.d.ts +6 -0
- package/authentication/models/authentication-session.model.js +6 -0
- package/authentication/models/init-secret-reset-data.model.d.ts +10 -1
- package/authentication/models/init-secret-reset-data.model.js +10 -1
- package/authentication/models/token-payload-base.model.d.ts +24 -4
- package/authentication/models/token-payload-base.model.js +24 -4
- package/authentication/models/token.model.d.ts +33 -2
- package/authentication/server/authentication-ancillary.service.d.ts +27 -4
- package/authentication/server/authentication-ancillary.service.js +7 -0
- package/authentication/server/authentication-api-request-token.provider.d.ts +3 -0
- package/authentication/server/authentication-api-request-token.provider.js +3 -0
- package/authentication/server/authentication-secret-requirements.validator.d.ts +37 -0
- package/authentication/server/authentication-secret-requirements.validator.js +22 -0
- package/authentication/server/authentication.api-controller.d.ts +66 -1
- package/authentication/server/authentication.api-controller.js +65 -0
- package/authentication/server/authentication.service.d.ts +191 -11
- package/authentication/server/authentication.service.js +157 -8
- package/authentication/server/helper.d.ts +44 -5
- package/authentication/server/helper.js +43 -4
- package/authentication/server/module.d.ts +23 -1
- package/authentication/server/module.js +23 -1
- package/browser/browser-context-controller.d.ts +1 -1
- package/browser/browser-controller.d.ts +1 -1
- package/browser/browser-controller.js +1 -1
- package/browser/element-controller.d.ts +1 -1
- package/browser/locator-controller.d.ts +1 -1
- package/context/context.d.ts +1 -1
- package/data-structures/context-data-map.d.ts +1 -1
- package/database/mongo/mongo-base.repository.d.ts +1 -1
- package/database/mongo/types.d.ts +1 -1
- package/database/query.d.ts +1 -1
- package/document-management/models/document-assignment-task.model.js +1 -0
- package/document-management/models/document-management-table.d.ts +1 -1
- package/document-management/models/document-validation-definition.model.d.ts +1 -1
- package/document-management/models/document-validation-execution.model.js +1 -0
- package/document-management/models/document-workflow.model.js +3 -2
- package/document-management/server/api/document-management.api.d.ts +1 -1
- package/document-management/server/api/document-management.api.js +3 -3
- package/document-management/server/drizzle/{0000_parallel_mantis.sql → 0000_ordinary_pretty_boy.sql} +6 -3
- package/document-management/server/drizzle/meta/0000_snapshot.json +27 -2
- package/document-management/server/drizzle/meta/_journal.json +2 -2
- package/document-management/server/schemas.d.ts +1 -1
- package/document-management/server/services/document-collection.service.d.ts +2 -2
- package/document-management/server/services/document-management-ai.service.js +7 -5
- package/document-management/server/services/document-management-ancillary.service.d.ts +1 -1
- package/document-management/server/services/document-management-observation.service.d.ts +1 -1
- package/document-management/server/services/document-management.service.d.ts +1 -1
- package/document-management/server/services/document-management.service.js +1 -1
- package/document-management/server/services/document-property.service.d.ts +3 -3
- package/document-management/server/services/document-request.service.d.ts +2 -2
- package/document-management/server/services/document-request.service.js +1 -1
- package/document-management/server/services/document-tag.service.js +1 -1
- package/document-management/server/services/document-validation.service.d.ts +2 -2
- package/document-management/server/services/document-validation.service.js +2 -2
- package/document-management/server/services/document-workflow.service.d.ts +2 -2
- package/document-management/server/services/document-workflow.service.js +4 -4
- package/document-management/server/services/document.service.d.ts +1 -1
- package/document-management/server/services/singleton.d.ts +1 -1
- package/document-management/server/validators/ai-validation-executor.js +4 -4
- package/document-management/server/validators/single-document-validation-executor.js +1 -1
- package/document-management/server/validators/validator.d.ts +1 -1
- package/document-management/service-models/document-management.view-model.d.ts +1 -1
- package/document-management/service-models/enriched/enriched-document-assignment.view.d.ts +1 -1
- package/document-management/service-models/enriched/enriched-document-category.view.d.ts +1 -1
- package/document-management/service-models/enriched/enriched-document-collection.view.d.ts +1 -1
- package/document-management/service-models/enriched/enriched-document-request.view.d.ts +1 -1
- package/document-management/service-models/enriched/enriched-document-type.view.d.ts +1 -1
- package/document-management/service-models/enriched/enriched-document.view.d.ts +1 -1
- package/document-management/service-models/enriched/enriched-requests-template-data.model.d.ts +1 -1
- package/dom/file-select-dialog.d.ts +1 -1
- package/enumeration/enumeration.d.ts +1 -1
- package/errors/custom.error.d.ts +3 -0
- package/errors/custom.error.js +0 -1
- package/errors/errors.localization.d.ts +1 -1
- package/errors/not-supported.error.d.ts +1 -1
- package/{formats.js → formats/formats.js} +3 -3
- package/formats/index.d.ts +1 -0
- package/formats/index.js +1 -0
- package/http/client/http-client-request.d.ts +1 -1
- package/http/client/http-client-response.d.ts +1 -1
- package/http/client/http-client.d.ts +1 -1
- package/http/client/module.d.ts +1 -1
- package/http/http-body.d.ts +1 -1
- package/http/http-value-map.d.ts +1 -1
- package/http/http.error.d.ts +1 -1
- package/http/server/http-server-request.d.ts +1 -1
- package/http/server/http-server-response.d.ts +1 -1
- package/http/types.d.ts +1 -1
- package/http/utils.d.ts +1 -1
- package/injector/decorators.d.ts +4 -4
- package/injector/index.d.ts +1 -1
- package/injector/index.js +1 -1
- package/injector/injector.d.ts +10 -1
- package/injector/injector.js +6 -0
- package/injector/interfaces.d.ts +1 -1
- package/injector/provider.d.ts +1 -1
- package/injector/resolution.d.ts +10 -5
- package/injector/resolve-chain.d.ts +2 -2
- package/injector/resolve-chain.js +1 -1
- package/injector/resolve.error.js +1 -1
- package/injector/token.d.ts +8 -1
- package/injector/token.js +7 -0
- package/injector/types.d.ts +1 -1
- package/key-value-store/key-value-store.provider.d.ts +2 -2
- package/key-value-store/key-value.store.d.ts +2 -2
- package/key-value-store/mongo/mongo-key-value-store.provider.d.ts +1 -1
- package/key-value-store/mongo/mongo-key-value.store.d.ts +1 -1
- package/key-value-store/postgres/key-value-store.service.d.ts +1 -1
- package/mail/mail.service.d.ts +1 -1
- package/mail/models/mail-data.model.d.ts +1 -1
- package/mail/models/mail-template.model.d.ts +1 -1
- package/mail/module.d.ts +1 -1
- package/module/index.d.ts +0 -1
- package/module/index.js +0 -1
- package/module/module-base.d.ts +1 -1
- package/module/module-metric-reporter.js +1 -1
- package/module/module.d.ts +1 -1
- package/module/modules/function.module.js +1 -1
- package/object-storage/object.d.ts +1 -1
- package/openid-connect/mongo-oidc-state.repository.d.ts +1 -1
- package/openid-connect/oidc.service.d.ts +1 -1
- package/orm/decorators.d.ts +2 -2
- package/orm/entity.d.ts +1 -1
- package/orm/index.d.ts +3 -3
- package/orm/index.js +3 -3
- package/orm/query.d.ts +1 -1
- package/orm/repository.types.d.ts +1 -1
- package/orm/schemas/json.d.ts +1 -1
- package/orm/server/database-schema.d.ts +1 -1
- package/orm/server/drizzle/schema-converter.d.ts +1 -1
- package/orm/server/repository.d.ts +1 -1
- package/orm/server/transaction.d.ts +1 -1
- package/orm/server/transactional.d.ts +3 -3
- package/orm/server/types.d.ts +1 -1
- package/orm/types.d.ts +1 -1
- package/package.json +24 -21
- package/queue/mongo/job.d.ts +1 -1
- package/queue/mongo/queue.js +31 -31
- package/queue/postgres/job.model.d.ts +1 -1
- package/queue/postgres/queue.d.ts +1 -1
- package/queue/postgres/queue.provider.d.ts +1 -1
- package/queue/provider.d.ts +1 -1
- package/reflection/decorators.d.ts +1 -1
- package/reflection/registry.d.ts +1 -1
- package/reflection/types.d.ts +1 -1
- package/reflection/utils.d.ts +1 -1
- package/rpc/model.d.ts +1 -1
- package/rxjs-utils/retry-backoff.js +2 -2
- package/schema/converters/openapi-converter.d.ts +1 -1
- package/schema/decorators/schema.d.ts +1 -1
- package/schema/decorators/utils.d.ts +1 -1
- package/schema/schema.d.ts +1 -1
- package/schema/schema.error.d.ts +1 -1
- package/schema/schemas/array.d.ts +1 -1
- package/schema/schemas/enumeration.d.ts +1 -1
- package/schema/schemas/function.d.ts +1 -1
- package/schema/schemas/instance.d.ts +1 -1
- package/schema/schemas/nullable.d.ts +1 -1
- package/schema/schemas/number.d.ts +1 -1
- package/schema/schemas/object.d.ts +1 -1
- package/schema/schemas/one-or-many.d.ts +1 -1
- package/schema/schemas/optional.d.ts +1 -1
- package/schema/schemas/simple.d.ts +1 -1
- package/search-index/elastic/model/index-mapping.d.ts +1 -1
- package/search-index/elastic/search-index.js +3 -4
- package/search-index/memory/memory-search-index.d.ts +1 -1
- package/search-index/memory/memory-search-index.js +1 -1
- package/serializer/handlers/binary.d.ts +1 -1
- package/serializer/serializable.d.ts +1 -1
- package/serializer/types.d.ts +1 -1
- package/templates/module.d.ts +1 -1
- package/templates/renderers/handlebars.template-renderer.d.ts +1 -1
- package/templates/renderers/jsx.template-renderer.d.ts +1 -1
- package/templates/renderers/mjml.template-renderer.d.ts +1 -1
- package/templates/renderers/string.template-renderer.d.ts +1 -1
- package/templates/resolvers/file.template-resolver.d.ts +1 -1
- package/templates/resolvers/jsx.template-resolver.d.ts +1 -1
- package/templates/resolvers/string.template-resolver.d.ts +1 -1
- package/templates/template.model.d.ts +1 -1
- package/templates/template.renderer.d.ts +1 -1
- package/templates/template.service.d.ts +1 -1
- package/text/dynamic-text.model.d.ts +1 -1
- package/text/localization.service.d.ts +1 -1
- package/types/geo-json.d.ts +1 -1
- package/types/index.d.ts +2 -0
- package/types/tagged.d.ts +1 -1
- package/{types.d.ts → types/types.d.ts} +2 -1
- package/utils/async-hook/async-hook.d.ts +109 -0
- package/utils/async-hook/async-hook.js +77 -3
- package/utils/backoff.d.ts +125 -43
- package/utils/backoff.js +140 -65
- package/utils/base64.d.ts +1 -1
- package/utils/base64.js +1 -2
- package/utils/binary.d.ts +1 -1
- package/utils/comparison.d.ts +5 -5
- package/utils/comparison.js +5 -3
- package/utils/cryptography.d.ts +1 -1
- package/utils/encoding.d.ts +1 -1
- package/utils/enum.d.ts +1 -1
- package/utils/equals.d.ts +1 -1
- package/utils/format-error.d.ts +1 -1
- package/utils/function/class.d.ts +1 -1
- package/utils/function/memoize.d.ts +1 -1
- package/utils/helpers.d.ts +1 -1
- package/utils/helpers.js +2 -2
- package/utils/jwt.d.ts +3 -3
- package/utils/merge.d.ts +1 -1
- package/utils/middleware.js +3 -3
- package/utils/object/decycle.d.ts +1 -1
- package/utils/object/forward-ref.d.ts +1 -1
- package/utils/object/lazy-property.d.ts +1 -1
- package/utils/object/object.d.ts +1 -1
- package/utils/object/property-name.d.ts +1 -1
- package/utils/patch-worker.d.ts +1 -1
- package/utils/reactive-value-to-signal.d.ts +1 -1
- package/utils/reflection.d.ts +1 -1
- package/utils/repl.d.ts +1 -1
- package/utils/singleton.d.ts +1 -1
- package/utils/stream/size-limited-stream.d.ts +1 -1
- package/utils/type/extends.d.ts +1 -1
- package/utils/type-guards.d.ts +1 -1
- package/utils/url-builder.d.ts +1 -1
- package/utils/z-base32.d.ts +1 -1
- package/module/utils.d.ts +0 -4
- package/module/utils.js +0 -21
- /package/{formats.d.ts → formats/formats.d.ts} +0 -0
- /package/{types.js → types/types.js} +0 -0
- /package/{web-types.d.ts → types/web-types.d.ts} +0 -0
- /package/{web-types.js → types/web-types.js} +0 -0
|
@@ -1,15 +1,54 @@
|
|
|
1
1
|
import type { HttpServerRequest } from '../../http/server/index.js';
|
|
2
|
-
import type { BinaryData, Record } from '../../types.js';
|
|
2
|
+
import type { BinaryData, Record } from '../../types/index.js';
|
|
3
3
|
import type { RefreshToken, SecretResetToken, Token } from '../models/index.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* @param request
|
|
7
|
-
* @param cookieName (
|
|
8
|
-
* @
|
|
5
|
+
* Tries to get the authorization token string from a request.
|
|
6
|
+
* @param request The request to get the token from.
|
|
7
|
+
* @param cookieName The name of the cookie to get the token from (defaults to 'authorization').
|
|
8
|
+
* @param fromCookieOnly Whether to only get the token from the cookie.
|
|
9
|
+
* @returns The token string or undefined if not found.
|
|
9
10
|
*/
|
|
10
11
|
export declare function tryGetAuthorizationTokenStringFromRequest(request: HttpServerRequest, cookieName?: string, fromCookieOnly?: boolean): string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Tries to get a token from a request.
|
|
14
|
+
* @param request The request to get the token from.
|
|
15
|
+
* @param tokenVersion The version of the token to get.
|
|
16
|
+
* @param secret The secret to use for validation.
|
|
17
|
+
* @returns The token or undefined if not found.
|
|
18
|
+
* @throws {InvalidTokenError} If the token is invalid.
|
|
19
|
+
*/
|
|
11
20
|
export declare function tryGetTokenFromRequest<AdditionalTokenPayload extends Record = Record<never>>(request: HttpServerRequest, tokenVersion: number, secret: string | BinaryData): Promise<Token<AdditionalTokenPayload> | undefined>;
|
|
21
|
+
/**
|
|
22
|
+
* Gets a token from a request.
|
|
23
|
+
* @param request The request to get the token from.
|
|
24
|
+
* @param tokenVersion The version of the token to get.
|
|
25
|
+
* @param secret The secret to use for validation.
|
|
26
|
+
* @returns The token.
|
|
27
|
+
* @throws {InvalidTokenError} If the token is invalid or not found.
|
|
28
|
+
*/
|
|
12
29
|
export declare function getTokenFromRequest<AdditionalTokenPayload extends Record = Record<never>>(request: HttpServerRequest, tokenVersion: number, secret: string | BinaryData): Promise<Token<AdditionalTokenPayload>>;
|
|
30
|
+
/**
|
|
31
|
+
* Gets a token from a token string.
|
|
32
|
+
* @param tokenString The token string to get the token from.
|
|
33
|
+
* @param tokenVersion The version of the token to get.
|
|
34
|
+
* @param secret The secret to use for validation.
|
|
35
|
+
* @returns The token.
|
|
36
|
+
* @throws {InvalidTokenError} If the token is invalid.
|
|
37
|
+
*/
|
|
13
38
|
export declare function getTokenFromString<AdditionalTokenPayload extends Record = Record<never>>(tokenString: string, tokenVersion: number, secret: string | BinaryData): Promise<Token<AdditionalTokenPayload>>;
|
|
39
|
+
/**
|
|
40
|
+
* Gets a refresh token from a token string.
|
|
41
|
+
* @param tokenString The token string to get the refresh token from.
|
|
42
|
+
* @param secret The secret to use for validation.
|
|
43
|
+
* @returns The refresh token.
|
|
44
|
+
* @throws {InvalidTokenError} If the refresh token is invalid.
|
|
45
|
+
*/
|
|
14
46
|
export declare function getRefreshTokenFromString(tokenString: string, secret: string | BinaryData): Promise<RefreshToken>;
|
|
47
|
+
/**
|
|
48
|
+
* Gets a secret reset token from a token string.
|
|
49
|
+
* @param tokenString The token string to get the secret reset token from.
|
|
50
|
+
* @param secret The secret to use for validation.
|
|
51
|
+
* @returns The secret reset token.
|
|
52
|
+
* @throws {InvalidTokenError} If the secret reset token is invalid.
|
|
53
|
+
*/
|
|
15
54
|
export declare function getSecretResetTokenFromString(tokenString: string, secret: string | BinaryData): Promise<SecretResetToken>;
|
|
@@ -4,10 +4,11 @@ import { currentTimestampSeconds } from '../../utils/date-time.js';
|
|
|
4
4
|
import { parseAndValidateJwtTokenString } from '../../utils/jwt.js';
|
|
5
5
|
import { isArray, isDefined, isUndefined } from '../../utils/type-guards.js';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @param request
|
|
9
|
-
* @param cookieName (
|
|
10
|
-
* @
|
|
7
|
+
* Tries to get the authorization token string from a request.
|
|
8
|
+
* @param request The request to get the token from.
|
|
9
|
+
* @param cookieName The name of the cookie to get the token from (defaults to 'authorization').
|
|
10
|
+
* @param fromCookieOnly Whether to only get the token from the cookie.
|
|
11
|
+
* @returns The token string or undefined if not found.
|
|
11
12
|
*/
|
|
12
13
|
export function tryGetAuthorizationTokenStringFromRequest(request, cookieName = 'authorization', fromCookieOnly = false) {
|
|
13
14
|
const authorizationHeaders = (fromCookieOnly || (cookieName.toLocaleLowerCase() != 'authorization')) ? undefined : request.headers.tryGet('Authorization');
|
|
@@ -24,6 +25,14 @@ export function tryGetAuthorizationTokenStringFromRequest(request, cookieName =
|
|
|
24
25
|
}
|
|
25
26
|
return undefined;
|
|
26
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Tries to get a token from a request.
|
|
30
|
+
* @param request The request to get the token from.
|
|
31
|
+
* @param tokenVersion The version of the token to get.
|
|
32
|
+
* @param secret The secret to use for validation.
|
|
33
|
+
* @returns The token or undefined if not found.
|
|
34
|
+
* @throws {InvalidTokenError} If the token is invalid.
|
|
35
|
+
*/
|
|
27
36
|
export async function tryGetTokenFromRequest(request, tokenVersion, secret) {
|
|
28
37
|
const tokenString = tryGetAuthorizationTokenStringFromRequest(request);
|
|
29
38
|
if (isUndefined(tokenString)) {
|
|
@@ -31,6 +40,14 @@ export async function tryGetTokenFromRequest(request, tokenVersion, secret) {
|
|
|
31
40
|
}
|
|
32
41
|
return getTokenFromString(tokenString, tokenVersion, secret);
|
|
33
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Gets a token from a request.
|
|
45
|
+
* @param request The request to get the token from.
|
|
46
|
+
* @param tokenVersion The version of the token to get.
|
|
47
|
+
* @param secret The secret to use for validation.
|
|
48
|
+
* @returns The token.
|
|
49
|
+
* @throws {InvalidTokenError} If the token is invalid or not found.
|
|
50
|
+
*/
|
|
34
51
|
export async function getTokenFromRequest(request, tokenVersion, secret) {
|
|
35
52
|
const token = await tryGetTokenFromRequest(request, tokenVersion, secret);
|
|
36
53
|
if (isUndefined(token)) {
|
|
@@ -38,6 +55,14 @@ export async function getTokenFromRequest(request, tokenVersion, secret) {
|
|
|
38
55
|
}
|
|
39
56
|
return token;
|
|
40
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Gets a token from a token string.
|
|
60
|
+
* @param tokenString The token string to get the token from.
|
|
61
|
+
* @param tokenVersion The version of the token to get.
|
|
62
|
+
* @param secret The secret to use for validation.
|
|
63
|
+
* @returns The token.
|
|
64
|
+
* @throws {InvalidTokenError} If the token is invalid.
|
|
65
|
+
*/
|
|
41
66
|
export async function getTokenFromString(tokenString, tokenVersion, secret) {
|
|
42
67
|
if (isUndefined(tokenString)) {
|
|
43
68
|
throw new InvalidTokenError('Missing authorization token');
|
|
@@ -51,6 +76,13 @@ export async function getTokenFromString(tokenString, tokenVersion, secret) {
|
|
|
51
76
|
}
|
|
52
77
|
return validatedToken;
|
|
53
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Gets a refresh token from a token string.
|
|
81
|
+
* @param tokenString The token string to get the refresh token from.
|
|
82
|
+
* @param secret The secret to use for validation.
|
|
83
|
+
* @returns The refresh token.
|
|
84
|
+
* @throws {InvalidTokenError} If the refresh token is invalid.
|
|
85
|
+
*/
|
|
54
86
|
export async function getRefreshTokenFromString(tokenString, secret) {
|
|
55
87
|
if (isUndefined(tokenString)) {
|
|
56
88
|
throw new InvalidTokenError('Missing refresh token');
|
|
@@ -61,6 +93,13 @@ export async function getRefreshTokenFromString(tokenString, secret) {
|
|
|
61
93
|
}
|
|
62
94
|
return validatedRefreshToken;
|
|
63
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Gets a secret reset token from a token string.
|
|
98
|
+
* @param tokenString The token string to get the secret reset token from.
|
|
99
|
+
* @param secret The secret to use for validation.
|
|
100
|
+
* @returns The secret reset token.
|
|
101
|
+
* @throws {InvalidTokenError} If the secret reset token is invalid.
|
|
102
|
+
*/
|
|
64
103
|
export async function getSecretResetTokenFromString(tokenString, secret) {
|
|
65
104
|
if (isUndefined(tokenString)) {
|
|
66
105
|
throw new InvalidTokenError('Missing secret reset token');
|
|
@@ -3,12 +3,34 @@ import type { InjectionToken } from '../../injector/token.js';
|
|
|
3
3
|
import type { DatabaseConfig } from '../../orm/server/module.js';
|
|
4
4
|
import { AuthenticationAncillaryService } from './authentication-ancillary.service.js';
|
|
5
5
|
import { AuthenticationService, AuthenticationServiceOptions } from './authentication.service.js';
|
|
6
|
+
/**
|
|
7
|
+
* Configuration for {@link configureAuthenticationServer}.
|
|
8
|
+
*/
|
|
6
9
|
export declare class AuthenticationModuleConfig {
|
|
10
|
+
/**
|
|
11
|
+
* Database configuration for authentication module.
|
|
12
|
+
* If not provided, the global database configuration is used.
|
|
13
|
+
*/
|
|
7
14
|
database?: DatabaseConfig;
|
|
15
|
+
/**
|
|
16
|
+
* Options for {@link AuthenticationService}.
|
|
17
|
+
*/
|
|
8
18
|
serviceOptions?: AuthenticationServiceOptions | Provider<AuthenticationServiceOptions>;
|
|
9
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Override default {@link AuthenticationService}.
|
|
21
|
+
*/
|
|
10
22
|
authenticationService?: InjectionToken<AuthenticationService<any, any, any>>;
|
|
23
|
+
/**
|
|
24
|
+
* Override default {@link AuthenticationAncillaryService}.
|
|
25
|
+
*/
|
|
11
26
|
authenticationAncillaryService?: InjectionToken<AuthenticationAncillaryService<any, any, any>>;
|
|
12
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Configures authentication server services.
|
|
30
|
+
* @param config Configuration.
|
|
31
|
+
*/
|
|
13
32
|
export declare function configureAuthenticationServer(config: AuthenticationModuleConfig): void;
|
|
33
|
+
/**
|
|
34
|
+
* Migrates the authentication schema.
|
|
35
|
+
*/
|
|
14
36
|
export declare function migrateAuthenticationSchema(): Promise<void>;
|
|
@@ -5,13 +5,32 @@ import { Database, migrate } from '../../orm/server/index.js';
|
|
|
5
5
|
import { isDefined } from '../../utils/type-guards.js';
|
|
6
6
|
import { AuthenticationAncillaryService } from './authentication-ancillary.service.js';
|
|
7
7
|
import { AuthenticationService, AuthenticationServiceOptions } from './authentication.service.js';
|
|
8
|
+
/**
|
|
9
|
+
* Configuration for {@link configureAuthenticationServer}.
|
|
10
|
+
*/
|
|
8
11
|
export class AuthenticationModuleConfig {
|
|
12
|
+
/**
|
|
13
|
+
* Database configuration for authentication module.
|
|
14
|
+
* If not provided, the global database configuration is used.
|
|
15
|
+
*/
|
|
9
16
|
database;
|
|
17
|
+
/**
|
|
18
|
+
* Options for {@link AuthenticationService}.
|
|
19
|
+
*/
|
|
10
20
|
serviceOptions;
|
|
11
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Override default {@link AuthenticationService}.
|
|
23
|
+
*/
|
|
12
24
|
authenticationService;
|
|
25
|
+
/**
|
|
26
|
+
* Override default {@link AuthenticationAncillaryService}.
|
|
27
|
+
*/
|
|
13
28
|
authenticationAncillaryService;
|
|
14
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Configures authentication server services.
|
|
32
|
+
* @param config Configuration.
|
|
33
|
+
*/
|
|
15
34
|
export function configureAuthenticationServer(config) {
|
|
16
35
|
Injector.register(AuthenticationModuleConfig, { useValue: config });
|
|
17
36
|
if (isDefined(config.serviceOptions)) {
|
|
@@ -27,6 +46,9 @@ export function configureAuthenticationServer(config) {
|
|
|
27
46
|
Injector.registerSingleton(AuthenticationAncillaryService, { useToken: config.authenticationAncillaryService });
|
|
28
47
|
}
|
|
29
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Migrates the authentication schema.
|
|
51
|
+
*/
|
|
30
52
|
export async function migrateAuthenticationSchema() {
|
|
31
53
|
const connection = inject(AuthenticationModuleConfig, undefined, { optional: true })?.database?.connection;
|
|
32
54
|
const database = inject(Database, connection);
|
|
@@ -4,7 +4,7 @@ import { disposeAsync } from '../disposable/disposable.js';
|
|
|
4
4
|
import type { Resolvable } from '../injector/interfaces.js';
|
|
5
5
|
import { afterResolve, resolveArgumentType } from '../injector/interfaces.js';
|
|
6
6
|
import type { Logger } from '../logger/logger.js';
|
|
7
|
-
import type { Record } from '../types.js';
|
|
7
|
+
import type { Record } from '../types/index.js';
|
|
8
8
|
import type { Tagged } from 'type-fest';
|
|
9
9
|
import type { NewBrowserContextOptions } from './browser-controller.js';
|
|
10
10
|
import type { PageControllerOptions } from './page-controller.js';
|
|
@@ -2,7 +2,7 @@ import type { Browser, BrowserContext } from 'playwright';
|
|
|
2
2
|
import type { AsyncDisposable } from '../disposable/disposable.js';
|
|
3
3
|
import { disposeAsync } from '../disposable/disposable.js';
|
|
4
4
|
import type { Resolvable, resolveArgumentType } from '../injector/interfaces.js';
|
|
5
|
-
import type { Record } from '../types.js';
|
|
5
|
+
import type { Record } from '../types/index.js';
|
|
6
6
|
import type { BrowserContextControllerOptions, BrowserContextState, NewPageOptions } from './browser-context-controller.js';
|
|
7
7
|
import { BrowserContextController } from './browser-context-controller.js';
|
|
8
8
|
import type { NewBrowserOptions } from './browser.service.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ElementHandle, Locator } from 'playwright';
|
|
2
|
-
import type { Merge, NonUndefinable, TypedOmit } from '../types.js';
|
|
2
|
+
import type { Merge, NonUndefinable, TypedOmit } from '../types/index.js';
|
|
3
3
|
import type { ActionDelayOptions, Delay, TimeoutOptions } from './types.js';
|
|
4
4
|
export type TypeDelayOptions = {
|
|
5
5
|
typeDelay?: Delay;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Frame, FrameLocator, Locator, Page } from 'playwright';
|
|
2
|
-
import type { NonUndefinable, SimplifyObject } from '../types.js';
|
|
2
|
+
import type { NonUndefinable, SimplifyObject } from '../types/index.js';
|
|
3
3
|
import type { ElementControllerOptions } from './element-controller.js';
|
|
4
4
|
import { ElementController } from './element-controller.js';
|
|
5
5
|
export declare class LocatorController<T extends Page | Frame | Locator | FrameLocator = Page | Frame | Locator | FrameLocator> {
|
package/context/context.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Entity, MaybeNewEntity } from '../../database/index.js';
|
|
2
|
-
import type { Record } from '../../types.js';
|
|
2
|
+
import type { Record } from '../../types/index.js';
|
|
3
3
|
import type { FindOneAndUpdateOptions } from 'mongodb';
|
|
4
4
|
import type { Collection } from './classes.js';
|
|
5
5
|
import { MongoBulk } from './mongo-bulk.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Entity } from '../../database/index.js';
|
|
2
|
-
import type { Paths, TypedOmit } from '../../types.js';
|
|
2
|
+
import type { Paths, TypedOmit } from '../../types/index.js';
|
|
3
3
|
import type * as Mongo from 'mongodb';
|
|
4
4
|
import type { MongoDocument } from './model/document.js';
|
|
5
5
|
export type MongoConnection = {
|
package/database/query.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ __decorate([
|
|
|
39
39
|
], DocumentAssignmentTask.prototype, "target", void 0);
|
|
40
40
|
DocumentAssignmentTask = __decorate([
|
|
41
41
|
DocumentManagementTable({ name: 'assignment_task' }),
|
|
42
|
+
Unique(['tenantId', 'id']),
|
|
42
43
|
ForeignKey(() => Document, ['tenantId', 'documentId'], ['tenantId', 'id'])
|
|
43
44
|
], DocumentAssignmentTask);
|
|
44
45
|
export { DocumentAssignmentTask };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type TableOptions } from '../../orm/decorators.js';
|
|
2
|
-
import type { TypedOmit } from '../../types.js';
|
|
2
|
+
import type { TypedOmit } from '../../types/index.js';
|
|
3
3
|
export declare function DocumentManagementTable(options?: TypedOmit<TableOptions, 'schema'>): ClassDecorator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Entity } from '../../orm/entity.js';
|
|
2
2
|
import { Json } from '../../orm/types.js';
|
|
3
|
-
import type { Record } from '../../types.js';
|
|
3
|
+
import type { Record } from '../../types/index.js';
|
|
4
4
|
export declare class DocumentValidationDefinition extends Entity {
|
|
5
5
|
static readonly entityName: 'DocumentValidationDefinition';
|
|
6
6
|
tenantId: string | null;
|
|
@@ -72,6 +72,7 @@ __decorate([
|
|
|
72
72
|
], DocumentValidationExecution.prototype, "completedAt", void 0);
|
|
73
73
|
DocumentValidationExecution = __decorate([
|
|
74
74
|
DocumentManagementTable({ name: 'validation_execution' }),
|
|
75
|
+
Unique(['tenantId', 'id']),
|
|
75
76
|
Unique(['tenantId', 'workflowId', 'definitionId']),
|
|
76
77
|
ForeignKey(() => DocumentWorkflow, ['tenantId', 'workflowId'], ['tenantId', 'id'])
|
|
77
78
|
], DocumentValidationExecution);
|
|
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
import { defineEnum } from '../../enumeration/enumeration.js';
|
|
11
11
|
import { ForeignKey, References } from '../../orm/decorators.js';
|
|
12
12
|
import { Entity } from '../../orm/entity.js';
|
|
13
|
-
import { Index, Timestamp, Uuid } from '../../orm/types.js';
|
|
13
|
+
import { Index, Timestamp, Unique, Uuid } from '../../orm/types.js';
|
|
14
14
|
import { Enumeration } from '../../schema/index.js';
|
|
15
15
|
import { DocumentManagementTable } from './document-management-table.js';
|
|
16
16
|
import { Document } from './document.model.js';
|
|
@@ -77,6 +77,7 @@ __decorate([
|
|
|
77
77
|
DocumentWorkflow = __decorate([
|
|
78
78
|
DocumentManagementTable({ name: 'workflow' }),
|
|
79
79
|
Index(['documentId'], { unique: true, where: () => ({ state: { $neq: DocumentWorkflowState.Completed } }) }),
|
|
80
|
-
ForeignKey(() => Document, ['tenantId', 'documentId'], ['tenantId', 'id'])
|
|
80
|
+
ForeignKey(() => Document, ['tenantId', 'documentId'], ['tenantId', 'id']),
|
|
81
|
+
Unique(['tenantId', 'id'])
|
|
81
82
|
], DocumentWorkflow);
|
|
82
83
|
export { DocumentWorkflow };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ApiController, type ApiRequestContext, type ApiServerResult } from '../../../api/index.js';
|
|
2
|
-
import { type DocumentManagementApiDefinition } from '
|
|
2
|
+
import { type DocumentManagementApiDefinition } from '../../api/index.js';
|
|
3
3
|
export declare class DocumentManagementApiController implements ApiController<DocumentManagementApiDefinition> {
|
|
4
4
|
#private;
|
|
5
5
|
loadData(context: ApiRequestContext<DocumentManagementApiDefinition, 'loadData'>): Promise<ApiServerResult<DocumentManagementApiDefinition, 'loadData'>>;
|
|
@@ -11,9 +11,6 @@ import { match, P } from 'ts-pattern';
|
|
|
11
11
|
import { createErrorResponse } from '../../../api/index.js';
|
|
12
12
|
import { apiController } from '../../../api/server/index.js';
|
|
13
13
|
import { CancellationSignal } from '../../../cancellation/token.js';
|
|
14
|
-
import { documentManagementApiDefinition } from '../../../document-management/api/index.js';
|
|
15
|
-
import { DocumentManagementAuthorizationService } from '../../../document-management/authorization/index.js';
|
|
16
|
-
import { DocumentRequestCollectionAssignment } from '../../../document-management/models/document-request-collection-assignment.model.js';
|
|
17
14
|
import { ForbiddenError, NotImplementedError } from '../../../errors/index.js';
|
|
18
15
|
import { HttpServerResponse } from '../../../http/index.js';
|
|
19
16
|
import { inject } from '../../../injector/index.js';
|
|
@@ -23,6 +20,9 @@ import { ServerSentEventsSource } from '../../../sse/server-sent-events-source.j
|
|
|
23
20
|
import { toArray } from '../../../utils/array/index.js';
|
|
24
21
|
import { tryIgnoreAsync } from '../../../utils/try-ignore.js';
|
|
25
22
|
import { isDefined, isUndefined } from '../../../utils/type-guards.js';
|
|
23
|
+
import { documentManagementApiDefinition } from '../../api/index.js';
|
|
24
|
+
import { DocumentManagementAuthorizationService } from '../../authorization/index.js';
|
|
25
|
+
import { DocumentRequestCollectionAssignment } from '../../models/document-request-collection-assignment.model.js';
|
|
26
26
|
import { DocumentCategoryTypeService, DocumentFileService, DocumentManagementService, DocumentRequestService, DocumentService, DocumentWorkflowService } from '../services/index.js';
|
|
27
27
|
const jsonDiffPatch = createDiffPatch({
|
|
28
28
|
omitRemovedValues: true,
|
package/document-management/server/drizzle/{0000_parallel_mantis.sql → 0000_ordinary_pretty_boy.sql}
RENAMED
|
@@ -54,7 +54,8 @@ CREATE TABLE "document_management"."assignment_task" (
|
|
|
54
54
|
"create_timestamp" timestamp with time zone NOT NULL,
|
|
55
55
|
"delete_timestamp" timestamp with time zone,
|
|
56
56
|
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL,
|
|
57
|
-
CONSTRAINT "assignment_task_document_id_unique" UNIQUE("document_id")
|
|
57
|
+
CONSTRAINT "assignment_task_document_id_unique" UNIQUE("document_id"),
|
|
58
|
+
CONSTRAINT "assignment_task_tenant_id_id_unique" UNIQUE("tenant_id","id")
|
|
58
59
|
);
|
|
59
60
|
--> statement-breakpoint
|
|
60
61
|
CREATE TABLE "document_management"."category" (
|
|
@@ -277,7 +278,8 @@ CREATE TABLE "document_management"."validation_execution" (
|
|
|
277
278
|
"create_timestamp" timestamp with time zone NOT NULL,
|
|
278
279
|
"delete_timestamp" timestamp with time zone,
|
|
279
280
|
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL,
|
|
280
|
-
CONSTRAINT "validation_execution_tenant_id_workflow_id_definition_id_unique" UNIQUE("tenant_id","workflow_id","definition_id")
|
|
281
|
+
CONSTRAINT "validation_execution_tenant_id_workflow_id_definition_id_unique" UNIQUE("tenant_id","workflow_id","definition_id"),
|
|
282
|
+
CONSTRAINT "validation_execution_tenant_id_id_unique" UNIQUE("tenant_id","id")
|
|
281
283
|
);
|
|
282
284
|
--> statement-breakpoint
|
|
283
285
|
CREATE TABLE "document_management"."validation_execution_related_document" (
|
|
@@ -306,7 +308,8 @@ CREATE TABLE "document_management"."workflow" (
|
|
|
306
308
|
"revision_timestamp" timestamp with time zone NOT NULL,
|
|
307
309
|
"create_timestamp" timestamp with time zone NOT NULL,
|
|
308
310
|
"delete_timestamp" timestamp with time zone,
|
|
309
|
-
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
311
|
+
"attributes" jsonb DEFAULT '{}'::jsonb NOT NULL,
|
|
312
|
+
CONSTRAINT "workflow_tenant_id_id_unique" UNIQUE("tenant_id","id")
|
|
310
313
|
);
|
|
311
314
|
--> statement-breakpoint
|
|
312
315
|
ALTER TABLE "document_management"."document" ADD CONSTRAINT "document_type_id_type_id_fk" FOREIGN KEY ("type_id") REFERENCES "document_management"."type"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
2
|
+
"id": "bbddb1b8-fa09-4465-8016-5a9b7915023d",
|
|
3
3
|
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
4
4
|
"version": "7",
|
|
5
5
|
"dialect": "postgresql",
|
|
@@ -406,6 +406,14 @@
|
|
|
406
406
|
"columns": [
|
|
407
407
|
"document_id"
|
|
408
408
|
]
|
|
409
|
+
},
|
|
410
|
+
"assignment_task_tenant_id_id_unique": {
|
|
411
|
+
"name": "assignment_task_tenant_id_id_unique",
|
|
412
|
+
"nullsNotDistinct": false,
|
|
413
|
+
"columns": [
|
|
414
|
+
"tenant_id",
|
|
415
|
+
"id"
|
|
416
|
+
]
|
|
409
417
|
}
|
|
410
418
|
},
|
|
411
419
|
"policies": {},
|
|
@@ -2263,6 +2271,14 @@
|
|
|
2263
2271
|
"workflow_id",
|
|
2264
2272
|
"definition_id"
|
|
2265
2273
|
]
|
|
2274
|
+
},
|
|
2275
|
+
"validation_execution_tenant_id_id_unique": {
|
|
2276
|
+
"name": "validation_execution_tenant_id_id_unique",
|
|
2277
|
+
"nullsNotDistinct": false,
|
|
2278
|
+
"columns": [
|
|
2279
|
+
"tenant_id",
|
|
2280
|
+
"id"
|
|
2281
|
+
]
|
|
2266
2282
|
}
|
|
2267
2283
|
},
|
|
2268
2284
|
"policies": {},
|
|
@@ -2548,7 +2564,16 @@
|
|
|
2548
2564
|
}
|
|
2549
2565
|
},
|
|
2550
2566
|
"compositePrimaryKeys": {},
|
|
2551
|
-
"uniqueConstraints": {
|
|
2567
|
+
"uniqueConstraints": {
|
|
2568
|
+
"workflow_tenant_id_id_unique": {
|
|
2569
|
+
"name": "workflow_tenant_id_id_unique",
|
|
2570
|
+
"nullsNotDistinct": false,
|
|
2571
|
+
"columns": [
|
|
2572
|
+
"tenant_id",
|
|
2573
|
+
"id"
|
|
2574
|
+
]
|
|
2575
|
+
}
|
|
2576
|
+
},
|
|
2552
2577
|
"policies": {},
|
|
2553
2578
|
"checkConstraints": {},
|
|
2554
2579
|
"isRLSEnabled": false
|
|
@@ -2,7 +2,7 @@ import { Document, DocumentAssignmentScope, DocumentAssignmentTask, DocumentCate
|
|
|
2
2
|
export declare const documentManagementSchema: import("../../orm/server/database-schema.js").DatabaseSchema<"document_management">;
|
|
3
3
|
export declare const documentApproval: import("drizzle-orm/pg-core").PgEnum<["pending", "approved", "rejected"]>;
|
|
4
4
|
export declare const documentAssignmentTarget: import("drizzle-orm/pg-core").PgEnum<["request", "collection"]>;
|
|
5
|
-
export declare const documentPropertyDataType: import("drizzle-orm/pg-core").PgEnum<["boolean", "date", "
|
|
5
|
+
export declare const documentPropertyDataType: import("drizzle-orm/pg-core").PgEnum<["boolean", "date", "text", "decimal", "integer"]>;
|
|
6
6
|
export declare const documentRequestState: import("drizzle-orm/pg-core").PgEnum<["open", "closed", "fulfilled"]>;
|
|
7
7
|
export declare const documentValidationExecutionState: import("drizzle-orm/pg-core").PgEnum<["pending", "error", "running", "completed"]>;
|
|
8
8
|
export declare const documentValidationResultStatus: import("drizzle-orm/pg-core").PgEnum<["warning", "failed", "passed"]>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { DocumentCollectionMetadata } from '../../../document-management/service-models/index.js';
|
|
2
1
|
import { type EntityMetadataInsert, type Query } from '../../../orm/index.js';
|
|
3
2
|
import { Transactional } from '../../../orm/server/index.js';
|
|
4
|
-
import type { OneOrMany } from '../../../types.js';
|
|
3
|
+
import type { OneOrMany } from '../../../types/index.js';
|
|
5
4
|
import { Document, DocumentCollection } from '../../models/index.js';
|
|
5
|
+
import type { DocumentCollectionMetadata } from '../../service-models/index.js';
|
|
6
6
|
export declare class DocumentCollectionService extends Transactional {
|
|
7
7
|
#private;
|
|
8
8
|
readonly repository: import("../../../orm/server/repository.js").EntityRepository<DocumentCollection>;
|
|
@@ -79,7 +79,9 @@ import { DocumentFileService } from './document-file.service.js';
|
|
|
79
79
|
import { DocumentPropertyService } from './document-property.service.js';
|
|
80
80
|
import { DocumentTagService } from './document-tag.service.js';
|
|
81
81
|
import { DocumentManagementSingleton } from './singleton.js';
|
|
82
|
-
const
|
|
82
|
+
const CLASSIFY_MODEL = 'gemini-2.5-flash-lite-preview-06-17';
|
|
83
|
+
const EXTRACT_MODEL = 'gemini-2.5-flash';
|
|
84
|
+
const ASSIGN_MODEL = 'gemini-2.5-flash-lite-preview-06-17';
|
|
83
85
|
let DocumentManagementAiService = DocumentManagementAiService_1 = class DocumentManagementAiService {
|
|
84
86
|
#documentCollectionService = inject(DocumentCollectionService);
|
|
85
87
|
#documentTagService = inject(DocumentTagService);
|
|
@@ -103,7 +105,7 @@ let DocumentManagementAiService = DocumentManagementAiService_1 = class Document
|
|
|
103
105
|
const typeLabels = typeLabelEntries.map(({ label }) => label);
|
|
104
106
|
this.#logger.trace(`Classifying document ${document.id}`);
|
|
105
107
|
const documentTypeGeneration = await this.#aiService.generate({
|
|
106
|
-
model:
|
|
108
|
+
model: CLASSIFY_MODEL,
|
|
107
109
|
generationOptions: {
|
|
108
110
|
maxOutputTokens: 128,
|
|
109
111
|
temperature: 0.1,
|
|
@@ -175,7 +177,7 @@ let DocumentManagementAiService = DocumentManagementAiService_1 = class Document
|
|
|
175
177
|
const context = { existingTags };
|
|
176
178
|
this.#logger.trace(`Extracting document ${document.id}`);
|
|
177
179
|
const { json: extraction } = await this.#aiService.generate({
|
|
178
|
-
model:
|
|
180
|
+
model: EXTRACT_MODEL,
|
|
179
181
|
generationOptions: {
|
|
180
182
|
maxOutputTokens: 2048,
|
|
181
183
|
temperature: 0.2,
|
|
@@ -268,7 +270,7 @@ Antworte auf deutsch.`,
|
|
|
268
270
|
collections,
|
|
269
271
|
};
|
|
270
272
|
const result = await this.#aiService.generate({
|
|
271
|
-
model:
|
|
273
|
+
model: ASSIGN_MODEL,
|
|
272
274
|
generationOptions: {
|
|
273
275
|
maxOutputTokens: 100,
|
|
274
276
|
temperature: 0,
|
|
@@ -332,7 +334,7 @@ Ordne das Dokument unter "document" einer oder mehreren passenden Collection unt
|
|
|
332
334
|
requests,
|
|
333
335
|
};
|
|
334
336
|
const result = await this.#aiService.generate({
|
|
335
|
-
model:
|
|
337
|
+
model: ASSIGN_MODEL,
|
|
336
338
|
generationOptions: {
|
|
337
339
|
maxOutputTokens: 100,
|
|
338
340
|
temperature: 0,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DocumentCollectionMetadata } from '../../../document-management/service-models/index.js';
|
|
2
1
|
import type { DocumentCollection } from '../../models/index.js';
|
|
2
|
+
import type { DocumentCollectionMetadata } from '../../service-models/index.js';
|
|
3
3
|
export declare abstract class DocumentManagementAncillaryService {
|
|
4
4
|
/**
|
|
5
5
|
* Resolves application-specific metadata for a list of document collections.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { afterResolve } from '../../../injector/interfaces.js';
|
|
2
2
|
import { MessageBus } from '../../../message-bus/message-bus.js';
|
|
3
3
|
import { Database, type PgTransaction, type Transaction } from '../../../orm/server/index.js';
|
|
4
|
-
import type { OneOrMany } from '../../../types.js';
|
|
4
|
+
import type { OneOrMany } from '../../../types/index.js';
|
|
5
5
|
export declare class DocumentManagementObservationService {
|
|
6
6
|
#private;
|
|
7
7
|
readonly collectionsChangedMessageBus: MessageBus<string[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CancellationSignal } from '../../../cancellation/token.js';
|
|
2
2
|
import { Transactional } from '../../../orm/server/index.js';
|
|
3
|
-
import type { Record } from '../../../types.js';
|
|
3
|
+
import type { Record } from '../../../types/index.js';
|
|
4
4
|
import { DocumentCategory, DocumentType, type DocumentProperty, type DocumentPropertyDataType } from '../../models/index.js';
|
|
5
5
|
import type { DocumentManagementData, DocumentRequestsTemplateData } from '../../service-models/index.js';
|
|
6
6
|
export declare class DocumentManagementService extends Transactional {
|
|
@@ -100,7 +100,7 @@ let DocumentManagementService = DocumentManagementService_1 = class DocumentMana
|
|
|
100
100
|
const taskIds = assignmentScopes.map((scope) => scope.taskId);
|
|
101
101
|
const [requests, assignmentTasks] = await Promise.all([
|
|
102
102
|
this.#documentRequestRepository.withTransaction(tx).loadManyByQuery({ tenantId, id: { $in: requestIds } }, { order: { 'metadata.createTimestamp': 'desc' } }),
|
|
103
|
-
this.#documentAssignmentTaskRepository.withTransaction(tx).loadManyByQuery({ tenantId,
|
|
103
|
+
this.#documentAssignmentTaskRepository.withTransaction(tx).loadManyByQuery({ tenantId, id: { $in: taskIds } }),
|
|
104
104
|
]);
|
|
105
105
|
const assignmentDocumentIds = documentCollectionAssignments.map((assignment) => assignment.documentId);
|
|
106
106
|
const requestDocumentIds = requests.map((request) => request.documentId).filter(isNotNull);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Transactional } from '../../../orm/server/index.js';
|
|
2
|
-
import type { OneOrMany } from '../../../types.js';
|
|
2
|
+
import type { OneOrMany } from '../../../types/index.js';
|
|
3
3
|
import { DocumentProperty, DocumentPropertyDataType, type Document } from '../../models/index.js';
|
|
4
4
|
import type { DocumentPropertyValueView, DocumentPropertyView, SetDocumentPropertyParameters } from '../../service-models/index.js';
|
|
5
5
|
export declare class DocumentPropertyService extends Transactional {
|
|
@@ -32,14 +32,14 @@ export declare class DocumentPropertyService extends Transactional {
|
|
|
32
32
|
tableName: "document_property";
|
|
33
33
|
dataType: "string";
|
|
34
34
|
columnType: "PgEnumColumn";
|
|
35
|
-
data: "boolean" | "date" | "
|
|
35
|
+
data: "boolean" | "date" | "text" | "decimal" | "integer";
|
|
36
36
|
driverParam: string;
|
|
37
37
|
notNull: true;
|
|
38
38
|
hasDefault: false;
|
|
39
39
|
isPrimaryKey: false;
|
|
40
40
|
isAutoincrement: false;
|
|
41
41
|
hasRuntimeDefault: false;
|
|
42
|
-
enumValues: ["boolean", "date", "
|
|
42
|
+
enumValues: ["boolean", "date", "text", "decimal", "integer"];
|
|
43
43
|
baseColumn: never;
|
|
44
44
|
identity: undefined;
|
|
45
45
|
generated: undefined;
|