Skip to content

How to use Custom Command in addAPLExecuteCommandsDirective #85

Description

@ysak-y

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Expected Behavior

Can use User-defined Command in addAPLExecuteCommandsDirective.

Current Behavior

When I try to set User-defined Command to command args of addAPLExecuteCommandsDirective, it reports type error.

      responseBuilder.addAPLExecuteCommandsDirective("MyTemplate", [
        {
          type: "myCommand", <- type error!!
        },
      ]);

Because addAPLExecuteCommandsDirective expects interfaces.alexa.presentation.apl.Command[] for its argument but Command type only accept built-in commands!!

https://github.com/alexa/ask-sdk-controls/blob/develop/src/responseGeneration/ControlResponseBuilder.ts#L306
https://github.com/alexa/alexa-apis-for-nodejs/blob/master/ask-sdk-model/index.ts#L1172

APL allows developer to define the custom command.

https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/apl-user-commands.html

Possible Solution

The easiest way is removeCommand[]type. But I'm not sure whether it is the best...

Steps to Reproduce (for bugs)

Copy following code and paste it under render method of the Act.

      responseBuilder.addAPLExecuteCommandsDirective("MyTemplate", [
        {
          type: "myCommand", <- type error!!
        },
      ]);

Context

To implement interactive APL document, User-defined Command is very important. It keeps DRY and can debug easily.

Your Environment

  • ASK SDK Controls used: 0.6.1
  • Operating System and version: macOS 11.6

Node.js and NPM Info

  • Node.js version used for development: v14.17.3
  • NPM version used for development: 6.14.13

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions