summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJannik Schönartz2018-07-17 04:43:31 +0200
committerJannik Schönartz2018-07-17 04:43:31 +0200
commite4c4d0e3d7dc7be7ac233cd6c9b90ae92fb1a5b3 (patch)
tree0c40021f77fea9688449c9c4d6e6222a809ec3d6 /server
parent[webapp] renamed components (diff)
downloadbas-e4c4d0e3d7dc7be7ac233cd6c9b90ae92fb1a5b3.tar.gz
bas-e4c4d0e3d7dc7be7ac233cd6c9b90ae92fb1a5b3.tar.xz
bas-e4c4d0e3d7dc7be7ac233cd6c9b90ae92fb1a5b3.zip
[server] Fixed eslint errors. (Standard ESLint is used)
Diffstat (limited to 'server')
-rw-r--r--server/api/backends.js127
-rw-r--r--server/api/clients.js34
-rw-r--r--server/api/ipxe-loader.js10
-rw-r--r--server/api/locations.js20
-rw-r--r--server/api/permissions.js42
-rw-r--r--server/api/user.js52
-rw-r--r--server/app.js60
-rwxr-xr-xserver/bin/www62
-rw-r--r--server/lib/authentication.js366
-rw-r--r--server/lib/database.js14
-rw-r--r--server/lib/external-backends/backends/another-backend.js10
-rw-r--r--server/lib/external-backends/backends/dummy-backend.js10
-rw-r--r--server/lib/external-backends/backends/template-backend.js10
-rw-r--r--server/lib/external-backends/external-backends.js48
-rw-r--r--server/lib/nodemailer.js60
-rw-r--r--server/lib/sequelize.js33
-rw-r--r--server/lib/shell.js64
-rw-r--r--server/lib/tftp.js40
-rw-r--r--server/migrations/20180522185323-create-user.js8
-rw-r--r--server/migrations/20180715193710-create-backend.js8
-rw-r--r--server/models/backend.js20
-rw-r--r--server/models/role.js20
-rw-r--r--server/models/user.js20
-rw-r--r--server/models/user_x_role.js27
-rw-r--r--server/package-lock.json1037
-rw-r--r--server/package.json2
-rw-r--r--server/router.js66
27 files changed, 1618 insertions, 652 deletions
diff --git a/server/api/backends.js b/server/api/backends.js
index e3e6014..fd2657b 100644
--- a/server/api/backends.js
+++ b/server/api/backends.js
@@ -1,75 +1,76 @@
/* global __appdir */
-const path = require('path');
-const ExternalBackends = require(path.join(__appdir, 'lib', 'external-backends', 'external-backends.js'));
-var db = require(path.join(__appdir, 'lib', 'sequelize'));
+const path = require('path')
+const ExternalBackends = require(path.join(__appdir, 'lib', 'external-backends', 'external-backends.js'))
+var db = require(path.join(__appdir, 'lib', 'sequelize'))
module.exports = {
- getCredentialsByType: function(req, res) {
- const backendType = req.query.type;
- const b = new ExternalBackends();
- const instance = b.getInstance(backendType);
- res.status(200).send(instance.getCredentials());
- },
+ getCredentialsByType: function (req, res) {
+ const backendType = req.query.type
+ const b = new ExternalBackends()
+ const instance = b.getInstance(backendType)
+ if (instance === null) {
+ res.status(500).send({ auth: false, status: 'TYPE_INVALID', error_message: 'The provided backend type is invalid.' })
+ }
+
+ res.status(200).send(instance.getCredentials())
+ },
- getBackendInfoById: function(req, res) {
- // TODO: Test (Not used for now) needed for edit // TODO: // TODO:
- const backendId = req.query.id;
- db.backend.findOne({ where: { id: backendId } }).then(backend => {
- const b = {
- backendId: backendId,
- backendName: backend.name,
- backendType: backend.type,
- backendCredentials: backend.credentials
- }
- res.status(200).send(b);
- });
- },
+ getBackendInfoById: function (req, res) {
+ const backendId = req.query.id
+ db.backend.findOne({ where: { id: backendId } }).then(backend => {
+ const b = {
+ backendId: backendId,
+ backendName: backend.name,
+ backendType: backend.type,
+ backendCredentials: backend.credentials
+ }
+ res.status(200).send(b)
+ })
+ },
- getBackendTypes: function(req, res) {
+ getBackendTypes: function (req, res) {
+ const backends = new ExternalBackends()
+ var files = backends.getBackends()
- const backends = new ExternalBackends();
- var files = backends.getBackends();
-
- for (var i = 0; i < files.length; i++) {
-
- // Cut off -backends.js
- files[i] = files[i].slice(0, -11);
- }
-
- res.status(200).send(files);
- },
+ for (var i = 0; i < files.length; i++) {
+ // Cut off -backends.js
+ files[i] = files[i].slice(0, -11)
+ }
- getBackendList: function(req, res) {
- db.backend.findAll({
- attributes: ['id', 'name', 'type']
- }).then(function (backends) {
- res.status(200).send(backends);
- });
- },
+ res.status(200).send(files)
+ },
- // POST REQUESTS
- saveBackend: function(req, res) {
- // Save credentials in the db.
- const formData = req.body;
- const credentialString = JSON.stringify(formData.backendCredentials);
+ getBackendList: function (req, res) {
+ db.backend.findAll({
+ attributes: ['id', 'name', 'type']
+ }).then(function (backends) {
+ res.status(200).send(backends)
+ })
+ },
- if (formData.backendId == 0) {
- // Insert new backend in the db.
- db.backend.create({ name: formData.backendName, type: formData.backendType, credentials: credentialString });
- } else {
- // Update an existing backend in the db.
- db.backend.update({ name: formData.backendName, type: formData.backendType, credentials: credentialString }, {where: {id: formData.backendId} });
- }
- //db.backend.findOne({})
-
- res.status(200).send('success');
- },
+ // POST REQUESTS
+ saveBackend: function (req, res) {
+ // Save credentials in the db.
+ const formData = req.body
+ const credentialString = JSON.stringify(formData.backendCredentials)
- deleteBackendById: function(req, res) {
- const backendId = req.body.id;
-
- db.backend.destroy({ where: { id: backendId } }).then(function() {
- res.status(200).send('success');
- });
+ if (formData.backendId === 0) {
+ // Insert new backend in the db.
+ db.backend.create({ name: formData.backendName, type: formData.backendType, credentials: credentialString })
+ } else {
+ // Update an existing backend in the db.
+ db.backend.update({ name: formData.backendName, type: formData.backendType, credentials: credentialString }, { where: { id: formData.backendId } })
}
+ // db.backend.findOne({})
+
+ res.status(200).send('success')
+ },
+
+ deleteBackendById: function (req, res) {
+ const backendId = req.body.id
+
+ db.backend.destroy({ where: { id: backendId } }).then(function () {
+ res.status(200).send('success')
+ })
+ }
}
diff --git a/server/api/clients.js b/server/api/clients.js
index 53aeb9d..f7fe455 100644
--- a/server/api/clients.js
+++ b/server/api/clients.js
@@ -1,20 +1,20 @@
/* global __appdir */
-var path = require('path');
-var db = require(path.join(__appdir, 'lib', 'sequelize'));
+var path = require('path')
+var db = require(path.join(__appdir, 'lib', 'sequelize'))
module.exports = {
- get: function(req, res) {
- //db.sequelize.authenticate()
- //.then(() => { console.log('Connection has been established successfully.'); })
- //.catch(err => { console.error('Unable to connect to the database:', err); });
-
- //db.users2.create({ username: "wasd", password: "wasd", email: "w@a.de", name: "wa"});
- db.users2.findOne({ where: { username: 'wasd' } }).then(user => {
- console.log(user.get('username'));
- });
- res.end();
- },
- post: function(req, res) {
-
- }
-} \ No newline at end of file
+ get: function (req, res) {
+ // db.sequelize.authenticate()
+ // .then(() => { console.log('Connection has been established successfully.'); })
+ // .catch(err => { console.error('Unable to connect to the database:', err); });
+
+ // db.users2.create({ username: "wasd", password: "wasd", email: "w@a.de", name: "wa"});
+ db.users2.findOne({ where: { username: 'wasd' } }).then(user => {
+ console.log(user.get('username'))
+ })
+ res.end()
+ },
+ post: function (req, res) {
+
+ }
+}
diff --git a/server/api/ipxe-loader.js b/server/api/ipxe-loader.js
index 57c152f..e75ce72 100644
--- a/server/api/ipxe-loader.js
+++ b/server/api/ipxe-loader.js
@@ -1,7 +1,7 @@
module.exports = {
- loadScript: function(req, res) {
- res.setHeader('content-type', 'text/plain');
- res.status(200).send(`#!ipxe
+ loadScript: function (req, res) {
+ res.setHeader('content-type', 'text/plain')
+ res.status(200).send(`#!ipxe
dhcp
:start
@@ -37,6 +37,6 @@ boot
:sh
shell
-goto start`);
- }
+goto start`)
+ }
}
diff --git a/server/api/locations.js b/server/api/locations.js
index c72ff93..7595837 100644
--- a/server/api/locations.js
+++ b/server/api/locations.js
@@ -1,13 +1,13 @@
-/* global __appdir */
-//var path = require('path');
+// /* global __appdir */
+// var path = require('path');
module.exports = {
- get: function(req, res) {
- console.log('You successfully called an authentication call!');
- res.send('You successfully called an authentication call!');
- },
- post: function(req, res) {
- console.log('You successfully called an unauthentication call!');
- res.send('You successfully called an unauthentication call!');
- }
+ get: function (req, res) {
+ console.log('You successfully called an authentication call!')
+ res.send('You successfully called an authentication call!')
+ },
+ post: function (req, res) {
+ console.log('You successfully called an unauthentication call!')
+ res.send('You successfully called an unauthentication call!')
+ }
}
diff --git a/server/api/permissions.js b/server/api/permissions.js
index bf24462..52cd110 100644
--- a/server/api/permissions.js
+++ b/server/api/permissions.js
@@ -1,28 +1,28 @@
/* global __appdir */
-var path = require('path');
-var db = require(path.join(__appdir, 'lib', 'sequelize'));
+var path = require('path')
+var db = require(path.join(__appdir, 'lib', 'sequelize'))
module.exports = {
- // Return ID, Description and Name of a given RoleID
- getRoleById: function(req, res) {
- var roleid = req.params.roleid;
- db.role.findById(roleid).then(role_db => {
- var role = { };
- role.id = role_db.id;
- role.descr = role_db.descr;
- role.name = role_db.name;
- res.status(200).send(role);
- });
- },
- // Return all RoleIDs associated to a given UserID
- getRolesByUserid: function(req, res) {
- // var userid = req.query.userid;
- // the usersxroles (and rolesxpermissions) models first have to get created
- /* db.usersxroles.findAndCountAll({ where: { id: userid }, attributes: ['roleid'] }).then(roles_db => {
+ // Return ID, Description and Name of a given RoleID
+ getRoleById: function (req, res) {
+ var roleid = req.params.roleid
+ db.role.findById(roleid).then(robeDb => {
+ var role = { }
+ role.id = robeDb.id
+ role.descr = robeDb.descr
+ role.name = robeDb.name
+ res.status(200).send(role)
+ })
+ },
+ // Return all RoleIDs associated to a given UserID
+ getRolesByUserid: function (req, res) {
+ // var userid = req.query.userid;
+ // the usersxroles (and rolesxpermissions) models first have to get created
+ /* db.usersxroles.findAndCountAll({ where: { id: userid }, attributes: ['roleid'] }).then(roles_db => {
var result = { };
result.count = roles_db.count;
result.roles = roles_db.rows;
res.status(200).send(result);
- });*/
- }
-} \ No newline at end of file
+ }); */
+ }
+}
diff --git a/server/api/user.js b/server/api/user.js
index e42e26b..0565d58 100644
--- a/server/api/user.js
+++ b/server/api/user.js
@@ -1,30 +1,30 @@
/* global __appdir */
-var path = require('path');
-//var db = require(path.join(__appdir, 'lib', 'database')).connectionPool;
-var db = require(path.join(__appdir, 'lib', 'sequelize'));
-var jwt = require('jsonwebtoken');
+var path = require('path')
+// var db = require(path.join(__appdir, 'lib', 'database')).connectionPool;
+var db = require(path.join(__appdir, 'lib', 'sequelize'))
+var jwt = require('jsonwebtoken')
module.exports = {
- info: function(req, res) {
- // Because veryfyToken was succesfully excecuted the request has the attribute token.
- const token = req.token;
- // Decode the token.
- var decoded = jwt.decode(token, {complete: true});
- var userid = decoded.payload.user.id;
-
- //db.query('SELECT * FROM users WHERE id=?', [userid], function(err, rows) {
- db.user.findOne({ where: { id: userid } }).then(user_db => {
- //if (err) return res.status(500).send({ auth: false, status: 'DATABASE_ERROR', error_message: 'SQL query failed.' });
- //user.id = rows[0].id;
- //user.username = rows[0].username;
- //user.email = rows[0].email;
- //user.name = rows[0].name;
- var user = { };
- user.id = user_db.id;
- user.username = user_db.username;
- user.email = user_db.email;
- user.name = user_db.name;
- res.status(200).send(user);
- });
- }
+ info: function (req, res) {
+ // Because veryfyToken was succesfully excecuted the request has the attribute token.
+ const token = req.token
+ // Decode the token.
+ var decoded = jwt.decode(token, {complete: true})
+ var userid = decoded.payload.user.id
+
+ // db.query('SELECT * FROM users WHERE id=?', [userid], function(err, rows) {
+ db.user.findOne({ where: { id: userid } }).then(userDb => {
+ // if (err) return res.status(500).send({ auth: false, status: 'DATABASE_ERROR', error_message: 'SQL query failed.' });
+ // user.id = rows[0].id;
+ // user.username = rows[0].username;
+ // user.email = rows[0].email;
+ // user.name = rows[0].name;
+ var user = { }
+ user.id = userDb.id
+ user.username = userDb.username
+ user.email = userDb.email
+ user.name = userDb.name
+ res.status(200).send(user)
+ })
+ }
}
diff --git a/server/app.js b/server/app.js
index 0a72576..8a18b58 100644
--- a/server/app.js
+++ b/server/app.js
@@ -1,56 +1,56 @@
-var createError = require('http-errors');
-var express = require('express');
-var cookieParser = require('cookie-parser');
-var compression = require('compression');
+var createError = require('http-errors')
+var express = require('express')
+var cookieParser = require('cookie-parser')
+var compression = require('compression')
-var path = require('path');
-var fs = require('fs');
+var path = require('path')
+// var fs = require('fs')
-var app = express();
+var app = express()
-global.__appdir = __dirname;
+global.__appdir = __dirname
-var tftp = require('./lib/tftp');
+var tftp = require('./lib/tftp')
// ############################################################################
// ########################### setup middleware ###############################
-app.use(compression());
-app.use(express.json());
-app.use(express.urlencoded({ extended: false }));
+app.use(compression())
+app.use(express.json())
+app.use(express.urlencoded({ extended: false }))
-var logger = require('morgan');
-app.use(logger('dev'));
-app.use(cookieParser());
+var logger = require('morgan')
+app.use(logger('dev'))
+app.use(cookieParser())
// ############################################################################
// ########################### setup routes ##################################
-app.use(express.static('public'));
+app.use(express.static('public'))
-var apiRouter = require(path.join(__dirname, 'router'));
-app.use('/api', apiRouter);
+var apiRouter = require(path.join(__dirname, 'router'))
+app.use('/api', apiRouter)
// ############################################################################
// ######################### handle http errors ###############################
// catch 404 and forward to error handler
-app.use(function(req, res, next) {
- next(createError(404));
-});
+app.use(function (req, res, next) {
+ next(createError(404))
+})
// error handler
-app.use(function(err, req, res, next) {
- // set locals, only providing error in development
- res.locals.message = err.message;
- res.locals.error = req.app.get('env') === 'development' ? err : {};
+app.use(function (err, req, res, next) {
+ // set locals, only providing error in development
+ res.locals.message = err.message
+ res.locals.error = req.app.get('env') === 'development' ? err : {}
- // render the error page
- res.status(err.status || 500);
- res.end();
-});
+ // render the error page
+ res.status(err.status || 500)
+ res.end()
+})
// ############################################################################
// ############################################################################
-module.exports = app;
+module.exports = app
diff --git a/server/bin/www b/server/bin/www
index 735e309..512fe54 100755
--- a/server/bin/www
+++ b/server/bin/www
@@ -4,18 +4,18 @@
* Module dependencies.
*/
-var app = require('../app');
-var debug = require('debug')('bas:server');
-var http = require('http');
-var https = require('https');
-var fs = require('fs');
+var app = require('../app')
+var debug = require('debug')('bas:server')
+// var http = require('http')
+var https = require('https')
+var fs = require('fs')
/**
* Get port from environment and store in Express.
*/
-var port = normalizePort(process.env.PORT || '3000');
-app.set('port', port);
+var port = normalizePort(process.env.PORT || '3000')
+app.set('port', port)
/**
* Create HTTP server.
@@ -24,62 +24,62 @@ app.set('port', port);
var options = {
key: fs.readFileSync('./bin/privkey.pem'),
cert: fs.readFileSync('./bin/fullchain.pem')
-};
-var server = https.createServer(options, app);
+}
+var server = https.createServer(options, app)
/**
* Listen on provided port, on all network interfaces.
*/
-server.listen(port);
-server.on('error', onError);
-server.on('listening', onListening);
+server.listen(port)
+server.on('error', onError)
+server.on('listening', onListening)
/**
* Normalize a port into a number, string, or false.
*/
-function normalizePort(val) {
- var port = parseInt(val, 10);
+function normalizePort (val) {
+ var port = parseInt(val, 10)
if (isNaN(port)) {
// named pipe
- return val;
+ return val
}
if (port >= 0) {
// port number
- return port;
+ return port
}
- return false;
+ return false
}
/**
* Event listener for HTTP server 'error' event.
*/
-function onError(error) {
+function onError (error) {
if (error.syscall !== 'listen') {
- throw error;
+ throw error
}
var bind = typeof port === 'string'
? 'Pipe ' + port
- : 'Port ' + port;
+ : 'Port ' + port
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
- console.error(bind + ' requires elevated privileges');
- process.exit(1);
- break;
+ console.error(bind + ' requires elevated privileges')
+ process.exit(1)
+ // break
case 'EADDRINUSE':
- console.error(bind + ' is already in use');
- process.exit(1);
- break;
+ console.error(bind + ' is already in use')
+ process.exit(1)
+ // break
default:
- throw error;
+ throw error
}
}
@@ -87,10 +87,10 @@ function onError(error) {
* Event listener for HTTP server 'listening' event.
*/
-function onListening() {
- var addr = server.address();
+function onListening () {
+ var addr = server.address()
var bind = typeof addr === 'string'
? 'pipe ' + addr
- : 'port ' + addr.port;
- debug('Listening on ' + bind);
+ : 'port ' + addr.port
+ debug('Listening on ' + bind)
}
diff --git a/server/lib/authentication.js b/server/lib/authentication.js
index 3a4dccd..b8ee506 100644
--- a/server/lib/authentication.js
+++ b/server/lib/authentication.js
@@ -1,203 +1,193 @@
/* global __appdir */
-var jwt = require('jsonwebtoken');
-var path = require('path');
-var config = require(path.join(__appdir, 'config', 'authentication'));
-//var db = require(path.join(__appdir, 'lib', 'database')).connectionPool;
-var db = require(path.join(__appdir, 'lib', 'sequelize'));
-var securePassword = require('secure-password');
-var pwd = securePassword();
+var jwt = require('jsonwebtoken')
+var path = require('path')
+var config = require(path.join(__appdir, 'config', 'authentication'))
+// var db = require(path.join(__appdir, 'lib', 'database')).connectionPool;
+var db = require(path.join(__appdir, 'lib', 'sequelize'))
+var securePassword = require('secure-password')
+var pwd = securePassword()
module.exports = {
- // Authentifivation method for the frontend using secure httpOnly cookies. (POST)
- login: function(req, res) {
- var params = req.body;
-
- verifyUser(res, params.username, params.password, function(token) {
- // The token has the form header.payload.signature
- // We split the cookie in header.payload and signature in two seperate cookies.
- // The signature cookie is httpOnly so JavaScript never has access to the full cookie.
- // Read more at: https://medium.com/lightrail/getting-token-authentication-right-in-a-stateless-single-page-application-57d0c6474e3
- const split = token.split('.');
- const headerPayload = split[0] + '.' + split[1];
- const signature = split[2];
- res.cookie('jwt_hp', headerPayload, { secure: true, httpOnly: false, sameSite: 'strict'});
- res.cookie('jwt_s', signature, { secure: true, httpOnly: true, sameSite: 'strict'});
- return res.status(200).send({ auth: true, status: 'VALID' });
- });
- },
-
- // Authentification method for the API using the authorization header. (GET)
- auth: function(req, res) {
- var query = req.query;
-
- verifyUser(res, query.username, query.password, function(token) {
- return res.status(200).send({ auth: true, token });
- });
- },
-
- signup: function(req, res) {
- // TODO: Implement some security stuff. Not every user who call this request should be able to sign up.
-
- var params = req.body;
-
- if (!params.username) return res.status(500).send({ auth: false, status: 'USER_MISSING', error_message: 'This service requires an username.' });
- if (!params.password) return res.status(500).send({ auth: false, status: 'PASSWORD_MISSING', error_message: 'This services requires a password.' });
- if (!params.email) return res.status(500).send({ auth: false, status: 'EMAIL_MISSING', error_message: 'This services requires an email.' });
-
- // Database and user validation.
- //SEQ//db.query('SELECT * FROM users WHERE username = ?', [params.username], function(err, rows) {
- db.user.findOne({ where: { username: params.username } }).then(user_db => {
- //SEQ//if (err) return res.status(500).send({ auth: false, status: 'DATABASE_ERROR', error_message: 'SQL query failed.' });
-
- // User exists validation.
- //SEQ//if (rows.length) return res.status(500).send({ auth: false, status: 'USER_ALREADY_EXISTS', error_message: 'The provided username already exists.' });
- if (user_db) return res.status(500).send({ auth: false, status: 'USER_ALREADY_EXISTS', error_message: 'The provided username already exists.' });
-
- // Password requirements validation.
- if (!validatePassword(params.password)) return res.status(500).send({ auth: false, status: 'PASSWORD_REQUIREMENTS', error_message: 'The password requirements are not fullfilled.' });
-
- // Email validation.
- if (!validateEmail(params.email)) return res.status(500).send({ auth: false, status: 'EMAIL_INVALID', error_message: 'The provided email is invalid.' });
-
- var userPassword = Buffer.from(params.password);
-
- // Register user
- pwd.hash(userPassword, function(err, hash) {
- if (err) return res.status(500).send({ auth: false, status: 'PASSWORD_HASH_ERROR', error_message: 'Hashing the password failed.' });
-
- // Saving the non improved hash and creating the user in the db.
- //SEQ//var att = [params.username, hash, params.email, params.name];
- //SEQ//db.query('INSERT INTO users (username, password, email, name) VALUES (?)', [att], function(err, result) {
- db.user.create({ username: params.username, password: hash, email: params.email, name: params.name }).then((user_db) => {
- //SEQ//if (err) return res.status(500).send({ auth: false, status: 'DATABASE_INSERT_ERROR', error_message: 'Inserting the user in the database failed.' });
- // TODO: Username could also be used because those are unique as well.
- //SEQ//var userId = result.insertId;
- var userId = user_db.id;
-
- // Verify & improving the hash.
- verifyHash(res, userPassword, hash, userId, function() {
- return res.status(200).send({ auth: true, status: 'VALID'});
- });
- });
- });
- });
- },
-
- // Logout method for the frontend. Deleting the cookies by overwriting them.
- logout: function(req, res) {
- // End session properly.
-
- res.clearCookie('jwt_hp');
- res.clearCookie('jwt_s');
- return res.status(200).send();
-
- // TODO: Implement.. blacklisting for jwt's and destroy the cookies..
- // Maybe use express-jwt and use the rewoke function.
- },
-
- changePassword: function(req, res) {
- // TODO: IMPLEMENT
- },
-
- verifyToken: function(req, res, next) {
- var token = '';
- // Check for the token in the authorization header or in the cookies. Else return with auth: false.
- if (req.headers['authorization']) {
- var authorization = req.headers['authorization'];
- // Authorization: Bearer <token>
- // Split the bearer token.
- const bearer = authorization.split(' ');
- token = bearer[1];
- } else if (req.cookies.jwt_hp && req.cookies.jwt_s) {
- token = req.cookies.jwt_hp + '.' + req.cookies.jwt_s;
- } else {
- return res.status(403).send({ auth: false, status: 'TOKEN_MISSING', error_message: 'This service requires a token.' });
- }
- // Verify the token with the secret.
- jwt.verify(token, config.secret, function(err) {
- if (err) return res.status(500).send({ auth: false, status: 'TOKEN_INVALID', error_message: 'The provided token is invalid.' });
- req.token = token;
- next();
- });
+ // Authentifivation method for the frontend using secure httpOnly cookies. (POST)
+ login: function (req, res) {
+ var params = req.body
+
+ verifyUser(res, params.username, params.password, function (token) {
+ // The token has the form header.payload.signature
+ // We split the cookie in header.payload and signature in two seperate cookies.
+ // The signature cookie is httpOnly so JavaScript never has access to the full cookie.
+ // Read more at: https://medium.com/lightrail/getting-token-authentication-right-in-a-stateless-single-page-application-57d0c6474e3
+ const split = token.split('.')
+ const headerPayload = split[0] + '.' + split[1]
+ const signature = split[2]
+ res.cookie('jwt_hp', headerPayload, { secure: true, httpOnly: false, sameSite: 'strict' })
+ res.cookie('jwt_s', signature, { secure: true, httpOnly: true, sameSite: 'strict' })
+ return res.status(200).send({ auth: true, status: 'VALID' })
+ })
+ },
+ // Authentification method for the API using the authorization header. (GET)
+ auth: function (req, res) {
+ var query = req.query
+
+ verifyUser(res, query.username, query.password, function (token) {
+ return res.status(200).send({ auth: true, token })
+ })
+ },
+
+ signup: function (req, res) {
+ // TODO: Implement some security stuff. Not every user who call this request should be able to sign up.
+
+ var params = req.body
+ if (!params.username) return res.status(500).send({ auth: false, status: 'USER_MISSING', error_message: 'This service requires an username.' })
+ if (!params.password) return res.status(500).send({ auth: false, status: 'PASSWORD_MISSING', error_message: 'This services requires a password.' })
+ if (!params.email) return res.status(500).send({ auth: false, status: 'EMAIL_MISSING', error_message: 'This services requires an email.' })
+ // Database and user validation.
+ // SEQ//db.query('SELECT * FROM users WHERE username = ?', [params.username], function (err, rows) {
+ db.user.findOne({ where: { username: params.username } }).then(userDb => {
+ // SEQ//if (err) return res.status(500).send({ auth: false, status: 'DATABASE_ERROR', error_message: 'SQL query failed.' });
+ // User exists validation.
+ // SEQ//if (rows.length) return res.status(500).send({ auth: false, status: 'USER_ALREADY_EXISTS', error_message: 'The provided username already exists.' });
+ if (userDb) return res.status(500).send({ auth: false, status: 'USER_ALREADY_EXISTS', error_message: 'The provided username already exists.' })
+
+ // Password requirements validation.
+ if (!validatePassword(params.password)) return res.status(500).send({ auth: false, status: 'PASSWORD_REQUIREMENTS', error_message: 'The password requirements are not fullfilled.' })
+ // Email validation.
+ if (!validateEmail(params.email)) return res.status(500).send({ auth: false, status: 'EMAIL_INVALID', error_message: 'The provided email is invalid.' })
+ var userPassword = Buffer.from(params.password)
+ // Register user
+ pwd.hash(userPassword, function (err, hash) {
+ if (err) return res.status(500).send({ auth: false, status: 'PASSWORD_HASH_ERROR', error_message: 'Hashing the password failed.' })
+ // Saving the non improved hash and creating the user in the db.
+ // SEQ//var att = [params.username, hash, params.email, params.name];
+ // SEQ//db.query('INSERT INTO users (username, password, email, name) VALUES (?)', [att], function (err, result) {
+ db.user.create({ username: params.username, password: hash, email: params.email, name: params.name }).then((userDb) => {
+ // SEQ//if (err) return res.status(500).send({ auth: false, status: 'DATABASE_INSERT_ERROR', error_message: 'Inserting the user in the database failed.' });
+ // TODO: Username could also be used because those are unique as well.
+ // SEQ//var userId = result.insertId;
+ var userId = userDb.id
+
+ // Verify & improving the hash.
+ verifyHash(res, userPassword, hash, userId, function () {
+ return res.status(200).send({ auth: true, status: 'VALID' })
+ })
+ })
+ })
+ })
+ },
+
+ // Logout method for the frontend. Deleting the cookies by overwriting them.
+ logout: function (req, res) {
+ // End session properly.
+ res.clearCookie('jwt_hp')
+ res.clearCookie('jwt_s')
+ return res.status(200).send()
+ // TODO: Implement.. blacklisting for jwt's and destroy the cookies..
+ // Maybe use express-jwt and use the rewoke function.
+ },
+
+ changePassword: function (req, res) {
+ // TODO: IMPLEMENT
+ },
+ verifyToken: function (req, res, next) {
+ var token = ''
+ // Check for the token in the authorization header or in the cookies. Else return with auth: false.
+ if (req.headers['authorization']) {
+ var authorization = req.headers['authorization']
+ // Authorization: Bearer <token>
+ // Split the bearer token.
+ const bearer = authorization.split(' ')
+ token = bearer[1]
+ } else if (req.cookies.jwt_hp && req.cookies.jwt_s) {
+ token = req.cookies.jwt_hp + '.' + req.cookies.jwt_s
+ } else {
+ return res.status(403).send({ auth: false, status: 'TOKEN_MISSING', error_message: 'This service requires a token.' })
}
-};
+ // Verify the token with the secret.
+ jwt.verify(token, config.secret, function (err) {
+ if (err) return res.status(500).send({ auth: false, status: 'TOKEN_INVALID', error_message: 'The provided token is invalid.' })
+ req.token = token
+ next()
+ })
+ }
+}
// The function for verifying a user. Callback only gets called if the user gets verified.
-function verifyUser(res, username, password, callback) {
- if (!username) return res.status(500).send({ auth: false, status: 'USER_MISSING', error_message: 'This service requires an username.' });
- if (!password) return res.status(500).send({ auth: false, status: 'PASSWORD_MISSING', error_message: 'This services requires a password.' });
-
- //SEQ//db.query('SELECT * FROM users WHERE username = ?', [username], function(err, rows) {
- db.user.findOne({ where: { username: username } }).then(user_db => {
- //SEQ//if (err) return res.status(500).send({ auth: false, status: 'DATABASE_ERROR', error_message: 'Database connection failed.' });
- //SEQ//if (rows.length != 1) {
- //SEQ// return res.status(404).send({ auth: false, status: 'USER_NOTFOUND', error_message: 'User does not exist.' });
- //SEQ//}
-
- if (!user_db) {
- return res.status(404).send({ auth: false, status: 'USER_NOTFOUND', error_message: 'User does not exist.' });
- }
- var user = {};
- //SEQ//user.id = rows[0].id;
- user.id = user_db.id;
- //user.username = rows[0].username;
- //user.email = rows[0].email;
- var userPassword = Buffer.from(password);
- //SEQ//var hash = Buffer.from(rows[0].password);
- var hash = Buffer.from(user_db.password);
-
- // Verify & improving the hash.
- verifyHash(res, userPassword, hash, user.id, function() {
- jwt.sign({user}, config.secret, { expiresIn: '12h' }, (err, token) => {
- if (err) return res.status(500).send({ auth: false, status: 'JWT_ERROR', error_message: 'Jwt sign failed.' });
- return callback(token);
- });
- });
- });
+function verifyUser (res, username, password, callback) {
+ if (!username) return res.status(500).send({ auth: false, status: 'USER_MISSING', error_message: 'This service requires an username.' })
+ if (!password) return res.status(500).send({ auth: false, status: 'PASSWORD_MISSING', error_message: 'This services requires a password.' })
+
+ // SEQ//db.query('SELECT * FROM users WHERE username = ?', [username], function (err, rows) {
+ db.user.findOne({ where: { username: username } }).then(userDb => {
+ // SEQ//if (err) return res.status(500).send({ auth: false, status: 'DATABASE_ERROR', error_message: 'Database connection failed.' });
+ // SEQ//if (rows.length != 1) {
+ // SEQ// return res.status(404).send({ auth: false, status: 'USER_NOTFOUND', error_message: 'User does not exist.' });
+ // SEQ//}
+ if (!userDb) {
+ return res.status(404).send({ auth: false, status: 'USER_NOTFOUND', error_message: 'User does not exist.' })
+ }
+ var user = {}
+ // SEQ//user.id = rows[0].id;
+ user.id = userDb.id
+ // user.username = rows[0].username;
+ // user.email = rows[0].email;
+ var userPassword = Buffer.from(password)
+ // SEQ//var hash = Buffer.from(rows[0].password);
+ var hash = Buffer.from(userDb.password)
+
+ // Verify & improving the hash.
+ verifyHash(res, userPassword, hash, user.id, function () {
+ jwt.sign({user}, config.secret, { expiresIn: '12h' }, (err, token) => {
+ if (err) return res.status(500).send({ auth: false, status: 'JWT_ERROR', error_message: 'Jwt sign failed.' })
+ return callback(token)
+ })
+ })
+ })
}
// The verify hash function from the secure-passwords with error handling.
-function verifyHash(res, password, hash, userId, callback) {
- // Check if the hash in the database fullfills the requirements needed for pwd.verify.
- // Hash will be a Buffer of length SecurePassword.HASH_BYTES.
- if (hash.length != securePassword.HASH_BYTES) return res.status(500).send({ auth: false, status: 'DATABASE_HASH_INVALID', error_message: 'The hash in the database is corrupted.' });
- // Password must be a Buffer of length SecurePassword.PASSWORD_BYTES_MIN - SecurePassword.PASSWORD_BYTES_MAX.
- if (password.length < securePassword.PASSWORD_BYTES_MIN || password.length > securePassword.PASSWORD_BYTES_MAX) return res.status(500).send({ auth: false, status: 'PASSWORD_INVALID', error_message: 'The provided password has an invalid length.' });
-
- // Verification of the password. Rehash if needed.
- pwd.verify(password, hash, function(err, result) {
- if (err) return res.status(500).send({ auth: false, status: 'PASSWORD_VERIFY_ERROR', error_message: 'Verifying the password failed.' });
-
- // Check the state of the verification.
- if (result === securePassword.INVALID_UNRECOGNIZED_HASH) return res.status(500).send({ auth: false, status: 'INVALID_UNRECOGNIZED_HASH', error_message: 'This hash was not made with secure-password. Attempt legacy algorithm.' });
- if (result === securePassword.INVALID) return res.status(500).send({ auth: false, status: 'PASSWORD_INVALID', error_message: 'The provided password is invalid.' });
- if (result === securePassword.VALID) callback();
- if (result === securePassword.VALID_NEEDS_REHASH) {
- pwd.hash(password, function (err, improvedHash) {
- if (err) throw err;
-
- // Update the improved hash in the db.
- //SEQ//db.query('UPDATE users SET password=? WHERE id=?', [improvedHash, userId], function(err, result) {
- db.user.findOne({ where: { id: userId } }).then(user_db => {
- //SEQ//if (err) throw err;
- user_db.updateAttributes({
- password: improvedHash
- });
- return callback();
- });
- });
- }
- });
+function verifyHash (res, password, hash, userId, callback) {
+ // Check if the hash in the database fullfills the requirements needed for pwd.verify.
+ // Hash will be a Buffer of length SecurePassword.HASH_BYTES.
+ if (hash.length !== securePassword.HASH_BYTES) return res.status(500).send({ auth: false, status: 'DATABASE_HASH_INVALID', error_message: 'The hash in the database is corrupted.' })
+ // Password must be a Buffer of length SecurePassword.PASSWORD_BYTES_MIN - SecurePassword.PASSWORD_BYTES_MAX.
+ if (password.length < securePassword.PASSWORD_BYTES_MIN || password.length > securePassword.PASSWORD_BYTES_MAX) return res.status(500).send({ auth: false, status: 'PASSWORD_INVALID', error_message: 'The provided password has an invalid length.' })
+
+ // Verification of the password. Rehash if needed.
+ pwd.verify(password, hash, function (err, result) {
+ if (err) return res.status(500).send({ auth: false, status: 'PASSWORD_VERIFY_ERROR', error_message: 'Verifying the password failed.' })
+
+ // Check the state of the verification.
+ if (result === securePassword.INVALID_UNRECOGNIZED_HASH) return res.status(500).send({ auth: false, status: 'INVALID_UNRECOGNIZED_HASH', error_message: 'This hash was not made with secure-password. Attempt legacy algorithm.' })
+ if (result === securePassword.INVALID) return res.status(500).send({ auth: false, status: 'PASSWORD_INVALID', error_message: 'The provided password is invalid.' })
+ if (result === securePassword.VALID) callback()
+ if (result === securePassword.VALID_NEEDS_REHASH) {
+ pwd.hash(password, function (err, improvedHash) {
+ if (err) throw err
+
+ // Update the improved hash in the db.
+ // SEQ//db.query('UPDATE users SET password=? WHERE id=?', [improvedHash, userId], function (err, result) {
+ db.user.findOne({ where: { id: userId } }).then(user => {
+ // SEQ//if (err) throw err;
+ user.updateAttributes({
+ password: improvedHash
+ })
+ return callback()
+ })
+ })
+ }
+ })
}
// Function for validating the e-mail.
-function validateEmail(email) {
- var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
- return re.test(String(email).toLowerCase());
+function validateEmail (email) {
+// var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
+// Removed escape before [ because eslint told me so.
+ var re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
+ return re.test(String(email).toLowerCase())
}
// Function for validating the password. Password requirements are implemented here.
-function validatePassword(password) {
- // TODO: implement pw requirements like in the frontend.
- return true;
-} \ No newline at end of file
+function validatePassword (password) {
+ // TODO: implement pw requirements like in the frontend.
+ return true
+}
diff --git a/server/lib/database.js b/server/lib/database.js
index c5a0df5..09ad947 100644
--- a/server/lib/database.js
+++ b/server/lib/database.js
@@ -1,10 +1,10 @@
/* global __appdir */
-var mysql = require('mysql');
-var path = require('path');
-var dbConfig = require(path.join(__appdir, 'config', 'database'));
+var mysql = require('mysql')
+var path = require('path')
+var dbConfig = require(path.join(__appdir, 'config', 'database'))
-dbConfig.connectionLimit = 10;
-var connectionPool = mysql.createPool(dbConfig);
+dbConfig.connectionLimit = 10
+var connectionPool = mysql.createPool(dbConfig)
module.exports = {
- connectionPool: connectionPool
-}; \ No newline at end of file
+ connectionPool: connectionPool
+}
diff --git a/server/lib/external-backends/backends/another-backend.js b/server/lib/external-backends/backends/another-backend.js
index 9458e1e..5efc185 100644
--- a/server/lib/external-backends/backends/another-backend.js
+++ b/server/lib/external-backends/backends/another-backend.js
@@ -1,9 +1,9 @@
-var ExternalBackends = require('../external-backends.js');
+var ExternalBackends = require('../external-backends.js')
class AnotherBackend extends ExternalBackends {
- getCredentials() {
- return [{ type: "text", name: "text 1" }, { type: "text", name: "text 2" }, { type: "password", name: "password 1", show: false}, { type: "password", name: "password 2", show: true}, { type: "password", name: "password 3", show: false}];
- }
+ getCredentials () {
+ return [{ type: 'text', name: 'text 1' }, { type: 'text', name: 'text 2' }, { type: 'password', name: 'password 1', show: false }, { type: 'password', name: 'password 2', show: true }, { type: 'password', name: 'password 3', show: false }]
+ }
}
-module.exports = AnotherBackend; \ No newline at end of file
+module.exports = AnotherBackend
diff --git a/server/lib/external-backends/backends/dummy-backend.js b/server/lib/external-backends/backends/dummy-backend.js
index 205eeb1..a261af1 100644
--- a/server/lib/external-backends/backends/dummy-backend.js
+++ b/server/lib/external-backends/backends/dummy-backend.js
@@ -1,9 +1,9 @@
-var ExternalBackends = require('../external-backends.js');
+var ExternalBackends = require('../external-backends.js')
class DummyBackend extends ExternalBackends {
- getCredentials() {
- return [{ type: "switch", name: "switch 1", value: false }, { type: "switch", name: "switch 2", value: false }, { type: "switch", name: "switch 3", value: true }, { type: "select", name: "selection 1", items: ["wasd", "asdf", "qwertz"] }, { type: "select", name: "selection 2", items: ["1", "2", "3"] }];
- }
+ getCredentials () {
+ return [{ type: 'switch', name: 'switch 1', value: false }, { type: 'switch', name: 'switch 2', value: false }, { type: 'switch', name: 'switch 3', value: true }, { type: 'select', name: 'selection 1', items: ['wasd', 'asdf', 'qwertz'] }, { type: 'select', name: 'selection 2', items: ['1', '2', '3'] }]
+ }
}
-module.exports = DummyBackend; \ No newline at end of file
+module.exports = DummyBackend
diff --git a/server/lib/external-backends/backends/template-backend.js b/server/lib/external-backends/backends/template-backend.js
index 3271447..9ce799d 100644
--- a/server/lib/external-backends/backends/template-backend.js
+++ b/server/lib/external-backends/backends/template-backend.js
@@ -1,9 +1,9 @@
-var ExternalBackends = require('../external-backends.js');
+var ExternalBackends = require('../external-backends.js')
class TemplateBackend extends ExternalBackends {
- getCredentials() {
- return [{ type: "text", name: "text test" }, { type: "password", name: "password test", show: true}, { type: "password", name: "password test nr2", show: false}, { type: "switch", name: "bool test", value: false }, { type: "select", name: "selection test", items: ["wasd", "asdf", "qwertz"] }];
- }
+ getCredentials () {
+ return [{ type: 'text', name: 'text test' }, { type: 'password', name: 'password test', show: true }, { type: 'password', name: 'password test nr2', show: false }, { type: 'switch', name: 'bool test', value: false }, { type: 'select', name: 'selection test', items: ['wasd', 'asdf', 'qwertz'] }]
+ }
}
-module.exports = TemplateBackend; \ No newline at end of file
+module.exports = TemplateBackend
diff --git a/server/lib/external-backends/external-backends.js b/server/lib/external-backends/external-backends.js
index 5ab2adf..0bf891e 100644
--- a/server/lib/external-backends/external-backends.js
+++ b/server/lib/external-backends/external-backends.js
@@ -1,30 +1,30 @@
/* global __appdir */
-const fs = require('fs');
-const path = require('path');
+const fs = require('fs')
+const path = require('path')
class ExternalBackends {
- getBackends() {
- var files = fs.readdirSync(path.join(__appdir, 'lib', 'external-backends', 'backends'));
- return files;
- }
-
- getCredentials() {
- return "If this method gets called the backend class has NOT IMPLEMENTED the getCredentials method!";
- }
-
- getInstance(type) {
- const bList = this.getBackends();
- const bType = type + '-backend.js';
-
- // Check if it's a valid backend type.
- if (bList.indexOf(bType) == -1) {
- console.log(bType + " is not a valid backend type.");
- return null;
- }
-
- const backend = new (require(path.join(__appdir, 'lib', 'external-backends', 'backends', bType)))();
- return backend;
+ getBackends () {
+ var files = fs.readdirSync(path.join(__appdir, 'lib', 'external-backends', 'backends'))
+ return files
+ }
+
+ getCredentials () {
+ return 'If this method gets called the backend class has NOT IMPLEMENTED the getCredentials method!'
+ }
+
+ getInstance (type) {
+ const bList = this.getBackends()
+ const bType = type + '-backend.js'
+
+ // Check if it's a valid backend type.
+ if (bList.indexOf(bType) === -1) {
+ console.log(bType + ' is not a valid backend type.')
+ return null
}
+
+ const backend = new (require(path.join(__appdir, 'lib', 'external-backends', 'backends', bType)))()
+ return backend
+ }
}
-module.exports = ExternalBackends;
+module.exports = ExternalBackends
diff --git a/server/lib/nodemailer.js b/server/lib/nodemailer.js
index 804f8a7..ba8f43d 100644
--- a/server/lib/nodemailer.js
+++ b/server/lib/nodemailer.js
@@ -1,37 +1,35 @@
/* global __appdir */
-var path = require('path');
-var nodemailer = require('nodemailer');
-var config = require(path.join(__appdir, 'config', 'email'));
-
+var path = require('path')
+var nodemailer = require('nodemailer')
+var config = require(path.join(__appdir, 'config', 'email'))
module.exports = {
- sendMail: function(req, res) {
-
- var transporter = nodemailer.createTransport({
- host: "smtp.gmail.com",
+ sendMail: function (req, res) {
+ var transporter = nodemailer.createTransport({
+ host: 'smtp.gmail.com',
- auth: {
- type: 'OAuth2',
- user: 'bootauswahlserver@gmail.com',
- clientId: '240716905262-md0hee9bqgrju4a28oe3k4u0s063l7na.apps.googleusercontent.com',
- clientSecret: 'VetTt8xiNEOy6Nugf_QKk_vN',
- refreshToken: '1/srkyBhhzaAK6cM7Mio797OrzA8bbszRoK2PTwnbcRDE',
- accessToken: 'ya29.GlvIBXW2439F0xGw9D2L3OtUWNgpks7EtVq25tZXwsxDyNu1NnRsTCNleqIi5q1MD0mJCATaxGsYkLTMG8ER9A-z-cFXHiOETOSUXng2eA_K43YHcgyKiy-SfBrn'
- }
- });
+ auth: {
+ type: 'OAuth2',
+ user: 'bootauswahlserver@gmail.com',
+ clientId: '240716905262-md0hee9bqgrju4a28oe3k4u0s063l7na.apps.googleusercontent.com',
+ clientSecret: 'VetTt8xiNEOy6Nugf_QKk_vN',
+ refreshToken: '1/srkyBhhzaAK6cM7Mio797OrzA8bbszRoK2PTwnbcRDE',
+ accessToken: 'ya29.GlvIBXW2439F0xGw9D2L3OtUWNgpks7EtVq25tZXwsxDyNu1NnRsTCNleqIi5q1MD0mJCATaxGsYkLTMG8ER9A-z-cFXHiOETOSUXng2eA_K43YHcgyKiy-SfBrn'
+ }
+ })
- const mailOptions = {
- from: config.user, // sender address
- to: 'thejannik@yahoo.de', // list of receivers
- subject: 'Nodemailer test mail', // Subject line
- html: '<p>Some fancy html mail stuff</p>'// plain text body
- };
-
- transporter.sendMail(mailOptions, function (err, info) {
- if(err) console.log(err)
- else console.log(info);
-
- return res.status(200).send({ status: 'success' });
- });
+ const mailOptions = {
+ from: config.user, // sender address
+ to: 'thejannik@yahoo.de', // list of receivers
+ subject: 'Nodemailer test mail', // Subject line
+ html: '<p>Some fancy html mail stuff</p>'// plain text body
}
-};
+
+ transporter.sendMail(mailOptions, function (err, info) {
+ if (err) console.log(err)
+ else console.log(info)
+
+ return res.status(200).send({ status: 'success' })
+ })
+ }
+}
diff --git a/server/lib/sequelize.js b/server/lib/sequelize.js
index e287cb9..f348603 100644
--- a/server/lib/sequelize.js
+++ b/server/lib/sequelize.js
@@ -1,29 +1,28 @@
/* global __appdir */
-'use strict';
+'use strict'
-var fs = require('fs');
-var path = require('path');
-var Sequelize = require('sequelize');
-var config = require(path.join(__appdir, 'config', 'database1'));
-var db = {};
+var fs = require('fs')
+var path = require('path')
+var Sequelize = require('sequelize')
+var config = require(path.join(__appdir, 'config', 'database1'))
+var db = {}
-
-var sequelize = new Sequelize(config.database, config.username, config.password, config);
+var sequelize = new Sequelize(config.database, config.username, config.password, config)
fs
- .readdirSync(__dirname + '/../models')
+ .readdirSync(path.join(__dirname, '/../models'))
.forEach(file => {
- var model = sequelize['import'](path.join(__dirname + '/../models', file));
- db[model.name] = model;
- });
+ var model = sequelize['import'](path.join(__dirname, '/../models', file))
+ db[model.name] = model
+ })
Object.keys(db).forEach(modelName => {
if (db[modelName].associate) {
- db[modelName].associate(db);
+ db[modelName].associate(db)
}
-});
+})
-db.sequelize = sequelize;
-db.Sequelize = Sequelize;
+db.sequelize = sequelize
+db.Sequelize = Sequelize
-module.exports = db;
+module.exports = db
diff --git a/server/lib/shell.js b/server/lib/shell.js
index 931286c..311af1d 100644
--- a/server/lib/shell.js
+++ b/server/lib/shell.js
@@ -1,38 +1,38 @@
/* global __appdir */
-var path = require('path');
-var shell = require('shelljs');
-var ipxeGIT = 'git://git.ipxe.org/ipxe.git';
+var path = require('path')
+var shell = require('shelljs')
+var ipxeGIT = 'git://git.ipxe.org/ipxe.git'
module.exports = {
- buildIPXE: function(req, res) {
- if (!shell.which('git')) {
- return res.status(500).send({ status: 'GIT_MISSING', error_message: 'Please install git on the server.' });
- }
-
- var gitclone = 'git clone ' + ipxeGIT;
- shell.cd(path.join(__appdir, 'ipxe'));
- shell.exec(gitclone, function(code, stdout, stderr) {
- shell.cd(path.join(__appdir, 'ipxe', 'ipxe', 'src'));
-
- // Remove the general config and paste in the own one
- shell.rm(path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config', 'general.h'));
- shell.cp(path.join(__appdir, 'ipxe', 'general.h'), path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config'));
- shell.rm(path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config', 'console.h'));
- shell.cp(path.join(__appdir, 'ipxe', 'console.h'), path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config'));
- //var make = 'make EMBED=' + path.join(__appdir, 'ipxe', 'main.ipxe');
- var make = 'make EMBED=' + path.join(__appdir, 'ipxe', 'main.ipxe') + " TRUST=" + path.join(__appdir, 'bin', 'fullchain.pem');
- //shell.env.PATH = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin';
- shell.env.DEBUG = '';
- shell.exec(make, function(code, stdout, stderr) {
- shell.rm(path.join(__appdir, 'tftp', 'ipxe.0'));
- shell.cp('bin/ipxe.pxe', path.join(__appdir, 'tftp'));
- shell.mv(path.join(__appdir, 'tftp', 'ipxe.pxe'), path.join(__appdir, 'tftp', 'ipxe.0'));
- // shell.rm('-rf', 'ipxe');
- return res.status(200).send({ status: 'success' });
- });
- });
+ buildIPXE: function (req, res) {
+ if (!shell.which('git')) {
+ return res.status(500).send({ status: 'GIT_MISSING', error_message: 'Please install git on the server.' })
}
-};
+
+ var gitclone = 'git clone ' + ipxeGIT
+ shell.cd(path.join(__appdir, 'ipxe'))
+ shell.exec(gitclone, function (code, stdout, stderr) {
+ shell.cd(path.join(__appdir, 'ipxe', 'ipxe', 'src'))
+
+ // Remove the general config and paste in the own one
+ shell.rm(path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config', 'general.h'))
+ shell.cp(path.join(__appdir, 'ipxe', 'general.h'), path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config'))
+ shell.rm(path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config', 'console.h'))
+ shell.cp(path.join(__appdir, 'ipxe', 'console.h'), path.join(__appdir, 'ipxe', 'ipxe', 'src', 'config'))
+ // var make = 'make EMBED=' + path.join(__appdir, 'ipxe', 'main.ipxe');
+ var make = 'make EMBED=' + path.join(__appdir, 'ipxe', 'main.ipxe') + ' TRUST=' + path.join(__appdir, 'bin', 'fullchain.pem')
+ // shell.env.PATH = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin';
+ shell.env.DEBUG = ''
+ shell.exec(make, function (code, stdout, stderr) {
+ shell.rm(path.join(__appdir, 'tftp', 'ipxe.0'))
+ shell.cp('bin/ipxe.pxe', path.join(__appdir, 'tftp'))
+ shell.mv(path.join(__appdir, 'tftp', 'ipxe.pxe'), path.join(__appdir, 'tftp', 'ipxe.0'))
+ // shell.rm('-rf', 'ipxe');
+ return res.status(200).send({ status: 'success' })
+ })
+ })
+ }
+}
// sudo apt-get install liblzma-dev
-// sudo apt-get install mkisofs \ No newline at end of file
+// sudo apt-get install mkisofs
diff --git a/server/lib/tftp.js b/server/lib/tftp.js
index 1e69b34..8d45cf0 100644
--- a/server/lib/tftp.js
+++ b/server/lib/tftp.js
@@ -1,27 +1,27 @@
-'use strict';
+'use strict'
// This tftp server uses BAS port +1
-var tftp_port = process.env.PORT;
-tftp_port++;
+var tftpPort = process.env.PORT
+tftpPort++
-var tftp = require('tftp');
+var tftp = require('tftp')
var server = tftp.createServer({
- host: '192.52.3.91',
- port: tftp_port,
- root: './tftp',
- denyPut: true
-});
+ host: '192.52.3.91',
+ port: tftpPort,
+ root: './tftp',
+ denyPut: true
+})
-server.on ('error', function (error){
- // Errors from the main socket
- console.error (error);
-});
+server.on('error', function (error) {
+ // Errors from the main socket
+ console.error(error)
+})
-server.on ('request', function (req){
- req.on ('error', function (error){
- // Error from the request
- console.error (error);
- });
-});
+server.on('request', function (req) {
+ req.on('error', function (error) {
+ // Error from the request
+ console.error(error)
+ })
+})
-server.listen();
+server.listen()
diff --git a/server/migrations/20180522185323-create-user.js b/server/migrations/20180522185323-create-user.js
index 236b229..4cf23dc 100644
--- a/server/migrations/20180522185323-create-user.js
+++ b/server/migrations/20180522185323-create-user.js
@@ -1,4 +1,4 @@
-'use strict';
+'use strict'
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('users', {
@@ -20,9 +20,9 @@ module.exports = {
name: {
type: Sequelize.STRING
}
- });
+ })
},
down: (queryInterface, Sequelize) => {
- return queryInterface.dropTable('users');
+ return queryInterface.dropTable('users')
}
-}; \ No newline at end of file
+}
diff --git a/server/migrations/20180715193710-create-backend.js b/server/migrations/20180715193710-create-backend.js
index 3b1a730..e89362e 100644
--- a/server/migrations/20180715193710-create-backend.js
+++ b/server/migrations/20180715193710-create-backend.js
@@ -1,4 +1,4 @@
-'use strict';
+'use strict'
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('backends', {
@@ -17,9 +17,9 @@ module.exports = {
credentials: {
type: Sequelize.STRING(2048)
}
- });
+ })
},
down: (queryInterface, Sequelize) => {
- return queryInterface.dropTable('backends');
+ return queryInterface.dropTable('backends')
}
-}; \ No newline at end of file
+}
diff --git a/server/models/backend.js b/server/models/backend.js
index b8b0313..4ed5fce 100644
--- a/server/models/backend.js
+++ b/server/models/backend.js
@@ -1,20 +1,20 @@
-'use strict';
+'use strict'
module.exports = (sequelize, DataTypes) => {
var backend = sequelize.define('backend', {
id: {
- allowNull: false,
- autoIncrement: true,
- primaryKey: true,
- type: DataTypes.INTEGER
+ allowNull: false,
+ autoIncrement: true,
+ primaryKey: true,
+ type: DataTypes.INTEGER
},
name: DataTypes.STRING,
type: DataTypes.STRING,
credentials: DataTypes.STRING(2048)
}, {
timestamps: false
- });
- backend.associate = function(models) {
+ })
+ backend.associate = function (models) {
// associations can be defined here
- };
- return backend;
-}; \ No newline at end of file
+ }
+ return backend
+}
diff --git a/server/models/role.js b/server/models/role.js
index 35ca139..60fba53 100644
--- a/server/models/role.js
+++ b/server/models/role.js
@@ -1,19 +1,19 @@
-'use strict';
+'use strict'
module.exports = (sequelize, DataTypes) => {
var role = sequelize.define('role', {
id: {
- allowNull: false,
- autoIncrement: true,
- primaryKey: true,
- type: DataTypes.INTEGER
+ allowNull: false,
+ autoIncrement: true,
+ primaryKey: true,
+ type: DataTypes.INTEGER
},
name: DataTypes.STRING,
descr: DataTypes.STRING
}, {
timestamps: false
- });
- role.associate = function(models) {
+ })
+ role.associate = function (models) {
// associations can be defined here
- };
- return role;
-}; \ No newline at end of file
+ }
+ return role
+}
diff --git a/server/models/user.js b/server/models/user.js
index 167b5a5..63e87bd 100644
--- a/server/models/user.js
+++ b/server/models/user.js
@@ -1,11 +1,11 @@
-'use strict';
+'use strict'
module.exports = (sequelize, DataTypes) => {
var user = sequelize.define('user', {
id: {
- allowNull: false,
- autoIncrement: true,
- primaryKey: true,
- type: DataTypes.INTEGER
+ allowNull: false,
+ autoIncrement: true,
+ primaryKey: true,
+ type: DataTypes.INTEGER
},
username: DataTypes.STRING,
password: DataTypes.STRING,
@@ -13,9 +13,9 @@ module.exports = (sequelize, DataTypes) => {
name: DataTypes.STRING
}, {
timestamps: false
- });
- user.associate = function(models) {
+ })
+ user.associate = function (models) {
// associations can be defined here
- };
- return user;
-}; \ No newline at end of file
+ }
+ return user
+}
diff --git a/server/models/user_x_role.js b/server/models/user_x_role.js
index 86068f0..96d5883 100644
--- a/server/models/user_x_role.js
+++ b/server/models/user_x_role.js
@@ -1,20 +1,17 @@
-'use strict';
+'use strict'
module.exports = (sequelize, DataTypes) => {
var user_x_role = sequelize.define('user_x_role', {},
- {
- timestamps: false
- });
-
- user_x_role.associate = function(models) {
+ {
+ timestamps: false
+ })
+
+ user_x_role.associate = function (models) {
// associations can be defined here
-
- //sequelize.role.belongsToMany(sequelize.user, {through: 'user_x_role', foreignKey: 'userid'});
- //sequelize.user.hasMany(sequelize.role, {
+ // sequelize.role.belongsToMany(sequelize.user, {through: 'user_x_role', foreignKey: 'userid'});
+ // sequelize.user.hasMany(sequelize.role, {
// through: 'user_x_role',
// foreignKey: 'roleid'
- //});
-
-
- };
- return user_x_role;
-}; \ No newline at end of file
+ // });
+ }
+ return user_x_role
+}
diff --git a/server/package-lock.json b/server/package-lock.json
index cf9b899..96ee9be 100644
--- a/server/package-lock.json
+++ b/server/package-lock.json
@@ -28,11 +28,57 @@
"negotiator": "0.6.1"
}
},
+ "acorn": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz",
+ "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ=="
+ },
+ "acorn-jsx": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz",
+ "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=",
+ "requires": {
+ "acorn": "^3.0.4"
+ },
+ "dependencies": {
+ "acorn": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz",
+ "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo="
+ }
+ }
+ },
+ "ajv": {
+ "version": "5.5.2",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
+ "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
+ "requires": {
+ "co": "^4.6.0",
+ "fast-deep-equal": "^1.0.0",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.3.0"
+ }
+ },
+ "ajv-keywords": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz",
+ "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I="
+ },
+ "ansi-escapes": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz",
+ "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw=="
+ },
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
},
+ "ansi-styles": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4="
+ },
"ansicolors": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.2.1.tgz",
@@ -43,11 +89,70 @@
"resolved": "https://registry.npmjs.org/argp/-/argp-1.0.4.tgz",
"integrity": "sha1-sxxzB1rW1syx2MhqzWn/MAMFsZQ="
},
+ "argparse": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
+ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+ "requires": {
+ "sprintf-js": "~1.0.2"
+ }
+ },
"array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
},
+ "array-includes": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz",
+ "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=",
+ "requires": {
+ "define-properties": "^1.1.2",
+ "es-abstract": "^1.7.0"
+ }
+ },
+ "array-union": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
+ "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=",
+ "requires": {
+ "array-uniq": "^1.0.1"
+ }
+ },
+ "array-uniq": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
+ "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY="
+ },
+ "arrify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
+ "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0="
+ },
+ "babel-code-frame": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
+ "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
+ "requires": {
+ "chalk": "^1.1.3",
+ "esutils": "^2.0.2",
+ "js-tokens": "^3.0.2"
+ },
+ "dependencies": {
+ "chalk": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "requires": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ }
+ }
+ }
+ },
"babel-runtime": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
@@ -121,6 +226,11 @@
"resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
"integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk="
},
+ "buffer-from": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz",
+ "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ=="
+ },
"builtin-modules": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
@@ -131,6 +241,19 @@
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
"integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg="
},
+ "caller-path": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz",
+ "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=",
+ "requires": {
+ "callsites": "^0.2.0"
+ }
+ },
+ "callsites": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz",
+ "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo="
+ },
"camelcase": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
@@ -145,6 +268,44 @@
"redeyed": "~1.0.0"
}
},
+ "chalk": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
+ "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
+ "requires": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "requires": {
+ "color-convert": "^1.9.0"
+ }
+ },
+ "supports-color": {
+ "version": "5.4.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
+ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ }
+ }
+ },
+ "chardet": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz",
+ "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I="
+ },
+ "circular-json": {
+ "version": "0.3.3",
+ "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz",
+ "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A=="
+ },
"cli-color": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/cli-color/-/cli-color-1.2.0.tgz",
@@ -158,6 +319,19 @@
"timers-ext": "0.1"
}
},
+ "cli-cursor": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
+ "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=",
+ "requires": {
+ "restore-cursor": "^2.0.0"
+ }
+ },
+ "cli-width": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz",
+ "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk="
+ },
"cliui": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
@@ -189,11 +363,29 @@
"shimmer": "^1.1.0"
}
},
+ "co": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
+ "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ="
+ },
"code-point-at": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
},
+ "color-convert": {
+ "version": "1.9.2",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz",
+ "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==",
+ "requires": {
+ "color-name": "1.1.1"
+ }
+ },
+ "color-name": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz",
+ "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok="
+ },
"commander": {
"version": "2.15.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
@@ -236,6 +428,17 @@
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
+ "concat-stream": {
+ "version": "1.6.2",
+ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
+ "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
+ "requires": {
+ "buffer-from": "^1.0.0",
+ "inherits": "^2.0.3",
+ "readable-stream": "^2.2.2",
+ "typedarray": "^0.0.6"
+ }
+ },
"config-chain": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.11.tgz",
@@ -248,8 +451,7 @@
"contains-path": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz",
- "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=",
- "dev": true
+ "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo="
},
"content-disposition": {
"version": "0.5.2",
@@ -316,11 +518,57 @@
"ms": "2.0.0"
}
},
+ "debug-log": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz",
+ "integrity": "sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8="
+ },
"decamelize": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
},
+ "deep-is": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
+ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ="
+ },
+ "define-properties": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz",
+ "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=",
+ "requires": {
+ "foreach": "^2.0.5",
+ "object-keys": "^1.0.8"
+ }
+ },
+ "deglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/deglob/-/deglob-2.1.1.tgz",
+ "integrity": "sha512-2kjwuGGonL7gWE1XU4Fv79+vVzpoQCl0V+boMwWtOQJV2AGDabCwez++nB1Nli/8BabAfZQ/UuHPlp6AymKdWw==",
+ "requires": {
+ "find-root": "^1.0.0",
+ "glob": "^7.0.5",
+ "ignore": "^3.0.9",
+ "pkg-config": "^1.1.0",
+ "run-parallel": "^1.1.2",
+ "uniq": "^1.0.1"
+ }
+ },
+ "del": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz",
+ "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=",
+ "requires": {
+ "globby": "^5.0.0",
+ "is-path-cwd": "^1.0.0",
+ "is-path-in-cwd": "^1.0.0",
+ "object-assign": "^4.0.1",
+ "pify": "^2.0.0",
+ "pinkie-promise": "^2.0.0",
+ "rimraf": "^2.2.8"
+ }
+ },
"denque": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/denque/-/denque-1.2.3.tgz",
@@ -340,7 +588,6 @@
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz",
"integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=",
- "dev": true,
"requires": {
"esutils": "^2.0.2",
"isarray": "^1.0.0"
@@ -399,6 +646,28 @@
"is-arrayish": "^0.2.1"
}
},
+ "es-abstract": {
+ "version": "1.12.0",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz",
+ "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==",
+ "requires": {
+ "es-to-primitive": "^1.1.1",
+ "function-bind": "^1.1.1",
+ "has": "^1.0.1",
+ "is-callable": "^1.1.3",
+ "is-regex": "^1.0.4"
+ }
+ },
+ "es-to-primitive": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz",
+ "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=",
+ "requires": {
+ "is-callable": "^1.1.1",
+ "is-date-object": "^1.0.1",
+ "is-symbol": "^1.0.1"
+ }
+ },
"es5-ext": {
"version": "0.10.42",
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.42.tgz",
@@ -444,23 +713,92 @@
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
},
- "eslint-config-google": {
- "version": "0.9.1",
- "resolved": "https://registry.npmjs.org/eslint-config-google/-/eslint-config-google-0.9.1.tgz",
- "integrity": "sha512-5A83D+lH0PA81QMESKbLJd/a3ic8tPZtwUmqNrxMRo54nfFaUvtt89q/+icQ+fd66c2xQHn0KyFkzJDoAUfpZA==",
- "dev": true
+ "escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
+ },
+ "eslint": {
+ "version": "4.18.2",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.18.2.tgz",
+ "integrity": "sha512-qy4i3wODqKMYfz9LUI8N2qYDkHkoieTbiHpMrYUI/WbjhXJQr7lI4VngixTgaG+yHX+NBCv7nW4hA0ShbvaNKw==",
+ "requires": {
+ "ajv": "^5.3.0",
+ "babel-code-frame": "^6.22.0",
+ "chalk": "^2.1.0",
+ "concat-stream": "^1.6.0",
+ "cross-spawn": "^5.1.0",
+ "debug": "^3.1.0",
+ "doctrine": "^2.1.0",
+ "eslint-scope": "^3.7.1",
+ "eslint-visitor-keys": "^1.0.0",
+ "espree": "^3.5.2",
+ "esquery": "^1.0.0",
+ "esutils": "^2.0.2",
+ "file-entry-cache": "^2.0.0",
+ "functional-red-black-tree": "^1.0.1",
+ "glob": "^7.1.2",
+ "globals": "^11.0.1",
+ "ignore": "^3.3.3",
+ "imurmurhash": "^0.1.4",
+ "inquirer": "^3.0.6",
+ "is-resolvable": "^1.0.0",
+ "js-yaml": "^3.9.1",
+ "json-stable-stringify-without-jsonify": "^1.0.1",
+ "levn": "^0.3.0",
+ "lodash": "^4.17.4",
+ "minimatch": "^3.0.2",
+ "mkdirp": "^0.5.1",
+ "natural-compare": "^1.4.0",
+ "optionator": "^0.8.2",
+ "path-is-inside": "^1.0.2",
+ "pluralize": "^7.0.0",
+ "progress": "^2.0.0",
+ "require-uncached": "^1.0.3",
+ "semver": "^5.3.0",
+ "strip-ansi": "^4.0.0",
+ "strip-json-comments": "~2.0.1",
+ "table": "4.0.2",
+ "text-table": "~0.2.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
+ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="
+ },
+ "doctrine": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
+ "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
+ "requires": {
+ "esutils": "^2.0.2"
+ }
+ },
+ "strip-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
+ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
+ "requires": {
+ "ansi-regex": "^3.0.0"
+ }
+ }
+ }
},
"eslint-config-standard": {
"version": "11.0.0",
"resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-11.0.0.tgz",
- "integrity": "sha512-oDdENzpViEe5fwuRCWla7AXQd++/oyIp8zP+iP9jiUPG6NBj3SHgdgtl/kTn00AjeN+1HNvavTKmYbMo+xMOlw==",
- "dev": true
+ "integrity": "sha512-oDdENzpViEe5fwuRCWla7AXQd++/oyIp8zP+iP9jiUPG6NBj3SHgdgtl/kTn00AjeN+1HNvavTKmYbMo+xMOlw=="
+ },
+ "eslint-config-standard-jsx": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-5.0.0.tgz",
+ "integrity": "sha512-rLToPAEqLMPBfWnYTu6xRhm2OWziS2n40QFqJ8jAM8NSVzeVKTa3nclhsU4DpPJQRY60F34Oo1wi/71PN/eITg=="
},
"eslint-import-resolver-node": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz",
"integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==",
- "dev": true,
"requires": {
"debug": "^2.6.9",
"resolve": "^1.5.0"
@@ -470,7 +808,6 @@
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
- "dev": true,
"requires": {
"ms": "2.0.0"
}
@@ -481,7 +818,6 @@
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz",
"integrity": "sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=",
- "dev": true,
"requires": {
"debug": "^2.6.8",
"pkg-dir": "^1.0.0"
@@ -491,7 +827,6 @@
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
- "dev": true,
"requires": {
"ms": "2.0.0"
}
@@ -531,7 +866,6 @@
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz",
"integrity": "sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw==",
- "dev": true,
"requires": {
"ignore": "^3.3.6",
"minimatch": "^3.0.4",
@@ -545,22 +879,86 @@
"integrity": "sha512-JiFL9UFR15NKpHyGii1ZcvmtIqa3UTwiDAGb8atSffe43qJ3+1czVGN6UtkklpcJ2DVnqvTMzEKRaJdBkAL2aQ==",
"dev": true
},
+ "eslint-plugin-react": {
+ "version": "7.7.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.7.0.tgz",
+ "integrity": "sha512-KC7Snr4YsWZD5flu6A5c0AcIZidzW3Exbqp7OT67OaD2AppJtlBr/GuPrW/vaQM/yfZotEvKAdrxrO+v8vwYJA==",
+ "requires": {
+ "doctrine": "^2.0.2",
+ "has": "^1.0.1",
+ "jsx-ast-utils": "^2.0.1",
+ "prop-types": "^15.6.0"
+ },
+ "dependencies": {
+ "doctrine": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
+ "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
+ "requires": {
+ "esutils": "^2.0.2"
+ }
+ }
+ }
+ },
"eslint-plugin-standard": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.1.0.tgz",
"integrity": "sha512-fVcdyuKRr0EZ4fjWl3c+gp1BANFJD1+RaWa2UPYfMZ6jCtp5RG00kSaXnK/dE5sYzt4kaWJ9qdxqUfc0d9kX0w==",
"dev": true
},
+ "eslint-scope": {
+ "version": "3.7.3",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz",
+ "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==",
+ "requires": {
+ "esrecurse": "^4.1.0",
+ "estraverse": "^4.1.1"
+ }
+ },
+ "eslint-visitor-keys": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",
+ "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ=="
+ },
+ "espree": {
+ "version": "3.5.4",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz",
+ "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==",
+ "requires": {
+ "acorn": "^5.5.0",
+ "acorn-jsx": "^3.0.0"
+ }
+ },
"esprima": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-3.0.0.tgz",
"integrity": "sha1-U88kes2ncxPlUcOqLnM0LT+099k="
},
+ "esquery": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz",
+ "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==",
+ "requires": {
+ "estraverse": "^4.0.0"
+ }
+ },
+ "esrecurse": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz",
+ "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==",
+ "requires": {
+ "estraverse": "^4.1.0"
+ }
+ },
+ "estraverse": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz",
+ "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM="
+ },
"esutils": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
- "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
- "dev": true
+ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs="
},
"etag": {
"version": "1.8.1",
@@ -637,6 +1035,48 @@
}
}
},
+ "external-editor": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz",
+ "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==",
+ "requires": {
+ "chardet": "^0.4.0",
+ "iconv-lite": "^0.4.17",
+ "tmp": "^0.0.33"
+ }
+ },
+ "fast-deep-equal": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
+ "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ="
+ },
+ "fast-json-stable-stringify": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
+ "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I="
+ },
+ "fast-levenshtein": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc="
+ },
+ "figures": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
+ "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
+ "requires": {
+ "escape-string-regexp": "^1.0.5"
+ }
+ },
+ "file-entry-cache": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz",
+ "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=",
+ "requires": {
+ "flat-cache": "^1.2.1",
+ "object-assign": "^4.0.1"
+ }
+ },
"finalhandler": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz",
@@ -661,6 +1101,11 @@
}
}
},
+ "find-root": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz",
+ "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng=="
+ },
"find-up": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
@@ -669,6 +1114,22 @@
"locate-path": "^2.0.0"
}
},
+ "flat-cache": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz",
+ "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=",
+ "requires": {
+ "circular-json": "^0.3.1",
+ "del": "^2.0.2",
+ "graceful-fs": "^4.1.2",
+ "write": "^0.2.1"
+ }
+ },
+ "foreach": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz",
+ "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k="
+ },
"forwarded": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
@@ -697,8 +1158,12 @@
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
- "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
- "dev": true
+ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+ },
+ "functional-red-black-tree": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
+ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc="
},
"generate-function": {
"version": "2.0.0",
@@ -715,6 +1180,11 @@
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz",
"integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U="
},
+ "get-stdin": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz",
+ "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g=="
+ },
"get-stream": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
@@ -733,6 +1203,24 @@
"path-is-absolute": "^1.0.0"
}
},
+ "globals": {
+ "version": "11.7.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz",
+ "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg=="
+ },
+ "globby": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz",
+ "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=",
+ "requires": {
+ "array-union": "^1.0.1",
+ "arrify": "^1.0.0",
+ "glob": "^7.0.3",
+ "object-assign": "^4.0.1",
+ "pify": "^2.0.0",
+ "pinkie-promise": "^2.0.0"
+ }
+ },
"graceful-fs": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
@@ -742,11 +1230,23 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
- "dev": true,
"requires": {
"function-bind": "^1.1.1"
}
},
+ "has-ansi": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
+ "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
+ "requires": {
+ "ansi-regex": "^2.0.0"
+ }
+ },
+ "has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
+ },
"hosted-git-info": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz",
@@ -771,8 +1271,12 @@
"ignore": {
"version": "3.3.8",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.8.tgz",
- "integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg==",
- "dev": true
+ "integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg=="
+ },
+ "imurmurhash": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
+ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o="
},
"inflection": {
"version": "1.12.0",
@@ -798,6 +1302,42 @@
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
},
+ "inquirer": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz",
+ "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==",
+ "requires": {
+ "ansi-escapes": "^3.0.0",
+ "chalk": "^2.0.0",
+ "cli-cursor": "^2.1.0",
+ "cli-width": "^2.0.0",
+ "external-editor": "^2.0.4",
+ "figures": "^2.0.0",
+ "lodash": "^4.3.0",
+ "mute-stream": "0.0.7",
+ "run-async": "^2.2.0",
+ "rx-lite": "^4.0.8",
+ "rx-lite-aggregates": "^4.0.8",
+ "string-width": "^2.1.0",
+ "strip-ansi": "^4.0.0",
+ "through": "^2.3.6"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
+ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="
+ },
+ "strip-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
+ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
+ "requires": {
+ "ansi-regex": "^3.0.0"
+ }
+ }
+ }
+ },
"interpret": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz",
@@ -831,6 +1371,16 @@
"builtin-modules": "^1.0.0"
}
},
+ "is-callable": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz",
+ "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA=="
+ },
+ "is-date-object": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz",
+ "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY="
+ },
"is-fullwidth-code-point": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
@@ -839,16 +1389,55 @@
"number-is-nan": "^1.0.0"
}
},
+ "is-path-cwd": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz",
+ "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0="
+ },
+ "is-path-in-cwd": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz",
+ "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==",
+ "requires": {
+ "is-path-inside": "^1.0.0"
+ }
+ },
+ "is-path-inside": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz",
+ "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=",
+ "requires": {
+ "path-is-inside": "^1.0.1"
+ }
+ },
"is-promise": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
"integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o="
},
+ "is-regex": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz",
+ "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=",
+ "requires": {
+ "has": "^1.0.1"
+ }
+ },
+ "is-resolvable": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz",
+ "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg=="
+ },
"is-stream": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
},
+ "is-symbol": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz",
+ "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI="
+ },
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
@@ -870,6 +1459,42 @@
"nopt": "~3.0.1"
}
},
+ "js-tokens": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
+ "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls="
+ },
+ "js-yaml": {
+ "version": "3.12.0",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz",
+ "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==",
+ "requires": {
+ "argparse": "^1.0.7",
+ "esprima": "^4.0.0"
+ },
+ "dependencies": {
+ "esprima": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
+ }
+ }
+ },
+ "json-parse-better-errors": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
+ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw=="
+ },
+ "json-schema-traverse": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz",
+ "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A="
+ },
+ "json-stable-stringify-without-jsonify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE="
+ },
"jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
@@ -902,6 +1527,14 @@
}
}
},
+ "jsx-ast-utils": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz",
+ "integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=",
+ "requires": {
+ "array-includes": "^3.0.3"
+ }
+ },
"jwa": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.6.tgz",
@@ -929,6 +1562,15 @@
"invert-kv": "^1.0.0"
}
},
+ "levn": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
+ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
+ "requires": {
+ "prelude-ls": "~1.1.2",
+ "type-check": "~0.3.2"
+ }
+ },
"load-json-file": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
@@ -994,6 +1636,14 @@
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
"integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA=="
},
+ "loose-envify": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
+ "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
+ "requires": {
+ "js-tokens": "^3.0.0 || ^4.0.0"
+ }
+ },
"lru-cache": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz",
@@ -1133,6 +1783,11 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
+ "mute-stream": {
+ "version": "0.0.7",
+ "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
+ "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s="
+ },
"mysql": {
"version": "2.15.0",
"resolved": "https://registry.npmjs.org/mysql/-/mysql-2.15.0.tgz",
@@ -1214,6 +1869,11 @@
"resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-1.1.0.tgz",
"integrity": "sha1-TzFS4JVA/eKMdvRLGbvNHVpCR40="
},
+ "natural-compare": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc="
+ },
"negotiator": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz",
@@ -1271,6 +1931,11 @@
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
},
+ "object-keys": {
+ "version": "1.0.12",
+ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz",
+ "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag=="
+ },
"on-finished": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
@@ -1292,6 +1957,27 @@
"wrappy": "1"
}
},
+ "onetime": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
+ "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=",
+ "requires": {
+ "mimic-fn": "^1.0.0"
+ }
+ },
+ "optionator": {
+ "version": "0.8.2",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz",
+ "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=",
+ "requires": {
+ "deep-is": "~0.1.3",
+ "fast-levenshtein": "~2.0.4",
+ "levn": "~0.3.0",
+ "prelude-ls": "~1.1.2",
+ "type-check": "~0.3.2",
+ "wordwrap": "~1.0.0"
+ }
+ },
"os-locale": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz",
@@ -1302,6 +1988,11 @@
"mem": "^1.1.0"
}
},
+ "os-tmpdir": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
+ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
+ },
"p-finally": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
@@ -1351,6 +2042,11 @@
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
+ "path-is-inside": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz",
+ "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM="
+ },
"path-key": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
@@ -1382,23 +2078,66 @@
"pinkie": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
- "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=",
- "dev": true
+ "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA="
},
"pinkie-promise": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
"integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
- "dev": true,
"requires": {
"pinkie": "^2.0.0"
}
},
+ "pkg-conf": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz",
+ "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=",
+ "requires": {
+ "find-up": "^2.0.0",
+ "load-json-file": "^4.0.0"
+ },
+ "dependencies": {
+ "load-json-file": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
+ "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=",
+ "requires": {
+ "graceful-fs": "^4.1.2",
+ "parse-json": "^4.0.0",
+ "pify": "^3.0.0",
+ "strip-bom": "^3.0.0"
+ }
+ },
+ "parse-json": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
+ "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
+ "requires": {
+ "error-ex": "^1.3.1",
+ "json-parse-better-errors": "^1.0.1"
+ }
+ },
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY="
+ }
+ }
+ },
+ "pkg-config": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/pkg-config/-/pkg-config-1.1.1.tgz",
+ "integrity": "sha1-VX7yLXPaPIg3EHdmxS6tq94pj+Q=",
+ "requires": {
+ "debug-log": "^1.0.0",
+ "find-root": "^1.0.0",
+ "xtend": "^4.0.1"
+ }
+ },
"pkg-dir": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz",
"integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=",
- "dev": true,
"requires": {
"find-up": "^1.0.0"
},
@@ -1407,7 +2146,6 @@
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
"integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
- "dev": true,
"requires": {
"path-exists": "^2.0.0",
"pinkie-promise": "^2.0.0"
@@ -1417,23 +2155,46 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
"integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
- "dev": true,
"requires": {
"pinkie-promise": "^2.0.0"
}
}
}
},
+ "pluralize": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz",
+ "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow=="
+ },
+ "prelude-ls": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
+ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ="
+ },
"process-nextick-args": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
"integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M="
},
+ "progress": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz",
+ "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8="
+ },
"progress-bar-formatter": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/progress-bar-formatter/-/progress-bar-formatter-2.0.1.tgz",
"integrity": "sha1-DZfrsWRn4sIwg3NXIXa3w1UeVW4="
},
+ "prop-types": {
+ "version": "15.6.2",
+ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.2.tgz",
+ "integrity": "sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==",
+ "requires": {
+ "loose-envify": "^1.3.1",
+ "object-assign": "^4.1.1"
+ }
+ },
"proto-list": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz",
@@ -1561,6 +2322,15 @@
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
"integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE="
},
+ "require-uncached": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz",
+ "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=",
+ "requires": {
+ "caller-path": "^0.1.0",
+ "resolve-from": "^1.0.0"
+ }
+ },
"resolve": {
"version": "1.7.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz",
@@ -1569,6 +2339,20 @@
"path-parse": "^1.0.5"
}
},
+ "resolve-from": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz",
+ "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY="
+ },
+ "restore-cursor": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
+ "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=",
+ "requires": {
+ "onetime": "^2.0.0",
+ "signal-exit": "^3.0.2"
+ }
+ },
"retry-as-promised": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-2.3.2.tgz",
@@ -1588,6 +2372,40 @@
}
}
},
+ "rimraf": {
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
+ "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
+ "requires": {
+ "glob": "^7.0.5"
+ }
+ },
+ "run-async": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz",
+ "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=",
+ "requires": {
+ "is-promise": "^2.1.0"
+ }
+ },
+ "run-parallel": {
+ "version": "1.1.9",
+ "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz",
+ "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q=="
+ },
+ "rx-lite": {
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz",
+ "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ="
+ },
+ "rx-lite-aggregates": {
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz",
+ "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=",
+ "requires": {
+ "rx-lite": "*"
+ }
+ },
"safe-buffer": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
@@ -1740,6 +2558,21 @@
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
},
+ "slice-ansi": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz",
+ "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==",
+ "requires": {
+ "is-fullwidth-code-point": "^2.0.0"
+ },
+ "dependencies": {
+ "is-fullwidth-code-point": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
+ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8="
+ }
+ }
+ },
"sodium-native": {
"version": "2.1.6",
"resolved": "https://registry.npmjs.org/sodium-native/-/sodium-native-2.1.6.tgz",
@@ -1778,11 +2611,87 @@
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz",
"integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA=="
},
+ "sprintf-js": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
+ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
+ },
"sqlstring": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.0.tgz",
"integrity": "sha1-UluKT9Jtb3GqYegipsr5dtMa0qg="
},
+ "standard": {
+ "version": "11.0.1",
+ "resolved": "https://registry.npmjs.org/standard/-/standard-11.0.1.tgz",
+ "integrity": "sha512-nu0jAcHiSc8H+gJCXeiziMVZNDYi8MuqrYJKxTgjP4xKXZMKm311boqQIzDrYI/ktosltxt2CbDjYQs9ANC8IA==",
+ "requires": {
+ "eslint": "~4.18.0",
+ "eslint-config-standard": "11.0.0",
+ "eslint-config-standard-jsx": "5.0.0",
+ "eslint-plugin-import": "~2.9.0",
+ "eslint-plugin-node": "~6.0.0",
+ "eslint-plugin-promise": "~3.7.0",
+ "eslint-plugin-react": "~7.7.0",
+ "eslint-plugin-standard": "~3.0.1",
+ "standard-engine": "~8.0.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "eslint-plugin-import": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.9.0.tgz",
+ "integrity": "sha1-JgAu+/ylmJtyiKwEdQi9JPIXsWk=",
+ "requires": {
+ "builtin-modules": "^1.1.1",
+ "contains-path": "^0.1.0",
+ "debug": "^2.6.8",
+ "doctrine": "1.5.0",
+ "eslint-import-resolver-node": "^0.3.1",
+ "eslint-module-utils": "^2.1.1",
+ "has": "^1.0.1",
+ "lodash": "^4.17.4",
+ "minimatch": "^3.0.3",
+ "read-pkg-up": "^2.0.0"
+ }
+ },
+ "eslint-plugin-promise": {
+ "version": "3.7.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.7.0.tgz",
+ "integrity": "sha512-2WO+ZFh7vxUKRfR0cOIMrWgYKdR6S1AlOezw6pC52B6oYpd5WFghN+QHxvrRdZMtbo8h3dfUZ2o1rWb0UPbKtg=="
+ },
+ "eslint-plugin-standard": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz",
+ "integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI="
+ }
+ }
+ },
+ "standard-engine": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-8.0.1.tgz",
+ "integrity": "sha512-LA531C3+nljom/XRvdW/hGPXwmilRkaRkENhO3FAGF1Vtq/WtCXzgmnc5S6vUHHsgv534MRy02C1ikMwZXC+tw==",
+ "requires": {
+ "deglob": "^2.1.0",
+ "get-stdin": "^6.0.0",
+ "minimist": "^1.1.0",
+ "pkg-conf": "^2.0.0"
+ },
+ "dependencies": {
+ "minimist": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
+ }
+ }
+ },
"status-bar": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/status-bar/-/status-bar-2.0.3.tgz",
@@ -1851,6 +2760,29 @@
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8="
},
+ "strip-json-comments": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
+ "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo="
+ },
+ "supports-color": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
+ },
+ "table": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz",
+ "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==",
+ "requires": {
+ "ajv": "^5.2.3",
+ "ajv-keywords": "^2.1.0",
+ "chalk": "^2.1.0",
+ "lodash": "^4.17.4",
+ "slice-ansi": "1.0.0",
+ "string-width": "^2.1.1"
+ }
+ },
"terraformer": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/terraformer/-/terraformer-1.0.8.tgz",
@@ -1868,6 +2800,11 @@
"terraformer": "~1.0.5"
}
},
+ "text-table": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
+ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ="
+ },
"tftp": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/tftp/-/tftp-0.1.2.tgz",
@@ -1877,6 +2814,11 @@
"status-bar": "2.0.x"
}
},
+ "through": {
+ "version": "2.3.8",
+ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
+ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
+ },
"timers-ext": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.5.tgz",
@@ -1886,11 +2828,27 @@
"next-tick": "1"
}
},
+ "tmp": {
+ "version": "0.0.33",
+ "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
+ "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
+ "requires": {
+ "os-tmpdir": "~1.0.2"
+ }
+ },
"toposort-class": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz",
"integrity": "sha1-f/0feMi+KMO6Rc1OGj9e4ZO9mYg="
},
+ "type-check": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
+ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
+ "requires": {
+ "prelude-ls": "~1.1.2"
+ }
+ },
"type-is": {
"version": "1.6.16",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz",
@@ -1900,6 +2858,11 @@
"mime-types": "~2.1.18"
}
},
+ "typedarray": {
+ "version": "0.0.6",
+ "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
+ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
+ },
"umzug": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/umzug/-/umzug-2.1.0.tgz",
@@ -1911,6 +2874,11 @@
"resolve": "^1.0.0"
}
},
+ "uniq": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz",
+ "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8="
+ },
"universalify": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz",
@@ -1976,6 +2944,11 @@
"@types/node": "*"
}
},
+ "wordwrap": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
+ "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus="
+ },
"wrap-ansi": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
@@ -2002,6 +2975,14 @@
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
},
+ "write": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz",
+ "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=",
+ "requires": {
+ "mkdirp": "^0.5.1"
+ }
+ },
"xtend": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
diff --git a/server/package.json b/server/package.json
index 13b887b..247a12e 100644
--- a/server/package.json
+++ b/server/package.json
@@ -21,10 +21,10 @@
"sequelize": "^4.37.7",
"sequelize-cli": "^4.0.0",
"shelljs": "^0.8.2",
+ "standard": "^11.0.1",
"tftp": "^0.1.2"
},
"devDependencies": {
- "eslint-config-google": "^0.9.1",
"eslint-config-standard": "^11.0.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-node": "^6.0.1",
diff --git a/server/router.js b/server/router.js
index 263abed..4f8d0bb 100644
--- a/server/router.js
+++ b/server/router.js
@@ -1,53 +1,53 @@
-var express = require('express');
-var router = express.Router();
-var path = require('path');
+var express = require('express')
+var router = express.Router()
+var path = require('path')
// Authentication routes
-var auth = require(path.join(__dirname, 'lib', 'authentication'));
-router.get('/auth', auth.auth);
-router.post('/login', auth.login);
-router.post('/signup', auth.signup);
-router.post('/logout', auth.logout);
-router.post('/changepassword', auth.changePassword);
+var auth = require(path.join(__dirname, 'lib', 'authentication'))
+router.get('/auth', auth.auth)
+router.post('/login', auth.login)
+router.post('/signup', auth.signup)
+router.post('/logout', auth.logout)
+router.post('/changepassword', auth.changePassword)
// User API
-var user = require(path.join(__dirname, 'api', 'user'));
-router.get('/user/info', auth.verifyToken, user.info);
+var user = require(path.join(__dirname, 'api', 'user'))
+router.get('/user/info', auth.verifyToken, user.info)
// Locations API
-var locations = require(path.join(__dirname, 'api', 'locations'));
-router.get('/locations', auth.verifyToken, locations.get);
-router.post('/locations', locations.post);
+var locations = require(path.join(__dirname, 'api', 'locations'))
+router.get('/locations', auth.verifyToken, locations.get)
+router.post('/locations', locations.post)
// Clients API
-var clients = require(path.join(__dirname, 'api', 'clients'));
-router.get('/clients', clients.get);
-router.post('/clients', clients.post);
+var clients = require(path.join(__dirname, 'api', 'clients'))
+router.get('/clients', clients.get)
+router.post('/clients', clients.post)
// Permissions API
-var permissions = require(path.join(__dirname, 'api', 'permissions'));
-router.get('/getRolesByUserid', permissions.getRolesByUserid);
-router.post('/getRoleById', auth.verifyToken, permissions.getRoleById);
+var permissions = require(path.join(__dirname, 'api', 'permissions'))
+router.get('/getRolesByUserid', permissions.getRolesByUserid)
+router.post('/getRoleById', auth.verifyToken, permissions.getRoleById)
// Shell API
-var shell = require(path.join(__dirname, 'lib', 'shell'));
-router.get('/shell/buildipxe', shell.buildIPXE);
+var shell = require(path.join(__dirname, 'lib', 'shell'))
+router.get('/shell/buildipxe', shell.buildIPXE)
// Nodemailer API
-var nodemailer = require(path.join(__dirname, 'lib', 'nodemailer'));
-router.get('/mail/send', nodemailer.sendMail);
+var nodemailer = require(path.join(__dirname, 'lib', 'nodemailer'))
+router.get('/mail/send', nodemailer.sendMail)
// External backends API
-var backends = require(path.join(__dirname, 'api', 'backends'));
-router.get('/backends/getCredentialsByType', auth.verifyToken, backends.getCredentialsByType);
-router.get('/backends/getBackendInfoById', auth.verifyToken, backends.getBackendInfoById);
-router.get('/backends/getBackendList', auth.verifyToken, backends.getBackendList);
-router.get('/backends/getBackendTypes', backends.getBackendTypes);
-router.post('/backends/saveBackend', auth.verifyToken, backends.saveBackend);
+var backends = require(path.join(__dirname, 'api', 'backends'))
+router.get('/backends/getCredentialsByType', auth.verifyToken, backends.getCredentialsByType)
+router.get('/backends/getBackendInfoById', auth.verifyToken, backends.getBackendInfoById)
+router.get('/backends/getBackendList', auth.verifyToken, backends.getBackendList)
+router.get('/backends/getBackendTypes', backends.getBackendTypes)
+router.post('/backends/saveBackend', auth.verifyToken, backends.saveBackend)
router.post('/backends/deleteBackendById', auth.verifyToken, backends.deleteBackendById)
// Load ipxe scipts API
-var ipxeloader = require(path.join(__dirname, 'api', 'ipxe-loader'));
-router.get('/ipxe-loader/load-script', ipxeloader.loadScript);
+var ipxeloader = require(path.join(__dirname, 'api', 'ipxe-loader'))
+router.get('/ipxe-loader/load-script', ipxeloader.loadScript)
-module.exports = router; \ No newline at end of file
+module.exports = router