From 9243a2cebcf3f6659d4b4154a4417a43567ae51d Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Tue, 12 Nov 2024 00:20:50 +0900 Subject: [PATCH] Fix #1094: skip validation when no request body --- package.json | 2 +- packages/core/package.json | 6 +- packages/core/src/decorators/PlainBody.ts | 8 +- packages/core/src/decorators/TypedBody.ts | 5 +- .../internal/is_request_body_undefined.ts | 14 +++ packages/core/tsconfig.test.json | 88 +------------- packages/fetcher/package.json | 4 +- packages/fetcher/src/internal/FetcherBase.ts | 4 +- packages/fetcher/tsconfig.test.json | 7 ++ packages/sdk/package.json | 10 +- .../internal/SdkHttpFunctionProgrammer.ts | 2 +- .../transformers/SdkOperationProgrammer.ts | 24 ++-- packages/sdk/tsconfig.test.json | 88 +------------- test/features/body-optional/nestia.config.ts | 11 ++ test/features/body-optional/src/Backend.ts | 25 ++++ .../body-optional/src/api/HttpError.ts | 1 + .../body-optional/src/api/IConnection.ts | 1 + .../body-optional/src/api/Primitive.ts | 1 + .../body-optional/src/api/Resolved.ts | 1 + .../src/api/functional/body/form/index.ts | 56 +++++++++ .../src/api/functional/body/index.ts | 7 ++ .../src/api/functional/body/optional/index.ts | 102 ++++++++++++++++ .../src/api/functional/health/index.ts | 35 ++++++ .../body-optional/src/api/functional/index.ts | 8 ++ test/features/body-optional/src/api/index.ts | 5 + test/features/body-optional/src/api/module.ts | 5 + .../src/api/structures/IBodyOptional.ts | 6 + .../src/controllers/BodyOptionalController.ts | 23 ++++ .../src/controllers/HealthController.ts | 8 ++ .../features/api/test_api_health_check.ts | 5 + .../api/test_api_json_body_optional.ts | 23 ++++ .../api/test_api_plain_body_optional.ts | 22 ++++ test/features/body-optional/src/test/index.ts | 52 ++++++++ test/features/body-optional/swagger.json | 111 ++++++++++++++++++ test/features/body-optional/tsconfig.json | 99 ++++++++++++++++ test/features/fastify/nestia.config.ts | 1 - .../fastify/src/api/functional/body/index.ts | 7 ++ .../src/api/functional/body/optional/index.ts | 102 ++++++++++++++++ .../fastify/src/api/functional/index.ts | 1 + .../src/api/structures/IBodyOptional.ts | 6 + .../src/controllers/BodyOptionalController.ts | 23 ++++ .../automated/test_api_bbs_articles_index.ts | 18 --- .../automated/test_api_bbs_articles_store.ts | 17 --- .../automated/test_api_bbs_articles_update.ts | 19 --- .../api/automated/test_api_health_get.ts | 8 -- .../api/automated/test_api_param_boolean.ts | 12 -- .../api/automated/test_api_param_literal.ts | 12 -- .../api/automated/test_api_param_nullable.ts | 12 -- .../api/automated/test_api_param_number.ts | 12 -- .../api/automated/test_api_param_string.ts | 12 -- .../api/automated/test_api_performance_get.ts | 11 -- .../api/automated/test_api_plain_send.ts | 12 -- .../test_api_sellers_authenticate_exit.ts | 10 -- .../test_api_sellers_authenticate_join.ts | 16 --- .../test_api_sellers_authenticate_login.ts | 16 --- ...pi_sellers_authenticate_password_change.ts | 14 --- .../api/test_api_json_body_optional.ts | 23 ++++ .../api/test_api_plain_body_optional.ts | 22 ++++ test/features/fastify/swagger.json | 2 +- test/package.json | 8 +- .../test/features/api/test_api_performance.ts | 12 -- 61 files changed, 862 insertions(+), 415 deletions(-) create mode 100644 packages/core/src/decorators/internal/is_request_body_undefined.ts create mode 100644 packages/fetcher/tsconfig.test.json create mode 100644 test/features/body-optional/nestia.config.ts create mode 100644 test/features/body-optional/src/Backend.ts create mode 100644 test/features/body-optional/src/api/HttpError.ts create mode 100644 test/features/body-optional/src/api/IConnection.ts create mode 100644 test/features/body-optional/src/api/Primitive.ts create mode 100644 test/features/body-optional/src/api/Resolved.ts create mode 100644 test/features/body-optional/src/api/functional/body/form/index.ts create mode 100644 test/features/body-optional/src/api/functional/body/index.ts create mode 100644 test/features/body-optional/src/api/functional/body/optional/index.ts create mode 100644 test/features/body-optional/src/api/functional/health/index.ts create mode 100644 test/features/body-optional/src/api/functional/index.ts create mode 100644 test/features/body-optional/src/api/index.ts create mode 100644 test/features/body-optional/src/api/module.ts create mode 100644 test/features/body-optional/src/api/structures/IBodyOptional.ts create mode 100644 test/features/body-optional/src/controllers/BodyOptionalController.ts create mode 100644 test/features/body-optional/src/controllers/HealthController.ts create mode 100644 test/features/body-optional/src/test/features/api/test_api_health_check.ts create mode 100644 test/features/body-optional/src/test/features/api/test_api_json_body_optional.ts create mode 100644 test/features/body-optional/src/test/features/api/test_api_plain_body_optional.ts create mode 100644 test/features/body-optional/src/test/index.ts create mode 100644 test/features/body-optional/swagger.json create mode 100644 test/features/body-optional/tsconfig.json create mode 100644 test/features/fastify/src/api/functional/body/index.ts create mode 100644 test/features/fastify/src/api/functional/body/optional/index.ts create mode 100644 test/features/fastify/src/api/structures/IBodyOptional.ts create mode 100644 test/features/fastify/src/controllers/BodyOptionalController.ts delete mode 100644 test/features/fastify/src/test/features/api/automated/test_api_bbs_articles_index.ts delete mode 100644 test/features/fastify/src/test/features/api/automated/test_api_bbs_articles_store.ts delete mode 100644 test/features/fastify/src/test/features/api/automated/test_api_bbs_articles_update.ts delete mode 100644 test/features/fastify/src/test/features/api/automated/test_api_health_get.ts delete mode 100644 test/features/fastify/src/test/features/api/automated/test_api_param_boolean.ts delete mode 100644 test/features/fastify/src/test/features/api/automated/test_api_param_literal.ts delete mode 100644 test/features/fastify/src/test/features/api/automated/test_api_param_nullable.ts delete mode 100644 test/features/fastify/src/test/features/api/automated/test_api_param_number.ts delete mode 100644 test/features/fastify/src/test/features/api/automated/test_api_param_string.ts delete mode 100644 test/features/fastify/src/test/features/api/automated/test_api_performance_get.ts delete mode 100644 test/features/fastify/src/test/features/api/automated/test_api_plain_send.ts delete mode 100644 test/features/fastify/src/test/features/api/automated/test_api_sellers_authenticate_exit.ts delete mode 100644 test/features/fastify/src/test/features/api/automated/test_api_sellers_authenticate_join.ts delete mode 100644 test/features/fastify/src/test/features/api/automated/test_api_sellers_authenticate_login.ts delete mode 100644 test/features/fastify/src/test/features/api/automated/test_api_sellers_authenticate_password_change.ts create mode 100644 test/features/fastify/src/test/features/api/test_api_json_body_optional.ts create mode 100644 test/features/fastify/src/test/features/api/test_api_plain_body_optional.ts delete mode 100644 test/template/success/src/test/features/api/test_api_performance.ts diff --git a/package.json b/package.json index 4a4d7d76f..dd2d67ecd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@nestia/station", - "version": "3.19.0-dev.20241111", + "version": "3.19.0-dev.20241112", "description": "Nestia station", "scripts": { "build": "node build/index.js", diff --git a/packages/core/package.json b/packages/core/package.json index f255036eb..2de170c19 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@nestia/core", - "version": "3.19.0-dev.20241111", + "version": "3.19.0-dev.20241112", "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": "^3.19.0-dev.20241111", + "@nestia/fetcher": "^3.19.0-dev.20241112", "@nestjs/common": ">=7.0.1", "@nestjs/core": ">=7.0.1", "@samchon/openapi": "^1.2.2", @@ -53,7 +53,7 @@ "ws": "^7.5.3" }, "peerDependencies": { - "@nestia/fetcher": ">=3.19.0-dev.20241111", + "@nestia/fetcher": ">=3.19.0-dev.20241112", "@nestjs/common": ">=7.0.1", "@nestjs/core": ">=7.0.1", "reflect-metadata": ">=0.1.12", diff --git a/packages/core/src/decorators/PlainBody.ts b/packages/core/src/decorators/PlainBody.ts index cd3ab4e89..c9cf3ccc3 100644 --- a/packages/core/src/decorators/PlainBody.ts +++ b/packages/core/src/decorators/PlainBody.ts @@ -8,6 +8,7 @@ import type { FastifyRequest } from "fastify"; import { assert } from "typia"; import { get_text_body } from "./internal/get_text_body"; +import { is_request_body_undefined } from "./internal/is_request_body_undefined"; import { validate_request_body } from "./internal/validate_request_body"; /** @@ -52,7 +53,12 @@ export function PlainBody( const request: express.Request | FastifyRequest = context .switchToHttp() .getRequest(); - if (!isTextPlain(request.headers["content-type"])) + if ( + is_request_body_undefined(request) && + (checker ?? (() => null))(undefined as any) === null + ) + return undefined; + else if (!isTextPlain(request.headers["content-type"])) throw new BadRequestException(`Request body type is not "text/plain".`); const value: string = await get_text_body(request); if (checker) { diff --git a/packages/core/src/decorators/TypedBody.ts b/packages/core/src/decorators/TypedBody.ts index 0c4080183..4bb322575 100644 --- a/packages/core/src/decorators/TypedBody.ts +++ b/packages/core/src/decorators/TypedBody.ts @@ -8,6 +8,7 @@ import type { FastifyRequest } from "fastify"; import { assert, is, misc, validate } from "typia"; import { IRequestBodyValidator } from "../options/IRequestBodyValidator"; +import { is_request_body_undefined } from "./internal/is_request_body_undefined"; import { validate_request_body } from "./internal/validate_request_body"; /** @@ -35,7 +36,9 @@ export function TypedBody( const request: express.Request | FastifyRequest = context .switchToHttp() .getRequest(); - if (isApplicationJson(request.headers["content-type"]) === false) + if (is_request_body_undefined(request) && checker(undefined as T) === null) + return undefined; + else if (isApplicationJson(request.headers["content-type"]) === false) throw new BadRequestException( `Request body type is not "application/json".`, ); diff --git a/packages/core/src/decorators/internal/is_request_body_undefined.ts b/packages/core/src/decorators/internal/is_request_body_undefined.ts new file mode 100644 index 000000000..f8c8586ff --- /dev/null +++ b/packages/core/src/decorators/internal/is_request_body_undefined.ts @@ -0,0 +1,14 @@ +import type express from "express"; +import type { FastifyRequest } from "fastify"; + +/** + * @internal + */ +export const is_request_body_undefined = ( + request: express.Request | FastifyRequest, +): boolean => + request.headers["content-type"] === undefined && + (request.body === undefined || + (typeof request.body === "object" && + request.body !== null && + Object.keys(request.body).length === 0)); diff --git a/packages/core/tsconfig.test.json b/packages/core/tsconfig.test.json index 9ab4e16bd..9efe583a3 100644 --- a/packages/core/tsconfig.test.json +++ b/packages/core/tsconfig.test.json @@ -1,85 +1,7 @@ { + "extends": "./tsconfig.json", "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ - - /* Basic Options */ - // "incremental": true, /* Enable incremental compilation */ - "target": "es2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ - "lib": [ - "DOM", - "ES2015" - ], /* Specify library files to be included in the compilation. */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "../../test/node_modules/@nestia/core/lib", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "composite": true, /* Enable project compilation */ - // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - - /* Strict Type-Checking Options */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - "noUnusedLocals": true, /* Report errors on unused locals. */ - "noUnusedParameters": true, /* Report errors on unused parameters. */ - "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - "types": [ - "node", - "reflect-metadata" - ], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - - /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - "stripInternal": true, - - /* Advanced Options */ - "skipLibCheck": true, /* Skip type checking of declaration files. */ - "forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */ - "plugins": [ - { - "transform": "typia/lib/transform", - "functional": true, - } - ], - "newLine": "LF", - }, - "include": ["src"] -} + "target": "ES2015", + "outDir": "../../test/node_modules/@nestia/core/lib" + } +} \ No newline at end of file diff --git a/packages/fetcher/package.json b/packages/fetcher/package.json index 69ea96878..59a52ccf1 100644 --- a/packages/fetcher/package.json +++ b/packages/fetcher/package.json @@ -1,12 +1,12 @@ { "name": "@nestia/fetcher", - "version": "3.19.0-dev.20241111", + "version": "3.19.0-dev.20241112", "description": "Fetcher library of Nestia SDK", "main": "lib/index.js", "typings": "lib/index.d.ts", "scripts": { "build": "rimraf lib && tsc", - "dev": "npm run build -- --watch", + "dev": "tsc -p tsconfig.test.json --watch", "eslint": "eslint src", "eslint:fix": "eslint src --fix" }, diff --git a/packages/fetcher/src/internal/FetcherBase.ts b/packages/fetcher/src/internal/FetcherBase.ts index b4118f2a4..9bf32622e 100644 --- a/packages/fetcher/src/internal/FetcherBase.ts +++ b/packages/fetcher/src/internal/FetcherBase.ts @@ -74,13 +74,15 @@ export namespace FetcherBase { const headers: Record = { ...(connection.headers ?? {}), }; - if (input !== undefined) + if (input !== undefined) { if (route.request?.type === undefined) throw new Error( `Error on ${props.className}.fetch(): no content-type being configured.`, ); else if (route.request.type !== "multipart/form-data") headers["Content-Type"] = route.request.type; + } else if (input === undefined && headers["Content-Type"] !== undefined) + delete headers["Content-Type"]; // INIT REQUEST DATA const init: RequestInit = { diff --git a/packages/fetcher/tsconfig.test.json b/packages/fetcher/tsconfig.test.json new file mode 100644 index 000000000..c216bd914 --- /dev/null +++ b/packages/fetcher/tsconfig.test.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "ES2015", + "outDir": "../../test/node_modules/@nestia/fetcher/lib" + } +} \ No newline at end of file diff --git a/packages/sdk/package.json b/packages/sdk/package.json index c26cd442f..4f3a97696 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@nestia/sdk", - "version": "3.19.0-dev.20241111", + "version": "3.19.0-dev.20241112", "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": "^3.19.0-dev.20241111", - "@nestia/fetcher": "^3.19.0-dev.20241111", + "@nestia/core": "^3.19.0-dev.20241112", + "@nestia/fetcher": "^3.19.0-dev.20241112", "@samchon/openapi": "^1.2.2", "cli": "^1.0.1", "get-function-location": "^2.0.0", @@ -47,8 +47,8 @@ "typia": "^6.12.0" }, "peerDependencies": { - "@nestia/core": ">=3.19.0-dev.20241111", - "@nestia/fetcher": ">=3.19.0-dev.20241111", + "@nestia/core": ">=3.19.0-dev.20241112", + "@nestia/fetcher": ">=3.19.0-dev.20241112", "@nestjs/common": ">=7.0.1", "@nestjs/core": ">=7.0.1", "reflect-metadata": ">=0.1.12", diff --git a/packages/sdk/src/generates/internal/SdkHttpFunctionProgrammer.ts b/packages/sdk/src/generates/internal/SdkHttpFunctionProgrammer.ts index 66924dd75..5996f3033 100644 --- a/packages/sdk/src/generates/internal/SdkHttpFunctionProgrammer.ts +++ b/packages/sdk/src/generates/internal/SdkHttpFunctionProgrammer.ts @@ -47,7 +47,7 @@ export namespace SdkHttpFunctionProgrammer { [], undefined, p.name, - p.metadata.optional + p.metadata.optional === true ? ts.factory.createToken(ts.SyntaxKind.QuestionToken) : undefined, project.config.primitive !== false && diff --git a/packages/sdk/src/transformers/SdkOperationProgrammer.ts b/packages/sdk/src/transformers/SdkOperationProgrammer.ts index f176d2156..996304ffa 100644 --- a/packages/sdk/src/transformers/SdkOperationProgrammer.ts +++ b/packages/sdk/src/transformers/SdkOperationProgrammer.ts @@ -48,7 +48,7 @@ export namespace SdkOperationProgrammer { ), jsDocTags: p.symbol?.getJsDocTags() ?? [], description: p.symbol - ? CommentFactory.description(p.symbol) ?? null + ? (CommentFactory.description(p.symbol) ?? null) : null, }; }; @@ -61,15 +61,20 @@ export namespace SdkOperationProgrammer { }): IOperationMetadata.IParameter => { const symbol: ts.Symbol | undefined = props.context.checker.getSymbolAtLocation(props.parameter); - const common: IOperationMetadata.IResponse = writeType({ + const common: IOperationMetadata.IResponse = writeResponse({ context: props.context, generics: props.generics, type: props.context.checker.getTypeFromTypeNode( props.parameter.type ?? TypeFactory.keyword("any"), ) ?? null, - required: props.parameter.questionToken === undefined, }); + const optional: boolean = props.parameter.questionToken !== undefined; + if (common.primitive.success) + common.primitive.data.metadata.optional = optional; + if (common.resolved.success) + common.resolved.data.metadata.optional = optional; + return { ...common, name: props.parameter.name.getText(), @@ -79,21 +84,10 @@ export namespace SdkOperationProgrammer { }; }; - const writeResponse = (props: { - context: ISdkOperationTransformerContext; - generics: WeakMap; - type: ts.Type | null; - }): IOperationMetadata.IResponse => - writeType({ - ...props, - required: true, - }); - - const writeType = (p: { + const writeResponse = (p: { context: ISdkOperationTransformerContext; generics: WeakMap; type: ts.Type | null; - required: boolean; }): IOperationMetadata.IResponse => { const analyzed: ImportAnalyzer.IOutput = p.type ? ImportAnalyzer.analyze(p.context.checker, p.generics, p.type) diff --git a/packages/sdk/tsconfig.test.json b/packages/sdk/tsconfig.test.json index d68b0efed..43e0faa0d 100644 --- a/packages/sdk/tsconfig.test.json +++ b/packages/sdk/tsconfig.test.json @@ -1,85 +1,7 @@ { + "extends": "./tsconfig.json", "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ - - /* Basic Options */ - // "incremental": true, /* Enable incremental compilation */ - "target": "es2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ - "lib": [ - "DOM", - "ES2015" - ], /* Specify library files to be included in the compilation. */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "../../test/node_modules/@nestia/sdk/lib", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "composite": true, /* Enable project compilation */ - // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - - /* Strict Type-Checking Options */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - "noUnusedLocals": true, /* Report errors on unused locals. */ - "noUnusedParameters": true, /* Report errors on unused parameters. */ - "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - "types": [ - "node", - "reflect-metadata" - ], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - - /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - "stripInternal": true, - - /* Advanced Options */ - "skipLibCheck": true, /* Skip type checking of declaration files. */ - "forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */ - "plugins": [ - { - "transform": "typia/lib/transform", - "functional": true, - } - ], - "newLine": "LF", - }, - "include": ["src"] -} + "target": "ES2015", + "outDir": "../../test/node_modules/@nestia/sdk/lib" + } +} \ No newline at end of file diff --git a/test/features/body-optional/nestia.config.ts b/test/features/body-optional/nestia.config.ts new file mode 100644 index 000000000..60c4be6d3 --- /dev/null +++ b/test/features/body-optional/nestia.config.ts @@ -0,0 +1,11 @@ +import { INestiaConfig } from "@nestia/sdk"; + +export const NESTIA_CONFIG: INestiaConfig = { + input: ["src/controllers"], + output: "src/api", + swagger: { + output: "swagger.json", + beautify: true, + }, +}; +export default NESTIA_CONFIG; diff --git a/test/features/body-optional/src/Backend.ts b/test/features/body-optional/src/Backend.ts new file mode 100644 index 000000000..fc5f679b2 --- /dev/null +++ b/test/features/body-optional/src/Backend.ts @@ -0,0 +1,25 @@ +import core from "@nestia/core"; +import { INestApplication } from "@nestjs/common"; +import { NestFactory } from "@nestjs/core"; +import { Singleton } from "tstl"; + +export class Backend { + public readonly application: Singleton> = + new Singleton(async () => + NestFactory.create( + await core.EncryptedModule.dynamic(__dirname + "/controllers", { + key: "A".repeat(32), + iv: "B".repeat(16), + }), + { logger: false }, + ), + ); + + public async open(): Promise { + return (await this.application.get()).listen(37_000); + } + + public async close(): Promise { + return (await this.application.get()).close(); + } +} diff --git a/test/features/body-optional/src/api/HttpError.ts b/test/features/body-optional/src/api/HttpError.ts new file mode 100644 index 000000000..5df328ae4 --- /dev/null +++ b/test/features/body-optional/src/api/HttpError.ts @@ -0,0 +1 @@ +export { HttpError } from "@nestia/fetcher"; diff --git a/test/features/body-optional/src/api/IConnection.ts b/test/features/body-optional/src/api/IConnection.ts new file mode 100644 index 000000000..107bdb8f8 --- /dev/null +++ b/test/features/body-optional/src/api/IConnection.ts @@ -0,0 +1 @@ +export type { IConnection } from "@nestia/fetcher"; diff --git a/test/features/body-optional/src/api/Primitive.ts b/test/features/body-optional/src/api/Primitive.ts new file mode 100644 index 000000000..60d394424 --- /dev/null +++ b/test/features/body-optional/src/api/Primitive.ts @@ -0,0 +1 @@ +export type { Primitive } from "@nestia/fetcher"; diff --git a/test/features/body-optional/src/api/Resolved.ts b/test/features/body-optional/src/api/Resolved.ts new file mode 100644 index 000000000..a4f457e60 --- /dev/null +++ b/test/features/body-optional/src/api/Resolved.ts @@ -0,0 +1 @@ +export type { Resolved } from "@nestia/fetcher"; diff --git a/test/features/body-optional/src/api/functional/body/form/index.ts b/test/features/body-optional/src/api/functional/body/form/index.ts new file mode 100644 index 000000000..41cae2667 --- /dev/null +++ b/test/features/body-optional/src/api/functional/body/form/index.ts @@ -0,0 +1,56 @@ +/** + * @packageDocumentation + * @module api.functional.body.form + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +//================================================================ +import type { IConnection, Primitive, Resolved } from "@nestia/fetcher"; +import { PlainFetcher } from "@nestia/fetcher/lib/PlainFetcher"; + +import type { IBodyOptional } from "../../../structures/IBodyOptional"; + +/** + * @controller BodyController.formData + * @path POST /body/form + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +export async function formData( + connection: IConnection, + body?: formData.Input, +): Promise { + return PlainFetcher.fetch( + { + ...connection, + headers: { + ...connection.headers, + "Content-Type": "application/json", + }, + }, + { + ...formData.METADATA, + template: formData.METADATA.path, + path: formData.path(), + }, + body, + ); +} +export namespace formData { + export type Input = Resolved; + export type Output = Primitive; + + export const METADATA = { + method: "POST", + path: "/body/form", + request: { + type: "application/json", + encrypted: false, + }, + response: { + type: "application/json", + encrypted: false, + }, + status: 201, + } as const; + + export const path = () => "/body/form"; +} diff --git a/test/features/body-optional/src/api/functional/body/index.ts b/test/features/body-optional/src/api/functional/body/index.ts new file mode 100644 index 000000000..0bb878fc0 --- /dev/null +++ b/test/features/body-optional/src/api/functional/body/index.ts @@ -0,0 +1,7 @@ +/** + * @packageDocumentation + * @module api.functional.body + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +//================================================================ +export * as optional from "./optional"; diff --git a/test/features/body-optional/src/api/functional/body/optional/index.ts b/test/features/body-optional/src/api/functional/body/optional/index.ts new file mode 100644 index 000000000..ad984f73a --- /dev/null +++ b/test/features/body-optional/src/api/functional/body/optional/index.ts @@ -0,0 +1,102 @@ +/** + * @packageDocumentation + * @module api.functional.body.optional + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +//================================================================ +import type { IConnection, Primitive, Resolved } from "@nestia/fetcher"; +import { PlainFetcher } from "@nestia/fetcher/lib/PlainFetcher"; + +import type { IBodyOptional } from "../../../structures/IBodyOptional"; + +/** + * @controller BodyOptionalController.json + * @path POST /body/optional/json + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +export async function json( + connection: IConnection, + body?: json.Input, +): Promise { + return PlainFetcher.fetch( + { + ...connection, + headers: { + ...connection.headers, + "Content-Type": "application/json", + }, + }, + { + ...json.METADATA, + template: json.METADATA.path, + path: json.path(), + }, + body, + ); +} +export namespace json { + export type Input = Resolved; + export type Output = Primitive; + + export const METADATA = { + method: "POST", + path: "/body/optional/json", + request: { + type: "application/json", + encrypted: false, + }, + response: { + type: "application/json", + encrypted: false, + }, + status: 201, + } as const; + + export const path = () => "/body/optional/json"; +} + +/** + * @controller BodyOptionalController.plain + * @path POST /body/optional/plain + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +export async function plain( + connection: IConnection, + body?: plain.Input, +): Promise { + return PlainFetcher.fetch( + { + ...connection, + headers: { + ...connection.headers, + "Content-Type": "text/plain", + }, + }, + { + ...plain.METADATA, + template: plain.METADATA.path, + path: plain.path(), + }, + body, + ); +} +export namespace plain { + export type Input = Resolved; + export type Output = Primitive; + + export const METADATA = { + method: "POST", + path: "/body/optional/plain", + request: { + type: "text/plain", + encrypted: false, + }, + response: { + type: "application/json", + encrypted: false, + }, + status: 201, + } as const; + + export const path = () => "/body/optional/plain"; +} diff --git a/test/features/body-optional/src/api/functional/health/index.ts b/test/features/body-optional/src/api/functional/health/index.ts new file mode 100644 index 000000000..36ae23908 --- /dev/null +++ b/test/features/body-optional/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-optional/src/api/functional/index.ts b/test/features/body-optional/src/api/functional/index.ts new file mode 100644 index 000000000..badb79c9c --- /dev/null +++ b/test/features/body-optional/src/api/functional/index.ts @@ -0,0 +1,8 @@ +/** + * @packageDocumentation + * @module api.functional + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +//================================================================ +export * as body from "./body"; +export * as health from "./health"; diff --git a/test/features/body-optional/src/api/index.ts b/test/features/body-optional/src/api/index.ts new file mode 100644 index 000000000..1896c4fbd --- /dev/null +++ b/test/features/body-optional/src/api/index.ts @@ -0,0 +1,5 @@ +import * as api from "./module"; + +export * from "./module"; + +export default api; diff --git a/test/features/body-optional/src/api/module.ts b/test/features/body-optional/src/api/module.ts new file mode 100644 index 000000000..dbb6e9a51 --- /dev/null +++ b/test/features/body-optional/src/api/module.ts @@ -0,0 +1,5 @@ +export type * from "./IConnection"; +export type * from "./Primitive"; +export * from "./HttpError"; + +export * as functional from "./functional"; diff --git a/test/features/body-optional/src/api/structures/IBodyOptional.ts b/test/features/body-optional/src/api/structures/IBodyOptional.ts new file mode 100644 index 000000000..52b2a7faf --- /dev/null +++ b/test/features/body-optional/src/api/structures/IBodyOptional.ts @@ -0,0 +1,6 @@ +import { tags } from "typia"; + +export interface IBodyOptional { + id: string & tags.Format<"uuid">; + value: number; +} diff --git a/test/features/body-optional/src/controllers/BodyOptionalController.ts b/test/features/body-optional/src/controllers/BodyOptionalController.ts new file mode 100644 index 000000000..8a89a4dc1 --- /dev/null +++ b/test/features/body-optional/src/controllers/BodyOptionalController.ts @@ -0,0 +1,23 @@ +import { PlainBody, TypedBody, TypedRoute } from "@nestia/core"; +import { Controller } from "@nestjs/common"; +import { v4 } from "uuid"; + +import { IBodyOptional } from "@api/lib/structures/IBodyOptional"; + +@Controller("body/optional") +export class BodyOptionalController { + @TypedRoute.Post("json") + public json(@TypedBody() body?: IBodyOptional | undefined): IBodyOptional { + return ( + body ?? { + id: v4(), + value: 1, + } + ); + } + + @TypedRoute.Post("plain") + public plain(@PlainBody() body?: string): string { + return body ?? "Hello, world!"; + } +} diff --git a/test/features/body-optional/src/controllers/HealthController.ts b/test/features/body-optional/src/controllers/HealthController.ts new file mode 100644 index 000000000..f7e06aef4 --- /dev/null +++ b/test/features/body-optional/src/controllers/HealthController.ts @@ -0,0 +1,8 @@ +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-optional/src/test/features/api/test_api_health_check.ts b/test/features/body-optional/src/test/features/api/test_api_health_check.ts new file mode 100644 index 000000000..4dceb4cec --- /dev/null +++ b/test/features/body-optional/src/test/features/api/test_api_health_check.ts @@ -0,0 +1,5 @@ +import api from "@api"; + +export const test_api_monitor_health_check = ( + connection: api.IConnection, +): Promise => api.functional.health.get(connection); diff --git a/test/features/body-optional/src/test/features/api/test_api_json_body_optional.ts b/test/features/body-optional/src/test/features/api/test_api_json_body_optional.ts new file mode 100644 index 000000000..e252713c1 --- /dev/null +++ b/test/features/body-optional/src/test/features/api/test_api_json_body_optional.ts @@ -0,0 +1,23 @@ +import { TestValidator } from "@nestia/e2e"; +import typia from "typia"; + +import api from "@api"; +import { IBodyOptional } from "@api/lib/structures/IBodyOptional"; + +export const test_api_json_body_optional = async ( + connection: api.IConnection, +): Promise => { + await api.functional.body.optional.json(connection); + await api.functional.body.optional.json( + connection, + typia.random(), + ); + + const response: Response = await fetch( + `${connection.host}/body/optional/json`, + { + method: "POST", + }, + ); + TestValidator.equals("status")(response.status)(201); +}; diff --git a/test/features/body-optional/src/test/features/api/test_api_plain_body_optional.ts b/test/features/body-optional/src/test/features/api/test_api_plain_body_optional.ts new file mode 100644 index 000000000..ebbde41eb --- /dev/null +++ b/test/features/body-optional/src/test/features/api/test_api_plain_body_optional.ts @@ -0,0 +1,22 @@ +import { TestValidator } from "@nestia/e2e"; + +import api from "@api"; + +export const test_api_plain_body_optional = async ( + connection: api.IConnection, +): Promise => { + TestValidator.equals("empty")( + await api.functional.body.optional.plain(connection), + )("Hello, world!"); + TestValidator.equals("filled")( + await api.functional.body.optional.plain(connection, "something"), + )("something"); + + const response: Response = await fetch( + `${connection.host}/body/optional/plain`, + { + method: "POST", + }, + ); + TestValidator.equals("status")(response.status)(201); +}; diff --git a/test/features/body-optional/src/test/index.ts b/test/features/body-optional/src/test/index.ts new file mode 100644 index 000000000..31a7190ab --- /dev/null +++ b/test/features/body-optional/src/test/index.ts @@ -0,0 +1,52 @@ +import { DynamicExecutor } from "@nestia/e2e"; +import chalk from "chalk"; + +import { Backend } from "../Backend"; + +async function main(): Promise { + const server: Backend = new Backend(); + await server.open(); + + const report: DynamicExecutor.IReport = await DynamicExecutor.validate({ + extension: __filename.substring(__filename.length - 2), + prefix: "test", + parameters: () => [ + { + host: "http://127.0.0.1:37000", + encryption: { + key: "A".repeat(32), + iv: "B".repeat(16), + }, + }, + ], + location: `${__dirname}/features`, + onComplete: (exec) => { + const trace = (str: string) => + console.log(` - ${chalk.green(exec.name)}: ${str}`); + if (exec.error === null) { + const elapsed: number = + new Date(exec.completed_at).getTime() - + new Date(exec.started_at).getTime(); + trace(`${chalk.yellow(elapsed.toLocaleString())} ms`); + } else trace(chalk.red(exec.error.name)); + }, + }); + 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/body-optional/swagger.json b/test/features/body-optional/swagger.json new file mode 100644 index 000000000..7eb852dc2 --- /dev/null +++ b/test/features/body-optional/swagger.json @@ -0,0 +1,111 @@ +{ + "openapi": "3.1.0", + "servers": [ + { + "url": "https://github.com/samchon/nestia", + "description": "insert your server url" + } + ], + "info": { + "version": "3.19.0-dev.20241111", + "title": "@samchon/nestia-test", + "description": "Test program of Nestia", + "license": { + "name": "MIT" + } + }, + "paths": { + "/body/optional/json": { + "post": { + "tags": [], + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IBodyOptional" + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IBodyOptional" + } + } + } + } + } + } + }, + "/body/optional/plain": { + "post": { + "tags": [], + "parameters": [], + "requestBody": { + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/health": { + "get": { + "tags": [], + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": {} + } + } + } + } + } + }, + "components": { + "schemas": { + "IBodyOptional": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "value": { + "type": "number" + } + }, + "required": [ + "id", + "value" + ] + } + } + }, + "tags": [], + "x-samchon-emended": true +} \ No newline at end of file diff --git a/test/features/body-optional/tsconfig.json b/test/features/body-optional/tsconfig.json new file mode 100644 index 000000000..afe2540b1 --- /dev/null +++ b/test/features/body-optional/tsconfig.json @@ -0,0 +1,99 @@ +{ + "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": "./", /* 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" }, + ], + }, + "include": ["src"], + } \ No newline at end of file diff --git a/test/features/fastify/nestia.config.ts b/test/features/fastify/nestia.config.ts index e4547d955..ca670ea91 100644 --- a/test/features/fastify/nestia.config.ts +++ b/test/features/fastify/nestia.config.ts @@ -3,7 +3,6 @@ import { INestiaConfig } from "@nestia/sdk"; export const NESTIA_CONFIG: INestiaConfig = { input: ["src/controllers"], output: "src/api", - e2e: "src/test", swagger: { output: "swagger.json", security: { diff --git a/test/features/fastify/src/api/functional/body/index.ts b/test/features/fastify/src/api/functional/body/index.ts new file mode 100644 index 000000000..0bb878fc0 --- /dev/null +++ b/test/features/fastify/src/api/functional/body/index.ts @@ -0,0 +1,7 @@ +/** + * @packageDocumentation + * @module api.functional.body + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +//================================================================ +export * as optional from "./optional"; diff --git a/test/features/fastify/src/api/functional/body/optional/index.ts b/test/features/fastify/src/api/functional/body/optional/index.ts new file mode 100644 index 000000000..ea84f028e --- /dev/null +++ b/test/features/fastify/src/api/functional/body/optional/index.ts @@ -0,0 +1,102 @@ +/** + * @packageDocumentation + * @module api.functional.body.optional + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +//================================================================ +import type { IConnection, Resolved, Primitive } from "@nestia/fetcher"; +import { PlainFetcher } from "@nestia/fetcher/lib/PlainFetcher"; + +import type { IBodyOptional } from "../../../structures/IBodyOptional"; + +/** + * @controller BodyOptionalController.json + * @path POST /body/optional/json + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +export async function json( + connection: IConnection, + body?: json.Input, +): Promise { + return PlainFetcher.fetch( + { + ...connection, + headers: { + ...connection.headers, + "Content-Type": "application/json", + }, + }, + { + ...json.METADATA, + template: json.METADATA.path, + path: json.path(), + }, + body, + ); +} +export namespace json { + export type Input = Resolved; + export type Output = Primitive; + + export const METADATA = { + method: "POST", + path: "/body/optional/json", + request: { + type: "application/json", + encrypted: false, + }, + response: { + type: "application/json", + encrypted: false, + }, + status: 201, + } as const; + + export const path = () => "/body/optional/json"; +} + +/** + * @controller BodyOptionalController.plain + * @path POST /body/optional/plain + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +export async function plain( + connection: IConnection, + body?: plain.Input, +): Promise { + return PlainFetcher.fetch( + { + ...connection, + headers: { + ...connection.headers, + "Content-Type": "text/plain", + }, + }, + { + ...plain.METADATA, + template: plain.METADATA.path, + path: plain.path(), + }, + body, + ); +} +export namespace plain { + export type Input = Resolved; + export type Output = Primitive; + + export const METADATA = { + method: "POST", + path: "/body/optional/plain", + request: { + type: "text/plain", + encrypted: false, + }, + response: { + type: "application/json", + encrypted: false, + }, + status: 201, + } as const; + + export const path = () => "/body/optional/plain"; +} diff --git a/test/features/fastify/src/api/functional/index.ts b/test/features/fastify/src/api/functional/index.ts index d98ec24b4..b72a9c187 100644 --- a/test/features/fastify/src/api/functional/index.ts +++ b/test/features/fastify/src/api/functional/index.ts @@ -5,6 +5,7 @@ */ //================================================================ export * as bbs from "./bbs"; +export * as body from "./body"; export * as calculate from "./calculate"; export * as health from "./health"; export * as performance from "./performance"; diff --git a/test/features/fastify/src/api/structures/IBodyOptional.ts b/test/features/fastify/src/api/structures/IBodyOptional.ts new file mode 100644 index 000000000..52b2a7faf --- /dev/null +++ b/test/features/fastify/src/api/structures/IBodyOptional.ts @@ -0,0 +1,6 @@ +import { tags } from "typia"; + +export interface IBodyOptional { + id: string & tags.Format<"uuid">; + value: number; +} diff --git a/test/features/fastify/src/controllers/BodyOptionalController.ts b/test/features/fastify/src/controllers/BodyOptionalController.ts new file mode 100644 index 000000000..8a89a4dc1 --- /dev/null +++ b/test/features/fastify/src/controllers/BodyOptionalController.ts @@ -0,0 +1,23 @@ +import { PlainBody, TypedBody, TypedRoute } from "@nestia/core"; +import { Controller } from "@nestjs/common"; +import { v4 } from "uuid"; + +import { IBodyOptional } from "@api/lib/structures/IBodyOptional"; + +@Controller("body/optional") +export class BodyOptionalController { + @TypedRoute.Post("json") + public json(@TypedBody() body?: IBodyOptional | undefined): IBodyOptional { + return ( + body ?? { + id: v4(), + value: 1, + } + ); + } + + @TypedRoute.Post("plain") + public plain(@PlainBody() body?: string): string { + return body ?? "Hello, world!"; + } +} diff --git a/test/features/fastify/src/test/features/api/automated/test_api_bbs_articles_index.ts b/test/features/fastify/src/test/features/api/automated/test_api_bbs_articles_index.ts deleted file mode 100644 index 04a597311..000000000 --- a/test/features/fastify/src/test/features/api/automated/test_api_bbs_articles_index.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { Primitive } from "@nestia/fetcher"; -import typia from "typia"; - -import api from "../../../../api"; -import type { IBbsArticle } from "../../../../api/structures/IBbsArticle"; -import type { IPage } from "../../../../api/structures/IPage"; - -export const test_api_bbs_articles_index = async ( - connection: api.IConnection, -) => { - const output: Primitive> = - await api.functional.bbs.articles.index( - connection, - typia.random(), - typia.random(), - ); - typia.assert(output); -}; diff --git a/test/features/fastify/src/test/features/api/automated/test_api_bbs_articles_store.ts b/test/features/fastify/src/test/features/api/automated/test_api_bbs_articles_store.ts deleted file mode 100644 index 4508b92e1..000000000 --- a/test/features/fastify/src/test/features/api/automated/test_api_bbs_articles_store.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { Primitive } from "@nestia/fetcher"; -import typia from "typia"; - -import api from "../../../../api"; -import type { IBbsArticle } from "../../../../api/structures/IBbsArticle"; - -export const test_api_bbs_articles_store = async ( - connection: api.IConnection, -) => { - const output: Primitive = - await api.functional.bbs.articles.store( - connection, - typia.random(), - typia.random(), - ); - typia.assert(output); -}; diff --git a/test/features/fastify/src/test/features/api/automated/test_api_bbs_articles_update.ts b/test/features/fastify/src/test/features/api/automated/test_api_bbs_articles_update.ts deleted file mode 100644 index 80c5bfc49..000000000 --- a/test/features/fastify/src/test/features/api/automated/test_api_bbs_articles_update.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Primitive } from "@nestia/fetcher"; -import typia from "typia"; -import type { Format } from "typia/lib/tags/Format"; - -import api from "../../../../api"; -import type { IBbsArticle } from "../../../../api/structures/IBbsArticle"; - -export const test_api_bbs_articles_update = async ( - connection: api.IConnection, -) => { - const output: Primitive = - await api.functional.bbs.articles.update( - connection, - typia.random(), - typia.random>(), - typia.random(), - ); - typia.assert(output); -}; diff --git a/test/features/fastify/src/test/features/api/automated/test_api_health_get.ts b/test/features/fastify/src/test/features/api/automated/test_api_health_get.ts deleted file mode 100644 index 8766b1129..000000000 --- a/test/features/fastify/src/test/features/api/automated/test_api_health_get.ts +++ /dev/null @@ -1,8 +0,0 @@ -import typia from "typia"; - -import api from "../../../../api"; - -export const test_api_health_get = async (connection: api.IConnection) => { - const output = await api.functional.health.get(connection); - typia.assert(output); -}; diff --git a/test/features/fastify/src/test/features/api/automated/test_api_param_boolean.ts b/test/features/fastify/src/test/features/api/automated/test_api_param_boolean.ts deleted file mode 100644 index b563a520e..000000000 --- a/test/features/fastify/src/test/features/api/automated/test_api_param_boolean.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Primitive } from "@nestia/fetcher"; -import typia from "typia"; - -import api from "../../../../api"; - -export const test_api_param_boolean = async (connection: api.IConnection) => { - const output: Primitive = await api.functional.param.boolean( - connection, - typia.random(), - ); - typia.assert(output); -}; diff --git a/test/features/fastify/src/test/features/api/automated/test_api_param_literal.ts b/test/features/fastify/src/test/features/api/automated/test_api_param_literal.ts deleted file mode 100644 index b4dc5f510..000000000 --- a/test/features/fastify/src/test/features/api/automated/test_api_param_literal.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Primitive } from "@nestia/fetcher"; -import typia from "typia"; - -import api from "../../../../api"; - -export const test_api_param_literal = async (connection: api.IConnection) => { - const output: Primitive<"A" | "B" | "C"> = await api.functional.param.literal( - connection, - typia.random<"A" | "B" | "C">(), - ); - typia.assert(output); -}; diff --git a/test/features/fastify/src/test/features/api/automated/test_api_param_nullable.ts b/test/features/fastify/src/test/features/api/automated/test_api_param_nullable.ts deleted file mode 100644 index 6974bf7a0..000000000 --- a/test/features/fastify/src/test/features/api/automated/test_api_param_nullable.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Primitive } from "@nestia/fetcher"; -import typia from "typia"; - -import api from "../../../../api"; - -export const test_api_param_nullable = async (connection: api.IConnection) => { - const output: Primitive = await api.functional.param.nullable( - connection, - typia.random(), - ); - typia.assert(output); -}; diff --git a/test/features/fastify/src/test/features/api/automated/test_api_param_number.ts b/test/features/fastify/src/test/features/api/automated/test_api_param_number.ts deleted file mode 100644 index 10eeb5f42..000000000 --- a/test/features/fastify/src/test/features/api/automated/test_api_param_number.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Primitive } from "@nestia/fetcher"; -import typia from "typia"; - -import api from "../../../../api"; - -export const test_api_param_number = async (connection: api.IConnection) => { - const output: Primitive = await api.functional.param.number( - connection, - typia.random(), - ); - typia.assert(output); -}; diff --git a/test/features/fastify/src/test/features/api/automated/test_api_param_string.ts b/test/features/fastify/src/test/features/api/automated/test_api_param_string.ts deleted file mode 100644 index 7781d46bb..000000000 --- a/test/features/fastify/src/test/features/api/automated/test_api_param_string.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Primitive } from "@nestia/fetcher"; -import typia from "typia"; - -import api from "../../../../api"; - -export const test_api_param_string = async (connection: api.IConnection) => { - const output: Primitive = await api.functional.param.string( - connection, - typia.random(), - ); - typia.assert(output); -}; diff --git a/test/features/fastify/src/test/features/api/automated/test_api_performance_get.ts b/test/features/fastify/src/test/features/api/automated/test_api_performance_get.ts deleted file mode 100644 index 54cdfd218..000000000 --- a/test/features/fastify/src/test/features/api/automated/test_api_performance_get.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Primitive } from "@nestia/fetcher"; -import typia from "typia"; - -import api from "../../../../api"; -import type { IPerformance } from "../../../../api/structures/IPerformance"; - -export const test_api_performance_get = async (connection: api.IConnection) => { - const output: Primitive = - await api.functional.performance.get(connection); - typia.assert(output); -}; diff --git a/test/features/fastify/src/test/features/api/automated/test_api_plain_send.ts b/test/features/fastify/src/test/features/api/automated/test_api_plain_send.ts deleted file mode 100644 index 704bf9b15..000000000 --- a/test/features/fastify/src/test/features/api/automated/test_api_plain_send.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Resolved } from "@nestia/fetcher"; -import typia from "typia"; - -import api from "../../../../api"; - -export const test_api_plain_send = async (connection: api.IConnection) => { - const output: Resolved = await api.functional.plain.send( - connection, - typia.random(), - ); - typia.assert(output); -}; diff --git a/test/features/fastify/src/test/features/api/automated/test_api_sellers_authenticate_exit.ts b/test/features/fastify/src/test/features/api/automated/test_api_sellers_authenticate_exit.ts deleted file mode 100644 index 9bcdb8167..000000000 --- a/test/features/fastify/src/test/features/api/automated/test_api_sellers_authenticate_exit.ts +++ /dev/null @@ -1,10 +0,0 @@ -import typia from "typia"; - -import api from "../../../../api"; - -export const test_api_sellers_authenticate_exit = async ( - connection: api.IConnection, -) => { - const output = await api.functional.sellers.authenticate.exit(connection); - typia.assert(output); -}; diff --git a/test/features/fastify/src/test/features/api/automated/test_api_sellers_authenticate_join.ts b/test/features/fastify/src/test/features/api/automated/test_api_sellers_authenticate_join.ts deleted file mode 100644 index 6102321aa..000000000 --- a/test/features/fastify/src/test/features/api/automated/test_api_sellers_authenticate_join.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Primitive } from "@nestia/fetcher"; -import typia from "typia"; - -import api from "../../../../api"; -import type { ISeller } from "../../../../api/structures/ISeller"; - -export const test_api_sellers_authenticate_join = async ( - connection: api.IConnection, -) => { - const output: Primitive = - await api.functional.sellers.authenticate.join( - connection, - typia.random(), - ); - typia.assert(output); -}; diff --git a/test/features/fastify/src/test/features/api/automated/test_api_sellers_authenticate_login.ts b/test/features/fastify/src/test/features/api/automated/test_api_sellers_authenticate_login.ts deleted file mode 100644 index 2dadf51ab..000000000 --- a/test/features/fastify/src/test/features/api/automated/test_api_sellers_authenticate_login.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Primitive } from "@nestia/fetcher"; -import typia from "typia"; - -import api from "../../../../api"; -import type { ISeller } from "../../../../api/structures/ISeller"; - -export const test_api_sellers_authenticate_login = async ( - connection: api.IConnection, -) => { - const output: Primitive = - await api.functional.sellers.authenticate.login( - connection, - typia.random(), - ); - typia.assert(output); -}; diff --git a/test/features/fastify/src/test/features/api/automated/test_api_sellers_authenticate_password_change.ts b/test/features/fastify/src/test/features/api/automated/test_api_sellers_authenticate_password_change.ts deleted file mode 100644 index 16562af50..000000000 --- a/test/features/fastify/src/test/features/api/automated/test_api_sellers_authenticate_password_change.ts +++ /dev/null @@ -1,14 +0,0 @@ -import typia from "typia"; - -import api from "../../../../api"; -import type { ISeller } from "../../../../api/structures/ISeller"; - -export const test_api_sellers_authenticate_password_change = async ( - connection: api.IConnection, -) => { - const output = await api.functional.sellers.authenticate.password.change( - connection, - typia.random(), - ); - typia.assert(output); -}; diff --git a/test/features/fastify/src/test/features/api/test_api_json_body_optional.ts b/test/features/fastify/src/test/features/api/test_api_json_body_optional.ts new file mode 100644 index 000000000..e252713c1 --- /dev/null +++ b/test/features/fastify/src/test/features/api/test_api_json_body_optional.ts @@ -0,0 +1,23 @@ +import { TestValidator } from "@nestia/e2e"; +import typia from "typia"; + +import api from "@api"; +import { IBodyOptional } from "@api/lib/structures/IBodyOptional"; + +export const test_api_json_body_optional = async ( + connection: api.IConnection, +): Promise => { + await api.functional.body.optional.json(connection); + await api.functional.body.optional.json( + connection, + typia.random(), + ); + + const response: Response = await fetch( + `${connection.host}/body/optional/json`, + { + method: "POST", + }, + ); + TestValidator.equals("status")(response.status)(201); +}; diff --git a/test/features/fastify/src/test/features/api/test_api_plain_body_optional.ts b/test/features/fastify/src/test/features/api/test_api_plain_body_optional.ts new file mode 100644 index 000000000..ebbde41eb --- /dev/null +++ b/test/features/fastify/src/test/features/api/test_api_plain_body_optional.ts @@ -0,0 +1,22 @@ +import { TestValidator } from "@nestia/e2e"; + +import api from "@api"; + +export const test_api_plain_body_optional = async ( + connection: api.IConnection, +): Promise => { + TestValidator.equals("empty")( + await api.functional.body.optional.plain(connection), + )("Hello, world!"); + TestValidator.equals("filled")( + await api.functional.body.optional.plain(connection, "something"), + )("something"); + + const response: Response = await fetch( + `${connection.host}/body/optional/plain`, + { + method: "POST", + }, + ); + TestValidator.equals("status")(response.status)(201); +}; diff --git a/test/features/fastify/swagger.json b/test/features/fastify/swagger.json index 4d037fdc1..4bcf9b25b 100644 --- a/test/features/fastify/swagger.json +++ b/test/features/fastify/swagger.json @@ -1 +1 @@ -{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"3.17.0","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/bbs/articles/{section}":{"get":{"tags":[],"parameters":[{"name":"section","in":"path","schema":{"type":"string"},"required":true},{"name":"page","in":"query","schema":{"oneOf":[{"type":"null"},{"type":"integer"}]},"required":false},{"name":"limit","in":"query","schema":{"oneOf":[{"type":"null"},{"type":"integer"}]},"required":false}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPageIBbsArticle.ISummary"}}}}}},"post":{"summary":"Store a new article","description":"Store a new article.","tags":[],"parameters":[{"name":"section","in":"path","schema":{"type":"string"},"required":true,"description":" Section code"}],"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"}}}}}}},"/bbs/articles/{section}/{id}":{"put":{"summary":"Update an article","description":"Update an article.","tags":[],"parameters":[{"name":"section","in":"path","schema":{"type":"string"},"required":true,"description":" Section code"},{"name":"id","in":"path","schema":{"type":"string","format":"uuid"},"required":true,"description":" Target article ID"}],"requestBody":{"description":"Content to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"200":{"description":"Updated content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}},"/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"}}}}}}},"/plain":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"text/plain":{"schema":{"type":"string"}}},"required":true},"responses":{"201":{"description":"","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/sellers/authenticate/join":{"post":{"summary":"Join as a seller","description":"Join as a seller.","tags":[],"parameters":[],"requestBody":{"description":"## Warning\n\nRequest body must be encrypted.\n\nThe request body data would be encrypted as \"AES-128(256) / CBC mode / PKCS#5 Padding / Base64 Encoding\", through the [EncryptedBody](https://github.com/samchon/@nestia/core#encryptedbody) component.\n\nTherefore, just utilize this swagger editor only for referencing. If you need to call the real API, using [SDK](https://github.com/samchon/nestia#software-development-kit) would be much better.\n\n----------------\n\nInformation of yours","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ISeller.IJoin"}}},"required":true,"x-nestia-encrypted":true},"responses":{"201":{"description":"## Warning\n\nResponse data have been encrypted.\n\nThe response body data would be encrypted as \"AES-128(256) / CBC mode / PKCS#5 Padding / Base64 Encoding\", through the [EncryptedRoute.Post](https://github.com/samchon/@nestia/core#encryptedroute) component.\n\nTherefore, just utilize this swagger editor only for referencing. If you need to call the real API, using [SDK](https://github.com/samchon/nestia#software-development-kit) would be much better.\n\n----------------\n\nInformation of newly joined seller","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ISeller.IAuthorized"}}},"x-nestia-encrypted":true}}}},"/sellers/authenticate/login":{"post":{"summary":"Log-in as a seller","description":"Log-in as a seller.","tags":[],"parameters":[],"requestBody":{"description":"## Warning\n\nRequest body must be encrypted.\n\nThe request body data would be encrypted as \"AES-128(256) / CBC mode / PKCS#5 Padding / Base64 Encoding\", through the [EncryptedBody](https://github.com/samchon/@nestia/core#encryptedbody) component.\n\nTherefore, just utilize this swagger editor only for referencing. If you need to call the real API, using [SDK](https://github.com/samchon/nestia#software-development-kit) would be much better.\n\n----------------\n\nEmail and password","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ISeller.ILogin"}}},"required":true,"x-nestia-encrypted":true},"responses":{"201":{"description":"## Warning\n\nResponse data have been encrypted.\n\nThe response body data would be encrypted as \"AES-128(256) / CBC mode / PKCS#5 Padding / Base64 Encoding\", through the [EncryptedRoute.Post](https://github.com/samchon/@nestia/core#encryptedroute) component.\n\nTherefore, just utilize this swagger editor only for referencing. If you need to call the real API, using [SDK](https://github.com/samchon/nestia#software-development-kit) would be much better.\n\n----------------\n\nInformation of the seller","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ISeller.IAuthorized"}}},"x-nestia-encrypted":true}}}},"/sellers/authenticate/password/change":{"patch":{"summary":"Change password","description":"Change password.","tags":[],"parameters":[],"requestBody":{"description":"## Warning\n\nRequest body must be encrypted.\n\nThe request body data would be encrypted as \"AES-128(256) / CBC mode / PKCS#5 Padding / Base64 Encoding\", through the [EncryptedBody](https://github.com/samchon/@nestia/core#encryptedbody) component.\n\nTherefore, just utilize this swagger editor only for referencing. If you need to call the real API, using [SDK](https://github.com/samchon/nestia#software-development-kit) would be much better.\n\n----------------\n\nOld and new passwords","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ISeller.IChangePassword"}}},"required":true,"x-nestia-encrypted":true},"responses":{"200":{"description":"Empty object","content":{"application/json":{}}}}}},"/sellers/authenticate/exit":{"delete":{"summary":"Erase the seller by itself","description":"Erase the seller by itself.","tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/param/{value}/boolean":{"get":{"tags":[],"parameters":[{"name":"value","in":"path","schema":{"type":"boolean"},"required":true}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"boolean"}}}}}}},"/param/{value}/number":{"get":{"tags":[],"parameters":[{"name":"value","in":"path","schema":{"type":"number"},"required":true}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"number"}}}}}}},"/param/{value}/string":{"get":{"tags":[],"parameters":[{"name":"value","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/param/{value}/nullable":{"get":{"tags":[],"parameters":[{"name":"value","in":"path","schema":{"oneOf":[{"type":"null"},{"type":"string"}]},"required":true}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"oneOf":[{"type":"null"},{"type":"string"}]}}}}}}},"/param/{value}/literal":{"get":{"tags":[],"parameters":[{"name":"value","in":"path","schema":{"oneOf":[{"const":"A"},{"const":"B"},{"const":"C"}]},"required":true}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"oneOf":[{"const":"A"},{"const":"B"},{"const":"C"}]}}}}}}}},"components":{"schemas":{"IPageIBbsArticle.ISummary":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/IBbsArticle.ISummary"}},"pagination":{"$ref":"#/components/schemas/IPage.IPagination"}},"required":["data","pagination"]},"IBbsArticle.ISummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"section":{"type":"string"},"writer":{"type":"string"},"title":{"type":"string","minLength":3,"maxLength":50},"created_at":{"type":"string","format":"date-time"}},"required":["id","section","writer","title","created_at"]},"IPage.IPagination":{"type":"object","properties":{"current":{"type":"integer"},"limit":{"type":"integer"},"records":{"type":"integer"},"pages":{"type":"integer"}},"required":["current","limit","records","pages"],"description":"Page information."},"IPage.IRequest":{"type":"object","properties":{"page":{"oneOf":[{"type":"null"},{"type":"integer"}]},"limit":{"oneOf":[{"type":"null"},{"type":"integer"}]}},"description":"Page request data"},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"section":{"type":"string"},"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","section","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"]},"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"]},"ISeller.IAuthorized":{"type":"object","properties":{"authorization":{"type":"object","properties":{"token":{"type":"string"},"expires_at":{"type":"string"}},"required":["token","expires_at"]},"id":{"type":"number","title":"Primary key","description":"Primary key."},"email":{"type":"string","title":"Email address","description":"Email address."},"name":{"type":"string","title":"Name of the seller","description":"Name of the seller."},"mobile":{"type":"string","title":"Mobile number of the seller","description":"Mobile number of the seller."},"company":{"type":"string","title":"Belonged company name","description":"Belonged company name."},"created_at":{"type":"string","title":"Joined time","description":"Joined time."}},"required":["authorization","id","email","name","mobile","company","created_at"]},"ISeller.IJoin":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"},"name":{"type":"string"},"mobile":{"type":"string"},"company":{"type":"string"}},"required":["email","password","name","mobile","company"]},"ISeller.ILogin":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"}},"required":["email","password"]},"ISeller.IChangePassword":{"type":"object","properties":{"old_password":{"type":"string"},"new_password":{"type":"string"}},"required":["old_password","new_password"]}},"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":"3.19.0-dev.20241111","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/bbs/articles/{section}":{"get":{"tags":[],"parameters":[{"name":"section","in":"path","schema":{"type":"string"},"required":true},{"name":"page","in":"query","schema":{"oneOf":[{"type":"null"},{"type":"integer"}]},"required":false},{"name":"limit","in":"query","schema":{"oneOf":[{"type":"null"},{"type":"integer"}]},"required":false}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPageIBbsArticle.ISummary"}}}}}},"post":{"summary":"Store a new article","description":"Store a new article.","tags":[],"parameters":[{"name":"section","in":"path","schema":{"type":"string"},"required":true,"description":" Section code"}],"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"}}}}}}},"/bbs/articles/{section}/{id}":{"put":{"summary":"Update an article","description":"Update an article.","tags":[],"parameters":[{"name":"section","in":"path","schema":{"type":"string"},"required":true,"description":" Section code"},{"name":"id","in":"path","schema":{"type":"string","format":"uuid"},"required":true,"description":" Target article ID"}],"requestBody":{"description":"Content to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle.IStore"}}},"required":true},"responses":{"200":{"description":"Updated content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}}}},"/body/optional/json":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBodyOptional"}}},"required":false},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBodyOptional"}}}}}}},"/body/optional/plain":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"text/plain":{"schema":{"type":"string"}}},"required":false},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/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"}}}}}}},"/plain":{"post":{"tags":[],"parameters":[],"requestBody":{"content":{"text/plain":{"schema":{"type":"string"}}},"required":true},"responses":{"201":{"description":"","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/sellers/authenticate/join":{"post":{"summary":"Join as a seller","description":"Join as a seller.","tags":[],"parameters":[],"requestBody":{"description":"## Warning\n\nRequest body must be encrypted.\n\nThe request body data would be encrypted as \"AES-128(256) / CBC mode / PKCS#5 Padding / Base64 Encoding\", through the [EncryptedBody](https://github.com/samchon/@nestia/core#encryptedbody) component.\n\nTherefore, just utilize this swagger editor only for referencing. If you need to call the real API, using [SDK](https://github.com/samchon/nestia#software-development-kit) would be much better.\n\n----------------\n\nInformation of yours","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ISeller.IJoin"}}},"required":true,"x-nestia-encrypted":true},"responses":{"201":{"description":"## Warning\n\nResponse data have been encrypted.\n\nThe response body data would be encrypted as \"AES-128(256) / CBC mode / PKCS#5 Padding / Base64 Encoding\", through the [EncryptedRoute.Post](https://github.com/samchon/@nestia/core#encryptedroute) component.\n\nTherefore, just utilize this swagger editor only for referencing. If you need to call the real API, using [SDK](https://github.com/samchon/nestia#software-development-kit) would be much better.\n\n----------------\n\nInformation of newly joined seller","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ISeller.IAuthorized"}}},"x-nestia-encrypted":true}}}},"/sellers/authenticate/login":{"post":{"summary":"Log-in as a seller","description":"Log-in as a seller.","tags":[],"parameters":[],"requestBody":{"description":"## Warning\n\nRequest body must be encrypted.\n\nThe request body data would be encrypted as \"AES-128(256) / CBC mode / PKCS#5 Padding / Base64 Encoding\", through the [EncryptedBody](https://github.com/samchon/@nestia/core#encryptedbody) component.\n\nTherefore, just utilize this swagger editor only for referencing. If you need to call the real API, using [SDK](https://github.com/samchon/nestia#software-development-kit) would be much better.\n\n----------------\n\nEmail and password","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ISeller.ILogin"}}},"required":true,"x-nestia-encrypted":true},"responses":{"201":{"description":"## Warning\n\nResponse data have been encrypted.\n\nThe response body data would be encrypted as \"AES-128(256) / CBC mode / PKCS#5 Padding / Base64 Encoding\", through the [EncryptedRoute.Post](https://github.com/samchon/@nestia/core#encryptedroute) component.\n\nTherefore, just utilize this swagger editor only for referencing. If you need to call the real API, using [SDK](https://github.com/samchon/nestia#software-development-kit) would be much better.\n\n----------------\n\nInformation of the seller","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ISeller.IAuthorized"}}},"x-nestia-encrypted":true}}}},"/sellers/authenticate/password/change":{"patch":{"summary":"Change password","description":"Change password.","tags":[],"parameters":[],"requestBody":{"description":"## Warning\n\nRequest body must be encrypted.\n\nThe request body data would be encrypted as \"AES-128(256) / CBC mode / PKCS#5 Padding / Base64 Encoding\", through the [EncryptedBody](https://github.com/samchon/@nestia/core#encryptedbody) component.\n\nTherefore, just utilize this swagger editor only for referencing. If you need to call the real API, using [SDK](https://github.com/samchon/nestia#software-development-kit) would be much better.\n\n----------------\n\nOld and new passwords","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ISeller.IChangePassword"}}},"required":true,"x-nestia-encrypted":true},"responses":{"200":{"description":"Empty object","content":{"application/json":{}}}}}},"/sellers/authenticate/exit":{"delete":{"summary":"Erase the seller by itself","description":"Erase the seller by itself.","tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}}}},"/param/{value}/boolean":{"get":{"tags":[],"parameters":[{"name":"value","in":"path","schema":{"type":"boolean"},"required":true}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"boolean"}}}}}}},"/param/{value}/number":{"get":{"tags":[],"parameters":[{"name":"value","in":"path","schema":{"type":"number"},"required":true}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"number"}}}}}}},"/param/{value}/string":{"get":{"tags":[],"parameters":[{"name":"value","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/param/{value}/nullable":{"get":{"tags":[],"parameters":[{"name":"value","in":"path","schema":{"oneOf":[{"type":"null"},{"type":"string"}]},"required":true}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"oneOf":[{"type":"null"},{"type":"string"}]}}}}}}},"/param/{value}/literal":{"get":{"tags":[],"parameters":[{"name":"value","in":"path","schema":{"oneOf":[{"const":"A"},{"const":"B"},{"const":"C"}]},"required":true}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"oneOf":[{"const":"A"},{"const":"B"},{"const":"C"}]}}}}}}}},"components":{"schemas":{"IPageIBbsArticle.ISummary":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/IBbsArticle.ISummary"}},"pagination":{"$ref":"#/components/schemas/IPage.IPagination"}},"required":["data","pagination"]},"IBbsArticle.ISummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"section":{"type":"string"},"writer":{"type":"string"},"title":{"type":"string","minLength":3,"maxLength":50},"created_at":{"type":"string","format":"date-time"}},"required":["id","section","writer","title","created_at"]},"IPage.IPagination":{"type":"object","properties":{"current":{"type":"integer"},"limit":{"type":"integer"},"records":{"type":"integer"},"pages":{"type":"integer"}},"required":["current","limit","records","pages"],"description":"Page information."},"IPage.IRequest":{"type":"object","properties":{"page":{"oneOf":[{"type":"null"},{"type":"integer"}]},"limit":{"oneOf":[{"type":"null"},{"type":"integer"}]}},"description":"Page request data"},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"section":{"type":"string"},"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","section","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"]},"IBodyOptional":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"value":{"type":"number"}},"required":["id","value"]},"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"]},"ISeller.IAuthorized":{"type":"object","properties":{"authorization":{"type":"object","properties":{"token":{"type":"string"},"expires_at":{"type":"string"}},"required":["token","expires_at"]},"id":{"type":"number","title":"Primary key","description":"Primary key."},"email":{"type":"string","title":"Email address","description":"Email address."},"name":{"type":"string","title":"Name of the seller","description":"Name of the seller."},"mobile":{"type":"string","title":"Mobile number of the seller","description":"Mobile number of the seller."},"company":{"type":"string","title":"Belonged company name","description":"Belonged company name."},"created_at":{"type":"string","title":"Joined time","description":"Joined time."}},"required":["authorization","id","email","name","mobile","company","created_at"]},"ISeller.IJoin":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"},"name":{"type":"string"},"mobile":{"type":"string"},"company":{"type":"string"}},"required":["email","password","name","mobile","company"]},"ISeller.ILogin":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"}},"required":["email","password"]},"ISeller.IChangePassword":{"type":"object","properties":{"old_password":{"type":"string"},"new_password":{"type":"string"}},"required":["old_password","new_password"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/package.json b/test/package.json index c53a3ddf5..e9145149a 100644 --- a/test/package.json +++ b/test/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@samchon/nestia-test", - "version": "3.19.0-dev.20241111", + "version": "3.19.0-dev.20241112", "description": "Test program of Nestia", "main": "index.js", "scripts": { @@ -26,7 +26,7 @@ }, "homepage": "https://nestia.io", "devDependencies": { - "@nestia/sdk": "^3.19.0-dev.20241111", + "@nestia/sdk": "^3.19.0-dev.20241112", "@nestjs/swagger": "^8.0.5", "@samchon/openapi": "^1.2.2", "@types/express": "^4.17.17", @@ -40,9 +40,9 @@ }, "dependencies": { "@fastify/multipart": "^8.1.0", - "@nestia/core": "^3.19.0-dev.20241111", + "@nestia/core": "^3.19.0-dev.20241112", "@nestia/e2e": "^0.7.0", - "@nestia/fetcher": "^3.19.0-dev.20241111", + "@nestia/fetcher": "^3.19.0-dev.20241112", "@nestjs/common": "^10.4.7", "@nestjs/core": "^10.4.7", "@nestjs/platform-express": "^10.4.7", diff --git a/test/template/success/src/test/features/api/test_api_performance.ts b/test/template/success/src/test/features/api/test_api_performance.ts deleted file mode 100644 index df2b434d7..000000000 --- a/test/template/success/src/test/features/api/test_api_performance.ts +++ /dev/null @@ -1,12 +0,0 @@ -import typia from "typia"; - -import api from "@api"; -import { IPerformance } from "@api/lib/structures/IPerformance"; - -export const test_api_monitor_performance = async ( - connection: api.IConnection, -): Promise => { - const performance: IPerformance = - await api.functional.performance.get(connection); - typia.assert(performance); -};