-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjovo.project.js
185 lines (171 loc) · 5.82 KB
/
jovo.project.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
const { ProjectConfig } = require('@jovotech/cli-core');
const { GoogleAssistantCli } = require('@jovotech/platform-googleassistant');
const { AlexaCli } = require('@jovotech/platform-alexa');
const { ServerlessCli } = require('@jovotech/target-serverless');
// This name will appear in the Alexa and Actions on Google consoles
const NAME = 'Jovo Sample';
/*
|--------------------------------------------------------------------------
| JOVO PROJECT CONFIGURATION
|--------------------------------------------------------------------------
|
| Information used by the Jovo CLI to build and deploy projects
| Learn more here: www.jovo.tech/docs/project-config
|
*/
const project = new ProjectConfig({
plugins: [
// "Stageless" configuration for Alexa: Map 'en' model to 'en-US'
// @see https://www.jovo.tech/marketplace/platform-alexa/project-config
new AlexaCli({ locales: { en: ['en-US'] } }),
// "Stageless" configuration for Serverless
// @see https://www.jovo.tech/marketplace/target-serverless
new ServerlessCli({
service: 'jovo-sample',
provider: {
runtime: 'nodejs14.x',
iam: {
role: {
statements: [
{
Effect: 'Allow',
Action: [
// @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Operations.html
'dynamodb:CreateTable',
'dynamodb:DescribeTable',
'dynamodb:Query',
'dynamodb:Scan',
'dynamodb:GetItem',
'dynamodb:PutItem',
'dynamodb:UpdateItem',
'dynamodb:DeleteItem',
],
Resource: 'arn:aws:dynamodb:*:*:table/*',
},
],
},
},
},
functions: {
handler: {
url: true, // @see https://www.serverless.com/blog/aws-lambda-function-urls-with-serverless-framework
timeout: 7, // Sets the timeout to 7 seconds
},
},
}),
],
// @see https://www.jovo.tech/docs/project-config#staging
defaultStage: 'dev',
stages: {
dev: {
// @see https://www.jovo.tech/docs/webhook
endpoint: '${JOVO_WEBHOOK_URL}',
plugins: [
// Dev config for Alexa, gets merged into the stageless config
// @see https://www.jovo.tech/marketplace/platform-alexa/project-config
new AlexaCli({
skillId: process.env.ALEXA_SKILL_ID_DEV,
askProfile: process.env.ALEXA_ASK_PROFILE_DEV,
// Overrides the skill.json to change the Skill name
// @see https://www.jovo.tech/marketplace/platform-alexa/project-config#files
files: {
'skill-package/skill.json': {
manifest: {
publishingInformation: {
locales: {
'en-US': {
name: `${NAME} DEV`,
},
},
},
},
},
},
}),
// Dev config for Google Assistant
// @see https://www.jovo.tech/marketplace/platform-googleassistant/project-config
new GoogleAssistantCli({
projectId: process.env.GOOGLE_ACTION_PROJECT_ID_DEV,
// Overrides the settings.yaml to change the Action name
// @see https://www.jovo.tech/marketplace/platform-alexa/project-config#files
files: {
'settings/settings.yaml': {
localizedSettings: {
displayName: `${NAME} DEV`,
},
},
},
}),
],
// @see https://www.jovo.tech/docs/project-config#models
models: {
override: {
en: {
invocation: 'my dev test app',
},
},
},
},
prod: {
plugins: [
// Prod config for Alexa, gets merged into the stageless config
// @see https://www.jovo.tech/marketplace/platform-alexa/project-config
new AlexaCli({
skillId: process.env.ALEXA_SKILL_ID_PROD,
askProfile: process.env.ALEXA_ASK_PROFILE_PROD,
endpoint: process.env.LAMBDA_ARN_PROD,
// Overrides the skill.json to change the Skill name
// @see https://www.jovo.tech/marketplace/platform-alexa/project-config#files
files: {
'skill-package/skill.json': {
manifest: {
publishingInformation: {
locales: {
'en-US': {
name: `${NAME} PROD`,
},
},
},
},
},
},
}),
// Prod config for Google Assistant
// @see https://www.jovo.tech/marketplace/platform-googleassistant/project-config
new GoogleAssistantCli({
projectId: process.env.GOOGLE_ACTION_PROJECT_ID_PROD,
endpoint: process.env.LAMBDA_URL_PROD,
// Overrides the settings.yaml to change the Action name
// @see https://www.jovo.tech/marketplace/platform-alexa/project-config#files
files: {
'settings/settings.yaml': {
localizedSettings: {
displayName: `${NAME} PROD`,
},
},
},
}),
// Prod config for Serverless, gets merged into the stageless config
// @see https://www.jovo.tech/marketplace/target-serverless
new ServerlessCli({
provider: {
stage: 'prod',
environment: {
DYNAMODB_TABLE_NAME: 'jovo-sample-db',
},
},
functions: {
handler: {
events: [
{
alexaSkill: process.env.ALEXA_SKILL_ID_PROD,
},
],
},
},
}),
],
},
},
});
module.exports = project;