\ No newline at end of file
diff --git a/answer/src/views/wcx/questionBank.vue b/answer/src/views/wcx/questionBank.vue
index 1d07a0a..0cd7804 100644
--- a/answer/src/views/wcx/questionBank.vue
+++ b/answer/src/views/wcx/questionBank.vue
@@ -7,6 +7,7 @@
v-model="status"
placeholder="请选择专业"
@change="changeClass"
+ style="margin-top:10px;margin-left:15px"
>
编辑
- 详情
+ 详情 {
currentPage.value = val;
show();
};
-const goDet = () => {
- router.push("/shouye/questionBank");
+const goDet = (item) => {
+ router.push(`/shouye/questionBank?_id=${item._id}`);
};
// 重置
const reset = () => {
@@ -306,7 +307,7 @@ const questBank = async () => {
uid: uid.value,
});
show();
- dialogVisible.value=false
+ dialogVisible.value = false;
};
//添加获取id
const getClassid = ref("");
diff --git a/node/app.js b/node/app.js
index 37e6b0d..64f30f8 100644
--- a/node/app.js
+++ b/node/app.js
@@ -8,6 +8,7 @@ var indexRouter = require('./routes/wcx');
var usersRouter = require('./routes/users');
var cors=require('cors');
var app = express();
+app.use('/upload',express.static('upload'))
app.use(cors());
// view engine setup
app.set('views', path.join(__dirname, 'views'));
diff --git a/node/model/model/kjq.js b/node/model/model/kjq.js
index b2caeb9..907d06f 100644
--- a/node/model/model/kjq.js
+++ b/node/model/model/kjq.js
@@ -57,7 +57,9 @@ let qestions = new mongoose.Schema({
qid:{type:mongoose.Types.ObjectId,ref:'quebank'}, //题库
trueqest:{type:String,default:''}, //正确答案
difficul:{type:Number,default:''}, //难度
- answer:{type:Array,default:[]} //题目/答案
+ answer:{type:Array,default:[]}, //题目/答案
+ score:{type:Number,default:''}, //分数
+ imgUrl:{type:String,default:''}, //图片地址
})
diff --git a/node/node_modules/.package-lock.json b/node/node_modules/.package-lock.json
index 94095d0..f47113e 100644
--- a/node/node_modules/.package-lock.json
+++ b/node/node_modules/.package-lock.json
@@ -752,6 +752,57 @@
"resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz",
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
},
+ "node_modules/multiparty": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmmirror.com/multiparty/-/multiparty-4.2.3.tgz",
+ "integrity": "sha512-Ak6EUJZuhGS8hJ3c2fY6UW5MbkGUPMBEGd13djUzoY/BHqV/gTuFWtC6IuVA7A2+v3yjBS6c4or50xhzTQZImQ==",
+ "dependencies": {
+ "http-errors": "~1.8.1",
+ "safe-buffer": "5.2.1",
+ "uid-safe": "2.1.5"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/multiparty/node_modules/http-errors": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-1.8.1.tgz",
+ "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
+ "dependencies": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.4",
+ "setprototypeof": "1.2.0",
+ "statuses": ">= 1.5.0 < 2",
+ "toidentifier": "1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/multiparty/node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ },
+ "node_modules/multiparty/node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
+ },
+ "node_modules/multiparty/node_modules/setprototypeof": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.2.0.tgz",
+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
+ },
+ "node_modules/multiparty/node_modules/statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmmirror.com/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
"node_modules/negotiator": {
"version": "0.6.3",
"resolved": "https://registry.npmmirror.com/negotiator/-/negotiator-0.6.3.tgz",
@@ -844,6 +895,14 @@
"node": ">=0.6"
}
},
+ "node_modules/random-bytes": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmmirror.com/random-bytes/-/random-bytes-1.0.0.tgz",
+ "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
"node_modules/range-parser": {
"version": "1.2.1",
"resolved": "https://registry.npmmirror.com/range-parser/-/range-parser-1.2.1.tgz",
@@ -969,6 +1028,14 @@
"node": ">= 0.6"
}
},
+ "node_modules/toidentifier": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmmirror.com/toidentifier/-/toidentifier-1.0.1.tgz",
+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
"node_modules/tr46": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/tr46/-/tr46-3.0.0.tgz",
@@ -1074,6 +1141,17 @@
"integrity": "sha512-vb2s1lYx2xBtUgy+ta+b2J/GLVUR+wmpINwHePmPRhOsIVCG2wDzKJ0n14GslH1BifsqVzSOwQhRaCAsZ/nI4Q==",
"optional": true
},
+ "node_modules/uid-safe": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmmirror.com/uid-safe/-/uid-safe-2.1.5.tgz",
+ "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==",
+ "dependencies": {
+ "random-bytes": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-5.26.5.tgz",
diff --git a/node/node_modules/multiparty/HISTORY.md b/node/node_modules/multiparty/HISTORY.md
new file mode 100644
index 0000000..16570d0
--- /dev/null
+++ b/node/node_modules/multiparty/HISTORY.md
@@ -0,0 +1,250 @@
+4.2.3 / 2022-01-20
+==================
+
+ * Fix handling of unquoted values in `Content-Disposition`
+ * deps: http-errors@~1.8.1
+ - deps: toidentifier@1.0.1
+
+4.2.2 / 2020-07-27
+==================
+
+ * Fix empty files on Node.js 14.x
+ * Fix form emitting aborted error after close
+ * Replace `fd-slicer` module with internal transform stream
+ * deps: http-errors@~1.8.0
+ - Fix error creating objects in some environments
+ - deps: inherits@2.0.4
+ - deps: setprototypeof@1.2.0
+ * deps: safe-buffer@5.2.1
+
+4.2.1 / 2018-08-12
+==================
+
+ * Use `uid-safe` module to for temp file names
+ * deps: fd-slicer@1.1.0
+ * deps: http-errors@~1.7.0
+
+4.2.0 / 2018-07-30
+==================
+
+ * Use `http-errors` for raised errors
+ * Use `random-bytes` module for polyfill
+ * perf: remove parameter reassignment
+
+4.1.4 / 2018-05-11
+==================
+
+ * Fix file extension filtering stopping on certain whitespace characters
+ * Use `safe-buffer` for improved API safety
+ * perf: enable strict mode
+
+4.1.3 / 2017-01-22
+==================
+
+ * Use `os.tmpdir()` instead of `os.tmpDir()`
+ * deps: fd-slicer@1.0.1
+
+4.1.2 / 2015-05-09
+==================
+
+ * Do not emit error on part prior to emitting part
+ * Fix filename with quotes truncating from certain clients
+
+4.1.1 / 2015-01-18
+==================
+
+ * Do not clobber existing temporary files
+
+4.1.0 / 2014-12-04
+==================
+
+ * Add `statusCode` field to HTTP-related errors
+ * deps: fd-slicer@1.0.0
+
+4.0.0 / 2014-10-14
+==================
+
+ * `part` events for fields no longer fire if `autoFields` is on
+ * `part` events for files no longer fire if `autoFiles` is on
+ * `field`, `file`, and `part` events are guaranteed to emit in the
+ correct order - the order that the user places the parts in the
+ request. Each `part` `end` event is guaranteed to emit before the
+ next `part` event is emitted.
+ * Drop Node.js 0.8.x support
+ * Improve random temp file names
+ - Now using 18 bytes of randomness instead of 8.
+ * More robust `maxFilesSize` implementation
+ - Before it was possible for race conditions to cause more than
+ `maxFilesSize` bytes to get written to disk. That is now fixed.
+ * Now `part` objects emit `error` events
+ - This makes streaming work better since the part stream will emit
+ an error when it is no longer streaming.
+ * Remove support for generating the hash digest of a part
+ - If you want this, do it in your own code.
+ * Remove undocumented `ws` property from `file` objects
+ * Require the close boundary
+ - This makes multiparty more RFC-compliant and makes some invalid
+ requests which used to work, now emit an error instead.
+
+3.3.2 / 2014-08-07
+==================
+
+ * Do not invoke callback after close
+ * Share callback ending logic between error and close
+
+3.3.1 / 2014-07-22
+==================
+
+ * Remove problematic test fixtures
+
+3.3.0 / 2014-07-03
+==================
+
+ * Always emit close after all parts ended
+
+3.2.10 / 2014-07-03
+===================
+
+ * Fix callback hang in node.js 0.8 on errors
+ * Remove execute bit from files
+
+3.2.9 / 2014-06-16
+==================
+
+ * Fix attaching error listeners directly after form.parse
+ * Fix to not synchronously invoke callback to form.parse on error
+
+3.2.8 / 2014-06-01
+==================
+
+ * Fix developer accidentally corrupting data
+ * Fix handling epilogue in a separate chunk
+ * Fix initial check errors to use supplied callback
+
+3.2.7 / 2014-05-26
+==================
+
+ * Fix errors hanging responses in callback-style
+
+3.2.6 / 2014-05-13
+==================
+
+ * Fix `maxFields` to error on field after max
+
+3.2.5 / 2014-05-11
+==================
+
+ * Support boundary containing equal sign
+
+3.2.4 / 2014-03-26
+==================
+
+ * Keep `part.byteCount` undefined in chunked encoding
+ * Fix temp files not always cleaned up
+
+3.2.3 / 2014-02-20
+==================
+
+ * Improve parsing boundary attribute from `Content-Type`
+
+3.2.2 / 2014-01-29
+==================
+
+ * Fix error on empty payloads
+
+3.2.1 / 2014-01-27
+==================
+
+ * Fix `maxFilesSize` overcalculation bug
+
+3.2.0 / 2014-01-17
+==================
+
+ * Add `maxFilesSize` for `autoFiles`
+
+3.1.2 / 2014-01-13
+==================
+
+ * Fix incorrectly using `autoFields` value for `autoFiles`
+
+3.1.1 / 2013-12-13
+==================
+
+ * Fix not emitting `close` after all part `end` events
+
+3.1.0 / 2013-11-10
+==================
+
+ * Support UTF-8 filename in `Content-Disposition`
+
+3.0.0 / 2013-10-25
+==================
+
+ * `form.parse` callback API changed in a compatibility-breaking manner
+
+2.2.0 / 2013-10-15
+==================
+
+ * Add callback API to support multiple files with same field name
+ * Fix assertion crash when max field count is exceeded
+ * Fix assertion crash when client aborts an invalid request
+ * Fix assertion crash when `EMFILE` occurrs
+ * Switch from assertions to only `error` events
+ * Unpipe the request when an error occurs to save resources
+ * Update readable-stream to ~1.1.9
+
+2.1.9 / 2013-10-06
+==================
+
+ * relax `Content-Type` detection regex
+
+2.1.8 / 2013-08-26
+==================
+
+ * Replace deprecated `Buffer.write()`
+
+2.1.7 / 2013-05-23
+==================
+
+ * Add repository field to package.json
+
+2.1.6 / 2013-04-30
+==================
+
+ * Expose `hash` as an option to `Form`
+
+2.1.5 / 2013-04-10
+==================
+
+ * Fix possible `close` event before all temp files are done
+
+2.1.4 / 2013-04-09
+==================
+
+ * Fix crash for invalid requests
+
+2.1.3 / 2013-04-09
+==================
+
+ * Add `file.size`
+
+2.1.2 / 2013-04-08
+==================
+
+ * Add proper backpressure support
+
+2.1.1 / 2013-04-05
+==================
+
+ * Add `part.byteCount` and `part.byteOffset`
+ * Fix uploads larger than 2KB
+
+2.1.0 / 2013-04-04
+==================
+
+ * Complete rewrite. See README for changes and new API.
+
+2.0.0 / 2013-04-02
+==================
+
+ * Fork and rewrite from `formidable`
diff --git a/node/node_modules/multiparty/LICENSE b/node/node_modules/multiparty/LICENSE
new file mode 100644
index 0000000..5d5dda3
--- /dev/null
+++ b/node/node_modules/multiparty/LICENSE
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2013 Felix Geisendörfer
+Copyright (c) 2014 Andrew Kelley
+Copyright (c) 2014 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node/node_modules/multiparty/README.md b/node/node_modules/multiparty/README.md
new file mode 100644
index 0000000..93b49a6
--- /dev/null
+++ b/node/node_modules/multiparty/README.md
@@ -0,0 +1,274 @@
+# multiparty
+
+[![NPM Version][npm-version-image]][npm-url]
+[![NPM Downloads][npm-downloads-image]][npm-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][github-actions-ci-image]][github-actions-ci-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Parse http requests with content-type `multipart/form-data`, also known as file uploads.
+
+See also [busboy](https://github.com/mscdex/busboy) - a
+[faster](https://github.com/mscdex/dicer/wiki/Benchmarks) alternative
+which may be worth looking into.
+
+## Installation
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```
+npm install multiparty
+```
+
+## Usage
+
+ * See [examples](examples).
+
+Parse an incoming `multipart/form-data` request.
+
+```js
+var multiparty = require('multiparty');
+var http = require('http');
+var util = require('util');
+
+http.createServer(function(req, res) {
+ if (req.url === '/upload' && req.method === 'POST') {
+ // parse a file upload
+ var form = new multiparty.Form();
+
+ form.parse(req, function(err, fields, files) {
+ res.writeHead(200, { 'content-type': 'text/plain' });
+ res.write('received upload:\n\n');
+ res.end(util.inspect({ fields: fields, files: files }));
+ });
+
+ return;
+ }
+
+ // show a file upload form
+ res.writeHead(200, { 'content-type': 'text/html' });
+ res.end(
+ ''
+ );
+}).listen(8080);
+```
+
+## API
+
+### multiparty.Form
+
+
+
+```js
+var form = new multiparty.Form(options)
+```
+
+Creates a new form. Options:
+
+ * `encoding` - sets encoding for the incoming form fields. Defaults to `utf8`.
+ * `maxFieldsSize` - Limits the amount of memory all fields (not files) can
+ allocate in bytes. If this value is exceeded, an `error` event is emitted.
+ The default size is 2MB.
+ * `maxFields` - Limits the number of fields that will be parsed before
+ emitting an `error` event. A file counts as a field in this case.
+ Defaults to 1000.
+ * `maxFilesSize` - Only relevant when `autoFiles` is `true`. Limits the
+ total bytes accepted for all files combined. If this value is exceeded,
+ an `error` event is emitted. The default is `Infinity`.
+ * `autoFields` - Enables `field` events and disables `part` events for fields.
+ This is automatically set to `true` if you add a `field` listener.
+ * `autoFiles` - Enables `file` events and disables `part` events for files.
+ This is automatically set to `true` if you add a `file` listener.
+ * `uploadDir` - Only relevant when `autoFiles` is `true`. The directory for
+ placing file uploads in. You can move them later using `fs.rename()`.
+ Defaults to `os.tmpdir()`.
+
+#### form.parse(request, [cb])
+
+Parses an incoming node.js `request` containing form data.This will cause
+`form` to emit events based off the incoming request.
+
+```js
+var count = 0;
+var form = new multiparty.Form();
+
+// Errors may be emitted
+// Note that if you are listening to 'part' events, the same error may be
+// emitted from the `form` and the `part`.
+form.on('error', function(err) {
+ console.log('Error parsing form: ' + err.stack);
+});
+
+// Parts are emitted when parsing the form
+form.on('part', function(part) {
+ // You *must* act on the part by reading it
+ // NOTE: if you want to ignore it, just call "part.resume()"
+
+ if (part.filename === undefined) {
+ // filename is not defined when this is a field and not a file
+ console.log('got field named ' + part.name);
+ // ignore field's content
+ part.resume();
+ }
+
+ if (part.filename !== undefined) {
+ // filename is defined when this is a file
+ count++;
+ console.log('got file named ' + part.name);
+ // ignore file's content here
+ part.resume();
+ }
+
+ part.on('error', function(err) {
+ // decide what to do
+ });
+});
+
+// Close emitted after form parsed
+form.on('close', function() {
+ console.log('Upload completed!');
+ res.setHeader('text/plain');
+ res.end('Received ' + count + ' files');
+});
+
+// Parse req
+form.parse(req);
+```
+
+If `cb` is provided, `autoFields` and `autoFiles` are set to `true` and all
+fields and files are collected and passed to the callback, removing the need to
+listen to any events on `form`. This is for convenience when you want to read
+everything, but be sure to write cleanup code, as this will write all uploaded
+files to the disk, even ones you may not be interested in.
+
+```js
+form.parse(req, function(err, fields, files) {
+ Object.keys(fields).forEach(function(name) {
+ console.log('got field named ' + name);
+ });
+
+ Object.keys(files).forEach(function(name) {
+ console.log('got file named ' + name);
+ });
+
+ console.log('Upload completed!');
+ res.setHeader('text/plain');
+ res.end('Received ' + files.length + ' files');
+});
+```
+
+`fields` is an object where the property names are field names and the values
+are arrays of field values.
+
+`files` is an object where the property names are field names and the values
+are arrays of file objects.
+
+#### form.bytesReceived
+
+The amount of bytes received for this form so far.
+
+#### form.bytesExpected
+
+The expected number of bytes in this form.
+
+### Events
+
+#### 'error' (err)
+
+Unless you supply a callback to `form.parse`, you definitely want to handle
+this event. Otherwise your server *will* crash when users submit bogus
+multipart requests!
+
+Only one 'error' event can ever be emitted, and if an 'error' event is
+emitted, then 'close' will not be emitted.
+
+If the error would correspond to a certain HTTP response code, the `err` object
+will have a `statusCode` property with the value of the suggested HTTP response
+code to send back.
+
+Note that an 'error' event will be emitted both from the `form` and from the
+current `part`.
+
+#### 'part' (part)
+
+Emitted when a part is encountered in the request. `part` is a
+`ReadableStream`. It also has the following properties:
+
+ * `headers` - the headers for this part. For example, you may be interested
+ in `content-type`.
+ * `name` - the field name for this part
+ * `filename` - only if the part is an incoming file
+ * `byteOffset` - the byte offset of this part in the request body
+ * `byteCount` - assuming that this is the last part in the request,
+ this is the size of this part in bytes. You could use this, for
+ example, to set the `Content-Length` header if uploading to S3.
+ If the part had a `Content-Length` header then that value is used
+ here instead.
+
+Parts for fields are not emitted when `autoFields` is on, and likewise parts
+for files are not emitted when `autoFiles` is on.
+
+`part` emits 'error' events! Make sure you handle them.
+
+#### 'aborted'
+
+Emitted when the request is aborted. This event will be followed shortly
+by an `error` event. In practice you do not need to handle this event.
+
+#### 'progress' (bytesReceived, bytesExpected)
+
+Emitted when a chunk of data is received for the form. The `bytesReceived`
+argument contains the total count of bytes received for this form so far. The
+`bytesExpected` argument contains the total expected bytes if known, otherwise
+`null`.
+
+#### 'close'
+
+Emitted after all parts have been parsed and emitted. Not emitted if an `error`
+event is emitted.
+
+If you have `autoFiles` on, this is not fired until all the data has been
+flushed to disk and the file handles have been closed.
+
+This is typically when you would send your response.
+
+#### 'file' (name, file)
+
+**By default multiparty will not touch your hard drive.** But if you add this
+listener, multiparty automatically sets `form.autoFiles` to `true` and will
+stream uploads to disk for you.
+
+**The max bytes accepted per request can be specified with `maxFilesSize`.**
+
+ * `name` - the field name for this file
+ * `file` - an object with these properties:
+ - `fieldName` - same as `name` - the field name for this file
+ - `originalFilename` - the filename that the user reports for the file
+ - `path` - the absolute path of the uploaded file on disk
+ - `headers` - the HTTP headers that were sent along with this file
+ - `size` - size of the file in bytes
+
+#### 'field' (name, value)
+
+ * `name` - field name
+ * `value` - string field value
+
+## License
+
+[MIT](LICENSE)
+
+[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/multiparty/master
+[coveralls-url]: https://coveralls.io/r/pillarjs/multiparty?branch=master
+[github-actions-ci-image]: https://badgen.net/github/checks/pillarjs/multiparty/master?label=ci
+[github-actions-ci-url]: https://github.com/pillarjs/multiparty/actions?query=workflow%3Aci
+[node-version-image]: https://badgen.net/npm/node/multiparty
+[node-version-url]: https://nodejs.org/en/download
+[npm-downloads-image]: https://badgen.net/npm/dm/multiparty
+[npm-url]: https://npmjs.org/package/multiparty
+[npm-version-image]: https://badgen.net/npm/v/multiparty
diff --git a/node/node_modules/multiparty/index.js b/node/node_modules/multiparty/index.js
new file mode 100644
index 0000000..1742c9f
--- /dev/null
+++ b/node/node_modules/multiparty/index.js
@@ -0,0 +1,820 @@
+/*!
+ * multiparty
+ * Copyright(c) 2013 Felix Geisendörfer
+ * Copyright(c) 2014 Andrew Kelley
+ * Copyright(c) 2014 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+var createError = require('http-errors')
+var uid = require('uid-safe')
+var stream = require('stream');
+var util = require('util');
+var fs = require('fs');
+var path = require('path');
+var os = require('os');
+var Buffer = require('safe-buffer').Buffer
+var StringDecoder = require('string_decoder').StringDecoder;
+
+var START = 0;
+var START_BOUNDARY = 1;
+var HEADER_FIELD_START = 2;
+var HEADER_FIELD = 3;
+var HEADER_VALUE_START = 4;
+var HEADER_VALUE = 5;
+var HEADER_VALUE_ALMOST_DONE = 6;
+var HEADERS_ALMOST_DONE = 7;
+var PART_DATA_START = 8;
+var PART_DATA = 9;
+var CLOSE_BOUNDARY = 10;
+var END = 11;
+
+var LF = 10;
+var CR = 13;
+var SPACE = 32;
+var HYPHEN = 45;
+var COLON = 58;
+var A = 97;
+var Z = 122;
+
+var CONTENT_TYPE_RE = /^multipart\/(?:form-data|related)(?:;|$)/i;
+var CONTENT_TYPE_PARAM_RE = /;\s*([^=]+)=(?:"([^"]+)"|([^;]+))/gi;
+var FILE_EXT_RE = /(\.[_\-a-zA-Z0-9]{0,16})[\S\s]*/;
+var FILENAME_PARAM_RE = /\bfilename=(?:"(.*?)"|([!#$%&'*+.0-9A-Z^_`a-z|~-]+))($|; )/i
+var LAST_BOUNDARY_SUFFIX_LEN = 4; // --\r\n
+var NAME_PARAM_RE = /\bname=(?:"([^"]+)"|([!#$%&'*+.0-9A-Z^_`a-z|~-]+))/i
+
+exports.Form = Form;
+
+util.inherits(Form, stream.Writable);
+function Form(options) {
+ var opts = options || {}
+ var self = this;
+ stream.Writable.call(self, { emitClose: false })
+
+ self.error = null;
+
+ self.autoFields = !!opts.autoFields
+ self.autoFiles = !!opts.autoFiles
+
+ self.maxFields = opts.maxFields || 1000
+ self.maxFieldsSize = opts.maxFieldsSize || 2 * 1024 * 1024
+ self.maxFilesSize = opts.maxFilesSize || Infinity
+ self.uploadDir = opts.uploadDir || os.tmpdir()
+ self.encoding = opts.encoding || 'utf8'
+
+ self.bytesReceived = 0;
+ self.bytesExpected = null;
+
+ self.openedFiles = [];
+ self.totalFieldSize = 0;
+ self.totalFieldCount = 0;
+ self.totalFileSize = 0;
+ self.flushing = 0;
+
+ self.backpressure = false;
+ self.writeCbs = [];
+
+ self.emitQueue = [];
+
+ self.on('newListener', function(eventName) {
+ if (eventName === 'file') {
+ self.autoFiles = true;
+ } else if (eventName === 'field') {
+ self.autoFields = true;
+ }
+ });
+}
+
+Form.prototype.parse = function(req, cb) {
+ var called = false;
+ var self = this;
+ var waitend = true;
+
+ self.on('close', onClosed)
+
+ if (cb) {
+ // if the user supplies a callback, this implies autoFields and autoFiles
+ self.autoFields = true;
+ self.autoFiles = true;
+
+ // wait for request to end before calling cb
+ var end = function (done) {
+ if (called) return;
+
+ called = true;
+
+ // wait for req events to fire
+ process.nextTick(function() {
+ if (waitend && req.readable) {
+ // dump rest of request
+ req.resume();
+ req.once('end', done);
+ return;
+ }
+
+ done();
+ });
+ };
+
+ var fields = {};
+ var files = {};
+ self.on('error', function(err) {
+ end(function() {
+ cb(err);
+ });
+ });
+ self.on('field', function(name, value) {
+ var fieldsArray = fields[name] || (fields[name] = []);
+ fieldsArray.push(value);
+ });
+ self.on('file', function(name, file) {
+ var filesArray = files[name] || (files[name] = []);
+ filesArray.push(file);
+ });
+ self.on('close', function() {
+ end(function() {
+ cb(null, fields, files);
+ });
+ });
+ }
+
+ self.handleError = handleError;
+ self.bytesExpected = getBytesExpected(req.headers);
+
+ req.on('end', onReqEnd);
+ req.on('error', function(err) {
+ waitend = false;
+ handleError(err);
+ });
+ req.on('aborted', onReqAborted);
+
+ var state = req._readableState;
+ if (req._decoder || (state && (state.encoding || state.decoder))) {
+ // this is a binary protocol
+ // if an encoding is set, input is likely corrupted
+ validationError(new Error('request encoding must not be set'));
+ return;
+ }
+
+ var contentType = req.headers['content-type'];
+ if (!contentType) {
+ validationError(createError(415, 'missing content-type header'));
+ return;
+ }
+
+ var m = CONTENT_TYPE_RE.exec(contentType);
+ if (!m) {
+ validationError(createError(415, 'unsupported content-type'));
+ return;
+ }
+
+ var boundary;
+ CONTENT_TYPE_PARAM_RE.lastIndex = m.index + m[0].length - 1;
+ while ((m = CONTENT_TYPE_PARAM_RE.exec(contentType))) {
+ if (m[1].toLowerCase() !== 'boundary') continue;
+ boundary = m[2] || m[3];
+ break;
+ }
+
+ if (!boundary) {
+ validationError(createError(400, 'content-type missing boundary'));
+ return;
+ }
+
+ setUpParser(self, boundary);
+ req.pipe(self);
+
+ function onClosed () {
+ req.removeListener('aborted', onReqAborted)
+ }
+
+ function onReqAborted() {
+ waitend = false;
+ self.emit('aborted');
+ handleError(new Error('Request aborted'))
+ }
+
+ function onReqEnd() {
+ waitend = false;
+ }
+
+ function handleError(err) {
+ var first = !self.error;
+ if (first) {
+ self.error = err;
+ req.removeListener('aborted', onReqAborted);
+ req.removeListener('end', onReqEnd);
+ if (self.destStream) {
+ errorEventQueue(self, self.destStream, err);
+ }
+ }
+
+ cleanupOpenFiles(self);
+
+ if (first) {
+ self.emit('error', err);
+ }
+ }
+
+ function validationError(err) {
+ // handle error on next tick for event listeners to attach
+ process.nextTick(handleError.bind(null, err))
+ }
+};
+
+Form.prototype._write = function(buffer, encoding, cb) {
+ if (this.error) return;
+
+ var self = this;
+ var i = 0;
+ var len = buffer.length;
+ var prevIndex = self.index;
+ var index = self.index;
+ var state = self.state;
+ var lookbehind = self.lookbehind;
+ var boundary = self.boundary;
+ var boundaryChars = self.boundaryChars;
+ var boundaryLength = self.boundary.length;
+ var boundaryEnd = boundaryLength - 1;
+ var bufferLength = buffer.length;
+ var c;
+ var cl;
+
+ for (i = 0; i < len; i++) {
+ c = buffer[i];
+ switch (state) {
+ case START:
+ index = 0;
+ state = START_BOUNDARY;
+ /* falls through */
+ case START_BOUNDARY:
+ if (index === boundaryLength - 2 && c === HYPHEN) {
+ index = 1;
+ state = CLOSE_BOUNDARY;
+ break;
+ } else if (index === boundaryLength - 2) {
+ if (c !== CR) return self.handleError(createError(400, 'Expected CR Received ' + c));
+ index++;
+ break;
+ } else if (index === boundaryLength - 1) {
+ if (c !== LF) return self.handleError(createError(400, 'Expected LF Received ' + c));
+ index = 0;
+ self.onParsePartBegin();
+ state = HEADER_FIELD_START;
+ break;
+ }
+
+ if (c !== boundary[index+2]) index = -2;
+ if (c === boundary[index+2]) index++;
+ break;
+ case HEADER_FIELD_START:
+ state = HEADER_FIELD;
+ self.headerFieldMark = i;
+ index = 0;
+ /* falls through */
+ case HEADER_FIELD:
+ if (c === CR) {
+ self.headerFieldMark = null;
+ state = HEADERS_ALMOST_DONE;
+ break;
+ }
+
+ index++;
+ if (c === HYPHEN) break;
+
+ if (c === COLON) {
+ if (index === 1) {
+ // empty header field
+ self.handleError(createError(400, 'Empty header field'));
+ return;
+ }
+ self.onParseHeaderField(buffer.slice(self.headerFieldMark, i));
+ self.headerFieldMark = null;
+ state = HEADER_VALUE_START;
+ break;
+ }
+
+ cl = lower(c);
+ if (cl < A || cl > Z) {
+ self.handleError(createError(400, 'Expected alphabetic character, received ' + c));
+ return;
+ }
+ break;
+ case HEADER_VALUE_START:
+ if (c === SPACE) break;
+
+ self.headerValueMark = i;
+ state = HEADER_VALUE;
+ /* falls through */
+ case HEADER_VALUE:
+ if (c === CR) {
+ self.onParseHeaderValue(buffer.slice(self.headerValueMark, i));
+ self.headerValueMark = null;
+ self.onParseHeaderEnd();
+ state = HEADER_VALUE_ALMOST_DONE;
+ }
+ break;
+ case HEADER_VALUE_ALMOST_DONE:
+ if (c !== LF) return self.handleError(createError(400, 'Expected LF Received ' + c));
+ state = HEADER_FIELD_START;
+ break;
+ case HEADERS_ALMOST_DONE:
+ if (c !== LF) return self.handleError(createError(400, 'Expected LF Received ' + c));
+ var err = self.onParseHeadersEnd(i + 1);
+ if (err) return self.handleError(err);
+ state = PART_DATA_START;
+ break;
+ case PART_DATA_START:
+ state = PART_DATA;
+ self.partDataMark = i;
+ /* falls through */
+ case PART_DATA:
+ prevIndex = index;
+
+ if (index === 0) {
+ // boyer-moore derrived algorithm to safely skip non-boundary data
+ i += boundaryEnd;
+ while (i < bufferLength && !(buffer[i] in boundaryChars)) {
+ i += boundaryLength;
+ }
+ i -= boundaryEnd;
+ c = buffer[i];
+ }
+
+ if (index < boundaryLength) {
+ if (boundary[index] === c) {
+ if (index === 0) {
+ self.onParsePartData(buffer.slice(self.partDataMark, i));
+ self.partDataMark = null;
+ }
+ index++;
+ } else {
+ index = 0;
+ }
+ } else if (index === boundaryLength) {
+ index++;
+ if (c === CR) {
+ // CR = part boundary
+ self.partBoundaryFlag = true;
+ } else if (c === HYPHEN) {
+ index = 1;
+ state = CLOSE_BOUNDARY;
+ break;
+ } else {
+ index = 0;
+ }
+ } else if (index - 1 === boundaryLength) {
+ if (self.partBoundaryFlag) {
+ index = 0;
+ if (c === LF) {
+ self.partBoundaryFlag = false;
+ self.onParsePartEnd();
+ self.onParsePartBegin();
+ state = HEADER_FIELD_START;
+ break;
+ }
+ } else {
+ index = 0;
+ }
+ }
+
+ if (index > 0) {
+ // when matching a possible boundary, keep a lookbehind reference
+ // in case it turns out to be a false lead
+ lookbehind[index-1] = c;
+ } else if (prevIndex > 0) {
+ // if our boundary turned out to be rubbish, the captured lookbehind
+ // belongs to partData
+ self.onParsePartData(lookbehind.slice(0, prevIndex));
+ prevIndex = 0;
+ self.partDataMark = i;
+
+ // reconsider the current character even so it interrupted the sequence
+ // it could be the beginning of a new sequence
+ i--;
+ }
+
+ break;
+ case CLOSE_BOUNDARY:
+ if (c !== HYPHEN) return self.handleError(createError(400, 'Expected HYPHEN Received ' + c));
+ if (index === 1) {
+ self.onParsePartEnd();
+ state = END;
+ } else if (index > 1) {
+ return self.handleError(new Error('Parser has invalid state.'))
+ }
+ index++;
+ break;
+ case END:
+ break;
+ default:
+ self.handleError(new Error('Parser has invalid state.'))
+ return;
+ }
+ }
+
+ if (self.headerFieldMark != null) {
+ self.onParseHeaderField(buffer.slice(self.headerFieldMark));
+ self.headerFieldMark = 0;
+ }
+ if (self.headerValueMark != null) {
+ self.onParseHeaderValue(buffer.slice(self.headerValueMark));
+ self.headerValueMark = 0;
+ }
+ if (self.partDataMark != null) {
+ self.onParsePartData(buffer.slice(self.partDataMark));
+ self.partDataMark = 0;
+ }
+
+ self.index = index;
+ self.state = state;
+
+ self.bytesReceived += buffer.length;
+ self.emit('progress', self.bytesReceived, self.bytesExpected);
+
+ if (self.backpressure) {
+ self.writeCbs.push(cb);
+ } else {
+ cb();
+ }
+};
+
+Form.prototype.onParsePartBegin = function() {
+ clearPartVars(this);
+}
+
+Form.prototype.onParseHeaderField = function(b) {
+ this.headerField += this.headerFieldDecoder.write(b);
+}
+
+Form.prototype.onParseHeaderValue = function(b) {
+ this.headerValue += this.headerValueDecoder.write(b);
+}
+
+Form.prototype.onParseHeaderEnd = function() {
+ this.headerField = this.headerField.toLowerCase();
+ this.partHeaders[this.headerField] = this.headerValue;
+
+ var m;
+ if (this.headerField === 'content-disposition') {
+ if (m = NAME_PARAM_RE.exec(this.headerValue)) {
+ this.partName = m[1] || m[2] || ''
+ }
+ this.partFilename = parseFilename(this.headerValue);
+ } else if (this.headerField === 'content-transfer-encoding') {
+ this.partTransferEncoding = this.headerValue.toLowerCase();
+ }
+
+ this.headerFieldDecoder = new StringDecoder(this.encoding);
+ this.headerField = '';
+ this.headerValueDecoder = new StringDecoder(this.encoding);
+ this.headerValue = '';
+}
+
+Form.prototype.onParsePartData = function(b) {
+ if (this.partTransferEncoding === 'base64') {
+ this.backpressure = ! this.destStream.write(b.toString('ascii'), 'base64');
+ } else {
+ this.backpressure = ! this.destStream.write(b);
+ }
+}
+
+Form.prototype.onParsePartEnd = function() {
+ if (this.destStream) {
+ flushWriteCbs(this);
+ var s = this.destStream;
+ process.nextTick(function() {
+ s.end();
+ });
+ }
+ clearPartVars(this);
+}
+
+Form.prototype.onParseHeadersEnd = function(offset) {
+ var self = this;
+ switch(self.partTransferEncoding){
+ case 'binary':
+ case '7bit':
+ case '8bit':
+ self.partTransferEncoding = 'binary';
+ break;
+
+ case 'base64': break;
+ default:
+ return createError(400, 'unknown transfer-encoding: ' + self.partTransferEncoding);
+ }
+
+ self.totalFieldCount += 1;
+ if (self.totalFieldCount > self.maxFields) {
+ return createError(413, 'maxFields ' + self.maxFields + ' exceeded.');
+ }
+
+ self.destStream = new stream.PassThrough();
+ self.destStream.on('drain', function() {
+ flushWriteCbs(self);
+ });
+ self.destStream.headers = self.partHeaders;
+ self.destStream.name = self.partName;
+ self.destStream.filename = self.partFilename;
+ self.destStream.byteOffset = self.bytesReceived + offset;
+ var partContentLength = self.destStream.headers['content-length'];
+ self.destStream.byteCount = partContentLength ? parseInt(partContentLength, 10) :
+ self.bytesExpected ? (self.bytesExpected - self.destStream.byteOffset -
+ self.boundary.length - LAST_BOUNDARY_SUFFIX_LEN) :
+ undefined;
+
+ if (self.destStream.filename == null && self.autoFields) {
+ handleField(self, self.destStream);
+ } else if (self.destStream.filename != null && self.autoFiles) {
+ handleFile(self, self.destStream);
+ } else {
+ handlePart(self, self.destStream);
+ }
+}
+
+util.inherits(LimitStream, stream.Transform)
+function LimitStream (limit) {
+ stream.Transform.call(this)
+
+ this.bytes = 0
+ this.limit = limit
+}
+
+LimitStream.prototype._transform = function _transform (chunk, encoding, callback) {
+ var length = !Buffer.isBuffer(chunk)
+ ? Buffer.byteLength(chunk, encoding)
+ : chunk.length
+
+ this.bytes += length
+
+ if (this.bytes > this.limit) {
+ var err = new Error('maximum file length exceeded')
+ err.code = 'ETOOBIG'
+ callback(err)
+ } else {
+ this.push(chunk)
+ this.emit('progress', this.bytes, length)
+ callback()
+ }
+}
+
+function flushWriteCbs(self) {
+ self.writeCbs.forEach(function(cb) {
+ process.nextTick(cb);
+ });
+ self.writeCbs = [];
+ self.backpressure = false;
+}
+
+function getBytesExpected(headers) {
+ var contentLength = headers['content-length'];
+ if (contentLength) {
+ return parseInt(contentLength, 10);
+ } else if (headers['transfer-encoding'] == null) {
+ return 0;
+ } else {
+ return null;
+ }
+}
+
+function beginFlush(self) {
+ self.flushing += 1;
+}
+
+function endFlush(self) {
+ self.flushing -= 1;
+
+ if (self.flushing < 0) {
+ // if this happens this is a critical bug in multiparty and this stack trace
+ // will help us figure it out.
+ self.handleError(new Error('unexpected endFlush'))
+ return;
+ }
+
+ maybeClose(self);
+}
+
+function maybeClose(self) {
+ if (self.flushing > 0 || self.error) return;
+
+ // go through the emit queue in case any field, file, or part events are
+ // waiting to be emitted
+ holdEmitQueue(self)(function() {
+ // nextTick because the user is listening to part 'end' events and we are
+ // using part 'end' events to decide when to emit 'close'. we add our 'end'
+ // handler before the user gets a chance to add theirs. So we make sure
+ // their 'end' event fires before we emit the 'close' event.
+ // this is covered by test/standalone/test-issue-36
+ process.nextTick(function() {
+ self.emit('close');
+ });
+ });
+}
+
+function cleanupOpenFiles(self) {
+ self.openedFiles.forEach(function(internalFile) {
+ // since fd slicer autoClose is true, destroying the only write stream
+ // is guaranteed by the API to close the fd
+ internalFile.ws.destroy();
+
+ fs.unlink(internalFile.publicFile.path, function(err) {
+ if (err) self.handleError(err);
+ });
+ });
+ self.openedFiles = [];
+}
+
+function holdEmitQueue(self, eventEmitter) {
+ var item = { cb: null, ee: eventEmitter, err: null }
+ self.emitQueue.push(item);
+ return function(cb) {
+ item.cb = cb;
+ flushEmitQueue(self);
+ };
+}
+
+function errorEventQueue(self, eventEmitter, err) {
+ var items = self.emitQueue.filter(function (item) {
+ return item.ee === eventEmitter;
+ });
+
+ if (items.length === 0) {
+ eventEmitter.emit('error', err);
+ return;
+ }
+
+ items.forEach(function (item) {
+ item.err = err;
+ });
+}
+
+function flushEmitQueue(self) {
+ while (self.emitQueue.length > 0 && self.emitQueue[0].cb) {
+ var item = self.emitQueue.shift();
+
+ // invoke the callback
+ item.cb();
+
+ if (item.err) {
+ // emit the delayed error
+ item.ee.emit('error', item.err);
+ }
+ }
+}
+
+function handlePart(self, partStream) {
+ beginFlush(self);
+ var emitAndReleaseHold = holdEmitQueue(self, partStream);
+ partStream.on('end', function() {
+ endFlush(self);
+ });
+ emitAndReleaseHold(function() {
+ self.emit('part', partStream);
+ });
+}
+
+function handleFile(self, fileStream) {
+ if (self.error) return;
+ var publicFile = {
+ fieldName: fileStream.name,
+ originalFilename: fileStream.filename,
+ path: uploadPath(self.uploadDir, fileStream.filename),
+ headers: fileStream.headers,
+ size: 0
+ };
+ var internalFile = {
+ publicFile: publicFile,
+ ls: null,
+ ws: fs.createWriteStream(publicFile.path, { flags: 'wx' })
+ };
+ self.openedFiles.push(internalFile)
+ beginFlush(self); // flush to write stream
+ var emitAndReleaseHold = holdEmitQueue(self, fileStream);
+ fileStream.on('error', function(err) {
+ self.handleError(err);
+ });
+ internalFile.ws.on('error', function (err) {
+ self.handleError(err)
+ })
+ internalFile.ws.on('open', function () {
+ // end option here guarantees that no more than that amount will be written
+ // or else an error will be emitted
+ internalFile.ls = new LimitStream(self.maxFilesSize - self.totalFileSize)
+ internalFile.ls.pipe(internalFile.ws)
+
+ internalFile.ls.on('error', function (err) {
+ self.handleError(err.code === 'ETOOBIG'
+ ? createError(413, err.message, { code: err.code })
+ : err)
+ });
+ internalFile.ls.on('progress', function (totalBytes, chunkBytes) {
+ publicFile.size = totalBytes
+ self.totalFileSize += chunkBytes
+ });
+ internalFile.ws.on('close', function () {
+ if (self.error) return;
+ emitAndReleaseHold(function() {
+ self.emit('file', fileStream.name, publicFile);
+ });
+ endFlush(self);
+ });
+ fileStream.pipe(internalFile.ls)
+ });
+}
+
+function handleField(self, fieldStream) {
+ var value = '';
+ var decoder = new StringDecoder(self.encoding);
+
+ beginFlush(self);
+ var emitAndReleaseHold = holdEmitQueue(self, fieldStream);
+ fieldStream.on('error', function(err) {
+ self.handleError(err);
+ });
+ fieldStream.on('readable', function() {
+ var buffer = fieldStream.read();
+ if (!buffer) return;
+
+ self.totalFieldSize += buffer.length;
+ if (self.totalFieldSize > self.maxFieldsSize) {
+ self.handleError(createError(413, 'maxFieldsSize ' + self.maxFieldsSize + ' exceeded'));
+ return;
+ }
+ value += decoder.write(buffer);
+ });
+
+ fieldStream.on('end', function() {
+ emitAndReleaseHold(function() {
+ self.emit('field', fieldStream.name, value);
+ });
+ endFlush(self);
+ });
+}
+
+function clearPartVars(self) {
+ self.partHeaders = {};
+ self.partName = null;
+ self.partFilename = null;
+ self.partTransferEncoding = 'binary';
+ self.destStream = null;
+
+ self.headerFieldDecoder = new StringDecoder(self.encoding);
+ self.headerField = ''
+ self.headerValueDecoder = new StringDecoder(self.encoding);
+ self.headerValue = ''
+}
+
+function setUpParser(self, boundary) {
+ self.boundary = Buffer.alloc(boundary.length + 4)
+ self.boundary.write('\r\n--', 0, boundary.length + 4, 'ascii');
+ self.boundary.write(boundary, 4, boundary.length, 'ascii');
+ self.lookbehind = Buffer.alloc(self.boundary.length + 8)
+ self.state = START;
+ self.boundaryChars = {};
+ for (var i = 0; i < self.boundary.length; i++) {
+ self.boundaryChars[self.boundary[i]] = true;
+ }
+
+ self.index = null;
+ self.partBoundaryFlag = false;
+
+ beginFlush(self);
+ self.on('finish', function() {
+ if (self.state !== END) {
+ self.handleError(createError(400, 'stream ended unexpectedly'));
+ }
+ endFlush(self);
+ });
+}
+
+function uploadPath(baseDir, filename) {
+ var ext = path.extname(filename).replace(FILE_EXT_RE, '$1');
+ var name = uid.sync(18) + ext
+ return path.join(baseDir, name);
+}
+
+function parseFilename(headerValue) {
+ var m = FILENAME_PARAM_RE.exec(headerValue)
+ if (!m) {
+ m = headerValue.match(/\bfilename\*=utf-8''(.*?)($|; )/i)
+ if (m) {
+ m[1] = decodeURI(m[1]);
+ } else {
+ return;
+ }
+ }
+
+ var filename = m[1] || m[2] || '';
+ filename = filename.replace(/%22|\\"/g, '"');
+ filename = filename.replace(/([\d]{4});/g, function(m, code) {
+ return String.fromCharCode(code);
+ });
+ return filename.substr(filename.lastIndexOf('\\') + 1);
+}
+
+function lower(c) {
+ return c | 0x20;
+}
diff --git a/node/node_modules/multiparty/node_modules/http-errors/HISTORY.md b/node/node_modules/multiparty/node_modules/http-errors/HISTORY.md
new file mode 100644
index 0000000..fd802a5
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/http-errors/HISTORY.md
@@ -0,0 +1,165 @@
+2021-11-14 / 1.8.1
+==================
+
+ * deps: toidentifier@1.0.1
+
+2020-06-29 / 1.8.0
+==================
+
+ * Add `isHttpError` export to determine if value is an HTTP error
+ * deps: setprototypeof@1.2.0
+
+2019-06-24 / 1.7.3
+==================
+
+ * deps: inherits@2.0.4
+
+2019-02-18 / 1.7.2
+==================
+
+ * deps: setprototypeof@1.1.1
+
+2018-09-08 / 1.7.1
+==================
+
+ * Fix error creating objects in some environments
+
+2018-07-30 / 1.7.0
+==================
+
+ * Set constructor name when possible
+ * Use `toidentifier` module to make class names
+ * deps: statuses@'>= 1.5.0 < 2'
+
+2018-03-29 / 1.6.3
+==================
+
+ * deps: depd@~1.1.2
+ - perf: remove argument reassignment
+ * deps: setprototypeof@1.1.0
+ * deps: statuses@'>= 1.4.0 < 2'
+
+2017-08-04 / 1.6.2
+==================
+
+ * deps: depd@1.1.1
+ - Remove unnecessary `Buffer` loading
+
+2017-02-20 / 1.6.1
+==================
+
+ * deps: setprototypeof@1.0.3
+ - Fix shim for old browsers
+
+2017-02-14 / 1.6.0
+==================
+
+ * Accept custom 4xx and 5xx status codes in factory
+ * Add deprecation message to `"I'mateapot"` export
+ * Deprecate passing status code as anything except first argument in factory
+ * Deprecate using non-error status codes
+ * Make `message` property enumerable for `HttpError`s
+
+2016-11-16 / 1.5.1
+==================
+
+ * deps: inherits@2.0.3
+ - Fix issue loading in browser
+ * deps: setprototypeof@1.0.2
+ * deps: statuses@'>= 1.3.1 < 2'
+
+2016-05-18 / 1.5.0
+==================
+
+ * Support new code `421 Misdirected Request`
+ * Use `setprototypeof` module to replace `__proto__` setting
+ * deps: statuses@'>= 1.3.0 < 2'
+ - Add `421 Misdirected Request`
+ - perf: enable strict mode
+ * perf: enable strict mode
+
+2016-01-28 / 1.4.0
+==================
+
+ * Add `HttpError` export, for `err instanceof createError.HttpError`
+ * deps: inherits@2.0.1
+ * deps: statuses@'>= 1.2.1 < 2'
+ - Fix message for status 451
+ - Remove incorrect nginx status code
+
+2015-02-02 / 1.3.1
+==================
+
+ * Fix regression where status can be overwritten in `createError` `props`
+
+2015-02-01 / 1.3.0
+==================
+
+ * Construct errors using defined constructors from `createError`
+ * Fix error names that are not identifiers
+ - `createError["I'mateapot"]` is now `createError.ImATeapot`
+ * Set a meaningful `name` property on constructed errors
+
+2014-12-09 / 1.2.8
+==================
+
+ * Fix stack trace from exported function
+ * Remove `arguments.callee` usage
+
+2014-10-14 / 1.2.7
+==================
+
+ * Remove duplicate line
+
+2014-10-02 / 1.2.6
+==================
+
+ * Fix `expose` to be `true` for `ClientError` constructor
+
+2014-09-28 / 1.2.5
+==================
+
+ * deps: statuses@1
+
+2014-09-21 / 1.2.4
+==================
+
+ * Fix dependency version to work with old `npm`s
+
+2014-09-21 / 1.2.3
+==================
+
+ * deps: statuses@~1.1.0
+
+2014-09-21 / 1.2.2
+==================
+
+ * Fix publish error
+
+2014-09-21 / 1.2.1
+==================
+
+ * Support Node.js 0.6
+ * Use `inherits` instead of `util`
+
+2014-09-09 / 1.2.0
+==================
+
+ * Fix the way inheriting functions
+ * Support `expose` being provided in properties argument
+
+2014-09-08 / 1.1.0
+==================
+
+ * Default status to 500
+ * Support provided `error` to extend
+
+2014-09-08 / 1.0.1
+==================
+
+ * Fix accepting string message
+
+2014-09-08 / 1.0.0
+==================
+
+ * Initial release
diff --git a/node/node_modules/multiparty/node_modules/http-errors/LICENSE b/node/node_modules/multiparty/node_modules/http-errors/LICENSE
new file mode 100644
index 0000000..82af4df
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/http-errors/LICENSE
@@ -0,0 +1,23 @@
+
+The MIT License (MIT)
+
+Copyright (c) 2014 Jonathan Ong me@jongleberry.com
+Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node/node_modules/multiparty/node_modules/http-errors/README.md b/node/node_modules/multiparty/node_modules/http-errors/README.md
new file mode 100644
index 0000000..42251a3
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/http-errors/README.md
@@ -0,0 +1,169 @@
+# http-errors
+
+[![NPM Version][npm-version-image]][npm-url]
+[![NPM Downloads][npm-downloads-image]][node-url]
+[![Node.js Version][node-image]][node-url]
+[![Build Status][ci-image]][ci-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Create HTTP errors for Express, Koa, Connect, etc. with ease.
+
+## Install
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```bash
+$ npm install http-errors
+```
+
+## Example
+
+```js
+var createError = require('http-errors')
+var express = require('express')
+var app = express()
+
+app.use(function (req, res, next) {
+ if (!req.user) return next(createError(401, 'Please login to view this page.'))
+ next()
+})
+```
+
+## API
+
+This is the current API, currently extracted from Koa and subject to change.
+
+### Error Properties
+
+- `expose` - can be used to signal if `message` should be sent to the client,
+ defaulting to `false` when `status` >= 500
+- `headers` - can be an object of header names to values to be sent to the
+ client, defaulting to `undefined`. When defined, the key names should all
+ be lower-cased
+- `message` - the traditional error message, which should be kept short and all
+ single line
+- `status` - the status code of the error, mirroring `statusCode` for general
+ compatibility
+- `statusCode` - the status code of the error, defaulting to `500`
+
+### createError([status], [message], [properties])
+
+Create a new error object with the given message `msg`.
+The error object inherits from `createError.HttpError`.
+
+```js
+var err = createError(404, 'This video does not exist!')
+```
+
+- `status: 500` - the status code as a number
+- `message` - the message of the error, defaulting to node's text for that status code.
+- `properties` - custom properties to attach to the object
+
+### createError([status], [error], [properties])
+
+Extend the given `error` object with `createError.HttpError`
+properties. This will not alter the inheritance of the given
+`error` object, and the modified `error` object is the
+return value.
+
+
+
+```js
+fs.readFile('foo.txt', function (err, buf) {
+ if (err) {
+ if (err.code === 'ENOENT') {
+ var httpError = createError(404, err, { expose: false })
+ } else {
+ var httpError = createError(500, err)
+ }
+ }
+})
+```
+
+- `status` - the status code as a number
+- `error` - the error object to extend
+- `properties` - custom properties to attach to the object
+
+### createError.isHttpError(val)
+
+Determine if the provided `val` is an `HttpError`. This will return `true`
+if the error inherits from the `HttpError` constructor of this module or
+matches the "duck type" for an error this module creates. All outputs from
+the `createError` factory will return `true` for this function, including
+if an non-`HttpError` was passed into the factory.
+
+### new createError\[code || name\](\[msg]\))
+
+Create a new error object with the given message `msg`.
+The error object inherits from `createError.HttpError`.
+
+```js
+var err = new createError.NotFound()
+```
+
+- `code` - the status code as a number
+- `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`.
+
+#### List of all constructors
+
+|Status Code|Constructor Name |
+|-----------|-----------------------------|
+|400 |BadRequest |
+|401 |Unauthorized |
+|402 |PaymentRequired |
+|403 |Forbidden |
+|404 |NotFound |
+|405 |MethodNotAllowed |
+|406 |NotAcceptable |
+|407 |ProxyAuthenticationRequired |
+|408 |RequestTimeout |
+|409 |Conflict |
+|410 |Gone |
+|411 |LengthRequired |
+|412 |PreconditionFailed |
+|413 |PayloadTooLarge |
+|414 |URITooLong |
+|415 |UnsupportedMediaType |
+|416 |RangeNotSatisfiable |
+|417 |ExpectationFailed |
+|418 |ImATeapot |
+|421 |MisdirectedRequest |
+|422 |UnprocessableEntity |
+|423 |Locked |
+|424 |FailedDependency |
+|425 |UnorderedCollection |
+|426 |UpgradeRequired |
+|428 |PreconditionRequired |
+|429 |TooManyRequests |
+|431 |RequestHeaderFieldsTooLarge |
+|451 |UnavailableForLegalReasons |
+|500 |InternalServerError |
+|501 |NotImplemented |
+|502 |BadGateway |
+|503 |ServiceUnavailable |
+|504 |GatewayTimeout |
+|505 |HTTPVersionNotSupported |
+|506 |VariantAlsoNegotiates |
+|507 |InsufficientStorage |
+|508 |LoopDetected |
+|509 |BandwidthLimitExceeded |
+|510 |NotExtended |
+|511 |NetworkAuthenticationRequired|
+
+## License
+
+[MIT](LICENSE)
+
+[ci-image]: https://badgen.net/github/checks/jshttp/http-errors/master?label=ci
+[ci-url]: https://github.com/jshttp/http-errors/actions?query=workflow%3Aci
+[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/http-errors/master
+[coveralls-url]: https://coveralls.io/r/jshttp/http-errors?branch=master
+[node-image]: https://badgen.net/npm/node/http-errors
+[node-url]: https://nodejs.org/en/download
+[npm-downloads-image]: https://badgen.net/npm/dm/http-errors
+[npm-url]: https://npmjs.org/package/http-errors
+[npm-version-image]: https://badgen.net/npm/v/http-errors
+[travis-image]: https://badgen.net/travis/jshttp/http-errors/master
+[travis-url]: https://travis-ci.org/jshttp/http-errors
diff --git a/node/node_modules/multiparty/node_modules/http-errors/index.js b/node/node_modules/multiparty/node_modules/http-errors/index.js
new file mode 100644
index 0000000..1a88029
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/http-errors/index.js
@@ -0,0 +1,299 @@
+/*!
+ * http-errors
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2016 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var deprecate = require('depd')('http-errors')
+var setPrototypeOf = require('setprototypeof')
+var statuses = require('statuses')
+var inherits = require('inherits')
+var toIdentifier = require('toidentifier')
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = createError
+module.exports.HttpError = createHttpErrorConstructor()
+module.exports.isHttpError = createIsHttpErrorFunction(module.exports.HttpError)
+
+// Populate exports for all constructors
+populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError)
+
+/**
+ * Get the code class of a status code.
+ * @private
+ */
+
+function codeClass (status) {
+ return Number(String(status).charAt(0) + '00')
+}
+
+/**
+ * Create a new HTTP Error.
+ *
+ * @returns {Error}
+ * @public
+ */
+
+function createError () {
+ // so much arity going on ~_~
+ var err
+ var msg
+ var status = 500
+ var props = {}
+ for (var i = 0; i < arguments.length; i++) {
+ var arg = arguments[i]
+ if (arg instanceof Error) {
+ err = arg
+ status = err.status || err.statusCode || status
+ continue
+ }
+ switch (typeof arg) {
+ case 'string':
+ msg = arg
+ break
+ case 'number':
+ status = arg
+ if (i !== 0) {
+ deprecate('non-first-argument status code; replace with createError(' + arg + ', ...)')
+ }
+ break
+ case 'object':
+ props = arg
+ break
+ }
+ }
+
+ if (typeof status === 'number' && (status < 400 || status >= 600)) {
+ deprecate('non-error status code; use only 4xx or 5xx status codes')
+ }
+
+ if (typeof status !== 'number' ||
+ (!statuses[status] && (status < 400 || status >= 600))) {
+ status = 500
+ }
+
+ // constructor
+ var HttpError = createError[status] || createError[codeClass(status)]
+
+ if (!err) {
+ // create error
+ err = HttpError
+ ? new HttpError(msg)
+ : new Error(msg || statuses[status])
+ Error.captureStackTrace(err, createError)
+ }
+
+ if (!HttpError || !(err instanceof HttpError) || err.status !== status) {
+ // add properties to generic error
+ err.expose = status < 500
+ err.status = err.statusCode = status
+ }
+
+ for (var key in props) {
+ if (key !== 'status' && key !== 'statusCode') {
+ err[key] = props[key]
+ }
+ }
+
+ return err
+}
+
+/**
+ * Create HTTP error abstract base class.
+ * @private
+ */
+
+function createHttpErrorConstructor () {
+ function HttpError () {
+ throw new TypeError('cannot construct abstract class')
+ }
+
+ inherits(HttpError, Error)
+
+ return HttpError
+}
+
+/**
+ * Create a constructor for a client error.
+ * @private
+ */
+
+function createClientErrorConstructor (HttpError, name, code) {
+ var className = toClassName(name)
+
+ function ClientError (message) {
+ // create the error object
+ var msg = message != null ? message : statuses[code]
+ var err = new Error(msg)
+
+ // capture a stack trace to the construction point
+ Error.captureStackTrace(err, ClientError)
+
+ // adjust the [[Prototype]]
+ setPrototypeOf(err, ClientError.prototype)
+
+ // redefine the error message
+ Object.defineProperty(err, 'message', {
+ enumerable: true,
+ configurable: true,
+ value: msg,
+ writable: true
+ })
+
+ // redefine the error name
+ Object.defineProperty(err, 'name', {
+ enumerable: false,
+ configurable: true,
+ value: className,
+ writable: true
+ })
+
+ return err
+ }
+
+ inherits(ClientError, HttpError)
+ nameFunc(ClientError, className)
+
+ ClientError.prototype.status = code
+ ClientError.prototype.statusCode = code
+ ClientError.prototype.expose = true
+
+ return ClientError
+}
+
+/**
+ * Create function to test is a value is a HttpError.
+ * @private
+ */
+
+function createIsHttpErrorFunction (HttpError) {
+ return function isHttpError (val) {
+ if (!val || typeof val !== 'object') {
+ return false
+ }
+
+ if (val instanceof HttpError) {
+ return true
+ }
+
+ return val instanceof Error &&
+ typeof val.expose === 'boolean' &&
+ typeof val.statusCode === 'number' && val.status === val.statusCode
+ }
+}
+
+/**
+ * Create a constructor for a server error.
+ * @private
+ */
+
+function createServerErrorConstructor (HttpError, name, code) {
+ var className = toClassName(name)
+
+ function ServerError (message) {
+ // create the error object
+ var msg = message != null ? message : statuses[code]
+ var err = new Error(msg)
+
+ // capture a stack trace to the construction point
+ Error.captureStackTrace(err, ServerError)
+
+ // adjust the [[Prototype]]
+ setPrototypeOf(err, ServerError.prototype)
+
+ // redefine the error message
+ Object.defineProperty(err, 'message', {
+ enumerable: true,
+ configurable: true,
+ value: msg,
+ writable: true
+ })
+
+ // redefine the error name
+ Object.defineProperty(err, 'name', {
+ enumerable: false,
+ configurable: true,
+ value: className,
+ writable: true
+ })
+
+ return err
+ }
+
+ inherits(ServerError, HttpError)
+ nameFunc(ServerError, className)
+
+ ServerError.prototype.status = code
+ ServerError.prototype.statusCode = code
+ ServerError.prototype.expose = false
+
+ return ServerError
+}
+
+/**
+ * Set the name of a function, if possible.
+ * @private
+ */
+
+function nameFunc (func, name) {
+ var desc = Object.getOwnPropertyDescriptor(func, 'name')
+
+ if (desc && desc.configurable) {
+ desc.value = name
+ Object.defineProperty(func, 'name', desc)
+ }
+}
+
+/**
+ * Populate the exports object with constructors for every error class.
+ * @private
+ */
+
+function populateConstructorExports (exports, codes, HttpError) {
+ codes.forEach(function forEachCode (code) {
+ var CodeError
+ var name = toIdentifier(statuses[code])
+
+ switch (codeClass(code)) {
+ case 400:
+ CodeError = createClientErrorConstructor(HttpError, name, code)
+ break
+ case 500:
+ CodeError = createServerErrorConstructor(HttpError, name, code)
+ break
+ }
+
+ if (CodeError) {
+ // export the constructor
+ exports[code] = CodeError
+ exports[name] = CodeError
+ }
+ })
+
+ // backwards-compatibility
+ exports["I'mateapot"] = deprecate.function(exports.ImATeapot,
+ '"I\'mateapot"; use "ImATeapot" instead')
+}
+
+/**
+ * Get a class name from a name identifier.
+ * @private
+ */
+
+function toClassName (name) {
+ return name.substr(-5) !== 'Error'
+ ? name + 'Error'
+ : name
+}
diff --git a/node/node_modules/multiparty/node_modules/http-errors/package.json b/node/node_modules/multiparty/node_modules/http-errors/package.json
new file mode 100644
index 0000000..df52507
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/http-errors/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "http-errors",
+ "description": "Create HTTP error objects",
+ "version": "1.8.1",
+ "author": "Jonathan Ong (http://jongleberry.com)",
+ "contributors": [
+ "Alan Plum ",
+ "Douglas Christopher Wilson "
+ ],
+ "license": "MIT",
+ "repository": "jshttp/http-errors",
+ "dependencies": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.4",
+ "setprototypeof": "1.2.0",
+ "statuses": ">= 1.5.0 < 2",
+ "toidentifier": "1.0.1"
+ },
+ "devDependencies": {
+ "eslint": "7.32.0",
+ "eslint-config-standard": "14.1.1",
+ "eslint-plugin-import": "2.25.3",
+ "eslint-plugin-markdown": "2.2.1",
+ "eslint-plugin-node": "11.1.0",
+ "eslint-plugin-promise": "5.1.1",
+ "eslint-plugin-standard": "4.1.0",
+ "mocha": "9.1.3",
+ "nyc": "15.1.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ },
+ "scripts": {
+ "lint": "eslint . && node ./scripts/lint-readme-list.js",
+ "test": "mocha --reporter spec --bail",
+ "test-ci": "nyc --reporter=lcov --reporter=text npm test",
+ "test-cov": "nyc --reporter=html --reporter=text npm test"
+ },
+ "keywords": [
+ "http",
+ "error"
+ ],
+ "files": [
+ "index.js",
+ "HISTORY.md",
+ "LICENSE",
+ "README.md"
+ ]
+}
diff --git a/node/node_modules/multiparty/node_modules/inherits/LICENSE b/node/node_modules/multiparty/node_modules/inherits/LICENSE
new file mode 100644
index 0000000..dea3013
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/inherits/LICENSE
@@ -0,0 +1,16 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/node/node_modules/multiparty/node_modules/inherits/README.md b/node/node_modules/multiparty/node_modules/inherits/README.md
new file mode 100644
index 0000000..b1c5665
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/inherits/README.md
@@ -0,0 +1,42 @@
+Browser-friendly inheritance fully compatible with standard node.js
+[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
+
+This package exports standard `inherits` from node.js `util` module in
+node environment, but also provides alternative browser-friendly
+implementation through [browser
+field](https://gist.github.com/shtylman/4339901). Alternative
+implementation is a literal copy of standard one located in standalone
+module to avoid requiring of `util`. It also has a shim for old
+browsers with no `Object.create` support.
+
+While keeping you sure you are using standard `inherits`
+implementation in node.js environment, it allows bundlers such as
+[browserify](https://github.com/substack/node-browserify) to not
+include full `util` package to your client code if all you need is
+just `inherits` function. It worth, because browser shim for `util`
+package is large and `inherits` is often the single function you need
+from it.
+
+It's recommended to use this package instead of
+`require('util').inherits` for any code that has chances to be used
+not only in node.js but in browser too.
+
+## usage
+
+```js
+var inherits = require('inherits');
+// then use exactly as the standard one
+```
+
+## note on version ~1.0
+
+Version ~1.0 had completely different motivation and is not compatible
+neither with 2.0 nor with standard node.js `inherits`.
+
+If you are using version ~1.0 and planning to switch to ~2.0, be
+careful:
+
+* new version uses `super_` instead of `super` for referencing
+ superclass
+* new version overwrites current prototype while old one preserves any
+ existing fields on it
diff --git a/node/node_modules/multiparty/node_modules/inherits/inherits.js b/node/node_modules/multiparty/node_modules/inherits/inherits.js
new file mode 100644
index 0000000..f71f2d9
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/inherits/inherits.js
@@ -0,0 +1,9 @@
+try {
+ var util = require('util');
+ /* istanbul ignore next */
+ if (typeof util.inherits !== 'function') throw '';
+ module.exports = util.inherits;
+} catch (e) {
+ /* istanbul ignore next */
+ module.exports = require('./inherits_browser.js');
+}
diff --git a/node/node_modules/multiparty/node_modules/inherits/inherits_browser.js b/node/node_modules/multiparty/node_modules/inherits/inherits_browser.js
new file mode 100644
index 0000000..86bbb3d
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/inherits/inherits_browser.js
@@ -0,0 +1,27 @@
+if (typeof Object.create === 'function') {
+ // implementation from standard node.js 'util' module
+ module.exports = function inherits(ctor, superCtor) {
+ if (superCtor) {
+ ctor.super_ = superCtor
+ ctor.prototype = Object.create(superCtor.prototype, {
+ constructor: {
+ value: ctor,
+ enumerable: false,
+ writable: true,
+ configurable: true
+ }
+ })
+ }
+ };
+} else {
+ // old school shim for old browsers
+ module.exports = function inherits(ctor, superCtor) {
+ if (superCtor) {
+ ctor.super_ = superCtor
+ var TempCtor = function () {}
+ TempCtor.prototype = superCtor.prototype
+ ctor.prototype = new TempCtor()
+ ctor.prototype.constructor = ctor
+ }
+ }
+}
diff --git a/node/node_modules/multiparty/node_modules/inherits/package.json b/node/node_modules/multiparty/node_modules/inherits/package.json
new file mode 100644
index 0000000..37b4366
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/inherits/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "inherits",
+ "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
+ "version": "2.0.4",
+ "keywords": [
+ "inheritance",
+ "class",
+ "klass",
+ "oop",
+ "object-oriented",
+ "inherits",
+ "browser",
+ "browserify"
+ ],
+ "main": "./inherits.js",
+ "browser": "./inherits_browser.js",
+ "repository": "git://github.com/isaacs/inherits",
+ "license": "ISC",
+ "scripts": {
+ "test": "tap"
+ },
+ "devDependencies": {
+ "tap": "^14.2.4"
+ },
+ "files": [
+ "inherits.js",
+ "inherits_browser.js"
+ ]
+}
diff --git a/node/node_modules/multiparty/node_modules/safe-buffer/LICENSE b/node/node_modules/multiparty/node_modules/safe-buffer/LICENSE
new file mode 100644
index 0000000..0c068ce
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/safe-buffer/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Feross Aboukhadijeh
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node/node_modules/multiparty/node_modules/safe-buffer/README.md b/node/node_modules/multiparty/node_modules/safe-buffer/README.md
new file mode 100644
index 0000000..e9a81af
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/safe-buffer/README.md
@@ -0,0 +1,584 @@
+# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
+
+[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg
+[travis-url]: https://travis-ci.org/feross/safe-buffer
+[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg
+[npm-url]: https://npmjs.org/package/safe-buffer
+[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg
+[downloads-url]: https://npmjs.org/package/safe-buffer
+[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
+[standard-url]: https://standardjs.com
+
+#### Safer Node.js Buffer API
+
+**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`,
+`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.**
+
+**Uses the built-in implementation when available.**
+
+## install
+
+```
+npm install safe-buffer
+```
+
+## usage
+
+The goal of this package is to provide a safe replacement for the node.js `Buffer`.
+
+It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to
+the top of your node.js modules:
+
+```js
+var Buffer = require('safe-buffer').Buffer
+
+// Existing buffer code will continue to work without issues:
+
+new Buffer('hey', 'utf8')
+new Buffer([1, 2, 3], 'utf8')
+new Buffer(obj)
+new Buffer(16) // create an uninitialized buffer (potentially unsafe)
+
+// But you can use these new explicit APIs to make clear what you want:
+
+Buffer.from('hey', 'utf8') // convert from many types to a Buffer
+Buffer.alloc(16) // create a zero-filled buffer (safe)
+Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe)
+```
+
+## api
+
+### Class Method: Buffer.from(array)
+
+
+* `array` {Array}
+
+Allocates a new `Buffer` using an `array` of octets.
+
+```js
+const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]);
+ // creates a new Buffer containing ASCII bytes
+ // ['b','u','f','f','e','r']
+```
+
+A `TypeError` will be thrown if `array` is not an `Array`.
+
+### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]])
+
+
+* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or
+ a `new ArrayBuffer()`
+* `byteOffset` {Number} Default: `0`
+* `length` {Number} Default: `arrayBuffer.length - byteOffset`
+
+When passed a reference to the `.buffer` property of a `TypedArray` instance,
+the newly created `Buffer` will share the same allocated memory as the
+TypedArray.
+
+```js
+const arr = new Uint16Array(2);
+arr[0] = 5000;
+arr[1] = 4000;
+
+const buf = Buffer.from(arr.buffer); // shares the memory with arr;
+
+console.log(buf);
+ // Prints:
+
+// changing the TypedArray changes the Buffer also
+arr[1] = 6000;
+
+console.log(buf);
+ // Prints:
+```
+
+The optional `byteOffset` and `length` arguments specify a memory range within
+the `arrayBuffer` that will be shared by the `Buffer`.
+
+```js
+const ab = new ArrayBuffer(10);
+const buf = Buffer.from(ab, 0, 2);
+console.log(buf.length);
+ // Prints: 2
+```
+
+A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`.
+
+### Class Method: Buffer.from(buffer)
+
+
+* `buffer` {Buffer}
+
+Copies the passed `buffer` data onto a new `Buffer` instance.
+
+```js
+const buf1 = Buffer.from('buffer');
+const buf2 = Buffer.from(buf1);
+
+buf1[0] = 0x61;
+console.log(buf1.toString());
+ // 'auffer'
+console.log(buf2.toString());
+ // 'buffer' (copy is not changed)
+```
+
+A `TypeError` will be thrown if `buffer` is not a `Buffer`.
+
+### Class Method: Buffer.from(str[, encoding])
+
+
+* `str` {String} String to encode.
+* `encoding` {String} Encoding to use, Default: `'utf8'`
+
+Creates a new `Buffer` containing the given JavaScript string `str`. If
+provided, the `encoding` parameter identifies the character encoding.
+If not provided, `encoding` defaults to `'utf8'`.
+
+```js
+const buf1 = Buffer.from('this is a tést');
+console.log(buf1.toString());
+ // prints: this is a tést
+console.log(buf1.toString('ascii'));
+ // prints: this is a tC)st
+
+const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');
+console.log(buf2.toString());
+ // prints: this is a tést
+```
+
+A `TypeError` will be thrown if `str` is not a string.
+
+### Class Method: Buffer.alloc(size[, fill[, encoding]])
+
+
+* `size` {Number}
+* `fill` {Value} Default: `undefined`
+* `encoding` {String} Default: `utf8`
+
+Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the
+`Buffer` will be *zero-filled*.
+
+```js
+const buf = Buffer.alloc(5);
+console.log(buf);
+ //
+```
+
+The `size` must be less than or equal to the value of
+`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
+`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
+be created if a `size` less than or equal to 0 is specified.
+
+If `fill` is specified, the allocated `Buffer` will be initialized by calling
+`buf.fill(fill)`. See [`buf.fill()`][] for more information.
+
+```js
+const buf = Buffer.alloc(5, 'a');
+console.log(buf);
+ //
+```
+
+If both `fill` and `encoding` are specified, the allocated `Buffer` will be
+initialized by calling `buf.fill(fill, encoding)`. For example:
+
+```js
+const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
+console.log(buf);
+ //
+```
+
+Calling `Buffer.alloc(size)` can be significantly slower than the alternative
+`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance
+contents will *never contain sensitive data*.
+
+A `TypeError` will be thrown if `size` is not a number.
+
+### Class Method: Buffer.allocUnsafe(size)
+
+
+* `size` {Number}
+
+Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must
+be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit
+architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is
+thrown. A zero-length Buffer will be created if a `size` less than or equal to
+0 is specified.
+
+The underlying memory for `Buffer` instances created in this way is *not
+initialized*. The contents of the newly created `Buffer` are unknown and
+*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
+`Buffer` instances to zeroes.
+
+```js
+const buf = Buffer.allocUnsafe(5);
+console.log(buf);
+ //
+ // (octets will be different, every time)
+buf.fill(0);
+console.log(buf);
+ //
+```
+
+A `TypeError` will be thrown if `size` is not a number.
+
+Note that the `Buffer` module pre-allocates an internal `Buffer` instance of
+size `Buffer.poolSize` that is used as a pool for the fast allocation of new
+`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated
+`new Buffer(size)` constructor) only when `size` is less than or equal to
+`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default
+value of `Buffer.poolSize` is `8192` but can be modified.
+
+Use of this pre-allocated internal memory pool is a key difference between
+calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
+Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer
+pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal
+Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The
+difference is subtle but can be important when an application requires the
+additional performance that `Buffer.allocUnsafe(size)` provides.
+
+### Class Method: Buffer.allocUnsafeSlow(size)
+
+
+* `size` {Number}
+
+Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The
+`size` must be less than or equal to the value of
+`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
+`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
+be created if a `size` less than or equal to 0 is specified.
+
+The underlying memory for `Buffer` instances created in this way is *not
+initialized*. The contents of the newly created `Buffer` are unknown and
+*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
+`Buffer` instances to zeroes.
+
+When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
+allocations under 4KB are, by default, sliced from a single pre-allocated
+`Buffer`. This allows applications to avoid the garbage collection overhead of
+creating many individually allocated Buffers. This approach improves both
+performance and memory usage by eliminating the need to track and cleanup as
+many `Persistent` objects.
+
+However, in the case where a developer may need to retain a small chunk of
+memory from a pool for an indeterminate amount of time, it may be appropriate
+to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then
+copy out the relevant bits.
+
+```js
+// need to keep around a few small chunks of memory
+const store = [];
+
+socket.on('readable', () => {
+ const data = socket.read();
+ // allocate for retained data
+ const sb = Buffer.allocUnsafeSlow(10);
+ // copy the data into the new allocation
+ data.copy(sb, 0, 0, 10);
+ store.push(sb);
+});
+```
+
+Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after*
+a developer has observed undue memory retention in their applications.
+
+A `TypeError` will be thrown if `size` is not a number.
+
+### All the Rest
+
+The rest of the `Buffer` API is exactly the same as in node.js.
+[See the docs](https://nodejs.org/api/buffer.html).
+
+
+## Related links
+
+- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660)
+- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4)
+
+## Why is `Buffer` unsafe?
+
+Today, the node.js `Buffer` constructor is overloaded to handle many different argument
+types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.),
+`ArrayBuffer`, and also `Number`.
+
+The API is optimized for convenience: you can throw any type at it, and it will try to do
+what you want.
+
+Because the Buffer constructor is so powerful, you often see code like this:
+
+```js
+// Convert UTF-8 strings to hex
+function toHex (str) {
+ return new Buffer(str).toString('hex')
+}
+```
+
+***But what happens if `toHex` is called with a `Number` argument?***
+
+### Remote Memory Disclosure
+
+If an attacker can make your program call the `Buffer` constructor with a `Number`
+argument, then they can make it allocate uninitialized memory from the node.js process.
+This could potentially disclose TLS private keys, user data, or database passwords.
+
+When the `Buffer` constructor is passed a `Number` argument, it returns an
+**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like
+this, you **MUST** overwrite the contents before returning it to the user.
+
+From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size):
+
+> `new Buffer(size)`
+>
+> - `size` Number
+>
+> The underlying memory for `Buffer` instances created in this way is not initialized.
+> **The contents of a newly created `Buffer` are unknown and could contain sensitive
+> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes.
+
+(Emphasis our own.)
+
+Whenever the programmer intended to create an uninitialized `Buffer` you often see code
+like this:
+
+```js
+var buf = new Buffer(16)
+
+// Immediately overwrite the uninitialized buffer with data from another buffer
+for (var i = 0; i < buf.length; i++) {
+ buf[i] = otherBuf[i]
+}
+```
+
+
+### Would this ever be a problem in real code?
+
+Yes. It's surprisingly common to forget to check the type of your variables in a
+dynamically-typed language like JavaScript.
+
+Usually the consequences of assuming the wrong type is that your program crashes with an
+uncaught exception. But the failure mode for forgetting to check the type of arguments to
+the `Buffer` constructor is more catastrophic.
+
+Here's an example of a vulnerable service that takes a JSON payload and converts it to
+hex:
+
+```js
+// Take a JSON payload {str: "some string"} and convert it to hex
+var server = http.createServer(function (req, res) {
+ var data = ''
+ req.setEncoding('utf8')
+ req.on('data', function (chunk) {
+ data += chunk
+ })
+ req.on('end', function () {
+ var body = JSON.parse(data)
+ res.end(new Buffer(body.str).toString('hex'))
+ })
+})
+
+server.listen(8080)
+```
+
+In this example, an http client just has to send:
+
+```json
+{
+ "str": 1000
+}
+```
+
+and it will get back 1,000 bytes of uninitialized memory from the server.
+
+This is a very serious bug. It's similar in severity to the
+[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process
+memory by remote attackers.
+
+
+### Which real-world packages were vulnerable?
+
+#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht)
+
+[Mathias Buus](https://github.com/mafintosh) and I
+([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages,
+[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow
+anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get
+them to reveal 20 bytes at a time of uninitialized memory from the node.js process.
+
+Here's
+[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8)
+that fixed it. We released a new fixed version, created a
+[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all
+vulnerable versions on npm so users will get a warning to upgrade to a newer version.
+
+#### [`ws`](https://www.npmjs.com/package/ws)
+
+That got us wondering if there were other vulnerable packages. Sure enough, within a short
+period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the
+most popular WebSocket implementation in node.js.
+
+If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as
+expected, then uninitialized server memory would be disclosed to the remote peer.
+
+These were the vulnerable methods:
+
+```js
+socket.send(number)
+socket.ping(number)
+socket.pong(number)
+```
+
+Here's a vulnerable socket server with some echo functionality:
+
+```js
+server.on('connection', function (socket) {
+ socket.on('message', function (message) {
+ message = JSON.parse(message)
+ if (message.type === 'echo') {
+ socket.send(message.data) // send back the user's message
+ }
+ })
+})
+```
+
+`socket.send(number)` called on the server, will disclose server memory.
+
+Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue
+was fixed, with a more detailed explanation. Props to
+[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the
+[Node Security Project disclosure](https://nodesecurity.io/advisories/67).
+
+
+### What's the solution?
+
+It's important that node.js offers a fast way to get memory otherwise performance-critical
+applications would needlessly get a lot slower.
+
+But we need a better way to *signal our intent* as programmers. **When we want
+uninitialized memory, we should request it explicitly.**
+
+Sensitive functionality should not be packed into a developer-friendly API that loosely
+accepts many different types. This type of API encourages the lazy practice of passing
+variables in without checking the type very carefully.
+
+#### A new API: `Buffer.allocUnsafe(number)`
+
+The functionality of creating buffers with uninitialized memory should be part of another
+API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that
+frequently gets user input of all sorts of different types passed into it.
+
+```js
+var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory!
+
+// Immediately overwrite the uninitialized buffer with data from another buffer
+for (var i = 0; i < buf.length; i++) {
+ buf[i] = otherBuf[i]
+}
+```
+
+
+### How do we fix node.js core?
+
+We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as
+`semver-major`) which defends against one case:
+
+```js
+var str = 16
+new Buffer(str, 'utf8')
+```
+
+In this situation, it's implied that the programmer intended the first argument to be a
+string, since they passed an encoding as a second argument. Today, node.js will allocate
+uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not
+what the programmer intended.
+
+But this is only a partial solution, since if the programmer does `new Buffer(variable)`
+(without an `encoding` parameter) there's no way to know what they intended. If `variable`
+is sometimes a number, then uninitialized memory will sometimes be returned.
+
+### What's the real long-term fix?
+
+We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when
+we need uninitialized memory. But that would break 1000s of packages.
+
+~~We believe the best solution is to:~~
+
+~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~
+
+~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~
+
+#### Update
+
+We now support adding three new APIs:
+
+- `Buffer.from(value)` - convert from any type to a buffer
+- `Buffer.alloc(size)` - create a zero-filled buffer
+- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size
+
+This solves the core problem that affected `ws` and `bittorrent-dht` which is
+`Buffer(variable)` getting tricked into taking a number argument.
+
+This way, existing code continues working and the impact on the npm ecosystem will be
+minimal. Over time, npm maintainers can migrate performance-critical code to use
+`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`.
+
+
+### Conclusion
+
+We think there's a serious design issue with the `Buffer` API as it exists today. It
+promotes insecure software by putting high-risk functionality into a convenient API
+with friendly "developer ergonomics".
+
+This wasn't merely a theoretical exercise because we found the issue in some of the
+most popular npm packages.
+
+Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of
+`buffer`.
+
+```js
+var Buffer = require('safe-buffer').Buffer
+```
+
+Eventually, we hope that node.js core can switch to this new, safer behavior. We believe
+the impact on the ecosystem would be minimal since it's not a breaking change.
+Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while
+older, insecure packages would magically become safe from this attack vector.
+
+
+## links
+
+- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514)
+- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67)
+- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68)
+
+
+## credit
+
+The original issues in `bittorrent-dht`
+([disclosure](https://nodesecurity.io/advisories/68)) and
+`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by
+[Mathias Buus](https://github.com/mafintosh) and
+[Feross Aboukhadijeh](http://feross.org/).
+
+Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues
+and for his work running the [Node Security Project](https://nodesecurity.io/).
+
+Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and
+auditing the code.
+
+
+## license
+
+MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org)
diff --git a/node/node_modules/multiparty/node_modules/safe-buffer/index.d.ts b/node/node_modules/multiparty/node_modules/safe-buffer/index.d.ts
new file mode 100644
index 0000000..e9fed80
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/safe-buffer/index.d.ts
@@ -0,0 +1,187 @@
+declare module "safe-buffer" {
+ export class Buffer {
+ length: number
+ write(string: string, offset?: number, length?: number, encoding?: string): number;
+ toString(encoding?: string, start?: number, end?: number): string;
+ toJSON(): { type: 'Buffer', data: any[] };
+ equals(otherBuffer: Buffer): boolean;
+ compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
+ copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
+ slice(start?: number, end?: number): Buffer;
+ writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUInt8(offset: number, noAssert?: boolean): number;
+ readUInt16LE(offset: number, noAssert?: boolean): number;
+ readUInt16BE(offset: number, noAssert?: boolean): number;
+ readUInt32LE(offset: number, noAssert?: boolean): number;
+ readUInt32BE(offset: number, noAssert?: boolean): number;
+ readInt8(offset: number, noAssert?: boolean): number;
+ readInt16LE(offset: number, noAssert?: boolean): number;
+ readInt16BE(offset: number, noAssert?: boolean): number;
+ readInt32LE(offset: number, noAssert?: boolean): number;
+ readInt32BE(offset: number, noAssert?: boolean): number;
+ readFloatLE(offset: number, noAssert?: boolean): number;
+ readFloatBE(offset: number, noAssert?: boolean): number;
+ readDoubleLE(offset: number, noAssert?: boolean): number;
+ readDoubleBE(offset: number, noAssert?: boolean): number;
+ swap16(): Buffer;
+ swap32(): Buffer;
+ swap64(): Buffer;
+ writeUInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
+ fill(value: any, offset?: number, end?: number): this;
+ indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+ lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+ includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
+
+ /**
+ * Allocates a new buffer containing the given {str}.
+ *
+ * @param str String to store in buffer.
+ * @param encoding encoding to use, optional. Default is 'utf8'
+ */
+ constructor (str: string, encoding?: string);
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ */
+ constructor (size: number);
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ constructor (array: Uint8Array);
+ /**
+ * Produces a Buffer backed by the same allocated memory as
+ * the given {ArrayBuffer}.
+ *
+ *
+ * @param arrayBuffer The ArrayBuffer with which to share memory.
+ */
+ constructor (arrayBuffer: ArrayBuffer);
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ constructor (array: any[]);
+ /**
+ * Copies the passed {buffer} data onto a new {Buffer} instance.
+ *
+ * @param buffer The buffer to copy.
+ */
+ constructor (buffer: Buffer);
+ prototype: Buffer;
+ /**
+ * Allocates a new Buffer using an {array} of octets.
+ *
+ * @param array
+ */
+ static from(array: any[]): Buffer;
+ /**
+ * When passed a reference to the .buffer property of a TypedArray instance,
+ * the newly created Buffer will share the same allocated memory as the TypedArray.
+ * The optional {byteOffset} and {length} arguments specify a memory range
+ * within the {arrayBuffer} that will be shared by the Buffer.
+ *
+ * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
+ * @param byteOffset
+ * @param length
+ */
+ static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
+ /**
+ * Copies the passed {buffer} data onto a new Buffer instance.
+ *
+ * @param buffer
+ */
+ static from(buffer: Buffer): Buffer;
+ /**
+ * Creates a new Buffer containing the given JavaScript string {str}.
+ * If provided, the {encoding} parameter identifies the character encoding.
+ * If not provided, {encoding} defaults to 'utf8'.
+ *
+ * @param str
+ */
+ static from(str: string, encoding?: string): Buffer;
+ /**
+ * Returns true if {obj} is a Buffer
+ *
+ * @param obj object to test.
+ */
+ static isBuffer(obj: any): obj is Buffer;
+ /**
+ * Returns true if {encoding} is a valid encoding argument.
+ * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
+ *
+ * @param encoding string to test.
+ */
+ static isEncoding(encoding: string): boolean;
+ /**
+ * Gives the actual byte length of a string. encoding defaults to 'utf8'.
+ * This is not the same as String.prototype.length since that returns the number of characters in a string.
+ *
+ * @param string string to test.
+ * @param encoding encoding used to evaluate (defaults to 'utf8')
+ */
+ static byteLength(string: string, encoding?: string): number;
+ /**
+ * Returns a buffer which is the result of concatenating all the buffers in the list together.
+ *
+ * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
+ * If the list has exactly one item, then the first item of the list is returned.
+ * If the list has more than one item, then a new Buffer is created.
+ *
+ * @param list An array of Buffer objects to concatenate
+ * @param totalLength Total length of the buffers when concatenated.
+ * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
+ */
+ static concat(list: Buffer[], totalLength?: number): Buffer;
+ /**
+ * The same as buf1.compare(buf2).
+ */
+ static compare(buf1: Buffer, buf2: Buffer): number;
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
+ * If parameter is omitted, buffer will be filled with zeros.
+ * @param encoding encoding used for call to buf.fill while initalizing
+ */
+ static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
+ /**
+ * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
+ * of the newly created Buffer are unknown and may contain sensitive data.
+ *
+ * @param size count of octets to allocate
+ */
+ static allocUnsafe(size: number): Buffer;
+ /**
+ * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
+ * of the newly created Buffer are unknown and may contain sensitive data.
+ *
+ * @param size count of octets to allocate
+ */
+ static allocUnsafeSlow(size: number): Buffer;
+ }
+}
\ No newline at end of file
diff --git a/node/node_modules/multiparty/node_modules/safe-buffer/index.js b/node/node_modules/multiparty/node_modules/safe-buffer/index.js
new file mode 100644
index 0000000..f8d3ec9
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/safe-buffer/index.js
@@ -0,0 +1,65 @@
+/*! safe-buffer. MIT License. Feross Aboukhadijeh */
+/* eslint-disable node/no-deprecated-api */
+var buffer = require('buffer')
+var Buffer = buffer.Buffer
+
+// alternative to using Object.keys for old browsers
+function copyProps (src, dst) {
+ for (var key in src) {
+ dst[key] = src[key]
+ }
+}
+if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
+ module.exports = buffer
+} else {
+ // Copy properties from require('buffer')
+ copyProps(buffer, exports)
+ exports.Buffer = SafeBuffer
+}
+
+function SafeBuffer (arg, encodingOrOffset, length) {
+ return Buffer(arg, encodingOrOffset, length)
+}
+
+SafeBuffer.prototype = Object.create(Buffer.prototype)
+
+// Copy static methods from Buffer
+copyProps(Buffer, SafeBuffer)
+
+SafeBuffer.from = function (arg, encodingOrOffset, length) {
+ if (typeof arg === 'number') {
+ throw new TypeError('Argument must not be a number')
+ }
+ return Buffer(arg, encodingOrOffset, length)
+}
+
+SafeBuffer.alloc = function (size, fill, encoding) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ var buf = Buffer(size)
+ if (fill !== undefined) {
+ if (typeof encoding === 'string') {
+ buf.fill(fill, encoding)
+ } else {
+ buf.fill(fill)
+ }
+ } else {
+ buf.fill(0)
+ }
+ return buf
+}
+
+SafeBuffer.allocUnsafe = function (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ return Buffer(size)
+}
+
+SafeBuffer.allocUnsafeSlow = function (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ return buffer.SlowBuffer(size)
+}
diff --git a/node/node_modules/multiparty/node_modules/safe-buffer/package.json b/node/node_modules/multiparty/node_modules/safe-buffer/package.json
new file mode 100644
index 0000000..f2869e2
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/safe-buffer/package.json
@@ -0,0 +1,51 @@
+{
+ "name": "safe-buffer",
+ "description": "Safer Node.js Buffer API",
+ "version": "5.2.1",
+ "author": {
+ "name": "Feross Aboukhadijeh",
+ "email": "feross@feross.org",
+ "url": "https://feross.org"
+ },
+ "bugs": {
+ "url": "https://github.com/feross/safe-buffer/issues"
+ },
+ "devDependencies": {
+ "standard": "*",
+ "tape": "^5.0.0"
+ },
+ "homepage": "https://github.com/feross/safe-buffer",
+ "keywords": [
+ "buffer",
+ "buffer allocate",
+ "node security",
+ "safe",
+ "safe-buffer",
+ "security",
+ "uninitialized"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "types": "index.d.ts",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/feross/safe-buffer.git"
+ },
+ "scripts": {
+ "test": "standard && tape test/*.js"
+ },
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+}
diff --git a/node/node_modules/multiparty/node_modules/setprototypeof/LICENSE b/node/node_modules/multiparty/node_modules/setprototypeof/LICENSE
new file mode 100644
index 0000000..61afa2f
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/setprototypeof/LICENSE
@@ -0,0 +1,13 @@
+Copyright (c) 2015, Wes Todd
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node/node_modules/multiparty/node_modules/setprototypeof/README.md b/node/node_modules/multiparty/node_modules/setprototypeof/README.md
new file mode 100644
index 0000000..791eeff
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/setprototypeof/README.md
@@ -0,0 +1,31 @@
+# Polyfill for `Object.setPrototypeOf`
+
+[![NPM Version](https://img.shields.io/npm/v/setprototypeof.svg)](https://npmjs.org/package/setprototypeof)
+[![NPM Downloads](https://img.shields.io/npm/dm/setprototypeof.svg)](https://npmjs.org/package/setprototypeof)
+[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/standard/standard)
+
+A simple cross platform implementation to set the prototype of an instianted object. Supports all modern browsers and at least back to IE8.
+
+## Usage:
+
+```
+$ npm install --save setprototypeof
+```
+
+```javascript
+var setPrototypeOf = require('setprototypeof')
+
+var obj = {}
+setPrototypeOf(obj, {
+ foo: function () {
+ return 'bar'
+ }
+})
+obj.foo() // bar
+```
+
+TypeScript is also supported:
+
+```typescript
+import setPrototypeOf from 'setprototypeof'
+```
diff --git a/node/node_modules/multiparty/node_modules/setprototypeof/index.d.ts b/node/node_modules/multiparty/node_modules/setprototypeof/index.d.ts
new file mode 100644
index 0000000..f108ecd
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/setprototypeof/index.d.ts
@@ -0,0 +1,2 @@
+declare function setPrototypeOf(o: any, proto: object | null): any;
+export = setPrototypeOf;
diff --git a/node/node_modules/multiparty/node_modules/setprototypeof/index.js b/node/node_modules/multiparty/node_modules/setprototypeof/index.js
new file mode 100644
index 0000000..c527055
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/setprototypeof/index.js
@@ -0,0 +1,17 @@
+'use strict'
+/* eslint no-proto: 0 */
+module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties)
+
+function setProtoOf (obj, proto) {
+ obj.__proto__ = proto
+ return obj
+}
+
+function mixinProperties (obj, proto) {
+ for (var prop in proto) {
+ if (!Object.prototype.hasOwnProperty.call(obj, prop)) {
+ obj[prop] = proto[prop]
+ }
+ }
+ return obj
+}
diff --git a/node/node_modules/multiparty/node_modules/setprototypeof/package.json b/node/node_modules/multiparty/node_modules/setprototypeof/package.json
new file mode 100644
index 0000000..f20915b
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/setprototypeof/package.json
@@ -0,0 +1,38 @@
+{
+ "name": "setprototypeof",
+ "version": "1.2.0",
+ "description": "A small polyfill for Object.setprototypeof",
+ "main": "index.js",
+ "typings": "index.d.ts",
+ "scripts": {
+ "test": "standard && mocha",
+ "testallversions": "npm run node010 && npm run node4 && npm run node6 && npm run node9 && npm run node11",
+ "testversion": "docker run -it --rm -v $(PWD):/usr/src/app -w /usr/src/app node:${NODE_VER} npm install mocha@${MOCHA_VER:-latest} && npm t",
+ "node010": "NODE_VER=0.10 MOCHA_VER=3 npm run testversion",
+ "node4": "NODE_VER=4 npm run testversion",
+ "node6": "NODE_VER=6 npm run testversion",
+ "node9": "NODE_VER=9 npm run testversion",
+ "node11": "NODE_VER=11 npm run testversion",
+ "prepublishOnly": "npm t",
+ "postpublish": "git push origin && git push origin --tags"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/wesleytodd/setprototypeof.git"
+ },
+ "keywords": [
+ "polyfill",
+ "object",
+ "setprototypeof"
+ ],
+ "author": "Wes Todd",
+ "license": "ISC",
+ "bugs": {
+ "url": "https://github.com/wesleytodd/setprototypeof/issues"
+ },
+ "homepage": "https://github.com/wesleytodd/setprototypeof",
+ "devDependencies": {
+ "mocha": "^6.1.4",
+ "standard": "^13.0.2"
+ }
+}
diff --git a/node/node_modules/multiparty/node_modules/setprototypeof/test/index.js b/node/node_modules/multiparty/node_modules/setprototypeof/test/index.js
new file mode 100644
index 0000000..afeb4dd
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/setprototypeof/test/index.js
@@ -0,0 +1,24 @@
+'use strict'
+/* eslint-env mocha */
+/* eslint no-proto: 0 */
+var assert = require('assert')
+var setPrototypeOf = require('..')
+
+describe('setProtoOf(obj, proto)', function () {
+ it('should merge objects', function () {
+ var obj = { a: 1, b: 2 }
+ var proto = { b: 3, c: 4 }
+ var mergeObj = setPrototypeOf(obj, proto)
+
+ if (Object.getPrototypeOf) {
+ assert.strictEqual(Object.getPrototypeOf(obj), proto)
+ } else if ({ __proto__: [] } instanceof Array) {
+ assert.strictEqual(obj.__proto__, proto)
+ } else {
+ assert.strictEqual(obj.a, 1)
+ assert.strictEqual(obj.b, 2)
+ assert.strictEqual(obj.c, 4)
+ }
+ assert.strictEqual(mergeObj, obj)
+ })
+})
diff --git a/node/node_modules/multiparty/node_modules/statuses/HISTORY.md b/node/node_modules/multiparty/node_modules/statuses/HISTORY.md
new file mode 100644
index 0000000..a1977b2
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/statuses/HISTORY.md
@@ -0,0 +1,65 @@
+1.5.0 / 2018-03-27
+==================
+
+ * Add `103 Early Hints`
+
+1.4.0 / 2017-10-20
+==================
+
+ * Add `STATUS_CODES` export
+
+1.3.1 / 2016-11-11
+==================
+
+ * Fix return type in JSDoc
+
+1.3.0 / 2016-05-17
+==================
+
+ * Add `421 Misdirected Request`
+ * perf: enable strict mode
+
+1.2.1 / 2015-02-01
+==================
+
+ * Fix message for status 451
+ - `451 Unavailable For Legal Reasons`
+
+1.2.0 / 2014-09-28
+==================
+
+ * Add `208 Already Repored`
+ * Add `226 IM Used`
+ * Add `306 (Unused)`
+ * Add `415 Unable For Legal Reasons`
+ * Add `508 Loop Detected`
+
+1.1.1 / 2014-09-24
+==================
+
+ * Add missing 308 to `codes.json`
+
+1.1.0 / 2014-09-21
+==================
+
+ * Add `codes.json` for universal support
+
+1.0.4 / 2014-08-20
+==================
+
+ * Package cleanup
+
+1.0.3 / 2014-06-08
+==================
+
+ * Add 308 to `.redirect` category
+
+1.0.2 / 2014-03-13
+==================
+
+ * Add `.retry` category
+
+1.0.1 / 2014-03-12
+==================
+
+ * Initial release
diff --git a/node/node_modules/multiparty/node_modules/statuses/LICENSE b/node/node_modules/multiparty/node_modules/statuses/LICENSE
new file mode 100644
index 0000000..28a3161
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/statuses/LICENSE
@@ -0,0 +1,23 @@
+
+The MIT License (MIT)
+
+Copyright (c) 2014 Jonathan Ong
+Copyright (c) 2016 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node/node_modules/multiparty/node_modules/statuses/README.md b/node/node_modules/multiparty/node_modules/statuses/README.md
new file mode 100644
index 0000000..0fe5720
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/statuses/README.md
@@ -0,0 +1,127 @@
+# Statuses
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+HTTP status utility for node.
+
+This module provides a list of status codes and messages sourced from
+a few different projects:
+
+ * The [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml)
+ * The [Node.js project](https://nodejs.org/)
+ * The [NGINX project](https://www.nginx.com/)
+ * The [Apache HTTP Server project](https://httpd.apache.org/)
+
+## Installation
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```sh
+$ npm install statuses
+```
+
+## API
+
+
+
+```js
+var status = require('statuses')
+```
+
+### var code = status(Integer || String)
+
+If `Integer` or `String` is a valid HTTP code or status message, then the
+appropriate `code` will be returned. Otherwise, an error will be thrown.
+
+
+
+```js
+status(403) // => 403
+status('403') // => 403
+status('forbidden') // => 403
+status('Forbidden') // => 403
+status(306) // throws, as it's not supported by node.js
+```
+
+### status.STATUS_CODES
+
+Returns an object which maps status codes to status messages, in
+the same format as the
+[Node.js http module](https://nodejs.org/dist/latest/docs/api/http.html#http_http_status_codes).
+
+### status.codes
+
+Returns an array of all the status codes as `Integer`s.
+
+### var msg = status[code]
+
+Map of `code` to `status message`. `undefined` for invalid `code`s.
+
+
+
+```js
+status[404] // => 'Not Found'
+```
+
+### var code = status[msg]
+
+Map of `status message` to `code`. `msg` can either be title-cased or
+lower-cased. `undefined` for invalid `status message`s.
+
+
+
+```js
+status['not found'] // => 404
+status['Not Found'] // => 404
+```
+
+### status.redirect[code]
+
+Returns `true` if a status code is a valid redirect status.
+
+
+
+```js
+status.redirect[200] // => undefined
+status.redirect[301] // => true
+```
+
+### status.empty[code]
+
+Returns `true` if a status code expects an empty body.
+
+
+
+```js
+status.empty[200] // => undefined
+status.empty[204] // => true
+status.empty[304] // => true
+```
+
+### status.retry[code]
+
+Returns `true` if you should retry the rest.
+
+
+
+```js
+status.retry[501] // => undefined
+status.retry[503] // => true
+```
+
+[npm-image]: https://img.shields.io/npm/v/statuses.svg
+[npm-url]: https://npmjs.org/package/statuses
+[node-version-image]: https://img.shields.io/node/v/statuses.svg
+[node-version-url]: https://nodejs.org/en/download
+[travis-image]: https://img.shields.io/travis/jshttp/statuses.svg
+[travis-url]: https://travis-ci.org/jshttp/statuses
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/statuses.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/statuses.svg
+[downloads-url]: https://npmjs.org/package/statuses
diff --git a/node/node_modules/multiparty/node_modules/statuses/codes.json b/node/node_modules/multiparty/node_modules/statuses/codes.json
new file mode 100644
index 0000000..a09283a
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/statuses/codes.json
@@ -0,0 +1,66 @@
+{
+ "100": "Continue",
+ "101": "Switching Protocols",
+ "102": "Processing",
+ "103": "Early Hints",
+ "200": "OK",
+ "201": "Created",
+ "202": "Accepted",
+ "203": "Non-Authoritative Information",
+ "204": "No Content",
+ "205": "Reset Content",
+ "206": "Partial Content",
+ "207": "Multi-Status",
+ "208": "Already Reported",
+ "226": "IM Used",
+ "300": "Multiple Choices",
+ "301": "Moved Permanently",
+ "302": "Found",
+ "303": "See Other",
+ "304": "Not Modified",
+ "305": "Use Proxy",
+ "306": "(Unused)",
+ "307": "Temporary Redirect",
+ "308": "Permanent Redirect",
+ "400": "Bad Request",
+ "401": "Unauthorized",
+ "402": "Payment Required",
+ "403": "Forbidden",
+ "404": "Not Found",
+ "405": "Method Not Allowed",
+ "406": "Not Acceptable",
+ "407": "Proxy Authentication Required",
+ "408": "Request Timeout",
+ "409": "Conflict",
+ "410": "Gone",
+ "411": "Length Required",
+ "412": "Precondition Failed",
+ "413": "Payload Too Large",
+ "414": "URI Too Long",
+ "415": "Unsupported Media Type",
+ "416": "Range Not Satisfiable",
+ "417": "Expectation Failed",
+ "418": "I'm a teapot",
+ "421": "Misdirected Request",
+ "422": "Unprocessable Entity",
+ "423": "Locked",
+ "424": "Failed Dependency",
+ "425": "Unordered Collection",
+ "426": "Upgrade Required",
+ "428": "Precondition Required",
+ "429": "Too Many Requests",
+ "431": "Request Header Fields Too Large",
+ "451": "Unavailable For Legal Reasons",
+ "500": "Internal Server Error",
+ "501": "Not Implemented",
+ "502": "Bad Gateway",
+ "503": "Service Unavailable",
+ "504": "Gateway Timeout",
+ "505": "HTTP Version Not Supported",
+ "506": "Variant Also Negotiates",
+ "507": "Insufficient Storage",
+ "508": "Loop Detected",
+ "509": "Bandwidth Limit Exceeded",
+ "510": "Not Extended",
+ "511": "Network Authentication Required"
+}
diff --git a/node/node_modules/multiparty/node_modules/statuses/index.js b/node/node_modules/multiparty/node_modules/statuses/index.js
new file mode 100644
index 0000000..4df469a
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/statuses/index.js
@@ -0,0 +1,113 @@
+/*!
+ * statuses
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2016 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var codes = require('./codes.json')
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = status
+
+// status code to message map
+status.STATUS_CODES = codes
+
+// array of status codes
+status.codes = populateStatusesMap(status, codes)
+
+// status codes for redirects
+status.redirect = {
+ 300: true,
+ 301: true,
+ 302: true,
+ 303: true,
+ 305: true,
+ 307: true,
+ 308: true
+}
+
+// status codes for empty bodies
+status.empty = {
+ 204: true,
+ 205: true,
+ 304: true
+}
+
+// status codes for when you should retry the request
+status.retry = {
+ 502: true,
+ 503: true,
+ 504: true
+}
+
+/**
+ * Populate the statuses map for given codes.
+ * @private
+ */
+
+function populateStatusesMap (statuses, codes) {
+ var arr = []
+
+ Object.keys(codes).forEach(function forEachCode (code) {
+ var message = codes[code]
+ var status = Number(code)
+
+ // Populate properties
+ statuses[status] = message
+ statuses[message] = status
+ statuses[message.toLowerCase()] = status
+
+ // Add to array
+ arr.push(status)
+ })
+
+ return arr
+}
+
+/**
+ * Get the status code.
+ *
+ * Given a number, this will throw if it is not a known status
+ * code, otherwise the code will be returned. Given a string,
+ * the string will be parsed for a number and return the code
+ * if valid, otherwise will lookup the code assuming this is
+ * the status message.
+ *
+ * @param {string|number} code
+ * @returns {number}
+ * @public
+ */
+
+function status (code) {
+ if (typeof code === 'number') {
+ if (!status[code]) throw new Error('invalid status code: ' + code)
+ return code
+ }
+
+ if (typeof code !== 'string') {
+ throw new TypeError('code must be a number or string')
+ }
+
+ // '403'
+ var n = parseInt(code, 10)
+ if (!isNaN(n)) {
+ if (!status[n]) throw new Error('invalid status code: ' + n)
+ return n
+ }
+
+ n = status[code.toLowerCase()]
+ if (!n) throw new Error('invalid status message: "' + code + '"')
+ return n
+}
diff --git a/node/node_modules/multiparty/node_modules/statuses/package.json b/node/node_modules/multiparty/node_modules/statuses/package.json
new file mode 100644
index 0000000..7595e2b
--- /dev/null
+++ b/node/node_modules/multiparty/node_modules/statuses/package.json
@@ -0,0 +1,48 @@
+{
+ "name": "statuses",
+ "description": "HTTP status utility",
+ "version": "1.5.0",
+ "contributors": [
+ "Douglas Christopher Wilson ",
+ "Jonathan Ong (http://jongleberry.com)"
+ ],
+ "repository": "jshttp/statuses",
+ "license": "MIT",
+ "keywords": [
+ "http",
+ "status",
+ "code"
+ ],
+ "files": [
+ "HISTORY.md",
+ "index.js",
+ "codes.json",
+ "LICENSE"
+ ],
+ "devDependencies": {
+ "csv-parse": "1.2.4",
+ "eslint": "4.19.1",
+ "eslint-config-standard": "11.0.0",
+ "eslint-plugin-import": "2.9.0",
+ "eslint-plugin-markdown": "1.0.0-beta.6",
+ "eslint-plugin-node": "6.0.1",
+ "eslint-plugin-promise": "3.7.0",
+ "eslint-plugin-standard": "3.0.1",
+ "istanbul": "0.4.5",
+ "mocha": "1.21.5",
+ "raw-body": "2.3.2",
+ "stream-to-array": "2.3.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ },
+ "scripts": {
+ "build": "node scripts/build.js",
+ "fetch": "node scripts/fetch-apache.js && node scripts/fetch-iana.js && node scripts/fetch-nginx.js && node scripts/fetch-node.js",
+ "lint": "eslint --plugin markdown --ext js,md .",
+ "test": "mocha --reporter spec --check-leaks --bail test/",
+ "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
+ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+ "update": "npm run fetch && npm run build"
+ }
+}
diff --git a/node/node_modules/multiparty/package.json b/node/node_modules/multiparty/package.json
new file mode 100644
index 0000000..84c5490
--- /dev/null
+++ b/node/node_modules/multiparty/package.json
@@ -0,0 +1,50 @@
+{
+ "name": "multiparty",
+ "description": "multipart/form-data parser which supports streaming",
+ "version": "4.2.3",
+ "author": "Andrew Kelley ",
+ "contributors": [
+ "Douglas Christopher Wilson ",
+ "Felix Geisendörfer "
+ ],
+ "license": "MIT",
+ "keywords": [
+ "file",
+ "upload",
+ "formidable",
+ "stream",
+ "s3"
+ ],
+ "repository": "pillarjs/multiparty",
+ "dependencies": {
+ "http-errors": "~1.8.1",
+ "safe-buffer": "5.2.1",
+ "uid-safe": "2.1.5"
+ },
+ "devDependencies": {
+ "eslint": "7.32.0",
+ "eslint-plugin-markdown": "2.2.1",
+ "mkdirp": "0.5.5",
+ "mocha": "9.1.4",
+ "nyc": "15.1.0",
+ "pend": "1.2.0",
+ "require-all": "3.0.0",
+ "rimraf": "2.6.3",
+ "superagent": "3.8.3"
+ },
+ "files": [
+ "HISTORY.md",
+ "LICENSE",
+ "README.md",
+ "index.js"
+ ],
+ "engines": {
+ "node": ">= 0.10"
+ },
+ "scripts": {
+ "lint": "eslint .",
+ "test": "mocha --reporter spec --bail --check-leaks test/",
+ "test-ci": "nyc --reporter=lcov --reporter=text npm test",
+ "test-cov": "nyc --reporter=html --reporter=text npm test"
+ }
+}
diff --git a/node/node_modules/random-bytes/HISTORY.md b/node/node_modules/random-bytes/HISTORY.md
new file mode 100644
index 0000000..8cabd9d
--- /dev/null
+++ b/node/node_modules/random-bytes/HISTORY.md
@@ -0,0 +1,4 @@
+1.0.0 / 2016-01-17
+==================
+
+ * Initial release
diff --git a/node/node_modules/random-bytes/LICENSE b/node/node_modules/random-bytes/LICENSE
new file mode 100644
index 0000000..c24dbe3
--- /dev/null
+++ b/node/node_modules/random-bytes/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node/node_modules/random-bytes/README.md b/node/node_modules/random-bytes/README.md
new file mode 100644
index 0000000..df5aacc
--- /dev/null
+++ b/node/node_modules/random-bytes/README.md
@@ -0,0 +1,77 @@
+# random-bytes
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Generate strong pseudo-random bytes.
+
+This module is a simple wrapper around the Node.js core `crypto.randomBytes` API,
+with the following additions:
+
+ * A `Promise` interface for environments with promises.
+ * For Node.js versions that do not wait for the PRNG to be seeded, this module
+ will wait a bit.
+
+## Installation
+
+```sh
+$ npm install random-bytes
+```
+
+## API
+
+```js
+var randomBytes = require('random-bytes')
+```
+
+### randomBytes(size, callback)
+
+Generates strong pseudo-random bytes. The `size` argument is a number indicating
+the number of bytes to generate.
+
+```js
+randomBytes(12, function (error, bytes) {
+ if (error) throw error
+ // do something with the bytes
+})
+```
+
+### randomBytes(size)
+
+Generates strong pseudo-random bytes and return a `Promise`. The `size` argument is
+a number indicating the number of bytes to generate.
+
+**Note**: To use promises in Node.js _prior to 0.12_, promises must be
+"polyfilled" using `global.Promise = require('bluebird')`.
+
+```js
+randomBytes(18).then(function (string) {
+ // do something with the string
+})
+```
+
+### randomBytes.sync(size)
+
+A synchronous version of above.
+
+```js
+var bytes = randomBytes.sync(18)
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/random-bytes.svg
+[npm-url]: https://npmjs.org/package/random-bytes
+[node-version-image]: https://img.shields.io/node/v/random-bytes.svg
+[node-version-url]: http://nodejs.org/download/
+[travis-image]: https://img.shields.io/travis/crypto-utils/random-bytes/master.svg
+[travis-url]: https://travis-ci.org/crypto-utils/random-bytes
+[coveralls-image]: https://img.shields.io/coveralls/crypto-utils/random-bytes/master.svg
+[coveralls-url]: https://coveralls.io/r/crypto-utils/random-bytes?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/random-bytes.svg
+[downloads-url]: https://npmjs.org/package/random-bytes
diff --git a/node/node_modules/random-bytes/index.js b/node/node_modules/random-bytes/index.js
new file mode 100644
index 0000000..9ad930f
--- /dev/null
+++ b/node/node_modules/random-bytes/index.js
@@ -0,0 +1,101 @@
+/*!
+ * random-bytes
+ * Copyright(c) 2016 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var crypto = require('crypto')
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var generateAttempts = crypto.randomBytes === crypto.pseudoRandomBytes ? 1 : 3
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = randomBytes
+module.exports.sync = randomBytesSync
+
+/**
+ * Generates strong pseudo-random bytes.
+ *
+ * @param {number} size
+ * @param {function} [callback]
+ * @return {Promise}
+ * @public
+ */
+
+function randomBytes(size, callback) {
+ // validate callback is a function, if provided
+ if (callback !== undefined && typeof callback !== 'function') {
+ throw new TypeError('argument callback must be a function')
+ }
+
+ // require the callback without promises
+ if (!callback && !global.Promise) {
+ throw new TypeError('argument callback is required')
+ }
+
+ if (callback) {
+ // classic callback style
+ return generateRandomBytes(size, generateAttempts, callback)
+ }
+
+ return new Promise(function executor(resolve, reject) {
+ generateRandomBytes(size, generateAttempts, function onRandomBytes(err, str) {
+ if (err) return reject(err)
+ resolve(str)
+ })
+ })
+}
+
+/**
+ * Generates strong pseudo-random bytes sync.
+ *
+ * @param {number} size
+ * @return {Buffer}
+ * @public
+ */
+
+function randomBytesSync(size) {
+ var err = null
+
+ for (var i = 0; i < generateAttempts; i++) {
+ try {
+ return crypto.randomBytes(size)
+ } catch (e) {
+ err = e
+ }
+ }
+
+ throw err
+}
+
+/**
+ * Generates strong pseudo-random bytes.
+ *
+ * @param {number} size
+ * @param {number} attempts
+ * @param {function} callback
+ * @private
+ */
+
+function generateRandomBytes(size, attempts, callback) {
+ crypto.randomBytes(size, function onRandomBytes(err, buf) {
+ if (!err) return callback(null, buf)
+ if (!--attempts) return callback(err)
+ setTimeout(generateRandomBytes.bind(null, size, attempts, callback), 10)
+ })
+}
diff --git a/node/node_modules/random-bytes/package.json b/node/node_modules/random-bytes/package.json
new file mode 100644
index 0000000..c67e0e8
--- /dev/null
+++ b/node/node_modules/random-bytes/package.json
@@ -0,0 +1,36 @@
+{
+ "name": "random-bytes",
+ "description": "URL and cookie safe UIDs",
+ "version": "1.0.0",
+ "contributors": [
+ "Douglas Christopher Wilson "
+ ],
+ "license": "MIT",
+ "repository": "crypto-utils/random-bytes",
+ "devDependencies": {
+ "bluebird": "3.1.1",
+ "istanbul": "0.4.2",
+ "mocha": "2.3.4",
+ "proxyquire": "1.2.0"
+ },
+ "files": [
+ "LICENSE",
+ "HISTORY.md",
+ "README.md",
+ "index.js"
+ ],
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "scripts": {
+ "test": "mocha --trace-deprecation --reporter spec --bail --check-leaks test/",
+ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --trace-deprecation --reporter dot --check-leaks test/",
+ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --trace-deprecation --reporter spec --check-leaks test/"
+ },
+ "keywords": [
+ "bytes",
+ "generator",
+ "random",
+ "safe"
+ ]
+}
diff --git a/node/node_modules/toidentifier/HISTORY.md b/node/node_modules/toidentifier/HISTORY.md
new file mode 100644
index 0000000..cb7cc89
--- /dev/null
+++ b/node/node_modules/toidentifier/HISTORY.md
@@ -0,0 +1,9 @@
+1.0.1 / 2021-11-14
+==================
+
+ * pref: enable strict mode
+
+1.0.0 / 2018-07-09
+==================
+
+ * Initial release
diff --git a/node/node_modules/toidentifier/LICENSE b/node/node_modules/toidentifier/LICENSE
new file mode 100644
index 0000000..de22d15
--- /dev/null
+++ b/node/node_modules/toidentifier/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2016 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node/node_modules/toidentifier/README.md b/node/node_modules/toidentifier/README.md
new file mode 100644
index 0000000..57e8a78
--- /dev/null
+++ b/node/node_modules/toidentifier/README.md
@@ -0,0 +1,61 @@
+# toidentifier
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Build Status][github-actions-ci-image]][github-actions-ci-url]
+[![Test Coverage][codecov-image]][codecov-url]
+
+> Convert a string of words to a JavaScript identifier
+
+## Install
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```bash
+$ npm install toidentifier
+```
+
+## Example
+
+```js
+var toIdentifier = require('toidentifier')
+
+console.log(toIdentifier('Bad Request'))
+// => "BadRequest"
+```
+
+## API
+
+This CommonJS module exports a single default function: `toIdentifier`.
+
+### toIdentifier(string)
+
+Given a string as the argument, it will be transformed according to
+the following rules and the new string will be returned:
+
+1. Split into words separated by space characters (`0x20`).
+2. Upper case the first character of each word.
+3. Join the words together with no separator.
+4. Remove all non-word (`[0-9a-z_]`) characters.
+
+## License
+
+[MIT](LICENSE)
+
+[codecov-image]: https://img.shields.io/codecov/c/github/component/toidentifier.svg
+[codecov-url]: https://codecov.io/gh/component/toidentifier
+[downloads-image]: https://img.shields.io/npm/dm/toidentifier.svg
+[downloads-url]: https://npmjs.org/package/toidentifier
+[github-actions-ci-image]: https://img.shields.io/github/workflow/status/component/toidentifier/ci/master?label=ci
+[github-actions-ci-url]: https://github.com/component/toidentifier?query=workflow%3Aci
+[npm-image]: https://img.shields.io/npm/v/toidentifier.svg
+[npm-url]: https://npmjs.org/package/toidentifier
+
+
+##
+
+[npm]: https://www.npmjs.com/
+
+[yarn]: https://yarnpkg.com/
diff --git a/node/node_modules/toidentifier/index.js b/node/node_modules/toidentifier/index.js
new file mode 100644
index 0000000..9295d02
--- /dev/null
+++ b/node/node_modules/toidentifier/index.js
@@ -0,0 +1,32 @@
+/*!
+ * toidentifier
+ * Copyright(c) 2016 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = toIdentifier
+
+/**
+ * Trasform the given string into a JavaScript identifier
+ *
+ * @param {string} str
+ * @returns {string}
+ * @public
+ */
+
+function toIdentifier (str) {
+ return str
+ .split(' ')
+ .map(function (token) {
+ return token.slice(0, 1).toUpperCase() + token.slice(1)
+ })
+ .join('')
+ .replace(/[^ _0-9a-z]/gi, '')
+}
diff --git a/node/node_modules/toidentifier/package.json b/node/node_modules/toidentifier/package.json
new file mode 100644
index 0000000..42db1a6
--- /dev/null
+++ b/node/node_modules/toidentifier/package.json
@@ -0,0 +1,38 @@
+{
+ "name": "toidentifier",
+ "description": "Convert a string of words to a JavaScript identifier",
+ "version": "1.0.1",
+ "author": "Douglas Christopher Wilson ",
+ "contributors": [
+ "Douglas Christopher Wilson ",
+ "Nick Baugh (http://niftylettuce.com/)"
+ ],
+ "repository": "component/toidentifier",
+ "devDependencies": {
+ "eslint": "7.32.0",
+ "eslint-config-standard": "14.1.1",
+ "eslint-plugin-import": "2.25.3",
+ "eslint-plugin-markdown": "2.2.1",
+ "eslint-plugin-node": "11.1.0",
+ "eslint-plugin-promise": "4.3.1",
+ "eslint-plugin-standard": "4.1.0",
+ "mocha": "9.1.3",
+ "nyc": "15.1.0"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "license": "MIT",
+ "files": [
+ "HISTORY.md",
+ "LICENSE",
+ "index.js"
+ ],
+ "scripts": {
+ "lint": "eslint .",
+ "test": "mocha --reporter spec --bail --check-leaks test/",
+ "test-ci": "nyc --reporter=lcov --reporter=text npm test",
+ "test-cov": "nyc --reporter=html --reporter=text npm test",
+ "version": "node scripts/version-history.js && git add HISTORY.md"
+ }
+}
diff --git a/node/node_modules/uid-safe/HISTORY.md b/node/node_modules/uid-safe/HISTORY.md
new file mode 100644
index 0000000..3ec249f
--- /dev/null
+++ b/node/node_modules/uid-safe/HISTORY.md
@@ -0,0 +1,61 @@
+2.1.5 / 2017-08-02
+==================
+
+ * perf: remove only trailing `=`
+
+2.1.4 / 2017-03-02
+==================
+
+ * Remove `base64-url` dependency
+
+2.1.3 / 2016-10-30
+==================
+
+ * deps: base64-url@1.3.3
+
+2.1.2 / 2016-08-15
+==================
+
+ * deps: base64-url@1.3.2
+
+2.1.1 / 2016-05-04
+==================
+
+ * deps: base64-url@1.2.2
+
+2.1.0 / 2016-01-17
+==================
+
+ * Use `random-bytes` for byte source
+
+2.0.0 / 2015-05-08
+==================
+
+ * Use global `Promise` when returning a promise
+
+1.1.0 / 2015-02-01
+==================
+
+ * Use `crypto.randomBytes`, if available
+ * deps: base64-url@1.2.1
+
+1.0.3 / 2015-01-31
+==================
+
+ * Fix error branch that would throw
+ * deps: base64-url@1.2.0
+
+1.0.2 / 2015-01-08
+==================
+
+ * Remove dependency on `mz`
+
+1.0.1 / 2014-06-18
+==================
+
+ * Remove direct `bluebird` dependency
+
+1.0.0 / 2014-06-18
+==================
+
+ * Initial release
diff --git a/node/node_modules/uid-safe/LICENSE b/node/node_modules/uid-safe/LICENSE
new file mode 100644
index 0000000..c4b8a49
--- /dev/null
+++ b/node/node_modules/uid-safe/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Jonathan Ong
+Copyright (c) 2015-2017 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node/node_modules/uid-safe/README.md b/node/node_modules/uid-safe/README.md
new file mode 100644
index 0000000..fa02be8
--- /dev/null
+++ b/node/node_modules/uid-safe/README.md
@@ -0,0 +1,77 @@
+# uid-safe
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+URL and cookie safe UIDs
+
+Create cryptographically secure UIDs safe for both cookie and URL usage.
+This is in contrast to modules such as [rand-token](https://www.npmjs.com/package/rand-token)
+and [uid2](https://www.npmjs.com/package/uid2) whose UIDs are actually skewed
+due to the use of `%` and unnecessarily truncate the UID.
+Use this if you could still use UIDs with `-` and `_` in them.
+
+## Installation
+
+```sh
+$ npm install uid-safe
+```
+
+## API
+
+```js
+var uid = require('uid-safe')
+```
+
+### uid(byteLength, callback)
+
+Asynchronously create a UID with a specific byte length. Because `base64`
+encoding is used underneath, this is not the string length. For example,
+to create a UID of length 24, you want a byte length of 18.
+
+```js
+uid(18, function (err, string) {
+ if (err) throw err
+ // do something with the string
+})
+```
+
+### uid(byteLength)
+
+Asynchronously create a UID with a specific byte length and return a
+`Promise`.
+
+**Note**: To use promises in Node.js _prior to 0.12_, promises must be
+"polyfilled" using `global.Promise = require('bluebird')`.
+
+```js
+uid(18).then(function (string) {
+ // do something with the string
+})
+```
+
+### uid.sync(byteLength)
+
+A synchronous version of above.
+
+```js
+var string = uid.sync(18)
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/uid-safe.svg
+[npm-url]: https://npmjs.org/package/uid-safe
+[node-version-image]: https://img.shields.io/node/v/uid-safe.svg
+[node-version-url]: https://nodejs.org/en/download/
+[travis-image]: https://img.shields.io/travis/crypto-utils/uid-safe/master.svg
+[travis-url]: https://travis-ci.org/crypto-utils/uid-safe
+[coveralls-image]: https://img.shields.io/coveralls/crypto-utils/uid-safe/master.svg
+[coveralls-url]: https://coveralls.io/r/crypto-utils/uid-safe?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/uid-safe.svg
+[downloads-url]: https://npmjs.org/package/uid-safe
diff --git a/node/node_modules/uid-safe/index.js b/node/node_modules/uid-safe/index.js
new file mode 100644
index 0000000..18e8492
--- /dev/null
+++ b/node/node_modules/uid-safe/index.js
@@ -0,0 +1,107 @@
+/*!
+ * uid-safe
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2015-2017 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var randomBytes = require('random-bytes')
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var EQUAL_END_REGEXP = /=+$/
+var PLUS_GLOBAL_REGEXP = /\+/g
+var SLASH_GLOBAL_REGEXP = /\//g
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = uid
+module.exports.sync = uidSync
+
+/**
+ * Create a unique ID.
+ *
+ * @param {number} length
+ * @param {function} [callback]
+ * @return {Promise}
+ * @public
+ */
+
+function uid (length, callback) {
+ // validate callback is a function, if provided
+ if (callback !== undefined && typeof callback !== 'function') {
+ throw new TypeError('argument callback must be a function')
+ }
+
+ // require the callback without promises
+ if (!callback && !global.Promise) {
+ throw new TypeError('argument callback is required')
+ }
+
+ if (callback) {
+ // classic callback style
+ return generateUid(length, callback)
+ }
+
+ return new Promise(function executor (resolve, reject) {
+ generateUid(length, function onUid (err, str) {
+ if (err) return reject(err)
+ resolve(str)
+ })
+ })
+}
+
+/**
+ * Create a unique ID sync.
+ *
+ * @param {number} length
+ * @return {string}
+ * @public
+ */
+
+function uidSync (length) {
+ return toString(randomBytes.sync(length))
+}
+
+/**
+ * Generate a unique ID string.
+ *
+ * @param {number} length
+ * @param {function} callback
+ * @private
+ */
+
+function generateUid (length, callback) {
+ randomBytes(length, function (err, buf) {
+ if (err) return callback(err)
+ callback(null, toString(buf))
+ })
+}
+
+/**
+ * Change a Buffer into a string.
+ *
+ * @param {Buffer} buf
+ * @return {string}
+ * @private
+ */
+
+function toString (buf) {
+ return buf.toString('base64')
+ .replace(EQUAL_END_REGEXP, '')
+ .replace(PLUS_GLOBAL_REGEXP, '-')
+ .replace(SLASH_GLOBAL_REGEXP, '_')
+}
diff --git a/node/node_modules/uid-safe/package.json b/node/node_modules/uid-safe/package.json
new file mode 100644
index 0000000..9d9ea4c
--- /dev/null
+++ b/node/node_modules/uid-safe/package.json
@@ -0,0 +1,46 @@
+{
+ "name": "uid-safe",
+ "description": "URL and cookie safe UIDs",
+ "version": "2.1.5",
+ "contributors": [
+ "Douglas Christopher Wilson ",
+ "Jonathan Ong (http://jongleberry.com)"
+ ],
+ "license": "MIT",
+ "repository": "crypto-utils/uid-safe",
+ "dependencies": {
+ "random-bytes": "~1.0.0"
+ },
+ "devDependencies": {
+ "bluebird": "3.5.0",
+ "eslint": "3.19.0",
+ "eslint-config-standard": "10.2.1",
+ "eslint-plugin-import": "2.7.0",
+ "eslint-plugin-node": "5.1.1",
+ "eslint-plugin-promise": "3.5.0",
+ "eslint-plugin-standard": "3.0.1",
+ "istanbul": "0.4.5",
+ "mocha": "2.5.3"
+ },
+ "files": [
+ "LICENSE",
+ "HISTORY.md",
+ "README.md",
+ "index.js"
+ ],
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "scripts": {
+ "lint": "eslint .",
+ "test": "mocha --trace-deprecation --reporter spec --bail --check-leaks test/",
+ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --trace-deprecation --reporter dot --check-leaks test/",
+ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --trace-deprecation --reporter spec --check-leaks test/"
+ },
+ "keywords": [
+ "random",
+ "generator",
+ "uid",
+ "safe"
+ ]
+}
diff --git a/node/package-lock.json b/node/package-lock.json
index 76bc8ac..3ce4ae4 100644
--- a/node/package-lock.json
+++ b/node/package-lock.json
@@ -15,7 +15,8 @@
"http-errors": "~1.6.3",
"jade": "~1.11.0",
"mongoose": "^8.0.3",
- "morgan": "~1.9.1"
+ "morgan": "~1.9.1",
+ "multiparty": "^4.2.3"
}
},
"node_modules/@mongodb-js/saslprep": {
@@ -766,6 +767,57 @@
"resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz",
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
},
+ "node_modules/multiparty": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmmirror.com/multiparty/-/multiparty-4.2.3.tgz",
+ "integrity": "sha512-Ak6EUJZuhGS8hJ3c2fY6UW5MbkGUPMBEGd13djUzoY/BHqV/gTuFWtC6IuVA7A2+v3yjBS6c4or50xhzTQZImQ==",
+ "dependencies": {
+ "http-errors": "~1.8.1",
+ "safe-buffer": "5.2.1",
+ "uid-safe": "2.1.5"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/multiparty/node_modules/http-errors": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-1.8.1.tgz",
+ "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
+ "dependencies": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.4",
+ "setprototypeof": "1.2.0",
+ "statuses": ">= 1.5.0 < 2",
+ "toidentifier": "1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/multiparty/node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ },
+ "node_modules/multiparty/node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
+ },
+ "node_modules/multiparty/node_modules/setprototypeof": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.2.0.tgz",
+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
+ },
+ "node_modules/multiparty/node_modules/statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmmirror.com/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
"node_modules/negotiator": {
"version": "0.6.3",
"resolved": "https://registry.npmmirror.com/negotiator/-/negotiator-0.6.3.tgz",
@@ -858,6 +910,14 @@
"node": ">=0.6"
}
},
+ "node_modules/random-bytes": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmmirror.com/random-bytes/-/random-bytes-1.0.0.tgz",
+ "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
"node_modules/range-parser": {
"version": "1.2.1",
"resolved": "https://registry.npmmirror.com/range-parser/-/range-parser-1.2.1.tgz",
@@ -983,6 +1043,14 @@
"node": ">= 0.6"
}
},
+ "node_modules/toidentifier": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmmirror.com/toidentifier/-/toidentifier-1.0.1.tgz",
+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
"node_modules/tr46": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/tr46/-/tr46-3.0.0.tgz",
@@ -1088,6 +1156,17 @@
"integrity": "sha512-vb2s1lYx2xBtUgy+ta+b2J/GLVUR+wmpINwHePmPRhOsIVCG2wDzKJ0n14GslH1BifsqVzSOwQhRaCAsZ/nI4Q==",
"optional": true
},
+ "node_modules/uid-safe": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmmirror.com/uid-safe/-/uid-safe-2.1.5.tgz",
+ "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==",
+ "dependencies": {
+ "random-bytes": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-5.26.5.tgz",
diff --git a/node/package.json b/node/package.json
index cb626c1..e9722cc 100644
--- a/node/package.json
+++ b/node/package.json
@@ -13,6 +13,7 @@
"http-errors": "~1.6.3",
"jade": "~1.11.0",
"mongoose": "^8.0.3",
- "morgan": "~1.9.1"
+ "morgan": "~1.9.1",
+ "multiparty": "^4.2.3"
}
}
diff --git a/node/routes/wcx.js b/node/routes/wcx.js
index d66996e..62f623b 100644
--- a/node/routes/wcx.js
+++ b/node/routes/wcx.js
@@ -1,71 +1,152 @@
-var express = require('express');
+var express = require("express");
var router = express.Router();
-let { quebankModel,qestionsModel,classModel}=require('../model/model/kjq.js')
+let multiparty = require("multiparty");
+let {
+ quebankModel,
+ qestionsModel,
+ classModel,
+ qestypeModel,
+} = require("../model/model/kjq.js");
/* GET home page. */
-router.get('/', function(req, res, next) {
- res.render('index', { title: 'Express' });
+router.get("/", function (req, res, next) {
+ res.render("index", { title: "Express" });
});
//班级
-router.post('/class_add', function(req, res, next) {
- classModel.create(req.body)
+router.post("/class_add", function (req, res, next) {
+ classModel.create(req.body);
res.send({
- code:200,
- msg:'添加成功'
- })
+ code: 200,
+ msg: "添加成功",
+ });
});
-router.get('/class_show',async function(req, res, next) {
- let data=await classModel.find()
+router.get("/class_show", async function (req, res, next) {
+ let data = await classModel.find();
res.send({
- code:200,
- data
- })
+ code: 200,
+ data,
+ });
});
-
-router.post('/questionBank_add', function(req, res, next) {
- quebankModel.create(req.body)
+//题库管理
+router.post("/questionBank_add", function (req, res, next) {
+ quebankModel.create(req.body);
res.send({
- code:200,
- msg:'添加成功'
- })
+ code: 200,
+ msg: "添加成功",
+ });
});
-router.get('/questionBank_show',async function(req, res, next) {
- let {pageSize,currentPage,name,classid}=req.query
- let obj={}
- if(name){
- name=new RegExp(name)
- obj.name=name
+router.get("/questionBank_show", async function (req, res, next) {
+ let { pageSize, currentPage, name, classid } = req.query;
+ let obj = {};
+ if (name) {
+ name = new RegExp(name);
+ obj.name = name;
}
- if(classid){
- obj.class=classid
+ if (classid) {
+ obj.class = classid;
}
- let total=0
- let data=await quebankModel.find(obj).populate('uid').populate('class')
- total=data.length
- data=data.slice((currentPage-1)*pageSize,currentPage*pageSize)
+ let total = 0;
+ let data = await quebankModel.find(obj).populate("uid").populate("class");
+ total = data.length;
+ data = data.slice((currentPage - 1) * pageSize, currentPage * pageSize);
res.send({
- code:200,
+ code: 200,
data,
- total
- })
+ total,
+ });
});
-router.put('/questionBank_edit',async function(req, res, next) {
- let list=req.body
+router.put("/questionBank_edit", async function (req, res, next) {
+ let list = req.body;
console.log(list);
- await quebankModel.updateOne({_id:list._id},list)
+ await quebankModel.updateOne({ _id: list._id }, list);
res.send({
- code:200,
- msg:'修改成功'
- })
+ code: 200,
+ msg: "修改成功",
+ });
});
-router.delete('/questionBank_del',async function(req, res, next) {
- let {_id}=req.query
- console.log(_id)
- await quebankModel.deleteOne({_id:_id})
+router.delete("/questionBank_del", async function (req, res, next) {
+ let { _id } = req.query;
+ console.log(_id);
+ await quebankModel.deleteOne({ _id: _id });
res.send({
- code:200,
- msg:'删除成功'
- })
+ code: 200,
+ msg: "删除成功",
+ });
+});
+
+//题库类型
+router.get("/quest_show", async function (req, res, next) {
+ let data = await qestypeModel.find();
+ res.send({
+ code: 200,
+ data,
+ });
+});
+
+//题库详情
+router.post("/details_add", function (req, res, next) {
+ qestionsModel.create(req.body);
+ res.send({
+ code: 200,
+ msg: "添加成功",
+ });
+});
+router.get("/details_show", async function (req, res, next) {
+ let { qid, name, qtype, pageSize, currentPage } = req.query;
+ console.log(qtype);
+ let total = 0;
+ let obj = {};
+ if (qid) {
+ obj.qid = qid;
+ }
+ if (name) {
+ name = new RegExp(name);
+ obj.name = name;
+ }
+ if (qtype) {
+ obj.qtype = qtype;
+ }
+ let data = await qestionsModel.find(obj).populate("qtype").populate("qid");
+ total = data.length;
+ data = data.slice((currentPage - 1) * pageSize, currentPage * pageSize);
+ res.send({
+ code: 200,
+ data,
+ total,
+ });
+});
+router.delete("/details_del", async function (req, res, next) {
+ let { _id } = req.query;
+ await qestionsModel.deleteOne({ _id: _id });
+ res.send({
+ code: 200,
+ msg: "删除成功",
+ });
+});
+
+router.post("/uploadImg", async function (req, res, next) {
+ let form = new multiparty.Form();
+ form.uploadDir = "upload";
+ form.parse(req, (error, a, filename) => {
+ console.log(filename);
+ res.send({
+ code: 200,
+ msg: "上传成功",
+ path: "http://127.0.0.1:3000/" + filename.file[0].path,
+ });
+ });
+});
+
+router.put("/details_edit", async function (req, res, next) {
+ let list = req.body;
+ console.log(list);
+ await qestionsModel.updateOne({ _id: list._id }, list);
+ res.send({
+ code: 200,
+ msg: "修改成功",
+ });
+
+
});
module.exports = router;
--
Gitee