diff --git a/services/web/app/coffee/Features/Project/ProjectCreationHandler.coffee b/services/web/app/coffee/Features/Project/ProjectCreationHandler.coffee index 7718524a79..ffb69abeac 100644 --- a/services/web/app/coffee/Features/Project/ProjectCreationHandler.coffee +++ b/services/web/app/coffee/Features/Project/ProjectCreationHandler.coffee @@ -2,7 +2,7 @@ logger = require('logger-sharelatex') async = require("async") metrics = require('metrics-sharelatex') Settings = require('settings-sharelatex') -ObjectId = require('../../infrastructure/Mongoose').Types.ObjectId +ObjectId = require('mongoose').Types.ObjectId Project = require('../../models/Project').Project Folder = require('../../models/Folder').Folder ProjectEntityHandler = require('./ProjectEntityHandler') diff --git a/services/web/app/coffee/Features/Project/ProjectEntityHandler.coffee b/services/web/app/coffee/Features/Project/ProjectEntityHandler.coffee index 078b4b49f4..5868d6941a 100644 --- a/services/web/app/coffee/Features/Project/ProjectEntityHandler.coffee +++ b/services/web/app/coffee/Features/Project/ProjectEntityHandler.coffee @@ -534,7 +534,7 @@ module.exports = ProjectEntityHandler = fileSystem: "#{path.fileSystem}/#{element.name}" mongo: path.mongo id = element._id+'' - element._id = require('../../infrastructure/Mongoose').Types.ObjectId(id) + element._id = require('mongoose').Types.ObjectId(id) conditions = _id:project._id mongopath = "#{path.mongo}.#{type}" update = "$push":{} diff --git a/services/web/app/coffee/Features/Subscription/SubscriptionLocator.coffee b/services/web/app/coffee/Features/Subscription/SubscriptionLocator.coffee index 0e17a5640d..beee4a3158 100644 --- a/services/web/app/coffee/Features/Subscription/SubscriptionLocator.coffee +++ b/services/web/app/coffee/Features/Subscription/SubscriptionLocator.coffee @@ -1,6 +1,6 @@ Subscription = require('../../models/Subscription').Subscription logger = require("logger-sharelatex") -ObjectId = require('../../infrastructure/Mongoose').Types.ObjectId +ObjectId = require('mongoose').Types.ObjectId module.exports = diff --git a/services/web/app/coffee/Features/Subscription/SubscriptionUpdater.coffee b/services/web/app/coffee/Features/Subscription/SubscriptionUpdater.coffee index 6027a2533e..a4a0864d4f 100644 --- a/services/web/app/coffee/Features/Subscription/SubscriptionUpdater.coffee +++ b/services/web/app/coffee/Features/Subscription/SubscriptionUpdater.coffee @@ -6,7 +6,7 @@ UserFeaturesUpdater = require("./UserFeaturesUpdater") PlansLocator = require("./PlansLocator") Settings = require("settings-sharelatex") logger = require("logger-sharelatex") -ObjectId = require('../../infrastructure/Mongoose').Types.ObjectId +ObjectId = require('mongoose').Types.ObjectId ReferalAllocator = require("../Referal/ReferalAllocator") oneMonthInSeconds = 60 * 60 * 24 * 30 diff --git a/services/web/app/coffee/infrastructure/Mongoose.coffee b/services/web/app/coffee/infrastructure/Mongoose.coffee index 6b9e05759f..7fbf64fd71 100644 --- a/services/web/app/coffee/infrastructure/Mongoose.coffee +++ b/services/web/app/coffee/infrastructure/Mongoose.coffee @@ -2,8 +2,6 @@ mongoose = require('mongoose') Settings = require 'settings-sharelatex' logger = require('logger-sharelatex') -mongoose.Promise = global.Promise - mongoose.connect(Settings.mongo.url, server: poolSize: 10) mongoose.connection.on 'connected', () -> diff --git a/services/web/app/coffee/models/Doc.coffee b/services/web/app/coffee/models/Doc.coffee index 122b6a935b..862638acb7 100644 --- a/services/web/app/coffee/models/Doc.coffee +++ b/services/web/app/coffee/models/Doc.coffee @@ -1,4 +1,4 @@ -mongoose = require '../infrastructure/Mongoose' +mongoose = require 'mongoose' Settings = require 'settings-sharelatex' Schema = mongoose.Schema diff --git a/services/web/app/coffee/models/File.coffee b/services/web/app/coffee/models/File.coffee index c6cf64bf1d..3ca32b8f8f 100644 --- a/services/web/app/coffee/models/File.coffee +++ b/services/web/app/coffee/models/File.coffee @@ -1,4 +1,4 @@ -mongoose = require '../infrastructure/Mongoose' +mongoose = require 'mongoose' Settings = require 'settings-sharelatex' Schema = mongoose.Schema diff --git a/services/web/app/coffee/models/Folder.coffee b/services/web/app/coffee/models/Folder.coffee index 03058aa5b7..4c2bf04b64 100644 --- a/services/web/app/coffee/models/Folder.coffee +++ b/services/web/app/coffee/models/Folder.coffee @@ -1,4 +1,4 @@ -mongoose = require('../infrastructure/Mongoose') +mongoose = require('mongoose') Settings = require 'settings-sharelatex' DocSchema = require('./Doc').DocSchema FileSchema = require('./File').FileSchema diff --git a/services/web/app/coffee/models/Project.coffee b/services/web/app/coffee/models/Project.coffee index 6211b1eff9..18387bdc0b 100644 --- a/services/web/app/coffee/models/Project.coffee +++ b/services/web/app/coffee/models/Project.coffee @@ -1,4 +1,4 @@ -mongoose = require('../infrastructure/Mongoose') +mongoose = require('mongoose') Settings = require 'settings-sharelatex' _ = require('underscore') FolderSchema = require('./Folder.js').FolderSchema diff --git a/services/web/app/coffee/models/ProjectInvite.coffee b/services/web/app/coffee/models/ProjectInvite.coffee index 9f6fb16c55..9b9e0cb350 100644 --- a/services/web/app/coffee/models/ProjectInvite.coffee +++ b/services/web/app/coffee/models/ProjectInvite.coffee @@ -1,4 +1,4 @@ -mongoose = require '../infrastructure/Mongoose' +mongoose = require 'mongoose' Settings = require 'settings-sharelatex' diff --git a/services/web/app/coffee/models/Subscription.coffee b/services/web/app/coffee/models/Subscription.coffee index 84395e7cc6..cd036fb6f1 100644 --- a/services/web/app/coffee/models/Subscription.coffee +++ b/services/web/app/coffee/models/Subscription.coffee @@ -1,4 +1,4 @@ -mongoose = require '../infrastructure/Mongoose' +mongoose = require 'mongoose' Settings = require 'settings-sharelatex' Schema = mongoose.Schema @@ -31,4 +31,4 @@ Subscription = conn.model('Subscription', SubscriptionSchema) mongoose.model 'Subscription', SubscriptionSchema exports.Subscription = Subscription -exports.SubscriptionSchema = SubscriptionSchema +exports.SubscriptionSchema = SubscriptionSchema \ No newline at end of file diff --git a/services/web/app/coffee/models/SystemMessage.coffee b/services/web/app/coffee/models/SystemMessage.coffee index 3e1e1689e4..adb665fede 100644 --- a/services/web/app/coffee/models/SystemMessage.coffee +++ b/services/web/app/coffee/models/SystemMessage.coffee @@ -1,4 +1,4 @@ -mongoose = require '../infrastructure/Mongoose' +mongoose = require 'mongoose' Settings = require 'settings-sharelatex' Schema = mongoose.Schema diff --git a/services/web/app/coffee/models/User.coffee b/services/web/app/coffee/models/User.coffee index d833c3412a..099b9ef8e2 100644 --- a/services/web/app/coffee/models/User.coffee +++ b/services/web/app/coffee/models/User.coffee @@ -1,7 +1,7 @@ Project = require('./Project').Project Settings = require 'settings-sharelatex' _ = require('underscore') -mongoose = require('../infrastructure/Mongoose') +mongoose = require('mongoose') uuid = require('uuid') Schema = mongoose.Schema ObjectId = Schema.ObjectId diff --git a/services/web/npm-shrinkwrap.json b/services/web/npm-shrinkwrap.json index 8fa1a1b2e8..6904ca8272 100644 --- a/services/web/npm-shrinkwrap.json +++ b/services/web/npm-shrinkwrap.json @@ -292,6 +292,20 @@ "from": "bson@>=1.0.4 <1.1.0", "resolved": "https://registry.npmjs.org/bson/-/bson-1.0.4.tgz" }, + "bson-ext": { + "version": "0.1.13", + "from": "bson-ext@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/bson-ext/-/bson-ext-0.1.13.tgz", + "optional": true, + "dependencies": { + "nan": { + "version": "2.0.9", + "from": "nan@>=2.0.9 <2.1.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.0.9.tgz", + "optional": true + } + } + }, "buffer": { "version": "4.9.1", "from": "buffer@4.9.1", @@ -1236,9 +1250,9 @@ "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz" }, "hooks-fixed": { - "version": "2.0.0", - "from": "hooks-fixed@2.0.0", - "resolved": "https://registry.npmjs.org/hooks-fixed/-/hooks-fixed-2.0.0.tgz" + "version": "1.1.0", + "from": "hooks-fixed@1.1.0", + "resolved": "https://registry.npmjs.org/hooks-fixed/-/hooks-fixed-1.1.0.tgz" }, "http-errors": { "version": "1.6.1", @@ -1461,9 +1475,23 @@ } }, "kareem": { - "version": "1.4.1", - "from": "kareem@1.4.1", - "resolved": "https://registry.npmjs.org/kareem/-/kareem-1.4.1.tgz" + "version": "1.0.1", + "from": "kareem@1.0.1", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-1.0.1.tgz" + }, + "kerberos": { + "version": "0.0.23", + "from": "kerberos@>=0.0.0 <0.1.0", + "resolved": "https://registry.npmjs.org/kerberos/-/kerberos-0.0.23.tgz", + "optional": true, + "dependencies": { + "nan": { + "version": "2.5.1", + "from": "nan@>=2.5.1 <2.6.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.5.1.tgz", + "optional": true + } + } }, "kind-of": { "version": "3.1.0", @@ -2068,49 +2096,46 @@ } }, "mongoose": { - "version": "4.9.8", - "from": "mongoose@4.9.8", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-4.9.8.tgz", + "version": "4.1.0", + "from": "mongoose@4.1.0", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-4.1.0.tgz", "dependencies": { "async": { - "version": "2.1.4", - "from": "async@2.1.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.1.4.tgz" + "version": "0.9.0", + "from": "async@0.9.0", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz" }, - "es6-promise": { - "version": "3.2.1", - "from": "es6-promise@3.2.1", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.2.1.tgz" - }, - "isarray": { - "version": "1.0.0", - "from": "isarray@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + "bson": { + "version": "0.3.2", + "from": "bson@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-0.3.2.tgz" }, "mongodb": { - "version": "2.2.26", - "from": "mongodb@2.2.26", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-2.2.26.tgz" + "version": "2.0.34", + "from": "mongodb@2.0.34", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-2.0.34.tgz" }, "mongodb-core": { - "version": "2.1.10", - "from": "mongodb-core@2.1.10", - "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-2.1.10.tgz" + "version": "1.2.0", + "from": "mongodb-core@1.2.0", + "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-1.2.0.tgz", + "dependencies": { + "bson": { + "version": "0.4.23", + "from": "bson@>=0.4.0 <0.5.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-0.4.23.tgz" + } + } }, "ms": { - "version": "0.7.2", - "from": "ms@0.7.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz" + "version": "0.1.0", + "from": "ms@0.1.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.1.0.tgz" }, "readable-stream": { - "version": "2.2.7", - "from": "readable-stream@2.2.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.7.tgz" - }, - "string_decoder": { - "version": "1.0.0", - "from": "string_decoder@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.0.tgz" + "version": "1.0.31", + "from": "readable-stream@1.0.31", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.31.tgz" } } }, @@ -2120,24 +2145,24 @@ "resolved": "https://registry.npmjs.org/monocle/-/monocle-1.1.51.tgz" }, "mpath": { - "version": "0.2.1", - "from": "mpath@0.2.1", - "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.2.1.tgz" + "version": "0.1.1", + "from": "mpath@0.1.1", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.1.1.tgz" }, "mpromise": { - "version": "0.5.5", - "from": "mpromise@0.5.5", - "resolved": "https://registry.npmjs.org/mpromise/-/mpromise-0.5.5.tgz" + "version": "0.5.4", + "from": "mpromise@0.5.4", + "resolved": "https://registry.npmjs.org/mpromise/-/mpromise-0.5.4.tgz" }, "mquery": { - "version": "2.3.0", - "from": "mquery@2.3.0", - "resolved": "https://registry.npmjs.org/mquery/-/mquery-2.3.0.tgz", + "version": "1.6.1", + "from": "mquery@1.6.1", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-1.6.1.tgz", "dependencies": { "bluebird": { - "version": "2.10.2", - "from": "bluebird@2.10.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.10.2.tgz" + "version": "2.9.26", + "from": "bluebird@2.9.26", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.9.26.tgz" }, "debug": { "version": "2.2.0", @@ -2148,11 +2173,6 @@ "version": "0.7.1", "from": "ms@0.7.1", "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" - }, - "sliced": { - "version": "0.0.5", - "from": "sliced@0.0.5", - "resolved": "https://registry.npmjs.org/sliced/-/sliced-0.0.5.tgz" } } }, @@ -2194,9 +2214,9 @@ } }, "muri": { - "version": "1.2.1", - "from": "muri@1.2.1", - "resolved": "https://registry.npmjs.org/muri/-/muri-1.2.1.tgz" + "version": "1.0.0", + "from": "muri@1.0.0", + "resolved": "https://registry.npmjs.org/muri/-/muri-1.0.0.tgz" }, "mv": { "version": "0.0.5", @@ -3182,9 +3202,9 @@ "resolved": "https://registry.npmjs.org/sixpack-client/-/sixpack-client-1.0.0.tgz" }, "sliced": { - "version": "1.0.1", - "from": "sliced@1.0.1", - "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz" + "version": "0.0.5", + "from": "sliced@0.0.5", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-0.0.5.tgz" }, "smtp-connection": { "version": "2.0.1", diff --git a/services/web/package.json b/services/web/package.json index ff9332f8f0..85da8a3765 100644 --- a/services/web/package.json +++ b/services/web/package.json @@ -39,7 +39,7 @@ "mimelib": "0.2.14", "mocha": "1.17.1", "mongojs": "2.4.0", - "mongoose": "4.9.8", + "mongoose": "4.1.0", "multer": "^0.1.8", "nodemailer": "2.1.0", "nodemailer-sendgrid-transport": "^0.2.0",