Skip to content

Commit

Permalink
Super Admin Service Dependency Update (#1922)
Browse files Browse the repository at this point in the history
* update dependencies

* refactor to new arango-tools version

* switch over to bcryptjs
  • Loading branch information
nsdeschenes committed Mar 18, 2021
1 parent a6d4a0a commit 002c258
Show file tree
Hide file tree
Showing 13 changed files with 8,791 additions and 853 deletions.
19 changes: 19 additions & 0 deletions services/super-admin/database-options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const databaseOptions = ({ rootPass }) => [
{ type: 'user', username: 'root', password: rootPass },
{
type: 'documentcollection',
name: 'users',
},
{
type: 'documentcollection',
name: 'organizations',
},
{
type: 'edgecollection',
name: 'affiliations',
},
]

module.exports = {
databaseOptions,
}
17 changes: 10 additions & 7 deletions services/super-admin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@ require('dotenv-safe').config({

const { DB_PASS: rootPass, DB_URL: url, DB_NAME: databaseName } = process.env

const bcrypt = require('bcrypt')
const { ArangoTools } = require('arango-tools')
const { makeMigrations } = require('./migrations')
const bcrypt = require('bcryptjs')
const { ensure } = require('arango-tools')
const { databaseOptions } = require('./database-options')

const { superAdminService } = require('./src')

;(async () => {
// Generate Database information
const { migrate } = await ArangoTools({ rootPass, url })
const { query, collections, transaction } = await migrate(
makeMigrations({ databaseName, rootPass }),
)
const { query, collections, transaction } = await ensure({
type: 'database',
name: databaseName,
url,
rootPassword: rootPass,
options: databaseOptions({ rootPass }),
})

await superAdminService({ query, collections, transaction, bcrypt })
})()
131 changes: 0 additions & 131 deletions services/super-admin/migrations.js

This file was deleted.

0 comments on commit 002c258

Please sign in to comment.