From bfe9080462a197cc30081b33ae7b2d941ba4ba90 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sat, 7 Dec 2024 22:46:21 +0900 Subject: [PATCH 01/10] Monorepo setup and fix some inteded bug cases. --- .github/workflows/build.yml | 6 + .github/workflows/migrate.yaml | 9 +- .github/workflows/release.yml | 23 + .github/workflows/website.yml | 7 +- benchmark/package.json | 2 +- build/index.js | 32 - deploy/build.js | 23 + deploy/index.js | 17 +- deploy/publish.js | 85 +- package.json | 10 +- packages/benchmark/package.json | 10 +- packages/cli/package.json | 4 +- packages/core/package.json | 10 +- .../ParameterDecoratorTransformer.ts | 4 +- .../src/transformers/TypedRouteTransformer.ts | 7 +- .../transformers/WebSocketRouteTransformer.ts | 11 +- packages/editor/package.json | 10 +- packages/fetcher/package.json | 2 +- packages/migrate/package.json | 14 +- packages/sdk/package.json | 10 +- packages/sdk/src/NestiaSdkApplication.ts | 16 +- .../transformers/SdkOperationTransformer.ts | 17 +- pnpm-workspace.yaml | 4 + test/executable/start.js | 48 +- test/features/all/swagger.json | 2 +- test/features/all/tsconfig.json | 7 +- .../swagger.json | 2 +- .../app-globalPrefix-versionUri/swagger.json | 2 +- test/features/app-globalPrefix/swagger.json | 2 +- test/features/app-routerModule/swagger.json | 2 +- test/features/app-versionHeader/swagger.json | 2 +- test/features/app-versionUri/swagger.json | 2 +- test/features/app/swagger.json | 2 +- test/features/beautify-4/swagger.json | 2 +- test/features/beautify-false/swagger.json | 2 +- .../features/api/test_api_body_invalid.ts | 2 +- test/features/beautify/src/test/index.ts | 11 +- test/features/beautify/swagger.json | 2 +- test/features/body-config-assert/swagger.json | 2 +- .../body-config-assertClone/swagger.json | 2 +- .../body-config-assertEquals/swagger.json | 2 +- .../body-config-assertPrune/swagger.json | 2 +- test/features/body-config-equals/swagger.json | 2 +- test/features/body-config-is/swagger.json | 2 +- .../body-config-validate/swagger.json | 2 +- .../body-config-validateClone/swagger.json | 2 +- .../body-config-validateEquals/swagger.json | 2 +- .../body-config-validatePrune/swagger.json | 2 +- .../body-error-implicit/src/api/HttpError.ts | 1 + .../src/api/IConnection.ts | 1 + .../body-error-implicit/src/api/Primitive.ts | 1 + .../body-error-implicit/src/api/Resolved.ts | 1 + .../src/api/functional/bbs/articles/index.ts | 59 ++ .../src/api/functional/bbs/index.ts | 7 + .../src/api/functional/health/index.ts | 35 + .../src/api/functional/index.ts | 8 + .../body-error-implicit/src/api/index.ts | 4 + .../body-error-implicit/src/api/module.ts | 6 + .../body-error-optional/nestia.config.ts | 15 - .../src/api/structures/IBbsArticle.ts | 43 - .../src/controllers/HealthController.ts | 8 - .../src/controllers/TypedBodyController.ts | 40 - .../body-error-optional/tsconfig.json | 95 --- test/features/body/swagger.json | 2 +- .../features/implicit-error/src/test/index.ts | 49 -- test/features/implicit-error/swagger.json | 769 +----------------- .../src/controllers/MethodController.ts | 2 +- .../method-error-get-body/swagger.json | 1 + .../plain-error-optional/nestia.config.ts | 15 - .../src/controllers/HealthController.ts | 8 - .../src/controllers/PlainController.ts | 11 - .../plain-error-optional/tsconfig.json | 95 --- .../query-error-optional/nestia.config.ts | 15 - .../query-error-optional/src/Backend.ts | 28 - .../src/controllers/QueryController.ts | 22 - .../query-error-optional/swagger.json | 1 - .../query-error-optional/tsconfig.json | 98 --- test/package.json | 10 +- 78 files changed, 385 insertions(+), 1508 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100644 build/index.js create mode 100644 deploy/build.js create mode 100644 pnpm-workspace.yaml create mode 100644 test/features/body-error-implicit/src/api/HttpError.ts create mode 100644 test/features/body-error-implicit/src/api/IConnection.ts create mode 100644 test/features/body-error-implicit/src/api/Primitive.ts create mode 100644 test/features/body-error-implicit/src/api/Resolved.ts create mode 100644 test/features/body-error-implicit/src/api/functional/bbs/articles/index.ts create mode 100644 test/features/body-error-implicit/src/api/functional/bbs/index.ts create mode 100644 test/features/body-error-implicit/src/api/functional/health/index.ts create mode 100644 test/features/body-error-implicit/src/api/functional/index.ts create mode 100644 test/features/body-error-implicit/src/api/index.ts create mode 100644 test/features/body-error-implicit/src/api/module.ts delete mode 100644 test/features/body-error-optional/nestia.config.ts delete mode 100644 test/features/body-error-optional/src/api/structures/IBbsArticle.ts delete mode 100644 test/features/body-error-optional/src/controllers/HealthController.ts delete mode 100644 test/features/body-error-optional/src/controllers/TypedBodyController.ts delete mode 100644 test/features/body-error-optional/tsconfig.json delete mode 100644 test/features/implicit-error/src/test/index.ts create mode 100644 test/features/method-error-get-body/swagger.json delete mode 100644 test/features/plain-error-optional/nestia.config.ts delete mode 100644 test/features/plain-error-optional/src/controllers/HealthController.ts delete mode 100644 test/features/plain-error-optional/src/controllers/PlainController.ts delete mode 100644 test/features/plain-error-optional/tsconfig.json delete mode 100644 test/features/query-error-optional/nestia.config.ts delete mode 100644 test/features/query-error-optional/src/Backend.ts delete mode 100644 test/features/query-error-optional/src/controllers/QueryController.ts delete mode 100644 test/features/query-error-optional/swagger.json delete mode 100644 test/features/query-error-optional/tsconfig.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb4fe4648..4087e0020 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,12 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 20.x + - uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: Install dependencies + run: pnpm install - name: test working-directory: ./test diff --git a/.github/workflows/migrate.yaml b/.github/workflows/migrate.yaml index ae1c8eb1f..e13e01228 100644 --- a/.github/workflows/migrate.yaml +++ b/.github/workflows/migrate.yaml @@ -21,7 +21,12 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 20.x + - uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Install dependencies + run: pnpm install - name: test - working-directory: ./test - run: npm start \ No newline at end of file + working-directory: ./packages/migrate + run: npm run test \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..0b85815bb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: release +on: + release: + types: [created] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org/ + - uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: Install dependencies + run: pnpm install + - name: Publish to npm + run: npm run package:latest + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH }} \ No newline at end of file diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index eb85254e8..bb46c04d6 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -14,8 +14,11 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 20.x - - name: Root Install - run: npm run package:tgz + - uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Root Setup + run: pnpm install && npm run build - name: Build working-directory: website run: npm install && npm run build diff --git a/benchmark/package.json b/benchmark/package.json index 4dce59d97..b9347f866 100644 --- a/benchmark/package.json +++ b/benchmark/package.json @@ -26,7 +26,7 @@ }, "homepage": "https://nestia.io", "dependencies": { - "@nestia/core": "^4.0.0", + "@nestia/core": "workspace:^", "@nestjs/common": "^10.3.7", "@nestjs/core": "^10.3.7", "@nestjs/platform-express": "^10.3.7", diff --git a/build/index.js b/build/index.js deleted file mode 100644 index bbf9e4326..000000000 --- a/build/index.js +++ /dev/null @@ -1,32 +0,0 @@ -const cp = require("child_process"); -const fs = require("fs"); - -const PACKAGES = `${__dirname}/../packages`; -const README = `${__dirname}/../README.md`; - -const execute = (command) => { - console.log(command); - cp.execSync(command, { stdio: "inherit" }); -}; - -const main = () => - fs.readdirSync(PACKAGES).forEach((lib) => { - const location = `${PACKAGES}/${lib}`; - if (fs.existsSync(`${location}/package.json`) === false) return; - - console.log("----------------------------------------"); - console.log(`@nestia/${lib}`); - console.log("----------------------------------------"); - process.chdir(location); - - fs.copyFileSync(README, "README.md"); - - const test = !!JSON.parse( - fs.readFileSync("package.json", { encoding: "utf-8" }), - ).scripts?.test; - - execute("npm install"); - execute("npm run build"); - if (test) execute("npm run test"); - }); -main(); diff --git a/deploy/build.js b/deploy/build.js new file mode 100644 index 000000000..fcfacd4e7 --- /dev/null +++ b/deploy/build.js @@ -0,0 +1,23 @@ +const cp = require("child_process"); + +const execute = (name) => { + console.log("========================================="); + console.log(` Build @nestia/${name}`); + console.log("========================================="); + + process.chdir(`${__dirname}/../packages/${name}`); + + cp.execSync("pnpm install", { stdio: "inherit" }); + cp.execSync("npm run build", { stdio: "inherit" }); +}; + +const build = async () => { + await execute("fetcher"); + await execute("core"); + await execute("sdk"); + await execute("e2e"); + await execute("cli"); + await execute("benchmark"); +}; + +module.exports = { build }; diff --git a/deploy/index.js b/deploy/index.js index 2d3a4e68a..201d78dec 100644 --- a/deploy/index.js +++ b/deploy/index.js @@ -1,6 +1,15 @@ +const { build } = require("./build"); const { publish } = require("./publish"); -const tag = process.argv[2]; -if (tag !== "latest" && tag !== "next" && tag !== "tgz") - throw new Error("Invalid tag"); -publish(tag); +const main = async () => { + if (process.argv[2] === "build") await build(); + else if (process.argv[2] === "publish") { + const index = process.argv.indexOf("--tag"); + const tag = index === -1 ? "next" : process.argv[index + 1]; + await publish(tag); + } +}; +main().catch((error) => { + console.error(error); + process.exit(-1); +}); diff --git a/deploy/publish.js b/deploy/publish.js index 50c6dcc30..f18b717e9 100644 --- a/deploy/publish.js +++ b/deploy/publish.js @@ -1,45 +1,33 @@ const cp = require("child_process"); const fs = require("fs"); -const path = require("path"); +const { build } = require("./build"); const packages = ["fetcher", "core", "sdk"]; -const execute = - (cwd, stdio = "ignore") => - (command) => { - console.log(command); - cp.execSync(command, { cwd, stdio }); - }; +const execute = ({ cwd, script, studio }) => { + console.log(script); + cp.execSync(script, { + cwd: cwd, + stdio: studio ?? "ignore", + }); +}; -const setup = (tag) => (version) => (directory) => { +const setup = ({ tag, version, directory }) => { // CHANGE PACKAGE.JSON INFO const file = `${directory}/package.json`; const info = JSON.parse(fs.readFileSync(file, "utf8")); info.version = version; + // SET DEPENDENCIES + const rollbacks = []; for (const record of [info.dependencies ?? {}, info.devDependencies ?? {}]) for (const key of Object.keys(record)) if ( key.startsWith("@nestia") && packages.includes(key.replace("@nestia/", "")) ) { - if (tag === "tgz" && fs.existsSync(`${directory}/node_modules/${key}`)) - try { - execute(directory)(`npm uninstall ${key}`); - } catch {} - record[key] = - tag === "tgz" - ? path - .relative( - directory, - `${__dirname}/../packages/${key.replace( - "@nestia/", - "", - )}/nestia-${key.replace("@nestia/", "")}-${version}.tgz`, - ) - .split("\\") - .join("/") - : `^${version}`; + record[key] = `^${version}`; + rollbacks.push(() => (record[key] = `workspace:^`)); } for (const key of Object.keys(info.peerDependencies ?? {})) if ( @@ -48,28 +36,34 @@ const setup = (tag) => (version) => (directory) => { ) info.peerDependencies[key] = `>=${version}`; - // SETUP UPDATED DEPENDENCIES + // DO PUBLISH fs.writeFileSync(file, JSON.stringify(info, null, 2), "utf8"); if (fs.existsSync(`${directory}/package-lock.json`)) fs.rmSync(`${directory}/package-lock.json`); - execute(directory)("npm cache clean --force"); - execute(directory)(`npm install`); + execute({ + cwd: directory, + script: `npm publish --tag ${tag} --access public`, + studio: "inherit", + }); + + // ROLLBACK THE PACKAGE.JSON + for (const r of rollbacks) r(); + fs.writeFileSync(file, JSON.stringify(info, null, 2), "utf8"); }; -const deploy = (tag) => (version) => (name) => { - console.log("-----------------------------------------"); - console.log(name.toUpperCase()); - console.log("-----------------------------------------"); +const deploy = ({ tag, version, name }) => { + console.log("========================================="); + console.log(` Publish @nestia/${name}`); + console.log("========================================="); // SETUP const directory = `${__dirname}/../packages/${name}`; - setup(tag)(version)(directory); - execute(directory)(`npm run build`); fs.copyFileSync(`${__dirname}/../README.md`, `${directory}/README.md`); - - // PUBLISH (OR PACK) - if (tag === "tgz") execute(directory)(`npm pack`); - else execute(directory)(`npm publish --tag ${tag} --access public`); + setup({ + tag, + version, + directory, + }); console.log(""); }; @@ -88,6 +82,9 @@ const publish = async (tag) => { else if (tag === "latest" && dev === true) throw new Error(`latest tag can only be used for non-dev versions.`); + // BUILD FIRST + await build(); + // DO DEPLOY const skip = (() => { const index = process.argv.indexOf("--skip"); @@ -98,15 +95,13 @@ const publish = async (tag) => { })(); for (const pack of packages) { if (skip.includes(pack)) continue; - deploy(tag)(version)(pack); + deploy({ + tag, + version, + name: pack, + }); await new Promise((resolve) => setTimeout(resolve, 1_000)); } - - // SETUP INTO TEST - console.log("-----------------------------------------"); - console.log("TEST"); - console.log("-----------------------------------------"); - setup(tag)(version)(`${__dirname}/../test`); }; module.exports = { publish }; diff --git a/package.json b/package.json index 3b48bc57b..f4065d526 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,12 @@ { "private": true, "name": "@nestia/station", - "version": "4.0.4", + "version": "4.0.5", "description": "Nestia station", "scripts": { - "build": "node build/index.js", - "package:latest": "node deploy latest", - "package:next": "node deploy next", - "package:tgz": "node deploy tgz", + "build": "node deploy build", + "package:latest": "node deploy publish --tag latest", + "package:next": "node deploy publish --tag next", "prettier": "prettier packages/*/src/**/*.ts --write && prettier benchmark/**/*.ts && prettier test/**/*.ts --write", "test": "cd test && npm run start" }, @@ -23,6 +22,7 @@ "homepage": "https://nestia.io", "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/node": "^22.10.1", "prettier": "^3.2.4", "rimraf": "^5.0.1", "sloc": "^0.3.0" diff --git a/packages/benchmark/package.json b/packages/benchmark/package.json index fe3d02e9f..ed8ce4980 100644 --- a/packages/benchmark/package.json +++ b/packages/benchmark/package.json @@ -22,14 +22,14 @@ "author": "Jeongho Nam", "license": "MIT", "devDependencies": { - "@nestia/core": "^4.0.0", - "@nestia/e2e": "^0.7.0", - "@nestia/sdk": "^4.0.0", + "@nestia/core": "workspace:^", + "@nestia/e2e": "workspace:^", + "@nestia/sdk": "workspace:^", "@nestjs/common": "^10.3.10", "@nestjs/core": "^10.3.10", "@nestjs/platform-express": "^10.3.10", "@types/uuid": "^10.0.0", - "nestia": "^5.5.0", + "nestia": "workspace:^i", "ts-node": "^10.9.2", "ts-patch": "^3.3.0", "typescript": "~5.7.2", @@ -38,7 +38,7 @@ "uuid": "^10.0.0" }, "dependencies": { - "@nestia/fetcher": "^4.0.1", + "@nestia/fetcher": "workspace:^", "tgrid": "^1.1.0", "tstl": "^3.0.0" }, diff --git a/packages/cli/package.json b/packages/cli/package.json index b8ffa3ee7..de0cf1b0b 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -37,8 +37,8 @@ "package-manager-detector": "^0.2.0" }, "devDependencies": { - "@nestia/core": "^3.8.0", - "@nestia/sdk": "^3.8.0", + "@nestia/core": "workspace:^", + "@nestia/sdk": "workspace:^", "@types/inquirer": "^9.0.3", "@types/node": "^18.11.16", "rimraf": "^3.0.2", diff --git a/packages/core/package.json b/packages/core/package.json index 4a9a4d19d..18d75ed19 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@nestia/core", - "version": "4.0.4", + "version": "4.0.5-dev.20241207-3", "description": "Super-fast validation decorators of NestJS", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -36,7 +36,7 @@ }, "homepage": "https://nestia.io", "dependencies": { - "@nestia/fetcher": "^4.0.4", + "@nestia/fetcher": "workspace:^", "@nestjs/common": ">=7.0.1", "@nestjs/core": ">=7.0.1", "@samchon/openapi": "^2.0.1", @@ -52,7 +52,7 @@ "ws": "^7.5.3" }, "peerDependencies": { - "@nestia/fetcher": ">=4.0.4", + "@nestia/fetcher": ">=4.0.5-dev.20241207-3", "@nestjs/common": ">=7.0.1", "@nestjs/core": ">=7.0.1", "reflect-metadata": ">=0.1.12", @@ -60,8 +60,8 @@ "typia": ">=7.0.2 <8.0.0" }, "devDependencies": { - "@nestjs/common": "^10.3.3", - "@nestjs/core": "^10.3.3", + "@nestjs/common": "^10.4.13", + "@nestjs/core": "^10.4.13", "@types/express": "^4.17.15", "@types/glob": "^7.2.0", "@types/inquirer": "^9.0.3", diff --git a/packages/core/src/transformers/ParameterDecoratorTransformer.ts b/packages/core/src/transformers/ParameterDecoratorTransformer.ts index 9350d470d..6ce63c66b 100644 --- a/packages/core/src/transformers/ParameterDecoratorTransformer.ts +++ b/packages/core/src/transformers/ParameterDecoratorTransformer.ts @@ -32,7 +32,7 @@ export namespace ParameterDecoratorTransformer { // FILE PATH const file: string = path.resolve(declaration.getSourceFile().fileName); - if (file.indexOf(LIB_PATH) === -1 && file.indexOf(SRC_PATH) === -1) + if (file.indexOf(LIB_PATH) === -1 && file.indexOf(MONO_PATH) === -1) return props.decorator; //---- @@ -127,7 +127,7 @@ const FUNCTORS: Record = { }; const LIB_PATH = path.join("@nestia", "core", "lib", "decorators"); -const SRC_PATH = path.resolve(path.join(__dirname, "..", "decorators")); +const MONO_PATH = path.join("packages", "core", "lib", "decorators"); const getName = (symbol: ts.Symbol): string => { const parent = symbol.getDeclarations()?.[0]?.parent; diff --git a/packages/core/src/transformers/TypedRouteTransformer.ts b/packages/core/src/transformers/TypedRouteTransformer.ts index 2d896f209..999768b7d 100644 --- a/packages/core/src/transformers/TypedRouteTransformer.ts +++ b/packages/core/src/transformers/TypedRouteTransformer.ts @@ -77,8 +77,9 @@ export namespace TypedRouteTransformer { !(checker as any).isArrayType(type) && !(checker as any).isArrayLikeType(type); - const CLASSES = ["EncryptedRoute", "TypedRoute", "TypedQuery"]; - const LIB_PATHS = CLASSES.map((cla) => + const CLASSES: string[] = ["EncryptedRoute", "TypedRoute", "TypedQuery"]; + const LIB_PATHS: string[] = CLASSES.map((cla) => [ path.join("@nestia", "core", "lib", "decorators", `${cla}.d.ts`), - ); + path.join("packages", "core", "lib", "decorators", `${cla}.d.ts`), + ]).flat(); } diff --git a/packages/core/src/transformers/WebSocketRouteTransformer.ts b/packages/core/src/transformers/WebSocketRouteTransformer.ts index 38b229f77..3f79a634e 100644 --- a/packages/core/src/transformers/WebSocketRouteTransformer.ts +++ b/packages/core/src/transformers/WebSocketRouteTransformer.ts @@ -99,7 +99,9 @@ const isLocated = (signature: ts.Signature) => { const location: string = path.resolve( signature.declaration.getSourceFile().fileName, ); - return location.indexOf(LIB_PATH) !== -1; + return ( + location.indexOf(LIB_PATH) !== -1 || location.indexOf(MONO_PATH) !== -1 + ); }; const LIB_PATH = path.join( @@ -109,3 +111,10 @@ const LIB_PATH = path.join( "decorators", `WebSocketRoute.d.ts`, ); +const MONO_PATH = path.join( + "packages", + "core", + "lib", + "decorators", + `WebSocketRoute.d.ts`, +); diff --git a/packages/editor/package.json b/packages/editor/package.json index a4c53f21d..77a947044 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -34,7 +34,7 @@ "homepage": "https://nestia.io", "dependencies": { "@mui/material": "^5.15.6", - "@nestia/migrate": "^0.21.3", + "@nestia/migrate": "workspace:^", "@stackblitz/sdk": "^1.11.0", "js-yaml": "^4.1.0", "prettier": "3.3.3", @@ -43,10 +43,10 @@ }, "devDependencies": { "@eslint/js": "^9.13.0", - "@nestjs/common": "^10.4.6", - "@nestjs/core": "^10.4.6", - "@nestjs/platform-express": "^10.4.6", - "@nestjs/platform-fastify": "^10.4.6", + "@nestjs/common": "^10.4.13", + "@nestjs/core": "^10.4.13", + "@nestjs/platform-express": "^10.4.13", + "@nestjs/platform-fastify": "^10.4.13", "@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-typescript": "^12.1.1", "@types/js-yaml": "^4.0.9", diff --git a/packages/fetcher/package.json b/packages/fetcher/package.json index de6275d48..efa6e815d 100644 --- a/packages/fetcher/package.json +++ b/packages/fetcher/package.json @@ -1,6 +1,6 @@ { "name": "@nestia/fetcher", - "version": "4.0.4", + "version": "4.0.5-dev.20241207-3", "description": "Fetcher library of Nestia SDK", "main": "lib/index.js", "typings": "lib/index.d.ts", diff --git a/packages/migrate/package.json b/packages/migrate/package.json index 80d48d044..92a101b36 100644 --- a/packages/migrate/package.json +++ b/packages/migrate/package.json @@ -37,12 +37,12 @@ }, "homepage": "https://nestia.io", "devDependencies": { - "@nestia/benchmark": "^0.3.0", - "@nestia/core": "^4.0.4", - "@nestia/e2e": "^0.7.0", - "@nestia/fetcher": "^4.0.4", - "@nestjs/common": "^10.3.8", - "@nestjs/core": "^10.3.8", + "@nestia/benchmark": "workspace:^", + "@nestia/core": "workspace:^", + "@nestia/e2e": "workspace:^", + "@nestia/fetcher": "workspace:^", + "@nestjs/common": "^10.4.13", + "@nestjs/core": "^10.4.13", "@nestjs/platform-express": "^10.3.8", "@nestjs/platform-fastify": "^10.3.8", "@rollup/plugin-terser": "^0.4.4", @@ -71,7 +71,7 @@ "typescript-transform-paths": "^3.5.2" }, "dependencies": { - "@nestia/sdk": "^4.0.4", + "@nestia/sdk": "workspace:^", "@samchon/openapi": "^2.0.1", "commander": "10.0.0", "inquirer": "8.2.5", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index b185b81cf..dae473260 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@nestia/sdk", - "version": "4.0.4", + "version": "4.0.5-dev.20241207-3", "description": "Nestia SDK and Swagger generator", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -32,8 +32,8 @@ }, "homepage": "https://nestia.io", "dependencies": { - "@nestia/core": "^4.0.4", - "@nestia/fetcher": "^4.0.4", + "@nestia/core": "workspace:^", + "@nestia/fetcher": "workspace:^", "@samchon/openapi": "^2.0.1", "cli": "^1.0.1", "get-function-location": "^2.0.0", @@ -47,8 +47,8 @@ "typia": "^7.0.2" }, "peerDependencies": { - "@nestia/core": ">=4.0.4", - "@nestia/fetcher": ">=4.0.4", + "@nestia/core": ">=4.0.5-dev.20241207-3", + "@nestia/fetcher": ">=4.0.5-dev.20241207-3", "@nestjs/common": ">=7.0.1", "@nestjs/core": ">=7.0.1", "reflect-metadata": ">=0.1.12", diff --git a/packages/sdk/src/NestiaSdkApplication.ts b/packages/sdk/src/NestiaSdkApplication.ts index 4a37bc6e1..9b4f39ddf 100644 --- a/packages/sdk/src/NestiaSdkApplication.ts +++ b/packages/sdk/src/NestiaSdkApplication.ts @@ -46,6 +46,7 @@ export class NestiaSdkApplication { } if (this.config.swagger) await SwaggerGenerator.generate(app); }, + validate: this.config.output ? SdkGenerator.validate : undefined, }); } @@ -232,11 +233,13 @@ export class NestiaSdkApplication { AccessorAnalyzer.analyze(routes); if (props.validate !== undefined) - props.validate({ - project, - collection, - routes, - }); + project.errors.push( + ...props.validate({ + project, + collection, + routes, + }), + ); if (project.errors.length) return report({ type: "error", @@ -295,7 +298,8 @@ const report = (props: { }) .join("\n"), ].join(""); - console.log(message); + if (props.type === "error") throw new Error(message); + else console.log(message); } }; diff --git a/packages/sdk/src/transformers/SdkOperationTransformer.ts b/packages/sdk/src/transformers/SdkOperationTransformer.ts index f87ee10d4..0735285ce 100644 --- a/packages/sdk/src/transformers/SdkOperationTransformer.ts +++ b/packages/sdk/src/transformers/SdkOperationTransformer.ts @@ -195,14 +195,20 @@ export namespace SdkOperationTransformer { props.decorators .map((deco) => { if (false === ts.isCallExpression(deco.expression)) return null; + const signature: ts.Signature | undefined = props.checker.getResolvedSignature(deco.expression); if (signature === undefined) return null; else if (!signature.declaration) return null; + const location: string = path.resolve( signature.declaration.getSourceFile()?.fileName ?? "", ); - if (location.includes(TYPED_EXCEPTION_PATH) === false) return null; + if ( + location.includes(TYPED_EXCEPTION_LIB_PATH) === false && + location.includes(TYPED_EXCEPTION_MONO_PATH) === false + ) + return null; else if (deco.expression.typeArguments?.length !== 1) return null; return deco.expression.typeArguments[0]; }) @@ -224,13 +230,20 @@ class MethodKey { } } -const TYPED_EXCEPTION_PATH = path.join( +const TYPED_EXCEPTION_LIB_PATH = path.join( "@nestia", "core", "lib", "decorators", `TypedException.d.ts`, ); +const TYPED_EXCEPTION_MONO_PATH = path.join( + "packages", + "core", + "lib", + "decorators", + `TypedException.d.ts`, +); const collection = new Singleton( () => diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 000000000..782f953ac --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,4 @@ +packages: + - 'packages/*' + - 'test' + - 'benchmark' \ No newline at end of file diff --git a/test/executable/start.js b/test/executable/start.js index 9e0798fe1..b09d92dc7 100644 --- a/test/executable/start.js +++ b/test/executable/start.js @@ -1,6 +1,7 @@ const cp = require("child_process"); const fs = require("fs"); -const { publish } = require("../../deploy/publish"); + +const { build } = require("../../deploy/build"); const featureDirectory = (name) => `${__dirname}/../features/${name}`; const feature = (name) => { @@ -13,31 +14,33 @@ const feature = (name) => { name === "cli-config" || name === "cli-config-project" ? "nestia.configuration.ts" : "nestia.config.ts"; - const generate = (type) => { + const generate = (type, mustBeError) => { const tail = name === "cli-config" || name === "cli-config-project" ? " --config nestia.configuration.ts" : name === "cli-config-project" || name === "cli-project" ? " --project tsconfig.nestia.json" : ""; - try { + if (mustBeError) cp.execSync(`npx nestia ${type}${tail}`, { stdio: "ignore" }); - } catch { - cp.execSync(`npx nestia ${type}${tail}`, { stdio: "inherit" }); - } + else + try { + cp.execSync(`npx nestia ${type}${tail}`, { stdio: "ignore" }); + } catch { + cp.execSync(`npx nestia ${type}${tail}`, { stdio: "inherit" }); + } }; // ERROR MODE HANDLING - if (name.includes("error")) + if (name.includes("error")) { try { - TestValidator.error("compile error")(() => { - cp.execSync("npx tsc", { stdio: "ignore" }); - generate("all"); - }); - throw new Error("compile error must be occured."); + cp.execSync("npx tsc", { stdio: "ignore" }); + generate("all", true); } catch { return; } + throw new Error("compile error must be occured."); + } // GENERATE SWAGGER & OPENAI & SDK & E2E for (const file of [ @@ -52,10 +55,8 @@ const feature = (name) => { ]) cp.execSync(`npx rimraf ${file}`, { stdio: "ignore" }); - if (name.includes("distribute")) - cp.execSync(`npx rimraf packages/api`, { stdio: "ignore" }); - - if (name === "all") { + if (name.includes("distribute")) return; + else if (name === "all") { const config = fs.readFileSync(`${featureDirectory(name)}/${file}`, "utf8"); { const lines = config.split("\r\n").join("\n").split("\n"); @@ -86,8 +87,8 @@ const main = async () => { }; await measure("\nTotal Elapsed Time")(async () => { - if (!process.argv.find((str) => str === "--skipBuild")) - await publish("tgz"); + if (!process.argv.find((str) => str === "--skipBuild")) await build(); + cp.execSync("pnpm install", { stdio: "inherit" }); console.log("\nTest Features"); const filter = (() => { @@ -103,17 +104,6 @@ const main = async () => { for (const name of await fs.promises.readdir(featureDirectory(""))) if (filter(name)) await measure()(async () => feature(name)); } - - // console.log("\nMigration Tests"); - // if (!process.argv.includes("--skipMigrates")) { - // if (fs.existsSync(`${__dirname}/../migrated`)) - // fs.rmSync(`${__dirname}/../migrated`, { recursive: true }); - // fs.mkdirSync(`${__dirname}/../migrated`); - - // for (const name of ["body", "date", "head", "param", "plain", "query" ,"security"]) - // if (name.includes(only ?? name)) - // await measure()(async () => migrate(name)); - // } }); }; diff --git a/test/features/all/swagger.json b/test/features/all/swagger.json index 4917357b1..dca026ef9 100644 --- a/test/features/all/swagger.json +++ b/test/features/all/swagger.json @@ -7,7 +7,7 @@ } ], "info": { - "version": "4.0.1-dev.20241203", + "version": "4.0.4", "title": "@samchon/nestia-test", "description": "Test program of Nestia", "license": { diff --git a/test/features/all/tsconfig.json b/test/features/all/tsconfig.json index c33dfa28f..ff0accab3 100644 --- a/test/features/all/tsconfig.json +++ b/test/features/all/tsconfig.json @@ -45,9 +45,9 @@ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ // "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. */ - // "outDir": "./", /* Specify an output folder for all emitted files. */ + "outDir": "./bin", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ - "noEmit": true, /* Disable emitting files from a compilation. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ @@ -94,5 +94,6 @@ { "transform": "typia/lib/transform" }, { "transform": "@nestia/core/lib/transform" }, ], - } + }, + "include": ["src"], } \ No newline at end of file diff --git a/test/features/app-globalPrefix-versionUri-routerModule/swagger.json b/test/features/app-globalPrefix-versionUri-routerModule/swagger.json index 1f178bfac..37b171ad6 100644 --- a/test/features/app-globalPrefix-versionUri-routerModule/swagger.json +++ b/test/features/app-globalPrefix-versionUri-routerModule/swagger.json @@ -7,7 +7,7 @@ } ], "info": { - "version": "4.0.1-dev.20241203", + "version": "4.0.4", "title": "@samchon/nestia-test", "description": "Test program of Nestia", "license": { diff --git a/test/features/app-globalPrefix-versionUri/swagger.json b/test/features/app-globalPrefix-versionUri/swagger.json index e1f9326b7..51e66f97e 100644 --- a/test/features/app-globalPrefix-versionUri/swagger.json +++ b/test/features/app-globalPrefix-versionUri/swagger.json @@ -7,7 +7,7 @@ } ], "info": { - "version": "4.0.1-dev.20241203", + "version": "4.0.4", "title": "@samchon/nestia-test", "description": "Test program of Nestia", "license": { diff --git a/test/features/app-globalPrefix/swagger.json b/test/features/app-globalPrefix/swagger.json index c07042960..875a3fad6 100644 --- a/test/features/app-globalPrefix/swagger.json +++ b/test/features/app-globalPrefix/swagger.json @@ -7,7 +7,7 @@ } ], "info": { - "version": "4.0.1-dev.20241203", + "version": "4.0.4", "title": "@samchon/nestia-test", "description": "Test program of Nestia", "license": { diff --git a/test/features/app-routerModule/swagger.json b/test/features/app-routerModule/swagger.json index 8a005a610..f571c5d84 100644 --- a/test/features/app-routerModule/swagger.json +++ b/test/features/app-routerModule/swagger.json @@ -7,7 +7,7 @@ } ], "info": { - "version": "4.0.1-dev.20241203", + "version": "4.0.4", "title": "@samchon/nestia-test", "description": "Test program of Nestia", "license": { diff --git a/test/features/app-versionHeader/swagger.json b/test/features/app-versionHeader/swagger.json index 68eead90a..ca6fee010 100644 --- a/test/features/app-versionHeader/swagger.json +++ b/test/features/app-versionHeader/swagger.json @@ -7,7 +7,7 @@ } ], "info": { - "version": "4.0.1-dev.20241203", + "version": "4.0.4", "title": "@samchon/nestia-test", "description": "Test program of Nestia", "license": { diff --git a/test/features/app-versionUri/swagger.json b/test/features/app-versionUri/swagger.json index 87cffb05d..b3aacb189 100644 --- a/test/features/app-versionUri/swagger.json +++ b/test/features/app-versionUri/swagger.json @@ -7,7 +7,7 @@ } ], "info": { - "version": "4.0.1-dev.20241203", + "version": "4.0.4", "title": "@samchon/nestia-test", "description": "Test program of Nestia", "license": { diff --git a/test/features/app/swagger.json b/test/features/app/swagger.json index 68eead90a..ca6fee010 100644 --- a/test/features/app/swagger.json +++ b/test/features/app/swagger.json @@ -7,7 +7,7 @@ } ], "info": { - "version": "4.0.1-dev.20241203", + "version": "4.0.4", "title": "@samchon/nestia-test", "description": "Test program of Nestia", "license": { diff --git a/test/features/beautify-4/swagger.json b/test/features/beautify-4/swagger.json index d5a747bfa..905ccdb0e 100644 --- a/test/features/beautify-4/swagger.json +++ b/test/features/beautify-4/swagger.json @@ -7,7 +7,7 @@ } ], "info": { - "version": "4.0.1-dev.20241203", + "version": "4.0.4", "title": "@samchon/nestia-test", "description": "Test program of Nestia", "license": { diff --git a/test/features/beautify-false/swagger.json b/test/features/beautify-false/swagger.json index b36fe22bc..d3ad7afbc 100644 --- a/test/features/beautify-false/swagger.json +++ b/test/features/beautify-false/swagger.json @@ -1 +1 @@ -{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.1-dev.20241203","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"summary":"Health check API","description":"Health check API.\n\nJust for health checking API liveness.","tags":["system","health"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"summary":"Get server performance info","description":"Get server performance info.","tags":["system","performance"],"parameters":[],"responses":{"200":{"description":"Performance info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"summary":"Store an article","description":"Store an article.","tags":[],"parameters":[],"requestBody":{"description":"Content to store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"Newly archived article","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}},"/body/{id}":{"put":{"tags":[],"parameters":[{"name":"id","in":"path","schema":{"type":"string","format":"uuid"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartialIBbsArticle.IStore"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]},"PartialIBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":[],"description":"Make all properties in T optional"}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[{"name":"system"},{"name":"health"},{"name":"performance"}],"x-samchon-emended":true} \ No newline at end of file +{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.4","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"summary":"Health check API","description":"Health check API.\n\nJust for health checking API liveness.","tags":["system","health"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"summary":"Get server performance info","description":"Get server performance info.","tags":["system","performance"],"parameters":[],"responses":{"200":{"description":"Performance info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"summary":"Store an article","description":"Store an article.","tags":[],"parameters":[],"requestBody":{"description":"Content to store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"Newly archived article","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}},"/body/{id}":{"put":{"tags":[],"parameters":[{"name":"id","in":"path","schema":{"type":"string","format":"uuid"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartialIBbsArticle.IStore"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]},"PartialIBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":[],"description":"Make all properties in T optional"}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[{"name":"system"},{"name":"health"},{"name":"performance"}],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/features/beautify/src/test/features/api/test_api_body_invalid.ts b/test/features/beautify/src/test/features/api/test_api_body_invalid.ts index dc8b9afb1..99a9b97e7 100644 --- a/test/features/beautify/src/test/features/api/test_api_body_invalid.ts +++ b/test/features/beautify/src/test/features/api/test_api_body_invalid.ts @@ -4,7 +4,7 @@ import typia from "typia"; import api from "@api"; import { IBbsArticle } from "@api/lib/structures/IBbsArticle"; -export const test_api_body = async ( +export const test_api_body_invalid = async ( connection: api.IConnection, ): Promise => { await TestValidator.httpError("invalid")(400)(() => diff --git a/test/features/beautify/src/test/index.ts b/test/features/beautify/src/test/index.ts index 1a8e4372b..166a343bd 100644 --- a/test/features/beautify/src/test/index.ts +++ b/test/features/beautify/src/test/index.ts @@ -23,7 +23,16 @@ async function main(): Promise { const elapsed: number = new Date(exec.completed_at).getTime() - new Date(exec.started_at).getTime(); - console.log(` - ${exec.name}: ${elapsed.toLocaleString()} ms`); + if (exec.error === null) + console.log(` - ${exec.name}: ${elapsed.toLocaleString()} ms`); + else console.log(` - ${exec.name} -> Error`); + }, + filter: (name) => { + const index: number = process.argv.findIndex( + (str) => str === "--include", + ); + if (index === -1) return true; + return process.argv.slice(index + 1).some((str) => name.includes(str)); }, }); await server.close(); diff --git a/test/features/beautify/swagger.json b/test/features/beautify/swagger.json index d27859d01..e77aeda05 100644 --- a/test/features/beautify/swagger.json +++ b/test/features/beautify/swagger.json @@ -7,7 +7,7 @@ } ], "info": { - "version": "4.0.1-dev.20241203", + "version": "4.0.4", "title": "@samchon/nestia-test", "description": "Test program of Nestia", "license": { diff --git a/test/features/body-config-assert/swagger.json b/test/features/body-config-assert/swagger.json index 52ab24744..20c03c6c0 100644 --- a/test/features/body-config-assert/swagger.json +++ b/test/features/body-config-assert/swagger.json @@ -1 +1 @@ -{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.1-dev.20241203","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file +{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.4","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/features/body-config-assertClone/swagger.json b/test/features/body-config-assertClone/swagger.json index 52ab24744..20c03c6c0 100644 --- a/test/features/body-config-assertClone/swagger.json +++ b/test/features/body-config-assertClone/swagger.json @@ -1 +1 @@ -{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.1-dev.20241203","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file +{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.4","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/features/body-config-assertEquals/swagger.json b/test/features/body-config-assertEquals/swagger.json index 52ab24744..20c03c6c0 100644 --- a/test/features/body-config-assertEquals/swagger.json +++ b/test/features/body-config-assertEquals/swagger.json @@ -1 +1 @@ -{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.1-dev.20241203","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file +{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.4","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/features/body-config-assertPrune/swagger.json b/test/features/body-config-assertPrune/swagger.json index 52ab24744..20c03c6c0 100644 --- a/test/features/body-config-assertPrune/swagger.json +++ b/test/features/body-config-assertPrune/swagger.json @@ -1 +1 @@ -{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.1-dev.20241203","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file +{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.4","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/features/body-config-equals/swagger.json b/test/features/body-config-equals/swagger.json index 52ab24744..20c03c6c0 100644 --- a/test/features/body-config-equals/swagger.json +++ b/test/features/body-config-equals/swagger.json @@ -1 +1 @@ -{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.1-dev.20241203","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file +{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.4","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/features/body-config-is/swagger.json b/test/features/body-config-is/swagger.json index 52ab24744..20c03c6c0 100644 --- a/test/features/body-config-is/swagger.json +++ b/test/features/body-config-is/swagger.json @@ -1 +1 @@ -{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.1-dev.20241203","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file +{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.4","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/features/body-config-validate/swagger.json b/test/features/body-config-validate/swagger.json index 52ab24744..20c03c6c0 100644 --- a/test/features/body-config-validate/swagger.json +++ b/test/features/body-config-validate/swagger.json @@ -1 +1 @@ -{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.1-dev.20241203","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file +{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.4","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/features/body-config-validateClone/swagger.json b/test/features/body-config-validateClone/swagger.json index 52ab24744..20c03c6c0 100644 --- a/test/features/body-config-validateClone/swagger.json +++ b/test/features/body-config-validateClone/swagger.json @@ -1 +1 @@ -{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.1-dev.20241203","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file +{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.4","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/features/body-config-validateEquals/swagger.json b/test/features/body-config-validateEquals/swagger.json index 52ab24744..20c03c6c0 100644 --- a/test/features/body-config-validateEquals/swagger.json +++ b/test/features/body-config-validateEquals/swagger.json @@ -1 +1 @@ -{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.1-dev.20241203","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file +{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.4","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/features/body-config-validatePrune/swagger.json b/test/features/body-config-validatePrune/swagger.json index 52ab24744..20c03c6c0 100644 --- a/test/features/body-config-validatePrune/swagger.json +++ b/test/features/body-config-validatePrune/swagger.json @@ -1 +1 @@ -{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.1-dev.20241203","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file +{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.4","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/features/body-error-implicit/src/api/HttpError.ts b/test/features/body-error-implicit/src/api/HttpError.ts new file mode 100644 index 000000000..5df328ae4 --- /dev/null +++ b/test/features/body-error-implicit/src/api/HttpError.ts @@ -0,0 +1 @@ +export { HttpError } from "@nestia/fetcher"; diff --git a/test/features/body-error-implicit/src/api/IConnection.ts b/test/features/body-error-implicit/src/api/IConnection.ts new file mode 100644 index 000000000..107bdb8f8 --- /dev/null +++ b/test/features/body-error-implicit/src/api/IConnection.ts @@ -0,0 +1 @@ +export type { IConnection } from "@nestia/fetcher"; diff --git a/test/features/body-error-implicit/src/api/Primitive.ts b/test/features/body-error-implicit/src/api/Primitive.ts new file mode 100644 index 000000000..ebdcd7620 --- /dev/null +++ b/test/features/body-error-implicit/src/api/Primitive.ts @@ -0,0 +1 @@ +export type { Primitive } from "typia"; diff --git a/test/features/body-error-implicit/src/api/Resolved.ts b/test/features/body-error-implicit/src/api/Resolved.ts new file mode 100644 index 000000000..7cf4920b0 --- /dev/null +++ b/test/features/body-error-implicit/src/api/Resolved.ts @@ -0,0 +1 @@ +export type { Resolved } from "typia"; diff --git a/test/features/body-error-implicit/src/api/functional/bbs/articles/index.ts b/test/features/body-error-implicit/src/api/functional/bbs/articles/index.ts new file mode 100644 index 000000000..ff669aec5 --- /dev/null +++ b/test/features/body-error-implicit/src/api/functional/bbs/articles/index.ts @@ -0,0 +1,59 @@ +/** + * @packageDocumentation + * @module api.functional.bbs.articles + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +//================================================================ +import type { IConnection } from "@nestia/fetcher"; +import { PlainFetcher } from "@nestia/fetcher/lib/PlainFetcher"; +import type { Resolved } from "typia"; +import type { Format } from "typia/lib/tags/Format"; + +import type { __type } from "../../../../controllers/BbsArticlesController"; + +/** + * @controller BbsArticlesController.update + * @path PUT /bbs/articles/:id + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +export async function update( + connection: IConnection, + id: string & Format<"uuid">, + input: update.Input, +): Promise { + return PlainFetcher.fetch( + { + ...connection, + headers: { + ...connection.headers, + "Content-Type": "application/json", + }, + }, + { + ...update.METADATA, + template: update.METADATA.path, + path: update.path(id), + }, + input, + ); +} +export namespace update { + export type Input = Resolved<__type>; + + export const METADATA = { + method: "PUT", + path: "/bbs/articles/:id", + request: { + type: "application/json", + encrypted: false, + }, + response: { + type: "application/json", + encrypted: false, + }, + status: 200, + } as const; + + export const path = (id: string & Format<"uuid">) => + `/bbs/articles/${encodeURIComponent(id?.toString() ?? "null")}`; +} diff --git a/test/features/body-error-implicit/src/api/functional/bbs/index.ts b/test/features/body-error-implicit/src/api/functional/bbs/index.ts new file mode 100644 index 000000000..7a891f888 --- /dev/null +++ b/test/features/body-error-implicit/src/api/functional/bbs/index.ts @@ -0,0 +1,7 @@ +/** + * @packageDocumentation + * @module api.functional.bbs + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +//================================================================ +export * as articles from "./articles"; diff --git a/test/features/body-error-implicit/src/api/functional/health/index.ts b/test/features/body-error-implicit/src/api/functional/health/index.ts new file mode 100644 index 000000000..36ae23908 --- /dev/null +++ b/test/features/body-error-implicit/src/api/functional/health/index.ts @@ -0,0 +1,35 @@ +/** + * @packageDocumentation + * @module api.functional.health + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +//================================================================ +import type { IConnection } from "@nestia/fetcher"; +import { PlainFetcher } from "@nestia/fetcher/lib/PlainFetcher"; + +/** + * @controller HealthController.get + * @path GET /health + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +export async function get(connection: IConnection): Promise { + return PlainFetcher.fetch(connection, { + ...get.METADATA, + template: get.METADATA.path, + path: get.path(), + }); +} +export namespace get { + export const METADATA = { + method: "GET", + path: "/health", + request: null, + response: { + type: "application/json", + encrypted: false, + }, + status: 200, + } as const; + + export const path = () => "/health"; +} diff --git a/test/features/body-error-implicit/src/api/functional/index.ts b/test/features/body-error-implicit/src/api/functional/index.ts new file mode 100644 index 000000000..3c05c315c --- /dev/null +++ b/test/features/body-error-implicit/src/api/functional/index.ts @@ -0,0 +1,8 @@ +/** + * @packageDocumentation + * @module api.functional + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +//================================================================ +export * as bbs from "./bbs"; +export * as health from "./health"; diff --git a/test/features/body-error-implicit/src/api/index.ts b/test/features/body-error-implicit/src/api/index.ts new file mode 100644 index 000000000..1705f43c8 --- /dev/null +++ b/test/features/body-error-implicit/src/api/index.ts @@ -0,0 +1,4 @@ +import * as api from "./module"; + +export * from "./module"; +export default api; diff --git a/test/features/body-error-implicit/src/api/module.ts b/test/features/body-error-implicit/src/api/module.ts new file mode 100644 index 000000000..2137b4473 --- /dev/null +++ b/test/features/body-error-implicit/src/api/module.ts @@ -0,0 +1,6 @@ +export type * from "./IConnection"; +export type * from "./Primitive"; +export type * from "./Resolved"; +export * from "./HttpError"; + +export * as functional from "./functional"; diff --git a/test/features/body-error-optional/nestia.config.ts b/test/features/body-error-optional/nestia.config.ts deleted file mode 100644 index ca670ea91..000000000 --- a/test/features/body-error-optional/nestia.config.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { INestiaConfig } from "@nestia/sdk"; - -export const NESTIA_CONFIG: INestiaConfig = { - input: ["src/controllers"], - output: "src/api", - swagger: { - output: "swagger.json", - security: { - bearer: { - type: "apiKey", - }, - }, - }, -}; -export default NESTIA_CONFIG; diff --git a/test/features/body-error-optional/src/api/structures/IBbsArticle.ts b/test/features/body-error-optional/src/api/structures/IBbsArticle.ts deleted file mode 100644 index 5a9e6cd32..000000000 --- a/test/features/body-error-optional/src/api/structures/IBbsArticle.ts +++ /dev/null @@ -1,43 +0,0 @@ -export interface IBbsArticle extends IBbsArticle.IStore { - /** - * @format uuid - */ - id: string; - - /** - * @format date-time - */ - created_at: string; -} -export namespace IBbsArticle { - export interface IStore { - /** - * @minLength 3 - * @maxLength 50 - */ - title: string; - body: string; - files: IAttachmentFile[]; - } - - export type IUpdate = Partial; -} - -export interface IAttachmentFile { - /** - * @minLengt 1 - * @maxLength 255 - */ - name: string | null; - - /** - * @minLength 1 - * @maxLength 8 - */ - extension: string | null; - - /** - * @format uri - */ - url: string; -} diff --git a/test/features/body-error-optional/src/controllers/HealthController.ts b/test/features/body-error-optional/src/controllers/HealthController.ts deleted file mode 100644 index f7e06aef4..000000000 --- a/test/features/body-error-optional/src/controllers/HealthController.ts +++ /dev/null @@ -1,8 +0,0 @@ -import core from "@nestia/core"; -import { Controller } from "@nestjs/common"; - -@Controller("health") -export class HealthController { - @core.TypedRoute.Get() - public get(): void {} -} diff --git a/test/features/body-error-optional/src/controllers/TypedBodyController.ts b/test/features/body-error-optional/src/controllers/TypedBodyController.ts deleted file mode 100644 index 05ca93cbb..000000000 --- a/test/features/body-error-optional/src/controllers/TypedBodyController.ts +++ /dev/null @@ -1,40 +0,0 @@ -import core from "@nestia/core"; -import { Controller, Request } from "@nestjs/common"; -import typia, { tags } from "typia"; - -import { IBbsArticle } from "../api/structures/IBbsArticle"; - -@Controller("body") -export class TypedBodyController { - /** - * Store an article. - * - * @param request Request object from express. Must be disappeared in SDK - * @param input Content to store - * @returns Newly archived article - * - * @author Samchon - * @warning This is an fake API - */ - @core.TypedRoute.Post() - public async store( - @Request() request: any, - @core.TypedBody() input: IBbsArticle.IStore, - ): Promise { - request; - const output: IBbsArticle = { - ...typia.random(), - ...input, - }; - return output; - } - - @core.TypedRoute.Put(":id") - public async update( - @core.TypedParam("id") id: string & tags.Format<"uuid">, - @core.TypedBody() input?: IBbsArticle.IUpdate, - ): Promise { - id; - input; - } -} diff --git a/test/features/body-error-optional/tsconfig.json b/test/features/body-error-optional/tsconfig.json deleted file mode 100644 index 886b107c7..000000000 --- a/test/features/body-error-optional/tsconfig.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - /* Language and Environment */ - "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ - "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */// "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "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. */ - "outDir": "./bin", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ - // "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. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "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. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. *//* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true, /* Skip type checking all .d.ts files. */ - "plugins": [ - { "transform": "typescript-transform-paths" }, - { "transform": "typia/lib/transform" }, - { "transform": "@nestia/core/lib/transform" }, - ], - } - } \ No newline at end of file diff --git a/test/features/body/swagger.json b/test/features/body/swagger.json index b36fe22bc..d3ad7afbc 100644 --- a/test/features/body/swagger.json +++ b/test/features/body/swagger.json @@ -1 +1 @@ -{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.1-dev.20241203","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"summary":"Health check API","description":"Health check API.\n\nJust for health checking API liveness.","tags":["system","health"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"summary":"Get server performance info","description":"Get server performance info.","tags":["system","performance"],"parameters":[],"responses":{"200":{"description":"Performance info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"summary":"Store an article","description":"Store an article.","tags":[],"parameters":[],"requestBody":{"description":"Content to store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"Newly archived article","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}},"/body/{id}":{"put":{"tags":[],"parameters":[{"name":"id","in":"path","schema":{"type":"string","format":"uuid"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartialIBbsArticle.IStore"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]},"PartialIBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":[],"description":"Make all properties in T optional"}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[{"name":"system"},{"name":"health"},{"name":"performance"}],"x-samchon-emended":true} \ No newline at end of file +{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.4","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"summary":"Health check API","description":"Health check API.\n\nJust for health checking API liveness.","tags":["system","health"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/performance":{"get":{"summary":"Get server performance info","description":"Get server performance info.","tags":["system","performance"],"parameters":[],"responses":{"200":{"description":"Performance info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}}}},"/body":{"post":{"summary":"Store an article","description":"Store an article.","tags":[],"parameters":[],"requestBody":{"description":"Content to store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"201":{"description":"Newly archived article","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}},"/body/{id}":{"put":{"tags":[],"parameters":[{"name":"id","in":"path","schema":{"type":"string","format":"uuid"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartialIBbsArticle.IStore"}}},"required":true},"responses":{"200":{"description":"","content":{"application/json":{}}}}}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]},"IBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["title","body","files"]},"PartialIBbsArticle.IStore":{"type":"object","properties":{"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":[],"description":"Make all properties in T optional"}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[{"name":"system"},{"name":"health"},{"name":"performance"}],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/features/implicit-error/src/test/index.ts b/test/features/implicit-error/src/test/index.ts deleted file mode 100644 index 0451fb9a7..000000000 --- a/test/features/implicit-error/src/test/index.ts +++ /dev/null @@ -1,49 +0,0 @@ -import core from "@nestia/core"; -import { DynamicExecutor } from "@nestia/e2e"; -import { INestApplication } from "@nestjs/common"; -import { NestFactory } from "@nestjs/core"; - -async function main(): Promise { - const server: INestApplication = await NestFactory.create( - await core.DynamicModule.mount({ - include: ["src/controllers"], - exclude: [], - }), - ); - await server.listen(37_000); - - const report: DynamicExecutor.IReport = await DynamicExecutor.validate({ - extension: __filename.substring(__filename.length - 2), - prefix: "test", - parameters: () => [ - { - host: "http://127.0.0.1:37000", - }, - ], - location: `${__dirname}/features`, - onComplete: (exec) => { - const elapsed: number = - new Date(exec.completed_at).getTime() - - new Date(exec.started_at).getTime(); - console.log(` - ${exec.name}: ${elapsed.toLocaleString()} ms`); - }, - }); - await server.close(); - - const exceptions: Error[] = report.executions - .filter((exec) => exec.error !== null) - .map((exec) => exec.error!); - if (exceptions.length === 0) { - console.log("Success"); - console.log("Elapsed time", report.time.toLocaleString(), `ms`); - } else { - for (const exp of exceptions) console.log(exp); - console.log("Failed"); - console.log("Elapsed time", report.time.toLocaleString(), `ms`); - process.exit(-1); - } -} -main().catch((exp) => { - console.log(exp); - process.exit(-1); -}); diff --git a/test/features/implicit-error/swagger.json b/test/features/implicit-error/swagger.json index 6fa25d6b3..af7dec4d4 100644 --- a/test/features/implicit-error/swagger.json +++ b/test/features/implicit-error/swagger.json @@ -1,768 +1 @@ -{ - "openapi": "3.0.1", - "servers": [ - { - "url": "https://github.com/samchon/nestia", - "description": "insert your server url" - } - ], - "info": { - "version": "0.0.0", - "title": "@nestia/test", - "description": "Test program of Nestia" - }, - "paths": { - "/implicit/number": { - "get": { - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "number" - } - } - }, - "x-nestia-encrypted": false - } - }, - "x-nestia-namespace": "implicit.number.number", - "x-nestia-jsDocTags": [] - } - }, - "/implicit/object1": { - "get": { - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/__object" - } - } - }, - "x-nestia-encrypted": false - } - }, - "x-nestia-namespace": "implicit.object1.object1", - "x-nestia-jsDocTags": [] - } - }, - "/implicit/object2": { - "get": { - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/__object.o1" - } - } - }, - "x-nestia-encrypted": false - } - }, - "x-nestia-namespace": "implicit.object2.object2", - "x-nestia-jsDocTags": [] - } - }, - "/implicit/objectConstant": { - "get": { - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/__object.o2" - } - } - }, - "x-nestia-encrypted": false - } - }, - "x-nestia-namespace": "implicit.objectConstant.objectConstant", - "x-nestia-jsDocTags": [] - } - }, - "/implicit/array": { - "get": { - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/__object.o3" - } - } - } - }, - "x-nestia-encrypted": false - } - }, - "x-nestia-namespace": "implicit.array.array", - "x-nestia-jsDocTags": [] - } - }, - "/implicit/arrayUnion": { - "get": { - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/__object.o4" - }, - { - "$ref": "#/components/schemas/__object.o5" - } - ] - } - } - } - }, - "x-nestia-encrypted": false - } - }, - "x-nestia-namespace": "implicit.arrayUnion.arrayUnion", - "x-nestia-jsDocTags": [] - } - }, - "/implicit/matrix": { - "get": { - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/__object.o6" - } - } - } - } - }, - "x-nestia-encrypted": false - } - }, - "x-nestia-namespace": "implicit.matrix.matrix", - "x-nestia-jsDocTags": [] - } - }, - "/implicit/matrixUnion": { - "get": { - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/__object.o7" - }, - { - "$ref": "#/components/schemas/__object.o8" - } - ] - } - } - } - } - }, - "x-nestia-encrypted": false - } - }, - "x-nestia-namespace": "implicit.matrixUnion.matrixUnion", - "x-nestia-jsDocTags": [] - } - }, - "/implicit/tuple": { - "get": { - "tags": [], - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/__object.o9" - }, - { - "$ref": "#/components/schemas/__object.o10" - } - ] - }, - "x-typia-tuple": { - "type": "array", - "items": [ - { - "$ref": "#/components/schemas/__object.o9" - }, - { - "$ref": "#/components/schemas/__object.o10" - } - ] - } - } - } - }, - "x-nestia-encrypted": false - } - }, - "x-nestia-namespace": "implicit.tuple.tuple", - "x-nestia-jsDocTags": [] - } - } - }, - "components": { - "schemas": { - "__object": { - "type": "object", - "properties": { - "cpu": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.CpuUsage" - }, - "memory": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.MemoryUsage" - }, - "resource": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.ResourceUsage" - } - }, - "nullable": false, - "required": [ - "cpu", - "memory", - "resource" - ], - "x-typia-jsDocTags": [] - }, - "_singlequote_process_singlequote_.global.NodeJS.CpuUsage": { - "type": "object", - "properties": { - "user": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "system": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - } - }, - "nullable": false, - "required": [ - "user", - "system" - ], - "x-typia-jsDocTags": [] - }, - "_singlequote_process_singlequote_.global.NodeJS.MemoryUsage": { - "type": "object", - "properties": { - "rss": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "heapTotal": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "heapUsed": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "external": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "arrayBuffers": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - } - }, - "nullable": false, - "required": [ - "rss", - "heapTotal", - "heapUsed", - "external", - "arrayBuffers" - ], - "x-typia-jsDocTags": [] - }, - "_singlequote_process_singlequote_.global.NodeJS.ResourceUsage": { - "type": "object", - "properties": { - "fsRead": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "fsWrite": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "involuntaryContextSwitches": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "ipcReceived": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "ipcSent": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "majorPageFault": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "maxRSS": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "minorPageFault": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "sharedMemorySize": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "signalsCount": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "swappedOut": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "systemCPUTime": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "unsharedDataSize": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "unsharedStackSize": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "userCPUTime": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - }, - "voluntaryContextSwitches": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "number" - } - }, - "nullable": false, - "required": [ - "fsRead", - "fsWrite", - "involuntaryContextSwitches", - "ipcReceived", - "ipcSent", - "majorPageFault", - "maxRSS", - "minorPageFault", - "sharedMemorySize", - "signalsCount", - "swappedOut", - "systemCPUTime", - "unsharedDataSize", - "unsharedStackSize", - "userCPUTime", - "voluntaryContextSwitches" - ], - "x-typia-jsDocTags": [] - }, - "__object.o1": { - "type": "object", - "properties": { - "arch": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.Architecture" - }, - "platform": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.Platform" - }, - "versions": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.ProcessVersions" - } - }, - "nullable": false, - "required": [ - "arch", - "platform", - "versions" - ], - "x-typia-jsDocTags": [] - }, - "_singlequote_process_singlequote_.global.NodeJS.Architecture": { - "type": "string", - "enum": [ - "arm", - "arm64", - "ia32", - "mips", - "mipsel", - "ppc", - "ppc64", - "s390", - "s390x", - "x64" - ] - }, - "_singlequote_process_singlequote_.global.NodeJS.Platform": { - "type": "string", - "enum": [ - "aix", - "android", - "darwin", - "freebsd", - "haiku", - "linux", - "openbsd", - "sunos", - "win32", - "cygwin", - "netbsd" - ] - }, - "_singlequote_process_singlequote_.global.NodeJS.ProcessVersions": { - "type": "object", - "properties": { - "http_parser": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "string" - }, - "node": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "string" - }, - "v8": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "string" - }, - "ares": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "string" - }, - "uv": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "string" - }, - "zlib": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "string" - }, - "modules": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "string" - }, - "openssl": { - "x-typia-required": true, - "x-typia-optional": false, - "type": "string" - } - }, - "nullable": false, - "required": [ - "http_parser", - "node", - "v8", - "ares", - "uv", - "zlib", - "modules", - "openssl" - ], - "x-typia-jsDocTags": [], - "x-typia-additionalProperties": { - "x-typia-required": false, - "x-typia-optional": false, - "type": "string" - }, - "additionalProperties": { - "x-typia-required": false, - "x-typia-optional": false, - "type": "string" - } - }, - "__object.o2": { - "type": "object", - "properties": { - "cpu": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.CpuUsage" - }, - "memory": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.MemoryUsage" - }, - "resource": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.ResourceUsage" - } - }, - "nullable": false, - "required": [ - "cpu", - "memory", - "resource" - ], - "x-typia-jsDocTags": [] - }, - "__object.o3": { - "type": "object", - "properties": { - "cpu": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.CpuUsage" - }, - "memory": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.MemoryUsage" - }, - "resource": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.ResourceUsage" - } - }, - "nullable": false, - "required": [ - "cpu", - "memory", - "resource" - ], - "x-typia-jsDocTags": [] - }, - "__object.o4": { - "type": "object", - "properties": { - "cpu": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.CpuUsage" - }, - "memory": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.MemoryUsage" - }, - "resource": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.ResourceUsage" - } - }, - "nullable": false, - "required": [ - "cpu", - "memory", - "resource" - ], - "x-typia-jsDocTags": [] - }, - "__object.o5": { - "type": "object", - "properties": { - "arch": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.Architecture" - }, - "platform": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.Platform" - }, - "versions": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.ProcessVersions" - } - }, - "nullable": false, - "required": [ - "arch", - "platform", - "versions" - ], - "x-typia-jsDocTags": [] - }, - "__object.o6": { - "type": "object", - "properties": { - "cpu": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.CpuUsage" - }, - "memory": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.MemoryUsage" - }, - "resource": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.ResourceUsage" - } - }, - "nullable": false, - "required": [ - "cpu", - "memory", - "resource" - ], - "x-typia-jsDocTags": [] - }, - "__object.o7": { - "type": "object", - "properties": { - "cpu": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.CpuUsage" - }, - "memory": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.MemoryUsage" - }, - "resource": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.ResourceUsage" - } - }, - "nullable": false, - "required": [ - "cpu", - "memory", - "resource" - ], - "x-typia-jsDocTags": [] - }, - "__object.o8": { - "type": "object", - "properties": { - "arch": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.Architecture" - }, - "platform": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.Platform" - }, - "versions": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.ProcessVersions" - } - }, - "nullable": false, - "required": [ - "arch", - "platform", - "versions" - ], - "x-typia-jsDocTags": [] - }, - "__object.o9": { - "type": "object", - "properties": { - "cpu": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.CpuUsage" - }, - "memory": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.MemoryUsage" - }, - "resource": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.ResourceUsage" - } - }, - "nullable": false, - "required": [ - "cpu", - "memory", - "resource" - ], - "x-typia-jsDocTags": [] - }, - "__object.o10": { - "type": "object", - "properties": { - "arch": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.Architecture" - }, - "platform": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.Platform" - }, - "versions": { - "$ref": "#/components/schemas/_singlequote_process_singlequote_.global.NodeJS.ProcessVersions" - } - }, - "nullable": false, - "required": [ - "arch", - "platform", - "versions" - ], - "x-typia-jsDocTags": [] - } - }, - "securitySchemes": { - "bearer": { - "type": "apiKey", - "in": "header", - "name": "Authorization" - } - } - }, - "security": [ - { - "bearer": [] - } - ] -} \ No newline at end of file +{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.4","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/implicit/number":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"number"}}}}}}},"/implicit/object1":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"]}}}}}}},"/implicit/object2":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"arch":{"oneOf":[{"const":"arm"},{"const":"arm64"},{"const":"ia32"},{"const":"mips"},{"const":"mipsel"},{"const":"ppc"},{"const":"ppc64"},{"const":"riscv64"},{"const":"s390"},{"const":"s390x"},{"const":"x64"}]},"platform":{"oneOf":[{"const":"aix"},{"const":"android"},{"const":"darwin"},{"const":"freebsd"},{"const":"haiku"},{"const":"linux"},{"const":"openbsd"},{"const":"sunos"},{"const":"win32"},{"const":"cygwin"},{"const":"netbsd"}]},"versions":{"$ref":"#/components/schemas/process.global.NodeJS.ProcessVersions"}},"required":["arch","platform","versions"]}}}}}}},"/implicit/objectConstant":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"]}}}}}}},"/implicit/array":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"]}}}}}}}},"/implicit/arrayUnion":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"]},{"type":"object","properties":{"arch":{"oneOf":[{"const":"arm"},{"const":"arm64"},{"const":"ia32"},{"const":"mips"},{"const":"mipsel"},{"const":"ppc"},{"const":"ppc64"},{"const":"riscv64"},{"const":"s390"},{"const":"s390x"},{"const":"x64"}]},"platform":{"oneOf":[{"const":"aix"},{"const":"android"},{"const":"darwin"},{"const":"freebsd"},{"const":"haiku"},{"const":"linux"},{"const":"openbsd"},{"const":"sunos"},{"const":"win32"},{"const":"cygwin"},{"const":"netbsd"}]},"versions":{"$ref":"#/components/schemas/process.global.NodeJS.ProcessVersions"}},"required":["arch","platform","versions"]}]}}}}}}}},"/implicit/matrix":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"array","items":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"]}}}}}}}}},"/implicit/matrixUnion":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"]},{"type":"object","properties":{"arch":{"oneOf":[{"const":"arm"},{"const":"arm64"},{"const":"ia32"},{"const":"mips"},{"const":"mipsel"},{"const":"ppc"},{"const":"ppc64"},{"const":"riscv64"},{"const":"s390"},{"const":"s390x"},{"const":"x64"}]},"platform":{"oneOf":[{"const":"aix"},{"const":"android"},{"const":"darwin"},{"const":"freebsd"},{"const":"haiku"},{"const":"linux"},{"const":"openbsd"},{"const":"sunos"},{"const":"win32"},{"const":"cygwin"},{"const":"netbsd"}]},"versions":{"$ref":"#/components/schemas/process.global.NodeJS.ProcessVersions"}},"required":["arch","platform","versions"]}]}}}}}}}}},"/implicit/tuple":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","prefixItems":[{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"]},{"type":"object","properties":{"arch":{"oneOf":[{"const":"arm"},{"const":"arm64"},{"const":"ia32"},{"const":"mips"},{"const":"mipsel"},{"const":"ppc"},{"const":"ppc64"},{"const":"riscv64"},{"const":"s390"},{"const":"s390x"},{"const":"x64"}]},"platform":{"oneOf":[{"const":"aix"},{"const":"android"},{"const":"darwin"},{"const":"freebsd"},{"const":"haiku"},{"const":"linux"},{"const":"openbsd"},{"const":"sunos"},{"const":"win32"},{"const":"cygwin"},{"const":"netbsd"}]},"versions":{"$ref":"#/components/schemas/process.global.NodeJS.ProcessVersions"}},"required":["arch","platform","versions"]}],"additionalItems":false}}}}}}}},"components":{"schemas":{"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"process.global.NodeJS.ProcessVersions":{"type":"object","properties":{"http_parser":{"type":"string"},"node":{"type":"string"},"v8":{"type":"string"},"ares":{"type":"string"},"uv":{"type":"string"},"zlib":{"type":"string"},"modules":{"type":"string"},"openssl":{"type":"string"}},"required":["http_parser","node","v8","ares","uv","zlib","modules","openssl"],"additionalProperties":{"type":"string"}}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/features/method-error-get-body/src/controllers/MethodController.ts b/test/features/method-error-get-body/src/controllers/MethodController.ts index e062aa7fe..c6638c787 100644 --- a/test/features/method-error-get-body/src/controllers/MethodController.ts +++ b/test/features/method-error-get-body/src/controllers/MethodController.ts @@ -7,7 +7,7 @@ import { IBbsArticle } from "../api/structures/IBbsArticle"; @Controller("method") export class MethodController { @core.TypedRoute.Get("body") - public body(input: IBbsArticle.IStore): IBbsArticle { + public body(@core.TypedBody() input: IBbsArticle.IStore): IBbsArticle { input; return typia.random(); } diff --git a/test/features/method-error-get-body/swagger.json b/test/features/method-error-get-body/swagger.json new file mode 100644 index 000000000..cf4e1f84d --- /dev/null +++ b/test/features/method-error-get-body/swagger.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"4.0.4","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/method/body":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}}},"components":{"schemas":{"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}}},"required":["id","created_at","title","body","files"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/features/plain-error-optional/nestia.config.ts b/test/features/plain-error-optional/nestia.config.ts deleted file mode 100644 index ca670ea91..000000000 --- a/test/features/plain-error-optional/nestia.config.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { INestiaConfig } from "@nestia/sdk"; - -export const NESTIA_CONFIG: INestiaConfig = { - input: ["src/controllers"], - output: "src/api", - swagger: { - output: "swagger.json", - security: { - bearer: { - type: "apiKey", - }, - }, - }, -}; -export default NESTIA_CONFIG; diff --git a/test/features/plain-error-optional/src/controllers/HealthController.ts b/test/features/plain-error-optional/src/controllers/HealthController.ts deleted file mode 100644 index f7e06aef4..000000000 --- a/test/features/plain-error-optional/src/controllers/HealthController.ts +++ /dev/null @@ -1,8 +0,0 @@ -import core from "@nestia/core"; -import { Controller } from "@nestjs/common"; - -@Controller("health") -export class HealthController { - @core.TypedRoute.Get() - public get(): void {} -} diff --git a/test/features/plain-error-optional/src/controllers/PlainController.ts b/test/features/plain-error-optional/src/controllers/PlainController.ts deleted file mode 100644 index 1767ae150..000000000 --- a/test/features/plain-error-optional/src/controllers/PlainController.ts +++ /dev/null @@ -1,11 +0,0 @@ -import core from "@nestia/core"; -import { Controller, Header, Post } from "@nestjs/common"; - -@Controller("plain") -export class PlainController { - @Header("Content-Type", "text/plain") - @Post() - public async send(@core.PlainBody() body?: string): Promise { - return body ?? ""; - } -} diff --git a/test/features/plain-error-optional/tsconfig.json b/test/features/plain-error-optional/tsconfig.json deleted file mode 100644 index 886b107c7..000000000 --- a/test/features/plain-error-optional/tsconfig.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - /* Language and Environment */ - "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ - "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */// "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "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. */ - "outDir": "./bin", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ - // "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. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "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. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. *//* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true, /* Skip type checking all .d.ts files. */ - "plugins": [ - { "transform": "typescript-transform-paths" }, - { "transform": "typia/lib/transform" }, - { "transform": "@nestia/core/lib/transform" }, - ], - } - } \ No newline at end of file diff --git a/test/features/query-error-optional/nestia.config.ts b/test/features/query-error-optional/nestia.config.ts deleted file mode 100644 index ca670ea91..000000000 --- a/test/features/query-error-optional/nestia.config.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { INestiaConfig } from "@nestia/sdk"; - -export const NESTIA_CONFIG: INestiaConfig = { - input: ["src/controllers"], - output: "src/api", - swagger: { - output: "swagger.json", - security: { - bearer: { - type: "apiKey", - }, - }, - }, -}; -export default NESTIA_CONFIG; diff --git a/test/features/query-error-optional/src/Backend.ts b/test/features/query-error-optional/src/Backend.ts deleted file mode 100644 index 7e69bc6bd..000000000 --- a/test/features/query-error-optional/src/Backend.ts +++ /dev/null @@ -1,28 +0,0 @@ -import core from "@nestia/core"; -import { INestApplication } from "@nestjs/common"; -import { NestFactory } from "@nestjs/core"; - -export class Backend { - private application_?: INestApplication; - - public async open(): Promise { - this.application_ = await NestFactory.create( - await core.EncryptedModule.dynamic(__dirname + "/controllers", { - key: "A".repeat(32), - iv: "B".repeat(16), - }), - { logger: false }, - ); - await core.WebSocketAdaptor.upgrade(this.application_); - await this.application_.listen(37_000); - } - - public async close(): Promise { - if (this.application_ === undefined) return; - - const app = this.application_; - await app.close(); - - delete this.application_; - } -} diff --git a/test/features/query-error-optional/src/controllers/QueryController.ts b/test/features/query-error-optional/src/controllers/QueryController.ts deleted file mode 100644 index a626a623f..000000000 --- a/test/features/query-error-optional/src/controllers/QueryController.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { TypedQuery, TypedRoute } from "@nestia/core"; -import { Controller } from "@nestjs/common"; - -@Controller("query") -export class QueryController { - @TypedRoute.Get("optional") - public async optional( - @TypedQuery() query?: IOptionalQuery, - ): Promise { - return ( - query ?? { - b: 1, - c: false, - } - ); - } -} -export interface IOptionalQuery { - a?: string; - b: number; - c: boolean; -} diff --git a/test/features/query-error-optional/swagger.json b/test/features/query-error-optional/swagger.json deleted file mode 100644 index 9728399f0..000000000 --- a/test/features/query-error-optional/swagger.json +++ /dev/null @@ -1 +0,0 @@ -{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"3.5.0-dev.20240707","title":"@nestia/test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/query/typed":{"get":{"tags":[],"parameters":[{"name":"query","in":"query","schema":{"$ref":"#/components/schemas/IQuery"},"description":"","required":true}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IQuery"}}}}}}},"/query/optional":{"get":{"tags":[],"parameters":[{"name":"query","in":"query","schema":{"$ref":"#/components/schemas/IOptionalQuery"},"description":"","required":false}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IOptionalQuery"}}}}}}},"/query/nest":{"get":{"tags":[],"parameters":[{"name":"query","in":"query","schema":{"$ref":"#/components/schemas/INestQuery"},"description":"","required":true}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IQuery"}}}}}}},"/query/individual":{"get":{"tags":[],"parameters":[{"name":"id","in":"query","schema":{"type":"string"},"description":"","required":true}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/query/composite":{"get":{"tags":[],"parameters":[{"name":"atomic","in":"query","schema":{"type":"string"},"description":"","required":true},{"name":"query","in":"query","schema":{"$ref":"#/components/schemas/OmitIQueryatomic"},"description":"","required":true}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IQuery"}}}}}}},"/query/body":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/IQuery"}}},"required":true},"responses":{"201":{"description":"","content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/IQuery"}}}}}}}},"components":{"schemas":{"IQuery":{"type":"object","properties":{"limit":{"type":"number"},"enforce":{"type":"boolean"},"values":{"type":"array","items":{"type":"string"}},"atomic":{"oneOf":[{"type":"null"},{"type":"string"}]}},"required":["enforce","atomic"]},"IOptionalQuery":{"type":"object","properties":{"a":{"type":"string"},"b":{"type":"number"},"c":{"type":"boolean"}}},"INestQuery":{"type":"object","properties":{"limit":{"type":"string","pattern":"^([+-]?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)$"},"enforce":{"oneOf":[{"const":"false"},{"const":"true"}]},"atomic":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["enforce","atomic","values"]},"OmitIQueryatomic":{"type":"object","properties":{"limit":{"type":"number"},"enforce":{"type":"boolean"},"values":{"type":"array","items":{"type":"string"}}},"required":["enforce"],"description":"Construct a type with the properties of T except for those in type K."}},"securitySchemes":{"bearer":{"type":"apiKey","in":"header","name":"Authorization"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/features/query-error-optional/tsconfig.json b/test/features/query-error-optional/tsconfig.json deleted file mode 100644 index fbaf6ada7..000000000 --- a/test/features/query-error-optional/tsconfig.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - /* Language and Environment */ - "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ - "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */// "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - "paths": { - "@api": ["./src/api"], - "@api/lib/*": ["./src/api/*"], - }, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - "resolveJsonModule": true, /* Enable importing .json files. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "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. */ - "outDir": "./bin", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ - // "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. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "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. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. *//* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true, /* Skip type checking all .d.ts files. */ - "plugins": [ - { "transform": "typescript-transform-paths" }, - { "transform": "typia/lib/transform" }, - { "transform": "@nestia/core/lib/transform" }, - ], - } - } \ No newline at end of file diff --git a/test/package.json b/test/package.json index 3a4020ff9..54f4b4ba3 100644 --- a/test/package.json +++ b/test/package.json @@ -26,13 +26,13 @@ }, "homepage": "https://nestia.io", "devDependencies": { - "@nestia/sdk": "^4.0.4", + "@nestia/sdk": "workspace:^", "@nestjs/swagger": "^8.1.0", "@types/express": "^4.17.17", "@types/multer": "^1.4.12", "@types/node": "20.11.16", "@types/uuid": "^9.0.8", - "nestia": "^6.2.0", + "nestia": "workspace:^", "ts-node": "^10.9.2", "ts-patch": "~3.3.0", "typescript": "~5.7.2", @@ -40,9 +40,9 @@ }, "dependencies": { "@fastify/multipart": "^8.1.0", - "@nestia/core": "^4.0.4", - "@nestia/e2e": "^0.7.0", - "@nestia/fetcher": "^4.0.4", + "@nestia/core": "workspace:^", + "@nestia/e2e": "workspace:^", + "@nestia/fetcher": "workspace:^", "@nestjs/common": "^10.4.13", "@nestjs/core": "^10.4.13", "@nestjs/platform-express": "^10.4.13", From 2251b794f7e14470dca121a2faedf2de25b724d7 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sat, 7 Dec 2024 22:52:02 +0900 Subject: [PATCH 02/10] Update PR template --- .github/PULL_REQUEST_TEMPLATE.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0e83eb4ea..c6a83acc4 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,6 +3,9 @@ Before submitting a Pull Request, please test your code. If you created a new created a new feature, then create the unit test function, too. ```bash +# INSTALL PACKAGES +pnpm install + # COMPILE THE BACKEND SERVER npm run build From adfa20bada78237a171f188b92c2e4b47ca842f7 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sat, 7 Dec 2024 23:03:23 +0900 Subject: [PATCH 03/10] Fix monorepo bug --- packages/benchmark/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/benchmark/package.json b/packages/benchmark/package.json index ed8ce4980..cf1b71ef0 100644 --- a/packages/benchmark/package.json +++ b/packages/benchmark/package.json @@ -29,7 +29,7 @@ "@nestjs/core": "^10.3.10", "@nestjs/platform-express": "^10.3.10", "@types/uuid": "^10.0.0", - "nestia": "workspace:^i", + "nestia": "workspace:^", "ts-node": "^10.9.2", "ts-patch": "^3.3.0", "typescript": "~5.7.2", From 03f21b7319775ef600f1b39fd95c65634533c6d6 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sat, 7 Dec 2024 23:15:32 +0900 Subject: [PATCH 04/10] Fix pnpm setup problem again --- packages/migrate/package.json | 2 +- .../src/executable/{bundle.ts => bundle.js} | 54 +++++++++---------- 2 files changed, 27 insertions(+), 29 deletions(-) rename packages/migrate/src/executable/{bundle.ts => bundle.js} (54%) diff --git a/packages/migrate/package.json b/packages/migrate/package.json index 92a101b36..b9292f12d 100644 --- a/packages/migrate/package.json +++ b/packages/migrate/package.json @@ -10,7 +10,7 @@ }, "scripts": { "build": "rimraf lib && tsc && rollup -c", - "bundle": "ts-node src/executable/bundle.ts", + "bundle": "node src/executable/bundle.js", "dev": "rimraf lib && tsc --watch", "package:next": "npm publish --access public --tag next", "prepare": "ts-patch install && typia patch && npm run bundle", diff --git a/packages/migrate/src/executable/bundle.ts b/packages/migrate/src/executable/bundle.js similarity index 54% rename from packages/migrate/src/executable/bundle.ts rename to packages/migrate/src/executable/bundle.js index b2f6c630a..9e5ffceac 100644 --- a/packages/migrate/src/executable/bundle.ts +++ b/packages/migrate/src/executable/bundle.js @@ -1,19 +1,17 @@ -import cp from "child_process"; -import fs from "fs"; +const cp = require("child_process"); +const fs = require("fs"); -import { IHttpMigrateFile } from "../structures/IHttpMigrateFile"; +const ROOT = `${__dirname}/../..`; +const ASSETS = `${ROOT}/assets`; -const ROOT: string = `${__dirname}/../..`; -const ASSETS: string = `${ROOT}/assets`; - -const bundle = async (props: { - mode: "nest" | "sdk"; - repository: string; - exceptions?: string[]; -}): Promise => { - const root: string = `${__dirname}/../..`; - const assets: string = `${root}/assets`; - const template: string = `${assets}/${props.mode}`; +const bundle = async ({ + mode, + repository, + exceptions, +}) => { + const root = `${__dirname}/../..`; + const assets = `${root}/assets`; + const template = `${assets}/${mode}`; const clone = async () => { // CLONE REPOSITORY @@ -25,29 +23,29 @@ const bundle = async (props: { } catch {} cp.execSync( - `git clone https://github.com/samchon/${props.repository} ${props.mode}`, + `git clone https://github.com/samchon/${repository} ${mode}`, { cwd: ASSETS, }, ); // REMOVE VUNLERABLE FILES - for (const location of props.exceptions ?? []) + for (const location of exceptions ?? []) await fs.promises.rm(`${template}/${location}`, { recursive: true }); }; const iterate = - (collection: IHttpMigrateFile[]) => async (location: string) => { - const directory: string[] = await fs.promises.readdir(location); + (collection) => async (location) => { + const directory = await fs.promises.readdir(location); for (const file of directory) { - const absolute: string = location + "/" + file; - const stats: fs.Stats = await fs.promises.stat(absolute); + const absolute = location + "/" + file; + const stats = await fs.promises.stat(absolute); if (stats.isDirectory()) await iterate(collection)(absolute); else { - const content: string = await fs.promises.readFile(absolute, "utf-8"); + const content = await fs.promises.readFile(absolute, "utf-8"); collection.push({ location: (() => { - const str: string = location.replace(template, ""); + const str = location.replace(template, ""); return str[0] === "/" ? str.substring(1) : str; })(), file, @@ -57,10 +55,10 @@ const bundle = async (props: { } }; - const archive = async (collection: IHttpMigrateFile[]): Promise => { - const name: string = `${props.mode.toUpperCase()}_TEMPLATE`; - const body: string = JSON.stringify(collection, null, 2); - const content: string = `export const ${name} = ${body}`; + const archive = async (collection) => { + const name = `${mode.toUpperCase()}_TEMPLATE`; + const body = JSON.stringify(collection, null, 2); + const content = `export const ${name} = ${body}`; try { await fs.promises.mkdir(`${ROOT}/src/bundles`); @@ -72,13 +70,13 @@ const bundle = async (props: { ); }; - const collection: IHttpMigrateFile[] = []; + const collection = []; await clone(); await iterate(collection)(template); await archive(collection); }; -const main = async (): Promise => { +const main = async () => { await bundle({ mode: "nest", repository: "nestia-start", From f705041392b73112f46774e466aeb451ed0fe011 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sat, 7 Dec 2024 23:21:11 +0900 Subject: [PATCH 05/10] Do it again --- .github/workflows/build.yml | 2 ++ .github/workflows/migrate.yaml | 4 +++- .github/workflows/website.yml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4087e0020..574afa106 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,12 +2,14 @@ name: build on: push: paths: + - '.github/workflows/build.yml' - 'packages/{core,fetcher,sdk}/src/**' - 'packages/{core,fetcher,sdk}/package.json' - 'test/**' - 'test/package.json' pull_request: paths: + - '.github/workflows/build.yml' - 'packages/*/src/**' - 'packages/*/package.json' - 'test/**' diff --git a/.github/workflows/migrate.yaml b/.github/workflows/migrate.yaml index e13e01228..fc3a2f772 100644 --- a/.github/workflows/migrate.yaml +++ b/.github/workflows/migrate.yaml @@ -2,12 +2,14 @@ name: build on: push: paths: + - '.github/workflows/migrate.yaml' - 'packages/migrate/assets/input/*.json' - 'packages/migrate/src/**' - 'packages/migrate/test/**' - 'packages/migrate/package.json' pull_request: paths: + - '.github/workflows/migrate.yaml' - 'packages/*/src/**' - 'packages/*/package.json' - 'test/**' @@ -26,7 +28,7 @@ jobs: version: 8 - name: Install dependencies - run: pnpm install + run: pnpm install && npm run build - name: test working-directory: ./packages/migrate run: npm run test \ No newline at end of file diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index bb46c04d6..68d214afa 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -4,6 +4,7 @@ on: branches: - master paths: + - '.github/workflows/website.yml' - 'website/**' - 'website/package.json' jobs: From e00f176e39bee0578ed870f0911308c3609a2de7 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sat, 7 Dec 2024 23:23:34 +0900 Subject: [PATCH 06/10] Change name of the migrate.yml --- .github/workflows/migrate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/migrate.yaml b/.github/workflows/migrate.yaml index fc3a2f772..c1fe92171 100644 --- a/.github/workflows/migrate.yaml +++ b/.github/workflows/migrate.yaml @@ -1,4 +1,4 @@ -name: build +name: migrate on: push: paths: From 77440f7b619f93160fd05235d42c369114eca3d5 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sat, 7 Dec 2024 23:26:32 +0900 Subject: [PATCH 07/10] Fix migrate.yaml again and again --- .github/workflows/migrate.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/migrate.yaml b/.github/workflows/migrate.yaml index c1fe92171..2e8e24e18 100644 --- a/.github/workflows/migrate.yaml +++ b/.github/workflows/migrate.yaml @@ -29,6 +29,9 @@ jobs: - name: Install dependencies run: pnpm install && npm run build + - name: Build + working-directory: ./packages/migrate + run: npm run build - name: test working-directory: ./packages/migrate run: npm run test \ No newline at end of file From 94cf4d93e8587a7d47167ba3371d5bbb72bc4a58 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sat, 7 Dec 2024 23:31:03 +0900 Subject: [PATCH 08/10] Fix workflows --- .github/workflows/build.yml | 4 ++-- .github/workflows/migrate.yaml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 574afa106..be2f17790 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,8 +10,8 @@ on: pull_request: paths: - '.github/workflows/build.yml' - - 'packages/*/src/**' - - 'packages/*/package.json' + - 'packages/{core,fetcher,sdk}/src/**' + - 'packages/{core,fetcher,sdk}/package.json' - 'test/**' - 'test/package.json' diff --git a/.github/workflows/migrate.yaml b/.github/workflows/migrate.yaml index 2e8e24e18..85fc4412e 100644 --- a/.github/workflows/migrate.yaml +++ b/.github/workflows/migrate.yaml @@ -10,10 +10,10 @@ on: pull_request: paths: - '.github/workflows/migrate.yaml' - - 'packages/*/src/**' - - 'packages/*/package.json' - - 'test/**' - - 'test/package.json' + - 'packages/migrate/assets/input/*.json' + - 'packages/migrate/src/**' + - 'packages/migrate/test/**' + - 'packages/migrate/package.json' jobs: Ubuntu: From 45ad9d712301d98b1df2b58121312c09f5513af7 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sat, 7 Dec 2024 23:42:52 +0900 Subject: [PATCH 09/10] Add chalk --- test/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/test/package.json b/test/package.json index 54f4b4ba3..96400d3fd 100644 --- a/test/package.json +++ b/test/package.json @@ -32,6 +32,7 @@ "@types/multer": "^1.4.12", "@types/node": "20.11.16", "@types/uuid": "^9.0.8", + "chalk": "4.1.2", "nestia": "workspace:^", "ts-node": "^10.9.2", "ts-patch": "~3.3.0", From 29c28a7388b05f709ed64d38dcd9537eb68fe120 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sun, 8 Dec 2024 02:13:52 +0900 Subject: [PATCH 10/10] Prepared deploying --- .github/workflows/release.yml | 7 +- deploy/build.js | 17 +- deploy/index.js | 15 +- deploy/migrate.js | 38 ++++ deploy/publish.js | 48 ++--- packages/core/package.json | 4 +- packages/editor/README.md | 3 +- packages/editor/package.json | 5 +- packages/fetcher/package.json | 2 +- packages/migrate/README.md | 25 ++- packages/migrate/package.json | 4 +- packages/migrate/src/executable/bundle.js | 76 ++++--- packages/sdk/package.json | 6 +- website/build/editor.js | 2 +- website/build/typedoc.js | 2 +- website/package-lock.json | 240 +++++++--------------- website/package.json | 4 +- 17 files changed, 242 insertions(+), 256 deletions(-) create mode 100644 deploy/migrate.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b85815bb..6f0e51c76 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,4 +20,9 @@ jobs: - name: Publish to npm run: npm run package:latest env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH }} \ No newline at end of file + NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH }} + - name: Website + uses: JamesIves/github-pages-deploy-action@4.1.3 + with: + branch: gh-pages + folder: ./website/out \ No newline at end of file diff --git a/deploy/build.js b/deploy/build.js index fcfacd4e7..461d4dae1 100644 --- a/deploy/build.js +++ b/deploy/build.js @@ -11,13 +11,16 @@ const execute = (name) => { cp.execSync("npm run build", { stdio: "inherit" }); }; -const build = async () => { - await execute("fetcher"); - await execute("core"); - await execute("sdk"); - await execute("e2e"); - await execute("cli"); - await execute("benchmark"); +const build = async (packages) => { + for (const pack of packages ?? [ + "fetcher", + "core", + "sdk", + "e2e", + "cli", + "benchmark", + ]) + await execute(pack); }; module.exports = { build }; diff --git a/deploy/index.js b/deploy/index.js index 201d78dec..1f97c9f94 100644 --- a/deploy/index.js +++ b/deploy/index.js @@ -1,12 +1,21 @@ +const { version } = require("../package.json"); const { build } = require("./build"); +const { migrate } = require("./migrate"); const { publish } = require("./publish"); const main = async () => { - if (process.argv[2] === "build") await build(); - else if (process.argv[2] === "publish") { + await build(); + if (process.argv[2] === "publish") { const index = process.argv.indexOf("--tag"); const tag = index === -1 ? "next" : process.argv[index + 1]; - await publish(tag); + await publish({ + tag, + version: (name) => + ["fetcher", "core", "sdk"].includes(name) ? version : null, + packages: ["fetcher", "core", "sdk"], + }); + if (tag === "latest" || process.argv.includes("--migrate")) + await migrate(tag); } }; main().catch((error) => { diff --git a/deploy/migrate.js b/deploy/migrate.js new file mode 100644 index 000000000..7d2ee0855 --- /dev/null +++ b/deploy/migrate.js @@ -0,0 +1,38 @@ +const cp = require("child_process"); + +const { build } = require("./build"); +const { publish } = require("./publish"); + +const { version: stationVersion } = require("../package.json"); +const { version: migrateVersion } = require("../packages/migrate/package.json"); +const { version: editorVersion } = require("../packages/editor/package.json"); + +const website = async () => { + console.log("========================================="); + console.log(` Publish @nestia/website`); + console.log("========================================="); + + for (const script of ["npm install", "npm run build"]) + cp.execSync(script, { + cwd: `${__dirname}/../website`, + stdio: "inherit", + }); +}; + +const migrate = async (tag) => { + await build(["migrate", "editor"]); + await publish({ + tag, + packages: ["migrate", "editor"], + version: (name) => + name === "migrate" + ? migrateVersion + : name === "editor" + ? editorVersion + : ["fetcher", "core", "sdk"].includes(name) + ? stationVersion + : null, + }); + await website(); +}; +module.exports = { migrate }; diff --git a/deploy/publish.js b/deploy/publish.js index f18b717e9..cc45e2ee9 100644 --- a/deploy/publish.js +++ b/deploy/publish.js @@ -1,8 +1,5 @@ const cp = require("child_process"); const fs = require("fs"); -const { build } = require("./build"); - -const packages = ["fetcher", "core", "sdk"]; const execute = ({ cwd, script, studio }) => { console.log(script); @@ -12,29 +9,24 @@ const execute = ({ cwd, script, studio }) => { }); }; -const setup = ({ tag, version, directory }) => { +const setup = ({ tag, name, directory, version }) => { // CHANGE PACKAGE.JSON INFO const file = `${directory}/package.json`; const info = JSON.parse(fs.readFileSync(file, "utf8")); - info.version = version; + info.version = version(name); // SET DEPENDENCIES const rollbacks = []; - for (const record of [info.dependencies ?? {}, info.devDependencies ?? {}]) - for (const key of Object.keys(record)) - if ( - key.startsWith("@nestia") && - packages.includes(key.replace("@nestia/", "")) - ) { - record[key] = `^${version}`; - rollbacks.push(() => (record[key] = `workspace:^`)); + if (info.dependencies) + for (const key of Object.keys(info.dependencies)) { + if (key.startsWith("@nestia") && !!version(key.replace("@nestia/", ""))) { + info.dependencies[key] = `^${version(key.replace("@nestia/", ""))}`; + rollbacks.push(() => (info.dependencies[key] = `workspace:^`)); } + } for (const key of Object.keys(info.peerDependencies ?? {})) - if ( - key.startsWith("@nestia") && - packages.includes(key.replace("@nestia/", "")) - ) - info.peerDependencies[key] = `>=${version}`; + if (key.startsWith("@nestia") && !!version(key.replace("@nestia/", ""))) + info.peerDependencies[key] = `>=${version(key.replace("@nestia/", ""))}`; // DO PUBLISH fs.writeFileSync(file, JSON.stringify(info, null, 2), "utf8"); @@ -62,29 +54,22 @@ const deploy = ({ tag, version, name }) => { setup({ tag, version, + name, directory, }); console.log(""); }; -const publish = async (tag) => { - // GET VERSION - const version = (() => { - const content = fs.readFileSync(`${__dirname}/../package.json`, "utf8"); - const info = JSON.parse(content); - return info.version; - })(); - +const publish = async ({ tag, packages, version }) => { // VALIDATE TAG - const dev = version.includes("-dev.") === true; - if (tag === "next" && dev === false) + const dev = version(packages[0])?.includes("-dev."); + if (dev === undefined) + throw new Error("Invalid package version. Please check the package.json."); + else if (tag === "next" && dev === false) throw new Error(`${tag} tag can only be used for dev versions.`); else if (tag === "latest" && dev === true) throw new Error(`latest tag can only be used for non-dev versions.`); - // BUILD FIRST - await build(); - // DO DEPLOY const skip = (() => { const index = process.argv.indexOf("--skip"); @@ -99,6 +84,7 @@ const publish = async (tag) => { tag, version, name: pack, + version, }); await new Promise((resolve) => setTimeout(resolve, 1_000)); } diff --git a/packages/core/package.json b/packages/core/package.json index 18d75ed19..7381a52dc 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@nestia/core", - "version": "4.0.5-dev.20241207-3", + "version": "4.0.5", "description": "Super-fast validation decorators of NestJS", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -52,7 +52,7 @@ "ws": "^7.5.3" }, "peerDependencies": { - "@nestia/fetcher": ">=4.0.5-dev.20241207-3", + "@nestia/fetcher": ">=4.0.5", "@nestjs/common": ">=7.0.1", "@nestjs/core": ">=7.0.1", "reflect-metadata": ">=0.1.12", diff --git a/packages/editor/README.md b/packages/editor/README.md index 37bb5894e..8e40440ee 100644 --- a/packages/editor/README.md +++ b/packages/editor/README.md @@ -6,7 +6,7 @@ [![Downloads](https://img.shields.io/npm/dm/@nestia/fetcher.svg)](https://www.npmjs.com/package/@nestia/fetcher) [![Build Status](https://github.com/samchon/nestia/workflows/build/badge.svg)](https://github.com/samchon/nestia/actions?query=workflow%3Abuild) [![Guide Documents](https://img.shields.io/badge/guide-documents-forestgreen)](https://nestia.io/docs/) -[![Discord Badge](https://img.shields.io/badge/discord-NestJS/Nestia-d91965?style=flat&labelColor=5866f2&logo=discord&logoColor=white&link=https://discord.com/channels/520622812742811698/1197293125434093701)](https://discord.com/channels/520622812742811698/1181877086797967420) +[![Discord Badge](https://img.shields.io/badge/discord-samchon-d91965?style=flat&labelColor=5866f2&logo=discord&logoColor=white&link=https://discord.gg/E94XhzrUCZ)](https://discord.gg/E94XhzrUCZ) Nestia is a set of helper libraries for NestJS, supporting below features: @@ -15,7 +15,6 @@ Nestia is a set of helper libraries for NestJS, supporting below features: - Advanced WebSocket routes - `@nestia/sdk`: - Swagger generator evolved than ever - - OpenAI function calling schema generator - SDK library generator for clients - Mockup Simulator for client applications - Automatic E2E test functions generator diff --git a/packages/editor/package.json b/packages/editor/package.json index 77a947044..6d7522c61 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -1,6 +1,6 @@ { "name": "@nestia/editor", - "version": "0.9.3", + "version": "0.9.4", "typings": "lib/index.d.ts", "main": "lib/index.js", "module": "lib/index.mjs", @@ -35,6 +35,7 @@ "dependencies": { "@mui/material": "^5.15.6", "@nestia/migrate": "workspace:^", + "@samchon/openapi": "^2.0.1", "@stackblitz/sdk": "^1.11.0", "js-yaml": "^4.1.0", "prettier": "3.3.3", @@ -74,4 +75,4 @@ "lib", "src" ] -} +} \ No newline at end of file diff --git a/packages/fetcher/package.json b/packages/fetcher/package.json index efa6e815d..0541fa189 100644 --- a/packages/fetcher/package.json +++ b/packages/fetcher/package.json @@ -1,6 +1,6 @@ { "name": "@nestia/fetcher", - "version": "4.0.5-dev.20241207-3", + "version": "4.0.5", "description": "Fetcher library of Nestia SDK", "main": "lib/index.js", "typings": "lib/index.d.ts", diff --git a/packages/migrate/README.md b/packages/migrate/README.md index d1ccbc226..8e40440ee 100644 --- a/packages/migrate/README.md +++ b/packages/migrate/README.md @@ -2,21 +2,27 @@ ![Nestia Logo](https://nestia.io/logo.png) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/nestia/blob/master/LICENSE) -[![npm version](https://img.shields.io/npm/v/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core) -[![Downloads](https://img.shields.io/npm/dm/@nestia/core.svg)](https://www.npmjs.com/package/@nestia/core) +[![npm version](https://img.shields.io/npm/v/@nestia/fetcher.svg)](https://www.npmjs.com/package/@nestia/fetcher) +[![Downloads](https://img.shields.io/npm/dm/@nestia/fetcher.svg)](https://www.npmjs.com/package/@nestia/fetcher) [![Build Status](https://github.com/samchon/nestia/workflows/build/badge.svg)](https://github.com/samchon/nestia/actions?query=workflow%3Abuild) [![Guide Documents](https://img.shields.io/badge/guide-documents-forestgreen)](https://nestia.io/docs/) +[![Discord Badge](https://img.shields.io/badge/discord-samchon-d91965?style=flat&labelColor=5866f2&logo=discord&logoColor=white&link=https://discord.gg/E94XhzrUCZ)](https://discord.gg/E94XhzrUCZ) Nestia is a set of helper libraries for NestJS, supporting below features: - - `@nestia/core`: super-fast decorators + - `@nestia/core`: + - Super-fast/easy decorators + - Advanced WebSocket routes - `@nestia/sdk`: - Swagger generator evolved than ever - SDK library generator for clients - Mockup Simulator for client applications - Automatic E2E test functions generator - - `@nestia/migrate`: migration from Swagger to NestJS - - `nestia`: just CLI (command line interface) tool + - `@nestia/e2e`: Test program utilizing e2e test functions + - `@nestia/benchmark`: Benchmark program using e2e test functions + - `@nestia/migrate`: OpenAPI generator from Swagger to NestJS/SDK + - `@nestia/editor`: Swagger-UI with Online TypeScript Editor + - `nestia`: Just CLI (command line interface) tool > [!NOTE] > @@ -56,6 +62,7 @@ Check out the document in the [website](https://nestia.io/docs/): ### 📖 Features - Core Library + - [WebSocketRoute](https://nestia.io/docs/core/WebSocketRoute) - [TypedRoute](https://nestia.io/docs/core/TypedRoute/) - [TypedBody](https://nestia.io/docs/core/TypedBody/) - [TypedParam](https://nestia.io/docs/core/TypedParam/) @@ -64,11 +71,17 @@ Check out the document in the [website](https://nestia.io/docs/): - [TypedException](https://nestia.io/docs/core/TypedException/) - Generators - [Swagger Documents](https://nestia.io/docs/sdk/swagger/) - - [SDK Library](https://nestia.io/docs/sdk/sdk/) + - [Software Development Kit](https://nestia.io/docs/sdk/sdk/) - [E2E Functions](https://nestia.io/docs/sdk/e2e/) - [Mockup Simulator](https://nestia.io/docs/sdk/simulator/) + - E2E Testing + - [Why E2E Test?](https://nestia.io/docs/e2e/why/) + - [Test Program Development](https://nestia.io/docs/e2e/development/) + - [Performance Benchmark](https://nestia.io/docs/e2e/benchmark/) - [Swagger to NestJS](https://nestia.io/docs/migrate/) + - [TypeScript Swagger Editor](https://nestia.io/docs/editor/) ### 🔗 Appendix + - [API Documents](https://nestia.io/api) - [⇲ Benchmark Result](https://github.com/samchon/nestia/tree/master/benchmark/results/11th%20Gen%20Intel(R)%20Core(TM)%20i5-1135G7%20%40%202.40GHz) - [⇲ `dev.to` Articles](https://dev.to/samchon/series/22751) diff --git a/packages/migrate/package.json b/packages/migrate/package.json index b9292f12d..c5fd71254 100644 --- a/packages/migrate/package.json +++ b/packages/migrate/package.json @@ -1,6 +1,6 @@ { "name": "@nestia/migrate", - "version": "0.21.3", + "version": "0.21.4", "description": "Migration program from swagger to NestJS", "typings": "lib/index.d.ts", "main": "lib/index.js", @@ -89,4 +89,4 @@ "README.md", "LICENSE" ] -} +} \ No newline at end of file diff --git a/packages/migrate/src/executable/bundle.js b/packages/migrate/src/executable/bundle.js index 9e5ffceac..08e665544 100644 --- a/packages/migrate/src/executable/bundle.js +++ b/packages/migrate/src/executable/bundle.js @@ -1,14 +1,27 @@ +const { version } = require("../../../../package.json"); const cp = require("child_process"); const fs = require("fs"); const ROOT = `${__dirname}/../..`; const ASSETS = `${ROOT}/assets`; -const bundle = async ({ - mode, - repository, - exceptions, -}) => { +const update = (content) => { + const parsed = JSON.parse(content); + for (const record of [ + parsed.dependencies ?? {}, + parsed.devDependencies ?? {}, + ]) + for (const key of Object.keys(record)) + if ( + key === "@nestia/core" || + key === "@nestia/fetcher" || + key === "@nestia/sdk" + ) + record[key] = `^${version}`; + return JSON.stringify(parsed, null, 2); +}; + +const bundle = async ({ mode, repository, exceptions, transform }) => { const root = `${__dirname}/../..`; const assets = `${root}/assets`; const template = `${assets}/${mode}`; @@ -22,38 +35,34 @@ const bundle = async ({ await fs.promises.mkdir(ASSETS); } catch {} - cp.execSync( - `git clone https://github.com/samchon/${repository} ${mode}`, - { - cwd: ASSETS, - }, - ); + cp.execSync(`git clone https://github.com/samchon/${repository} ${mode}`, { + cwd: ASSETS, + }); // REMOVE VUNLERABLE FILES for (const location of exceptions ?? []) await fs.promises.rm(`${template}/${location}`, { recursive: true }); }; - const iterate = - (collection) => async (location) => { - const directory = await fs.promises.readdir(location); - for (const file of directory) { - const absolute = location + "/" + file; - const stats = await fs.promises.stat(absolute); - if (stats.isDirectory()) await iterate(collection)(absolute); - else { - const content = await fs.promises.readFile(absolute, "utf-8"); - collection.push({ - location: (() => { - const str = location.replace(template, ""); - return str[0] === "/" ? str.substring(1) : str; - })(), - file, - content, - }); - } + const iterate = (collection) => async (location) => { + const directory = await fs.promises.readdir(location); + for (const file of directory) { + const absolute = location + "/" + file; + const stats = await fs.promises.stat(absolute); + if (stats.isDirectory()) await iterate(collection)(absolute); + else { + const content = await fs.promises.readFile(absolute, "utf-8"); + collection.push({ + location: (() => { + const str = location.replace(template, ""); + return str[0] === "/" ? str.substring(1) : str; + })(), + file, + content, + }); } - }; + } + }; const archive = async (collection) => { const name = `${mode.toUpperCase()}_TEMPLATE`; @@ -73,6 +82,7 @@ const bundle = async ({ const collection = []; await clone(); await iterate(collection)(template); + if (transform) for (const it of collection) transform(it); await archive(collection); }; @@ -89,6 +99,9 @@ const main = async () => { "src/providers", "test/features", ], + transform: (it) => { + if (it.file === "package.json") it.content = update(it.content); + }, }); await bundle({ mode: "sdk", @@ -101,6 +114,9 @@ const main = async () => { "src/structures", "test/features", ], + transform: (it) => { + if (it.file === "package.json") it.content = update(it.content); + }, }); }; main().catch((exp) => { diff --git a/packages/sdk/package.json b/packages/sdk/package.json index dae473260..57f7be736 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@nestia/sdk", - "version": "4.0.5-dev.20241207-3", + "version": "4.0.5", "description": "Nestia SDK and Swagger generator", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -47,8 +47,8 @@ "typia": "^7.0.2" }, "peerDependencies": { - "@nestia/core": ">=4.0.5-dev.20241207-3", - "@nestia/fetcher": ">=4.0.5-dev.20241207-3", + "@nestia/core": ">=4.0.5", + "@nestia/fetcher": ">=4.0.5", "@nestjs/common": ">=7.0.1", "@nestjs/core": ">=7.0.1", "reflect-metadata": ">=0.1.12", diff --git a/website/build/editor.js b/website/build/editor.js index 49463c104..11cedc62c 100644 --- a/website/build/editor.js +++ b/website/build/editor.js @@ -6,7 +6,7 @@ const PACKAGE = `${__dirname}/../../packages/editor`; const ASSETS = `${PACKAGE}/dist/assets`; const main = async () => { - cp.execSync("npm i && npm run build:static", { + cp.execSync("pnpm install && npm run build:static", { stdio: "ignore", cwd: PACKAGE, }); diff --git a/website/build/typedoc.js b/website/build/typedoc.js index 58d73648f..0336bec3b 100644 --- a/website/build/typedoc.js +++ b/website/build/typedoc.js @@ -4,7 +4,7 @@ const fs = require("fs"); for (const pack of ["benchmark", "core", "e2e", "fetcher"]) { const location = `${__dirname}/../../packages/${pack}`; if (fs.existsSync(`${location}/node_modules`) === false) - cp.execSync("npm install", { cwd: location, stdio: "ignore" }); + cp.execSync("pnpm install", { cwd: location, stdio: "ignore" }); cp.execSync( [ `npx typedoc --json typedoc-json/${pack}.json`, diff --git a/website/package-lock.json b/website/package-lock.json index b3547db73..fac668839 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -14,7 +14,7 @@ "@mui/icons-material": "5.15.6", "@mui/material": "5.15.6", "@mui/system": "5.15.6", - "@nestia/editor": "^0.9.0", + "@nestia/editor": "latest", "next": "14.2.13", "nextra": "^2.13.4", "nextra-theme-docs": "^2.13.4", @@ -29,8 +29,8 @@ "next-sitemap": "^4.2.3", "rimraf": "^5.0.0", "ts-node": "^10.9.2", - "typedoc": "^0.26.2", - "typescript": "~5.6.3" + "typedoc": "^0.27.3", + "typescript": "~5.7.2" } }, "node_modules/@babel/code-frame": { @@ -359,6 +359,18 @@ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.8.tgz", "integrity": "sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==" }, + "node_modules/@gerrit0/mini-shiki": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-1.24.1.tgz", + "integrity": "sha512-PNP/Gjv3VqU7z7DjRgO3F9Ok5frTKqtpV+LJW1RzMcr2zpRk0ulhEWnbcNGXzPC7BZyWMIHrkfQX2GZRfxrn6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/engine-oniguruma": "^1.24.0", + "@shikijs/types": "^1.24.0", + "@shikijs/vscode-textmate": "^9.3.0" + } + }, "node_modules/@headlessui/react": { "version": "1.7.19", "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-1.7.19.tgz", @@ -1147,6 +1159,19 @@ "migrate": "lib/executable/migrate.js" } }, + "node_modules/@nestia/migrate/node_modules/typescript": { + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/@nestia/sdk": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@nestia/sdk/-/sdk-4.0.0.tgz", @@ -1471,59 +1496,28 @@ } }, "node_modules/@samchon/openapi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@samchon/openapi/-/openapi-2.0.0.tgz", - "integrity": "sha512-KqopzRMUKsz4ZSKTU1+AQfYbCs6f7AhiPbemWmTFe10Gx7c8qvPhb5NLBXQwgGrAF8rvxw5Ib+YFk1FDJtCNmg==" - }, - "node_modules/@shikijs/core": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.22.1.tgz", - "integrity": "sha512-bqAhT/Ri5ixV4oYsvJNH8UJjpjbINWlWyXY6tBTsP4OmD6XnFv43nRJ+lTdxd2rmG5pgam/x+zGR6kLRXrpEKA==", - "dev": true, - "dependencies": { - "@shikijs/engine-javascript": "1.22.1", - "@shikijs/engine-oniguruma": "1.22.1", - "@shikijs/types": "1.22.1", - "@shikijs/vscode-textmate": "^9.3.0", - "@types/hast": "^3.0.4", - "hast-util-to-html": "^9.0.3" - } - }, - "node_modules/@shikijs/core/node_modules/@types/hast": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", - "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", - "dev": true, - "dependencies": { - "@types/unist": "*" - } - }, - "node_modules/@shikijs/engine-javascript": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-1.22.1.tgz", - "integrity": "sha512-540pyoy0LWe4jj2BVbgELwOFu1uFvRI7lg4hdsExrSXA9x7gqfzZ/Nnh4RfX86aDAgJ647gx4TCmRwACbnQSvw==", - "dev": true, - "dependencies": { - "@shikijs/types": "1.22.1", - "@shikijs/vscode-textmate": "^9.3.0", - "oniguruma-to-js": "0.4.3" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@samchon/openapi/-/openapi-2.0.1.tgz", + "integrity": "sha512-Vw/iaxqrWVIXlGuwsLPb7hCZUmhBm/ez0aCP3e/8hPWuA9+0sEWAODrvyyrR8elMzK6uXrRRK9a6KibTQ/jHPw==", + "license": "MIT" }, "node_modules/@shikijs/engine-oniguruma": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.22.1.tgz", - "integrity": "sha512-L+1Vmd+a2kk8HtogUFymQS6BjUfJnzcWoUp1BUgxoDiklbKSMvrsMuLZGevTOP1m0rEjgnC5MsDmsr8lX1lC+Q==", + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.24.0.tgz", + "integrity": "sha512-Eua0qNOL73Y82lGA4GF5P+G2+VXX9XnuUxkiUuwcxQPH4wom+tE39kZpBFXfUuwNYxHSkrSxpB1p4kyRW0moSg==", "dev": true, + "license": "MIT", "dependencies": { - "@shikijs/types": "1.22.1", + "@shikijs/types": "1.24.0", "@shikijs/vscode-textmate": "^9.3.0" } }, "node_modules/@shikijs/types": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.22.1.tgz", - "integrity": "sha512-+45f8mu/Hxqs6Kyhfm98Nld5n7Q7lwhjU8UtdQwrOPs7BnM4VAb929O3IQ2ce+4D7SlNFlZGd8CnKRSnwbQreQ==", + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.24.0.tgz", + "integrity": "sha512-aptbEuq1Pk88DMlCe+FzXNnBZ17LCiLIGWAeCWhoFDzia5Q5Krx3DgnULLiouSdd6+LUM39XwXGppqYE0Ghtug==", "dev": true, + "license": "MIT", "dependencies": { "@shikijs/vscode-textmate": "^9.3.0", "@types/hast": "^3.0.4" @@ -1534,6 +1528,7 @@ "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/unist": "*" } @@ -1542,7 +1537,8 @@ "version": "9.3.0", "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-9.3.0.tgz", "integrity": "sha512-jn7/7ky30idSkd/O5yDBfAnVt+JJpepofP/POZ1iMOxK59cOfqIgg/Dj0eFsjOTMw+4ycJN0uhZH/Eb0bs/EUA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@stackblitz/sdk": { "version": "1.11.0", @@ -1879,7 +1875,8 @@ "node_modules/array-timsort": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", - "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==" + "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", + "license": "MIT" }, "node_modules/array-union": { "version": "1.0.2", @@ -2240,6 +2237,7 @@ "version": "4.2.5", "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.5.tgz", "integrity": "sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw==", + "license": "MIT", "dependencies": { "array-timsort": "^1.0.3", "core-util-is": "^1.0.3", @@ -2888,6 +2886,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/drange/-/drange-1.1.1.tgz", "integrity": "sha512-pYxfDYpued//QpnLIm4Avk7rsNtAtQkUES2cwAYSvD/wd2pKD71gN2Ebj3e7klzXwjocvE8c5vx/1fxwpqmSxA==", + "license": "MIT", "engines": { "node": ">=4" } @@ -3532,6 +3531,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", + "license": "MIT", "engines": { "node": ">=8" } @@ -3835,57 +3835,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/hast-util-to-html": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.3.tgz", - "integrity": "sha512-M17uBDzMJ9RPCqLMO92gNNUDuBSq10a25SDBI08iCCxmorf4Yy6sYHK57n9WAbRAAaU+DuR4W6GN9K4DFZesYg==", - "dev": true, - "dependencies": { - "@types/hast": "^3.0.0", - "@types/unist": "^3.0.0", - "ccount": "^2.0.0", - "comma-separated-tokens": "^2.0.0", - "hast-util-whitespace": "^3.0.0", - "html-void-elements": "^3.0.0", - "mdast-util-to-hast": "^13.0.0", - "property-information": "^6.0.0", - "space-separated-tokens": "^2.0.0", - "stringify-entities": "^4.0.0", - "zwitch": "^2.0.4" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/hast-util-to-html/node_modules/@types/hast": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", - "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", - "dev": true, - "dependencies": { - "@types/unist": "*" - } - }, - "node_modules/hast-util-to-html/node_modules/@types/unist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", - "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", - "dev": true - }, - "node_modules/hast-util-to-html/node_modules/hast-util-whitespace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", - "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", - "dev": true, - "dependencies": { - "@types/hast": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/hast-util-to-parse5": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz", @@ -6364,18 +6313,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/oniguruma-to-js": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/oniguruma-to-js/-/oniguruma-to-js-0.4.3.tgz", - "integrity": "sha512-X0jWUcAlxORhOqqBREgPMgnshB7ZGYszBNspP+tS9hPD3l13CdaXcHbgImoHUHlrvGx/7AvFEkTRhAGYh+jzjQ==", - "dev": true, - "dependencies": { - "regex": "^4.3.2" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, "node_modules/ora": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", @@ -6471,9 +6408,10 @@ "dev": true }, "node_modules/package-manager-detector": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-0.2.6.tgz", - "integrity": "sha512-9vPH3qooBlYRJdmdYP00nvjZOulm40r5dhtal8st18ctf+6S1k7pi5yIHLvI4w5D70x0Y+xdVD9qITH0QO/A8A==" + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-0.2.7.tgz", + "integrity": "sha512-g4+387DXDKlZzHkP+9FLt8yKj8+/3tOkPv7DVTJGGRm00RkEWgqbFstX1mXJ4M0VDYhUqsTOiISqNOJnhAu3PQ==", + "license": "MIT" }, "node_modules/pako": { "version": "1.0.11", @@ -6822,6 +6760,7 @@ "version": "0.5.3", "resolved": "https://registry.npmjs.org/randexp/-/randexp-0.5.3.tgz", "integrity": "sha512-U+5l2KrcMNOUPYvazA3h5ekF80FHTUG+87SEAmHZmolh1M+i/WyTCxVzmi+tidIa1tM4BSe8g2Y/D3loWDjj+w==", + "license": "MIT", "dependencies": { "drange": "^1.0.2", "ret": "^0.2.0" @@ -6933,12 +6872,6 @@ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" }, - "node_modules/regex": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/regex/-/regex-4.3.3.tgz", - "integrity": "sha512-r/AadFO7owAq1QJVeZ/nq9jNS1vyZt+6t1p/E59B56Rn2GCya+gr1KSyOzNL/er+r+B7phv5jG2xU2Nz1YkmJg==", - "dev": true - }, "node_modules/rehype-katex": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/rehype-katex/-/rehype-katex-7.0.1.tgz", @@ -7204,6 +7137,7 @@ "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "license": "MIT", "engines": { "node": ">=0.10" } @@ -7248,6 +7182,7 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/ret/-/ret-0.2.2.tgz", "integrity": "sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ==", + "license": "MIT", "engines": { "node": ">=4" } @@ -8043,16 +7978,17 @@ } }, "node_modules/typedoc": { - "version": "0.26.10", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.26.10.tgz", - "integrity": "sha512-xLmVKJ8S21t+JeuQLNueebEuTVphx6IrP06CdV7+0WVflUSW3SPmR+h1fnWVdAR/FQePEgsSWCUHXqKKjzuUAw==", + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.3.tgz", + "integrity": "sha512-oWT7zDS5oIaxYL5yOikBX4cL99CpNAZn6mI24JZQxsYuIHbtguSSwJ7zThuzNNwSE0wqhlfTSd99HgqKu2aQXQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { + "@gerrit0/mini-shiki": "^1.24.0", "lunr": "^2.3.9", "markdown-it": "^14.1.0", "minimatch": "^9.0.5", - "shiki": "^1.16.2", - "yaml": "^2.5.1" + "yaml": "^2.6.1" }, "bin": { "typedoc": "bin/typedoc" @@ -8061,16 +7997,7 @@ "node": ">= 18" }, "peerDependencies": { - "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x" - } - }, - "node_modules/typedoc/node_modules/@types/hast": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", - "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", - "dev": true, - "dependencies": { - "@types/unist": "*" + "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x" } }, "node_modules/typedoc/node_modules/brace-expansion": { @@ -8097,25 +8024,12 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/typedoc/node_modules/shiki": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.22.1.tgz", - "integrity": "sha512-PbJ6XxrWLMwB2rm3qdjIHNm3zq4SfFnOx0B3rEoi4AN8AUngsdyZ1tRe5slMPtn6jQkbUURLNZPpLR7Do3k78g==", - "dev": true, - "dependencies": { - "@shikijs/core": "1.22.1", - "@shikijs/engine-javascript": "1.22.1", - "@shikijs/engine-oniguruma": "1.22.1", - "@shikijs/types": "1.22.1", - "@shikijs/vscode-textmate": "^9.3.0", - "@types/hast": "^3.0.4" - } - }, "node_modules/typedoc/node_modules/yaml": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.0.tgz", - "integrity": "sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", + "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", "dev": true, + "license": "ISC", "bin": { "yaml": "bin.mjs" }, @@ -8124,9 +8038,10 @@ } }, "node_modules/typescript": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", - "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -8136,11 +8051,12 @@ } }, "node_modules/typia": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/typia/-/typia-7.0.0.tgz", - "integrity": "sha512-8+0M3PismvYARMIt9t9wJjuGadExGFOHpejVyaaiqw+BVNI1uJSv0HcIzSeyKp2tBZVfbPBPnlS3+kxPOfnuyA==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/typia/-/typia-7.0.2.tgz", + "integrity": "sha512-Wxl/2XK+KIyCmBpR8X8uopKJEtZHsvGF0G5ZgwDGaqzIF9wBdSqDnnuLRpOI/zIch+nDBhbpHdtCztp1RpGg2A==", + "license": "MIT", "dependencies": { - "@samchon/openapi": "^2.0.0", + "@samchon/openapi": "^2.0.1", "commander": "^10.0.0", "comment-json": "^4.2.3", "inquirer": "^8.2.5", @@ -8151,8 +8067,8 @@ "typia": "lib/executable/typia.js" }, "peerDependencies": { - "@samchon/openapi": ">=2.0.0 <3.0.0", - "typescript": ">=4.8.0 <5.7.0" + "@samchon/openapi": ">=2.0.1 <3.0.0", + "typescript": ">=4.8.0 <5.8.0" } }, "node_modules/uc.micro": { diff --git a/website/package.json b/website/package.json index 4c44b70cb..2ceace3d3 100644 --- a/website/package.json +++ b/website/package.json @@ -23,7 +23,7 @@ "@mui/icons-material": "5.15.6", "@mui/material": "5.15.6", "@mui/system": "5.15.6", - "@nestia/editor": "^0.9.3", + "@nestia/editor": "latest", "next": "14.2.13", "nextra": "^2.13.4", "nextra-theme-docs": "^2.13.4", @@ -38,7 +38,7 @@ "next-sitemap": "^4.2.3", "rimraf": "^5.0.0", "ts-node": "^10.9.2", - "typedoc": "^0.26.2", + "typedoc": "^0.27.3", "typescript": "~5.7.2" } }