-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandle.js
56 lines (52 loc) · 3.21 KB
/
handle.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Developer environment
require('dotenv').config();
// main parameters for Lambda.
const eventRepeatIntent = {
version: '1.0',
session: {
new: false,
sessionId: 'amzn1.echo-api.session.00aa000a-a000-00a0-a0aa-aa00aa000000',
application: {
applicationId: 'amzn1.ask.skill.a0a0000a-00a0-00a0-0000-0aaaaa000a00',
},
user: {
userId: 'amzn1.ask.account.ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXY',
},
},
context: {
System: {
application: {
applicationId: 'amzn1.ask.skill.a0a0000a-00a0-00a0-0000-0aaaaa000a00',
},
user: {
userId: 'amzn1.ask.account.ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXY',
},
device: {
deviceId: 'amzn1.ask.device.AGWX3F567ZLCNRKK3EWONQGBNQTCECXFU6JSSNSIT3UJ2URGCJ7AHBINCJ6SNRMBSA2AIUOLET25T6JJKU5UHKRQMF4Q3OE475FW47WRUKHFKCECUIP2B6BUGBNKOA765Y3CJWKRVRRYD6VAO2NFUKUF2UJA',
supportedInterfaces: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EFGHIJKLMNOPQRSTUVWXYZAB-CDEFGHIJKLMNO-PQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL',
},
},
request: {
type: 'IntentRequest',
requestId: 'amzn1.echo-api.session.00aa000a-a000-00a0-a0aa-aa00aa000000',
timestamp: '2018-04-06T04:06:46Z',
locale: 'ja-JP',
intent: {
name: 'AMAZON.RepeatIntent',
confirmationStatus: 'NONE',
},
},
};
const event = eventRepeatIntent;
const context = {};
// const lambda = require('./build/index');
const lambda = require('./src/index');
// Execute.
console.time('execute lambda.handler');
lambda.handler(event, context)
.then(data => console.log(`Process complete successfully. Returned value is below.\r\n${data}`))
.catch(e => console.error(e))
.finally(() => console.timeEnd('execute lambda.handler'));