@nestia/migrate 14.0.0 → 14.0.2

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 (182) hide show
  1. package/README.md +1 -1
  2. package/lib/NestiaMigrateApplication.d.ts +111 -0
  3. package/lib/NestiaMigrateApplication.js +148 -9
  4. package/lib/NestiaMigrateApplication.js.map +1 -1
  5. package/lib/NestiaMigrateApplication.mjs +147 -5
  6. package/lib/analyzers/NestiaMigrateControllerAnalyzer.d.ts +58 -0
  7. package/lib/analyzers/NestiaMigrateControllerAnalyzer.js +88 -2
  8. package/lib/analyzers/NestiaMigrateControllerAnalyzer.js.map +1 -1
  9. package/lib/analyzers/NestiaMigrateControllerAnalyzer.mjs +20 -2
  10. package/lib/archivers/NestiaMigrateFileArchiver.d.ts +34 -0
  11. package/lib/archivers/NestiaMigrateFileArchiver.js +34 -0
  12. package/lib/archivers/NestiaMigrateFileArchiver.js.map +1 -1
  13. package/lib/bundles/NEST_TEMPLATE.js +1 -1
  14. package/lib/bundles/NEST_TEMPLATE.js.map +1 -1
  15. package/lib/bundles/NEST_TEMPLATE.mjs +1 -1
  16. package/lib/bundles/SDK_TEMPLATE.js +1 -1
  17. package/lib/bundles/SDK_TEMPLATE.js.map +1 -1
  18. package/lib/bundles/SDK_TEMPLATE.mjs +1 -1
  19. package/lib/executable/NestiaMigrateCommander.d.ts +36 -0
  20. package/lib/executable/NestiaMigrateCommander.js +43 -1
  21. package/lib/executable/NestiaMigrateCommander.js.map +1 -1
  22. package/lib/executable/NestiaMigrateCommander.mjs +4 -2
  23. package/lib/executable/NestiaMigrateInquirer.d.ts +29 -0
  24. package/lib/executable/NestiaMigrateInquirer.js +27 -25
  25. package/lib/executable/NestiaMigrateInquirer.js.map +1 -1
  26. package/lib/executable/NestiaMigrateInquirer.mjs +5 -7
  27. package/lib/factories/ExpressionFactory.d.ts +14 -0
  28. package/lib/factories/ExpressionFactory.js +14 -0
  29. package/lib/factories/ExpressionFactory.js.map +1 -1
  30. package/lib/factories/IdentifierFactory.d.ts +20 -0
  31. package/lib/factories/IdentifierFactory.js +20 -0
  32. package/lib/factories/IdentifierFactory.js.map +1 -1
  33. package/lib/factories/LiteralFactory.d.ts +18 -2
  34. package/lib/factories/LiteralFactory.js +18 -2
  35. package/lib/factories/LiteralFactory.js.map +1 -1
  36. package/lib/factories/StatementFactory.d.ts +26 -1
  37. package/lib/factories/StatementFactory.js +26 -1
  38. package/lib/factories/StatementFactory.js.map +1 -1
  39. package/lib/factories/SupportedStringFormats.d.ts +6 -0
  40. package/lib/factories/SupportedStringFormats.js +33 -0
  41. package/lib/factories/SupportedStringFormats.js.map +1 -0
  42. package/lib/factories/SupportedStringFormats.mjs +34 -0
  43. package/lib/factories/SupportedStringFormats.mjs.map +1 -0
  44. package/lib/factories/TypeFactory.d.ts +21 -0
  45. package/lib/factories/TypeFactory.js +13 -0
  46. package/lib/factories/TypeFactory.js.map +1 -1
  47. package/lib/factories/TypeLiteralFactory.d.ts +18 -0
  48. package/lib/factories/TypeLiteralFactory.js +18 -0
  49. package/lib/factories/TypeLiteralFactory.js.map +1 -1
  50. package/lib/internal/ts.d.ts +153 -0
  51. package/lib/internal/ts.js.map +1 -1
  52. package/lib/programmers/NestiaMigrateApiFileProgrammer.d.ts +31 -0
  53. package/lib/programmers/NestiaMigrateApiFileProgrammer.js +17 -0
  54. package/lib/programmers/NestiaMigrateApiFileProgrammer.js.map +1 -1
  55. package/lib/programmers/NestiaMigrateApiFunctionProgrammer.d.ts +40 -0
  56. package/lib/programmers/NestiaMigrateApiFunctionProgrammer.js +34 -5
  57. package/lib/programmers/NestiaMigrateApiFunctionProgrammer.js.map +1 -1
  58. package/lib/programmers/NestiaMigrateApiFunctionProgrammer.mjs +4 -2
  59. package/lib/programmers/NestiaMigrateApiNamespaceProgrammer.d.ts +39 -0
  60. package/lib/programmers/NestiaMigrateApiNamespaceProgrammer.js +57 -13
  61. package/lib/programmers/NestiaMigrateApiNamespaceProgrammer.js.map +1 -1
  62. package/lib/programmers/NestiaMigrateApiNamespaceProgrammer.mjs +17 -8
  63. package/lib/programmers/NestiaMigrateApiProgrammer.d.ts +18 -0
  64. package/lib/programmers/NestiaMigrateApiProgrammer.js +18 -0
  65. package/lib/programmers/NestiaMigrateApiProgrammer.js.map +1 -1
  66. package/lib/programmers/NestiaMigrateApiProgrammer.mjs +1 -1
  67. package/lib/programmers/NestiaMigrateApiSimulationProgrammer.d.ts +40 -0
  68. package/lib/programmers/NestiaMigrateApiSimulationProgrammer.js +51 -22
  69. package/lib/programmers/NestiaMigrateApiSimulationProgrammer.js.map +1 -1
  70. package/lib/programmers/NestiaMigrateApiSimulationProgrammer.mjs +13 -20
  71. package/lib/programmers/NestiaMigrateApiStartProgrammer.d.ts +17 -0
  72. package/lib/programmers/NestiaMigrateApiStartProgrammer.js +19 -8
  73. package/lib/programmers/NestiaMigrateApiStartProgrammer.js.map +1 -1
  74. package/lib/programmers/NestiaMigrateApiStartProgrammer.mjs +1 -6
  75. package/lib/programmers/NestiaMigrateDtoProgrammer.d.ts +30 -0
  76. package/lib/programmers/NestiaMigrateDtoProgrammer.js +17 -0
  77. package/lib/programmers/NestiaMigrateDtoProgrammer.js.map +1 -1
  78. package/lib/programmers/NestiaMigrateE2eFileProgrammer.d.ts +39 -0
  79. package/lib/programmers/NestiaMigrateE2eFileProgrammer.js +46 -5
  80. package/lib/programmers/NestiaMigrateE2eFileProgrammer.js.map +1 -1
  81. package/lib/programmers/NestiaMigrateE2eFileProgrammer.mjs +6 -2
  82. package/lib/programmers/NestiaMigrateE2eProgrammer.d.ts +16 -0
  83. package/lib/programmers/NestiaMigrateE2eProgrammer.js +16 -0
  84. package/lib/programmers/NestiaMigrateE2eProgrammer.js.map +1 -1
  85. package/lib/programmers/NestiaMigrateImportProgrammer.d.ts +75 -0
  86. package/lib/programmers/NestiaMigrateImportProgrammer.js +58 -3
  87. package/lib/programmers/NestiaMigrateImportProgrammer.js.map +1 -1
  88. package/lib/programmers/NestiaMigrateImportProgrammer.mjs +58 -3
  89. package/lib/programmers/NestiaMigrateNestControllerProgrammer.d.ts +28 -0
  90. package/lib/programmers/NestiaMigrateNestControllerProgrammer.js +16 -0
  91. package/lib/programmers/NestiaMigrateNestControllerProgrammer.js.map +1 -1
  92. package/lib/programmers/NestiaMigrateNestMethodProgrammer.d.ts +30 -0
  93. package/lib/programmers/NestiaMigrateNestMethodProgrammer.js +85 -13
  94. package/lib/programmers/NestiaMigrateNestMethodProgrammer.js.map +1 -1
  95. package/lib/programmers/NestiaMigrateNestMethodProgrammer.mjs +46 -9
  96. package/lib/programmers/NestiaMigrateNestModuleProgrammer.d.ts +16 -0
  97. package/lib/programmers/NestiaMigrateNestModuleProgrammer.js +16 -0
  98. package/lib/programmers/NestiaMigrateNestModuleProgrammer.js.map +1 -1
  99. package/lib/programmers/NestiaMigrateNestProgrammer.d.ts +17 -0
  100. package/lib/programmers/NestiaMigrateNestProgrammer.js +17 -0
  101. package/lib/programmers/NestiaMigrateNestProgrammer.js.map +1 -1
  102. package/lib/programmers/NestiaMigrateSchemaProgrammer.d.ts +16 -0
  103. package/lib/programmers/NestiaMigrateSchemaProgrammer.js +45 -9
  104. package/lib/programmers/NestiaMigrateSchemaProgrammer.js.map +1 -1
  105. package/lib/programmers/NestiaMigrateSchemaProgrammer.mjs +19 -8
  106. package/lib/structures/INestiaMigrateConfig.d.ts +21 -0
  107. package/lib/structures/INestiaMigrateContext.d.ts +15 -0
  108. package/lib/structures/INestiaMigrateController.d.ts +13 -0
  109. package/lib/structures/INestiaMigrateFile.d.ts +11 -0
  110. package/lib/utils/FilePrinter.d.ts +33 -0
  111. package/lib/utils/FilePrinter.js +33 -0
  112. package/lib/utils/FilePrinter.js.map +1 -1
  113. package/lib/utils/MapUtil.d.ts +17 -0
  114. package/lib/utils/MapUtil.js +19 -3
  115. package/lib/utils/MapUtil.js.map +1 -1
  116. package/lib/utils/MapUtil.mjs +1 -2
  117. package/lib/utils/PathTemplate.d.ts +41 -0
  118. package/lib/utils/PathTemplate.js +56 -0
  119. package/lib/utils/PathTemplate.js.map +1 -0
  120. package/lib/utils/PathTemplate.mjs +34 -0
  121. package/lib/utils/PathTemplate.mjs.map +1 -0
  122. package/lib/utils/RequestBody.d.ts +22 -0
  123. package/lib/utils/RequestBody.js +29 -0
  124. package/lib/utils/RequestBody.js.map +1 -0
  125. package/lib/utils/RequestBody.mjs +9 -0
  126. package/lib/utils/RequestBody.mjs.map +1 -0
  127. package/lib/utils/StringUtil.d.ts +55 -0
  128. package/lib/utils/StringUtil.js +93 -8
  129. package/lib/utils/StringUtil.js.map +1 -1
  130. package/lib/utils/StringUtil.mjs +30 -8
  131. package/lib/utils/SuccessStatus.d.ts +34 -0
  132. package/lib/utils/SuccessStatus.js +48 -0
  133. package/lib/utils/SuccessStatus.js.map +1 -0
  134. package/lib/utils/SuccessStatus.mjs +14 -0
  135. package/lib/utils/SuccessStatus.mjs.map +1 -0
  136. package/package.json +5 -4
  137. package/src/NestiaMigrateApplication.ts +151 -13
  138. package/src/analyzers/NestiaMigrateControllerAnalyzer.ts +94 -2
  139. package/src/archivers/NestiaMigrateFileArchiver.ts +34 -0
  140. package/src/bundles/NEST_TEMPLATE.ts +1 -1
  141. package/src/bundles/SDK_TEMPLATE.ts +1 -1
  142. package/src/executable/NestiaMigrateCommander.ts +47 -1
  143. package/src/executable/NestiaMigrateInquirer.ts +41 -26
  144. package/src/factories/ExpressionFactory.ts +14 -0
  145. package/src/factories/IdentifierFactory.ts +20 -0
  146. package/src/factories/LiteralFactory.ts +18 -2
  147. package/src/factories/StatementFactory.ts +26 -1
  148. package/src/factories/SupportedStringFormats.ts +29 -0
  149. package/src/factories/TypeFactory.ts +21 -0
  150. package/src/factories/TypeLiteralFactory.ts +18 -0
  151. package/src/internal/ts.ts +153 -0
  152. package/src/programmers/NestiaMigrateApiFileProgrammer.ts +35 -0
  153. package/src/programmers/NestiaMigrateApiFunctionProgrammer.ts +53 -4
  154. package/src/programmers/NestiaMigrateApiNamespaceProgrammer.ts +83 -20
  155. package/src/programmers/NestiaMigrateApiProgrammer.ts +18 -0
  156. package/src/programmers/NestiaMigrateApiSimulationProgrammer.ts +66 -73
  157. package/src/programmers/NestiaMigrateApiStartProgrammer.ts +19 -10
  158. package/src/programmers/NestiaMigrateDtoProgrammer.ts +33 -0
  159. package/src/programmers/NestiaMigrateE2eFileProgrammer.ts +83 -8
  160. package/src/programmers/NestiaMigrateE2eProgrammer.ts +16 -0
  161. package/src/programmers/NestiaMigrateImportProgrammer.ts +86 -5
  162. package/src/programmers/NestiaMigrateNestControllerProgrammer.ts +30 -0
  163. package/src/programmers/NestiaMigrateNestMethodProgrammer.ts +122 -29
  164. package/src/programmers/NestiaMigrateNestModuleProgrammer.ts +16 -0
  165. package/src/programmers/NestiaMigrateNestProgrammer.ts +17 -0
  166. package/src/programmers/NestiaMigrateSchemaProgrammer.ts +53 -18
  167. package/src/structures/INestiaMigrateConfig.ts +26 -0
  168. package/src/structures/INestiaMigrateContext.ts +17 -0
  169. package/src/structures/INestiaMigrateController.ts +16 -0
  170. package/src/structures/INestiaMigrateFile.ts +13 -0
  171. package/src/utils/FilePrinter.ts +33 -0
  172. package/src/utils/MapUtil.ts +18 -2
  173. package/src/utils/PathTemplate.ts +61 -0
  174. package/src/utils/RequestBody.ts +27 -0
  175. package/src/utils/StringUtil.ts +101 -9
  176. package/src/utils/SuccessStatus.ts +49 -0
  177. package/lib/factories/FormatCheatSheet.d.ts +0 -25
  178. package/lib/factories/FormatCheatSheet.js +0 -34
  179. package/lib/factories/FormatCheatSheet.js.map +0 -1
  180. package/lib/factories/FormatCheatSheet.mjs +0 -31
  181. package/lib/factories/FormatCheatSheet.mjs.map +0 -1
  182. package/src/factories/FormatCheatSheet.ts +0 -71
