Skip to content

Commit

Permalink
merge Release - v3.3.1 (#268)
Browse files Browse the repository at this point in the history
* Add Browse Carousel directive usage to docs (#251)

* Updates i18next imports (#256)

* Updates i18next imports

* lint

* release 3.3.1-alpha2 (#257)

* Update state flow plugin example code

* Add dynamic entities directive (#264)

* Create alexa directive for dynamic entities

* Add test case for dynamic entities directive

* Add usage of dynamic entities directive in docs

* Fix lint issues

* Support getting the types and the dynamic entity directive

* Fix import order

* Add test cases for types and whole directive

* [Snyk] Fix for 1 vulnerabilities (#266)

* Update README.md (#258)

* fix: package.json to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-HTTPSPROXYAGENT-469131

* Release - v3.3.1 (#267)

* Update CHANGELOG.md

* Update package.json

* Handle all CanFullFillIntent Requests (#270)

* Update README.md (#258)

* Handle all CanFullFillIntent Requests

YES with the default intents, NO with the rest.

* fix google-auth-library dependency

* lint

* lint

* fixes integration tests

* more on the lambda version

* more on lambda
  • Loading branch information
rmberrios authored and armonge committed Dec 16, 2019
1 parent 6c0654b commit 092bab9
Show file tree
Hide file tree
Showing 27 changed files with 1,089 additions and 1,045 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ language: node_js
sudo: required
node_js:
- "8.10"
- "10"
- "12"

before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# VOXA Changelog

## 3.3.1 (2019-10-29)

#### Enhancement
* Add dynamic entities directive
* Add Browse Carousel directive usage to docs
* Updates i18next imports

## 3.3.1-alpha2 (2019-08-13)

#### Enhancement
* Add Browse Carousel directive usage to docs
* Updates i18next imports

## 3.3.0 (2019-07-11)

#### New Feature
Expand Down
93 changes: 93 additions & 0 deletions docs/alexa-directives.rst
Original file line number Diff line number Diff line change
Expand Up @@ -421,3 +421,96 @@ The only required parameter is the ``slotToElicit``, but you can also pass in th
to: "someOtherThing",
};
});
Dynamic Entities
------------------------------------------

`Alexa Documentation <https://developer.amazon.com/docs/custom-skills/use-dynamic-entities-for-customized-interactions.html>`_

Dynamic entities are sent with the `alexaDynamicEntities` key in your controller. You need to pass a view name with the types array.

.. code-block:: javascript
// variables.js
exports.dynamicNames = (voxaEvent) => {
return [
{
name: "LIST_OF_AVAILABLE_NAMES",
values: [
{
id: "nathan",
name: {
synonyms: ["nate"],
value: "nathan"
}
}
]
}
];
});
// views.js
const views = {
"en-US": {
translation: {
MyAvailableNames: "{dynamicNames}"
},
};
};
// state.js
app.onState('someState', () => {
return {
alexaDynamicEntities: "MyAvailableNames",
};
});
// Or you can pass the types directly...
app.onState('someState', () => {
return {
alexaDynamicEntities: [
{
name: "LIST_OF_AVAILABLE_NAMES",
values: [
{
id: "nathan",
name: {
synonyms: ["nate"],
value: "nathan"
}
}
]
}
],
};
});
// Or you can pass the whole directive directly...
app.onState('someState', () => {
return {
alexaDynamicEntities: {
type: "Dialog.UpdateDynamicEntities",
updateBehavior: "REPLACE",
types: [
{
name: "LIST_OF_AVAILABLE_NAMES",
values: [
{
id: "nathan",
name: {
synonyms: ["nate"],
value: "nathan"
}
}
]
}
]
},
};
});
37 changes: 37 additions & 0 deletions docs/google-assistant-directives.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,43 @@ The carousel scrolls horizontally and allows for selecting one item. Compared to
}
});
Browse Carousel
----------

`Actions on Google Documentation <https://developers.google.com/actions/assistant/responses#browsing_carousel>`_

A browsing carousel is a rich response that allows users to scroll vertically and select a tile in a collection. Browsing carousels are designed specifically for web content by opening the selected tile in a web browser.


.. code-block:: javascript
app.onState('someState', () => {
return {
dialogflowBrowseCarousel: {
items: [
{
title: 'Title of the item',
description: 'This is a description of an item.',
footer: 'Footer of the item'
openUrlAction: {
url: 'https://example.com/page',
urlTypeHint: 'DEFAULT' // Optional
}
},
{
title: 'Title of the item',
description: 'This is a description of an item.',
footer: 'Footer of the item'
openUrlAction: {
url: 'https://example.com/page',
urlTypeHint: 'DEFAULT' // Optional
}
},
],
}
}
});
Suggestions
------------

Expand Down
9 changes: 5 additions & 4 deletions docs/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ Usage

.. code-block:: javascript
const alexa = require('alexa-statemachine');
alexa.plugins.stateFlow.register(app)
const { plugins, VoxaApp } = require('voxa');
const voxaApp = new VoxaApp();
plugins.stateFlow(voxaApp);
app.onBeforeReplySent((voxaEvent) => {
console.log(voxaEvent.flow.join(' > ')); // entry > firstState > secondState > die
voxaApp.onBeforeReplySent((voxaEvent) => {
console.log(voxaEvent.session.outputAttributes.flow.join(' > ')); // entry > firstState > secondState > die
});
Expand Down
12 changes: 4 additions & 8 deletions hello-world/hello-world.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@ const dockerLambda = require("docker-lambda");
const { getPortPromise } = require("portfinder");
const { spawn, execSync } = require("child_process");

const NODE_VERSION = process.env.NODE_VERSION;
const LAMBDA_VERSION = process.env.LAMBDA_VERSION;
const launchIntent = require("../test/requests/alexa/launchRequest.json");
const lambdaProxyLaunchIntent = require("../test/requests/dialogflow/lambdaProxyLaunchIntent.json");
const alexaEvent = require("../test/requests/alexa/launchRequest.json");

/* tslint:disable-next-line:no-var-requires */
const views = require("./views.json");

describe("Hello World", () => {
describe("azureFunction", () => {
Expand All @@ -47,7 +43,7 @@ describe("Hello World", () => {
endpoint = `http://localhost:${port}/api/HelloWorldHttpTrigger`;

await new Promise((resolve, reject) => {
child = spawn("npx", ["func", "start", "--port", port]);
child = spawn("npx", ["func", "start", "--port", port, "--javascript"]);
child.stdout.on("data", data => {
if (_.includes(data.toString(), endpoint)) {
return resolve();
Expand Down Expand Up @@ -99,7 +95,7 @@ describe("Hello World", () => {
it("runs the lambda call", function() {
this.timeout(10000);
const lambdaCallbackResult = dockerLambda({
dockerImage: `lambci/lambda:nodejs${NODE_VERSION}`,
dockerImage: `lambci/lambda:nodejs${LAMBDA_VERSION}`,
event: launchIntent,
handler: "hello-world.alexaLambdaHandler"
});
Expand All @@ -121,7 +117,7 @@ describe("Hello World", () => {
it("runs the apiGateway call", function() {
this.timeout(10000);
const lambdaCallbackResult = dockerLambda({
dockerImage: `lambci/lambda:nodejs${NODE_VERSION}`,
dockerImage: `lambci/lambda:nodejs${LAMBDA_VERSION}`,
event: lambdaProxyLaunchIntent,
handler: "hello-world.googleAssistantActionLambdaHTTPHandler"
});
Expand Down
2 changes: 1 addition & 1 deletion hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"voxa": "file:.."
},
"devDependencies": {
"azure-functions-core-tools": "^2.7.1158",
"azure-functions-core-tools": "2.7.1948",
"chai": "^4.2.0",
"docker-lambda": "^0.15.3",
"mocha": "^6.1.4",
Expand Down

0 comments on commit 092bab9

Please sign in to comment.