alexa-lambda-skill
Advanced tools
Comparing version 0.1.16 to 0.1.17
@@ -1,1 +0,1 @@ | ||
!function(e,t){for(var n in t)e[n]=t[n]}(exports,function(e){function t(r){if(n[r])return n[r].exports;var u=n[r]={exports:{},id:r,loaded:!1};return e[r].call(u.exports,u,u.exports,t),u.loaded=!0,u.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var u=n(1),o=r(u);t["default"]={Handler:o["default"]},e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){var t=arguments.length<=1||void 0===arguments[1]?s["default"]:arguments[1];return function(n,r){var o=n.request,s=void 0===o?{}:o,d=s.intent;d=void 0===d?{}:d;var c=d.slots,l=void 0===c?{}:c,f=t(s,e),v=f.handler,p=void 0===v?a.NotFound:v,b=Object.values(l).reduce(function(e,t){var n=t.name,r=t.value;return Object.assign({},e,u({},n,r))},{});Promise.resolve(p(b)).then(function(e){var t=e?{version:"1.0",sessionAttributes:{},response:i({shouldEndSession:!0},e)}:void 0;r.succeed(t)})["catch"](function(e){r.fail(e||"Unknown error")})}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t["default"]=o;var a=n(2),s=r(a);e.exports=t["default"]},function(e,t){"use strict";function n(e,t){var n=e.type,a=e.intent;a=void 0===a?{}:a;var s=a.name;return[n==r&&t[s],n==r&&t.intent&&t.intent.bind(t,s),n==u&&t.launch,n==o&&t.sessionEnded,t.notFound||i].filter(function(e){return!!e})[0]}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n;var r="IntentRequest",u="LaunchRequest",o="SessionEndedRequest",i=function(){return Promise.reject("404 Not Found")};t.NotFound=i}])); | ||
!function(e,t){for(var n in t)e[n]=t[n]}(exports,function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(2),s=r(u),a=n(1),i=r(a);t["default"]=o({Handler:s["default"]},i["default"]),e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=Array.prototype.slice,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(){function e(){n(this,e),this.state=Object.assign.apply(Object,[{shouldEndSession:!1}].concat(r.call(arguments)))}return o(e,[{key:"say",value:function(t){return new e(this.state,{outputSpeech:{type:"PlainText",text:t}})}},{key:"card",value:function(t,n){var r=arguments.length<=2||void 0===arguments[2]?"Simple":arguments[2];return new e(this.state,{card:{type:r,title:t,content:n}})}},{key:"reprompt",value:function(t){return new e(this.state,{reprompt:{outputSpeech:{type:"PlainText",text:t}}})}},{key:"shouldEndSession",value:function(t){return new e(this.state,{shouldEndSession:t})}}]),e}();t["default"]={Response:u,say:(new u).say,card:(new u).card,reprompt:(new u).reprompt,shouldEndSession:(new u).shouldEndSession},e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){var t=arguments.length<=1||void 0===arguments[1]?i["default"]:arguments[1];return function(n,r){var u=n.request,i=void 0===u?{}:u,l=n.session;l=void 0===l?{}:l;var d=l.attributes,f=void 0===d?{}:d,p=i.intent;p=void 0===p?{}:p;var v=p.slots,h=void 0===v?{}:v,y=t(i,e),b=y.handler,m=void 0===b?a.NotFound:b,g=Object.values(h).reduce(function(e,t){var n=t.name,r=t.value;return Object.assign({},e,o({},n,r))},{});Promise.resolve(m(g)).then(function(e){return e&&e instanceof c.Response?e.state:e}).then(function(e){var t=e?{version:"1.0",sessionAttributes:f,response:s({shouldEndSession:!0},e)}:void 0;r.succeed(t)})["catch"](function(e){r.fail(e||"Unknown error")})}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t["default"]=u;var a=n(3),i=r(a),c=n(1);e.exports=t["default"]},function(e,t){"use strict";function n(e,t){var n=e.type,a=e.reason,i=e.intent;i=void 0===i?{}:i;var c=i.name;return[n==r&&t[c],n==r&&t.intent&&t.intent.bind(t,c),n==o&&t.launch,n==u&&t.sessionEnded&&t.sessionEnded.bind(t,a),t.notFound||s].filter(function(e){return!!e})[0]}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n;var r="IntentRequest",o="LaunchRequest",u="SessionEndedRequest",s=function(){return Promise.reject("404 Not Found")};t.NotFound=s}])); |
@@ -5,3 +5,3 @@ { | ||
"description": "Create Alexa Skills for AWS Lambda, easily.", | ||
"version": "0.1.16", | ||
"version": "0.1.17", | ||
"main": "dist/index.js", | ||
@@ -8,0 +8,0 @@ "license": "MIT", |
@@ -8,3 +8,3 @@ # alexa-lambda-skill | ||
```javascript | ||
import Alexa from "alexa-lambda-skill"; | ||
import { Handler, say } from "alexa-lambda-skill"; | ||
@@ -20,17 +20,17 @@ class MySkill { | ||
const { sentence } = slots; | ||
return { | ||
outputSpeech: { | ||
type: "PlainText", | ||
text: sentence | ||
} | ||
}; | ||
return say(sentence).card("MySkill", `Said "${sentence}"`); | ||
} | ||
// Called when an intent doesn't have a specific handler | ||
// Called when the IntentRequest doesn't have a specific handler | ||
intent(name, slots) { | ||
return Promise.reject(`Unhandled intent "${name}"`); | ||
} | ||
// Called when a SessionEndedRequest is triggered | ||
sessionEnded(reason) { | ||
console.log(`Session ended: "${reason}"`); | ||
} | ||
} | ||
export default new Alexa.Handler(new MySkill()); | ||
export default new Handler(new MySkill()); | ||
``` |
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
5921