Merge pull request #39 from overleaf/msm-dependency-update

npm dependencies update
This commit is contained in:
Miguel Serrano 2020-03-17 16:33:20 +01:00 committed by GitHub
commit 59664a0c96
15 changed files with 3908 additions and 4142 deletions

View file

@ -1,7 +1,7 @@
// this file was auto-generated, do not edit it directly.
// instead run bin/update_build_scripts from
// https://github.com/sharelatex/sharelatex-dev-environment
// Version: 1.3.5
// Version: 1.4.0
{
"extends": [
"standard",

View file

@ -1,7 +1,7 @@
# This file was auto-generated, do not edit it directly.
# Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment
# Version: 1.3.5
# Version: 1.4.0
{
"semi": false,
"singleQuote": true

View file

@ -1,7 +1,7 @@
# This file was auto-generated, do not edit it directly.
# Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment
# Version: 1.3.5
# Version: 1.4.0
FROM node:10.19.0 as base

View file

@ -1,7 +1,7 @@
# This file was auto-generated, do not edit it directly.
# Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment
# Version: 1.3.5
# Version: 1.4.0
BUILD_NUMBER ?= local
BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)

View file

@ -60,7 +60,7 @@ module.exports = MessageFormatter = {
}
}
for (let message of Array.from(messages)) {
for (const message of Array.from(messages)) {
room = rooms_by_id[message.room_id.toString()]
if (room != null) {
thread = getThread(room)
@ -70,7 +70,7 @@ module.exports = MessageFormatter = {
}
}
for (let thread_id in threads) {
for (const thread_id in threads) {
thread = threads[thread_id]
thread.messages.sort((a, b) => a.timestamp - b.timestamp)
}

View file

@ -81,7 +81,7 @@ module.exports = MessageHttpController = {
if (error != null) {
return next(error)
}
return res.send(204)
return res.sendStatus(204)
})
}, // No content
@ -92,7 +92,7 @@ module.exports = MessageHttpController = {
if (error != null) {
return next(error)
}
return res.send(204)
return res.sendStatus(204)
})
}, // No content
@ -110,7 +110,7 @@ module.exports = MessageHttpController = {
if (error != null) {
return next(error)
}
return res.send(204)
return res.sendStatus(204)
})
})
}, // No content
@ -138,7 +138,7 @@ module.exports = MessageHttpController = {
if (error != null) {
return next(error)
}
return res.send(204)
return res.sendStatus(204)
}
)
})
@ -161,7 +161,7 @@ module.exports = MessageHttpController = {
if (error != null) {
return next(error)
}
return res.send(204)
return res.status(204).send()
})
})
},
@ -170,16 +170,15 @@ module.exports = MessageHttpController = {
const { user_id, content } = req != null ? req.body : undefined
const { project_id } = req.params
if (!ObjectId.isValid(user_id)) {
return res.send(400, 'Invalid user_id')
return res.status(400).send('Invalid user_id')
}
if (content == null) {
return res.send(400, 'No content provided')
return res.status(400).send('No content provided')
}
if (content.length > this.MAX_MESSAGE_LENGTH) {
return res.send(
400,
`Content too long (> ${this.MAX_MESSAGE_LENGTH} bytes)`
)
return res
.status(400)
.send(`Content too long (> ${this.MAX_MESSAGE_LENGTH} bytes)`)
}
logger.log(
{ client_thread_id, project_id, user_id, content },
@ -203,7 +202,7 @@ module.exports = MessageHttpController = {
}
message = MessageFormatter.formatMessageForClientSide(message)
message.room_id = project_id
return res.send(201, message)
return res.status(201).send(message)
}
)
}
@ -249,7 +248,7 @@ module.exports = MessageHttpController = {
}
messages = MessageFormatter.formatMessagesForClientSide(messages)
logger.log({ project_id, messages }, 'got messages')
return res.send(200, messages)
return res.status(200).send(messages)
}
)
}

View file

@ -50,7 +50,9 @@ module.exports = ThreadManager = {
}
}
return db.rooms.update(query, update, { upsert: true }, function(error) {
return db.rooms.update(query, { $set: update }, { upsert: true }, function(
error
) {
if (error != null) {
return callback(error)
}

View file

@ -20,7 +20,7 @@ module.exports = Router = {
if (ObjectId.isValid(project_id)) {
return next()
} else {
return res.send(400, 'Invalid project_id')
return res.status(400).send('Invalid project_id')
}
})
@ -28,7 +28,7 @@ module.exports = Router = {
if (ObjectId.isValid(thread_id)) {
return next()
} else {
return res.send(400, 'Invalid thread_id')
return res.status(400).send('Invalid thread_id')
}
})
@ -61,7 +61,7 @@ module.exports = Router = {
'/project/:project_id/thread/:thread_id/messages/:message_id/edit',
MessageHttpController.editMessage
)
app.del(
app.delete(
'/project/:project_id/thread/:thread_id/messages/:message_id',
MessageHttpController.deleteMessage
)
@ -74,7 +74,7 @@ module.exports = Router = {
'/project/:project_id/thread/:thread_id/reopen',
MessageHttpController.reopenThread
)
app.del(
app.delete(
'/project/:project_id/thread/:thread_id',
MessageHttpController.deleteThread
)

View file

@ -14,23 +14,25 @@ const logger = require('logger-sharelatex')
logger.initialize('chat')
const Path = require('path')
const express = require('express')
const bodyParser = require('body-parser')
const errorHandler = require('errorhandler')
const morganLogger = require('morgan')
const app = express()
const server = require('http').createServer(app)
const Router = require('./router')
app.use(express.bodyParser())
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))
app.use(metrics.http.monitor(logger))
metrics.injectMetricsRoute(app)
if (app.get('env') === 'development') {
console.log('Development Enviroment')
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }))
app.use(errorHandler({ dumpExceptions: true, showStack: true }))
}
if (app.get('env') === 'production') {
console.log('Production Enviroment')
app.use(express.logger())
app.use(express.errorHandler())
app.use(morganLogger('tiny'))
app.use(errorHandler())
}
Router.route(app)

