Code Monkey home page Code Monkey logo

amazon-alexa-skill-library's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

dlabas

amazon-alexa-skill-library's Issues

Extract session attribute handling from AlexaApplication

The Session attribute handling needs to be extracted from the TravelloAlexaLibrary\Application\AbstractAlexaApplication class. This involves the following steps:

  • Move initSessionAttributes() to a session container class.
  • Move getSessionAttributes() to a session container class.
  • Move resetSessionAttributes() to a session container class.
  • The method initResponse() should be removed as well. Maybe a middleware pipeline class could handle this.
  • The intent classes should get the new session container injected.
  • Finally, the AbstractAlexaApplication does not need to be abstract anymore.

Allow other POST request

Currently every POST request is handled as an Alexa request. If you want to add a form to your application the InjectCertificateValidatorMiddleware and InjectAlexaRequestMiddleware throw an exception.

Bug when other timestamp format is sent with service request

When working at a new Skill, I got a service request sent by the service simulator with a different timestamp format:

"request": {
    "requestId": "EdwRequestId.ea1f77ad-b269-4b61-b606-f77f65c012b0",
    "locale": "de-DE",
    "type": "LaunchRequest",
    "timestamp": 1501507326551
},

The normal format is 2017-01-26T20:38:55Z for example. To keep users from frustrating debugging this "unnormal" format should be handled.

Extend SkillConfiguration class

Extend the skill configuration class TravelloAlexaLibrary\Configuration\SkillConfiguration with further fields:

  • Skill name
  • RenderTemplate background image
  • Render template background title

Inject the SkillConfiguration class into the intents and remove the injection from the application.

Needs updates in the ZF Library intent factory as well.

Refactorings for AbstractAlexaApplication, TextHelper and IntentManager

The AbstractAlexaApplication needs to be refactored:

  • CertificateValidator should be removed from AbstractAlexaApplication
  • Check of application id should be removed from AbstractAlexaApplication
  • Both checks should be added to the middleware pipeline
  • TextHelper should be removed from AbstractAlexaApplication
  • Locale for TextHelper should be set in the middleware pipeline
  • TextHelper should be injected in the intent classes via factory

Further refactorings:

  • Remove the need to extends the text helper class for each skill
  • Remove the need to extends the intent manager class for each skill
  • Add a new configuration class for current skill, e.g. for application id, intents, etc.

Add Intent classes

Currently, all intents are tightly fixed to the TravelloAlexaLibrary\Application\AbstractAlexaApplication class. The idea behind this issue is to create single classes for each intent. Intent objects should habe access to the TravelloAlexaLibrary\Request\AlexaRequest and TravelloAlexaLibrary\Response\AlexaResponse objects and manipulate the Alexa response by changing its OutputSpeech, Card, Session Attributes, and so on.

The need to extend the AbstractAlexaApplication class to implement the handleIntentRequest() method in each application should be removed. The handleIntentRequest() should handle the intent requests automatically without the need to add each intent into a case condition.

Bug when version is not sent

When the service request is sent without the version the skill handling breaks with an error:

ErrorException: Undefined index: version in file /vendor/travello-gmbh/amazon-alexa-skill-library/src/Request/RequestType/RequestTypeFactory.php on line 39

Bug with context object without AudioPlayer object

When the context object is sent within an Alexa request and no AudioPlayer object is sent, the request handling fails. The TravelloAlexaLibrary\Request\Context\Context expects an AudioPlayerInterface instance as a parameter for its constructor. This should be changed. Otherwise the handling in the TravelloAlexaLibrary\Request\RequestType\RequestTypeFactory fails.

Randomize common texts

Add a solution to randomize common texts like alexaLaunchMessage or alexaStopMessage or alexaCancelTitle by adding arrays for each text.

Add AlexaRequest and AlexaResponse to DI container

Write a new middleware for the pipeline to add the AlexaRequest instance to the DI Container. Write another one to add the AlexaResponse instance to the DI Container. This will make it easier to access both in the application.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.