Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Custom Command in addAPLExecuteCommandsDirective #85

Open
ysak-y opened this issue Sep 24, 2021 · 1 comment
Open

How to use Custom Command in addAPLExecuteCommandsDirective #85

ysak-y opened this issue Sep 24, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ysak-y
Copy link
Contributor

ysak-y commented Sep 24, 2021

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
@Shreyas-vgr Shreyas-vgr self-assigned this Sep 24, 2021
@Shreyas-vgr Shreyas-vgr added the bug Something isn't working label Sep 24, 2021
@Shreyas-vgr
Copy link
Contributor

Hi @ysak-y , thanks for the bug. I'll discuss the issue with my team and get back!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants