@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
@@ -13,6 +13,7 @@ import { PgTransaction as DrizzlePgTransaction } from 'drizzle-orm/pg-core';
13
13
  import { NotFoundError } from '../../errors/not-found.error.js';
14
14
  import { Singleton } from '../../injector/decorators.js';
15
15
  import { inject, injectArgument } from '../../injector/inject.js';
16
+ import { resolveArgumentType } from '../../injector/interfaces.js';
16
17
  import { Schema } from '../../schema/schema.js';
17
18
  import { toArray } from '../../utils/array/array.js';
18
19
  import { fromDeepObjectEntries } from '../../utils/object/object.js';
package/orm/types.d.ts CHANGED
@@ -1,31 +1,27 @@
1
1
  import type { $Type, HasDefault as DrizzleHasDefault, IsPrimaryKey as DrizzleIsPrimaryKey } from 'drizzle-orm';
2
2
  import type { boolean, date, doublePrecision, integer, jsonb, PgColumnBuilder, PgColumnBuilderBase, PgEnumColumnBuilderInitial, text, timestamp, uuid } from 'drizzle-orm/pg-core';
3
- import type { GetTagMetadata, Tagged, UnwrapTagged } from 'type-fest';
4
3
  import { Array, Integer } from '../schema/index.js';
5
4
  import type { AbstractConstructor, EnumerationObject, EnumerationValue, ObjectLiteral, UnionToTuple } from '../types.js';
5
+ import type { GetTagMetadata, HasTag, Tagged, UnwrapTagged } from '../types/index.js';
6
6
  import { Column, Embedded, Index, PrimaryKey, References, Unique } from './decorators.js';
7
7
  import { Json, NumericDate, Timestamp, Uuid } from './schemas/index.js';
8
- export type IsPrimaryKey<T> = T extends Tagged<unknown, 'column', PgColumnBuilderBase> ? Tagged<UnwrapTagged<T>, 'column', DrizzleIsPrimaryKey<GetTagMetadata<T, 'column'>>> : Tagged<T, 'column', ColumnBuilder<T>>;
9
- export type HasDefault<T> = T extends Tagged<unknown, 'column', PgColumnBuilderBase> ? Tagged<UnwrapTagged<T>, 'column', DrizzleHasDefault<GetTagMetadata<T, 'column'>>> : Tagged<T, 'column', ColumnBuilder<T>>;
8
+ export type ColumnTypeTag = 'column';
9
+ export type EmbeddedConfigTag = 'embedded';
10
+ export type IsPrimaryKey<T> = T extends Tagged<unknown, ColumnTypeTag, PgColumnBuilderBase> ? Tagged<UnwrapTagged<T>, ColumnTypeTag, DrizzleIsPrimaryKey<GetTagMetadata<T, ColumnTypeTag>>> : Tagged<T, ColumnTypeTag, DrizzleIsPrimaryKey<ColumnBuilder<T>>>;
11
+ export type HasDefault<T> = T extends Tagged<unknown, ColumnTypeTag, PgColumnBuilderBase> ? Tagged<UnwrapTagged<T>, ColumnTypeTag, DrizzleHasDefault<GetTagMetadata<T, ColumnTypeTag>>> : Tagged<T, ColumnTypeTag, DrizzleHasDefault<ColumnBuilder<T>>>;
10
12
  type EnumColumn<T extends EnumerationObject, ColumnName extends string = ''> = PgEnumColumnBuilderInitial<ColumnName, UnionToTuple<`${EnumerationValue<T>}`> extends [string, ...string[]] ? UnionToTuple<`${EnumerationValue<T>}`> : ['NO_VALUES_PROVIDED']>;
