Commit 5016e7ce authored by Giannis Kopanas's avatar Giannis Kopanas Committed by Alexandros Georgantas

feat(seedapplicationparameter): seed database with config for app

parent fe4af9b0
......@@ -13,6 +13,7 @@
"pubsweet-component-theme-editoria",
"editoria-component-login",
"editoria-component-signup",
"editoria-data-model/src/applicationParameter",
"editoria-data-model/src/book",
"editoria-data-model/src/lock",
"editoria-data-model/src/bookCollection",
......
#!/usr/bin/env node
const logger = require('@pubsweet/logger')
const {
model: ApplicationParameter,
} = require('editoria-data-model/src/applicationParameter')
const config = require('../config/modules/book-builder')
const seed = async () => {
const areas = Object.keys(config)
await Promise.all(
areas.map(async area => {
const parameters = await new ApplicationParameter({
context: 'bookBuilder',
area,
config: config[area],
}).save()
logger.info(
`New Application Parameter created: ${JSON.parse(config[area])}`,
)
return parameters
}),
)
}
seed()
......@@ -13201,11 +13201,6 @@ pkginfo@0.3.x:
resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.3.1.tgz#5b29f6a81f70717142e09e765bbeab97b4f81e21"
integrity sha1-Wyn2qB9wcXFC4J52W76rl7T4HiE=
pkginfo@0.x.x:
version "0.4.1"
resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.1.tgz#b5418ef0439de5425fc4995042dced14fb2a84ff"
integrity sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8=
platform@1.3.5:
version "1.3.5"
resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.5.tgz#fb6958c696e07e2918d2eeda0f0bc9448d733444"
......@@ -13836,19 +13831,7 @@ promisify-event@^1.0.0:
dependencies:
pinkie-promise "^2.0.0"
prompt@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/prompt/-/prompt-1.0.0.tgz#8e57123c396ab988897fb327fd3aedc3e735e4fe"
integrity sha1-jlcSPDlquYiJf7Mn/Trtw+c15P4=
dependencies:
colors "^1.1.2"
pkginfo "0.x.x"
read "1.0.x"
revalidator "0.1.x"
utile "0.3.x"
winston "2.1.x"
prompt@flatiron/prompt#1c95d1d8d333b5fbc13fa5f0619f3dcf0d514f87:
prompt@^1.0.0, prompt@flatiron/prompt#1c95d1d8d333b5fbc13fa5f0619f3dcf0d514f87:
version "1.0.0"
resolved "https://codeload.github.com/flatiron/prompt/tar.gz/1c95d1d8d333b5fbc13fa5f0619f3dcf0d514f87"
dependencies:
......@@ -18213,19 +18196,6 @@ winston@0.8.x:
pkginfo "0.3.x"
stack-trace "0.0.x"
winston@2.1.x:
version "2.1.1"
resolved "https://registry.yarnpkg.com/winston/-/winston-2.1.1.tgz#3c9349d196207fd1bdff9d4bc43ef72510e3a12e"
integrity sha1-PJNJ0ZYgf9G9/51LxD73JRDjoS4=
dependencies:
async "~1.0.0"
colors "1.0.x"
cycle "1.0.x"
eyes "0.1.x"
isstream "0.1.x"
pkginfo "0.3.x"
stack-trace "0.0.x"
winston@2.x, winston@^2.2.0:
version "2.4.4"
resolved "https://registry.yarnpkg.com/winston/-/winston-2.4.4.tgz#a01e4d1d0a103cf4eada6fc1f886b3110d71c34b"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment