alexa-ability-lambda-handler
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -6,13 +6,15 @@ "use strict"; | ||
}); | ||
exports.default = createAbilityHandler; | ||
function createAbilityHandler(ability) { | ||
exports.handleAbility = handleAbility; | ||
function handleAbility(ability) { | ||
return function (event, context) { | ||
return function abilityHandler(event, context) { | ||
ability.handle(event).then(function (req) { | ||
console.log(req.toJSON()), context.succeed(req.toJSON()); | ||
}, function (err) { | ||
return context.fail(err); | ||
ability.handle(event, function (err, req) { | ||
if (err) { | ||
context.fail(err); | ||
} else { | ||
context.succeed(req.toJSON()); | ||
} | ||
}); | ||
}; | ||
} |
{ | ||
"name": "alexa-ability-lambda-handler", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "", | ||
@@ -30,4 +30,4 @@ "main": "lib/index.js", | ||
"peerDependencies": { | ||
"alexa-ability": "^0.3.4" | ||
"alexa-ability": "^0.5.0" | ||
} | ||
} |
@@ -7,11 +7,11 @@ # alexa-ability-lambda-handler | ||
import { Ability, events } from 'alexa-ability'; | ||
import handle from 'alexa-ability-lambda-handler'; | ||
import { handleAbility } from 'alexa-ability-lambda-handler'; | ||
const ability = new Ability(); | ||
ability.on(events.LAUNCH, function(req) { | ||
ability.on(events.launch, function(req) { | ||
req.say("Testing testing one two three.").end(); | ||
}); | ||
export const handler = handle(ability); | ||
export const handler = handleAbility(ability); | ||
``` |
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
2629
15