@nestia/migrate 12.0.0-rc.4 → 12.1.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 (27) hide show
  1. package/lib/bundles/NEST_TEMPLATE.js +7 -6
  2. package/lib/bundles/NEST_TEMPLATE.js.map +1 -1
  3. package/lib/bundles/NEST_TEMPLATE.mjs +7 -6
  4. package/lib/bundles/SDK_TEMPLATE.js +7 -8
  5. package/lib/bundles/SDK_TEMPLATE.js.map +1 -1
  6. package/lib/bundles/SDK_TEMPLATE.mjs +7 -8
  7. package/lib/programmers/NestiaMigrateApiProgrammer.js +7 -0
  8. package/lib/programmers/NestiaMigrateApiProgrammer.js.map +1 -1
  9. package/lib/programmers/NestiaMigrateApiProgrammer.mjs +7 -0
  10. package/lib/programmers/NestiaMigrateApiStartProgrammer.js +23 -12
  11. package/lib/programmers/NestiaMigrateApiStartProgrammer.js.map +1 -1
  12. package/lib/programmers/NestiaMigrateApiStartProgrammer.mjs +6 -5
  13. package/lib/programmers/NestiaMigrateImportProgrammer.js +2 -2
  14. package/lib/programmers/NestiaMigrateImportProgrammer.js.map +1 -1
  15. package/lib/programmers/NestiaMigrateImportProgrammer.mjs +3 -3
  16. package/lib/programmers/NestiaMigrateNestModuleProgrammer.js +1 -1
  17. package/lib/programmers/NestiaMigrateNestModuleProgrammer.js.map +1 -1
  18. package/lib/programmers/NestiaMigrateNestModuleProgrammer.mjs +1 -1
  19. package/package.json +8 -8
  20. package/src/bundles/NEST_TEMPLATE.ts +7 -6
  21. package/src/bundles/SDK_TEMPLATE.ts +7 -8
  22. package/src/executable/bundle.js +24 -25
  23. package/src/programmers/NestiaMigrateApiProgrammer.ts +7 -0
  24. package/src/programmers/NestiaMigrateApiStartProgrammer.ts +34 -26
  25. package/src/programmers/NestiaMigrateImportProgrammer.ts +3 -3
  26. package/src/programmers/NestiaMigrateNestModuleProgrammer.ts +1 -1
  27. package/src/structures/INestiaMigrateConfig.ts +0 -1
@@ -1,14 +1,13 @@
1
1
  //#region src/bundles/SDK_TEMPLATE.ts
