ask-sdk-core
- Version 2.14.0
- Published
- 186 kB
- 1 dependency
- Apache-2.0 license
Install
npm i ask-sdk-core
yarn add ask-sdk-core
pnpm add ask-sdk-core
Overview
Core package for Alexa Skills Kit SDK
Index
Variables
Functions
- egressFromComponent()
- escapeXmlCharacters()
- getAccountLinkingAccessToken()
- getApiAccessToken()
- getDeviceId()
- getDialogState()
- getIntentName()
- getLocale()
- getRequest()
- getRequestType()
- getSimpleSlotValues()
- getSlot()
- getSlotValue()
- getSlotValueV2()
- getSupportedInterfaces()
- getUserId()
- getViewportDpiGroup()
- getViewportOrientation()
- getViewportProfile()
- getViewportSizeGroup()
- isNewSession()
- launchComponent()
Classes
Interfaces
ResponseBuilder
- addAudioPlayerClearQueueDirective()
- addAudioPlayerPlayDirective()
- addAudioPlayerStopDirective()
- addConfirmIntentDirective()
- addConfirmSlotDirective()
- addDelegateDirective()
- addDirective()
- addDirectiveToReprompt()
- addElicitSlotDirective()
- addExperimentTrigger()
- addHintDirective()
- addRenderTemplateDirective()
- addVideoAppLaunchDirective()
- getResponse()
- reprompt()
- speak()
- withApiResponse()
- withAskForPermissionsConsentCard()
- withCanFulfillIntent()
- withLinkAccountCard()
- withShouldEndSession()
- withSimpleCard()
- withStandardCard()
Type Aliases
Variables
variable SkillBuilders
const SkillBuilders: { custom(): CustomSkillBuilder };
Provider for skill builders.
variable ViewportDpiGroupOrder
const ViewportDpiGroupOrder: ViewportDpiGroup[];
variable ViewportSizeGroupOrder
const ViewportSizeGroupOrder: ViewportSizeGroup[];
Functions
function egressFromComponent
egressFromComponent: ( actionName: string, egressInput: { intentName?: string; handle?: (input: HandlerInput) => Response | Promise<Response>; }) => RequestHandler;
function escapeXmlCharacters
escapeXmlCharacters: (input: string) => string;
return the string with all invalid XML characters escaped
Parameter input
function getAccountLinkingAccessToken
getAccountLinkingAccessToken: (requestEnvelope: RequestEnvelope) => string;
Retrieves the account linking access token from the request.
The method retrieves the user's accessToken from the input request. Once a user successfully enables a skill and links their Alexa account to the skill, the input request will have the user's access token. A null value is returned if there is no access token in the input request. More information on this can be found here: https://developer.amazon.com/docs/account-linking/add-account-linking-logic-custom-skill.html
Parameter requestEnvelope
{string}
function getApiAccessToken
getApiAccessToken: (requestEnvelope: RequestEnvelope) => string;
Retrieves the API access token from the request.
The method retrieves the apiAccessToken from the input request, which has the encapsulated information of permissions granted by the user. This token can be used to call Alexa-specific APIs. More information about this can be found here: https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#system-object
The SDK automatically injects this value into service client instances retrieved from the services.ServiceClientFactory
Parameter requestEnvelope
{string}
function getDeviceId
getDeviceId: (requestEnvelope: RequestEnvelope) => string;
Retrieves the device ID from the request.
The method retrieves the deviceId property from the input request. This value uniquely identifies the device and is generally used as input for some Alexa-specific API calls. More information about this can be found here: https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#system-object
Parameter requestEnvelope
{string}
function getDialogState
getDialogState: (requestEnvelope: RequestEnvelope) => DialogState;
Retrieves the dialog state from the request.
The method retrieves the
dialogState
from the intent request, if the skill's interaction model includes a dialog model. This can be used to determine the current status of user conversation and return the appropriate dialog directives if the conversation is not yet complete. More information on dialog management can be found here: https://developer.amazon.com/docs/custom-skills/define-the-dialog-to-collect-and-confirm-required-information.htmlParameter requestEnvelope
{DialogState}
function getIntentName
getIntentName: (requestEnvelope: RequestEnvelope) => string;
Retrieves the name of the intent from the request.
The method retrieves the intent name from the input request, only if the input request is an IntentRequest.
Parameter requestEnvelope
{string}
function getLocale
getLocale: (requestEnvelope: RequestEnvelope) => string;
Retrieves the locale from the request.
The method returns the locale value present in the request. More information about the locale can be found here: https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#request-locale
Parameter requestEnvelope
{string}
function getRequest
getRequest: <T extends Request>(requestEnvelope: RequestEnvelope) => T;
Get request object.
We can set a specific type to the response by using the generics
Parameter requestEnvelope
{Request}
Example 1
const intentRequest = getRequest<IntentRequest>(requestEnvelope)console.log(intentRequest.intent.name)
function getRequestType
getRequestType: (requestEnvelope: RequestEnvelope) => string;
Retrieves the type of the request.
The method retrieves the request type of the input request. More information about the different request types are mentioned here: https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#request-body-parameters
Parameter requestEnvelope
{string}
function getSimpleSlotValues
getSimpleSlotValues: (slotValue: SlotValue) => SimpleSlotValue[];
Returns all the SimpleSlotValues from the given SlotValue.
Parameter slotValue
{SimpleSlotValue[]}
function getSlot
getSlot: (requestEnvelope: RequestEnvelope, slotName: string) => Slot;
function getSlotValue
getSlotValue: (requestEnvelope: RequestEnvelope, slotName: string) => string;
function getSlotValueV2
getSlotValueV2: ( requestEnvelope: RequestEnvelope, slotName: string) => SlotValue;
Returns the SlotValue from the given Slot in the request.
SlotValue will exist for slots using multiple slot value feature. And this method attempts to retrieve the requested Slot's SlotValue from the incoming request. If the slot or slot.slotValue does not exist in the request, null will be returned.
Parameter requestEnvelope
Parameter slotName
{SlotValue}
function getSupportedInterfaces
getSupportedInterfaces: ( requestEnvelope: RequestEnvelope) => SupportedInterfaces;
Retrieves the SupportedInterfaces from the request.
This method returns an object listing each interface that the device supports. For example, if supportedInterfaces includes AudioPlayer, then you know that the device supports streaming audio using the AudioPlayer interface.
Parameter requestEnvelope
{SupportedInterfaces}
function getUserId
getUserId: (requestEnvelope: RequestEnvelope) => string;
Retrieves the user ID from the request.
The method retrieves the userId property from the input request. This value uniquely identifies the user and is generally used as input for some Alexa-specific API calls. More information about this can be found here: https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#system-object
Parameter requestEnvelope
{string}
function getViewportDpiGroup
getViewportDpiGroup: (dpi: number) => ViewportDpiGroup;
return the ViewportDpiGroup of given dpi value
Parameter dpi
{ViewportDpiGroup}
function getViewportOrientation
getViewportOrientation: (width: number, height: number) => ViewportOrientation;
return the ViewportOrientation of given width and height value
Parameter width
Parameter height
{ViewportOrientation}
function getViewportProfile
getViewportProfile: (requestEnvelope: RequestEnvelope) => ViewportProfile;
return the ViewportProfile of given request envelope
Parameter requestEnvelope
{ViewportProfile}
function getViewportSizeGroup
getViewportSizeGroup: (size: number) => ViewportSizeGroup;
return the ViewportSizeGroup of given size value
Parameter size
{ViewportSizeGroup}
function isNewSession
isNewSession: (requestEnvelope: RequestEnvelope) => boolean;
Returns whether the request is a new session.
The method retrieves the new value from the input request's session, which indicates if it's a new session or not. More information can be found here : https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#session-object
Parameter requestEnvelope
function launchComponent
launchComponent: (options?: { utteranceSetName?: string; slots?: { [key: string]: Slot }; isUserUtteranceInput?: boolean;}) => dialog.DelegateRequestDirective;
Classes
class AttributesManagerFactory
class AttributesManagerFactory {}
Provider for attributes that can be stored on three levels: request, session and persistence.
method init
static init: (options: { requestEnvelope: RequestEnvelope; persistenceAdapter?: PersistenceAdapter;}) => AttributesManager;
class BaseSkillFactory
class BaseSkillFactory {}
method init
static init: () => BaseSkillBuilder;
class ComponentInterface
abstract class ComponentInterface {}
class CustomSkillFactory
class CustomSkillFactory {}
Provider for CustomSkillBuilder
method init
static init: () => CustomSkillBuilder;
class DefaultApiClient
class DefaultApiClient implements ApiClient {}
Default implementation of services.ApiClient which uses the native HTTP/HTTPS library of Node.JS.
method invoke
invoke: (request: ApiClientRequest) => Promise<ApiClientResponse>;
Dispatches a request to an API endpoint described in the request. An ApiClient is expected to resolve the Promise in the case an API returns a non-200 HTTP status code. The responsibility of translating a particular response code to an error lies with the caller to invoke.
Parameter request
request to dispatch to the ApiClient
Returns
{Promise<services.ApiClientResponse>} response from the ApiClient
class DelegateToIntentHandler
class DelegateToIntentHandler implements CustomSkillRequestHandler {}
class ImageHelper
class ImageHelper {}
Responsible for building image object using ask-sdk-model in Alexa skills kit display interface https://developer.amazon.com/docs/custom-skills/display-interface-reference.html#image-object-specifications.
property image
protected image: Image;
method addImageInstance
addImageInstance: ( url: string, size?: interfaces.display.ImageSize, widthPixels?: number, heightPixels?: number) => this;
Add image instance in image object
Parameter url
source of the image
Parameter size
size of the image. Accepted values: X_SMALL: Displayed within extra small containers SMALL: Displayed within small containers MEDIUM: Displayed within medium containers LARGE: Displayed within large containers X_LARGE Displayed within extra large containers By default, for Echo Show, size takes the value X_SMALL. If the other size values are included, then the order of precedence for displaying images begins with X_LARGE and proceeds downward, which means that larger images will be downscaled for display on Echo Show if provided. For the best user experience, include the appropriately sized image, and do not include larger images.
Parameter widthPixels
widthPixels of the image
Parameter heightPixels
heightPixels of the image
Returns
{ImageHelper}
method getImage
getImage: () => Image;
Returns
{Image}
method withDescription
withDescription: (description: string) => this;
Sets content description in image object
Parameter description
text used to describe the image for a screen reader
Returns
{ImageHelper}
class PlainTextContentHelper
class PlainTextContentHelper extends TextContentHelper {}
Responsible for building plain text content object using ask-sdk-model in Alexa skills kit display interface https://developer.amazon.com/docs/custom-skills/display-interface-reference.html#textcontent-object-specifications.
constructor
constructor();
method getTextContent
getTextContent: () => interfaces.display.TextContent;
Returns
{interfaces.display.TextContent}
class ResponseFactory
class ResponseFactory {}
Responsible for building JSON responses using ask-sdk-model as per the Alexa skills kit interface https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interface-reference#response-body-syntax.
method init
static init: () => ResponseBuilder;
class RichTextContentHelper
class RichTextContentHelper extends TextContentHelper {}
Responsible for building rich text content object using ask-sdk-model in Alexa skills kit display interface https://developer.amazon.com/docs/custom-skills/display-interface-reference.html#textcontent-object-specifications.
constructor
constructor();
method getTextContent
getTextContent: () => TextContent;
Returns
{interfaces.display.TextContent}
class Skill
class CustomSkill implements Skill<RequestEnvelope, ResponseEnvelope> {}
Top level container for request dispatcher.
constructor
constructor(skillConfiguration: CustomSkillConfiguration);
property apiClient
protected apiClient: ApiClient;
property customUserAgent
protected customUserAgent: string;
property persistenceAdapter
protected persistenceAdapter: PersistenceAdapter;
property requestDispatcher
protected requestDispatcher: RequestDispatcher<HandlerInput, Response>;
property skillId
protected skillId: string;
method appendAdditionalUserAgent
appendAdditionalUserAgent: (userAgent: string) => void;
Append additional user agent info
Parameter userAgent
method invoke
invoke: ( requestEnvelope: RequestEnvelope, context?: any) => Promise<ResponseEnvelope>;
Invokes the dispatcher to handler the request envelope and construct the handler input.
Parameter requestEnvelope
Parameter context
method supports
supports: (input: any, context?: any) => boolean;
Determines if the skill can support the specific request type.
Parameter input
Parameter context
class TextContentHelper
abstract class TextContentHelper {}
An abstract class responsible for building text content object using ask-sdk-model in Alexa skills kit display interface https://developer.amazon.com/docs/custom-skills/display-interface-reference.html#textcontent-object-specifications.
property primaryText
protected primaryText: string;
property secondaryText
protected secondaryText: string;
property tertiaryText
protected tertiaryText: string;
method getTextContent
abstract getTextContent: () => TextContent;
Returns
{interfaces.display.TextContent}
method withPrimaryText
withPrimaryText: (primaryText: string) => this;
Parameter primaryText
Returns
{this}
method withSecondaryText
withSecondaryText: (secondaryText: string) => this;
Parameter secondaryText
Returns
{this}
method withTertiaryText
withTertiaryText: (tertiaryText: string) => this;
Parameter tertiaryText
Returns
{this}
Interfaces
interface AttributesManager
interface AttributesManager {}
An interface handling three level attributes: request, session and persistence.
method deletePersistentAttributes
deletePersistentAttributes: () => Promise<void>;
Delete persistent attributes from the persistent layer if a persistence adapter is provided. {Promise}
method getPersistentAttributes
getPersistentAttributes: ( useSessionCache?: boolean, defaultAttributes?: { [key: string]: any }) => Promise<{ [key: string]: any }>;
Provides persistent attributes retrieved and cached from persistence adapter, provide false to useSessionCache to ignore values cached from previous invocations.
Parameter useSessionCache
Returns
{Promise<Object.<string, any>>}
method getRequestAttributes
getRequestAttributes: () => { [key: string]: any };
Provides request attributes for the request life cycle.
Returns
{Object.<string, any>}
method getSessionAttributes
getSessionAttributes: <T = { [key: string]: any }>() => T;
Provides session attributes extracted from request envelope.
Returns
{Object.<string, any>}
method savePersistentAttributes
savePersistentAttributes: () => Promise<void>;
Save persistent attributes to the persistence layer if a persistence adapter is provided. {Promise}
method setPersistentAttributes
setPersistentAttributes: (persistentAttributes: { [key: string]: any }) => void;
Overwrites and caches the persistent attributes value. Note no persistence layer calls are being made in this function.
Parameter persistentAttributes
Returns
{void}
method setRequestAttributes
setRequestAttributes: (requestAttributes: { [key: string]: any }) => void;
Overwrites the request attributes value.
Parameter requestAttributes
Returns
{void}
method setSessionAttributes
setSessionAttributes: (sessionAttributes: { [key: string]: any }) => void;
Overwrites the session attributes value.
Parameter sessionAttributes
Returns
{void}
interface BaseSkillBuilder
interface BaseSkillBuilder {}
An interface containing help functions to build a CustomSkill.
method addErrorHandler
addErrorHandler: ( matcher: (input: HandlerInput, error: Error) => Promise<boolean> | boolean, executor: (input: HandlerInput, error: Error) => Promise<Response> | Response) => this;
method addErrorHandlers
addErrorHandlers: (...errorHandlers: CustomSkillErrorHandler[]) => this;
method addRequestHandler
addRequestHandler: ( matcher: string | ((input: HandlerInput) => Promise<boolean> | boolean), executor: (input: HandlerInput) => Promise<Response> | Response) => this;
method addRequestHandlers
addRequestHandlers: (...requestHandlers: CustomSkillRequestHandler[]) => this;
method addRequestInterceptors
addRequestInterceptors: ( ...executors: ( | CustomSkillRequestInterceptor | ((input: HandlerInput) => Promise<void> | void) )[]) => this;
method addResponseInterceptors
addResponseInterceptors: ( ...executors: ( | CustomSkillResponseInterceptor | ((input: HandlerInput, response?: Response) => Promise<void> | void) )[]) => this;
method create
create: () => CustomSkill;
method getSkillConfiguration
getSkillConfiguration: () => CustomSkillConfiguration;
method lambda
lambda: () => LambdaHandler;
method withCustomUserAgent
withCustomUserAgent: (customUserAgent: string) => this;
method withSkillId
withSkillId: (skillId: string) => this;
interface CustomSkillBuilder
interface CustomSkillBuilder extends BaseSkillBuilder {}
An interface which helps building a customized skill.
method withApiClient
withApiClient: (apiClient: ApiClient) => this;
method withPersistenceAdapter
withPersistenceAdapter: (persistenceAdapter: PersistenceAdapter) => this;
interface ErrorHandler
interface CustomSkillErrorHandler extends ErrorHandler<HandlerInput, Response> {}
interface HandlerInput
interface HandlerInput {}
An interface that represents components passed into CustomSkillRequestHandler and CustomSkillErrorHandler.
property attributesManager
attributesManager: AttributesManager;
property context
context?: any;
property requestEnvelope
requestEnvelope: RequestEnvelope;
property responseBuilder
responseBuilder: ResponseBuilder;
property serviceClientFactory
serviceClientFactory?: ServiceClientFactory;
interface PersistenceAdapter
interface PersistenceAdapter {}
An interface for storing and retrieving persistent attributes from persistence tier given request envelope.
method deleteAttributes
deleteAttributes: (requestEnvelope: RequestEnvelope) => Promise<void>;
method getAttributes
getAttributes: ( requestEnvelope: RequestEnvelope) => Promise<{ [key: string]: any }>;
method saveAttributes
saveAttributes: ( requestEnvelope: RequestEnvelope, attributes: { [key: string]: any }) => Promise<void>;
interface RequestHandler
interface CustomSkillRequestHandler extends RequestHandler<HandlerInput, Response> {}
interface RequestInterceptor
interface CustomSkillRequestInterceptor extends RequestInterceptor<HandlerInput> {}
interface ResponseBuilder
interface ResponseBuilder {}
An interface which helps building a response.
method addAudioPlayerClearQueueDirective
addAudioPlayerClearQueueDirective: ( clearBehavior: interfaces.audioplayer.ClearBehavior) => this;
Adds an AudioPlayer ClearQueue directive - clear the queue without stopping the currently playing stream, or clear the queue and stop any currently playing stream.
Parameter clearBehavior
Describes the clear queue behavior. Accepted values: CLEAR_ENQUEUED: clears the queue and continues to play the currently playing stream CLEAR_ALL: clears the entire playback queue and stops the currently playing stream (if applicable).
Returns
{ResponseBuilder}
method addAudioPlayerPlayDirective
addAudioPlayerPlayDirective: ( playBehavior: interfaces.audioplayer.PlayBehavior, url: string, token: string, offsetInMilliseconds: number, expectedPreviousToken?: string, audioItemMetadata?: AudioItemMetadata) => this;
Adds an AudioPlayer play directive
Parameter playBehavior
Describes playback behavior. Accepted values: REPLACE_ALL: Immediately begin playback of the specified stream, and replace current and enqueued streams. ENQUEUE: Add the specified stream to the end of the current queue. This does not impact the currently playing stream. REPLACE_ENQUEUED: Replace all streams in the queue. This does not impact the currently playing stream.
Parameter url
Identifies the location of audio content at a remote HTTPS location. The audio file must be hosted at an Internet-accessible HTTPS endpoint. HTTPS is required, and the domain hosting the files must present a valid, trusted SSL certificate. Self-signed certificates cannot be used. The supported formats for the audio file include AAC/MP4, MP3, HLS, PLS and M3U. Bitrates: 16kbps to 384 kbps.
Parameter token
A token that represents the audio stream. This token cannot exceed 1024 characters
Parameter offsetInMilliseconds
The timestamp in the stream from which Alexa should begin playback. Set to 0 to start playing the stream from the beginning. Set to any other value to start playback from that associated point in the stream
Parameter expectedPreviousToken
A token that represents the expected previous stream. This property is required and allowed only when the playBehavior is ENQUEUE. This is used to prevent potential race conditions if requests to progress through a playlist and change tracks occur at the same time.
Parameter audioItemMetadata
Metadata that can be displayed on screen enabled devices
Returns
{ResponseBuilder}
method addAudioPlayerStopDirective
addAudioPlayerStopDirective: () => this;
Adds an AudioPlayer Stop directive - Stops the current audio Playback
Returns
{ResponseBuilder}
method addConfirmIntentDirective
addConfirmIntentDirective: (updatedIntent?: Intent) => this;
Adds a Dialog confirmIntent directive to response
Parameter updatedIntent
Returns
{ResponseBuilder}
method addConfirmSlotDirective
addConfirmSlotDirective: (slotToConfirm: string, updatedIntent?: Intent) => this;
Adds a Dialog confirmSlot directive to response
Parameter slotToConfirm
Parameter updatedIntent
Returns
{ResponseBuilder}
method addDelegateDirective
addDelegateDirective: (updatedIntent?: Intent) => this;
Adds a Dialog delegate directive to response
Parameter updatedIntent
Returns
{ResponseBuilder}
method addDirective
addDirective: (directive: Directive) => this;
Helper method for adding directives to responses
Parameter directive
the directive send back to Alexa device
Returns
{ResponseBuilder}
method addDirectiveToReprompt
addDirectiveToReprompt: (directive: Directive) => this;
Helper method for adding directives to reprompt
Parameter directive
the directive sent back to Alexa device
Returns
{ResponseBuilder}
method addElicitSlotDirective
addElicitSlotDirective: (slotToElicit: string, updatedIntent?: Intent) => this;
Adds a Dialog elicitSlot directive to response
Parameter slotToElicit
Parameter updatedIntent
Returns
{ResponseBuilder}
method addExperimentTrigger
addExperimentTrigger: (experimentId: string) => this;
Helper method for adding experimentation trigger to responses
Parameter experimentId
the id of the experiment that was triggered
Returns
{ResponseBuilder}
method addHintDirective
addHintDirective: (text: string) => this;
Adds a hint directive - show a hint on the screen of the echo show
Parameter text
plain text to show on the hint
Returns
{ResponseBuilder}
method addRenderTemplateDirective
addRenderTemplateDirective: (template: interfaces.display.Template) => this;
Adds a Display RenderTemplate Directive
Parameter template
Returns
{ResponseBuilder}
method addVideoAppLaunchDirective
addVideoAppLaunchDirective: ( source: string, title?: string, subtitle?: string) => this;
Adds a VideoApp play directive to play a video
Parameter source
Identifies the location of video content at a remote HTTPS location. The video file must be hosted at an Internet-accessible HTTPS endpoint.
Parameter title
(optional) title that can be displayed on VideoApp.
Parameter subtitle
(optional) subtitle that can be displayed on VideoApp.
Returns
{ResponseBuilder}
method getResponse
getResponse: () => Response;
Returns the response object
Returns
{Response}
method reprompt
reprompt: (repromptSpeechOutput: string, playBehavior?: ui.PlayBehavior) => this;
Has alexa listen for speech from the user. If the user doesn't respond within 8 seconds then has alexa reprompt with the provided reprompt speech
Parameter repromptSpeechOutput
Parameter playBehavior
Returns
{ResponseBuilder}
method speak
speak: (speechOutput: string, playBehavior?: ui.PlayBehavior) => this;
Has Alexa say the provided speech to the user
Parameter speechOutput
Parameter playBehavior
Returns
{ResponseBuilder}
method withApiResponse
withApiResponse: (apiResponse: any) => this;
Helper method for adding Api response in the response
Parameter apiResponse
Returns
{ResponseBuilder}
method withAskForPermissionsConsentCard
withAskForPermissionsConsentCard: (permissionArray: string[]) => this;
Renders an askForPermissionsConsent card
Parameter permissionArray
Returns
{ResponseBuilder}
method withCanFulfillIntent
withCanFulfillIntent: (canFulfillIntent: CanFulfillIntent) => this;
Adds canFulfillIntent to response.
Parameter canFulfillIntent
{ResponseBuilder}
method withLinkAccountCard
withLinkAccountCard: () => this;
Renders a link account card
Returns
{ResponseBuilder}
method withShouldEndSession
withShouldEndSession: (val: boolean) => this;
Sets shouldEndSession value to null/false/true
Parameter val
Returns
{ResponseBuilder}
method withSimpleCard
withSimpleCard: (cardTitle: string, cardContent: string) => this;
Renders a simple card with the following title and content
Parameter cardTitle
Parameter cardContent
Returns
{ResponseBuilder}
method withStandardCard
withStandardCard: ( cardTitle: string, cardContent: string, smallImageUrl?: string, largeImageUrl?: string) => this;
Renders a standard card with the following title, content and image
Parameter cardTitle
Parameter cardContent
Parameter smallImageUrl
Parameter largeImageUrl
Returns
{ResponseBuilder}
interface ResponseInterceptor
interface CustomSkillResponseInterceptor extends ResponseInterceptor<HandlerInput, Response> {}
interface SkillConfiguration
interface CustomSkillConfiguration extends RuntimeConfiguration<HandlerInput, Response> {}
An interfaces that represents the standard components needed to build CustomSkill.
property apiClient
apiClient?: services.ApiClient;
property customUserAgent
customUserAgent?: string;
property persistenceAdapter
persistenceAdapter?: PersistenceAdapter;
property skillId
skillId?: string;
Type Aliases
type LambdaHandler
type LambdaHandler = ( requestEnvelope: RequestEnvelope, context: any, callback: (err: Error, result?: any) => void) => void;
Type definition of LambdaHandler which contains inputs received in lambda function. https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html.
type ViewportDpiGroup
type ViewportDpiGroup = 'XLOW' | 'LOW' | 'MEDIUM' | 'HIGH' | 'XHIGH' | 'XXHIGH';
type ViewportOrientation
type ViewportOrientation = 'EQUAL' | 'LANDSCAPE' | 'PORTRAIT';
type ViewportProfile
type ViewportProfile = | 'HUB-ROUND-SMALL' | 'HUB-LANDSCAPE-SMALL' | 'HUB-LANDSCAPE-MEDIUM' | 'HUB-LANDSCAPE-LARGE' | 'MOBILE-LANDSCAPE-SMALL' | 'MOBILE-PORTRAIT-SMALL' | 'MOBILE-LANDSCAPE-MEDIUM' | 'MOBILE-PORTRAIT-MEDIUM' | 'TV-LANDSCAPE-XLARGE' | 'TV-PORTRAIT-MEDIUM' | 'TV-LANDSCAPE-MEDIUM' | 'UNKNOWN-VIEWPORT-PROFILE';
type ViewportSizeGroup
type ViewportSizeGroup = 'XSMALL' | 'SMALL' | 'MEDIUM' | 'LARGE' | 'XLARGE';
Package Files (29)
- dist/attributes/AttributesManager.d.ts
- dist/attributes/AttributesManagerFactory.d.ts
- dist/attributes/persistence/PersistenceAdapter.d.ts
- dist/components/ComponentInterface.d.ts
- dist/dispatcher/error/handler/CustomSkillErrorHandler.d.ts
- dist/dispatcher/request/handler/CustomSkillRequestHandler.d.ts
- dist/dispatcher/request/handler/DelegateToIntentHandler.d.ts
- dist/dispatcher/request/handler/HandlerInput.d.ts
- dist/dispatcher/request/interceptor/CustomSkillRequestInterceptor.d.ts
- dist/dispatcher/request/interceptor/CustomSkillResponseInterceptor.d.ts
- dist/index.d.ts
- dist/response/ImageHelper.d.ts
- dist/response/PlainTextContentHelper.d.ts
- dist/response/ResponseBuilder.d.ts
- dist/response/ResponseFactory.d.ts
- dist/response/RichTextContentHelper.d.ts
- dist/response/TextContentHelper.d.ts
- dist/service/DefaultApiClient.d.ts
- dist/skill/CustomSkill.d.ts
- dist/skill/CustomSkillConfiguration.d.ts
- dist/skill/SkillBuilders.d.ts
- dist/skill/factory/BaseSkillBuilder.d.ts
- dist/skill/factory/BaseSkillFactory.d.ts
- dist/skill/factory/CustomSkillBuilder.d.ts
- dist/skill/factory/CustomSkillFactory.d.ts
- dist/util/ComponentUtils.d.ts
- dist/util/RequestEnvelopeUtils.d.ts
- dist/util/SsmlUtils.d.ts
- dist/util/ViewportUtils.d.ts
Dependencies (1)
Dev Dependencies (17)
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/ask-sdk-core
.
- Markdown[](https://www.jsdocs.io/package/ask-sdk-core)
- HTML<a href="https://www.jsdocs.io/package/ask-sdk-core"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2505 ms. - Missing or incorrect documentation? Open an issue for this package.