chore: cleanup, node14 and new admin default
This commit is contained in:
parent
c7c18633d7
commit
89bb9a8f25
244 changed files with 3957 additions and 39487 deletions
|
|
@ -1,11 +1,21 @@
|
|||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
|
||||
const _ = require('lodash/fp')
|
||||
|
||||
const db = require('../db')
|
||||
const configValidate = require('../config-validate')
|
||||
const configValidate = require('./config-validate')
|
||||
const config = require('./config')
|
||||
const ph = require('../plugin-helper')
|
||||
|
||||
const schemas = ph.loadSchemas()
|
||||
function loadSchemas () {
|
||||
const schemasRoot = path.resolve(__dirname, 'schemas')
|
||||
const schemaFiles = fs.readdirSync(schemasRoot)
|
||||
const stripJson = fileName => fileName.slice(0, -5)
|
||||
const readSchema = fileName => JSON.parse(fs.readFileSync(path.resolve(schemasRoot, fileName)))
|
||||
return _.zipObject(_.map(stripJson, schemaFiles), _.map(readSchema, schemaFiles))
|
||||
}
|
||||
|
||||
const schemas = loadSchemas()
|
||||
|
||||
function fetchAccounts () {
|
||||
return db.oneOrNone('select data from user_config where type=$1 and schema_version=$2', ['accounts', configValidate.SETTINGS_LOADER_SCHEMA_VERSION])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue