2020-09-28 06:51:39 -04:00
|
|
|
let userOptions
|
|
|
|
try {
|
|
|
|
userOptions = require('../../data/onesky.json')
|
|
|
|
} catch (err) {
|
|
|
|
if (!process.env.ONE_SKY_PUBLIC_KEY) {
|
|
|
|
console.error(
|
|
|
|
'Cannot detect onesky credentials.\n\tDevelopers: see the docs at',
|
|
|
|
'https://github.com/overleaf/developer-manual/blob/master/code/translations.md#testing-translations-scripts',
|
|
|
|
'\n\tOps: environment variable ONE_SKY_PUBLIC_KEY is not set'
|
|
|
|
)
|
|
|
|
process.exit(1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function withAuth(options) {
|
|
|
|
return Object.assign(
|
|
|
|
options,
|
|
|
|
{
|
|
|
|
apiKey: process.env.ONE_SKY_PUBLIC_KEY,
|
|
|
|
secret: process.env.ONE_SKY_PRIVATE_KEY,
|
2021-04-27 03:52:58 -04:00
|
|
|
projectId: '25049',
|
2020-09-28 06:51:39 -04:00
|
|
|
},
|
|
|
|
userOptions
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
2021-04-27 03:52:58 -04:00
|
|
|
withAuth,
|
2020-09-28 06:51:39 -04:00
|
|
|
}
|