Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Definitions<T, C, K>

Type parameters

  • T

  • C

  • K: keyof T

Hierarchy

  • Definitions

Index

Properties

Optional authorize

authorize: undefined | ((context: CrudContext<T, C, K>) => PromiseLike<any> | any)

Reject access to any given handler based on CrudContext. This method is called before each handler is finished. To reject access, throw Error. Override the method for custom ACL or validation.

Optional controller

controller: CrudController<T, C, K>

Optional create

create: undefined | ((context: CreateContext<T, C>) => PromiseLike<T>)

Create entity from data (stored in CreateContext) Implement to use createHandler

Optional createNotFoundError

createNotFoundError: undefined | (() => Error)

Override to throw custom error when resource not found.

Optional delete

delete: undefined | ((context: DeleteContext<T, C, K>) => PromiseLike<any>)

Delete entity (fetched in DeleteContext) Implement to use deleteHandler

Optional detail

detail: undefined | ((context: Omit<DetailContext<T, C, K>, "entity">) => PromiseLike<T>)

Find entity by id (stored in ReadContext) Implement to use detailHandler

Optional getOptions

getOptions: undefined | ((operation: Operation) => PromiseLike<any> | any)

Optional idKey

idKey: K

Optional list

list: undefined | ((context: ListContext<T, C>) => PromiseLike<T[]>)

List entities, optionally filter (filters stored in ListContext) Implement to use listHandler

Optional options

options: undefined | { allowedOperations?: Operation[] }

Optional postprocessData

postprocessData: undefined | ((returnValue: any, context: CrudContext<T, C, K>) => PromiseLike<any> | any)

Process data coming from the service.

Optional processData

processData: undefined | ((data: any, ctx: DataContext<T, C>) => PromiseLike<any> | any)

This method processes any incoming data coming from user. Data processing is called for Create, Update and List (filters). Override the method for custom data transformation.

Optional repository

repository: CrudRepository<T, K>

Optional setDefaults

setDefaults: undefined | ((data: any, ctx: DataContext<T, C>) => PromiseLike<any> | any)

This method sets the defaults for data or filters coming from user. Method is called for Create, Update and List.

Optional update

update: undefined | ((context: UpdateContext<T, C>) => PromiseLike<T>)

Update entity with new data (both in UpdateContext) Implement to use updateHandler

Generated using TypeDoc