Skip to main content

HandlerService

Stentor API Reference


Stentor API Reference / stentor-models/src / HandlerService

Interface: HandlerService

Defined in: packages/stentor-models/src/Services/HandlerService.ts:10

The HandlerService provides the assistant application's dialog management with logic and content in the form of a Handler.

Methods​

get()​

get(id): Promise<Handler<Content, Data, Forward, Redirect>> | Promise<undefined>

Defined in: packages/stentor-models/src/Services/HandlerService.ts:17

Returns the handler for the provided ID or undefined if not found.

Parameters​

id​

string | { intentId: string; }

Either the ID as a string or an object that has the ID under intentId

Returns​

Promise<Handler<Content, Data, Forward, Redirect>> | Promise<undefined>


getMany()?​

optional getMany(ids): Promise<Handler<Content, Data, Forward, Redirect>[]>

Defined in: packages/stentor-models/src/Services/HandlerService.ts:28

Returns the handlers for the provided IDs in a single call. Handlers that cannot be found are omitted from the result rather than causing the whole call to fail.

Optional so that existing HandlerService implementations remain valid; implementations that do not override this can be batched by callers falling back to multiple get calls.

Parameters​

ids​

(string | { intentId: string; })[]

Array of IDs, each either a string or an object that has the ID under intentId

Returns​

Promise<Handler<Content, Data, Forward, Redirect>[]>