Options
All
  • Public
  • Public/Protected
  • All
Menu

ASK SDK for Node.js

Index

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

LambdaHandler

LambdaHandler: function

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 declaration

    • (requestEnvelope: RequestEnvelope, context: any, callback: function): void
    • Parameters

      • requestEnvelope: RequestEnvelope
      • context: any
      • callback: function
          • (err: Error, result?: any): void
          • Parameters

            • err: Error
            • Optional result: any

            Returns void

      Returns void

ObjectKeyGenerator

ObjectKeyGenerator: function

Type definition of function used by S3PersistenceAdapter to extract attributes id from {@link RequestEnvelope}.

Type declaration

    • (requestEnvelope: RequestEnvelope): string
    • Parameters

      • requestEnvelope: RequestEnvelope

      Returns string

PartitionKeyGenerator

PartitionKeyGenerator: function

Type definition of function used by DynamoDbPersistenceAdapter to extract attributes id from {@link RequestEnvelope}.

Type declaration

    • (requestEnvelope: RequestEnvelope): string
    • Parameters

      • requestEnvelope: RequestEnvelope

      Returns string

ViewportDpiGroup

ViewportDpiGroup: "XLOW" | "LOW" | "MEDIUM" | "HIGH" | "XHIGH" | "XXHIGH"

ViewportOrientation

ViewportOrientation: "EQUAL" | "LANDSCAPE" | "PORTRAIT"

ViewportProfile

ViewportProfile: "HUB-ROUND-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"

ViewportSizeGroup

ViewportSizeGroup: "XSMALL" | "SMALL" | "MEDIUM" | "LARGE" | "XLARGE"

Variables

Const StateString

StateString: unique symbol = Symbol('StateString')

Const ViewportDpiGroupOrder

ViewportDpiGroupOrder: ViewportDpiGroup[] = [ 'XLOW', 'LOW', 'MEDIUM', 'HIGH', 'XHIGH', 'XXHIGH']

Const ViewportSizeGroupOrder

ViewportSizeGroupOrder: ViewportSizeGroup[] = [ 'XSMALL', 'SMALL', 'MEDIUM', 'LARGE', 'XLARGE']

Let dynamoDbPersistenceAdapter

dynamoDbPersistenceAdapter: DynamoDbPersistenceAdapter

Functions

CreateStateHandler

EmitEvent

  • EmitEvent(): void

EmitWithState

  • EmitWithState(): void

Const EventParser

  • EventParser(event: RequestEnvelope): string

IsObject

  • IsObject(obj: any): boolean

IsOverridden

  • IsOverridden(name: string): boolean

ValidateRequest

  • ValidateRequest(): void

Private arrayToObjectHeader

  • arrayToObjectHeader(header: Array<object>): object
  • Converts the header array in {@link services.ApiClientRequest} to compatible JSON object.

    Parameters

    • header: Array<object>

    Returns object

    header object to pass into HTTP client

    • [key: string]: string[]

createAskSdkError

  • createAskSdkError(errorScope: string, errorMessage: string): Error

createAskSdkUserAgent

  • createAskSdkUserAgent(packageVersion: string, customUserAgent: string): string

escapeXmlCharacters

  • escapeXmlCharacters(input: string): string

getAccountLinkingAccessToken

  • getAccountLinkingAccessToken(requestEnvelope: RequestEnvelope): string

getApiAccessToken

  • getApiAccessToken(requestEnvelope: RequestEnvelope): string

getDeviceId

  • getDeviceId(requestEnvelope: RequestEnvelope): string

getDialogState

  • getDialogState(requestEnvelope: RequestEnvelope): string

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 {@link IntentRequest}.

    Parameters

    • requestEnvelope: RequestEnvelope

    Returns string

getLocale

  • getLocale(requestEnvelope: RequestEnvelope): string

getRequestType

  • getRequestType(requestEnvelope: RequestEnvelope): string

getSlot

  • getSlot(requestEnvelope: RequestEnvelope, slotName: string): Slot
  • Returns the {@link Slot} for the given slot name from the request.

    This method attempts to retrieve the requested {@link Slot} from the incoming request. If the slot does not exist in the request, a null value will be returned.

    Parameters

    • requestEnvelope: RequestEnvelope
    • slotName: string

    Returns Slot

getSlotValue

  • getSlotValue(requestEnvelope: RequestEnvelope, slotName: string): string
  • Returns the value from the given {@link Slot} in the request.

    This method attempts to retrieve the requested {@link Slot}'s value from the incoming request. If the slot does not exist in the request, a null value will be returned.

    Parameters

    • requestEnvelope: RequestEnvelope
    • slotName: string

    Returns string

getSupportedInterfaces

  • getSupportedInterfaces(requestEnvelope: RequestEnvelope): SupportedInterfaces
  • Retrieves the {@link 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.

    Parameters

    • requestEnvelope: RequestEnvelope

    Returns SupportedInterfaces

getViewportDpiGroup

getViewportOrientation

getViewportProfile

getViewportSizeGroup

handler

  • handler(event: RequestEnvelope, context: any, callback?: function): Adapter
  • Parameters

    • event: RequestEnvelope
    • context: any
    • Optional callback: function
        • (err: Error, result?: any): void
        • Parameters

          • err: Error
          • Optional result: any

          Returns void

    Returns Adapter

isBetween

  • isBetween(target: number, min: number, max: number): boolean

isNewSession

  • isNewSession(requestEnvelope: RequestEnvelope): boolean

Private objectToArrayHeader

  • objectToArrayHeader(header: object): Array<object>
  • Converts JSON header object to header array required for {services.ApiClientResponse}

    Parameters

    • header: object

      JSON header object returned by HTTP client

      • [key: string]: string | string[]

    Returns Array<object>

    []}

