koatty 4.2.0 → 4.3.0

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.
@@ -1,100 +1,99 @@
1
-
2
- 
3
- > koatty@4.2.0 build /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty
4
- > pnpm run build:js && pnpm run build:dts && pnpm run build:doc && pnpm run build:cp
5
-
6
-
7
- > koatty@4.2.0 build:js /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty
8
- > tsup
9
-
10
- CLI Building entry: src/index.ts
11
- CLI Using tsconfig: tsconfig.json
12
- CLI tsup v8.5.1
13
- CLI Using tsup config: /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty/tsup.config.ts
14
- CLI Target: node18
15
- CLI Cleaning output folder
16
- CJS Build start
17
- ESM Build start
18
- ESM dist/index.mjs 27.66 KB
19
- ESM dist/index.mjs.map 65.74 KB
20
- ESM ⚡️ Build success in 84ms
21
- CJS dist/index.js 31.62 KB
22
- CJS dist/index.js.map 65.89 KB
23
- CJS ⚡️ Build success in 85ms
24
-
25
- > koatty@4.2.0 build:dts /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty
26
- > bash scripts/build-dts.sh
27
-
28
- 🔨 Building type declarations for koatty...
29
- ⏳ Waiting for dependencies to be ready...
30
-
31
- 🔍 Checking dependencies: koatty_config, koatty_container, koatty_core, koatty_exception, koatty_lib, koatty_loader, koatty_logger, koatty_router, koatty_serve, koatty_trace, koatty_validation
32
- ✓ koatty_config type declarations ready
33
- ✓ koatty_container type declarations ready
34
- ✓ koatty_core type declarations ready
35
- ✓ koatty_exception type declarations ready
36
- ✓ koatty_lib type declarations ready
37
- ✓ koatty_loader type declarations ready
38
- ✓ koatty_logger type declarations ready
39
- ✓ koatty_router type declarations ready
40
- ✓ koatty_serve type declarations ready
41
- ✓ koatty_trace type declarations ready
42
- ✓ koatty_validation type declarations ready
43
-
44
- ✅ All dependencies ready (waited 1ms)
45
- 📝 Running TypeScript compiler...
46
- ⠙📦 Running API Extractor...
47
- 
48
- api-extractor 7.55.2  - https://api-extractor.com/
49
- 
50
- Using configuration from ./api-extractor.json
51
- Analysis will use the bundled TypeScript version 5.8.2
52
- *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
53
- Writing: /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty/temp/koatty.api.json
54
- Writing package typings: /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty/dist/index.d.ts
55
- Warning: /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty-core/dist/index.d.ts:899:4 - (tsdoc-undefined-tag) The TSDoc tag "@interface" is not defined in this configuration
56
- Warning: /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty-core/dist/index.d.ts:900:4 - (tsdoc-undefined-tag) The TSDoc tag "@extends" is not defined in this configuration
57
- Warning: src/core/Bootstrap.ts:21:4 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
58
- Warning: src/core/Bootstrap.ts:30:1 - (ae-missing-release-tag) "ExecBootStrap" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
59
- Warning: src/core/Bootstrap.ts:140:64 - (tsdoc-characters-after-block-tag) The token "@Bootstrap" looks like a TSDoc tag but contains an invalid character "("; if it is not a tag, use a backslash to escape the "@"
60
- Warning: src/core/Bootstrap.ts:165:1 - (ae-missing-release-tag) "createApplication" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
61
- Warning: src/core/Decorator.ts:17:4 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
62
- Warning: src/core/Decorator.ts:29:1 - (ae-missing-release-tag) "Bootstrap" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
63
- Warning: src/core/Decorator.ts:43:31 - (tsdoc-param-tag-with-invalid-optional-name) The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets.
64
- Warning: src/core/Decorator.ts:43:11 - (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'
65
- Warning: src/core/Decorator.ts:44:28 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
66
- Warning: src/core/Decorator.ts:44:13 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@"
67
- Warning: src/core/Decorator.ts:45:18 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
68
- Warning: src/core/Decorator.ts:45:12 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@"
69
- Warning: src/core/Decorator.ts:54:1 - (ae-missing-release-tag) "ComponentScan" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
70
- Warning: src/core/Decorator.ts:79:1 - (ae-missing-release-tag) "ConfigurationScan" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
71
-
72
- API Extractor completed successfully
73
- ⠙✅ Type declarations built successfully
74
-
75
- > koatty@4.2.0 build:doc /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty
76
- > api-documenter markdown --input temp --output docs/api
77
-
78
-
79
- api-documenter 7.28.2  - https://api-extractor.com/
80
- 
81
- Reading koatty.api.json
82
-
83
- Deleting old output from docs/api
84
- Writing koatty package
85
-
86
- > koatty@4.2.0 build:cp /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty
87
- > node scripts/copyFiles && node ../../scripts/postBuild.js
88
-
89
- Copied package.json to dist/
90
- Copied LICENSE to dist/
91
- Copied README.md to dist/
92
- File copy completed
93
- 📦 postBuild: koatty
94
- ✓ Copied package.json to dist/
95
- ✓ Copied LICENSE to dist/
96
- ✓ Copied README.md to dist/
97
- ✓ Fixed paths in dist/package.json
98
- ✓ Cleaned DTS declarations
99
- ✅ Done
100
-
1
+
2
+ > koatty@4.3.0 build /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty
3
+ > pnpm run build:js && pnpm run build:dts && pnpm run build:doc && pnpm run build:cp
4
+
5
+
6
+ > koatty@4.3.0 build:js /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty
7
+ > tsup
8
+
9
+ CLI Building entry: src/index.ts
10
+ CLI Using tsconfig: tsconfig.json
11
+ CLI tsup v8.5.1
12
+ CLI Using tsup config: /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty/tsup.config.ts
13
+ CLI Target: node18
14
+ CLI Cleaning output folder
15
+ CJS Build start
16
+ ESM Build start
17
+ CJS dist/index.js 31.81 KB
18
+ CJS dist/index.js.map 66.93 KB
19
+ CJS ⚡️ Build success in 86ms
20
+ ESM dist/index.mjs 27.83 KB
21
+ ESM dist/index.mjs.map 66.78 KB
22
+ ESM ⚡️ Build success in 86ms
23
+
24
+ > koatty@4.3.0 build:dts /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty
25
+ > bash scripts/build-dts.sh
26
+
27
+ 🔨 Building type declarations for koatty...
28
+ ⏳ Waiting for dependencies to be ready...
29
+
30
+ 🔍 Checking dependencies: koatty_config, koatty_container, koatty_core, koatty_exception, koatty_lib, koatty_loader, koatty_logger, koatty_router, koatty_serve, koatty_trace, koatty_validation
31
+ ✓ koatty_config type declarations ready
32
+ ✓ koatty_container type declarations ready
33
+ ✓ koatty_core type declarations ready
34
+ ✓ koatty_exception type declarations ready
35
+ ✓ koatty_lib type declarations ready
36
+ ✓ koatty_loader type declarations ready
37
+ ✓ koatty_logger type declarations ready
38
+ ✓ koatty_router type declarations ready
39
+ ✓ koatty_serve type declarations ready
40
+ ✓ koatty_trace type declarations ready
41
+ ✓ koatty_validation type declarations ready
42
+
43
+ ✅ All dependencies ready (waited 0ms)
44
+ 📝 Running TypeScript compiler...
45
+ 📦 Running API Extractor...
46
+
47
+ api-extractor 7.55.2  - https://api-extractor.com/
48
+ 
49
+ Using configuration from ./api-extractor.json
50
+ Analysis will use the bundled TypeScript version 5.8.2
51
+ *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
52
+ Writing: /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty/temp/koatty.api.json
53
+ Writing package typings: /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty/dist/index.d.ts
54
+ Warning: /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty-core/dist/index.d.ts:917:4 - (tsdoc-undefined-tag) The TSDoc tag "@interface" is not defined in this configuration
55
+ Warning: /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty-core/dist/index.d.ts:918:4 - (tsdoc-undefined-tag) The TSDoc tag "@extends" is not defined in this configuration
56
+ Warning: src/core/Bootstrap.ts:21:4 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
57
+ Warning: src/core/Bootstrap.ts:30:1 - (ae-missing-release-tag) "ExecBootStrap" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
58
+ Warning: src/core/Bootstrap.ts:148:64 - (tsdoc-characters-after-block-tag) The token "@Bootstrap" looks like a TSDoc tag but contains an invalid character "("; if it is not a tag, use a backslash to escape the "@"
59
+ Warning: src/core/Bootstrap.ts:173:1 - (ae-missing-release-tag) "createApplication" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
60
+ Warning: src/core/Decorator.ts:18:4 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
61
+ Warning: src/core/Decorator.ts:30:1 - (ae-missing-release-tag) "Bootstrap" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
62
+ Warning: src/core/Decorator.ts:50:31 - (tsdoc-param-tag-with-invalid-optional-name) The @param should not include a JSDoc-style optional name; it must not be enclosed in '[ ]' brackets.
63
+ Warning: src/core/Decorator.ts:50:11 - (tsdoc-param-tag-with-invalid-type) The @param block should not include a JSDoc-style '{type}'
64
+ Warning: src/core/Decorator.ts:51:28 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
65
+ Warning: src/core/Decorator.ts:51:13 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@"
66
+ Warning: src/core/Decorator.ts:52:18 - (tsdoc-escape-right-brace) The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
67
+ Warning: src/core/Decorator.ts:52:12 - (tsdoc-malformed-inline-tag) Expecting a TSDoc tag starting with "{@"
68
+ Warning: src/core/Decorator.ts:61:1 - (ae-missing-release-tag) "ComponentScan" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
69
+ Warning: src/core/Decorator.ts:86:1 - (ae-missing-release-tag) "ConfigurationScan" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
70
+
71
+ API Extractor completed successfully
72
+ ✅ Type declarations built successfully
73
+
74
+ > koatty@4.3.0 build:doc /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty
75
+ > api-documenter markdown --input temp --output docs/api
76
+
77
+
78
+ api-documenter 7.28.2  - https://api-extractor.com/
79
+ 
80
+ Reading koatty.api.json
81
+
82
+ Deleting old output from docs/api
83
+ Writing koatty package
84
+
85
+ > koatty@4.3.0 build:cp /Volumes/ExternalSSD/Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty
86
+ > node scripts/copyFiles && node ../../scripts/postBuild.js
87
+
88
+ Copied package.json to dist/
89
+ Copied LICENSE to dist/
90
+ Copied README.md to dist/
91
+ File copy completed
92
+ 📦 postBuild: koatty
93
+ ✓ Copied package.json to dist/
94
+ ✓ Copied LICENSE to dist/
95
+ ✓ Copied README.md to dist/
96
+ ✓ Fixed paths in dist/package.json
97
+ ✓ Cleaned DTS declarations
98
+ ✅ Done
99
+
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # koatty
2
2
 
3
+ ## 4.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Phase B security hardening (koatty-hardening-and-ai-evolution-plan.md, ADR-101/102/103). Fail-closed defaults with a `security.legacyDefaults: true` rollback switch; see docs/migration/4.3.0.md for the full migration guide.
8
+
9
+ Highlights:
10
+
11
+ - SecurityProfile (strict/standard/development) exposed read-only as `app.security`, with a startup summary and per-item WARN when rolling back
12
+ - body parsing failures return 400/413/415 instead of silently producing `{}`; body size limit follows the security profile (1mb in production)
13
+ - DTO validation whitelist on by default (strict profile rejects unknown fields); `__proto__`/`constructor` keys never reach DTO instances
14
+ - AOP aspect failures abort the business method unless opted out via `{ onError: 'log' }` or `app.security.aop.onAspectError`
15
+ - After/AfterEach aspects receive the business result via `options.result`
16
+ - GraphQL: profile-driven playground/introspection/depth limits, built-in depth rule, optional complexity package fails startup when configured but missing, CDN-free GraphiQL
17
+ - uploads: profile-driven maxFiles/maxFields/maxFieldsSize, keepExtensions defaults off, array-aware temp cleanup, new `safeFilename` export
18
+ - ops endpoints: minimal liveness body, /ready 503 while draining, /metrics behind the exposeMetrics policy (loopback/RFC1918/allowCidrs/token), Prometheus bound to 127.0.0.1, rateLimit middleware wired (default off)
19
+ - request IDs validated (`[A-Za-z0-9._:-]{1,128}`), query fallback disabled, structured access logs, topology service header opt-in
20
+ - WebSocket: profile maxPayload, perMessageDeflate off, Origin check, connection limits, error-message redaction, slow-consumer guard, timer cleanup on destroy
21
+ - TLS minVersion TLSv1.2 by default; TypeORM production logs errors only with sensitive-parameter redaction; Swagger disabled in production by default
22
+ - defect fixes: escapeHtml (&-escaping, valid entities), ReDoS-safe isNumberString, plugin run() executes once, bootstrap failures propagate, Redis default port 6379, gRPC ListServices, koatty_cli bin (CJS build), RedLocker.resetInstance, config() write loss, CLI sandbox + `apply` dry-run by default
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+ - koatty_core@2.3.0
28
+ - koatty_router@2.3.0
29
+ - koatty_serve@3.3.0
30
+ - koatty_trace@2.3.0
31
+ - koatty_config@1.4.0
32
+ - koatty_container@3.0.0
33
+ - koatty_lib@1.6.0
34
+ - koatty_exception@2.2.1
35
+ - koatty_loader@2.0.0
36
+ - koatty_logger@3.0.0
37
+
3
38
  ## 4.2.0
4
39
 
5
40
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2026-04-24 16:20:43
3
+ * @Date: 2026-09-27 22:09:07
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ var path__namespace = /*#__PURE__*/_interopNamespace(path);
34
34
 
35
35
  /*!
36
36
  * @Author: richen
37
- * @Date: 2026-04-24 08:20:40
37
+ * @Date: 2026-09-27 14:09:05
38
38
  * @License: BSD (3-Clause)
39
39
  * @Copyright (c) - <richenlin(at)gmail.com>
40
40
  * @HomePage: https://koatty.org/
@@ -51,7 +51,7 @@ var require_package = __commonJS({
51
51
  "package.json"(exports$1, module) {
52
52
  module.exports = {
53
53
  name: "koatty",
54
- version: "4.2.0",
54
+ version: "4.3.0",
55
55
  description: "Koa + Typescript = koatty. Use Typescript's decorator implement auto injection.",
56
56
  scripts: {
57
57
  build: "pnpm run build:js && pnpm run build:dts && pnpm run build:doc && pnpm run build:cp",
@@ -764,7 +764,11 @@ var executeBootstrap = /* @__PURE__ */ __name(async function(target, bootFunc, i
764
764
  }
765
765
  return app;
766
766
  } catch (err) {
767
+ if (checkUTRuntime() || isInitiative) {
768
+ throw err;
769
+ }
767
770
  koatty_logger.DefaultLogger.Fatal(err);
771
+ process.exitCode = 1;
768
772
  }
769
773
  }, "executeBootstrap");
770
774
  async function createApplication(target, bootFunc) {
@@ -793,7 +797,10 @@ function Bootstrap(bootFunc) {
793
797
  throw new Error(`class does not inherit from Koatty`);
794
798
  }
795
799
  koatty_container.IOC.saveClass("COMPONENT", target, "KOATTY_APP");
796
- ExecBootStrap(bootFunc)(target);
800
+ ExecBootStrap(bootFunc)(target).catch((err) => {
801
+ koatty_logger.DefaultLogger.Fatal(err);
802
+ process.exitCode = 1;
803
+ });
797
804
  }, "class");
798
805
  }
799
806
  __name(Bootstrap, "Bootstrap");