From 6c95d20660644ebe68fc7eaa54e176212f7f3732 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Wed, 18 Dec 2024 16:19:00 +0900 Subject: [PATCH] New decorator `@HumanRoute()`. A new decorator excluding an API operation from LLM function calling application composing. --- packages/core/src/decorators/HumanRoute.ts | 22 +++++ packages/core/src/module.ts | 1 + test/features/route-human/nestia.config.ts | 16 +++ test/features/route-human/src/Backend.ts | 27 +++++ .../features/route-human/src/api/HttpError.ts | 1 + .../route-human/src/api/IConnection.ts | 1 + .../features/route-human/src/api/Primitive.ts | 1 + test/features/route-human/src/api/Resolved.ts | 1 + .../src/api/functional/health/index.ts | 35 +++++++ .../route-human/src/api/functional/index.ts | 9 ++ .../src/api/functional/performance/index.ts | 40 ++++++++ .../src/api/functional/route/index.ts | 40 ++++++++ test/features/route-human/src/api/index.ts | 4 + test/features/route-human/src/api/module.ts | 6 ++ .../src/api/structures/IBbsArticle.ts | 40 ++++++++ .../src/api/structures/IPerformance.ts | 10 ++ .../route-human/src/api/structures/ISystem.ts | 81 +++++++++++++++ .../src/controllers/HealthController.ts | 9 ++ .../src/controllers/PerformanceController.ts | 17 ++++ .../src/controllers/TypedRouteController.ts | 18 ++++ .../src/test/features/test_human_route.ts | 33 +++++++ test/features/route-human/src/test/index.ts | 47 +++++++++ test/features/route-human/swagger.json | 1 + test/features/route-human/tsconfig.json | 98 +++++++++++++++++++ 24 files changed, 558 insertions(+) create mode 100644 packages/core/src/decorators/HumanRoute.ts create mode 100644 test/features/route-human/nestia.config.ts create mode 100644 test/features/route-human/src/Backend.ts create mode 100644 test/features/route-human/src/api/HttpError.ts create mode 100644 test/features/route-human/src/api/IConnection.ts create mode 100644 test/features/route-human/src/api/Primitive.ts create mode 100644 test/features/route-human/src/api/Resolved.ts create mode 100644 test/features/route-human/src/api/functional/health/index.ts create mode 100644 test/features/route-human/src/api/functional/index.ts create mode 100644 test/features/route-human/src/api/functional/performance/index.ts create mode 100644 test/features/route-human/src/api/functional/route/index.ts create mode 100644 test/features/route-human/src/api/index.ts create mode 100644 test/features/route-human/src/api/module.ts create mode 100644 test/features/route-human/src/api/structures/IBbsArticle.ts create mode 100644 test/features/route-human/src/api/structures/IPerformance.ts create mode 100644 test/features/route-human/src/api/structures/ISystem.ts create mode 100644 test/features/route-human/src/controllers/HealthController.ts create mode 100644 test/features/route-human/src/controllers/PerformanceController.ts create mode 100644 test/features/route-human/src/controllers/TypedRouteController.ts create mode 100644 test/features/route-human/src/test/features/test_human_route.ts create mode 100644 test/features/route-human/src/test/index.ts create mode 100644 test/features/route-human/swagger.json create mode 100644 test/features/route-human/tsconfig.json diff --git a/packages/core/src/decorators/HumanRoute.ts b/packages/core/src/decorators/HumanRoute.ts new file mode 100644 index 000000000..5a8215891 --- /dev/null +++ b/packages/core/src/decorators/HumanRoute.ts @@ -0,0 +1,22 @@ +import { SwaggerCustomizer } from "./SwaggerCustomizer"; + +/** + * Human only API marking. + * + * This decorator marks the API for human only, so that LLM function calling + * schema composer (of [`@samchon/openapi`](https://github.com/samchon/openapi)) + * excludes the API. + * + * In other words, if you adjust the `@HumanRoute()` decorator to the API, + * the API never participates in the LLM function calling. When calling the + * {@link HttpLlm.application} function, matched {@link IHttpLlmFunction} data + * never be composed. + * + * @returns Method decorator + * @author Jeongho Nam - https://github.com/samchon + */ +export function HumanRoute(): MethodDecorator { + return SwaggerCustomizer((props) => { + props.route["x-samchon-human"] = true; + }); +} diff --git a/packages/core/src/module.ts b/packages/core/src/module.ts index b0cf800af..b923a5e1d 100644 --- a/packages/core/src/module.ts +++ b/packages/core/src/module.ts @@ -1,6 +1,7 @@ export * from "./decorators/DynamicModule"; export * from "./utils/ExceptionManager"; +export * from "./decorators/HumanRoute"; export * from "./decorators/TypedRoute"; export * from "./decorators/TypedBody"; export * from "./decorators/TypedQuery"; diff --git a/test/features/route-human/nestia.config.ts b/test/features/route-human/nestia.config.ts new file mode 100644 index 000000000..e4547d955 --- /dev/null +++ b/test/features/route-human/nestia.config.ts @@ -0,0 +1,16 @@ +import { INestiaConfig } from "@nestia/sdk"; + +export const NESTIA_CONFIG: INestiaConfig = { + input: ["src/controllers"], + output: "src/api", + e2e: "src/test", + swagger: { + output: "swagger.json", + security: { + bearer: { + type: "apiKey", + }, + }, + }, +}; +export default NESTIA_CONFIG; diff --git a/test/features/route-human/src/Backend.ts b/test/features/route-human/src/Backend.ts new file mode 100644 index 000000000..be2c2d840 --- /dev/null +++ b/test/features/route-human/src/Backend.ts @@ -0,0 +1,27 @@ +import core from "@nestia/core"; +import { INestApplication } from "@nestjs/common"; +import { NestFactory } from "@nestjs/core"; + +export class Backend { + private application_?: INestApplication; + + public async open(): Promise { + this.application_ = await NestFactory.create( + await core.EncryptedModule.dynamic(__dirname + "/controllers", { + key: "A".repeat(32), + iv: "B".repeat(16), + }), + { logger: false }, + ); + await this.application_.listen(37_000); + } + + public async close(): Promise { + if (this.application_ === undefined) return; + + const app = this.application_; + await app.close(); + + delete this.application_; + } +} diff --git a/test/features/route-human/src/api/HttpError.ts b/test/features/route-human/src/api/HttpError.ts new file mode 100644 index 000000000..5df328ae4 --- /dev/null +++ b/test/features/route-human/src/api/HttpError.ts @@ -0,0 +1 @@ +export { HttpError } from "@nestia/fetcher"; diff --git a/test/features/route-human/src/api/IConnection.ts b/test/features/route-human/src/api/IConnection.ts new file mode 100644 index 000000000..107bdb8f8 --- /dev/null +++ b/test/features/route-human/src/api/IConnection.ts @@ -0,0 +1 @@ +export type { IConnection } from "@nestia/fetcher"; diff --git a/test/features/route-human/src/api/Primitive.ts b/test/features/route-human/src/api/Primitive.ts new file mode 100644 index 000000000..ebdcd7620 --- /dev/null +++ b/test/features/route-human/src/api/Primitive.ts @@ -0,0 +1 @@ +export type { Primitive } from "typia"; diff --git a/test/features/route-human/src/api/Resolved.ts b/test/features/route-human/src/api/Resolved.ts new file mode 100644 index 000000000..7cf4920b0 --- /dev/null +++ b/test/features/route-human/src/api/Resolved.ts @@ -0,0 +1 @@ +export type { Resolved } from "typia"; diff --git a/test/features/route-human/src/api/functional/health/index.ts b/test/features/route-human/src/api/functional/health/index.ts new file mode 100644 index 000000000..36ae23908 --- /dev/null +++ b/test/features/route-human/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/route-human/src/api/functional/index.ts b/test/features/route-human/src/api/functional/index.ts new file mode 100644 index 000000000..096a4be8c --- /dev/null +++ b/test/features/route-human/src/api/functional/index.ts @@ -0,0 +1,9 @@ +/** + * @packageDocumentation + * @module api.functional + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +//================================================================ +export * as health from "./health"; +export * as performance from "./performance"; +export * as route from "./route"; diff --git a/test/features/route-human/src/api/functional/performance/index.ts b/test/features/route-human/src/api/functional/performance/index.ts new file mode 100644 index 000000000..c4be76f56 --- /dev/null +++ b/test/features/route-human/src/api/functional/performance/index.ts @@ -0,0 +1,40 @@ +/** + * @packageDocumentation + * @module api.functional.performance + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +//================================================================ +import type { IConnection } from "@nestia/fetcher"; +import { PlainFetcher } from "@nestia/fetcher/lib/PlainFetcher"; +import type { Primitive } from "typia"; + +import type { IPerformance } from "../../structures/IPerformance"; + +/** + * @controller PerformanceController.get + * @path GET /performance + * @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 type Output = Primitive; + + export const METADATA = { + method: "GET", + path: "/performance", + request: null, + response: { + type: "application/json", + encrypted: false, + }, + status: 200, + } as const; + + export const path = () => "/performance"; +} diff --git a/test/features/route-human/src/api/functional/route/index.ts b/test/features/route-human/src/api/functional/route/index.ts new file mode 100644 index 000000000..23b2889f5 --- /dev/null +++ b/test/features/route-human/src/api/functional/route/index.ts @@ -0,0 +1,40 @@ +/** + * @packageDocumentation + * @module api.functional.route + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +//================================================================ +import type { IConnection } from "@nestia/fetcher"; +import { PlainFetcher } from "@nestia/fetcher/lib/PlainFetcher"; +import type { Primitive } from "typia"; + +import type { IBbsArticle } from "../../structures/IBbsArticle"; + +/** + * @controller TypedRouteController.random + * @path GET /route/random + * @nestia Generated by Nestia - https://github.com/samchon/nestia + */ +export async function random(connection: IConnection): Promise { + return PlainFetcher.fetch(connection, { + ...random.METADATA, + template: random.METADATA.path, + path: random.path(), + }); +} +export namespace random { + export type Output = Primitive; + + export const METADATA = { + method: "GET", + path: "/route/random", + request: null, + response: { + type: "application/json", + encrypted: false, + }, + status: 200, + } as const; + + export const path = () => "/route/random"; +} diff --git a/test/features/route-human/src/api/index.ts b/test/features/route-human/src/api/index.ts new file mode 100644 index 000000000..1705f43c8 --- /dev/null +++ b/test/features/route-human/src/api/index.ts @@ -0,0 +1,4 @@ +import * as api from "./module"; + +export * from "./module"; +export default api; diff --git a/test/features/route-human/src/api/module.ts b/test/features/route-human/src/api/module.ts new file mode 100644 index 000000000..2137b4473 --- /dev/null +++ b/test/features/route-human/src/api/module.ts @@ -0,0 +1,6 @@ +export type * from "./IConnection"; +export type * from "./Primitive"; +export type * from "./Resolved"; +export * from "./HttpError"; + +export * as functional from "./functional"; diff --git a/test/features/route-human/src/api/structures/IBbsArticle.ts b/test/features/route-human/src/api/structures/IBbsArticle.ts new file mode 100644 index 000000000..4ac1973bb --- /dev/null +++ b/test/features/route-human/src/api/structures/IBbsArticle.ts @@ -0,0 +1,40 @@ +export interface IBbsArticle { + /** + * @format uuid + */ + id: string; + + /** + * @minLength 3 + * @maxLength 50 + */ + title: string; + + body: string; + + files: IAttachmentFile[]; + + /** + * @format date-time + */ + created_at: string; +} + +export interface IAttachmentFile { + /** + * @minLengt 1 + * @maxLength 255 + */ + name: string | null; + + /** + * @minLength 1 + * @maxLength 8 + */ + extension: string | null; + + /** + * @format uri + */ + url: string; +} diff --git a/test/features/route-human/src/api/structures/IPerformance.ts b/test/features/route-human/src/api/structures/IPerformance.ts new file mode 100644 index 000000000..22b8f2840 --- /dev/null +++ b/test/features/route-human/src/api/structures/IPerformance.ts @@ -0,0 +1,10 @@ +/** + * Performance info. + * + * @author Samchon + */ +export interface IPerformance { + cpu: NodeJS.CpuUsage; + memory: NodeJS.MemoryUsage; + resource: NodeJS.ResourceUsage; +} diff --git a/test/features/route-human/src/api/structures/ISystem.ts b/test/features/route-human/src/api/structures/ISystem.ts new file mode 100644 index 000000000..0e135bede --- /dev/null +++ b/test/features/route-human/src/api/structures/ISystem.ts @@ -0,0 +1,81 @@ +/** + * System Information. + * + * @author Jeongho Nam + */ +export interface ISystem { + /** + * Random Unique ID. + */ + uid: number; + + /** + * `process.argv` + */ + arguments: string[]; + + /** + * Git commit info. + */ + commit: ISystem.ICommit; + + /** + * `package.json` + */ + package: ISystem.IPackage; + + /** + * Creation time of this server. + */ + created_at: string; +} + +export namespace ISystem { + /** + * Git commit info. + */ + export interface ICommit { + shortHash: string; + branch: string; + hash: string; + subject: string; + sanitizedSubject: string; + body: string; + author: ICommit.IUser; + committer: ICommit.IUser; + authored_at: string; + commited_at: string; + notes?: string; + tags: string[]; + } + export namespace ICommit { + /** + * Git user account info. + */ + export interface IUser { + name: string; + email: string; + } + } + + /** + * NPM package info. + */ + export interface IPackage { + name: string; + version: string; + description: string; + main?: string; + typings?: string; + scripts: Record; + repository: { type: "git"; url: string }; + author: string; + license: string; + bugs: { url: string }; + homepage: string; + devDependencies?: Record; + dependencies: Record; + publishConfig?: { registry: string }; + files?: string[]; + } +} diff --git a/test/features/route-human/src/controllers/HealthController.ts b/test/features/route-human/src/controllers/HealthController.ts new file mode 100644 index 000000000..68f4e59cf --- /dev/null +++ b/test/features/route-human/src/controllers/HealthController.ts @@ -0,0 +1,9 @@ +import core from "@nestia/core"; +import { Controller } from "@nestjs/common"; + +@Controller("health") +export class HealthController { + @core.HumanRoute() + @core.TypedRoute.Get() + public get(): void {} +} diff --git a/test/features/route-human/src/controllers/PerformanceController.ts b/test/features/route-human/src/controllers/PerformanceController.ts new file mode 100644 index 000000000..47f47d159 --- /dev/null +++ b/test/features/route-human/src/controllers/PerformanceController.ts @@ -0,0 +1,17 @@ +import core from "@nestia/core"; +import { Controller } from "@nestjs/common"; + +import { IPerformance } from "@api/lib/structures/IPerformance"; + +@Controller("performance") +export class PerformanceController { + @core.HumanRoute() + @core.TypedRoute.Get() + public async get(): Promise { + return { + cpu: process.cpuUsage(), + memory: process.memoryUsage(), + resource: process.resourceUsage(), + }; + } +} diff --git a/test/features/route-human/src/controllers/TypedRouteController.ts b/test/features/route-human/src/controllers/TypedRouteController.ts new file mode 100644 index 000000000..5c3ce4bf5 --- /dev/null +++ b/test/features/route-human/src/controllers/TypedRouteController.ts @@ -0,0 +1,18 @@ +import core from "@nestia/core"; +import { Controller } from "@nestjs/common"; +import typia from "typia"; + +import { IBbsArticle } from "@api/lib/structures/IBbsArticle"; + +@Controller("route") +export class TypedRouteController { + @core.TypedRoute.Get("random") + public async random(): Promise { + return { + ...typia.random(), + ...{ + dummy: 1, + }, + }; + } +} diff --git a/test/features/route-human/src/test/features/test_human_route.ts b/test/features/route-human/src/test/features/test_human_route.ts new file mode 100644 index 000000000..46379b0e7 --- /dev/null +++ b/test/features/route-human/src/test/features/test_human_route.ts @@ -0,0 +1,33 @@ +import { TestValidator } from "@nestia/e2e"; +import { OpenApi } from "@samchon/openapi"; +import { HttpLlm } from "@samchon/openapi/lib/HttpLlm"; +import { IHttpLlmApplication } from "@samchon/openapi/lib/structures/IHttpLlmApplication"; +import { IHttpLlmFunction } from "@samchon/openapi/lib/structures/IHttpLlmFunction"; +import cp from "child_process"; +import fs from "fs"; + +export const test_human_route = async (): Promise => { + if (fs.existsSync(LOCATION) === false) + cp.execSync(`npx nestia swagger`, { + stdio: "ignore", + cwd: LOCATION, + }); + const document: OpenApi.IDocument = JSON.parse( + await fs.promises.readFile(LOCATION, "utf8"), + ); + TestValidator.equals("human")( + document.paths?.["/performance"]?.get?.["x-samchon-human"], + )(true); + + const application: IHttpLlmApplication<"chatgpt"> = HttpLlm.application({ + model: "chatgpt", + document, + }); + const func: IHttpLlmFunction<"chatgpt"> | undefined = + application.functions.find( + (func) => func.method === "get" && func.path === "/performance", + ); + TestValidator.equals("excluded")(func)(undefined); +}; + +const LOCATION = `${__dirname}/../../../swagger.json`; diff --git a/test/features/route-human/src/test/index.ts b/test/features/route-human/src/test/index.ts new file mode 100644 index 000000000..7e8f43d54 --- /dev/null +++ b/test/features/route-human/src/test/index.ts @@ -0,0 +1,47 @@ +import { DynamicExecutor } from "@nestia/e2e"; + +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 elapsed: number = + new Date(exec.completed_at).getTime() - + new Date(exec.started_at).getTime(); + console.log(` - ${exec.name}: ${elapsed.toLocaleString()} ms`); + }, + }); + await server.close(); + + const exceptions: Error[] = report.executions + .filter((exec) => exec.error !== null) + .map((exec) => exec.error!); + if (exceptions.length === 0) { + console.log("Success"); + console.log("Elapsed time", report.time.toLocaleString(), `ms`); + } else { + for (const exp of exceptions) console.log(exp); + console.log("Failed"); + console.log("Elapsed time", report.time.toLocaleString(), `ms`); + process.exit(-1); + } +} +main().catch((exp) => { + console.log(exp); + process.exit(-1); +}); diff --git a/test/features/route-human/swagger.json b/test/features/route-human/swagger.json new file mode 100644 index 000000000..cef99093b --- /dev/null +++ b/test/features/route-human/swagger.json @@ -0,0 +1 @@ +{"openapi":"3.1.0","servers":[{"url":"https://github.com/samchon/nestia","description":"insert your server url"}],"info":{"version":"1.0.0","title":"@samchon/nestia-test","description":"Test program of Nestia","license":{"name":"MIT"}},"paths":{"/health":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{}}}},"x-samchon-accessor":["health","get"],"x-samchon-controller":"HealthController","x-samchon-human":true}},"/performance":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IPerformance"}}}}},"x-samchon-accessor":["performance","get"],"x-samchon-controller":"PerformanceController","x-samchon-human":true}},"/route/random":{"get":{"tags":[],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBbsArticle"}}}}},"x-samchon-accessor":["route","random"],"x-samchon-controller":"TypedRouteController"}}},"components":{"schemas":{"IPerformance":{"type":"object","properties":{"cpu":{"$ref":"#/components/schemas/process.global.NodeJS.CpuUsage"},"memory":{"$ref":"#/components/schemas/process.global.NodeJS.MemoryUsage"},"resource":{"$ref":"#/components/schemas/process.global.NodeJS.ResourceUsage"}},"required":["cpu","memory","resource"],"description":"Performance info."},"process.global.NodeJS.CpuUsage":{"type":"object","properties":{"user":{"type":"number"},"system":{"type":"number"}},"required":["user","system"]},"process.global.NodeJS.MemoryUsage":{"type":"object","properties":{"rss":{"type":"number"},"heapTotal":{"type":"number"},"heapUsed":{"type":"number"},"external":{"type":"number"},"arrayBuffers":{"type":"number"}},"required":["rss","heapTotal","heapUsed","external","arrayBuffers"]},"process.global.NodeJS.ResourceUsage":{"type":"object","properties":{"fsRead":{"type":"number"},"fsWrite":{"type":"number"},"involuntaryContextSwitches":{"type":"number"},"ipcReceived":{"type":"number"},"ipcSent":{"type":"number"},"majorPageFault":{"type":"number"},"maxRSS":{"type":"number"},"minorPageFault":{"type":"number"},"sharedMemorySize":{"type":"number"},"signalsCount":{"type":"number"},"swappedOut":{"type":"number"},"systemCPUTime":{"type":"number"},"unsharedDataSize":{"type":"number"},"unsharedStackSize":{"type":"number"},"userCPUTime":{"type":"number"},"voluntaryContextSwitches":{"type":"number"}},"required":["fsRead","fsWrite","involuntaryContextSwitches","ipcReceived","ipcSent","majorPageFault","maxRSS","minorPageFault","sharedMemorySize","signalsCount","swappedOut","systemCPUTime","unsharedDataSize","unsharedStackSize","userCPUTime","voluntaryContextSwitches"]},"IBbsArticle":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string","minLength":3,"maxLength":50},"body":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/IAttachmentFile"}},"created_at":{"type":"string","format":"date-time"}},"required":["id","title","body","files","created_at"]},"IAttachmentFile":{"type":"object","properties":{"name":{"oneOf":[{"type":"null"},{"type":"string","maxLength":255}]},"extension":{"oneOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":8}]},"url":{"type":"string","format":"uri"}},"required":["name","extension","url"]}},"securitySchemes":{"bearer":{"type":"apiKey"}}},"tags":[],"x-samchon-emended":true} \ No newline at end of file diff --git a/test/features/route-human/tsconfig.json b/test/features/route-human/tsconfig.json new file mode 100644 index 000000000..c33dfa28f --- /dev/null +++ b/test/features/route-human/tsconfig.json @@ -0,0 +1,98 @@ +{ + "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" }, + ], + } + } \ No newline at end of file