Object literals

Const ObjectKeyGenerators

ObjectKeyGenerators: object

Object containing implementations of ObjectKeyGenerator.

deviceId

  • deviceId(requestEnvelope: RequestEnvelope): string

userId

  • userId(requestEnvelope: RequestEnvelope): string

Const PartitionKeyGenerators

PartitionKeyGenerators: object

Object containing implementations of PartitionKeyGenerator.

deviceId

  • deviceId(requestEnvelope: RequestEnvelope): string

userId

  • userId(requestEnvelope: RequestEnvelope): string

Const ResponseHandlers

ResponseHandlers: object

:ask

  • :ask(speechOutput: string, repromptSpeech: string): void

:askWithCard

  • :askWithCard(speechOutput: string, repromptSpeech: string, cardTitle: string, cardContent: string, imageObj: object): void

:askWithLinkAccountCard

  • :askWithLinkAccountCard(speechOutput: string, repromptSpeech: string): void

:askWithPermissionCard

  • :askWithPermissionCard(speechOutput: string, repromptSpeech: string, permissions: string[]): void

:confirmIntent

  • :confirmIntent(speechOutput: string, repromptSpeech: string, updatedIntent: Intent): void

:confirmIntentWithCard

  • :confirmIntentWithCard(speechOutput: string, repromptSpeech: string, cardTitle: string, cardContent: string, updatedIntent: Intent, imageObj: object): void
  • Parameters

    • speechOutput: string
    • repromptSpeech: string
    • cardTitle: string
    • cardContent: string
    • updatedIntent: Intent
    • imageObj: object
      • [key: string]: string

    Returns void

:confirmSlot

  • :confirmSlot(slotName: string, speechOutput: string, repromptSpeech: string, updatedIntent: Intent): void

:confirmSlotWithCard

  • :confirmSlotWithCard(slotName: string, speechOutput: string, repromptSpeech: string, cardTitle: string, cardContent: string, updatedIntent: Intent, imageObj: object): void
  • Parameters

    • slotName: string
    • speechOutput: string
    • repromptSpeech: string
    • cardTitle: string
    • cardContent: string
    • updatedIntent: Intent
    • imageObj: object
      • [key: string]: string

    Returns void

:delegate

  • :delegate(updatedIntent: Intent): void

:elicitSlot

  • :elicitSlot(slotName: string, speechOutput: string, repromptSpeech: string, updatedIntent: Intent): void

:elicitSlotWithCard

  • :elicitSlotWithCard(slotName: string, speechOutput: string, repromptSpeech: string, cardTitle: string, cardContent: string, updatedIntent: Intent, imageObj: object): void
  • Parameters

    • slotName: string
    • speechOutput: string
    • repromptSpeech: string
    • cardTitle: string
    • cardContent: string
    • updatedIntent: Intent
    • imageObj: object
      • [key: string]: string

    Returns void

:responseReady

  • :responseReady(): void

:saveState

  • :saveState(forceSave: boolean): void

:saveStateError

  • :saveStateError(error: Error): void

:tell

  • :tell(speechOutput: string): void

:tellWithCard

  • :tellWithCard(speechOutput: string, cardTitle: string, cardContent: string, imageObj: object): void

:tellWithLinkAccountCard

  • :tellWithLinkAccountCard(speechOutput: string): void

:tellWithPermissionCard

  • :tellWithPermissionCard(speechOutput: string, permissions: string[]): void

Const SkillBuilders

SkillBuilders: object

Provider for skill builder. Provider for skill builders.

custom

standard

Const SkillEventHandlers

SkillEventHandlers: object

AlexaSkillEvent.SkillAccountLinked

  • AlexaSkillEvent.SkillAccountLinked(): void

AlexaSkillEvent.SkillDisabled

  • AlexaSkillEvent.SkillDisabled(): void

AlexaSkillEvent.SkillEnabled

  • AlexaSkillEvent.SkillEnabled(): void

AlexaSkillEvent.SkillPermissionAccepted

  • AlexaSkillEvent.SkillPermissionAccepted(): void

AlexaSkillEvent.SkillPermissionChanged

  • AlexaSkillEvent.SkillPermissionChanged(): void

Const directives

directives: object

VoicePlayerSpeakDirective

VoicePlayerSpeakDirective: VoicePlayerSpeakDirective

Const services

services: object

DeviceAddressService

DeviceAddressService: DeviceAddressService

DirectiveService

DirectiveService: DirectiveService

ListManagementService

ListManagementService: ListManagementService

Const templateBuilders

templateBuilders: object

BodyTemplate1Builder

BodyTemplate1Builder: BodyTemplate1Builder

BodyTemplate2Builder

BodyTemplate2Builder: BodyTemplate2Builder

BodyTemplate3Builder

BodyTemplate3Builder: BodyTemplate3Builder

BodyTemplate6Builder

BodyTemplate6Builder: BodyTemplate6Builder

BodyTemplate7Builder

BodyTemplate7Builder: BodyTemplate7Builder

ListItemBuilder

ListItemBuilder: ListItemBuilder

ListTemplate1Builder

ListTemplate1Builder: ListTemplate1Builder

ListTemplate2Builder

ListTemplate2Builder: ListTemplate2Builder

Const utils

utils: object

ImageUtils

ImageUtils: ImageUtils

TextUtils

TextUtils: TextUtils