@nestia/core 12.0.0-rc.2 → 12.0.0-rc.3

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 (80) hide show
  1. package/LICENSE +21 -21
  2. package/MIGRATION.md +138 -169
  3. package/lib/decorators/NoTransformConfigurationError.js +5 -5
  4. package/lib/decorators/NoTransformConfigurationError.js.map +1 -1
  5. package/native/cmd/ttsc-nestia/main.go +11 -11
  6. package/native/go.mod +32 -32
  7. package/native/go.sum +54 -54
  8. package/native/plugin/plan.go +102 -102
  9. package/native/transform/ast.go +32 -32
  10. package/native/transform/build.go +388 -380
  11. package/native/transform/cleanup.go +408 -408
  12. package/native/transform/contributor.go +97 -97
  13. package/native/transform/core_querify.go +231 -231
  14. package/native/transform/core_transform.go +1996 -1996
  15. package/native/transform/core_websocket.go +115 -115
  16. package/native/transform/exports.go +13 -13
  17. package/native/transform/mcp_transform.go +414 -414
  18. package/native/transform/node_transform.go +357 -357
  19. package/native/transform/path_rewrite.go +285 -285
  20. package/native/transform/printer.go +244 -244
  21. package/native/transform/rewrite.go +668 -668
  22. package/native/transform/run.go +73 -73
  23. package/native/transform/transform.go +336 -336
  24. package/native/transform/typia_fast.go +375 -352
  25. package/native/transform/typia_replacement.go +24 -24
  26. package/native/transform.cjs +43 -43
  27. package/package.json +9 -9
  28. package/src/adaptors/McpAdaptor.ts +276 -276
  29. package/src/adaptors/WebSocketAdaptor.ts +429 -429
  30. package/src/decorators/DynamicModule.ts +44 -44
  31. package/src/decorators/EncryptedBody.ts +97 -97
  32. package/src/decorators/EncryptedController.ts +40 -40
  33. package/src/decorators/EncryptedModule.ts +98 -98
  34. package/src/decorators/EncryptedRoute.ts +213 -213
  35. package/src/decorators/HumanRoute.ts +21 -21
  36. package/src/decorators/McpRoute.ts +154 -154
  37. package/src/decorators/NoTransformConfigurationError.ts +40 -40
  38. package/src/decorators/PlainBody.ts +76 -76
  39. package/src/decorators/SwaggerCustomizer.ts +97 -97
  40. package/src/decorators/SwaggerExample.ts +180 -180
  41. package/src/decorators/TypedBody.ts +57 -57
  42. package/src/decorators/TypedException.ts +147 -147
  43. package/src/decorators/TypedFormData.ts +187 -187
  44. package/src/decorators/TypedHeaders.ts +66 -66
  45. package/src/decorators/TypedParam.ts +77 -77
  46. package/src/decorators/TypedQuery.ts +234 -234
  47. package/src/decorators/TypedRoute.ts +198 -198
  48. package/src/decorators/WebSocketRoute.ts +242 -242
  49. package/src/decorators/doNotThrowTransformError.ts +5 -5
  50. package/src/decorators/internal/EncryptedConstant.ts +2 -2
  51. package/src/decorators/internal/IMcpRouteReflect.ts +40 -40
  52. package/src/decorators/internal/IWebSocketRouteReflect.ts +23 -23
  53. package/src/decorators/internal/get_path_and_querify.ts +94 -94
  54. package/src/decorators/internal/get_path_and_stringify.ts +110 -110
  55. package/src/decorators/internal/get_text_body.ts +16 -16
  56. package/src/decorators/internal/headers_to_object.ts +11 -11
  57. package/src/decorators/internal/is_request_body_undefined.ts +12 -12
  58. package/src/decorators/internal/load_controller.ts +94 -94
  59. package/src/decorators/internal/route_error.ts +43 -43
  60. package/src/decorators/internal/validate_request_body.ts +64 -64
  61. package/src/decorators/internal/validate_request_form_data.ts +67 -67
  62. package/src/decorators/internal/validate_request_headers.ts +76 -76
  63. package/src/decorators/internal/validate_request_query.ts +83 -83
  64. package/src/index.ts +5 -5
  65. package/src/module.ts +25 -25
  66. package/src/options/IRequestBodyValidator.ts +20 -20
  67. package/src/options/IRequestFormDataProps.ts +27 -27
  68. package/src/options/IRequestHeadersValidator.ts +22 -22
  69. package/src/options/IRequestQueryValidator.ts +20 -20
  70. package/src/options/IResponseBodyQuerifier.ts +25 -25
  71. package/src/options/IResponseBodyStringifier.ts +30 -30
  72. package/src/transform.ts +26 -26
  73. package/src/typings/Creator.ts +3 -3
  74. package/src/typings/get-function-location.d.ts +7 -7
  75. package/src/utils/ArrayUtil.ts +7 -7
  76. package/src/utils/ExceptionManager.ts +115 -115
  77. package/src/utils/Singleton.ts +16 -16
  78. package/src/utils/SourceFinder.ts +54 -54
  79. package/src/utils/VersioningStrategy.ts +27 -27
  80. package/README.md +0 -93
