@tstdl/base 0.90.56 → 0.90.58
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 +136 -116
- package/core.d.ts +3 -0
- package/core.js +4 -0
- package/jsx/render-to-string.d.ts +2 -0
- package/jsx/render-to-string.js +9 -3
- package/package.json +10 -10
- package/queue/mongo/queue.provider.d.ts +2 -4
- package/random/series.d.ts +1 -1
- package/schema/constraints/maximum.d.ts +1 -1
- package/schema/constraints/minimum-date.d.ts +1 -1
- package/schema/constraints/minimum.d.ts +1 -1
- package/schema/constraints/pattern.d.ts +1 -1
- package/schema/types/types.d.ts +2 -2
- package/search-index/elastic/query-builder/boolean-query-builder.d.ts +1 -4
- package/search-index/elastic/query-builder/boolean-query-builder.js +23 -23
- package/templates/renderers/jsx.template-renderer.d.ts +1 -1
- package/templates/renderers/jsx.template-renderer.js +3 -3
- package/theme/theme-service.d.ts +1 -1
- package/theme/theme-service.js +3 -2
- package/types.d.ts +26 -12
- package/utils/async-iterable-helpers/to-async-iterator.js +2 -2
- package/utils/async-iterator-iterable-iterator.js +3 -3
- package/utils/base64.js +1 -1
- package/utils/cryptography.d.ts +13 -13
- package/utils/cryptography.js +12 -12
- package/utils/date-time.js +1 -1
- package/utils/encoding.d.ts +6 -6
- package/utils/encoding.js +6 -6
- package/utils/enum.js +9 -15
- package/utils/equals.js +3 -2
- package/utils/format-error.d.ts +5 -5
- package/utils/format.js +7 -6
- package/utils/helpers.d.ts +9 -9
- package/utils/helpers.js +3 -3
- package/utils/object/decycle.d.ts +2 -2
- package/utils/object/decycle.js +8 -8
- package/utils/object/dereference.d.ts +4 -4
- package/utils/object/dereference.js +3 -3
- package/utils/object/forward-ref.js +2 -2
- package/utils/object/lazy-property.d.ts +9 -9
- package/utils/object/lazy-property.js +4 -3
- package/utils/object/merge.d.ts +1 -1
- package/utils/object/merge.js +3 -3
- package/utils/object/object.d.ts +2 -2
- package/utils/object/object.js +2 -2
- package/utils/object/property-name.d.ts +15 -15
- package/utils/object/property-name.js +12 -12
- package/utils/patch-worker.d.ts +3 -3
- package/utils/patterns.d.ts +2 -2
- package/utils/patterns.js +3 -3
- package/utils/periodic-reporter.d.ts +1 -1
- package/utils/periodic-sampler.d.ts +1 -1
- package/utils/periodic-sampler.js +7 -5
- package/utils/random.d.ts +2 -2
- package/utils/random.js +2 -2
- package/utils/reactive-value-to-signal.d.ts +1 -1
- package/utils/reactive-value-to-signal.js +1 -1
- package/utils/repl.js +1 -0
- package/utils/singleton.d.ts +5 -4
- package/utils/singleton.js +3 -3
- package/utils/stream/finalize-stream.d.ts +5 -5
- package/utils/stream/readable-stream-adapter.d.ts +1 -1
- package/utils/stream/readable-stream-adapter.js +2 -2
- package/utils/stream/readable-stream-from-promise.d.ts +1 -1
- package/utils/stream/slice.js +1 -1
- package/utils/stream/to-bytes-stream.js +4 -4
- package/utils/timing.d.ts +5 -5
- package/utils/timing.js +4 -4
- package/utils/type-guards.js +1 -1
- package/utils/type-of.d.ts +3 -2
- package/utils/type-of.js +1 -1
- package/utils/units.js +3 -2
- package/utils/url-builder.js +3 -3
- package/utils/value-or-provider.js +1 -1
- package/utils/z-base32.js +1 -3
- package/web-types.d.ts +1 -1
package/.eslintrc.json
CHANGED
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"eslint:all",
|
|
10
10
|
"plugin:@typescript-eslint/all",
|
|
11
11
|
"plugin:import/recommended",
|
|
12
|
-
"plugin:import/typescript"
|
|
12
|
+
"plugin:import/typescript",
|
|
13
|
+
"plugin:@stylistic/disable-legacy"
|
|
13
14
|
],
|
|
14
15
|
"settings": {
|
|
15
16
|
"import/resolver": {
|
|
@@ -20,140 +21,141 @@
|
|
|
20
21
|
"parserOptions": {
|
|
21
22
|
"ecmaVersion": "latest",
|
|
22
23
|
"sourceType": "module",
|
|
23
|
-
"project":
|
|
24
|
+
"project": true
|
|
24
25
|
},
|
|
25
|
-
"plugins": ["@
|
|
26
|
+
"plugins": ["@stylistic"],
|
|
26
27
|
"rules": {
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
28
|
+
"camelcase": ["off"],
|
|
29
|
+
"capitalized-comments": ["warn", "always", { "ignorePattern": "noop" }],
|
|
30
|
+
"class-methods-use-this": ["off"],
|
|
31
|
+
"complexity": ["warn"],
|
|
32
|
+
"consistent-type-definitions": ["off"],
|
|
33
|
+
"eqeqeq": ["off"],
|
|
34
|
+
"explicit-function-return-type": ["off"],
|
|
35
|
+
"explicit-member-accessibility": ["off"],
|
|
36
|
+
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
|
|
37
|
+
"id-length": ["off"],
|
|
38
|
+
"init-declarations": ["off"],
|
|
39
|
+
"line-comment-position": ["off"],
|
|
40
|
+
"max-classes-per-file": ["warn"],
|
|
41
|
+
"max-lines-per-function": ["warn", { "max": 100, "skipBlankLines": true, "skipComments": true }],
|
|
42
|
+
"max-lines": ["warn"],
|
|
43
|
+
"max-params": ["off"],
|
|
44
|
+
"max-statements": ["off"],
|
|
45
|
+
"new-cap": ["off"],
|
|
46
|
+
"no-await-in-loop": ["off"],
|
|
47
|
+
"no-bitwise": ["off"],
|
|
48
|
+
"no-case-declarations": ["warn"],
|
|
49
|
+
"no-confusing-void-expression": ["off"],
|
|
50
|
+
"no-constant-condition": ["error", { "checkLoops": false }],
|
|
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
|
+
"no-negated-condition": ["warn"],
|
|
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
|
+
"no-void": ["warn", { "allowAsStatement": true }],
|
|
70
|
+
"one-var": ["error", "never"],
|
|
71
|
+
"prefer-arrow-callback": ["warn"],
|
|
72
|
+
"prefer-destructuring": ["off"],
|
|
73
|
+
"prefer-named-capture-group": ["warn"],
|
|
74
|
+
"restrict-template-expressions": ["off"],
|
|
75
|
+
"sort-imports": ["off", { "ignoreCase": true }],
|
|
76
|
+
"sort-keys": ["off"],
|
|
77
|
+
"sort-type-constituents": ["off"],
|
|
78
|
+
|
|
79
|
+
"@typescript-eslint/ban-types": ["error"],
|
|
80
|
+
"@typescript-eslint/class-methods-use-this": ["warn", { "ignoreOverrideMethods": true, "ignoreClassesThatImplementAnInterface": true }],
|
|
81
|
+
"@typescript-eslint/consistent-type-definitions": ["off"],
|
|
82
|
+
"@typescript-eslint/consistent-type-imports": ["warn", { "prefer": "type-imports", "fixStyle": "inline-type-imports", "disallowTypeAnnotations": false }],
|
|
31
83
|
"@typescript-eslint/explicit-function-return-type": ["error", { "allowExpressions": true, "allowFunctionsWithoutTypeParameters": true }],
|
|
32
84
|
"@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "no-public" }],
|
|
33
|
-
"@typescript-eslint/
|
|
34
|
-
"@typescript-eslint/
|
|
35
|
-
"@typescript-eslint/init-declarations": "off",
|
|
36
|
-
"@typescript-eslint/lines-around-comment": "off",
|
|
37
|
-
"@typescript-eslint/lines-between-class-members": ["warn", "always", { "exceptAfterSingleLine": true }],
|
|
38
|
-
"@typescript-eslint/max-params": "off",
|
|
39
|
-
"@typescript-eslint/method-signature-style": "off",
|
|
85
|
+
"@typescript-eslint/init-declarations": ["off"],
|
|
86
|
+
"@typescript-eslint/max-params": ["warn", { "max": 5 }],
|
|
40
87
|
"@typescript-eslint/no-confusing-void-expression": ["error", { "ignoreArrowShorthand": true, "ignoreVoidOperator": true }],
|
|
41
88
|
"@typescript-eslint/no-empty-interface": ["warn", { "allowSingleExtends": true }],
|
|
42
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
43
|
-
"@typescript-eslint/no-extra-parens": "off",
|
|
44
|
-
"@typescript-eslint/no-extraneous-class": "off",
|
|
89
|
+
"@typescript-eslint/no-explicit-any": ["off"],
|
|
45
90
|
"@typescript-eslint/no-inferrable-types": ["warn", { "ignoreParameters": true, "ignoreProperties": true }],
|
|
46
|
-
"@typescript-eslint/no-invalid-void-type": "
|
|
47
|
-
"@typescript-eslint/no-magic-numbers": ["
|
|
48
|
-
"@typescript-eslint/no-
|
|
49
|
-
"@typescript-eslint/no-restricted-imports": "off",
|
|
50
|
-
"@typescript-eslint/no-type-alias": "off",
|
|
91
|
+
"@typescript-eslint/no-invalid-void-type": ["error", { "allowInGenericTypeArguments": true }],
|
|
92
|
+
"@typescript-eslint/no-magic-numbers": ["error", { "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
|
+
"@typescript-eslint/no-restricted-imports": ["warn"],
|
|
51
94
|
"@typescript-eslint/no-unnecessary-condition": ["error", { "allowConstantLoopConditions": true }],
|
|
52
|
-
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
53
|
-
"@typescript-eslint/no-unused-vars-experimental": "off",
|
|
95
|
+
"@typescript-eslint/no-unsafe-assignment": ["off"],
|
|
54
96
|
"@typescript-eslint/no-unused-vars": ["warn", { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }],
|
|
55
|
-
"@typescript-eslint/no-use-before-define": ["
|
|
56
|
-
"@typescript-eslint/
|
|
57
|
-
"@typescript-eslint/object-curly-spacing": "off",
|
|
58
|
-
"@typescript-eslint/prefer-readonly-parameter-types": ["off", { "checkParameterProperties": false }],
|
|
59
|
-
"@typescript-eslint/quotes": ["warn", "single"],
|
|
97
|
+
"@typescript-eslint/no-use-before-define": ["off"],
|
|
98
|
+
"@typescript-eslint/prefer-destructuring": ["off"],
|
|
60
99
|
"@typescript-eslint/restrict-template-expressions": ["error", { "allowNumber": true, "allowBoolean": true, "allowNullish": true }],
|
|
61
|
-
"@typescript-eslint/sort-type-constituents": "off",
|
|
62
|
-
"@typescript-eslint/
|
|
63
|
-
"@typescript-eslint/space-before-function-paren": ["warn", { "anonymous": "never", "named": "never", "asyncArrow": "always" }],
|
|
64
|
-
"@typescript-eslint/typedef": "off",
|
|
100
|
+
"@typescript-eslint/sort-type-constituents": ["off"],
|
|
101
|
+
"@typescript-eslint/method-signature-style": ["off"],
|
|
65
102
|
|
|
66
|
-
|
|
67
|
-
"
|
|
103
|
+
/* deprecated */
|
|
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
|
+
|
|
108
|
+
"@stylistic/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
|
|
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
|
+
"@stylistic/prefer-readonly-parameter-types": ["off", { "checkParameterProperties": false }],
|
|
118
|
+
"@stylistic/sort-type-union-intersection-members": ["off"],
|
|
119
|
+
"@stylistic/space-before-function-paren": ["warn", { "anonymous": "never", "named": "never", "asyncArrow": "always" }],
|
|
120
|
+
"@stylistic/typedef": ["off"],
|
|
121
|
+
|
|
122
|
+
"import/consistent-type-specifier-style": ["off", "prefer-inline"],
|
|
123
|
+
"import/newline-after-import": ["warn"],
|
|
124
|
+
"import/no-absolute-path": ["error"],
|
|
125
|
+
"import/no-anonymous-default-export": ["error"],
|
|
68
126
|
"import/no-cycle": ["off", { "ignoreExternal": true }],
|
|
69
|
-
"import/no-
|
|
70
|
-
"import/no-extraneous-dependencies": ["off", { "devDependencies": false, "includeTypes": true }],
|
|
127
|
+
"import/no-duplicates": ["warn", { "prefer-inline": true }],
|
|
71
128
|
"import/no-empty-named-blocks": ["error"],
|
|
129
|
+
"import/no-extraneous-dependencies": ["off", { "devDependencies": false, "includeTypes": true }],
|
|
72
130
|
"import/no-mutable-exports": ["error"],
|
|
73
|
-
"import/no-nodejs-modules": ["error"],
|
|
74
|
-
"import/no-absolute-path": ["error"],
|
|
75
|
-
"import/no-useless-path-segments": ["warn"],
|
|
76
|
-
"import/consistent-type-specifier-style": ["off", "prefer-inline"],
|
|
77
|
-
"import/newline-after-import": ["warn", { "considerComments": true }],
|
|
78
|
-
"import/no-anonymous-default-export": ["error"],
|
|
79
131
|
"import/no-named-default": ["error"],
|
|
132
|
+
"import/no-nodejs-modules": ["error"],
|
|
133
|
+
"import/no-self-import": ["error"],
|
|
80
134
|
"import/no-unassigned-import": ["error"],
|
|
135
|
+
"import/no-useless-path-segments": ["warn"],
|
|
81
136
|
|
|
82
137
|
/** misc */
|
|
83
|
-
"
|
|
84
|
-
"array-
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"max-classes-per-file": "off",
|
|
103
|
-
"max-len": ["off", { "code": 150 }],
|
|
104
|
-
"max-lines-per-function": ["off", { "max": 100, "skipBlankLines": true, "skipComments": true }],
|
|
105
|
-
"max-lines": "off",
|
|
106
|
-
"max-params": "off",
|
|
107
|
-
"max-statements": "off",
|
|
108
|
-
"multiline-ternary": "off",
|
|
109
|
-
"new-cap": "off",
|
|
110
|
-
"newline-per-chained-call": "off",
|
|
111
|
-
"no-await-in-loop": "off",
|
|
112
|
-
"no-case-declarations": "off",
|
|
113
|
-
"no-constant-condition": "off",
|
|
114
|
-
"no-continue": "off",
|
|
115
|
-
"no-duplicate-imports": "off",
|
|
116
|
-
"no-inline-comments": "off",
|
|
117
|
-
"no-negated-condition": "off",
|
|
118
|
-
"no-nested-ternary": "off",
|
|
119
|
-
"no-plusplus": ["off", { "allowForLoopAfterthoughts": true }],
|
|
120
|
-
"no-promise-executor-return": "off",
|
|
121
|
-
"no-restricted-imports": "off",
|
|
122
|
-
"no-ternary": "off",
|
|
123
|
-
"no-undefined": "off",
|
|
124
|
-
"no-underscore-dangle": "off",
|
|
125
|
-
"no-void": "off",
|
|
126
|
-
"object-curly-spacing": "off",
|
|
127
|
-
"object-property-newline": ["warn", { "allowAllPropertiesOnSameLine": true }],
|
|
128
|
-
"one-var": ["error", "never"],
|
|
129
|
-
"operator-linebreak": ["warn", "before"],
|
|
130
|
-
"padded-blocks": ["error", "never"],
|
|
131
|
-
"prefer-arrow/prefer-arrow-functions": "off",
|
|
132
|
-
"prefer-destructuring": "off",
|
|
133
|
-
"prefer-named-capture-group": "off",
|
|
134
|
-
"quote-props": ["error", "as-needed"],
|
|
135
|
-
"quotes": ["error", "single"],
|
|
136
|
-
"semi": ["error", "always"],
|
|
137
|
-
"sort-imports": ["off", { "ignoreCase": true }],
|
|
138
|
-
"sort-keys": "off",
|
|
138
|
+
"@stylistic/lines-around-comment": ["warn", { "allowClassStart": true, "allowTypeStart": true }],
|
|
139
|
+
"@stylistic/array-bracket-newline": ["error", "consistent"],
|
|
140
|
+
"@stylistic/array-element-newline": ["error", "consistent"],
|
|
141
|
+
"@stylistic/dot-location": ["error", "property"],
|
|
142
|
+
"@stylistic/function-call-argument-newline": ["warn", "consistent"],
|
|
143
|
+
"@stylistic/function-paren-newline": ["warn", "consistent"],
|
|
144
|
+
"@stylistic/linebreak-style": ["error", "unix"],
|
|
145
|
+
"@stylistic/lines-between-class-members": ["warn", "always", { "exceptAfterSingleLine": true }],
|
|
146
|
+
"@stylistic/object-property-newline": ["warn", { "allowAllPropertiesOnSameLine": true }],
|
|
147
|
+
"@stylistic/operator-linebreak": ["warn", "before"],
|
|
148
|
+
"@stylistic/padded-blocks": ["error", "never"],
|
|
149
|
+
"@stylistic/quote-props": ["error", "consistent-as-needed"],
|
|
150
|
+
"@stylistic/quotes": ["warn", "single"],
|
|
151
|
+
"@stylistic/semi": ["error", "always"],
|
|
152
|
+
"@stylistic/multiline-ternary": ["error", "always-multiline"],
|
|
153
|
+
"@stylistic/generator-star-spacing": ["warn", { "before": false, "after": true }],
|
|
154
|
+
"@stylistic/indent": ["warn", 2],
|
|
155
|
+
"@stylistic/max-len": ["off"],
|
|
156
|
+
"@stylistic/object-curly-spacing": ["warn", "always"],
|
|
139
157
|
|
|
140
|
-
"@
|
|
141
|
-
"warn",
|
|
142
|
-
{
|
|
143
|
-
"selector": "default",
|
|
144
|
-
"format": ["camelCase"],
|
|
145
|
-
"leadingUnderscore": "allowSingleOrDouble"
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
"selector": "enumMember",
|
|
149
|
-
"format": ["PascalCase"]
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"selector": "typeLike",
|
|
153
|
-
"format": ["PascalCase"]
|
|
154
|
-
}
|
|
155
|
-
],
|
|
156
|
-
"@typescript-eslint/member-delimiter-style": ["error", {
|
|
158
|
+
"@stylistic/member-delimiter-style": ["error", {
|
|
157
159
|
"multiline": {
|
|
158
160
|
"delimiter": "comma",
|
|
159
161
|
"requireLast": false
|
|
@@ -171,6 +173,24 @@
|
|
|
171
173
|
}
|
|
172
174
|
}
|
|
173
175
|
}],
|
|
176
|
+
|
|
177
|
+
"@typescript-eslint/naming-convention": [
|
|
178
|
+
"warn",
|
|
179
|
+
{
|
|
180
|
+
"selector": "default",
|
|
181
|
+
"format": ["camelCase"],
|
|
182
|
+
"leadingUnderscore": "allowSingleOrDouble"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"selector": "enumMember",
|
|
186
|
+
"format": ["PascalCase"]
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"selector": "typeLike",
|
|
190
|
+
"format": ["PascalCase"]
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
|
|
174
194
|
"@typescript-eslint/member-ordering": ["warn", {
|
|
175
195
|
"default": [
|
|
176
196
|
// Index signature
|
package/core.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import { Injector } from './injector/injector.js';
|
|
|
3
3
|
import type { InjectionToken } from './injector/token.js';
|
|
4
4
|
import type { LoggerArgument } from './logger/index.js';
|
|
5
5
|
import { LogLevel, Logger } from './logger/index.js';
|
|
6
|
+
declare global {
|
|
7
|
+
var tstdlLoaded: boolean | undefined;
|
|
8
|
+
}
|
|
6
9
|
export declare const CORE_LOGGER: InjectionToken<Logger, never>;
|
|
7
10
|
/**
|
|
8
11
|
* @deprecated Should be avoided. Use `Application` scoped injector instead.
|
package/core.js
CHANGED
|
@@ -6,6 +6,10 @@ import { LOG_LEVEL } from './logger/tokens.js';
|
|
|
6
6
|
import { initializeSignals, setProcessShutdownLogger } from './process-shutdown.js';
|
|
7
7
|
import { timeout } from './utils/timing.js';
|
|
8
8
|
import { assertDefinedPass, isDefined, isUndefined } from './utils/type-guards.js';
|
|
9
|
+
if (globalThis.tstdlLoaded == true) {
|
|
10
|
+
console.error(new Error('tstdl seems to be loaded multiple times. This is likely an error as some modules won\'t work as intended this way.'));
|
|
11
|
+
}
|
|
12
|
+
globalThis.tstdlLoaded = true;
|
|
9
13
|
export const CORE_LOGGER = injectionToken('core logger');
|
|
10
14
|
let globalInjector;
|
|
11
15
|
let _isDevMode = true;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { ComponentClass, FunctionComponent, VNode } from 'preact';
|
|
2
2
|
export declare function renderJsx(template: FunctionComponent<void> | ComponentClass<void, void> | VNode): string;
|
|
3
3
|
export declare function renderJsx<Properties>(template: FunctionComponent<Properties> | ComponentClass<Properties, any>, properties: Properties): string;
|
|
4
|
+
export declare function renderJsxAsync(template: FunctionComponent<void> | ComponentClass<void, void> | VNode): Promise<string>;
|
|
5
|
+
export declare function renderJsxAsync<Properties>(template: FunctionComponent<Properties> | ComponentClass<Properties, any>, properties: Properties): Promise<string>;
|
package/jsx/render-to-string.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "preact/jsx-runtime";
|
|
2
2
|
import { isFunction } from '../utils/type-guards.js';
|
|
3
|
-
import {
|
|
3
|
+
import { renderToString, renderToStringAsync } from 'preact-render-to-string';
|
|
4
4
|
export function renderJsx(Template, properties) {
|
|
5
5
|
if (isFunction(Template)) {
|
|
6
|
-
return
|
|
6
|
+
return renderToString(_jsx(Template, { ...properties }));
|
|
7
7
|
}
|
|
8
|
-
return
|
|
8
|
+
return renderToString(Template);
|
|
9
|
+
}
|
|
10
|
+
export async function renderJsxAsync(Template, properties) {
|
|
11
|
+
if (isFunction(Template)) {
|
|
12
|
+
return renderToStringAsync(_jsx(Template, { ...properties }));
|
|
13
|
+
}
|
|
14
|
+
return renderToStringAsync(Template);
|
|
9
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.90.
|
|
3
|
+
"version": "0.90.58",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"build:production:copy-files": "cp package.json .eslintrc.json tsconfig.server.json dist/ && cp tsconfig.base.json dist/tsconfig.json",
|
|
14
14
|
"build:docs": "typedoc",
|
|
15
15
|
"build:docs:watch": "typedoc --watch",
|
|
16
|
-
"lint": "eslint
|
|
16
|
+
"lint": "eslint --config .eslintrc.json --cache source/",
|
|
17
17
|
"pub": "npm run build:production && rm -vf dist/test* && npm publish dist/",
|
|
18
18
|
"tsc:watch": "tsc --watch",
|
|
19
19
|
"tsc-alias:watch": "tsc-alias --watch"
|
|
@@ -113,6 +113,7 @@
|
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
115
|
"@mxssfd/typedoc-theme": "1.1",
|
|
116
|
+
"@stylistic/eslint-plugin": "1.6",
|
|
116
117
|
"@types/chroma-js": "2.4",
|
|
117
118
|
"@types/koa__router": "12.0",
|
|
118
119
|
"@types/luxon": "3.4",
|
|
@@ -120,20 +121,19 @@
|
|
|
120
121
|
"@types/mjml": "4.7",
|
|
121
122
|
"@types/node": "20",
|
|
122
123
|
"@types/nodemailer": "6.4",
|
|
123
|
-
"@typescript-eslint/eslint-plugin": "6.20",
|
|
124
|
-
"@typescript-eslint/parser": "6.20",
|
|
125
124
|
"concurrently": "8.2",
|
|
126
125
|
"esbuild": "0.20",
|
|
127
|
-
"eslint": "8.
|
|
126
|
+
"eslint": "8.57",
|
|
128
127
|
"eslint-import-resolver-typescript": "3.6",
|
|
129
128
|
"eslint-plugin-import": "2.29",
|
|
130
129
|
"tsc-alias": "1.8",
|
|
131
130
|
"typedoc": "0.25",
|
|
132
131
|
"typedoc-plugin-missing-exports": "2.2",
|
|
133
|
-
"typescript": "5.3"
|
|
132
|
+
"typescript": "5.3",
|
|
133
|
+
"typescript-eslint": "7.1"
|
|
134
134
|
},
|
|
135
135
|
"peerDependencies": {
|
|
136
|
-
"@elastic/elasticsearch": "^8.
|
|
136
|
+
"@elastic/elasticsearch": "^8.12",
|
|
137
137
|
"@koa/router": "^12.0",
|
|
138
138
|
"@tstdl/angular": "^0.90",
|
|
139
139
|
"@zxcvbn-ts/core": "^3.0",
|
|
@@ -147,10 +147,10 @@
|
|
|
147
147
|
"mjml": "^4.15",
|
|
148
148
|
"mongodb": "^6.3",
|
|
149
149
|
"nodemailer": "^6.9",
|
|
150
|
-
"playwright": "^1.
|
|
150
|
+
"playwright": "^1.42",
|
|
151
151
|
"preact": "^10.19",
|
|
152
|
-
"preact-render-to-string": "^6.
|
|
153
|
-
"undici": "^6.
|
|
152
|
+
"preact-render-to-string": "^6.4",
|
|
153
|
+
"undici": "^6.6",
|
|
154
154
|
"urlpattern-polyfill": "^10.0"
|
|
155
155
|
},
|
|
156
156
|
"peerDependenciesMeta": {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { CollectionArgument, MongoRepositoryConfig } from '../../database/mongo/index.js';
|
|
2
|
-
import type
|
|
3
|
-
import { resolveArgumentType } from '../../injector/interfaces.js';
|
|
2
|
+
import { resolveArgumentType, type Resolvable } from '../../injector/interfaces.js';
|
|
4
3
|
import { LockProvider } from '../../lock/index.js';
|
|
5
4
|
import { MessageBusProvider } from '../../message-bus/index.js';
|
|
6
|
-
import type
|
|
7
|
-
import { QueueProvider } from '../../queue/index.js';
|
|
5
|
+
import { QueueProvider, type QueueConfig } from '../../queue/index.js';
|
|
8
6
|
import type { MongoJob } from './job.js';
|
|
9
7
|
import { MongoJobRepository } from './mongo-job.repository.js';
|
|
10
8
|
import { MongoQueue } from './queue.js';
|
package/random/series.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type RandomNumberGeneratorFn } from './number-generator/random-number-generator-function.js';
|
|
2
2
|
export type RandomSeriesOptions = {
|
|
3
3
|
/**
|
|
4
4
|
* Initial value of series. If [number, number] is provided, a random value in that range is generated. If not provided but {@link RandomSeriesOptions.bounds} are, their values are used.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JsonPath } from '../../json-path/json-path.js';
|
|
2
2
|
import type { Decorator } from '../../reflection/index.js';
|
|
3
3
|
import { SchemaValueConstraint } from '../types/schema-value-constraint.js';
|
|
4
|
-
import type
|
|
4
|
+
import { type ConstraintContext, type ConstraintResult } from '../types/types.js';
|
|
5
5
|
export declare class MaximumConstraint extends SchemaValueConstraint {
|
|
6
6
|
private readonly maximum;
|
|
7
7
|
readonly suitableTypes: NumberConstructor;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JsonPath } from '../../json-path/json-path.js';
|
|
2
2
|
import type { Decorator } from '../../reflection/index.js';
|
|
3
3
|
import { SchemaValueConstraint } from '../types/schema-value-constraint.js';
|
|
4
|
-
import type
|
|
4
|
+
import { type ConstraintContext, type ConstraintResult } from '../types/types.js';
|
|
5
5
|
export declare class MinimumDateConstraint extends SchemaValueConstraint {
|
|
6
6
|
private readonly minimum;
|
|
7
7
|
readonly suitableTypes: NumberConstructor;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JsonPath } from '../../json-path/json-path.js';
|
|
2
2
|
import type { Decorator } from '../../reflection/index.js';
|
|
3
3
|
import { SchemaValueConstraint } from '../types/schema-value-constraint.js';
|
|
4
|
-
import type
|
|
4
|
+
import { type ConstraintContext, type ConstraintResult } from '../types/types.js';
|
|
5
5
|
export declare class MinimumConstraint extends SchemaValueConstraint {
|
|
6
6
|
private readonly minimum;
|
|
7
7
|
readonly suitableTypes: NumberConstructor;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JsonPath } from '../../json-path/json-path.js';
|
|
2
2
|
import type { Decorator } from '../../reflection/index.js';
|
|
3
3
|
import { SchemaValueConstraint } from '../types/schema-value-constraint.js';
|
|
4
|
-
import type
|
|
4
|
+
import { type ConstraintContext, type ConstraintResult } from '../types/types.js';
|
|
5
5
|
export declare class PatternConstraint extends SchemaValueConstraint {
|
|
6
6
|
private readonly pattern;
|
|
7
7
|
private readonly patternName;
|
package/schema/types/types.d.ts
CHANGED
|
@@ -53,9 +53,9 @@ export type ValueSchema<T = unknown> = {
|
|
|
53
53
|
array?: boolean;
|
|
54
54
|
optional?: boolean;
|
|
55
55
|
nullable?: boolean;
|
|
56
|
-
/**
|
|
56
|
+
/** Use default coercers */
|
|
57
57
|
coerce?: boolean;
|
|
58
|
-
/**
|
|
58
|
+
/** Custom coercers */
|
|
59
59
|
coercers?: OneOrMany<SchemaValueCoercer>;
|
|
60
60
|
transformers?: OneOrMany<SchemaValueTransformer>;
|
|
61
61
|
arrayConstraints?: OneOrMany<SchemaArrayConstraint>;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { ElasticQuery } from '../model/elastic-query.js';
|
|
2
2
|
export declare class BoolQueryBuilder {
|
|
3
|
-
private
|
|
4
|
-
private readonly _should;
|
|
5
|
-
private readonly _mustNot;
|
|
6
|
-
private readonly _filter;
|
|
3
|
+
#private;
|
|
7
4
|
get totalQueries(): number;
|
|
8
5
|
constructor();
|
|
9
6
|
build(): ElasticQuery;
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
export class BoolQueryBuilder {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
#must;
|
|
3
|
+
#should;
|
|
4
|
+
#mustNot;
|
|
5
|
+
#filter;
|
|
6
6
|
get totalQueries() {
|
|
7
|
-
return this.
|
|
7
|
+
return this.#must.length + this.#should.length + this.#mustNot.length + this.#filter.length;
|
|
8
8
|
}
|
|
9
9
|
constructor() {
|
|
10
|
-
this
|
|
11
|
-
this
|
|
12
|
-
this
|
|
13
|
-
this
|
|
10
|
+
this.#must = [];
|
|
11
|
+
this.#should = [];
|
|
12
|
+
this.#mustNot = [];
|
|
13
|
+
this.#filter = [];
|
|
14
14
|
}
|
|
15
15
|
build() {
|
|
16
16
|
const queryObj = {
|
|
17
17
|
bool: {}
|
|
18
18
|
};
|
|
19
|
-
if (this.
|
|
20
|
-
queryObj.bool.must = this
|
|
19
|
+
if (this.#must.length > 0) {
|
|
20
|
+
queryObj.bool.must = this.#must;
|
|
21
21
|
}
|
|
22
|
-
if (this.
|
|
23
|
-
queryObj.bool.should = this
|
|
22
|
+
if (this.#should.length > 0) {
|
|
23
|
+
queryObj.bool.should = this.#should;
|
|
24
24
|
}
|
|
25
|
-
if (this.
|
|
26
|
-
queryObj.bool.must_not = this
|
|
25
|
+
if (this.#mustNot.length > 0) {
|
|
26
|
+
queryObj.bool.must_not = this.#mustNot;
|
|
27
27
|
}
|
|
28
|
-
if (this.
|
|
29
|
-
queryObj.bool.filter = this
|
|
28
|
+
if (this.#filter.length > 0) {
|
|
29
|
+
queryObj.bool.filter = this.#filter;
|
|
30
30
|
}
|
|
31
|
-
if (this.
|
|
32
|
-
return [...this
|
|
31
|
+
if (this.#mustNot.length == 0 && (this.#must.length + this.#should.length + this.#filter.length) == 1) {
|
|
32
|
+
return [...this.#must, ...this.#should, ...this.#filter][0];
|
|
33
33
|
}
|
|
34
34
|
return queryObj;
|
|
35
35
|
}
|
|
36
36
|
must(...queries) {
|
|
37
|
-
this.
|
|
37
|
+
this.#must.push(...queries);
|
|
38
38
|
return this;
|
|
39
39
|
}
|
|
40
40
|
should(...queries) {
|
|
41
|
-
this.
|
|
41
|
+
this.#should.push(...queries);
|
|
42
42
|
return this;
|
|
43
43
|
}
|
|
44
44
|
mustNot(...queries) {
|
|
45
|
-
this.
|
|
45
|
+
this.#mustNot.push(...queries);
|
|
46
46
|
return this;
|
|
47
47
|
}
|
|
48
48
|
filter(...queries) {
|
|
49
|
-
this.
|
|
49
|
+
this.#filter.push(...queries);
|
|
50
50
|
return this;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -6,5 +6,5 @@ export type JsxTemplateRenderObject = TemplateRenderObject<'jsx', undefined, Jsx
|
|
|
6
6
|
export declare class JsxTemplateRenderer extends TemplateRenderer<'jsx', undefined> {
|
|
7
7
|
constructor();
|
|
8
8
|
canHandleType(type: string): boolean;
|
|
9
|
-
_render({ template }: JsxTemplateRenderObject, context: Record): TemplateRenderResult
|
|
9
|
+
_render({ template }: JsxTemplateRenderObject, context: Record): Promise<TemplateRenderResult>;
|
|
10
10
|
}
|
|
@@ -8,7 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { Singleton } from '../../injector/decorators.js';
|
|
11
|
-
import {
|
|
11
|
+
import { renderJsxAsync } from '../../jsx/render-to-string.js';
|
|
12
12
|
import { TemplateRenderer } from '../template.renderer.js';
|
|
13
13
|
let JsxTemplateRenderer = class JsxTemplateRenderer extends TemplateRenderer {
|
|
14
14
|
constructor() {
|
|
@@ -17,8 +17,8 @@ let JsxTemplateRenderer = class JsxTemplateRenderer extends TemplateRenderer {
|
|
|
17
17
|
canHandleType(type) {
|
|
18
18
|
return (type == 'jsx');
|
|
19
19
|
}
|
|
20
|
-
_render({ template }, context) {
|
|
21
|
-
return
|
|
20
|
+
async _render({ template }, context) {
|
|
21
|
+
return renderJsxAsync(template, context);
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
JsxTemplateRenderer = __decorate([
|
package/theme/theme-service.d.ts
CHANGED
package/theme/theme-service.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -81,8 +82,8 @@ function _generateColorTones(base) {
|
|
|
81
82
|
function toColorTonesWithRgb(tones) {
|
|
82
83
|
return {
|
|
83
84
|
/* eslint-disable @typescript-eslint/naming-convention, quote-props */
|
|
84
|
-
base: tones.base,
|
|
85
|
-
baseRgb: getRgbString(tones.base),
|
|
85
|
+
'base': tones.base,
|
|
86
|
+
'baseRgb': getRgbString(tones.base),
|
|
86
87
|
'50': tones['50'],
|
|
87
88
|
'50Rgb': getRgbString(tones['50']),
|
|
88
89
|
'100': tones['100'],
|