@tstdl/base 0.91.42 → 0.91.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +64 -64
- package/collections/awaitable/awaitable-map.d.ts +4 -4
- package/collections/awaitable/awaitable-set.d.ts +4 -4
- package/collections/keyed-set.d.ts +4 -4
- package/collections/observable/observable-map.d.ts +5 -5
- package/collections/observable/observable-set.d.ts +4 -4
- package/data-structures/array-dictionary.d.ts +3 -3
- package/data-structures/circular-buffer.d.ts +1 -1
- package/data-structures/collection.d.ts +3 -3
- package/data-structures/dictionary.d.ts +7 -7
- package/data-structures/distinct-collection.d.ts +5 -5
- package/data-structures/iterable-weak-map.d.ts +5 -5
- package/data-structures/list.d.ts +24 -24
- package/data-structures/list.js +10 -10
- package/data-structures/map-dictionary.d.ts +3 -3
- package/data-structures/multi-key-map.d.ts +3 -3
- package/data-structures/multi-key-set.d.ts +1 -1
- package/data-structures/set-collection.d.ts +4 -4
- package/data-structures/weak-ref-map.d.ts +5 -5
- package/decorators/log.js +0 -1
- package/examples/orm/user.model.d.ts +2 -2
- package/function/log.js +0 -1
- package/injector/decorators.js +1 -1
- package/injector/type-info.d.ts +8 -8
- package/orm/index.d.ts +1 -0
- package/orm/index.js +1 -0
- package/orm/types.d.ts +5 -3
- package/package.json +11 -11
- package/pdf/pdf.service.js +9 -4
- package/pool/pool.d.ts +1 -1
- package/search-index/elastic/model/elastic-query.d.ts +16 -16
- package/search-index/elastic/model/index-mapping.d.ts +11 -11
- package/search-index/elastic/model/sort.d.ts +4 -4
- package/search-index/elastic/query-converter.d.ts +2 -2
- package/search-index/elastic/search-index.d.ts +4 -4
- package/search-index/elastic/types.d.ts +5 -1
- package/serializer/serializer.js +1 -1
- package/types.js +1 -1
- package/utils/equals.js +0 -1
- package/utils/factory-map.d.ts +4 -4
- package/utils/helpers.js +0 -1
- package/utils/object/forward-ref.js +1 -1
- package/utils/type-guards.js +0 -1
- package/utils/type-of.js +0 -1
package/.eslintrc.json
CHANGED
|
@@ -25,99 +25,99 @@
|
|
|
25
25
|
},
|
|
26
26
|
"plugins": ["@stylistic"],
|
|
27
27
|
"rules": {
|
|
28
|
-
"camelcase":
|
|
28
|
+
"camelcase": "off",
|
|
29
29
|
"capitalized-comments": ["warn", "always", { "ignorePattern": "noop" }],
|
|
30
|
-
"class-methods-use-this":
|
|
31
|
-
"complexity":
|
|
32
|
-
"consistent-type-definitions":
|
|
33
|
-
"eqeqeq":
|
|
34
|
-
"explicit-function-return-type":
|
|
35
|
-
"explicit-member-accessibility":
|
|
30
|
+
"class-methods-use-this": "off",
|
|
31
|
+
"complexity": "off",
|
|
32
|
+
"consistent-type-definitions": "off",
|
|
33
|
+
"eqeqeq": "off",
|
|
34
|
+
"explicit-function-return-type": "off",
|
|
35
|
+
"explicit-member-accessibility": "off",
|
|
36
36
|
"func-style": ["warn", "declaration", { "allowArrowFunctions": true }],
|
|
37
|
-
"id-length":
|
|
38
|
-
"init-declarations":
|
|
39
|
-
"line-comment-position":
|
|
40
|
-
"max-classes-per-file":
|
|
37
|
+
"id-length": "off",
|
|
38
|
+
"init-declarations": "off",
|
|
39
|
+
"line-comment-position": "off",
|
|
40
|
+
"max-classes-per-file": "off",
|
|
41
41
|
"max-lines-per-function": ["warn", { "max": 100, "skipBlankLines": true, "skipComments": true }],
|
|
42
|
-
"max-lines":
|
|
43
|
-
"max-params":
|
|
44
|
-
"max-statements":
|
|
45
|
-
"new-cap":
|
|
46
|
-
"no-await-in-loop":
|
|
47
|
-
"no-bitwise":
|
|
42
|
+
"max-lines": "off",
|
|
43
|
+
"max-params": "off",
|
|
44
|
+
"max-statements": "off",
|
|
45
|
+
"new-cap": "off",
|
|
46
|
+
"no-await-in-loop": "off",
|
|
47
|
+
"no-bitwise": "off",
|
|
48
48
|
"no-case-declarations": ["warn"],
|
|
49
|
-
"no-confusing-void-expression":
|
|
49
|
+
"no-confusing-void-expression": "off",
|
|
50
50
|
"no-constant-condition": ["warn", { "checkLoops": false }],
|
|
51
|
-
"no-continue":
|
|
52
|
-
"no-duplicate-imports":
|
|
53
|
-
"no-empty-interface":
|
|
54
|
-
"no-explicit-any":
|
|
55
|
-
"no-inferrable-types":
|
|
56
|
-
"no-inline-comments":
|
|
57
|
-
"no-magic-numbers":
|
|
51
|
+
"no-continue": "off",
|
|
52
|
+
"no-duplicate-imports": "off",
|
|
53
|
+
"no-empty-interface": "off",
|
|
54
|
+
"no-explicit-any": "off",
|
|
55
|
+
"no-inferrable-types": "off",
|
|
56
|
+
"no-inline-comments": "off",
|
|
57
|
+
"no-magic-numbers": "off",
|
|
58
58
|
"no-negated-condition": ["warn"],
|
|
59
|
-
"no-nested-ternary":
|
|
60
|
-
"no-plusplus":
|
|
61
|
-
"no-promise-executor-return":
|
|
62
|
-
"no-restricted-imports":
|
|
63
|
-
"no-ternary":
|
|
64
|
-
"no-undefined":
|
|
65
|
-
"no-underscore-dangle":
|
|
66
|
-
"no-unnecessary-condition":
|
|
67
|
-
"no-unused-vars":
|
|
68
|
-
"no-use-before-define":
|
|
59
|
+
"no-nested-ternary": "off",
|
|
60
|
+
"no-plusplus": "off",
|
|
61
|
+
"no-promise-executor-return": "off",
|
|
62
|
+
"no-restricted-imports": "off",
|
|
63
|
+
"no-ternary": "off",
|
|
64
|
+
"no-undefined": "off",
|
|
65
|
+
"no-underscore-dangle": "off",
|
|
66
|
+
"no-unnecessary-condition": "off",
|
|
67
|
+
"no-unused-vars": "off",
|
|
68
|
+
"no-use-before-define": "off",
|
|
69
69
|
"no-void": ["warn", { "allowAsStatement": true }],
|
|
70
70
|
"one-var": ["warn", "never"],
|
|
71
71
|
"prefer-arrow-callback": ["warn"],
|
|
72
|
-
"prefer-destructuring":
|
|
72
|
+
"prefer-destructuring": "off",
|
|
73
73
|
"prefer-named-capture-group": ["warn"],
|
|
74
|
-
"restrict-template-expressions":
|
|
74
|
+
"restrict-template-expressions": "off",
|
|
75
75
|
"sort-imports": ["off", { "ignoreCase": true }],
|
|
76
|
-
"sort-keys":
|
|
77
|
-
"sort-type-constituents":
|
|
76
|
+
"sort-keys": "off",
|
|
77
|
+
"sort-type-constituents": "off",
|
|
78
78
|
|
|
79
|
-
"@typescript-eslint/ban-types": ["warn"],
|
|
80
79
|
"@typescript-eslint/class-methods-use-this": ["warn", { "ignoreOverrideMethods": true, "ignoreClassesThatImplementAnInterface": true }],
|
|
81
|
-
"@typescript-eslint/consistent-type-definitions":
|
|
80
|
+
"@typescript-eslint/consistent-type-definitions": "off",
|
|
82
81
|
"@typescript-eslint/consistent-type-imports": ["warn", { "prefer": "type-imports", "fixStyle": "inline-type-imports", "disallowTypeAnnotations": false }],
|
|
83
82
|
"@typescript-eslint/explicit-function-return-type": ["warn", { "allowExpressions": true, "allowFunctionsWithoutTypeParameters": true }],
|
|
84
83
|
"@typescript-eslint/explicit-member-accessibility": ["warn", { "accessibility": "no-public" }],
|
|
85
|
-
"@typescript-eslint/init-declarations":
|
|
84
|
+
"@typescript-eslint/init-declarations": "off",
|
|
86
85
|
"@typescript-eslint/max-params": ["warn", { "max": 5 }],
|
|
87
86
|
"@typescript-eslint/no-confusing-void-expression": ["warn", { "ignoreArrowShorthand": true, "ignoreVoidOperator": true }],
|
|
88
87
|
"@typescript-eslint/no-empty-interface": ["warn", { "allowSingleExtends": true }],
|
|
89
|
-
"@typescript-eslint/no-explicit-any":
|
|
88
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
90
89
|
"@typescript-eslint/no-inferrable-types": ["warn", { "ignoreParameters": true, "ignoreProperties": true }],
|
|
91
90
|
"@typescript-eslint/no-invalid-void-type": ["warn", { "allowInGenericTypeArguments": true }],
|
|
92
91
|
"@typescript-eslint/no-magic-numbers": ["warn", { "ignoreEnums": true, "ignoreNumericLiteralTypes": true, "ignoreReadonlyClassProperties": true, "ignoreArrayIndexes": true, "ignoreTypeIndexes": true, "ignore": [0, 1, 2, 4, 8, 16, 32, 64, 128, 192, 255, 256, 512, 1024, 2048, 4096, 8192] }],
|
|
93
92
|
"@typescript-eslint/no-restricted-imports": ["warn"],
|
|
94
93
|
"@typescript-eslint/no-unnecessary-condition": ["warn", { "allowConstantLoopConditions": true }],
|
|
95
|
-
"@typescript-eslint/no-unsafe-assignment":
|
|
94
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
95
|
+
"@typescript-eslint/no-unsafe-type-assertion": "off",
|
|
96
96
|
"@typescript-eslint/no-unused-vars": ["warn", { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }],
|
|
97
|
-
"@typescript-eslint/no-use-before-define":
|
|
98
|
-
"@typescript-eslint/prefer-destructuring":
|
|
97
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
98
|
+
"@typescript-eslint/prefer-destructuring": "off",
|
|
99
99
|
"@typescript-eslint/restrict-template-expressions": ["warn", { "allowNumber": true, "allowBoolean": true, "allowNullish": true }],
|
|
100
|
-
"@typescript-eslint/sort-type-constituents":
|
|
101
|
-
"@typescript-eslint/method-signature-style":
|
|
100
|
+
"@typescript-eslint/sort-type-constituents": "off",
|
|
101
|
+
"@typescript-eslint/method-signature-style": "off",
|
|
102
102
|
|
|
103
103
|
/* deprecated */
|
|
104
|
-
"@typescript-eslint/no-non-null-assertion":
|
|
105
|
-
"@typescript-eslint/prefer-readonly-parameter-types":
|
|
106
|
-
"@typescript-eslint/explicit-module-boundary-types":
|
|
104
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
105
|
+
"@typescript-eslint/prefer-readonly-parameter-types": "off",
|
|
106
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
107
107
|
|
|
108
108
|
"@stylistic/brace-style": ["warn", "stroustrup", { "allowSingleLine": true }],
|
|
109
|
-
"@stylistic/explicit-module-boundary-types":
|
|
110
|
-
"@stylistic/newline-per-chained-call":
|
|
111
|
-
"@stylistic/no-extra-parens":
|
|
112
|
-
"@stylistic/no-extraneous-class":
|
|
113
|
-
"@stylistic/no-non-null-assertion":
|
|
114
|
-
"@stylistic/no-type-alias":
|
|
115
|
-
"@stylistic/no-unused-vars-experimental":
|
|
116
|
-
"@stylistic/no-useless-constructor":
|
|
109
|
+
"@stylistic/explicit-module-boundary-types": "off",
|
|
110
|
+
"@stylistic/newline-per-chained-call": "off",
|
|
111
|
+
"@stylistic/no-extra-parens": "off",
|
|
112
|
+
"@stylistic/no-extraneous-class": "off",
|
|
113
|
+
"@stylistic/no-non-null-assertion": "off",
|
|
114
|
+
"@stylistic/no-type-alias": "off",
|
|
115
|
+
"@stylistic/no-unused-vars-experimental": "off",
|
|
116
|
+
"@stylistic/no-useless-constructor": "off",
|
|
117
117
|
"@stylistic/prefer-readonly-parameter-types": ["off", { "checkParameterProperties": false }],
|
|
118
|
-
"@stylistic/sort-type-union-intersection-members":
|
|
118
|
+
"@stylistic/sort-type-union-intersection-members": "off",
|
|
119
119
|
"@stylistic/space-before-function-paren": ["warn", { "anonymous": "never", "named": "never", "asyncArrow": "always" }],
|
|
120
|
-
"@stylistic/typedef":
|
|
120
|
+
"@stylistic/typedef": "off",
|
|
121
121
|
|
|
122
122
|
"import/consistent-type-specifier-style": ["off", "prefer-inline"],
|
|
123
123
|
"import/newline-after-import": ["warn"],
|
|
@@ -149,13 +149,13 @@
|
|
|
149
149
|
"@stylistic/quotes": ["warn", "single"],
|
|
150
150
|
"@stylistic/semi": ["warn", "always"],
|
|
151
151
|
"@stylistic/multiline-ternary": ["warn", "always-multiline"],
|
|
152
|
-
"@stylistic/generator-star-spacing": ["
|
|
152
|
+
"@stylistic/generator-star-spacing": ["warn", {
|
|
153
153
|
"named": "before",
|
|
154
154
|
"anonymous": "neither",
|
|
155
155
|
"method": "before"
|
|
156
156
|
}],
|
|
157
|
-
"@stylistic/indent":
|
|
158
|
-
"@stylistic/max-len":
|
|
157
|
+
"@stylistic/indent": "off",
|
|
158
|
+
"@stylistic/max-len": "off",
|
|
159
159
|
"@stylistic/object-curly-spacing": ["warn", "always"],
|
|
160
160
|
|
|
161
161
|
"@stylistic/member-delimiter-style": ["warn", {
|
|
@@ -11,10 +11,10 @@ export declare class AwaitableMap<K, V> implements Map<K, V> {
|
|
|
11
11
|
constructor(backingMap?: Map<K, V>);
|
|
12
12
|
static from<K, V>(map: Map<K, V>, clone?: boolean): AwaitableMap<K, V>;
|
|
13
13
|
static fromIterable<K, V>(map: Iterable<[K, V]>): AwaitableMap<K, V>;
|
|
14
|
-
[Symbol.iterator]():
|
|
15
|
-
entries():
|
|
16
|
-
keys():
|
|
17
|
-
values():
|
|
14
|
+
[Symbol.iterator](): MapIterator<[K, V]>;
|
|
15
|
+
entries(): MapIterator<[K, V]>;
|
|
16
|
+
keys(): MapIterator<K>;
|
|
17
|
+
values(): MapIterator<V>;
|
|
18
18
|
clear(): void;
|
|
19
19
|
delete(key: K): boolean;
|
|
20
20
|
forEach(callback: (value: V, key: K, map: AwaitableMap<K, V>) => void, thisArg?: any): void;
|
|
@@ -21,8 +21,8 @@ export declare class AwaitableSet<T> implements Set<T> {
|
|
|
21
21
|
isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;
|
|
22
22
|
forEach(callback: (value: T, value2: T, set: AwaitableSet<T>) => void, thisArg?: any): void;
|
|
23
23
|
has(value: T): boolean;
|
|
24
|
-
entries():
|
|
25
|
-
keys():
|
|
26
|
-
values():
|
|
27
|
-
[Symbol.iterator]():
|
|
24
|
+
entries(): SetIterator<[T, T]>;
|
|
25
|
+
keys(): SetIterator<T>;
|
|
26
|
+
values(): SetIterator<T>;
|
|
27
|
+
[Symbol.iterator](): SetIterator<T>;
|
|
28
28
|
}
|
|
@@ -22,8 +22,8 @@ export declare class KeyedSet<T> implements Set<T> {
|
|
|
22
22
|
isDisjointFrom(_other: ReadonlySetLike<unknown>): boolean;
|
|
23
23
|
forEach(callback: (value: T, value2: T, set: KeyedSet<T>) => void, thisArg?: any): void;
|
|
24
24
|
has(value: T): boolean;
|
|
25
|
-
[Symbol.iterator]():
|
|
26
|
-
entries():
|
|
27
|
-
keys():
|
|
28
|
-
values():
|
|
25
|
+
[Symbol.iterator](): SetIterator<T>;
|
|
26
|
+
entries(): SetIterator<[T, T]>;
|
|
27
|
+
keys(): SetIterator<T>;
|
|
28
|
+
values(): SetIterator<T>;
|
|
29
29
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Observable } from 'rxjs';
|
|
2
2
|
export declare class ObservableMap<K, V> implements Map<K, V> {
|
|
3
3
|
private readonly backingMap;
|
|
4
4
|
private readonly subject;
|
|
@@ -12,9 +12,9 @@ export declare class ObservableMap<K, V> implements Map<K, V> {
|
|
|
12
12
|
delete(key: K): boolean;
|
|
13
13
|
forEach(callback: (value: V, key: K, map: ObservableMap<K, V>) => void, thisArg?: any): void;
|
|
14
14
|
has(key: K): boolean;
|
|
15
|
-
entries():
|
|
16
|
-
keys():
|
|
17
|
-
values():
|
|
18
|
-
[Symbol.iterator]():
|
|
15
|
+
entries(): MapIterator<[K, V]>;
|
|
16
|
+
keys(): MapIterator<K>;
|
|
17
|
+
values(): MapIterator<V>;
|
|
18
|
+
[Symbol.iterator](): MapIterator<[K, V]>;
|
|
19
19
|
private next;
|
|
20
20
|
}
|
|
@@ -22,8 +22,8 @@ export declare class ObservableSet<T> extends ObservableCollectionBase<T, Observ
|
|
|
22
22
|
isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;
|
|
23
23
|
forEach(callback: (value: T, value2: T, set: ObservableSet<T>) => void, thisArg?: any): void;
|
|
24
24
|
has(value: T): boolean;
|
|
25
|
-
entries():
|
|
26
|
-
keys():
|
|
27
|
-
values():
|
|
28
|
-
[Symbol.iterator]():
|
|
25
|
+
entries(): SetIterator<[T, T]>;
|
|
26
|
+
keys(): SetIterator<T>;
|
|
27
|
+
values(): SetIterator<T>;
|
|
28
|
+
[Symbol.iterator](): SetIterator<T>;
|
|
29
29
|
}
|
|
@@ -12,9 +12,9 @@ export declare class ArrayDictionary<K, V> extends Dictionary<K, V, ArrayDiction
|
|
|
12
12
|
add(item: [K, V]): void;
|
|
13
13
|
addMany(items: Iterable<readonly [K, V]>): void;
|
|
14
14
|
clone(): ArrayDictionary<K, V>;
|
|
15
|
-
items():
|
|
16
|
-
keys():
|
|
17
|
-
values():
|
|
15
|
+
items(): MapIterator<[K, V]>;
|
|
16
|
+
keys(): MapIterator<K>;
|
|
17
|
+
values(): MapIterator<V>;
|
|
18
18
|
protected _clear(): void;
|
|
19
19
|
private updateSize;
|
|
20
20
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Observable } from 'rxjs';
|
|
2
2
|
import { type CancellationSignal } from '../cancellation/token.js';
|
|
3
3
|
import { Collection } from './collection.js';
|
|
4
|
-
export declare class CircularBuffer<T> extends Collection<T, CircularBuffer<T>> {
|
|
4
|
+
export declare class CircularBuffer<T> extends Collection<T, IterableIterator<T>, CircularBuffer<T>> {
|
|
5
5
|
private readonly maxBufferSizeSubject;
|
|
6
6
|
private readonly overflowSubject;
|
|
7
7
|
private backingArray;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Observable } from 'rxjs';
|
|
2
2
|
import type { ToJson } from '../interfaces.js';
|
|
3
3
|
import { type Signal } from '../signals/index.js';
|
|
4
|
-
export declare abstract class Collection<T, TThis extends Collection<T, TThis> = Collection<T, any>> implements Iterable<T>, ToJson {
|
|
4
|
+
export declare abstract class Collection<T, TItemsIterator extends IterableIterator<any>, TThis extends Collection<T, TItemsIterator, TThis> = Collection<T, TItemsIterator, any>> implements Iterable<T>, ToJson {
|
|
5
5
|
private readonly sizeSubject;
|
|
6
6
|
private readonly changeSubject;
|
|
7
7
|
private readonly clearSubject;
|
|
@@ -39,7 +39,7 @@ export declare abstract class Collection<T, TThis extends Collection<T, TThis> =
|
|
|
39
39
|
/** Whether the collection has items */
|
|
40
40
|
get hasItems(): boolean;
|
|
41
41
|
constructor();
|
|
42
|
-
[Symbol.iterator]():
|
|
42
|
+
[Symbol.iterator](): TItemsIterator;
|
|
43
43
|
toArray(): T[];
|
|
44
44
|
toJSON(): T[];
|
|
45
45
|
/** Remove all items */
|
|
@@ -59,7 +59,7 @@ export declare abstract class Collection<T, TThis extends Collection<T, TThis> =
|
|
|
59
59
|
/** Clone collection */
|
|
60
60
|
abstract clone(): TThis;
|
|
61
61
|
/** Yields all items from the collection */
|
|
62
|
-
abstract items():
|
|
62
|
+
abstract items(): TItemsIterator;
|
|
63
63
|
/** Clear all data - size is set to 0 automatically */
|
|
64
64
|
protected abstract _clear(): void;
|
|
65
65
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Collection } from './collection.js';
|
|
2
|
-
export declare abstract class Dictionary<K, V, TThis extends Dictionary<K, V, TThis> = Dictionary<K, V, any>> extends Collection<[K, V], TThis> {
|
|
2
|
+
export declare abstract class Dictionary<K, V, TThis extends Dictionary<K, V, TThis> = Dictionary<K, V, any>> extends Collection<[K, V], MapIterator<[K, V]>, TThis> {
|
|
3
3
|
/** Creates a new map and copies the items */
|
|
4
4
|
toMap(): Map<K, V>;
|
|
5
5
|
/** Returns an adapter that has the same interface as {@link Map}. No copying of data involved. */
|
|
@@ -8,8 +8,8 @@ export declare abstract class Dictionary<K, V, TThis extends Dictionary<K, V, TT
|
|
|
8
8
|
abstract get(key: K): V | undefined;
|
|
9
9
|
abstract set(key: K, value: V): void;
|
|
10
10
|
abstract delete(key: K): boolean;
|
|
11
|
-
abstract keys():
|
|
12
|
-
abstract values():
|
|
11
|
+
abstract keys(): MapIterator<K>;
|
|
12
|
+
abstract values(): MapIterator<V>;
|
|
13
13
|
}
|
|
14
14
|
export declare class DictionaryAdapter<K, V> implements Map<K, V> {
|
|
15
15
|
private readonly dictionary;
|
|
@@ -22,8 +22,8 @@ export declare class DictionaryAdapter<K, V> implements Map<K, V> {
|
|
|
22
22
|
get(key: K): V | undefined;
|
|
23
23
|
has(key: K): boolean;
|
|
24
24
|
set(key: K, value: V): this;
|
|
25
|
-
entries():
|
|
26
|
-
keys():
|
|
27
|
-
values():
|
|
28
|
-
[Symbol.iterator]():
|
|
25
|
+
entries(): MapIterator<[K, V]>;
|
|
26
|
+
keys(): MapIterator<K>;
|
|
27
|
+
values(): MapIterator<V>;
|
|
28
|
+
[Symbol.iterator](): MapIterator<[K, V]>;
|
|
29
29
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Collection } from './collection.js';
|
|
2
|
-
export declare abstract class DistinctCollection<T, TThis extends DistinctCollection<T, TThis> = DistinctCollection<T, any>> extends Collection<T, TThis> {
|
|
2
|
+
export declare abstract class DistinctCollection<T, TThis extends DistinctCollection<T, TThis> = DistinctCollection<T, any>> extends Collection<T, SetIterator<T>, TThis> {
|
|
3
3
|
/** Creates a new set and copies the items */
|
|
4
4
|
toSet(): Set<T>;
|
|
5
5
|
/** Returns an adapter that has the same interface as {@link Set}. No copying of data involved. */
|
|
@@ -26,8 +26,8 @@ export declare class SetAdapter<T> implements Set<T> {
|
|
|
26
26
|
isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;
|
|
27
27
|
forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
|
|
28
28
|
has(value: T): boolean;
|
|
29
|
-
entries():
|
|
30
|
-
keys():
|
|
31
|
-
values():
|
|
32
|
-
[Symbol.iterator]():
|
|
29
|
+
entries(): SetIterator<[T, T]>;
|
|
30
|
+
keys(): SetIterator<T>;
|
|
31
|
+
values(): SetIterator<T>;
|
|
32
|
+
[Symbol.iterator](): SetIterator<T>;
|
|
33
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Collection } from './collection.js';
|
|
2
|
-
export declare class IterableWeakMap<K extends object, V> extends Collection<[K, V], IterableWeakMap<K, V>> implements Map<K, V> {
|
|
2
|
+
export declare class IterableWeakMap<K extends object, V> extends Collection<[K, V], MapIterator<[K, V]>, IterableWeakMap<K, V>> implements Map<K, V> {
|
|
3
3
|
private weakMap;
|
|
4
4
|
private refMap;
|
|
5
5
|
private finalizationRegistry;
|
|
@@ -21,10 +21,10 @@ export declare class IterableWeakMap<K extends object, V> extends Collection<[K,
|
|
|
21
21
|
cleanup(): void;
|
|
22
22
|
clone(): IterableWeakMap<K, V>;
|
|
23
23
|
forEach(callback: (value: V, key: K, map: IterableWeakMap<K, V>) => void, thisArg?: any): void;
|
|
24
|
-
entries():
|
|
25
|
-
keys():
|
|
26
|
-
values():
|
|
27
|
-
items():
|
|
24
|
+
entries(): MapIterator<[K, V]>;
|
|
25
|
+
keys(): MapIterator<K>;
|
|
26
|
+
values(): MapIterator<V>;
|
|
27
|
+
items(): MapIterator<[K, V]>;
|
|
28
28
|
protected _clear(): void;
|
|
29
29
|
private updateSize;
|
|
30
30
|
}
|
|
@@ -1,76 +1,76 @@
|
|
|
1
1
|
import type { Predicate } from '../utils/iterable-helpers/types.js';
|
|
2
2
|
import { Collection } from './collection.js';
|
|
3
|
-
export declare abstract class List<T, TThis extends Collection<T, TThis>> extends Collection<T, TThis> {
|
|
4
|
-
/**
|
|
3
|
+
export declare abstract class List<T, TThis extends Collection<T, IterableIterator<T>, TThis>> extends Collection<T, IterableIterator<T>, TThis> {
|
|
4
|
+
/** Get item at index */
|
|
5
5
|
at(index: number): T;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Find index of first occurrence of item
|
|
8
8
|
* @param item item to search for
|
|
9
9
|
* @param fromIndex index to start search at
|
|
10
10
|
*/
|
|
11
11
|
indexOf(item: T, fromIndex?: number): number | undefined;
|
|
12
|
-
/**
|
|
12
|
+
/** Index of item (last occurrence) */
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Find index of last occurrence of item
|
|
15
15
|
* @param item item to search for
|
|
16
16
|
* @param fromIndex index to start from (backwards)
|
|
17
17
|
*/
|
|
18
18
|
lastIndexOf(item: T, fromIndex?: number): number | undefined;
|
|
19
|
-
/**
|
|
19
|
+
/** Set item at index */
|
|
20
20
|
set(index: number, item: T): void;
|
|
21
|
-
/**
|
|
21
|
+
/** Remove item at index */
|
|
22
22
|
removeAt(index: number): T;
|
|
23
|
-
/**
|
|
23
|
+
/** Remove first item */
|
|
24
24
|
removeFirst(): T;
|
|
25
|
-
/**
|
|
25
|
+
/** Remove last item */
|
|
26
26
|
removeLast(): T;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Remove many items at index
|
|
29
29
|
* @param index index to start removing at
|
|
30
30
|
* @param count how many items to remove. If not defined, all items starting at `index` are removed
|
|
31
31
|
*/
|
|
32
32
|
removeManyAt(index: number, count?: number): T[];
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* Remove range of items at `fromIndex` to `toIndex`
|
|
35
35
|
* @param fromIndex index to start removing at
|
|
36
36
|
* @param toIndex index to remove to
|
|
37
37
|
*/
|
|
38
38
|
removeRange(fromIndex: number, toIndex: number): T[];
|
|
39
39
|
protected ensureBounds(index: number, count?: number): void;
|
|
40
40
|
protected normalizeIndex(index: number): number;
|
|
41
|
-
/**
|
|
41
|
+
/** Yields all items from the list in reverse */
|
|
42
42
|
abstract itemsReverse(): IterableIterator<T>;
|
|
43
|
-
/**
|
|
43
|
+
/** Get item at index */
|
|
44
44
|
protected abstract _at(index: number): T;
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* Find index of first occurrence of item
|
|
47
47
|
* @param item item to search for
|
|
48
48
|
* @param fromIndex index to start search at
|
|
49
49
|
*/
|
|
50
50
|
protected abstract _indexOf(item: T, fromIndex?: number): number | undefined;
|
|
51
|
-
/**
|
|
51
|
+
/** Index of match (first occurrence) */
|
|
52
52
|
protected abstract findIndex(predicate: Predicate<T>): number | undefined;
|
|
53
|
-
/**
|
|
53
|
+
/** Index of item (last occurrence) */
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* Find index of last occurrence of item
|
|
56
56
|
* @param item item to search for
|
|
57
57
|
* @param fromIndex index to start from (backwards)
|
|
58
58
|
*/
|
|
59
59
|
protected abstract _lastIndexOf(item: T, fromIndex?: number): number | undefined;
|
|
60
|
-
/**
|
|
60
|
+
/** Index of match (last occurrence) */
|
|
61
61
|
protected abstract findLastIndex(predicate: Predicate<T>): number | undefined;
|
|
62
|
-
/**
|
|
62
|
+
/** Set item at index */
|
|
63
63
|
protected abstract _set(index: number, item: T): void;
|
|
64
|
-
/**
|
|
64
|
+
/** Add item to start of list */
|
|
65
65
|
protected abstract prepend(item: T): void;
|
|
66
|
-
/**
|
|
66
|
+
/** Add many items to start of list */
|
|
67
67
|
protected abstract prependMany(items: Iterable<T>): void;
|
|
68
|
-
/**
|
|
68
|
+
/** Remove item */
|
|
69
69
|
protected abstract remove(item: T): boolean;
|
|
70
|
-
/**
|
|
70
|
+
/** Remove item at index */
|
|
71
71
|
protected abstract _removeAt(index: number): T;
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
73
|
+
* Remove many items at index
|
|
74
74
|
* @param index index to start removing at
|
|
75
75
|
* @param count how many items to remove. If not defined, all items starting at `index` are removed
|
|
76
76
|
*/
|
package/data-structures/list.js
CHANGED
|
@@ -2,51 +2,51 @@ import { isDefined } from '../utils/type-guards.js';
|
|
|
2
2
|
import { Collection } from './collection.js';
|
|
3
3
|
import { IndexOutOfBoundsError } from './index-out-of-bounds.error.js';
|
|
4
4
|
export class List extends Collection {
|
|
5
|
-
/**
|
|
5
|
+
/** Get item at index */
|
|
6
6
|
at(index) {
|
|
7
7
|
const normalizedIndex = this.normalizeIndex(index);
|
|
8
8
|
this.ensureBounds(normalizedIndex);
|
|
9
9
|
return this._at(normalizedIndex);
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Find index of first occurrence of item
|
|
13
13
|
* @param item item to search for
|
|
14
14
|
* @param fromIndex index to start search at
|
|
15
15
|
*/
|
|
16
16
|
indexOf(item, fromIndex) {
|
|
17
17
|
return this._indexOf(item, isDefined(fromIndex) ? this.normalizeIndex(fromIndex) : fromIndex);
|
|
18
18
|
}
|
|
19
|
-
/**
|
|
19
|
+
/** Index of item (last occurrence) */
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Find index of last occurrence of item
|
|
22
22
|
* @param item item to search for
|
|
23
23
|
* @param fromIndex index to start from (backwards)
|
|
24
24
|
*/
|
|
25
25
|
lastIndexOf(item, fromIndex) {
|
|
26
26
|
return this._lastIndexOf(item, isDefined(fromIndex) ? this.normalizeIndex(fromIndex) : fromIndex);
|
|
27
27
|
}
|
|
28
|
-
/**
|
|
28
|
+
/** Set item at index */
|
|
29
29
|
set(index, item) {
|
|
30
30
|
const normalizedIndex = this.normalizeIndex(index);
|
|
31
31
|
this.ensureBounds(normalizedIndex);
|
|
32
32
|
this._set(normalizedIndex, item);
|
|
33
33
|
}
|
|
34
|
-
/**
|
|
34
|
+
/** Remove item at index */
|
|
35
35
|
removeAt(index) {
|
|
36
36
|
const normalizedIndex = this.normalizeIndex(index);
|
|
37
37
|
this.ensureBounds(normalizedIndex);
|
|
38
38
|
return this._removeAt(normalizedIndex);
|
|
39
39
|
}
|
|
40
|
-
/**
|
|
40
|
+
/** Remove first item */
|
|
41
41
|
removeFirst() {
|
|
42
42
|
return this.removeAt(0);
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
44
|
+
/** Remove last item */
|
|
45
45
|
removeLast() {
|
|
46
46
|
return this.removeAt(-1);
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Remove many items at index
|
|
50
50
|
* @param index index to start removing at
|
|
51
51
|
* @param count how many items to remove. If not defined, all items starting at `index` are removed
|
|
52
52
|
*/
|
|
@@ -56,7 +56,7 @@ export class List extends Collection {
|
|
|
56
56
|
return this._removeManyAt(normalizedIndex, count);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* Remove range of items at `fromIndex` to `toIndex`
|
|
60
60
|
* @param fromIndex index to start removing at
|
|
61
61
|
* @param toIndex index to remove to
|
|
62
62
|
*/
|
|
@@ -11,9 +11,9 @@ export declare class MapDictionary<K, V> extends Dictionary<K, V, MapDictionary<
|
|
|
11
11
|
add(item: [K, V]): void;
|
|
12
12
|
addMany(items: Iterable<readonly [K, V]>): void;
|
|
13
13
|
clone(): MapDictionary<K, V>;
|
|
14
|
-
items():
|
|
15
|
-
keys():
|
|
16
|
-
values():
|
|
14
|
+
items(): MapIterator<[K, V]>;
|
|
15
|
+
keys(): MapIterator<K>;
|
|
16
|
+
values(): MapIterator<V>;
|
|
17
17
|
protected _clear(): void;
|
|
18
18
|
private updateSize;
|
|
19
19
|
}
|
|
@@ -24,9 +24,9 @@ export declare class MultiKeyMap<K extends any[], V> extends Dictionary<K, V, Mu
|
|
|
24
24
|
deleteFlat(...key: K): boolean;
|
|
25
25
|
delete(key: K): boolean;
|
|
26
26
|
clone(): MultiKeyMap<K, V>;
|
|
27
|
-
keys():
|
|
28
|
-
values():
|
|
29
|
-
items():
|
|
27
|
+
keys(): MapIterator<K>;
|
|
28
|
+
values(): MapIterator<V>;
|
|
29
|
+
items(): MapIterator<[K, V]>;
|
|
30
30
|
protected _clear(): void;
|
|
31
31
|
private getNode;
|
|
32
32
|
private deleteNodeIfEmpty;
|
|
@@ -13,7 +13,7 @@ export declare class MultiKeySet<T extends any[]> extends DistinctCollection<T>
|
|
|
13
13
|
deleteFlat(...value: T): boolean;
|
|
14
14
|
delete(value: T): boolean;
|
|
15
15
|
clone(): MultiKeySet<T>;
|
|
16
|
-
items():
|
|
16
|
+
items(): SetIterator<T>;
|
|
17
17
|
protected _clear(): void;
|
|
18
18
|
protected _getBackingSet(): ReadonlySet<T> | undefined;
|
|
19
19
|
private updateSize;
|
|
@@ -8,7 +8,7 @@ export declare class SetCollection<T> extends DistinctCollection<T, SetCollectio
|
|
|
8
8
|
add(item: T): this;
|
|
9
9
|
addMany(items: Iterable<T>): void;
|
|
10
10
|
clone(): SetCollection<T>;
|
|
11
|
-
items():
|
|
11
|
+
items(): SetIterator<T>;
|
|
12
12
|
delete(item: T): boolean;
|
|
13
13
|
union<U>(other: ReadonlySetLike<U>): SetCollection<T | U>;
|
|
14
14
|
intersection<U>(other: ReadonlySetLike<U>): SetCollection<T & U>;
|
|
@@ -19,9 +19,9 @@ export declare class SetCollection<T> extends DistinctCollection<T, SetCollectio
|
|
|
19
19
|
isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;
|
|
20
20
|
forEach(callbackfn: (value: T, value2: T, set: globalThis.Set<T>) => void, thisArg?: any): void;
|
|
21
21
|
has(item: T): boolean;
|
|
22
|
-
entries():
|
|
23
|
-
keys():
|
|
24
|
-
values():
|
|
22
|
+
entries(): SetIterator<[T, T]>;
|
|
23
|
+
keys(): SetIterator<T>;
|
|
24
|
+
values(): SetIterator<T>;
|
|
25
25
|
protected _clear(): void;
|
|
26
26
|
protected _getBackingSet(): ReadonlySet<T> | undefined;
|
|
27
27
|
private updateSize;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Collection } from './collection.js';
|
|
2
|
-
export declare class WeakRefMap<K, V extends object> extends Collection<[K, V], WeakRefMap<K, V>> implements Map<K, V> {
|
|
2
|
+
export declare class WeakRefMap<K, V extends object> extends Collection<[K, V], MapIterator<[K, V]>, WeakRefMap<K, V>> implements Map<K, V> {
|
|
3
3
|
private readonly backingMapProvider;
|
|
4
4
|
private backingMap;
|
|
5
5
|
private finalizationRegistry;
|
|
@@ -21,9 +21,9 @@ export declare class WeakRefMap<K, V extends object> extends Collection<[K, V],
|
|
|
21
21
|
cleanup(): void;
|
|
22
22
|
clone(): WeakRefMap<K, V>;
|
|
23
23
|
forEach(callback: (value: V, key: K, map: WeakRefMap<K, V>) => void, thisArg?: any): void;
|
|
24
|
-
entries():
|
|
25
|
-
keys():
|
|
26
|
-
values():
|
|
27
|
-
items():
|
|
24
|
+
entries(): MapIterator<[K, V]>;
|
|
25
|
+
keys(): MapIterator<K>;
|
|
26
|
+
values(): MapIterator<V>;
|
|
27
|
+
items(): MapIterator<[K, V]>;
|
|
28
28
|
protected _clear(): void;
|
|
29
29
|
}
|
package/decorators/log.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Entity, Integer } from '../../orm/index.js';
|
|
1
|
+
import { Entity, Enum, Integer } from '../../orm/index.js';
|
|
2
2
|
export declare enum Foo {
|
|
3
3
|
Bar = 0,
|
|
4
4
|
Baz = 1
|
|
@@ -10,5 +10,5 @@ export declare class User extends Entity {
|
|
|
10
10
|
age: Integer | null;
|
|
11
11
|
hasAge: boolean;
|
|
12
12
|
mail: string;
|
|
13
|
-
foo: Foo
|
|
13
|
+
foo: Enum<typeof Foo>;
|
|
14
14
|
}
|
package/function/log.js
CHANGED
package/injector/decorators.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/
|
|
1
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
2
|
import { createClassDecorator, createDecorator } from '../reflection/index.js';
|
|
3
3
|
import { toArray } from '../utils/array/array.js';
|
|
4
4
|
import { isDefined, isFunction } from '../utils/type-guards.js';
|
package/injector/type-info.d.ts
CHANGED
|
@@ -2,21 +2,21 @@ import type { ForwardRefTypeHint } from '../utils/object/forward-ref.js';
|
|
|
2
2
|
import type { InjectionToken } from './token.js';
|
|
3
3
|
import type { ArgumentProvider, ForwardRefInjectionToken, Mapper } from './types.js';
|
|
4
4
|
export type InjectMetadata = {
|
|
5
|
-
/**
|
|
5
|
+
/** Token overwrite by inject decorator */
|
|
6
6
|
injectToken?: InjectionToken;
|
|
7
|
-
/**
|
|
7
|
+
/** If defined, resolve the token or ForwardRefToken using ForwardRef strategy instead of resolving the token directly */
|
|
8
8
|
forwardRef?: boolean | ForwardRefInjectionToken;
|
|
9
9
|
forwardRefTypeHint?: ForwardRefTypeHint;
|
|
10
|
-
/**
|
|
10
|
+
/** Whether injection is optional if token is not registered. Set by optional decorator */
|
|
11
11
|
optional?: boolean;
|
|
12
|
-
/**
|
|
12
|
+
/** Whether injection should resolve all providers */
|
|
13
13
|
resolveAll?: boolean;
|
|
14
|
-
/**
|
|
14
|
+
/** Mapper to map resolved value */
|
|
15
15
|
mapper?: Mapper;
|
|
16
|
-
/**
|
|
16
|
+
/** Provider to get resolve argument */
|
|
17
17
|
resolveArgumentProvider?: ArgumentProvider;
|
|
18
|
-
/**
|
|
18
|
+
/** If defined, map the resolve argument and use the returned value as the value to inject */
|
|
19
19
|
injectArgumentMapper?: Mapper;
|
|
20
|
-
/**
|
|
20
|
+
/** If defined, use the provided argument, map it and pass it to the resolution of the token */
|
|
21
21
|
forwardArgumentMapper?: Mapper;
|
|
22
22
|
};
|
package/orm/index.d.ts
CHANGED
package/orm/index.js
CHANGED
package/orm/types.d.ts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import type { HasDefault as DrizzleHasDefault, IsPrimaryKey as DrizzleIsPrimaryKey } from 'drizzle-orm';
|
|
2
|
-
import type { boolean, doublePrecision, integer, PgColumnBuilder, PgColumnBuilderBase, text, uuid } from 'drizzle-orm/pg-core';
|
|
2
|
+
import type { boolean, doublePrecision, integer, PgColumnBuilder, PgColumnBuilderBase, PgEnumColumnBuilderInitial, text, uuid } from 'drizzle-orm/pg-core';
|
|
3
3
|
import type { GetTagMetadata, Tagged, UnwrapTagged } from 'type-fest';
|
|
4
4
|
import { Array, Integer } from '../schema/index.js';
|
|
5
|
-
import type { ObjectLiteral, Record } from '../types.js';
|
|
5
|
+
import type { EnumerationObject, EnumerationValue, ObjectLiteral, Record, UnionToTuple } from '../types.js';
|
|
6
6
|
import { Uuid } from './schemas/index.js';
|
|
7
7
|
export type IsPrimaryKey<T> = T extends Tagged<unknown, 'column', PgColumnBuilderBase> ? Tagged<UnwrapTagged<T>, 'column', DrizzleIsPrimaryKey<GetTagMetadata<T, 'column'>>> : Tagged<T, 'column', ColumnBuilder<T>>;
|
|
8
8
|
export type HasDefault<T> = T extends Tagged<unknown, 'column', PgColumnBuilderBase> ? Tagged<UnwrapTagged<T>, 'column', DrizzleHasDefault<GetTagMetadata<T, 'column'>>> : Tagged<T, 'column', ColumnBuilder<T>>;
|
|
9
9
|
export type Nested<T extends Record> = Tagged<T, 'column', {
|
|
10
10
|
nested: T;
|
|
11
11
|
}>;
|
|
12
|
-
|
|
12
|
+
type EnumColumn<T extends EnumerationObject, ColumnName extends string = ''> = PgEnumColumnBuilderInitial<ColumnName, UnionToTuple<`${EnumerationValue<T>}`> extends [string, ...string[]] ? UnionToTuple<`${EnumerationValue<T>}`> : ['NO_VALUES_PROVIDED']>;
|
|
13
|
+
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;
|
|
13
14
|
export type TypeBuilder<T, ColumnName extends string = never> = [
|
|
14
15
|
ColumnName
|
|
15
16
|
] extends [never] ? T extends Tagged<any, 'column', PgColumnBuilderBase> ? T : T extends infer U ? Tagged<U, 'column', ColumnBuilder<U>> : never : never;
|
|
16
17
|
export type Array<T extends Tagged<ObjectLiteral, 'column', PgColumnBuilder<any>>> = Tagged<UnwrapTagged<T>[], 'column', ReturnType<GetTagMetadata<T, 'column'>['array']>>;
|
|
18
|
+
export type Enum<T extends EnumerationObject> = Tagged<EnumerationValue<T>, 'column', EnumColumn<T>>;
|
|
17
19
|
export type Text = Tagged<string, 'column', ReturnType<typeof text<string, [string, ...string[]]>>>;
|
|
18
20
|
export type Uuid = Tagged<string, 'column', ReturnType<typeof uuid>>;
|
|
19
21
|
export type Integer = Tagged<number, 'column', ReturnType<typeof integer>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.91.
|
|
3
|
+
"version": "0.91.44",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -115,11 +115,11 @@
|
|
|
115
115
|
"luxon": "^3.5",
|
|
116
116
|
"reflect-metadata": "^0.2",
|
|
117
117
|
"rxjs": "^7.8",
|
|
118
|
-
"type-fest": "4.
|
|
118
|
+
"type-fest": "4.28"
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
121
|
"@mxssfd/typedoc-theme": "1.1",
|
|
122
|
-
"@stylistic/eslint-plugin": "2.
|
|
122
|
+
"@stylistic/eslint-plugin": "2.11",
|
|
123
123
|
"@types/chroma-js": "2.4",
|
|
124
124
|
"@types/koa__router": "12.0",
|
|
125
125
|
"@types/luxon": "3.4",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"@types/node": "22",
|
|
129
129
|
"@types/nodemailer": "6.4",
|
|
130
130
|
"@types/pg": "8.11",
|
|
131
|
-
"@typescript-eslint/eslint-plugin": "
|
|
131
|
+
"@typescript-eslint/eslint-plugin": "8.15",
|
|
132
132
|
"concurrently": "9.1",
|
|
133
133
|
"drizzle-kit": "0.28",
|
|
134
134
|
"eslint": "8.57",
|
|
@@ -136,11 +136,11 @@
|
|
|
136
136
|
"eslint-plugin-import": "2.31",
|
|
137
137
|
"tsc-alias": "1.8",
|
|
138
138
|
"typedoc": "0.26",
|
|
139
|
-
"typedoc-plugin-missing-exports": "3.
|
|
140
|
-
"typescript": "5.
|
|
139
|
+
"typedoc-plugin-missing-exports": "3.1",
|
|
140
|
+
"typescript": "5.6"
|
|
141
141
|
},
|
|
142
142
|
"peerDependencies": {
|
|
143
|
-
"@elastic/elasticsearch": "^8.
|
|
143
|
+
"@elastic/elasticsearch": "^8.16",
|
|
144
144
|
"@koa/router": "^13.1",
|
|
145
145
|
"@tstdl/angular": "^0.91",
|
|
146
146
|
"@zxcvbn-ts/core": "^3.0",
|
|
@@ -153,13 +153,13 @@
|
|
|
153
153
|
"koa": "^2.15",
|
|
154
154
|
"minio": "^8.0",
|
|
155
155
|
"mjml": "^4.15",
|
|
156
|
-
"mongodb": "^6.
|
|
156
|
+
"mongodb": "^6.11",
|
|
157
157
|
"nodemailer": "^6.9",
|
|
158
158
|
"pg": "8.13",
|
|
159
|
-
"playwright": "^1.
|
|
160
|
-
"preact": "^10.
|
|
159
|
+
"playwright": "^1.49",
|
|
160
|
+
"preact": "^10.25",
|
|
161
161
|
"preact-render-to-string": "^6.5",
|
|
162
|
-
"undici": "^6.
|
|
162
|
+
"undici": "^6.21",
|
|
163
163
|
"urlpattern-polyfill": "^10.0"
|
|
164
164
|
},
|
|
165
165
|
"peerDependenciesMeta": {
|
package/pdf/pdf.service.js
CHANGED
|
@@ -40,17 +40,22 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
40
40
|
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
41
41
|
env.hasError = true;
|
|
42
42
|
}
|
|
43
|
+
var r, s = 0;
|
|
43
44
|
function next() {
|
|
44
|
-
while (env.stack.
|
|
45
|
-
var rec = env.stack.pop();
|
|
45
|
+
while (r = env.stack.pop()) {
|
|
46
46
|
try {
|
|
47
|
-
|
|
48
|
-
if (
|
|
47
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
48
|
+
if (r.dispose) {
|
|
49
|
+
var result = r.dispose.call(r.value);
|
|
50
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
51
|
+
}
|
|
52
|
+
else s |= 1;
|
|
49
53
|
}
|
|
50
54
|
catch (e) {
|
|
51
55
|
fail(e);
|
|
52
56
|
}
|
|
53
57
|
}
|
|
58
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
54
59
|
if (env.hasError) throw env.error;
|
|
55
60
|
}
|
|
56
61
|
return next();
|
package/pool/pool.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type ElasticQuery = QueryDslQueryContainer;
|
|
3
|
-
export type ElasticBooleanQuery = Required<Pick<QueryDslQueryContainer, 'bool'>>;
|
|
4
|
-
export type ElasticIdsQuery = Required<Pick<QueryDslQueryContainer, 'ids'>>;
|
|
5
|
-
export type ElasticMatchAllQuery = Required<Pick<QueryDslQueryContainer, 'match_all'>>;
|
|
6
|
-
export type ElasticRangeQuery = Required<Pick<QueryDslQueryContainer, 'range'>>;
|
|
7
|
-
export type ElasticRegexQuery = Required<Pick<QueryDslQueryContainer, 'regexp'>>;
|
|
8
|
-
export type ElasticTermQuery = Required<Pick<QueryDslQueryContainer, 'term'>>;
|
|
9
|
-
export type ElasticTermsQuery = Required<Pick<QueryDslQueryContainer, 'terms'>>;
|
|
10
|
-
export type ElasticMatchQuery = Required<Pick<QueryDslQueryContainer, 'match'>>;
|
|
11
|
-
export type ElasticExistsQuery = Required<Pick<QueryDslQueryContainer, 'exists'>>;
|
|
12
|
-
export type ElasticMultiMatchQuery = Required<Pick<QueryDslQueryContainer, 'multi_match'>>;
|
|
13
|
-
export type ElasticGeoBoundingBoxQuery = Required<Pick<QueryDslQueryContainer, 'geo_bounding_box'>>;
|
|
14
|
-
export type ElasticGeoDistanceQuery = Required<Pick<QueryDslQueryContainer, 'geo_distance'>>;
|
|
15
|
-
export type ElasticGeoPolygonQuery = Required<Pick<QueryDslQueryContainer, 'geo_polygon'>>;
|
|
16
|
-
export type ElasticGeoShapeQuery = Required<Pick<QueryDslQueryContainer, 'geo_shape'>>;
|
|
1
|
+
import type { estypes } from '@elastic/elasticsearch';
|
|
2
|
+
export type ElasticQuery = estypes.QueryDslQueryContainer;
|
|
3
|
+
export type ElasticBooleanQuery = Required<Pick<estypes.QueryDslQueryContainer, 'bool'>>;
|
|
4
|
+
export type ElasticIdsQuery = Required<Pick<estypes.QueryDslQueryContainer, 'ids'>>;
|
|
5
|
+
export type ElasticMatchAllQuery = Required<Pick<estypes.QueryDslQueryContainer, 'match_all'>>;
|
|
6
|
+
export type ElasticRangeQuery = Required<Pick<estypes.QueryDslQueryContainer, 'range'>>;
|
|
7
|
+
export type ElasticRegexQuery = Required<Pick<estypes.QueryDslQueryContainer, 'regexp'>>;
|
|
8
|
+
export type ElasticTermQuery = Required<Pick<estypes.QueryDslQueryContainer, 'term'>>;
|
|
9
|
+
export type ElasticTermsQuery = Required<Pick<estypes.QueryDslQueryContainer, 'terms'>>;
|
|
10
|
+
export type ElasticMatchQuery = Required<Pick<estypes.QueryDslQueryContainer, 'match'>>;
|
|
11
|
+
export type ElasticExistsQuery = Required<Pick<estypes.QueryDslQueryContainer, 'exists'>>;
|
|
12
|
+
export type ElasticMultiMatchQuery = Required<Pick<estypes.QueryDslQueryContainer, 'multi_match'>>;
|
|
13
|
+
export type ElasticGeoBoundingBoxQuery = Required<Pick<estypes.QueryDslQueryContainer, 'geo_bounding_box'>>;
|
|
14
|
+
export type ElasticGeoDistanceQuery = Required<Pick<estypes.QueryDslQueryContainer, 'geo_distance'>>;
|
|
15
|
+
export type ElasticGeoPolygonQuery = Required<Pick<estypes.QueryDslQueryContainer, 'geo_polygon'>>;
|
|
16
|
+
export type ElasticGeoShapeQuery = Required<Pick<estypes.QueryDslQueryContainer, 'geo_shape'>>;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import type { Entity } from '../../../database/index.js';
|
|
2
2
|
import type { DeepFlatten, StringMap, TypedOmit } from '../../../types.js';
|
|
3
|
-
import type {
|
|
4
|
-
export type ElasticIndexMapping<T extends Entity = Entity> = TypedOmit<MappingTypeMapping, 'properties'> & ElasticNestedIndexMapping<TypedOmit<T, 'id'>>;
|
|
3
|
+
import type { estypes } from '@elastic/elasticsearch';
|
|
4
|
+
export type ElasticIndexMapping<T extends Entity = Entity> = TypedOmit<estypes.MappingTypeMapping, 'properties'> & ElasticNestedIndexMapping<TypedOmit<T, 'id'>>;
|
|
5
5
|
export type ElasticNestedIndexMapping<T> = {
|
|
6
6
|
properties: {
|
|
7
7
|
[P in keyof Required<T>]: ElasticIndexMappingItem<DeepFlatten<Required<T>[P]>>;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
type StrippedBaseType<T extends MappingPropertyBase> = TypedOmit<T, 'properties' | 'fields'>;
|
|
10
|
+
type StrippedBaseType<T extends estypes.MappingPropertyBase> = TypedOmit<T, 'properties' | 'fields'>;
|
|
11
11
|
type ElasticIndexMappingItemBase = {
|
|
12
12
|
index?: boolean;
|
|
13
13
|
fields?: StringMap<ElasticIndexMappingItem>;
|
|
14
14
|
};
|
|
15
|
-
export type MappingNumberProperty = MappingByteNumberProperty | MappingDoubleNumberProperty | MappingFloatNumberProperty | MappingHalfFloatNumberProperty | MappingIntegerNumberProperty | MappingLongNumberProperty | MappingShortNumberProperty | MappingScaledFloatNumberProperty | MappingUnsignedLongNumberProperty;
|
|
16
|
-
export type ElasticKeywordIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<MappingKeywordProperty>;
|
|
17
|
-
export type ElasticTextIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<MappingTextProperty>;
|
|
15
|
+
export type MappingNumberProperty = estypes.MappingByteNumberProperty | estypes.MappingDoubleNumberProperty | estypes.MappingFloatNumberProperty | estypes.MappingHalfFloatNumberProperty | estypes.MappingIntegerNumberProperty | estypes.MappingLongNumberProperty | estypes.MappingShortNumberProperty | estypes.MappingScaledFloatNumberProperty | estypes.MappingUnsignedLongNumberProperty;
|
|
16
|
+
export type ElasticKeywordIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<estypes.MappingKeywordProperty>;
|
|
17
|
+
export type ElasticTextIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<estypes.MappingTextProperty>;
|
|
18
18
|
export type ElasticNumberIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<MappingNumberProperty>;
|
|
19
|
-
export type ElasticBooleanIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<MappingBooleanProperty>;
|
|
20
|
-
export type ElasticDateIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<MappingDateProperty>;
|
|
21
|
-
export type ElasticGeoPointIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<MappingGeoPointProperty>;
|
|
22
|
-
export type ElasticObjectIndexMappingItem<T> = ElasticIndexMappingItemBase & StrippedBaseType<MappingObjectProperty> & ElasticNestedIndexMapping<T>;
|
|
23
|
-
export type ElasticNestedIndexMappingItem<T> = ElasticIndexMappingItemBase & StrippedBaseType<MappingNestedProperty> & ElasticNestedIndexMapping<T>;
|
|
19
|
+
export type ElasticBooleanIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<estypes.MappingBooleanProperty>;
|
|
20
|
+
export type ElasticDateIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<estypes.MappingDateProperty>;
|
|
21
|
+
export type ElasticGeoPointIndexMappingItem = ElasticIndexMappingItemBase & StrippedBaseType<estypes.MappingGeoPointProperty>;
|
|
22
|
+
export type ElasticObjectIndexMappingItem<T> = ElasticIndexMappingItemBase & StrippedBaseType<estypes.MappingObjectProperty> & ElasticNestedIndexMapping<T>;
|
|
23
|
+
export type ElasticNestedIndexMappingItem<T> = ElasticIndexMappingItemBase & StrippedBaseType<estypes.MappingNestedProperty> & ElasticNestedIndexMapping<T>;
|
|
24
24
|
export type ElasticIndexMappingItem<T = any> = ElasticKeywordIndexMappingItem | ElasticTextIndexMappingItem | ElasticNumberIndexMappingItem | ElasticBooleanIndexMappingItem | ElasticDateIndexMappingItem | ElasticGeoPointIndexMappingItem | ElasticObjectIndexMappingItem<T> | ElasticNestedIndexMappingItem<T>;
|
|
25
25
|
export declare function mergeElasticSearchMappings<T extends Entity>(mappings: ElasticIndexMapping<T>[]): ElasticIndexMapping<T>;
|
|
26
26
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Entity } from '../../../database/index.js';
|
|
2
|
-
import type {
|
|
3
|
-
export type
|
|
2
|
+
import type { estypes } from '@elastic/elasticsearch';
|
|
3
|
+
export type SortOrder = estypes.SortOrder;
|
|
4
4
|
export type Sort<T extends Entity = Entity> = SortCombinations<T> | SortCombinations<T>[];
|
|
5
5
|
export type SortCombinations<T extends Entity = Entity> = keyof T | SortOptions<T>;
|
|
6
|
-
export type SortOptions<T extends Entity = Entity> = SortOptionsKeys & {
|
|
7
|
-
[P in keyof T]?:
|
|
6
|
+
export type SortOptions<T extends Entity = Entity> = estypes.SortOptionsKeys & {
|
|
7
|
+
[P in keyof T]?: estypes.SortOptions[string];
|
|
8
8
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Entity } from '../../database/index.js';
|
|
2
2
|
import type { LogicalAndQuery, LogicalNorQuery, LogicalOrQuery, Query, TextSpanQueryMode } from '../../database/query.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { estypes } from '@elastic/elasticsearch';
|
|
4
4
|
import type { ElasticQuery } from './model/index.js';
|
|
5
5
|
export declare function convertQuery<T extends Entity>(query: Query<T>): ElasticQuery;
|
|
6
6
|
export declare function convertLogicalAndQuery<T extends Entity>(andQuery: LogicalAndQuery<T>['$and']): ElasticQuery;
|
|
7
7
|
export declare function convertLogicalOrQuery<T extends Entity>(orQuery: LogicalOrQuery<T>['$or']): ElasticQuery;
|
|
8
8
|
export declare function convertLogicalNorQuery<T extends Entity>(norQuery: LogicalNorQuery<T>['$nor']): ElasticQuery;
|
|
9
|
-
export declare function convertTextSpanQueryMode(mode: TextSpanQueryMode | undefined): QueryDslTextQueryType | undefined;
|
|
9
|
+
export declare function convertTextSpanQueryMode(mode: TextSpanQueryMode | undefined): estypes.QueryDslTextQueryType | undefined;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import type { Client } from '@elastic/elasticsearch';
|
|
1
2
|
import type { Entity, Query, QueryOptions } from '../../database/index.js';
|
|
2
3
|
import type { AfterResolve } from '../../injector/interfaces.js';
|
|
3
4
|
import { afterResolve } from '../../injector/interfaces.js';
|
|
4
5
|
import type { Logger } from '../../logger/index.js';
|
|
5
6
|
import type { SearchResult } from '../../search-index/index.js';
|
|
6
7
|
import { SearchIndex } from '../../search-index/index.js';
|
|
7
|
-
import type {
|
|
8
|
-
import type { IndicesIndexSettings } from '@elastic/elasticsearch/lib/api/types.js';
|
|
8
|
+
import type { estypes } from '@elastic/elasticsearch';
|
|
9
9
|
import type { ElasticSearchIndexConfig } from './config.js';
|
|
10
10
|
import { KeywordRewriter } from './keyword-rewriter.js';
|
|
11
11
|
import type { ElasticIndexMapping } from './model/index.js';
|
|
@@ -13,10 +13,10 @@ export declare class ElasticSearchIndex<T extends Entity> extends SearchIndex<T>
|
|
|
13
13
|
private readonly logger;
|
|
14
14
|
readonly client: Client;
|
|
15
15
|
readonly indexName: string;
|
|
16
|
-
readonly indexSettings: IndicesIndexSettings;
|
|
16
|
+
readonly indexSettings: estypes.IndicesIndexSettings;
|
|
17
17
|
readonly indexMapping: ElasticIndexMapping<T>;
|
|
18
18
|
readonly keywordRewriter: KeywordRewriter;
|
|
19
|
-
constructor(client: Client, config: ElasticSearchIndexConfig<T>, indexSettings: IndicesIndexSettings, indexMapping: ElasticIndexMapping<T>, keywordRewrites: Iterable<string>, logger: Logger);
|
|
19
|
+
constructor(client: Client, config: ElasticSearchIndexConfig<T>, indexSettings: estypes.IndicesIndexSettings, indexMapping: ElasticIndexMapping<T>, keywordRewrites: Iterable<string>, logger: Logger);
|
|
20
20
|
[afterResolve](): Promise<void>;
|
|
21
21
|
initialize(): Promise<void>;
|
|
22
22
|
refresh(): Promise<void>;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { estypes } from '@elastic/elasticsearch';
|
|
2
|
+
export type AnalysisAnalyzer = estypes.AnalysisAnalyzer;
|
|
3
|
+
export type AnalysisTokenFilter = estypes.AnalysisTokenFilter;
|
|
4
|
+
export type AnalysisTokenizer = estypes.AnalysisTokenizer;
|
|
5
|
+
export type IndicesIndexSettings = estypes.IndicesIndexSettings;
|
package/serializer/serializer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return,
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-return, max-lines-per-function, max-statements, complexity */
|
|
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';
|
package/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/
|
|
1
|
+
/* eslint-disable @typescript-eslint/consistent-indexed-object-style */
|
|
2
2
|
export {};
|
package/utils/equals.js
CHANGED
package/utils/factory-map.d.ts
CHANGED
|
@@ -19,8 +19,8 @@ export declare class FactoryMap<K, V, I = K> implements Map<K, V> {
|
|
|
19
19
|
set(key: K, value: V): this;
|
|
20
20
|
delete(key: K): boolean;
|
|
21
21
|
forEach(callback: (value: V, key: K, map: FactoryMap<K, V, I>) => void, thisArg?: any): void;
|
|
22
|
-
[Symbol.iterator]():
|
|
23
|
-
entries():
|
|
24
|
-
keys():
|
|
25
|
-
values():
|
|
22
|
+
[Symbol.iterator](): MapIterator<[K, V]>;
|
|
23
|
+
entries(): MapIterator<[K, V]>;
|
|
24
|
+
keys(): MapIterator<K>;
|
|
25
|
+
values(): MapIterator<V>;
|
|
26
26
|
}
|
package/utils/helpers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unsafe-argument
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
2
2
|
import { propertyReflectMethods, reflectMethods } from '../proxy.js';
|
|
3
3
|
import { assert, isDefined, isUndefined } from '../type-guards.js';
|
|
4
4
|
import { lazyObject } from './lazy-property.js';
|
package/utils/type-guards.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
|
|
2
|
-
/* eslint-disable @typescript-eslint/ban-types */
|
|
3
2
|
/* eslint-disable @typescript-eslint/no-invalid-void-type */
|
|
4
3
|
/* eslint-disable @typescript-eslint/no-unnecessary-type-parameters */
|
|
5
4
|
import { supportsBlob, supportsReadableStream } from '../supports.js';
|
package/utils/type-of.js
CHANGED