Options
All
  • Public
  • Public/Protected
  • All
Menu

ts-framework (v1.0.0-rc.1)

Index

Type aliases

HttpCode

Variables

BASE_CTRLS_PATH

BASE_CTRLS_PATH: string = path.join(__dirname, ctrl_path)

BASE_FILTERS_PATH

BASE_FILTERS_PATH: string = path.join(__dirname, filter_path)

Delete

Delete: Function = routeDecoratorFactory('delete')

The @Delete route decorator.

type

{Function}

param

The route to be assigned to the decorated method.

param

The filters to be called before the decorated method.

Get

Get: Function = routeDecoratorFactory('get')

The @Get route decorator.

type

{Function}

param

The route to be assigned to the decorated method.

param

The filters to be called before the decorated method.

Logger

Logger: LoggerInstance = SimpleLogger.getInstance()

Post

Post: Function = routeDecoratorFactory('post')

The @Post route decorator.

type

{Function}

param

The route to be assigned to the decorated method.

param

The filters to be called before the decorated method.

Put

Put: Function = routeDecoratorFactory('put')

The @Put route decorator.

type

{Function}

param

The route to be assigned to the decorated method.

param

The filters to be called before the decorated method.

SENTRY_RELEASE

SENTRY_RELEASE: any = process.env.SENTRY_RELEASE ? process.env.SENTRY_RELEASE : (() => {try {return Git.long();} catch (error) {}})()

Schema

Schema: Schema = mongoose.Schema

ctrl_path

ctrl_path: "../../../api/controllers" = "../../../api/controllers"

filter_path

filter_path: "../../../api/filters" = "../../../api/filters"

Functions

AssertionHelper

  • AssertionHelper(fn: function): any
  • Wraps function to handle assertions as promises.

    Parameters

    • fn: function

      The function with assertions

        • (req: any, res: any): void
        • Parameters

          • req: any
          • res: any

          Returns void

    Returns any

Controller

  • Controller(route?: string, filters?: Function[]): controllerDecorator
  • The @Controller decorator.

    Parameters

    • Optional route: string

      The route to be assigned to all methods of decorated class.

    • Default value filters: Function[] = []

      The filters to be called before all methods of decorated class.

    Returns controllerDecorator

Model

  • Model(name: string, schema?: Schema): controllerDecorator
  • model

    The decorator for assigning a Schema to a Mongoose Model.

    Parameters

    • name: string

      The mongoose model name

    • Optional schema: Schema

      The mongoode schema

    Returns controllerDecorator

asyncMiddleware

  • asyncMiddleware(functions: Function | Function[]): (Anonymous function)[]
  • Parameters

    • functions: Function | Function[]

    Returns (Anonymous function)[]

legacyParams

  • legacyParams(req: Request, res: Response, next: Function): void
  • Parameters

    • req: Request
    • res: Response
    • next: Function

    Returns void

maskAuthUrl

  • maskAuthUrl(url: any): string
  • Utility function to mask authentication from URLs.

    Parameters

    • url: any

      The url to be masked

    Returns string

routeDecoratorFactory

  • routeDecoratorFactory(method: any): Function
  • Parameters

    • method: any

    Returns Function

Generated using TypeDoc