@tstdl/base 0.92.44 → 0.92.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/ai/ai-file.service.d.ts +3 -3
  2. package/ai/ai.service.d.ts +4 -4
  3. package/api/client/client.js +1 -0
  4. package/api/server/gateway.js +1 -1
  5. package/application/application.d.ts +1 -2
  6. package/authentication/client/api.client.d.ts +3 -3
  7. package/authentication/server/mongo/mongo-authentication-credentials.repository.js +1 -1
  8. package/authentication/server/mongo/mongo-authentication-session.repository.js +1 -1
  9. package/browser/browser-context-controller.js +1 -1
  10. package/browser/browser-controller.d.ts +1 -2
  11. package/browser/browser.service.d.ts +1 -2
  12. package/database/mongo/classes.d.ts +1 -2
  13. package/distributed-loop/distributed-loop.js +1 -1
  14. package/document-management/models/document-property-value.model.d.ts +1 -1
  15. package/document-management/models/document-request-template.d.ts +2 -2
  16. package/document-management/models/document-request.model.js +1 -0
  17. package/document-management/models/service-models/document.view-model.d.ts +1 -1
  18. package/document-management/server/services/document-management.service.d.ts +5 -5
  19. package/document-management/server/services/document-management.service.js +1 -1
  20. package/eslint.config.js +69 -0
  21. package/examples/reflection/basic.d.ts +1 -1
  22. package/examples/reflection/basic.js +2 -2
  23. package/http/client/adapters/undici.adapter.js +1 -1
  24. package/http/client/http-client.js +1 -1
  25. package/image-service/imgproxy/imgproxy-image-service.js +1 -1
  26. package/key-value-store/key-value.store.js +1 -0
  27. package/key-value-store/mongo/mongo-key-value.repository.js +1 -1
  28. package/lock/lock.js +1 -0
  29. package/lock/mongo/lock.js +3 -4
  30. package/lock/mongo/mongo-lock-repository.js +1 -1
  31. package/lock/provider.js +1 -0
  32. package/logger/logger.js +1 -0
  33. package/mail/mail.client.js +1 -0
  34. package/mail/repositories/mongo/mongo-mail-log.repository.js +1 -1
  35. package/message-bus/message-bus.js +1 -0
  36. package/migration/mongo/migration-state-repository.js +1 -1
  37. package/module/modules/web-server.module.d.ts +1 -2
  38. package/object-storage/object-storage.js +1 -0
  39. package/openid-connect/mongo-oidc-state.repository.js +1 -1
  40. package/orm/entity.d.ts +4 -3
  41. package/orm/entity.js +1 -1
  42. package/orm/query.d.ts +2 -1
  43. package/orm/server/database.d.ts +2 -2
  44. package/orm/server/drizzle/schema-converter.d.ts +10 -11
  45. package/orm/server/drizzle/schema-converter.js +1 -1
  46. package/orm/server/repository.d.ts +9 -8
  47. package/orm/server/repository.js +1 -0
  48. package/orm/types.d.ts +19 -23
  49. package/orm/types.js +0 -1
  50. package/package.json +7 -10
  51. package/pdf/pdf.service.js +1 -1
  52. package/queue/mongo/mongo-job.repository.js +1 -1
  53. package/queue/mongo/queue.provider.js +1 -0
  54. package/queue/queue.d.ts +1 -2
  55. package/schema/schemas/literal.d.ts +2 -2
  56. package/search-index/elastic/config.d.ts +1 -2
  57. package/serializer/serializer.js +2 -2
  58. package/signals/implementation/to-signal.d.ts +2 -2
  59. package/signals/implementation/writable-signal.d.ts +3 -3
  60. package/signals/implementation/writable-signal.js +0 -1
  61. package/templates/providers/file.template-provider.d.ts +1 -2
  62. package/templates/resolvers/file.template-resolver.d.ts +1 -1
  63. package/templates/resolvers/file.template-resolver.js +1 -0
  64. package/templates/resolvers/jsx.template-resolver.d.ts +1 -1
  65. package/text/localization.service.d.ts +2 -4
  66. package/tsconfig.json +6 -10
  67. package/tsconfig.server.json +1 -1
  68. package/types/index.d.ts +2 -0
  69. package/types/index.js +1 -0
  70. package/types/tagged.d.ts +16 -0
  71. package/types/tagged.js +1 -0
  72. package/types.d.ts +6 -10
  73. package/utils/async-iterable-helpers/multiplex.js +1 -2
  74. package/utils/benchmark.js +1 -1
  75. package/utils/comparison.js +0 -1
  76. package/utils/cryptography.d.ts +2 -4
  77. package/utils/event-loop.js +1 -2
  78. package/utils/iterable-helpers/first-or-default.js +0 -1
  79. package/utils/iterable-helpers/first.js +0 -1
  80. package/utils/iterable-helpers/group-to-map.js +1 -1
  81. package/utils/iterable-helpers/last-or-default.js +1 -1
  82. package/utils/object/merge.js +2 -2
  83. package/utils/object/object.d.ts +2 -2
  84. package/utils/periodic-reporter.js +1 -2
  85. package/utils/reflection.js +1 -1
  86. package/utils/repl.d.ts +1 -1
  87. package/utils/repl.js +0 -1
  88. package/utils/set.js +0 -1
  89. package/utils/stream/slice.js +2 -2
  90. package/utils/stream/stream-reader.js +0 -1
  91. package/utils/stream/to-bytes-stream.js +2 -2
  92. package/utils/string/snake-case.js +1 -1
  93. package/utils/timing.js +2 -2
  94. package/utils/type-guards.js +0 -1
  95. package/utils/units.js +0 -1
  96. package/utils/z-base32.js +0 -1
  97. package/.eslintrc.json +0 -281
