跳到内容

tsoa-next / @tsoa-next/cli / DefaultRouteGenerator

类: 默认旋转梯

定义如下: cli/src/routeGeneration/defaultRouteGenerator.ts:11

内置的默认路由生成器 Express, (中文(简体) ). Koa,以及 Hapi 模板。

扩展

构造器

构造器

ts
new DefaultRouteGenerator(metadata, options): DefaultRouteGenerator;

定义如下: cli/src/routeGeneration/defaultRouteGenerator.ts:14

参数

metadata

Metadata

options

ExtendedRoutesConfig

回返

DefaultRouteGenerator

覆盖

AbstractRouteGenerator.constructor

属性

metadata

ts
protected readonly metadata: Metadata;

定义如下: cli/src/routeGeneration/routeGenerator.ts:13

继承自

AbstractRouteGenerator.metadata


options

ts
protected readonly options: ExtendedRoutesConfig;

定义如下: cli/src/routeGeneration/routeGenerator.ts:14

继承自

AbstractRouteGenerator.options


pathTransformerFn

ts
pathTransformerFn: (path) => string;

定义如下: cli/src/routeGeneration/defaultRouteGenerator.ts:12

参数

path

string

回返

string


template

ts
template: string;

定义如下: cli/src/routeGeneration/defaultRouteGenerator.ts:13

方法

buildContent()

ts
buildContent(middlewareTemplate): string;

定义如下: cli/src/routeGeneration/defaultRouteGenerator.ts:69

将路由模板以当前元数据上下文格式化。

参数

middlewareTemplate

string

回返

string


buildContext()

ts
protected buildContext(): object;

定义如下: cli/src/routeGeneration/routeGenerator.ts:76

构建 Handlebars 默认路由模板所使用的模板上下文。

回返

object

authenticationModule
ts
authenticationModule: string | undefined;
basePath
ts
basePath: string = normalisedBasePath;
canImportByAlias
ts
canImportByAlias: boolean;
controllers
ts
controllers: object[];
embeddedSpecGeneratorArtifacts
ts
embeddedSpecGeneratorArtifacts: 
  | {
  spec: Spec;
  yaml: string;
}
  | undefined;
environment
ts
environment: ProcessEnv = process.env;
esm
ts
esm: boolean | undefined;
existingGetPaths
ts
existingGetPaths: string[];
iocModule
ts
iocModule: string | undefined;
minimalSwaggerConfig
ts
minimalSwaggerConfig: object;
最小Swagger Config.body 强制化
ts
bodyCoercion: boolean;
最小Swagger 配置. no Implicial 附加品
ts
noImplicitAdditionalProperties: "ignore" | "throw-on-extras" | "silently-remove-extras";
models
ts
models: Models;
multerOpts
ts
multerOpts: Options | undefined;
runtimeSpecConfig
ts
runtimeSpecConfig: 
  | {
  compilerOptions?: Record<string, unknown>;
  defaultNumberType?: "double" | "float" | "integer" | "long";
  ignore?: string[];
  metadata: Metadata;
  spec: SpecConfig & object;
}
  | undefined;
useFileUploads
ts
useFileUploads: boolean;
useSecurity
ts
useSecurity: boolean;
useSpecPaths
ts
useSpecPaths: boolean;

继承自

AbstractRouteGenerator.buildContext


buildEmbeddedSpecGeneratorArtifacts()

ts
protected buildEmbeddedSpecGeneratorArtifacts(useSpecPaths): 
  | {
  spec: Spec;
  yaml: string;
}
  | undefined;

定义如下: cli/src/routeGeneration/routeGenerator.ts:157

参数

useSpecPaths

boolean

回返

| { spec: Spec; yaml: string; } | undefined

继承自

AbstractRouteGenerator.buildEmbeddedSpecGeneratorArtifacts


buildModels()

ts
buildModels(): Models;

定义如下: cli/src/routeGeneration/routeGenerator.ts:23

构建生成的路由处理器所消耗的运行时间模型元数据.

回返

Models

继承自

AbstractRouteGenerator.buildModels


buildParameterSchema()

ts
protected buildParameterSchema(source): ParameterSchema;

定义如下: cli/src/routeGeneration/routeGenerator.ts:199

参数

source

Parameter

回返

ParameterSchema

继承自

AbstractRouteGenerator.buildParameterSchema


buildProperty()

ts
protected buildProperty(type): PropertySchema;

定义如下: cli/src/routeGeneration/routeGenerator.ts:219

参数

type

Type

回返

PropertySchema

继承自

AbstractRouteGenerator.buildProperty


buildPropertySchema()

ts
protected buildPropertySchema(source): PropertySchema;

定义如下: cli/src/routeGeneration/routeGenerator.ts:188

参数

source

Property

回返

PropertySchema

继承自

AbstractRouteGenerator.buildPropertySchema


GenerateCustomRoutes()

ts
GenerateCustomRoutes(): Promise<void>;

定义如下: cli/src/routeGeneration/defaultRouteGenerator.ts:37

装入所选模板文件并生成路由输出。

回返

Promise<void>

覆盖

AbstractRouteGenerator.GenerateCustomRoutes


GenerateRoutes()

ts
GenerateRoutes(middlewareTemplate): Promise<void>;

定义如下: cli/src/routeGeneration/defaultRouteGenerator.ts:44

将生成的路由文件写入磁盘。

参数

middlewareTemplate

string

回返

Promise<void>


getRelativeImportPath()

ts
protected getRelativeImportPath(fileLocation): string;

定义如下: cli/src/routeGeneration/routeGenerator.ts:176

参数

fileLocation

string

回返

string

继承自

AbstractRouteGenerator.getRelativeImportPath


pathTransformer()

ts
protected pathTransformer(path): string;

定义如下: cli/src/routeGeneration/defaultRouteGenerator.ts:64

参数

path

string

回返

string

覆盖

AbstractRouteGenerator.pathTransformer


shouldWriteFile()

ts
protected shouldWriteFile(fileName, content): Promise<boolean>;

定义如下: cli/src/routeGeneration/routeGenerator.ts:263

参数

fileName

string

content

string

回返

Promise<boolean>

继承自

AbstractRouteGenerator.shouldWriteFile

贡献者

暂无相关贡献者

页面历史

暂无最近变更历史

以 TypeScript 为先的 OpenAPI 生成、路由生成与运行时验证。