@nestia/migrate 7.0.0-dev.20250608 → 7.0.0

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 (52) hide show
  1. package/README.md +92 -92
  2. package/lib/analyzers/NestiaMigrateControllerAnalyzer.js +1 -1
  3. package/lib/analyzers/NestiaMigrateControllerAnalyzer.js.map +1 -1
  4. package/lib/bundles/NEST_TEMPLATE.js +47 -47
  5. package/lib/bundles/NEST_TEMPLATE.js.map +1 -1
  6. package/lib/bundles/SDK_TEMPLATE.js +21 -21
  7. package/lib/bundles/SDK_TEMPLATE.js.map +1 -1
  8. package/lib/index.mjs +69 -69
  9. package/lib/index.mjs.map +1 -1
  10. package/lib/utils/openapi-down-convert/converter.js +2 -2
  11. package/package.json +7 -7
  12. package/src/NestiaMigrateApplication.ts +144 -144
  13. package/src/analyzers/NestiaMigrateControllerAnalyzer.ts +51 -51
  14. package/src/archivers/NestiaMigrateFileArchiver.ts +28 -28
  15. package/src/bundles/NEST_TEMPLATE.ts +47 -47
  16. package/src/bundles/SDK_TEMPLATE.ts +21 -21
  17. package/src/executable/NestiaMigrateCommander.ts +98 -98
  18. package/src/executable/NestiaMigrateInquirer.ts +106 -106
  19. package/src/executable/bundle.js +129 -129
  20. package/src/executable/migrate.ts +7 -7
  21. package/src/factories/TypeLiteralFactory.ts +57 -57
  22. package/src/index.ts +4 -4
  23. package/src/module.ts +2 -2
  24. package/src/programmers/NestiaMigrateApiFileProgrammer.ts +55 -55
  25. package/src/programmers/NestiaMigrateApiFunctionProgrammer.ts +256 -256
  26. package/src/programmers/NestiaMigrateApiNamespaceProgrammer.ts +515 -515
  27. package/src/programmers/NestiaMigrateApiProgrammer.ts +107 -107
  28. package/src/programmers/NestiaMigrateApiSimulationProgrammer.ts +340 -340
  29. package/src/programmers/NestiaMigrateApiStartProgrammer.ts +198 -198
  30. package/src/programmers/NestiaMigrateDtoProgrammer.ts +101 -101
  31. package/src/programmers/NestiaMigrateE2eFileProgrammer.ts +153 -153
  32. package/src/programmers/NestiaMigrateE2eProgrammer.ts +46 -46
  33. package/src/programmers/NestiaMigrateImportProgrammer.ts +118 -118
  34. package/src/programmers/NestiaMigrateNestControllerProgrammer.ts +66 -66
  35. package/src/programmers/NestiaMigrateNestMethodProgrammer.ts +406 -406
  36. package/src/programmers/NestiaMigrateNestModuleProgrammer.ts +65 -65
  37. package/src/programmers/NestiaMigrateNestProgrammer.ts +88 -88
  38. package/src/programmers/NestiaMigrateSchemaProgrammer.ts +475 -475
  39. package/src/structures/INestiaMigrateConfig.ts +10 -10
  40. package/src/structures/INestiaMigrateContext.ts +15 -15
  41. package/src/structures/INestiaMigrateController.ts +8 -8
  42. package/src/structures/INestiaMigrateDto.ts +8 -8
  43. package/src/structures/INestiaMigrateFile.ts +5 -5
  44. package/src/structures/INestiaMigrateProgram.ts +11 -11
  45. package/src/structures/INestiaMigrateSchema.ts +4 -4
  46. package/src/utils/FilePrinter.ts +38 -38
  47. package/src/utils/MapUtil.ts +13 -13
  48. package/src/utils/OpenApiTypeChecker.ts +73 -73
  49. package/src/utils/SetupWizard.ts +12 -12
  50. package/src/utils/StringUtil.ts +113 -113
  51. package/src/utils/openapi-down-convert/RefVisitor.ts +139 -139
  52. package/src/utils/openapi-down-convert/converter.ts +527 -527