@@ -1,24 +1,24 @@
1
- package transform
2
-
3
- import (
4
- "strings"
5
-
6
- shimast "github.com/microsoft/typescript-go/shim/ast"
7
- typiaadapter "github.com/samchon/typia/packages/typia/native/adapter"
8
- )
9
-
10
- func parenthesizeTypiaReplacement(
11
- site typiaadapter.CallSite,
12
- expr string,
13
- ) string {
14
- text := strings.TrimSpace(expr)
15
- if strings.HasPrefix(text, "{") == false {
16
- return expr
17
- }
18
- node := site.Call.AsNode()
19
- if node == nil || node.Parent == nil ||
20
- node.Parent.Kind != shimast.KindExpressionStatement {
21
- return expr
22
- }
23
- return "(" + expr + ")"
24
- }
1
+ package transform
2
+
3
+ import (
4
+ "strings"
5
+
6
+ shimast "github.com/microsoft/typescript-go/shim/ast"
7
+ typiaadapter "github.com/samchon/typia/packages/typia/native/adapter"
8
+ )
9
+
10
+ func parenthesizeTypiaReplacement(
11
+ site typiaadapter.CallSite,
12
+ expr string,
13
+ ) string {
14
+ text := strings.TrimSpace(expr)
15
+ if strings.HasPrefix(text, "{") == false {
16
+ return expr
17
+ }
18
+ node := site.Call.AsNode()
19
+ if node == nil || node.Parent == nil ||
20
+ node.Parent.Kind != shimast.KindExpressionStatement {
21
+ return expr
22
+ }
23
+ return "(" + expr + ")"
24
+ }
@@ -1,43 +1,43 @@
1
- const fs = require("node:fs");
2
- const path = require("node:path");
3
-
4
- // `@nestia/core` ttsc plugin descriptor.
5
- //
6
- // `source` is the Go command package of the executable transform host
7
- // (`cmd/ttsc-nestia`, package `main`).
8
- //
9
- // `@nestia/sdk` is NOT a standalone ttsc plugin: its Go transform is declared
10
- // here as a `contributor`, discovered by resolving `@nestia/sdk` from the
11
- // project. ttsc statically links a contributor's Go source into this host
12
- // binary. Consequences:
13
- //
14
- // - A project that depends on `@nestia/core` but not `@nestia/sdk` never
15
- // links, compiles, or ships any SDK transform code.
16
- // - When the `@nestia/core` plugin itself is disabled, this descriptor is
17
- // never evaluated, so the SDK contributor is never linked either.
18
- function createTtscPlugin(context) {
19
- const plugin = {
20
- name: "@nestia/core",
21
- source: path.resolve(__dirname, "cmd", "ttsc-nestia"),
22
- composes: ["typia/lib/transform"],
23
- };
24
- const sdk = resolveSdkContributorSource(context);
25
- if (sdk !== null) plugin.contributors = [{ name: "sdk", source: sdk }];
26
- return plugin;
27
- }
28
-
29
- function resolveSdkContributorSource(context) {
30
- const paths = [__dirname];
31
- if (context && typeof context.projectRoot === "string")
32
- paths.push(context.projectRoot);
33
- try {
34
- const manifest = require.resolve("@nestia/sdk/package.json", { paths });
35
- const source = path.resolve(path.dirname(manifest), "native", "sdk");
36
- return fs.existsSync(source) ? source : null;
37
- } catch {
38
- return null;
39
- }
40
- }
41
-
42
- module.exports = createTtscPlugin;
43
- module.exports.createTtscPlugin = createTtscPlugin;
1
+ const fs = require("node:fs");
2
+ const path = require("node:path");
3
+
4
+ // `@nestia/core` ttsc plugin descriptor.
5
+ //
6
+ // `source` is the Go command package of the executable transform host
7
+ // (`cmd/ttsc-nestia`, package `main`).
8
+ //
9
+ // `@nestia/sdk` is NOT a standalone ttsc plugin: its Go transform is declared
10
+ // here as a `contributor`, discovered by resolving `@nestia/sdk` from the
11
+ // project. ttsc statically links a contributor's Go source into this host
12
+ // binary. Consequences:
13
+ //
14
+ // - A project that depends on `@nestia/core` but not `@nestia/sdk` never
15
+ // links, compiles, or ships any SDK transform code.
16
+ // - When the `@nestia/core` plugin itself is disabled, this descriptor is
17
+ // never evaluated, so the SDK contributor is never linked either.
18
+ function createTtscPlugin(context) {
19
+ const plugin = {
20
+ name: "@nestia/core",
21
+ source: path.resolve(__dirname, "cmd", "ttsc-nestia"),
22
+ composes: ["typia/lib/transform"],
23
+ };
24
+ const sdk = resolveSdkContributorSource(context);
25
+ if (sdk !== null) plugin.contributors = [{ name: "sdk", source: sdk }];
26
+ return plugin;
27
+ }
28
+
29
+ function resolveSdkContributorSource(context) {
30
+ const paths = [__dirname];
31
+ if (context && typeof context.projectRoot === "string")
32
+ paths.push(context.projectRoot);
33
+ try {
34
+ const manifest = require.resolve("@nestia/sdk/package.json", { paths });
35
+ const source = path.resolve(path.dirname(manifest), "native", "sdk");
36
+ return fs.existsSync(source) ? source : null;
37
+ } catch {
38
+ return null;
39
+ }
40
+ }
41
+
42
+ module.exports = createTtscPlugin;
43
+ module.exports.createTtscPlugin = createTtscPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/core",
3
- "version": "12.0.0-rc.2",
3
+ "version": "12.0.0-rc.3",
4
4
  "description": "Super-fast validation decorators of NestJS",
