Skip to content

Interface: EntrypointOptions ​

The options of the Entrypoint component: its controllers, middlewares and access rules, and the adapters receiving the requests of each channel. Any other key is the name of a channel and takes that channel's adapters (the packages providing a channel add their key to this interface by declaration merging); an adapter given under another channel's key, or a key which is neither an option nor an adapter, fails the entrypoint's initialization with an InvalidEntrypointAdapterException. Build them with buildEntrypoints.

Properties ​

cli? ​

optional cli?: CLIEntrypoint | EntrypointAdapter<CLIContext<{ }>> | (CLIEntrypoint | EntrypointAdapter<CLIContext<{ }>>)[]

The adapters (or 2.x entrypoint functions) receiving the CLI requests, such as commanderCLIEntrypoint().


cliActionGroups? ​

optional cliActionGroups?: Record<string, string>

The CLI action groups: each group id (used in the actions' groups option) mapped to its display name. An action in a group not listed here fails the entrypoint's initialization with an InvalidActionGroupException.

Default ​

ts
{}

controllers ​

controllers: IBaseObjectConstructor<Controller>[]

The controller classes whose actions the entrypoint serves. They are registered in the entrypoint's container; an action declared in a parent controller is served by each registered subclass.


http? ​

optional http?: HTTPEntrypoint | EntrypointAdapter<HTTPContext<{ }>> | (HTTPEntrypoint | EntrypointAdapter<HTTPContext<{ }>>)[]

The adapters (or 2.x entrypoint functions) receiving the HTTP requests, such as expressHTTPEntrypoint().


httpActionGroups? ​

optional httpActionGroups?: Record<string, string>

The HTTP action groups: each group id (used in the actions' groups option) mapped to its display name. An action in a group not listed here fails the entrypoint's initialization with an InvalidActionGroupException.

Default ​

ts
{}

middlewares? ​

optional middlewares?: MiddlewareDefinition[]

The middlewares run around every action of every channel, in order, before the ones of the adapter, of the controller class and of the action.

Default ​

ts
[]

queue? ​

optional queue?: EntrypointAdapter<QueueContext<{ }>> | EntrypointAdapter<QueueContext<{ }>>[]

The adapter delivering the messages of the queues to the @QueueAction actions (queueEntrypoint).


rules? ​

optional rules?: IBaseObjectConstructor<AccessControlRule<BaseContext<Record<string, any>>>>[]

The access control rule classes checked for the actions declared with acl: true, in order; a rule is skipped for the contexts not in its supportContextTypes.

Default ​

ts
[]

schedule? ​

optional schedule?: EntrypointAdapter<ScheduleContext<{ }>> | EntrypointAdapter<ScheduleContext<{ }>>[]

The schedule adapter running the actions declared with @Schedule (scheduleEntrypoint()); without it they never run.


service? ​

optional service?: ServiceEntrypoint | EntrypointAdapter<ServiceContext<{ }>> | (ServiceEntrypoint | EntrypointAdapter<ServiceContext<{ }>>)[]

The adapters (or 2.x entrypoint functions) receiving the service requests, such as socketIOServiceEntrypoint().


serviceActionGroups? ​

optional serviceActionGroups?: Record<string, string>

The service action groups: each group id (used in the actions' groups option) mapped to its display name. An action in a group not listed here fails the entrypoint's initialization with an InvalidActionGroupException.

Default ​

ts
{}

shutdownTimeout? ​

optional shutdownTimeout?: number

The time in milliseconds given to the requests in progress when the entrypoint stops; the ones still running after it are aborted, and fail with an EntrypointStoppedException.

Default ​

ts
30000

Released under the MIT License.