@nestia/sdk 11.2.1 → 12.0.0-dev.20260521.1

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 (277) hide show
  1. package/assets/bundle/distribute/package.json +1 -1
  2. package/lib/NestiaSdkApplication.js +5 -4
  3. package/lib/NestiaSdkApplication.js.map +1 -1
  4. package/lib/NestiaSwaggerComposer.js +2 -2
  5. package/lib/NestiaSwaggerComposer.js.map +1 -1
  6. package/lib/analyses/AccessorAnalyzer.js.map +1 -1
  7. package/lib/analyses/ConfigAnalyzer.js +133 -7
  8. package/lib/analyses/ConfigAnalyzer.js.map +1 -1
  9. package/lib/analyses/ImportAnalyzer.d.ts +9 -2
  10. package/lib/analyses/ImportAnalyzer.js +13 -50
  11. package/lib/analyses/ImportAnalyzer.js.map +1 -1
  12. package/lib/analyses/PathAnalyzer.js.map +1 -1
  13. package/lib/analyses/ReflectControllerAnalyzer.js.map +1 -1
  14. package/lib/analyses/ReflectHttpOperationAnalyzer.d.ts +1 -1
  15. package/lib/analyses/ReflectHttpOperationAnalyzer.js +5 -4
  16. package/lib/analyses/ReflectHttpOperationAnalyzer.js.map +1 -1
  17. package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.d.ts +1 -1
  18. package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.js +22 -5
  19. package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.js.map +1 -1
  20. package/lib/analyses/ReflectHttpOperationParameterAnalyzer.d.ts +1 -1
  21. package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js +8 -8
  22. package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js.map +1 -1
  23. package/lib/analyses/ReflectHttpOperationResponseAnalyzer.d.ts +1 -1
  24. package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js +15 -15
  25. package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js.map +1 -1
  26. package/lib/analyses/ReflectMetadataAnalyzer.js.map +1 -1
  27. package/lib/analyses/ReflectWebSocketOperationAnalyzer.d.ts +1 -1
  28. package/lib/analyses/ReflectWebSocketOperationAnalyzer.js +1 -1
  29. package/lib/analyses/ReflectWebSocketOperationAnalyzer.js.map +1 -1
  30. package/lib/analyses/SecurityAnalyzer.js.map +1 -1
  31. package/lib/analyses/TypedHttpRouteAnalyzer.d.ts +2 -1
  32. package/lib/analyses/TypedHttpRouteAnalyzer.js +296 -39
  33. package/lib/analyses/TypedHttpRouteAnalyzer.js.map +1 -1
  34. package/lib/analyses/TypedWebSocketRouteAnalyzer.js +1 -4
  35. package/lib/analyses/TypedWebSocketRouteAnalyzer.js.map +1 -1
  36. package/lib/decorators/OperationMetadata.d.ts +12 -2
  37. package/lib/decorators/OperationMetadata.js +14 -1
  38. package/lib/decorators/OperationMetadata.js.map +1 -1
  39. package/lib/executable/internal/CommandParser.js.map +1 -1
  40. package/lib/executable/internal/NestiaConfigLoader.d.ts +6 -2
  41. package/lib/executable/internal/NestiaConfigLoader.js +285 -793
  42. package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
  43. package/lib/executable/internal/NestiaSdkCommand.js +6 -4
  44. package/lib/executable/internal/NestiaSdkCommand.js.map +1 -1
  45. package/lib/executable/sdk.js +17 -5
  46. package/lib/executable/sdk.js.map +1 -1
  47. package/lib/generates/CloneGenerator.js +2 -2
  48. package/lib/generates/CloneGenerator.js.map +1 -1
  49. package/lib/generates/E2eGenerator.js.map +1 -1
  50. package/lib/generates/SdkGenerator.js +6 -9
  51. package/lib/generates/SdkGenerator.js.map +1 -1
  52. package/lib/generates/SwaggerGenerator.js +20 -107
  53. package/lib/generates/SwaggerGenerator.js.map +1 -1
  54. package/lib/generates/internal/E2eFileProgrammer.js +44 -28
  55. package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
  56. package/lib/generates/internal/FilePrinter.d.ts +4 -4
  57. package/lib/generates/internal/FilePrinter.js +25 -16
  58. package/lib/generates/internal/FilePrinter.js.map +1 -1
  59. package/lib/generates/internal/ImportDictionary.d.ts +2 -2
  60. package/lib/generates/internal/ImportDictionary.js +7 -5
  61. package/lib/generates/internal/ImportDictionary.js.map +1 -1
  62. package/lib/generates/internal/SdkAliasCollection.d.ts +11 -11
  63. package/lib/generates/internal/SdkAliasCollection.js +27 -31
  64. package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
  65. package/lib/generates/internal/SdkDistributionComposer.js +15 -70
  66. package/lib/generates/internal/SdkDistributionComposer.js.map +1 -1
  67. package/lib/generates/internal/SdkFileProgrammer.js +2 -2
  68. package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
  69. package/lib/generates/internal/SdkHttpCloneProgrammer.d.ts +2 -2
  70. package/lib/generates/internal/SdkHttpCloneProgrammer.js +6 -12
  71. package/lib/generates/internal/SdkHttpCloneProgrammer.js.map +1 -1
  72. package/lib/generates/internal/SdkHttpCloneReferencer.js +2 -1
  73. package/lib/generates/internal/SdkHttpCloneReferencer.js.map +1 -1
  74. package/lib/generates/internal/SdkHttpFunctionProgrammer.d.ts +2 -2
  75. package/lib/generates/internal/SdkHttpFunctionProgrammer.js +73 -77
  76. package/lib/generates/internal/SdkHttpFunctionProgrammer.js.map +1 -1
  77. package/lib/generates/internal/SdkHttpNamespaceProgrammer.d.ts +2 -2
  78. package/lib/generates/internal/SdkHttpNamespaceProgrammer.js +64 -66
  79. package/lib/generates/internal/SdkHttpNamespaceProgrammer.js.map +1 -1
  80. package/lib/generates/internal/SdkHttpParameterProgrammer.d.ts +4 -10
  81. package/lib/generates/internal/SdkHttpParameterProgrammer.js +15 -22
  82. package/lib/generates/internal/SdkHttpParameterProgrammer.js.map +1 -1
  83. package/lib/generates/internal/SdkHttpRouteProgrammer.d.ts +2 -2
  84. package/lib/generates/internal/SdkHttpRouteProgrammer.js +18 -20
  85. package/lib/generates/internal/SdkHttpRouteProgrammer.js.map +1 -1
  86. package/lib/generates/internal/SdkHttpSimulationProgrammer.d.ts +3 -3
  87. package/lib/generates/internal/SdkHttpSimulationProgrammer.js +47 -49
  88. package/lib/generates/internal/SdkHttpSimulationProgrammer.js.map +1 -1
  89. package/lib/generates/internal/SdkImportWizard.js.map +1 -1
  90. package/lib/generates/internal/SdkRouteDirectory.js.map +1 -1
  91. package/lib/generates/internal/SdkTypeProgrammer.d.ts +4 -4
  92. package/lib/generates/internal/SdkTypeProgrammer.js +66 -67
  93. package/lib/generates/internal/SdkTypeProgrammer.js.map +1 -1
  94. package/lib/generates/internal/SdkTypeTagProgrammer.d.ts +1 -2
  95. package/lib/generates/internal/SdkTypeTagProgrammer.js +29 -11
  96. package/lib/generates/internal/SdkTypeTagProgrammer.js.map +1 -1
  97. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.d.ts +2 -2
  98. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js +55 -55
  99. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js.map +1 -1
  100. package/lib/generates/internal/SdkWebSocketParameterProgrammer.d.ts +3 -3
  101. package/lib/generates/internal/SdkWebSocketParameterProgrammer.js +9 -12
  102. package/lib/generates/internal/SdkWebSocketParameterProgrammer.js.map +1 -1
  103. package/lib/generates/internal/SdkWebSocketRouteProgrammer.d.ts +2 -2
  104. package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +43 -45
  105. package/lib/generates/internal/SdkWebSocketRouteProgrammer.js.map +1 -1
  106. package/lib/generates/internal/SwaggerDescriptionComposer.js.map +1 -1
  107. package/lib/generates/internal/SwaggerOperationComposer.d.ts +1 -1
  108. package/lib/generates/internal/SwaggerOperationComposer.js +5 -4
  109. package/lib/generates/internal/SwaggerOperationComposer.js.map +1 -1
  110. package/lib/generates/internal/SwaggerOperationParameterComposer.d.ts +0 -3
  111. package/lib/generates/internal/SwaggerOperationParameterComposer.js +19 -20
  112. package/lib/generates/internal/SwaggerOperationParameterComposer.js.map +1 -1
  113. package/lib/generates/internal/SwaggerOperationResponseComposer.d.ts +1 -1
  114. package/lib/generates/internal/SwaggerOperationResponseComposer.js +4 -3
  115. package/lib/generates/internal/SwaggerOperationResponseComposer.js.map +1 -1
  116. package/lib/index.js.map +1 -1
  117. package/lib/internal/legacy.d.ts +180 -0
  118. package/lib/internal/legacy.js +361 -0
  119. package/lib/internal/legacy.js.map +1 -0
  120. package/lib/structures/INestiaProject.d.ts +0 -2
  121. package/lib/{transformers → structures}/IOperationMetadata.d.ts +2 -7
  122. package/lib/structures/IOperationMetadata.js.map +1 -0
  123. package/lib/structures/IReflectHttpOperationException.d.ts +1 -1
  124. package/lib/structures/IReflectHttpOperationParameter.d.ts +1 -1
  125. package/lib/structures/IReflectHttpOperationSuccess.d.ts +1 -1
  126. package/lib/structures/IReflectOperationError.d.ts +1 -1
  127. package/lib/structures/IReflectOperationError.js.map +1 -1
  128. package/lib/structures/IReflectWebSocketOperation.d.ts +2 -2
  129. package/lib/structures/ITypedApplication.d.ts +1 -1
  130. package/lib/structures/ITypedHttpRouteException.d.ts +1 -1
  131. package/lib/structures/ITypedHttpRouteParameter.d.ts +1 -1
  132. package/lib/structures/ITypedHttpRouteSuccess.d.ts +1 -1
  133. package/lib/structures/ITypedWebSocketRoute.d.ts +2 -2
  134. package/lib/transform.d.ts +16 -3
  135. package/lib/transform.js +47 -5
  136. package/lib/transform.js.map +1 -1
  137. package/lib/utils/ArrayUtil.js.map +1 -1
  138. package/lib/utils/FileRetriever.js.map +1 -1
  139. package/lib/utils/MapUtil.js.map +1 -1
  140. package/lib/utils/PathUtil.js.map +1 -1
  141. package/lib/utils/SourceFinder.js.map +1 -1
  142. package/lib/utils/StringUtil.js.map +1 -1
  143. package/lib/utils/TsConfigReader.d.ts +7 -0
  144. package/lib/utils/TsConfigReader.js +102 -0
  145. package/lib/utils/TsConfigReader.js.map +1 -0
  146. package/lib/utils/TtscExecutor.d.ts +8 -0
  147. package/lib/utils/TtscExecutor.js +58 -0
  148. package/lib/utils/TtscExecutor.js.map +1 -0
  149. package/lib/utils/VersioningStrategy.js.map +1 -1
  150. package/lib/validators/HttpHeadersValidator.d.ts +8 -5
  151. package/lib/validators/HttpHeadersValidator.js +7 -26
  152. package/lib/validators/HttpHeadersValidator.js.map +1 -1
  153. package/lib/validators/HttpQueryValidator.d.ts +8 -5
  154. package/lib/validators/HttpQueryValidator.js +7 -26
  155. package/lib/validators/HttpQueryValidator.js.map +1 -1
  156. package/lib/{transformers → validators}/TextPlainValidator.d.ts +1 -1
  157. package/lib/{transformers → validators}/TextPlainValidator.js +2 -1
  158. package/lib/validators/TextPlainValidator.js.map +1 -0
  159. package/native/go.mod +52 -0
  160. package/native/go.sum +54 -0
  161. package/native/sdk/register.go +130 -0
  162. package/native/sdk/sdk.go +17 -0
  163. package/native/sdk/sdk_metadata_json.go +327 -0
  164. package/native/sdk/sdk_transform.go +1542 -0
  165. package/package.json +19 -19
  166. package/src/NestiaSdkApplication.ts +9 -5
  167. package/src/NestiaSwaggerComposer.ts +2 -3
  168. package/src/analyses/ConfigAnalyzer.ts +175 -1
  169. package/src/analyses/ImportAnalyzer.ts +15 -49
  170. package/src/analyses/ReflectControllerAnalyzer.ts +1 -1
  171. package/src/analyses/ReflectHttpOperationAnalyzer.ts +1 -1
  172. package/src/analyses/ReflectHttpOperationExceptionAnalyzer.ts +24 -6
  173. package/src/analyses/ReflectHttpOperationParameterAnalyzer.ts +3 -3
  174. package/src/analyses/ReflectHttpOperationResponseAnalyzer.ts +14 -10
  175. package/src/analyses/ReflectWebSocketOperationAnalyzer.ts +2 -2
  176. package/src/analyses/TypedHttpRouteAnalyzer.ts +354 -22
  177. package/src/decorators/OperationMetadata.ts +17 -3
  178. package/src/executable/internal/NestiaConfigLoader.ts +419 -53
  179. package/src/executable/internal/NestiaSdkCommand.ts +9 -10
  180. package/src/executable/sdk.ts +15 -4
  181. package/src/generates/CloneGenerator.ts +10 -10
  182. package/src/generates/SwaggerGenerator.ts +28 -9
  183. package/src/generates/internal/E2eFileProgrammer.ts +80 -43
  184. package/src/generates/internal/FilePrinter.ts +38 -37
  185. package/src/generates/internal/ImportDictionary.ts +18 -16
  186. package/src/generates/internal/SdkAliasCollection.ts +41 -40
  187. package/src/generates/internal/SdkDistributionComposer.ts +21 -8
  188. package/src/generates/internal/SdkFileProgrammer.ts +7 -5
  189. package/src/generates/internal/SdkHttpCloneProgrammer.ts +10 -10
  190. package/src/generates/internal/SdkHttpCloneReferencer.ts +6 -6
  191. package/src/generates/internal/SdkHttpFunctionProgrammer.ts +101 -78
  192. package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +153 -145
  193. package/src/generates/internal/SdkHttpParameterProgrammer.ts +20 -33
  194. package/src/generates/internal/SdkHttpRouteProgrammer.ts +2 -2
  195. package/src/generates/internal/SdkHttpSimulationProgrammer.ts +88 -86
  196. package/src/generates/internal/SdkTypeProgrammer.ts +93 -99
  197. package/src/generates/internal/SdkTypeTagProgrammer.ts +12 -12
  198. package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +128 -118
  199. package/src/generates/internal/SdkWebSocketParameterProgrammer.ts +15 -13
  200. package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +133 -112
  201. package/src/generates/internal/SwaggerOperationComposer.ts +1 -1
  202. package/src/generates/internal/SwaggerOperationParameterComposer.ts +10 -9
  203. package/src/generates/internal/SwaggerOperationResponseComposer.ts +1 -1
  204. package/src/internal/legacy.ts +492 -0
  205. package/src/structures/INestiaProject.ts +0 -3
  206. package/src/{transformers → structures}/IOperationMetadata.ts +2 -7
  207. package/src/structures/IReflectHttpOperationException.ts +1 -1
  208. package/src/structures/IReflectHttpOperationParameter.ts +1 -1
  209. package/src/structures/IReflectHttpOperationSuccess.ts +1 -1
  210. package/src/structures/IReflectOperationError.ts +1 -1
  211. package/src/structures/IReflectWebSocketOperation.ts +2 -2
  212. package/src/structures/ITypedApplication.ts +1 -1
  213. package/src/structures/ITypedHttpRouteException.ts +1 -1
  214. package/src/structures/ITypedHttpRouteParameter.ts +1 -1
  215. package/src/structures/ITypedHttpRouteSuccess.ts +1 -1
  216. package/src/structures/ITypedWebSocketRoute.ts +2 -2
  217. package/src/transform.ts +57 -7
  218. package/src/utils/TsConfigReader.ts +108 -0
  219. package/src/utils/TtscExecutor.ts +63 -0
  220. package/src/validators/HttpHeadersValidator.ts +8 -37
  221. package/src/validators/HttpQueryValidator.ts +8 -37
  222. package/src/{transformers → validators}/TextPlainValidator.ts +2 -2
  223. package/lib/analyses/DtoAnalyzer.d.ts +0 -21
  224. package/lib/analyses/DtoAnalyzer.js +0 -219
  225. package/lib/analyses/DtoAnalyzer.js.map +0 -1
  226. package/lib/analyses/ExceptionAnalyzer.d.ts +0 -0
  227. package/lib/analyses/ExceptionAnalyzer.js +0 -2
  228. package/lib/analyses/ExceptionAnalyzer.js.map +0 -1
  229. package/lib/analyses/GenericAnalyzer.d.ts +0 -4
  230. package/lib/analyses/GenericAnalyzer.js +0 -42
  231. package/lib/analyses/GenericAnalyzer.js.map +0 -1
  232. package/lib/structures/IReflectApplication.d.ts +0 -6
  233. package/lib/structures/IReflectApplication.js +0 -3
  234. package/lib/structures/IReflectApplication.js.map +0 -1
  235. package/lib/structures/MethodType.d.ts +0 -4
  236. package/lib/structures/MethodType.js +0 -8
  237. package/lib/structures/MethodType.js.map +0 -1
  238. package/lib/structures/ParamCategory.d.ts +0 -1
  239. package/lib/structures/ParamCategory.js +0 -3
  240. package/lib/structures/ParamCategory.js.map +0 -1
  241. package/lib/structures/TypeEntry.d.ts +0 -9
  242. package/lib/structures/TypeEntry.js +0 -21
  243. package/lib/structures/TypeEntry.js.map +0 -1
  244. package/lib/transformers/IOperationMetadata.js.map +0 -1
  245. package/lib/transformers/ISdkOperationTransformerContext.d.ts +0 -7
  246. package/lib/transformers/ISdkOperationTransformerContext.js +0 -3
  247. package/lib/transformers/ISdkOperationTransformerContext.js.map +0 -1
  248. package/lib/transformers/SdkOperationProgrammer.d.ts +0 -15
  249. package/lib/transformers/SdkOperationProgrammer.js +0 -186
  250. package/lib/transformers/SdkOperationProgrammer.js.map +0 -1
  251. package/lib/transformers/SdkOperationTransformer.d.ts +0 -4
  252. package/lib/transformers/SdkOperationTransformer.js +0 -128
  253. package/lib/transformers/SdkOperationTransformer.js.map +0 -1
  254. package/lib/transformers/TextPlainValidator.js.map +0 -1
  255. package/lib/utils/MetadataUtil.d.ts +0 -4
  256. package/lib/utils/MetadataUtil.js +0 -34
  257. package/lib/utils/MetadataUtil.js.map +0 -1
  258. package/lib/utils/StripEnums.d.ts +0 -3
  259. package/lib/utils/StripEnums.js +0 -3
  260. package/lib/utils/StripEnums.js.map +0 -1
  261. package/lib/utils/TypeLiteralExpression.d.ts +0 -0
  262. package/lib/utils/TypeLiteralExpression.js +0 -2
  263. package/lib/utils/TypeLiteralExpression.js.map +0 -1
  264. package/src/analyses/DtoAnalyzer.ts +0 -260
  265. package/src/analyses/ExceptionAnalyzer.ts +0 -154
  266. package/src/analyses/GenericAnalyzer.ts +0 -49
  267. package/src/structures/IReflectApplication.ts +0 -8
  268. package/src/structures/MethodType.ts +0 -5
  269. package/src/structures/ParamCategory.ts +0 -1
  270. package/src/structures/TypeEntry.ts +0 -22
  271. package/src/transformers/ISdkOperationTransformerContext.ts +0 -8
  272. package/src/transformers/SdkOperationProgrammer.ts +0 -240
  273. package/src/transformers/SdkOperationTransformer.ts +0 -248
  274. package/src/utils/MetadataUtil.ts +0 -26
  275. package/src/utils/StripEnums.ts +0 -5
  276. package/src/utils/TypeLiteralExpression.ts +0 -0
  277. /package/lib/{transformers → structures}/IOperationMetadata.js +0 -0
