@nestia/sdk 12.0.0-dev.20260601.1 → 12.0.0-dev.20260619.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 (259) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +93 -93
  3. package/assets/bundle/api/HttpError.ts +1 -1
  4. package/assets/bundle/api/IConnection.ts +1 -1
  5. package/assets/bundle/api/Primitive.ts +1 -1
  6. package/assets/bundle/api/Resolved.ts +1 -1
  7. package/assets/bundle/api/index.ts +4 -4
  8. package/assets/bundle/api/module.ts +6 -6
  9. package/assets/bundle/distribute/README.md +37 -37
  10. package/assets/bundle/distribute/package.json +28 -28
  11. package/assets/bundle/distribute/tsconfig.json +109 -109
  12. package/assets/bundle/e2e/index.ts +42 -42
  13. package/assets/config/nestia.config.ts +97 -97
  14. package/lib/NestiaSdkApplication.js +29 -7
  15. package/lib/NestiaSdkApplication.js.map +1 -1
  16. package/lib/NestiaSwaggerComposer.js +21 -13
  17. package/lib/NestiaSwaggerComposer.js.map +1 -1
  18. package/lib/analyses/AccessorAnalyzer.d.ts +4 -1
  19. package/lib/analyses/AccessorAnalyzer.js.map +1 -1
  20. package/lib/analyses/ConfigAnalyzer.js +1 -1
  21. package/lib/analyses/PathAnalyzer.d.ts +18 -3
  22. package/lib/analyses/PathAnalyzer.js +32 -0
  23. package/lib/analyses/PathAnalyzer.js.map +1 -1
  24. package/lib/analyses/ReflectControllerAnalyzer.js +3 -2
  25. package/lib/analyses/ReflectControllerAnalyzer.js.map +1 -1
  26. package/lib/analyses/ReflectHttpOperationAnalyzer.d.ts +1 -1
  27. package/lib/analyses/ReflectHttpOperationAnalyzer.js +1 -1
  28. package/lib/analyses/ReflectHttpOperationAnalyzer.js.map +1 -1
  29. package/lib/analyses/ReflectHttpOperationResponseAnalyzer.d.ts +1 -1
  30. package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js +53 -20
  31. package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js.map +1 -1
  32. package/lib/analyses/ReflectMcpOperationAnalyzer.d.ts +14 -0
  33. package/lib/analyses/ReflectMcpOperationAnalyzer.js +79 -0
  34. package/lib/analyses/ReflectMcpOperationAnalyzer.js.map +1 -0
  35. package/lib/analyses/TypedMcpRouteAnalyzer.d.ts +9 -0
  36. package/lib/analyses/TypedMcpRouteAnalyzer.js +31 -0
  37. package/lib/analyses/TypedMcpRouteAnalyzer.js.map +1 -0
  38. package/lib/executable/internal/NestiaConfigLoader.js +5 -1
  39. package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
  40. package/lib/executable/internal/NestiaSdkCommand.js +30 -14
  41. package/lib/executable/internal/NestiaSdkCommand.js.map +1 -1
  42. package/lib/executable/internal/NestiaSdkWatcher.d.ts +10 -0
  43. package/lib/executable/internal/NestiaSdkWatcher.js +322 -0
  44. package/lib/executable/internal/NestiaSdkWatcher.js.map +1 -0
  45. package/lib/executable/sdk.js +12 -12
  46. package/lib/executable/sdk.js.map +1 -1
  47. package/lib/factories/ExpressionFactory.d.ts +9 -0
  48. package/lib/factories/ExpressionFactory.js +16 -0
  49. package/lib/factories/ExpressionFactory.js.map +1 -0
  50. package/lib/factories/IdentifierFactory.d.ts +22 -0
  51. package/lib/factories/IdentifierFactory.js +50 -0
  52. package/lib/factories/IdentifierFactory.js.map +1 -0
  53. package/lib/factories/LiteralFactory.d.ts +9 -0
  54. package/lib/factories/LiteralFactory.js +48 -0
  55. package/lib/factories/LiteralFactory.js.map +1 -0
  56. package/lib/factories/StatementFactory.d.ts +14 -0
  57. package/lib/factories/StatementFactory.js +20 -0
  58. package/lib/factories/StatementFactory.js.map +1 -0
  59. package/lib/factories/TypeFactory.d.ts +24 -0
  60. package/lib/factories/TypeFactory.js +27 -0
  61. package/lib/factories/TypeFactory.js.map +1 -0
  62. package/lib/generates/CloneGenerator.js +6 -4
  63. package/lib/generates/CloneGenerator.js.map +1 -1
  64. package/lib/generates/SdkGenerator.js +50 -1
  65. package/lib/generates/SdkGenerator.js.map +1 -1
  66. package/lib/generates/SwaggerGenerator.js +18 -2
  67. package/lib/generates/SwaggerGenerator.js.map +1 -1
  68. package/lib/generates/internal/E2eFileProgrammer.js +32 -29
  69. package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
  70. package/lib/generates/internal/FilePrinter.d.ts +2 -2
  71. package/lib/generates/internal/FilePrinter.js +14 -25
  72. package/lib/generates/internal/FilePrinter.js.map +1 -1
  73. package/lib/generates/internal/ImportDictionary.d.ts +2 -1
  74. package/lib/generates/internal/ImportDictionary.js +16 -10
  75. package/lib/generates/internal/ImportDictionary.js.map +1 -1
  76. package/lib/generates/internal/SdkAliasCollection.d.ts +12 -10
  77. package/lib/generates/internal/SdkAliasCollection.js +29 -22
  78. package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
  79. package/lib/generates/internal/SdkDistributionComposer.d.ts +1 -0
  80. package/lib/generates/internal/SdkDistributionComposer.js +3 -0
  81. package/lib/generates/internal/SdkDistributionComposer.js.map +1 -1
  82. package/lib/generates/internal/SdkFileProgrammer.js +6 -3
  83. package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
  84. package/lib/generates/internal/SdkHttpCloneProgrammer.d.ts +1 -1
  85. package/lib/generates/internal/SdkHttpCloneProgrammer.js +3 -3
  86. package/lib/generates/internal/SdkHttpCloneProgrammer.js.map +1 -1
  87. package/lib/generates/internal/SdkHttpCloneReferencer.d.ts +1 -1
  88. package/lib/generates/internal/SdkHttpCloneReferencer.js +42 -9
  89. package/lib/generates/internal/SdkHttpCloneReferencer.js.map +1 -1
  90. package/lib/generates/internal/SdkHttpFunctionProgrammer.d.ts +1 -1
  91. package/lib/generates/internal/SdkHttpFunctionProgrammer.js +47 -51
  92. package/lib/generates/internal/SdkHttpFunctionProgrammer.js.map +1 -1
  93. package/lib/generates/internal/SdkHttpNamespaceProgrammer.d.ts +1 -1
  94. package/lib/generates/internal/SdkHttpNamespaceProgrammer.js +63 -61
  95. package/lib/generates/internal/SdkHttpNamespaceProgrammer.js.map +1 -1
  96. package/lib/generates/internal/SdkHttpParameterProgrammer.d.ts +2 -2
  97. package/lib/generates/internal/SdkHttpParameterProgrammer.js +11 -13
  98. package/lib/generates/internal/SdkHttpParameterProgrammer.js.map +1 -1
  99. package/lib/generates/internal/SdkHttpRouteProgrammer.d.ts +1 -1
  100. package/lib/generates/internal/SdkHttpSimulationProgrammer.d.ts +1 -1
  101. package/lib/generates/internal/SdkHttpSimulationProgrammer.js +52 -47
  102. package/lib/generates/internal/SdkHttpSimulationProgrammer.js.map +1 -1
  103. package/lib/generates/internal/SdkMcpRouteProgrammer.d.ts +15 -0
  104. package/lib/generates/internal/SdkMcpRouteProgrammer.js +149 -0
  105. package/lib/generates/internal/SdkMcpRouteProgrammer.js.map +1 -0
  106. package/lib/generates/internal/SdkRouteDirectory.d.ts +2 -1
  107. package/lib/generates/internal/SdkRouteDirectory.js.map +1 -1
  108. package/lib/generates/internal/SdkTypeProgrammer.d.ts +3 -3
  109. package/lib/generates/internal/SdkTypeProgrammer.js +42 -43
  110. package/lib/generates/internal/SdkTypeProgrammer.js.map +1 -1
  111. package/lib/generates/internal/SdkTypeTagProgrammer.d.ts +2 -1
  112. package/lib/generates/internal/SdkTypeTagProgrammer.js +7 -9
  113. package/lib/generates/internal/SdkTypeTagProgrammer.js.map +1 -1
  114. package/lib/generates/internal/SdkWebSocketCloneProgrammer.d.ts +6 -0
  115. package/lib/generates/internal/SdkWebSocketCloneProgrammer.js +283 -0
  116. package/lib/generates/internal/SdkWebSocketCloneProgrammer.js.map +1 -0
  117. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.d.ts +2 -2
  118. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js +45 -47
  119. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js.map +1 -1
  120. package/lib/generates/internal/SdkWebSocketParameterProgrammer.d.ts +3 -3
  121. package/lib/generates/internal/SdkWebSocketParameterProgrammer.js +9 -9
  122. package/lib/generates/internal/SdkWebSocketParameterProgrammer.js.map +1 -1
  123. package/lib/generates/internal/SdkWebSocketRouteProgrammer.d.ts +2 -2
  124. package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +37 -41
  125. package/lib/generates/internal/SdkWebSocketRouteProgrammer.js.map +1 -1
  126. package/lib/generates/internal/SwaggerOperationParameterComposer.js +10 -2
  127. package/lib/generates/internal/SwaggerOperationParameterComposer.js.map +1 -1
  128. package/lib/generates/internal/SwaggerOperationResponseComposer.d.ts +1 -1
  129. package/lib/generates/internal/SwaggerOperationResponseComposer.js +6 -1
  130. package/lib/generates/internal/SwaggerOperationResponseComposer.js.map +1 -1
  131. package/lib/generates/internal/SwaggerReadonlyArrayEmender.d.ts +9 -0
  132. package/lib/generates/internal/SwaggerReadonlyArrayEmender.js +174 -0
  133. package/lib/generates/internal/SwaggerReadonlyArrayEmender.js.map +1 -0
  134. package/lib/structures/INestiaSdkInput.d.ts +9 -2
  135. package/lib/structures/IReflectController.d.ts +2 -1
  136. package/lib/structures/IReflectHttpOperationSuccess.d.ts +4 -2
  137. package/lib/structures/IReflectMcpOperation.d.ts +35 -0
  138. package/lib/structures/IReflectMcpOperation.js +3 -0
  139. package/lib/structures/IReflectMcpOperation.js.map +1 -0
  140. package/lib/structures/IReflectMcpOperationParameter.d.ts +19 -0
  141. package/lib/structures/IReflectMcpOperationParameter.js +3 -0
  142. package/lib/structures/IReflectMcpOperationParameter.js.map +1 -0
  143. package/lib/structures/ITypedApplication.d.ts +2 -1
  144. package/lib/structures/ITypedHttpRouteSuccess.d.ts +3 -1
  145. package/lib/structures/ITypedMcpRoute.d.ts +31 -0
  146. package/lib/structures/ITypedMcpRoute.js +3 -0
  147. package/lib/structures/ITypedMcpRoute.js.map +1 -0
  148. package/lib/transform.d.ts +5 -9
  149. package/lib/transform.js +8 -31
  150. package/lib/transform.js.map +1 -1
  151. package/lib/utils/HttpResponseContentTypeUtil.d.ts +5 -0
  152. package/lib/utils/HttpResponseContentTypeUtil.js +22 -0
  153. package/lib/utils/HttpResponseContentTypeUtil.js.map +1 -0
  154. package/native/go.mod +52 -52
  155. package/native/go.sum +84 -54
  156. package/native/sdk/register.go +322 -165
  157. package/native/sdk/sdk.go +17 -17
  158. package/native/sdk/sdk_metadata_json.go +327 -327
  159. package/native/sdk/sdk_transform.go +1879 -1549
  160. package/package.json +13 -11
  161. package/src/INestiaConfig.ts +267 -267
  162. package/src/NestiaSdkApplication.ts +39 -8
  163. package/src/NestiaSwaggerComposer.ts +153 -142
  164. package/src/analyses/AccessorAnalyzer.ts +64 -67
  165. package/src/analyses/ConfigAnalyzer.ts +330 -330
  166. package/src/analyses/ImportAnalyzer.ts +92 -92
  167. package/src/analyses/PathAnalyzer.ts +130 -69
  168. package/src/analyses/ReflectControllerAnalyzer.ts +112 -105
  169. package/src/analyses/ReflectHttpOperationAnalyzer.ts +183 -183
  170. package/src/analyses/ReflectHttpOperationExceptionAnalyzer.ts +90 -90
  171. package/src/analyses/ReflectHttpOperationParameterAnalyzer.ts +350 -350
  172. package/src/analyses/ReflectHttpOperationResponseAnalyzer.ts +163 -130
  173. package/src/analyses/ReflectMcpOperationAnalyzer.ts +124 -0
  174. package/src/analyses/ReflectMetadataAnalyzer.ts +44 -44
  175. package/src/analyses/SecurityAnalyzer.ts +25 -25
  176. package/src/analyses/TypedMcpRouteAnalyzer.ts +34 -0
  177. package/src/decorators/OperationMetadata.ts +29 -29
  178. package/src/executable/internal/CommandParser.ts +15 -15
  179. package/src/executable/internal/NestiaConfigLoader.ts +451 -446
  180. package/src/executable/internal/NestiaSdkCommand.ts +124 -106
  181. package/src/executable/internal/NestiaSdkWatcher.ts +342 -0
  182. package/src/executable/sdk.ts +90 -88
  183. package/src/factories/ExpressionFactory.ts +23 -0
  184. package/src/factories/IdentifierFactory.ts +84 -0
  185. package/src/factories/LiteralFactory.ts +54 -0
  186. package/src/factories/StatementFactory.ts +56 -0
  187. package/src/factories/TypeFactory.ts +27 -0
  188. package/src/generates/CloneGenerator.ts +74 -66
  189. package/src/generates/E2eGenerator.ts +32 -32
  190. package/src/generates/SdkGenerator.ts +176 -118
  191. package/src/generates/SwaggerGenerator.ts +342 -310
  192. package/src/generates/internal/E2eFileProgrammer.ts +246 -233
  193. package/src/generates/internal/FilePrinter.ts +57 -65
  194. package/src/generates/internal/ImportDictionary.ts +207 -204
  195. package/src/generates/internal/SdkAliasCollection.ts +280 -261
  196. package/src/generates/internal/SdkDistributionComposer.ts +123 -116
  197. package/src/generates/internal/SdkFileProgrammer.ts +113 -112
  198. package/src/generates/internal/SdkHttpCloneProgrammer.ts +124 -126
  199. package/src/generates/internal/SdkHttpCloneReferencer.ts +131 -77
  200. package/src/generates/internal/SdkHttpFunctionProgrammer.ts +290 -301
  201. package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +507 -510
  202. package/src/generates/internal/SdkHttpParameterProgrammer.ts +163 -165
  203. package/src/generates/internal/SdkHttpRouteProgrammer.ts +109 -109
  204. package/src/generates/internal/SdkHttpSimulationProgrammer.ts +322 -314
  205. package/src/generates/internal/SdkImportWizard.ts +62 -62
  206. package/src/generates/internal/SdkMcpRouteProgrammer.ts +447 -0
  207. package/src/generates/internal/SdkRouteDirectory.ts +21 -18
  208. package/src/generates/internal/SdkTypeProgrammer.ts +389 -382
  209. package/src/generates/internal/SdkTypeTagProgrammer.ts +110 -114
  210. package/src/generates/internal/SdkWebSocketCloneProgrammer.ts +319 -0
  211. package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +383 -389
  212. package/src/generates/internal/SdkWebSocketParameterProgrammer.ts +91 -89
  213. package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +304 -323
  214. package/src/generates/internal/SwaggerDescriptionComposer.ts +64 -64
  215. package/src/generates/internal/SwaggerOperationComposer.ts +119 -119
  216. package/src/generates/internal/SwaggerOperationParameterComposer.ts +175 -162
  217. package/src/generates/internal/SwaggerOperationResponseComposer.ts +115 -110
  218. package/src/generates/internal/SwaggerReadonlyArrayEmender.ts +262 -0
  219. package/src/index.ts +4 -4
  220. package/src/internal/legacy.ts +492 -492
  221. package/src/module.ts +4 -4
  222. package/src/structures/INestiaProject.ts +10 -10
  223. package/src/structures/INestiaSdkInput.ts +27 -20
  224. package/src/structures/IOperationMetadata.ts +41 -41
  225. package/src/structures/IReflectController.ts +18 -15
  226. package/src/structures/IReflectHttpOperation.ts +26 -26
  227. package/src/structures/IReflectHttpOperationException.ts +18 -18
  228. package/src/structures/IReflectHttpOperationParameter.ts +79 -79
  229. package/src/structures/IReflectHttpOperationSuccess.ts +18 -21
  230. package/src/structures/IReflectImport.ts +6 -6
  231. package/src/structures/IReflectMcpOperation.ts +38 -0
  232. package/src/structures/IReflectMcpOperationParameter.ts +27 -0
  233. package/src/structures/IReflectOperationError.ts +26 -26
  234. package/src/structures/IReflectType.ts +4 -4
  235. package/src/structures/IReflectWebSocketOperation.ts +17 -17
  236. package/src/structures/ITypedApplication.ts +12 -11
  237. package/src/structures/ITypedHttpRoute.ts +41 -41
  238. package/src/structures/ITypedHttpRouteException.ts +15 -15
  239. package/src/structures/ITypedHttpRouteParameter.ts +41 -41
  240. package/src/structures/ITypedHttpRouteSuccess.ts +18 -22
  241. package/src/structures/ITypedMcpRoute.ts +33 -0
  242. package/src/structures/ITypedWebSocketRoute.ts +24 -24
  243. package/src/structures/ITypedWebSocketRouteParameter.ts +3 -3
  244. package/src/transform.ts +28 -59
  245. package/src/typings/get-function-location.d.ts +7 -7
  246. package/src/utils/ArrayUtil.ts +26 -26
  247. package/src/utils/EmittedJavaScriptPatcher.ts +88 -88
  248. package/src/utils/FileRetriever.ts +22 -22
  249. package/src/utils/HttpResponseContentTypeUtil.ts +30 -0
  250. package/src/utils/MapUtil.ts +14 -14
  251. package/src/utils/PathUtil.ts +10 -10
  252. package/src/utils/SourceFinder.ts +63 -63
  253. package/src/utils/StringUtil.ts +17 -17
  254. package/src/utils/TsConfigReader.ts +108 -108
  255. package/src/utils/TtscExecutor.ts +68 -68
  256. package/src/utils/VersioningStrategy.ts +28 -28
  257. package/src/validators/HttpHeadersValidator.ts +11 -11
  258. package/src/validators/HttpQueryValidator.ts +11 -11
  259. package/src/validators/TextPlainValidator.ts +17 -17