View file

@ -1,10 +1,10 @@
chat
--public-repo=False
--language=es
--env-add=
--node-version=10.19.0
--acceptance-creds=None
--dependencies=mongo
--docker-repos=gcr.io/overleaf-ops
--env-add=
--env-pass-through=
--script-version=1.3.5
--language=es
--node-version=10.19.0
--public-repo=False
--script-version=1.4.0

View file

@ -1,24 +1,23 @@
module.exports = {
internal: {
chat: {
host: process.env['LISTEN_ADDRESS'] || 'localhost',
host: process.env.LISTEN_ADDRESS || 'localhost',
port: 3010
}
},
apis: {
web: {
url: `http://${process.env['WEB_HOST'] || 'localhost'}:${process.env[
'WEB_PORT'
] || 3000}`,
user: process.env['WEB_API_USER'] || 'sharelatex',
pass: process.env['WEB_API_PASSWORD'] || 'password'
url: `http://${process.env.WEB_HOST || 'localhost'}:${process.env
.WEB_PORT || 3000}`,
user: process.env.WEB_API_USER || 'sharelatex',
pass: process.env.WEB_API_PASSWORD || 'password'
}
},
mongo: {
url:
process.env['MONGO_CONNECTION_STRING'] ||
`mongodb://${process.env['MONGO_HOST'] || 'localhost'}/sharelatex`
process.env.MONGO_CONNECTION_STRING ||
`mongodb://${process.env.MONGO_HOST || 'localhost'}/sharelatex`
}
}

View file

@ -1,7 +1,7 @@
# This file was auto-generated, do not edit it directly.
# Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment
# Version: 1.3.5
# Version: 1.4.0
version: "2.3"

View file

@ -1,7 +1,7 @@
# This file was auto-generated, do not edit it directly.
# Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment
# Version: 1.3.5
# Version: 1.4.0
version: "2.3"

File diff suppressed because it is too large Load diff

View file

@ -14,39 +14,42 @@
"test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js",
"test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js",
"lint": "node_modules/.bin/eslint .",
"format": "node_modules/.bin/prettier-eslint '**/*.js' --list-different",
"format:fix": "node_modules/.bin/prettier-eslint '**/*.js' --write"
"format": "node_modules/.bin/prettier-eslint $PWD'/**/*.js' --list-different",
"format:fix": "node_modules/.bin/prettier-eslint $PWD'/**/*.js' --write"
},
"dependencies": {
"async": "0.2.9",
"express": "3.3.1",
"logger-sharelatex": "^1.7.0",
"metrics-sharelatex": "^2.2.0",
"mongojs": "2.4.0",
"request": "^2.79.0",
"async": "3.2.0",
"body-parser": "^1.19.0",
"errorhandler": "^1.5.1",
"express": "4.17.1",
"logger-sharelatex": "^1.9.0",
"metrics-sharelatex": "^2.5.0",
"mongojs": "3.1.0",
"morgan": "^1.9.1",
"request": "^2.88.2",
"settings-sharelatex": "^1.1.0"
},
"devDependencies": {
"acorn": "^6.1.1",
"ajv": "^5.5.2",
"bunyan": "^1.0.0",
"acorn": "^7.1.1",
"ajv": "^6.12.0",
"bunyan": "^1.8.12",
"chai": "^4.2.0",
"eslint": "^5.11.1",
"eslint-config-prettier": "^3.3.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-chai-expect": "^2.0.1",
"eslint-plugin-chai-friendly": "^0.4.1",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-mocha": "^5.2.0",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"mocha": "^4.1.0",
"nodemon": "^1.14.11",
"prettier-eslint-cli": "^4.7.1",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-chai-expect": "^2.1.0",
"eslint-plugin-chai-friendly": "^0.5.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-mocha": "^6.3.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"mocha": "^7.1.0",
"nodemon": "^2.0.2",
"prettier-eslint-cli": "^5.0.0",
"sandboxed-module": "^2.0.3",
"sinon": "^8.1.1",
"sinon": "^9.0.0",
"timekeeper": "^2.2.0"
}
}