5
5
  "types": "lib/index.d.ts",
6
6
  "main": "lib/index.js",
@@ -46,8 +46,8 @@
46
46
  },
47
47
  "homepage": "https://nestia.io",
48
48
  "dependencies": {
49
- "@typia/interface": "^13.0.0-rc.1",
50
- "@typia/utils": "^13.0.0-rc.1",
49
+ "@typia/interface": "^13.0.0",
50
+ "@typia/utils": "^13.0.0",
51
51
  "get-function-location": "^2.0.0",
52
52
  "glob": "^11.0.3",
53
53
  "path-parser": "^6.1.0",
@@ -55,9 +55,9 @@
55
55
  "reflect-metadata": ">=0.1.12",
56
56
  "rxjs": ">=6.0.3",
57
57
  "tgrid": "^1.1.0",
58
- "typia": "^13.0.0-rc.1",
58
+ "typia": "^13.0.0",
59
59
  "ws": "^7.5.3",
60
- "@nestia/fetcher": "^12.0.0-rc.2"
60
+ "@nestia/fetcher": "^12.0.0-rc.3"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@modelcontextprotocol/sdk": "^1.18.0",
@@ -65,8 +65,8 @@
65
65
  "@nestjs/core": ">=7.0.1",
66
66
  "reflect-metadata": ">=0.1.12",
67
67
  "rxjs": ">=6.0.3",
68
- "typia": "^13.0.0-rc.1",
69
- "@nestia/fetcher": "^12.0.0-rc.2"
68
+ "typia": "^13.0.0",
69
+ "@nestia/fetcher": "^12.0.0-rc.3"
70
70
  },
71
71
  "peerDependenciesMeta": {
72
72
  "@modelcontextprotocol/sdk": {
@@ -83,9 +83,9 @@
83
83
  "@types/ws": "^8.5.10",
84
84
  "fastify": "^4.28.1",
85
85
  "rimraf": "^6.1.3",
86
- "ttsc": "^0.16.10",
86
+ "ttsc": "^0.18.0",
87
87
  "tstl": "^3.0.0",
88
- "typescript": "7.0.1-rc"
88
+ "typescript": "^7.0.2"
89
89
  },
90
90
  "files": [
91
91
  "README.md",