Update dependencies
This commit is contained in:
1 parent
afd1a61696
commit
24b047bd5e
11 files changed
+7555
-37
No files matched your search
+1
-1
@@ -1,3 +1,3 @@
|
||||
*~
|
||||
node_modules
|
||||
public
|
||||
dist
|
||||
+5
-10
@@ -245,8 +245,7 @@ function fulfill(accessTimestamp, _fulfillTimestamp) {
|
||||
updated = true;
|
||||
let filter = queries.filter.get(queryResponse);
|
||||
filter = unpackExpression(filter);
|
||||
m
|
||||
.request({
|
||||
m.request({
|
||||
method: "HEAD",
|
||||
url:
|
||||
`/api/${resourceType}/?` +
|
||||
@@ -291,8 +290,7 @@ function fulfill(accessTimestamp, _fulfillTimestamp) {
|
||||
updated = true;
|
||||
let filter = queries.filter.get(queryResponse);
|
||||
filter = unpackExpression(filter);
|
||||
m
|
||||
.request({
|
||||
m.request({
|
||||
method: "GET",
|
||||
url:
|
||||
`/api/${resourceType}/?` +
|
||||
@@ -379,8 +377,7 @@ function fulfill(accessTimestamp, _fulfillTimestamp) {
|
||||
|
||||
allPromises2.push(
|
||||
new Promise((resolve2, reject2) => {
|
||||
m
|
||||
.request({
|
||||
m.request({
|
||||
method: "GET",
|
||||
url:
|
||||
`/api/${resourceType}/?` +
|
||||
@@ -453,8 +450,7 @@ function postTasks(deviceId, tasks) {
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
m
|
||||
.request({
|
||||
m.request({
|
||||
method: "POST",
|
||||
url: `/api/devices/${encodeURIComponent(deviceId)}/tasks`,
|
||||
data: tasks,
|
||||
@@ -471,8 +467,7 @@ function postTasks(deviceId, tasks) {
|
||||
}
|
||||
resolve(connectionRequestStatus);
|
||||
}
|
||||
})
|
||||
.catch(reject);
|
||||
}).catch(reject);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
File renamed without changes.
File renamed without changes.
Generated
+7472
File diff suppressed because it is too large.
Load diff
+21
-18
@@ -4,31 +4,34 @@
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"lint": "eslint --fix common/*.js common/validators/*.js server/*.js client/*.js client/components/*.js;prettier --write common/*.js common/validators/*.js server/*.js client/*.js client/components/*.js client/css/*.css",
|
||||
"build": "npm run lint;webpack;postcss -c postcss.config.js client/css/app.css -o public/app.css",
|
||||
"start": "node server/server"
|
||||
"lint": "eslint --fix common/*.js common/validators/*.js server/*.js client/*.js client/components/*.js;prettier --write *.js common/*.js common/validators/*.js server/*.js client/*.js client/components/*.js client/css/*.css",
|
||||
"build": "npm run lint;webpack;postcss -c postcss.config.js client/css/app.css -o dist/public/app.css",
|
||||
"start": "cd dist && node server"
|
||||
},
|
||||
"author": "Zaid Abdulla <zaid@genieacs.com>",
|
||||
"dependencies": {
|
||||
"jsonwebtoken": "^8.2.1",
|
||||
"koa": "^2.5.0",
|
||||
"koa-body": "^2.5.0",
|
||||
"koa-bodyparser": "^4.2.0",
|
||||
"koa-compress": "^2.0.0",
|
||||
"koa-jwt": "^3.3.1",
|
||||
"jsonwebtoken": "^8.3.0",
|
||||
"koa": "^2.5.2",
|
||||
"koa-bodyparser": "^4.2.1",
|
||||
"koa-compress": "^3.0.0",
|
||||
"koa-jwt": "^3.3.2",
|
||||
"koa-router": "^7.4.0",
|
||||
"koa-static": "^4.0.2",
|
||||
"mithril": "^1.1.6",
|
||||
"mongodb": "^3.0.10",
|
||||
"parsimmon": "^1.7.2"
|
||||
"koa-static": "^5.0.0",
|
||||
"mongodb": "^3.1.1",
|
||||
"parsimmon": "^1.12.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cssnano": "^3.10.0",
|
||||
"eslint": "^4.19.1",
|
||||
"postcss-cli": "^4.1.1",
|
||||
"clean-webpack-plugin": "^0.1.19",
|
||||
"copy-webpack-plugin": "^4.5.2",
|
||||
"cssnano": "^4.0.5",
|
||||
"eslint": "^5.2.0",
|
||||
"mithril": "^1.1.6",
|
||||
"postcss-cli": "^6.0.0",
|
||||
"postcss-cssnext": "^3.1.0",
|
||||
"postcss-import": "^11.1.0",
|
||||
"prettier": "^1.11.1",
|
||||
"webpack": "^3.11.0"
|
||||
"prettier": "^1.14.0",
|
||||
"webpack": "^4.16.3",
|
||||
"webpack-cli": "^3.1.0",
|
||||
"webpack-node-externals": "^1.7.2"
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,4 +4,4 @@ module.exports = {
|
||||
require("postcss-cssnext")({ warnForDuplicates: false }),
|
||||
require("cssnano")
|
||||
]
|
||||
}
|
||||
};
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
const configFile = require("../config.json");
|
||||
const fs = require("fs");
|
||||
const configFile = JSON.parse(fs.readFileSync("./config.json"));
|
||||
|
||||
let config;
|
||||
|
||||
|
||||
+6
-2
@@ -21,10 +21,14 @@ function getClient(db) {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const CONNECTION_URL = config.server.mongodbConnectionUrl;
|
||||
mongodb.MongoClient.connect(CONNECTION_URL, (err, client) => {
|
||||
mongodb.MongoClient.connect(
|
||||
CONNECTION_URL,
|
||||
{ useNewUrlParser: true },
|
||||
(err, client) => {
|
||||
if (err) return reject(err);
|
||||
resolve((_client[db] = client.db(db)));
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ const Koa = require("koa");
|
||||
const Router = require("koa-router");
|
||||
const koaStatic = require("koa-static");
|
||||
const koaCompress = require("koa-compress");
|
||||
const koaBody = require("koa-body");
|
||||
const koaBodyParser = require("koa-bodyparser");
|
||||
const koaJwt = require("koa-jwt");
|
||||
const jwt = require("jsonwebtoken");
|
||||
|
||||
@@ -81,7 +81,7 @@ router.post("/logout", async ctx => {
|
||||
ctx.body = "";
|
||||
});
|
||||
|
||||
koa.use(koaBody());
|
||||
koa.use(koaBodyParser());
|
||||
router.use("/api", api.routes(), api.allowedMethods());
|
||||
|
||||
router.get("/", async ctx => {
|
||||
|
||||
+45
-2
@@ -1,6 +1,49 @@
|
||||
module.exports = {
|
||||
const nodeExternals = require("webpack-node-externals");
|
||||
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
||||
const CleanWebpackPlugin = require("clean-webpack-plugin");
|
||||
|
||||
const mode = "production";
|
||||
|
||||
function transformPackageJson(content) {
|
||||
const pkg = JSON.parse(content);
|
||||
delete pkg["devDependencies"];
|
||||
pkg["scripts"] = {
|
||||
start: "node server"
|
||||
};
|
||||
return JSON.stringify(pkg, null, 2);
|
||||
}
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
mode: mode,
|
||||
entry: "./server/server.js",
|
||||
target: "node",
|
||||
externals: [nodeExternals()],
|
||||
output: {
|
||||
filename: "server.js"
|
||||
},
|
||||
plugins: [
|
||||
new CleanWebpackPlugin(["dist"]),
|
||||
new CopyWebpackPlugin(
|
||||
[
|
||||
{ from: "images/logo.svg", to: "public/logo.svg" },
|
||||
{ from: "images/favicon.png", to: "public/favicon.png" },
|
||||
{ from: "config.json", to: "config.json" },
|
||||
{
|
||||
from: "package.json",
|
||||
to: "package.json",
|
||||
transform: transformPackageJson
|
||||
}
|
||||
],
|
||||
{}
|
||||
)
|
||||
]
|
||||
},
|
||||
{
|
||||
mode: mode,
|
||||
entry: "./client/app.js",
|
||||
output: {
|
||||
filename: "public/app.js"
|
||||
}
|
||||
};
|
||||
}
|
||||
];
|
||||
Reference in new issue
Block a user