-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
172 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
fetch_users.js | ||
fetchUsers.js | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
const { tableEnv } = require('./dynamodb'); | ||
const { fetch_env, getStage, required_env } = require('./util'); | ||
const { fetchEnv, getStage, requiredEnv } = require('./util'); | ||
const resources = require('./resources'); | ||
|
||
module.exports.env = () => { | ||
let env_cache; | ||
return fetch_env() | ||
let envCache; | ||
return fetchEnv() | ||
.then(env => { | ||
const missing_env = required_env.filter(name => !(name in env)); | ||
if (missing_env.length > 0) { | ||
throw new Error(`Missing environment variables: ${missing_env.join(', ')}`); | ||
const missingEnv = requiredEnv.filter(name => !(name in env)); | ||
if (missingEnv.length > 0) { | ||
throw new Error(`Missing environment variables: ${missingEnv.join(', ')}`); | ||
} | ||
env_cache = env; | ||
envCache = env; | ||
return getStage(); | ||
}) | ||
.then(tableEnv) | ||
.then(tableEnv => Object.assign(env_cache, tableEnv)); | ||
.then(tableEnv => Object.assign(envCache, tableEnv)); | ||
}; | ||
|
||
module.exports.stage = getStage; | ||
|
||
module.exports.enableDomain = () => fetch_env() | ||
module.exports.enableDomain = () => fetchEnv() | ||
.then(env => 'DEPLOY_ALIAS' in env || 'SLS_STAGE' in process.env); | ||
|
||
module.exports.resources = resources; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
handler/__tests__/action_current_news.js → handler/__tests__/actionCurrentNews.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
handler/__tests__/action_current_time.js → handler/__tests__/actionCurrentTime.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
handler/__tests__/payload_faq.js → handler/__tests__/payloadFaq.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
handler/action_current_time.js → handler/actionCurrentTime.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
const moment = require('moment-timezone'); | ||
|
||
const current_time = chat => { | ||
const currentTime = chat => { | ||
const time = moment.tz('Europe/Berlin').format('HH:mm:ss'); | ||
return chat.sendText(`Die exakte Uhrzeit lautet: ${time}`); | ||
}; | ||
|
||
module.exports = current_time; | ||
module.exports = currentTime; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
|
||
module.exports = { | ||
actions: { | ||
current_time: require('./action_current_time'), | ||
current_news: require('./action_current_news'), | ||
subscriptions: require('./payload_subscribe').subscriptions, | ||
'current_time': require('./actionCurrentTime'), | ||
'current_news': require('./actionCurrentNews'), | ||
'subscriptions': require('./payloadSubscribe').subscriptions, | ||
}, | ||
payloads: { | ||
report_start: require('./payload_report_start'), | ||
fragment_next: require('./payload_fragment_next'), | ||
faq: require('./payload_faq'), | ||
pushOutro: require('./payloadPushOutro'), | ||
subscriptions: require('./payload_subscribe').subscriptions, | ||
subscribe: require('./payload_subscribe').subscribe, | ||
unsubscribe: require('./payload_subscribe').unsubscribe, | ||
share: require('./payload_share.js'), | ||
current_news: require('./action_current_news'), | ||
'report_start': require('./payloadReportStart'), | ||
'fragment_next': require('./payloadFragmentNext'), | ||
'faq': require('./payloadFaq'), | ||
'push_outro': require('./payloadPushOutro'), | ||
'subscriptions': require('./payloadSubscribe').subscriptions, | ||
'subscribe': require('./payloadSubscribe').subscribe, | ||
'unsubscribe': require('./payloadSubscribe').unsubscribe, | ||
'share': require('./payloadShare.js'), | ||
'current_news': require('./actionCurrentNews'), | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Oops, something went wrong.