@@ -1,5 +1,6 @@
1
- import { MetadataSchema, TypeFactory } from "@typia/core";
2
- import ts from "typescript";
1
+ import { Node, SyntaxKind, TypeScriptFactory } from "@nestia/factory";
2
+ import { TypeFactory } from "@nestia/factory";
3
+ import { MetadataSchema, sizeOf } from "../../internal/legacy";
3
4
 
4
5
  import { INestiaProject } from "../../structures/INestiaProject";
5
6
  import { IReflectType } from "../../structures/IReflectType";
@@ -12,8 +13,8 @@ import { SdkHttpParameterProgrammer } from "./SdkHttpParameterProgrammer";
12
13
  import { SdkTypeProgrammer } from "./SdkTypeProgrammer";
13
14
 
14
15
  export namespace SdkAliasCollection {
15
- export const name = ({ type }: { type: IReflectType }): ts.TypeNode =>
16
- ts.factory.createTypeReferenceNode(
16
+ export const name = ({ type }: { type: IReflectType }): Node =>
17
+ TypeScriptFactory.createTypeReferenceNode(
17
18
  type.name,
18
19
  type.typeArguments
19
20
  ? type.typeArguments.map((a) => name({ type: a }))
@@ -29,8 +30,8 @@ export namespace SdkAliasCollection {
29
30
  export const httpProps =
30
31
  (project: INestiaProject) =>
31
32
  (importer: ImportDictionary) =>
32
- (route: ITypedHttpRoute): ts.TypeNode =>
33
- ts.factory.createTypeLiteralNode(
33
+ (route: ITypedHttpRoute): Node =>
34
+ TypeScriptFactory.createTypeLiteralNode(
34
35
  SdkHttpParameterProgrammer.getEntries({
35
36
  project,
36
37
  importer,
@@ -39,13 +40,13 @@ export namespace SdkAliasCollection {
39
40
  prefix: false,
40
41
  })
41
42
  .map((e) => {
42
- const signature: ts.PropertySignature =
43
- ts.factory.createPropertySignature(
43
+ const signature: Node =
44
+ TypeScriptFactory.createPropertySignature(
44
45
  undefined,
45
46
  e.key,
46
47
  e.required
47
48
  ? undefined
48
- : ts.factory.createToken(ts.SyntaxKind.QuestionToken),
49
+ : TypeScriptFactory.createToken(SyntaxKind.QuestionToken),
49
50
  e.type,
50
51
  );
51
52
  const description: string | null =
@@ -61,7 +62,7 @@ export namespace SdkAliasCollection {
61
62
  null;
62
63
  return description?.length
63
64
  ? [
64
- ts.factory.createIdentifier("\n") as any,
65
+ TypeScriptFactory.createIdentifier("\n") as any,
65
66
  FilePrinter.description(signature, description),
66
67
  ]
67
68
  : [signature];
@@ -69,10 +70,10 @@ export namespace SdkAliasCollection {
69
70
  .flat(),
70
71
  );
71
72
 
72
- export const websocketProps = (route: ITypedWebSocketRoute): ts.TypeNode =>
73
- ts.factory.createTypeLiteralNode([
73
+ export const websocketProps = (route: ITypedWebSocketRoute): Node =>
74
+ TypeScriptFactory.createTypeLiteralNode([
74
75
  ...route.pathParameters.map((p) =>
75
- ts.factory.createPropertySignature(
76
+ TypeScriptFactory.createPropertySignature(
76
77
  undefined,
77
78
  p.name,
78
79
  undefined,
@@ -81,31 +82,31 @@ export namespace SdkAliasCollection {
81
82
  ),
82
83
  ...(route.query
83
84
  ? [
84
- ts.factory.createPropertySignature(
85
+ TypeScriptFactory.createPropertySignature(
85
86
  undefined,
86
87
  "query",
87
88
  undefined,
88
- ts.factory.createTypeReferenceNode("Query"),
89
+ TypeScriptFactory.createTypeReferenceNode("Query"),
89
90
  ),
90
91
  ]
91
92
  : []),
92
- ts.factory.createPropertySignature(
93
+ TypeScriptFactory.createPropertySignature(
93
94
  undefined,
94
95
  "provider",
95
96
  undefined,
96
- ts.factory.createTypeReferenceNode("Provider"),
97
+ TypeScriptFactory.createTypeReferenceNode("Provider"),
97
98
  ),
98
99
  ]);
99
100
 
100
101
  export const headers =
101
102
  (project: INestiaProject) =>
102
103
  (importer: ImportDictionary) =>
103
- (param: ITypedHttpRouteParameter.IHeaders): ts.TypeNode => {
104
+ (param: ITypedHttpRouteParameter.IHeaders): Node => {
104
105
  if (project.config.clone === true)
105
106
  return from(project)(importer)(param.metadata);
106
- const type: ts.TypeNode = name(param);
107
+ const type: Node = name(param);
107
108
  if (project.config.primitive === false) return type;
108
- return ts.factory.createTypeReferenceNode(
109
+ return TypeScriptFactory.createTypeReferenceNode(
109
110
  importer.external({
110
111
  file: "typia",
111
112
  declaration: true,
@@ -119,12 +120,12 @@ export namespace SdkAliasCollection {
119
120
  export const query =
120
121
  (project: INestiaProject) =>
121
122
  (importer: ImportDictionary) =>
122
- (param: ITypedHttpRouteParameter.IQuery): ts.TypeNode => {
123
+ (param: ITypedHttpRouteParameter.IQuery): Node => {
123
124
  if (project.config.clone === true)
124
125
  return from(project)(importer)(param.metadata);
125
- const type: ts.TypeNode = name(param);
126
+ const type: Node = name(param);
126
127
  if (project.config.primitive === false) return type;
127
- return ts.factory.createTypeReferenceNode(
128
+ return TypeScriptFactory.createTypeReferenceNode(
128
129
  importer.external({
129
130
  file: "typia",
130
131
  declaration: true,
@@ -138,18 +139,18 @@ export namespace SdkAliasCollection {
138
139
  export const body =
139
140
  (project: INestiaProject) =>
140
141
  (importer: ImportDictionary) =>
141
- (param: ITypedHttpRouteParameter.IBody): ts.TypeNode => {
142
+ (param: ITypedHttpRouteParameter.IBody): Node => {
142
143
  if (project.config.clone === true) {
143
- const type: ts.TypeNode = from(project)(importer)(param.metadata);
144
+ const type: Node = from(project)(importer)(param.metadata);
144
145
  return param.contentType === "multipart/form-data"
145
146
  ? formDataInput(importer)(type)
146
147
  : type;
147
148
  }
148
- const type: ts.TypeNode = name(param);
149
+ const type: Node = name(param);
149
150
  if (param.contentType === "multipart/form-data")
150
151
  return formDataInput(importer)(type);
151
152
  else if (project.config.primitive === false) return type;
152
- return ts.factory.createTypeReferenceNode(
153
+ return TypeScriptFactory.createTypeReferenceNode(
153
154
  importer.external({
154
155
  file: "typia",
155
156
  declaration: true,
@@ -166,14 +167,14 @@ export namespace SdkAliasCollection {
166
167
  export const response =
167
168
  (project: INestiaProject) =>
168
169
  (importer: ImportDictionary) =>
169
- (route: ITypedHttpRoute): ts.TypeNode => {
170
+ (route: ITypedHttpRoute): Node => {
170
171
  const schema = (p: { metadata: MetadataSchema; type: IReflectType }) =>
171
- p.metadata.size() === 0
172
+ sizeOf(p.metadata) === 0
172
173
  ? TypeFactory.keyword("void")
173
174
  : project.config.clone === true
174
175
  ? from(project)(importer)(p.metadata)
175
176
  : project.config.primitive !== false
176
- ? ts.factory.createTypeReferenceNode(
177
+ ? TypeScriptFactory.createTypeReferenceNode(
177
178
  importer.external({
178
179
  file: "typia",
179
180
  declaration: true,
@@ -201,7 +202,7 @@ export namespace SdkAliasCollection {
201
202
  type: schema(value),
202
203
  })),
203
204
  ];
204
- return ts.factory.createTypeReferenceNode(
205
+ return TypeScriptFactory.createTypeReferenceNode(
205
206
  importer.external({
206
207
  file: "@nestia/fetcher",
207
208
  declaration: true,
@@ -209,11 +210,11 @@ export namespace SdkAliasCollection {
209
210
  name: "IPropagation",
210
211
  }),
211
212
  [
212
- ts.factory.createTypeLiteralNode(
213
+ TypeScriptFactory.createTypeLiteralNode(
213
214
  branches.map((b) =>
214
- ts.factory.createPropertySignature(
215
+ TypeScriptFactory.createPropertySignature(
215
216
  undefined,
216
- ts.factory.createNumericLiteral(b.status),
217
+ TypeScriptFactory.createNumericLiteral(b.status),
217
218
  undefined,
218
219
  b.type,
219
220
  ),
@@ -221,8 +222,8 @@ export namespace SdkAliasCollection {
221
222
  ),
222
223
  ...(route.success.status
223
224
  ? [
224
- ts.factory.createLiteralTypeNode(
225
- ts.factory.createNumericLiteral(route.success.status),
225
+ TypeScriptFactory.createLiteralTypeNode(
226
+ TypeScriptFactory.createNumericLiteral(route.success.status),
226
227
  ),
227
228
  ]
228
229
  : []),
@@ -233,7 +234,7 @@ export namespace SdkAliasCollection {
233
234
  export const responseBody =
234
235
  (project: INestiaProject) =>
235
236
  (importer: ImportDictionary) =>
236
- (route: ITypedHttpRoute): ts.TypeNode =>
237
+ (route: ITypedHttpRoute): Node =>
237
238
  response({
238
239
  ...project,
239
240
  config: {
@@ -242,8 +243,8 @@ export namespace SdkAliasCollection {
242
243
  },
243
244
  })(importer)(route);
244
245
 
245
- const formDataInput = (importer: ImportDictionary) => (type: ts.TypeNode) =>
246
- ts.factory.createTypeReferenceNode(
246
+ const formDataInput = (importer: ImportDictionary) => (type: Node) =>
247
+ TypeScriptFactory.createTypeReferenceNode(
247
248
  importer.external({
248
249
  file: "@nestia/fetcher",
249
250
  declaration: true,
@@ -256,5 +257,5 @@ export namespace SdkAliasCollection {
256
257
 
257
258
  interface IBranch {
258
259
  status: string;
259
- type: ts.TypeNode;
260
+ type: Node;
260
261
  }
@@ -1,7 +1,6 @@
1
1
  import cp from "child_process";
2
2
  import fs from "fs";
3
3
  import path from "path";
4
- import typia from "typia";
5
4
 
6
5
  import { INestiaConfig } from "../../INestiaConfig";
7
6
 
@@ -30,11 +29,12 @@ export namespace SdkDistributionComposer {
30
29
  await replace({ root, output })(file);
31
30
 
32
31
  // INSTALL PACKAGES
33
- const v: IDependencies = await dependencies();
32
+ const v: IDependencies = await dependencies({ websocket: props.websocket });
34
33
  execute("npm install --save-dev rimraf");
35
34
  execute(`npm install --save @nestia/fetcher@${v.version}`);
36
35
  execute(`npm install --save typia@${v.typia}`);
37
- if (props.websocket) execute(`npm install --save tgrid@${v.tgrid}`);
36
+ if (props.websocket && v.tgrid !== undefined)
37
+ execute(`npm install --save tgrid@${v.tgrid}`);
38
38
  execute("npx typia setup --manager npm");
39
39
 
40
40
  exit();
@@ -77,7 +77,9 @@ export namespace SdkDistributionComposer {
77
77
  );
78
78
  };
79
79
 
80
- const dependencies = async (): Promise<IDependencies> => {
80
+ const dependencies = async (opts: {
81
+ websocket: boolean;
82
+ }): Promise<IDependencies> => {
81
83
  const content: string = await fs.promises.readFile(
82
84
  __dirname + "/../../../package.json",
83
85
  "utf8",
@@ -87,17 +89,28 @@ export namespace SdkDistributionComposer {
87
89
  dependencies: Record<string, string>;
88
90
  devDependencies: Record<string, string>;
89
91
  } = JSON.parse(content);
90
- return typia.assert<IDependencies>({
92
+ const dependencies: Record<string, string> = {
91
93
  ...json.devDependencies,
92
94
  ...json.dependencies,
93
- version: json.version,
94
- });
95
+ };
96
+ const required = (key: "version" | "typia"): string => {
97
+ const value: string | undefined =
98
+ key === "version" ? json.version : dependencies[key];
99
+ if (typeof value !== "string" || value.length === 0)
100
+ throw new Error(`Unable to resolve ${key} version for SDK distribution.`);
101
+ return value;
102
+ };
103
+ return {
104
+ version: required("version"),
105
+ typia: required("typia"),
106
+ tgrid: opts.websocket ? dependencies.tgrid : undefined,
107
+ };
95
108
  };
96
109
  }
97
110
 
98
111
  interface IDependencies {
99
112
  version: string;
100
113
  typia: string;
101
- tgrid: string;
114
+ tgrid: string | undefined;
102
115
  }
103
116
  const BUNDLE = __dirname + "/../../../assets/bundle/distribute";
@@ -1,5 +1,5 @@
1
+ import { Node, TypeScriptFactory } from "@nestia/factory";
1
2
  import fs from "fs";
2
- import ts from "typescript";
3
3
 
4
4
  import { INestiaProject } from "../../structures/INestiaProject";
5
5
  import { ITypedApplication } from "../../structures/ITypedApplication";
@@ -54,15 +54,17 @@ export namespace SdkFileProgrammer {
54
54
  } catch {}
55
55
 
56
56
  // ITERATE CHILDREN
57
- const statements: ts.Statement[] = [];
57
+ const statements: Node[] = [];
58
58
  for (const [key, value] of directory.children) {
59
59
  await iterate(project)(value)(`${outDir}/${key}`);
60
60
  statements.push(
61
- ts.factory.createExportDeclaration(
61
+ TypeScriptFactory.createExportDeclaration(
62
62
  undefined,
63
63
  false,
64
- ts.factory.createNamespaceExport(ts.factory.createIdentifier(key)),
65
- ts.factory.createStringLiteral(`./${key}/index`),
64
+ TypeScriptFactory.createNamespaceExport(
65
+ TypeScriptFactory.createIdentifier(key),
66
+ ),
67
+ TypeScriptFactory.createStringLiteral(`./${key}/index`),
66
68
  undefined,
67
69
  ),
68
70
  );
@@ -1,10 +1,10 @@
1
+ import { Node, SyntaxKind, TypeScriptFactory } from "@nestia/factory";
1
2
  import {
2
3
  MetadataAliasType,
3
4
  MetadataAtomic,
4
5
  MetadataObjectType,
5
- } from "@typia/core";
6
+ } from "../../internal/legacy";
6
7
  import { IPointer } from "tstl";
7
- import ts from "typescript";
8
8
  import { IJsDocTagInfo } from "typia";
9
9
 
10
10
  import { INestiaProject } from "../../structures/INestiaProject";
@@ -21,7 +21,7 @@ export namespace SdkHttpCloneProgrammer {
21
21
  children: Map<string, IModule>;
22
22
  programmer:
23
23
  | null
24
- | ((importer: ImportDictionary) => ts.TypeAliasDeclaration);
24
+ | ((importer: ImportDictionary) => Node);
25
25
  }
26
26
 
27
27
  export const write = (app: ITypedApplication): Map<string, IModule> => {
@@ -47,7 +47,7 @@ export namespace SdkHttpCloneProgrammer {
47
47
  const prepare = (props: {
48
48
  dict: Map<string, IModule>;
49
49
  name: string;
50
- programmer: (importer: ImportDictionary) => ts.TypeAliasDeclaration;
50
+ programmer: (importer: ImportDictionary) => Node;
51
51
  }) => {
52
52
  let next: Map<string, IModule> = props.dict;
53
53
  const accessors: string[] = props.name.split(".");
@@ -69,10 +69,10 @@ export namespace SdkHttpCloneProgrammer {
69
69
  const writeAlias =
70
70
  (project: INestiaProject) =>
71
71
  (importer: ImportDictionary) =>
72
- (alias: MetadataAliasType): ts.TypeAliasDeclaration =>
72
+ (alias: MetadataAliasType): Node =>
73
73
  FilePrinter.description(
74
- ts.factory.createTypeAliasDeclaration(
75
- [ts.factory.createToken(ts.SyntaxKind.ExportKeyword)],
74
+ TypeScriptFactory.createTypeAliasDeclaration(
75
+ [TypeScriptFactory.createToken(SyntaxKind.ExportKeyword)],
76
76
  alias.name.split(".").at(-1)!,
77
77
  [],
78
78
  SdkTypeProgrammer.write(project)(importer)(alias.value),
@@ -83,10 +83,10 @@ export namespace SdkHttpCloneProgrammer {
83
83
  const writeObject =
84
84
  (project: INestiaProject) =>
85
85
  (importer: ImportDictionary) =>
86
- (object: MetadataObjectType): ts.TypeAliasDeclaration => {
86
+ (object: MetadataObjectType): Node => {
87
87
  return FilePrinter.description(
88
- ts.factory.createTypeAliasDeclaration(
89
- [ts.factory.createToken(ts.SyntaxKind.ExportKeyword)],
88
+ TypeScriptFactory.createTypeAliasDeclaration(
89
+ [TypeScriptFactory.createToken(SyntaxKind.ExportKeyword)],
90
90
  object.name.split(".").at(-1)!,
91
91
  [],
92
92
  SdkTypeProgrammer.write_object(project)(importer)(object),
@@ -1,4 +1,4 @@
1
- import { MetadataSchema } from "@typia/core";
1
+ import { MetadataSchema, nameOf } from "../../internal/legacy";
2
2
 
3
3
  import { IReflectType } from "../../structures/IReflectType";
4
4
  import { ITypedApplication } from "../../structures/ITypedApplication";
@@ -63,11 +63,11 @@ export namespace SdkHttpCloneReferencer {
63
63
  if (key.length && StringUtil.isImplicit(key) === false)
64
64
  p.unique.add(key.split(".")[0]!);
65
65
  };
66
- for (const alias of p.metadata.aliases) enroll(alias.type.name);
67
- for (const array of p.metadata.arrays) enroll(array.type.name);
68
- for (const tuple of p.metadata.tuples) enroll(tuple.type.name);
69
- for (const object of p.metadata.objects) enroll(object.type.name);
70
- p.name(p.metadata.getName());
66
+ for (const alias of p.metadata.aliases) enroll(alias.type!.name);
67
+ for (const array of p.metadata.arrays) enroll(array.type!.name);
68
+ for (const tuple of p.metadata.tuples) enroll(tuple.type!.name);
69
+ for (const object of p.metadata.objects) enroll(object.type!.name);
70
+ p.name(nameOf(p.metadata));
71
71
  };
72
72
  }
73
73