Channel
Stentor API Reference / stentor-models/src / Channel
Interface: Channel
Defined in: packages/stentor-models/src/Channel/Channel.ts:19
Propertiesβ
nameβ
name:
string
Defined in: packages/stentor-models/src/Channel/Channel.ts:30
The name of the channel.
This must be alphanumeric characters only, dashes instead of spaces.
For example: "actions-on-google" or "alexa"
This is used in analytics and in some cases platform selection if the platform is provided in the URL as a query or path parameter.
requestβ
request:
Translator\<object,Request>
Defined in: packages/stentor-models/src/Channel/Channel.ts:44
Request translator (an instantiated class)
responseβ
response:
Translator\<RequestResponse,object>
Defined in: packages/stentor-models/src/Channel/Channel.ts:48
Response translator (an instantiated class)
builder()?β
optionalbuilder: (props) =>AbstractResponseBuilder
Defined in: packages/stentor-models/src/Channel/Channel.ts:54
Response builder, this is now deprecated in favor of providing a response translator.
Parametersβ
propsβ
object
Returnsβ
Deprecatedβ
Provide a response translator instead of a customer builder. This will be removed in the next major release.
nlu?β
optionalnlu:NLUService
Defined in: packages/stentor-models/src/Channel/Channel.ts:67
The NLU for the channel
hooks?β
optionalhooks:ChannelHooks
Defined in: packages/stentor-models/src/Channel/Channel.ts:71
Runtime hooks used by the channel to make any necessary checks or modifications
Methodsβ
test()?β
optionaltest(body):boolean
Defined in: packages/stentor-models/src/Channel/Channel.ts:40
Optional function that tests the incoming request to see if it is a request for the channel.
It returns true if the request is for the channel.
If one isn't provided, it will rely on the name to determine the channel.
Parametersβ
bodyβ
object
Returnsβ
boolean
capabilities()β
capabilities(
body):Device
Defined in: packages/stentor-models/src/Channel/Channel.ts:63
Determine the capabilities and contextual information related to the device the user is accessing the channel on.
Parametersβ
bodyβ
object
Returnsβ
handlerHook()?β
optionalhandlerHook(handler,event,context,callback,services):Promise\<void>
Defined in: packages/stentor-models/src/Channel/Channel.ts:81
Lambda event interceptor (right after the event)
Parametersβ
handlerβ
(event, context, callback) => Promise\<void>
Stentor handler function
eventβ
any
raw lambda event
contextβ
lambda context
callbackβ
lambda callback
servicesβ
userStorageService?β
appService?β
any
Returnsβ
Promise\<void>