@tstdl/base 0.90.57 → 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.
Files changed (74) hide show
  1. package/.eslintrc.json +136 -116
  2. package/jsx/render-to-string.d.ts +2 -0
  3. package/jsx/render-to-string.js +9 -3
  4. package/package.json +8 -8
  5. package/queue/mongo/queue.provider.d.ts +2 -4
  6. package/random/series.d.ts +1 -1
  7. package/schema/constraints/maximum.d.ts +1 -1
  8. package/schema/constraints/minimum-date.d.ts +1 -1
  9. package/schema/constraints/minimum.d.ts +1 -1
  10. package/schema/constraints/pattern.d.ts +1 -1
  11. package/schema/types/types.d.ts +2 -2
  12. package/search-index/elastic/query-builder/boolean-query-builder.d.ts +1 -4
  13. package/search-index/elastic/query-builder/boolean-query-builder.js +23 -23
  14. package/templates/renderers/jsx.template-renderer.d.ts +1 -1
  15. package/templates/renderers/jsx.template-renderer.js +3 -3
  16. package/theme/theme-service.d.ts +1 -1
  17. package/theme/theme-service.js +3 -2
  18. package/types.d.ts +26 -12
  19. package/utils/async-iterable-helpers/to-async-iterator.js +2 -2
  20. package/utils/async-iterator-iterable-iterator.js +3 -3
  21. package/utils/base64.js +1 -1
  22. package/utils/cryptography.d.ts +13 -13
  23. package/utils/cryptography.js +12 -12
  24. package/utils/date-time.js +1 -1
  25. package/utils/encoding.d.ts +6 -6
  26. package/utils/encoding.js +6 -6
  27. package/utils/enum.js +9 -15
  28. package/utils/equals.js +3 -2
  29. package/utils/format-error.d.ts +5 -5
  30. package/utils/format.js +7 -6
  31. package/utils/helpers.d.ts +9 -9
  32. package/utils/helpers.js +3 -3
  33. package/utils/object/decycle.d.ts +2 -2
  34. package/utils/object/decycle.js +8 -8
  35. package/utils/object/dereference.d.ts +4 -4
  36. package/utils/object/dereference.js +3 -3
  37. package/utils/object/forward-ref.js +2 -2
  38. package/utils/object/lazy-property.d.ts +9 -9
  39. package/utils/object/lazy-property.js +4 -3
  40. package/utils/object/merge.d.ts +1 -1
  41. package/utils/object/merge.js +3 -3
  42. package/utils/object/object.d.ts +2 -2
  43. package/utils/object/object.js +2 -2
  44. package/utils/object/property-name.d.ts +15 -15
  45. package/utils/object/property-name.js +12 -12
  46. package/utils/patch-worker.d.ts +3 -3
  47. package/utils/patterns.d.ts +2 -2
  48. package/utils/patterns.js +3 -3
  49. package/utils/periodic-reporter.d.ts +1 -1
  50. package/utils/periodic-sampler.d.ts +1 -1
  51. package/utils/periodic-sampler.js +7 -5
  52. package/utils/random.d.ts +2 -2
  53. package/utils/random.js +2 -2
  54. package/utils/reactive-value-to-signal.d.ts +1 -1
  55. package/utils/reactive-value-to-signal.js +1 -1
  56. package/utils/repl.js +1 -0
  57. package/utils/singleton.d.ts +5 -4
  58. package/utils/singleton.js +3 -3
  59. package/utils/stream/finalize-stream.d.ts +5 -5
  60. package/utils/stream/readable-stream-adapter.d.ts +1 -1
  61. package/utils/stream/readable-stream-adapter.js +2 -2
  62. package/utils/stream/readable-stream-from-promise.d.ts +1 -1
  63. package/utils/stream/slice.js +1 -1
  64. package/utils/stream/to-bytes-stream.js +4 -4
  65. package/utils/timing.d.ts +5 -5
  66. package/utils/timing.js +4 -4
  67. package/utils/type-guards.js +1 -1
  68. package/utils/type-of.d.ts +3 -2
  69. package/utils/type-of.js +1 -1
  70. package/utils/units.js +3 -2
  71. package/utils/url-builder.js +3 -3
  72. package/utils/value-or-provider.js +1 -1
  73. package/utils/z-base32.js +1 -3
  74. 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": "tsconfig.json"
24
+ "project": true
24
25
  },
