-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjovo.project.js
386 lines (370 loc) · 12.2 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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
const { ProjectConfig } = require('@jovotech/cli-core');
const { AlexaCli } = require('@jovotech/platform-alexa');
const { ServerlessCli } = require('@jovotech/target-serverless');
// https://developer.amazon.com/en-US/docs/alexa/custom-skills/choose-the-invocation-name-for-a-custom-skill.html
const INVOCATION_NAME_ALEXA_DE = 'Cocktail Party';
const INVOCATION_NAME_ALEXA_EN = 'Cocktail Party';
let ALEXA_PUBLISHING_INFORMATION_DE = (suffix) => ({
examplePhrases: [
'Alexa, öffne ' + INVOCATION_NAME_ALEXA_DE,
'Alexa, starte ' + INVOCATION_NAME_ALEXA_DE,
'Alexa, frage ' + INVOCATION_NAME_ALEXA_DE + ' nach Hilfe',
],
name: 'Cocktail Party - Jovo Template Projekt ' + suffix,
summary: 'Kurze Zusammenfassung',
description:
'Dies ist ein Beschreibungstext - Schicke [email protected] eine Mail und erzähle ihm, was Du mit diesem Template gemacht hast. ',
keywords: ['einige', 'tolle', 'tags'],
smallIconUri: 'https://via.placeholder.com/108/09f/09f.png',
largeIconUri: 'https://via.placeholder.com/512/09f/09f.png',
});
let ALEXA_PUBLISHING_INFORMATION_EN = (suffix) => ({
examplePhrases: [
'Alexa, open ' + INVOCATION_NAME_ALEXA_EN,
'Alexa, launch ' + INVOCATION_NAME_ALEXA_EN,
'Alexa, ask ' + INVOCATION_NAME_ALEXA_EN + ' for help',
],
name: 'Cocktail Party - Jovo Template Project ' + suffix,
summary: 'Some short summary text.',
description:
'Some description text - Send an email to [email protected] and tell him what you built using this template. ',
keywords: ['some', 'cool', 'keywords'],
smallIconUri: 'https://via.placeholder.com/108/09f/09f.png',
largeIconUri: 'https://via.placeholder.com/512/09f/09f.png',
});
/**
* List of all supportable APL interfaces. This correspondns to the selection in the "Build" => "Interfaces" => "Alexa Presentation Language " area within the Alexa Developer Console
*
* Simple remove what you don't need for your usecase.
*/
const interfaces = [
{
supportedViewports: [
{
maxHeight: 540,
maxWidth: 960,
minHeight: 540,
minWidth: 960,
mode: 'TV',
shape: 'RECTANGLE',
},
{
maxHeight: 599,
maxWidth: 599,
minHeight: 100,
minWidth: 100,
mode: 'HUB',
shape: 'ROUND',
},
{
maxHeight: 959,
maxWidth: 1279,
minHeight: 600,
minWidth: 960,
mode: 'HUB',
shape: 'RECTANGLE',
},
{
maxHeight: 1279,
maxWidth: 1920,
minHeight: 600,
minWidth: 1280,
mode: 'HUB',
shape: 'RECTANGLE',
},
{
maxHeight: 599,
maxWidth: 1279,
minHeight: 100,
minWidth: 960,
mode: 'HUB',
shape: 'RECTANGLE',
},
{
maxHeight: 1279,
maxWidth: 2560,
minHeight: 960,
minWidth: 1920,
mode: 'HUB',
shape: 'RECTANGLE',
},
{
maxHeight: 2560,
maxWidth: 1279,
minHeight: 1920,
minWidth: 960,
mode: 'HUB',
shape: 'RECTANGLE',
},
{
maxHeight: 1920,
maxWidth: 959,
minHeight: 320,
minWidth: 600,
mode: 'MOBILE',
shape: 'RECTANGLE',
},
{
maxHeight: 1920,
maxWidth: 1279,
minHeight: 320,
minWidth: 960,
mode: 'MOBILE',
shape: 'RECTANGLE',
},
{
maxHeight: 1920,
maxWidth: 1920,
minHeight: 320,
minWidth: 1280,
mode: 'MOBILE',
shape: 'RECTANGLE',
},
],
type: 'ALEXA_PRESENTATION_APL',
},
];
/*
|--------------------------------------------------------------------------
| 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 'de' model to 'de-DE'
// @see https://www.jovo.tech/marketplace/platform-alexa/project-config
new AlexaCli({ locales: { de: ['de-DE'], en: ['en-US', 'en-AU', 'en-IN', 'en-GB', 'en-CA'] } }),
// "Stageless" configuration for Serverless
// @see https://www.jovo.tech/marketplace/target-serverless
new ServerlessCli({
service: 'cocktail-party',
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}',
languageModel: {
de: {
invocation: INVOCATION_NAME_ALEXA_DE.toLowerCase() + ' test',
},
en: {
invocation: INVOCATION_NAME_ALEXA_EN.toLowerCase() + ' test',
},
},
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: {
'de-DE': ALEXA_PUBLISHING_INFORMATION_DE('TEST'),
'en-US': ALEXA_PUBLISHING_INFORMATION_EN('TEST'),
'en-AU': ALEXA_PUBLISHING_INFORMATION_EN('TEST'),
'en-GB': ALEXA_PUBLISHING_INFORMATION_EN('TEST'),
'en-CA': ALEXA_PUBLISHING_INFORMATION_EN('TEST'),
'en-IN': ALEXA_PUBLISHING_INFORMATION_EN('TEST'),
},
automaticDistribution: {
isActive: false,
},
isAvailableWorldwide: true,
testingInstructions: 'handle with care',
// https://developer.amazon.com/en-US/docs/alexa/smapi/skill-manifest.html#category-enum
category: 'EDUCATION_AND_REFERENCE',
distributionMode: 'PUBLIC',
distributionCountries: [],
},
apis: {
custom: {
interfaces,
},
},
privacyAndCompliance: {
locales: {
'de-DE': {
privacyPolicyUrl: '',
termsOfUseUrl: '',
},
'en-US': {
privacyPolicyUrl: '',
termsOfUseUrl: '',
},
'en-CA': {
privacyPolicyUrl: '',
termsOfUseUrl: '',
},
'en-IN': {
privacyPolicyUrl: '',
termsOfUseUrl: '',
},
'en-AU': {
privacyPolicyUrl: '',
termsOfUseUrl: '',
},
'en-GB': {
privacyPolicyUrl: '',
termsOfUseUrl: '',
},
},
allowsPurchases: false,
containsAds: false,
isExportCompliant: true,
isChildDirected: false,
usesPersonalInfo: false,
},
},
},
},
}),
],
},
prod: {
languageModel: {
de: {
invocation: INVOCATION_NAME_ALEXA_DE.toLowerCase(),
},
en: {
invocation: INVOCATION_NAME_ALEXA_EN.toLowerCase(),
},
},
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: {
'de-DE': ALEXA_PUBLISHING_INFORMATION_DE('PROD'),
'en-US': ALEXA_PUBLISHING_INFORMATION_EN('PROD'),
'en-AU': ALEXA_PUBLISHING_INFORMATION_EN('PROD'),
'en-GB': ALEXA_PUBLISHING_INFORMATION_EN('PROD'),
'en-CA': ALEXA_PUBLISHING_INFORMATION_EN('PROD'),
'en-IN': ALEXA_PUBLISHING_INFORMATION_EN('PROD'),
},
automaticDistribution: {
isActive: false,
},
isAvailableWorldwide: true,
testingInstructions: 'handle with care',
// https://developer.amazon.com/en-US/docs/alexa/smapi/skill-manifest.html#category-enum
category: 'EDUCATION_AND_REFERENCE',
distributionMode: 'PUBLIC',
distributionCountries: [],
},
apis: {
custom: {
interfaces,
},
},
privacyAndCompliance: {
locales: {
'de-DE': {
privacyPolicyUrl: '',
termsOfUseUrl: '',
},
'en-US': {
privacyPolicyUrl: '',
termsOfUseUrl: '',
},
'en-CA': {
privacyPolicyUrl: '',
termsOfUseUrl: '',
},
'en-IN': {
privacyPolicyUrl: '',
termsOfUseUrl: '',
},
'en-AU': {
privacyPolicyUrl: '',
termsOfUseUrl: '',
},
'en-GB': {
privacyPolicyUrl: '',
termsOfUseUrl: '',
},
},
allowsPurchases: false,
containsAds: false,
isExportCompliant: true,
isChildDirected: false,
usesPersonalInfo: false,
},
},
},
},
}),
// 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: 'cocktail-party-db',
},
},
functions: {
handler: {
events: [
{
alexaSkill: process.env.ALEXA_SKILL_ID_PROD,
},
],
},
},
}),
],
},
},
});
module.exports = project;