Saltar al contenido

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

Clase: DefaultRouteGenerator

Definido en: cli/src/routeGeneration/defaultRouteGenerator.ts:11

Generador de ruta predeterminado para el Express, Koa, y Hapi plantillas.

Extensión

Constructores

Constructor

ts
new DefaultRouteGenerator(metadata, options): DefaultRouteGenerator;

Definido en: cli/src/routeGeneration/defaultRouteGenerator.ts:14

Parámetros

metadata

Metadata

options

ExtendedRoutesConfig

Devoluciones

DefaultRouteGenerator

Anulaciones

AbstractRouteGenerator.constructor

Propiedades

metadata

ts
protected readonly metadata: Metadata;

Definido en: cli/src/routeGeneration/routeGenerator.ts:13

Inhered from

AbstractRouteGenerator.metadata


options

ts
protected readonly options: ExtendedRoutesConfig;

Definido en: cli/src/routeGeneration/routeGenerator.ts:14

Inhered from

AbstractRouteGenerator.options


pathTransformerFn

ts
pathTransformerFn: (path) => string;

Definido en: cli/src/routeGeneration/defaultRouteGenerator.ts:12

Parámetros

path

string

Devoluciones

string


template

ts
template: string;

Definido en: cli/src/routeGeneration/defaultRouteGenerator.ts:13

Métodos

buildContent()

ts
buildContent(middlewareTemplate): string;

Definido en: cli/src/routeGeneration/defaultRouteGenerator.ts:69

Renders the route template with the current metadata context.

Parámetros

middlewareTemplate

string

Devoluciones

string


buildContext()

ts
protected buildContext(): object;

Definido en: cli/src/routeGeneration/routeGenerator.ts:76

Construye los Handlebars contexto de plantilla utilizado por las plantillas de ruta predeterminadas.

Devoluciones

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;
minimalSwaggerConfig.bodyCoercion
ts
bodyCoercion: boolean;
minimalSwaggerConfig.noImplicit
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;

Inhered from

AbstractRouteGenerator.buildContext


buildEmbeddedSpecGeneratorArtifacts()

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

Definido en: cli/src/routeGeneration/routeGenerator.ts:157

Parámetros

useSpecPaths

boolean

Devoluciones

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

Inhered from

AbstractRouteGenerator.buildEmbeddedSpecGeneratorArtifacts


buildModels()

ts
buildModels(): Models;

Definido en: cli/src/routeGeneration/routeGenerator.ts:23

Construye los metadatos modelo de tiempo de ejecución consumidos por los manipuladores de rutas generados.

Devoluciones

Models

Inhered from

AbstractRouteGenerator.buildModels


buildParameterSchema()

ts
protected buildParameterSchema(source): ParameterSchema;

Definido en: cli/src/routeGeneration/routeGenerator.ts:199

Parámetros

source

Parameter

Devoluciones

ParameterSchema

Inhered from

AbstractRouteGenerator.buildParameterSchema


buildProperty()

ts
protected buildProperty(type): PropertySchema;

Definido en: cli/src/routeGeneration/routeGenerator.ts:219

Parámetros

type

Type

Devoluciones

PropertySchema

Inhered from

AbstractRouteGenerator.buildProperty


buildPropertySchema()

ts
protected buildPropertySchema(source): PropertySchema;

Definido en: cli/src/routeGeneration/routeGenerator.ts:188

Parámetros

source

Property

Devoluciones

PropertySchema

Inhered from

AbstractRouteGenerator.buildPropertySchema


GenerateCustomRoutes()

ts
GenerateCustomRoutes(): Promise<void>;

Definido en: cli/src/routeGeneration/defaultRouteGenerator.ts:37

Carga el archivo de plantilla seleccionado y genera la salida de la ruta.

Devoluciones

Promise<void>

Anulaciones

AbstractRouteGenerator.GenerateCustomRoutes


GenerateRoutes()

ts
GenerateRoutes(middlewareTemplate): Promise<void>;

Definido en: cli/src/routeGeneration/defaultRouteGenerator.ts:44

Escribe el archivo de ruta generado al disco.

Parámetros

middlewareTemplate

string

Devoluciones

Promise<void>


getRelativeImportPath()

ts
protected getRelativeImportPath(fileLocation): string;

Definido en: cli/src/routeGeneration/routeGenerator.ts:176

Parámetros

fileLocation

string

Devoluciones

string

Inhered from

AbstractRouteGenerator.getRelativeImportPath


pathTransformer()

ts
protected pathTransformer(path): string;

Definido en: cli/src/routeGeneration/defaultRouteGenerator.ts:64

Parámetros

path

string

Devoluciones

string

Anulaciones

AbstractRouteGenerator.pathTransformer


shouldWriteFile()

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

Definido en: cli/src/routeGeneration/routeGenerator.ts:263

Parámetros

fileName

string

content

string

Devoluciones

Promise<boolean>

Inhered from

AbstractRouteGenerator.shouldWriteFile

Contributors

No contributors

Changelog

No recent changes

Generación de OpenAPI, generación de rutas y validación en tiempo de ejecución con prioridad en TypeScript.