From fb377aac3ee762feae92944bae71fe651d6f3232 Mon Sep 17 00:00:00 2001 From: dblock Date: Wed, 8 Feb 2017 10:46:10 -0500 Subject: [PATCH 01/11] Fix #162: do not generate empty slots in schema. --- CHANGELOG.md | 1 + index.js | 18 ++- test/fixtures/expected_intent_schema.json | 27 ----- test/test_alexa_app_schema.js | 132 ++++++++++++++++++---- 4 files changed, 122 insertions(+), 56 deletions(-) delete mode 100644 test/fixtures/expected_intent_schema.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b6ac05..a95807e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### 3.0.1 (Next) +* [#162](https://github.com/alexa-js/alexa-app/issues/162): Fix: do not generate empty slots in schema - [@dblock](https://github.com/dblock). * Your contribution here. ### 3.0.0 (February 6, 2017) diff --git a/index.js b/index.js index 0f7b783..8cb3e5d 100644 --- a/index.js +++ b/index.js @@ -486,17 +486,15 @@ alexa.app = function(name) { for (intentName in self.intents) { intent = self.intents[intentName]; var intentSchema = { - "intent": intent.name, - "slots": [] + "intent": intent.name }; - if (intent.schema) { - if (intent.schema.slots) { - for (key in intent.schema.slots) { - intentSchema.slots.push({ - "name": key, - "type": intent.schema.slots[key] - }); - } + if (intent.schema && intent.schema.slots && Object.keys(intent.schema.slots).length > 0) { + intentSchema["slots"] = []; + for (key in intent.schema.slots) { + intentSchema.slots.push({ + "name": key, + "type": intent.schema.slots[key] + }); } } schema.intents.push(intentSchema); diff --git a/test/fixtures/expected_intent_schema.json b/test/fixtures/expected_intent_schema.json deleted file mode 100644 index b1d85f2..0000000 --- a/test/fixtures/expected_intent_schema.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "intents": [{ - "intent": "testIntentTwo", - "slots": [{ - "name": "MyCustomSlotType", - "type": "CUSTOMTYPE" - }, { - "name": "Tubular", - "type": "AMAZON.LITERAL" - }, { - "name": "Radical", - "type": "AMAZON.US_STATE" - }] - }, { - "intent": "testIntent", - "slots": [{ - "name": "AirportCode", - "type": "FAACODES" - }, { - "name": "Awesome", - "type": "AMAZON.DATE" - }, { - "name": "Tubular", - "type": "AMAZON.LITERAL" - }] - }] -} diff --git a/test/test_alexa_app_schema.js b/test/test_alexa_app_schema.js index 179d91f..d245542 100644 --- a/test/test_alexa_app_schema.js +++ b/test/test_alexa_app_schema.js @@ -17,28 +17,122 @@ describe("Alexa", function() { }); describe("#schema", function() { - beforeEach(function() { - testApp.intent("testIntentTwo", { - "slots": { - "MyCustomSlotType": "CUSTOMTYPE", - "Tubular": "AMAZON.LITERAL", - "Radical": "AMAZON.US_STATE", - }, - }); - - testApp.intent("testIntent", { - "slots": { - "AirportCode": "FAACODES", - "Awesome": "AMAZON.DATE", - "Tubular": "AMAZON.LITERAL" - }, + describe("with a minimum intent", function() { + beforeEach(function() { + testApp.intent("AMAZON.PauseIntent"); + }); + + it("contains no slots", function() { + var subject = JSON.parse(testApp.schema()); + expect(subject).to.eql({ + "intents": [{ + "intent": "AMAZON.PauseIntent" + }] + }); }); }); - it("generates the expected schema", function() { - var expected = mockHelper.load("expected_intent_schema.json"); - var subject = JSON.parse(testApp.schema()); - expect(subject).to.eql(expected); + describe("with empty slots", function() { + beforeEach(function() { + testApp.intent("AMAZON.PauseIntent", { + "slots": {} + }); + }); + + it("contains no slots", function() { + var subject = JSON.parse(testApp.schema()); + expect(subject).to.eql({ + "intents": [{ + "intent": "AMAZON.PauseIntent" + }] + }); + }); + }); + + describe("with a slot", function() { + beforeEach(function() { + testApp.intent("testIntent", { + "slots": { + "MyCustomSlotType": "CUSTOMTYPE", + "Tubular": "AMAZON.LITERAL", + "Radical": "AMAZON.US_STATE", + }, + }); + }); + + it("includes slots", function() { + var subject = JSON.parse(testApp.schema()); + expect(subject).to.eql({ + "intents": [{ + "intent": "testIntent", + "slots": [{ + "name": "MyCustomSlotType", + "type": "CUSTOMTYPE" + }, { + "name": "Tubular", + "type": "AMAZON.LITERAL" + }, { + "name": "Radical", + "type": "AMAZON.US_STATE" + }] + }] + }); + }); + }); + + describe("with multiple intents", function() { + beforeEach(function() { + testApp.intent("AMAZON.PauseIntent"); + + testApp.intent("testIntentTwo", { + "slots": { + "MyCustomSlotType": "CUSTOMTYPE", + "Tubular": "AMAZON.LITERAL", + "Radical": "AMAZON.US_STATE", + }, + }); + + testApp.intent("testIntent", { + "slots": { + "AirportCode": "FAACODES", + "Awesome": "AMAZON.DATE", + "Tubular": "AMAZON.LITERAL" + }, + }); + }); + + it("generates the expected schema", function() { + var subject = JSON.parse(testApp.schema()); + expect(subject).to.eql({ + "intents": [{ + "intent": "AMAZON.PauseIntent", + }, { + "intent": "testIntentTwo", + "slots": [{ + "name": "MyCustomSlotType", + "type": "CUSTOMTYPE" + }, { + "name": "Tubular", + "type": "AMAZON.LITERAL" + }, { + "name": "Radical", + "type": "AMAZON.US_STATE" + }] + }, { + "intent": "testIntent", + "slots": [{ + "name": "AirportCode", + "type": "FAACODES" + }, { + "name": "Awesome", + "type": "AMAZON.DATE" + }, { + "name": "Tubular", + "type": "AMAZON.LITERAL" + }] + }] + }); + }); }); }); }); From 908f20435bfa8b7cf79c24962ceb353a78f81624 Mon Sep 17 00:00:00 2001 From: "Daniel Doubrovkine (dB.) @dblockdotorg" Date: Wed, 8 Feb 2017 23:17:03 -0500 Subject: [PATCH 02/11] Put back a note about stable release. [ci skip] --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 521f631..75e2d9a 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,12 @@ A Node module to simplify the development of Alexa skills (applications.) [![Build Status](https://travis-ci.org/alexa-js/alexa-app.svg?branch=master)](https://travis-ci.org/alexa-js/alexa-app) [![Coverage Status](https://coveralls.io/repos/github/alexa-js/alexa-app/badge.svg?branch=master)](https://coveralls.io/github/alexa-js/alexa-app?branch=master) +### Stable Release + +You're reading the documentation for the next release of alexa-app. Please see [CHANGELOG](CHANGELOG.md) and make sure to read [UPGRADING](UPGRADING.md) when upgrading from a previous version. The current stable release is [3.0.0](https://github.com/alexa-js/alexa-app/tree/v3.0.0). + +### Introduction + This module parses HTTP JSON requests from the Alexa platform and builds the JSON response that consumed by an Alexa-compatible device, such as the Echo. It provides a DSL for defining intents, convenience methods to more easily build the response, handle session objects, and add cards. @@ -598,6 +604,6 @@ All named apps can be found in the `alexa.apps` object, keyed by name. The value ## License -Copyright (c) 2016 Matt Kruse +Copyright (c) 2016-2017 Matt Kruse MIT License, see [LICENSE](LICENSE.md) for details. From 94a2f2ba91cfdce31383c5d95fd2bf97aff22935 Mon Sep 17 00:00:00 2001 From: Matt Gowie Date: Sat, 11 Feb 2017 21:16:17 -0500 Subject: [PATCH 03/11] Fixes bad utterance syntax is Docs. Fixes #89 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 75e2d9a..e4c0d44 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ var app = new alexa.app("sample"); app.intent("number", { "slots": { "number": "NUMBER" }, - "utterances": ["say the number {1-100|number}"] + "utterances": ["say the number {-|number}"] }, function(request, response) { var number = request.slot("number"); @@ -70,7 +70,7 @@ var app = new alexa.app("sample"); app.intent("number", { "slots": { "number": "NUMBER" }, - "utterances": ["say the number {1-100|number}"] + "utterances": ["say the number {-|number}"] }, function(request, response) { var number = request.slot("number"); @@ -356,7 +356,7 @@ app.intent("sampleIntent", { "AGE": "AMAZON.NUMBER" }, "utterances": [ - "my {name is|name's} {NAME} and {I am|I'm} {1-100|AGE}{ years old|}" + "my {name is|name's} {NAME} and {I am|I'm} {-|AGE}{ years old|}" ] }, function(request, response) { ... } From 7afe42373aa0d647fa11871c703a510bf0d023ba Mon Sep 17 00:00:00 2001 From: Matt Gowie Date: Sun, 12 Feb 2017 14:22:30 -0500 Subject: [PATCH 04/11] Updates slot examples: AMAZON.NUMBER > NUMBER --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e4c0d44..aece414 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ You need to make sure that the Handler is set to `index.handler`, which is the d var app = new alexa.app("sample"); app.intent("number", { - "slots": { "number": "NUMBER" }, + "slots": { "number": "AMAZON.NUMBER" }, "utterances": ["say the number {-|number}"] }, function(request, response) { @@ -69,7 +69,7 @@ var express_app = express(); var app = new alexa.app("sample"); app.intent("number", { - "slots": { "number": "NUMBER" }, + "slots": { "number": "AMAZON.NUMBER" }, "utterances": ["say the number {-|number}"] }, function(request, response) { From a06a4017bc3f938ede9354425cf5ee9e69651284 Mon Sep 17 00:00:00 2001 From: Tejas Shah Date: Mon, 13 Feb 2017 06:45:13 -0800 Subject: [PATCH 05/11] Always enfore strict header checking --- CHANGELOG.md | 1 + index.js | 4 ++-- package.json | 26 +++++++++++++------------- test/test_alexa_integration_express.js | 10 ---------- 4 files changed, 16 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a95807e..d743bcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### 3.0.1 (Next) +* [#174](https://github.com/alexa-js/alexa-app/pull/174): Always enfore strict header checking - [@tejashah88](https://github.com/tejashah88). * [#162](https://github.com/alexa-js/alexa-app/issues/162): Fix: do not generate empty slots in schema - [@dblock](https://github.com/dblock). * Your contribution here. diff --git a/index.js b/index.js index 8cb3e5d..8c077d9 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,7 @@ var AlexaUtterances = require("alexa-utterances"); var SSML = require("./to-ssml"); var alexa = {}; var defaults = require("lodash.defaults"); -var verifierMiddleware = require("alexa-verifier-middleware"); +var verifier = require("alexa-verifier-middleware"); var bodyParser = require('body-parser'); alexa.response = function(session) { @@ -586,7 +586,7 @@ alexa.app = function(name) { } if (options.checkCert) { - options.router.use(verifierMiddleware({ strictHeaderCheck: true })); + options.router.use(verifier); } else { options.router.use(bodyParser.json()); } diff --git a/package.json b/package.json index 767b502..a488da7 100644 --- a/package.json +++ b/package.json @@ -29,27 +29,27 @@ }, "license": "MIT", "dependencies": { - "alexa-utterances": "^0.2.0", - "alexa-verifier-middleware": "^0.1.9", - "bluebird": "^2.10.2", + "alexa-utterances": "^0.2.1", + "alexa-verifier-middleware": "^0.2.1", + "bluebird": "^3.4.7", "lodash.defaults": "^4.2.0", "numbered": "^1.0.0", - "body-parser": "^1.15.2" + "body-parser": "^1.16.1" }, "devDependencies": { - "chai": "^3.4.1", - "chai-as-promised": "^5.3.0", + "chai": "^3.5.0", + "chai-as-promised": "^6.0.0", "chai-string": "^1.3.0", - "coveralls": "^2.11.9", - "danger": "0.6.10", + "coveralls": "^2.11.16", + "danger": "0.11.4", "ejs": "^2.5.5", - "eslint": "^2.9.0", + "eslint": "^3.15.0", "esprima": "^3.1.3", - "express": "^4.14.0", - "istanbul": "^0.4.3", - "mocha": "^2.3.4", + "express": "^4.14.1", + "istanbul": "^0.4.5", + "mocha": "^3.2.0", "sinon": "^1.17.7", "sinon-chai": "^2.8.0", - "supertest": "^2.0.1" + "supertest": "^3.0.0" } } diff --git a/test/test_alexa_integration_express.js b/test/test_alexa_integration_express.js index d606228..9577a82 100644 --- a/test/test_alexa_integration_express.js +++ b/test/test_alexa_integration_express.js @@ -183,15 +183,6 @@ describe("Alexa", function() { }); }); - it("requires a cert header", function() { - return request(testServer) - .post('/testApp') - .expect(401).then(function(res) { - expect(res.body.status).to.equal("failure"); - expect(res.body.reason).to.equal("The signaturecertchainurl HTTP request header is invalid!"); - }); - }); - it("checks cert header", function() { return request(testServer) .post('/testApp') @@ -203,7 +194,6 @@ describe("Alexa", function() { }); }); - it("checks cert header with data", function() { var mockRequest = mockHelper.load("intent_request_airport_info.json"); return request(testServer) From 1089b7d1b52318813413165806be23dddd418301 Mon Sep 17 00:00:00 2001 From: Andrew Crites Date: Thu, 9 Feb 2017 17:17:14 -0500 Subject: [PATCH 06/11] Documented deprecation of non-promise async functionality --- README.md | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index aece414..2ef84b2 100644 --- a/README.md +++ b/README.md @@ -223,9 +223,11 @@ app.launch(function(request, response) { Define the handler for multiple intents using multiple calls to `intent()`. Intent schema and sample utterances can also be passed to `intent()`, which is detailed below. -Intent handlers that don't return an immediate response (because they do some asynchronous operation) must return `false`. +Intent handlers that don't return an immediate response (because they do some asynchronous operation) must return `false` (**deprecated**) or a `Promise`. See example further below. +**Note:** Using `return false` to signify an asynchronous intent handler function is deprecated and will be removed in the next major version. Instead, return a `Promise`. + ```javascript app.intent("live", { "slots": { @@ -258,7 +260,7 @@ app.sessionEnded(function(request, response) { ### AudioPlayer Event Request -Define the handler for multiple events using multiple calls to `audioPlayer()`. You can define only one handler per event. Event handlers that don't return an immediate response (because they do some asynchronous operation) must return false. +Define the handler for multiple events using multiple calls to `audioPlayer()`. You can define only one handler per event. Event handlers that don't return an immediate response (because they do some asynchronous operation) must return false (**deprecated**) or a Promise. You can define handlers for the following events: @@ -290,7 +292,8 @@ See an example of asynchronous response below. ```javascript app.audioPlayer("PlaybackFinished", function(request, response) { // async response - getNextSongFromDB(function(url, token) { + return getNextSongFromDBAsync() + .then(function(url, token) { var stream = { "url": url, "token": token, @@ -300,7 +303,6 @@ app.audioPlayer("PlaybackFinished", function(request, response) { response.audioPlayerPlayStream("ENQUEUE", stream); response.send(); }); - return false; }); ``` @@ -516,13 +518,28 @@ app.error = function(exception, request, response) { ## Asynchronous Intent Handler Example -If an intent or other request handler will return a response later, it must return ether `false` or a `Promise` (object with a `.then` function). This tells the alexa-app library not to send the response automatically. +If an intent or other request handler will return a response later, it must return either `false` (**deprecated**) or a `Promise` (object with a `.then` function). This tells the alexa-app library not to send the response automatically. + +**Note:** Using `return false` to signify an asynchronous intent handler function is deprecated and will be removed in the next major version. Instead, return a `Promise`. A callback is also passed to the handler. When this callback is called with no first argument, the response will be sent. If something is passed to the first argument, it is treated as an error. +**Note:** Using the callback is also deprecated and will be removed in the next major version. Instead, use promises. + If you return a Promise from the handler, you do not need to call the callback. If the Promise resolves, the response will be sent. If it is rejected, it is treated as an error. ```javascript +app.intent("checkStatus", function(request, response) { + // `getAsync` returns a Promise in this example. When + // returning a Promise, the response is sent after it + // resolves. If rejected, it is treated as an error. + return http.getAsync("http://server.com/status.html").then(function (rc) { + response.say(rc.statusText); + }); +}); + +// **NOTE** this example is deprecated and will not work +// after the next major version app.intent("checkStatus", function(request, response, callback) { http.get("http://server.com/status.html", function(rc) { // this is async and will run after the http call returns @@ -538,18 +555,8 @@ app.intent("checkStatus", function(request, response, callback) { // return false immediately so alexa-app doesn't send the response return false; }); - -app.intent("checkStatus", function(request, response) { - // `getAsync` returns a Promise in this example. When - // returning a Promise, the response is sent after it - // resolves. If rejected, it is treated as an error. - return http.getAsync("http://server.com/status.html").then(function (rc) { - response.say(rc.statusText); - }); -}); ``` - ### Customizing Default Error Messages ```javascript From a59b45ce3b10d717b9ecb6baf9c3aaad0c629956 Mon Sep 17 00:00:00 2001 From: Andrew Crites Date: Thu, 9 Feb 2017 17:21:55 -0500 Subject: [PATCH 07/11] Adding deprecation notices for `return false` async functionality This will be removed in the next major version --- index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.js b/index.js index 8c077d9..71e7a3d 100644 --- a/index.js +++ b/index.js @@ -428,6 +428,8 @@ alexa.app = function(name) { Promise.resolve(intentResult).asCallback(callbackHandler); } else if (false !== intentResult) { callbackHandler(); + } else { + console.warn("NOTE: using `return false` for async intent requests is deprecated and will not work after the next major version"); } } else { throw "NO_INTENT_FOUND"; @@ -439,6 +441,8 @@ alexa.app = function(name) { Promise.resolve(launchResult).asCallback(callbackHandler); } else if (false !== launchResult) { callbackHandler(); + } else { + console.warn("NOTE: using `return false` for async launch requests is deprecated and will not work after the next major version"); } } else { throw "NO_LAUNCH_FUNCTION"; @@ -450,6 +454,8 @@ alexa.app = function(name) { Promise.resolve(sessionEndedResult).asCallback(callbackHandler); } else if (false !== sessionEndedResult) { callbackHandler(); + } else { + console.warn("NOTE: using `return false` for async session ended requests is deprecated and will not work after the next major version"); } } else { response.send(); @@ -463,6 +469,8 @@ alexa.app = function(name) { Promise.resolve(eventHandlerResult).asCallback(callbackHandler); } else if (false !== eventHandlerResult) { callbackHandler(); + } else { + console.warn("NOTE: using `return false` for async audio player requests is deprecated and will not work after the next major version"); } } else { response.send(); From 89b9a74ab4b74e52b8b8aac3a5c5dd9075105d81 Mon Sep 17 00:00:00 2001 From: Andrew Crites Date: Thu, 9 Feb 2017 17:23:09 -0500 Subject: [PATCH 08/11] Updating Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d743bcb..7a83bbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * [#174](https://github.com/alexa-js/alexa-app/pull/174): Always enfore strict header checking - [@tejashah88](https://github.com/tejashah88). * [#162](https://github.com/alexa-js/alexa-app/issues/162): Fix: do not generate empty slots in schema - [@dblock](https://github.com/dblock). +* [#134](https://github.com/alexa-js/alexa-app/pull/134): Adding deprecation notices for plan to use Promises for async functionality - [ajcrites](https://github.com/ajcrites). * Your contribution here. ### 3.0.0 (February 6, 2017) From d93a171e9e8565fc821ed70b8f65ba37718c417a Mon Sep 17 00:00:00 2001 From: Andrew Crites Date: Sun, 12 Feb 2017 20:49:53 -0500 Subject: [PATCH 09/11] Updating Upgrading instructions for version 4 Also updated logging of old functionality to include stack trace --- UPGRADING.md | 39 +++++++++++++++++++++++++++++++++++++++ index.js | 8 ++++---- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index e4285ff..43580c7 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,5 +1,44 @@ # Upgrading Alexa-app +### Upgrading to >= 4.0.0 + +#### Changes to Asynchronous Support + +Support for asynchronous `pre` and `post` as well as all handlers such as the intent and launch handlers is now done through promises. This allows `pre` and `post` to be asynchronous. + +You can no longer make these handlers asynchronous by using `return false`. A callback is no longer taken as an argument to these handlers. Instead if you want your handler to be asynchronous you may return a promise. + +`response.send` and `response.fail` now return promises. If you call either, you must return them in order to continue the promise chain for any asynchronous functionality. If you return a promise but do not explicitly call `response.send` it will be called automatically when the returned promise resolves. If you want to trigger a failure, `return response.fail(error)` and `throw error` have the same effect. + +Before: +```javascript +app.intent("tellme", (request, response) => { + http.get(url, rc => { + if (rc.statusText >= 400) { + response.fail(); + } else { + response.send(rc.body); + } + }); + + return false; +}); +``` + +After: +```javascript +app.intent("tellme", (request, response) => { + // `getAsync` returns a Promise in this example + return http.getAsync(url).then(rc => { + if (rc.statusText >= 400) { + return response.fail(); + } else { + return response.send(rc.body); + } + }); +}); +``` + ### Upgrading to >= 3.0.0 #### Changes in Express integration interface diff --git a/index.js b/index.js index 71e7a3d..cb73986 100644 --- a/index.js +++ b/index.js @@ -429,7 +429,7 @@ alexa.app = function(name) { } else if (false !== intentResult) { callbackHandler(); } else { - console.warn("NOTE: using `return false` for async intent requests is deprecated and will not work after the next major version"); + console.trace("NOTE: using `return false` for async intent requests is deprecated and will not work after the next major version"); } } else { throw "NO_INTENT_FOUND"; @@ -442,7 +442,7 @@ alexa.app = function(name) { } else if (false !== launchResult) { callbackHandler(); } else { - console.warn("NOTE: using `return false` for async launch requests is deprecated and will not work after the next major version"); + console.trace("NOTE: using `return false` for async launch requests is deprecated and will not work after the next major version"); } } else { throw "NO_LAUNCH_FUNCTION"; @@ -455,7 +455,7 @@ alexa.app = function(name) { } else if (false !== sessionEndedResult) { callbackHandler(); } else { - console.warn("NOTE: using `return false` for async session ended requests is deprecated and will not work after the next major version"); + console.trace("NOTE: using `return false` for async session ended requests is deprecated and will not work after the next major version"); } } else { response.send(); @@ -470,7 +470,7 @@ alexa.app = function(name) { } else if (false !== eventHandlerResult) { callbackHandler(); } else { - console.warn("NOTE: using `return false` for async audio player requests is deprecated and will not work after the next major version"); + console.trace("NOTE: using `return false` for async audio player requests is deprecated and will not work after the next major version"); } } else { response.send(); From 36a23982f18ad9a0d0fde2034b1532a525888daf Mon Sep 17 00:00:00 2001 From: Tejas Shah Date: Mon, 13 Feb 2017 14:59:53 -0800 Subject: [PATCH 10/11] restoring express test with no cart headers provided --- test/test_alexa_integration_express.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/test_alexa_integration_express.js b/test/test_alexa_integration_express.js index 9577a82..5e8214f 100644 --- a/test/test_alexa_integration_express.js +++ b/test/test_alexa_integration_express.js @@ -183,6 +183,15 @@ describe("Alexa", function() { }); }); + it("requires a cert header", function() { + return request(testServer) + .post('/testApp') + .expect(401).then(function(res) { + expect(res.body.status).to.equal("failure"); + expect(res.body.reason).to.equal("signature is not base64 encoded"); + }); + }); + it("checks cert header", function() { return request(testServer) .post('/testApp') From 81fc2fdd21dd63ca5434e03781a98584b1ba4472 Mon Sep 17 00:00:00 2001 From: Andrew Crites Date: Mon, 13 Feb 2017 13:03:10 -0500 Subject: [PATCH 11/11] Preparing for release, 3.1.0 --- CHANGELOG.md | 6 ++++-- README.md | 2 +- package.json | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a83bbe..c674f9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,13 @@ ## Changelog -### 3.0.1 (Next) +### 4.0.0 (Next) +* Your contribution here. + +### 3.1.0 (February 13, 2017) * [#174](https://github.com/alexa-js/alexa-app/pull/174): Always enfore strict header checking - [@tejashah88](https://github.com/tejashah88). * [#162](https://github.com/alexa-js/alexa-app/issues/162): Fix: do not generate empty slots in schema - [@dblock](https://github.com/dblock). * [#134](https://github.com/alexa-js/alexa-app/pull/134): Adding deprecation notices for plan to use Promises for async functionality - [ajcrites](https://github.com/ajcrites). -* Your contribution here. ### 3.0.0 (February 6, 2017) diff --git a/README.md b/README.md index 2ef84b2..caafbd1 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A Node module to simplify the development of Alexa skills (applications.) ### Stable Release -You're reading the documentation for the next release of alexa-app. Please see [CHANGELOG](CHANGELOG.md) and make sure to read [UPGRADING](UPGRADING.md) when upgrading from a previous version. The current stable release is [3.0.0](https://github.com/alexa-js/alexa-app/tree/v3.0.0). +You're reading the documentation for the next release of alexa-app. Please see [CHANGELOG](CHANGELOG.md) and make sure to read [UPGRADING](UPGRADING.md) when upgrading from a previous version. The current stable release is [3.1.0](https://github.com/alexa-js/alexa-app/tree/v3.1.0). ### Introduction diff --git a/package.json b/package.json index a488da7..05bbd9d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "alexa-app", - "version": "3.0.1", + "version": "3.1.0", "description": "A module to simplify creation of Alexa (Amazon Echo) apps (Skills) using Node.js", "main": "index.js", "author": "Matt Kruse (http://mattkruse.com)",