11
- export type ColumnBuilder<T, ColumnName extends string = never> = T extends Tagged<T, 'column', any> ? GetTagMetadata<T, 'column'> : T extends string ? string extends ColumnName ? ReturnType<typeof text<ColumnName, string, [string, ...string[]]>> : ReturnType<typeof text<string, [string, ...string[]]>> : T extends number ? string extends ColumnName ? ReturnType<typeof doublePrecision<ColumnName>> : ReturnType<typeof doublePrecision> : T extends boolean ? string extends ColumnName ? ReturnType<typeof boolean<ColumnName>> : ReturnType<typeof boolean> : T extends EnumerationObject ? string extends ColumnName ? EnumColumn<T, ColumnName> : EnumColumn<T> : T extends (infer U)[] ? string extends ColumnName ? ReturnType<ColumnBuilder<U, ColumnName>['array']> : ReturnType<ColumnBuilder<U>['array']> : never;
12
- export type TypeBuilder<T, ColumnName extends string = never> = [
13
- ColumnName
14
- ] extends [never] ? T extends Tagged<any, 'column', PgColumnBuilderBase> ? T : T extends infer U ? Tagged<U, 'column', ColumnBuilder<U>> : never : never;
15
- export declare const embedded: unique symbol;
16
- export type Embedded<T = AbstractConstructor, P extends string = ''> = T & {
17
- [embedded]: {
18
- prefix: P;
19
- };
20
- };
21
- export type Array<T extends Tagged<ObjectLiteral, 'column', PgColumnBuilder<any>>> = Tagged<UnwrapTagged<T>[], 'column', ReturnType<GetTagMetadata<T, 'column'>['array']>>;
22
- export type Json<T extends ObjectLiteral = ObjectLiteral> = Tagged<T, 'column', $Type<ReturnType<typeof jsonb>, T>>;
23
- export type Enum<T extends EnumerationObject> = Tagged<EnumerationValue<T>, 'column', EnumColumn<T>>;
24
- export type Text = Tagged<string, 'column', ReturnType<typeof text<string, [string, ...string[]]>>>;
25
- export type Uuid = Tagged<string, 'column', ReturnType<typeof uuid>>;
26
- export type Integer = Tagged<number, 'column', ReturnType<typeof integer>>;
27
- export type DoublePrecision = Tagged<number, 'column', ReturnType<typeof doublePrecision>>;
28
- export type Boolean = Tagged<number, 'column', ReturnType<typeof boolean>>;
29
- export type NumericDate = Tagged<number, 'column', ReturnType<typeof date>>;
30
- export type Timestamp = Tagged<number, 'column', ReturnType<typeof timestamp>>;
13
+ export type ColumnBuilder<T, ColumnName extends string = never> = HasTag<T> extends true ? T extends Tagged<T, ColumnTypeTag, any> ? GetTagMetadata<T, ColumnTypeTag> : never : T extends string ? string extends ColumnName ? ReturnType<typeof text<ColumnName, string, [string, ...string[]]>> : ReturnType<typeof text<string, [string, ...string[]]>> : T extends number ? string extends ColumnName ? ReturnType<typeof doublePrecision<ColumnName>> : ReturnType<typeof doublePrecision> : T extends boolean ? string extends ColumnName ? ReturnType<typeof boolean<ColumnName>> : ReturnType<typeof boolean> : T extends EnumerationObject ? string extends ColumnName ? EnumColumn<T, ColumnName> : EnumColumn<T> : T extends (infer U)[] ? string extends ColumnName ? ReturnType<ColumnBuilder<U, ColumnName>['array']> : ReturnType<ColumnBuilder<U>['array']> : never;
14
+ export type Embedded<T = AbstractConstructor, P extends string = ''> = Tagged<T, EmbeddedConfigTag, {
15
+ prefix: P;
16
+ }>;
17
+ export type Array<T extends Tagged<ObjectLiteral, ColumnTypeTag, PgColumnBuilder<any>>> = Tagged<UnwrapTagged<T>[], ColumnTypeTag, ReturnType<GetTagMetadata<T, ColumnTypeTag>['array']>>;
18
+ export type Json<T extends ObjectLiteral = ObjectLiteral> = Tagged<T, ColumnTypeTag, $Type<ReturnType<typeof jsonb>, T>>;
19
+ export type Enum<T extends EnumerationObject> = Tagged<EnumerationValue<T>, ColumnTypeTag, EnumColumn<T>>;
20
+ export type Text = Tagged<string, ColumnTypeTag, ReturnType<typeof text<string, [string, ...string[]]>>>;
21
+ export type Uuid = Tagged<string, ColumnTypeTag, ReturnType<typeof uuid>>;
22
+ export type Integer = Tagged<number, ColumnTypeTag, ReturnType<typeof integer>>;
23
+ export type DoublePrecision = Tagged<number, ColumnTypeTag, ReturnType<typeof doublePrecision>>;
24
+ export type Boolean = Tagged<number, ColumnTypeTag, ReturnType<typeof boolean>>;
25
+ export type NumericDate = Tagged<number, ColumnTypeTag, ReturnType<typeof date>>;
26
+ export type Timestamp = Tagged<number, ColumnTypeTag, ReturnType<typeof timestamp>>;
31
27
  export { Array, Column, Embedded, Index, Integer, Json, NumericDate, PrimaryKey, References, Timestamp, Unique, Uuid };
package/orm/types.js CHANGED
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-redeclare, @typescript-eslint/naming-convention */
2
1
  import { Array, Integer } from '../schema/index.js';
3
2
  import { Column, Embedded, Index, PrimaryKey, References, Unique } from './decorators.js';
4
3
  import { Json, NumericDate, Timestamp, Uuid } from './schemas/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.92.44",
3
+ "version": "0.92.48",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -10,18 +10,19 @@
10
10
  "build": "tsc && tsc-alias",
11
11
  "build:watch": "concurrently --raw --kill-others npm:tsc:watch npm:tsc-alias:watch",
12
12
  "build:production": "rm -rf dist && npm run build && npm run build:production:copy-files",
13
- "build:production:copy-files": "cp package.json .eslintrc.json tsconfig.server.json dist/ && cp tsconfig.base.json dist/tsconfig.json && npm run copy:document-management",
13
+ "build:production:copy-files": "cp package.json eslint.config.js tsconfig.server.json dist/ && cp tsconfig.base.json dist/tsconfig.json && npm run copy:document-management",
14
14
  "build:docs": "typedoc",
