stockhub-sms 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitignore +35 -0
- package/README.md +303 -0
- package/backend-project/.env +3 -0
- package/backend-project/.env.example +3 -0
- package/backend-project/config/database.js +13 -0
- package/backend-project/controllers/authController.js +70 -0
- package/backend-project/controllers/productController.js +58 -0
- package/backend-project/controllers/reportController.js +206 -0
- package/backend-project/controllers/transactionController.js +199 -0
- package/backend-project/controllers/warehouseController.js +54 -0
- package/backend-project/middleware/auth.js +20 -0
- package/backend-project/models/Product.js +44 -0
- package/backend-project/models/StockTransaction.js +32 -0
- package/backend-project/models/User.js +18 -0
- package/backend-project/models/Warehouse.js +24 -0
- package/backend-project/node_modules/.bin/mime +16 -0
- package/backend-project/node_modules/.bin/mime.cmd +17 -0
- package/backend-project/node_modules/.bin/mime.ps1 +28 -0
- package/backend-project/node_modules/.bin/nodemon +16 -0
- package/backend-project/node_modules/.bin/nodemon.cmd +17 -0
- package/backend-project/node_modules/.bin/nodemon.ps1 +28 -0
- package/backend-project/node_modules/.bin/nodetouch +16 -0
- package/backend-project/node_modules/.bin/nodetouch.cmd +17 -0
- package/backend-project/node_modules/.bin/nodetouch.ps1 +28 -0
- package/backend-project/node_modules/.bin/semver +16 -0
- package/backend-project/node_modules/.bin/semver.cmd +17 -0
- package/backend-project/node_modules/.bin/semver.ps1 +28 -0
- package/backend-project/node_modules/.package-lock.json +1609 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/LICENSE +22 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/.esm-wrapper.mjs +4 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/browser.d.ts +5 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/browser.d.ts.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/browser.js +12 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/browser.js.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.d.ts +3 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.d.ts.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.js +5 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-data-browser.js.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-data.d.ts +3 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-data.d.ts.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-data.js +5 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-data.js.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-src.d.ts +7 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-src.d.ts.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-src.js +881 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/code-points-src.js.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/generate-code-points.d.ts +2 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/generate-code-points.d.ts.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/generate-code-points.js +83 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/generate-code-points.js.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/index.d.ts +11 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/index.d.ts.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/index.js +65 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/index.js.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/memory-code-points.d.ts +10 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/memory-code-points.d.ts.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/memory-code-points.js +32 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/memory-code-points.js.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/node.d.ts +10 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/node.d.ts.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/node.js +15 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/node.js.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/util.d.ts +2 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/util.d.ts.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/util.js +11 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/dist/util.js.map +1 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/package.json +87 -0
- package/backend-project/node_modules/@mongodb-js/saslprep/readme.md +29 -0
- package/backend-project/node_modules/@types/node/LICENSE +21 -0
- package/backend-project/node_modules/@types/node/README.md +15 -0
- package/backend-project/node_modules/@types/node/assert/strict.d.ts +59 -0
- package/backend-project/node_modules/@types/node/assert.d.ts +950 -0
- package/backend-project/node_modules/@types/node/async_hooks.d.ts +711 -0
- package/backend-project/node_modules/@types/node/buffer.buffer.d.ts +466 -0
- package/backend-project/node_modules/@types/node/buffer.d.ts +1765 -0
- package/backend-project/node_modules/@types/node/child_process.d.ts +1366 -0
- package/backend-project/node_modules/@types/node/cluster.d.ts +432 -0
- package/backend-project/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/backend-project/node_modules/@types/node/console.d.ts +93 -0
- package/backend-project/node_modules/@types/node/constants.d.ts +14 -0
- package/backend-project/node_modules/@types/node/crypto.d.ts +4058 -0
- package/backend-project/node_modules/@types/node/dgram.d.ts +537 -0
- package/backend-project/node_modules/@types/node/diagnostics_channel.d.ts +552 -0
- package/backend-project/node_modules/@types/node/dns/promises.d.ts +497 -0
- package/backend-project/node_modules/@types/node/dns.d.ts +876 -0
- package/backend-project/node_modules/@types/node/domain.d.ts +150 -0
- package/backend-project/node_modules/@types/node/events.d.ts +1008 -0
- package/backend-project/node_modules/@types/node/fs/promises.d.ts +1468 -0
- package/backend-project/node_modules/@types/node/fs.d.ts +4780 -0
- package/backend-project/node_modules/@types/node/globals.d.ts +150 -0
- package/backend-project/node_modules/@types/node/globals.typedarray.d.ts +101 -0
- package/backend-project/node_modules/@types/node/http.d.ts +2147 -0
- package/backend-project/node_modules/@types/node/http2.d.ts +2485 -0
- package/backend-project/node_modules/@types/node/https.d.ts +400 -0
- package/backend-project/node_modules/@types/node/index.d.ts +117 -0
- package/backend-project/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/backend-project/node_modules/@types/node/inspector.d.ts +264 -0
- package/backend-project/node_modules/@types/node/inspector.generated.d.ts +4406 -0
- package/backend-project/node_modules/@types/node/module.d.ts +755 -0
- package/backend-project/node_modules/@types/node/net.d.ts +970 -0
- package/backend-project/node_modules/@types/node/os.d.ts +498 -0
- package/backend-project/node_modules/@types/node/package.json +155 -0
- package/backend-project/node_modules/@types/node/path/posix.d.ts +8 -0
- package/backend-project/node_modules/@types/node/path/win32.d.ts +8 -0
- package/backend-project/node_modules/@types/node/path.d.ts +178 -0
- package/backend-project/node_modules/@types/node/perf_hooks.d.ts +612 -0
- package/backend-project/node_modules/@types/node/process.d.ts +2204 -0
- package/backend-project/node_modules/@types/node/punycode.d.ts +89 -0
- package/backend-project/node_modules/@types/node/querystring.d.ts +139 -0
- package/backend-project/node_modules/@types/node/quic.d.ts +897 -0
- package/backend-project/node_modules/@types/node/readline/promises.d.ts +158 -0
- package/backend-project/node_modules/@types/node/readline.d.ts +507 -0
- package/backend-project/node_modules/@types/node/repl.d.ts +420 -0
- package/backend-project/node_modules/@types/node/sea.d.ts +47 -0
- package/backend-project/node_modules/@types/node/sqlite.d.ts +1068 -0
- package/backend-project/node_modules/@types/node/stream/consumers.d.ts +114 -0
- package/backend-project/node_modules/@types/node/stream/iter.d.ts +301 -0
- package/backend-project/node_modules/@types/node/stream/promises.d.ts +211 -0
- package/backend-project/node_modules/@types/node/stream/web.d.ts +300 -0
- package/backend-project/node_modules/@types/node/stream.d.ts +1774 -0
- package/backend-project/node_modules/@types/node/string_decoder.d.ts +27 -0
- package/backend-project/node_modules/@types/node/test/reporters.d.ts +59 -0
- package/backend-project/node_modules/@types/node/test.d.ts +2279 -0
- package/backend-project/node_modules/@types/node/timers/promises.d.ts +93 -0
- package/backend-project/node_modules/@types/node/timers.d.ts +149 -0
- package/backend-project/node_modules/@types/node/tls.d.ts +1193 -0
- package/backend-project/node_modules/@types/node/trace_events.d.ts +103 -0
- package/backend-project/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
- package/backend-project/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/backend-project/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
- package/backend-project/node_modules/@types/node/ts5.6/index.d.ts +119 -0
- package/backend-project/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/backend-project/node_modules/@types/node/ts5.7/index.d.ts +119 -0
- package/backend-project/node_modules/@types/node/tty.d.ts +225 -0
- package/backend-project/node_modules/@types/node/url.d.ts +556 -0
- package/backend-project/node_modules/@types/node/util/types.d.ts +558 -0
- package/backend-project/node_modules/@types/node/util.d.ts +1677 -0
- package/backend-project/node_modules/@types/node/v8.d.ts +980 -0
- package/backend-project/node_modules/@types/node/vm.d.ts +1136 -0
- package/backend-project/node_modules/@types/node/wasi.d.ts +131 -0
- package/backend-project/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
- package/backend-project/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/backend-project/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/backend-project/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/backend-project/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/backend-project/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/backend-project/node_modules/@types/node/web-globals/events.d.ts +106 -0
- package/backend-project/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
- package/backend-project/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/backend-project/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/backend-project/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/backend-project/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/backend-project/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/backend-project/node_modules/@types/node/web-globals/streams.d.ts +115 -0
- package/backend-project/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/backend-project/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/backend-project/node_modules/@types/node/worker_threads.d.ts +671 -0
- package/backend-project/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/backend-project/node_modules/@types/node/zlib.d.ts +589 -0
- package/backend-project/node_modules/@types/webidl-conversions/LICENSE +21 -0
- package/backend-project/node_modules/@types/webidl-conversions/README.md +15 -0
- package/backend-project/node_modules/@types/webidl-conversions/index.d.ts +91 -0
- package/backend-project/node_modules/@types/webidl-conversions/package.json +30 -0
- package/backend-project/node_modules/@types/whatwg-url/LICENSE +21 -0
- package/backend-project/node_modules/@types/whatwg-url/README.md +16 -0
- package/backend-project/node_modules/@types/whatwg-url/dist/URL-impl.d.ts +23 -0
- package/backend-project/node_modules/@types/whatwg-url/dist/URL.d.ts +76 -0
- package/backend-project/node_modules/@types/whatwg-url/dist/URLSearchParams-impl.d.ts +23 -0
- package/backend-project/node_modules/@types/whatwg-url/dist/URLSearchParams.d.ts +91 -0
- package/backend-project/node_modules/@types/whatwg-url/index.d.ts +162 -0
- package/backend-project/node_modules/@types/whatwg-url/package.json +33 -0
- package/backend-project/node_modules/@types/whatwg-url/webidl2js-wrapper.d.ts +4 -0
- package/backend-project/node_modules/accepts/HISTORY.md +243 -0
- package/backend-project/node_modules/accepts/LICENSE +23 -0
- package/backend-project/node_modules/accepts/README.md +140 -0
- package/backend-project/node_modules/accepts/index.js +238 -0
- package/backend-project/node_modules/accepts/package.json +47 -0
- package/backend-project/node_modules/anymatch/LICENSE +15 -0
- package/backend-project/node_modules/anymatch/README.md +87 -0
- package/backend-project/node_modules/anymatch/index.d.ts +20 -0
- package/backend-project/node_modules/anymatch/index.js +104 -0
- package/backend-project/node_modules/anymatch/package.json +48 -0
- package/backend-project/node_modules/array-flatten/LICENSE +21 -0
- package/backend-project/node_modules/array-flatten/README.md +43 -0
- package/backend-project/node_modules/array-flatten/array-flatten.js +64 -0
- package/backend-project/node_modules/array-flatten/package.json +39 -0
- package/backend-project/node_modules/balanced-match/LICENSE.md +23 -0
- package/backend-project/node_modules/balanced-match/README.md +57 -0
- package/backend-project/node_modules/balanced-match/dist/commonjs/index.d.ts +9 -0
- package/backend-project/node_modules/balanced-match/dist/commonjs/index.d.ts.map +1 -0
- package/backend-project/node_modules/balanced-match/dist/commonjs/index.js +59 -0
- package/backend-project/node_modules/balanced-match/dist/commonjs/index.js.map +1 -0
- package/backend-project/node_modules/balanced-match/dist/commonjs/package.json +3 -0
- package/backend-project/node_modules/balanced-match/dist/esm/index.d.ts +9 -0
- package/backend-project/node_modules/balanced-match/dist/esm/index.d.ts.map +1 -0
- package/backend-project/node_modules/balanced-match/dist/esm/index.js +54 -0
- package/backend-project/node_modules/balanced-match/dist/esm/index.js.map +1 -0
- package/backend-project/node_modules/balanced-match/dist/esm/package.json +3 -0
- package/backend-project/node_modules/balanced-match/package.json +68 -0
- package/backend-project/node_modules/bcryptjs/.travis.yml +18 -0
- package/backend-project/node_modules/bcryptjs/.vscode/settings.json +3 -0
- package/backend-project/node_modules/bcryptjs/LICENSE +50 -0
- package/backend-project/node_modules/bcryptjs/README.md +251 -0
- package/backend-project/node_modules/bcryptjs/bin/bcrypt +25 -0
- package/backend-project/node_modules/bcryptjs/bower.json +22 -0
- package/backend-project/node_modules/bcryptjs/dist/README.md +15 -0
- package/backend-project/node_modules/bcryptjs/dist/bcrypt.js +1379 -0
- package/backend-project/node_modules/bcryptjs/dist/bcrypt.min.js +48 -0
- package/backend-project/node_modules/bcryptjs/dist/bcrypt.min.js.gz +0 -0
- package/backend-project/node_modules/bcryptjs/dist/bcrypt.min.map +8 -0
- package/backend-project/node_modules/bcryptjs/externs/bcrypt.js +91 -0
- package/backend-project/node_modules/bcryptjs/externs/minimal-env.js +98 -0
- package/backend-project/node_modules/bcryptjs/index.js +29 -0
- package/backend-project/node_modules/bcryptjs/package.json +47 -0
- package/backend-project/node_modules/bcryptjs/scripts/build.js +37 -0
- package/backend-project/node_modules/bcryptjs/src/bcrypt/impl.js +669 -0
- package/backend-project/node_modules/bcryptjs/src/bcrypt/prng/README.md +5 -0
- package/backend-project/node_modules/bcryptjs/src/bcrypt/prng/accum.js +133 -0
- package/backend-project/node_modules/bcryptjs/src/bcrypt/prng/isaac.js +140 -0
- package/backend-project/node_modules/bcryptjs/src/bcrypt/util/base64.js +115 -0
- package/backend-project/node_modules/bcryptjs/src/bcrypt/util.js +33 -0
- package/backend-project/node_modules/bcryptjs/src/bcrypt.js +327 -0
- package/backend-project/node_modules/bcryptjs/src/bower.json +22 -0
- package/backend-project/node_modules/bcryptjs/src/wrap.js +50 -0
- package/backend-project/node_modules/bcryptjs/tests/quickbrown.txt +150 -0
- package/backend-project/node_modules/bcryptjs/tests/suite.js +197 -0
- package/backend-project/node_modules/binary-extensions/binary-extensions.json +263 -0
- package/backend-project/node_modules/binary-extensions/binary-extensions.json.d.ts +3 -0
- package/backend-project/node_modules/binary-extensions/index.d.ts +14 -0
- package/backend-project/node_modules/binary-extensions/index.js +1 -0
- package/backend-project/node_modules/binary-extensions/license +10 -0
- package/backend-project/node_modules/binary-extensions/package.json +40 -0
- package/backend-project/node_modules/binary-extensions/readme.md +25 -0
- package/backend-project/node_modules/body-parser/HISTORY.md +686 -0
- package/backend-project/node_modules/body-parser/LICENSE +23 -0
- package/backend-project/node_modules/body-parser/README.md +476 -0
- package/backend-project/node_modules/body-parser/index.js +156 -0
- package/backend-project/node_modules/body-parser/lib/read.js +205 -0
- package/backend-project/node_modules/body-parser/lib/types/json.js +243 -0
- package/backend-project/node_modules/body-parser/lib/types/raw.js +101 -0
- package/backend-project/node_modules/body-parser/lib/types/text.js +121 -0
- package/backend-project/node_modules/body-parser/lib/types/urlencoded.js +299 -0
- package/backend-project/node_modules/body-parser/package.json +55 -0
- package/backend-project/node_modules/brace-expansion/LICENSE +23 -0
- package/backend-project/node_modules/brace-expansion/README.md +94 -0
- package/backend-project/node_modules/brace-expansion/dist/commonjs/index.d.ts +6 -0
- package/backend-project/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +1 -0
- package/backend-project/node_modules/brace-expansion/dist/commonjs/index.js +201 -0
- package/backend-project/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -0
- package/backend-project/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
- package/backend-project/node_modules/brace-expansion/dist/esm/index.d.ts +6 -0
- package/backend-project/node_modules/brace-expansion/dist/esm/index.d.ts.map +1 -0
- package/backend-project/node_modules/brace-expansion/dist/esm/index.js +197 -0
- package/backend-project/node_modules/brace-expansion/dist/esm/index.js.map +1 -0
- package/backend-project/node_modules/brace-expansion/dist/esm/package.json +3 -0
- package/backend-project/node_modules/brace-expansion/package.json +64 -0
- package/backend-project/node_modules/braces/LICENSE +21 -0
- package/backend-project/node_modules/braces/README.md +586 -0
- package/backend-project/node_modules/braces/index.js +170 -0
- package/backend-project/node_modules/braces/lib/compile.js +60 -0
- package/backend-project/node_modules/braces/lib/constants.js +57 -0
- package/backend-project/node_modules/braces/lib/expand.js +113 -0
- package/backend-project/node_modules/braces/lib/parse.js +331 -0
- package/backend-project/node_modules/braces/lib/stringify.js +32 -0
- package/backend-project/node_modules/braces/lib/utils.js +122 -0
- package/backend-project/node_modules/braces/package.json +77 -0
- package/backend-project/node_modules/bson/LICENSE.md +201 -0
- package/backend-project/node_modules/bson/README.md +238 -0
- package/backend-project/node_modules/bson/bson.d.ts +1302 -0
- package/backend-project/node_modules/bson/etc/prepare.js +19 -0
- package/backend-project/node_modules/bson/lib/bson.bundle.js +4149 -0
- package/backend-project/node_modules/bson/lib/bson.bundle.js.map +1 -0
- package/backend-project/node_modules/bson/lib/bson.cjs +4144 -0
- package/backend-project/node_modules/bson/lib/bson.cjs.map +1 -0
- package/backend-project/node_modules/bson/lib/bson.mjs +4116 -0
- package/backend-project/node_modules/bson/lib/bson.mjs.map +1 -0
- package/backend-project/node_modules/bson/lib/bson.rn.cjs +4159 -0
- package/backend-project/node_modules/bson/lib/bson.rn.cjs.map +1 -0
- package/backend-project/node_modules/bson/package.json +116 -0
- package/backend-project/node_modules/bson/src/binary.ts +510 -0
- package/backend-project/node_modules/bson/src/bson.ts +250 -0
- package/backend-project/node_modules/bson/src/bson_value.ts +18 -0
- package/backend-project/node_modules/bson/src/code.ts +69 -0
- package/backend-project/node_modules/bson/src/constants.ts +141 -0
- package/backend-project/node_modules/bson/src/db_ref.ts +127 -0
- package/backend-project/node_modules/bson/src/decimal128.ts +858 -0
- package/backend-project/node_modules/bson/src/double.ts +83 -0
- package/backend-project/node_modules/bson/src/error.ts +83 -0
- package/backend-project/node_modules/bson/src/extended_json.ts +515 -0
- package/backend-project/node_modules/bson/src/index.ts +19 -0
- package/backend-project/node_modules/bson/src/int_32.ts +70 -0
- package/backend-project/node_modules/bson/src/long.ts +1067 -0
- package/backend-project/node_modules/bson/src/max_key.ts +36 -0
- package/backend-project/node_modules/bson/src/min_key.ts +36 -0
- package/backend-project/node_modules/bson/src/objectid.ts +323 -0
- package/backend-project/node_modules/bson/src/parser/calculate_size.ts +211 -0
- package/backend-project/node_modules/bson/src/parser/deserializer.ts +751 -0
- package/backend-project/node_modules/bson/src/parser/serializer.ts +1001 -0
- package/backend-project/node_modules/bson/src/parser/utils.ts +29 -0
- package/backend-project/node_modules/bson/src/regexp.ts +114 -0
- package/backend-project/node_modules/bson/src/symbol.ts +58 -0
- package/backend-project/node_modules/bson/src/timestamp.ts +152 -0
- package/backend-project/node_modules/bson/src/utils/byte_utils.ts +61 -0
- package/backend-project/node_modules/bson/src/utils/node_byte_utils.ts +141 -0
- package/backend-project/node_modules/bson/src/utils/web_byte_utils.ts +190 -0
- package/backend-project/node_modules/bson/src/validate_utf8.ts +47 -0
- package/backend-project/node_modules/bson/vendor/base64/LICENSE-MIT.txt +20 -0
- package/backend-project/node_modules/bson/vendor/base64/README.md +112 -0
- package/backend-project/node_modules/bson/vendor/base64/base64.js +157 -0
- package/backend-project/node_modules/bson/vendor/base64/package.json +43 -0
- package/backend-project/node_modules/bson/vendor/text-encoding/LICENSE.md +237 -0
- package/backend-project/node_modules/bson/vendor/text-encoding/README.md +111 -0
- package/backend-project/node_modules/bson/vendor/text-encoding/index.js +9 -0
- package/backend-project/node_modules/bson/vendor/text-encoding/lib/encoding-indexes.js +47 -0
- package/backend-project/node_modules/bson/vendor/text-encoding/lib/encoding.js +3301 -0
- package/backend-project/node_modules/bson/vendor/text-encoding/package.json +37 -0
- package/backend-project/node_modules/buffer-equal-constant-time/.travis.yml +4 -0
- package/backend-project/node_modules/buffer-equal-constant-time/LICENSE.txt +12 -0
- package/backend-project/node_modules/buffer-equal-constant-time/README.md +50 -0
- package/backend-project/node_modules/buffer-equal-constant-time/index.js +41 -0
- package/backend-project/node_modules/buffer-equal-constant-time/package.json +21 -0
- package/backend-project/node_modules/buffer-equal-constant-time/test.js +42 -0
- package/backend-project/node_modules/bytes/History.md +97 -0
- package/backend-project/node_modules/bytes/LICENSE +23 -0
- package/backend-project/node_modules/bytes/Readme.md +152 -0
- package/backend-project/node_modules/bytes/index.js +170 -0
- package/backend-project/node_modules/bytes/package.json +42 -0
- package/backend-project/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
- package/backend-project/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/call-bind-apply-helpers/.nycrc +9 -0
- package/backend-project/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
- package/backend-project/node_modules/call-bind-apply-helpers/LICENSE +21 -0
- package/backend-project/node_modules/call-bind-apply-helpers/README.md +62 -0
- package/backend-project/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- package/backend-project/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/backend-project/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- package/backend-project/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/backend-project/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- package/backend-project/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/backend-project/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- package/backend-project/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/backend-project/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
- package/backend-project/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/backend-project/node_modules/call-bind-apply-helpers/package.json +85 -0
- package/backend-project/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- package/backend-project/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/backend-project/node_modules/call-bind-apply-helpers/test/index.js +63 -0
- package/backend-project/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- package/backend-project/node_modules/call-bound/.eslintrc +13 -0
- package/backend-project/node_modules/call-bound/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/call-bound/.nycrc +9 -0
- package/backend-project/node_modules/call-bound/CHANGELOG.md +42 -0
- package/backend-project/node_modules/call-bound/LICENSE +21 -0
- package/backend-project/node_modules/call-bound/README.md +53 -0
- package/backend-project/node_modules/call-bound/index.d.ts +94 -0
- package/backend-project/node_modules/call-bound/index.js +19 -0
- package/backend-project/node_modules/call-bound/package.json +99 -0
- package/backend-project/node_modules/call-bound/test/index.js +61 -0
- package/backend-project/node_modules/call-bound/tsconfig.json +10 -0
- package/backend-project/node_modules/chokidar/LICENSE +21 -0
- package/backend-project/node_modules/chokidar/README.md +308 -0
- package/backend-project/node_modules/chokidar/index.js +973 -0
- package/backend-project/node_modules/chokidar/lib/constants.js +66 -0
- package/backend-project/node_modules/chokidar/lib/fsevents-handler.js +526 -0
- package/backend-project/node_modules/chokidar/lib/nodefs-handler.js +654 -0
- package/backend-project/node_modules/chokidar/package.json +70 -0
- package/backend-project/node_modules/chokidar/types/index.d.ts +192 -0
- package/backend-project/node_modules/content-disposition/HISTORY.md +60 -0
- package/backend-project/node_modules/content-disposition/LICENSE +22 -0
- package/backend-project/node_modules/content-disposition/README.md +142 -0
- package/backend-project/node_modules/content-disposition/index.js +458 -0
- package/backend-project/node_modules/content-disposition/package.json +44 -0
- package/backend-project/node_modules/content-type/HISTORY.md +29 -0
- package/backend-project/node_modules/content-type/LICENSE +22 -0
- package/backend-project/node_modules/content-type/README.md +94 -0
- package/backend-project/node_modules/content-type/index.js +225 -0
- package/backend-project/node_modules/content-type/package.json +42 -0
- package/backend-project/node_modules/cookie/LICENSE +24 -0
- package/backend-project/node_modules/cookie/README.md +317 -0
- package/backend-project/node_modules/cookie/SECURITY.md +25 -0
- package/backend-project/node_modules/cookie/index.js +335 -0
- package/backend-project/node_modules/cookie/package.json +44 -0
- package/backend-project/node_modules/cookie-signature/History.md +42 -0
- package/backend-project/node_modules/cookie-signature/Readme.md +42 -0
- package/backend-project/node_modules/cookie-signature/index.js +51 -0
- package/backend-project/node_modules/cookie-signature/package.json +18 -0
- package/backend-project/node_modules/cors/LICENSE +22 -0
- package/backend-project/node_modules/cors/README.md +277 -0
- package/backend-project/node_modules/cors/lib/index.js +238 -0
- package/backend-project/node_modules/cors/package.json +42 -0
- package/backend-project/node_modules/debug/.coveralls.yml +1 -0
- package/backend-project/node_modules/debug/.eslintrc +11 -0
- package/backend-project/node_modules/debug/.travis.yml +14 -0
- package/backend-project/node_modules/debug/CHANGELOG.md +362 -0
- package/backend-project/node_modules/debug/LICENSE +19 -0
- package/backend-project/node_modules/debug/Makefile +50 -0
- package/backend-project/node_modules/debug/README.md +312 -0
- package/backend-project/node_modules/debug/component.json +19 -0
- package/backend-project/node_modules/debug/karma.conf.js +70 -0
- package/backend-project/node_modules/debug/node.js +1 -0
- package/backend-project/node_modules/debug/package.json +49 -0
- package/backend-project/node_modules/debug/src/browser.js +185 -0
- package/backend-project/node_modules/debug/src/debug.js +202 -0
- package/backend-project/node_modules/debug/src/index.js +10 -0
- package/backend-project/node_modules/debug/src/inspector-log.js +15 -0
- package/backend-project/node_modules/debug/src/node.js +248 -0
- package/backend-project/node_modules/depd/History.md +103 -0
- package/backend-project/node_modules/depd/LICENSE +22 -0
- package/backend-project/node_modules/depd/Readme.md +280 -0
- package/backend-project/node_modules/depd/index.js +538 -0
- package/backend-project/node_modules/depd/lib/browser/index.js +77 -0
- package/backend-project/node_modules/depd/package.json +45 -0
- package/backend-project/node_modules/destroy/LICENSE +23 -0
- package/backend-project/node_modules/destroy/README.md +63 -0
- package/backend-project/node_modules/destroy/index.js +209 -0
- package/backend-project/node_modules/destroy/package.json +48 -0
- package/backend-project/node_modules/dotenv/CHANGELOG.md +520 -0
- package/backend-project/node_modules/dotenv/LICENSE +23 -0
- package/backend-project/node_modules/dotenv/README-es.md +411 -0
- package/backend-project/node_modules/dotenv/README.md +645 -0
- package/backend-project/node_modules/dotenv/SECURITY.md +1 -0
- package/backend-project/node_modules/dotenv/config.d.ts +1 -0
- package/backend-project/node_modules/dotenv/config.js +9 -0
- package/backend-project/node_modules/dotenv/lib/cli-options.js +17 -0
- package/backend-project/node_modules/dotenv/lib/env-options.js +28 -0
- package/backend-project/node_modules/dotenv/lib/main.d.ts +162 -0
- package/backend-project/node_modules/dotenv/lib/main.js +386 -0
- package/backend-project/node_modules/dotenv/package.json +62 -0
- package/backend-project/node_modules/dunder-proto/.eslintrc +5 -0
- package/backend-project/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/dunder-proto/.nycrc +13 -0
- package/backend-project/node_modules/dunder-proto/CHANGELOG.md +24 -0
- package/backend-project/node_modules/dunder-proto/LICENSE +21 -0
- package/backend-project/node_modules/dunder-proto/README.md +54 -0
- package/backend-project/node_modules/dunder-proto/get.d.ts +5 -0
- package/backend-project/node_modules/dunder-proto/get.js +30 -0
- package/backend-project/node_modules/dunder-proto/package.json +76 -0
- package/backend-project/node_modules/dunder-proto/set.d.ts +5 -0
- package/backend-project/node_modules/dunder-proto/set.js +35 -0
- package/backend-project/node_modules/dunder-proto/test/get.js +34 -0
- package/backend-project/node_modules/dunder-proto/test/index.js +4 -0
- package/backend-project/node_modules/dunder-proto/test/set.js +50 -0
- package/backend-project/node_modules/dunder-proto/tsconfig.json +9 -0
- package/backend-project/node_modules/ecdsa-sig-formatter/CODEOWNERS +1 -0
- package/backend-project/node_modules/ecdsa-sig-formatter/LICENSE +201 -0
- package/backend-project/node_modules/ecdsa-sig-formatter/README.md +65 -0
- package/backend-project/node_modules/ecdsa-sig-formatter/package.json +46 -0
- package/backend-project/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.d.ts +17 -0
- package/backend-project/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js +187 -0
- package/backend-project/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js +23 -0
- package/backend-project/node_modules/ee-first/LICENSE +22 -0
- package/backend-project/node_modules/ee-first/README.md +80 -0
- package/backend-project/node_modules/ee-first/index.js +95 -0
- package/backend-project/node_modules/ee-first/package.json +29 -0
- package/backend-project/node_modules/encodeurl/LICENSE +22 -0
- package/backend-project/node_modules/encodeurl/README.md +109 -0
- package/backend-project/node_modules/encodeurl/index.js +60 -0
- package/backend-project/node_modules/encodeurl/package.json +40 -0
- package/backend-project/node_modules/es-define-property/.eslintrc +13 -0
- package/backend-project/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/es-define-property/.nycrc +9 -0
- package/backend-project/node_modules/es-define-property/CHANGELOG.md +29 -0
- package/backend-project/node_modules/es-define-property/LICENSE +21 -0
- package/backend-project/node_modules/es-define-property/README.md +49 -0
- package/backend-project/node_modules/es-define-property/index.d.ts +3 -0
- package/backend-project/node_modules/es-define-property/index.js +14 -0
- package/backend-project/node_modules/es-define-property/package.json +81 -0
- package/backend-project/node_modules/es-define-property/test/index.js +56 -0
- package/backend-project/node_modules/es-define-property/tsconfig.json +10 -0
- package/backend-project/node_modules/es-errors/.eslintrc +5 -0
- package/backend-project/node_modules/es-errors/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/es-errors/CHANGELOG.md +40 -0
- package/backend-project/node_modules/es-errors/LICENSE +21 -0
- package/backend-project/node_modules/es-errors/README.md +55 -0
- package/backend-project/node_modules/es-errors/eval.d.ts +3 -0
- package/backend-project/node_modules/es-errors/eval.js +4 -0
- package/backend-project/node_modules/es-errors/index.d.ts +3 -0
- package/backend-project/node_modules/es-errors/index.js +4 -0
- package/backend-project/node_modules/es-errors/package.json +80 -0
- package/backend-project/node_modules/es-errors/range.d.ts +3 -0
- package/backend-project/node_modules/es-errors/range.js +4 -0
- package/backend-project/node_modules/es-errors/ref.d.ts +3 -0
- package/backend-project/node_modules/es-errors/ref.js +4 -0
- package/backend-project/node_modules/es-errors/syntax.d.ts +3 -0
- package/backend-project/node_modules/es-errors/syntax.js +4 -0
- package/backend-project/node_modules/es-errors/test/index.js +19 -0
- package/backend-project/node_modules/es-errors/tsconfig.json +49 -0
- package/backend-project/node_modules/es-errors/type.d.ts +3 -0
- package/backend-project/node_modules/es-errors/type.js +4 -0
- package/backend-project/node_modules/es-errors/uri.d.ts +3 -0
- package/backend-project/node_modules/es-errors/uri.js +4 -0
- package/backend-project/node_modules/es-object-atoms/.eslintrc +16 -0
- package/backend-project/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/es-object-atoms/CHANGELOG.md +44 -0
- package/backend-project/node_modules/es-object-atoms/LICENSE +21 -0
- package/backend-project/node_modules/es-object-atoms/README.md +63 -0
- package/backend-project/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- package/backend-project/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/backend-project/node_modules/es-object-atoms/ToObject.d.ts +7 -0
- package/backend-project/node_modules/es-object-atoms/ToObject.js +10 -0
- package/backend-project/node_modules/es-object-atoms/index.d.ts +3 -0
- package/backend-project/node_modules/es-object-atoms/index.js +4 -0
- package/backend-project/node_modules/es-object-atoms/isObject.d.ts +3 -0
- package/backend-project/node_modules/es-object-atoms/isObject.js +6 -0
- package/backend-project/node_modules/es-object-atoms/package.json +79 -0
- package/backend-project/node_modules/es-object-atoms/test/index.js +38 -0
- package/backend-project/node_modules/es-object-atoms/tsconfig.json +7 -0
- package/backend-project/node_modules/escape-html/LICENSE +24 -0
- package/backend-project/node_modules/escape-html/Readme.md +43 -0
- package/backend-project/node_modules/escape-html/index.js +78 -0
- package/backend-project/node_modules/escape-html/package.json +24 -0
- package/backend-project/node_modules/etag/HISTORY.md +83 -0
- package/backend-project/node_modules/etag/LICENSE +22 -0
- package/backend-project/node_modules/etag/README.md +159 -0
- package/backend-project/node_modules/etag/index.js +131 -0
- package/backend-project/node_modules/etag/package.json +47 -0
- package/backend-project/node_modules/express/History.md +3676 -0
- package/backend-project/node_modules/express/LICENSE +24 -0
- package/backend-project/node_modules/express/Readme.md +260 -0
- package/backend-project/node_modules/express/index.js +11 -0
- package/backend-project/node_modules/express/lib/application.js +661 -0
- package/backend-project/node_modules/express/lib/express.js +116 -0
- package/backend-project/node_modules/express/lib/middleware/init.js +43 -0
- package/backend-project/node_modules/express/lib/middleware/query.js +47 -0
- package/backend-project/node_modules/express/lib/request.js +525 -0
- package/backend-project/node_modules/express/lib/response.js +1179 -0
- package/backend-project/node_modules/express/lib/router/index.js +673 -0
- package/backend-project/node_modules/express/lib/router/layer.js +181 -0
- package/backend-project/node_modules/express/lib/router/route.js +230 -0
- package/backend-project/node_modules/express/lib/utils.js +304 -0
- package/backend-project/node_modules/express/lib/view.js +182 -0
- package/backend-project/node_modules/express/package.json +102 -0
- package/backend-project/node_modules/fill-range/LICENSE +21 -0
- package/backend-project/node_modules/fill-range/README.md +237 -0
- package/backend-project/node_modules/fill-range/index.js +248 -0
- package/backend-project/node_modules/fill-range/package.json +74 -0
- package/backend-project/node_modules/finalhandler/HISTORY.md +216 -0
- package/backend-project/node_modules/finalhandler/LICENSE +22 -0
- package/backend-project/node_modules/finalhandler/README.md +147 -0
- package/backend-project/node_modules/finalhandler/SECURITY.md +25 -0
- package/backend-project/node_modules/finalhandler/index.js +341 -0
- package/backend-project/node_modules/finalhandler/package.json +47 -0
- package/backend-project/node_modules/forwarded/HISTORY.md +21 -0
- package/backend-project/node_modules/forwarded/LICENSE +22 -0
- package/backend-project/node_modules/forwarded/README.md +57 -0
- package/backend-project/node_modules/forwarded/index.js +90 -0
- package/backend-project/node_modules/forwarded/package.json +45 -0
- package/backend-project/node_modules/fresh/HISTORY.md +70 -0
- package/backend-project/node_modules/fresh/LICENSE +23 -0
- package/backend-project/node_modules/fresh/README.md +119 -0
- package/backend-project/node_modules/fresh/index.js +137 -0
- package/backend-project/node_modules/fresh/package.json +46 -0
- package/backend-project/node_modules/function-bind/.eslintrc +21 -0
- package/backend-project/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/backend-project/node_modules/function-bind/.nycrc +13 -0
- package/backend-project/node_modules/function-bind/CHANGELOG.md +136 -0
- package/backend-project/node_modules/function-bind/LICENSE +20 -0
- package/backend-project/node_modules/function-bind/README.md +46 -0
- package/backend-project/node_modules/function-bind/implementation.js +84 -0
- package/backend-project/node_modules/function-bind/index.js +5 -0
- package/backend-project/node_modules/function-bind/package.json +87 -0
- package/backend-project/node_modules/function-bind/test/.eslintrc +9 -0
- package/backend-project/node_modules/function-bind/test/index.js +252 -0
- package/backend-project/node_modules/get-intrinsic/.eslintrc +42 -0
- package/backend-project/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/get-intrinsic/.nycrc +9 -0
- package/backend-project/node_modules/get-intrinsic/CHANGELOG.md +186 -0
- package/backend-project/node_modules/get-intrinsic/LICENSE +21 -0
- package/backend-project/node_modules/get-intrinsic/README.md +71 -0
- package/backend-project/node_modules/get-intrinsic/index.js +378 -0
- package/backend-project/node_modules/get-intrinsic/package.json +97 -0
- package/backend-project/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
- package/backend-project/node_modules/get-proto/.eslintrc +10 -0
- package/backend-project/node_modules/get-proto/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/get-proto/.nycrc +9 -0
- package/backend-project/node_modules/get-proto/CHANGELOG.md +21 -0
- package/backend-project/node_modules/get-proto/LICENSE +21 -0
- package/backend-project/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
- package/backend-project/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/backend-project/node_modules/get-proto/README.md +50 -0
- package/backend-project/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
- package/backend-project/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/backend-project/node_modules/get-proto/index.d.ts +5 -0
- package/backend-project/node_modules/get-proto/index.js +27 -0
- package/backend-project/node_modules/get-proto/package.json +81 -0
- package/backend-project/node_modules/get-proto/test/index.js +68 -0
- package/backend-project/node_modules/get-proto/tsconfig.json +9 -0
- package/backend-project/node_modules/glob-parent/CHANGELOG.md +110 -0
- package/backend-project/node_modules/glob-parent/LICENSE +15 -0
- package/backend-project/node_modules/glob-parent/README.md +137 -0
- package/backend-project/node_modules/glob-parent/index.js +42 -0
- package/backend-project/node_modules/glob-parent/package.json +48 -0
- package/backend-project/node_modules/gopd/.eslintrc +16 -0
- package/backend-project/node_modules/gopd/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/gopd/CHANGELOG.md +45 -0
- package/backend-project/node_modules/gopd/LICENSE +21 -0
- package/backend-project/node_modules/gopd/README.md +40 -0
- package/backend-project/node_modules/gopd/gOPD.d.ts +1 -0
- package/backend-project/node_modules/gopd/gOPD.js +4 -0
- package/backend-project/node_modules/gopd/index.d.ts +5 -0
- package/backend-project/node_modules/gopd/index.js +15 -0
- package/backend-project/node_modules/gopd/package.json +77 -0
- package/backend-project/node_modules/gopd/test/index.js +36 -0
- package/backend-project/node_modules/gopd/tsconfig.json +9 -0
- package/backend-project/node_modules/has-flag/index.js +8 -0
- package/backend-project/node_modules/has-flag/license +9 -0
- package/backend-project/node_modules/has-flag/package.json +44 -0
- package/backend-project/node_modules/has-flag/readme.md +70 -0
- package/backend-project/node_modules/has-symbols/.eslintrc +11 -0
- package/backend-project/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/has-symbols/.nycrc +9 -0
- package/backend-project/node_modules/has-symbols/CHANGELOG.md +91 -0
- package/backend-project/node_modules/has-symbols/LICENSE +21 -0
- package/backend-project/node_modules/has-symbols/README.md +46 -0
- package/backend-project/node_modules/has-symbols/index.d.ts +3 -0
- package/backend-project/node_modules/has-symbols/index.js +14 -0
- package/backend-project/node_modules/has-symbols/package.json +111 -0
- package/backend-project/node_modules/has-symbols/shams.d.ts +3 -0
- package/backend-project/node_modules/has-symbols/shams.js +45 -0
- package/backend-project/node_modules/has-symbols/test/index.js +22 -0
- package/backend-project/node_modules/has-symbols/test/shams/core-js.js +29 -0
- package/backend-project/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
- package/backend-project/node_modules/has-symbols/test/tests.js +58 -0
- package/backend-project/node_modules/has-symbols/tsconfig.json +10 -0
- package/backend-project/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/hasown/.nycrc +13 -0
- package/backend-project/node_modules/hasown/CHANGELOG.md +58 -0
- package/backend-project/node_modules/hasown/LICENSE +21 -0
- package/backend-project/node_modules/hasown/README.md +40 -0
- package/backend-project/node_modules/hasown/eslint.config.mjs +6 -0
- package/backend-project/node_modules/hasown/index.d.ts +3 -0
- package/backend-project/node_modules/hasown/index.js +8 -0
- package/backend-project/node_modules/hasown/package.json +91 -0
- package/backend-project/node_modules/hasown/tsconfig.json +6 -0
- package/backend-project/node_modules/http-errors/HISTORY.md +186 -0
- package/backend-project/node_modules/http-errors/LICENSE +23 -0
- package/backend-project/node_modules/http-errors/README.md +169 -0
- package/backend-project/node_modules/http-errors/index.js +290 -0
- package/backend-project/node_modules/http-errors/package.json +54 -0
- package/backend-project/node_modules/iconv-lite/Changelog.md +162 -0
- package/backend-project/node_modules/iconv-lite/LICENSE +21 -0
- package/backend-project/node_modules/iconv-lite/README.md +156 -0
- package/backend-project/node_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
- package/backend-project/node_modules/iconv-lite/encodings/dbcs-data.js +176 -0
- package/backend-project/node_modules/iconv-lite/encodings/index.js +22 -0
- package/backend-project/node_modules/iconv-lite/encodings/internal.js +188 -0
- package/backend-project/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- package/backend-project/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/backend-project/node_modules/iconv-lite/encodings/sbcs-data.js +174 -0
- package/backend-project/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/backend-project/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/backend-project/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/backend-project/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/backend-project/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/backend-project/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/backend-project/node_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
- package/backend-project/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/backend-project/node_modules/iconv-lite/encodings/utf16.js +177 -0
- package/backend-project/node_modules/iconv-lite/encodings/utf7.js +290 -0
- package/backend-project/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- package/backend-project/node_modules/iconv-lite/lib/extend-node.js +217 -0
- package/backend-project/node_modules/iconv-lite/lib/index.d.ts +24 -0
- package/backend-project/node_modules/iconv-lite/lib/index.js +153 -0
- package/backend-project/node_modules/iconv-lite/lib/streams.js +121 -0
- package/backend-project/node_modules/iconv-lite/package.json +46 -0
- package/backend-project/node_modules/ignore-by-default/LICENSE +14 -0
- package/backend-project/node_modules/ignore-by-default/README.md +26 -0
- package/backend-project/node_modules/ignore-by-default/index.js +12 -0
- package/backend-project/node_modules/ignore-by-default/package.json +34 -0
- package/backend-project/node_modules/inherits/LICENSE +16 -0
- package/backend-project/node_modules/inherits/README.md +42 -0
- package/backend-project/node_modules/inherits/inherits.js +9 -0
- package/backend-project/node_modules/inherits/inherits_browser.js +27 -0
- package/backend-project/node_modules/inherits/package.json +29 -0
- package/backend-project/node_modules/ip-address/LICENSE +19 -0
- package/backend-project/node_modules/ip-address/README.md +278 -0
- package/backend-project/node_modules/ip-address/dist/address-error.d.ts +4 -0
- package/backend-project/node_modules/ip-address/dist/address-error.js +12 -0
- package/backend-project/node_modules/ip-address/dist/address-error.js.map +1 -0
- package/backend-project/node_modules/ip-address/dist/common.d.ts +20 -0
- package/backend-project/node_modules/ip-address/dist/common.js +67 -0
- package/backend-project/node_modules/ip-address/dist/common.js.map +1 -0
- package/backend-project/node_modules/ip-address/dist/ip-address.d.ts +7 -0
- package/backend-project/node_modules/ip-address/dist/ip-address.js +35 -0
- package/backend-project/node_modules/ip-address/dist/ip-address.js.map +1 -0
- package/backend-project/node_modules/ip-address/dist/ipv4.d.ts +267 -0
- package/backend-project/node_modules/ip-address/dist/ipv4.js +485 -0
- package/backend-project/node_modules/ip-address/dist/ipv4.js.map +1 -0
- package/backend-project/node_modules/ip-address/dist/ipv6.d.ts +489 -0
- package/backend-project/node_modules/ip-address/dist/ipv6.js +1217 -0
- package/backend-project/node_modules/ip-address/dist/ipv6.js.map +1 -0
- package/backend-project/node_modules/ip-address/dist/v4/constants.d.ts +4 -0
- package/backend-project/node_modules/ip-address/dist/v4/constants.js +8 -0
- package/backend-project/node_modules/ip-address/dist/v4/constants.js.map +1 -0
- package/backend-project/node_modules/ip-address/dist/v6/constants.d.ts +44 -0
- package/backend-project/node_modules/ip-address/dist/v6/constants.js +81 -0
- package/backend-project/node_modules/ip-address/dist/v6/constants.js.map +1 -0
- package/backend-project/node_modules/ip-address/dist/v6/helpers.d.ts +18 -0
- package/backend-project/node_modules/ip-address/dist/v6/helpers.js +54 -0
- package/backend-project/node_modules/ip-address/dist/v6/helpers.js.map +1 -0
- package/backend-project/node_modules/ip-address/dist/v6/regular-expressions.d.ts +5 -0
- package/backend-project/node_modules/ip-address/dist/v6/regular-expressions.js +95 -0
- package/backend-project/node_modules/ip-address/dist/v6/regular-expressions.js.map +1 -0
- package/backend-project/node_modules/ip-address/package.json +88 -0
- package/backend-project/node_modules/ipaddr.js/LICENSE +19 -0
- package/backend-project/node_modules/ipaddr.js/README.md +233 -0
- package/backend-project/node_modules/ipaddr.js/ipaddr.min.js +1 -0
- package/backend-project/node_modules/ipaddr.js/lib/ipaddr.js +673 -0
- package/backend-project/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +68 -0
- package/backend-project/node_modules/ipaddr.js/package.json +35 -0
- package/backend-project/node_modules/is-binary-path/index.d.ts +17 -0
- package/backend-project/node_modules/is-binary-path/index.js +7 -0
- package/backend-project/node_modules/is-binary-path/license +9 -0
- package/backend-project/node_modules/is-binary-path/package.json +40 -0
- package/backend-project/node_modules/is-binary-path/readme.md +34 -0
- package/backend-project/node_modules/is-extglob/LICENSE +21 -0
- package/backend-project/node_modules/is-extglob/README.md +107 -0
- package/backend-project/node_modules/is-extglob/index.js +20 -0
- package/backend-project/node_modules/is-extglob/package.json +69 -0
- package/backend-project/node_modules/is-glob/LICENSE +21 -0
- package/backend-project/node_modules/is-glob/README.md +206 -0
- package/backend-project/node_modules/is-glob/index.js +150 -0
- package/backend-project/node_modules/is-glob/package.json +81 -0
- package/backend-project/node_modules/is-number/LICENSE +21 -0
- package/backend-project/node_modules/is-number/README.md +187 -0
- package/backend-project/node_modules/is-number/index.js +18 -0
- package/backend-project/node_modules/is-number/package.json +82 -0
- package/backend-project/node_modules/jsonwebtoken/LICENSE +21 -0
- package/backend-project/node_modules/jsonwebtoken/README.md +396 -0
- package/backend-project/node_modules/jsonwebtoken/decode.js +30 -0
- package/backend-project/node_modules/jsonwebtoken/index.js +8 -0
- package/backend-project/node_modules/jsonwebtoken/lib/JsonWebTokenError.js +14 -0
- package/backend-project/node_modules/jsonwebtoken/lib/NotBeforeError.js +13 -0
- package/backend-project/node_modules/jsonwebtoken/lib/TokenExpiredError.js +13 -0
- package/backend-project/node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js +3 -0
- package/backend-project/node_modules/jsonwebtoken/lib/psSupported.js +3 -0
- package/backend-project/node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js +3 -0
- package/backend-project/node_modules/jsonwebtoken/lib/timespan.js +18 -0
- package/backend-project/node_modules/jsonwebtoken/lib/validateAsymmetricKey.js +66 -0
- package/backend-project/node_modules/jsonwebtoken/node_modules/ms/index.js +162 -0
- package/backend-project/node_modules/jsonwebtoken/node_modules/ms/license.md +21 -0
- package/backend-project/node_modules/jsonwebtoken/node_modules/ms/package.json +38 -0
- package/backend-project/node_modules/jsonwebtoken/node_modules/ms/readme.md +59 -0
- package/backend-project/node_modules/jsonwebtoken/package.json +70 -0
- package/backend-project/node_modules/jsonwebtoken/sign.js +253 -0
- package/backend-project/node_modules/jsonwebtoken/verify.js +263 -0
- package/backend-project/node_modules/jwa/LICENSE +17 -0
- package/backend-project/node_modules/jwa/README.md +150 -0
- package/backend-project/node_modules/jwa/index.js +266 -0
- package/backend-project/node_modules/jwa/opslevel.yml +6 -0
- package/backend-project/node_modules/jwa/package.json +37 -0
- package/backend-project/node_modules/jws/CHANGELOG.md +56 -0
- package/backend-project/node_modules/jws/LICENSE +17 -0
- package/backend-project/node_modules/jws/index.js +22 -0
- package/backend-project/node_modules/jws/lib/data-stream.js +55 -0
- package/backend-project/node_modules/jws/lib/sign-stream.js +83 -0
- package/backend-project/node_modules/jws/lib/tostring.js +10 -0
- package/backend-project/node_modules/jws/lib/verify-stream.js +125 -0
- package/backend-project/node_modules/jws/opslevel.yml +6 -0
- package/backend-project/node_modules/jws/package.json +34 -0
- package/backend-project/node_modules/jws/readme.md +255 -0
- package/backend-project/node_modules/kareem/LICENSE +202 -0
- package/backend-project/node_modules/kareem/README.md +420 -0
- package/backend-project/node_modules/kareem/index.js +668 -0
- package/backend-project/node_modules/kareem/package.json +31 -0
- package/backend-project/node_modules/lodash.includes/LICENSE +47 -0
- package/backend-project/node_modules/lodash.includes/README.md +18 -0
- package/backend-project/node_modules/lodash.includes/index.js +745 -0
- package/backend-project/node_modules/lodash.includes/package.json +17 -0
- package/backend-project/node_modules/lodash.isboolean/LICENSE +22 -0
- package/backend-project/node_modules/lodash.isboolean/README.md +18 -0
- package/backend-project/node_modules/lodash.isboolean/index.js +70 -0
- package/backend-project/node_modules/lodash.isboolean/package.json +17 -0
- package/backend-project/node_modules/lodash.isinteger/LICENSE +47 -0
- package/backend-project/node_modules/lodash.isinteger/README.md +18 -0
- package/backend-project/node_modules/lodash.isinteger/index.js +265 -0
- package/backend-project/node_modules/lodash.isinteger/package.json +17 -0
- package/backend-project/node_modules/lodash.isnumber/LICENSE +22 -0
- package/backend-project/node_modules/lodash.isnumber/README.md +18 -0
- package/backend-project/node_modules/lodash.isnumber/index.js +79 -0
- package/backend-project/node_modules/lodash.isnumber/package.json +17 -0
- package/backend-project/node_modules/lodash.isplainobject/LICENSE +47 -0
- package/backend-project/node_modules/lodash.isplainobject/README.md +18 -0
- package/backend-project/node_modules/lodash.isplainobject/index.js +139 -0
- package/backend-project/node_modules/lodash.isplainobject/package.json +17 -0
- package/backend-project/node_modules/lodash.isstring/LICENSE +22 -0
- package/backend-project/node_modules/lodash.isstring/README.md +18 -0
- package/backend-project/node_modules/lodash.isstring/index.js +95 -0
- package/backend-project/node_modules/lodash.isstring/package.json +17 -0
- package/backend-project/node_modules/lodash.once/LICENSE +47 -0
- package/backend-project/node_modules/lodash.once/README.md +18 -0
- package/backend-project/node_modules/lodash.once/index.js +294 -0
- package/backend-project/node_modules/lodash.once/package.json +17 -0
- package/backend-project/node_modules/math-intrinsics/.eslintrc +16 -0
- package/backend-project/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/math-intrinsics/CHANGELOG.md +24 -0
- package/backend-project/node_modules/math-intrinsics/LICENSE +21 -0
- package/backend-project/node_modules/math-intrinsics/README.md +50 -0
- package/backend-project/node_modules/math-intrinsics/abs.d.ts +1 -0
- package/backend-project/node_modules/math-intrinsics/abs.js +4 -0
- package/backend-project/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
- package/backend-project/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- package/backend-project/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
- package/backend-project/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- package/backend-project/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
- package/backend-project/node_modules/math-intrinsics/constants/maxValue.js +5 -0
- package/backend-project/node_modules/math-intrinsics/floor.d.ts +1 -0
- package/backend-project/node_modules/math-intrinsics/floor.js +4 -0
- package/backend-project/node_modules/math-intrinsics/isFinite.d.ts +3 -0
- package/backend-project/node_modules/math-intrinsics/isFinite.js +12 -0
- package/backend-project/node_modules/math-intrinsics/isInteger.d.ts +3 -0
- package/backend-project/node_modules/math-intrinsics/isInteger.js +16 -0
- package/backend-project/node_modules/math-intrinsics/isNaN.d.ts +1 -0
- package/backend-project/node_modules/math-intrinsics/isNaN.js +6 -0
- package/backend-project/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
- package/backend-project/node_modules/math-intrinsics/isNegativeZero.js +6 -0
- package/backend-project/node_modules/math-intrinsics/max.d.ts +1 -0
- package/backend-project/node_modules/math-intrinsics/max.js +4 -0
- package/backend-project/node_modules/math-intrinsics/min.d.ts +1 -0
- package/backend-project/node_modules/math-intrinsics/min.js +4 -0
- package/backend-project/node_modules/math-intrinsics/mod.d.ts +3 -0
- package/backend-project/node_modules/math-intrinsics/mod.js +9 -0
- package/backend-project/node_modules/math-intrinsics/package.json +86 -0
- package/backend-project/node_modules/math-intrinsics/pow.d.ts +1 -0
- package/backend-project/node_modules/math-intrinsics/pow.js +4 -0
- package/backend-project/node_modules/math-intrinsics/round.d.ts +1 -0
- package/backend-project/node_modules/math-intrinsics/round.js +4 -0
- package/backend-project/node_modules/math-intrinsics/sign.d.ts +3 -0
- package/backend-project/node_modules/math-intrinsics/sign.js +11 -0
- package/backend-project/node_modules/math-intrinsics/test/index.js +192 -0
- package/backend-project/node_modules/math-intrinsics/tsconfig.json +3 -0
- package/backend-project/node_modules/media-typer/HISTORY.md +22 -0
- package/backend-project/node_modules/media-typer/LICENSE +22 -0
- package/backend-project/node_modules/media-typer/README.md +81 -0
- package/backend-project/node_modules/media-typer/index.js +270 -0
- package/backend-project/node_modules/media-typer/package.json +26 -0
- package/backend-project/node_modules/memory-pager/.travis.yml +4 -0
- package/backend-project/node_modules/memory-pager/LICENSE +21 -0
- package/backend-project/node_modules/memory-pager/README.md +65 -0
- package/backend-project/node_modules/memory-pager/index.js +160 -0
- package/backend-project/node_modules/memory-pager/package.json +24 -0
- package/backend-project/node_modules/memory-pager/test.js +80 -0
- package/backend-project/node_modules/merge-descriptors/HISTORY.md +21 -0
- package/backend-project/node_modules/merge-descriptors/LICENSE +23 -0
- package/backend-project/node_modules/merge-descriptors/README.md +49 -0
- package/backend-project/node_modules/merge-descriptors/index.js +60 -0
- package/backend-project/node_modules/merge-descriptors/package.json +39 -0
- package/backend-project/node_modules/methods/HISTORY.md +29 -0
- package/backend-project/node_modules/methods/LICENSE +24 -0
- package/backend-project/node_modules/methods/README.md +51 -0
- package/backend-project/node_modules/methods/index.js +69 -0
- package/backend-project/node_modules/methods/package.json +36 -0
- package/backend-project/node_modules/mime/CHANGELOG.md +164 -0
- package/backend-project/node_modules/mime/LICENSE +21 -0
- package/backend-project/node_modules/mime/README.md +90 -0
- package/backend-project/node_modules/mime/cli.js +8 -0
- package/backend-project/node_modules/mime/mime.js +108 -0
- package/backend-project/node_modules/mime/package.json +44 -0
- package/backend-project/node_modules/mime/src/build.js +53 -0
- package/backend-project/node_modules/mime/src/test.js +60 -0
- package/backend-project/node_modules/mime/types.json +1 -0
- package/backend-project/node_modules/mime-db/HISTORY.md +507 -0
- package/backend-project/node_modules/mime-db/LICENSE +23 -0
- package/backend-project/node_modules/mime-db/README.md +100 -0
- package/backend-project/node_modules/mime-db/db.json +8519 -0
- package/backend-project/node_modules/mime-db/index.js +12 -0
- package/backend-project/node_modules/mime-db/package.json +60 -0
- package/backend-project/node_modules/mime-types/HISTORY.md +397 -0
- package/backend-project/node_modules/mime-types/LICENSE +23 -0
- package/backend-project/node_modules/mime-types/README.md +113 -0
- package/backend-project/node_modules/mime-types/index.js +188 -0
- package/backend-project/node_modules/mime-types/package.json +44 -0
- package/backend-project/node_modules/minimatch/LICENSE.md +55 -0
- package/backend-project/node_modules/minimatch/README.md +528 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +1 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/ast.d.ts +22 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/ast.d.ts.map +1 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/ast.js +845 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/ast.js.map +1 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +8 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +1 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/brace-expressions.js +150 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +1 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/escape.d.ts +15 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/escape.d.ts.map +1 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/escape.js +30 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/escape.js.map +1 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/index.d.ts +174 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/index.js +1127 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/index.js.map +1 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/package.json +3 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/unescape.d.ts +22 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +1 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
- package/backend-project/node_modules/minimatch/dist/commonjs/unescape.js.map +1 -0
- package/backend-project/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
- package/backend-project/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +1 -0
- package/backend-project/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
- package/backend-project/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
- package/backend-project/node_modules/minimatch/dist/esm/ast.d.ts +22 -0
- package/backend-project/node_modules/minimatch/dist/esm/ast.d.ts.map +1 -0
- package/backend-project/node_modules/minimatch/dist/esm/ast.js +841 -0
- package/backend-project/node_modules/minimatch/dist/esm/ast.js.map +1 -0
- package/backend-project/node_modules/minimatch/dist/esm/brace-expressions.d.ts +8 -0
- package/backend-project/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +1 -0
- package/backend-project/node_modules/minimatch/dist/esm/brace-expressions.js +146 -0
- package/backend-project/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -0
- package/backend-project/node_modules/minimatch/dist/esm/escape.d.ts +15 -0
- package/backend-project/node_modules/minimatch/dist/esm/escape.d.ts.map +1 -0
- package/backend-project/node_modules/minimatch/dist/esm/escape.js +26 -0
- package/backend-project/node_modules/minimatch/dist/esm/escape.js.map +1 -0
- package/backend-project/node_modules/minimatch/dist/esm/index.d.ts +174 -0
- package/backend-project/node_modules/minimatch/dist/esm/index.d.ts.map +1 -0
- package/backend-project/node_modules/minimatch/dist/esm/index.js +1114 -0
- package/backend-project/node_modules/minimatch/dist/esm/index.js.map +1 -0
- package/backend-project/node_modules/minimatch/dist/esm/package.json +3 -0
- package/backend-project/node_modules/minimatch/dist/esm/unescape.d.ts +22 -0
- package/backend-project/node_modules/minimatch/dist/esm/unescape.d.ts.map +1 -0
- package/backend-project/node_modules/minimatch/dist/esm/unescape.js +34 -0
- package/backend-project/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
- package/backend-project/node_modules/minimatch/package.json +73 -0
- package/backend-project/node_modules/mongodb/LICENSE.md +201 -0
- package/backend-project/node_modules/mongodb/README.md +310 -0
- package/backend-project/node_modules/mongodb/etc/prepare.js +12 -0
- package/backend-project/node_modules/mongodb/lib/admin.js +149 -0
- package/backend-project/node_modules/mongodb/lib/admin.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/bson.js +61 -0
- package/backend-project/node_modules/mongodb/lib/bson.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/bulk/common.js +907 -0
- package/backend-project/node_modules/mongodb/lib/bulk/common.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/bulk/ordered.js +67 -0
- package/backend-project/node_modules/mongodb/lib/bulk/ordered.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/bulk/unordered.js +92 -0
- package/backend-project/node_modules/mongodb/lib/bulk/unordered.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/change_stream.js +397 -0
- package/backend-project/node_modules/mongodb/lib/change_stream.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/auth_provider.js +47 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/auth_provider.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/gssapi.js +153 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/gssapi.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js +177 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongocr.js +35 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongocr.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js +227 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/aws_service_workflow.js +30 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/aws_service_workflow.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_service_workflow.js +73 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_service_workflow.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_token_cache.js +49 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_token_cache.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/cache.js +55 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/cache.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_lock_cache.js +89 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_lock_cache.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.js +204 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/service_workflow.js +43 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/service_workflow.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_entry_cache.js +62 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_entry_cache.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js +68 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/plain.js +26 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/plain.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/providers.js +24 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/providers.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/scram.js +262 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/scram.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/x509.js +36 -0
- package/backend-project/node_modules/mongodb/lib/cmap/auth/x509.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/command_monitoring_events.js +251 -0
- package/backend-project/node_modules/mongodb/lib/cmap/command_monitoring_events.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/commands.js +487 -0
- package/backend-project/node_modules/mongodb/lib/cmap/commands.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/connect.js +378 -0
- package/backend-project/node_modules/mongodb/lib/cmap/connect.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/connection.js +492 -0
- package/backend-project/node_modules/mongodb/lib/cmap/connection.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/connection_pool.js +637 -0
- package/backend-project/node_modules/mongodb/lib/cmap/connection_pool.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/connection_pool_events.js +191 -0
- package/backend-project/node_modules/mongodb/lib/cmap/connection_pool_events.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/errors.js +64 -0
- package/backend-project/node_modules/mongodb/lib/cmap/errors.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/handshake/client_metadata.js +173 -0
- package/backend-project/node_modules/mongodb/lib/cmap/handshake/client_metadata.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/message_stream.js +156 -0
- package/backend-project/node_modules/mongodb/lib/cmap/message_stream.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/metrics.js +62 -0
- package/backend-project/node_modules/mongodb/lib/cmap/metrics.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/stream_description.js +51 -0
- package/backend-project/node_modules/mongodb/lib/cmap/stream_description.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/wire_protocol/compression.js +107 -0
- package/backend-project/node_modules/mongodb/lib/cmap/wire_protocol/compression.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/wire_protocol/constants.js +17 -0
- package/backend-project/node_modules/mongodb/lib/cmap/wire_protocol/constants.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cmap/wire_protocol/shared.js +40 -0
- package/backend-project/node_modules/mongodb/lib/cmap/wire_protocol/shared.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/collection.js +629 -0
- package/backend-project/node_modules/mongodb/lib/collection.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/connection_string.js +1103 -0
- package/backend-project/node_modules/mongodb/lib/connection_string.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/constants.js +142 -0
- package/backend-project/node_modules/mongodb/lib/constants.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cursor/abstract_cursor.js +698 -0
- package/backend-project/node_modules/mongodb/lib/cursor/abstract_cursor.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cursor/aggregation_cursor.js +168 -0
- package/backend-project/node_modules/mongodb/lib/cursor/aggregation_cursor.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cursor/change_stream_cursor.js +115 -0
- package/backend-project/node_modules/mongodb/lib/cursor/change_stream_cursor.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cursor/find_cursor.js +382 -0
- package/backend-project/node_modules/mongodb/lib/cursor/find_cursor.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cursor/list_collections_cursor.js +37 -0
- package/backend-project/node_modules/mongodb/lib/cursor/list_collections_cursor.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cursor/list_indexes_cursor.js +36 -0
- package/backend-project/node_modules/mongodb/lib/cursor/list_indexes_cursor.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.js +14 -0
- package/backend-project/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/cursor/run_command_cursor.js +94 -0
- package/backend-project/node_modules/mongodb/lib/cursor/run_command_cursor.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/db.js +379 -0
- package/backend-project/node_modules/mongodb/lib/db.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/deps.js +87 -0
- package/backend-project/node_modules/mongodb/lib/deps.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/encrypter.js +103 -0
- package/backend-project/node_modules/mongodb/lib/encrypter.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/error.js +832 -0
- package/backend-project/node_modules/mongodb/lib/error.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/explain.js +35 -0
- package/backend-project/node_modules/mongodb/lib/explain.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/gridfs/download.js +313 -0
- package/backend-project/node_modules/mongodb/lib/gridfs/download.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/gridfs/index.js +128 -0
- package/backend-project/node_modules/mongodb/lib/gridfs/index.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/gridfs/upload.js +330 -0
- package/backend-project/node_modules/mongodb/lib/gridfs/upload.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/index.js +162 -0
- package/backend-project/node_modules/mongodb/lib/index.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/mongo_client.js +329 -0
- package/backend-project/node_modules/mongodb/lib/mongo_client.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/mongo_logger.js +360 -0
- package/backend-project/node_modules/mongodb/lib/mongo_logger.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/mongo_types.js +22 -0
- package/backend-project/node_modules/mongodb/lib/mongo_types.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/add_user.js +74 -0
- package/backend-project/node_modules/mongodb/lib/operations/add_user.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/aggregate.js +92 -0
- package/backend-project/node_modules/mongodb/lib/operations/aggregate.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/bulk_write.js +36 -0
- package/backend-project/node_modules/mongodb/lib/operations/bulk_write.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/collections.js +32 -0
- package/backend-project/node_modules/mongodb/lib/operations/collections.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/command.js +88 -0
- package/backend-project/node_modules/mongodb/lib/operations/command.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/common_functions.js +69 -0
- package/backend-project/node_modules/mongodb/lib/operations/common_functions.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/count.js +39 -0
- package/backend-project/node_modules/mongodb/lib/operations/count.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/count_documents.js +37 -0
- package/backend-project/node_modules/mongodb/lib/operations/count_documents.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/create_collection.js +108 -0
- package/backend-project/node_modules/mongodb/lib/operations/create_collection.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/delete.js +119 -0
- package/backend-project/node_modules/mongodb/lib/operations/delete.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/distinct.js +67 -0
- package/backend-project/node_modules/mongodb/lib/operations/distinct.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/drop.js +82 -0
- package/backend-project/node_modules/mongodb/lib/operations/drop.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/estimated_document_count.js +38 -0
- package/backend-project/node_modules/mongodb/lib/operations/estimated_document_count.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/eval.js +55 -0
- package/backend-project/node_modules/mongodb/lib/operations/eval.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/execute_operation.js +162 -0
- package/backend-project/node_modules/mongodb/lib/operations/execute_operation.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/find.js +149 -0
- package/backend-project/node_modules/mongodb/lib/operations/find.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/find_and_modify.js +152 -0
- package/backend-project/node_modules/mongodb/lib/operations/find_and_modify.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/get_more.js +58 -0
- package/backend-project/node_modules/mongodb/lib/operations/get_more.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/indexes.js +270 -0
- package/backend-project/node_modules/mongodb/lib/operations/indexes.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/insert.js +95 -0
- package/backend-project/node_modules/mongodb/lib/operations/insert.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/is_capped.js +28 -0
- package/backend-project/node_modules/mongodb/lib/operations/is_capped.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/kill_cursors.js +32 -0
- package/backend-project/node_modules/mongodb/lib/operations/kill_cursors.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/list_collections.js +47 -0
- package/backend-project/node_modules/mongodb/lib/operations/list_collections.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/list_databases.js +35 -0
- package/backend-project/node_modules/mongodb/lib/operations/list_databases.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/operation.js +82 -0
- package/backend-project/node_modules/mongodb/lib/operations/operation.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/options_operation.js +28 -0
- package/backend-project/node_modules/mongodb/lib/operations/options_operation.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/profiling_level.js +33 -0
- package/backend-project/node_modules/mongodb/lib/operations/profiling_level.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/remove_user.js +21 -0
- package/backend-project/node_modules/mongodb/lib/operations/remove_user.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/rename.js +46 -0
- package/backend-project/node_modules/mongodb/lib/operations/rename.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/run_command.js +26 -0
- package/backend-project/node_modules/mongodb/lib/operations/run_command.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/search_indexes/create.js +29 -0
- package/backend-project/node_modules/mongodb/lib/operations/search_indexes/create.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/search_indexes/drop.js +30 -0
- package/backend-project/node_modules/mongodb/lib/operations/search_indexes/drop.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/search_indexes/update.js +30 -0
- package/backend-project/node_modules/mongodb/lib/operations/search_indexes/update.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/set_profiling_level.js +51 -0
- package/backend-project/node_modules/mongodb/lib/operations/set_profiling_level.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/stats.js +48 -0
- package/backend-project/node_modules/mongodb/lib/operations/stats.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/update.js +183 -0
- package/backend-project/node_modules/mongodb/lib/operations/update.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/operations/validate_collection.js +41 -0
- package/backend-project/node_modules/mongodb/lib/operations/validate_collection.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/read_concern.js +73 -0
- package/backend-project/node_modules/mongodb/lib/read_concern.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/read_preference.js +195 -0
- package/backend-project/node_modules/mongodb/lib/read_preference.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/sdam/common.js +56 -0
- package/backend-project/node_modules/mongodb/lib/sdam/common.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/sdam/events.js +125 -0
- package/backend-project/node_modules/mongodb/lib/sdam/events.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/sdam/monitor.js +414 -0
- package/backend-project/node_modules/mongodb/lib/sdam/monitor.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/sdam/server.js +382 -0
- package/backend-project/node_modules/mongodb/lib/sdam/server.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/sdam/server_description.js +189 -0
- package/backend-project/node_modules/mongodb/lib/sdam/server_description.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/sdam/server_selection.js +226 -0
- package/backend-project/node_modules/mongodb/lib/sdam/server_selection.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/sdam/srv_polling.js +103 -0
- package/backend-project/node_modules/mongodb/lib/sdam/srv_polling.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/sdam/topology.js +621 -0
- package/backend-project/node_modules/mongodb/lib/sdam/topology.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/sdam/topology_description.js +360 -0
- package/backend-project/node_modules/mongodb/lib/sdam/topology_description.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/sessions.js +739 -0
- package/backend-project/node_modules/mongodb/lib/sessions.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/sort.js +97 -0
- package/backend-project/node_modules/mongodb/lib/sort.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/transactions.js +138 -0
- package/backend-project/node_modules/mongodb/lib/transactions.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/utils.js +1064 -0
- package/backend-project/node_modules/mongodb/lib/utils.js.map +1 -0
- package/backend-project/node_modules/mongodb/lib/write_concern.js +86 -0
- package/backend-project/node_modules/mongodb/lib/write_concern.js.map +1 -0
- package/backend-project/node_modules/mongodb/mongodb.d.ts +6750 -0
- package/backend-project/node_modules/mongodb/package.json +163 -0
- package/backend-project/node_modules/mongodb/src/admin.ts +192 -0
- package/backend-project/node_modules/mongodb/src/bson.ts +117 -0
- package/backend-project/node_modules/mongodb/src/bulk/common.ts +1338 -0
- package/backend-project/node_modules/mongodb/src/bulk/ordered.ts +83 -0
- package/backend-project/node_modules/mongodb/src/bulk/unordered.ts +116 -0
- package/backend-project/node_modules/mongodb/src/change_stream.ts +973 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/auth_provider.ts +73 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/gssapi.ts +204 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/mongo_credentials.ts +278 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/mongocr.ts +42 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_aws.ts +293 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc/aws_service_workflow.ts +29 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc/azure_service_workflow.ts +86 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc/azure_token_cache.ts +51 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc/cache.ts +63 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc/callback_lock_cache.ts +114 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc/callback_workflow.ts +296 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc/service_workflow.ts +49 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc/token_entry_cache.ts +77 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/mongodb_oidc.ts +149 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/plain.ts +25 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/providers.ts +24 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/scram.ts +354 -0
- package/backend-project/node_modules/mongodb/src/cmap/auth/x509.ts +47 -0
- package/backend-project/node_modules/mongodb/src/cmap/command_monitoring_events.ts +316 -0
- package/backend-project/node_modules/mongodb/src/cmap/commands.ts +712 -0
- package/backend-project/node_modules/mongodb/src/cmap/connect.ts +503 -0
- package/backend-project/node_modules/mongodb/src/cmap/connection.ts +758 -0
- package/backend-project/node_modules/mongodb/src/cmap/connection_pool.ts +920 -0
- package/backend-project/node_modules/mongodb/src/cmap/connection_pool_events.ts +268 -0
- package/backend-project/node_modules/mongodb/src/cmap/errors.ts +75 -0
- package/backend-project/node_modules/mongodb/src/cmap/handshake/client_metadata.ts +273 -0
- package/backend-project/node_modules/mongodb/src/cmap/message_stream.ts +234 -0
- package/backend-project/node_modules/mongodb/src/cmap/metrics.ts +58 -0
- package/backend-project/node_modules/mongodb/src/cmap/stream_description.ts +76 -0
- package/backend-project/node_modules/mongodb/src/cmap/wire_protocol/compression.ts +126 -0
- package/backend-project/node_modules/mongodb/src/cmap/wire_protocol/constants.ts +13 -0
- package/backend-project/node_modules/mongodb/src/cmap/wire_protocol/shared.ts +53 -0
- package/backend-project/node_modules/mongodb/src/collection.ts +1145 -0
- package/backend-project/node_modules/mongodb/src/connection_string.ts +1315 -0
- package/backend-project/node_modules/mongodb/src/constants.ts +147 -0
- package/backend-project/node_modules/mongodb/src/cursor/abstract_cursor.ts +948 -0
- package/backend-project/node_modules/mongodb/src/cursor/aggregation_cursor.ts +208 -0
- package/backend-project/node_modules/mongodb/src/cursor/change_stream_cursor.ts +194 -0
- package/backend-project/node_modules/mongodb/src/cursor/find_cursor.ts +458 -0
- package/backend-project/node_modules/mongodb/src/cursor/list_collections_cursor.ts +52 -0
- package/backend-project/node_modules/mongodb/src/cursor/list_indexes_cursor.ts +41 -0
- package/backend-project/node_modules/mongodb/src/cursor/list_search_indexes_cursor.ts +20 -0
- package/backend-project/node_modules/mongodb/src/cursor/run_command_cursor.ts +140 -0
- package/backend-project/node_modules/mongodb/src/db.ts +558 -0
- package/backend-project/node_modules/mongodb/src/deps.ts +428 -0
- package/backend-project/node_modules/mongodb/src/encrypter.ts +131 -0
- package/backend-project/node_modules/mongodb/src/error.ts +968 -0
- package/backend-project/node_modules/mongodb/src/explain.ts +52 -0
- package/backend-project/node_modules/mongodb/src/gridfs/download.ts +474 -0
- package/backend-project/node_modules/mongodb/src/gridfs/index.ts +213 -0
- package/backend-project/node_modules/mongodb/src/gridfs/upload.ts +510 -0
- package/backend-project/node_modules/mongodb/src/index.ts +508 -0
- package/backend-project/node_modules/mongodb/src/mongo_client.ts +839 -0
- package/backend-project/node_modules/mongodb/src/mongo_logger.ts +538 -0
- package/backend-project/node_modules/mongodb/src/mongo_types.ts +575 -0
- package/backend-project/node_modules/mongodb/src/operations/add_user.ts +124 -0
- package/backend-project/node_modules/mongodb/src/operations/aggregate.ts +149 -0
- package/backend-project/node_modules/mongodb/src/operations/bulk_write.ts +62 -0
- package/backend-project/node_modules/mongodb/src/operations/collections.ts +50 -0
- package/backend-project/node_modules/mongodb/src/operations/command.ts +177 -0
- package/backend-project/node_modules/mongodb/src/operations/common_functions.ts +105 -0
- package/backend-project/node_modules/mongodb/src/operations/count.ts +68 -0
- package/backend-project/node_modules/mongodb/src/operations/count_documents.ts +57 -0
- package/backend-project/node_modules/mongodb/src/operations/create_collection.ts +217 -0
- package/backend-project/node_modules/mongodb/src/operations/delete.ts +182 -0
- package/backend-project/node_modules/mongodb/src/operations/distinct.ts +90 -0
- package/backend-project/node_modules/mongodb/src/operations/drop.ts +119 -0
- package/backend-project/node_modules/mongodb/src/operations/estimated_document_count.ts +62 -0
- package/backend-project/node_modules/mongodb/src/operations/eval.ts +82 -0
- package/backend-project/node_modules/mongodb/src/operations/execute_operation.ts +270 -0
- package/backend-project/node_modules/mongodb/src/operations/find.ts +271 -0
- package/backend-project/node_modules/mongodb/src/operations/find_and_modify.ts +303 -0
- package/backend-project/node_modules/mongodb/src/operations/get_more.ts +111 -0
- package/backend-project/node_modules/mongodb/src/operations/indexes.ts +526 -0
- package/backend-project/node_modules/mongodb/src/operations/insert.ts +158 -0
- package/backend-project/node_modules/mongodb/src/operations/is_capped.ts +44 -0
- package/backend-project/node_modules/mongodb/src/operations/kill_cursors.ts +62 -0
- package/backend-project/node_modules/mongodb/src/operations/list_collections.ts +99 -0
- package/backend-project/node_modules/mongodb/src/operations/list_databases.ts +66 -0
- package/backend-project/node_modules/mongodb/src/operations/operation.ts +141 -0
- package/backend-project/node_modules/mongodb/src/operations/options_operation.ts +45 -0
- package/backend-project/node_modules/mongodb/src/operations/profiling_level.ts +39 -0
- package/backend-project/node_modules/mongodb/src/operations/remove_user.ts +33 -0
- package/backend-project/node_modules/mongodb/src/operations/rename.ts +67 -0
- package/backend-project/node_modules/mongodb/src/operations/run_command.ts +73 -0
- package/backend-project/node_modules/mongodb/src/operations/search_indexes/create.ts +54 -0
- package/backend-project/node_modules/mongodb/src/operations/search_indexes/drop.ts +39 -0
- package/backend-project/node_modules/mongodb/src/operations/search_indexes/update.ts +40 -0
- package/backend-project/node_modules/mongodb/src/operations/set_profiling_level.ts +74 -0
- package/backend-project/node_modules/mongodb/src/operations/stats.ts +280 -0
- package/backend-project/node_modules/mongodb/src/operations/update.ts +314 -0
- package/backend-project/node_modules/mongodb/src/operations/validate_collection.ts +59 -0
- package/backend-project/node_modules/mongodb/src/read_concern.ts +88 -0
- package/backend-project/node_modules/mongodb/src/read_preference.ts +262 -0
- package/backend-project/node_modules/mongodb/src/sdam/common.ts +79 -0
- package/backend-project/node_modules/mongodb/src/sdam/events.ts +182 -0
- package/backend-project/node_modules/mongodb/src/sdam/monitor.ts +595 -0
- package/backend-project/node_modules/mongodb/src/sdam/server.ts +587 -0
- package/backend-project/node_modules/mongodb/src/sdam/server_description.ts +262 -0
- package/backend-project/node_modules/mongodb/src/sdam/server_selection.ts +324 -0
- package/backend-project/node_modules/mongodb/src/sdam/srv_polling.ts +142 -0
- package/backend-project/node_modules/mongodb/src/sdam/topology.ts +994 -0
- package/backend-project/node_modules/mongodb/src/sdam/topology_description.ts +511 -0
- package/backend-project/node_modules/mongodb/src/sessions.ts +1050 -0
- package/backend-project/node_modules/mongodb/src/sort.ts +132 -0
- package/backend-project/node_modules/mongodb/src/transactions.ts +188 -0
- package/backend-project/node_modules/mongodb/src/utils.ts +1336 -0
- package/backend-project/node_modules/mongodb/src/write_concern.ts +161 -0
- package/backend-project/node_modules/mongodb/tsconfig.json +45 -0
- package/backend-project/node_modules/mongodb-connection-string-url/.esm-wrapper.mjs +6 -0
- package/backend-project/node_modules/mongodb-connection-string-url/LICENSE +192 -0
- package/backend-project/node_modules/mongodb-connection-string-url/README.md +25 -0
- package/backend-project/node_modules/mongodb-connection-string-url/lib/index.d.ts +62 -0
- package/backend-project/node_modules/mongodb-connection-string-url/lib/index.js +213 -0
- package/backend-project/node_modules/mongodb-connection-string-url/lib/index.js.map +1 -0
- package/backend-project/node_modules/mongodb-connection-string-url/lib/redact.d.ts +7 -0
- package/backend-project/node_modules/mongodb-connection-string-url/lib/redact.js +86 -0
- package/backend-project/node_modules/mongodb-connection-string-url/lib/redact.js.map +1 -0
- package/backend-project/node_modules/mongodb-connection-string-url/package.json +62 -0
- package/backend-project/node_modules/mongoose/.claude/settings.local.json +7 -0
- package/backend-project/node_modules/mongoose/LICENSE.md +22 -0
- package/backend-project/node_modules/mongoose/README.md +375 -0
- package/backend-project/node_modules/mongoose/SECURITY.md +1 -0
- package/backend-project/node_modules/mongoose/browser.js +8 -0
- package/backend-project/node_modules/mongoose/dist/browser.umd.js +2 -0
- package/backend-project/node_modules/mongoose/index.js +63 -0
- package/backend-project/node_modules/mongoose/lib/aggregate.js +1199 -0
- package/backend-project/node_modules/mongoose/lib/browser.js +132 -0
- package/backend-project/node_modules/mongoose/lib/browserDocument.js +101 -0
- package/backend-project/node_modules/mongoose/lib/cast/bigint.js +36 -0
- package/backend-project/node_modules/mongoose/lib/cast/boolean.js +32 -0
- package/backend-project/node_modules/mongoose/lib/cast/date.js +41 -0
- package/backend-project/node_modules/mongoose/lib/cast/decimal128.js +39 -0
- package/backend-project/node_modules/mongoose/lib/cast/number.js +42 -0
- package/backend-project/node_modules/mongoose/lib/cast/objectid.js +29 -0
- package/backend-project/node_modules/mongoose/lib/cast/string.js +37 -0
- package/backend-project/node_modules/mongoose/lib/cast.js +443 -0
- package/backend-project/node_modules/mongoose/lib/collection.js +327 -0
- package/backend-project/node_modules/mongoose/lib/connection.js +1477 -0
- package/backend-project/node_modules/mongoose/lib/connectionstate.js +26 -0
- package/backend-project/node_modules/mongoose/lib/cursor/AggregationCursor.js +386 -0
- package/backend-project/node_modules/mongoose/lib/cursor/ChangeStream.js +153 -0
- package/backend-project/node_modules/mongoose/lib/cursor/QueryCursor.js +579 -0
- package/backend-project/node_modules/mongoose/lib/document.js +4830 -0
- package/backend-project/node_modules/mongoose/lib/document_provider.js +30 -0
- package/backend-project/node_modules/mongoose/lib/driver.js +15 -0
- package/backend-project/node_modules/mongoose/lib/drivers/SPEC.md +4 -0
- package/backend-project/node_modules/mongoose/lib/drivers/browser/binary.js +14 -0
- package/backend-project/node_modules/mongoose/lib/drivers/browser/decimal128.js +7 -0
- package/backend-project/node_modules/mongoose/lib/drivers/browser/index.js +12 -0
- package/backend-project/node_modules/mongoose/lib/drivers/browser/objectid.js +29 -0
- package/backend-project/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js +461 -0
- package/backend-project/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js +409 -0
- package/backend-project/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js +8 -0
- package/backend-project/node_modules/mongoose/lib/error/browserMissingSchema.js +28 -0
- package/backend-project/node_modules/mongoose/lib/error/bulkWriteError.js +41 -0
- package/backend-project/node_modules/mongoose/lib/error/cast.js +159 -0
- package/backend-project/node_modules/mongoose/lib/error/createCollectionsError.js +26 -0
- package/backend-project/node_modules/mongoose/lib/error/divergentArray.js +38 -0
- package/backend-project/node_modules/mongoose/lib/error/eachAsyncMultiError.js +41 -0
- package/backend-project/node_modules/mongoose/lib/error/index.js +227 -0
- package/backend-project/node_modules/mongoose/lib/error/invalidSchemaOption.js +30 -0
- package/backend-project/node_modules/mongoose/lib/error/messages.js +47 -0
- package/backend-project/node_modules/mongoose/lib/error/missingSchema.js +31 -0
- package/backend-project/node_modules/mongoose/lib/error/mongooseError.js +13 -0
- package/backend-project/node_modules/mongoose/lib/error/notFound.js +45 -0
- package/backend-project/node_modules/mongoose/lib/error/objectExpected.js +30 -0
- package/backend-project/node_modules/mongoose/lib/error/objectParameter.js +30 -0
- package/backend-project/node_modules/mongoose/lib/error/overwriteModel.js +30 -0
- package/backend-project/node_modules/mongoose/lib/error/parallelSave.js +30 -0
- package/backend-project/node_modules/mongoose/lib/error/parallelValidate.js +31 -0
- package/backend-project/node_modules/mongoose/lib/error/serverSelection.js +61 -0
- package/backend-project/node_modules/mongoose/lib/error/setOptionError.js +101 -0
- package/backend-project/node_modules/mongoose/lib/error/strict.js +33 -0
- package/backend-project/node_modules/mongoose/lib/error/strictPopulate.js +29 -0
- package/backend-project/node_modules/mongoose/lib/error/syncIndexes.js +30 -0
- package/backend-project/node_modules/mongoose/lib/error/validation.js +103 -0
- package/backend-project/node_modules/mongoose/lib/error/validator.js +99 -0
- package/backend-project/node_modules/mongoose/lib/error/version.js +36 -0
- package/backend-project/node_modules/mongoose/lib/helpers/aggregate/prepareDiscriminatorPipeline.js +39 -0
- package/backend-project/node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.js +50 -0
- package/backend-project/node_modules/mongoose/lib/helpers/arrayDepth.js +33 -0
- package/backend-project/node_modules/mongoose/lib/helpers/clone.js +180 -0
- package/backend-project/node_modules/mongoose/lib/helpers/common.js +127 -0
- package/backend-project/node_modules/mongoose/lib/helpers/cursor/eachAsync.js +225 -0
- package/backend-project/node_modules/mongoose/lib/helpers/discriminator/applyEmbeddedDiscriminators.js +32 -0
- package/backend-project/node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.js +16 -0
- package/backend-project/node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js +12 -0
- package/backend-project/node_modules/mongoose/lib/helpers/discriminator/getConstructor.js +29 -0
- package/backend-project/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js +28 -0
- package/backend-project/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js +27 -0
- package/backend-project/node_modules/mongoose/lib/helpers/discriminator/mergeDiscriminatorSchema.js +76 -0
- package/backend-project/node_modules/mongoose/lib/helpers/document/applyDefaults.js +128 -0
- package/backend-project/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js +35 -0
- package/backend-project/node_modules/mongoose/lib/helpers/document/compile.js +238 -0
- package/backend-project/node_modules/mongoose/lib/helpers/document/getDeepestSubdocumentForPath.js +38 -0
- package/backend-project/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js +53 -0
- package/backend-project/node_modules/mongoose/lib/helpers/document/handleSpreadDoc.js +35 -0
- package/backend-project/node_modules/mongoose/lib/helpers/each.js +25 -0
- package/backend-project/node_modules/mongoose/lib/helpers/error/combinePathErrors.js +22 -0
- package/backend-project/node_modules/mongoose/lib/helpers/firstKey.js +8 -0
- package/backend-project/node_modules/mongoose/lib/helpers/get.js +65 -0
- package/backend-project/node_modules/mongoose/lib/helpers/getConstructorName.js +16 -0
- package/backend-project/node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.js +27 -0
- package/backend-project/node_modules/mongoose/lib/helpers/getFunctionName.js +10 -0
- package/backend-project/node_modules/mongoose/lib/helpers/immediate.js +16 -0
- package/backend-project/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js +13 -0
- package/backend-project/node_modules/mongoose/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js +14 -0
- package/backend-project/node_modules/mongoose/lib/helpers/indexes/getRelatedIndexes.js +59 -0
- package/backend-project/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js +18 -0
- package/backend-project/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js +96 -0
- package/backend-project/node_modules/mongoose/lib/helpers/indexes/isTextIndex.js +16 -0
- package/backend-project/node_modules/mongoose/lib/helpers/isAsyncFunction.js +9 -0
- package/backend-project/node_modules/mongoose/lib/helpers/isBsonType.js +16 -0
- package/backend-project/node_modules/mongoose/lib/helpers/isMongooseObject.js +22 -0
- package/backend-project/node_modules/mongoose/lib/helpers/isObject.js +16 -0
- package/backend-project/node_modules/mongoose/lib/helpers/isPOJO.js +12 -0
- package/backend-project/node_modules/mongoose/lib/helpers/isPromise.js +6 -0
- package/backend-project/node_modules/mongoose/lib/helpers/isSimpleValidator.js +22 -0
- package/backend-project/node_modules/mongoose/lib/helpers/model/applyDefaultsToPOJO.js +52 -0
- package/backend-project/node_modules/mongoose/lib/helpers/model/applyHooks.js +149 -0
- package/backend-project/node_modules/mongoose/lib/helpers/model/applyMethods.js +70 -0
- package/backend-project/node_modules/mongoose/lib/helpers/model/applyStaticHooks.js +71 -0
- package/backend-project/node_modules/mongoose/lib/helpers/model/applyStatics.js +13 -0
- package/backend-project/node_modules/mongoose/lib/helpers/model/castBulkWrite.js +284 -0
- package/backend-project/node_modules/mongoose/lib/helpers/model/discriminator.js +213 -0
- package/backend-project/node_modules/mongoose/lib/helpers/model/pushNestedArrayPaths.js +15 -0
- package/backend-project/node_modules/mongoose/lib/helpers/once.js +12 -0
- package/backend-project/node_modules/mongoose/lib/helpers/parallelLimit.js +55 -0
- package/backend-project/node_modules/mongoose/lib/helpers/path/parentPaths.js +18 -0
- package/backend-project/node_modules/mongoose/lib/helpers/path/setDottedPath.js +33 -0
- package/backend-project/node_modules/mongoose/lib/helpers/pluralize.js +95 -0
- package/backend-project/node_modules/mongoose/lib/helpers/populate/SkipPopulateValue.js +10 -0
- package/backend-project/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js +129 -0
- package/backend-project/node_modules/mongoose/lib/helpers/populate/assignVals.js +344 -0
- package/backend-project/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js +97 -0
- package/backend-project/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js +758 -0
- package/backend-project/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js +229 -0
- package/backend-project/node_modules/mongoose/lib/helpers/populate/getVirtual.js +72 -0
- package/backend-project/node_modules/mongoose/lib/helpers/populate/leanPopulateMap.js +7 -0
- package/backend-project/node_modules/mongoose/lib/helpers/populate/lookupLocalFields.js +40 -0
- package/backend-project/node_modules/mongoose/lib/helpers/populate/markArraySubdocsPopulated.js +49 -0
- package/backend-project/node_modules/mongoose/lib/helpers/populate/modelNamesFromRefPath.js +68 -0
- package/backend-project/node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.js +31 -0
- package/backend-project/node_modules/mongoose/lib/helpers/populate/validateRef.js +19 -0
- package/backend-project/node_modules/mongoose/lib/helpers/printJestWarning.js +21 -0
- package/backend-project/node_modules/mongoose/lib/helpers/processConnectionOptions.js +65 -0
- package/backend-project/node_modules/mongoose/lib/helpers/projection/applyProjection.js +77 -0
- package/backend-project/node_modules/mongoose/lib/helpers/projection/hasIncludedChildren.js +41 -0
- package/backend-project/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js +18 -0
- package/backend-project/node_modules/mongoose/lib/helpers/projection/isExclusive.js +37 -0
- package/backend-project/node_modules/mongoose/lib/helpers/projection/isInclusive.js +39 -0
- package/backend-project/node_modules/mongoose/lib/helpers/projection/isNestedProjection.js +8 -0
- package/backend-project/node_modules/mongoose/lib/helpers/projection/isPathExcluded.js +40 -0
- package/backend-project/node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.js +28 -0
- package/backend-project/node_modules/mongoose/lib/helpers/projection/isSubpath.js +14 -0
- package/backend-project/node_modules/mongoose/lib/helpers/projection/parseProjection.js +33 -0
- package/backend-project/node_modules/mongoose/lib/helpers/promiseOrCallback.js +54 -0
- package/backend-project/node_modules/mongoose/lib/helpers/query/applyGlobalOption.js +29 -0
- package/backend-project/node_modules/mongoose/lib/helpers/query/applyQueryMiddleware.js +54 -0
- package/backend-project/node_modules/mongoose/lib/helpers/query/cast$expr.js +292 -0
- package/backend-project/node_modules/mongoose/lib/helpers/query/castFilterPath.js +55 -0
- package/backend-project/node_modules/mongoose/lib/helpers/query/castUpdate.js +584 -0
- package/backend-project/node_modules/mongoose/lib/helpers/query/completeMany.js +36 -0
- package/backend-project/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js +94 -0
- package/backend-project/node_modules/mongoose/lib/helpers/query/handleImmutable.js +32 -0
- package/backend-project/node_modules/mongoose/lib/helpers/query/handleReadPreferenceAliases.js +23 -0
- package/backend-project/node_modules/mongoose/lib/helpers/query/hasDollarKeys.js +23 -0
- package/backend-project/node_modules/mongoose/lib/helpers/query/isOperator.js +14 -0
- package/backend-project/node_modules/mongoose/lib/helpers/query/sanitizeFilter.js +41 -0
- package/backend-project/node_modules/mongoose/lib/helpers/query/sanitizeProjection.js +14 -0
- package/backend-project/node_modules/mongoose/lib/helpers/query/selectPopulatedFields.js +62 -0
- package/backend-project/node_modules/mongoose/lib/helpers/query/trusted.js +13 -0
- package/backend-project/node_modules/mongoose/lib/helpers/query/validOps.js +22 -0
- package/backend-project/node_modules/mongoose/lib/helpers/schema/addAutoId.js +7 -0
- package/backend-project/node_modules/mongoose/lib/helpers/schema/applyBuiltinPlugins.js +12 -0
- package/backend-project/node_modules/mongoose/lib/helpers/schema/applyPlugins.js +55 -0
- package/backend-project/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js +33 -0
- package/backend-project/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js +12 -0
- package/backend-project/node_modules/mongoose/lib/helpers/schema/getIndexes.js +172 -0
- package/backend-project/node_modules/mongoose/lib/helpers/schema/getKeysInSchemaOrder.js +28 -0
- package/backend-project/node_modules/mongoose/lib/helpers/schema/getPath.js +37 -0
- package/backend-project/node_modules/mongoose/lib/helpers/schema/getSubdocumentStrictValue.js +32 -0
- package/backend-project/node_modules/mongoose/lib/helpers/schema/handleIdOption.js +20 -0
- package/backend-project/node_modules/mongoose/lib/helpers/schema/handleTimestampOption.js +24 -0
- package/backend-project/node_modules/mongoose/lib/helpers/schema/idGetter.js +46 -0
- package/backend-project/node_modules/mongoose/lib/helpers/schema/merge.js +36 -0
- package/backend-project/node_modules/mongoose/lib/helpers/schematype/handleImmutable.js +50 -0
- package/backend-project/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js +132 -0
- package/backend-project/node_modules/mongoose/lib/helpers/specialProperties.js +3 -0
- package/backend-project/node_modules/mongoose/lib/helpers/symbols.js +20 -0
- package/backend-project/node_modules/mongoose/lib/helpers/timers.js +3 -0
- package/backend-project/node_modules/mongoose/lib/helpers/timestamps/setDocumentTimestamps.js +26 -0
- package/backend-project/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js +110 -0
- package/backend-project/node_modules/mongoose/lib/helpers/topology/allServersUnknown.js +12 -0
- package/backend-project/node_modules/mongoose/lib/helpers/topology/isAtlas.js +31 -0
- package/backend-project/node_modules/mongoose/lib/helpers/topology/isSSLError.js +16 -0
- package/backend-project/node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.js +193 -0
- package/backend-project/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js +131 -0
- package/backend-project/node_modules/mongoose/lib/helpers/update/castArrayFilters.js +109 -0
- package/backend-project/node_modules/mongoose/lib/helpers/update/decorateUpdateWithVersionKey.js +26 -0
- package/backend-project/node_modules/mongoose/lib/helpers/update/modifiedPaths.js +33 -0
- package/backend-project/node_modules/mongoose/lib/helpers/update/moveImmutableProperties.js +53 -0
- package/backend-project/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js +32 -0
- package/backend-project/node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.js +27 -0
- package/backend-project/node_modules/mongoose/lib/helpers/updateValidators.js +249 -0
- package/backend-project/node_modules/mongoose/lib/index.js +1300 -0
- package/backend-project/node_modules/mongoose/lib/internal.js +46 -0
- package/backend-project/node_modules/mongoose/lib/model.js +4945 -0
- package/backend-project/node_modules/mongoose/lib/options/PopulateOptions.js +36 -0
- package/backend-project/node_modules/mongoose/lib/options/SchemaArrayOptions.js +78 -0
- package/backend-project/node_modules/mongoose/lib/options/SchemaBufferOptions.js +38 -0
- package/backend-project/node_modules/mongoose/lib/options/SchemaDateOptions.js +71 -0
- package/backend-project/node_modules/mongoose/lib/options/SchemaDocumentArrayOptions.js +68 -0
- package/backend-project/node_modules/mongoose/lib/options/SchemaMapOptions.js +43 -0
- package/backend-project/node_modules/mongoose/lib/options/SchemaNumberOptions.js +101 -0
- package/backend-project/node_modules/mongoose/lib/options/SchemaObjectIdOptions.js +64 -0
- package/backend-project/node_modules/mongoose/lib/options/SchemaStringOptions.js +138 -0
- package/backend-project/node_modules/mongoose/lib/options/SchemaSubdocumentOptions.js +42 -0
- package/backend-project/node_modules/mongoose/lib/options/SchemaTypeOptions.js +244 -0
- package/backend-project/node_modules/mongoose/lib/options/VirtualOptions.js +164 -0
- package/backend-project/node_modules/mongoose/lib/options/propertyOptions.js +8 -0
- package/backend-project/node_modules/mongoose/lib/options/saveOptions.js +14 -0
- package/backend-project/node_modules/mongoose/lib/options.js +15 -0
- package/backend-project/node_modules/mongoose/lib/plugins/index.js +7 -0
- package/backend-project/node_modules/mongoose/lib/plugins/removeSubdocs.js +35 -0
- package/backend-project/node_modules/mongoose/lib/plugins/saveSubdocs.js +66 -0
- package/backend-project/node_modules/mongoose/lib/plugins/sharding.js +83 -0
- package/backend-project/node_modules/mongoose/lib/plugins/trackTransaction.js +92 -0
- package/backend-project/node_modules/mongoose/lib/plugins/validateBeforeSave.js +51 -0
- package/backend-project/node_modules/mongoose/lib/query.js +5542 -0
- package/backend-project/node_modules/mongoose/lib/queryhelpers.js +403 -0
- package/backend-project/node_modules/mongoose/lib/schema/DocumentArrayElement.js +100 -0
- package/backend-project/node_modules/mongoose/lib/schema/SubdocumentPath.js +397 -0
- package/backend-project/node_modules/mongoose/lib/schema/array.js +686 -0
- package/backend-project/node_modules/mongoose/lib/schema/bigint.js +240 -0
- package/backend-project/node_modules/mongoose/lib/schema/boolean.js +290 -0
- package/backend-project/node_modules/mongoose/lib/schema/buffer.js +290 -0
- package/backend-project/node_modules/mongoose/lib/schema/date.js +426 -0
- package/backend-project/node_modules/mongoose/lib/schema/decimal128.js +228 -0
- package/backend-project/node_modules/mongoose/lib/schema/documentarray.js +616 -0
- package/backend-project/node_modules/mongoose/lib/schema/index.js +28 -0
- package/backend-project/node_modules/mongoose/lib/schema/map.js +84 -0
- package/backend-project/node_modules/mongoose/lib/schema/mixed.js +131 -0
- package/backend-project/node_modules/mongoose/lib/schema/number.js +440 -0
- package/backend-project/node_modules/mongoose/lib/schema/objectid.js +297 -0
- package/backend-project/node_modules/mongoose/lib/schema/operators/bitwise.js +38 -0
- package/backend-project/node_modules/mongoose/lib/schema/operators/exists.js +12 -0
- package/backend-project/node_modules/mongoose/lib/schema/operators/geospatial.js +107 -0
- package/backend-project/node_modules/mongoose/lib/schema/operators/helpers.js +32 -0
- package/backend-project/node_modules/mongoose/lib/schema/operators/text.js +39 -0
- package/backend-project/node_modules/mongoose/lib/schema/operators/type.js +20 -0
- package/backend-project/node_modules/mongoose/lib/schema/string.js +698 -0
- package/backend-project/node_modules/mongoose/lib/schema/symbols.js +5 -0
- package/backend-project/node_modules/mongoose/lib/schema/uuid.js +356 -0
- package/backend-project/node_modules/mongoose/lib/schema.js +2780 -0
- package/backend-project/node_modules/mongoose/lib/schematype.js +1709 -0
- package/backend-project/node_modules/mongoose/lib/statemachine.js +211 -0
- package/backend-project/node_modules/mongoose/lib/types/ArraySubdocument.js +197 -0
- package/backend-project/node_modules/mongoose/lib/types/DocumentArray/index.js +113 -0
- package/backend-project/node_modules/mongoose/lib/types/DocumentArray/isMongooseDocumentArray.js +5 -0
- package/backend-project/node_modules/mongoose/lib/types/DocumentArray/methods/index.js +383 -0
- package/backend-project/node_modules/mongoose/lib/types/array/index.js +119 -0
- package/backend-project/node_modules/mongoose/lib/types/array/isMongooseArray.js +5 -0
- package/backend-project/node_modules/mongoose/lib/types/array/methods/index.js +1031 -0
- package/backend-project/node_modules/mongoose/lib/types/buffer.js +277 -0
- package/backend-project/node_modules/mongoose/lib/types/decimal128.js +13 -0
- package/backend-project/node_modules/mongoose/lib/types/index.js +22 -0
- package/backend-project/node_modules/mongoose/lib/types/map.js +354 -0
- package/backend-project/node_modules/mongoose/lib/types/objectid.js +41 -0
- package/backend-project/node_modules/mongoose/lib/types/subdocument.js +436 -0
- package/backend-project/node_modules/mongoose/lib/types/uuid.js +13 -0
- package/backend-project/node_modules/mongoose/lib/utils.js +988 -0
- package/backend-project/node_modules/mongoose/lib/validoptions.js +38 -0
- package/backend-project/node_modules/mongoose/lib/virtualtype.js +175 -0
- package/backend-project/node_modules/mongoose/node_modules/ms/index.js +162 -0
- package/backend-project/node_modules/mongoose/node_modules/ms/license.md +21 -0
- package/backend-project/node_modules/mongoose/node_modules/ms/package.json +38 -0
- package/backend-project/node_modules/mongoose/node_modules/ms/readme.md +59 -0
- package/backend-project/node_modules/mongoose/package.json +156 -0
- package/backend-project/node_modules/mongoose/startmdb.mjs +19 -0
- package/backend-project/node_modules/mongoose/types/aggregate.d.ts +180 -0
- package/backend-project/node_modules/mongoose/types/augmentations.d.ts +9 -0
- package/backend-project/node_modules/mongoose/types/callback.d.ts +8 -0
- package/backend-project/node_modules/mongoose/types/collection.d.ts +44 -0
- package/backend-project/node_modules/mongoose/types/connection.d.ts +234 -0
- package/backend-project/node_modules/mongoose/types/cursor.d.ts +58 -0
- package/backend-project/node_modules/mongoose/types/document.d.ts +261 -0
- package/backend-project/node_modules/mongoose/types/error.d.ts +134 -0
- package/backend-project/node_modules/mongoose/types/expressions.d.ts +3038 -0
- package/backend-project/node_modules/mongoose/types/helpers.d.ts +32 -0
- package/backend-project/node_modules/mongoose/types/index.d.ts +678 -0
- package/backend-project/node_modules/mongoose/types/indexes.d.ts +89 -0
- package/backend-project/node_modules/mongoose/types/inferschematype.d.ts +230 -0
- package/backend-project/node_modules/mongoose/types/middlewares.d.ts +49 -0
- package/backend-project/node_modules/mongoose/types/models.d.ts +790 -0
- package/backend-project/node_modules/mongoose/types/mongooseoptions.d.ts +219 -0
- package/backend-project/node_modules/mongoose/types/pipelinestage.d.ts +312 -0
- package/backend-project/node_modules/mongoose/types/populate.d.ts +45 -0
- package/backend-project/node_modules/mongoose/types/query.d.ts +781 -0
- package/backend-project/node_modules/mongoose/types/schemaoptions.d.ts +261 -0
- package/backend-project/node_modules/mongoose/types/schematypes.d.ts +490 -0
- package/backend-project/node_modules/mongoose/types/session.d.ts +32 -0
- package/backend-project/node_modules/mongoose/types/types.d.ts +103 -0
- package/backend-project/node_modules/mongoose/types/utility.d.ts +43 -0
- package/backend-project/node_modules/mongoose/types/validation.d.ts +34 -0
- package/backend-project/node_modules/mongoose/types/virtuals.d.ts +14 -0
- package/backend-project/node_modules/mpath/.travis.yml +9 -0
- package/backend-project/node_modules/mpath/History.md +88 -0
- package/backend-project/node_modules/mpath/LICENSE +22 -0
- package/backend-project/node_modules/mpath/README.md +278 -0
- package/backend-project/node_modules/mpath/SECURITY.md +5 -0
- package/backend-project/node_modules/mpath/index.js +3 -0
- package/backend-project/node_modules/mpath/lib/index.js +336 -0
- package/backend-project/node_modules/mpath/lib/stringToParts.js +48 -0
- package/backend-project/node_modules/mpath/package.json +144 -0
- package/backend-project/node_modules/mpath/test/.eslintrc.yml +4 -0
- package/backend-project/node_modules/mpath/test/index.js +1879 -0
- package/backend-project/node_modules/mpath/test/stringToParts.js +30 -0
- package/backend-project/node_modules/mquery/.github/ISSUE_TEMPLATE.md +11 -0
- package/backend-project/node_modules/mquery/.github/PULL_REQUEST_TEMPLATE.md +9 -0
- package/backend-project/node_modules/mquery/History.md +384 -0
- package/backend-project/node_modules/mquery/LICENSE +22 -0
- package/backend-project/node_modules/mquery/README.md +1247 -0
- package/backend-project/node_modules/mquery/SECURITY.md +1 -0
- package/backend-project/node_modules/mquery/lib/collection/collection.js +45 -0
- package/backend-project/node_modules/mquery/lib/collection/index.js +13 -0
- package/backend-project/node_modules/mquery/lib/collection/node.js +114 -0
- package/backend-project/node_modules/mquery/lib/env.js +22 -0
- package/backend-project/node_modules/mquery/lib/mquery.js +2705 -0
- package/backend-project/node_modules/mquery/lib/permissions.js +78 -0
- package/backend-project/node_modules/mquery/lib/utils.js +297 -0
- package/backend-project/node_modules/mquery/node_modules/debug/LICENSE +20 -0
- package/backend-project/node_modules/mquery/node_modules/debug/README.md +481 -0
- package/backend-project/node_modules/mquery/node_modules/debug/package.json +64 -0
- package/backend-project/node_modules/mquery/node_modules/debug/src/browser.js +272 -0
- package/backend-project/node_modules/mquery/node_modules/debug/src/common.js +292 -0
- package/backend-project/node_modules/mquery/node_modules/debug/src/index.js +10 -0
- package/backend-project/node_modules/mquery/node_modules/debug/src/node.js +263 -0
- package/backend-project/node_modules/mquery/node_modules/ms/index.js +162 -0
- package/backend-project/node_modules/mquery/node_modules/ms/license.md +21 -0
- package/backend-project/node_modules/mquery/node_modules/ms/package.json +38 -0
- package/backend-project/node_modules/mquery/node_modules/ms/readme.md +59 -0
- package/backend-project/node_modules/mquery/package.json +38 -0
- package/backend-project/node_modules/ms/index.js +152 -0
- package/backend-project/node_modules/ms/license.md +21 -0
- package/backend-project/node_modules/ms/package.json +37 -0
- package/backend-project/node_modules/ms/readme.md +51 -0
- package/backend-project/node_modules/negotiator/HISTORY.md +108 -0
- package/backend-project/node_modules/negotiator/LICENSE +24 -0
- package/backend-project/node_modules/negotiator/README.md +203 -0
- package/backend-project/node_modules/negotiator/index.js +82 -0
- package/backend-project/node_modules/negotiator/lib/charset.js +169 -0
- package/backend-project/node_modules/negotiator/lib/encoding.js +184 -0
- package/backend-project/node_modules/negotiator/lib/language.js +179 -0
- package/backend-project/node_modules/negotiator/lib/mediaType.js +294 -0
- package/backend-project/node_modules/negotiator/package.json +42 -0
- package/backend-project/node_modules/nodemon/.prettierrc.json +3 -0
- package/backend-project/node_modules/nodemon/LICENSE +21 -0
- package/backend-project/node_modules/nodemon/README.md +439 -0
- package/backend-project/node_modules/nodemon/bin/nodemon.js +16 -0
- package/backend-project/node_modules/nodemon/bin/windows-kill.exe +0 -0
- package/backend-project/node_modules/nodemon/doc/cli/authors.txt +8 -0
- package/backend-project/node_modules/nodemon/doc/cli/config.txt +44 -0
- package/backend-project/node_modules/nodemon/doc/cli/help.txt +29 -0
- package/backend-project/node_modules/nodemon/doc/cli/logo.txt +20 -0
- package/backend-project/node_modules/nodemon/doc/cli/options.txt +36 -0
- package/backend-project/node_modules/nodemon/doc/cli/topics.txt +8 -0
- package/backend-project/node_modules/nodemon/doc/cli/usage.txt +3 -0
- package/backend-project/node_modules/nodemon/doc/cli/whoami.txt +9 -0
- package/backend-project/node_modules/nodemon/index.d.ts +124 -0
- package/backend-project/node_modules/nodemon/jsconfig.json +7 -0
- package/backend-project/node_modules/nodemon/lib/cli/index.js +49 -0
- package/backend-project/node_modules/nodemon/lib/cli/parse.js +230 -0
- package/backend-project/node_modules/nodemon/lib/config/command.js +43 -0
- package/backend-project/node_modules/nodemon/lib/config/defaults.js +34 -0
- package/backend-project/node_modules/nodemon/lib/config/exec.js +240 -0
- package/backend-project/node_modules/nodemon/lib/config/index.js +93 -0
- package/backend-project/node_modules/nodemon/lib/config/load.js +225 -0
- package/backend-project/node_modules/nodemon/lib/help/index.js +27 -0
- package/backend-project/node_modules/nodemon/lib/index.js +1 -0
- package/backend-project/node_modules/nodemon/lib/monitor/index.js +4 -0
- package/backend-project/node_modules/nodemon/lib/monitor/match.js +288 -0
- package/backend-project/node_modules/nodemon/lib/monitor/run.js +562 -0
- package/backend-project/node_modules/nodemon/lib/monitor/signals.js +34 -0
- package/backend-project/node_modules/nodemon/lib/monitor/watch.js +244 -0
- package/backend-project/node_modules/nodemon/lib/nodemon.js +317 -0
- package/backend-project/node_modules/nodemon/lib/rules/add.js +89 -0
- package/backend-project/node_modules/nodemon/lib/rules/index.js +53 -0
- package/backend-project/node_modules/nodemon/lib/rules/parse.js +43 -0
- package/backend-project/node_modules/nodemon/lib/spawn.js +74 -0
- package/backend-project/node_modules/nodemon/lib/utils/bus.js +44 -0
- package/backend-project/node_modules/nodemon/lib/utils/clone.js +40 -0
- package/backend-project/node_modules/nodemon/lib/utils/colour.js +26 -0
- package/backend-project/node_modules/nodemon/lib/utils/index.js +103 -0
- package/backend-project/node_modules/nodemon/lib/utils/log.js +82 -0
- package/backend-project/node_modules/nodemon/lib/utils/merge.js +47 -0
- package/backend-project/node_modules/nodemon/lib/version.js +100 -0
- package/backend-project/node_modules/nodemon/node_modules/debug/LICENSE +20 -0
- package/backend-project/node_modules/nodemon/node_modules/debug/README.md +481 -0
- package/backend-project/node_modules/nodemon/node_modules/debug/package.json +64 -0
- package/backend-project/node_modules/nodemon/node_modules/debug/src/browser.js +272 -0
- package/backend-project/node_modules/nodemon/node_modules/debug/src/common.js +292 -0
- package/backend-project/node_modules/nodemon/node_modules/debug/src/index.js +10 -0
- package/backend-project/node_modules/nodemon/node_modules/debug/src/node.js +263 -0
- package/backend-project/node_modules/nodemon/node_modules/ms/index.js +162 -0
- package/backend-project/node_modules/nodemon/node_modules/ms/license.md +21 -0
- package/backend-project/node_modules/nodemon/node_modules/ms/package.json +38 -0
- package/backend-project/node_modules/nodemon/node_modules/ms/readme.md +59 -0
- package/backend-project/node_modules/nodemon/package.json +78 -0
- package/backend-project/node_modules/normalize-path/LICENSE +21 -0
- package/backend-project/node_modules/normalize-path/README.md +127 -0
- package/backend-project/node_modules/normalize-path/index.js +35 -0
- package/backend-project/node_modules/normalize-path/package.json +77 -0
- package/backend-project/node_modules/object-assign/index.js +90 -0
- package/backend-project/node_modules/object-assign/license +21 -0
- package/backend-project/node_modules/object-assign/package.json +42 -0
- package/backend-project/node_modules/object-assign/readme.md +61 -0
- package/backend-project/node_modules/object-inspect/.eslintrc +53 -0
- package/backend-project/node_modules/object-inspect/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/object-inspect/.nycrc +13 -0
- package/backend-project/node_modules/object-inspect/CHANGELOG.md +424 -0
- package/backend-project/node_modules/object-inspect/LICENSE +21 -0
- package/backend-project/node_modules/object-inspect/example/all.js +23 -0
- package/backend-project/node_modules/object-inspect/example/circular.js +6 -0
- package/backend-project/node_modules/object-inspect/example/fn.js +5 -0
- package/backend-project/node_modules/object-inspect/example/inspect.js +10 -0
- package/backend-project/node_modules/object-inspect/index.js +544 -0
- package/backend-project/node_modules/object-inspect/package-support.json +20 -0
- package/backend-project/node_modules/object-inspect/package.json +105 -0
- package/backend-project/node_modules/object-inspect/readme.markdown +84 -0
- package/backend-project/node_modules/object-inspect/test/bigint.js +58 -0
- package/backend-project/node_modules/object-inspect/test/browser/dom.js +15 -0
- package/backend-project/node_modules/object-inspect/test/circular.js +16 -0
- package/backend-project/node_modules/object-inspect/test/deep.js +12 -0
- package/backend-project/node_modules/object-inspect/test/element.js +53 -0
- package/backend-project/node_modules/object-inspect/test/err.js +48 -0
- package/backend-project/node_modules/object-inspect/test/fakes.js +29 -0
- package/backend-project/node_modules/object-inspect/test/fn.js +76 -0
- package/backend-project/node_modules/object-inspect/test/global.js +17 -0
- package/backend-project/node_modules/object-inspect/test/has.js +15 -0
- package/backend-project/node_modules/object-inspect/test/holes.js +15 -0
- package/backend-project/node_modules/object-inspect/test/indent-option.js +271 -0
- package/backend-project/node_modules/object-inspect/test/inspect.js +139 -0
- package/backend-project/node_modules/object-inspect/test/lowbyte.js +12 -0
- package/backend-project/node_modules/object-inspect/test/number.js +58 -0
- package/backend-project/node_modules/object-inspect/test/quoteStyle.js +26 -0
- package/backend-project/node_modules/object-inspect/test/toStringTag.js +40 -0
- package/backend-project/node_modules/object-inspect/test/undef.js +12 -0
- package/backend-project/node_modules/object-inspect/test/values.js +261 -0
- package/backend-project/node_modules/object-inspect/test-core-js.js +26 -0
- package/backend-project/node_modules/object-inspect/util.inspect.js +1 -0
- package/backend-project/node_modules/on-finished/HISTORY.md +98 -0
- package/backend-project/node_modules/on-finished/LICENSE +23 -0
- package/backend-project/node_modules/on-finished/README.md +162 -0
- package/backend-project/node_modules/on-finished/index.js +234 -0
- package/backend-project/node_modules/on-finished/package.json +39 -0
- package/backend-project/node_modules/parseurl/HISTORY.md +58 -0
- package/backend-project/node_modules/parseurl/LICENSE +24 -0
- package/backend-project/node_modules/parseurl/README.md +133 -0
- package/backend-project/node_modules/parseurl/index.js +158 -0
- package/backend-project/node_modules/parseurl/package.json +40 -0
- package/backend-project/node_modules/path-to-regexp/LICENSE +21 -0
- package/backend-project/node_modules/path-to-regexp/Readme.md +35 -0
- package/backend-project/node_modules/path-to-regexp/index.js +158 -0
- package/backend-project/node_modules/path-to-regexp/package.json +30 -0
- package/backend-project/node_modules/picomatch/LICENSE +21 -0
- package/backend-project/node_modules/picomatch/README.md +716 -0
- package/backend-project/node_modules/picomatch/index.js +3 -0
- package/backend-project/node_modules/picomatch/lib/constants.js +184 -0
- package/backend-project/node_modules/picomatch/lib/parse.js +1392 -0
- package/backend-project/node_modules/picomatch/lib/picomatch.js +342 -0
- package/backend-project/node_modules/picomatch/lib/scan.js +391 -0
- package/backend-project/node_modules/picomatch/lib/utils.js +64 -0
- package/backend-project/node_modules/picomatch/package.json +81 -0
- package/backend-project/node_modules/proxy-addr/HISTORY.md +161 -0
- package/backend-project/node_modules/proxy-addr/LICENSE +22 -0
- package/backend-project/node_modules/proxy-addr/README.md +139 -0
- package/backend-project/node_modules/proxy-addr/index.js +327 -0
- package/backend-project/node_modules/proxy-addr/package.json +47 -0
- package/backend-project/node_modules/pstree.remy/.travis.yml +8 -0
- package/backend-project/node_modules/pstree.remy/LICENSE +7 -0
- package/backend-project/node_modules/pstree.remy/README.md +26 -0
- package/backend-project/node_modules/pstree.remy/lib/index.js +37 -0
- package/backend-project/node_modules/pstree.remy/lib/tree.js +37 -0
- package/backend-project/node_modules/pstree.remy/lib/utils.js +53 -0
- package/backend-project/node_modules/pstree.remy/package.json +33 -0
- package/backend-project/node_modules/pstree.remy/tests/fixtures/index.js +13 -0
- package/backend-project/node_modules/pstree.remy/tests/fixtures/out1 +10 -0
- package/backend-project/node_modules/pstree.remy/tests/fixtures/out2 +29 -0
- package/backend-project/node_modules/pstree.remy/tests/index.test.js +51 -0
- package/backend-project/node_modules/punycode/LICENSE-MIT.txt +20 -0
- package/backend-project/node_modules/punycode/README.md +148 -0
- package/backend-project/node_modules/punycode/package.json +58 -0
- package/backend-project/node_modules/punycode/punycode.es6.js +444 -0
- package/backend-project/node_modules/punycode/punycode.js +443 -0
- package/backend-project/node_modules/qs/.editorconfig +46 -0
- package/backend-project/node_modules/qs/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/qs/.github/SECURITY.md +11 -0
- package/backend-project/node_modules/qs/.github/THREAT_MODEL.md +78 -0
- package/backend-project/node_modules/qs/.nycrc +13 -0
- package/backend-project/node_modules/qs/CHANGELOG.md +822 -0
- package/backend-project/node_modules/qs/LICENSE.md +29 -0
- package/backend-project/node_modules/qs/README.md +758 -0
- package/backend-project/node_modules/qs/dist/qs.js +141 -0
- package/backend-project/node_modules/qs/eslint.config.mjs +57 -0
- package/backend-project/node_modules/qs/lib/formats.js +23 -0
- package/backend-project/node_modules/qs/lib/index.js +11 -0
- package/backend-project/node_modules/qs/lib/parse.js +403 -0
- package/backend-project/node_modules/qs/lib/stringify.js +363 -0
- package/backend-project/node_modules/qs/lib/utils.js +342 -0
- package/backend-project/node_modules/qs/package.json +94 -0
- package/backend-project/node_modules/qs/test/empty-keys-cases.js +267 -0
- package/backend-project/node_modules/qs/test/parse.js +1703 -0
- package/backend-project/node_modules/qs/test/stringify.js +1448 -0
- package/backend-project/node_modules/qs/test/utils.js +432 -0
- package/backend-project/node_modules/range-parser/HISTORY.md +56 -0
- package/backend-project/node_modules/range-parser/LICENSE +23 -0
- package/backend-project/node_modules/range-parser/README.md +84 -0
- package/backend-project/node_modules/range-parser/index.js +162 -0
- package/backend-project/node_modules/range-parser/package.json +44 -0
- package/backend-project/node_modules/raw-body/LICENSE +22 -0
- package/backend-project/node_modules/raw-body/README.md +223 -0
- package/backend-project/node_modules/raw-body/index.d.ts +87 -0
- package/backend-project/node_modules/raw-body/index.js +336 -0
- package/backend-project/node_modules/raw-body/package.json +47 -0
- package/backend-project/node_modules/readdirp/LICENSE +21 -0
- package/backend-project/node_modules/readdirp/README.md +122 -0
- package/backend-project/node_modules/readdirp/index.d.ts +43 -0
- package/backend-project/node_modules/readdirp/index.js +287 -0
- package/backend-project/node_modules/readdirp/package.json +122 -0
- package/backend-project/node_modules/safe-buffer/LICENSE +21 -0
- package/backend-project/node_modules/safe-buffer/README.md +584 -0
- package/backend-project/node_modules/safe-buffer/index.d.ts +187 -0
- package/backend-project/node_modules/safe-buffer/index.js +65 -0
- package/backend-project/node_modules/safe-buffer/package.json +51 -0
- package/backend-project/node_modules/safer-buffer/LICENSE +21 -0
- package/backend-project/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- package/backend-project/node_modules/safer-buffer/Readme.md +156 -0
- package/backend-project/node_modules/safer-buffer/dangerous.js +58 -0
- package/backend-project/node_modules/safer-buffer/package.json +34 -0
- package/backend-project/node_modules/safer-buffer/safer.js +77 -0
- package/backend-project/node_modules/safer-buffer/tests.js +406 -0
- package/backend-project/node_modules/semver/LICENSE +15 -0
- package/backend-project/node_modules/semver/README.md +680 -0
- package/backend-project/node_modules/semver/bin/semver.js +195 -0
- package/backend-project/node_modules/semver/classes/comparator.js +143 -0
- package/backend-project/node_modules/semver/classes/index.js +7 -0
- package/backend-project/node_modules/semver/classes/range.js +564 -0
- package/backend-project/node_modules/semver/classes/semver.js +333 -0
- package/backend-project/node_modules/semver/functions/clean.js +8 -0
- package/backend-project/node_modules/semver/functions/cmp.js +54 -0
- package/backend-project/node_modules/semver/functions/coerce.js +62 -0
- package/backend-project/node_modules/semver/functions/compare-build.js +9 -0
- package/backend-project/node_modules/semver/functions/compare-loose.js +5 -0
- package/backend-project/node_modules/semver/functions/compare.js +7 -0
- package/backend-project/node_modules/semver/functions/diff.js +60 -0
- package/backend-project/node_modules/semver/functions/eq.js +5 -0
- package/backend-project/node_modules/semver/functions/gt.js +5 -0
- package/backend-project/node_modules/semver/functions/gte.js +5 -0
- package/backend-project/node_modules/semver/functions/inc.js +21 -0
- package/backend-project/node_modules/semver/functions/lt.js +5 -0
- package/backend-project/node_modules/semver/functions/lte.js +5 -0
- package/backend-project/node_modules/semver/functions/major.js +5 -0
- package/backend-project/node_modules/semver/functions/minor.js +5 -0
- package/backend-project/node_modules/semver/functions/neq.js +5 -0
- package/backend-project/node_modules/semver/functions/parse.js +18 -0
- package/backend-project/node_modules/semver/functions/patch.js +5 -0
- package/backend-project/node_modules/semver/functions/prerelease.js +8 -0
- package/backend-project/node_modules/semver/functions/rcompare.js +5 -0
- package/backend-project/node_modules/semver/functions/rsort.js +5 -0
- package/backend-project/node_modules/semver/functions/satisfies.js +12 -0
- package/backend-project/node_modules/semver/functions/sort.js +5 -0
- package/backend-project/node_modules/semver/functions/truncate.js +48 -0
- package/backend-project/node_modules/semver/functions/valid.js +8 -0
- package/backend-project/node_modules/semver/index.js +93 -0
- package/backend-project/node_modules/semver/internal/constants.js +37 -0
- package/backend-project/node_modules/semver/internal/debug.js +11 -0
- package/backend-project/node_modules/semver/internal/identifiers.js +29 -0
- package/backend-project/node_modules/semver/internal/lrucache.js +42 -0
- package/backend-project/node_modules/semver/internal/parse-options.js +17 -0
- package/backend-project/node_modules/semver/internal/re.js +223 -0
- package/backend-project/node_modules/semver/package.json +78 -0
- package/backend-project/node_modules/semver/preload.js +4 -0
- package/backend-project/node_modules/semver/range.bnf +17 -0
- package/backend-project/node_modules/semver/ranges/gtr.js +6 -0
- package/backend-project/node_modules/semver/ranges/intersects.js +9 -0
- package/backend-project/node_modules/semver/ranges/ltr.js +6 -0
- package/backend-project/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/backend-project/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/backend-project/node_modules/semver/ranges/min-version.js +63 -0
- package/backend-project/node_modules/semver/ranges/outside.js +82 -0
- package/backend-project/node_modules/semver/ranges/simplify.js +49 -0
- package/backend-project/node_modules/semver/ranges/subset.js +249 -0
- package/backend-project/node_modules/semver/ranges/to-comparators.js +10 -0
- package/backend-project/node_modules/semver/ranges/valid.js +13 -0
- package/backend-project/node_modules/send/HISTORY.md +538 -0
- package/backend-project/node_modules/send/LICENSE +23 -0
- package/backend-project/node_modules/send/README.md +327 -0
- package/backend-project/node_modules/send/SECURITY.md +24 -0
- package/backend-project/node_modules/send/index.js +1142 -0
- package/backend-project/node_modules/send/node_modules/ms/index.js +162 -0
- package/backend-project/node_modules/send/node_modules/ms/license.md +21 -0
- package/backend-project/node_modules/send/node_modules/ms/package.json +38 -0
- package/backend-project/node_modules/send/node_modules/ms/readme.md +59 -0
- package/backend-project/node_modules/send/package.json +62 -0
- package/backend-project/node_modules/serve-static/HISTORY.md +493 -0
- package/backend-project/node_modules/serve-static/LICENSE +25 -0
- package/backend-project/node_modules/serve-static/README.md +257 -0
- package/backend-project/node_modules/serve-static/index.js +209 -0
- package/backend-project/node_modules/serve-static/package.json +42 -0
- package/backend-project/node_modules/setprototypeof/LICENSE +13 -0
- package/backend-project/node_modules/setprototypeof/README.md +31 -0
- package/backend-project/node_modules/setprototypeof/index.d.ts +2 -0
- package/backend-project/node_modules/setprototypeof/index.js +17 -0
- package/backend-project/node_modules/setprototypeof/package.json +38 -0
- package/backend-project/node_modules/setprototypeof/test/index.js +24 -0
- package/backend-project/node_modules/side-channel/.editorconfig +9 -0
- package/backend-project/node_modules/side-channel/.eslintrc +12 -0
- package/backend-project/node_modules/side-channel/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/side-channel/.nycrc +13 -0
- package/backend-project/node_modules/side-channel/CHANGELOG.md +110 -0
- package/backend-project/node_modules/side-channel/LICENSE +21 -0
- package/backend-project/node_modules/side-channel/README.md +61 -0
- package/backend-project/node_modules/side-channel/index.d.ts +14 -0
- package/backend-project/node_modules/side-channel/index.js +43 -0
- package/backend-project/node_modules/side-channel/package.json +85 -0
- package/backend-project/node_modules/side-channel/test/index.js +104 -0
- package/backend-project/node_modules/side-channel/tsconfig.json +9 -0
- package/backend-project/node_modules/side-channel-list/.editorconfig +9 -0
- package/backend-project/node_modules/side-channel-list/.eslintrc +11 -0
- package/backend-project/node_modules/side-channel-list/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/side-channel-list/.nycrc +13 -0
- package/backend-project/node_modules/side-channel-list/CHANGELOG.md +36 -0
- package/backend-project/node_modules/side-channel-list/LICENSE +21 -0
- package/backend-project/node_modules/side-channel-list/README.md +62 -0
- package/backend-project/node_modules/side-channel-list/index.d.ts +13 -0
- package/backend-project/node_modules/side-channel-list/index.js +111 -0
- package/backend-project/node_modules/side-channel-list/list.d.ts +14 -0
- package/backend-project/node_modules/side-channel-list/package.json +77 -0
- package/backend-project/node_modules/side-channel-list/test/index.js +154 -0
- package/backend-project/node_modules/side-channel-list/tsconfig.json +9 -0
- package/backend-project/node_modules/side-channel-map/.editorconfig +9 -0
- package/backend-project/node_modules/side-channel-map/.eslintrc +11 -0
- package/backend-project/node_modules/side-channel-map/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/side-channel-map/.nycrc +13 -0
- package/backend-project/node_modules/side-channel-map/CHANGELOG.md +22 -0
- package/backend-project/node_modules/side-channel-map/LICENSE +21 -0
- package/backend-project/node_modules/side-channel-map/README.md +62 -0
- package/backend-project/node_modules/side-channel-map/index.d.ts +15 -0
- package/backend-project/node_modules/side-channel-map/index.js +68 -0
- package/backend-project/node_modules/side-channel-map/package.json +80 -0
- package/backend-project/node_modules/side-channel-map/test/index.js +114 -0
- package/backend-project/node_modules/side-channel-map/tsconfig.json +9 -0
- package/backend-project/node_modules/side-channel-weakmap/.editorconfig +9 -0
- package/backend-project/node_modules/side-channel-weakmap/.eslintrc +12 -0
- package/backend-project/node_modules/side-channel-weakmap/.github/FUNDING.yml +12 -0
- package/backend-project/node_modules/side-channel-weakmap/.nycrc +13 -0
- package/backend-project/node_modules/side-channel-weakmap/CHANGELOG.md +28 -0
- package/backend-project/node_modules/side-channel-weakmap/LICENSE +21 -0
- package/backend-project/node_modules/side-channel-weakmap/README.md +62 -0
- package/backend-project/node_modules/side-channel-weakmap/index.d.ts +15 -0
- package/backend-project/node_modules/side-channel-weakmap/index.js +84 -0
- package/backend-project/node_modules/side-channel-weakmap/package.json +87 -0
- package/backend-project/node_modules/side-channel-weakmap/test/index.js +114 -0
- package/backend-project/node_modules/side-channel-weakmap/tsconfig.json +9 -0
- package/backend-project/node_modules/sift/MIT-LICENSE.txt +20 -0
- package/backend-project/node_modules/sift/README.md +465 -0
- package/backend-project/node_modules/sift/es/index.js +626 -0
- package/backend-project/node_modules/sift/es/index.js.map +1 -0
- package/backend-project/node_modules/sift/es5m/index.js +729 -0
- package/backend-project/node_modules/sift/es5m/index.js.map +1 -0
- package/backend-project/node_modules/sift/index.d.ts +4 -0
- package/backend-project/node_modules/sift/index.js +4 -0
- package/backend-project/node_modules/sift/lib/core.d.ts +120 -0
- package/backend-project/node_modules/sift/lib/index.d.ts +6 -0
- package/backend-project/node_modules/sift/lib/index.js +766 -0
- package/backend-project/node_modules/sift/lib/index.js.map +1 -0
- package/backend-project/node_modules/sift/lib/operations.d.ts +88 -0
- package/backend-project/node_modules/sift/lib/utils.d.ts +9 -0
- package/backend-project/node_modules/sift/package.json +62 -0
- package/backend-project/node_modules/sift/sift.csp.min.js +763 -0
- package/backend-project/node_modules/sift/sift.csp.min.js.map +1 -0
- package/backend-project/node_modules/sift/sift.min.js +16 -0
- package/backend-project/node_modules/sift/sift.min.js.map +1 -0
- package/backend-project/node_modules/sift/src/core.d.ts +120 -0
- package/backend-project/node_modules/sift/src/core.js +267 -0
- package/backend-project/node_modules/sift/src/core.js.map +1 -0
- package/backend-project/node_modules/sift/src/core.ts +481 -0
- package/backend-project/node_modules/sift/src/index.d.ts +6 -0
- package/backend-project/node_modules/sift/src/index.js +38 -0
- package/backend-project/node_modules/sift/src/index.js.map +1 -0
- package/backend-project/node_modules/sift/src/index.ts +54 -0
- package/backend-project/node_modules/sift/src/operations.d.ts +88 -0
- package/backend-project/node_modules/sift/src/operations.js +297 -0
- package/backend-project/node_modules/sift/src/operations.js.map +1 -0
- package/backend-project/node_modules/sift/src/operations.ts +411 -0
- package/backend-project/node_modules/sift/src/utils.d.ts +9 -0
- package/backend-project/node_modules/sift/src/utils.js +70 -0
- package/backend-project/node_modules/sift/src/utils.js.map +1 -0
- package/backend-project/node_modules/sift/src/utils.ts +68 -0
- package/backend-project/node_modules/simple-update-notifier/LICENSE +21 -0
- package/backend-project/node_modules/simple-update-notifier/README.md +82 -0
- package/backend-project/node_modules/simple-update-notifier/build/index.d.ts +13 -0
- package/backend-project/node_modules/simple-update-notifier/build/index.js +210 -0
- package/backend-project/node_modules/simple-update-notifier/package.json +100 -0
- package/backend-project/node_modules/simple-update-notifier/src/borderedText.ts +12 -0
- package/backend-project/node_modules/simple-update-notifier/src/cache.spec.ts +17 -0
- package/backend-project/node_modules/simple-update-notifier/src/cache.ts +44 -0
- package/backend-project/node_modules/simple-update-notifier/src/getDistVersion.spec.ts +35 -0
- package/backend-project/node_modules/simple-update-notifier/src/getDistVersion.ts +29 -0
- package/backend-project/node_modules/simple-update-notifier/src/hasNewVersion.spec.ts +82 -0
- package/backend-project/node_modules/simple-update-notifier/src/hasNewVersion.ts +40 -0
- package/backend-project/node_modules/simple-update-notifier/src/index.spec.ts +27 -0
- package/backend-project/node_modules/simple-update-notifier/src/index.ts +34 -0
- package/backend-project/node_modules/simple-update-notifier/src/isNpmOrYarn.ts +12 -0
- package/backend-project/node_modules/simple-update-notifier/src/types.ts +8 -0
- package/backend-project/node_modules/smart-buffer/.prettierrc.yaml +5 -0
- package/backend-project/node_modules/smart-buffer/.travis.yml +13 -0
- package/backend-project/node_modules/smart-buffer/LICENSE +20 -0
- package/backend-project/node_modules/smart-buffer/README.md +633 -0
- package/backend-project/node_modules/smart-buffer/build/smartbuffer.js +1233 -0
- package/backend-project/node_modules/smart-buffer/build/smartbuffer.js.map +1 -0
- package/backend-project/node_modules/smart-buffer/build/utils.js +108 -0
- package/backend-project/node_modules/smart-buffer/build/utils.js.map +1 -0
- package/backend-project/node_modules/smart-buffer/docs/CHANGELOG.md +70 -0
- package/backend-project/node_modules/smart-buffer/docs/README_v3.md +367 -0
- package/backend-project/node_modules/smart-buffer/docs/ROADMAP.md +0 -0
- package/backend-project/node_modules/smart-buffer/package.json +79 -0
- package/backend-project/node_modules/smart-buffer/typings/smartbuffer.d.ts +755 -0
- package/backend-project/node_modules/smart-buffer/typings/utils.d.ts +66 -0
- package/backend-project/node_modules/socks/.eslintrc.cjs +11 -0
- package/backend-project/node_modules/socks/.prettierrc.yaml +7 -0
- package/backend-project/node_modules/socks/LICENSE +20 -0
- package/backend-project/node_modules/socks/README.md +686 -0
- package/backend-project/node_modules/socks/build/client/socksclient.js +793 -0
- package/backend-project/node_modules/socks/build/client/socksclient.js.map +1 -0
- package/backend-project/node_modules/socks/build/common/constants.js +108 -0
- package/backend-project/node_modules/socks/build/common/constants.js.map +1 -0
- package/backend-project/node_modules/socks/build/common/helpers.js +167 -0
- package/backend-project/node_modules/socks/build/common/helpers.js.map +1 -0
- package/backend-project/node_modules/socks/build/common/receivebuffer.js +43 -0
- package/backend-project/node_modules/socks/build/common/receivebuffer.js.map +1 -0
- package/backend-project/node_modules/socks/build/common/util.js +25 -0
- package/backend-project/node_modules/socks/build/common/util.js.map +1 -0
- package/backend-project/node_modules/socks/build/index.js +18 -0
- package/backend-project/node_modules/socks/build/index.js.map +1 -0
- package/backend-project/node_modules/socks/docs/examples/index.md +17 -0
- package/backend-project/node_modules/socks/docs/examples/javascript/associateExample.md +90 -0
- package/backend-project/node_modules/socks/docs/examples/javascript/bindExample.md +83 -0
- package/backend-project/node_modules/socks/docs/examples/javascript/connectExample.md +258 -0
- package/backend-project/node_modules/socks/docs/examples/typescript/associateExample.md +93 -0
- package/backend-project/node_modules/socks/docs/examples/typescript/bindExample.md +86 -0
- package/backend-project/node_modules/socks/docs/examples/typescript/connectExample.md +265 -0
- package/backend-project/node_modules/socks/docs/index.md +5 -0
- package/backend-project/node_modules/socks/docs/migratingFromV1.md +86 -0
- package/backend-project/node_modules/socks/package.json +58 -0
- package/backend-project/node_modules/socks/typings/client/socksclient.d.ts +162 -0
- package/backend-project/node_modules/socks/typings/common/constants.d.ts +151 -0
- package/backend-project/node_modules/socks/typings/common/helpers.d.ts +17 -0
- package/backend-project/node_modules/socks/typings/common/receivebuffer.d.ts +12 -0
- package/backend-project/node_modules/socks/typings/common/util.d.ts +14 -0
- package/backend-project/node_modules/socks/typings/index.d.ts +1 -0
- package/backend-project/node_modules/sparse-bitfield/.travis.yml +6 -0
- package/backend-project/node_modules/sparse-bitfield/LICENSE +21 -0
- package/backend-project/node_modules/sparse-bitfield/README.md +62 -0
- package/backend-project/node_modules/sparse-bitfield/index.js +95 -0
- package/backend-project/node_modules/sparse-bitfield/package.json +27 -0
- package/backend-project/node_modules/sparse-bitfield/test.js +79 -0
- package/backend-project/node_modules/statuses/HISTORY.md +87 -0
- package/backend-project/node_modules/statuses/LICENSE +23 -0
- package/backend-project/node_modules/statuses/README.md +139 -0
- package/backend-project/node_modules/statuses/codes.json +65 -0
- package/backend-project/node_modules/statuses/index.js +146 -0
- package/backend-project/node_modules/statuses/package.json +49 -0
- package/backend-project/node_modules/supports-color/browser.js +5 -0
- package/backend-project/node_modules/supports-color/index.js +131 -0
- package/backend-project/node_modules/supports-color/license +9 -0
- package/backend-project/node_modules/supports-color/package.json +53 -0
- package/backend-project/node_modules/supports-color/readme.md +66 -0
- package/backend-project/node_modules/to-regex-range/LICENSE +21 -0
- package/backend-project/node_modules/to-regex-range/README.md +305 -0
- package/backend-project/node_modules/to-regex-range/index.js +288 -0
- package/backend-project/node_modules/to-regex-range/package.json +88 -0
- package/backend-project/node_modules/toidentifier/HISTORY.md +9 -0
- package/backend-project/node_modules/toidentifier/LICENSE +21 -0
- package/backend-project/node_modules/toidentifier/README.md +61 -0
- package/backend-project/node_modules/toidentifier/index.js +32 -0
- package/backend-project/node_modules/toidentifier/package.json +38 -0
- package/backend-project/node_modules/touch/LICENSE +15 -0
- package/backend-project/node_modules/touch/README.md +52 -0
- package/backend-project/node_modules/touch/bin/nodetouch.js +112 -0
- package/backend-project/node_modules/touch/index.js +224 -0
- package/backend-project/node_modules/touch/package.json +25 -0
- package/backend-project/node_modules/tr46/LICENSE.md +21 -0
- package/backend-project/node_modules/tr46/README.md +78 -0
- package/backend-project/node_modules/tr46/index.js +298 -0
- package/backend-project/node_modules/tr46/lib/mappingTable.json +1 -0
- package/backend-project/node_modules/tr46/lib/regexes.js +29 -0
- package/backend-project/node_modules/tr46/lib/statusMapping.js +11 -0
- package/backend-project/node_modules/tr46/package.json +47 -0
- package/backend-project/node_modules/type-is/HISTORY.md +259 -0
- package/backend-project/node_modules/type-is/LICENSE +23 -0
- package/backend-project/node_modules/type-is/README.md +170 -0
- package/backend-project/node_modules/type-is/index.js +266 -0
- package/backend-project/node_modules/type-is/package.json +45 -0
- package/backend-project/node_modules/undefsafe/.github/workflows/release.yml +25 -0
- package/backend-project/node_modules/undefsafe/.jscsrc +13 -0
- package/backend-project/node_modules/undefsafe/.jshintrc +16 -0
- package/backend-project/node_modules/undefsafe/.travis.yml +18 -0
- package/backend-project/node_modules/undefsafe/LICENSE +22 -0
- package/backend-project/node_modules/undefsafe/README.md +63 -0
- package/backend-project/node_modules/undefsafe/example.js +14 -0
- package/backend-project/node_modules/undefsafe/lib/undefsafe.js +125 -0
- package/backend-project/node_modules/undefsafe/package.json +34 -0
- package/backend-project/node_modules/undici-types/LICENSE +21 -0
- package/backend-project/node_modules/undici-types/README.md +6 -0
- package/backend-project/node_modules/undici-types/agent.d.ts +32 -0
- package/backend-project/node_modules/undici-types/api.d.ts +43 -0
- package/backend-project/node_modules/undici-types/balanced-pool.d.ts +30 -0
- package/backend-project/node_modules/undici-types/cache-interceptor.d.ts +179 -0
- package/backend-project/node_modules/undici-types/cache.d.ts +36 -0
- package/backend-project/node_modules/undici-types/client-stats.d.ts +15 -0
- package/backend-project/node_modules/undici-types/client.d.ts +123 -0
- package/backend-project/node_modules/undici-types/connector.d.ts +36 -0
- package/backend-project/node_modules/undici-types/content-type.d.ts +21 -0
- package/backend-project/node_modules/undici-types/cookies.d.ts +30 -0
- package/backend-project/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
- package/backend-project/node_modules/undici-types/dispatcher.d.ts +279 -0
- package/backend-project/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
- package/backend-project/node_modules/undici-types/errors.d.ts +177 -0
- package/backend-project/node_modules/undici-types/eventsource.d.ts +66 -0
- package/backend-project/node_modules/undici-types/fetch.d.ts +211 -0
- package/backend-project/node_modules/undici-types/formdata.d.ts +108 -0
- package/backend-project/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/backend-project/node_modules/undici-types/global-origin.d.ts +7 -0
- package/backend-project/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/backend-project/node_modules/undici-types/handlers.d.ts +15 -0
- package/backend-project/node_modules/undici-types/header.d.ts +160 -0
- package/backend-project/node_modules/undici-types/index.d.ts +91 -0
- package/backend-project/node_modules/undici-types/interceptors.d.ts +80 -0
- package/backend-project/node_modules/undici-types/mock-agent.d.ts +68 -0
- package/backend-project/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/backend-project/node_modules/undici-types/mock-client.d.ts +27 -0
- package/backend-project/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/backend-project/node_modules/undici-types/mock-interceptor.d.ts +94 -0
- package/backend-project/node_modules/undici-types/mock-pool.d.ts +27 -0
- package/backend-project/node_modules/undici-types/package.json +55 -0
- package/backend-project/node_modules/undici-types/patch.d.ts +29 -0
- package/backend-project/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/backend-project/node_modules/undici-types/pool.d.ts +41 -0
- package/backend-project/node_modules/undici-types/proxy-agent.d.ts +29 -0
- package/backend-project/node_modules/undici-types/readable.d.ts +68 -0
- package/backend-project/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/backend-project/node_modules/undici-types/retry-handler.d.ts +125 -0
- package/backend-project/node_modules/undici-types/round-robin-pool.d.ts +41 -0
- package/backend-project/node_modules/undici-types/snapshot-agent.d.ts +109 -0
- package/backend-project/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
- package/backend-project/node_modules/undici-types/util.d.ts +18 -0
- package/backend-project/node_modules/undici-types/utility.d.ts +7 -0
- package/backend-project/node_modules/undici-types/webidl.d.ts +347 -0
- package/backend-project/node_modules/undici-types/websocket.d.ts +188 -0
- package/backend-project/node_modules/unpipe/HISTORY.md +4 -0
- package/backend-project/node_modules/unpipe/LICENSE +22 -0
- package/backend-project/node_modules/unpipe/README.md +43 -0
- package/backend-project/node_modules/unpipe/index.js +69 -0
- package/backend-project/node_modules/unpipe/package.json +27 -0
- package/backend-project/node_modules/utils-merge/LICENSE +20 -0
- package/backend-project/node_modules/utils-merge/README.md +34 -0
- package/backend-project/node_modules/utils-merge/index.js +23 -0
- package/backend-project/node_modules/utils-merge/package.json +40 -0
- package/backend-project/node_modules/vary/HISTORY.md +39 -0
- package/backend-project/node_modules/vary/LICENSE +22 -0
- package/backend-project/node_modules/vary/README.md +101 -0
- package/backend-project/node_modules/vary/index.js +149 -0
- package/backend-project/node_modules/vary/package.json +43 -0
- package/backend-project/node_modules/webidl-conversions/LICENSE.md +12 -0
- package/backend-project/node_modules/webidl-conversions/README.md +99 -0
- package/backend-project/node_modules/webidl-conversions/lib/index.js +450 -0
- package/backend-project/node_modules/webidl-conversions/package.json +35 -0
- package/backend-project/node_modules/whatwg-url/LICENSE.txt +21 -0
- package/backend-project/node_modules/whatwg-url/README.md +106 -0
- package/backend-project/node_modules/whatwg-url/index.js +27 -0
- package/backend-project/node_modules/whatwg-url/lib/Function.js +42 -0
- package/backend-project/node_modules/whatwg-url/lib/URL-impl.js +209 -0
- package/backend-project/node_modules/whatwg-url/lib/URL.js +442 -0
- package/backend-project/node_modules/whatwg-url/lib/URLSearchParams-impl.js +130 -0
- package/backend-project/node_modules/whatwg-url/lib/URLSearchParams.js +472 -0
- package/backend-project/node_modules/whatwg-url/lib/VoidFunction.js +26 -0
- package/backend-project/node_modules/whatwg-url/lib/encoding.js +16 -0
- package/backend-project/node_modules/whatwg-url/lib/infra.js +26 -0
- package/backend-project/node_modules/whatwg-url/lib/percent-encoding.js +142 -0
- package/backend-project/node_modules/whatwg-url/lib/url-state-machine.js +1244 -0
- package/backend-project/node_modules/whatwg-url/lib/urlencoded.js +106 -0
- package/backend-project/node_modules/whatwg-url/lib/utils.js +190 -0
- package/backend-project/node_modules/whatwg-url/package.json +58 -0
- package/backend-project/node_modules/whatwg-url/webidl2js-wrapper.js +7 -0
- package/backend-project/package-lock.json +1640 -0
- package/backend-project/package.json +29 -0
- package/backend-project/routes/auth.js +8 -0
- package/backend-project/routes/products.js +10 -0
- package/backend-project/routes/reports.js +11 -0
- package/backend-project/routes/transactions.js +12 -0
- package/backend-project/routes/warehouses.js +10 -0
- package/backend-project/server.js +49 -0
- package/bin/stockhub.js +44 -0
- package/frontend-project/package.json +41 -0
- package/frontend-project/postcss.config.js +6 -0
- package/frontend-project/public/index.html +14 -0
- package/frontend-project/src/App.js +59 -0
- package/frontend-project/src/components/Auth/Login.js +116 -0
- package/frontend-project/src/components/Auth/Register.js +142 -0
- package/frontend-project/src/components/Dashboard/Dashboard.js +183 -0
- package/frontend-project/src/components/Layout/Layout.js +162 -0
- package/frontend-project/src/components/Products/Products.js +253 -0
- package/frontend-project/src/components/Reports/Reports.js +312 -0
- package/frontend-project/src/components/Transactions/Transactions.js +310 -0
- package/frontend-project/src/components/Warehouses/Warehouses.js +178 -0
- package/frontend-project/src/index.css +30 -0
- package/frontend-project/src/index.js +11 -0
- package/frontend-project/src/services/api.js +76 -0
- package/frontend-project/tailwind.config.js +19 -0
- package/package.json +49 -0
- package/setup.js +157 -0
|
@@ -0,0 +1,2780 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/*!
|
|
4
|
+
* Module dependencies.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const EventEmitter = require('events').EventEmitter;
|
|
8
|
+
const Kareem = require('kareem');
|
|
9
|
+
const MongooseError = require('./error/mongooseError');
|
|
10
|
+
const SchemaType = require('./schematype');
|
|
11
|
+
const SchemaTypeOptions = require('./options/SchemaTypeOptions');
|
|
12
|
+
const VirtualOptions = require('./options/VirtualOptions');
|
|
13
|
+
const VirtualType = require('./virtualtype');
|
|
14
|
+
const addAutoId = require('./helpers/schema/addAutoId');
|
|
15
|
+
const clone = require('./helpers/clone');
|
|
16
|
+
const get = require('./helpers/get');
|
|
17
|
+
const getConstructorName = require('./helpers/getConstructorName');
|
|
18
|
+
const getIndexes = require('./helpers/schema/getIndexes');
|
|
19
|
+
const handleReadPreferenceAliases = require('./helpers/query/handleReadPreferenceAliases');
|
|
20
|
+
const idGetter = require('./helpers/schema/idGetter');
|
|
21
|
+
const merge = require('./helpers/schema/merge');
|
|
22
|
+
const mpath = require('mpath');
|
|
23
|
+
const setupTimestamps = require('./helpers/timestamps/setupTimestamps');
|
|
24
|
+
const utils = require('./utils');
|
|
25
|
+
const validateRef = require('./helpers/populate/validateRef');
|
|
26
|
+
const util = require('util');
|
|
27
|
+
|
|
28
|
+
const hasNumericSubpathRegex = /\.\d+(\.|$)/;
|
|
29
|
+
|
|
30
|
+
let MongooseTypes;
|
|
31
|
+
|
|
32
|
+
const queryHooks = require('./helpers/query/applyQueryMiddleware').
|
|
33
|
+
middlewareFunctions;
|
|
34
|
+
const documentHooks = require('./helpers/model/applyHooks').middlewareFunctions;
|
|
35
|
+
const hookNames = queryHooks.concat(documentHooks).
|
|
36
|
+
reduce((s, hook) => s.add(hook), new Set());
|
|
37
|
+
|
|
38
|
+
const isPOJO = utils.isPOJO;
|
|
39
|
+
|
|
40
|
+
let id = 0;
|
|
41
|
+
|
|
42
|
+
const numberRE = /^\d+$/;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Schema constructor.
|
|
46
|
+
*
|
|
47
|
+
* #### Example:
|
|
48
|
+
*
|
|
49
|
+
* const child = new Schema({ name: String });
|
|
50
|
+
* const schema = new Schema({ name: String, age: Number, children: [child] });
|
|
51
|
+
* const Tree = mongoose.model('Tree', schema);
|
|
52
|
+
*
|
|
53
|
+
* // setting schema options
|
|
54
|
+
* new Schema({ name: String }, { _id: false, autoIndex: false })
|
|
55
|
+
*
|
|
56
|
+
* #### Options:
|
|
57
|
+
*
|
|
58
|
+
* - [autoIndex](https://mongoosejs.com/docs/guide.html#autoIndex): bool - defaults to null (which means use the connection's autoIndex option)
|
|
59
|
+
* - [autoCreate](https://mongoosejs.com/docs/guide.html#autoCreate): bool - defaults to null (which means use the connection's autoCreate option)
|
|
60
|
+
* - [bufferCommands](https://mongoosejs.com/docs/guide.html#bufferCommands): bool - defaults to true
|
|
61
|
+
* - [bufferTimeoutMS](https://mongoosejs.com/docs/guide.html#bufferTimeoutMS): number - defaults to 10000 (10 seconds). If `bufferCommands` is enabled, the amount of time Mongoose will wait for connectivity to be restablished before erroring out.
|
|
62
|
+
* - [capped](https://mongoosejs.com/docs/guide.html#capped): bool | number | object - defaults to false
|
|
63
|
+
* - [collection](https://mongoosejs.com/docs/guide.html#collection): string - no default
|
|
64
|
+
* - [discriminatorKey](https://mongoosejs.com/docs/guide.html#discriminatorKey): string - defaults to `__t`
|
|
65
|
+
* - [id](https://mongoosejs.com/docs/guide.html#id): bool - defaults to true
|
|
66
|
+
* - [_id](https://mongoosejs.com/docs/guide.html#_id): bool - defaults to true
|
|
67
|
+
* - [minimize](https://mongoosejs.com/docs/guide.html#minimize): bool - controls [document#toObject](https://mongoosejs.com/docs/api/document.html#Document.prototype.toObject()) behavior when called manually - defaults to true
|
|
68
|
+
* - [read](https://mongoosejs.com/docs/guide.html#read): string
|
|
69
|
+
* - [writeConcern](https://mongoosejs.com/docs/guide.html#writeConcern): object - defaults to null, use to override [the MongoDB server's default write concern settings](https://www.mongodb.com/docs/manual/reference/write-concern/)
|
|
70
|
+
* - [shardKey](https://mongoosejs.com/docs/guide.html#shardKey): object - defaults to `null`
|
|
71
|
+
* - [strict](https://mongoosejs.com/docs/guide.html#strict): bool - defaults to true
|
|
72
|
+
* - [strictQuery](https://mongoosejs.com/docs/guide.html#strictQuery): bool - defaults to false
|
|
73
|
+
* - [toJSON](https://mongoosejs.com/docs/guide.html#toJSON) - object - no default
|
|
74
|
+
* - [toObject](https://mongoosejs.com/docs/guide.html#toObject) - object - no default
|
|
75
|
+
* - [typeKey](https://mongoosejs.com/docs/guide.html#typeKey) - string - defaults to 'type'
|
|
76
|
+
* - [validateBeforeSave](https://mongoosejs.com/docs/guide.html#validateBeforeSave) - bool - defaults to `true`
|
|
77
|
+
* - [validateModifiedOnly](https://mongoosejs.com/docs/api/document.html#Document.prototype.validate()) - bool - defaults to `false`
|
|
78
|
+
* - [versionKey](https://mongoosejs.com/docs/guide.html#versionKey): string or object - defaults to "__v"
|
|
79
|
+
* - [optimisticConcurrency](https://mongoosejs.com/docs/guide.html#optimisticConcurrency): bool - defaults to false. Set to true to enable [optimistic concurrency](https://thecodebarbarian.com/whats-new-in-mongoose-5-10-optimistic-concurrency.html).
|
|
80
|
+
* - [collation](https://mongoosejs.com/docs/guide.html#collation): object - defaults to null (which means use no collation)
|
|
81
|
+
* - [timeseries](https://mongoosejs.com/docs/guide.html#timeseries): object - defaults to null (which means this schema's collection won't be a timeseries collection)
|
|
82
|
+
* - [selectPopulatedPaths](https://mongoosejs.com/docs/guide.html#selectPopulatedPaths): boolean - defaults to `true`
|
|
83
|
+
* - [skipVersioning](https://mongoosejs.com/docs/guide.html#skipVersioning): object - paths to exclude from versioning
|
|
84
|
+
* - [timestamps](https://mongoosejs.com/docs/guide.html#timestamps): object or boolean - defaults to `false`. If true, Mongoose adds `createdAt` and `updatedAt` properties to your schema and manages those properties for you.
|
|
85
|
+
* - [pluginTags](https://mongoosejs.com/docs/guide.html#pluginTags): array of strings - defaults to `undefined`. If set and plugin called with `tags` option, will only apply that plugin to schemas with a matching tag.
|
|
86
|
+
* - [virtuals](https://mongoosejs.com/docs/tutorials/virtuals.html#virtuals-via-schema-options): object - virtuals to define, alias for [`.virtual`](https://mongoosejs.com/docs/api/schema.html#Schema.prototype.virtual())
|
|
87
|
+
* - [collectionOptions]: object with options passed to [`createCollection()`](https://www.mongodb.com/docs/manual/reference/method/db.createCollection/) when calling `Model.createCollection()` or `autoCreate` set to true.
|
|
88
|
+
*
|
|
89
|
+
* #### Options for Nested Schemas:
|
|
90
|
+
*
|
|
91
|
+
* - `excludeIndexes`: bool - defaults to `false`. If `true`, skip building indexes on this schema's paths.
|
|
92
|
+
*
|
|
93
|
+
* #### Note:
|
|
94
|
+
*
|
|
95
|
+
* _When nesting schemas, (`children` in the example above), always declare the child schema first before passing it into its parent._
|
|
96
|
+
*
|
|
97
|
+
* @param {Object|Schema|Array} [definition] Can be one of: object describing schema paths, or schema to copy, or array of objects and schemas
|
|
98
|
+
* @param {Object} [options]
|
|
99
|
+
* @inherits NodeJS EventEmitter https://nodejs.org/api/events.html#class-eventemitter
|
|
100
|
+
* @event `init`: Emitted after the schema is compiled into a `Model`.
|
|
101
|
+
* @api public
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
function Schema(obj, options) {
|
|
105
|
+
if (!(this instanceof Schema)) {
|
|
106
|
+
return new Schema(obj, options);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
this.obj = obj;
|
|
110
|
+
this.paths = {};
|
|
111
|
+
this.aliases = {};
|
|
112
|
+
this.subpaths = {};
|
|
113
|
+
this.virtuals = {};
|
|
114
|
+
this.singleNestedPaths = {};
|
|
115
|
+
this.nested = {};
|
|
116
|
+
this.inherits = {};
|
|
117
|
+
this.callQueue = [];
|
|
118
|
+
this._indexes = [];
|
|
119
|
+
this.methods = (options && options.methods) || {};
|
|
120
|
+
this.methodOptions = {};
|
|
121
|
+
this.statics = (options && options.statics) || {};
|
|
122
|
+
this.tree = {};
|
|
123
|
+
this.query = (options && options.query) || {};
|
|
124
|
+
this.childSchemas = [];
|
|
125
|
+
this.plugins = [];
|
|
126
|
+
// For internal debugging. Do not use this to try to save a schema in MDB.
|
|
127
|
+
this.$id = ++id;
|
|
128
|
+
this.mapPaths = [];
|
|
129
|
+
|
|
130
|
+
this.s = {
|
|
131
|
+
hooks: new Kareem()
|
|
132
|
+
};
|
|
133
|
+
this.options = this.defaultOptions(options);
|
|
134
|
+
|
|
135
|
+
// build paths
|
|
136
|
+
if (Array.isArray(obj)) {
|
|
137
|
+
for (const definition of obj) {
|
|
138
|
+
this.add(definition);
|
|
139
|
+
}
|
|
140
|
+
} else if (obj) {
|
|
141
|
+
this.add(obj);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// build virtual paths
|
|
145
|
+
if (options && options.virtuals) {
|
|
146
|
+
const virtuals = options.virtuals;
|
|
147
|
+
const pathNames = Object.keys(virtuals);
|
|
148
|
+
for (const pathName of pathNames) {
|
|
149
|
+
const pathOptions = virtuals[pathName].options ? virtuals[pathName].options : undefined;
|
|
150
|
+
const virtual = this.virtual(pathName, pathOptions);
|
|
151
|
+
|
|
152
|
+
if (virtuals[pathName].get) {
|
|
153
|
+
virtual.get(virtuals[pathName].get);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (virtuals[pathName].set) {
|
|
157
|
+
virtual.set(virtuals[pathName].set);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// check if _id's value is a subdocument (gh-2276)
|
|
163
|
+
const _idSubDoc = obj && obj._id && utils.isObject(obj._id);
|
|
164
|
+
|
|
165
|
+
// ensure the documents get an auto _id unless disabled
|
|
166
|
+
const auto_id = !this.paths['_id'] &&
|
|
167
|
+
(this.options._id) && !_idSubDoc;
|
|
168
|
+
|
|
169
|
+
if (auto_id) {
|
|
170
|
+
addAutoId(this);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
this.setupTimestamp(this.options.timestamps);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Create virtual properties with alias field
|
|
178
|
+
* @api private
|
|
179
|
+
*/
|
|
180
|
+
function aliasFields(schema, paths) {
|
|
181
|
+
for (const path of Object.keys(paths)) {
|
|
182
|
+
let alias = null;
|
|
183
|
+
if (paths[path] != null) {
|
|
184
|
+
alias = paths[path];
|
|
185
|
+
} else {
|
|
186
|
+
const options = get(schema.paths[path], 'options');
|
|
187
|
+
if (options == null) {
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
alias = options.alias;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (!alias) {
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const prop = schema.paths[path].path;
|
|
199
|
+
if (Array.isArray(alias)) {
|
|
200
|
+
for (const a of alias) {
|
|
201
|
+
if (typeof a !== 'string') {
|
|
202
|
+
throw new Error('Invalid value for alias option on ' + prop + ', got ' + a);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
schema.aliases[a] = prop;
|
|
206
|
+
|
|
207
|
+
schema.
|
|
208
|
+
virtual(a).
|
|
209
|
+
get((function(p) {
|
|
210
|
+
return function() {
|
|
211
|
+
if (typeof this.get === 'function') {
|
|
212
|
+
return this.get(p);
|
|
213
|
+
}
|
|
214
|
+
return this[p];
|
|
215
|
+
};
|
|
216
|
+
})(prop)).
|
|
217
|
+
set((function(p) {
|
|
218
|
+
return function(v) {
|
|
219
|
+
return this.$set(p, v);
|
|
220
|
+
};
|
|
221
|
+
})(prop));
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (typeof alias !== 'string') {
|
|
228
|
+
throw new Error('Invalid value for alias option on ' + prop + ', got ' + alias);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
schema.aliases[alias] = prop;
|
|
232
|
+
|
|
233
|
+
schema.
|
|
234
|
+
virtual(alias).
|
|
235
|
+
get((function(p) {
|
|
236
|
+
return function() {
|
|
237
|
+
if (typeof this.get === 'function') {
|
|
238
|
+
return this.get(p);
|
|
239
|
+
}
|
|
240
|
+
return this[p];
|
|
241
|
+
};
|
|
242
|
+
})(prop)).
|
|
243
|
+
set((function(p) {
|
|
244
|
+
return function(v) {
|
|
245
|
+
return this.$set(p, v);
|
|
246
|
+
};
|
|
247
|
+
})(prop));
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/*!
|
|
252
|
+
* Inherit from EventEmitter.
|
|
253
|
+
*/
|
|
254
|
+
Schema.prototype = Object.create(EventEmitter.prototype);
|
|
255
|
+
Schema.prototype.constructor = Schema;
|
|
256
|
+
Schema.prototype.instanceOfSchema = true;
|
|
257
|
+
|
|
258
|
+
/*!
|
|
259
|
+
* ignore
|
|
260
|
+
*/
|
|
261
|
+
|
|
262
|
+
Object.defineProperty(Schema.prototype, '$schemaType', {
|
|
263
|
+
configurable: false,
|
|
264
|
+
enumerable: false,
|
|
265
|
+
writable: true
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Array of child schemas (from document arrays and single nested subdocs)
|
|
270
|
+
* and their corresponding compiled models. Each element of the array is
|
|
271
|
+
* an object with 2 properties: `schema` and `model`.
|
|
272
|
+
*
|
|
273
|
+
* This property is typically only useful for plugin authors and advanced users.
|
|
274
|
+
* You do not need to interact with this property at all to use mongoose.
|
|
275
|
+
*
|
|
276
|
+
* @api public
|
|
277
|
+
* @property childSchemas
|
|
278
|
+
* @memberOf Schema
|
|
279
|
+
* @instance
|
|
280
|
+
*/
|
|
281
|
+
|
|
282
|
+
Object.defineProperty(Schema.prototype, 'childSchemas', {
|
|
283
|
+
configurable: false,
|
|
284
|
+
enumerable: true,
|
|
285
|
+
writable: true
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Object containing all virtuals defined on this schema.
|
|
290
|
+
* The objects' keys are the virtual paths and values are instances of `VirtualType`.
|
|
291
|
+
*
|
|
292
|
+
* This property is typically only useful for plugin authors and advanced users.
|
|
293
|
+
* You do not need to interact with this property at all to use mongoose.
|
|
294
|
+
*
|
|
295
|
+
* #### Example:
|
|
296
|
+
*
|
|
297
|
+
* const schema = new Schema({});
|
|
298
|
+
* schema.virtual('answer').get(() => 42);
|
|
299
|
+
*
|
|
300
|
+
* console.log(schema.virtuals); // { answer: VirtualType { path: 'answer', ... } }
|
|
301
|
+
* console.log(schema.virtuals['answer'].getters[0].call()); // 42
|
|
302
|
+
*
|
|
303
|
+
* @api public
|
|
304
|
+
* @property virtuals
|
|
305
|
+
* @memberOf Schema
|
|
306
|
+
* @instance
|
|
307
|
+
*/
|
|
308
|
+
|
|
309
|
+
Object.defineProperty(Schema.prototype, 'virtuals', {
|
|
310
|
+
configurable: false,
|
|
311
|
+
enumerable: true,
|
|
312
|
+
writable: true
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* The original object passed to the schema constructor
|
|
317
|
+
*
|
|
318
|
+
* #### Example:
|
|
319
|
+
*
|
|
320
|
+
* const schema = new Schema({ a: String }).add({ b: String });
|
|
321
|
+
* schema.obj; // { a: String }
|
|
322
|
+
*
|
|
323
|
+
* @api public
|
|
324
|
+
* @property obj
|
|
325
|
+
* @memberOf Schema
|
|
326
|
+
* @instance
|
|
327
|
+
*/
|
|
328
|
+
|
|
329
|
+
Schema.prototype.obj;
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* The paths defined on this schema. The keys are the top-level paths
|
|
333
|
+
* in this schema, and the values are instances of the SchemaType class.
|
|
334
|
+
*
|
|
335
|
+
* #### Example:
|
|
336
|
+
*
|
|
337
|
+
* const schema = new Schema({ name: String }, { _id: false });
|
|
338
|
+
* schema.paths; // { name: SchemaString { ... } }
|
|
339
|
+
*
|
|
340
|
+
* schema.add({ age: Number });
|
|
341
|
+
* schema.paths; // { name: SchemaString { ... }, age: SchemaNumber { ... } }
|
|
342
|
+
*
|
|
343
|
+
* @api public
|
|
344
|
+
* @property paths
|
|
345
|
+
* @memberOf Schema
|
|
346
|
+
* @instance
|
|
347
|
+
*/
|
|
348
|
+
|
|
349
|
+
Schema.prototype.paths;
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Schema as a tree
|
|
353
|
+
*
|
|
354
|
+
* #### Example:
|
|
355
|
+
*
|
|
356
|
+
* {
|
|
357
|
+
* '_id' : ObjectId
|
|
358
|
+
* , 'nested' : {
|
|
359
|
+
* 'key' : String
|
|
360
|
+
* }
|
|
361
|
+
* }
|
|
362
|
+
*
|
|
363
|
+
* @api private
|
|
364
|
+
* @property tree
|
|
365
|
+
* @memberOf Schema
|
|
366
|
+
* @instance
|
|
367
|
+
*/
|
|
368
|
+
|
|
369
|
+
Schema.prototype.tree;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Returns a deep copy of the schema
|
|
373
|
+
*
|
|
374
|
+
* #### Example:
|
|
375
|
+
*
|
|
376
|
+
* const schema = new Schema({ name: String });
|
|
377
|
+
* const clone = schema.clone();
|
|
378
|
+
* clone === schema; // false
|
|
379
|
+
* clone.path('name'); // SchemaString { ... }
|
|
380
|
+
*
|
|
381
|
+
* @return {Schema} the cloned schema
|
|
382
|
+
* @api public
|
|
383
|
+
* @memberOf Schema
|
|
384
|
+
* @instance
|
|
385
|
+
*/
|
|
386
|
+
|
|
387
|
+
Schema.prototype.clone = function() {
|
|
388
|
+
const s = this._clone();
|
|
389
|
+
|
|
390
|
+
// Bubble up `init` for backwards compat
|
|
391
|
+
s.on('init', v => this.emit('init', v));
|
|
392
|
+
|
|
393
|
+
return s;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
/*!
|
|
397
|
+
* ignore
|
|
398
|
+
*/
|
|
399
|
+
|
|
400
|
+
Schema.prototype._clone = function _clone(Constructor) {
|
|
401
|
+
Constructor = Constructor || (this.base == null ? Schema : this.base.Schema);
|
|
402
|
+
|
|
403
|
+
const s = new Constructor({}, this._userProvidedOptions);
|
|
404
|
+
s.base = this.base;
|
|
405
|
+
s.obj = this.obj;
|
|
406
|
+
s.options = clone(this.options);
|
|
407
|
+
s.callQueue = this.callQueue.map(function(f) { return f; });
|
|
408
|
+
s.methods = clone(this.methods);
|
|
409
|
+
s.methodOptions = clone(this.methodOptions);
|
|
410
|
+
s.statics = clone(this.statics);
|
|
411
|
+
s.query = clone(this.query);
|
|
412
|
+
s.plugins = Array.prototype.slice.call(this.plugins);
|
|
413
|
+
s._indexes = clone(this._indexes);
|
|
414
|
+
s.s.hooks = this.s.hooks.clone();
|
|
415
|
+
|
|
416
|
+
s.tree = clone(this.tree);
|
|
417
|
+
s.paths = Object.fromEntries(
|
|
418
|
+
Object.entries(this.paths).map(([key, value]) => ([key, value.clone()]))
|
|
419
|
+
);
|
|
420
|
+
s.nested = clone(this.nested);
|
|
421
|
+
s.subpaths = clone(this.subpaths);
|
|
422
|
+
for (const schemaType of Object.values(s.paths)) {
|
|
423
|
+
if (schemaType.$isSingleNested) {
|
|
424
|
+
const path = schemaType.path;
|
|
425
|
+
for (const key of Object.keys(schemaType.schema.paths)) {
|
|
426
|
+
s.singleNestedPaths[path + '.' + key] = schemaType.schema.paths[key];
|
|
427
|
+
}
|
|
428
|
+
for (const key of Object.keys(schemaType.schema.singleNestedPaths)) {
|
|
429
|
+
s.singleNestedPaths[path + '.' + key] =
|
|
430
|
+
schemaType.schema.singleNestedPaths[key];
|
|
431
|
+
}
|
|
432
|
+
for (const key of Object.keys(schemaType.schema.subpaths)) {
|
|
433
|
+
s.singleNestedPaths[path + '.' + key] =
|
|
434
|
+
schemaType.schema.subpaths[key];
|
|
435
|
+
}
|
|
436
|
+
for (const key of Object.keys(schemaType.schema.nested)) {
|
|
437
|
+
s.singleNestedPaths[path + '.' + key] = 'nested';
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
s.childSchemas = gatherChildSchemas(s);
|
|
442
|
+
|
|
443
|
+
s.virtuals = clone(this.virtuals);
|
|
444
|
+
s.$globalPluginsApplied = this.$globalPluginsApplied;
|
|
445
|
+
s.$isRootDiscriminator = this.$isRootDiscriminator;
|
|
446
|
+
s.$implicitlyCreated = this.$implicitlyCreated;
|
|
447
|
+
s.$id = ++id;
|
|
448
|
+
s.$originalSchemaId = this.$id;
|
|
449
|
+
s.mapPaths = [].concat(this.mapPaths);
|
|
450
|
+
|
|
451
|
+
if (this.discriminatorMapping != null) {
|
|
452
|
+
s.discriminatorMapping = Object.assign({}, this.discriminatorMapping);
|
|
453
|
+
}
|
|
454
|
+
if (this.discriminators != null) {
|
|
455
|
+
s.discriminators = Object.assign({}, this.discriminators);
|
|
456
|
+
}
|
|
457
|
+
if (this._applyDiscriminators != null) {
|
|
458
|
+
s._applyDiscriminators = new Map(this._applyDiscriminators);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
s.aliases = Object.assign({}, this.aliases);
|
|
462
|
+
|
|
463
|
+
return s;
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Returns a new schema that has the picked `paths` from this schema.
|
|
468
|
+
*
|
|
469
|
+
* This method is analagous to [Lodash's `pick()` function](https://lodash.com/docs/4.17.15#pick) for Mongoose schemas.
|
|
470
|
+
*
|
|
471
|
+
* #### Example:
|
|
472
|
+
*
|
|
473
|
+
* const schema = Schema({ name: String, age: Number });
|
|
474
|
+
* // Creates a new schema with the same `name` path as `schema`,
|
|
475
|
+
* // but no `age` path.
|
|
476
|
+
* const newSchema = schema.pick(['name']);
|
|
477
|
+
*
|
|
478
|
+
* newSchema.path('name'); // SchemaString { ... }
|
|
479
|
+
* newSchema.path('age'); // undefined
|
|
480
|
+
*
|
|
481
|
+
* @param {String[]} paths List of Paths to pick for the new Schema
|
|
482
|
+
* @param {Object} [options] Options to pass to the new Schema Constructor (same as `new Schema(.., Options)`). Defaults to `this.options` if not set.
|
|
483
|
+
* @return {Schema}
|
|
484
|
+
* @api public
|
|
485
|
+
*/
|
|
486
|
+
|
|
487
|
+
Schema.prototype.pick = function(paths, options) {
|
|
488
|
+
const newSchema = new Schema({}, options || this.options);
|
|
489
|
+
if (!Array.isArray(paths)) {
|
|
490
|
+
throw new MongooseError('Schema#pick() only accepts an array argument, ' +
|
|
491
|
+
'got "' + typeof paths + '"');
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
for (const path of paths) {
|
|
495
|
+
if (this.nested[path]) {
|
|
496
|
+
newSchema.add({ [path]: get(this.tree, path) });
|
|
497
|
+
} else {
|
|
498
|
+
const schematype = this.path(path);
|
|
499
|
+
if (schematype == null) {
|
|
500
|
+
throw new MongooseError('Path `' + path + '` is not in the schema');
|
|
501
|
+
}
|
|
502
|
+
newSchema.add({ [path]: schematype });
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
return newSchema;
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Returns a new schema that has the `paths` from the original schema, minus the omitted ones.
|
|
511
|
+
*
|
|
512
|
+
* This method is analagous to [Lodash's `omit()` function](https://lodash.com/docs/#omit) for Mongoose schemas.
|
|
513
|
+
*
|
|
514
|
+
* #### Example:
|
|
515
|
+
*
|
|
516
|
+
* const schema = Schema({ name: String, age: Number });
|
|
517
|
+
* // Creates a new schema omitting the `age` path
|
|
518
|
+
* const newSchema = schema.omit(['age']);
|
|
519
|
+
*
|
|
520
|
+
* newSchema.path('name'); // SchemaString { ... }
|
|
521
|
+
* newSchema.path('age'); // undefined
|
|
522
|
+
*
|
|
523
|
+
* @param {String[]} paths List of Paths to omit for the new Schema
|
|
524
|
+
* @param {Object} [options] Options to pass to the new Schema Constructor (same as `new Schema(.., Options)`). Defaults to `this.options` if not set.
|
|
525
|
+
* @return {Schema}
|
|
526
|
+
* @api public
|
|
527
|
+
*/
|
|
528
|
+
|
|
529
|
+
Schema.prototype.omit = function(paths, options) {
|
|
530
|
+
const newSchema = new Schema(this, options || this.options);
|
|
531
|
+
if (!Array.isArray(paths)) {
|
|
532
|
+
throw new MongooseError(
|
|
533
|
+
'Schema#omit() only accepts an array argument, ' +
|
|
534
|
+
'got "' +
|
|
535
|
+
typeof paths +
|
|
536
|
+
'"'
|
|
537
|
+
);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
newSchema.remove(paths);
|
|
541
|
+
|
|
542
|
+
for (const nested in newSchema.singleNestedPaths) {
|
|
543
|
+
if (paths.includes(nested)) {
|
|
544
|
+
delete newSchema.singleNestedPaths[nested];
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
return newSchema;
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Returns default options for this schema, merged with `options`.
|
|
553
|
+
*
|
|
554
|
+
* @param {Object} [options] Options to overwrite the default options
|
|
555
|
+
* @return {Object} The merged options of `options` and the default options
|
|
556
|
+
* @api private
|
|
557
|
+
*/
|
|
558
|
+
|
|
559
|
+
Schema.prototype.defaultOptions = function(options) {
|
|
560
|
+
this._userProvidedOptions = options == null ? {} : clone(options);
|
|
561
|
+
const baseOptions = this.base && this.base.options || {};
|
|
562
|
+
const strict = 'strict' in baseOptions ? baseOptions.strict : true;
|
|
563
|
+
const strictQuery = 'strictQuery' in baseOptions ? baseOptions.strictQuery : false;
|
|
564
|
+
const id = 'id' in baseOptions ? baseOptions.id : true;
|
|
565
|
+
options = {
|
|
566
|
+
strict,
|
|
567
|
+
strictQuery,
|
|
568
|
+
bufferCommands: true,
|
|
569
|
+
capped: false, // { size, max, autoIndexId }
|
|
570
|
+
versionKey: '__v',
|
|
571
|
+
optimisticConcurrency: false,
|
|
572
|
+
minimize: true,
|
|
573
|
+
autoIndex: null,
|
|
574
|
+
discriminatorKey: '__t',
|
|
575
|
+
shardKey: null,
|
|
576
|
+
read: null,
|
|
577
|
+
validateBeforeSave: true,
|
|
578
|
+
validateModifiedOnly: false,
|
|
579
|
+
// the following are only applied at construction time
|
|
580
|
+
_id: true,
|
|
581
|
+
id: id,
|
|
582
|
+
typeKey: 'type',
|
|
583
|
+
...options
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
if (options.versionKey && typeof options.versionKey !== 'string') {
|
|
587
|
+
throw new MongooseError('`versionKey` must be falsy or string, got `' + (typeof options.versionKey) + '`');
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
if (typeof options.read === 'string') {
|
|
591
|
+
options.read = handleReadPreferenceAliases(options.read);
|
|
592
|
+
} else if (Array.isArray(options.read) && typeof options.read[0] === 'string') {
|
|
593
|
+
options.read = {
|
|
594
|
+
mode: handleReadPreferenceAliases(options.read[0]),
|
|
595
|
+
tags: options.read[1]
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
if (options.optimisticConcurrency && !options.versionKey) {
|
|
600
|
+
throw new MongooseError('Must set `versionKey` if using `optimisticConcurrency`');
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
return options;
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* Inherit a Schema by applying a discriminator on an existing Schema.
|
|
608
|
+
*
|
|
609
|
+
*
|
|
610
|
+
* #### Example:
|
|
611
|
+
*
|
|
612
|
+
* const eventSchema = new mongoose.Schema({ timestamp: Date }, { discriminatorKey: 'kind' });
|
|
613
|
+
*
|
|
614
|
+
* const clickedEventSchema = new mongoose.Schema({ element: String }, { discriminatorKey: 'kind' });
|
|
615
|
+
* const ClickedModel = eventSchema.discriminator('clicked', clickedEventSchema);
|
|
616
|
+
*
|
|
617
|
+
* const Event = mongoose.model('Event', eventSchema);
|
|
618
|
+
*
|
|
619
|
+
* Event.discriminators['clicked']; // Model { clicked }
|
|
620
|
+
*
|
|
621
|
+
* const doc = await Event.create({ kind: 'clicked', element: '#hero' });
|
|
622
|
+
* doc.element; // '#hero'
|
|
623
|
+
* doc instanceof ClickedModel; // true
|
|
624
|
+
*
|
|
625
|
+
* @param {String} name the name of the discriminator
|
|
626
|
+
* @param {Schema} schema the discriminated Schema
|
|
627
|
+
* @param {Object} [options] discriminator options
|
|
628
|
+
* @param {String} [options.value] the string stored in the `discriminatorKey` property. If not specified, Mongoose uses the `name` parameter.
|
|
629
|
+
* @param {Boolean} [options.clone=true] By default, `discriminator()` clones the given `schema`. Set to `false` to skip cloning.
|
|
630
|
+
* @param {Boolean} [options.overwriteModels=false] by default, Mongoose does not allow you to define a discriminator with the same name as another discriminator. Set this to allow overwriting discriminators with the same name.
|
|
631
|
+
* @param {Boolean} [options.mergeHooks=true] By default, Mongoose merges the base schema's hooks with the discriminator schema's hooks. Set this option to `false` to make Mongoose use the discriminator schema's hooks instead.
|
|
632
|
+
* @param {Boolean} [options.mergePlugins=true] By default, Mongoose merges the base schema's plugins with the discriminator schema's plugins. Set this option to `false` to make Mongoose use the discriminator schema's plugins instead.
|
|
633
|
+
* @return {Schema} the Schema instance
|
|
634
|
+
* @api public
|
|
635
|
+
*/
|
|
636
|
+
Schema.prototype.discriminator = function(name, schema, options) {
|
|
637
|
+
this._applyDiscriminators = this._applyDiscriminators || new Map();
|
|
638
|
+
this._applyDiscriminators.set(name, { schema, options });
|
|
639
|
+
|
|
640
|
+
return this;
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Adds key path / schema type pairs to this schema.
|
|
645
|
+
*
|
|
646
|
+
* #### Example:
|
|
647
|
+
*
|
|
648
|
+
* const ToySchema = new Schema();
|
|
649
|
+
* ToySchema.add({ name: 'string', color: 'string', price: 'number' });
|
|
650
|
+
*
|
|
651
|
+
* const TurboManSchema = new Schema();
|
|
652
|
+
* // You can also `add()` another schema and copy over all paths, virtuals,
|
|
653
|
+
* // getters, setters, indexes, methods, and statics.
|
|
654
|
+
* TurboManSchema.add(ToySchema).add({ year: Number });
|
|
655
|
+
*
|
|
656
|
+
* @param {Object|Schema} obj plain object with paths to add, or another schema
|
|
657
|
+
* @param {String} [prefix] path to prefix the newly added paths with
|
|
658
|
+
* @return {Schema} the Schema instance
|
|
659
|
+
* @api public
|
|
660
|
+
*/
|
|
661
|
+
|
|
662
|
+
Schema.prototype.add = function add(obj, prefix) {
|
|
663
|
+
if (obj instanceof Schema || (obj != null && obj.instanceOfSchema)) {
|
|
664
|
+
merge(this, obj);
|
|
665
|
+
|
|
666
|
+
return this;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
// Special case: setting top-level `_id` to false should convert to disabling
|
|
670
|
+
// the `_id` option. This behavior never worked before 5.4.11 but numerous
|
|
671
|
+
// codebases use it (see gh-7516, gh-7512).
|
|
672
|
+
if (obj._id === false && prefix == null) {
|
|
673
|
+
this.options._id = false;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
prefix = prefix || '';
|
|
677
|
+
// avoid prototype pollution
|
|
678
|
+
if (prefix === '__proto__.' || prefix === 'constructor.' || prefix === 'prototype.') {
|
|
679
|
+
return this;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
const keys = Object.keys(obj);
|
|
683
|
+
const typeKey = this.options.typeKey;
|
|
684
|
+
for (const key of keys) {
|
|
685
|
+
if (utils.specialProperties.has(key)) {
|
|
686
|
+
continue;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
const fullPath = prefix + key;
|
|
690
|
+
const val = obj[key];
|
|
691
|
+
|
|
692
|
+
if (val == null) {
|
|
693
|
+
throw new TypeError('Invalid value for schema path `' + fullPath +
|
|
694
|
+
'`, got value "' + val + '"');
|
|
695
|
+
}
|
|
696
|
+
// Retain `_id: false` but don't set it as a path, re: gh-8274.
|
|
697
|
+
if (key === '_id' && val === false) {
|
|
698
|
+
continue;
|
|
699
|
+
}
|
|
700
|
+
// Deprecate setting schema paths to primitive types (gh-7558)
|
|
701
|
+
let isMongooseTypeString = false;
|
|
702
|
+
if (typeof val === 'string') {
|
|
703
|
+
// Handle the case in which the type is specified as a string (eg. 'date', 'oid', ...)
|
|
704
|
+
const MongooseTypes = this.base != null ? this.base.Schema.Types : Schema.Types;
|
|
705
|
+
const upperVal = val.charAt(0).toUpperCase() + val.substring(1);
|
|
706
|
+
isMongooseTypeString = MongooseTypes[upperVal] != null;
|
|
707
|
+
}
|
|
708
|
+
if (
|
|
709
|
+
key !== '_id' &&
|
|
710
|
+
((typeof val !== 'object' && typeof val !== 'function' && !isMongooseTypeString) ||
|
|
711
|
+
val == null)
|
|
712
|
+
) {
|
|
713
|
+
throw new TypeError(`Invalid schema configuration: \`${val}\` is not ` +
|
|
714
|
+
`a valid type at path \`${key}\`. See ` +
|
|
715
|
+
'https://bit.ly/mongoose-schematypes for a list of valid schema types.');
|
|
716
|
+
}
|
|
717
|
+
if (val instanceof VirtualType || (val.constructor && val.constructor.name || null) === 'VirtualType') {
|
|
718
|
+
this.virtual(val);
|
|
719
|
+
continue;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
if (Array.isArray(val) && val.length === 1 && val[0] == null) {
|
|
723
|
+
throw new TypeError('Invalid value for schema Array path `' + fullPath +
|
|
724
|
+
'`, got value "' + val[0] + '"');
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
if (!(isPOJO(val) || val instanceof SchemaTypeOptions)) {
|
|
728
|
+
// Special-case: Non-options definitely a path so leaf at this node
|
|
729
|
+
// Examples: Schema instances, SchemaType instances
|
|
730
|
+
if (prefix) {
|
|
731
|
+
this.nested[prefix.substring(0, prefix.length - 1)] = true;
|
|
732
|
+
}
|
|
733
|
+
this.path(prefix + key, val);
|
|
734
|
+
if (val[0] != null && !(val[0].instanceOfSchema) && utils.isPOJO(val[0].discriminators)) {
|
|
735
|
+
const schemaType = this.path(prefix + key);
|
|
736
|
+
for (const key in val[0].discriminators) {
|
|
737
|
+
schemaType.discriminator(key, val[0].discriminators[key]);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
} else if (Object.keys(val).length < 1) {
|
|
741
|
+
// Special-case: {} always interpreted as Mixed path so leaf at this node
|
|
742
|
+
if (prefix) {
|
|
743
|
+
this.nested[prefix.substring(0, prefix.length - 1)] = true;
|
|
744
|
+
}
|
|
745
|
+
this.path(fullPath, val); // mixed type
|
|
746
|
+
} else if (!val[typeKey] || (typeKey === 'type' && isPOJO(val.type) && val.type.type)) {
|
|
747
|
+
// Special-case: POJO with no bona-fide type key - interpret as tree of deep paths so recurse
|
|
748
|
+
// nested object `{ last: { name: String } }`. Avoid functions with `.type` re: #10807 because
|
|
749
|
+
// NestJS sometimes adds `Date.type`.
|
|
750
|
+
this.nested[fullPath] = true;
|
|
751
|
+
this.add(val, fullPath + '.');
|
|
752
|
+
} else {
|
|
753
|
+
// There IS a bona-fide type key that may also be a POJO
|
|
754
|
+
const _typeDef = val[typeKey];
|
|
755
|
+
if (isPOJO(_typeDef) && Object.keys(_typeDef).length > 0) {
|
|
756
|
+
// If a POJO is the value of a type key, make it a subdocument
|
|
757
|
+
if (prefix) {
|
|
758
|
+
this.nested[prefix.substring(0, prefix.length - 1)] = true;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
const childSchemaOptions = {};
|
|
762
|
+
if (this._userProvidedOptions.typeKey) {
|
|
763
|
+
childSchemaOptions.typeKey = this._userProvidedOptions.typeKey;
|
|
764
|
+
}
|
|
765
|
+
// propagate 'strict' option to child schema
|
|
766
|
+
if (this._userProvidedOptions.strict != null) {
|
|
767
|
+
childSchemaOptions.strict = this._userProvidedOptions.strict;
|
|
768
|
+
}
|
|
769
|
+
if (this._userProvidedOptions.toObject != null) {
|
|
770
|
+
childSchemaOptions.toObject = utils.omit(this._userProvidedOptions.toObject, ['transform']);
|
|
771
|
+
}
|
|
772
|
+
if (this._userProvidedOptions.toJSON != null) {
|
|
773
|
+
childSchemaOptions.toJSON = utils.omit(this._userProvidedOptions.toJSON, ['transform']);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
const _schema = new Schema(_typeDef, childSchemaOptions);
|
|
777
|
+
_schema.$implicitlyCreated = true;
|
|
778
|
+
const schemaWrappedPath = Object.assign({}, val, { [typeKey]: _schema });
|
|
779
|
+
this.path(prefix + key, schemaWrappedPath);
|
|
780
|
+
} else {
|
|
781
|
+
// Either the type is non-POJO or we interpret it as Mixed anyway
|
|
782
|
+
if (prefix) {
|
|
783
|
+
this.nested[prefix.substring(0, prefix.length - 1)] = true;
|
|
784
|
+
}
|
|
785
|
+
this.path(prefix + key, val);
|
|
786
|
+
if (val != null && !(val.instanceOfSchema) && utils.isPOJO(val.discriminators)) {
|
|
787
|
+
const schemaType = this.path(prefix + key);
|
|
788
|
+
for (const key in val.discriminators) {
|
|
789
|
+
schemaType.discriminator(key, val.discriminators[key]);
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
const aliasObj = Object.fromEntries(
|
|
797
|
+
Object.entries(obj).map(([key]) => ([prefix + key, null]))
|
|
798
|
+
);
|
|
799
|
+
aliasFields(this, aliasObj);
|
|
800
|
+
return this;
|
|
801
|
+
};
|
|
802
|
+
|
|
803
|
+
/**
|
|
804
|
+
* Add an alias for `path`. This means getting or setting the `alias`
|
|
805
|
+
* is equivalent to getting or setting the `path`.
|
|
806
|
+
*
|
|
807
|
+
* #### Example:
|
|
808
|
+
*
|
|
809
|
+
* const toySchema = new Schema({ n: String });
|
|
810
|
+
*
|
|
811
|
+
* // Make 'name' an alias for 'n'
|
|
812
|
+
* toySchema.alias('n', 'name');
|
|
813
|
+
*
|
|
814
|
+
* const Toy = mongoose.model('Toy', toySchema);
|
|
815
|
+
* const turboMan = new Toy({ n: 'Turbo Man' });
|
|
816
|
+
*
|
|
817
|
+
* turboMan.name; // 'Turbo Man'
|
|
818
|
+
* turboMan.n; // 'Turbo Man'
|
|
819
|
+
*
|
|
820
|
+
* turboMan.name = 'Turbo Man Action Figure';
|
|
821
|
+
* turboMan.n; // 'Turbo Man Action Figure'
|
|
822
|
+
*
|
|
823
|
+
* await turboMan.save(); // Saves { _id: ..., n: 'Turbo Man Action Figure' }
|
|
824
|
+
*
|
|
825
|
+
*
|
|
826
|
+
* @param {String} path real path to alias
|
|
827
|
+
* @param {String|String[]} alias the path(s) to use as an alias for `path`
|
|
828
|
+
* @return {Schema} the Schema instance
|
|
829
|
+
* @api public
|
|
830
|
+
*/
|
|
831
|
+
|
|
832
|
+
Schema.prototype.alias = function alias(path, alias) {
|
|
833
|
+
aliasFields(this, { [path]: alias });
|
|
834
|
+
return this;
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* Remove an index by name or index specification.
|
|
839
|
+
*
|
|
840
|
+
* removeIndex only removes indexes from your schema object. Does **not** affect the indexes
|
|
841
|
+
* in MongoDB.
|
|
842
|
+
*
|
|
843
|
+
* #### Example:
|
|
844
|
+
*
|
|
845
|
+
* const ToySchema = new Schema({ name: String, color: String, price: Number });
|
|
846
|
+
*
|
|
847
|
+
* // Add a new index on { name, color }
|
|
848
|
+
* ToySchema.index({ name: 1, color: 1 });
|
|
849
|
+
*
|
|
850
|
+
* // Remove index on { name, color }
|
|
851
|
+
* // Keep in mind that order matters! `removeIndex({ color: 1, name: 1 })` won't remove the index
|
|
852
|
+
* ToySchema.removeIndex({ name: 1, color: 1 });
|
|
853
|
+
*
|
|
854
|
+
* // Add an index with a custom name
|
|
855
|
+
* ToySchema.index({ color: 1 }, { name: 'my custom index name' });
|
|
856
|
+
* // Remove index by name
|
|
857
|
+
* ToySchema.removeIndex('my custom index name');
|
|
858
|
+
*
|
|
859
|
+
* @param {Object|string} index name or index specification
|
|
860
|
+
* @return {Schema} the Schema instance
|
|
861
|
+
* @api public
|
|
862
|
+
*/
|
|
863
|
+
|
|
864
|
+
Schema.prototype.removeIndex = function removeIndex(index) {
|
|
865
|
+
if (arguments.length > 1) {
|
|
866
|
+
throw new Error('removeIndex() takes only 1 argument');
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
if (typeof index !== 'object' && typeof index !== 'string') {
|
|
870
|
+
throw new Error('removeIndex() may only take either an object or a string as an argument');
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
if (typeof index === 'object') {
|
|
874
|
+
for (let i = this._indexes.length - 1; i >= 0; --i) {
|
|
875
|
+
if (util.isDeepStrictEqual(this._indexes[i][0], index)) {
|
|
876
|
+
this._indexes.splice(i, 1);
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
} else {
|
|
880
|
+
for (let i = this._indexes.length - 1; i >= 0; --i) {
|
|
881
|
+
if (this._indexes[i][1] != null && this._indexes[i][1].name === index) {
|
|
882
|
+
this._indexes.splice(i, 1);
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
return this;
|
|
888
|
+
};
|
|
889
|
+
|
|
890
|
+
/**
|
|
891
|
+
* Remove all indexes from this schema.
|
|
892
|
+
*
|
|
893
|
+
* clearIndexes only removes indexes from your schema object. Does **not** affect the indexes
|
|
894
|
+
* in MongoDB.
|
|
895
|
+
*
|
|
896
|
+
* #### Example:
|
|
897
|
+
*
|
|
898
|
+
* const ToySchema = new Schema({ name: String, color: String, price: Number });
|
|
899
|
+
* ToySchema.index({ name: 1 });
|
|
900
|
+
* ToySchema.index({ color: 1 });
|
|
901
|
+
*
|
|
902
|
+
* // Remove all indexes on this schema
|
|
903
|
+
* ToySchema.clearIndexes();
|
|
904
|
+
*
|
|
905
|
+
* ToySchema.indexes(); // []
|
|
906
|
+
*
|
|
907
|
+
* @return {Schema} the Schema instance
|
|
908
|
+
* @api public
|
|
909
|
+
*/
|
|
910
|
+
|
|
911
|
+
Schema.prototype.clearIndexes = function clearIndexes() {
|
|
912
|
+
this._indexes.length = 0;
|
|
913
|
+
|
|
914
|
+
return this;
|
|
915
|
+
};
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* Reserved document keys.
|
|
919
|
+
*
|
|
920
|
+
* Keys in this object are names that are warned in schema declarations
|
|
921
|
+
* because they have the potential to break Mongoose/ Mongoose plugins functionality. If you create a schema
|
|
922
|
+
* using `new Schema()` with one of these property names, Mongoose will log a warning.
|
|
923
|
+
*
|
|
924
|
+
* - _posts
|
|
925
|
+
* - _pres
|
|
926
|
+
* - collection
|
|
927
|
+
* - emit
|
|
928
|
+
* - errors
|
|
929
|
+
* - get
|
|
930
|
+
* - init
|
|
931
|
+
* - isModified
|
|
932
|
+
* - isNew
|
|
933
|
+
* - listeners
|
|
934
|
+
* - modelName
|
|
935
|
+
* - on
|
|
936
|
+
* - once
|
|
937
|
+
* - populated
|
|
938
|
+
* - prototype
|
|
939
|
+
* - remove
|
|
940
|
+
* - removeListener
|
|
941
|
+
* - save
|
|
942
|
+
* - schema
|
|
943
|
+
* - toObject
|
|
944
|
+
* - validate
|
|
945
|
+
*
|
|
946
|
+
* _NOTE:_ Use of these terms as method names is permitted, but play at your own risk, as they may be existing mongoose document methods you are stomping on.
|
|
947
|
+
*
|
|
948
|
+
* const schema = new Schema(..);
|
|
949
|
+
* schema.methods.init = function () {} // potentially breaking
|
|
950
|
+
*
|
|
951
|
+
* @property reserved
|
|
952
|
+
* @memberOf Schema
|
|
953
|
+
* @static
|
|
954
|
+
*/
|
|
955
|
+
|
|
956
|
+
Schema.reserved = Object.create(null);
|
|
957
|
+
Schema.prototype.reserved = Schema.reserved;
|
|
958
|
+
|
|
959
|
+
const reserved = Schema.reserved;
|
|
960
|
+
// Core object
|
|
961
|
+
reserved['prototype'] =
|
|
962
|
+
// EventEmitter
|
|
963
|
+
reserved.emit =
|
|
964
|
+
reserved.listeners =
|
|
965
|
+
reserved.removeListener =
|
|
966
|
+
|
|
967
|
+
// document properties and functions
|
|
968
|
+
reserved.collection =
|
|
969
|
+
reserved.errors =
|
|
970
|
+
reserved.get =
|
|
971
|
+
reserved.init =
|
|
972
|
+
reserved.isModified =
|
|
973
|
+
reserved.isNew =
|
|
974
|
+
reserved.populated =
|
|
975
|
+
reserved.remove =
|
|
976
|
+
reserved.save =
|
|
977
|
+
reserved.toObject =
|
|
978
|
+
reserved.validate = 1;
|
|
979
|
+
reserved.collection = 1;
|
|
980
|
+
|
|
981
|
+
/**
|
|
982
|
+
* Gets/sets schema paths.
|
|
983
|
+
*
|
|
984
|
+
* Sets a path (if arity 2)
|
|
985
|
+
* Gets a path (if arity 1)
|
|
986
|
+
*
|
|
987
|
+
* #### Example:
|
|
988
|
+
*
|
|
989
|
+
* schema.path('name') // returns a SchemaType
|
|
990
|
+
* schema.path('name', Number) // changes the schemaType of `name` to Number
|
|
991
|
+
*
|
|
992
|
+
* @param {String} path The name of the Path to get / set
|
|
993
|
+
* @param {Object} [obj] The Type to set the path to, if provided the path will be SET, otherwise the path will be GET
|
|
994
|
+
* @api public
|
|
995
|
+
*/
|
|
996
|
+
|
|
997
|
+
Schema.prototype.path = function(path, obj) {
|
|
998
|
+
if (obj === undefined) {
|
|
999
|
+
if (this.paths[path] != null) {
|
|
1000
|
+
return this.paths[path];
|
|
1001
|
+
}
|
|
1002
|
+
// Convert to '.$' to check subpaths re: gh-6405
|
|
1003
|
+
const cleanPath = _pathToPositionalSyntax(path);
|
|
1004
|
+
let schematype = _getPath(this, path, cleanPath);
|
|
1005
|
+
if (schematype != null) {
|
|
1006
|
+
return schematype;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
// Look for maps
|
|
1010
|
+
const mapPath = getMapPath(this, path);
|
|
1011
|
+
if (mapPath != null) {
|
|
1012
|
+
return mapPath;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
// Look if a parent of this path is mixed
|
|
1016
|
+
schematype = this.hasMixedParent(cleanPath);
|
|
1017
|
+
if (schematype != null) {
|
|
1018
|
+
return schematype;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
// subpaths?
|
|
1022
|
+
return hasNumericSubpathRegex.test(path)
|
|
1023
|
+
? getPositionalPath(this, path, cleanPath)
|
|
1024
|
+
: undefined;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
// some path names conflict with document methods
|
|
1028
|
+
const firstPieceOfPath = path.split('.')[0];
|
|
1029
|
+
if (reserved[firstPieceOfPath] && !this.options.suppressReservedKeysWarning) {
|
|
1030
|
+
const errorMessage = `\`${firstPieceOfPath}\` is a reserved schema pathname and may break some functionality. ` +
|
|
1031
|
+
'You are allowed to use it, but use at your own risk. ' +
|
|
1032
|
+
'To disable this warning pass `suppressReservedKeysWarning` as a schema option.';
|
|
1033
|
+
|
|
1034
|
+
utils.warn(errorMessage);
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
if (typeof obj === 'object' && utils.hasUserDefinedProperty(obj, 'ref')) {
|
|
1038
|
+
validateRef(obj.ref, path);
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
// update the tree
|
|
1042
|
+
const subpaths = path.split(/\./);
|
|
1043
|
+
const last = subpaths.pop();
|
|
1044
|
+
let branch = this.tree;
|
|
1045
|
+
let fullPath = '';
|
|
1046
|
+
|
|
1047
|
+
for (const sub of subpaths) {
|
|
1048
|
+
if (utils.specialProperties.has(sub)) {
|
|
1049
|
+
throw new Error('Cannot set special property `' + sub + '` on a schema');
|
|
1050
|
+
}
|
|
1051
|
+
fullPath = fullPath += (fullPath.length > 0 ? '.' : '') + sub;
|
|
1052
|
+
if (!branch[sub]) {
|
|
1053
|
+
this.nested[fullPath] = true;
|
|
1054
|
+
branch[sub] = {};
|
|
1055
|
+
}
|
|
1056
|
+
if (typeof branch[sub] !== 'object') {
|
|
1057
|
+
const msg = 'Cannot set nested path `' + path + '`. '
|
|
1058
|
+
+ 'Parent path `'
|
|
1059
|
+
+ fullPath
|
|
1060
|
+
+ '` already set to type ' + branch[sub].name
|
|
1061
|
+
+ '.';
|
|
1062
|
+
throw new Error(msg);
|
|
1063
|
+
}
|
|
1064
|
+
branch = branch[sub];
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
branch[last] = clone(obj);
|
|
1068
|
+
|
|
1069
|
+
this.paths[path] = this.interpretAsType(path, obj, this.options);
|
|
1070
|
+
const schemaType = this.paths[path];
|
|
1071
|
+
|
|
1072
|
+
if (schemaType.$isSchemaMap) {
|
|
1073
|
+
// Maps can have arbitrary keys, so `$*` is internal shorthand for "any key"
|
|
1074
|
+
// The '$' is to imply this path should never be stored in MongoDB so we
|
|
1075
|
+
// can easily build a regexp out of this path, and '*' to imply "any key."
|
|
1076
|
+
const mapPath = path + '.$*';
|
|
1077
|
+
|
|
1078
|
+
this.paths[mapPath] = schemaType.$__schemaType;
|
|
1079
|
+
this.mapPaths.push(this.paths[mapPath]);
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
if (schemaType.$isSingleNested) {
|
|
1083
|
+
for (const key of Object.keys(schemaType.schema.paths)) {
|
|
1084
|
+
this.singleNestedPaths[path + '.' + key] = schemaType.schema.paths[key];
|
|
1085
|
+
}
|
|
1086
|
+
for (const key of Object.keys(schemaType.schema.singleNestedPaths)) {
|
|
1087
|
+
this.singleNestedPaths[path + '.' + key] =
|
|
1088
|
+
schemaType.schema.singleNestedPaths[key];
|
|
1089
|
+
}
|
|
1090
|
+
for (const key of Object.keys(schemaType.schema.subpaths)) {
|
|
1091
|
+
this.singleNestedPaths[path + '.' + key] =
|
|
1092
|
+
schemaType.schema.subpaths[key];
|
|
1093
|
+
}
|
|
1094
|
+
for (const key of Object.keys(schemaType.schema.nested)) {
|
|
1095
|
+
this.singleNestedPaths[path + '.' + key] = 'nested';
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
Object.defineProperty(schemaType.schema, 'base', {
|
|
1099
|
+
configurable: true,
|
|
1100
|
+
enumerable: false,
|
|
1101
|
+
writable: false,
|
|
1102
|
+
value: this.base
|
|
1103
|
+
});
|
|
1104
|
+
|
|
1105
|
+
schemaType.caster.base = this.base;
|
|
1106
|
+
this.childSchemas.push({
|
|
1107
|
+
schema: schemaType.schema,
|
|
1108
|
+
model: schemaType.caster
|
|
1109
|
+
});
|
|
1110
|
+
} else if (schemaType.$isMongooseDocumentArray) {
|
|
1111
|
+
Object.defineProperty(schemaType.schema, 'base', {
|
|
1112
|
+
configurable: true,
|
|
1113
|
+
enumerable: false,
|
|
1114
|
+
writable: false,
|
|
1115
|
+
value: this.base
|
|
1116
|
+
});
|
|
1117
|
+
|
|
1118
|
+
schemaType.casterConstructor.base = this.base;
|
|
1119
|
+
this.childSchemas.push({
|
|
1120
|
+
schema: schemaType.schema,
|
|
1121
|
+
model: schemaType.casterConstructor
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
if (schemaType.$isMongooseArray && schemaType.caster instanceof SchemaType) {
|
|
1126
|
+
let arrayPath = path;
|
|
1127
|
+
let _schemaType = schemaType;
|
|
1128
|
+
|
|
1129
|
+
const toAdd = [];
|
|
1130
|
+
while (_schemaType.$isMongooseArray) {
|
|
1131
|
+
arrayPath = arrayPath + '.$';
|
|
1132
|
+
|
|
1133
|
+
// Skip arrays of document arrays
|
|
1134
|
+
if (_schemaType.$isMongooseDocumentArray) {
|
|
1135
|
+
_schemaType.$embeddedSchemaType._arrayPath = arrayPath;
|
|
1136
|
+
_schemaType.$embeddedSchemaType._arrayParentPath = path;
|
|
1137
|
+
_schemaType = _schemaType.$embeddedSchemaType;
|
|
1138
|
+
} else {
|
|
1139
|
+
_schemaType.caster._arrayPath = arrayPath;
|
|
1140
|
+
_schemaType.caster._arrayParentPath = path;
|
|
1141
|
+
_schemaType = _schemaType.caster;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
this.subpaths[arrayPath] = _schemaType;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
for (const _schemaType of toAdd) {
|
|
1148
|
+
this.subpaths[_schemaType.path] = _schemaType;
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
if (schemaType.$isMongooseDocumentArray) {
|
|
1153
|
+
for (const key of Object.keys(schemaType.schema.paths)) {
|
|
1154
|
+
const _schemaType = schemaType.schema.paths[key];
|
|
1155
|
+
this.subpaths[path + '.' + key] = _schemaType;
|
|
1156
|
+
if (typeof _schemaType === 'object' && _schemaType != null && _schemaType.$parentSchemaDocArray == null) {
|
|
1157
|
+
_schemaType.$parentSchemaDocArray = schemaType;
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
for (const key of Object.keys(schemaType.schema.subpaths)) {
|
|
1161
|
+
const _schemaType = schemaType.schema.subpaths[key];
|
|
1162
|
+
this.subpaths[path + '.' + key] = _schemaType;
|
|
1163
|
+
if (typeof _schemaType === 'object' && _schemaType != null && _schemaType.$parentSchemaDocArray == null) {
|
|
1164
|
+
_schemaType.$parentSchemaDocArray = schemaType;
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
for (const key of Object.keys(schemaType.schema.singleNestedPaths)) {
|
|
1168
|
+
const _schemaType = schemaType.schema.singleNestedPaths[key];
|
|
1169
|
+
this.subpaths[path + '.' + key] = _schemaType;
|
|
1170
|
+
if (typeof _schemaType === 'object' && _schemaType != null && _schemaType.$parentSchemaDocArray == null) {
|
|
1171
|
+
_schemaType.$parentSchemaDocArray = schemaType;
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
return this;
|
|
1177
|
+
};
|
|
1178
|
+
|
|
1179
|
+
/*!
|
|
1180
|
+
* ignore
|
|
1181
|
+
*/
|
|
1182
|
+
|
|
1183
|
+
function gatherChildSchemas(schema) {
|
|
1184
|
+
const childSchemas = [];
|
|
1185
|
+
|
|
1186
|
+
for (const path of Object.keys(schema.paths)) {
|
|
1187
|
+
const schematype = schema.paths[path];
|
|
1188
|
+
if (schematype.$isMongooseDocumentArray || schematype.$isSingleNested) {
|
|
1189
|
+
childSchemas.push({ schema: schematype.schema, model: schematype.caster });
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
return childSchemas;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
/*!
|
|
1197
|
+
* ignore
|
|
1198
|
+
*/
|
|
1199
|
+
|
|
1200
|
+
function _getPath(schema, path, cleanPath) {
|
|
1201
|
+
if (schema.paths.hasOwnProperty(path)) {
|
|
1202
|
+
return schema.paths[path];
|
|
1203
|
+
}
|
|
1204
|
+
if (schema.subpaths.hasOwnProperty(cleanPath)) {
|
|
1205
|
+
return schema.subpaths[cleanPath];
|
|
1206
|
+
}
|
|
1207
|
+
if (schema.singleNestedPaths.hasOwnProperty(cleanPath) && typeof schema.singleNestedPaths[cleanPath] === 'object') {
|
|
1208
|
+
return schema.singleNestedPaths[cleanPath];
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
return null;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
/*!
|
|
1215
|
+
* ignore
|
|
1216
|
+
*/
|
|
1217
|
+
|
|
1218
|
+
function _pathToPositionalSyntax(path) {
|
|
1219
|
+
if (!/\.\d+/.test(path)) {
|
|
1220
|
+
return path;
|
|
1221
|
+
}
|
|
1222
|
+
return path.replace(/\.\d+\./g, '.$.').replace(/\.\d+$/, '.$');
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
/*!
|
|
1226
|
+
* ignore
|
|
1227
|
+
*/
|
|
1228
|
+
|
|
1229
|
+
function getMapPath(schema, path) {
|
|
1230
|
+
if (schema.mapPaths.length === 0) {
|
|
1231
|
+
return null;
|
|
1232
|
+
}
|
|
1233
|
+
for (const val of schema.mapPaths) {
|
|
1234
|
+
const _path = val.path;
|
|
1235
|
+
const re = new RegExp('^' + _path.replace(/\.\$\*/g, '\\.[^.]+') + '$');
|
|
1236
|
+
if (re.test(path)) {
|
|
1237
|
+
return schema.paths[_path];
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
return null;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
/**
|
|
1245
|
+
* The Mongoose instance this schema is associated with
|
|
1246
|
+
*
|
|
1247
|
+
* @property base
|
|
1248
|
+
* @api private
|
|
1249
|
+
*/
|
|
1250
|
+
|
|
1251
|
+
Object.defineProperty(Schema.prototype, 'base', {
|
|
1252
|
+
configurable: true,
|
|
1253
|
+
enumerable: false,
|
|
1254
|
+
writable: true,
|
|
1255
|
+
value: null
|
|
1256
|
+
});
|
|
1257
|
+
|
|
1258
|
+
/**
|
|
1259
|
+
* Converts type arguments into Mongoose Types.
|
|
1260
|
+
*
|
|
1261
|
+
* @param {String} path
|
|
1262
|
+
* @param {Object} obj constructor
|
|
1263
|
+
* @param {Object} options
|
|
1264
|
+
* @api private
|
|
1265
|
+
*/
|
|
1266
|
+
|
|
1267
|
+
Schema.prototype.interpretAsType = function(path, obj, options) {
|
|
1268
|
+
if (obj instanceof SchemaType) {
|
|
1269
|
+
if (obj.path === path) {
|
|
1270
|
+
return obj;
|
|
1271
|
+
}
|
|
1272
|
+
const clone = obj.clone();
|
|
1273
|
+
clone.path = path;
|
|
1274
|
+
return clone;
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
// If this schema has an associated Mongoose object, use the Mongoose object's
|
|
1278
|
+
// copy of SchemaTypes re: gh-7158 gh-6933
|
|
1279
|
+
const MongooseTypes = this.base != null ? this.base.Schema.Types : Schema.Types;
|
|
1280
|
+
const Types = this.base != null ? this.base.Types : require('./types');
|
|
1281
|
+
|
|
1282
|
+
if (!utils.isPOJO(obj) && !(obj instanceof SchemaTypeOptions)) {
|
|
1283
|
+
const constructorName = utils.getFunctionName(obj.constructor);
|
|
1284
|
+
if (constructorName !== 'Object') {
|
|
1285
|
+
const oldObj = obj;
|
|
1286
|
+
obj = {};
|
|
1287
|
+
obj[options.typeKey] = oldObj;
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
// Get the type making sure to allow keys named "type"
|
|
1292
|
+
// and default to mixed if not specified.
|
|
1293
|
+
// { type: { type: String, default: 'freshcut' } }
|
|
1294
|
+
let type = obj[options.typeKey] && (obj[options.typeKey] instanceof Function || options.typeKey !== 'type' || !obj.type.type)
|
|
1295
|
+
? obj[options.typeKey]
|
|
1296
|
+
: {};
|
|
1297
|
+
let name;
|
|
1298
|
+
|
|
1299
|
+
if (utils.isPOJO(type) || type === 'mixed') {
|
|
1300
|
+
return new MongooseTypes.Mixed(path, obj);
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
if (Array.isArray(type) || type === Array || type === 'array' || type === MongooseTypes.Array) {
|
|
1304
|
+
// if it was specified through { type } look for `cast`
|
|
1305
|
+
let cast = (type === Array || type === 'array')
|
|
1306
|
+
? obj.cast || obj.of
|
|
1307
|
+
: type[0];
|
|
1308
|
+
|
|
1309
|
+
// new Schema({ path: [new Schema({ ... })] })
|
|
1310
|
+
if (cast && cast.instanceOfSchema) {
|
|
1311
|
+
if (!(cast instanceof Schema)) {
|
|
1312
|
+
if (this.options._isMerging) {
|
|
1313
|
+
cast = new Schema(cast);
|
|
1314
|
+
} else {
|
|
1315
|
+
throw new TypeError('Schema for array path `' + path +
|
|
1316
|
+
'` is from a different copy of the Mongoose module. ' +
|
|
1317
|
+
'Please make sure you\'re using the same version ' +
|
|
1318
|
+
'of Mongoose everywhere with `npm list mongoose`. If you are still ' +
|
|
1319
|
+
'getting this error, please add `new Schema()` around the path: ' +
|
|
1320
|
+
`${path}: new Schema(...)`);
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
return new MongooseTypes.DocumentArray(path, cast, obj);
|
|
1324
|
+
}
|
|
1325
|
+
if (cast &&
|
|
1326
|
+
cast[options.typeKey] &&
|
|
1327
|
+
cast[options.typeKey].instanceOfSchema) {
|
|
1328
|
+
if (!(cast[options.typeKey] instanceof Schema)) {
|
|
1329
|
+
if (this.options._isMerging) {
|
|
1330
|
+
cast[options.typeKey] = new Schema(cast[options.typeKey]);
|
|
1331
|
+
} else {
|
|
1332
|
+
throw new TypeError('Schema for array path `' + path +
|
|
1333
|
+
'` is from a different copy of the Mongoose module. ' +
|
|
1334
|
+
'Please make sure you\'re using the same version ' +
|
|
1335
|
+
'of Mongoose everywhere with `npm list mongoose`. If you are still ' +
|
|
1336
|
+
'getting this error, please add `new Schema()` around the path: ' +
|
|
1337
|
+
`${path}: new Schema(...)`);
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
return new MongooseTypes.DocumentArray(path, cast[options.typeKey], obj, cast);
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
if (Array.isArray(cast)) {
|
|
1344
|
+
return new MongooseTypes.Array(path, this.interpretAsType(path, cast, options), obj);
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
// Handle both `new Schema({ arr: [{ subpath: String }] })` and `new Schema({ arr: [{ type: { subpath: string } }] })`
|
|
1348
|
+
const castFromTypeKey = (cast != null && cast[options.typeKey] && (options.typeKey !== 'type' || !cast.type.type)) ?
|
|
1349
|
+
cast[options.typeKey] :
|
|
1350
|
+
cast;
|
|
1351
|
+
if (typeof cast === 'string') {
|
|
1352
|
+
cast = MongooseTypes[cast.charAt(0).toUpperCase() + cast.substring(1)];
|
|
1353
|
+
} else if (utils.isPOJO(castFromTypeKey)) {
|
|
1354
|
+
if (Object.keys(castFromTypeKey).length) {
|
|
1355
|
+
// The `minimize` and `typeKey` options propagate to child schemas
|
|
1356
|
+
// declared inline, like `{ arr: [{ val: { $type: String } }] }`.
|
|
1357
|
+
// See gh-3560
|
|
1358
|
+
const childSchemaOptions = { minimize: options.minimize };
|
|
1359
|
+
if (options.typeKey) {
|
|
1360
|
+
childSchemaOptions.typeKey = options.typeKey;
|
|
1361
|
+
}
|
|
1362
|
+
// propagate 'strict' option to child schema
|
|
1363
|
+
if (options.hasOwnProperty('strict')) {
|
|
1364
|
+
childSchemaOptions.strict = options.strict;
|
|
1365
|
+
}
|
|
1366
|
+
if (options.hasOwnProperty('strictQuery')) {
|
|
1367
|
+
childSchemaOptions.strictQuery = options.strictQuery;
|
|
1368
|
+
}
|
|
1369
|
+
if (options.hasOwnProperty('toObject')) {
|
|
1370
|
+
childSchemaOptions.toObject = utils.omit(options.toObject, ['transform']);
|
|
1371
|
+
}
|
|
1372
|
+
if (options.hasOwnProperty('toJSON')) {
|
|
1373
|
+
childSchemaOptions.toJSON = utils.omit(options.toJSON, ['transform']);
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
if (this._userProvidedOptions.hasOwnProperty('_id')) {
|
|
1377
|
+
childSchemaOptions._id = this._userProvidedOptions._id;
|
|
1378
|
+
} else if (Schema.Types.DocumentArray.defaultOptions._id != null) {
|
|
1379
|
+
childSchemaOptions._id = Schema.Types.DocumentArray.defaultOptions._id;
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
const childSchema = new Schema(castFromTypeKey, childSchemaOptions);
|
|
1383
|
+
childSchema.$implicitlyCreated = true;
|
|
1384
|
+
return new MongooseTypes.DocumentArray(path, childSchema, obj);
|
|
1385
|
+
} else {
|
|
1386
|
+
// Special case: empty object becomes mixed
|
|
1387
|
+
return new MongooseTypes.Array(path, MongooseTypes.Mixed, obj);
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
if (cast) {
|
|
1392
|
+
type = cast[options.typeKey] && (options.typeKey !== 'type' || !cast.type.type)
|
|
1393
|
+
? cast[options.typeKey]
|
|
1394
|
+
: cast;
|
|
1395
|
+
|
|
1396
|
+
if (Array.isArray(type)) {
|
|
1397
|
+
return new MongooseTypes.Array(path, this.interpretAsType(path, type, options), obj);
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
name = typeof type === 'string'
|
|
1401
|
+
? type
|
|
1402
|
+
: type.schemaName || utils.getFunctionName(type);
|
|
1403
|
+
|
|
1404
|
+
// For Jest 26+, see #10296
|
|
1405
|
+
if (name === 'ClockDate') {
|
|
1406
|
+
name = 'Date';
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
if (name === void 0) {
|
|
1410
|
+
throw new TypeError('Invalid schema configuration: ' +
|
|
1411
|
+
`Could not determine the embedded type for array \`${path}\`. ` +
|
|
1412
|
+
'See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.');
|
|
1413
|
+
}
|
|
1414
|
+
if (!MongooseTypes.hasOwnProperty(name)) {
|
|
1415
|
+
throw new TypeError('Invalid schema configuration: ' +
|
|
1416
|
+
`\`${name}\` is not a valid type within the array \`${path}\`.` +
|
|
1417
|
+
'See https://bit.ly/mongoose-schematypes for a list of valid schema types.');
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
return new MongooseTypes.Array(path, cast || MongooseTypes.Mixed, obj, options);
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
if (type && type.instanceOfSchema) {
|
|
1425
|
+
return new MongooseTypes.Subdocument(type, path, obj);
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
if (Buffer.isBuffer(type)) {
|
|
1429
|
+
name = 'Buffer';
|
|
1430
|
+
} else if (typeof type === 'function' || typeof type === 'object') {
|
|
1431
|
+
name = type.schemaName || utils.getFunctionName(type);
|
|
1432
|
+
} else if (type === Types.ObjectId) {
|
|
1433
|
+
name = 'ObjectId';
|
|
1434
|
+
} else if (type === Types.Decimal128) {
|
|
1435
|
+
name = 'Decimal128';
|
|
1436
|
+
} else {
|
|
1437
|
+
name = type == null ? '' + type : type.toString();
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
if (name) {
|
|
1441
|
+
name = name.charAt(0).toUpperCase() + name.substring(1);
|
|
1442
|
+
}
|
|
1443
|
+
// Special case re: gh-7049 because the bson `ObjectID` class' capitalization
|
|
1444
|
+
// doesn't line up with Mongoose's.
|
|
1445
|
+
if (name === 'ObjectID') {
|
|
1446
|
+
name = 'ObjectId';
|
|
1447
|
+
}
|
|
1448
|
+
// For Jest 26+, see #10296
|
|
1449
|
+
if (name === 'ClockDate') {
|
|
1450
|
+
name = 'Date';
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
if (name === void 0) {
|
|
1454
|
+
throw new TypeError(`Invalid schema configuration: \`${path}\` schematype definition is ` +
|
|
1455
|
+
'invalid. See ' +
|
|
1456
|
+
'https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.');
|
|
1457
|
+
}
|
|
1458
|
+
if (MongooseTypes[name] == null) {
|
|
1459
|
+
throw new TypeError(`Invalid schema configuration: \`${name}\` is not ` +
|
|
1460
|
+
`a valid type at path \`${path}\`. See ` +
|
|
1461
|
+
'https://bit.ly/mongoose-schematypes for a list of valid schema types.');
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
const schemaType = new MongooseTypes[name](path, obj);
|
|
1465
|
+
|
|
1466
|
+
if (schemaType.$isSchemaMap) {
|
|
1467
|
+
createMapNestedSchemaType(this, schemaType, path, obj, options);
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
return schemaType;
|
|
1471
|
+
};
|
|
1472
|
+
|
|
1473
|
+
/*!
|
|
1474
|
+
* ignore
|
|
1475
|
+
*/
|
|
1476
|
+
|
|
1477
|
+
function createMapNestedSchemaType(schema, schemaType, path, obj, options) {
|
|
1478
|
+
const mapPath = path + '.$*';
|
|
1479
|
+
let _mapType = { type: {} };
|
|
1480
|
+
if (utils.hasUserDefinedProperty(obj, 'of')) {
|
|
1481
|
+
const isInlineSchema = utils.isPOJO(obj.of) &&
|
|
1482
|
+
Object.keys(obj.of).length > 0 &&
|
|
1483
|
+
!utils.hasUserDefinedProperty(obj.of, schema.options.typeKey);
|
|
1484
|
+
if (isInlineSchema) {
|
|
1485
|
+
_mapType = { [schema.options.typeKey]: new Schema(obj.of) };
|
|
1486
|
+
} else if (utils.isPOJO(obj.of)) {
|
|
1487
|
+
_mapType = Object.assign({}, obj.of);
|
|
1488
|
+
} else {
|
|
1489
|
+
_mapType = { [schema.options.typeKey]: obj.of };
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
if (_mapType[schema.options.typeKey] && _mapType[schema.options.typeKey].instanceOfSchema) {
|
|
1493
|
+
const subdocumentSchema = _mapType[schema.options.typeKey];
|
|
1494
|
+
subdocumentSchema.eachPath((subpath, type) => {
|
|
1495
|
+
if (type.options.select === true || type.options.select === false) {
|
|
1496
|
+
throw new MongooseError('Cannot use schema-level projections (`select: true` or `select: false`) within maps at path "' + path + '.' + subpath + '"');
|
|
1497
|
+
}
|
|
1498
|
+
});
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
if (utils.hasUserDefinedProperty(obj, 'ref')) {
|
|
1502
|
+
_mapType.ref = obj.ref;
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
schemaType.$__schemaType = schema.interpretAsType(mapPath, _mapType, options);
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
/**
|
|
1509
|
+
* Iterates the schemas paths similar to Array#forEach.
|
|
1510
|
+
*
|
|
1511
|
+
* The callback is passed the pathname and the schemaType instance.
|
|
1512
|
+
*
|
|
1513
|
+
* #### Example:
|
|
1514
|
+
*
|
|
1515
|
+
* const userSchema = new Schema({ name: String, registeredAt: Date });
|
|
1516
|
+
* userSchema.eachPath((pathname, schematype) => {
|
|
1517
|
+
* // Prints twice:
|
|
1518
|
+
* // name SchemaString { ... }
|
|
1519
|
+
* // registeredAt SchemaDate { ... }
|
|
1520
|
+
* console.log(pathname, schematype);
|
|
1521
|
+
* });
|
|
1522
|
+
*
|
|
1523
|
+
* @param {Function} fn callback function
|
|
1524
|
+
* @return {Schema} this
|
|
1525
|
+
* @api public
|
|
1526
|
+
*/
|
|
1527
|
+
|
|
1528
|
+
Schema.prototype.eachPath = function(fn) {
|
|
1529
|
+
const keys = Object.keys(this.paths);
|
|
1530
|
+
const len = keys.length;
|
|
1531
|
+
|
|
1532
|
+
for (let i = 0; i < len; ++i) {
|
|
1533
|
+
fn(keys[i], this.paths[keys[i]]);
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
return this;
|
|
1537
|
+
};
|
|
1538
|
+
|
|
1539
|
+
/**
|
|
1540
|
+
* Returns an Array of path strings that are required by this schema.
|
|
1541
|
+
*
|
|
1542
|
+
* #### Example:
|
|
1543
|
+
*
|
|
1544
|
+
* const s = new Schema({
|
|
1545
|
+
* name: { type: String, required: true },
|
|
1546
|
+
* age: { type: String, required: true },
|
|
1547
|
+
* notes: String
|
|
1548
|
+
* });
|
|
1549
|
+
* s.requiredPaths(); // [ 'age', 'name' ]
|
|
1550
|
+
*
|
|
1551
|
+
* @api public
|
|
1552
|
+
* @param {Boolean} invalidate Refresh the cache
|
|
1553
|
+
* @return {Array}
|
|
1554
|
+
*/
|
|
1555
|
+
|
|
1556
|
+
Schema.prototype.requiredPaths = function requiredPaths(invalidate) {
|
|
1557
|
+
if (this._requiredpaths && !invalidate) {
|
|
1558
|
+
return this._requiredpaths;
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
const paths = Object.keys(this.paths);
|
|
1562
|
+
let i = paths.length;
|
|
1563
|
+
const ret = [];
|
|
1564
|
+
|
|
1565
|
+
while (i--) {
|
|
1566
|
+
const path = paths[i];
|
|
1567
|
+
if (this.paths[path].isRequired) {
|
|
1568
|
+
ret.push(path);
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
this._requiredpaths = ret;
|
|
1572
|
+
return this._requiredpaths;
|
|
1573
|
+
};
|
|
1574
|
+
|
|
1575
|
+
/**
|
|
1576
|
+
* Returns indexes from fields and schema-level indexes (cached).
|
|
1577
|
+
*
|
|
1578
|
+
* @api private
|
|
1579
|
+
* @return {Array}
|
|
1580
|
+
*/
|
|
1581
|
+
|
|
1582
|
+
Schema.prototype.indexedPaths = function indexedPaths() {
|
|
1583
|
+
if (this._indexedpaths) {
|
|
1584
|
+
return this._indexedpaths;
|
|
1585
|
+
}
|
|
1586
|
+
this._indexedpaths = this.indexes();
|
|
1587
|
+
return this._indexedpaths;
|
|
1588
|
+
};
|
|
1589
|
+
|
|
1590
|
+
/**
|
|
1591
|
+
* Returns the pathType of `path` for this schema.
|
|
1592
|
+
*
|
|
1593
|
+
* Given a path, returns whether it is a real, virtual, nested, or ad-hoc/undefined path.
|
|
1594
|
+
*
|
|
1595
|
+
* #### Example:
|
|
1596
|
+
*
|
|
1597
|
+
* const s = new Schema({ name: String, nested: { foo: String } });
|
|
1598
|
+
* s.virtual('foo').get(() => 42);
|
|
1599
|
+
* s.pathType('name'); // "real"
|
|
1600
|
+
* s.pathType('nested'); // "nested"
|
|
1601
|
+
* s.pathType('foo'); // "virtual"
|
|
1602
|
+
* s.pathType('fail'); // "adhocOrUndefined"
|
|
1603
|
+
*
|
|
1604
|
+
* @param {String} path
|
|
1605
|
+
* @return {String}
|
|
1606
|
+
* @api public
|
|
1607
|
+
*/
|
|
1608
|
+
|
|
1609
|
+
Schema.prototype.pathType = function(path) {
|
|
1610
|
+
if (this.paths.hasOwnProperty(path)) {
|
|
1611
|
+
return 'real';
|
|
1612
|
+
}
|
|
1613
|
+
if (this.virtuals.hasOwnProperty(path)) {
|
|
1614
|
+
return 'virtual';
|
|
1615
|
+
}
|
|
1616
|
+
if (this.nested.hasOwnProperty(path)) {
|
|
1617
|
+
return 'nested';
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
// Convert to '.$' to check subpaths re: gh-6405
|
|
1621
|
+
const cleanPath = _pathToPositionalSyntax(path);
|
|
1622
|
+
|
|
1623
|
+
if (this.subpaths.hasOwnProperty(cleanPath) || this.subpaths.hasOwnProperty(path)) {
|
|
1624
|
+
return 'real';
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
const singleNestedPath = this.singleNestedPaths.hasOwnProperty(cleanPath) || this.singleNestedPaths.hasOwnProperty(path);
|
|
1628
|
+
if (singleNestedPath) {
|
|
1629
|
+
return singleNestedPath === 'nested' ? 'nested' : 'real';
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
// Look for maps
|
|
1633
|
+
const mapPath = getMapPath(this, path);
|
|
1634
|
+
if (mapPath != null) {
|
|
1635
|
+
return 'real';
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
if (/\.\d+\.|\.\d+$/.test(path)) {
|
|
1639
|
+
return getPositionalPathType(this, path, cleanPath);
|
|
1640
|
+
}
|
|
1641
|
+
return 'adhocOrUndefined';
|
|
1642
|
+
};
|
|
1643
|
+
|
|
1644
|
+
/**
|
|
1645
|
+
* Returns true iff this path is a child of a mixed schema.
|
|
1646
|
+
*
|
|
1647
|
+
* @param {String} path
|
|
1648
|
+
* @return {Boolean}
|
|
1649
|
+
* @api private
|
|
1650
|
+
*/
|
|
1651
|
+
|
|
1652
|
+
Schema.prototype.hasMixedParent = function(path) {
|
|
1653
|
+
const subpaths = path.split(/\./g);
|
|
1654
|
+
path = '';
|
|
1655
|
+
for (let i = 0; i < subpaths.length; ++i) {
|
|
1656
|
+
path = i > 0 ? path + '.' + subpaths[i] : subpaths[i];
|
|
1657
|
+
if (this.paths.hasOwnProperty(path) &&
|
|
1658
|
+
this.paths[path] instanceof MongooseTypes.Mixed) {
|
|
1659
|
+
return this.paths[path];
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
return null;
|
|
1664
|
+
};
|
|
1665
|
+
|
|
1666
|
+
/**
|
|
1667
|
+
* Setup updatedAt and createdAt timestamps to documents if enabled
|
|
1668
|
+
*
|
|
1669
|
+
* @param {Boolean|Object} timestamps timestamps options
|
|
1670
|
+
* @api private
|
|
1671
|
+
*/
|
|
1672
|
+
Schema.prototype.setupTimestamp = function(timestamps) {
|
|
1673
|
+
return setupTimestamps(this, timestamps);
|
|
1674
|
+
};
|
|
1675
|
+
|
|
1676
|
+
/**
|
|
1677
|
+
* ignore. Deprecated re: #6405
|
|
1678
|
+
* @param {Any} self
|
|
1679
|
+
* @param {String} path
|
|
1680
|
+
* @api private
|
|
1681
|
+
*/
|
|
1682
|
+
|
|
1683
|
+
function getPositionalPathType(self, path, cleanPath) {
|
|
1684
|
+
const subpaths = path.split(/\.(\d+)\.|\.(\d+)$/).filter(Boolean);
|
|
1685
|
+
if (subpaths.length < 2) {
|
|
1686
|
+
return self.paths.hasOwnProperty(subpaths[0]) ?
|
|
1687
|
+
self.paths[subpaths[0]] :
|
|
1688
|
+
'adhocOrUndefined';
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
let val = self.path(subpaths[0]);
|
|
1692
|
+
let isNested = false;
|
|
1693
|
+
if (!val) {
|
|
1694
|
+
return 'adhocOrUndefined';
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
const last = subpaths.length - 1;
|
|
1698
|
+
|
|
1699
|
+
for (let i = 1; i < subpaths.length; ++i) {
|
|
1700
|
+
isNested = false;
|
|
1701
|
+
const subpath = subpaths[i];
|
|
1702
|
+
|
|
1703
|
+
if (i === last && val && !/\D/.test(subpath)) {
|
|
1704
|
+
if (val.$isMongooseDocumentArray) {
|
|
1705
|
+
val = val.$embeddedSchemaType;
|
|
1706
|
+
} else if (val instanceof MongooseTypes.Array) {
|
|
1707
|
+
// StringSchema, NumberSchema, etc
|
|
1708
|
+
val = val.caster;
|
|
1709
|
+
} else {
|
|
1710
|
+
val = undefined;
|
|
1711
|
+
}
|
|
1712
|
+
break;
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
// ignore if its just a position segment: path.0.subpath
|
|
1716
|
+
if (!/\D/.test(subpath)) {
|
|
1717
|
+
// Nested array
|
|
1718
|
+
if (val instanceof MongooseTypes.Array && i !== last) {
|
|
1719
|
+
val = val.caster;
|
|
1720
|
+
}
|
|
1721
|
+
continue;
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
if (!(val && val.schema)) {
|
|
1725
|
+
val = undefined;
|
|
1726
|
+
break;
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
const type = val.schema.pathType(subpath);
|
|
1730
|
+
isNested = (type === 'nested');
|
|
1731
|
+
val = val.schema.path(subpath);
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
self.subpaths[cleanPath] = val;
|
|
1735
|
+
if (val) {
|
|
1736
|
+
return 'real';
|
|
1737
|
+
}
|
|
1738
|
+
if (isNested) {
|
|
1739
|
+
return 'nested';
|
|
1740
|
+
}
|
|
1741
|
+
return 'adhocOrUndefined';
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
|
|
1745
|
+
/*!
|
|
1746
|
+
* ignore
|
|
1747
|
+
*/
|
|
1748
|
+
|
|
1749
|
+
function getPositionalPath(self, path, cleanPath) {
|
|
1750
|
+
getPositionalPathType(self, path, cleanPath);
|
|
1751
|
+
return self.subpaths[cleanPath];
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
/**
|
|
1755
|
+
* Adds a method call to the queue.
|
|
1756
|
+
*
|
|
1757
|
+
* #### Example:
|
|
1758
|
+
*
|
|
1759
|
+
* schema.methods.print = function() { console.log(this); };
|
|
1760
|
+
* schema.queue('print', []); // Print the doc every one is instantiated
|
|
1761
|
+
*
|
|
1762
|
+
* const Model = mongoose.model('Test', schema);
|
|
1763
|
+
* new Model({ name: 'test' }); // Prints '{"_id": ..., "name": "test" }'
|
|
1764
|
+
*
|
|
1765
|
+
* @param {String} name name of the document method to call later
|
|
1766
|
+
* @param {Array} args arguments to pass to the method
|
|
1767
|
+
* @api public
|
|
1768
|
+
*/
|
|
1769
|
+
|
|
1770
|
+
Schema.prototype.queue = function(name, args) {
|
|
1771
|
+
this.callQueue.push([name, args]);
|
|
1772
|
+
return this;
|
|
1773
|
+
};
|
|
1774
|
+
|
|
1775
|
+
/**
|
|
1776
|
+
* Defines a pre hook for the model.
|
|
1777
|
+
*
|
|
1778
|
+
* #### Example:
|
|
1779
|
+
*
|
|
1780
|
+
* const toySchema = new Schema({ name: String, created: Date });
|
|
1781
|
+
*
|
|
1782
|
+
* toySchema.pre('save', function(next) {
|
|
1783
|
+
* if (!this.created) this.created = new Date;
|
|
1784
|
+
* next();
|
|
1785
|
+
* });
|
|
1786
|
+
*
|
|
1787
|
+
* toySchema.pre('validate', function(next) {
|
|
1788
|
+
* if (this.name !== 'Woody') this.name = 'Woody';
|
|
1789
|
+
* next();
|
|
1790
|
+
* });
|
|
1791
|
+
*
|
|
1792
|
+
* // Equivalent to calling `pre()` on `find`, `findOne`, `findOneAndUpdate`.
|
|
1793
|
+
* toySchema.pre(/^find/, function(next) {
|
|
1794
|
+
* console.log(this.getFilter());
|
|
1795
|
+
* });
|
|
1796
|
+
*
|
|
1797
|
+
* // Equivalent to calling `pre()` on `updateOne`, `findOneAndUpdate`.
|
|
1798
|
+
* toySchema.pre(['updateOne', 'findOneAndUpdate'], function(next) {
|
|
1799
|
+
* console.log(this.getFilter());
|
|
1800
|
+
* });
|
|
1801
|
+
*
|
|
1802
|
+
* toySchema.pre('deleteOne', function() {
|
|
1803
|
+
* // Runs when you call `Toy.deleteOne()`
|
|
1804
|
+
* });
|
|
1805
|
+
*
|
|
1806
|
+
* toySchema.pre('deleteOne', { document: true }, function() {
|
|
1807
|
+
* // Runs when you call `doc.deleteOne()`
|
|
1808
|
+
* });
|
|
1809
|
+
*
|
|
1810
|
+
* @param {String|RegExp|String[]} methodName The method name or regular expression to match method name
|
|
1811
|
+
* @param {Object} [options]
|
|
1812
|
+
* @param {Boolean} [options.document] If `name` is a hook for both document and query middleware, set to `true` to run on document middleware. For example, set `options.document` to `true` to apply this hook to `Document#deleteOne()` rather than `Query#deleteOne()`.
|
|
1813
|
+
* @param {Boolean} [options.query] If `name` is a hook for both document and query middleware, set to `true` to run on query middleware.
|
|
1814
|
+
* @param {Function} callback
|
|
1815
|
+
* @api public
|
|
1816
|
+
*/
|
|
1817
|
+
|
|
1818
|
+
Schema.prototype.pre = function(name) {
|
|
1819
|
+
if (name instanceof RegExp) {
|
|
1820
|
+
const remainingArgs = Array.prototype.slice.call(arguments, 1);
|
|
1821
|
+
for (const fn of hookNames) {
|
|
1822
|
+
if (name.test(fn)) {
|
|
1823
|
+
this.pre.apply(this, [fn].concat(remainingArgs));
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
return this;
|
|
1827
|
+
}
|
|
1828
|
+
if (Array.isArray(name)) {
|
|
1829
|
+
const remainingArgs = Array.prototype.slice.call(arguments, 1);
|
|
1830
|
+
for (const el of name) {
|
|
1831
|
+
this.pre.apply(this, [el].concat(remainingArgs));
|
|
1832
|
+
}
|
|
1833
|
+
return this;
|
|
1834
|
+
}
|
|
1835
|
+
this.s.hooks.pre.apply(this.s.hooks, arguments);
|
|
1836
|
+
return this;
|
|
1837
|
+
};
|
|
1838
|
+
|
|
1839
|
+
/**
|
|
1840
|
+
* Defines a post hook for the document
|
|
1841
|
+
*
|
|
1842
|
+
* const schema = new Schema(..);
|
|
1843
|
+
* schema.post('save', function (doc) {
|
|
1844
|
+
* console.log('this fired after a document was saved');
|
|
1845
|
+
* });
|
|
1846
|
+
*
|
|
1847
|
+
* schema.post('find', function(docs) {
|
|
1848
|
+
* console.log('this fired after you ran a find query');
|
|
1849
|
+
* });
|
|
1850
|
+
*
|
|
1851
|
+
* schema.post(/Many$/, function(res) {
|
|
1852
|
+
* console.log('this fired after you ran `updateMany()` or `deleteMany()`');
|
|
1853
|
+
* });
|
|
1854
|
+
*
|
|
1855
|
+
* const Model = mongoose.model('Model', schema);
|
|
1856
|
+
*
|
|
1857
|
+
* const m = new Model(..);
|
|
1858
|
+
* m.save(function(err) {
|
|
1859
|
+
* console.log('this fires after the `post` hook');
|
|
1860
|
+
* });
|
|
1861
|
+
*
|
|
1862
|
+
* m.find(function(err, docs) {
|
|
1863
|
+
* console.log('this fires after the post find hook');
|
|
1864
|
+
* });
|
|
1865
|
+
*
|
|
1866
|
+
* @param {String|RegExp|String[]} methodName The method name or regular expression to match method name
|
|
1867
|
+
* @param {Object} [options]
|
|
1868
|
+
* @param {Boolean} [options.document] If `name` is a hook for both document and query middleware, set to `true` to run on document middleware.
|
|
1869
|
+
* @param {Boolean} [options.query] If `name` is a hook for both document and query middleware, set to `true` to run on query middleware.
|
|
1870
|
+
* @param {Function} fn callback
|
|
1871
|
+
* @see middleware https://mongoosejs.com/docs/middleware.html
|
|
1872
|
+
* @see kareem https://npmjs.org/package/kareem
|
|
1873
|
+
* @api public
|
|
1874
|
+
*/
|
|
1875
|
+
|
|
1876
|
+
Schema.prototype.post = function(name) {
|
|
1877
|
+
if (name instanceof RegExp) {
|
|
1878
|
+
const remainingArgs = Array.prototype.slice.call(arguments, 1);
|
|
1879
|
+
for (const fn of hookNames) {
|
|
1880
|
+
if (name.test(fn)) {
|
|
1881
|
+
this.post.apply(this, [fn].concat(remainingArgs));
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
return this;
|
|
1885
|
+
}
|
|
1886
|
+
if (Array.isArray(name)) {
|
|
1887
|
+
const remainingArgs = Array.prototype.slice.call(arguments, 1);
|
|
1888
|
+
for (const el of name) {
|
|
1889
|
+
this.post.apply(this, [el].concat(remainingArgs));
|
|
1890
|
+
}
|
|
1891
|
+
return this;
|
|
1892
|
+
}
|
|
1893
|
+
this.s.hooks.post.apply(this.s.hooks, arguments);
|
|
1894
|
+
return this;
|
|
1895
|
+
};
|
|
1896
|
+
|
|
1897
|
+
/**
|
|
1898
|
+
* Registers a plugin for this schema.
|
|
1899
|
+
*
|
|
1900
|
+
* #### Example:
|
|
1901
|
+
*
|
|
1902
|
+
* const s = new Schema({ name: String });
|
|
1903
|
+
* s.plugin(schema => console.log(schema.path('name').path));
|
|
1904
|
+
* mongoose.model('Test', s); // Prints 'name'
|
|
1905
|
+
*
|
|
1906
|
+
* Or with Options:
|
|
1907
|
+
*
|
|
1908
|
+
* const s = new Schema({ name: String });
|
|
1909
|
+
* s.plugin((schema, opts) => console.log(opts.text, schema.path('name').path), { text: "Schema Path Name:" });
|
|
1910
|
+
* mongoose.model('Test', s); // Prints 'Schema Path Name: name'
|
|
1911
|
+
*
|
|
1912
|
+
* @param {Function} plugin The Plugin's callback
|
|
1913
|
+
* @param {Object} [opts] Options to pass to the plugin
|
|
1914
|
+
* @param {Boolean} [opts.deduplicate=false] If true, ignore duplicate plugins (same `fn` argument using `===`)
|
|
1915
|
+
* @see plugins https://mongoosejs.com/docs/plugins.html
|
|
1916
|
+
* @api public
|
|
1917
|
+
*/
|
|
1918
|
+
|
|
1919
|
+
Schema.prototype.plugin = function(fn, opts) {
|
|
1920
|
+
if (typeof fn !== 'function') {
|
|
1921
|
+
throw new Error('First param to `schema.plugin()` must be a function, ' +
|
|
1922
|
+
'got "' + (typeof fn) + '"');
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
|
|
1926
|
+
if (opts && opts.deduplicate) {
|
|
1927
|
+
for (const plugin of this.plugins) {
|
|
1928
|
+
if (plugin.fn === fn) {
|
|
1929
|
+
return this;
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
this.plugins.push({ fn: fn, opts: opts });
|
|
1934
|
+
|
|
1935
|
+
fn(this, opts);
|
|
1936
|
+
return this;
|
|
1937
|
+
};
|
|
1938
|
+
|
|
1939
|
+
/**
|
|
1940
|
+
* Adds an instance method to documents constructed from Models compiled from this schema.
|
|
1941
|
+
*
|
|
1942
|
+
* #### Example:
|
|
1943
|
+
*
|
|
1944
|
+
* const schema = kittySchema = new Schema(..);
|
|
1945
|
+
*
|
|
1946
|
+
* schema.method('meow', function () {
|
|
1947
|
+
* console.log('meeeeeoooooooooooow');
|
|
1948
|
+
* })
|
|
1949
|
+
*
|
|
1950
|
+
* const Kitty = mongoose.model('Kitty', schema);
|
|
1951
|
+
*
|
|
1952
|
+
* const fizz = new Kitty;
|
|
1953
|
+
* fizz.meow(); // meeeeeooooooooooooow
|
|
1954
|
+
*
|
|
1955
|
+
* If a hash of name/fn pairs is passed as the only argument, each name/fn pair will be added as methods.
|
|
1956
|
+
*
|
|
1957
|
+
* schema.method({
|
|
1958
|
+
* purr: function () {}
|
|
1959
|
+
* , scratch: function () {}
|
|
1960
|
+
* });
|
|
1961
|
+
*
|
|
1962
|
+
* // later
|
|
1963
|
+
* const fizz = new Kitty;
|
|
1964
|
+
* fizz.purr();
|
|
1965
|
+
* fizz.scratch();
|
|
1966
|
+
*
|
|
1967
|
+
* NOTE: `Schema.method()` adds instance methods to the `Schema.methods` object. You can also add instance methods directly to the `Schema.methods` object as seen in the [guide](https://mongoosejs.com/docs/guide.html#methods)
|
|
1968
|
+
*
|
|
1969
|
+
* @param {String|Object} name The Method Name for a single function, or a Object of "string-function" pairs.
|
|
1970
|
+
* @param {Function} [fn] The Function in a single-function definition.
|
|
1971
|
+
* @api public
|
|
1972
|
+
*/
|
|
1973
|
+
|
|
1974
|
+
Schema.prototype.method = function(name, fn, options) {
|
|
1975
|
+
if (typeof name !== 'string') {
|
|
1976
|
+
for (const i in name) {
|
|
1977
|
+
this.methods[i] = name[i];
|
|
1978
|
+
this.methodOptions[i] = clone(options);
|
|
1979
|
+
}
|
|
1980
|
+
} else {
|
|
1981
|
+
this.methods[name] = fn;
|
|
1982
|
+
this.methodOptions[name] = clone(options);
|
|
1983
|
+
}
|
|
1984
|
+
return this;
|
|
1985
|
+
};
|
|
1986
|
+
|
|
1987
|
+
/**
|
|
1988
|
+
* Adds static "class" methods to Models compiled from this schema.
|
|
1989
|
+
*
|
|
1990
|
+
* #### Example:
|
|
1991
|
+
*
|
|
1992
|
+
* const schema = new Schema(..);
|
|
1993
|
+
* // Equivalent to `schema.statics.findByName = function(name) {}`;
|
|
1994
|
+
* schema.static('findByName', function(name) {
|
|
1995
|
+
* return this.find({ name: name });
|
|
1996
|
+
* });
|
|
1997
|
+
*
|
|
1998
|
+
* const Drink = mongoose.model('Drink', schema);
|
|
1999
|
+
* await Drink.findByName('LaCroix');
|
|
2000
|
+
*
|
|
2001
|
+
* If a hash of name/fn pairs is passed as the only argument, each name/fn pair will be added as methods.
|
|
2002
|
+
*
|
|
2003
|
+
* schema.static({
|
|
2004
|
+
* findByName: function () {..}
|
|
2005
|
+
* , findByCost: function () {..}
|
|
2006
|
+
* });
|
|
2007
|
+
*
|
|
2008
|
+
* const Drink = mongoose.model('Drink', schema);
|
|
2009
|
+
* await Drink.findByName('LaCroix');
|
|
2010
|
+
* await Drink.findByCost(3);
|
|
2011
|
+
*
|
|
2012
|
+
* If a hash of name/fn pairs is passed as the only argument, each name/fn pair will be added as statics.
|
|
2013
|
+
*
|
|
2014
|
+
* @param {String|Object} name The Method Name for a single function, or a Object of "string-function" pairs.
|
|
2015
|
+
* @param {Function} [fn] The Function in a single-function definition.
|
|
2016
|
+
* @api public
|
|
2017
|
+
* @see Statics https://mongoosejs.com/docs/guide.html#statics
|
|
2018
|
+
*/
|
|
2019
|
+
|
|
2020
|
+
Schema.prototype.static = function(name, fn) {
|
|
2021
|
+
if (typeof name !== 'string') {
|
|
2022
|
+
for (const i in name) {
|
|
2023
|
+
this.statics[i] = name[i];
|
|
2024
|
+
}
|
|
2025
|
+
} else {
|
|
2026
|
+
this.statics[name] = fn;
|
|
2027
|
+
}
|
|
2028
|
+
return this;
|
|
2029
|
+
};
|
|
2030
|
+
|
|
2031
|
+
/**
|
|
2032
|
+
* Defines an index (most likely compound) for this schema.
|
|
2033
|
+
*
|
|
2034
|
+
* #### Example:
|
|
2035
|
+
*
|
|
2036
|
+
* schema.index({ first: 1, last: -1 })
|
|
2037
|
+
*
|
|
2038
|
+
* @param {Object} fields The Fields to index, with the order, available values: `1 | -1 | '2d' | '2dsphere' | 'geoHaystack' | 'hashed' | 'text'`
|
|
2039
|
+
* @param {Object} [options] Options to pass to [MongoDB driver's `createIndex()` function](https://mongodb.github.io/node-mongodb-native/4.9/classes/Collection.html#createIndex)
|
|
2040
|
+
* @param {String | number} [options.expires=null] Mongoose-specific syntactic sugar, uses [ms](https://www.npmjs.com/package/ms) to convert `expires` option into seconds for the `expireAfterSeconds` in the above link.
|
|
2041
|
+
* @param {String} [options.language_override=null] Tells mongodb to use the specified field instead of `language` for parsing text indexes.
|
|
2042
|
+
* @api public
|
|
2043
|
+
*/
|
|
2044
|
+
|
|
2045
|
+
Schema.prototype.index = function(fields, options) {
|
|
2046
|
+
fields || (fields = {});
|
|
2047
|
+
options || (options = {});
|
|
2048
|
+
|
|
2049
|
+
if (options.expires) {
|
|
2050
|
+
utils.expires(options);
|
|
2051
|
+
}
|
|
2052
|
+
for (const key in fields) {
|
|
2053
|
+
if (this.aliases[key]) {
|
|
2054
|
+
fields[this.aliases[key]] = fields[key];
|
|
2055
|
+
delete fields[key];
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
for (const field of Object.keys(fields)) {
|
|
2060
|
+
if (fields[field] === 'ascending' || fields[field] === 'asc') {
|
|
2061
|
+
fields[field] = 1;
|
|
2062
|
+
} else if (fields[field] === 'descending' || fields[field] === 'desc') {
|
|
2063
|
+
fields[field] = -1;
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
this._indexes.push([fields, options]);
|
|
2068
|
+
return this;
|
|
2069
|
+
};
|
|
2070
|
+
|
|
2071
|
+
/**
|
|
2072
|
+
* Sets a schema option.
|
|
2073
|
+
*
|
|
2074
|
+
* #### Example:
|
|
2075
|
+
*
|
|
2076
|
+
* schema.set('strict'); // 'true' by default
|
|
2077
|
+
* schema.set('strict', false); // Sets 'strict' to false
|
|
2078
|
+
* schema.set('strict'); // 'false'
|
|
2079
|
+
*
|
|
2080
|
+
* @param {String} key The name of the option to set the value to
|
|
2081
|
+
* @param {Object} [value] The value to set the option to, if not passed, the option will be reset to default
|
|
2082
|
+
* @param {Array<string>} [tags] tags to add to read preference if key === 'read'
|
|
2083
|
+
* @see Schema https://mongoosejs.com/docs/api/schema.html#Schema()
|
|
2084
|
+
* @api public
|
|
2085
|
+
*/
|
|
2086
|
+
|
|
2087
|
+
Schema.prototype.set = function(key, value, tags) {
|
|
2088
|
+
if (arguments.length === 1) {
|
|
2089
|
+
return this.options[key];
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
switch (key) {
|
|
2093
|
+
case 'read':
|
|
2094
|
+
if (typeof value === 'string') {
|
|
2095
|
+
this.options[key] = { mode: handleReadPreferenceAliases(value), tags };
|
|
2096
|
+
} else if (Array.isArray(value) && typeof value[0] === 'string') {
|
|
2097
|
+
this.options[key] = {
|
|
2098
|
+
mode: handleReadPreferenceAliases(value[0]),
|
|
2099
|
+
tags: value[1]
|
|
2100
|
+
};
|
|
2101
|
+
} else {
|
|
2102
|
+
this.options[key] = value;
|
|
2103
|
+
}
|
|
2104
|
+
this._userProvidedOptions[key] = this.options[key];
|
|
2105
|
+
break;
|
|
2106
|
+
case 'timestamps':
|
|
2107
|
+
this.setupTimestamp(value);
|
|
2108
|
+
this.options[key] = value;
|
|
2109
|
+
this._userProvidedOptions[key] = this.options[key];
|
|
2110
|
+
break;
|
|
2111
|
+
case '_id':
|
|
2112
|
+
this.options[key] = value;
|
|
2113
|
+
this._userProvidedOptions[key] = this.options[key];
|
|
2114
|
+
|
|
2115
|
+
if (value && !this.paths['_id']) {
|
|
2116
|
+
addAutoId(this);
|
|
2117
|
+
} else if (!value && this.paths['_id'] != null && this.paths['_id'].auto) {
|
|
2118
|
+
this.remove('_id');
|
|
2119
|
+
}
|
|
2120
|
+
break;
|
|
2121
|
+
default:
|
|
2122
|
+
this.options[key] = value;
|
|
2123
|
+
this._userProvidedOptions[key] = this.options[key];
|
|
2124
|
+
break;
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
// Propagate `strict` and `strictQuery` changes down to implicitly created schemas
|
|
2128
|
+
if (key === 'strict') {
|
|
2129
|
+
_propagateOptionsToImplicitlyCreatedSchemas(this, { strict: value });
|
|
2130
|
+
}
|
|
2131
|
+
if (key === 'strictQuery') {
|
|
2132
|
+
_propagateOptionsToImplicitlyCreatedSchemas(this, { strictQuery: value });
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
return this;
|
|
2136
|
+
};
|
|
2137
|
+
|
|
2138
|
+
/*!
|
|
2139
|
+
* Recursively set options on implicitly created schemas
|
|
2140
|
+
*/
|
|
2141
|
+
|
|
2142
|
+
function _propagateOptionsToImplicitlyCreatedSchemas(baseSchema, options) {
|
|
2143
|
+
for (const { schema } of baseSchema.childSchemas) {
|
|
2144
|
+
if (!schema.$implicitlyCreated) {
|
|
2145
|
+
continue;
|
|
2146
|
+
}
|
|
2147
|
+
Object.assign(schema.options, options);
|
|
2148
|
+
_propagateOptionsToImplicitlyCreatedSchemas(schema, options);
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
|
|
2152
|
+
/**
|
|
2153
|
+
* Gets a schema option.
|
|
2154
|
+
*
|
|
2155
|
+
* #### Example:
|
|
2156
|
+
*
|
|
2157
|
+
* schema.get('strict'); // true
|
|
2158
|
+
* schema.set('strict', false);
|
|
2159
|
+
* schema.get('strict'); // false
|
|
2160
|
+
*
|
|
2161
|
+
* @param {String} key The name of the Option to get the current value for
|
|
2162
|
+
* @api public
|
|
2163
|
+
* @return {Any} the option's value
|
|
2164
|
+
*/
|
|
2165
|
+
|
|
2166
|
+
Schema.prototype.get = function(key) {
|
|
2167
|
+
return this.options[key];
|
|
2168
|
+
};
|
|
2169
|
+
|
|
2170
|
+
const indexTypes = '2d 2dsphere hashed text'.split(' ');
|
|
2171
|
+
|
|
2172
|
+
/**
|
|
2173
|
+
* The allowed index types
|
|
2174
|
+
*
|
|
2175
|
+
* @property {String[]} indexTypes
|
|
2176
|
+
* @memberOf Schema
|
|
2177
|
+
* @static
|
|
2178
|
+
* @api public
|
|
2179
|
+
*/
|
|
2180
|
+
|
|
2181
|
+
Object.defineProperty(Schema, 'indexTypes', {
|
|
2182
|
+
get: function() {
|
|
2183
|
+
return indexTypes;
|
|
2184
|
+
},
|
|
2185
|
+
set: function() {
|
|
2186
|
+
throw new Error('Cannot overwrite Schema.indexTypes');
|
|
2187
|
+
}
|
|
2188
|
+
});
|
|
2189
|
+
|
|
2190
|
+
/**
|
|
2191
|
+
* Returns a list of indexes that this schema declares, via `schema.index()` or by `index: true` in a path's options.
|
|
2192
|
+
* Indexes are expressed as an array `[spec, options]`.
|
|
2193
|
+
*
|
|
2194
|
+
* #### Example:
|
|
2195
|
+
*
|
|
2196
|
+
* const userSchema = new Schema({
|
|
2197
|
+
* email: { type: String, required: true, unique: true },
|
|
2198
|
+
* registeredAt: { type: Date, index: true }
|
|
2199
|
+
* });
|
|
2200
|
+
*
|
|
2201
|
+
* // [ [ { email: 1 }, { unique: true, background: true } ],
|
|
2202
|
+
* // [ { registeredAt: 1 }, { background: true } ] ]
|
|
2203
|
+
* userSchema.indexes();
|
|
2204
|
+
*
|
|
2205
|
+
* [Plugins](https://mongoosejs.com/docs/plugins.html) can use the return value of this function to modify a schema's indexes.
|
|
2206
|
+
* For example, the below plugin makes every index unique by default.
|
|
2207
|
+
*
|
|
2208
|
+
* function myPlugin(schema) {
|
|
2209
|
+
* for (const index of schema.indexes()) {
|
|
2210
|
+
* if (index[1].unique === undefined) {
|
|
2211
|
+
* index[1].unique = true;
|
|
2212
|
+
* }
|
|
2213
|
+
* }
|
|
2214
|
+
* }
|
|
2215
|
+
*
|
|
2216
|
+
* @api public
|
|
2217
|
+
* @return {Array} list of indexes defined in the schema
|
|
2218
|
+
*/
|
|
2219
|
+
|
|
2220
|
+
Schema.prototype.indexes = function() {
|
|
2221
|
+
return getIndexes(this);
|
|
2222
|
+
};
|
|
2223
|
+
|
|
2224
|
+
/**
|
|
2225
|
+
* Creates a virtual type with the given name.
|
|
2226
|
+
*
|
|
2227
|
+
* @param {String} name The name of the Virtual
|
|
2228
|
+
* @param {Object} [options]
|
|
2229
|
+
* @param {String|Model} [options.ref] model name or model instance. Marks this as a [populate virtual](https://mongoosejs.com/docs/populate.html#populate-virtuals).
|
|
2230
|
+
* @param {String|Function} [options.localField] Required for populate virtuals. See [populate virtual docs](https://mongoosejs.com/docs/populate.html#populate-virtuals) for more information.
|
|
2231
|
+
* @param {String|Function} [options.foreignField] Required for populate virtuals. See [populate virtual docs](https://mongoosejs.com/docs/populate.html#populate-virtuals) for more information.
|
|
2232
|
+
* @param {Boolean|Function} [options.justOne=false] Only works with populate virtuals. If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), will be a single doc or `null`. Otherwise, the populate virtual will be an array.
|
|
2233
|
+
* @param {Boolean} [options.count=false] Only works with populate virtuals. If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), this populate virtual will contain the number of documents rather than the documents themselves when you `populate()`.
|
|
2234
|
+
* @param {Function|null} [options.get=null] Adds a [getter](https://mongoosejs.com/docs/tutorials/getters-setters.html) to this virtual to transform the populated doc.
|
|
2235
|
+
* @param {Object|Function} [options.match=null] Apply a default [`match` option to populate](https://mongoosejs.com/docs/populate.html#match), adding an additional filter to the populate query.
|
|
2236
|
+
* @return {VirtualType}
|
|
2237
|
+
*/
|
|
2238
|
+
|
|
2239
|
+
Schema.prototype.virtual = function(name, options) {
|
|
2240
|
+
if (name instanceof VirtualType || getConstructorName(name) === 'VirtualType') {
|
|
2241
|
+
return this.virtual(name.path, name.options);
|
|
2242
|
+
}
|
|
2243
|
+
options = new VirtualOptions(options);
|
|
2244
|
+
|
|
2245
|
+
if (utils.hasUserDefinedProperty(options, ['ref', 'refPath'])) {
|
|
2246
|
+
if (options.localField == null) {
|
|
2247
|
+
throw new Error('Reference virtuals require `localField` option');
|
|
2248
|
+
}
|
|
2249
|
+
|
|
2250
|
+
if (options.foreignField == null) {
|
|
2251
|
+
throw new Error('Reference virtuals require `foreignField` option');
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
this.pre('init', function virtualPreInit(obj) {
|
|
2255
|
+
if (mpath.has(name, obj)) {
|
|
2256
|
+
const _v = mpath.get(name, obj);
|
|
2257
|
+
if (!this.$$populatedVirtuals) {
|
|
2258
|
+
this.$$populatedVirtuals = {};
|
|
2259
|
+
}
|
|
2260
|
+
|
|
2261
|
+
if (options.justOne || options.count) {
|
|
2262
|
+
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
|
|
2263
|
+
_v[0] :
|
|
2264
|
+
_v;
|
|
2265
|
+
} else {
|
|
2266
|
+
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
|
|
2267
|
+
_v :
|
|
2268
|
+
_v == null ? [] : [_v];
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
mpath.unset(name, obj);
|
|
2272
|
+
}
|
|
2273
|
+
});
|
|
2274
|
+
|
|
2275
|
+
const virtual = this.virtual(name);
|
|
2276
|
+
virtual.options = options;
|
|
2277
|
+
|
|
2278
|
+
virtual.
|
|
2279
|
+
set(function(_v) {
|
|
2280
|
+
if (!this.$$populatedVirtuals) {
|
|
2281
|
+
this.$$populatedVirtuals = {};
|
|
2282
|
+
}
|
|
2283
|
+
|
|
2284
|
+
if (options.justOne || options.count) {
|
|
2285
|
+
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
|
|
2286
|
+
_v[0] :
|
|
2287
|
+
_v;
|
|
2288
|
+
|
|
2289
|
+
if (typeof this.$$populatedVirtuals[name] !== 'object') {
|
|
2290
|
+
this.$$populatedVirtuals[name] = options.count ? _v : null;
|
|
2291
|
+
}
|
|
2292
|
+
} else {
|
|
2293
|
+
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
|
|
2294
|
+
_v :
|
|
2295
|
+
_v == null ? [] : [_v];
|
|
2296
|
+
|
|
2297
|
+
this.$$populatedVirtuals[name] = this.$$populatedVirtuals[name].filter(function(doc) {
|
|
2298
|
+
return doc && typeof doc === 'object';
|
|
2299
|
+
});
|
|
2300
|
+
}
|
|
2301
|
+
});
|
|
2302
|
+
|
|
2303
|
+
if (typeof options.get === 'function') {
|
|
2304
|
+
virtual.get(options.get);
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
// Workaround for gh-8198: if virtual is under document array, make a fake
|
|
2308
|
+
// virtual. See gh-8210, gh-13189
|
|
2309
|
+
const parts = name.split('.');
|
|
2310
|
+
let cur = parts[0];
|
|
2311
|
+
for (let i = 0; i < parts.length - 1; ++i) {
|
|
2312
|
+
if (this.paths[cur] == null) {
|
|
2313
|
+
continue;
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
if (this.paths[cur].$isMongooseDocumentArray || this.paths[cur].$isSingleNested) {
|
|
2317
|
+
const remnant = parts.slice(i + 1).join('.');
|
|
2318
|
+
this.paths[cur].schema.virtual(remnant, options);
|
|
2319
|
+
break;
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
cur += '.' + parts[i + 1];
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2325
|
+
return virtual;
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
const virtuals = this.virtuals;
|
|
2329
|
+
const parts = name.split('.');
|
|
2330
|
+
|
|
2331
|
+
if (this.pathType(name) === 'real') {
|
|
2332
|
+
throw new Error('Virtual path "' + name + '"' +
|
|
2333
|
+
' conflicts with a real path in the schema');
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
virtuals[name] = parts.reduce(function(mem, part, i) {
|
|
2337
|
+
mem[part] || (mem[part] = (i === parts.length - 1)
|
|
2338
|
+
? new VirtualType(options, name)
|
|
2339
|
+
: {});
|
|
2340
|
+
return mem[part];
|
|
2341
|
+
}, this.tree);
|
|
2342
|
+
|
|
2343
|
+
return virtuals[name];
|
|
2344
|
+
};
|
|
2345
|
+
|
|
2346
|
+
/**
|
|
2347
|
+
* Returns the virtual type with the given `name`.
|
|
2348
|
+
*
|
|
2349
|
+
* @param {String} name The name of the Virtual to get
|
|
2350
|
+
* @return {VirtualType|null}
|
|
2351
|
+
*/
|
|
2352
|
+
|
|
2353
|
+
Schema.prototype.virtualpath = function(name) {
|
|
2354
|
+
return this.virtuals.hasOwnProperty(name) ? this.virtuals[name] : null;
|
|
2355
|
+
};
|
|
2356
|
+
|
|
2357
|
+
/**
|
|
2358
|
+
* Removes the given `path` (or [`paths`]).
|
|
2359
|
+
*
|
|
2360
|
+
* #### Example:
|
|
2361
|
+
*
|
|
2362
|
+
* const schema = new Schema({ name: String, age: Number });
|
|
2363
|
+
* schema.remove('name');
|
|
2364
|
+
* schema.path('name'); // Undefined
|
|
2365
|
+
* schema.path('age'); // SchemaNumber { ... }
|
|
2366
|
+
*
|
|
2367
|
+
* Or as a Array:
|
|
2368
|
+
*
|
|
2369
|
+
* schema.remove(['name', 'age']);
|
|
2370
|
+
* schema.path('name'); // Undefined
|
|
2371
|
+
* schema.path('age'); // Undefined
|
|
2372
|
+
*
|
|
2373
|
+
* @param {String|Array} path The Path(s) to remove
|
|
2374
|
+
* @return {Schema} the Schema instance
|
|
2375
|
+
* @api public
|
|
2376
|
+
*/
|
|
2377
|
+
Schema.prototype.remove = function(path) {
|
|
2378
|
+
if (typeof path === 'string') {
|
|
2379
|
+
path = [path];
|
|
2380
|
+
}
|
|
2381
|
+
if (Array.isArray(path)) {
|
|
2382
|
+
path.forEach(function(name) {
|
|
2383
|
+
if (this.path(name) == null && !this.nested[name]) {
|
|
2384
|
+
return;
|
|
2385
|
+
}
|
|
2386
|
+
if (this.nested[name]) {
|
|
2387
|
+
const allKeys = Object.keys(this.paths).
|
|
2388
|
+
concat(Object.keys(this.nested));
|
|
2389
|
+
for (const path of allKeys) {
|
|
2390
|
+
if (path.startsWith(name + '.')) {
|
|
2391
|
+
delete this.paths[path];
|
|
2392
|
+
delete this.nested[path];
|
|
2393
|
+
_deletePath(this, path);
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2397
|
+
delete this.nested[name];
|
|
2398
|
+
_deletePath(this, name);
|
|
2399
|
+
return;
|
|
2400
|
+
}
|
|
2401
|
+
|
|
2402
|
+
delete this.paths[name];
|
|
2403
|
+
_deletePath(this, name);
|
|
2404
|
+
}, this);
|
|
2405
|
+
}
|
|
2406
|
+
return this;
|
|
2407
|
+
};
|
|
2408
|
+
|
|
2409
|
+
/*!
|
|
2410
|
+
* ignore
|
|
2411
|
+
*/
|
|
2412
|
+
|
|
2413
|
+
function _deletePath(schema, name) {
|
|
2414
|
+
const pieces = name.split('.');
|
|
2415
|
+
const last = pieces.pop();
|
|
2416
|
+
|
|
2417
|
+
let branch = schema.tree;
|
|
2418
|
+
|
|
2419
|
+
for (const piece of pieces) {
|
|
2420
|
+
branch = branch[piece];
|
|
2421
|
+
}
|
|
2422
|
+
|
|
2423
|
+
delete branch[last];
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
/**
|
|
2427
|
+
* Removes the given virtual or virtuals from the schema.
|
|
2428
|
+
*
|
|
2429
|
+
* @param {String|Array} path The virutal path(s) to remove.
|
|
2430
|
+
* @returns {Schema} the Schema instance, or a mongoose error if the virtual does not exist.
|
|
2431
|
+
* @api public
|
|
2432
|
+
*/
|
|
2433
|
+
|
|
2434
|
+
Schema.prototype.removeVirtual = function(path) {
|
|
2435
|
+
if (typeof path === 'string') {
|
|
2436
|
+
path = [path];
|
|
2437
|
+
}
|
|
2438
|
+
if (Array.isArray(path)) {
|
|
2439
|
+
for (const virtual of path) {
|
|
2440
|
+
if (this.virtuals[virtual] == null) {
|
|
2441
|
+
throw new MongooseError(`Attempting to remove virtual "${virtual}" that does not exist.`);
|
|
2442
|
+
}
|
|
2443
|
+
}
|
|
2444
|
+
|
|
2445
|
+
for (const virtual of path) {
|
|
2446
|
+
delete this.paths[virtual];
|
|
2447
|
+
delete this.virtuals[virtual];
|
|
2448
|
+
if (virtual.indexOf('.') !== -1) {
|
|
2449
|
+
mpath.unset(virtual, this.tree);
|
|
2450
|
+
} else {
|
|
2451
|
+
delete this.tree[virtual];
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
return this;
|
|
2456
|
+
};
|
|
2457
|
+
|
|
2458
|
+
/**
|
|
2459
|
+
* Loads an ES6 class into a schema. Maps [setters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set) + [getters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get), [static methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static),
|
|
2460
|
+
* and [instance methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Class_body_and_method_definitions)
|
|
2461
|
+
* to schema [virtuals](https://mongoosejs.com/docs/guide.html#virtuals),
|
|
2462
|
+
* [statics](https://mongoosejs.com/docs/guide.html#statics), and
|
|
2463
|
+
* [methods](https://mongoosejs.com/docs/guide.html#methods).
|
|
2464
|
+
*
|
|
2465
|
+
* #### Example:
|
|
2466
|
+
*
|
|
2467
|
+
* ```javascript
|
|
2468
|
+
* const md5 = require('md5');
|
|
2469
|
+
* const userSchema = new Schema({ email: String });
|
|
2470
|
+
* class UserClass {
|
|
2471
|
+
* // `gravatarImage` becomes a virtual
|
|
2472
|
+
* get gravatarImage() {
|
|
2473
|
+
* const hash = md5(this.email.toLowerCase());
|
|
2474
|
+
* return `https://www.gravatar.com/avatar/${hash}`;
|
|
2475
|
+
* }
|
|
2476
|
+
*
|
|
2477
|
+
* // `getProfileUrl()` becomes a document method
|
|
2478
|
+
* getProfileUrl() {
|
|
2479
|
+
* return `https://mysite.com/${this.email}`;
|
|
2480
|
+
* }
|
|
2481
|
+
*
|
|
2482
|
+
* // `findByEmail()` becomes a static
|
|
2483
|
+
* static findByEmail(email) {
|
|
2484
|
+
* return this.findOne({ email });
|
|
2485
|
+
* }
|
|
2486
|
+
* }
|
|
2487
|
+
*
|
|
2488
|
+
* // `schema` will now have a `gravatarImage` virtual, a `getProfileUrl()` method,
|
|
2489
|
+
* // and a `findByEmail()` static
|
|
2490
|
+
* userSchema.loadClass(UserClass);
|
|
2491
|
+
* ```
|
|
2492
|
+
*
|
|
2493
|
+
* @param {Function} model The Class to load
|
|
2494
|
+
* @param {Boolean} [virtualsOnly] if truthy, only pulls virtuals from the class, not methods or statics
|
|
2495
|
+
*/
|
|
2496
|
+
Schema.prototype.loadClass = function(model, virtualsOnly) {
|
|
2497
|
+
// Stop copying when hit certain base classes
|
|
2498
|
+
if (model === Object.prototype ||
|
|
2499
|
+
model === Function.prototype ||
|
|
2500
|
+
model.prototype.hasOwnProperty('$isMongooseModelPrototype') ||
|
|
2501
|
+
model.prototype.hasOwnProperty('$isMongooseDocumentPrototype')) {
|
|
2502
|
+
return this;
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2505
|
+
this.loadClass(Object.getPrototypeOf(model), virtualsOnly);
|
|
2506
|
+
|
|
2507
|
+
// Add static methods
|
|
2508
|
+
if (!virtualsOnly) {
|
|
2509
|
+
Object.getOwnPropertyNames(model).forEach(function(name) {
|
|
2510
|
+
if (name.match(/^(length|name|prototype|constructor|__proto__)$/)) {
|
|
2511
|
+
return;
|
|
2512
|
+
}
|
|
2513
|
+
const prop = Object.getOwnPropertyDescriptor(model, name);
|
|
2514
|
+
if (prop.hasOwnProperty('value')) {
|
|
2515
|
+
this.static(name, prop.value);
|
|
2516
|
+
}
|
|
2517
|
+
}, this);
|
|
2518
|
+
}
|
|
2519
|
+
|
|
2520
|
+
// Add methods and virtuals
|
|
2521
|
+
Object.getOwnPropertyNames(model.prototype).forEach(function(name) {
|
|
2522
|
+
if (name.match(/^(constructor)$/)) {
|
|
2523
|
+
return;
|
|
2524
|
+
}
|
|
2525
|
+
const method = Object.getOwnPropertyDescriptor(model.prototype, name);
|
|
2526
|
+
if (!virtualsOnly) {
|
|
2527
|
+
if (typeof method.value === 'function') {
|
|
2528
|
+
this.method(name, method.value);
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
if (typeof method.get === 'function') {
|
|
2532
|
+
if (this.virtuals[name]) {
|
|
2533
|
+
this.virtuals[name].getters = [];
|
|
2534
|
+
}
|
|
2535
|
+
this.virtual(name).get(method.get);
|
|
2536
|
+
}
|
|
2537
|
+
if (typeof method.set === 'function') {
|
|
2538
|
+
if (this.virtuals[name]) {
|
|
2539
|
+
this.virtuals[name].setters = [];
|
|
2540
|
+
}
|
|
2541
|
+
this.virtual(name).set(method.set);
|
|
2542
|
+
}
|
|
2543
|
+
}, this);
|
|
2544
|
+
|
|
2545
|
+
return this;
|
|
2546
|
+
};
|
|
2547
|
+
|
|
2548
|
+
/*!
|
|
2549
|
+
* ignore
|
|
2550
|
+
*/
|
|
2551
|
+
|
|
2552
|
+
Schema.prototype._getSchema = function(path) {
|
|
2553
|
+
const _this = this;
|
|
2554
|
+
const pathschema = _this.path(path);
|
|
2555
|
+
const resultPath = [];
|
|
2556
|
+
|
|
2557
|
+
if (pathschema) {
|
|
2558
|
+
pathschema.$fullPath = path;
|
|
2559
|
+
return pathschema;
|
|
2560
|
+
}
|
|
2561
|
+
|
|
2562
|
+
function search(parts, schema) {
|
|
2563
|
+
let p = parts.length + 1;
|
|
2564
|
+
let foundschema;
|
|
2565
|
+
let trypath;
|
|
2566
|
+
|
|
2567
|
+
while (p--) {
|
|
2568
|
+
trypath = parts.slice(0, p).join('.');
|
|
2569
|
+
foundschema = schema.path(trypath);
|
|
2570
|
+
if (foundschema) {
|
|
2571
|
+
resultPath.push(trypath);
|
|
2572
|
+
|
|
2573
|
+
if (foundschema.caster) {
|
|
2574
|
+
// array of Mixed?
|
|
2575
|
+
if (foundschema.caster instanceof MongooseTypes.Mixed) {
|
|
2576
|
+
foundschema.caster.$fullPath = resultPath.join('.');
|
|
2577
|
+
return foundschema.caster;
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
// Now that we found the array, we need to check if there
|
|
2581
|
+
// are remaining document paths to look up for casting.
|
|
2582
|
+
// Also we need to handle array.$.path since schema.path
|
|
2583
|
+
// doesn't work for that.
|
|
2584
|
+
// If there is no foundschema.schema we are dealing with
|
|
2585
|
+
// a path like array.$
|
|
2586
|
+
if (p !== parts.length) {
|
|
2587
|
+
if (p + 1 === parts.length && foundschema.$embeddedSchemaType && (parts[p] === '$' || isArrayFilter(parts[p]))) {
|
|
2588
|
+
return foundschema.$embeddedSchemaType;
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
if (foundschema.schema) {
|
|
2592
|
+
let ret;
|
|
2593
|
+
if (parts[p] === '$' || isArrayFilter(parts[p])) {
|
|
2594
|
+
if (p + 1 === parts.length) {
|
|
2595
|
+
// comments.$
|
|
2596
|
+
return foundschema.$embeddedSchemaType;
|
|
2597
|
+
}
|
|
2598
|
+
// comments.$.comments.$.title
|
|
2599
|
+
ret = search(parts.slice(p + 1), foundschema.schema);
|
|
2600
|
+
if (ret) {
|
|
2601
|
+
ret.$parentSchemaDocArray = ret.$parentSchemaDocArray ||
|
|
2602
|
+
(foundschema.schema.$isSingleNested ? null : foundschema);
|
|
2603
|
+
}
|
|
2604
|
+
return ret;
|
|
2605
|
+
}
|
|
2606
|
+
// this is the last path of the selector
|
|
2607
|
+
ret = search(parts.slice(p), foundschema.schema);
|
|
2608
|
+
if (ret) {
|
|
2609
|
+
ret.$parentSchemaDocArray = ret.$parentSchemaDocArray ||
|
|
2610
|
+
(foundschema.schema.$isSingleNested ? null : foundschema);
|
|
2611
|
+
}
|
|
2612
|
+
return ret;
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
} else if (foundschema.$isSchemaMap) {
|
|
2616
|
+
if (p >= parts.length) {
|
|
2617
|
+
return foundschema;
|
|
2618
|
+
}
|
|
2619
|
+
// Any path in the map will be an instance of the map's embedded schematype
|
|
2620
|
+
if (p + 1 >= parts.length) {
|
|
2621
|
+
return foundschema.$__schemaType;
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
if (foundschema.$__schemaType instanceof MongooseTypes.Mixed) {
|
|
2625
|
+
return foundschema.$__schemaType;
|
|
2626
|
+
}
|
|
2627
|
+
if (foundschema.$__schemaType.schema != null) {
|
|
2628
|
+
// Map of docs
|
|
2629
|
+
const ret = search(parts.slice(p + 1), foundschema.$__schemaType.schema);
|
|
2630
|
+
return ret;
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
foundschema.$fullPath = resultPath.join('.');
|
|
2635
|
+
|
|
2636
|
+
return foundschema;
|
|
2637
|
+
}
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
|
|
2641
|
+
// look for arrays
|
|
2642
|
+
const parts = path.split('.');
|
|
2643
|
+
for (let i = 0; i < parts.length; ++i) {
|
|
2644
|
+
if (parts[i] === '$' || isArrayFilter(parts[i])) {
|
|
2645
|
+
// Re: gh-5628, because `schema.path()` doesn't take $ into account.
|
|
2646
|
+
parts[i] = '0';
|
|
2647
|
+
}
|
|
2648
|
+
if (numberRE.test(parts[i])) {
|
|
2649
|
+
parts[i] = '$';
|
|
2650
|
+
}
|
|
2651
|
+
}
|
|
2652
|
+
return search(parts, _this);
|
|
2653
|
+
};
|
|
2654
|
+
|
|
2655
|
+
/*!
|
|
2656
|
+
* ignore
|
|
2657
|
+
*/
|
|
2658
|
+
|
|
2659
|
+
Schema.prototype._getPathType = function(path) {
|
|
2660
|
+
const _this = this;
|
|
2661
|
+
const pathschema = _this.path(path);
|
|
2662
|
+
|
|
2663
|
+
if (pathschema) {
|
|
2664
|
+
return 'real';
|
|
2665
|
+
}
|
|
2666
|
+
|
|
2667
|
+
function search(parts, schema) {
|
|
2668
|
+
let p = parts.length + 1,
|
|
2669
|
+
foundschema,
|
|
2670
|
+
trypath;
|
|
2671
|
+
|
|
2672
|
+
while (p--) {
|
|
2673
|
+
trypath = parts.slice(0, p).join('.');
|
|
2674
|
+
foundschema = schema.path(trypath);
|
|
2675
|
+
if (foundschema) {
|
|
2676
|
+
if (foundschema.caster) {
|
|
2677
|
+
// array of Mixed?
|
|
2678
|
+
if (foundschema.caster instanceof MongooseTypes.Mixed) {
|
|
2679
|
+
return { schema: foundschema, pathType: 'mixed' };
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
// Now that we found the array, we need to check if there
|
|
2683
|
+
// are remaining document paths to look up for casting.
|
|
2684
|
+
// Also we need to handle array.$.path since schema.path
|
|
2685
|
+
// doesn't work for that.
|
|
2686
|
+
// If there is no foundschema.schema we are dealing with
|
|
2687
|
+
// a path like array.$
|
|
2688
|
+
if (p !== parts.length && foundschema.schema) {
|
|
2689
|
+
if (parts[p] === '$' || isArrayFilter(parts[p])) {
|
|
2690
|
+
if (p === parts.length - 1) {
|
|
2691
|
+
return { schema: foundschema, pathType: 'nested' };
|
|
2692
|
+
}
|
|
2693
|
+
// comments.$.comments.$.title
|
|
2694
|
+
return search(parts.slice(p + 1), foundschema.schema);
|
|
2695
|
+
}
|
|
2696
|
+
// this is the last path of the selector
|
|
2697
|
+
return search(parts.slice(p), foundschema.schema);
|
|
2698
|
+
}
|
|
2699
|
+
return {
|
|
2700
|
+
schema: foundschema,
|
|
2701
|
+
pathType: foundschema.$isSingleNested ? 'nested' : 'array'
|
|
2702
|
+
};
|
|
2703
|
+
}
|
|
2704
|
+
return { schema: foundschema, pathType: 'real' };
|
|
2705
|
+
} else if (p === parts.length && schema.nested[trypath]) {
|
|
2706
|
+
return { schema: schema, pathType: 'nested' };
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
return { schema: foundschema || schema, pathType: 'undefined' };
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
// look for arrays
|
|
2713
|
+
return search(path.split('.'), _this);
|
|
2714
|
+
};
|
|
2715
|
+
|
|
2716
|
+
/*!
|
|
2717
|
+
* ignore
|
|
2718
|
+
*/
|
|
2719
|
+
|
|
2720
|
+
function isArrayFilter(piece) {
|
|
2721
|
+
return piece.startsWith('$[') && piece.endsWith(']');
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
/**
|
|
2725
|
+
* Called by `compile()` _right before_ compiling. Good for making any changes to
|
|
2726
|
+
* the schema that should respect options set by plugins, like `id`
|
|
2727
|
+
* @method _preCompile
|
|
2728
|
+
* @memberOf Schema
|
|
2729
|
+
* @instance
|
|
2730
|
+
* @api private
|
|
2731
|
+
*/
|
|
2732
|
+
|
|
2733
|
+
Schema.prototype._preCompile = function _preCompile() {
|
|
2734
|
+
this.plugin(idGetter, { deduplicate: true });
|
|
2735
|
+
};
|
|
2736
|
+
|
|
2737
|
+
/*!
|
|
2738
|
+
* Module exports.
|
|
2739
|
+
*/
|
|
2740
|
+
|
|
2741
|
+
module.exports = exports = Schema;
|
|
2742
|
+
|
|
2743
|
+
// require down here because of reference issues
|
|
2744
|
+
|
|
2745
|
+
/**
|
|
2746
|
+
* The various built-in Mongoose Schema Types.
|
|
2747
|
+
*
|
|
2748
|
+
* #### Example:
|
|
2749
|
+
*
|
|
2750
|
+
* const mongoose = require('mongoose');
|
|
2751
|
+
* const ObjectId = mongoose.Schema.Types.ObjectId;
|
|
2752
|
+
*
|
|
2753
|
+
* #### Types:
|
|
2754
|
+
*
|
|
2755
|
+
* - [String](https://mongoosejs.com/docs/schematypes.html#strings)
|
|
2756
|
+
* - [Number](https://mongoosejs.com/docs/schematypes.html#numbers)
|
|
2757
|
+
* - [Boolean](https://mongoosejs.com/docs/schematypes.html#booleans) | Bool
|
|
2758
|
+
* - [Array](https://mongoosejs.com/docs/schematypes.html#arrays)
|
|
2759
|
+
* - [Buffer](https://mongoosejs.com/docs/schematypes.html#buffers)
|
|
2760
|
+
* - [Date](https://mongoosejs.com/docs/schematypes.html#dates)
|
|
2761
|
+
* - [ObjectId](https://mongoosejs.com/docs/schematypes.html#objectids) | Oid
|
|
2762
|
+
* - [Mixed](https://mongoosejs.com/docs/schematypes.html#mixed)
|
|
2763
|
+
* - [UUID](https://mongoosejs.com/docs/schematypes.html#uuid)
|
|
2764
|
+
* - [BigInt](https://mongoosejs.com/docs/schematypes.html#bigint)
|
|
2765
|
+
*
|
|
2766
|
+
* Using this exposed access to the `Mixed` SchemaType, we can use them in our schema.
|
|
2767
|
+
*
|
|
2768
|
+
* const Mixed = mongoose.Schema.Types.Mixed;
|
|
2769
|
+
* new mongoose.Schema({ _user: Mixed })
|
|
2770
|
+
*
|
|
2771
|
+
* @api public
|
|
2772
|
+
*/
|
|
2773
|
+
|
|
2774
|
+
Schema.Types = MongooseTypes = require('./schema/index');
|
|
2775
|
+
|
|
2776
|
+
/*!
|
|
2777
|
+
* ignore
|
|
2778
|
+
*/
|
|
2779
|
+
|
|
2780
|
+
exports.ObjectId = MongooseTypes.ObjectId;
|