@@ -1,66 +1,66 @@
1
- import { OpenApi } from "@samchon/openapi";
2
- import ts from "typescript";
3
-
4
- import { INestiaMigrateConfig } from "../structures/INestiaMigrateConfig";
5
- import { INestiaMigrateController } from "../structures/INestiaMigrateController";
6
- import { FilePrinter } from "../utils/FilePrinter";
7
- import { StringUtil } from "../utils/StringUtil";
8
- import { NestiaMigrateImportProgrammer } from "./NestiaMigrateImportProgrammer";
9
- import { NestiaMigrateNestMethodProgrammer } from "./NestiaMigrateNestMethodProgrammer";
10
-
11
- export namespace NestiaMigrateNestControllerProgrammer {
12
- export interface IProps {
13
- config: INestiaMigrateConfig;
14
- components: OpenApi.IComponents;
15
- controller: INestiaMigrateController;
16
- }
17
-
18
- export const write = (props: IProps): ts.Statement[] => {
19
- const importer: NestiaMigrateImportProgrammer =
20
- new NestiaMigrateImportProgrammer();
21
- const $class = ts.factory.createClassDeclaration(
22
- [
23
- ts.factory.createDecorator(
24
- ts.factory.createCallExpression(
25
- ts.factory.createIdentifier(
26
- importer.external({
27
- type: "instance",
28
- library: "@nestjs/common",
29
- name: "Controller",
30
- }),
31
- ),
32
- [],
33
- [ts.factory.createStringLiteral(props.controller.path)],
34
- ),
35
- ),
36
- ts.factory.createToken(ts.SyntaxKind.ExportKeyword),
37
- ],
38
- props.controller.name,
39
- [],
40
- [],
41
- props.controller.routes
42
- .map((route, index) => [
43
- ...(index !== 0 ? [FilePrinter.newLine() as any] : []),
44
- NestiaMigrateNestMethodProgrammer.write({
45
- config: props.config,
46
- components: props.components,
47
- controller: props.controller,
48
- importer,
49
- route,
50
- }),
51
- ])
52
- .flat(),
53
- );
54
- return [
55
- ...importer.toStatements(
56
- (ref) =>
57
- `${"../".repeat(
58
- StringUtil.splitWithNormalization(props.controller.location)
59
- .length - 1,
60
- )}api/structures/${ref}`,
61
- ),
62
- ...(importer.empty() ? [] : [FilePrinter.newLine()]),
63
- $class,
64
- ];
65
- };
66
- }
1
+ import { OpenApi } from "@samchon/openapi";
2
+ import ts from "typescript";
3
+
4
+ import { INestiaMigrateConfig } from "../structures/INestiaMigrateConfig";
5
+ import { INestiaMigrateController } from "../structures/INestiaMigrateController";
6
+ import { FilePrinter } from "../utils/FilePrinter";
7
+ import { StringUtil } from "../utils/StringUtil";
8
+ import { NestiaMigrateImportProgrammer } from "./NestiaMigrateImportProgrammer";
9
+ import { NestiaMigrateNestMethodProgrammer } from "./NestiaMigrateNestMethodProgrammer";
10
+
11
+ export namespace NestiaMigrateNestControllerProgrammer {
12
+ export interface IProps {
13
+ config: INestiaMigrateConfig;
14
+ components: OpenApi.IComponents;
15
+ controller: INestiaMigrateController;
16
+ }
17
+
18
+ export const write = (props: IProps): ts.Statement[] => {
19
+ const importer: NestiaMigrateImportProgrammer =
20
+ new NestiaMigrateImportProgrammer();
21
+ const $class = ts.factory.createClassDeclaration(
22
+ [
23
+ ts.factory.createDecorator(
24
+ ts.factory.createCallExpression(
25
+ ts.factory.createIdentifier(
26
+ importer.external({
27
+ type: "instance",
28
+ library: "@nestjs/common",
29
+ name: "Controller",
30
+ }),
31
+ ),
32
+ [],
33
+ [ts.factory.createStringLiteral(props.controller.path)],
34
+ ),
35
+ ),
36
+ ts.factory.createToken(ts.SyntaxKind.ExportKeyword),
37
+ ],
38
+ props.controller.name,
39
+ [],
40
+ [],
41
+ props.controller.routes
42
+ .map((route, index) => [
43
+ ...(index !== 0 ? [FilePrinter.newLine() as any] : []),
44
+ NestiaMigrateNestMethodProgrammer.write({
45
+ config: props.config,
46
+ components: props.components,
47
+ controller: props.controller,
48
+ importer,
49
+ route,
50
+ }),
51
+ ])
52
+ .flat(),
53
+ );
54
+ return [
55
+ ...importer.toStatements(
56
+ (ref) =>
57
+ `${"../".repeat(
58
+ StringUtil.splitWithNormalization(props.controller.location)
59
+ .length - 1,
60
+ )}api/structures/${ref}`,
61
+ ),
62
+ ...(importer.empty() ? [] : [FilePrinter.newLine()]),
63
+ $class,
64
+ ];
65
+ };
66
+ }