@@ -1,7 +1,7 @@
1
1
  import '../polyfills.js';
2
- import { Resolvable, type resolveArgumentType } from '../injector/interfaces.js';
3
- import { AiServiceOptions } from './ai.service.js';
4
- import { FileContentPart, FileInput } from './types.js';
2
+ import type { Resolvable, resolveArgumentType } from '../injector/interfaces.js';
3
+ import type { AiServiceOptions } from './ai.service.js';
4
+ import type { FileContentPart, FileInput } from './types.js';
5
5
  export type AiFileServiceOptions = Pick<AiServiceOptions, 'apiKey' | 'keyFile' | 'vertex'>;
6
6
  export type AiFileServiceArgument = AiFileServiceOptions;
7
7
  type File = {
@@ -1,8 +1,8 @@
1
- import { Resolvable, type resolveArgumentType } from '../injector/interfaces.js';
2
- import { OneOrMany, SchemaTestable } from '../schema/index.js';
3
- import { Enumeration as EnumerationType, EnumerationValue } from '../types.js';
1
+ import type { Resolvable, resolveArgumentType } from '../injector/interfaces.js';
2
+ import { type OneOrMany, type SchemaTestable } from '../schema/index.js';
3
+ import type { Enumeration as EnumerationType, EnumerationValue } from '../types.js';
4
4
  import { AiSession } from './ai-session.js';
5
- import { AiModel, Content, ContentPart, FileContentPart, FileInput, GenerationOptions, GenerationRequest, GenerationResult, SchemaFunctionDeclarations, SchemaFunctionDeclarationsResult } from './types.js';
5
+ import { type AiModel, type Content, type ContentPart, type FileContentPart, type FileInput, type GenerationOptions, type GenerationRequest, type GenerationResult, type SchemaFunctionDeclarations, type SchemaFunctionDeclarationsResult } from './types.js';
6
6
  export type SpecializedGenerationResult<T> = {
7
7
  result: T;
8
8
  raw: GenerationResult;
@@ -2,6 +2,7 @@ import { HttpClient, HttpClientRequest } from '../../http/client/index.js';
2
2
  import { normalizeSingleHttpValue } from '../../http/types.js';
3
3
  import { inject } from '../../injector/inject.js';
4
4
  import { Injector } from '../../injector/injector.js';
5
+ import { resolveArgumentType } from '../../injector/interfaces.js';
5
6
  import { Schema } from '../../schema/index.js';
6
7
  import { ServerSentEvents } from '../../sse/server-sent-events.js';
7
8
  import { toArray } from '../../utils/array/array.js';
@@ -15,7 +15,7 @@ import { BadRequestError } from '../../errors/bad-request.error.js';
15
15
  import { NotFoundError } from '../../errors/not-found.error.js';
16
16
  import { NotImplementedError } from '../../errors/not-implemented.error.js';
17
17
  import { HttpServerResponse } from '../../http/server/index.js';
18
- import { InjectArg, ResolveArg, Singleton } from '../../injector/index.js';
18
+ import { InjectArg, ResolveArg, Singleton, resolveArgumentType } from '../../injector/index.js';
19
19
  import { Logger } from '../../logger/index.js';
20
20
  import { Schema } from '../../schema/index.js';
21
21
  import { ServerSentEventsSource } from '../../sse/server-sent-events-source.js';
@@ -1,6 +1,5 @@
1
1
  import type { CancellationSignal } from '../cancellation/token.js';
2
- import type { Resolvable } from '../injector/interfaces.js';
3
- import { resolveArgumentType } from '../injector/interfaces.js';
2
+ import type { Resolvable, resolveArgumentType } from '../injector/interfaces.js';
4
3
  import type { LoggerArgument } from '../logger/index.js';
5
4
  import type { Module } from '../module/module.js';
6
5
  import type { FunctionModuleFunction } from '../module/modules/function.module.js';
@@ -1,7 +1,7 @@
1
- import { ApiClient } from '../../api/client/index.js';
2
- import { ObjectSchemaOrType, SchemaTestable } from '../../schema/index.js';
1
+ import { type ApiClient } from '../../api/client/index.js';
2
+ import { type ObjectSchemaOrType, type SchemaTestable } from '../../schema/index.js';
3
3
  import type { Record } from '../../types.js';
4
- import { AuthenticationApiDefinition } from '../authentication.api.js';
4
+ import { type AuthenticationApiDefinition } from '../authentication.api.js';
5
5
  export declare function getAuthenticationApiClient<AdditionalTokenPayload extends Record, AuthenticationData, AdditionalInitSecretResetData extends Record>(additionalTokenPayloadSchema: ObjectSchemaOrType<AdditionalTokenPayload>, authenticationDataSchema: SchemaTestable<AuthenticationData>, additionalInitSecretResetData: ObjectSchemaOrType<AdditionalInitSecretResetData>): ApiClient<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>>;
6
6
  declare const defaultAuthenticationApiClient: ApiClient<AuthenticationApiDefinition<import("type-fest").EmptyObject, unknown, import("type-fest").EmptyObject>>;
7
7
  export declare class AuthenticationApiClient extends defaultAuthenticationApiClient {
@@ -12,7 +12,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  };
13
13
  import { getNewId } from '../../../database/index.js';
14
14
  import { Collection, MongoEntityRepository, noopTransformer } from '../../../database/mongo/index.js';
15
- import { ForwardArg, Singleton } from '../../../injector/index.js';
15
+ import { ForwardArg, Singleton, resolveArgumentType } from '../../../injector/index.js';
16
16
  import { Logger } from '../../../logger/index.js';
17
17
  import { isUndefined } from '../../../utils/type-guards.js';
18
18
  import { AuthenticationCredentialsRepository } from '../authentication-credentials.repository.js';
@@ -11,7 +11,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
13
  import { Collection, MongoEntityRepository, noopTransformer } from '../../../database/mongo/index.js';
14
- import { ForwardArg, Singleton } from '../../../injector/index.js';
14
+ import { ForwardArg, Singleton, resolveArgumentType } from '../../../injector/index.js';
15
15
  import { Logger } from '../../../logger/index.js';
16
16
  import { AuthenticationSessionRepository } from '../authentication-session.repository.js';
17
17
  let defaultArgument;
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  };
10
10
  import { disposeAsync } from '../disposable/disposable.js';
11
11
  import { Injectable } from '../injector/decorators.js';
12
- import { afterResolve } from '../injector/interfaces.js';
12
+ import { afterResolve, resolveArgumentType } from '../injector/interfaces.js';
13
13
  import { filterUndefinedFromRecord } from '../utils/object/object.js';
14
14
  import { isDefined } from '../utils/type-guards.js';
15
15
  import { BrowserController } from './browser-controller.js';
@@ -1,8 +1,7 @@
1
1
  import type { Browser, BrowserContext } from 'playwright';
2
2
  import type { AsyncDisposable } from '../disposable/disposable.js';
3
3
  import { disposeAsync } from '../disposable/disposable.js';
4
- import type { Resolvable } from '../injector/interfaces.js';
5
- import { resolveArgumentType } from '../injector/interfaces.js';
4
+ import type { Resolvable, resolveArgumentType } from '../injector/interfaces.js';
6
5
  import type { Record } from '../types.js';
7
6
  import type { BrowserContextControllerOptions, BrowserContextState, NewPageOptions } from './browser-context-controller.js';
8
7
  import { BrowserContextController } from './browser-context-controller.js';
@@ -1,8 +1,7 @@
1
1
  import type { Browser, LaunchOptions } from 'playwright';
2
2
  import type { AsyncDisposable } from '../disposable/disposable.js';
3
3
  import { disposeAsync } from '../disposable/disposable.js';
4
- import type { Resolvable } from '../injector/interfaces.js';
5
- import { resolveArgumentType } from '../injector/interfaces.js';
4
+ import type { Resolvable, resolveArgumentType } from '../injector/interfaces.js';
6
5
  import { BrowserContextController } from './browser-context-controller.js';
7
6
  import type { BrowserControllerOptions, NewBrowserContextOptions } from './browser-controller.js';
8
7
  import { BrowserController } from './browser-controller.js';
@@ -1,6 +1,5 @@
1
- import { resolveArgumentType } from '../../injector/interfaces.js';
2
1
  import type { Entity } from '../../database/index.js';
3
- import type { Resolvable } from '../../injector/interfaces.js';
2
+ import type { Resolvable, resolveArgumentType } from '../../injector/interfaces.js';
4
3
  import { Db, Collection as MongoCollection, MongoClient as MongoMongoClient } from 'mongodb';
5
4
  import type { MongoDocument } from './model/document.js';
6
5
  import type { MongoConnection, MongoRepositoryConfig } from './types.js';
@@ -11,7 +11,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
13
  import { CancellationToken } from '../cancellation/index.js';
14
- import { InjectArg, Injectable } from '../injector/index.js';
14
+ import { InjectArg, Injectable, resolveArgumentType } from '../injector/index.js';
15
15
  import { LockProvider } from '../lock/index.js';
16
16
  import { DeferredPromise } from '../promise/deferred-promise.js';
17
17
  import { Timer } from '../utils/timer.js';
@@ -1,6 +1,6 @@
1
1
  import { Entity } from '../../orm/entity.js';
2
2
  import { Uuid } from '../../orm/types.js';
3
- import { SchemaOutput } from '../../schema/index.js';
3
+ import { type SchemaOutput } from '../../schema/index.js';
4
4
  export declare abstract class DocumentPropertyValueBase extends Entity {
5
5
  documentId: Uuid;
6
6
  propertyId: Uuid;
@@ -1,7 +1,7 @@
1
1
  import { Entity } from '../../orm/entity.js';
2
2
  import { Uuid } from '../../orm/types.js';
3
- import { TypedOmit } from '../../types.js';
4
- import { DocumentRequest } from './document-request.model.js';
3
+ import type { TypedOmit } from '../../types.js';
4
+ import type { DocumentRequest } from './document-request.model.js';
5
5
  export declare class DocumentRequestTemplate extends Entity implements TypedOmit<DocumentRequest, 'completed'> {
6
6
  requestsTemplateId: Uuid;
7
7
  typeId: Uuid | null;
@@ -12,6 +12,7 @@ import { Entity } from '../../orm/entity.js';
12
12
  import { Uuid } from '../../orm/types.js';
13
13
  import { BooleanProperty, Integer, StringProperty } from '../../schema/index.js';
14
14
  import { DocumentType } from './document-type.model.js';
15
+ import { Document } from './document.model.js';
15
16
  export class DocumentRequest extends Entity {
16
17
  typeId;
17
18
  requiredFilesCount;
@@ -2,7 +2,7 @@ import { Timestamp } from '../../../orm/types.js';
2
2
  import { DocumentCategory } from '../document-category.model.js';
3
3
  import { DocumentCollection } from '../document-collection.model.js';
4
4
  import { DocumentFile } from '../document-file.model.js';
5
- import { DocumentPropertyValue } from '../document-property-value.model.js';
5
+ import { type DocumentPropertyValue } from '../document-property-value.model.js';
6
6
  import { DocumentRequestFile } from '../document-request-file.model.js';
7
7
  import { DocumentRequest } from '../document-request.model.js';
8
8
  import { DocumentType } from '../document-type.model.js';
@@ -1,9 +1,9 @@
1
- import { Resolvable, resolveArgumentType } from '../../../injector/index.js';
1
+ import { type Resolvable, resolveArgumentType } from '../../../injector/index.js';
2
2
  import { ObjectStorage } from '../../../object-storage/index.js';
3
- import { Query } from '../../../orm/index.js';
4
- import { Transaction } from '../../../orm/server/index.js';
5
- import { OneOrMany } from '../../../types.js';
6
- import { AddOrArchiveDocumentToOrFromCollectionParameters, ApplyDocumentRequestsTemplateParameters, ApproveDocumentRequestFileParameters, AssignPropertyToTypeParameters, CategoryAndTypesView, CreateCollectionParameters, CreateDocumentCategoryParameters, CreateDocumentParameters, CreateDocumentPropertyParameters, CreateDocumentRequestFileParameters, CreateDocumentRequestParameters, CreateDocumentRequestTemplateParameters, CreateDocumentRequestsTemplateParameters, CreateDocumentTypeParameters, DeleteDocumentRequestFileParameters, DeleteDocumentRequestParameters, DeleteDocumentRequestTemplateParameters, DeleteDocumentRequestsTemplateParameters, Document, DocumentCategory, DocumentCollection, DocumentCollectionDocument, DocumentFile, DocumentManagementData, DocumentProperty, DocumentPropertyBooleanValue, DocumentPropertyDataType, DocumentPropertyDecimalValue, DocumentPropertyIntegerValue, DocumentPropertyTextValue, DocumentRequest, DocumentRequestCollection, DocumentRequestFile, DocumentRequestTemplate, DocumentRequestsTemplate, DocumentRequestsTemplateData, DocumentType, DocumentTypeProperty, LoadDataCollectionsMetadataParameters, RejectDocumentRequestFileParameters, RequestFilesStats, SetDocumentPropertiesParameters, UpdateDocumentParameters, UpdateDocumentRequestFileParameters, UpdateDocumentRequestParameters, UpdateDocumentRequestTemplateParameters, UpdateDocumentRequestsTemplateParameters } from '../../models/index.js';
3
+ import type { Query } from '../../../orm/index.js';
4
+ import { type Transaction } from '../../../orm/server/index.js';
5
+ import type { OneOrMany } from '../../../types.js';
6
+ import { type AddOrArchiveDocumentToOrFromCollectionParameters, type ApplyDocumentRequestsTemplateParameters, type ApproveDocumentRequestFileParameters, type AssignPropertyToTypeParameters, type CategoryAndTypesView, type CreateCollectionParameters, type CreateDocumentCategoryParameters, type CreateDocumentParameters, type CreateDocumentPropertyParameters, type CreateDocumentRequestFileParameters, type CreateDocumentRequestParameters, type CreateDocumentRequestTemplateParameters, type CreateDocumentRequestsTemplateParameters, type CreateDocumentTypeParameters, type DeleteDocumentRequestFileParameters, type DeleteDocumentRequestParameters, type DeleteDocumentRequestTemplateParameters, type DeleteDocumentRequestsTemplateParameters, Document, DocumentCategory, DocumentCollection, DocumentCollectionDocument, DocumentFile, type DocumentManagementData, DocumentProperty, DocumentPropertyBooleanValue, DocumentPropertyDataType, DocumentPropertyDecimalValue, DocumentPropertyIntegerValue, DocumentPropertyTextValue, DocumentRequest, DocumentRequestCollection, DocumentRequestFile, DocumentRequestTemplate, DocumentRequestsTemplate, type DocumentRequestsTemplateData, DocumentType, DocumentTypeProperty, type LoadDataCollectionsMetadataParameters, type RejectDocumentRequestFileParameters, type RequestFilesStats, type SetDocumentPropertiesParameters, type UpdateDocumentParameters, type UpdateDocumentRequestFileParameters, type UpdateDocumentRequestParameters, type UpdateDocumentRequestTemplateParameters, type UpdateDocumentRequestsTemplateParameters } from '../../models/index.js';
7
7
  import { DocumentManagementConfig } from '../module.js';
8
8
  export type DocumentServiceArgument = DocumentManagementConfig;
9
9
  export declare class DocumentManagementService implements Resolvable<DocumentServiceArgument> {
@@ -8,7 +8,7 @@ import { getEntityMap } from '../../../database/index.js';
8
8
  import { Enumerable } from '../../../enumerable/index.js';
9
9
  import { BadRequestError } from '../../../errors/index.js';
10
10
  import { getMimeType, getMimeTypeExtensions } from '../../../file/index.js';
11
- import { Singleton, inject, injectArgument, provide } from '../../../injector/index.js';
11
+ import { Singleton, inject, injectArgument, provide, resolveArgumentType } from '../../../injector/index.js';
12
12
  import { ObjectStorage } from '../../../object-storage/index.js';
13
13
  import { DATABASE_CONFIG, EntityRepositoryConfig, injectRepository } from '../../../orm/server/index.js';
14
14
  import { toArray } from '../../../utils/array/index.js';
@@ -0,0 +1,69 @@
1
+ import stylistic from '@stylistic/eslint-plugin';
2
+ import tseslint from '@typescript-eslint/eslint-plugin';
3
+ import tsParser from '@typescript-eslint/parser';
4
+ import globals from 'globals';
5
+
6
+ /** @type {import('eslint').Linter.Config[]} */
7
+ export default [
8
+ { files: ['**/*.{js,mjs,cjs,jsx,ts,tsx}'] },
9
+ { ignores: ['**/dist/'] },
10
+ {
11
+ languageOptions: {
12
+ parser: tsParser,
13
+ parserOptions: {
14
+ projectService: {
15
+ allowDefaultProject: ['*.js']
16
+ }
17
+ },
18
+ globals: { ...globals.browser, ...globals.node }
19
+ }
20
+ },
21
+ stylistic.configs.customize({
22
+ semi: true,
23
+ arrowParens: true,
24
+ commaDangle: 'never'
25
+ }),
26
+ {
27
+ rules: {
28
+ 'prefer-named-capture-group': ['warn']
29
+ }
30
+ },
31
+ {
32
+ plugins: {
33
+ '@typescript-eslint': tseslint
34
+ },
35
+ rules: {
36
+ ...tseslint.configs['strict-type-checked'].rules,
37
+ ...tseslint.configs['stylistic-type-checked'].rules,
38
+ '@typescript-eslint/consistent-type-definitions': 'off',
39
+ '@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports', disallowTypeAnnotations: false }],
40
+ '@typescript-eslint/no-confusing-void-expression': ['warn', { ignoreArrowShorthand: true, ignoreVoidOperator: true }],
41
+ '@typescript-eslint/no-explicit-any': 'off',
42
+ '@typescript-eslint/no-floating-promises': 'error',
43
+ '@typescript-eslint/no-import-type-side-effects': 'error',
44
+ '@typescript-eslint/no-inferrable-types': ['warn', { ignoreParameters: true, ignoreProperties: true }],
45
+ '@typescript-eslint/no-non-null-assertion': 'off',
46
+ '@typescript-eslint/no-unnecessary-condition': ['warn', { allowConstantLoopConditions: 'only-allowed-literals', checkTypePredicates: true }],
47
+ '@typescript-eslint/no-unsafe-assignment': 'off',
48
+ '@typescript-eslint/no-unused-vars': ['warn', { varsIgnorePattern: '^_', argsIgnorePattern: '^_' }],
49
+ '@typescript-eslint/promise-function-async': 'error',
50
+ '@typescript-eslint/restrict-template-expressions': ['warn', { allowNumber: true, allowBoolean: true, allowNullish: true }]
51
+ }
52
+ },
53
+ {
54
+ rules: {
55
+ '@stylistic/member-delimiter-style': ['warn', {
56
+ multiline: { delimiter: 'comma', requireLast: false },
57
+ singleline: { delimiter: 'comma', requireLast: false },
58
+ overrides: {
59
+ interface: {
60
+ multiline: { delimiter: 'semi', requireLast: true },
61
+ singleline: { delimiter: 'semi', requireLast: true }
62
+ }
63
+ }
64
+ }],
65
+ '@stylistic/yield-star-spacing': ['error', 'after'],
66
+ '@stylistic/indent': 'off'
67
+ }
68
+ }
69
+ ];
@@ -1,4 +1,4 @@
1
- import { ReflectionRegistry } from '../../reflection/index.js';
1
+ import { type ReflectionRegistry } from '../../reflection/index.js';
2
2
  export declare class Foo {
3
3
  private readonly registry;
4
4
  get someGetter(): number;
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
- import { Accessor, Class, Method, Parameter, printType, Property, reflectionRegistry, ReflectionRegistry } from '../../reflection/index.js';
13
+ import { Accessor, Class, Method, Parameter, printType, Property, reflectionRegistry } from '../../reflection/index.js';
14
14
  let Foo = class Foo {
15
15
  registry;
16
16
  get someGetter() {
@@ -62,7 +62,7 @@ __decorate([
62
62
  Foo = __decorate([
63
63
  Class({ data: { tableName: 'foos' } }),
64
64
  __param(0, Parameter()),
65
- __metadata("design:paramtypes", [ReflectionRegistry])
65
+ __metadata("design:paramtypes", [Function])
66
66
  ], Foo);
67
67
  export { Foo };
68
68
  console.log('Type:');
@@ -8,7 +8,7 @@ import { Readable } from 'node:stream';
8
8
  import { request, errors as undiciErrors } from 'undici';
9
9
  import { HttpHeaders } from '../../../http/http-headers.js';
10
10
  import { HttpError, HttpErrorReason } from '../../../http/http.error.js';
11
- import { Singleton, injectArgument } from '../../../injector/index.js';
11
+ import { Singleton, injectArgument, resolveArgumentType } from '../../../injector/index.js';
12
12
  import { Injector } from '../../../injector/injector.js';
13
13
  import { toArray } from '../../../utils/array/array.js';
14
14
  import { isBlob, isDefined, isUint8Array } from '../../../utils/type-guards.js';
@@ -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 { hasErrorHandler, isErrorResponse, parseErrorResponse } from '../../api/response.js';
11
- import { Singleton, inject, injectAll, injectArgument } from '../../injector/index.js';
11
+ import { Singleton, inject, injectAll, injectArgument, resolveArgumentType } from '../../injector/index.js';
12
12
  import { toArray } from '../../utils/array/array.js';
13
13
  import { encodeBase64 } from '../../utils/base64.js';
14
14
  import { encodeUtf8 } from '../../utils/encoding.js';
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
- import { InjectArg, Singleton, injectionToken } from '../../injector/index.js';
13
+ import { InjectArg, Singleton, injectionToken, resolveArgumentType } from '../../injector/index.js';
14
14
  import { Injector } from '../../injector/injector.js';
15
15
  import { encodeBase64Url } from '../../utils/base64.js';
16
16
  import { concatArrayBufferViews } from '../../utils/binary.js';
@@ -1,3 +1,4 @@
1
+ import { resolveArgumentType } from '../injector/interfaces.js';
1
2
  export class KeyValueStore {
2
3
  module;
3
4
  constructor(module) {
@@ -11,7 +11,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
13
  import { Collection, MongoEntityRepository, noopTransformer } from '../../database/mongo/index.js';
14
- import { ForwardArg, ResolveArg, Singleton } from '../../injector/index.js';
14
+ import { ForwardArg, ResolveArg, Singleton, resolveArgumentType } from '../../injector/index.js';
15
15
  import { Logger } from '../../logger/index.js';
16
16
  import { DEFAULT_KEY_VALUE_REPOSITORY_CONFIG } from './tokens.js';
17
17
  const indexes = [
package/lock/lock.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { resolveArgumentType } from '../injector/index.js';
1
2
  export class Lock {
2
3
  resource;
3
4
  constructor(resource) {
@@ -34,7 +34,7 @@ let MongoLock = class MongoLock extends Lock {
34
34
  const timeoutDuration = Math.max(50, Math.min(1000, (timeout ?? 0) / 10));
35
35
  let result = false;
36
36
  const timer = new Timer(true);
37
- while ((result == false) && (isUndefined(timeout) || (timer.milliseconds < timeout))) { // eslint-disable-line no-unmodified-loop-condition
37
+ while ((result == false) && (isUndefined(timeout) || (timer.milliseconds < timeout))) {
38
38
  result = await this.tryAcquireOrRefresh(this.resource, key);
39
39
  if ((result == false) && isUndefined(timeout)) {
40
40
  break;
@@ -60,13 +60,12 @@ let MongoLock = class MongoLock extends Lock {
60
60
  await this.release(this.resource, key);
61
61
  }
62
62
  };
63
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
64
- (async () => {
63
+ void (async () => {
65
64
  await cancelableTimeoutUntil(expiration.valueOf() - renewBuffer, releaseToken);
66
65
  while (!releaseToken.isSet && !controller.lost) {
67
66
  try {
68
67
  const refreshResult = await this.tryRefresh(this.resource, key);
69
- expiration = (refreshResult == false) ? new Date(0) : refreshResult; // eslint-disable-line require-atomic-updates
68
+ expiration = (refreshResult == false) ? new Date(0) : refreshResult;
70
69
  }
71
70
  catch (error) {
72
71
  this.#logger.error(error);
@@ -12,7 +12,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  };
13
13
  import { getNewId } from '../../database/index.js';
14
14
  import { Collection, MongoEntityRepository, noopTransformer } from '../../database/mongo/index.js';
15
- import { ForwardArg, Singleton } from '../../injector/index.js';
15
+ import { ForwardArg, Singleton, resolveArgumentType } from '../../injector/index.js';
16
16
  import { Logger } from '../../logger/index.js';
17
17
  import { now } from '../../utils/date-time.js';
18
18
  import { MongoError } from 'mongodb';
package/lock/provider.js CHANGED
@@ -1,2 +1,3 @@
1
+ import { resolveArgumentType } from '../injector/index.js';
1
2
  export class LockProvider {
2
3
  }
package/logger/logger.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { resolveArgumentType } from '../injector/index.js';
1
2
  import { toArray } from '../utils/array/array.js';
2
3
  import { isDefined, isFunction } from '../utils/type-guards.js';
3
4
  import { LogLevel } from './level.js';
@@ -7,6 +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 { resolveArgumentType } from '../injector/index.js';
10
11
  import { BooleanProperty, NumberProperty, StringProperty } from '../schema/index.js';
11
12
  import { Optional } from '../schema/schemas/optional.js';
12
13
  export class MailClientAuthConfig {
@@ -11,7 +11,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
13
  import { Collection, MongoEntityRepository, noopTransformer } from '../../../database/mongo/index.js';
14
- import { ForwardArg, Singleton } from '../../../injector/index.js';
14
+ import { ForwardArg, Singleton, resolveArgumentType } from '../../../injector/index.js';
15
15
  import { Logger } from '../../../logger/index.js';
16
16
  export const mongoMailLogRepositoryConfig = {};
17
17
  const indexes = [];
@@ -1,3 +1,4 @@
1
+ import { resolveArgumentType } from '../injector/interfaces.js';
1
2
  import { disposeAsync } from '../disposable/disposable.js';
2
3
  export class MessageBus {
3
4
  async dispose() {
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
- import { ForwardArg, ResolveArg, Singleton } from '../../injector/index.js';
13
+ import { ForwardArg, ResolveArg, Singleton, resolveArgumentType } from '../../injector/index.js';
14
14
  import { Logger } from '../../logger/index.js';
15
15
  import { Collection } from '../../database/mongo/classes.js';
16
16
  import { MongoEntityRepository, noopTransformer } from '../../database/mongo/mongo-entity-repository.js';
@@ -1,6 +1,5 @@
1
1
  import type { CancellationSignal } from '../../cancellation/index.js';
2
- import type { Resolvable } from '../../injector/interfaces.js';
3
- import { resolveArgumentType } from '../../injector/interfaces.js';
2
+ import type { Resolvable, resolveArgumentType } from '../../injector/interfaces.js';
4
3
  import { ModuleBase } from '../module-base.js';
5
4
  import type { Module } from '../module.js';
6
5
  import { ModuleMetricType } from '../module.js';
@@ -1,3 +1,4 @@
1
+ import { resolveArgumentType } from '../injector/interfaces.js';
1
2
  export class ObjectStorage {
2
3
  /** Object storage module */
3
4
  module;
@@ -11,7 +11,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
13
  import { Collection, MongoEntityRepository, mapTo } from '../database/mongo/index.js';
14
- import { ForwardArg, ResolveArg, Singleton } from '../injector/index.js';
14
+ import { ForwardArg, ResolveArg, Singleton, resolveArgumentType } from '../injector/index.js';
15
15
  import { Injector } from '../injector/injector.js';
16
16
  import { Logger } from '../logger/index.js';
17
17
  import { OidcStateRepository } from './oidc-state.repository.js';
package/orm/entity.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Record } from '../schema/index.js';
2
- import type { Type, TypedOmit, UntaggedDeep } from '../types.js';
1
+ import type { Type, TypedOmit } from '../types.js';
2
+ import type { UntaggedDeep } from '../types/index.js';
3
3
  import { Embedded, type HasDefault, type IsPrimaryKey, Json, Timestamp, Uuid } from './types.js';
4
4
  export interface EntityType<T extends Entity = Entity> extends Type<T> {
5
5
  readonly entityName?: string;
@@ -8,7 +8,8 @@ export type NewEntity<T extends Entity> = UntaggedDeep<TypedOmit<T, 'id' | 'meta
8
8
  id?: string;
9
9
  metadata?: Partial<Pick<EntityMetadata, 'attributes'>>;
10
10
  }>;
11
- export declare abstract class EntityMetadataAttributes implements Record {
11
+ export declare abstract class EntityMetadataAttributes {
12
+ [key: string]: unknown;
12
13
  }
13
14
  export declare abstract class EntityMetadata {
14
15
  revision: number;
package/orm/entity.js CHANGED
@@ -11,7 +11,7 @@ import { Defaulted, Integer } from '../schema/index.js';
11
11
  import { Index, PrimaryKey } from './decorators.js';
12
12
  import { Embedded, Json, Timestamp, Uuid } from './types.js';
13
13
  let EntityMetadataAttributes = class EntityMetadataAttributes {
14
- }; // eslint-disable-line @typescript-eslint/no-extraneous-class
14
+ };
15
15
  EntityMetadataAttributes = __decorate([
16
16
  Json()
17
17
  ], EntityMetadataAttributes);
package/orm/query.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { SQLWrapper } from 'drizzle-orm';
2
- import type { Flatten, Record, Untagged } from '../types.js';
2
+ import type { Flatten, Record } from '../types.js';
3
3
  import type { Geometry } from '../types/geo-json.js';
4
+ import type { Untagged } from '../types/tagged.js';
4
5
  export type LogicalQuery<T = any> = LogicalAndQuery<T> | LogicalOrQuery<T> | LogicalNorQuery<T>;
5
6
  export type LogicalQueryTypes = keyof (LogicalAndQuery & LogicalOrQuery & LogicalNorQuery);
6
7
  export declare const allLogicalQueryTypes: LogicalQueryTypes[];
@@ -1,6 +1,6 @@
1
1
  import { NodePgDatabase } from 'drizzle-orm/node-postgres';
2
- import { Resolvable, type resolveArgumentType } from '../../injector/interfaces.js';
3
- import { DatabaseArgument } from './module.js';
2
+ import type { Resolvable, resolveArgumentType } from '../../injector/interfaces.js';
3
+ import type { DatabaseArgument } from './module.js';
4
4
  export declare class Database extends NodePgDatabase<any> implements Resolvable<DatabaseArgument> {
5
5
  readonly [resolveArgumentType]?: DatabaseArgument;
6
6
  }
@@ -3,10 +3,11 @@ import { type PgColumnBuilder, type PgEnum, type PgSchema, type PgTableWithColum
3
3
  import type { CamelCase, ConditionalPick, SnakeCase } from 'type-fest';
4
4
  import { JsonPath } from '../../../json-path/json-path.js';
5
5
  import { type Record } from '../../../schema/index.js';
6
- import type { AbstractConstructor, Enumeration } from '../../../types.js';
6
+ import type { AbstractConstructor, Enumeration, UnionToIntersection } from '../../../types.js';
7
+ import type { Tagged } from '../../../types/index.js';
7
8
  import type { OrmColumnReflectionData } from '../../decorators.js';
8
9
  import type { EntityType } from '../../entity.js';
9
- import type { ColumnBuilder, embedded } from '../../types.js';
10
+ import type { ColumnBuilder, EmbeddedConfigTag } from '../../types.js';
10
11
  type Column<Name extends string, T> = null extends T ? ColumnBuilder<T, Name> : NotNull<ColumnBuilder<T, Name>>;
11
12
  type ConverterContext = {
12
13
  type: AbstractConstructor;
@@ -20,24 +21,22 @@ export type ColumnDefinition = {
20
21
  dereferenceObjectPath: (obj: Record) => any;
21
22
  };
22
23
  export declare const getDrizzleTableFromType: typeof _getDrizzleTableFromType;
23
- export type ColumnPrefix<T> = T extends {
24
+ export type ColumnPrefix<T> = T extends Tagged<unknown, EmbeddedConfigTag, {
24
25
  prefix: infer Prefix;
25
- } ? Prefix extends string ? Prefix : '' : '';
26
+ }> ? Prefix extends string ? Prefix : '' : '';
26
27
  export type PgTableFromType<S extends string, T extends AbstractConstructor, TableName extends string = T extends Required<EntityType> ? SnakeCase<T['entityName']> : string> = PgTableWithColumns<{
27
28
  name: TableName;
28
29
  schema: S;
29
30
  columns: BuildColumns<TableName, {
30
31
  [P in Exclude<keyof InstanceType<T>, keyof EmbeddedProperties<InstanceType<T>>>]: Column<CamelCase<Extract<P, string>>, InstanceType<T>[P]>;
31
- } & {
32
+ } & UnionToIntersection<{
32
33
  [P in keyof EmbeddedProperties<InstanceType<T>>]: EmbeddedColumns<InstanceType<T>[P], ColumnPrefix<InstanceType<T>[P]>>;
33
- }[keyof EmbeddedProperties<InstanceType<T>>], 'pg'>;
34
+ }[keyof EmbeddedProperties<InstanceType<T>>]>, 'pg'>;
34
35
  dialect: 'pg';
35
36
  }>;
36
- export type EmbeddedProperties<T> = ConditionalPick<T, {
37
- [embedded]: {
38
- prefix: any;
39
- };
40
- }>;
37
+ export type EmbeddedProperties<T> = ConditionalPick<T, Tagged<unknown, EmbeddedConfigTag, {
38
+ prefix: any;
39
+ }>>;
41
40
  export type EmbeddedColumns<T, Prefix extends string> = {
42
41
  [P in keyof T as CamelCase<`${Prefix}${Extract<P, string>}`>]: Column<CamelCase<`${Prefix}${Extract<P, string>}`>, T[P]>;
43
42
  };
@@ -68,7 +68,7 @@ export function _getDrizzleTableFromType(type, schemaName, tableName = getDefaul
68
68
  ...(tableReflectionData?.index?.map((data) => buildIndex(table, data)) ?? [])
69
69
  ]);
70
70
  drizzleSchema[columnDefinitionsSymbol] = columnDefinitions;
71
- return drizzleSchema; // eslint-disable-line @typescript-eslint/no-unsafe-return
71
+ return drizzleSchema;
72
72
  }
73
73
  function getPostgresColumnEntries(type, tableName, dbSchema, path = new JsonPath({ dollar: false }), prefix = '') {
74
74
  const metadata = reflectionRegistry.getMetadata(type);
@@ -1,13 +1,14 @@
1
- import { SQL } from 'drizzle-orm';
2
- import { PgTransaction as DrizzlePgTransaction, PgColumn, PgInsertValue, PgQueryResultHKT, PgUpdateSetSource } from 'drizzle-orm/pg-core';
3
- import { PartialDeep } from 'type-fest';
4
- import { Resolvable, resolveArgumentType } from '../../injector/interfaces.js';
5
- import type { DeepPartial, OneOrMany, Paths, Record, Type, TypedOmit, UntaggedDeep } from '../../types.js';
6
- import { Database } from './database.js';
7
- import { ColumnDefinition, type PgTableFromType } from './drizzle/schema-converter.js';
1
+ import { type SQL } from 'drizzle-orm';
2
+ import { PgTransaction as DrizzlePgTransaction, type PgColumn, type PgInsertValue, type PgQueryResultHKT, type PgUpdateSetSource } from 'drizzle-orm/pg-core';
3
+ import type { PartialDeep } from 'type-fest';
4
+ import { type Resolvable, resolveArgumentType } from '../../injector/interfaces.js';
5
+ import type { DeepPartial, OneOrMany, Paths, Record, Type, TypedOmit } from '../../types.js';
6
+ import type { UntaggedDeep } from '../../types/index.js';
8
7
  import type { Entity, EntityMetadata, EntityMetadataAttributes, EntityType, NewEntity } from '../entity.js';
9
8
  import type { Query } from '../query.js';
10
- import { Transaction, TransactionConfig } from './transaction.js';
9
+ import { Database } from './database.js';
10
+ import { type ColumnDefinition, type PgTableFromType } from './drizzle/schema-converter.js';
11
+ import { type Transaction, type TransactionConfig } from './transaction.js';
11
12
  type PgTransaction = DrizzlePgTransaction<PgQueryResultHKT, Record, Record>;
12
13
  export declare const repositoryType: unique symbol;
13
14
  export type OrderOptions<T extends Entity> = {