Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

AfterRequestHandler

AfterRequestHandler<TRequest>: (context: AfterRequestHandlerContext<TRequest>) => any

A handler, that is invoked after a controller method.

param

The context.

Type parameters

  • TRequest: express.Request = express.Request

Type declaration

ApiUrlScheme

ApiUrlScheme: "http" | "https"

Possible value for an API url scheme.

AuthorizeFailedHandler

AuthorizeFailedHandler<TRequest>: (context: AuthorizeFailedHandlerContext<TRequest>) => any

A handler, that is invoked, if authorization failed.

param

The context.

Type parameters

  • TRequest: express.Request = express.Request

Type declaration

AuthorizeHandler

AuthorizeHandler<TRequest>: (context: AuthorizeHandlerContext<TRequest>) => AuthorizeHandlerResult | PromiseLike<AuthorizeHandlerResult>

An authorization handler.

param

The context.

returns

The result.

Type parameters

  • TRequest: express.Request = express.Request

Type declaration

AuthorizeHandlerResult

AuthorizeHandlerResult: boolean | void | null | undefined | string

The result of an authorization handler.

ControllerClassConstructorArgsProvider

ControllerClassConstructorArgsProvider: (app: ExpressApp, routePath: string, router: express.Router, file: string) => ArrayLike<any>

A function that provides the arguments for the constructor of a controller class.

param

The underlying Express app / the router.

param

The route path.

param

The underlying Express for the controller instance.

param

The underlying file.

returns

The list of constructors.

Type declaration

    • (app: ExpressApp, routePath: string, router: express.Router, file: string): ArrayLike<any>
    • Parameters

      • app: ExpressApp
      • routePath: string
      • router: express.Router
      • file: string

      Returns ArrayLike<any>

ControllerClassNameProvider

ControllerClassNameProvider: (file: string, fullPath: string) => string

A function that provides the name for a controller class.

param

The underyling class file (relative path).

param

The underyling class file (full path).

returns

The class name.

Type declaration

    • (file: string, fullPath: string): string
    • Parameters

      • file: string
      • fullPath: string

      Returns string

ControllerCreatedEventHandler

ControllerCreatedEventHandler<TApp>: (args: ControllerCreatedEventArguments<TApp>) => any

A handler, that is invoked, after a controller instance has been created.

Type parameters

Type declaration

ControllerFileFilter

ControllerFileFilter: (file: string) => boolean

A preficate, which checks, if a controller (module) file should be included or not.

param

The full path of the file to check.

returns

Handle / include file or not.

Type declaration

    • (file: string): boolean
    • Parameters

      • file: string

      Returns boolean

ControllerFileLoadedEventHandler

ControllerFileLoadedEventHandler: (args: ControllerFileLoadedEventArguments) => void

Event handler, that is invoked, AFTER loading a file has been finished.

param

The arguments.

Type declaration

ControllerFileLoadingEventHandler

ControllerFileLoadingEventHandler: (args: ControllerFileLoadingEventArguments) => void

Event handler, that is invoked, BEFORE loading a file is going to start.

param

The arguments.

Type declaration

DecoratorFunction

DecoratorFunction: (target: any, propertyName: string, propertyInfo: PropertyDescriptor) => void

A decorator function.

param

The target.

param

The (property) name.

param

The property information.

Type declaration

    • (target: any, propertyName: string, propertyInfo: PropertyDescriptor): void
    • Parameters

      • target: any
      • propertyName: string
      • propertyInfo: PropertyDescriptor

      Returns void

ExpressApp

ExpressApp: express.Express | express.Router

A possible value for an express app.

InitControllersSwaggerOptionsValue

InitControllersSwaggerOptionsValue: InitControllersSwaggerOptions | false

A possible value for 'swagger' property of 'InitControllersSwaggerOptions' interface.

(false) indicates NOT to setup Swagger UI.

ObjectValidationFailedHandler

ObjectValidationFailedHandler<TRequest>: (context: ObjectValidationFailedHandlerContext<TRequest>) => any