25
- "plugins": ["@typescript-eslint"],
26
+ "plugins": ["@stylistic"],
26
27
  "rules": {
27
- /** typescript */
28
- "@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
29
- "@typescript-eslint/class-methods-use-this": ["error", { "ignoreOverrideMethods": true, "ignoreClassesThatImplementAnInterface": true }],
30
- "@typescript-eslint/consistent-type-definitions": "off",
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/explicit-module-boundary-types": "off",
34
- "@typescript-eslint/indent": "off",
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": "off",
47
- "@typescript-eslint/no-magic-numbers": ["off", { "ignoreNumericLiteralTypes": true, "ignoreEnums": true, "ignore": [0, 1, 128, 256, 512, 1024, 2048, 4096], "ignoreArrayIndexes": true }],
48
- "@typescript-eslint/no-non-null-assertion": "off",
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": ["error", { "functions": false }],
56
- "@typescript-eslint/no-useless-constructor": "off",
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/sort-type-union-intersection-members": "off",
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
- /** import */
67
- "import/no-duplicates": ["warn", { "prefer-inline": true }],
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-self-import": ["error"],
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
- "array-bracket-newline": ["error", "consistent"],
84
- "array-element-newline": ["error", "consistent"],
85
- "camelcase": "off",
86
- "capitalized-comments": "off",
87
- "class-methods-use-this": "off",
88
- "complexity": "off",
89
- "dot-location": ["error", "property"],
90
- "eqeqeq": "off",
91
- "func-style": ["error", "declaration", { "allowArrowFunctions": true }],
92
- "function-call-argument-newline": ["warn", "consistent"],
93
- "function-paren-newline": ["warn", "consistent"],
94
- "generator-star-spacing": ["off", { "before": false, "after": true }],
95
- "id-length": "off",
96
- "indent": "off",
97
- "init-declarations": "off",
98
- "line-comment-position": "off",
99
- "linebreak-style": ["error", "unix"],
100
- "lines-around-comment": "off",
101
- "lines-between-class-members": "off",
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
- "@typescript-eslint/naming-convention": [
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
@@ -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>;
@@ -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 { render } from 'preact-render-to-string';
3
+ import { renderToString, renderToStringAsync } from 'preact-render-to-string';
4
4
  export function renderJsx(Template, properties) {
5
5
  if (isFunction(Template)) {
6
- return render(_jsx(Template, { ...properties }));
6
+ return renderToString(_jsx(Template, { ...properties }));
7
7
  }
8
- return render(Template);
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.57",
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 -c .eslintrc.json --ext .ts .",
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,17 +121,16 @@
120
121
  "@types/mjml": "4.7",
121
122
  "@types/node": "20",
122
123
  "@types/nodemailer": "6.4",
123
- "@typescript-eslint/eslint-plugin": "6.21",
124
- "@typescript-eslint/parser": "6.21",
125
124
  "concurrently": "8.2",
126
125
  "esbuild": "0.20",
127
- "eslint": "8.56",
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
136
  "@elastic/elasticsearch": "^8.12",
@@ -147,9 +147,9 @@
147
147
  "mjml": "^4.15",
148
148
  "mongodb": "^6.3",
149
149
  "nodemailer": "^6.9",
150
- "playwright": "^1.41",
150
+ "playwright": "^1.42",
151
151
  "preact": "^10.19",
152
- "preact-render-to-string": "^6.3",
152
+ "preact-render-to-string": "^6.4",
153
153
  "undici": "^6.6",
154
154
  "urlpattern-polyfill": "^10.0"
155
155
  },
@@ -1,10 +1,8 @@
1
1
  import type { CollectionArgument, MongoRepositoryConfig } from '../../database/mongo/index.js';
2
- import type { Resolvable } from '../../injector/interfaces.js';
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 { QueueConfig } from '../../queue/index.js';
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';
@@ -1,4 +1,4 @@
1
- import type { RandomNumberGeneratorFn } from './number-generator/random-number-generator-function.js';
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 { ConstraintContext, ConstraintResult } from '../types/types.js';
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 { ConstraintContext, ConstraintResult } from '../types/types.js';
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 { ConstraintContext, ConstraintResult } from '../types/types.js';
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 { ConstraintContext, ConstraintResult } from '../types/types.js';
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;
@@ -53,9 +53,9 @@ export type ValueSchema<T = unknown> = {
53
53
  array?: boolean;
54
54
  optional?: boolean;
55
55
  nullable?: boolean;
56
- /** use default coercers */
56
+ /** Use default coercers */
57
57
  coerce?: boolean;
58
- /** custom coercers */
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 readonly _must;
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
- _must;
3
- _should;
4
- _mustNot;
5
- _filter;
2
+ #must;
3
+ #should;
4
+ #mustNot;
5
+ #filter;
6
6
  get totalQueries() {
7
- return this._must.length + this._should.length + this._mustNot.length + this._filter.length;
7
+ return this.#must.length + this.#should.length + this.#mustNot.length + this.#filter.length;
8
8
  }
9
9
  constructor() {
10
- this._must = [];
11
- this._should = [];
12
- this._mustNot = [];
13
- this._filter = [];
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._must.length > 0) {
20
- queryObj.bool.must = this._must;
19
+ if (this.#must.length > 0) {
20
+ queryObj.bool.must = this.#must;
21
21
  }
22
- if (this._should.length > 0) {
23
- queryObj.bool.should = this._should;
22
+ if (this.#should.length > 0) {
23
+ queryObj.bool.should = this.#should;
24
24
  }
25
- if (this._mustNot.length > 0) {
26
- queryObj.bool.must_not = this._mustNot;
25
+ if (this.#mustNot.length > 0) {
26
+ queryObj.bool.must_not = this.#mustNot;
27
27
  }
28
- if (this._filter.length > 0) {
29
- queryObj.bool.filter = this._filter;
28
+ if (this.#filter.length > 0) {
29
+ queryObj.bool.filter = this.#filter;
30
30
  }
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];
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._must.push(...queries);
37
+ this.#must.push(...queries);
38
38
  return this;
39
39
  }
40
40
  should(...queries) {
41
- this._should.push(...queries);
41
+ this.#should.push(...queries);
42
42
  return this;
43
43
  }
44
44
  mustNot(...queries) {
45
- this._mustNot.push(...queries);
45
+ this.#mustNot.push(...queries);
46
46
  return this;
47
47
  }
48
48
  filter(...queries) {
49
- this._filter.push(...queries);
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 { renderJsx } from '../../jsx/render-to-string.js';
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 renderJsx(template, context);
20
+ async _render({ template }, context) {
21
+ return renderJsxAsync(template, context);
22
22
  }
23
23
  };
24
24
  JsxTemplateRenderer = __decorate([
@@ -1,4 +1,4 @@
1
- import type { Observable } from 'rxjs';
1
+ import { type Observable } from 'rxjs';
2
2
  export type CalculatedPalette<Colors extends string = string> = {
3
3
  [Color in Colors]: ColorTonesWithRgb;
4
4
  };
@@ -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'],