@nestia/migrate 11.0.0-dev.20260313 → 11.0.0-dev.20260313-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/lib/NestiaMigrateApplication.d.ts +24 -0
  2. package/lib/NestiaMigrateApplication.js +21136 -0
  3. package/lib/NestiaMigrateApplication.js.map +1 -0
  4. package/lib/analyzers/NestiaMigrateControllerAnalyzer.d.ts +5 -0
  5. package/lib/analyzers/NestiaMigrateControllerAnalyzer.js +46 -0
  6. package/lib/analyzers/NestiaMigrateControllerAnalyzer.js.map +1 -0
  7. package/lib/archivers/NestiaMigrateFileArchiver.d.ts +8 -0
  8. package/lib/archivers/NestiaMigrateFileArchiver.js +36 -0
  9. package/lib/archivers/NestiaMigrateFileArchiver.js.map +1 -0
  10. package/lib/bundles/NEST_TEMPLATE.d.ts +1 -0
  11. package/lib/bundles/NEST_TEMPLATE.js +55 -0
  12. package/lib/bundles/NEST_TEMPLATE.js.map +1 -0
  13. package/lib/bundles/SDK_TEMPLATE.d.ts +1 -0
  14. package/lib/bundles/SDK_TEMPLATE.js +27 -0
  15. package/lib/bundles/SDK_TEMPLATE.js.map +1 -0
  16. package/lib/executable/NestiaMigrateCommander.d.ts +4 -0
  17. package/lib/executable/NestiaMigrateCommander.js +125 -0
  18. package/lib/executable/NestiaMigrateCommander.js.map +1 -0
  19. package/lib/executable/NestiaMigrateInquirer.d.ts +12 -0
  20. package/lib/executable/NestiaMigrateInquirer.js +91 -0
  21. package/lib/executable/NestiaMigrateInquirer.js.map +1 -0
  22. package/lib/executable/migrate.d.ts +2 -0
  23. package/lib/executable/migrate.js +9 -0
  24. package/lib/executable/migrate.js.map +1 -0
  25. package/lib/factories/TypeLiteralFactory.d.ts +4 -0
  26. package/lib/factories/TypeLiteralFactory.js +35 -0
  27. package/lib/factories/TypeLiteralFactory.js.map +1 -0
  28. package/lib/index.d.ts +3 -0
  29. package/lib/index.js +42 -0
  30. package/lib/index.js.map +1 -0
  31. package/lib/index.mjs +21880 -0
  32. package/lib/index.mjs.map +1 -0
  33. package/lib/module.d.ts +5 -0
  34. package/lib/module.js +22 -0
  35. package/lib/module.js.map +1 -0
  36. package/lib/programmers/NestiaMigrateApiFileProgrammer.d.ts +13 -0
  37. package/lib/programmers/NestiaMigrateApiFileProgrammer.js +40 -0
  38. package/lib/programmers/NestiaMigrateApiFileProgrammer.js.map +1 -0
  39. package/lib/programmers/NestiaMigrateApiFunctionProgrammer.d.ts +14 -0
  40. package/lib/programmers/NestiaMigrateApiFunctionProgrammer.js +180 -0
  41. package/lib/programmers/NestiaMigrateApiFunctionProgrammer.js.map +1 -0
  42. package/lib/programmers/NestiaMigrateApiNamespaceProgrammer.d.ts +15 -0
  43. package/lib/programmers/NestiaMigrateApiNamespaceProgrammer.js +223 -0
  44. package/lib/programmers/NestiaMigrateApiNamespaceProgrammer.js.map +1 -0
  45. package/lib/programmers/NestiaMigrateApiProgrammer.d.ts +4 -0
  46. package/lib/programmers/NestiaMigrateApiProgrammer.js +82 -0
  47. package/lib/programmers/NestiaMigrateApiProgrammer.js.map +1 -0
  48. package/lib/programmers/NestiaMigrateApiSimulationProgrammer.d.ts +15 -0
  49. package/lib/programmers/NestiaMigrateApiSimulationProgrammer.js +140 -0
  50. package/lib/programmers/NestiaMigrateApiSimulationProgrammer.js.map +1 -0
  51. package/lib/programmers/NestiaMigrateApiStartProgrammer.d.ts +4 -0
  52. package/lib/programmers/NestiaMigrateApiStartProgrammer.js +79 -0
  53. package/lib/programmers/NestiaMigrateApiStartProgrammer.js.map +1 -0
  54. package/lib/programmers/NestiaMigrateDtoProgrammer.d.ts +15 -0
  55. package/lib/programmers/NestiaMigrateDtoProgrammer.js +65 -0
  56. package/lib/programmers/NestiaMigrateDtoProgrammer.js.map +1 -0
  57. package/lib/programmers/NestiaMigrateE2eFileProgrammer.d.ts +15 -0
  58. package/lib/programmers/NestiaMigrateE2eFileProgrammer.js +80 -0
  59. package/lib/programmers/NestiaMigrateE2eFileProgrammer.js.map +1 -0
  60. package/lib/programmers/NestiaMigrateE2eProgrammer.d.ts +4 -0
  61. package/lib/programmers/NestiaMigrateE2eProgrammer.js +32 -0
  62. package/lib/programmers/NestiaMigrateE2eProgrammer.js.map +1 -0
  63. package/lib/programmers/NestiaMigrateImportProgrammer.d.ts +18 -0
  64. package/lib/programmers/NestiaMigrateImportProgrammer.js +65 -0
  65. package/lib/programmers/NestiaMigrateImportProgrammer.js.map +1 -0
  66. package/lib/programmers/NestiaMigrateNestControllerProgrammer.d.ts +12 -0
  67. package/lib/programmers/NestiaMigrateNestControllerProgrammer.js +46 -0
  68. package/lib/programmers/NestiaMigrateNestControllerProgrammer.js.map +1 -0
  69. package/lib/programmers/NestiaMigrateNestMethodProgrammer.d.ts +16 -0
  70. package/lib/programmers/NestiaMigrateNestMethodProgrammer.js +221 -0
  71. package/lib/programmers/NestiaMigrateNestMethodProgrammer.js.map +1 -0
  72. package/lib/programmers/NestiaMigrateNestModuleProgrammer.d.ts +5 -0
  73. package/lib/programmers/NestiaMigrateNestModuleProgrammer.js +29 -0
  74. package/lib/programmers/NestiaMigrateNestModuleProgrammer.js.map +1 -0
  75. package/lib/programmers/NestiaMigrateNestProgrammer.d.ts +4 -0
  76. package/lib/programmers/NestiaMigrateNestProgrammer.js +65 -0
  77. package/lib/programmers/NestiaMigrateNestProgrammer.js.map +1 -0
  78. package/lib/programmers/NestiaMigrateSchemaProgrammer.d.ts +10 -0
  79. package/lib/programmers/NestiaMigrateSchemaProgrammer.js +339 -0
  80. package/lib/programmers/NestiaMigrateSchemaProgrammer.js.map +1 -0
  81. package/lib/programmers/index.d.ts +15 -0
  82. package/lib/programmers/index.js +32 -0
  83. package/lib/programmers/index.js.map +1 -0
  84. package/lib/structures/INestiaMigrateConfig.d.ts +15 -0
  85. package/lib/structures/INestiaMigrateConfig.js +3 -0
  86. package/lib/structures/INestiaMigrateConfig.js.map +1 -0
  87. package/lib/structures/INestiaMigrateContext.d.ts +7 -0
  88. package/lib/structures/INestiaMigrateContext.js +3 -0
  89. package/lib/structures/INestiaMigrateContext.js.map +1 -0
  90. package/lib/structures/INestiaMigrateController.d.ts +7 -0
  91. package/lib/structures/INestiaMigrateController.js +3 -0
  92. package/lib/structures/INestiaMigrateController.js.map +1 -0
  93. package/lib/structures/INestiaMigrateDto.d.ts +7 -0
  94. package/lib/structures/INestiaMigrateDto.js +3 -0
  95. package/lib/structures/INestiaMigrateDto.js.map +1 -0
  96. package/lib/structures/INestiaMigrateFile.d.ts +5 -0
  97. package/lib/structures/INestiaMigrateFile.js +3 -0
  98. package/lib/structures/INestiaMigrateFile.js.map +1 -0
  99. package/lib/structures/INestiaMigrateProgram.d.ts +9 -0
  100. package/lib/structures/INestiaMigrateProgram.js +3 -0
  101. package/lib/structures/INestiaMigrateProgram.js.map +1 -0
  102. package/lib/structures/INestiaMigrateSchema.d.ts +4 -0
  103. package/lib/structures/INestiaMigrateSchema.js +3 -0
  104. package/lib/structures/INestiaMigrateSchema.js.map +1 -0
  105. package/lib/structures/index.d.ts +4 -0
  106. package/lib/structures/index.js +21 -0
  107. package/lib/structures/index.js.map +1 -0
  108. package/lib/utils/FilePrinter.d.ts +9 -0
  109. package/lib/utils/FilePrinter.js +35 -0
  110. package/lib/utils/FilePrinter.js.map +1 -0
  111. package/lib/utils/MapUtil.d.ts +3 -0
  112. package/lib/utils/MapUtil.js +15 -0
  113. package/lib/utils/MapUtil.js.map +1 -0
  114. package/lib/utils/SetupWizard.d.ts +3 -0
  115. package/lib/utils/SetupWizard.js +18 -0
  116. package/lib/utils/SetupWizard.js.map +1 -0
  117. package/lib/utils/StringUtil.d.ts +6 -0
  118. package/lib/utils/StringUtil.js +108 -0
  119. package/lib/utils/StringUtil.js.map +1 -0
  120. package/lib/utils/openapi-down-convert/RefVisitor.d.ts +52 -0
  121. package/lib/utils/openapi-down-convert/RefVisitor.js +102 -0
  122. package/lib/utils/openapi-down-convert/RefVisitor.js.map +1 -0
  123. package/lib/utils/openapi-down-convert/converter.d.ts +146 -0
  124. package/lib/utils/openapi-down-convert/converter.js +441 -0
  125. package/lib/utils/openapi-down-convert/converter.js.map +1 -0
  126. package/package.json +1 -2
  127. package/src/bundles/NEST_TEMPLATE.ts +1 -1
  128. package/src/bundles/SDK_TEMPLATE.ts +1 -1