A function that returns the response for a failed JSON validation.

param

The context.

Type parameters

  • TRequest: express.Request = express.Request

Type declaration

ObjectValidatorOptionsValue

ObjectValidatorOptionsValue: ObjectValidatorOptions | joi.AnySchema

A value for an object validator.

RequestErrorHandler

RequestErrorHandler<TRequest>: (context: RequestErrorHandlerContext<TRequest>) => any

Handles a request error.

param

The context.

Type parameters

  • TRequest: express.Request = express.Request

Type declaration

ResponseSerializer

ResponseSerializer<TRequest>: (context: ResponseSerializerContext<TRequest>) => any

A function, that handles the result of a request handler, serializes it and sends it to the requesting client.

param

The context.

Type parameters

  • TRequest: express.Request = express.Request

Type declaration

RouterPath

RouterPath: string | RegExp

A value for a router path.

SwaggerDefinitionList

SwaggerDefinitionList: {}

List of Swagger definitions.

Type declaration

  • [key: string]: any

SwaggerPathDefinition

SwaggerPathDefinition: any

A swagger path definition.

SwaggerPathDefinitionUpdater

SwaggerPathDefinitionUpdater: (context: SwaggerPathDefinitionUpdaterContext) => any

Updates a Swagger path definition.

param

The context.

Type declaration

SwaggerSecurityDefintion

SwaggerSecurityDefintion: {}

A security defintion.

Type declaration

  • [name: string]: any[]

Variables

Const AUTHORIZER_OPTIONS

AUTHORIZER_OPTIONS: typeof AUTHORIZER_OPTIONS = ...

Key for storing Authorize() options.

Const REQUEST_VALIDATORS

REQUEST_VALIDATORS: typeof REQUEST_VALIDATORS = ...

Index / key for request validators.

Const SWAGGER_INFO

SWAGGER_INFO: typeof SWAGGER_INFO = ...

Key for storing a SwaggerInfo document.

Const schema

schema: Root = ...

Namespace / sort link to 'joi' module, used by that library.

Functions

Authorize

CONNECT

DELETE

GET

HEAD

OPTIONS

PATCH

POST

PUT

Swagger

TRACE

createRouteAuthorizer

  • createRouteAuthorizer(controller: Controller, method: Function): express.RequestHandler
  • Creates a middleware for handling an 'Authorize()' decorator, if defined.

    Parameters

    • controller: Controller

      The controller.

    • method: Function

      The underlying router method.

    Returns express.RequestHandler

    The created middle.

getAfterRequestHandler

  • Returns the global handler, that is invoked after a controller method.

    Type parameters

    • TRequest: Request<TRequest> = Request

    Returns AfterRequestHandler<TRequest>

    The handler.

getAuthorizeFailedHandler

getAuthorizeHandler

getObjectValidationFailedHandler

getRequestErrorHandler

getResponseSerializer

getSwaggerPathDefinitionUpdater

initControllers

serializeForJSON

  • serializeForJSON(val: any): Promise<any>
  • Serializes a value for use as JSON response.

    Parameters

    • val: any

      The value to serialize.

    Returns Promise<any>

    The promise with the serialized value.

setAfterRequestHandler

  • setAfterRequestHandler<TRequest>(newHandler: AfterRequestHandler<TRequest> | undefined | null): void
  • Sets a global handler, that is invoked after a controller method.

    Type parameters

    • TRequest: Request<TRequest> = Request

    Parameters

    Returns void

setAuthorizeFailedHandler

  • Sets the global handler, which is invoked if a request authorization fails.

    Parameters

    Returns void

setAuthorizeHandler

  • Sets the global handler, which authorizes requests.

    Parameters

    Returns void

setObjectValidationFailedHandler

setRequestErrorHandler

  • Sets the global handler, which handles request errors.

    Parameters

    Returns void

setResponseSerializer

  • Sets a global response serializer.

    Parameters

    Returns void

setSwaggerPathDefinitionUpdater

setupSwaggerUI

Generated using TypeDoc