@@ -1,4 +1,4 @@
1
1
  import { ITypedApplication } from "../../structures/ITypedApplication";
2
2
  export declare namespace SdkHttpCloneReferencer {
3
- const replace: (app: ITypedApplication) => void;
3
+ const replace: (app: ITypedApplication, websocket?: Set<string>) => void;
4
4
  }
@@ -4,18 +4,25 @@ exports.SdkHttpCloneReferencer = void 0;
4
4
  const legacy_1 = require("../../internal/legacy");
5
5
  const StringUtil_1 = require("../../utils/StringUtil");
6
6
  const SdkHttpParameterProgrammer_1 = require("./SdkHttpParameterProgrammer");
7
+ const SdkWebSocketCloneProgrammer_1 = require("./SdkWebSocketCloneProgrammer");
7
8
  var SdkHttpCloneReferencer;
8
9
  (function (SdkHttpCloneReferencer) {
9
- SdkHttpCloneReferencer.replace = (app) => {
10
+ SdkHttpCloneReferencer.replace = (app, websocket = new Set()) => {
10
11
  const directory = `${app.project.config.output}/structures`;
11
12
  for (const route of app.routes)
12
13
  if (route.protocol === "http")
13
- visitRoute({
14
+ visitHttpRoute({
15
+ directory,
16
+ route,
17
+ });
18
+ else if (route.protocol === "websocket")
19
+ visitWebSocketRoute({
20
+ cloned: websocket,
14
21
  directory,
15
22
  route,
16
23
  });
17
24
  };
18
- const visitRoute = (props) => {
25
+ const visitHttpRoute = (props) => {
19
26
  const unique = new Set();
20
27
  for (const p of SdkHttpParameterProgrammer_1.SdkHttpParameterProgrammer.getSignificant(props.route, true))
21
28
  visitType({
@@ -31,12 +38,13 @@ var SdkHttpCloneReferencer;
31
38
  type: v.type,
32
39
  name: (name) => (v.type = { name }),
33
40
  });
34
- visitType({
35
- unique,
36
- metadata: props.route.success.metadata,
37
- type: props.route.success.type,
38
- name: (name) => (props.route.success.type = { name }),
39
- });
41
+ if (props.route.success.binary === false)
42
+ visitType({
43
+ unique,
44
+ metadata: props.route.success.metadata,
45
+ type: props.route.success.type,
46
+ name: (name) => (props.route.success.type = { name }),
47
+ });
40
48
  props.route.imports = Array.from(unique).map((str) => ({
41
49
  file: `${props.directory}/${str}`,
42
50
  asterisk: null,
@@ -44,6 +52,31 @@ var SdkHttpCloneReferencer;
44
52
  elements: [str],
45
53
  }));
46
54
  };
55
+ const visitWebSocketRoute = (props) => {
56
+ const unique = new Set();
57
+ const keep = [];
58
+ for (const imp of props.route.imports) {
59
+ const cloned = SdkWebSocketCloneProgrammer_1.SdkWebSocketCloneProgrammer.isNodeModulesPath(imp.file)
60
+ ? []
61
+ : imp.elements.filter((elem) => props.cloned.has(SdkWebSocketCloneProgrammer_1.SdkWebSocketCloneProgrammer.importKey(imp.file, elem)));
62
+ const remained = imp.elements.filter((elem) => cloned.includes(elem) === false);
63
+ for (const elem of cloned)
64
+ unique.add(elem);
65
+ if (imp.asterisk !== null ||
66
+ imp.default !== null ||
67
+ remained.length !== 0)
68
+ keep.push(Object.assign(Object.assign({}, imp), { elements: remained }));
69
+ }
70
+ props.route.imports = [
71
+ ...keep,
72
+ ...Array.from(unique).map((str) => ({
73
+ file: `${props.directory}/${str}`,
74
+ asterisk: null,
75
+ default: null,
76
+ elements: [str],
77
+ })),
78
+ ];
79
+ };
47
80
  const visitType = (p) => {
48
81
  const enroll = (key) => {
49
82
  if (key.length && StringUtil_1.StringUtil.isImplicit(key) === false)
@@ -1 +1 @@
1
- {"version":3,"file":"SdkHttpCloneReferencer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkHttpCloneReferencer.ts"],"names":[],"mappings":";;;AAAA,kDAA+D;AAK/D,uDAAoD;AACpD,6EAA0E;AAE1E,IAAiB,sBAAsB,CA+DtC;AA/DD,WAAiB,sBAAsB;IACxB,8BAAO,GAAG,CAAC,GAAsB,EAAQ,EAAE;QACtD,MAAM,SAAS,GAAW,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,aAAa,CAAC;QACpE,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM;YAC5B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B,EAAU,EAAE,CACjD,IAAI,CAAC,aAAa,KAAK,SAAS;IAC9B,CAAC,CAAC,IAAI,CAAC,IAAI;IACX,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC"}
1
+ {"version":3,"file":"SdkHttpCloneReferencer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkHttpCloneReferencer.ts"],"names":[],"mappings":";;;AAAA,kDAA+D;AAK/D,uDAAoD;AACpD,6EAA0E;AAC1E,+EAA4E;AAE5E,IAAiB,sBAAsB,CAoHtC;AApHD,WAAiB,sBAAsB;IACxB,8BAAO,GAAG,CACrB,GAAsB,EACtB,SAAS,GAAgB,IAAI,GAAG,EAAE,EAC5B,EAAE;QACR,MAAM,SAAS,GAAW,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,aAAa,CAAC;QACpE,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM;YAC5B,IAAI,KAAK,CAAC,QAAQ,KAAK,MAAM;gBAC3B,cAAc,CAAC;oBACb,SAAS;oBACT,KAAK;iBACN,CAAC,CAAC;iBACA,IAAI,KAAK,CAAC,QAAQ,KAAK,WAAW;gBACrC,mBAAmB,CAAC;oBAClB,MAAM,EAAE,SAAS;oBACjB,SAAS;oBACT,KAAK;iBACN,CAAC,CAAC;IACT,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,CAAC,KAGvB,EAAQ,EAAE;QACT,MAAM,MAAM,GAAgB,IAAI,GAAG,EAAE,CAAC;QACtC,KAAK,MAAM,CAAC,IAAI,uDAA0B,CAAC,cAAc,CACvD,KAAK,CAAC,KAAK,EACX,IAAI,CACL;YACC,SAAS,CAAC;gBACR,MAAM;gBACN,QAAQ,EAAE,CAAC,CAAC,QAAQ;gBACpB,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,IAAI,EAAE,CAAC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"@ttsc/factory";
2
2
  import { INestiaProject } from "../../structures/INestiaProject";
3
3
  import { ITypedHttpRoute } from "../../structures/ITypedHttpRoute";
4
4
  import { ImportDictionary } from "./ImportDictionary";
@@ -1,24 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SdkHttpFunctionProgrammer = void 0;
4
- const factory_1 = require("@nestia/factory");
5
- const factory_2 = require("@nestia/factory");
4
+ const factory_1 = require("@ttsc/factory");
5
+ const IdentifierFactory_1 = require("../../factories/IdentifierFactory");
6
+ const TypeFactory_1 = require("../../factories/TypeFactory");
7
+ const legacy_1 = require("../../internal/legacy");
6
8
  const StringUtil_1 = require("../../utils/StringUtil");
7
9
  const SdkAliasCollection_1 = require("./SdkAliasCollection");
8
10
  const SdkHttpParameterProgrammer_1 = require("./SdkHttpParameterProgrammer");
9
11
  const SdkImportWizard_1 = require("./SdkImportWizard");
10
- const legacy_1 = require("../../internal/legacy");
11
12
  var SdkHttpFunctionProgrammer;
12
13
  (function (SdkHttpFunctionProgrammer) {
13
14
  SdkHttpFunctionProgrammer.write = (project) => (importer) => (route) => {
14
- return factory_1.TypeScriptFactory.createFunctionDeclaration([
15
- factory_1.TypeScriptFactory.createModifier(factory_1.SyntaxKind.ExportKeyword),
16
- factory_1.TypeScriptFactory.createModifier(factory_1.SyntaxKind.AsyncKeyword),
15
+ return factory_1.factory.createFunctionDeclaration([
16
+ factory_1.factory.createModifier(factory_1.SyntaxKind.ExportKeyword),
17
+ factory_1.factory.createModifier(factory_1.SyntaxKind.AsyncKeyword),
17
18
  ], undefined, route.name, undefined, [
18
- factory_2.IdentifierFactory.parameter("connection", factory_1.TypeScriptFactory.createTypeReferenceNode(SdkImportWizard_1.SdkImportWizard.IConnection(importer), route.headerObject !== null
19
- ? [
20
- factory_1.TypeScriptFactory.createTypeReferenceNode(`${route.name}.Headers`),
21
- ]
19
+ IdentifierFactory_1.IdentifierFactory.parameter("connection", factory_1.factory.createTypeReferenceNode(SdkImportWizard_1.SdkImportWizard.IConnection(importer), route.headerObject !== null
20
+ ? [factory_1.factory.createTypeReferenceNode(`${route.name}.Headers`)]
22
21
  : undefined)),
23
22
  ...SdkHttpParameterProgrammer_1.SdkHttpParameterProgrammer.getParameterDeclarations({
24
23
  project,
@@ -27,36 +26,37 @@ var SdkHttpFunctionProgrammer;
27
26
  body: true,
28
27
  prefix: true,
29
28
  }),
30
- ], factory_1.TypeScriptFactory.createTypeReferenceNode("Promise", [
29
+ ], factory_1.factory.createTypeReferenceNode("Promise", [
31
30
  project.config.propagate === true ||
31
+ route.success.binary === true ||
32
32
  (0, legacy_1.sizeOf)(route.success.metadata) !== 0
33
- ? factory_1.TypeScriptFactory.createTypeReferenceNode(`${route.name}.Output`)
34
- : factory_1.TypeScriptFactory.createTypeReferenceNode("void"),
35
- ]), factory_1.TypeScriptFactory.createBlock(writeBody(project)(importer)(route), true));
33
+ ? factory_1.factory.createTypeReferenceNode(`${route.name}.Output`)
34
+ : factory_1.factory.createTypeReferenceNode("void"),
35
+ ]), factory_1.factory.createBlock(writeBody(project)(importer)(route), true));
36
36
  };
37
37
  const writeBody = (project) => (importer) => (route) => {
38
38
  const access = (name) => project.config.keyword === true
39
- ? factory_1.TypeScriptFactory.createPropertyAccessExpression(factory_1.TypeScriptFactory.createIdentifier("props"), name)
40
- : factory_1.TypeScriptFactory.createIdentifier(name);
41
- const fetch = () => { var _a, _b; var _c; return factory_1.TypeScriptFactory.createCallExpression(factory_2.IdentifierFactory.access(factory_1.TypeScriptFactory.createIdentifier(SdkImportWizard_1.SdkImportWizard.Fetcher(!!((_a = route.body) === null || _a === void 0 ? void 0 : _a.encrypted) || route.success.encrypted)(importer)), project.config.propagate ? "propagate" : "fetch"), project.config.propagate
39
+ ? factory_1.factory.createPropertyAccessExpression(factory_1.factory.createIdentifier("props"), name)
40
+ : factory_1.factory.createIdentifier(name);
41
+ const fetch = () => { var _a, _b; var _c; return factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.Fetcher(!!((_a = route.body) === null || _a === void 0 ? void 0 : _a.encrypted) || route.success.encrypted)(importer)), project.config.propagate ? "propagate" : "fetch"), project.config.propagate
42
42
  ? route.method.toLowerCase() === "get" ||
43
43
  route.method.toLowerCase() === "head"
44
- ? [factory_2.TypeFactory.keyword("any")]
45
- : [factory_2.TypeFactory.keyword("any"), factory_2.TypeFactory.keyword("any")]
44
+ ? [TypeFactory_1.TypeFactory.keyword("any")]
45
+ : [TypeFactory_1.TypeFactory.keyword("any"), TypeFactory_1.TypeFactory.keyword("any")]
46
46
  : undefined, [
47
47
  route.body && route.body.contentType !== "multipart/form-data"
48
- ? factory_1.TypeScriptFactory.createObjectLiteralExpression([
49
- factory_1.TypeScriptFactory.createSpreadAssignment(factory_1.TypeScriptFactory.createIdentifier("connection")),
50
- factory_1.TypeScriptFactory.createPropertyAssignment("headers", factory_1.TypeScriptFactory.createObjectLiteralExpression([
51
- factory_1.TypeScriptFactory.createSpreadAssignment(factory_2.IdentifierFactory.access(factory_1.TypeScriptFactory.createIdentifier("connection"), "headers")),
52
- factory_1.TypeScriptFactory.createPropertyAssignment(factory_1.TypeScriptFactory.createStringLiteral("Content-Type"), factory_1.TypeScriptFactory.createStringLiteral((_c = (_b = route.body) === null || _b === void 0 ? void 0 : _b.contentType) !== null && _c !== void 0 ? _c : "application/json")),
48
+ ? factory_1.factory.createObjectLiteralExpression([
49
+ factory_1.factory.createSpreadAssignment(factory_1.factory.createIdentifier("connection")),
50
+ factory_1.factory.createPropertyAssignment("headers", factory_1.factory.createObjectLiteralExpression([
51
+ factory_1.factory.createSpreadAssignment(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier("connection"), "headers")),
52
+ factory_1.factory.createPropertyAssignment(factory_1.factory.createStringLiteral("Content-Type"), factory_1.factory.createStringLiteral((_c = (_b = route.body) === null || _b === void 0 ? void 0 : _b.contentType) !== null && _c !== void 0 ? _c : "application/json")),
53
53
  ], true)),
54
54
  ], true)
55
- : factory_1.TypeScriptFactory.createIdentifier("connection"),
56
- factory_1.TypeScriptFactory.createObjectLiteralExpression([
57
- factory_1.TypeScriptFactory.createSpreadAssignment(factory_2.IdentifierFactory.access(factory_1.TypeScriptFactory.createIdentifier(route.name), "METADATA")),
58
- factory_1.TypeScriptFactory.createPropertyAssignment("template", factory_2.IdentifierFactory.access(factory_2.IdentifierFactory.access(factory_1.TypeScriptFactory.createIdentifier(route.name), "METADATA"), "path")),
59
- factory_1.TypeScriptFactory.createPropertyAssignment("path", factory_1.TypeScriptFactory.createCallExpression(factory_2.IdentifierFactory.access(factory_1.TypeScriptFactory.createIdentifier(route.name), "path"), undefined, SdkHttpParameterProgrammer_1.SdkHttpParameterProgrammer.getArguments({
55
+ : factory_1.factory.createIdentifier("connection"),
56
+ factory_1.factory.createObjectLiteralExpression([
57
+ factory_1.factory.createSpreadAssignment(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(route.name), "METADATA")),
58
+ factory_1.factory.createPropertyAssignment("template", IdentifierFactory_1.IdentifierFactory.access(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(route.name), "METADATA"), "path")),
59
+ factory_1.factory.createPropertyAssignment("path", factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(route.name), "path"), undefined, SdkHttpParameterProgrammer_1.SdkHttpParameterProgrammer.getArguments({
60
60
  project,
61
61
  route,
62
62
  body: false,
@@ -67,31 +67,27 @@ var SdkHttpFunctionProgrammer;
67
67
  route.body !== null &&
68
68
  (route.body.contentType === "application/json" ||
69
69
  route.body.encrypted === true)
70
- ? [factory_1.TypeScriptFactory.createIdentifier(`${route.name}.stringify`)]
70
+ ? [factory_1.factory.createIdentifier(`${route.name}.stringify`)]
71
71
  : []),
72
72
  ]); };
73
73
  const output = (awaiter) => project.config.simulate
74
- ? factory_1.TypeScriptFactory.createConditionalExpression(factory_1.TypeScriptFactory.createStrictEquality(factory_1.TypeScriptFactory.createTrue(), factory_1.TypeScriptFactory.createIdentifier("connection.simulate")), undefined, factory_1.TypeScriptFactory.createCallExpression(factory_1.TypeScriptFactory.createIdentifier(`${route.name}.simulate`), [], [
75
- factory_1.TypeScriptFactory.createIdentifier("connection"),
74
+ ? factory_1.factory.createConditionalExpression(factory_1.factory.createStrictEquality(factory_1.factory.createTrue(), factory_1.factory.createIdentifier("connection.simulate")), undefined, factory_1.factory.createCallExpression(factory_1.factory.createIdentifier(`${route.name}.simulate`), [], [
75
+ factory_1.factory.createIdentifier("connection"),
76
76
  ...SdkHttpParameterProgrammer_1.SdkHttpParameterProgrammer.getArguments({
77
77
  project,
78
78
  route,
79
79
  body: true,
80
80
  }),
81
- ]), undefined, awaiter
82
- ? factory_1.TypeScriptFactory.createAwaitExpression(fetch())
83
- : fetch())
81
+ ]), undefined, awaiter ? factory_1.factory.createAwaitExpression(fetch()) : fetch())
84
82
  : awaiter
85
- ? factory_1.TypeScriptFactory.createAwaitExpression(fetch())
83
+ ? factory_1.factory.createAwaitExpression(fetch())
86
84
  : fetch();
87
85
  return [
88
86
  ...(project.config.assert
89
- ? SdkHttpParameterProgrammer_1.SdkHttpParameterProgrammer.getSignificant(route, true).map((p) => factory_1.TypeScriptFactory.createExpressionStatement(factory_1.TypeScriptFactory.createCallExpression(factory_2.IdentifierFactory.access(factory_1.TypeScriptFactory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "assert"), [
90
- factory_1.TypeScriptFactory.createTypeQueryNode(factory_1.TypeScriptFactory.createIdentifier(p.name)),
91
- ], [factory_1.TypeScriptFactory.createIdentifier(p.name)])))
87
+ ? SdkHttpParameterProgrammer_1.SdkHttpParameterProgrammer.getSignificant(route, true).map((p) => factory_1.factory.createExpressionStatement(factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "assert"), [factory_1.factory.createTypeQueryNode(access(p.name))], [access(p.name)])))
92
88
  : []),
93
89
  ...(route.success.setHeaders.length === 0
94
- ? [factory_1.TypeScriptFactory.createReturnStatement(output(false))]
90
+ ? [factory_1.factory.createReturnStatement(output(false))]
95
91
  : writeSetHeaders(project)(importer)(route)(output(true))),
96
92
  ];
97
93
  };
@@ -106,26 +102,26 @@ var SdkHttpFunctionProgrammer;
106
102
  ? accessor(output)("data")
107
103
  : output;
108
104
  const assigners = [
109
- factory_1.TypeScriptFactory.createBinaryExpression(factory_1.TypeScriptFactory.createIdentifier(headers), factory_1.TypeScriptFactory.createToken(factory_1.SyntaxKind.QuestionQuestionEqualsToken), factory_1.TypeScriptFactory.createObjectLiteralExpression([])),
105
+ factory_1.factory.createBinaryExpression(factory_1.factory.createIdentifier(headers), factory_1.factory.createToken(factory_1.SyntaxKind.QuestionQuestionEqualsToken), factory_1.factory.createObjectLiteralExpression([])),
110
106
  ...route.success.setHeaders.map((tuple) => { var _a; return tuple.type === "assigner"
111
- ? factory_1.TypeScriptFactory.createCallExpression(factory_1.TypeScriptFactory.createIdentifier("Object.assign"), [], [
112
- factory_1.TypeScriptFactory.createIdentifier(headers),
113
- factory_1.TypeScriptFactory.createIdentifier(accessor(data)(tuple.source)),
107
+ ? factory_1.factory.createCallExpression(factory_1.factory.createIdentifier("Object.assign"), [], [
108
+ factory_1.factory.createIdentifier(headers),
109
+ factory_1.factory.createIdentifier(accessor(data)(tuple.source)),
114
110
  ])
115
- : factory_1.TypeScriptFactory.createBinaryExpression(factory_1.TypeScriptFactory.createIdentifier(accessor(headers)((_a = tuple.target) !== null && _a !== void 0 ? _a : tuple.source)), factory_1.TypeScriptFactory.createToken(factory_1.SyntaxKind.EqualsToken), factory_1.TypeScriptFactory.createIdentifier(accessor(data)(tuple.source))); }),
116
- ].map(factory_1.TypeScriptFactory.createExpressionStatement);
111
+ : factory_1.factory.createBinaryExpression(factory_1.factory.createIdentifier(accessor(headers)((_a = tuple.target) !== null && _a !== void 0 ? _a : tuple.source)), factory_1.factory.createToken(factory_1.SyntaxKind.EqualsToken), factory_1.factory.createIdentifier(accessor(data)(tuple.source))); }),
112
+ ].map(factory_1.factory.createExpressionStatement);
117
113
  return [
118
- factory_1.TypeScriptFactory.createVariableStatement([], factory_1.TypeScriptFactory.createVariableDeclarationList([
119
- factory_1.TypeScriptFactory.createVariableDeclaration(output, undefined, SdkAliasCollection_1.SdkAliasCollection.response(project)(importer)(route), condition),
114
+ factory_1.factory.createVariableStatement([], factory_1.factory.createVariableDeclarationList([
115
+ factory_1.factory.createVariableDeclaration(output, undefined, SdkAliasCollection_1.SdkAliasCollection.response(project)(importer)(route), condition),
120
116
  ], factory_1.NodeFlags.Const)),
121
117
  ...(project.config.propagate
122
118
  ? [
123
- factory_1.TypeScriptFactory.createIfStatement(factory_1.TypeScriptFactory.createIdentifier(accessor(output)("success")), assigners.length === 1
119
+ factory_1.factory.createIfStatement(factory_1.factory.createIdentifier(accessor(output)("success")), assigners.length === 1
124
120
  ? assigners[0]
125
- : factory_1.TypeScriptFactory.createBlock(assigners, true), undefined),
121
+ : factory_1.factory.createBlock(assigners, true), undefined),
126
122
  ]
127
123
  : assigners),
128
- factory_1.TypeScriptFactory.createReturnStatement(factory_1.TypeScriptFactory.createIdentifier(output)),
124
+ factory_1.factory.createReturnStatement(factory_1.factory.createIdentifier(output)),
129
125
  ];
130
126
  };
131
127
  })(SdkHttpFunctionProgrammer || (exports.SdkHttpFunctionProgrammer = SdkHttpFunctionProgrammer = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"SdkHttpFunctionProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkHttpFunctionProgrammer.ts"],"names":[],"mappings":";;;AAAA,6CAAiF;AACjF,6CAAiE;AAIjE,uDAAoD;AAEpD,6DAA0D;AAC1D,6EAA0E;AAC1E,uDAAoD;AACpD,kDAA+C;AAE/C,IAAiB,yBAAyB,CAgSzC;AAhSD,WAAiB,yBAAyB;IAC3B,+BAAK,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,KAAK,CAAC,MAAM,CAAC,CAChD,EACD,2BAAiB,CAAC,WAAW,CAAC,oBAAU,CAAC,WAAW,CAAC,EACrD,2BAAiB,CAAC,gBAAgB,CAChC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAC7B,CACF,GAAA,CACN;SACF,CAAC,GAAG,CAAC,2BAAiB,CAAC,yBAAyB,CAAC,CAAC;QACnD,OAAO;YACL,2BAAiB,CAAC,uBAAuB,CACvC,EAAE,EACF,2BAAiB,CAAC,6BAA6B,CAC7C;gBACE,2BAAiB,CAAC,yBAAyB,CACzC,MAAM,EACN,SAAS,EACT,uCAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,EACrD,SAAS,CACV;aACF,EACD,mBAAS,CAAC,KAAK,CAChB,CACF;YACD,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS;gBAC1B,CAAC,CAAC;oBACE,2BAAiB,CAAC,iBAAiB,CACjC,2BAAiB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,EAC/D,SAAS,CAAC,MAAM,KAAK,CAAC;wBACpB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE;wBACf,CAAC,CAAC,2BAAiB,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,EAClD,SAAS,CACV;iBACF;gBACH,CAAC,CAAC,SAAS,CAAC;YACd,2BAAiB,CAAC,qBAAqB,CACrC,2BAAiB,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAC3C;SACF,CAAC;IACJ,CAAC,CAAC;AACN,CAAC,EAhSgB,yBAAyB,aAAzB,yBAAyB,GAAzB,yBAAyB,QAgSzC"}
1
+ {"version":3,"file":"SdkHttpFunctionProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkHttpFunctionProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAUuB;AAEvB,yEAA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+1,4 @@
1
- import { Node } from "@nestia/factory";
1
+ import { type Node } from "@ttsc/factory";
2
2
  import { INestiaProject } from "../../structures/INestiaProject";
3
3
  import { ITypedHttpRoute } from "../../structures/ITypedHttpRoute";
4
4
  import { ImportDictionary } from "./ImportDictionary";
@@ -1,20 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SdkHttpNamespaceProgrammer = void 0;
4
- const factory_1 = require("@nestia/factory");
5
- const factory_2 = require("@nestia/factory");
4
+ const factory_1 = require("@ttsc/factory");
6
5
  const utils_1 = require("@typia/utils");
6
+ const ExpressionFactory_1 = require("../../factories/ExpressionFactory");
7
+ const IdentifierFactory_1 = require("../../factories/IdentifierFactory");
8
+ const LiteralFactory_1 = require("../../factories/LiteralFactory");
9
+ const TypeFactory_1 = require("../../factories/TypeFactory");
10
+ const legacy_1 = require("../../internal/legacy");
7
11
  const FilePrinter_1 = require("./FilePrinter");
8
12
  const SdkAliasCollection_1 = require("./SdkAliasCollection");
9
13
  const SdkHttpParameterProgrammer_1 = require("./SdkHttpParameterProgrammer");
10
14
  const SdkHttpSimulationProgrammer_1 = require("./SdkHttpSimulationProgrammer");
11
15
  const SdkImportWizard_1 = require("./SdkImportWizard");
12
- const legacy_1 = require("../../internal/legacy");
13
16
  var SdkHttpNamespaceProgrammer;
14
17
  (function (SdkHttpNamespaceProgrammer) {
15
18
  SdkHttpNamespaceProgrammer.write = (project) => (importer) => (route) => {
16
19
  const types = writeTypes(project)(importer)(route);
17
- return factory_1.TypeScriptFactory.createModuleDeclaration([factory_1.TypeScriptFactory.createToken(factory_1.SyntaxKind.ExportKeyword)], factory_1.TypeScriptFactory.createIdentifier(route.name), factory_1.TypeScriptFactory.createModuleBlock([
20
+ return factory_1.factory.createModuleDeclaration([factory_1.factory.createToken(factory_1.SyntaxKind.ExportKeyword)], factory_1.factory.createIdentifier(route.name), factory_1.factory.createModuleBlock([
18
21
  ...types,
19
22
  ...(types.length ? [FilePrinter_1.FilePrinter.enter()] : []),
20
23
  writeMetadata(project)(importer)(route),
@@ -36,7 +39,7 @@ var SdkHttpNamespaceProgrammer;
36
39
  };
37
40
  const writeTypes = (project) => (importer) => (route) => {
38
41
  const array = [];
39
- const declare = (name, type) => array.push(factory_1.TypeScriptFactory.createTypeAliasDeclaration([factory_1.TypeScriptFactory.createModifier(factory_1.SyntaxKind.ExportKeyword)], name, undefined, type));
42
+ const declare = (name, type) => array.push(factory_1.factory.createTypeAliasDeclaration([factory_1.factory.createModifier(factory_1.SyntaxKind.ExportKeyword)], name, undefined, type));
40
43
  if (project.config.keyword === true &&
41
44
  SdkHttpParameterProgrammer_1.SdkHttpParameterProgrammer.getSignificant(route, true).length !== 0)
42
45
  declare("Props", SdkAliasCollection_1.SdkAliasCollection.httpProps(project)(importer)(route));
@@ -47,15 +50,16 @@ var SdkHttpNamespaceProgrammer;
47
50
  if (route.body)
48
51
  declare("Body", SdkAliasCollection_1.SdkAliasCollection.body(project)(importer)(route.body));
49
52
  if (project.config.propagate === true ||
53
+ route.success.binary === true ||
50
54
  (0, legacy_1.sizeOf)(route.success.metadata) !== 0)
51
55
  declare("Output", SdkAliasCollection_1.SdkAliasCollection.response(project)(importer)(route));
52
56
  return array;
53
57
  };
54
- const writeMetadata = (project) => (importer) => (route) => constant("METADATA")(factory_1.TypeScriptFactory.createAsExpression(factory_1.TypeScriptFactory.createObjectLiteralExpression([
55
- factory_1.TypeScriptFactory.createPropertyAssignment("method", factory_1.TypeScriptFactory.createStringLiteral(route.method)),
56
- factory_1.TypeScriptFactory.createPropertyAssignment("path", factory_1.TypeScriptFactory.createStringLiteral(route.path)),
57
- factory_1.TypeScriptFactory.createPropertyAssignment("request", route.body
58
- ? factory_2.LiteralFactory.write(route.body !== undefined
58
+ const writeMetadata = (project) => (importer) => (route) => constant("METADATA")(factory_1.factory.createAsExpression(factory_1.factory.createObjectLiteralExpression([
59
+ factory_1.factory.createPropertyAssignment("method", factory_1.factory.createStringLiteral(route.method)),
60
+ factory_1.factory.createPropertyAssignment("path", factory_1.factory.createStringLiteral(route.path)),
61
+ factory_1.factory.createPropertyAssignment("request", route.body
62
+ ? LiteralFactory_1.LiteralFactory.write(route.body !== undefined
59
63
  ? {
60
64
  type: route.body.contentType,
61
65
  encrypted: !!route.body.encrypted,
@@ -64,29 +68,29 @@ var SdkHttpNamespaceProgrammer;
64
68
  type: "application/json",
65
69
  encrypted: false,
66
70
  })
67
- : factory_1.TypeScriptFactory.createNull()),
68
- factory_1.TypeScriptFactory.createPropertyAssignment("response", route.method !== "HEAD"
69
- ? factory_2.LiteralFactory.write({
71
+ : factory_1.factory.createNull()),
72
+ factory_1.factory.createPropertyAssignment("response", route.method !== "HEAD"
73
+ ? LiteralFactory_1.LiteralFactory.write({
70
74
  type: route.success.contentType,
71
75
  encrypted: !!route.success.encrypted,
72
76
  })
73
- : factory_1.TypeScriptFactory.createNull()),
74
- factory_1.TypeScriptFactory.createPropertyAssignment("status", route.success.status !== null
75
- ? factory_2.ExpressionFactory.number(route.success.status)
76
- : factory_1.TypeScriptFactory.createNull()),
77
+ : factory_1.factory.createNull()),
78
+ factory_1.factory.createPropertyAssignment("status", route.success.status !== null
79
+ ? ExpressionFactory_1.ExpressionFactory.number(route.success.status)
80
+ : factory_1.factory.createNull()),
77
81
  ...(route.success.contentType ===
78
82
  "application/x-www-form-urlencoded"
79
83
  ? [
80
- factory_1.TypeScriptFactory.createPropertyAssignment("parseQuery", factory_1.TypeScriptFactory.createCallExpression(factory_1.TypeScriptFactory.createIdentifier(`${SdkImportWizard_1.SdkImportWizard.typia(importer)}.http.createAssertQuery`), [
81
- project.config.clone === true
84
+ factory_1.factory.createPropertyAssignment("parseQuery", factory_1.factory.createCallExpression(factory_1.factory.createIdentifier(`${SdkImportWizard_1.SdkImportWizard.typia(importer)}.http.createAssertQuery`), [
85
+ (project.config.clone === true
82
86
  ? SdkAliasCollection_1.SdkAliasCollection.from(project)(importer)(route.success.metadata)
83
- : SdkAliasCollection_1.SdkAliasCollection.name(route.success),
87
+ : SdkAliasCollection_1.SdkAliasCollection.name(route.success)),
84
88
  ], undefined)),
85
89
  ]
86
90
  : []),
87
- ], true), factory_1.TypeScriptFactory.createTypeReferenceNode(factory_1.TypeScriptFactory.createIdentifier("const"))));
91
+ ], true), factory_1.factory.createTypeReferenceNode(factory_1.factory.createIdentifier("const"))));
88
92
  const writePath = (project) => (importer) => (route) => {
89
- const out = (body) => constant("path")(factory_1.TypeScriptFactory.createArrowFunction([], [], SdkHttpParameterProgrammer_1.SdkHttpParameterProgrammer.getParameterDeclarations({
93
+ const out = (body) => constant("path")(factory_1.factory.createArrowFunction([], [], SdkHttpParameterProgrammer_1.SdkHttpParameterProgrammer.getParameterDeclarations({
90
94
  project,
91
95
  importer,
92
96
  route,
@@ -95,20 +99,20 @@ var SdkHttpNamespaceProgrammer;
95
99
  }), undefined, undefined, body));
96
100
  const parameters = SdkHttpParameterProgrammer_1.SdkHttpParameterProgrammer.getSignificant(route, false);
97
101
  if (parameters.length === 0)
98
- return out(factory_1.TypeScriptFactory.createStringLiteral(route.path));
102
+ return out(factory_1.factory.createStringLiteral(route.path));
99
103
  const access = (name) => project.config.keyword === true ? `props.${name}` : name;
100
104
  const template = () => {
101
105
  const split = route.path.split(":");
102
106
  if (split.length === 1)
103
- return factory_1.TypeScriptFactory.createStringLiteral(route.path);
104
- return factory_1.TypeScriptFactory.createTemplateExpression(factory_1.TypeScriptFactory.createTemplateHead(split[0]), split.slice(1).map((s, i, arr) => {
107
+ return factory_1.factory.createStringLiteral(route.path);
108
+ return factory_1.factory.createTemplateExpression(factory_1.factory.createTemplateHead(split[0]), split.slice(1).map((s, i, arr) => {
105
109
  const name = s.split("/")[0];
106
- return factory_1.TypeScriptFactory.createTemplateSpan(factory_1.TypeScriptFactory.createCallExpression(factory_1.TypeScriptFactory.createIdentifier("encodeURIComponent"), undefined, [
107
- factory_1.TypeScriptFactory.createBinaryExpression(factory_1.TypeScriptFactory.createCallChain(factory_1.TypeScriptFactory.createPropertyAccessChain(factory_1.TypeScriptFactory.createIdentifier(access(route.pathParameters.find((p) => p.field === name)
108
- .name)), factory_1.TypeScriptFactory.createToken(factory_1.SyntaxKind.QuestionDotToken), "toString"), undefined, undefined, []), factory_1.TypeScriptFactory.createToken(factory_1.SyntaxKind.QuestionQuestionToken), factory_1.TypeScriptFactory.createStringLiteral("null")),
110
+ return factory_1.factory.createTemplateSpan(factory_1.factory.createCallExpression(factory_1.factory.createIdentifier("encodeURIComponent"), undefined, [
111
+ factory_1.factory.createBinaryExpression(factory_1.factory.createCallChain(factory_1.factory.createPropertyAccessChain(factory_1.factory.createIdentifier(access(route.pathParameters.find((p) => p.field === name)
112
+ .name)), factory_1.factory.createToken(factory_1.SyntaxKind.QuestionDotToken), "toString"), undefined, undefined, []), factory_1.factory.createToken(factory_1.SyntaxKind.QuestionQuestionToken), factory_1.factory.createStringLiteral("null")),
109
113
  ]), (i !== arr.length - 1
110
- ? factory_1.TypeScriptFactory.createTemplateMiddle
111
- : factory_1.TypeScriptFactory.createTemplateTail)(s.substring(name.length)));
114
+ ? factory_1.factory.createTemplateMiddle
115
+ : factory_1.factory.createTemplateTail)(s.substring(name.length)));
112
116
  }));
113
117
  };
114
118
  if (route.queryObject === null && route.queryParameters.length === 0)
@@ -118,54 +122,52 @@ var SdkHttpNamespaceProgrammer;
118
122
  ? computeName("_" + str)
119
123
  : str;
120
124
  const variables = computeName("variables");
121
- return factory_1.TypeScriptFactory.createBlock([
122
- local(variables)("URLSearchParams")(factory_1.TypeScriptFactory.createNewExpression(factory_1.TypeScriptFactory.createIdentifier("URLSearchParams"), [], [])),
123
- factory_1.TypeScriptFactory.createForOfStatement(undefined, factory_1.TypeScriptFactory.createVariableDeclarationList([
124
- factory_1.TypeScriptFactory.createVariableDeclaration(factory_1.TypeScriptFactory.createArrayBindingPattern([
125
- factory_1.TypeScriptFactory.createBindingElement(undefined, undefined, factory_1.TypeScriptFactory.createIdentifier("key"), undefined),
126
- factory_1.TypeScriptFactory.createBindingElement(undefined, undefined, factory_1.TypeScriptFactory.createIdentifier("value"), undefined),
125
+ return factory_1.factory.createBlock([
126
+ local(variables)("URLSearchParams")(factory_1.factory.createNewExpression(factory_1.factory.createIdentifier("URLSearchParams"), [], [])),
127
+ factory_1.factory.createForOfStatement(undefined, factory_1.factory.createVariableDeclarationList([
128
+ factory_1.factory.createVariableDeclaration(factory_1.factory.createArrayBindingPattern([
129
+ factory_1.factory.createBindingElement(undefined, undefined, factory_1.factory.createIdentifier("key"), undefined),
130
+ factory_1.factory.createBindingElement(undefined, undefined, factory_1.factory.createIdentifier("value"), undefined),
127
131
  ]), undefined, undefined, undefined),
128
- ], factory_1.NodeFlags.Const), factory_1.TypeScriptFactory.createCallExpression(factory_1.TypeScriptFactory.createIdentifier("Object.entries"), undefined, [
129
- factory_1.TypeScriptFactory.createAsExpression(expr, factory_2.TypeFactory.keyword("any")),
130
- ]), factory_1.TypeScriptFactory.createIfStatement(factory_1.TypeScriptFactory.createStrictEquality(factory_1.TypeScriptFactory.createIdentifier("undefined"), factory_1.TypeScriptFactory.createIdentifier("value")), factory_1.TypeScriptFactory.createContinueStatement(), factory_1.TypeScriptFactory.createIfStatement(factory_1.TypeScriptFactory.createCallExpression(factory_1.TypeScriptFactory.createIdentifier("Array.isArray"), undefined, [factory_1.TypeScriptFactory.createIdentifier("value")]), factory_1.TypeScriptFactory.createExpressionStatement(factory_1.TypeScriptFactory.createCallExpression(factory_1.TypeScriptFactory.createPropertyAccessExpression(factory_1.TypeScriptFactory.createIdentifier("value"), factory_1.TypeScriptFactory.createIdentifier("forEach")), undefined, [
131
- factory_1.TypeScriptFactory.createArrowFunction(undefined, undefined, [factory_2.IdentifierFactory.parameter("elem")], undefined, undefined, factory_1.TypeScriptFactory.createCallExpression(factory_2.IdentifierFactory.access(factory_1.TypeScriptFactory.createIdentifier(variables), "append"), undefined, [
132
- factory_1.TypeScriptFactory.createIdentifier("key"),
133
- factory_1.TypeScriptFactory.createCallExpression(factory_1.TypeScriptFactory.createIdentifier("String"), undefined, [factory_1.TypeScriptFactory.createIdentifier("elem")]),
132
+ ], factory_1.NodeFlags.Const), factory_1.factory.createCallExpression(factory_1.factory.createIdentifier("Object.entries"), undefined, [factory_1.factory.createAsExpression(expr, TypeFactory_1.TypeFactory.keyword("any"))]), factory_1.factory.createIfStatement(factory_1.factory.createStrictEquality(factory_1.factory.createIdentifier("undefined"), factory_1.factory.createIdentifier("value")), factory_1.factory.createContinueStatement(), factory_1.factory.createIfStatement(factory_1.factory.createCallExpression(factory_1.factory.createIdentifier("Array.isArray"), undefined, [factory_1.factory.createIdentifier("value")]), factory_1.factory.createExpressionStatement(factory_1.factory.createCallExpression(factory_1.factory.createPropertyAccessExpression(factory_1.factory.createIdentifier("value"), factory_1.factory.createIdentifier("forEach")), undefined, [
133
+ factory_1.factory.createArrowFunction(undefined, undefined, [IdentifierFactory_1.IdentifierFactory.parameter("elem")], undefined, undefined, factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(variables), "append"), undefined, [
134
+ factory_1.factory.createIdentifier("key"),
135
+ factory_1.factory.createCallExpression(factory_1.factory.createIdentifier("String"), undefined, [factory_1.factory.createIdentifier("elem")]),
134
136
  ])),
135
- ])), factory_1.TypeScriptFactory.createExpressionStatement(factory_1.TypeScriptFactory.createCallExpression(factory_2.IdentifierFactory.access(factory_1.TypeScriptFactory.createIdentifier(variables), "set"), undefined, [
136
- factory_1.TypeScriptFactory.createIdentifier("key"),
137
- factory_1.TypeScriptFactory.createCallExpression(factory_1.TypeScriptFactory.createIdentifier("String"), undefined, [factory_1.TypeScriptFactory.createIdentifier("value")]),
137
+ ])), factory_1.factory.createExpressionStatement(factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(variables), "set"), undefined, [
138
+ factory_1.factory.createIdentifier("key"),
139
+ factory_1.factory.createCallExpression(factory_1.factory.createIdentifier("String"), undefined, [factory_1.factory.createIdentifier("value")]),
138
140
  ]))))),
139
141
  local("location")("string")(template()),
140
- factory_1.TypeScriptFactory.createReturnStatement(factory_1.TypeScriptFactory.createConditionalExpression(factory_1.TypeScriptFactory.createStrictEquality(factory_2.ExpressionFactory.number(0), factory_2.IdentifierFactory.access(factory_1.TypeScriptFactory.createIdentifier(variables), "size")), undefined, factory_1.TypeScriptFactory.createIdentifier("location"), undefined, factory_1.TypeScriptFactory.createTemplateExpression(factory_1.TypeScriptFactory.createTemplateHead(""), [
141
- factory_1.TypeScriptFactory.createTemplateSpan(factory_1.TypeScriptFactory.createIdentifier("location"), factory_1.TypeScriptFactory.createTemplateMiddle("?")),
142
- factory_1.TypeScriptFactory.createTemplateSpan(factory_1.TypeScriptFactory.createCallExpression(factory_2.IdentifierFactory.access(factory_1.TypeScriptFactory.createIdentifier(variables), "toString"), undefined, undefined), factory_1.TypeScriptFactory.createTemplateTail("")),
142
+ factory_1.factory.createReturnStatement(factory_1.factory.createConditionalExpression(factory_1.factory.createStrictEquality(ExpressionFactory_1.ExpressionFactory.number(0), IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(variables), "size")), undefined, factory_1.factory.createIdentifier("location"), undefined, factory_1.factory.createTemplateExpression(factory_1.factory.createTemplateHead(""), [
143
+ factory_1.factory.createTemplateSpan(factory_1.factory.createIdentifier("location"), factory_1.factory.createTemplateMiddle("?")),
144
+ factory_1.factory.createTemplateSpan(factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(variables), "toString"), undefined, undefined), factory_1.factory.createTemplateTail("")),
143
145
  ]))),
144
146
  ], true);
145
147
  };
146
148
  if (route.queryObject !== null && route.queryParameters.length === 0)
147
149
  return out(block(route.queryObject.metadata.required === false
148
- ? factory_1.TypeScriptFactory.createBinaryExpression(factory_1.TypeScriptFactory.createIdentifier(route.queryObject.name), factory_1.TypeScriptFactory.createToken(factory_1.SyntaxKind.QuestionQuestionToken), factory_1.TypeScriptFactory.createObjectLiteralExpression([], false))
149
- : factory_1.TypeScriptFactory.createIdentifier(access(route.queryObject.name))));
150
- return out(block(factory_1.TypeScriptFactory.createObjectLiteralExpression([
150
+ ? factory_1.factory.createBinaryExpression(factory_1.factory.createIdentifier(route.queryObject.name), factory_1.factory.createToken(factory_1.SyntaxKind.QuestionQuestionToken), factory_1.factory.createObjectLiteralExpression([], false))
151
+ : factory_1.factory.createIdentifier(access(route.queryObject.name))));
152
+ return out(block(factory_1.factory.createObjectLiteralExpression([
151
153
  ...(route.queryObject
152
154
  ? [
153
- factory_1.TypeScriptFactory.createSpreadAssignment(factory_1.TypeScriptFactory.createIdentifier(access(route.queryObject.name))),
155
+ factory_1.factory.createSpreadAssignment(factory_1.factory.createIdentifier(access(route.queryObject.name))),
154
156
  ]
155
157
  : []),
156
- ...route.queryParameters.map((q) => factory_1.TypeScriptFactory.createPropertyAssignment(utils_1.NamingConvention.variable(q.field)
158
+ ...route.queryParameters.map((q) => factory_1.factory.createPropertyAssignment(utils_1.NamingConvention.variable(q.field)
157
159
  ? q.field
158
- : factory_1.TypeScriptFactory.createStringLiteral(q.field), factory_1.TypeScriptFactory.createIdentifier(access(q.name)))),
160
+ : factory_1.factory.createStringLiteral(q.field), factory_1.factory.createIdentifier(access(q.name)))),
159
161
  ], true)));
160
162
  };
161
- const writeStringify = (project) => (importer) => constant("stringify")(factory_1.TypeScriptFactory.createArrowFunction([], undefined, [
162
- factory_2.IdentifierFactory.parameter("input", factory_1.TypeScriptFactory.createTypeReferenceNode("Body")),
163
- ], undefined, undefined, factory_1.TypeScriptFactory.createCallExpression(factory_2.IdentifierFactory.access(factory_2.IdentifierFactory.access(factory_1.TypeScriptFactory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "json"), project.config.assert ? "stringify" : "assertStringify"), undefined, [factory_1.TypeScriptFactory.createIdentifier("input")])));
163
+ const writeStringify = (project) => (importer) => constant("stringify")(factory_1.factory.createArrowFunction([], undefined, [
164
+ IdentifierFactory_1.IdentifierFactory.parameter("input", factory_1.factory.createTypeReferenceNode("Body")),
165
+ ], undefined, undefined, factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "json"), project.config.assert ? "stringify" : "assertStringify"), undefined, [factory_1.factory.createIdentifier("input")])));
164
166
  })(SdkHttpNamespaceProgrammer || (exports.SdkHttpNamespaceProgrammer = SdkHttpNamespaceProgrammer = {}));
165
- const local = (name) => (type) => (expression) => factory_1.TypeScriptFactory.createVariableStatement([], factory_1.TypeScriptFactory.createVariableDeclarationList([
166
- factory_1.TypeScriptFactory.createVariableDeclaration(name, undefined, factory_1.TypeScriptFactory.createTypeReferenceNode(type), expression),
167
+ const local = (name) => (type) => (expression) => factory_1.factory.createVariableStatement([], factory_1.factory.createVariableDeclarationList([
168
+ factory_1.factory.createVariableDeclaration(name, undefined, factory_1.factory.createTypeReferenceNode(type), expression),
167
169
  ], factory_1.NodeFlags.Const));
168
- const constant = (name) => (expression) => factory_1.TypeScriptFactory.createVariableStatement([factory_1.TypeScriptFactory.createModifier(factory_1.SyntaxKind.ExportKeyword)], factory_1.TypeScriptFactory.createVariableDeclarationList([
169
- factory_1.TypeScriptFactory.createVariableDeclaration(name, undefined, undefined, expression),
170
+ const constant = (name) => (expression) => factory_1.factory.createVariableStatement([factory_1.factory.createModifier(factory_1.SyntaxKind.ExportKeyword)], factory_1.factory.createVariableDeclarationList([
171
+ factory_1.factory.createVariableDeclaration(name, undefined, undefined, expression),
170
172
  ], factory_1.NodeFlags.Const));
171
173
  //# sourceMappingURL=SdkHttpNamespaceProgrammer.js.map