Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// exports
const skillBuilder = Alexa.SkillBuilders.custom();
exports.handler = skillBuilder
.addRequestHandlers(
AmazonCancelStopHandler,
AmazonHelpHandler,
LaunchRequestHandler,
SkillEventHandler,
ItemEventHandler,
ListEventHandler,
SessionEndedHandler,
UnhandledHandler,
)
.addErrorHandlers(ErrorHandler)
.withApiClient(new Alexa.DefaultApiClient())
.withCustomUserAgent('cookbook/list-events/v1')
.lambda();
}
// 4. Exports handler function and setup ===================================================
const skillBuilder = Alexa.SkillBuilders.custom();
exports.handler = skillBuilder
.addRequestHandlers(
LaunchRequestHandler,
AmazonCancelStopNoHandler,
AmazonHelpHandler,
InProgressGetFirstEventHandler,
GetFirstEventHandler,
AmazonYesHandler,
SessionEndedHandler,
)
.addErrorHandlers(ErrorHandler)
.withApiClient(new Alexa.DefaultApiClient())
.withCustomUserAgent('cookbook/progressive-response/v1')
.lambda();
}
// exports
const skillBuilder = Alexa.SkillBuilders.custom();
exports.handler = skillBuilder
.addRequestHandlers(
AmazonCancelStopHandler,
AmazonHelpHandler,
LaunchRequestHandler,
CompleteTopToDoHandler,
TopToDoHandler,
SessionEndedHandler,
)
.addErrorHandlers(ErrorHandler)
.withApiClient(new Alexa.DefaultApiClient())
.withCustomUserAgent('cookbook/list-access/v1')
.lambda();
&& handlerInput.requestEnvelope.request.intent.name === 'SayGoodbye';
}
public async handle(handlerInput : HandlerInput) : Promise {
const attributes = await handlerInput.attributesManager.getPersistentAttributes();
return handlerInput.responseBuilder.speak(`Bye ${attributes.foo}!`).getResponse();
}
}
export const handler : LambdaHandler = SkillBuilders.custom()
.withPersistenceAdapter(new DynamoDbPersistenceAdapter({
tableName: 'TestTable',
partitionKeyName: 'userId',
attributesName: 'mapAttr',
}))
.withApiClient(new DefaultApiClient())
.addRequestHandlers(
new SayHelloHandler(),
new SayGoodbyeHandler(),
)
.lambda();
const mobile = await upsServiceClient.getProfileMobileNumber();
const speechText = `Hello, ${givenName} ${name}. Your e-mail is ${email} and your phone number is ${mobile}`;
return handlerInput.responseBuilder.speak(speechText).getResponse();
} catch (e) {
return handlerInput.responseBuilder.speak('Hello, world! I am not allowed to view your profile.').getResponse();
}
}
}
export const handler : LambdaHandler = SkillBuilders.custom()
.addRequestHandlers(
new LaunchRequestHandler(),
)
.withApiClient(new DefaultApiClient())
.lambda();
function EmitEvent() : void {
const packageInfo = require('../package.json');
this.state = this._event.session.attributes.STATE || '';
SkillBuilders.custom()
.addRequestHandlers(new Handler(this), ...this.v2RequestHandlers)
.addRequestInterceptors(new CopySessionAttributesInterceptor())
.withPersistenceAdapter(dynamoDbPersistenceAdapter)
.withApiClient(new DefaultApiClient())
.withCustomUserAgent(`${packageInfo.name}/${packageInfo.version}`)
.create()
.invoke(this._event, this._context)
.then((responseEnvelope) => {
if (typeof this._callback === 'undefined') {
this._context.succeed(responseEnvelope);
} else {
this._callback(null, responseEnvelope);
}
})
.catch((err) => {
if (typeof this._callback === 'undefined') {
this._context.fail(err);
} else {
this._callback(err);
}