diff --git a/package.json b/package.json index ea1784f..31aa05e 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,6 @@ "main": "index.js", "scripts": { "build": "tsc", - "pjson": "ts-node ./src/tools/gen-package-json.ts > ./lambda/package.json", "clean": "rm -rf ./lambda/*" }, "author": "Amazon Alexa", diff --git a/src/index.ts b/src/index.ts index 438bdc5..572da21 100644 --- a/src/index.ts +++ b/src/index.ts @@ -43,6 +43,21 @@ const KidShiftAuthIntentHandler = { } }; + +const KidShiftAuthIntentResutHandler = { + canHandle(handlerInput: Alexa.HandlerInput) { + return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest' + && Alexa.getIntentName(handlerInput.requestEnvelope) === 'KidShiftAuthIntent' + && Alexa.getDialogState(handlerInput.requestEnvelope) === 'COMPLETED'; + }, + async handle(handlerInput: Alexa.HandlerInput) { + const speakOutput = 'Hello World!2'; + return handlerInput.responseBuilder + .speak(speakOutput) + .getResponse(); + } +}; + const HelpIntentHandler = { canHandle(handlerInput: Alexa.HandlerInput) { return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest' @@ -136,7 +151,8 @@ exports.handler = Alexa.SkillBuilders.custom() FallbackIntentHandler, SessionEndedRequestHandler, IntentReflectorHandler, - KidShiftAuthIntentHandler) + KidShiftAuthIntentHandler, + KidShiftAuthIntentResutHandler) .addErrorHandlers( ErrorHandler) .withPersistenceAdapter(new DynamoDBPersistantAttributesAdapter.DynamoDbPersistenceAdapter({