@tstdl/base 0.92.43 → 0.92.47

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 (99) 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/decorators.d.ts +2 -0
  41. package/orm/decorators.js +13 -7
  42. package/orm/entity.d.ts +4 -3
  43. package/orm/entity.js +1 -1
  44. package/orm/query.d.ts +2 -1
  45. package/orm/server/database.d.ts +2 -2
  46. package/orm/server/drizzle/schema-converter.d.ts +10 -11
  47. package/orm/server/drizzle/schema-converter.js +2 -2
  48. package/orm/server/repository.d.ts +9 -8
  49. package/orm/server/repository.js +1 -0
  50. package/orm/types.d.ts +19 -23
  51. package/orm/types.js +0 -1
  52. package/package.json +6 -10
  53. package/pdf/pdf.service.js +1 -1
  54. package/queue/mongo/mongo-job.repository.js +1 -1
  55. package/queue/mongo/queue.provider.js +1 -0
  56. package/queue/queue.d.ts +1 -2
  57. package/schema/schemas/literal.d.ts +2 -2
  58. package/search-index/elastic/config.d.ts +1 -2
  59. package/serializer/serializer.js +2 -2
  60. package/signals/implementation/to-signal.d.ts +2 -2
  61. package/signals/implementation/writable-signal.d.ts +3 -3
  62. package/signals/implementation/writable-signal.js +0 -1
  63. package/templates/providers/file.template-provider.d.ts +1 -2
  64. package/templates/resolvers/file.template-resolver.d.ts +1 -1
  65. package/templates/resolvers/file.template-resolver.js +1 -0
  66. package/templates/resolvers/jsx.template-resolver.d.ts +1 -1
  67. package/text/localization.service.d.ts +2 -4
  68. package/tsconfig.json +6 -10
  69. package/tsconfig.server.json +1 -1
  70. package/types/index.d.ts +2 -0
  71. package/types/index.js +1 -0
  72. package/types/tagged.d.ts +16 -0
  73. package/types/tagged.js +1 -0
  74. package/types.d.ts +6 -10
  75. package/utils/async-iterable-helpers/multiplex.js +1 -2
  76. package/utils/benchmark.js +1 -1
  77. package/utils/comparison.js +0 -1
  78. package/utils/cryptography.d.ts +2 -4
  79. package/utils/event-loop.js +1 -2
  80. package/utils/iterable-helpers/first-or-default.js +0 -1
  81. package/utils/iterable-helpers/first.js +0 -1
  82. package/utils/iterable-helpers/group-to-map.js +1 -1
  83. package/utils/iterable-helpers/last-or-default.js +1 -1
  84. package/utils/object/merge.js +2 -2
  85. package/utils/object/object.d.ts +2 -2
  86. package/utils/periodic-reporter.js +1 -2
  87. package/utils/reflection.js +1 -1
  88. package/utils/repl.d.ts +1 -1
  89. package/utils/repl.js +0 -1
  90. package/utils/set.js +0 -1
  91. package/utils/stream/slice.js +2 -2
  92. package/utils/stream/stream-reader.js +0 -1
  93. package/utils/stream/to-bytes-stream.js +2 -2
  94. package/utils/string/snake-case.js +1 -1
  95. package/utils/timing.js +2 -2
  96. package/utils/type-guards.js +0 -1
  97. package/utils/units.js +0 -1
  98. package/utils/z-base32.js +0 -1
  99. 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';
@@ -47,6 +47,8 @@ export declare function References(type: () => EntityType): PropertyDecorator;
47
47
  export declare function Embedded(type: AbstractConstructor, options?: TypedOmit<NonNullable<OrmColumnReflectionData['embedded']>, 'type'>): PropertyDecorator;
48
48
  export declare function Unique(name?: string, options?: UniqueReflectionData['options']): PropertyDecorator;
49
49
  export declare function Unique(name: string | undefined, columns: [string, ...string[]], options?: UniqueReflectionData['options']): ClassDecorator;
50
+ export declare function Unique(columns: [string, ...string[]], options?: UniqueReflectionData['options']): ClassDecorator;
50
51
  export declare function Index(name?: string, options?: IndexReflectionData['options']): PropertyDecorator;
51
52
  export declare function Index(name: string | undefined, columns: [string, ...string[]], options?: IndexReflectionData['options']): ClassDecorator;
53
+ export declare function Index(columns: [string, ...string[]], options?: IndexReflectionData['options']): ClassDecorator;
52
54
  export {};
package/orm/decorators.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createClassDecorator, createDecorator, createPropertyDecorator } from '../reflection/utils.js';
2
2
  import { Property } from '../schema/index.js';
3
- import { isArray } from '../utils/type-guards.js';
3
+ import { assertNotArrayPass, isArray } from '../utils/type-guards.js';
4
4
  export function createTableDecorator(data) {
5
5
  return createClassDecorator({ data: { orm: data }, mergeData: true });
6
6
  }
@@ -24,15 +24,21 @@ export function Embedded(type, options) {
24
24
  include: [Property(type), createColumnDecorator({ embedded: { type, ...options } })]
25
25
  });
26
26
  }
27
- export function Unique(name, columnsOrOptions, options) {
27
+ export function Unique(nameOrColumns, columnsOrOptions, options) {
28
+ if (isArray(nameOrColumns)) {
29
+ return createTableDecorator({ unique: [{ columns: nameOrColumns, options: assertNotArrayPass(columnsOrOptions) }] });
30
+ }
28
31
  if (isArray(columnsOrOptions)) {
29
- return createTableDecorator({ unique: [{ name, columns: columnsOrOptions, options }] });
32
+ return createTableDecorator({ unique: [{ name: nameOrColumns, columns: columnsOrOptions, options }] });
30
33
  }
31
- return createColumnDecorator({ unique: { name, options: columnsOrOptions ?? options } });
34
+ return createColumnDecorator({ unique: { name: nameOrColumns, options: columnsOrOptions ?? options } });
32
35
  }
33
- export function Index(name, columnsOrOptions, options) {
36
+ export function Index(nameOrColumns, columnsOrOptions, options) {
37
+ if (isArray(nameOrColumns)) {
38
+ return createTableDecorator({ index: [{ columns: nameOrColumns, options: assertNotArrayPass(columnsOrOptions) }] });
39
+ }
34
40
  if (isArray(columnsOrOptions)) {
35
- return createTableDecorator({ index: [{ name, columns: columnsOrOptions, options }] });
41
+ return createTableDecorator({ index: [{ name: nameOrColumns, columns: columnsOrOptions, options }] });
36
42
  }
37
- return createColumnDecorator({ index: { name, options: columnsOrOptions ?? options } });
43
+ return createColumnDecorator({ index: { name: nameOrColumns, options: columnsOrOptions ?? options } });
38
44
  }
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
  }