@diagramers/api
Version:
Diagramers API - A comprehensive Node.js API template with TypeScript, Firebase Functions, and Socket.io
538 lines (436 loc) • 8.48 kB
Plain Text
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/*!
* ignore
*/
/*!
* @ignore
*/
/*!
* Applies query middleware from this model's schema to this model's
* Query constructor.
*/
/*!
* Applies virtuals properties to `json`.
*/
/*!
* Browser doc exposes the event emitter API
*/
/*!
* Called internally by `openUri()` to create a MongoClient instance.
*/
/*!
* Centralize this so we can more easily work around issues with people
* stubbing out `process.nextTick()` in tests using sinon:
* https://github.com/sinonjs/lolex#automatically-incrementing-mocked-time
* See gh-6074
*/
/*!
* Check if the given document only has primitive values
*/
/*!
* Compile other Buffer methods marking this buffer as modified.
*/
/*!
* Connection states
*/
/*!
* Convenience `valueOf()` to allow comparing ObjectIds using double equals re: gh-7299
*/
/*!
* Convert sort values
*/
/*!
* Converts to POJO when you use the document for querying
*/
/*!
* Create a new default connection (`mongoose.connection`) for a Mongoose instance.
* No-op if there is already a default connection.
*/
/*!
* Dependencies
*/
/*!
* Document exposes the NodeJS event emitter API, so you can use
* `on`, `once`, etc.
*/
/*!
* Export
*/
/*!
* Exports
*/
/*!
* Exports.
*/
/*!
* Get the default buffer timeout for this connection
*/
/*!
* Get this schema's default toObject/toJSON options, including Mongoose global
* options.
*/
/*!
* Give the constructor the ability to emit events.
*/
/*!
* Handle casting $elemMatch operators
*/
/*!
* Helpers
*/
/*!
* If _duplicateKeyErrorMessage is a string, replace unique index errors "E11000 duplicate key error" with this string.
*
* @api private
*/
/*!
* If `docs` isn't all instances of the right model, depopulate `arr`
*/
/*!
* If `translateAliases` option is set, call `Model.translateAliases()`
* on the following query properties: filter, projection, update, distinct.
*/
/*!
* If transaction was aborted, we need to reset newly inserted documents' `isNew`.
*/
/*!
* Inherit from Buffer.
*/
/*!
* Inherit from EventEmitter
*/
/*!
* Inherit from EventEmitter.
*/
/*!
* Inherit from Subdocument
*/
/*!
* Inherit from abstract Collection.
*/
/*!
* Inherit from the NodeJS document
*/
/*!
* Inherits from Connection.
*/
/*!
* Inherits from SchemaArray.
*/
/*!
* Inherits from SchemaType.
*/
/*!
* Internal helper for updateMany, updateOne
*/
/*!
* Internal shallow clone alternative to `$toObject()`: much faster, no options processing
*/
/*!
* Minimize _just_ empty objects along the path chain specified
* by `parts`, ignoring all other paths. Useful in cases where
* you want to minimize after unsetting a path.
*
* #### Example:
*
* const obj = { foo: { bar: { baz: {} } }, a: {} };
* _minimizePath(obj, 'foo.bar.baz');
* obj; // { a: {} }
*/
/*!
* Module dependencies
*/
/*!
* Module dependencies.
*/
/*!
* Module exports
*/
/*!
* Module exports.
*/
/*!
* Module requirements
*/
/*!
* Module requirements.
*/
/*!
* Overwrite mquery's `_distinct`, because Mongoose uses that name
* to store the field to apply distinct on.
*/
/*!
* Permissions
*/
/*!
* Populates `docs` for a single `populateOptions` instance.
*/
/*!
* Recursively set nested arrays
*/
/*!
* Recursively set options on implicitly created schemas
*/
/*!
* Reset document state in between transaction retries re: gh-13698
*/
/*!
* Returns the value passed to it.
*/
/*!
* Runs queued functions
*/
/*!
* Split a string path into components delimited by '.' or
* '[\d+]'
*
* #### Example:
* stringToParts('foo[0].bar.1'); // ['foo', '0', 'bar', '1']
*/
/*!
* Valid mongoose options
*/
/*!
* Virtuals defined on this array itself.
*/
/*!
* accepts
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* body-parser
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* body-parser
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* bytes
* Copyright(c) 2012-2014 TJ Holowaychuk
* Copyright(c) 2015 Jed Watson
* MIT Licensed
*/
/*!
* content-disposition
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* content-type
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* define methods
*/
/*!
* depd
* Copyright(c) 2014-2018 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* destroy
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* ee-first
* Copyright(c) 2014 Jonathan Ong
* MIT Licensed
*/
/*!
* encodeurl
* Copyright(c) 2016 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* escape-html
* Copyright(c) 2012-2013 TJ Holowaychuk
* Copyright(c) 2015 Andreas Lubbe
* Copyright(c) 2015 Tiancheng "Timothy" Gu
* MIT Licensed
*/
/*!
* etag
* Copyright(c) 2014-2016 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* exports
*/
/*!
* express
* Copyright(c) 2009-2013 TJ Holowaychuk
* Copyright(c) 2013 Roman Shtylman
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* express
* Copyright(c) 2009-2013 TJ Holowaychuk
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* finalhandler
* Copyright(c) 2014-2022 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* forwarded
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* fresh
* Copyright(c) 2012 TJ Holowaychuk
* Copyright(c) 2016-2017 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* gt, gte, lt, lte, ne, in, nin, all, regex, size, maxDistance
*
* Thing.where('type').nin(array)
*/
/*!
* http-errors
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2016 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* ignore
*/
/*!
* inherit mquery
*/
/*!
* limit, skip, batchSize, comment
*
* Sets these associated options.
*
* query.comment('feed query');
*/
/*!
* media-typer
* Copyright(c) 2014 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* merge-descriptors
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* methods
* Copyright(c) 2013-2014 TJ Holowaychuk
* Copyright(c) 2015-2016 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* negotiator
* Copyright(c) 2012 Federico Romero
* Copyright(c) 2012-2014 Isaac Z. Schlueter
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* on-finished
* Copyright(c) 2013 Jonathan Ong
* Copyright(c) 2014 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* parseurl
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* proxy-addr
* Copyright(c) 2014-2016 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* range-parser
* Copyright(c) 2012-2014 TJ Holowaychuk
* Copyright(c) 2015-2016 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* raw-body
* Copyright(c) 2013-2014 Jonathan Ong
* Copyright(c) 2014-2022 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* send
* Copyright(c) 2012 TJ Holowaychuk
* Copyright(c) 2014-2022 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* serve-static
* Copyright(c) 2010 Sencha Inc.
* Copyright(c) 2011 TJ Holowaychuk
* Copyright(c) 2014-2016 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* statuses
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2016 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* toidentifier
* Copyright(c) 2016 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* type-is
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* unpipe
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
/*!
* vary
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*/
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */