Skip to content

Module: abstract

Index

References

Classes

Interfaces

Decorator Functions

References

Controllable

Controllable:


Validatable

Validatable:

Decorator Functions

Const affects

affects(...paths: Array‹string›): Function

Defined in lib/abstract/Controllable.ts:210

Decorator function that creates a partially defined instance of Controller. Defines Controller.dependents.

Parameters:

Name Type Description
...paths Array‹string› An array of path patterns representing the paths that should be recalculated when the resulting controller executes an operation.

Returns: Function


Const authorizer

authorizer(...authorizers: Array‹Function›): Function

Defined in lib/abstract/Controllable.ts:150

Decorator function that creates a partially defined instance of Controller. Defines Controller.authorizer.

Parameters:

Name Type Description
...authorizers Array‹Function An array of functions (args) => {...} that will authorize input arguments of requests to the resulting controller. Should return either an array containg arguments to be passed to the next authorizer, or any other value to abort the operation.

Returns: Function


Const endpoint

endpoint(value: string): Function

Defined in lib/abstract/Controllable.ts:134

Decorator function that creates a partially defined instance of Controller. Defines Controller.isRead, Controller.isCacheable, Controller.pattern.

An string defining an endpoint HTTP method and path pattern in the format METHOD /path/:param [NOCACHE].

Parameters:

Name Type
value string

Returns: Function


Const field

field(instance: Field, flags: number): Function

Defined in lib/abstract/Validatable.ts:32

Decorator function that adds a Field to the target class's schema using the provided instance of Field and the decorated property name.

Parameters:

Name Type Default Description
instance Field - An instance of field
flags number 0 Flags to be applied to the Field instance.

Returns: Function


Const instance

instance(source: Function): Function

Defined in lib/abstract/Controllable.ts:180

Decorator function that creates a partially defined instance of Controller. Defines Controller.instance.

Parameters:

Name Type Description
source Function A function which returns an instance of the derived class.

Returns: Function


Const schema

schema(source: Schema | object): Function

Defined in lib/abstract/Controllable.ts:165

Decorator function that creates a partially defined instance of Controller. Defines Controller.schema.

Parameters:

Name Type Description
source Schema | object An instance of Schema, or an object which can be used to construct an instance of Schema.

Returns: Function


Const uses

uses(...paths: Array‹string›): Function

Defined in lib/abstract/Controllable.ts:195

Decorator function that creates a partially defined instance of Controller. Defines Controller.dependencies.

Parameters:

Name Type Description
...paths Array‹string› An array of path patterns representing the paths that, when invalidated, should cause the outputs of the resulting controller's operations to be invalidated.

Returns: Function