@@ -0,0 +1,441 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Converter = void 0;
4
+ /** OpenAPI Down Converted - convert an OAS document from OAS 3.1 to OAS 3.0 */
5
+ const RefVisitor_1 = require("./RefVisitor");
6
+ class Converter {
7
+ /**
8
+ * Construct a new Converter
9
+ *
10
+ * @throws Error if the scopeDescriptionFile (if specified) cannot be read or
11
+ * parsed as YAML/JSON
12
+ */
13
+ constructor(openapiDocument, options) {
14
+ this.verbose = false;
15
+ this.deleteExampleWithId = false;
16
+ this.allOfTransform = false;
17
+ this.scopeDescriptions = undefined;
18
+ this.convertSchemaComments = false;
19
+ this.returnCode = 0;
20
+ this.openapi30 = Converter.deepClone(openapiDocument);
21
+ this.verbose = Boolean(options === null || options === void 0 ? void 0 : options.verbose);
22
+ this.deleteExampleWithId = Boolean(options === null || options === void 0 ? void 0 : options.deleteExampleWithId);
23
+ this.allOfTransform = Boolean(options === null || options === void 0 ? void 0 : options.allOfTransform);
24
+ this.authorizationUrl =
25
+ (options === null || options === void 0 ? void 0 : options.authorizationUrl) || "https://www.example.com/oauth2/authorize";
26
+ this.tokenUrl = (options === null || options === void 0 ? void 0 : options.tokenUrl) || "https://www.example.com/oauth2/token";
27
+ this.loadScopeDescriptions(options === null || options === void 0 ? void 0 : options.scopeDescriptionFile);
28
+ this.convertSchemaComments = !!(options === null || options === void 0 ? void 0 : options.convertSchemaComments);
29
+ }
30
+ /**
31
+ * Load the scopes.yaml file and save in this.scopeDescriptions
32
+ *
33
+ * @throws Error if the file cannot be read or parsed as YAML/JSON
34
+ */
35
+ loadScopeDescriptions(scopeDescriptionFile) {
36
+ if (!scopeDescriptionFile) {
37
+ return;
38
+ }
39
+ }
40
+ /**
41
+ * Log a message to console.warn stream if verbose is true
42
+ *
43
+ * @param message Parameters for console.warn
44
+ */
45
+ log(...message) {
46
+ if (this.verbose) {
47
+ this.warn(...message);
48
+ }
49
+ }
50
+ /**
51
+ * Log a message to console.warn stream. Prefix the message string with
52
+ * `Warning: ` if it does not already have that text.
53
+ *
54
+ * @param message Parameters for console.warn
55
+ */
56
+ warn(...message) {
57
+ if (!message[0].startsWith("Warning")) {
58
+ message[0] = `Warning: ${message[0]}`;
59
+ }
60
+ console.warn(...message);
61
+ }
62
+ /**
63
+ * Log an error message to `console.error` stream. Prefix the message string
64
+ * with `Error: ` if it does not already start with `'Error'`. Increments the
65
+ * `returnCode`, causing the CLI to throw an Error when done.
66
+ *
67
+ * @param message Parameters for `console.error`
68
+ */
69
+ error(...message) {
70
+ if (!message[0].startsWith("Error")) {
71
+ message[0] = `Error: ${message[0]}`;
72
+ }
73
+ this.returnCode++;
74
+ console.error(...message);
75
+ }
76
+ /**
77
+ * Convert the OpenAPI document to 3.0
78
+ *
79
+ * @returns The converted document. The input is not modified.
80
+ */
81
+ convert() {
82
+ this.log("Converting from OpenAPI 3.1 to 3.0");
83
+ this.openapi30.openapi = "3.0.3";
84
+ this.removeLicenseIdentifier();
85
+ this.convertSchemaRef();
86
+ this.simplifyNonSchemaRef();
87
+ if (this.scopeDescriptions) {
88
+ this.convertSecuritySchemes();
89
+ }
90
+ this.convertJsonSchemaExamples();
91
+ this.convertJsonSchemaContentEncoding();
92
+ this.convertJsonSchemaContentMediaType();
93
+ this.convertConstToEnum();
94
+ this.convertNullableTypeArray();
95
+ this.removeWebhooksObject();
96
+ this.removeUnsupportedSchemaKeywords();
97
+ if (this.convertSchemaComments) {
98
+ this.renameSchema$comment();
99
+ }
100
+ else {
101
+ this.deleteSchema$comment();
102
+ }
103
+ if (this.returnCode > 0) {
104
+ throw new Error("Cannot down convert this OpenAPI definition.");
105
+ }
106
+ return this.openapi30;
107
+ }
108
+ /**
109
+ * OpenAPI 3.1 uses JSON Schema 2020-12 which allows schema `examples`;
110
+ * OpenAPI 3.0 uses JSON Scheme Draft 7 which only allows `example`. Replace
111
+ * all `examples` with `example`, using `examples[0]`
112
+ */
113
+ convertJsonSchemaExamples() {
114
+ const schemaVisitor = (schema) => {
115
+ for (const key in schema) {
116
+ const subSchema = schema[key];
117
+ if (subSchema !== null && typeof subSchema === "object") {
118
+ if (key === "examples") {
119
+ const examples = schema["examples"];
120
+ if (Array.isArray(examples) && examples.length > 0) {
121
+ delete schema["examples"];
122
+ const first = examples[0];
123
+ if (this.deleteExampleWithId &&
124
+ first != null &&
125
+ typeof first === "object" &&
126
+ first.hasOwnProperty("id")) {
127
+ this.log(`Deleted schema example with \`id\` property:\n${this.json(examples)}`);
128
+ }
129
+ else {
130
+ schema["example"] = first;
131
+ this.log(`Replaces examples with examples[0]. Old examples:\n${this.json(examples)}`);
132
+ }
133
+ // TODO: Add an else here to check example for `id` and delete the example if this.deleteExampleWithId
134
+ // We've put most of those in `examples` so this is probably not needed, but it would be more robust.
135
+ }
136
+ }
137
+ else {
138
+ schema[key] = (0, RefVisitor_1.walkObject)(subSchema, schemaVisitor);
139
+ }
140
+ }
141
+ }
142
+ return schema;
143
+ };
144
+ (0, RefVisitor_1.visitSchemaObjects)(this.openapi30, schemaVisitor);
145
+ }
146
+ walkNestedSchemaObjects(schema, schemaVisitor) {
147
+ for (const key in schema) {
148
+ const subSchema = schema[key];
149
+ if (subSchema !== null && typeof subSchema === "object") {
150
+ schema[key] = (0, RefVisitor_1.walkObject)(subSchema, schemaVisitor);
151
+ }
152
+ }
153
+ return schema;
154
+ }
155
+ /**
156
+ * OpenAPI 3.1 uses JSON Schema 2020-12 which allows `const` OpenAPI 3.0 uses
157
+ * JSON Scheme Draft 7 which only allows `enum`. Replace all `const: value`
158
+ * with `enum: [ value ]`
159
+ */
160
+ convertConstToEnum() {
161
+ const schemaVisitor = (schema) => {
162
+ if (schema["const"]) {
163
+ const constant = schema["const"];
164
+ delete schema["const"];
165
+ schema["enum"] = [constant];
166
+ this.log(`Converted const: ${constant} to enum`);
167
+ }
168
+ return this.walkNestedSchemaObjects(schema, schemaVisitor);
169
+ };
170
+ (0, RefVisitor_1.visitSchemaObjects)(this.openapi30, schemaVisitor);
171
+ }
172
+ /**
173
+ * Convert 2-element type arrays containing 'null' to string type and
174
+ * `nullable: true`
175
+ */
176
+ convertNullableTypeArray() {
177
+ const schemaVisitor = (schema) => {
178
+ if (schema.hasOwnProperty("type")) {
179
+ const schemaType = schema["type"];
180
+ if (Array.isArray(schemaType) &&
181
+ schemaType.length === 2 &&
182
+ schemaType.includes("null")) {
183
+ const nonNull = schemaType.filter((_) => _ !== "null")[0];
184
+ schema["type"] = nonNull;
185
+ schema["nullable"] = true;
186
+ this.log(`Converted schema type array to nullable`);
187
+ }
188
+ }
189
+ return this.walkNestedSchemaObjects(schema, schemaVisitor);
190
+ };
191
+ (0, RefVisitor_1.visitSchemaObjects)(this.openapi30, schemaVisitor);
192
+ }
193
+ removeWebhooksObject() {
194
+ if (Object.hasOwnProperty.call(this.openapi30, "webhooks")) {
195
+ this.log(`Deleted webhooks object`);
196
+ delete this.openapi30["webhooks"];
197
+ }
198
+ }
199
+ removeUnsupportedSchemaKeywords() {
200
+ const keywordsToRemove = [
201
+ "$id",
202
+ "$schema",
203
+ "unevaluatedProperties",
204
+ "contentMediaType",
205
+ "patternProperties",
206
+ ];
207
+ const schemaVisitor = (schema) => {
208
+ keywordsToRemove.forEach((key) => {
209
+ if (schema.hasOwnProperty(key)) {
210
+ delete schema[key];
211
+ this.log(`Removed unsupported schema keyword ${key}`);
212
+ }
213
+ });
214
+ return this.walkNestedSchemaObjects(schema, schemaVisitor);
215
+ };
216
+ (0, RefVisitor_1.visitSchemaObjects)(this.openapi30, schemaVisitor);
217
+ }
218
+ renameSchema$comment() {
219
+ const schemaVisitor = (schema) => {
220
+ if (schema.hasOwnProperty("$comment")) {
221
+ schema["x-comment"] = schema["$comment"];
222
+ delete schema["$comment"];
223
+ this.log(`schema $comment renamed to x-comment`);
224
+ }
225
+ return this.walkNestedSchemaObjects(schema, schemaVisitor);
226
+ };
227
+ (0, RefVisitor_1.visitSchemaObjects)(this.openapi30, schemaVisitor);
228
+ }
229
+ deleteSchema$comment() {
230
+ const schemaVisitor = (schema) => {
231
+ if (schema.hasOwnProperty("$comment")) {
232
+ const comment = schema["$comment"];
233
+ delete schema["$comment"];
234
+ this.log(`schema $comment deleted: ${comment}`);
235
+ }
236
+ return this.walkNestedSchemaObjects(schema, schemaVisitor);
237
+ };
238
+ (0, RefVisitor_1.visitSchemaObjects)(this.openapi30, schemaVisitor);
239
+ }
240
+ /**
241
+ * Convert
242
+ *
243
+ * contentMediaType: "application/octet-stream";
244
+ *
245
+ * To
246
+ *
247
+ * format: binary;
248
+ *
249
+ * In `type: string` schemas. Warn if schema has a `format` already and it is
250
+ * not `binary`.
251
+ */
252
+ convertJsonSchemaContentMediaType() {
253
+ const schemaVisitor = (schema) => {
254
+ if (schema.hasOwnProperty("type") &&
255
+ schema["type"] === "string" &&
256
+ schema.hasOwnProperty("contentMediaType") &&
257
+ schema["contentMediaType"] === "application/octet-stream") {
258
+ if (schema.hasOwnProperty("format")) {
259
+ if (schema["format"] === "binary") {
260
+ this.log(`Deleted schema contentMediaType: application/octet-stream (leaving format: binary)`);
261
+ delete schema["contentMediaType"];
262
+ }
263
+ else {
264
+ this.error(`Unable to down-convert schema with contentMediaType: application/octet-stream to format: binary because the schema already has a format (${schema["format"]})`);
265
+ }
266
+ }
267
+ else {
268
+ delete schema["contentMediaType"];
269
+ schema["format"] = "binary";
270
+ this.log(`Converted schema contentMediaType: application/octet-stream to format: binary`);
271
+ }
272
+ }
273
+ return this.walkNestedSchemaObjects(schema, schemaVisitor);
274
+ };
275
+ (0, RefVisitor_1.visitSchemaObjects)(this.openapi30, schemaVisitor);
276
+ }
277
+ /**
278
+ * Convert
279
+ *
280
+ * contentEncoding: base64;
281
+ *
282
+ * To
283
+ *
284
+ * format: byte;
285
+ *
286
+ * In `type: string` schemas. It is an error if the schema has a `format`
287
+ * already and it is not `byte`.
288
+ */
289
+ convertJsonSchemaContentEncoding() {
290
+ const schemaVisitor = (schema) => {
291
+ if (schema.hasOwnProperty("type") &&
292
+ schema["type"] === "string" &&
293
+ schema.hasOwnProperty("contentEncoding")) {
294
+ if (schema["contentEncoding"] === "base64") {
295
+ if (schema.hasOwnProperty("format")) {
296
+ if (schema["format"] === "byte") {
297
+ this.log(`Deleted schema contentEncoding: base64 (leaving format: byte)`);
298
+ delete schema["contentEncoding"];
299
+ }
300
+ else {
301
+ this.error(`Unable to down-convert schema contentEncoding: base64 to format: byte because the schema already has a format (${schema["format"]})`);
302
+ }
303
+ }
304
+ else {
305
+ delete schema["contentEncoding"];
306
+ schema["format"] = "byte";
307
+ this.log(`Converted schema: 'contentEncoding: base64' to 'format: byte'`);
308
+ }
309
+ }
310
+ else {
311
+ this.error(`Unable to down-convert contentEncoding: ${schema["contentEncoding"]}`);
312
+ }
313
+ }
314
+ return this.walkNestedSchemaObjects(schema, schemaVisitor);
315
+ };
316
+ (0, RefVisitor_1.visitSchemaObjects)(this.openapi30, schemaVisitor);
317
+ }
318
+ json(x) {
319
+ return JSON.stringify(x, null, 2);
320
+ }
321
+ /**
322
+ * OpenAPI 3.1 defines a new `openIdConnect` security scheme. Down-convert the
323
+ * scheme to `oauth2` / authorization code flow. Collect all the scopes used
324
+ * in any security requirements within operations and add them to the scheme.
325
+ * Also define the URLs to the `authorizationUrl` and `tokenUrl` of `oauth2`.
326
+ */
327
+ convertSecuritySchemes() {
328
+ var _a, _b, _c;
329
+ const oauth2Scopes = (schemeName) => {
330
+ var _a, _b;
331
+ const scopes = {};
332
+ const paths = (_b = (_a = this.openapi30) === null || _a === void 0 ? void 0 : _a.paths) !== null && _b !== void 0 ? _b : {};
333
+ for (const path in paths) {
334
+ for (const op in paths[path]) {
335
+ if (op === "parameters") {
336
+ continue;
337
+ }
338
+ const operation = paths[path][op];
339
+ const sec = operation === null || operation === void 0 ? void 0 : operation.security;
340
+ sec.forEach((s) => {
341
+ const requirement = s === null || s === void 0 ? void 0 : s[schemeName];
342
+ if (requirement) {
343
+ requirement.forEach((scope) => {
344
+ var _a, _b;
345
+ scopes[scope] =
346
+ (_b = (_a = this.scopeDescriptions) === null || _a === void 0 ? void 0 : _a[scope]) !== null && _b !== void 0 ? _b : `TODO: describe the '${scope}' scope`;
347
+ });
348
+ }
349
+ });
350
+ }
351
+ }
352
+ return scopes;
353
+ };
354
+ const schemes = (_c = (_b = (_a = this.openapi30) === null || _a === void 0 ? void 0 : _a.components) === null || _b === void 0 ? void 0 : _b["securitySchemes"]) !== null && _c !== void 0 ? _c : {};
355
+ for (const schemeName in schemes) {
356
+ const scheme = schemes[schemeName];
357
+ const type = scheme.type;
358
+ if (type === "openIdConnect") {
359
+ this.log(`Converting openIdConnect security scheme to oauth2/authorizationCode`);
360
+ scheme.type = "oauth2";
361
+ const openIdConnectUrl = scheme.openIdConnectUrl;
362
+ scheme.description = `OAuth2 Authorization Code Flow. The client may
363
+ GET the OpenID Connect configuration JSON from \`${openIdConnectUrl}\`
364
+ to get the correct \`authorizationUrl\` and \`tokenUrl\`.`;
365
+ delete scheme.openIdConnectUrl;
366
+ const scopes = oauth2Scopes(schemeName);
367
+ scheme.flows = {
368
+ authorizationCode: {
369
+ // TODO: add options for these URLs
370
+ authorizationUrl: this.authorizationUrl,
371
+ tokenUrl: this.tokenUrl,
372
+ scopes: scopes,
373
+ },
374
+ };
375
+ }
376
+ }
377
+ }
378
+ /**
379
+ * Find remaining OpenAPI 3.0 [Reference
380
+ * Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)
381
+ * and down convert them to [JSON
382
+ * Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03)
383
+ * objects with _only_ a `$ref` property.
384
+ */
385
+ simplifyNonSchemaRef() {
386
+ (0, RefVisitor_1.visitRefObjects)(this.openapi30, (node) => {
387
+ if (Object.keys(node).length === 1) {
388
+ return node;
389
+ }
390
+ else {
391
+ this.log(`Down convert reference object to JSON Reference:\n${JSON.stringify(node, null, 3)}`);
392
+ Object.keys(node)
393
+ .filter((key) => key !== "$ref")
394
+ .forEach((key) => delete node[key]);
395
+ return node;
396
+ }
397
+ });
398
+ }
399
+ removeLicenseIdentifier() {
400
+ var _a, _b, _c;
401
+ if ((_c = (_b = (_a = this.openapi30) === null || _a === void 0 ? void 0 : _a["info"]) === null || _b === void 0 ? void 0 : _b["license"]) === null || _c === void 0 ? void 0 : _c["identifier"]) {
402
+ this.log(`Removed info.license.identifier: ${this.openapi30["info"]["license"]["identifier"]}`);
403
+ delete this.openapi30["info"]["license"]["identifier"];
404
+ }
405
+ }
406
+ // This transformation ends up breaking openapi-generator
407
+ // SDK gen (typescript-axios, typescript-angular)
408
+ // so it is disabled unless the `allOfTransform` option is `true`.
409
+ convertSchemaRef() {
410
+ /**
411
+ * In a JSON Schema, replace `{ blah blah, $ref: "uri"}` with `{ blah blah,
412
+ * allOf: [ $ref: "uri" ]}`
413
+ *
414
+ * @param object An object that may contain JSON schemas (directly or in
415
+ * sub-objects)
416
+ */
417
+ const simplifyRefObjectsInSchemas = (object) => {
418
+ return (0, RefVisitor_1.visitRefObjects)(object, (node) => {
419
+ if (Object.keys(node).length === 1) {
420
+ return node;
421
+ }
422
+ else {
423
+ this.log(`Converting JSON Schema $ref ${this.json(node)} to allOf: [ $ref ]`);
424
+ node["allOf"] = [{ $ref: node.$ref }];
425
+ delete node.$ref;
426
+ return node;
427
+ }
428
+ });
429
+ };
430
+ if (this.allOfTransform) {
431
+ (0, RefVisitor_1.visitSchemaObjects)(this.openapi30, (schema) => {
432
+ return simplifyRefObjectsInSchemas(schema);
433
+ });
434
+ }
435
+ }
436
+ static deepClone(obj) {
437
+ return JSON.parse(JSON.stringify(obj)); // kinda simple way to clone, but it works...
438
+ }
439
+ }
440
+ exports.Converter = Converter;
441
+ //# sourceMappingURL=converter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"converter.js","sourceRoot":"","sources":["../../../src/utils/openapi-down-convert/converter.ts"],"names":[],"mappings":";;;AAAA,+EAA+E;AAC/E,6CAOsB;AAwCtB,MAAa,SAAS;IAYpB;;;;;OAKG;IACH,YAAY,eAAuB,EAAE,OAA0B;QAhBvD,YAAO,GAAG,KAAK,CAAC;QAChB,wBAAmB,GAAG,KAAK,CAAC;QAC5B,mBAAc,GAAG,KAAK,CAAC;QAIvB,sBAAiB,GAAG,SAAS,CAAC;QAC9B,0BAAqB,GAAG,KAAK,CAAC;QAC9B,eAAU,GAAG,CAAC,CAAC;QASrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,eAAe,CAAa,CAAC;QAClE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,mBAAmB,CAAC,CAAC;QACjE,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,CAAC,CAAC;QACvD,IAAI,CAAC,gBAAgB;YACnB,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,KAAI,0CAA0C,CAAC;QAC1E,IAAI,CAAC,QAAQ,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,KAAI,sCAAsC,CAAC;QAC5E,IAAI,CAAC,qBAAqB,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oBAAoB,CAAC,CAAC;QAC1D,IAAI,CAAC,qBAAqB,GAAG,CAAC,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,qBAAqB,CAAA,CAAC;IAChE,CAAC;IAED;;;;OAIG;IACK,qBAAqB,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AE,CAAC;YACxB,IAAA,+BAAkB,EAChB,IAAI,CAAC,SAAS,EACd,CAAC,MAAoB,EAAgB,EAAE;gBACrC,OAAO,2BAA2B,CAAC,MAAM,CAAC,CAAC;YAC7C,CAAC,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,SAAS,CAAC,GAAW;QACjC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,6CAA6C;IACvF,CAAC;CACF;AAveD,8BAueC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/migrate",
3
- "version": "11.0.0-dev.20260313",
3
+ "version": "11.0.0-dev.20260313-3",
4
4
  "description": "Migration program from swagger to NestJS",
