@nestia/migrate 7.0.0-dev.20250607 → 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 (54) 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 +70 -70
  9. package/lib/index.mjs.map +1 -1
  10. package/lib/programmers/NestiaMigrateApiProgrammer.js +1 -1
  11. package/lib/programmers/NestiaMigrateApiProgrammer.js.map +1 -1
  12. package/lib/utils/openapi-down-convert/converter.js +2 -2
  13. package/package.json +7 -7
  14. package/src/NestiaMigrateApplication.ts +144 -144
  15. package/src/analyzers/NestiaMigrateControllerAnalyzer.ts +51 -51
  16. package/src/archivers/NestiaMigrateFileArchiver.ts +28 -28
  17. package/src/bundles/NEST_TEMPLATE.ts +47 -47
  18. package/src/bundles/SDK_TEMPLATE.ts +21 -21
  19. package/src/executable/NestiaMigrateCommander.ts +98 -98
  20. package/src/executable/NestiaMigrateInquirer.ts +106 -106
  21. package/src/executable/bundle.js +129 -129
  22. package/src/executable/migrate.ts +7 -7
  23. package/src/factories/TypeLiteralFactory.ts +57 -57
  24. package/src/index.ts +4 -4
  25. package/src/module.ts +2 -2
  26. package/src/programmers/NestiaMigrateApiFileProgrammer.ts +55 -55
  27. package/src/programmers/NestiaMigrateApiFunctionProgrammer.ts +256 -256
  28. package/src/programmers/NestiaMigrateApiNamespaceProgrammer.ts +515 -515
  29. package/src/programmers/NestiaMigrateApiProgrammer.ts +107 -107
  30. package/src/programmers/NestiaMigrateApiSimulationProgrammer.ts +340 -340
  31. package/src/programmers/NestiaMigrateApiStartProgrammer.ts +198 -198
  32. package/src/programmers/NestiaMigrateDtoProgrammer.ts +101 -101
  33. package/src/programmers/NestiaMigrateE2eFileProgrammer.ts +153 -153
  34. package/src/programmers/NestiaMigrateE2eProgrammer.ts +46 -46
  35. package/src/programmers/NestiaMigrateImportProgrammer.ts +118 -118
  36. package/src/programmers/NestiaMigrateNestControllerProgrammer.ts +66 -66
  37. package/src/programmers/NestiaMigrateNestMethodProgrammer.ts +406 -406
  38. package/src/programmers/NestiaMigrateNestModuleProgrammer.ts +65 -65
  39. package/src/programmers/NestiaMigrateNestProgrammer.ts +88 -88
  40. package/src/programmers/NestiaMigrateSchemaProgrammer.ts +475 -475
  41. package/src/structures/INestiaMigrateConfig.ts +10 -10
  42. package/src/structures/INestiaMigrateContext.ts +15 -15
  43. package/src/structures/INestiaMigrateController.ts +8 -8
  44. package/src/structures/INestiaMigrateDto.ts +8 -8
  45. package/src/structures/INestiaMigrateFile.ts +5 -5
  46. package/src/structures/INestiaMigrateProgram.ts +11 -11
  47. package/src/structures/INestiaMigrateSchema.ts +4 -4
  48. package/src/utils/FilePrinter.ts +38 -38
  49. package/src/utils/MapUtil.ts +13 -13
  50. package/src/utils/OpenApiTypeChecker.ts +73 -73
  51. package/src/utils/SetupWizard.ts +12 -12
  52. package/src/utils/StringUtil.ts +113 -113
  53. package/src/utils/openapi-down-convert/RefVisitor.ts +139 -139
  54. 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
+ }