15
15
  "build:docs:watch": "typedoc --watch",
16
16
  "generate:drizzle": "drizzle-kit generate --config dist/document-management/server/drizzle.config.js",
17
17
  "copy:document-management": "rm -rf ./dist/document-management/server/drizzle && cp -r ./source/document-management/server/drizzle ./dist/document-management/server/",
18
- "lint": "eslint --config .eslintrc.json --cache source/",
18
+ "lint": "eslint --cache source/",
19
19
  "pub": "npm run build:production && rm -vf dist/test* && rm -vrf dist/tools/ && npm publish dist/",
20
20
  "tsc:watch": "tsc --watch",
21
21
  "tsc-alias:watch": "tsc-alias --watch"
22
22
  },
23
23
  "exports": {
24
24
  "./tsconfig.json": "./tsconfig.json",
25
+ "./eslint.config.js": "./eslint.config.js",
25
26
  ".": "./index.js",
26
27
  "./environment": "./environment.js",
27
28
  "./formats": "./formats.js",
@@ -127,8 +128,7 @@
127
128
  "type-fest": "4.35"
128
129
  },
129
130
  "devDependencies": {
130
- "@mxssfd/typedoc-theme": "1.1",
131
- "@stylistic/eslint-plugin": "3.1",
131
+ "@stylistic/eslint-plugin": "4.0",
132
132
  "@types/chroma-js": "2.4",
133
133
  "@types/koa__router": "12.0",
134
134
  "@types/luxon": "3.4",
@@ -140,12 +140,9 @@
140
140
  "@typescript-eslint/eslint-plugin": "8.24",
141
141
  "concurrently": "9.1",
142
142
  "drizzle-kit": "0.30",
143
- "eslint": "8.57",
144
- "eslint-import-resolver-typescript": "3.8",
145
- "eslint-plugin-import": "2.31",
143
+ "eslint": "9.20",
144
+ "globals": "15.15",
146
145
  "tsc-alias": "1.8",
147
- "typedoc": "0.27",
148
- "typedoc-plugin-missing-exports": "3.1",
149
146
  "typescript": "5.7"
150
147
  },
151
148
  "peerDependencies": {
@@ -71,7 +71,7 @@ import { promisify } from 'node:util';
71
71
  import { BrowserContextController } from '../browser/browser-context-controller.js';
72
72
  import { BrowserController } from '../browser/browser-controller.js';
73
73
  import { PdfRenderOptions } from '../browser/pdf-options.js';
74
- import { Singleton, inject, injectArgument } from '../injector/index.js';
74
+ import { Singleton, inject, injectArgument, resolveArgumentType } from '../injector/index.js';
75
75
  import { LogLevel } from '../logger/level.js';
76
76
  import { Logger } from '../logger/logger.js';
77
77
  import { Optional } from '../schema/index.js';
@@ -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, ResolveArg, Singleton } from '../../injector/index.js';
15
+ import { ForwardArg, ResolveArg, Singleton, resolveArgumentType } from '../../injector/index.js';
16
16
  import { Logger } from '../../logger/index.js';
17
17
  import { UniqueTagStrategy } from '../../queue/index.js';
18
18
  const indexes = [
@@ -12,6 +12,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  };
13
13
  import { ForwardArg, ResolveArg, Singleton } from '../../injector/decorators.js';
14
14
  import { Injector } from '../../injector/injector.js';
15
+ import { resolveArgumentType } from '../../injector/interfaces.js';
15
16
  import { LockProvider } from '../../lock/index.js';
16
17
  import { MessageBusProvider } from '../../message-bus/index.js';
17
18
  import { Queue, QueueProvider } from '../../queue/index.js';
package/queue/queue.d.ts CHANGED
@@ -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 { QueueEnqueueBatch } from './enqueue-batch.js';
5
4
  export type JobTag = string | number | null;