5
5
  "main": "lib/index.js",
6
6
  "exports": {
@@ -71,7 +71,6 @@
71
71
  "build": "rimraf lib && tsc && rollup -c",
72
72
  "bundle": "node src/executable/bundle.js",
73
73
  "dev": "rimraf lib && tsc --watch",
74
- "package:next": "npm publish --access public --tag next",
75
74
  "test": "node lib/test"
76
75
  },
77
76
  "types": "lib/index.d.ts",
@@ -12,7 +12,7 @@ export const NEST_TEMPLATE: Record<string, string> = {
12
12
  "LICENSE": "MIT License\r\n\r\nCopyright (c) 2022 Jeongho Nam\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n",
13
13
  "nest-cli.json": "{\r\n \"$schema\": \"https://json.schemastore.org/nest-cli\",\r\n \"collection\": \"@nestjs/schematics\",\r\n \"sourceRoot\": \"src\",\r\n \"entryFile\": \"executable/server\",\r\n \"compilerOptions\": {\r\n \"deleteOutDir\": true\r\n }\r\n}\r\n",
14
14
  "nestia.config.ts": "// nestia configuration file\r\nimport type sdk from \"@nestia/sdk\";\r\nimport { NestFactory } from \"@nestjs/core\";\r\n\r\nimport { MyModule } from \"./src/MyModule\";\r\n\r\nconst NESTIA_CONFIG: sdk.INestiaConfig = {\r\n input: () => NestFactory.create(MyModule),\r\n output: \"src/api\",\r\n swagger: {\r\n output: \"packages/api/swagger.json\",\r\n servers: [\r\n {\r\n url: \"http://localhost:37001\",\r\n description: \"Local Server\",\r\n },\r\n ],\r\n beautify: true,\r\n },\r\n distribute: \"packages/api\",\r\n keyword: true,\r\n simulate: true,\r\n primitive: false,\r\n};\r\nexport default NESTIA_CONFIG;\r\n",
15
- "package.json": "{\n \"private\": true,\n \"name\": \"@ORGANIZATION/PROJECT\",\n \"version\": \"0.1.0\",\n \"description\": \"Starter kit of Nestia\",\n \"main\": \"lib/index.js\",\n \"scripts\": {\n \"benchmark\": \"node bin/test/benchmark\",\n \"test\": \"node bin/test\",\n \"test:webpack\": \"npm run webpack && node bin/test/webpack.js\",\n \"------------------------BUILDS------------------------\": \"\",\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\n \"build:api\": \"rimraf packages/api/lib && nestia all && rimraf packages/api/lib && tsc -p packages/api/tsconfig.json && rollup -c packages/api/rollup.config.js\",\n \"build:main\": \"rimraf lib && tsc\",\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\n \"build:swagger\": \"npx nestia swagger\",\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\n \"dev\": \"npm run build:test -- --watch\",\n \"eslint\": \"eslint src && eslint test\",\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\n \"prepare\": \"ts-patch install && ts-node build/env.ts\",\n \"prettier\": \"prettier src --write && prettier test --write\",\n \"------------------------WEBPACK------------------------\": \"\",\n \"webpack\": \"rimraf dist && webpack\",\n \"webpack:start\": \"cd dist && node dist/server\",\n \"webpack:test\": \"npm run webpack && node bin/test/webpack.js\",\n \"------------------------DEPLOYS------------------------\": \"\",\n \"package:api\": \"npm run build:api && cd packages/api && npm publish\",\n \"start\": \"node lib/executable/server\",\n \"start:dev\": \"nest start --watch\",\n \"start:swagger\": \"ts-node src/executable/swagger.ts\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/samchon/nestia-start\"\n },\n \"keywords\": [\n \"nestia\",\n \"template\",\n \"boilerplate\"\n ],\n \"author\": \"AUTHOR\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/samchon/nestia-start/issues\"\n },\n \"homepage\": \"https://github.com/samchon/nestia-start#readme\",\n \"devDependencies\": {\n \"@autobe/interface\": \"^0.10.6\",\n \"@nestia/benchmark\": \"^11.0.0-dev.20260313\",\n \"@nestia/e2e\": \"^11.0.0-dev.20260313\",\n \"@nestjs/cli\": \"^11.0.16\",\n \"@rollup/plugin-terser\": \"^0.4.4\",\n \"@rollup/plugin-typescript\": \"^11.1.6\",\n \"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\n \"@types/cli\": \"^0.11.21\",\n \"@types/cli-progress\": \"^3.11.5\",\n \"@types/express\": \"^4.17.21\",\n \"@types/inquirer\": \"^8.2.5\",\n \"@types/node\": \"^18.11.0\",\n \"@types/uuid\": \"^8.3.4\",\n \"@typescript-eslint/eslint-plugin\": \"^8.1.0\",\n \"@typescript-eslint/parser\": \"^8.1.0\",\n \"chalk\": \"^4.1.2\",\n \"cli\": \"^1.0.1\",\n \"cli-progress\": \"^3.12.0\",\n \"copy-webpack-plugin\": \"^11.0.0\",\n \"eslint-plugin-deprecation\": \"^3.0.0\",\n \"express\": \"^4.18.2\",\n \"nestia\": \"^11.0.0-dev.20260313\",\n \"prettier\": \"^3.2.4\",\n \"prettier-plugin-prisma\": \"^5.0.0\",\n \"rimraf\": \"^3.0.2\",\n \"rollup\": \"^4.18.0\",\n \"source-map-support\": \"^0.5.21\",\n \"swagger-ui-express\": \"^5.0.0\",\n \"ts-loader\": \"^9.5.1\",\n \"ts-node\": \"^10.9.1\",\n \"ts-patch\": \"^3.3.0\",\n \"typescript\": \"~5.9.3\",\n \"typescript-transform-paths\": \"^3.5.6\",\n \"webpack\": \"^5.89.0\",\n \"webpack-cli\": \"^5.1.4\",\n \"write-file-webpack-plugin\": \"^4.5.1\"\n },\n \"dependencies\": {\n \"@nestia/core\": \"^11.0.0-dev.20260313\",\n \"@nestia/fetcher\": \"^11.0.0-dev.20260313\",\n \"@nestia/sdk\": \"^11.0.0-dev.20260313\",\n \"@nestjs/common\": \"^11.1.12\",\n \"@nestjs/core\": \"^11.1.12\",\n \"@nestjs/platform-express\": \"^11.1.12\",\n \"commander\": \"10.0.0\",\n \"dotenv\": \"^16.3.1\",\n \"dotenv-expand\": \"^10.0.0\",\n \"inquirer\": \"8.2.5\",\n \"serialize-error\": \"^4.1.0\",\n \"tgrid\": \"^1.1.0\",\n \"tstl\": \"^3.0.0\",\n \"typia\": \"^11.0.3\",\n \"uuid\": \"^9.0.0\"\n },\n \"stackblitz\": {\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test -- --simultaneous 1\"\n }\n}",
15
+ "package.json": "{\n \"private\": true,\n \"name\": \"@ORGANIZATION/PROJECT\",\n \"version\": \"0.1.0\",\n \"description\": \"Starter kit of Nestia\",\n \"main\": \"lib/index.js\",\n \"scripts\": {\n \"benchmark\": \"node bin/test/benchmark\",\n \"test\": \"node bin/test\",\n \"test:webpack\": \"npm run webpack && node bin/test/webpack.js\",\n \"------------------------BUILDS------------------------\": \"\",\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\n \"build:api\": \"rimraf packages/api/lib && nestia all && rimraf packages/api/lib && tsc -p packages/api/tsconfig.json && rollup -c packages/api/rollup.config.js\",\n \"build:main\": \"rimraf lib && tsc\",\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\n \"build:swagger\": \"npx nestia swagger\",\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\n \"dev\": \"npm run build:test -- --watch\",\n \"eslint\": \"eslint src && eslint test\",\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\n \"prepare\": \"ts-patch install && ts-node build/env.ts\",\n \"prettier\": \"prettier src --write && prettier test --write\",\n \"------------------------WEBPACK------------------------\": \"\",\n \"webpack\": \"rimraf dist && webpack\",\n \"webpack:start\": \"cd dist && node dist/server\",\n \"webpack:test\": \"npm run webpack && node bin/test/webpack.js\",\n \"------------------------DEPLOYS------------------------\": \"\",\n \"package:api\": \"npm run build:api && cd packages/api && npm publish\",\n \"start\": \"node lib/executable/server\",\n \"start:dev\": \"nest start --watch\",\n \"start:swagger\": \"ts-node src/executable/swagger.ts\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/samchon/nestia-start\"\n },\n \"keywords\": [\n \"nestia\",\n \"template\",\n \"boilerplate\"\n ],\n \"author\": \"AUTHOR\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/samchon/nestia-start/issues\"\n },\n \"homepage\": \"https://github.com/samchon/nestia-start#readme\",\n \"devDependencies\": {\n \"@autobe/interface\": \"^0.10.6\",\n \"@nestia/benchmark\": \"^11.0.0-dev.20260313-3\",\n \"@nestia/e2e\": \"^11.0.0-dev.20260313-3\",\n \"@nestjs/cli\": \"^11.0.16\",\n \"@rollup/plugin-terser\": \"^0.4.4\",\n \"@rollup/plugin-typescript\": \"^11.1.6\",\n \"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\n \"@types/cli\": \"^0.11.21\",\n \"@types/cli-progress\": \"^3.11.5\",\n \"@types/express\": \"^4.17.21\",\n \"@types/inquirer\": \"^8.2.5\",\n \"@types/node\": \"^18.11.0\",\n \"@types/uuid\": \"^8.3.4\",\n \"@typescript-eslint/eslint-plugin\": \"^8.1.0\",\n \"@typescript-eslint/parser\": \"^8.1.0\",\n \"chalk\": \"^4.1.2\",\n \"cli\": \"^1.0.1\",\n \"cli-progress\": \"^3.12.0\",\n \"copy-webpack-plugin\": \"^11.0.0\",\n \"eslint-plugin-deprecation\": \"^3.0.0\",\n \"express\": \"^4.18.2\",\n \"nestia\": \"^11.0.0-dev.20260313-3\",\n \"prettier\": \"^3.2.4\",\n \"prettier-plugin-prisma\": \"^5.0.0\",\n \"rimraf\": \"^3.0.2\",\n \"rollup\": \"^4.18.0\",\n \"source-map-support\": \"^0.5.21\",\n \"swagger-ui-express\": \"^5.0.0\",\n \"ts-loader\": \"^9.5.1\",\n \"ts-node\": \"^10.9.1\",\n \"ts-patch\": \"^3.3.0\",\n \"typescript\": \"~5.9.3\",\n \"typescript-transform-paths\": \"^3.5.6\",\n \"webpack\": \"^5.89.0\",\n \"webpack-cli\": \"^5.1.4\",\n \"write-file-webpack-plugin\": \"^4.5.1\"\n },\n \"dependencies\": {\n \"@nestia/core\": \"^11.0.0-dev.20260313-3\",\n \"@nestia/fetcher\": \"^11.0.0-dev.20260313-3\",\n \"@nestia/sdk\": \"^11.0.0-dev.20260313-3\",\n \"@nestjs/common\": \"^11.1.12\",\n \"@nestjs/core\": \"^11.1.12\",\n \"@nestjs/platform-express\": \"^11.1.12\",\n \"commander\": \"10.0.0\",\n \"dotenv\": \"^16.3.1\",\n \"dotenv-expand\": \"^10.0.0\",\n \"inquirer\": \"8.2.5\",\n \"serialize-error\": \"^4.1.0\",\n \"tgrid\": \"^1.1.0\",\n \"tstl\": \"^3.0.0\",\n \"typia\": \"^11.0.3\",\n \"uuid\": \"^9.0.0\"\n },\n \"stackblitz\": {\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test -- --simultaneous 1\"\n }\n}",
16
16
  "packages/api/.gitignore": "lib/\r\nnode_modules/\r\n\r\nswagger.json\r\nopenai.json",
17
17
  "packages/api/LICENSE": "MIT License\r\n\r\nCopyright (c) 2021 ORGANIZATION\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.",
18
18
  "packages/api/package.json": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"module\": \"lib/index.mjs\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"package.json\",\r\n \"swagger.json\",\r\n \"openai.json\",\r\n \"README.md\"\r\n ],\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^10.0.2\",\r\n \"tgrid\": \"^1.2.1\",\r\n \"typia\": \"^11.0.3\"\r\n }\r\n}",
@@ -4,7 +4,7 @@ export const SDK_TEMPLATE: Record<string, string> = {
4
4
  ".vscode/settings.json": "{\r\n \"editor.tabSize\": 2,\r\n \"editor.formatOnSave\": true,\r\n \"[javascript][typescript]\": {\r\n \"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\r\n \"editor.codeActionsOnSave\": {\r\n \"source.fixAll.eslint\": \"explicit\"\r\n },\r\n },\r\n}",
5
5
  "hello.js": "function print(command, description) {\r\n return console.log(`\\x1b[1m${command}\\x1b[2m: ${description}\\x1b[0m`);\r\n}\r\n\r\nconsole.log(\"-----------------------------------------\");\r\nconsole.log(\"\\x1b[7mGenerated by \\x1b[2m@nestia/editor\\x1b[0m\");\r\nconsole.log(\"\");\r\nconsole.log(\" - \\x1b[36mhttps://nestia.io/docs/editor\\x1b[0m\");\r\nconsole.log(\" - \\x1b[36mhttps://github.com/samchon/nestia\\x1b[0m\");\r\nconsole.log(\"-----------------------------------------\");\r\n\r\nprint(\"npm run start\", \"Run only test/start.ts\");\r\nprint(\"npm run test\", \"Run every test/features/**/*.ts files\");\r\nprint(\"npm run test:simulate\", \"Test with mockup simulator\");\r\n",
6
6
  "LICENSE": "MIT License\r\n\r\nCopyright (c) 2024 Jeongho Nam\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n",
7
- "package.json": "{\n \"name\": \"@ORGANIZATION/PROJECT-api\",\n \"version\": \"0.1.0\",\n \"description\": \"SDK library generated by Nestia\",\n \"main\": \"lib/index.js\",\n \"module\": \"lib/index.mjs\",\n \"typings\": \"lib/index.d.ts\",\n \"scripts\": {\n \"build\": \"rimraf lib && tsc && rollup -c\",\n \"build:test\": \"rimraf bin && tsc --project test/tsconfig.json\",\n \"deploy\": \"npm run build && npm publish\",\n \"dev\": \"npm run build:test -- --watch\",\n \"hello\": \"node hello\",\n \"prepare\": \"ts-patch install && typia patch\",\n \"start\": \"ts-node test/start.ts\",\n \"swagger\": \"ts-node test/swagger.ts\",\n \"test\": \"ts-node test/index.ts\",\n \"test:simulate\": \"ts-node test/index.ts --simulate true\",\n \"test:manual\": \"ts-node test/manual.ts\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/samchon/nestia\"\n },\n \"author\": \"Jeongho Nam\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/samchon/nestia/issues\"\n },\n \"homepage\": \"https://nestia.io\",\n \"files\": [\n \"lib\",\n \"swagger.json\",\n \"package.json\",\n \"README.md\"\n ],\n \"dependencies\": {\n \"@nestia/fetcher\": \"^11.0.0-dev.20260313\",\n \"tgrid\": \"^1.2.1\",\n \"typia\": \"^11.0.3\"\n },\n \"devDependencies\": {\n \"@nestia/e2e\": \"^11.0.0-dev.20260313\",\n \"@rollup/plugin-terser\": \"^0.4.4\",\n \"@rollup/plugin-typescript\": \"^11.1.6\",\n \"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\n \"@types/express\": \"^4.17.21\",\n \"@types/inquirer\": \"8.2.5\",\n \"@types/swagger-ui-express\": \"^4.1.6\",\n \"chalk\": \"4.1.2\",\n \"commander\": \"^10.0.0\",\n \"express\": \"^4.19.2\",\n \"inquirer\": \"8.2.5\",\n \"prettier\": \"^3.2.5\",\n \"rimraf\": \"^5.0.5\",\n \"rollup\": \"^4.13.2\",\n \"swagger-ui-express\": \"^5.0.0\",\n \"ts-node\": \"^10.9.2\",\n \"ts-patch\": \"^3.3.0\",\n \"typescript\": \"~5.9.3\",\n \"typescript-transform-paths\": \"^3.5.6\"\n }\n}",
7
+ "package.json": "{\n \"name\": \"@ORGANIZATION/PROJECT-api\",\n \"version\": \"0.1.0\",\n \"description\": \"SDK library generated by Nestia\",\n \"main\": \"lib/index.js\",\n \"module\": \"lib/index.mjs\",\n \"typings\": \"lib/index.d.ts\",\n \"scripts\": {\n \"build\": \"rimraf lib && tsc && rollup -c\",\n \"build:test\": \"rimraf bin && tsc --project test/tsconfig.json\",\n \"deploy\": \"npm run build && npm publish\",\n \"dev\": \"npm run build:test -- --watch\",\n \"hello\": \"node hello\",\n \"prepare\": \"ts-patch install && typia patch\",\n \"start\": \"ts-node test/start.ts\",\n \"swagger\": \"ts-node test/swagger.ts\",\n \"test\": \"ts-node test/index.ts\",\n \"test:simulate\": \"ts-node test/index.ts --simulate true\",\n \"test:manual\": \"ts-node test/manual.ts\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/samchon/nestia\"\n },\n \"author\": \"Jeongho Nam\",\n \"license\": \"MIT\",\n \"bugs\": {\n \"url\": \"https://github.com/samchon/nestia/issues\"\n },\n \"homepage\": \"https://nestia.io\",\n \"files\": [\n \"lib\",\n \"swagger.json\",\n \"package.json\",\n \"README.md\"\n ],\n \"dependencies\": {\n \"@nestia/fetcher\": \"^11.0.0-dev.20260313-3\",\n \"tgrid\": \"^1.2.1\",\n \"typia\": \"^11.0.3\"\n },\n \"devDependencies\": {\n \"@nestia/e2e\": \"^11.0.0-dev.20260313-3\",\n \"@rollup/plugin-terser\": \"^0.4.4\",\n \"@rollup/plugin-typescript\": \"^11.1.6\",\n \"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\n \"@types/express\": \"^4.17.21\",\n \"@types/inquirer\": \"8.2.5\",\n \"@types/swagger-ui-express\": \"^4.1.6\",\n \"chalk\": \"4.1.2\",\n \"commander\": \"^10.0.0\",\n \"express\": \"^4.19.2\",\n \"inquirer\": \"8.2.5\",\n \"prettier\": \"^3.2.5\",\n \"rimraf\": \"^5.0.5\",\n \"rollup\": \"^4.13.2\",\n \"swagger-ui-express\": \"^5.0.0\",\n \"ts-node\": \"^10.9.2\",\n \"ts-patch\": \"^3.3.0\",\n \"typescript\": \"~5.9.3\",\n \"typescript-transform-paths\": \"^3.5.6\"\n }\n}",
8
8
  "prettier.config.js": "module.exports = {\r\n // DEFAULT CONFIGURATIONS\r\n parser: \"typescript\",\r\n printWidth: 80,\r\n semi: true,\r\n tabWidth: 2,\r\n trailingComma: \"all\",\r\n\r\n // PLUG-IN CONFIGURATIONS\r\n plugins: [\"@trivago/prettier-plugin-sort-imports\"],\r\n importOrder: [\"<THIRD_PARTY_MODULES>\", \"^[./]\"],\r\n importOrderSeparation: true,\r\n importOrderSortSpecifiers: true,\r\n importOrderParserPlugins: [\"decorators-legacy\", \"typescript\", \"jsx\"],\r\n};\r\n",
9
9
  "README.md": "# Software Development Kit\r\nThis is a SDK library generated by [`@nestia/migrate`](https://nestia.io/docs/migrate) or [`@nestia/editor`](https://nestia.io/docs/editor).\r\n\r\nWith this SDK library, you can easily and safely interact with backend server.\r\n\r\nJust import and call some API functions like gif image below:\r\n\r\n![nestia-sdk-demo](https://user-images.githubusercontent.com/13158709/215004990-368c589d-7101-404e-b81b-fbc936382f05.gif)\r\n\r\n> Left is server code, and right is client code utilizing the SDK\r\n\r\n\r\n\r\n\r\n## How to Test\r\n```bash\r\nnpm install\r\nnpm start # run only \"test/start.ts\" file\r\nnpm run test # everything under the \"test/features\" directory\r\nnpm run test:simulate # \"test/features\" with mockup simulation mode\r\n```\r\n\r\nIf you run `npm start` command, only [test/start.ts](test/start.ts) file would be executed.\r\n\r\nOtherwise you run `npm run test` command instead, run everything in the [test/features](test/features) directory.\r\n\r\nFor reference, the [test/features](test/features) directory and E2E test functions (for each API endpoints) would be automatically composed only when you've configured the \"E2E test function generation mode\" of the `@nestia/migrate` (or `@nestia/editor`).\r\n\r\n```bash\r\nnpm install -g @nestia/migrate\r\nnpx @nestia/migrate\r\n? Migration mode (Use arrow keys):\r\n NestJS\r\n > SDK\r\n? Swagger file location: assets/input/clickhouse.json\r\n? Output directory path: assets/output/clickhouse-sdk-manual\r\n? Mokup Simulator: true\r\n? E2E Test Functions: true\r\n```\r\n\r\n\r\n\r\n\r\n## Deploy\r\n```bash\r\nnpm install\r\nnpm run deploy\r\n```\r\n\r\nJust run `npm run deploy` command, then your SDK library would be published.\r\n\r\nBy the way, the initial package name of this template repository is `@ORGANIZATION/PROJECT-api`. I think it would better to change the word to your own organization and project name. If you're utilizing `VsCode`, you can do it through `Edit > Replace in Files` (*Ctrl + Shift + H*) feature.\r\n\r\n-----------\r\n\r\n> ## What [`Nestia`](https://nestia.io) is:\r\n> ![Nestia Logo](https://nestia.io/logo.png)\r\n> \r\n> [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/nestia/blob/master/LICENSE)\r\n> [![npm version](https://img.shields.io/npm/v/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core)\r\n> [![Downloads](https://img.shields.io/npm/dm/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core)\r\n> [![Build Status](https://github.com/samchon/nestia/workflows/build/badge.svg)](https://github.com/samchon/nestia/actions?query=workflow%3Abuild)\r\n> [![Guide Documents](https://img.shields.io/badge/guide-documents-forestgreen)](https://nestia.io/docs/)\r\n> \r\n> Nestia is a set of helper libraries for NestJS, supporting below features:\r\n> \r\n> - `@nestia/core`: Super-fast decorators\r\n> - `@nestia/sdk`:\r\n> - Swagger generator evolved than ever\r\n> - SDK library generator for clients\r\n> - Mockup Simulator for client applications\r\n> - Automatic E2E test functions generator\r\n> - `@nestia/migrate`: Migration from Swagger to NestJS\r\n> - `@nestia/editor`: Online TypeScript Swagger Editor\r\n> - `nestia`: Just CLI (command line interface) tool\r\n> \r\n>> **Note**\r\n>> \r\n>> - **Only one line** required, with pure TypeScript type\r\n>> - Enhance performance **30x** up\r\n>> - Runtime validator is **20,000x faster** than `class-validator`\r\n>> - JSON serialization is **200x faster** than `class-transformer`\r\n>> - Software Development Kit\r\n>> - SDK is a collection of `fetch` functions with type definitions like [tRPC](https://> trpc.io/)\r\n>> - Mockup simulator means embedded backend simulator in SDK\r\n>> - similar with [msw](https://mswjs.io/), but fully automated",
10
10
  "rollup.config.js": "const typescript = require(\"@rollup/plugin-typescript\");\r\nconst terser = require(\"@rollup/plugin-terser\");\r\n\r\nmodule.exports = {\r\n input: \"./src/index.ts\",\r\n output: {\r\n dir: \"lib\",\r\n format: \"esm\",\r\n entryFileNames: \"[name].mjs\",\r\n sourcemap: true,\r\n },\r\n plugins: [\r\n typescript({\r\n tsconfig: \"tsconfig.json\",\r\n module: \"ES2020\",\r\n target: \"ES2020\",\r\n }),\r\n terser({\r\n format: {\r\n comments: \"some\",\r\n beautify: true,\r\n ecma: \"2020\",\r\n },\r\n compress: false,\r\n mangle: false,\r\n module: true,\r\n }),\r\n ],\r\n};\r\n",