2019-07-11 14:45:50 -04:00
|
|
|
const ProjectDetailsHandler = require('../../app/src/Features/Project/ProjectDetailsHandler')
|
2019-02-14 05:49:32 -05:00
|
|
|
const Async = require('async')
|
|
|
|
|
|
|
|
const projectIds = [
|
|
|
|
// put ids here
|
|
|
|
]
|
|
|
|
|
|
|
|
Async.eachLimit(
|
|
|
|
projectIds,
|
|
|
|
5,
|
|
|
|
(projectId, cb) => {
|
|
|
|
ProjectDetailsHandler.setPublicAccessLevel(projectId, 'tokenBased', err => {
|
|
|
|
if (err) {
|
|
|
|
return cb(err)
|
|
|
|
}
|
|
|
|
console.log(
|
|
|
|
`>> Set public-access-level to tokenBased for project ${projectId}`
|
|
|
|
)
|
|
|
|
ProjectDetailsHandler.ensureTokensArePresent(projectId, (err, tokens) => {
|
|
|
|
if (err) {
|
|
|
|
return cb(err)
|
|
|
|
}
|
|
|
|
console.log(
|
|
|
|
`>> Re-generated tokens for project ${projectId}, ${JSON.stringify(
|
|
|
|
tokens
|
|
|
|
)}`
|
|
|
|
)
|
|
|
|
cb()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
err => {
|
|
|
|
if (err) {
|
|
|
|
throw err
|
|
|
|
}
|
|
|
|
console.log('>> Done')
|
|
|
|
process.exit(0)
|
|
|
|
}
|
|
|
|
)
|