6
5
  export type Job<T> = {
@@ -1,6 +1,6 @@
1
1
  import type { JsonPath } from '../../json-path/json-path.js';
2
- import { type SchemaPropertyDecorator, type SchemaDecoratorOptions } from '../decorators/index.js';
3
- import { Schema, SchemaOptions, type SchemaTestOptions, type SchemaTestResult } from '../schema.js';
2
+ import { type SchemaDecoratorOptions, type SchemaPropertyDecorator } from '../decorators/index.js';
3
+ import { Schema, type SchemaOptions, type SchemaTestOptions, type SchemaTestResult } from '../schema.js';
4
4
  export type LiteralSchemaOptions<T> = SchemaOptions<T>;
5
5
  export declare class LiteralSchema<const T> extends Schema<T> {
6
6
  readonly name: string;
@@ -1,6 +1,5 @@
1
1
  import type { Entity } from '../../database/index.js';
2
- import { resolveArgumentType } from '../../injector/interfaces.js';
3
- import type { Resolvable } from '../../injector/interfaces.js';
2
+ import type { Resolvable, resolveArgumentType } from '../../injector/interfaces.js';
4
3
  export type ElasticSearchIndexConfigArgument<T extends Entity = Entity> = string | ElasticSearchIndexConfig<T>;
5
4
  export declare abstract class ElasticSearchIndexConfig<T extends Entity = Entity> implements Resolvable<ElasticSearchIndexConfigArgument> {
6
5
  readonly indexName: string;
@@ -1,4 +1,4 @@
1
- /* eslint-disable @typescript-eslint/no-unsafe-return, max-lines-per-function, max-statements, complexity */
1
+ /* eslint-disable @typescript-eslint/no-unsafe-return, @typescript-eslint/no-deprecated */
2
2
  import { CircularBuffer } from '../data-structures/circular-buffer.js';
3
3
  import { SortedArrayList } from '../data-structures/sorted-array-list.js';
4
4
  import { compareByValueSelection } from '../utils/comparison.js';
@@ -156,7 +156,7 @@ function _deserialize(serialized, context, path, depth) {
156
156
  if (context.options.allowUnsafe !== true) {
157
157
  throw new Error('functions are only allowed if allowUnsafe option is true');
158
158
  }
159
- const fn = eval(nonPrimitiveData); // eslint-disable-line no-eval
159
+ const fn = eval(nonPrimitiveData);
160
160
  context.references.set(path, fn);
161
161
  return fn;
162
162
  }
@@ -6,9 +6,9 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  import type { Observable, Subscribable } from 'rxjs';
9
- import { SignalsInjector } from '../api.js';
9
+ import type { SignalsInjector } from '../api.js';
10
10
  import type { Signal } from './api.js';
11
- import { ValueEqualityFn } from './equality.js';
11
+ import type { ValueEqualityFn } from './equality.js';
12
12
  export interface ToSignalOptions<T> {
13
13
  /**
14
14
  * Initial value for the signal produced by `toSignal`.
@@ -1,6 +1,6 @@
1
- import { Signal } from './api.js';
2
- import { ValueEqualityFn } from './equality.js';
3
- import { SignalGetter } from './signal.js';
1
+ import { type Signal } from './api.js';
2
+ import type { ValueEqualityFn } from './equality.js';
3
+ import { type SignalGetter } from './signal.js';
4
4
  /**
5
5
  * @license
6
6
  * Copyright Google LLC All Rights Reserved.
@@ -1,4 +1,3 @@
1
- /* eslint-disable */
2
1
  import { SIGNAL } from '../symbol.js';
3
2
  import { isSignal } from './api.js';
4
3
  import { createSignal, signalSetFn, signalUpdateFn } from './signal.js';
@@ -1,5 +1,4 @@
1
- import type { Resolvable } from '../../injector/interfaces.js';
2
- import { resolveArgumentType } from '../../injector/interfaces.js';
1
+ import type { Resolvable, resolveArgumentType } from '../../injector/interfaces.js';
3
2
  import { Template } from '../template.model.js';
4
3
  import { TemplateProvider } from '../template.provider.js';
5
4
  export type FileTemplateProviderConfig = {
@@ -1,4 +1,4 @@
1
- import { Resolvable, resolveArgumentType } from '../../injector/interfaces.js';
1
+ import { type Resolvable, resolveArgumentType } from '../../injector/interfaces.js';
2
2
  import type { TypedOmit } from '../../types.js';
3
3
  import { TemplateField } from '../template.model.js';
4
4
  import type { TemplateRenderer, TemplateRendererOptions, TemplateRendererString } from '../template.renderer.js';
@@ -14,6 +14,7 @@ import * as fs from 'node:fs/promises';
14
14
  import * as path from 'node:path';
15
15
  import { BadRequestError } from '../../errors/bad-request.error.js';
16
16
  import { InjectArg, Singleton } from '../../injector/decorators.js';
17
+ import { resolveArgumentType } from '../../injector/interfaces.js';
17
18
  import { StringProperty } from '../../schema/index.js';
18
19
  import { TemplateField } from '../template.model.js';
19
20
  import { TemplateResolver } from '../template.resolver.js';
@@ -1,6 +1,6 @@
1
1
  import type { PartialProperty, Record, TypedOmit } from '../../types.js';
2
2
  import type { ComponentClass, FunctionComponent } from 'preact';
3
- import { Template, TemplateField } from '../template.model.js';
3
+ import { type Template, TemplateField } from '../template.model.js';
4
4
  import type { TemplateRenderer, TemplateRendererOptions, TemplateRendererString } from '../template.renderer.js';
5
5
  import { TemplateResolver } from '../template.resolver.js';
6
6
  export type JsxTemplate<Context extends Record = any> = FunctionComponent<Context> | ComponentClass<Context, any>;
@@ -1,7 +1,7 @@
1
1
  import type { Observable } from 'rxjs';
2
2
  import { Logger } from '../logger/index.js';
3
3
  import type { Signal } from '../signals/api.js';
4
- import type { Enumeration, EnumerationValue } from '../types.js';
4
+ import type { Enumeration, EnumerationValue, Record } from '../types.js';
5
5
  import type { PropertyName } from '../utils/object/property-name.js';
6
6
  export type Language = {
7
7
  code: string;
@@ -15,9 +15,7 @@ export type LocalizeItem<Parameters = void> = string | LocalizeFunction<Paramete
15
15
  type LocalizationTemplate = {
16
16
  [key: string]: LocalizeItem<any> | LocalizationTemplate;
17
17
  };
18
- export type EnumerationLocalization<T extends Enumeration = Enumeration> = {
19
- [P in EnumerationValue<T>]: LocalizeItem<any>;
20
- };
18
+ export type EnumerationLocalization<T extends Enumeration = Enumeration> = Record<EnumerationValue<T>, LocalizeItem<any>>;
21
19
  export type EnumerationLocalizationEntry<T extends Enumeration = Enumeration> = [enumType: T, enumName: LocalizeItem<any> | undefined, enumValues: EnumerationLocalization<T>];
22
20
  export type Localization<T extends LocalizationTemplate = LocalizationTemplate, Enums extends Enumeration[] = Enumeration[]> = {
23
21
  language: Language;
package/tsconfig.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "module": "nodenext",
5
5
  "moduleResolution": "nodenext",
6
6
  "lib": ["esnext", "dom"],
7
- "target": "es2023",
7
+ "target": "es2024",
8
8
  "baseUrl": "source/",
9
9
  "rootDir": "source/",
10
10
  "outDir": "dist/",
@@ -20,27 +20,23 @@
20
20
  "experimentalDecorators": true,
21
21
 
22
22
  /* strictness */
23
+ "strict": true,
24
+ "strictPropertyInitialization": false,
23
25
  "allowUnreachableCode": false,
24
26
  "allowUnusedLabels": false,
25
- "alwaysStrict": true,
26
27
  "exactOptionalPropertyTypes": false,
27
28
  "noFallthroughCasesInSwitch": true,
28
- "noImplicitAny": true,
29
29
  "noImplicitOverride": true,
30
30
  "noImplicitReturns": true,
31
- "noImplicitThis": true,
31
+ "noUncheckedSideEffectImports": true,
32
32
  "noPropertyAccessFromIndexSignature": true,
33
33
  "noUncheckedIndexedAccess": true,
34
34
  "noUnusedLocals": false,
35
35
  "noUnusedParameters": true,
36
- "strict": true,
37
- "strictBindCallApply": true,
38
- "strictFunctionTypes": true,
39
- "strictNullChecks": true,
40
- "strictPropertyInitialization": false,
41
- "useDefineForClassFields": true,
42
36
  "useUnknownInCatchVariables": true,
37
+
43
38
  "isolatedModules": true,
39
+ "verbatimModuleSyntax": true,
44
40
 
45
41
  /* jsx */
46
42
  "jsx": "react-jsx",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "extends": "./tsconfig.json", // in dist tsconfig.base.json is renamed to tsconfig.json
3
3
  "compilerOptions": {
4
- "target": "es2023"
4
+ "target": "es2024"
5
5
  }
6
6
  }
@@ -0,0 +1,2 @@
1
+ export type * from './geo-json.js';
2
+ export type * from './tagged.js';
package/types/index.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { Record } from '../types.js';
2
+ export declare const tag: unique symbol;
3
+ export declare const type: unique symbol;
4
+ export type TagContainer<Type, Token> = {
5
+ readonly [tag]?: Token;
6
+ readonly [type]?: Type;
7
+ };
8
+ export type Tag<Type, Token extends PropertyKey, TagMetadata> = TagContainer<Type, Record<Token, TagMetadata>>;
9
+ export type HasTag<T, Token = unknown> = T extends TagContainer<unknown, Token> ? true : false;
10
+ export type Tagged<Type = unknown, TagName extends PropertyKey = PropertyKey, TagMetadata = unknown> = Type & Tag<Type, TagName, TagMetadata>;
11
+ export type GetTagMetadata<Type extends Tag<unknown, TagName, unknown>, TagName extends PropertyKey> = NonNullable<Type[typeof tag]>[TagName];
12
+ export type UnwrapTagged<TaggedType extends Tag<unknown, PropertyKey, any>> = TaggedType extends Tagged<infer Type, PropertyKey, any> ? Type : never;
13
+ export type Untagged<T> = T extends Tagged ? UnwrapTagged<T> : T;
14
+ export type UntaggedDeep<T> = T extends Tagged ? UnwrapTagged<T> : T extends readonly (infer U)[] ? UntaggedDeep<U>[] : T extends Record ? {
15
+ [P in keyof T]: UntaggedDeep<T[P]>;
16
+ } : Untagged<T>;
@@ -0,0 +1 @@
1
+ export {};
package/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Observable } from 'rxjs';
2
- import type { CamelCase, Except, IsEqual, LiteralUnion, Tagged, UnwrapTagged } from 'type-fest';
2
+ import type { CamelCase, Except, IsEqual, LiteralUnion } from 'type-fest';
3
3
  import type { Signal } from './signals/api.js';
4
4
  export type ObjectLiteral = {};
5
5
  export type Function<P extends any[] = any[], R = any> = (...params: P) => R;
@@ -94,10 +94,10 @@ export type DeepWritable<T> = T extends readonly (infer U)[] ? DeepWritable<U>[]
94
94
  -readonly [P in keyof T]: DeepWritable<T[P]>;
95
95
  };
96
96
  export type RequiredKeys<T> = {
97
- [K in keyof T]-?: {} extends Pick<T, K> ? never : K;
97
+ [K in keyof T]-?: ObjectLiteral extends Pick<T, K> ? never : K;
98
98
  }[keyof T];
99
99
  export type OptionalKeys<T> = {
100
- [K in keyof T]-?: {} extends Pick<T, K> ? K : never;
100
+ [K in keyof T]-?: ObjectLiteral extends Pick<T, K> ? K : never;
101
101
  }[keyof T];
102
102
  export type TypedOmit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
103
103
  export type TypedExtract<T, U extends T> = T extends U ? T : never;
@@ -105,7 +105,7 @@ export type ReplaceIfUnknown<T, U> = IfUnknown<T, U, T>;
105
105
  export type OmitNever<T extends Record> = {
106
106
  [K in keyof T as T[K] extends never ? never : K]: T[K];
107
107
  };
108
- export type BaseType<T extends Exclude<Primitive, null | undefined>> = T extends string ? string : never | T extends number ? number : never | T extends boolean ? boolean : never | T extends bigint ? bigint : never | T extends symbol ? symbol : never;
108
+ export type BaseType<T extends Exclude<Primitive, null | undefined>> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends bigint ? bigint : T extends symbol ? symbol : T extends null ? null : T extends undefined ? undefined : never;
109
109
  export type SharedProperties<A, B, C = unknown, D = unknown, E = unknown, F = unknown, G = unknown, H = unknown, I = unknown, J = unknown> = OmitNever<Pick<A & B & C & D & E & F & G & H & I & J, keyof A & keyof B & keyof ReplaceIfUnknown<C, never> & keyof ReplaceIfUnknown<D, never> & keyof ReplaceIfUnknown<E, never> & keyof ReplaceIfUnknown<F, never> & keyof ReplaceIfUnknown<G, never> & keyof ReplaceIfUnknown<H, never> & keyof ReplaceIfUnknown<I, never> & keyof ReplaceIfUnknown<J, never>>>;
110
110
  /**
111
111
  * Omit properties from a type that extend from a specific type.
@@ -158,7 +158,7 @@ export type IfAny<T, Then, Else = never> = true extends (false & T) ? Then : Els
158
158
  export type IfUnknown<T, Then, Else = never> = unknown extends T ? Then : Else;
159
159
  export type IsAny<T> = IfAny<T, true, false>;
160
160
  export type IsUnknown<T> = IfUnknown<T, true, false>;
161
- export type If<B extends Boolean, Then, Else> = B extends true ? Then : Else;
161
+ export type If<B extends boolean, Then, Else> = B extends true ? Then : Else;
162
162
  export type Not<T extends boolean> = T extends true ? false : true;
163
163
  export type Fallback<T, F> = [T] extends [never] ? F : T;
164
164
  export type PartialProperty<T, P extends keyof T> = Omit<T, P> & Partial<Pick<T, P>>;
@@ -195,7 +195,7 @@ export type Paths<T extends Record> = T extends object ? {
195
195
  export type TypeFromPath<T extends Record, Path extends Paths<T> | string> = {
196
196
  [K in Path]: K extends keyof T ? T[K] : K extends `${infer P}.${infer S}` ? T[P] extends Record ? TypeFromPath<T[P], S> : never : never;
197
197
  }[Path];
198
- export type ConstructorParameterDecorator = (target: Object, propertyKey: undefined, parameterIndex: number) => void;
198
+ export type ConstructorParameterDecorator = (target: object, propertyKey: undefined, parameterIndex: number) => void;
199
199
  export type ReactiveValue<T> = T | Signal<T> | Observable<T>;
200
200
  export type PascalCase<Value> = CamelCase<Value> extends string ? Capitalize<CamelCase<Value>> : CamelCase<Value>;
201
201
  type PickOmitDeepSelection<T> = T extends (infer U)[] ? (boolean | PickOmitDeepSelection<U>) : T extends Record<any> ? (boolean | {
@@ -211,8 +211,4 @@ export type OmitDeep<T, S extends OmitDeepSelection<T>> = T extends Record<any>
211
211
  S[Extract<P, keyof S>]
212
212
  ] extends ([false] | [never]) ? T[P] : S[Extract<P, keyof S>] extends Record<any> ? T[P] extends (infer U)[] ? S[Extract<P, keyof S>] extends OmitDeepSelection<U> ? OmitDeep<U, S[Extract<P, keyof S>]>[] : never : S[Extract<P, keyof S>] extends OmitDeepSelection<T[P]> ? OmitDeep<T[P], S[Extract<P, keyof S>]> : never : never;
213
213
  }> : T;
214
- export type Untagged<T> = T extends Tagged<unknown, any, any> ? UnwrapTagged<T> : T;
215
- export type UntaggedDeep<T> = T extends Tagged<unknown, any, any> ? UnwrapTagged<T> : T extends readonly (infer U)[] ? UntaggedDeep<U>[] : T extends Record ? {
216
- [P in keyof T]: UntaggedDeep<T[P]>;
217
- } : Untagged<T>;
218
214
  export {};
@@ -5,8 +5,7 @@ export function multiplexAsync(iterable, count, bufferSize) {
5
5
  throw new Error('bufferSize must be greater than 0');
6
6
  }
7
7
  const feedableIterables = createArray(count, () => new FeedableAsyncIterable());
8
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
9
- multiplexTo(iterable, feedableIterables, bufferSize);
8
+ void multiplexTo(iterable, feedableIterables, bufferSize);
10
9
  return feedableIterables;
11
10
  }
12
11
  async function multiplexTo(input, outputs, bufferSize) {
@@ -26,7 +26,7 @@ export function measureBenchmarkOverhead(duration = 250) {
26
26
  do {
27
27
  warmupFunction();
28
28
  operations++;
29
- } while (timer.milliseconds < testDuration || warmupPhase);
29
+ } while (timer.milliseconds < testDuration || warmupPhase); // eslint-disable-line @typescript-eslint/no-unnecessary-condition
30
30
  timer.stop();
31
31
  microsecondsPerTimerRead = timer.microseconds / operations;
32
32
  }
@@ -46,7 +46,6 @@ export const orderRest = Symbol('Order rest');
46
46
  export function compareByValueSelectionToOrder(order, selector) {
47
47
  const indexMapEntries = order.map((orderItem, index) => [orderItem, index]);
48
48
  const indexMap = new Map(indexMapEntries);
49
- // eslint-disable-next-line @typescript-eslint/no-shadow
50
49
  return function compareByValueSelectionToOrder(a, b) {
51
50
  const selectedA = selector(a);
52
51
  const selectedB = selector(b);
@@ -27,10 +27,8 @@ export interface CryptionResult {
27
27
  export interface DecryptionResult extends CryptionResult {
28
28
  toUtf8(): Promise<string>;
29
29
  }
30
- export interface DigestResult extends CryptionResult {
31
- }
32
- export interface SignResult extends CryptionResult {
33
- }
30
+ export type DigestResult = CryptionResult;
31
+ export type SignResult = CryptionResult;
34
32
  /**
35
33
  * Encrypt data
36
34
  * @param algorithm algorithm as supported by Web Crypto API
@@ -17,6 +17,5 @@ export function runEventLoopWatcher(logger, cancellationSignal) {
17
17
  .watch(0, 100, AggregationMode.ThirdQuartile)
18
18
  .subscribe((delay) => logger.debug(`eventloop: ${formatDuration(delay, 2)}`));
19
19
  sampler.start();
20
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
21
- cancellationSignal.then(async () => sampler.stop());
20
+ void cancellationSignal.then(async () => sampler.stop());
22
21
  }
@@ -1,7 +1,6 @@
1
1
  import { filter } from './filter.js';
2
2
  export function firstOrDefault(iterable, defaultValue, predicate) {
3
3
  const source = (predicate == undefined) ? iterable : filter(iterable, predicate);
4
- // eslint-disable-next-line no-unreachable-loop
5
4
  for (const item of source) {
6
5
  return item;
7
6
  }
@@ -1,7 +1,6 @@
1
1
  import { filter } from './filter.js';
2
2
  export function first(iterable, predicate) {
3
3
  const source = (predicate == undefined) ? iterable : filter(iterable, predicate);
4
- // eslint-disable-next-line no-unreachable-loop
5
4
  for (const item of source) {
6
5
  return item;
7
6
  }
@@ -15,7 +15,7 @@ export function groupToMap(iterable, ...selectors) {
15
15
  }
16
16
  const map = new MultiKeyMap();
17
17
  for (const item of iterable) {
18
- const groupKeys = selectors.map((selector) => selector(item, index)); // eslint-disable-line @typescript-eslint/no-loop-func
18
+ const groupKeys = selectors.map((selector) => selector(item, index));
19
19
  index++;
20
20
  if (!map.has(groupKeys)) {
21
21
  map.set(groupKeys, []);
@@ -8,7 +8,7 @@ export function lastOrDefault(iterable, defaultValue, predicate) {
8
8
  lastItem = item;
9
9
  }
10
10
  if (hasLastItem) {
11
- return lastItem; // eslint-disable-line @typescript-eslint/no-non-null-assertion
11
+ return lastItem;
12
12
  }
13
13
  return defaultValue;
14
14
  }
@@ -9,7 +9,7 @@ function mergeObjectsInternal(a, b, options, path = '$') {
9
9
  const merged = { ...a };
10
10
  const bEntries = objectEntries(b);
11
11
  for (const [key, valueB] of bEntries) {
12
- if (!hasOwnProperty(merged, key)) {
12
+ if (!hasOwnProperty(merged, key)) { // eslint-disable-line @typescript-eslint/no-unnecessary-condition
13
13
  merged[key] = valueB;
14
14
  continue;
15
15
  }
@@ -34,7 +34,7 @@ function mergeValues(a, b, options, path) {
34
34
  if (!isArray(b)) {
35
35
  throw new Error(`Property type mismatch at ${path}.`);
36
36
  }
37
- return mergeArray(a, b, options, path); // eslint-disable-line @typescript-eslint/no-unsafe-return
37
+ return mergeArray(a, b, options, path);
38
38
  }
39
39
  return mergeObjectsInternal(a, b, options, path);
40
40
  }
@@ -22,8 +22,8 @@ export declare function filterObject<T extends ObjectLiteral>(object: T, predica
22
22
  export declare function filterObjectAsync<T extends ObjectLiteral>(object: T, predicate: (value: T[keyof T], key: keyof T) => Promise<boolean>): Promise<Partial<T>>;
23
23
  export declare function filterUndefinedFromRecord<K extends PropertyKey, V>(record: Record<K, V>): Record<BaseType<K>, Exclude<V, undefined>>;
24
24
  export declare function filterUndefinedObjectProperties<T extends ObjectLiteral>(object: T): SimplifyObject<Optionalize<T>>;
25
- export declare function copyObjectProperties<T extends ObjectLiteral, U extends T>(source: T, target: U): void;
26
- export declare function getGetter<T extends ObjectLiteral, U extends keyof T>(obj: T, property: keyof T, bind: boolean): () => T[U];
25
+ export declare function copyObjectProperties<T extends ObjectLiteral>(source: T, target: T): void;
26
+ export declare function getGetter<T extends ObjectLiteral, U extends keyof T>(obj: T, property: U, bind: boolean): () => T[U];
27
27
  export declare function deepObjectEntries(object: ObjectLiteral, keepInnerObjects?: boolean, prefix?: string): [string, any][];
28
28
  export declare function fromDeepObjectEntries(entries: readonly (readonly [JsonPathInput, any])[]): ObjectLiteral;
29
29
  export declare function omit<T extends Record, K extends keyof T>(object: T, ...keys: K[]): SimplifyObject<Omit<T, K>>;
@@ -32,8 +32,7 @@ export class PeriodicReporter {
32
32
  throw new Error('already started');
33
33
  }
34
34
  this.running = true;
35
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
36
- (async () => {
35
+ void (async () => {
37
36
  this.counter = 0;
38
37
  this.stopRequested = false;
39
38
  this.stopToken.unset();
@@ -1,4 +1,4 @@
1
- import 'reflect-metadata/lite'; // eslint-disable-line import/no-unassigned-import
1
+ import 'reflect-metadata/lite';
2
2
  export function getDesignType(target, propertyKey) {
3
3
  return Reflect.getMetadata('design:type', target, propertyKey);
4
4
  }
package/utils/repl.d.ts CHANGED
@@ -5,5 +5,5 @@ import type { Record } from '../types.js';
5
5
  * @param context context to set the repl context to
6
6
  */
7
7
  export declare function repl(options?: ReplOptions & {
8
- context?: Record<string>;
8
+ context?: Record<string, unknown>;
9
9
  }): Promise<void>;
package/utils/repl.js CHANGED
@@ -1,4 +1,3 @@
1
- /* eslint-disable import/no-nodejs-modules */
2
1
  import { dynamicImport } from '../import.js';
3
2
  import { objectEntries } from './object/object.js';
4
3
  import { isDefined } from './type-guards.js';
package/utils/set.js CHANGED
@@ -1,4 +1,3 @@
1
- /* eslint-disable max-statements */
2
1
  import { compareByValueSelectionDescending } from './comparison.js';
3
2
  export function intersectSets(...sets) {
4
3
  if (sets.length == 0) {
@@ -39,7 +39,7 @@ export function sliceStream(stream, offset, length, type = 'bytes') {
39
39
  let offsetBuffer = new ArrayBuffer(mebibyte);
40
40
  return new ReadableStream({
41
41
  type: 'bytes',
42
- autoAllocateChunkSize: 100 * kibibyte, // eslint-disable-line @typescript-eslint/no-magic-numbers
42
+ autoAllocateChunkSize: 100 * kibibyte,
43
43
  async pull(controller) {
44
44
  while (bytesRead < offset) {
45
45
  const readResult = await byobReader.read(new Uint8Array(offsetBuffer, 0, Math.min(offsetBuffer.byteLength, offset - bytesRead)));
@@ -50,7 +50,7 @@ export function sliceStream(stream, offset, length, type = 'bytes') {
50
50
  }
51
51
  bytesRead += readResult.value.byteLength;
52
52
  if (bytesRead == offset) {
53
- offsetBuffer = null; // eslint-disable-line require-atomic-updates
53
+ offsetBuffer = null;
54
54
  }
55
55
  }
56
56
  if ((bytesRead - offset) == length) {