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
new DefaultRouteGenerator(metadata, options): DefaultRouteGenerator;Definido en: cli/src/routeGeneration/defaultRouteGenerator.ts:14
Parámetros
metadata
Metadata
options
Devoluciones
DefaultRouteGenerator
Anulaciones
AbstractRouteGenerator.constructor
Propiedades
metadata
protected readonly metadata: Metadata;Definido en: cli/src/routeGeneration/routeGenerator.ts:13
Inhered from
AbstractRouteGenerator.metadata
options
protected readonly options: ExtendedRoutesConfig;Definido en: cli/src/routeGeneration/routeGenerator.ts:14
Inhered from
AbstractRouteGenerator.options
pathTransformerFn
pathTransformerFn: (path) => string;Definido en: cli/src/routeGeneration/defaultRouteGenerator.ts:12
Parámetros
path
string
Devoluciones
string
template
template: string;Definido en: cli/src/routeGeneration/defaultRouteGenerator.ts:13
Métodos
buildContent()
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()
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
authenticationModule: string | undefined;basePath
basePath: string = normalisedBasePath;canImportByAlias
canImportByAlias: boolean;controllers
controllers: object[];embeddedSpecGeneratorArtifacts
embeddedSpecGeneratorArtifacts:
| {
spec: Spec;
yaml: string;
}
| undefined;environment
environment: ProcessEnv = process.env;esm
esm: boolean | undefined;existingGetPaths
existingGetPaths: string[];iocModule
iocModule: string | undefined;minimalSwaggerConfig
minimalSwaggerConfig: object;minimalSwaggerConfig.bodyCoercion
bodyCoercion: boolean;minimalSwaggerConfig.noImplicit
noImplicitAdditionalProperties: "ignore" | "throw-on-extras" | "silently-remove-extras";models
models: Models;multerOpts
multerOpts: Options | undefined;runtimeSpecConfig
runtimeSpecConfig:
| {
compilerOptions?: Record<string, unknown>;
defaultNumberType?: "double" | "float" | "integer" | "long";
ignore?: string[];
metadata: Metadata;
spec: SpecConfig & object;
}
| undefined;useFileUploads
useFileUploads: boolean;useSecurity
useSecurity: boolean;useSpecPaths
useSpecPaths: boolean;Inhered from
AbstractRouteGenerator.buildContext
buildEmbeddedSpecGeneratorArtifacts()
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()
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()
protected buildParameterSchema(source): ParameterSchema;Definido en: cli/src/routeGeneration/routeGenerator.ts:199
Parámetros
source
Parameter
Devoluciones
ParameterSchema
Inhered from
AbstractRouteGenerator.buildParameterSchema
buildProperty()
protected buildProperty(type): PropertySchema;Definido en: cli/src/routeGeneration/routeGenerator.ts:219
Parámetros
type
Type
Devoluciones
PropertySchema
Inhered from
AbstractRouteGenerator.buildProperty
buildPropertySchema()
protected buildPropertySchema(source): PropertySchema;Definido en: cli/src/routeGeneration/routeGenerator.ts:188
Parámetros
source
Property
Devoluciones
PropertySchema
Inhered from
AbstractRouteGenerator.buildPropertySchema
GenerateCustomRoutes()
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()
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()
protected getRelativeImportPath(fileLocation): string;Definido en: cli/src/routeGeneration/routeGenerator.ts:176
Parámetros
fileLocation
string
Devoluciones
string
Inhered from
AbstractRouteGenerator.getRelativeImportPath
pathTransformer()
protected pathTransformer(path): string;Definido en: cli/src/routeGeneration/defaultRouteGenerator.ts:64
Parámetros
path
string
Devoluciones
string
Anulaciones
AbstractRouteGenerator.pathTransformer
shouldWriteFile()
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
