alexa-ability
Advanced tools
Comparing version 0.11.1 to 0.12.0
@@ -125,4 +125,2 @@ # `Request` | ||
### `show(title, content) -> request` | ||
Set the `cardOutput` property on the response. Cannot be used | ||
with the `linkAccount` method. | ||
@@ -133,5 +131,26 @@ ##### Arguments | ||
Show a [Simple](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interface-reference#card-object) card. | ||
### `show(card) -> request` | ||
##### Arguments | ||
- `card`: The card definition | ||
Show a [Standard](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interface-reference#card-object) card. | ||
##### Example | ||
```js | ||
req.show({ | ||
"title": "card title", | ||
"content": "card content", | ||
"text": "card text", | ||
"image": { | ||
"smallImageUrl": "/path/to/img-small.png", | ||
"largeImageUrl": "/path/to/img-large.png" | ||
} | ||
}); | ||
``` | ||
### `linkAccount() -> request` | ||
Show a card on the Alexa app to link their account to your service. Cannot be used with the `show` method. | ||
Show a [LinkAccount](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interface-reference#card-object) card. | ||
### `reprompt([type,] value)` | ||
@@ -138,0 +157,0 @@ Set the `reprompt.speechOutput` property on the response. |
@@ -38,8 +38,8 @@ 'use strict'; | ||
log('invalid applicationId: %s (expected %s)', appId, id); | ||
return req.fail(new Error('Invalid applicationId')); | ||
req.fail(new Error('Invalid applicationId')); | ||
} else { | ||
log('applicationId matches'); | ||
next(); | ||
} | ||
log('applicationId matches'); | ||
next(); | ||
}; | ||
} |
@@ -8,2 +8,4 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
@@ -25,2 +27,6 @@ | ||
var _debug = require('debug'); | ||
var _debug2 = _interopRequireDefault(_debug); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -34,2 +40,4 @@ | ||
var log = (0, _debug2.default)('alexa-ability:ability:request'); | ||
var Request = exports.Request = function (_EventEmitter) { | ||
@@ -57,3 +65,3 @@ _inherits(Request, _EventEmitter); | ||
_this.slots = _this.params = (0, _transform2.default)((0, _get2.default)(event, 'request.intent.slots'), function (obj, slot) { | ||
return obj[slot.name] = slot.value; | ||
obj[slot.name] = slot.value; | ||
}, {}); | ||
@@ -78,8 +86,17 @@ | ||
key: 'show', | ||
value: function show(title, content) { | ||
this._res.card = { | ||
title: title, | ||
content: content, | ||
type: 'Simple' | ||
}; | ||
value: function show(card, text) { | ||
if (typeof card === 'string') { | ||
log('showing Simple card'); | ||
this._res.card = { | ||
type: 'Simple', | ||
title: card, | ||
content: text | ||
}; | ||
} else { | ||
log('showing Standard card type'); | ||
// TODO validation? | ||
this._res.card = _extends({ | ||
type: 'Standard' | ||
}, card); | ||
} | ||
return this; | ||
@@ -86,0 +103,0 @@ } |
{ | ||
"name": "alexa-ability", | ||
"version": "0.11.1", | ||
"version": "0.12.0", | ||
"description": "An Alexa skills framework for node", | ||
@@ -48,3 +48,3 @@ "main": "lib/index.js", | ||
"babel-cli": "^6.4.5", | ||
"babel-eslint": "^4.1.8", | ||
"babel-eslint": "^6.1.0", | ||
"babel-preset-es2015": "^6.3.13", | ||
@@ -54,5 +54,7 @@ "babel-preset-stage-1": "^6.3.13", | ||
"chai": "^3.4.1", | ||
"eslint": "^1.10.3", | ||
"eslint-config-airbnb": "^4.0.0", | ||
"eslint-plugin-react": "^3.16.1", | ||
"eslint": "^2.13.1", | ||
"eslint-config-airbnb": "^9.0.1", | ||
"eslint-plugin-import": "^1.10.0", | ||
"eslint-plugin-jsx-a11y": "^1.5.3", | ||
"eslint-plugin-react": "^5.2.2", | ||
"in-publish": "^2.0.0", | ||
@@ -59,0 +61,0 @@ "mocha": "^2.3.4", |
@@ -27,3 +27,3 @@ # alexa-ability [![Build Status](https://travis-ci.org/nickclaw/alexa-ability.svg?branch=master)](https://travis-ci.org/nickclaw/alexa-ability) | ||
### Example | ||
### Example ([es5 version](examples/es5/index.js)) | ||
@@ -30,0 +30,0 @@ ```js |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40541
21
546
15