2
2
  const SDK_TEMPLATE = {
3
- ".gitignore": ".git/\nbin/\nlib/\nnode_modules/\n\npackage-lock.json\npnpm-lock.yaml",
3
+ ".gitignore": ".git/\nbin/\nlib/\nnode_modules/\n\npackage-lock.json",
4
4
  ".vscode/launch.json": "{\n // Use IntelliSense to learn about possible Node.js debug attributes.\n // Hover to view descriptions of existing attributes.\n // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n \"version\": \"0.2.0\",\n \"configurations\": [\n {\n \"type\": \"node\",\n \"request\": \"launch\",\n \"name\": \"JavaScript Test using SourceMap\",\n \"program\": \"${workspaceRoot}/test/index.ts\",\n \"cwd\": \"${workspaceRoot}\",\n \"args\": [\n //----\n // You can run specific test functions\n //----\n // \"--include\", \"something\",\n // \"--exclude\", \"nothing\",\n ],\n \"outFiles\": [\"${workspaceRoot}/bin/**/*.js\"],\n }\n ]\n}",
5
5
  ".vscode/settings.json": "{\n \"editor.tabSize\": 2,\n \"editor.formatOnSave\": true,\n \"[javascript][typescript]\": {\n \"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\n \"editor.codeActionsOnSave\": {\n \"source.fixAll.eslint\": \"explicit\"\n },\n },\n}",
6
6
  "LICENSE": "MIT License\n\nCopyright (c) 2024 Jeongho Nam\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
7
- "README.md": "# Software Development Kit\nThis is a SDK library generated by [`@nestia/migrate`](https://nestia.io/docs/migrate) or [`@nestia/editor`](https://nestia.io/docs/editor).\n\nWith this SDK library, you can easily and safely interact with backend server.\n\nJust import and call some API functions like gif image below:\n\n![nestia-sdk-demo](https://user-images.githubusercontent.com/13158709/215004990-368c589d-7101-404e-b81b-fbc936382f05.gif)\n\n> Left is server code, and right is client code utilizing the SDK\n\n\n\n\n## How to Test\n```bash\nnpm install\nnpm start # run only \"test/start.ts\" file\nnpm run test # everything under the \"test/features\" directory\nnpm run test:simulate # \"test/features\" with mockup simulation mode\n```\n\nIf you run `npm start` command, only [test/start.ts](test/start.ts) file would be executed.\n\nOtherwise you run `npm run test` command instead, run everything in the [test/features](test/features) directory.\n\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`).\n\n```bash\nnpm install -g @nestia/migrate\nnpx @nestia/migrate\n? Migration mode (Use arrow keys):\n NestJS\n > SDK\n? Swagger file location: assets/input/clickhouse.json\n? Output directory path: assets/output/clickhouse-sdk-manual\n? Mokup Simulator: true\n? E2E Test Functions: true\n```\n\n\n\n\n## Deploy\n```bash\nnpm install\nnpm run deploy\n```\n\nJust run `npm run deploy` command, then your SDK library would be published.\n\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.\n\n-----------\n\n> ## What [`Nestia`](https://nestia.io) is:\n> ![Nestia Logo](https://nestia.io/logo.png)\n> \n> [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/nestia/blob/master/LICENSE)\n> [![npm version](https://img.shields.io/npm/v/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core)\n> [![Downloads](https://img.shields.io/npm/dm/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core)\n> [![Build Status](https://github.com/samchon/nestia/workflows/build/badge.svg)](https://github.com/samchon/nestia/actions?query=workflow%3Abuild)\n> [![Guide Documents](https://img.shields.io/badge/guide-documents-forestgreen)](https://nestia.io/docs/)\n> \n> Nestia is a set of helper libraries for NestJS, supporting below features:\n> \n> - `@nestia/core`: Super-fast decorators\n> - `@nestia/sdk`:\n> - Swagger generator evolved than ever\n> - SDK library generator for clients\n> - Mockup Simulator for client applications\n> - Automatic E2E test functions generator\n> - `@nestia/migrate`: Migration from Swagger to NestJS\n> - `@nestia/editor`: Online TypeScript Swagger Editor\n> - `nestia`: Just CLI (command line interface) tool\n> \n>> **Note**\n>> \n>> - **Only one line** required, with pure TypeScript type\n>> - Enhance performance **30x** up\n>> - Runtime validator is **20,000x faster** than `class-validator`\n>> - JSON serialization is **200x faster** than `class-transformer`\n>> - Software Development Kit\n>> - SDK is a collection of `fetch` functions with type definitions like [tRPC](https://> trpc.io/)\n>> - Mockup simulator means embedded backend simulator in SDK\n>> - similar with [msw](https://mswjs.io/), but fully automated",
8
- "hello.js": "function print(command, description) {\n return console.log(`\\x1b[1m${command}\\x1b[2m: ${description}\\x1b[0m`);\n}\n\nconsole.log(\"-----------------------------------------\");\nconsole.log(\"\\x1b[7mGenerated by \\x1b[2m@nestia/editor\\x1b[0m\");\nconsole.log(\"\");\nconsole.log(\" - \\x1b[36mhttps://nestia.io/docs/editor\\x1b[0m\");\nconsole.log(\" - \\x1b[36mhttps://github.com/samchon/nestia\\x1b[0m\");\nconsole.log(\"-----------------------------------------\");\n\nprint(\"npm run start\", \"Run only test/start.ts\");\nprint(\"npm run test\", \"Run every test/features/**/*.ts files\");\nprint(\"npm run test:simulate\", \"Test with mockup simulator\");\n",
9
- "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 && ttsc && rollup -c\",\n \"build:test\": \"rimraf bin && ttsc --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\",\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 },\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\": \"^12.0.0-rc.3\",\n \"tgrid\": \"^1.2.1\",\n \"typia\": \"^13.0.1\"\n },\n \"devDependencies\": {\n \"@nestia/e2e\": \"^12.0.0-rc.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/swagger-ui-express\": \"^4.1.6\",\n \"chalk\": \"4.1.2\",\n \"express\": \"^4.19.2\",\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\": \"^4.0.1\",\n \"typescript\": \"~6.0.3\",\n \"ttsc\": \"^0.18.1\",\n \"@nestia/core\": \"^12.0.0-rc.3\"\n }\n}",
10
- "prettier.config.js": "module.exports = {\n // DEFAULT CONFIGURATIONS\n parser: \"typescript\",\n printWidth: 80,\n semi: true,\n tabWidth: 2,\n trailingComma: \"all\",\n\n // PLUG-IN CONFIGURATIONS\n plugins: [\"@trivago/prettier-plugin-sort-imports\"],\n importOrder: [\"<THIRD_PARTY_MODULES>\", \"^[./]\"],\n importOrderSeparation: true,\n importOrderSortSpecifiers: true,\n importOrderParserPlugins: [\"decorators-legacy\", \"typescript\", \"jsx\"],\n};\n",
11
- "rollup.config.js": "const typescript = require(\"@rollup/plugin-typescript\");\nconst terser = require(\"@rollup/plugin-terser\");\n\nmodule.exports = {\n input: \"./src/index.ts\",\n output: {\n dir: \"lib\",\n format: \"esm\",\n entryFileNames: \"[name].mjs\",\n sourcemap: true,\n },\n plugins: [\n typescript({\n tsconfig: \"tsconfig.json\",\n module: \"ES2020\",\n target: \"ES2020\",\n }),\n terser({\n format: {\n comments: \"some\",\n beautify: true,\n ecma: \"2020\",\n },\n compress: false,\n mangle: false,\n module: true,\n }),\n ],\n};\n",
7
+ "README.md": "# Software Development Kit\nThis is a SDK library generated by [`@nestia/migrate`](https://nestia.io/docs/migrate) or [`@nestia/editor`](https://nestia.io/docs/editor).\n\nWith this SDK library, you can easily and safely interact with backend server.\n\nJust import and call some API functions like gif image below:\n\n![nestia-sdk-demo](https://user-images.githubusercontent.com/13158709/215004990-368c589d-7101-404e-b81b-fbc936382f05.gif)\n\n> Left is server code, and right is client code utilizing the SDK\n\n\n\n\n## How to Test\n```bash\npnpm install\npnpm run start # run only \"test/start.ts\" file\npnpm run test # everything under the \"test/features\" directory\npnpm run test:simulate # \"test/features\" with mockup simulation mode\n```\n\nIf you run `pnpm run start` command, only [test/start.ts](test/start.ts) file would be executed.\n\nOtherwise you run `pnpm run test` command instead, run everything in the [test/features](test/features) directory.\n\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`).\n\n```bash\npnpm dlx @nestia/migrate\n? Migration mode (Use arrow keys):\n NestJS\n > SDK\n? Swagger file location: assets/input/clickhouse.json\n? Output directory path: assets/output/clickhouse-sdk-manual\n? Mokup Simulator: true\n? E2E Test Functions: true\n```\n\n\n\n\n## Deploy\n```bash\npnpm install\npnpm run deploy\n```\n\nJust run `pnpm run deploy` command, then your SDK library would be published.\n\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.\n\n-----------\n\n> ## What [`Nestia`](https://nestia.io) is:\n> ![Nestia Logo](https://nestia.io/logo.png)\n> \n> [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/nestia/blob/master/LICENSE)\n> [![npm version](https://img.shields.io/npm/v/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core)\n> [![Downloads](https://img.shields.io/npm/dm/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core)\n> [![Build Status](https://github.com/samchon/nestia/workflows/build/badge.svg)](https://github.com/samchon/nestia/actions?query=workflow%3Abuild)\n> [![Guide Documents](https://img.shields.io/badge/guide-documents-forestgreen)](https://nestia.io/docs/)\n> \n> Nestia is a set of helper libraries for NestJS, supporting below features:\n> \n> - `@nestia/core`: Super-fast decorators\n> - `@nestia/sdk`:\n> - Swagger generator evolved than ever\n> - SDK library generator for clients\n> - Mockup Simulator for client applications\n> - Automatic E2E test functions generator\n> - `@nestia/migrate`: Migration from Swagger to NestJS\n> - `@nestia/editor`: Online TypeScript Swagger Editor\n> - `nestia`: Just CLI (command line interface) tool\n> \n>> **Note**\n>> \n>> - **Only one line** required, with pure TypeScript type\n>> - Enhance performance **30x** up\n>> - Runtime validator is **20,000x faster** than `class-validator`\n>> - JSON serialization is **200x faster** than `class-transformer`\n>> - Software Development Kit\n>> - SDK is a collection of `fetch` functions with type definitions like [tRPC](https://> trpc.io/)\n>> - Mockup simulator means embedded backend simulator in SDK\n>> - similar with [msw](https://mswjs.io/), but fully automated\n",
8
+ "hello.js": "function print(command, description) {\n return console.log(`\\x1b[1m${command}\\x1b[2m: ${description}\\x1b[0m`);\n}\n\nconsole.log(\"-----------------------------------------\");\nconsole.log(\"\\x1b[7mGenerated by \\x1b[2m@nestia/editor\\x1b[0m\");\nconsole.log(\"\");\nconsole.log(\" - \\x1b[36mhttps://nestia.io/docs/editor\\x1b[0m\");\nconsole.log(\" - \\x1b[36mhttps://github.com/samchon/nestia\\x1b[0m\");\nconsole.log(\"-----------------------------------------\");\n\nprint(\"pnpm run start\", \"Run only test/start.ts\");\nprint(\"pnpm run test\", \"Run every test/features/**/*.ts files\");\nprint(\"pnpm run test:simulate\", \"Test with mockup simulator\");\n",
9
+ "package.json": "{\n \"name\": \"@ORGANIZATION/PROJECT-api\",\n \"version\": \"0.1.0\",\n \"description\": \"SDK library generated by Nestia\",\n \"main\": \"src/index.ts\",\n \"exports\": {\n \".\": \"./src/index.ts\",\n \"./lib/*\": \"./src/*.ts\",\n \"./package.json\": \"./package.json\"\n },\n \"publishConfig\": {\n \"main\": \"lib/index.mjs\",\n \"module\": \"lib/index.mjs\",\n \"types\": \"lib/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./lib/index.d.ts\",\n \"import\": \"./lib/index.mjs\",\n \"default\": \"./lib/index.js\"\n },\n \"./lib/*\": {\n \"types\": \"./lib/*.d.ts\",\n \"import\": \"./lib/*.mjs\",\n \"default\": \"./lib/*.js\"\n },\n \"./package.json\": \"./package.json\"\n }\n },\n \"scripts\": {\n \"build\": \"rimraf lib && ttsc && rolldown -c\",\n \"build:test\": \"rimraf bin && ttsc --project test/tsconfig.json\",\n \"deploy\": \"pnpm run build && pnpm publish\",\n \"dev\": \"pnpm run build:test --watch\",\n \"hello\": \"node hello\",\n \"start\": \"ttsx test/start.ts\",\n \"swagger\": \"ttsx test/swagger.ts\",\n \"test\": \"ttsx test/index.ts\",\n \"test:simulate\": \"ttsx test/index.ts --simulate true\"\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\": \"^12.1.0\",\n \"tgrid\": \"^1.2.1\",\n \"typia\": \"^13.2.0\"\n },\n \"devDependencies\": {\n \"@nestia/e2e\": \"^12.1.0\",\n \"@ttsc/unplugin\": \"^0.18.2\",\n \"@types/express\": \"^4.17.21\",\n \"@types/swagger-ui-express\": \"^4.1.6\",\n \"chalk\": \"4.1.2\",\n \"express\": \"^4.19.2\",\n \"rimraf\": \"^5.0.5\",\n \"rolldown\": \"^1.1.5\",\n \"swagger-ui-express\": \"^5.0.0\",\n \"tinyglobby\": \"^0.2.17\",\n \"ttsc\": \"^0.18.2\",\n \"typescript\": \"^7.0.2\",\n \"@nestia/core\": \"^12.1.0\"\n },\n \"packageManager\": \"pnpm@10.19.0\"\n}",
10
+ "rolldown.config.mjs": "import ttsc from \"@ttsc/unplugin/rolldown\";\nimport path from \"node:path\";\nimport { globSync } from \"tinyglobby\";\n\nexport default {\n input: globSync(\"./src/**/*.ts\"),\n external: (id) => !id.startsWith(\".\") && !path.isAbsolute(id),\n output: {\n dir: \"./lib\",\n format: \"esm\",\n sourcemap: true,\n entryFileNames: \"[name].mjs\",\n preserveModules: true,\n preserveModulesRoot: \"src\",\n },\n plugins: [ttsc()],\n};\n",
12
11
  "src/HttpError.ts": "export { HttpError } from \"@nestia/fetcher\";\n",
13
12
  "src/IConnection.ts": "export type { IConnection } from \"@nestia/fetcher\";\n",
14
13
  "src/index.ts": "import * as api from \"./module\";\n\nexport * from \"./module\";\nexport default api;\n",
@@ -18,9 +17,9 @@ const SDK_TEMPLATE = {
18
17
  "test/index.ts": "import { DynamicExecutor } from \"@nestia/e2e\";\nimport chalk from \"chalk\";\n\nimport { TestGlobal } from \"./TestGlobal\";\nimport { ArgumentParser } from \"./utils/ArgumentParser\";\n\ninterface IOptions {\n simulate: boolean;\n include?: string[];\n exclude?: string[];\n trace: boolean;\n}\n\nconst getOptions = () =>\n ArgumentParser.parse<IOptions>(async (command, prompt, action) => {\n command.option(\"--simulate <boolean>\", \"Mockup Simultator\");\n command.option(\"--include <string...>\", \"include feature files\");\n command.option(\"--exclude <string...>\", \"exclude feature files\");\n command.option(\"--trace <boolean>\", \"trace detailed errors\");\n\n return action(async (options) => {\n if (typeof options.simulate === \"string\")\n options.simulate = options.simulate === \"true\";\n options.simulate ??= await prompt.boolean(\"simulate\")(\"Mockup Simulator\");\n options.trace = options.trace !== (\"false\" as any);\n return options as IOptions;\n });\n });\n\nconst main = async (): Promise<void> => {\n // DO TEST\n const options: IOptions = await getOptions();\n const report: DynamicExecutor.IReport = await DynamicExecutor.validate({\n prefix: \"test\",\n location: __dirname + \"/features\",\n extension: __filename.substring(__filename.length - 2),\n parameters: () => [\n {\n ...TestGlobal.connection(),\n simulate: options.simulate,\n },\n ],\n filter: (func) =>\n (!options.include?.length ||\n (options.include ?? []).some((str) => func.includes(str))) &&\n (!options.exclude?.length ||\n (options.exclude ?? []).every((str) => !func.includes(str))),\n onComplete: (exec) => {\n const trace = (str: string) =>\n console.log(` - ${chalk.green(exec.name)}: ${str}`);\n if (exec.error === null) {\n const elapsed: number =\n new Date(exec.completed_at).getTime() -\n new Date(exec.started_at).getTime();\n trace(`${chalk.yellow(elapsed.toLocaleString())} ms`);\n } else trace(chalk.red(exec.error.name));\n },\n });\n\n // REPORT EXCEPTIONS\n const exceptions: Error[] = report.executions\n .filter((exec) => exec.error !== null)\n .map((exec) => exec.error!);\n if (exceptions.length === 0) {\n console.log(\"Success\");\n console.log(\"Elapsed time\", report.time.toLocaleString(), `ms`);\n } else {\n if (options.trace !== false) for (const exp of exceptions) console.log(exp);\n console.log(\"Failed\");\n console.log(\"Elapsed time\", report.time.toLocaleString(), `ms`);\n }\n\n // TERMINATE\n if (exceptions.length) process.exit(-1);\n else process.exit(0);\n};\nmain().catch((exp) => {\n console.log(exp);\n process.exit(-1);\n});\n",
19
18
  "test/start.ts": "import api from \"@ORGANIZATION/PROJECT-api\";\nimport { IBbsArticleComment } from \"@ORGANIZATION/PROJECT-api/lib/structures/bbs/IBbsArticleComment\";\nimport typia, { tags } from \"typia\";\n\nimport { TestGlobal } from \"./TestGlobal\";\n\nconst main = async () => {\n const connection: api.IConnection = {\n ...TestGlobal.connection(),\n simulate: true,\n };\n const output: IBbsArticleComment =\n await api.functional.bbs.articles.comments.create(\n connection,\n typia.random<string & tags.Format<\"uuid\">>(),\n typia.random<IBbsArticleComment.ICreate>(),\n );\n typia.assert(output);\n};\nmain().catch((exp) => {\n console.log(exp);\n process.exit(-1);\n});\n",
20
19
  "test/swagger.ts": "import express from \"express\";\nimport ui from \"swagger-ui-express\";\n\nimport swagger from \"../swagger.json\";\n\nconst main = async (): Promise<void> => {\n const app = express();\n app.use(\"/\", ui.serve, ui.setup(swagger));\n app.listen(3000);\n\n console.log(\"-----------------------------------------------------------\");\n console.log(\"\\n Swagger UI Address: http://127.0.0.1:3000 \\n\");\n console.log(\"-----------------------------------------------------------\");\n};\nmain().catch((exp) => {\n console.log(exp);\n process.exit(-1);\n});\n",
21
- "test/tsconfig.json": "{\n \"extends\": \"../tsconfig.json\",\n \"compilerOptions\": {\n \"noEmit\": true,\n \"paths\": {\n \"@ORGANIZATION/PROJECT-api\": [\"../src\"],\n \"@ORGANIZATION/PROJECT-api/lib/*\": [\"../src/*\"],\n },\n \"plugins\": [\n ],\n \"rootDir\": \"../\",\n },\n \"include\": [\n \".\", \n \"../src\",\n ],\n}",
20
+ "test/tsconfig.json": "{\n \"extends\": \"../tsconfig.json\",\n \"compilerOptions\": {\n \"noEmit\": true,\n \"rootDir\": \"../\",\n },\n \"include\": [\n \".\", \n \"../src\",\n ],\n}",
22
21
  "test/utils/ArgumentParser.ts": "import { createInterface } from \"node:readline/promises\";\n\nexport namespace ArgumentParser {\n export interface Command {\n option: (flags: string, description?: string) => Command;\n }\n\n export interface Prompt {\n select: (\n name: string,\n ) => (\n message: string,\n ) => <Choice extends string>(choices: Choice[]) => Promise<Choice>;\n boolean: (name: string) => (message: string) => Promise<boolean>;\n number: (name: string) => (message: string) => Promise<number>;\n }\n\n export const parse = async <T>(\n inquiry: (\n command: Command,\n prompt: Prompt,\n action: (closure: (options: Partial<T>) => Promise<T>) => Promise<T>,\n ) => Promise<T>,\n ): Promise<T> => {\n const command: Command = {\n option: (_flags: string, _description?: string): Command => command,\n };\n const action = (closure: (options: Partial<T>) => Promise<T>) =>\n closure(parseArguments() as Partial<T>);\n return inquiry(\n command,\n { select, boolean, number },\n action,\n );\n };\n\n const select =\n (_name: string) =>\n (message: string) =>\n async <Choice extends string>(choices: Choice[]): Promise<Choice> => {\n const answer: string = await ask(`${message} (${choices.join(\"/\")})`);\n return (choices.find((choice) => choice === answer) ?? choices[0])!;\n };\n\n const boolean = (_name: string) => async (message: string) =>\n /^(true|t|yes|y|1)$/i.test(await ask(`${message} [y/N]`));\n\n const number = (_name: string) => async (message: string) =>\n Number(await ask(message));\n\n const ask = async (message: string): Promise<string> => {\n const reader = createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n try {\n return (await reader.question(`${message}: `)).trim();\n } finally {\n reader.close();\n }\n };\n\n const parseArguments = (): Record<string, string | string[] | boolean> => {\n const output: Record<string, string | string[] | boolean> = {};\n const args: string[] = process.argv.slice(2);\n for (let i = 0; i < args.length; ++i) {\n const raw: string = args[i]!;\n if (raw.startsWith(\"--\") === false) continue;\n\n const equal: number = raw.indexOf(\"=\");\n const name: string = toCamelCase(\n raw.slice(2, equal === -1 ? undefined : equal),\n );\n if (equal !== -1) {\n assign(output, name, raw.slice(equal + 1));\n continue;\n }\n\n const values: string[] = [];\n while (i + 1 < args.length && args[i + 1]!.startsWith(\"--\") === false)\n values.push(args[++i]!);\n assign(\n output,\n name,\n values.length === 0 ? true : values.length === 1 ? values[0]! : values,\n );\n }\n return output;\n };\n\n const assign = (\n output: Record<string, string | string[] | boolean>,\n name: string,\n value: string | string[] | boolean,\n ): void => {\n const current: string | string[] | boolean | undefined = output[name];\n if (current === undefined) output[name] = value;\n else\n output[name] = [\n ...(Array.isArray(current) ? current : [String(current)]),\n ...(Array.isArray(value) ? value : [String(value)]),\n ];\n };\n\n const toCamelCase = (str: string): string =>\n str.replace(/-([a-z])/g, (_matched, letter: string) =>\n letter.toUpperCase(),\n );\n}\n",
23
- "tsconfig.json": "{\n \"compilerOptions\": {\n /* Visit https://aka.ms/tsconfig to read more about this file */\n /* Projects */\n // \"incremental\": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */\n // \"composite\": true, /* Enable constraints that allow a TypeScript project to be used with project references. */\n // \"tsBuildInfoFile\": \"./.tsbuildinfo\", /* Specify the path to .tsbuildinfo incremental compilation file. */\n // \"disableSourceOfProjectReferenceRedirect\": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */\n // \"disableSolutionSearching\": true, /* Opt a project out of multi-project reference checking when editing. */\n // \"disableReferencedProjectLoad\": true, /* Reduce the number of projects loaded automatically by TypeScript. */\n /* Language and Environment */\n \"target\": \"ES2015\", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */\n \"lib\": [\n \"DOM\",\n \"ES2015\"\n ], /* Specify a set of bundled library declaration files that describe the target runtime environment. */// \"jsx\": \"preserve\", /* Specify what JSX code is generated. */\n // \"experimentalDecorators\": true, /* Enable experimental support for TC39 stage 2 draft decorators. */\n // \"emitDecoratorMetadata\": true, /* Emit design-type metadata for decorated declarations in source files. */\n // \"jsxFactory\": \"\", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */\n // \"jsxFragmentFactory\": \"\", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */\n // \"jsxImportSource\": \"\", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */\n // \"reactNamespace\": \"\", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */\n // \"noLib\": true, /* Disable including any library files, including the default lib.d.ts. */\n // \"useDefineForClassFields\": true, /* Emit ECMAScript-standard-compliant class fields. */\n // \"moduleDetection\": \"auto\", /* Control what method is used to detect module-format JS files. */\n /* Modules */\n \"module\": \"nodenext\", /* Specify what module code is generated. */\n \"moduleResolution\": \"nodenext\", /* Specify how TypeScript looks up a file from a given module specifier. */\n \"rootDir\": \"src\", /* Specify the root folder within your source files. */\n // \"baseUrl\": \"./\", /* Specify the base directory to resolve non-relative module names. */\n \"paths\": {\n \"@ORGANIZATION/PROJECT-api\": [\"../src\"],\n \"@ORGANIZATION/PROJECT-api/lib/*\": [\"../src/*\"],\n }, /* Specify a set of entries that re-map imports to additional lookup locations. */\n // \"rootDirs\": [], /* Allow multiple folders to be treated as one when resolving modules. */\n // \"typeRoots\": [], /* Specify multiple folders that act like './node_modules/@types'. */\n \"types\": [\"*\"], /* Specify type package names to be included without being referenced in a source file. */\n // \"allowUmdGlobalAccess\": true, /* Allow accessing UMD globals from modules. */\n // \"moduleSuffixes\": [], /* List of file name suffixes to search when resolving a module. */\n \"resolveJsonModule\": true, /* Enable importing .json files. */\n // \"noResolve\": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */\n /* JavaScript Support */\n // \"allowJs\": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */\n // \"checkJs\": true, /* Enable error reporting in type-checked JavaScript files. */\n // \"maxNodeModuleJsDepth\": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */\n /* Emit */\n \"declaration\": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */// \"declarationMap\": true, /* Create sourcemaps for d.ts files. */\n // \"emitDeclarationOnly\": true, /* Only output d.ts files and not JavaScript files. */\n \"sourceMap\": true, /* Create source map files for emitted JavaScript files. */// \"outFile\": \"./\", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */\n \"outDir\": \"./lib\", /* Specify an output folder for all emitted files. */// \"removeComments\": true, /* Disable emitting comments. */\n // \"noEmit\": true, /* Disable emitting files from a compilation. */\n // \"importHelpers\": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */\n // \"importsNotUsedAsValues\": \"remove\", /* Specify emit/checking behavior for imports that are only used for types. */\n // \"downlevelIteration\": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */// \"sourceRoot\": \"\", /* Specify the root path for debuggers to find the reference source code. */\n // \"mapRoot\": \"\", /* Specify the location where debugger should locate map files instead of generated locations. */\n // \"inlineSourceMap\": true, /* Include sourcemap files inside the emitted JavaScript. */\n // \"inlineSources\": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */\n // \"emitBOM\": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */\n \"newLine\": \"lf\", /* Set the newline character for emitting files. */// \"stripInternal\": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */\n // \"noEmitHelpers\": true, /* Disable generating custom helper functions like '__extends' in compiled output. */\n // \"noEmitOnError\": true, /* Disable emitting files if any type checking errors are reported. */\n // \"preserveConstEnums\": true, /* Disable erasing 'const enum' declarations in generated code. */\n // \"declarationDir\": \"./\", /* Specify the output directory for generated declaration files. */\n // \"preserveValueImports\": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */\n /* Interop Constraints */\n // \"isolatedModules\": true, /* Ensure that each file can be safely transpiled without relying on other imports. */\n // \"allowSyntheticDefaultImports\": true, /* Allow 'import x from y' when a module doesn't have a default export. */\n \"esModuleInterop\": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */// \"preserveSymlinks\": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */\n \"forceConsistentCasingInFileNames\": true, /* Ensure that casing is correct in imports. *//* Type Checking */\n \"strict\": true, /* Enable all strict type-checking options. */// \"noImplicitAny\": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */\n // \"strictNullChecks\": true, /* When type checking, take into account 'null' and 'undefined'. */\n // \"strictFunctionTypes\": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */\n // \"strictBindCallApply\": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */\n // \"strictPropertyInitialization\": true, /* Check for class properties that are declared but not set in the constructor. */\n // \"noImplicitThis\": true, /* Enable error reporting when 'this' is given the type 'any'. */\n // \"useUnknownInCatchVariables\": true, /* Default catch clause variables as 'unknown' instead of 'any'. */\n // \"alwaysStrict\": true, /* Ensure 'use strict' is always emitted. */\n // \"noUnusedLocals\": true, /* Enable error reporting when local variables aren't read. */\n // \"noUnusedParameters\": true, /* Raise an error when a function parameter isn't read. */\n // \"exactOptionalPropertyTypes\": true, /* Interpret optional property types as written, rather than adding 'undefined'. */\n // \"noImplicitReturns\": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */\n // \"noFallthroughCasesInSwitch\": true, /* Enable error reporting for fallthrough cases in switch statements. */\n // \"noUncheckedIndexedAccess\": true, /* Add 'undefined' to a type when accessed using an index. */\n // \"noImplicitOverride\": true, /* Ensure overriding members in derived classes are marked with an override modifier. */\n // \"noPropertyAccessFromIndexSignature\": true, /* Enforces using indexed accessors for keys declared using an indexed type. */\n // \"allowUnusedLabels\": true, /* Disable error reporting for unused labels. */\n // \"allowUnreachableCode\": true, /* Disable error reporting for unreachable code. */\n /* Completeness */\n // \"skipDefaultLibCheck\": true, /* Skip type checking .d.ts files that are included with TypeScript. */\n \"skipLibCheck\": true, /* Skip type checking all .d.ts files. */\n \"plugins\": [\n ],\n },\n \"include\": [\"src\"],\n}"
22
+ "tsconfig.json": "{\n \"compilerOptions\": {\n /* Visit https://aka.ms/tsconfig to read more about this file */\n /* Projects */\n // \"incremental\": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */\n // \"composite\": true, /* Enable constraints that allow a TypeScript project to be used with project references. */\n // \"tsBuildInfoFile\": \"./.tsbuildinfo\", /* Specify the path to .tsbuildinfo incremental compilation file. */\n // \"disableSourceOfProjectReferenceRedirect\": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */\n // \"disableSolutionSearching\": true, /* Opt a project out of multi-project reference checking when editing. */\n // \"disableReferencedProjectLoad\": true, /* Reduce the number of projects loaded automatically by TypeScript. */\n /* Language and Environment */\n \"target\": \"ESNext\", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */\n \"lib\": [\n \"DOM\",\n \"ESNext\"\n ], /* Specify a set of bundled library declaration files that describe the target runtime environment. */// \"jsx\": \"preserve\", /* Specify what JSX code is generated. */\n // \"experimentalDecorators\": true, /* Enable experimental support for TC39 stage 2 draft decorators. */\n // \"emitDecoratorMetadata\": true, /* Emit design-type metadata for decorated declarations in source files. */\n // \"jsxFactory\": \"\", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */\n // \"jsxFragmentFactory\": \"\", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */\n // \"jsxImportSource\": \"\", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */\n // \"reactNamespace\": \"\", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */\n // \"noLib\": true, /* Disable including any library files, including the default lib.d.ts. */\n // \"useDefineForClassFields\": true, /* Emit ECMAScript-standard-compliant class fields. */\n // \"moduleDetection\": \"auto\", /* Control what method is used to detect module-format JS files. */\n /* Modules */\n \"module\": \"nodenext\", /* Specify what module code is generated. */\n \"moduleResolution\": \"nodenext\", /* Specify how TypeScript looks up a file from a given module specifier. */\n \"rootDir\": \"src\", /* Specify the root folder within your source files. */\n // \"baseUrl\": \"./\", /* Specify the base directory to resolve non-relative module names. */\n // \"paths\": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */\n // \"rootDirs\": [], /* Allow multiple folders to be treated as one when resolving modules. */\n // \"typeRoots\": [], /* Specify multiple folders that act like './node_modules/@types'. */\n \"types\": [\"*\"], /* Specify type package names to be included without being referenced in a source file. */\n // \"allowUmdGlobalAccess\": true, /* Allow accessing UMD globals from modules. */\n // \"moduleSuffixes\": [], /* List of file name suffixes to search when resolving a module. */\n \"resolveJsonModule\": true, /* Enable importing .json files. */\n // \"noResolve\": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */\n /* JavaScript Support */\n // \"allowJs\": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */\n // \"checkJs\": true, /* Enable error reporting in type-checked JavaScript files. */\n // \"maxNodeModuleJsDepth\": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */\n /* Emit */\n \"declaration\": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */// \"declarationMap\": true, /* Create sourcemaps for d.ts files. */\n // \"emitDeclarationOnly\": true, /* Only output d.ts files and not JavaScript files. */\n \"sourceMap\": true, /* Create source map files for emitted JavaScript files. */// \"outFile\": \"./\", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */\n \"outDir\": \"./lib\", /* Specify an output folder for all emitted files. */// \"removeComments\": true, /* Disable emitting comments. */\n // \"noEmit\": true, /* Disable emitting files from a compilation. */\n // \"importHelpers\": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */\n // \"importsNotUsedAsValues\": \"remove\", /* Specify emit/checking behavior for imports that are only used for types. */\n // \"downlevelIteration\": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */// \"sourceRoot\": \"\", /* Specify the root path for debuggers to find the reference source code. */\n // \"mapRoot\": \"\", /* Specify the location where debugger should locate map files instead of generated locations. */\n // \"inlineSourceMap\": true, /* Include sourcemap files inside the emitted JavaScript. */\n // \"inlineSources\": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */\n // \"emitBOM\": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */\n \"newLine\": \"lf\", /* Set the newline character for emitting files. */// \"stripInternal\": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */\n // \"noEmitHelpers\": true, /* Disable generating custom helper functions like '__extends' in compiled output. */\n // \"noEmitOnError\": true, /* Disable emitting files if any type checking errors are reported. */\n // \"preserveConstEnums\": true, /* Disable erasing 'const enum' declarations in generated code. */\n // \"declarationDir\": \"./\", /* Specify the output directory for generated declaration files. */\n // \"preserveValueImports\": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */\n /* Interop Constraints */\n // \"isolatedModules\": true, /* Ensure that each file can be safely transpiled without relying on other imports. */\n // \"allowSyntheticDefaultImports\": true, /* Allow 'import x from y' when a module doesn't have a default export. */\n \"esModuleInterop\": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */// \"preserveSymlinks\": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */\n \"forceConsistentCasingInFileNames\": true, /* Ensure that casing is correct in imports. *//* Type Checking */\n \"strict\": true, /* Enable all strict type-checking options. */// \"noImplicitAny\": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */\n // \"strictNullChecks\": true, /* When type checking, take into account 'null' and 'undefined'. */\n // \"strictFunctionTypes\": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */\n // \"strictBindCallApply\": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */\n // \"strictPropertyInitialization\": true, /* Check for class properties that are declared but not set in the constructor. */\n // \"noImplicitThis\": true, /* Enable error reporting when 'this' is given the type 'any'. */\n // \"useUnknownInCatchVariables\": true, /* Default catch clause variables as 'unknown' instead of 'any'. */\n // \"alwaysStrict\": true, /* Ensure 'use strict' is always emitted. */\n // \"noUnusedLocals\": true, /* Enable error reporting when local variables aren't read. */\n // \"noUnusedParameters\": true, /* Raise an error when a function parameter isn't read. */\n // \"exactOptionalPropertyTypes\": true, /* Interpret optional property types as written, rather than adding 'undefined'. */\n // \"noImplicitReturns\": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */\n // \"noFallthroughCasesInSwitch\": true, /* Enable error reporting for fallthrough cases in switch statements. */\n // \"noUncheckedIndexedAccess\": true, /* Add 'undefined' to a type when accessed using an index. */\n // \"noImplicitOverride\": true, /* Ensure overriding members in derived classes are marked with an override modifier. */\n // \"noPropertyAccessFromIndexSignature\": true, /* Enforces using indexed accessors for keys declared using an indexed type. */\n // \"allowUnusedLabels\": true, /* Disable error reporting for unused labels. */\n // \"allowUnreachableCode\": true, /* Disable error reporting for unreachable code. */\n /* Completeness */\n // \"skipDefaultLibCheck\": true, /* Skip type checking .d.ts files that are included with TypeScript. */\n \"skipLibCheck\": true, /* Skip type checking all .d.ts files. */\n },\n \"include\": [\"src\"],\n}"
24
23
  };
25
24
  //#endregion
26
25
  export { SDK_TEMPLATE };
@@ -11,6 +11,13 @@ var NestiaMigrateApiProgrammer;
11
11
  (function (NestiaMigrateApiProgrammer) {
12
12
  NestiaMigrateApiProgrammer.write = (ctx) => {
13
13
  const dict = new tstl_1.HashMap((x) => (0, tstl_1.hash)(x.join(".")), (x, y) => x.length === y.length && x.join(".") === y.join("."));
14
+ dict.take([], () => ({
15
+ config: ctx.config,
16
+ components: ctx.application.document().components,
17
+ namespace: [],
18
+ routes: [],
19
+ children: new Set(),
20
+ }));
14
21
  for (const route of ctx.application.routes) {
15
22
  const namespace = route.accessor.slice(0, -1);
16
23
  let last = dict.take(namespace, () => ({
@@ -1 +1 @@
1
- {"version":3,"file":"NestiaMigrateApiProgrammer.js","sourceRoot":"","sources":["../../src/programmers/NestiaMigrateApiProgrammer.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,CAAC,IAAI,CAAC,yBAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,EAxGgB,0BAA0B,aAA1B,0BAA0B,GAA1B,0BAA0B,QAwG1C"}
@@ -9,6 +9,13 @@ let NestiaMigrateApiProgrammer;
9
9
  (function(_NestiaMigrateApiProgrammer) {
10
10
  _NestiaMigrateApiProgrammer.write = (ctx) => {
11
11
  const dict = new HashMap((x) => hash(x.join(".")), (x, y) => x.length === y.length && x.join(".") === y.join("."));
12
+ dict.take([], () => ({
13
+ config: ctx.config,
14
+ components: ctx.application.document().components,
15
+ namespace: [],
16
+ routes: [],
17
+ children: /* @__PURE__ */ new Set()
18
+ }));
12
19
  for (const route of ctx.application.routes) {
13
20
  const namespace = route.accessor.slice(0, -1);
14
21
  let last = dict.take(namespace, () => ({
@@ -11,14 +11,19 @@ var NestiaMigrateApiStartProgrammer;
11
11
  (function (NestiaMigrateApiStartProgrammer) {
12
12
  NestiaMigrateApiStartProgrammer.write = (context) => {
13
13
  const importer = new NestiaMigrateImportProgrammer_1.NestiaMigrateImportProgrammer();
14
- const main = writeMain(context, importer, pick(context.application.routes));
14
+ const route = pick(context.application.routes);
15
+ const main = writeMain(context, importer, route);
15
16
  const statements = [
16
17
  ...importer.toStatements((name) => `@ORGANIZATION/PROJECT-api/lib/structures/${name}`),
17
18
  FilePrinter_1.FilePrinter.newLine(),
18
- factory_1.factory.createImportDeclaration(undefined, factory_1.factory.createImportClause(false, undefined, factory_1.factory.createNamedImports([
19
- factory_1.factory.createImportSpecifier(false, undefined, factory_1.factory.createIdentifier("TestGlobal")),
20
- ])), factory_1.factory.createStringLiteral("./TestGlobal")),
21
- FilePrinter_1.FilePrinter.newLine(),
19
+ ...(route === undefined
20
+ ? []
21
+ : [
22
+ factory_1.factory.createImportDeclaration(undefined, factory_1.factory.createImportClause(undefined, undefined, factory_1.factory.createNamedImports([
23
+ factory_1.factory.createImportSpecifier(false, undefined, factory_1.factory.createIdentifier("TestGlobal")),
24
+ ])), factory_1.factory.createStringLiteral("./TestGlobal")),
25
+ FilePrinter_1.FilePrinter.newLine(),
26
+ ]),
22
27
  main,
23
28
  factory_1.factory.createExpressionStatement(writeStarter()),
24
29
  ];
@@ -29,13 +34,17 @@ var NestiaMigrateApiStartProgrammer;
29
34
  const writeMain = (ctx, importer, route) => StatementFactory_1.StatementFactory.constant({
30
35
  name: "main",
31
36
  value: factory_1.factory.createArrowFunction([factory_1.factory.createToken(factory_1.SyntaxKind.AsyncKeyword)], undefined, [], undefined, undefined, factory_1.factory.createBlock([
32
- writeConnection(ctx, importer),
33
- ...NestiaMigrateE2eFileProgrammer_1.NestiaMigrateE2eFunctionProgrammer.writeBody({
34
- config: ctx.config,
35
- components: ctx.application.document().components,
36
- importer,
37
- route,
38
- }),
37
+ ...(route === undefined
38
+ ? []
39
+ : [
40
+ writeConnection(ctx, importer),
41
+ ...NestiaMigrateE2eFileProgrammer_1.NestiaMigrateE2eFunctionProgrammer.writeBody({
42
+ config: ctx.config,
43
+ components: ctx.application.document().components,
44
+ importer,
45
+ route,
46
+ }),
47
+ ]),
39
48
  ], true)),
40
49
  });
41
50
  const writeConnection = (ctx, importer) => { var _a, _b, _c; return factory_1.factory.createVariableStatement(undefined, factory_1.factory.createVariableDeclarationList([
@@ -67,6 +76,8 @@ var NestiaMigrateApiStartProgrammer;
67
76
  ]);
68
77
  })(NestiaMigrateApiStartProgrammer || (exports.NestiaMigrateApiStartProgrammer = NestiaMigrateApiStartProgrammer = {}));
69
78
  const pick = (array) => {
79
+ if (array.length === 0)
80
+ return undefined;
70
81
  const rand = Math.random() * array.length;
71
82
  const index = Math.min(array.length - 1, Math.floor(rand));
72
83
  return array[index];
@@ -1 +1 @@
1
- {"version":3,"file":"NestiaMigrateApiStartProgrammer.js","sourceRoot":"","sources":["../../src/programmers/NestiaMigrateApiStartProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAA+D;AAG/D,sEAAm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AC,GAAG,CAAC,CAClC;aACF,CACF,CACF;SACF,EACD,IAAI,CACL,CACF;KACF,CACF,CAAC;AACN,CAAC,EApLgB,+BAA+B,aAA/B,+BAA+B,GAA/B,+BAA+B,QAoL/C;AAED,MAAM,IAAI,GAAG,CAAI,KAAU,EAAK,EAAE;IAChC,MAAM,IAAI,GAAW,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;IAClD,MAAM,KAAK,GAAW,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACnE,OAAO,KAAK,CAAC,KAAK,CAAE,CAAC;AACvB,CAAC,CAAC"}
1
+ {"version":3,"file":"NestiaMigrateApiStartProgrammer.js","sourceRoot":"","sources":["../../src/programmers/NestiaMigrateApiStartProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAA+D;AAG/D,sEAAmE;AACnE,oEAAiE;AAGjE,sDAAmD;AACnD,qFAAsF;AACtF,mFAAgF;AAEhF,IAAiB,+BAA+B,CA2L/C;AA3LD,WAAiB,+BAA+B;IACjC,qCAAK,GAAG,CACnB,OAA8B,EACN,EAAE;QAC1B,MAAM,QAAQ,GACZ,IAAI,6DAA6B,EAAE,CAAC;QACtC,MAAM,KAAK,GAAkC,IAAI,CAC/C,OAAO,CAAC,WAAW,CAAC,MAAM,CAC3B,CAAC;QACF,MAAM,IAAI,GAAyB,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QACvE,MAAM,UAAU,GAAmB;YACjC,GAAG,QAAQ,CAAC,YAAY,CACtB,CAAC,IAAI,EAAE,EAAE,CAAC,4CAA4C,IAAI,EAAE,CAC7D;YACD,yBAAW,CAAC,OAAO,EAAE;YACrB,GAAG,CAAC,KAAK,KAAK,SAAS;gBACrB,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC;oBACE,iBAAO,CAAC,uBAAuB,C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AM,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACnE,OAAO,KAAK,CAAC,KAAK,CAAE,CAAC;AACvB,CAAC,CAAC"}
@@ -9,12 +9,12 @@ let NestiaMigrateApiStartProgrammer;
9
9
  (function(_NestiaMigrateApiStartProgrammer) {
10
10
  _NestiaMigrateApiStartProgrammer.write = (context) => {
11
11
  const importer = new NestiaMigrateImportProgrammer();
12
- const main = writeMain(context, importer, pick(context.application.routes));
12
+ const route = pick(context.application.routes);
13
+ const main = writeMain(context, importer, route);
13
14
  const statements = [
14
15
  ...importer.toStatements((name) => `@ORGANIZATION/PROJECT-api/lib/structures/${name}`),
15
16
  FilePrinter.newLine(),
16
- factory.createImportDeclaration(void 0, factory.createImportClause(false, void 0, factory.createNamedImports([factory.createImportSpecifier(false, void 0, factory.createIdentifier("TestGlobal"))])), factory.createStringLiteral("./TestGlobal")),
17
- FilePrinter.newLine(),
17
+ ...route === void 0 ? [] : [factory.createImportDeclaration(void 0, factory.createImportClause(void 0, void 0, factory.createNamedImports([factory.createImportSpecifier(false, void 0, factory.createIdentifier("TestGlobal"))])), factory.createStringLiteral("./TestGlobal")), FilePrinter.newLine()],
18
18
  main,
19
19
  factory.createExpressionStatement(writeStarter())
20
20
  ];
@@ -22,12 +22,12 @@ let NestiaMigrateApiStartProgrammer;
22
22
  };
23
23
  const writeMain = (ctx, importer, route) => StatementFactory.constant({
24
24
  name: "main",
25
- value: factory.createArrowFunction([factory.createToken(SyntaxKind.AsyncKeyword)], void 0, [], void 0, void 0, factory.createBlock([writeConnection(ctx, importer), ...NestiaMigrateE2eFunctionProgrammer.writeBody({
25
+ value: factory.createArrowFunction([factory.createToken(SyntaxKind.AsyncKeyword)], void 0, [], void 0, void 0, factory.createBlock([...route === void 0 ? [] : [writeConnection(ctx, importer), ...NestiaMigrateE2eFunctionProgrammer.writeBody({
26
26
  config: ctx.config,
27
27
  components: ctx.application.document().components,
28
28
  importer,
29
29
  route
30
- })], true))
30
+ })]], true))
31
31
  });
32
32
  const writeConnection = (ctx, importer) => factory.createVariableStatement(void 0, factory.createVariableDeclarationList([factory.createVariableDeclaration("connection", void 0, factory.createTypeReferenceNode(factory.createQualifiedName(factory.createIdentifier(importer.external({
33
33
  type: "default",
@@ -41,6 +41,7 @@ let NestiaMigrateApiStartProgrammer;
41
41
  const writeStarter = () => factory.createCallExpression(factory.createPropertyAccessExpression(factory.createCallExpression(factory.createIdentifier("main"), void 0, void 0), "catch"), void 0, [factory.createArrowFunction(void 0, void 0, [IdentifierFactory.parameter("exp")], void 0, void 0, factory.createBlock([factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier("console"), "log"), void 0, [factory.createIdentifier("exp")])), factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier("process"), "exit"), void 0, [factory.createPrefixMinus(factory.createNumericLiteral("1"))]))], true))]);
42
42
  })(NestiaMigrateApiStartProgrammer || (NestiaMigrateApiStartProgrammer = {}));
43
43
  const pick = (array) => {
44
+ if (array.length === 0) return void 0;
44
45
  const rand = Math.random() * array.length;
45
46
  return array[Math.min(array.length - 1, Math.floor(rand))];
46
47
  };
@@ -49,7 +49,7 @@ class NestiaMigrateImportProgrammer {
49
49
  if (current === undefined || name !== current.split(".")[0])
50
50
  MapUtil_1.MapUtil.take(modules)(dtoPath(name))(() => []).push(name);
51
51
  return [
52
- ...[...this.external_.entries()].map(([library, props]) => factory_1.factory.createImportDeclaration(undefined, factory_1.factory.createImportClause(false, props.default !== null
52
+ ...[...this.external_.entries()].map(([library, props]) => factory_1.factory.createImportDeclaration(undefined, factory_1.factory.createImportClause(undefined, props.default !== null
53
53
  ? factory_1.factory.createIdentifier(props.default)
54
54
  : undefined, props.instances.size
55
55
  ? factory_1.factory.createNamedImports([...props.instances].map((i) => factory_1.factory.createImportSpecifier(false, undefined, factory_1.factory.createIdentifier(i))))
@@ -61,7 +61,7 @@ class NestiaMigrateImportProgrammer {
61
61
  // DTO files declare pure types, and generated code references them
62
62
  // only in type positions — keep the clause type-only so emitted
63
63
  // JS never loads the DTO module at runtime.
64
- factory_1.factory.createImportClause(true, undefined, factory_1.factory.createNamedImports(names.map((name) => factory_1.factory.createImportSpecifier(false, undefined, factory_1.factory.createIdentifier(name))))), factory_1.factory.createStringLiteral(specifier))),
64
+ factory_1.factory.createImportClause(factory_1.SyntaxKind.TypeKeyword, undefined, factory_1.factory.createNamedImports(names.map((name) => factory_1.factory.createImportSpecifier(false, undefined, factory_1.factory.createIdentifier(name))))), factory_1.factory.createStringLiteral(specifier))),
65
65
  ];
66
66
  }
67
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NestiaMigrateImportProgrammer.js","sourceRoot":"","sources":["../../src/programmers/NestiaMigrateImportProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAExC,wEAAqE;AAErE,sDAAmD;AACnD,8CAA2C;AAE3C;IAIE;QAHQ,cAAS,GAAyB,IAAI,GAAG,EAAE,CAAC;QAC5C,UAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IAEjB,CAAC;IAEhB,KAAK;QACV,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC;IAC5D,CAAC;IAEM,QAAQ,CAAC,KAAqC;QACnD,MAAM,MAAM,GAAY,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;YACzE,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,IAAI,GAAG,EAAE;SACrB,CAAC,CAAC,CAAC;QACJ,MAAM,IAAI,GAAW,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;QAC/C,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;YAAE,MAAM,CAAC,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AAmE;YACnE,gEAAgE;YAChE,4CAA4C;YAC5C,iBAAO,CAAC,kBAAkB,CACxB,IAAI,EACJ,SAAS,EACT,iBAAO,CAAC,kBAAkB,CACxB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACjB,iBAAO,CAAC,qBAAqB,CAC3B,KAAK,EACL,SAAS,EACT,iBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAC/B,CACF,CACF,CACF,EACD,iBAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,CACvC,CACF;SACF,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"NestiaMigrateImportProgrammer.js","sourceRoot":"","sources":["../../src/programmers/NestiaMigrateImportProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAAoD;AAEpD,wEAAqE;AAErE,sDAAmD;AACnD,8CAA2C;AAE3C;IAIE;QAHQ,cAAS,GAAyB,IAAI,GAAG,EAAE,CAAC;QAC5C,UAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IAEjB,CAAC;IAEhB,KAAK;QACV,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC;IAC5D,CAAC;IAEM,QAAQ,CAAC,KAAqC;QACnD,MAAM,MAAM,GAAY,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;YACzE,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,IAAI,GAAG,EAAE;SACrB,CAAC,CAAC,CAAC;QACJ,MAAM,IAAI,GAAW,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;QAC/C,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;YAAE,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC;;YACrD,MAAM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,CAAC,kBAAkB,CACxB,oBAAU,CAAC,WAAW,EACtB,SAAS,EACT,iBAAO,CAAC,kBAAkB,CACxB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACjB,iBAAO,CAAC,qBAAqB,CAC3B,KAAK,EACL,SAAS,EACT,iBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAC/B,CACF,CACF,CACF,EACD,iBAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,CACvC,CACF;SACF,CAAC;IACJ,CAAC;CACF"}
@@ -1,7 +1,7 @@
1
1
  import { FilePrinter } from "../utils/FilePrinter.mjs";
2
2
  import { TypeLiteralFactory } from "../factories/TypeLiteralFactory.mjs";
3
3
  import { MapUtil } from "../utils/MapUtil.mjs";
4
- import { factory } from "@ttsc/factory";
4
+ import { SyntaxKind, factory } from "@ttsc/factory";
5
5
  //#region src/programmers/NestiaMigrateImportProgrammer.ts
6
6
  var NestiaMigrateImportProgrammer = class {
7
7
  constructor() {
@@ -38,9 +38,9 @@ var NestiaMigrateImportProgrammer = class {
38
38
  const modules = /* @__PURE__ */ new Map();
39
39
  for (const name of this.dtos_) if (current === void 0 || name !== current.split(".")[0]) MapUtil.take(modules)(dtoPath(name))(() => []).push(name);
40
40
  return [
41
- ...[...this.external_.entries()].map(([library, props]) => factory.createImportDeclaration(void 0, factory.createImportClause(false, props.default !== null ? factory.createIdentifier(props.default) : void 0, props.instances.size ? factory.createNamedImports([...props.instances].map((i) => factory.createImportSpecifier(false, void 0, factory.createIdentifier(i)))) : void 0), factory.createStringLiteral(library))),
41
+ ...[...this.external_.entries()].map(([library, props]) => factory.createImportDeclaration(void 0, factory.createImportClause(void 0, props.default !== null ? factory.createIdentifier(props.default) : void 0, props.instances.size ? factory.createNamedImports([...props.instances].map((i) => factory.createImportSpecifier(false, void 0, factory.createIdentifier(i)))) : void 0), factory.createStringLiteral(library))),
42
42
  ...this.external_.size && this.dtos_.size ? [FilePrinter.newLine()] : [],
43
- ...[...modules.entries()].map(([specifier, names]) => factory.createImportDeclaration(void 0, factory.createImportClause(true, void 0, factory.createNamedImports(names.map((name) => factory.createImportSpecifier(false, void 0, factory.createIdentifier(name))))), factory.createStringLiteral(specifier)))
43
+ ...[...modules.entries()].map(([specifier, names]) => factory.createImportDeclaration(void 0, factory.createImportClause(SyntaxKind.TypeKeyword, void 0, factory.createNamedImports(names.map((name) => factory.createImportSpecifier(false, void 0, factory.createIdentifier(name))))), factory.createStringLiteral(specifier)))
44
44
  ];
45
45
  }
46
46
  };
@@ -20,7 +20,7 @@ var NestiaMigrateNestModuleProgrammer;
20
20
  ], "MyModule", undefined, undefined, []),
21
21
  ];
22
22
  })(NestiaMigrateNestModuleProgrammer || (exports.NestiaMigrateNestModuleProgrammer = NestiaMigrateNestModuleProgrammer = {}));
23
- const $import = (file) => (instance) => factory_1.factory.createImportDeclaration(undefined, factory_1.factory.createImportClause(false, undefined, factory_1.factory.createNamedImports([
23
+ const $import = (file) => (instance) => factory_1.factory.createImportDeclaration(undefined, factory_1.factory.createImportClause(undefined, undefined, factory_1.factory.createNamedImports([
24
24
  factory_1.factory.createImportSpecifier(false, undefined, factory_1.factory.createIdentifier(instance)),
25
25
  ])), factory_1.factory.createStringLiteral(file));
26
26
  //# sourceMappingURL=NestiaMigrateNestModuleProgrammer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NestiaMigrateNestModuleProgrammer.js","sourceRoot":"","sources":["../../src/programmers/NestiaMigrateNestModuleProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAAoD;AAIpD,sDAAmD;AAEnD,IAAiB,iCAAiC,CAwCjD;AAxCD,WAAiB,iCAAiC;IACnC,uCAAK,GAAG,CACnB,WAAuC,EACvB,EAAE,CAAC;QACnB,OAAO,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC;QACnC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,yBAAW,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,C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AqB,CAC3B,KAAK,EACL,SAAS,EACT,iBAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CACnC;CACF,CAAC,CACH,EACD,iBAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAClC,CAAC"}
1
+ {"version":3,"file":"NestiaMigrateNestModuleProgrammer.js","sourceRoot":"","sources":["../../src/programmers/NestiaMigrateNestModuleProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAAoD;AAIpD,sDAAmD;AAEnD,IAAiB,iCAAiC,CAwCjD;AAxCD,WAAiB,iCAAiC;IACnC,uCAAK,GAAG,CACnB,WAAuC,EACvB,EAAE,CAAC;QACnB,OAAO,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC;QACnC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,yBAAW,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACvB,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CACjE;QACD,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,yBAAW,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,iBAAO,CAAC,sBAAsB,CAC5B;YACE,iBAAO,CAAC,eAAe,CACrB,iBAAO,CAAC,oBAAoB,CAC1B,iBAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAClC,SAAS,EACT;gBACE,iBAAO,CAAC,6BAA6B,CACnC;oBACE,iBAAO,CAAC,wBAAwB,CAC9B,iBAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,EACvC,iBAAO,CAAC,4BAA4B,CAClC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EACxD,IAAI,CACL,CACF;iBACF,EACD,IAAI,CACL;aACF,CACF,CACF;YACD,iBAAO,CAAC,WAAW,CAAC,oBAAU,CAAC,aAAa,CAAC;SAC9C,EACD,UAAU,EACV,SAAS,EACT,SAAS,EACT,EAAE,CACH;KACF,CAAC;AACJ,CAAC,EAxCgB,iCAAiC,aAAjC,iCAAiC,GAAjC,iCAAiC,QAwCjD;AAED,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,QAAgB,EAAE,EAAE,CACrD,iBAAO,CAAC,uBAAuB,CAC7B,SAAS,EACT,iBAAO,CAAC,kBAAkB,CACxB,SAAS,EACT,SAAS,EACT,iBAAO,CAAC,kBAAkB,CAAC;IACzB,iBAAO,CAAC,qBAAqB,CAC3B,KAAK,EACL,SAAS,EACT,iBAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CACnC;CACF,CAAC,CACH,EACD,iBAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAClC,CAAC"}
@@ -11,7 +11,7 @@ let NestiaMigrateNestModuleProgrammer;
11
11
  factory.createClassDeclaration([factory.createDecorator(factory.createCallExpression(factory.createIdentifier("Module"), void 0, [factory.createObjectLiteralExpression([factory.createPropertyAssignment(factory.createIdentifier("controllers"), factory.createArrayLiteralExpression(controllers.map((c) => factory.createIdentifier(c.name)), true))], true)])), factory.createToken(SyntaxKind.ExportKeyword)], "MyModule", void 0, void 0, [])
12
12
  ];
13
13
  })(NestiaMigrateNestModuleProgrammer || (NestiaMigrateNestModuleProgrammer = {}));
14
- const $import = (file) => (instance) => factory.createImportDeclaration(void 0, factory.createImportClause(false, void 0, factory.createNamedImports([factory.createImportSpecifier(false, void 0, factory.createIdentifier(instance))])), factory.createStringLiteral(file));
14
+ const $import = (file) => (instance) => factory.createImportDeclaration(void 0, factory.createImportClause(void 0, void 0, factory.createNamedImports([factory.createImportSpecifier(false, void 0, factory.createIdentifier(instance))])), factory.createStringLiteral(file));
15
15
  //#endregion
16
16
  export { NestiaMigrateNestModuleProgrammer };
17
17
 
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@nestia/migrate",
3
- "version": "12.0.0-rc.4",
3
+ "version": "12.1.0",
4
4
  "description": "Migration program from swagger to NestJS",
5
5
  "main": "lib/index.js",
6
+ "bin": {
7
+ "nestia-migrate": "./lib/executable/migrate.js"
8
+ },
6
9
  "exports": {
7
10
  ".": {
8
11
  "types": "./lib/index.d.ts",
@@ -11,9 +14,6 @@
11
14
  },
12
15
  "./package.json": "./package.json"
13
16
  },
14
- "bin": {
15
- "@nestia/migrate": "./lib/executable/migrate.js"
16
- },
17
17
  "repository": {
18
18
  "type": "git",
19
19
  "url": "https://github.com/samchon/nestia"
@@ -44,15 +44,15 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@trivago/prettier-plugin-sort-imports": "^4.3.0",
47
- "@ttsc/factory": "^0.18.1",
48
- "@typia/interface": "^13.0.1",
49
- "@typia/utils": "^13.0.1",
47
+ "@ttsc/factory": "^0.20.0",
48
+ "@typia/interface": "^13.2.0",
49
+ "@typia/utils": "^13.2.0",
50
50
  "commander": "10.0.0",
51
51
  "inquirer": "8.2.5",
52
52
  "prettier": "^3.8.1",
53
53
  "prettier-plugin-jsdoc": "^1.8.0",
54
54
  "tstl": "^3.0.0",
55
- "typia": "^13.0.1"
55
+ "typia": "^13.2.0"
56
56
  },
57
57
  "files": [
58
58
  "lib",