@@ -3,8 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TypeLiteralFactory = void 0;
4
4
  const factory_1 = require("@ttsc/factory");
5
5
  const utils_1 = require("@typia/utils");
6
+ /**
7
+ * Builds type nodes from JavaScript values, so a value can be written as a
8
+ * literal type.
9
+ *
10
+ * @evidence contracts/common.md#principled-implementation The namespace maps booleans, numbers, strings, null, arrays as tuples, and objects as type literals, and anything else to `any`.
11
+ * @evidence contracts/common.md#clear-and-simple-design One entry function and small private builders per kind.
12
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The mapping is by type, with no value special-cased.
13
+ * @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
14
+ */
6
15
  var TypeLiteralFactory;
7
16
  (function (TypeLiteralFactory) {
17
+ /**
18
+ * Builds the literal type of a value: a literal for a primitive, a tuple for
19
+ * an array, a type literal for an object, and `any` for other values.
20
+ *
21
+ * @evidence contracts/common.md#principled-implementation The value is dispatched by type, negative numbers use a prefix minus as expressions do, and object keys that are not identifiers are quoted.
22
+ * @evidence contracts/common.md#clear-and-simple-design One function with one branch per kind.
23
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The dispatch is general.
24
+ * @evidence contracts/common.md#meaningful-documentation The comment lists the mapping.
25
+ */
8
26
  TypeLiteralFactory.generate = (value) => typeof value === "boolean"
9
27
  ? generateBoolean(value)
10
28
  : typeof value === "number"
@@ -1 +1 @@
1
- {"version":3,"file":"TypeLiteralFactory.js","sourceRoot":"","sources":["../../src/factories/TypeLiteralFactory.ts"],"names":[],"mappings":";;;AAAA,2CAAoD;AACpD,wCAAgD;AAIhD,IAAiB,kBAAkB,CAqDlC;AArDD,WAAiB,kBAAkB;IACpB,2BAAQ,GAAG,CAAC,KAAU,EAAe,EAAE,CAClD,OAAO,KAAK,KAAK,SAAS;QACxB,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC;QACxB,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ;YACzB,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC;YACvB,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ;gBACzB,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC;gBACvB,CAAC,CAAC,OAAO,KAAK,K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CAAC;QAC/B,CAAC,CAAC,iBAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,EACpC,SAAS,EACT,2BAAQ,CAAC,KAAK,CAAC,CAChB,CACF,CACF,CAAC;AACN,CAAC,EA9DgB,kBAAkB,aAAlB,kBAAkB,GAAlB,kBAAkB,QA8DlC"}
@@ -20,24 +20,177 @@ type _TypeNode = TypeNode;
20
20
  type _TypeReferenceNode = TypeReferenceNode;
21
21
  type _UnionTypeNode = UnionTypeNode;
22
22
  type _VariableStatement = VariableStatement;
23
+ /**
24
+ * A compatibility stand-in for `import ts from "typescript"`: the one value the
25
+ * generators still call, and the node types under the names they use.
26
+ *
27
+ * @evidence contracts/common.md#principled-implementation The value is the union-type guard, and the namespace aliases map each used compiler type name to the matching node type of the factory package, so existing annotations keep their exact shapes.
28
+ * @evidence contracts/common.md#clear-and-simple-design One value and one declaration-only namespace of aliases.
29
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It avoids loading the compiler; the guard is implemented on the node kind, not on a patched compiler.
30
+ * @evidence contracts/common.md#meaningful-documentation The leading comment explains why the shim exists.
31
+ */
23
32
  declare namespace ts {
33
+ /**
34
+ * The `Node` node type under the name the generators use.
35
+ *
36
+ * @evidence contracts/common.md#principled-implementation The alias names the `Node` node type of the factory package.
37
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
38
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
39
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
40
+ */
24
41
  type Node = _Node;
42
+ /**
43
+ * The `Block` node type under the name the generators use.
44
+ *
45
+ * @evidence contracts/common.md#principled-implementation The alias names the `Block` node type of the factory package.
46
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
47
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
48
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
49
+ */
25
50
  type Block = _Block;
51
+ /**
52
+ * The `CallExpression` node type under the name the generators use.
53
+ *
54
+ * @evidence contracts/common.md#principled-implementation The alias names the `CallExpression` node type of the factory package.
55
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
56
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
57
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
58
+ */
26
59
  type CallExpression = _CallExpression;
60
+ /**
61
+ * The `ConciseBody` node type under the name the generators use.
62
+ *
63
+ * @evidence contracts/common.md#principled-implementation A concise body is a block or an expression, the same union the compiler defines.
64
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
65
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
66
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
67
+ */
27
68
  type ConciseBody = _Block | _Expression;
69
+ /**
70
+ * The `Decorator` node type under the name the generators use.
71
+ *
72
+ * @evidence contracts/common.md#principled-implementation The alias names the `Decorator` node type of the factory package.
73
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
74
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
75
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
76
+ */
28
77
  type Decorator = _Decorator;
78
+ /**
79
+ * The `Expression` node type under the name the generators use.
80
+ *
81
+ * @evidence contracts/common.md#principled-implementation The alias names the `Expression` node type of the factory package.
82
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
83
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
84
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
85
+ */
29
86
  type Expression = _Expression;
87
+ /**
88
+ * The `FunctionDeclaration` node type under the name the generators use.
89
+ *
90
+ * @evidence contracts/common.md#principled-implementation The alias names the `FunctionDeclaration` node type of the factory package.
91
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
92
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
93
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
94
+ */
30
95
  type FunctionDeclaration = _FunctionDeclaration;
96
+ /**
97
+ * The `Identifier` node type under the name the generators use.
98
+ *
99
+ * @evidence contracts/common.md#principled-implementation The alias names the `Identifier` node type of the factory package.
100
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
101
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
102
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
103
+ */
31
104
  type Identifier = _Identifier;
105
+ /**
106
+ * The `KeywordTypeNode` node type under the name the generators use.
107
+ *
108
+ * @evidence contracts/common.md#principled-implementation The alias names the `KeywordTypeNode` node type of the factory package.
109
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
110
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
111
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
112
+ */
32
113
  type KeywordTypeNode = _KeywordTypeNode;
114
+ /**
115
+ * The `MethodDeclaration` node type under the name the generators use.
116
+ *
117
+ * @evidence contracts/common.md#principled-implementation The alias names the `MethodDeclaration` node type of the factory package.
118
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
119
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
120
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
121
+ */
33
122
  type MethodDeclaration = _MethodDeclaration;
123
+ /**
124
+ * The `ModuleDeclaration` node type under the name the generators use.
125
+ *
126
+ * @evidence contracts/common.md#principled-implementation The alias names the `ModuleDeclaration` node type of the factory package.
127
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
128
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
129
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
130
+ */
34
131
  type ModuleDeclaration = _ModuleDeclaration;
132
+ /**
133
+ * The `ParameterDeclaration` node type under the name the generators use.
134
+ *
135
+ * @evidence contracts/common.md#principled-implementation The alias names the `ParameterDeclaration` node type of the factory package.
136
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
137
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
138
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
139
+ */
35
140
  type ParameterDeclaration = _ParameterDeclaration;
141
+ /**
142
+ * The `Statement` node type under the name the generators use.
143
+ *
144
+ * @evidence contracts/common.md#principled-implementation The alias names the `Statement` node type of the factory package.
145
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
146
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
147
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
148
+ */
36
149
  type Statement = _Statement;
150
+ /**
151
+ * The `TypeAliasDeclaration` node type under the name the generators use.
152
+ *
153
+ * @evidence contracts/common.md#principled-implementation The alias names the `TypeAliasDeclaration` node type of the factory package.
154
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
155
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
156
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
157
+ */
37
158
  type TypeAliasDeclaration = _TypeAliasDeclaration;
159
+ /**
160
+ * The `TypeNode` node type under the name the generators use.
161
+ *
162
+ * @evidence contracts/common.md#principled-implementation The alias names the `TypeNode` node type of the factory package.
163
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
164
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
165
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
166
+ */
38
167
  type TypeNode = _TypeNode;
168
+ /**
169
+ * The `TypeReferenceNode` node type under the name the generators use.
170
+ *
171
+ * @evidence contracts/common.md#principled-implementation The alias names the `TypeReferenceNode` node type of the factory package.
172
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
173
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
174
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
175
+ */
39
176
  type TypeReferenceNode = _TypeReferenceNode;
177
+ /**
178
+ * The `UnionTypeNode` node type under the name the generators use.
179
+ *
180
+ * @evidence contracts/common.md#principled-implementation The alias names the `UnionTypeNode` node type of the factory package.
181
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
182
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
183
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
184
+ */
40
185
  type UnionTypeNode = _UnionTypeNode;
186
+ /**
187
+ * The `VariableStatement` node type under the name the generators use.
188
+ *
189
+ * @evidence contracts/common.md#principled-implementation The alias names the `VariableStatement` node type of the factory package.
190
+ * @evidence contracts/common.md#clear-and-simple-design One alias.
191
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
192
+ * @evidence contracts/common.md#meaningful-documentation The alias is named after the compiler type it replaces, and the file comment explains the shim.
193
+ */
41
194
  type VariableStatement = _VariableStatement;
42
195
  }
43
196
  export default ts;
@@ -1 +1 @@
1
- {"version":3,"file":"ts.js","sourceRoot":"","sources":["../../src/internal/ts.ts"],"names":[],"mappings":";;AA8BA,MAAM,EAAE,GAAY;IAClB,eAAe,EAAE,CAAC,IAAsB,EAAyB,EAAE,CACjE,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe;CAC1C,CAAC;kBAyCa,EAAE"}
1
+ {"version":3,"file":"ts.js","sourceRoot":"","sources":["../../src/internal/ts.ts"],"names":[],"mappings":";;AA8BA,MAAM,EAAE,GAAY;IAClB,eAAe,EAAE,CAAC,IAAsB,EAAyB,EAAE,CACjE,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe;CAC1C,CAAC;kBAkMa,EAAE"}
@@ -1,13 +1,44 @@
1
1
  import { IHttpMigrateRoute, OpenApi } from "@typia/interface";
2
2
  import ts from "../internal/ts";
3
3
  import { INestiaMigrateConfig } from "../structures/INestiaMigrateConfig";
4
+ /**
5
+ * Generates one file of the functional API: the imports, the exports of the
6
+ * child namespaces, and the functions of the routes at this level.
7
+ *
8
+ * @evidence contracts/common.md#principled-implementation Each route contributes its function and its namespace, the imports are collected by one importer and emitted first, and each child namespace is re-exported, so a file is a complete module.
9
+ * @evidence contracts/common.md#clear-and-simple-design One function over the two per-route programmers and the importer.
10
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The output derives from the routes and the configuration.
11
+ * @evidence contracts/common.md#meaningful-documentation The comment states the file's content.
12
+ */
4
13
  export declare namespace NestiaMigrateApiFileProgrammer {
14
+ /**
15
+ * The input of one API file: the configuration, the components, the namespace
16
+ * path, the routes, and the child namespaces.
17
+ *
18
+ * @evidence contracts/common.md#principled-implementation The record holds exactly what a file needs, so files can be generated independently.
19
+ * @evidence contracts/common.md#clear-and-simple-design A flat record.
20
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
21
+ * @evidence contracts/common.md#meaningful-documentation The comment lists the fields.
22
+ */
5
23
  interface IProps {
24
+ /** Calling convention and optional generated features for this operation. */
6
25
  config: INestiaMigrateConfig;
26
+ /** Component schemas used to resolve DTO references. */
7
27
  components: OpenApi.IComponents;
28
+ /** Accessor prefix locating this functional API index. */
8
29
  namespace: string[];
30
+ /** Operations whose functions belong directly to this index. */
9
31
  routes: IHttpMigrateRoute[];
32
+ /** Immediate child namespace names re-exported by this index. */
10
33
  children: Set<string>;
11
34
  }
35
+ /**
36
+ * Returns the statements of one API file.
37
+ *
38
+ * @evidence contracts/common.md#principled-implementation The relative path to the structures directory is derived from the namespace depth, so imports resolve from every level.
39
+ * @evidence contracts/common.md#clear-and-simple-design One function.
40
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The depth is computed, not hardcoded.
41
+ * @evidence contracts/common.md#meaningful-documentation The comment states its result.
42
+ */
12
43
  const write: (props: IProps) => ts.Statement[];
13
44
  }
@@ -6,8 +6,25 @@ const FilePrinter_1 = require("../utils/FilePrinter");
6
6
  const NestiaMigrateApiFunctionProgrammer_1 = require("./NestiaMigrateApiFunctionProgrammer");
7
7
  const NestiaMigrateApiNamespaceProgrammer_1 = require("./NestiaMigrateApiNamespaceProgrammer");
8
8
  const NestiaMigrateImportProgrammer_1 = require("./NestiaMigrateImportProgrammer");
9
+ /**
10
+ * Generates one file of the functional API: the imports, the exports of the
11
+ * child namespaces, and the functions of the routes at this level.
12
+ *
13
+ * @evidence contracts/common.md#principled-implementation Each route contributes its function and its namespace, the imports are collected by one importer and emitted first, and each child namespace is re-exported, so a file is a complete module.
14
+ * @evidence contracts/common.md#clear-and-simple-design One function over the two per-route programmers and the importer.
15
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The output derives from the routes and the configuration.
16
+ * @evidence contracts/common.md#meaningful-documentation The comment states the file's content.
17
+ */
9
18
  var NestiaMigrateApiFileProgrammer;
10
19
  (function (NestiaMigrateApiFileProgrammer) {
20
+ /**
21
+ * Returns the statements of one API file.
22
+ *
23
+ * @evidence contracts/common.md#principled-implementation The relative path to the structures directory is derived from the namespace depth, so imports resolve from every level.
24
+ * @evidence contracts/common.md#clear-and-simple-design One function.
25
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The depth is computed, not hardcoded.
26
+ * @evidence contracts/common.md#meaningful-documentation The comment states its result.
27
+ */
11
28
  NestiaMigrateApiFileProgrammer.write = (props) => {
12
29
  const importer = new NestiaMigrateImportProgrammer_1.NestiaMigrateImportProgrammer();
13
30
  const statements = props.routes
@@ -1 +1 @@
1
- {"version":3,"file":"NestiaMigrateApiFileProgrammer.js","sourceRoot":"","sources":["../../src/programmers/NestiaMigrateApiFileProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAKxC,sDAAmD;AACnD,6FAA0F;AAC1F,+FAA4F;AAC5F,mFAAgF;AAEhF,IAAiB,8BAA8B,CA4C9C;AA5CD,WAAiB,8BAA8B;IAShC,oCAAK,GAAG,CAAC,KAAa,EAAkB,EAAE;QACrD,MAAM,QAAQ,GACZ,IAAI,6DAA6B,EAAE,CAAC;QACtC,MAAM,UAAU,GAAmB,KAAK,CAAC,MAAM;aAC5C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;YACd,yBAAW,CAAC,OAAO,EAAE;YACrB,uEAAkC,CAAC,KAAK,CAAC;gBACvC,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,QAAQ;gBACR,KAAK;aACN,CAAC;YACF,yEAAmC,CAAC,KAAK,CAAC;gBACxC,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,QAAQ;gBACR,KAAK;aACN,CAAC;SACH,CAAC;aACD,IAAI,EAAE,CAAC;QACV,OAAO;YACL,GAAG,QAAQ,CAAC,YAAY,CACtB,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,GAAG,EAAE,CACvE;YACD,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACnC,iBAAO,CAAC,uBAAuB,CAC7B,SAAS,EACT,KAAK,EACL,iBAAO,CAAC,qBAAqB,CAAC,iBAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAC9D,iBAAO,CAAC,mBAAmB,CAAC,KAAK,KAAK,QAAQ,CAAC,CAChD,CACF;YACD,GAAG,UAAU;SACd,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,EA5CgB,8BAA8B,aAA9B,8BAA8B,GAA9B,8BAA8B,QA4C9C"}
1
+ {"version":3,"file":"NestiaMigrateApiFileProgrammer.js","sourceRoot":"","sources":["../../src/programmers/NestiaMigrateApiFileProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAKxC,sDAAmD;AACnD,6FAA0F;AAC1F,+FAA4F;AAC5F,mFAAgF;AAEhF;;;;;;;;GAQG;AACH,IAAiB,8BAA8B,CAsE9C;AAtED,WAAiB,8BAA8B;IA2B7C;;;;;;;OAOG;IACU,oCAAK,GAAG,CAAC,KAAa,EAAkB,EAAE;QACrD,MAAM,QAAQ,GACZ,IAAI,6DAA6B,EAAE,CAAC;QACtC,MAAM,UAAU,GAAmB,KAAK,CAAC,MAAM;aAC5C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;YACd,yBAAW,CAAC,OAAO,EAAE;YACrB,uEAAkC,CAAC,KAAK,CAAC;gBACvC,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,QAAQ;gBACR,KAAK;aACN,CAAC;YACF,yEAAmC,CAAC,KAAK,CAAC;gBACxC,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,QAAQ;gBACR,KAAK;aACN,CAAC;SACH,CAAC;aACD,IAAI,EAAE,CAAC;QACV,OAAO;YACL,GAAG,QAAQ,CAAC,YAAY,CACtB,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,GAAG,EAAE,CACvE;YACD,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACnC,iBAAO,CAAC,uBAAuB,CAC7B,SAAS,EACT,KAAK,EACL,iBAAO,CAAC,qBAAqB,CAAC,iBAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAC9D,iBAAO,CAAC,mBAAmB,CAAC,KAAK,KAAK,QAAQ,CAAC,CAChD,CACF;YACD,GAAG,UAAU;SACd,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,EAtEgB,8BAA8B,aAA9B,8BAA8B,GAA9B,8BAA8B,QAsE9C"}
@@ -2,13 +2,53 @@ import { IHttpMigrateRoute, OpenApi } from "@typia/interface";
2
2
  import ts from "../internal/ts";
3
3
  import { INestiaMigrateConfig } from "../structures/INestiaMigrateConfig";
4
4
  import { NestiaMigrateImportProgrammer } from "./NestiaMigrateImportProgrammer";
5
+ /**
6
+ * Generates the function of one route in the SDK.
7
+ *
8
+ * @evidence contracts/common.md#principled-implementation The function has the connection parameter, the path, query, header, and body parameters in positional or keyword form, and its body calls the plain or the encrypted fetcher, or the simulator when the connection asks for it, and copies response headers when the description asks.
9
+ * @evidence contracts/common.md#clear-and-simple-design One entry function, one public parameter builder shared with the simulation programmer, and private helpers for the body and the header directives.
10
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The output derives from the route and the configuration, and the header directives are read from the documented tags.
11
+ * @evidence contracts/common.md#meaningful-documentation The comment states what is generated.
12
+ */
5
13
  export declare namespace NestiaMigrateApiFunctionProgrammer {
14
+ /**
15
+ * The input of one function: the configuration, the components, the importer,
16
+ * and the route.
17
+ *
18
+ * @evidence contracts/common.md#principled-implementation The record holds exactly what the function generation needs.
19
+ * @evidence contracts/common.md#clear-and-simple-design A flat record.
20
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
21
+ * @evidence contracts/common.md#meaningful-documentation The comment lists the fields.
22
+ */
6
23
  interface IContext {
24
+ /** Calling convention and optional generated features for this operation. */
7
25
  config: INestiaMigrateConfig;
26
+ /** Component schemas used to resolve DTO references. */
8
27
  components: OpenApi.IComponents;
28
+ /** File-local import collector shared with the surrounding file writer. */
9
29
  importer: NestiaMigrateImportProgrammer;
30
+ /** Analyzed operation, with the accessor chosen for this generation. */
10
31
  route: IHttpMigrateRoute;
11
32
  }
33
+ /**
34
+ * Returns the exported async function declaration of the route, with its
35
+ * description.
36
+ *
37
+ * @evidence contracts/common.md#principled-implementation The function name is the last accessor segment, the return type is the namespace's response type or void, and the description comes from the route comment with the path, the accessor, and the author tag.
38
+ * @evidence contracts/common.md#clear-and-simple-design One expression over the private parts.
39
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The names come from the accessor.
40
+ * @evidence contracts/common.md#meaningful-documentation The comment states the result.
41
+ */
12
42
  const write: (ctx: IContext) => ts.FunctionDeclaration;
43
+ /**
44
+ * Returns the parameters of the function: the connection first, then either
45
+ * one `props` parameter in keyword mode or the path, query, and body
46
+ * parameters in positional mode.
47
+ *
48
+ * @evidence contracts/common.md#principled-implementation The connection type carries the route's header type when it has one, keyword mode adds `props` only when there is something to pass, and an optional body is marked optional.
49
+ * @evidence contracts/common.md#clear-and-simple-design One function with the two modes as two returns.
50
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The shape follows the configuration.
51
+ * @evidence contracts/common.md#meaningful-documentation The comment states the two modes.
52
+ */
13
53
  const writeParameterDeclarations: (ctx: IContext, connectionName?: string) => ts.ParameterDeclaration[];
14
54
  }
@@ -6,9 +6,28 @@ const utils_1 = require("@typia/utils");
6
6
  const IdentifierFactory_1 = require("../factories/IdentifierFactory");
7
7
  const StatementFactory_1 = require("../factories/StatementFactory");
8
8
  const FilePrinter_1 = require("../utils/FilePrinter");
9
+ const RequestBody_1 = require("../utils/RequestBody");
10
+ const SuccessStatus_1 = require("../utils/SuccessStatus");
9
11
  const NestiaMigrateSchemaProgrammer_1 = require("./NestiaMigrateSchemaProgrammer");
12
+ /**
13
+ * Generates the function of one route in the SDK.
14
+ *
15
+ * @evidence contracts/common.md#principled-implementation The function has the connection parameter, the path, query, header, and body parameters in positional or keyword form, and its body calls the plain or the encrypted fetcher, or the simulator when the connection asks for it, and copies response headers when the description asks.
16
+ * @evidence contracts/common.md#clear-and-simple-design One entry function, one public parameter builder shared with the simulation programmer, and private helpers for the body and the header directives.
17
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The output derives from the route and the configuration, and the header directives are read from the documented tags.
18
+ * @evidence contracts/common.md#meaningful-documentation The comment states what is generated.
19
+ */
10
20
  var NestiaMigrateApiFunctionProgrammer;
11
21
  (function (NestiaMigrateApiFunctionProgrammer) {
22
+ /**
23
+ * Returns the exported async function declaration of the route, with its
24
+ * description.
25
+ *
26
+ * @evidence contracts/common.md#principled-implementation The function name is the last accessor segment, the return type is the namespace's response type or void, and the description comes from the route comment with the path, the accessor, and the author tag.
27
+ * @evidence contracts/common.md#clear-and-simple-design One expression over the private parts.
28
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The names come from the accessor.
29
+ * @evidence contracts/common.md#meaningful-documentation The comment states the result.
30
+ */
12
31
  NestiaMigrateApiFunctionProgrammer.write = (ctx) => FilePrinter_1.FilePrinter.description(factory_1.factory.createFunctionDeclaration([
13
32
  factory_1.factory.createModifier(factory_1.SyntaxKind.ExportKeyword),
14
33
  factory_1.factory.createModifier(factory_1.SyntaxKind.AsyncKeyword),
@@ -17,8 +36,17 @@ var NestiaMigrateApiFunctionProgrammer;
17
36
  ? "void"
18
37
  : `${ctx.route.accessor.at(-1)}.Response`),
19
38
  ]), factory_1.factory.createBlock(writeBody(ctx), true)), writeDescription(ctx.config, ctx.route));
39
+ /**
40
+ * Returns the parameters of the function: the connection first, then either
41
+ * one `props` parameter in keyword mode or the path, query, and body
42
+ * parameters in positional mode.
43
+ *
44
+ * @evidence contracts/common.md#principled-implementation The connection type carries the route's header type when it has one, keyword mode adds `props` only when there is something to pass, and an optional body is marked optional.
45
+ * @evidence contracts/common.md#clear-and-simple-design One function with the two modes as two returns.
46
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The shape follows the configuration.
47
+ * @evidence contracts/common.md#meaningful-documentation The comment states the two modes.
48
+ */
20
49
  NestiaMigrateApiFunctionProgrammer.writeParameterDeclarations = (ctx, connectionName) => {
21
- var _a;
22
50
  const connection = IdentifierFactory_1.IdentifierFactory.parameter(connectionName !== null && connectionName !== void 0 ? connectionName : "connection", factory_1.factory.createTypeReferenceNode(ctx.importer.external({
23
51
  type: "instance",
24
52
  library: "@nestia/fetcher",
@@ -53,9 +81,7 @@ var NestiaMigrateApiFunctionProgrammer;
53
81
  : []),
54
82
  ...(ctx.route.body
55
83
  ? [
56
- IdentifierFactory_1.IdentifierFactory.parameter(ctx.route.body.key, factory_1.factory.createTypeReferenceNode(`${ctx.route.accessor.at(-1)}.Body`), (ctx.route.body.type === "application/json" ||
57
- ctx.route.body.type === "text/plain") &&
58
- ((_a = ctx.route.operation().requestBody) === null || _a === void 0 ? void 0 : _a.required) === false
84
+ IdentifierFactory_1.IdentifierFactory.parameter(ctx.route.body.key, factory_1.factory.createTypeReferenceNode(`${ctx.route.accessor.at(-1)}.Body`), RequestBody_1.RequestBody.optional(ctx.route)
59
85
  ? factory_1.factory.createToken(factory_1.SyntaxKind.QuestionToken)
60
86
  : undefined),
61
87
  ]
@@ -102,7 +128,10 @@ var NestiaMigrateApiFunctionProgrammer;
102
128
  factory_1.factory.createObjectLiteralExpression([
103
129
  factory_1.factory.createSpreadAssignment(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(ctx.route.accessor.at(-1)), "METADATA")),
104
130
  factory_1.factory.createPropertyAssignment("path", factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(ctx.route.accessor.at(-1)), "path"), undefined, getArguments(ctx, false))),
105
- factory_1.factory.createPropertyAssignment("status", factory_1.factory.createNull()),
131
+ // the fetcher reads only 200, 201, and this status as success
132
+ factory_1.factory.createPropertyAssignment("status", ((status) => status === null
133
+ ? factory_1.factory.createNull()
134
+ : factory_1.factory.createNumericLiteral(status))(SuccessStatus_1.SuccessStatus.of(ctx.route))),
106
135
  ], true),
107
136
  ...(ctx.route.body ? [property(ctx.route.body.key)] : []),
108
137
  ]));
@@ -1 +1 @@
1
- {"version":3,"file":"NestiaMigrateApiFunctionProgrammer.js","sourceRoot":"","sources":["../../src/programmers/NestiaMigrateApiFunctionProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAAoD;AAEpD,wCAAgD;AAEhD,sEAAmE;AACnE,oEAAiE;AAGjE,sDAAmD;AAEnD,mFAAgF;AAEhF,IAAiB,kCAAkC,CA4UlD;AA5UD,WAAiB,kCAAkC;IAQpC,wCAAK,GAAG,CAAC,GAAa,EAA0B,EAAE,CAC7D,yBAAW,CAAC,WAAW,CACrB,iBAAO,CAAC,yBAAyB,CAC/B;QACE,iBAAO,CAAC,cAAc,CAAC,oBAAU,CAAC,aAAa,CAAC;QAChD,iBAAO,CAAC,cAAc,CAAC,oBAAU,CAAC,YAAY,CAAC;KAChD,EACD,SAAS,EACT,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,EAC1B,SAAS,EACT,6DAA0B,CAAC,GAAG,CAAC,EAC/B,iBAAO,CAAC,uBAAuB,CAAC,SAAS,EAAE;QACzC,iBAAO,CAAC,uBAAuB,CAC7B,GAAG,CAAC,KAAK,CAAC,OAAO,KAAK,IAAI;YACxB,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,WAAW,CAC7C;KACF,CAAC,EACF,iBAAO,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAC1C,EACD,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAA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YAChE,MAAM,YAAY,GAAuB;gBACvC,aAAa;gBACb,cAAc;aACf,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;YACtC,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;gBAC/B,MAAM,KAAK,GAAa,IAAI;qBACzB,SAAS,CAAC,YAAY,CAAC,MAAM,CAAC;qBAC9B,IAAI,EAAE;qBACN,KAAK,CAAC,KAAK,CAAC,CAAC;gBAChB,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;oBACnB,UAAU,CAAC,IAAI,CAAC;wBACd,IAAI,EAAE,KAAK;wBACX,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAE;wBACnB,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAE;qBACpB,CAAC,CAAC;YACP,CAAC;iBAAM,IAAI,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;gBAC9C,MAAM,QAAQ,GAAW,IAAI;qBAC1B,SAAS,CAAC,iBAAiB,CAAC,MAAM,CAAC;qBACnC,IAAI,EAAE,CAAC;gBACV,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;oBACvB,UAAU,CAAC,IAAI,CAAC;wBACd,IAAI,EAAE,QAAQ;wBACd,QAAQ;qBACT,CAAC,CAAC;YACP,CAAC;QACH,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC,EA5UgB,kCAAkC,aAAlC,kCAAkC,GAAlC,kCAAkC,QA4UlD"}
1
+ {"version":3,"file":"NestiaMigrateApiFunctionProgrammer.js","sourceRoot":"","sources":["../../src/programmers/NestiaMigrateApiFunctionProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAAoD;AAEpD,wCAAgD;AAEhD,sEAAmE;AACnE,oEAAiE;AAGjE,sDAAmD;AACnD,sDAAmD;AACnD,0DAAuD;AAEvD,mFAAgF;AAEhF;;;;;;;GAOG;A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KAAK,CAAC,MAAM,IAAI,CAAC;oBACnB,UAAU,CAAC,IAAI,CAAC;wBACd,IAAI,EAAE,KAAK;wBACX,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAE;wBACnB,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAE;qBACpB,CAAC,CAAC;YACP,CAAC;iBAAM,IAAI,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;gBAC9C,MAAM,QAAQ,GAAW,IAAI;qBAC1B,SAAS,CAAC,iBAAiB,CAAC,MAAM,CAAC;qBACnC,IAAI,EAAE,CAAC;gBACV,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;oBACvB,UAAU,CAAC,IAAI,CAAC;wBACd,IAAI,EAAE,QAAQ;wBACd,QAAQ;qBACT,CAAC,CAAC;YACP,CAAC;QACH,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC,EAnXgB,kCAAkC,aAAlC,kCAAkC,GAAlC,kCAAkC,QAmXlD"}
@@ -1,6 +1,8 @@
1
1
  import { FilePrinter } from "../utils/FilePrinter.mjs";
2
2
  import { IdentifierFactory } from "../factories/IdentifierFactory.mjs";
3
3
  import { StatementFactory } from "../factories/StatementFactory.mjs";
4
+ import { RequestBody } from "../utils/RequestBody.mjs";
5
+ import { SuccessStatus } from "../utils/SuccessStatus.mjs";
4
6
  import { NestiaMigrateSchemaProgrammer } from "./NestiaMigrateSchemaProgrammer.mjs";
5
7
  import { NamingConvention } from "@typia/utils";
6
8
  import { SyntaxKind, factory } from "@ttsc/factory";
@@ -26,7 +28,7 @@ let NestiaMigrateApiFunctionProgrammer;
26
28
  schema: p.schema
27
29
  }))),
28
30
  ...ctx.route.query ? [IdentifierFactory.parameter(ctx.route.query.key, factory.createTypeReferenceNode(`${ctx.route.accessor.at(-1)}.Query`))] : [],
29
- ...ctx.route.body ? [IdentifierFactory.parameter(ctx.route.body.key, factory.createTypeReferenceNode(`${ctx.route.accessor.at(-1)}.Body`), (ctx.route.body.type === "application/json" || ctx.route.body.type === "text/plain") && ctx.route.operation().requestBody?.required === false ? factory.createToken(SyntaxKind.QuestionToken) : void 0)] : []
31
+ ...ctx.route.body ? [IdentifierFactory.parameter(ctx.route.body.key, factory.createTypeReferenceNode(`${ctx.route.accessor.at(-1)}.Body`), RequestBody.optional(ctx.route) ? factory.createToken(SyntaxKind.QuestionToken) : void 0)] : []
30
32
  ];
31
33
  };
32
34
  const writeDescription = (config, route) => {
@@ -51,7 +53,7 @@ let NestiaMigrateApiFunctionProgrammer;
51
53
  factory.createObjectLiteralExpression([
52
54
  factory.createSpreadAssignment(IdentifierFactory.access(factory.createIdentifier(ctx.route.accessor.at(-1)), "METADATA")),
53
55
  factory.createPropertyAssignment("path", factory.createCallExpression(IdentifierFactory.access(factory.createIdentifier(ctx.route.accessor.at(-1)), "path"), void 0, getArguments(ctx, false))),
54
- factory.createPropertyAssignment("status", factory.createNull())
56
+ factory.createPropertyAssignment("status", ((status) => status === null ? factory.createNull() : factory.createNumericLiteral(status))(SuccessStatus.of(ctx.route)))
55
57
  ], true),
56
58
  ...ctx.route.body ? [property(ctx.route.body.key)] : []
57
59
  ]));
@@ -3,13 +3,52 @@ import { OpenApi } from "typia";
3
3
  import ts from "../internal/ts";
4
4
  import { INestiaMigrateConfig } from "../structures/INestiaMigrateConfig";
5
5
  import { NestiaMigrateImportProgrammer } from "./NestiaMigrateImportProgrammer";
6
+ /**
7
+ * Generates the namespace that accompanies the function of a route: its types,
8
+ * its metadata, its path builder, and, in simulation mode, its simulator.
9
+ *
10
+ * @evidence contracts/common.md#principled-implementation The namespace declares the `Props`, `Query`, `Body`, `Headers`, and `Response` types from the schemas, the route metadata the fetcher reads, the `path` function that fills the parameters into the template, and the simulator members.
11
+ * @evidence contracts/common.md#clear-and-simple-design One entry function, one public path-call builder shared with the simulation programmer, and private helpers per member.
12
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The output derives from the route and the configuration.
13
+ * @evidence contracts/common.md#meaningful-documentation The comment states what is generated.
14
+ */
6
15
  export declare namespace NestiaMigrateApiNamespaceProgrammer {
16
+ /**
17
+ * The input of one namespace: the configuration, the components, the
18
+ * importer, and the route.
19
+ *
20
+ * @evidence contracts/common.md#principled-implementation The record holds exactly what the namespace generation needs.
21
+ * @evidence contracts/common.md#clear-and-simple-design A flat record.
22
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
23
+ * @evidence contracts/common.md#meaningful-documentation The comment lists the fields.
24
+ */
7
25
  interface IContext {
26
+ /** Calling convention and optional generated features for this operation. */
8
27
  config: INestiaMigrateConfig;
28
+ /** Component schemas used to resolve DTO references. */
9
29
  components: OpenApi.IComponents;
30
+ /** File-local import collector shared with the surrounding file writer. */
10
31
  importer: NestiaMigrateImportProgrammer;
32
+ /** Analyzed operation, with the accessor chosen for this generation. */
11
33
  route: IHttpMigrateRoute;
12
34
  }
35
+ /**
36
+ * Returns the namespace declaration of a route.
37
+ *
38
+ * @evidence contracts/common.md#principled-implementation The members are written in a fixed order: types, metadata, path function, and the random and simulate members when simulation is enabled.
39
+ * @evidence contracts/common.md#clear-and-simple-design One function composing the private writers.
40
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The members follow the configuration.
41
+ * @evidence contracts/common.md#meaningful-documentation The comment states the result.
42
+ */
13
43
  const write: (ctx: IContext) => ts.ModuleDeclaration;
44
+ /**
45
+ * Returns the call expression of the route's `path` function with the
46
+ * arguments the configuration selects.
47
+ *
48
+ * @evidence contracts/common.md#principled-implementation In keyword mode the arguments are the `props` object and otherwise the path and query parameters in order, so the same call is valid in both modes.
49
+ * @evidence contracts/common.md#clear-and-simple-design One function shared by the simulator and the namespace.
50
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The arguments follow the configuration.
51
+ * @evidence contracts/common.md#meaningful-documentation The comment states the two argument forms.
52
+ */
14
53
  const writePathCallExpression: (config: INestiaMigrateConfig, route: IHttpMigrateRoute) => import("@ttsc/factory").CallExpression;
15
54
  }