mirror of
https://github.com/yawaflua/SusMarket.git
synced 2025-12-08 19:49:36 +02:00
Fixes and other
This commit is contained in:
97
node_modules/.package-lock.json
generated
vendored
Normal file
97
node_modules/.package-lock.json
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
{
|
||||||
|
"name": "SusMarket",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"node_modules/asynckit": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||||
|
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||||
|
},
|
||||||
|
"node_modules/axios": {
|
||||||
|
"version": "1.6.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz",
|
||||||
|
"integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"follow-redirects": "^1.15.6",
|
||||||
|
"form-data": "^4.0.0",
|
||||||
|
"proxy-from-env": "^1.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/combined-stream": {
|
||||||
|
"version": "1.0.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
|
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||||
|
"dependencies": {
|
||||||
|
"delayed-stream": "~1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/delayed-stream": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/follow-redirects": {
|
||||||
|
"version": "1.15.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
|
||||||
|
"integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "individual",
|
||||||
|
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"debug": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/form-data": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
|
||||||
|
"dependencies": {
|
||||||
|
"asynckit": "^0.4.0",
|
||||||
|
"combined-stream": "^1.0.8",
|
||||||
|
"mime-types": "^2.1.12"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mime-db": {
|
||||||
|
"version": "1.52.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||||
|
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mime-types": {
|
||||||
|
"version": "2.1.35",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
||||||
|
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||||
|
"dependencies": {
|
||||||
|
"mime-db": "1.52.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/proxy-from-env": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
21
node_modules/asynckit/LICENSE
generated
vendored
Normal file
21
node_modules/asynckit/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2016 Alex Indigo
|
||||||
|
|
||||||
|
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.
|
||||||
233
node_modules/asynckit/README.md
generated
vendored
Normal file
233
node_modules/asynckit/README.md
generated
vendored
Normal file
@@ -0,0 +1,233 @@
|
|||||||
|
# asynckit [](https://www.npmjs.com/package/asynckit)
|
||||||
|
|
||||||
|
Minimal async jobs utility library, with streams support.
|
||||||
|
|
||||||
|
[](https://travis-ci.org/alexindigo/asynckit)
|
||||||
|
[](https://travis-ci.org/alexindigo/asynckit)
|
||||||
|
[](https://ci.appveyor.com/project/alexindigo/asynckit)
|
||||||
|
|
||||||
|
[](https://coveralls.io/github/alexindigo/asynckit?branch=master)
|
||||||
|
[](https://david-dm.org/alexindigo/asynckit)
|
||||||
|
[](https://www.bithound.io/github/alexindigo/asynckit)
|
||||||
|
|
||||||
|
<!-- [](https://www.npmjs.com/package/reamde) -->
|
||||||
|
|
||||||
|
AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects.
|
||||||
|
Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method.
|
||||||
|
|
||||||
|
It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators.
|
||||||
|
|
||||||
|
| compression | size |
|
||||||
|
| :----------------- | -------: |
|
||||||
|
| asynckit.js | 12.34 kB |
|
||||||
|
| asynckit.min.js | 4.11 kB |
|
||||||
|
| asynckit.min.js.gz | 1.47 kB |
|
||||||
|
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm install --save asynckit
|
||||||
|
```
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
### Parallel Jobs
|
||||||
|
|
||||||
|
Runs iterator over provided array in parallel. Stores output in the `result` array,
|
||||||
|
on the matching positions. In unlikely event of an error from one of the jobs,
|
||||||
|
will terminate rest of the active jobs (if abort function is provided)
|
||||||
|
and return error along with salvaged data to the main callback function.
|
||||||
|
|
||||||
|
#### Input Array
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var parallel = require('asynckit').parallel
|
||||||
|
, assert = require('assert')
|
||||||
|
;
|
||||||
|
|
||||||
|
var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
|
||||||
|
, expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
|
||||||
|
, expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ]
|
||||||
|
, target = []
|
||||||
|
;
|
||||||
|
|
||||||
|
parallel(source, asyncJob, function(err, result)
|
||||||
|
{
|
||||||
|
assert.deepEqual(result, expectedResult);
|
||||||
|
assert.deepEqual(target, expectedTarget);
|
||||||
|
});
|
||||||
|
|
||||||
|
// async job accepts one element from the array
|
||||||
|
// and a callback function
|
||||||
|
function asyncJob(item, cb)
|
||||||
|
{
|
||||||
|
// different delays (in ms) per item
|
||||||
|
var delay = item * 25;
|
||||||
|
|
||||||
|
// pretend different jobs take different time to finish
|
||||||
|
// and not in consequential order
|
||||||
|
var timeoutId = setTimeout(function() {
|
||||||
|
target.push(item);
|
||||||
|
cb(null, item * 2);
|
||||||
|
}, delay);
|
||||||
|
|
||||||
|
// allow to cancel "leftover" jobs upon error
|
||||||
|
// return function, invoking of which will abort this job
|
||||||
|
return clearTimeout.bind(null, timeoutId);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js).
|
||||||
|
|
||||||
|
#### Input Object
|
||||||
|
|
||||||
|
Also it supports named jobs, listed via object.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var parallel = require('asynckit/parallel')
|
||||||
|
, assert = require('assert')
|
||||||
|
;
|
||||||
|
|
||||||
|
var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 }
|
||||||
|
, expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 }
|
||||||
|
, expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ]
|
||||||
|
, expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ]
|
||||||
|
, target = []
|
||||||
|
, keys = []
|
||||||
|
;
|
||||||
|
|
||||||
|
parallel(source, asyncJob, function(err, result)
|
||||||
|
{
|
||||||
|
assert.deepEqual(result, expectedResult);
|
||||||
|
assert.deepEqual(target, expectedTarget);
|
||||||
|
assert.deepEqual(keys, expectedKeys);
|
||||||
|
});
|
||||||
|
|
||||||
|
// supports full value, key, callback (shortcut) interface
|
||||||
|
function asyncJob(item, key, cb)
|
||||||
|
{
|
||||||
|
// different delays (in ms) per item
|
||||||
|
var delay = item * 25;
|
||||||
|
|
||||||
|
// pretend different jobs take different time to finish
|
||||||
|
// and not in consequential order
|
||||||
|
var timeoutId = setTimeout(function() {
|
||||||
|
keys.push(key);
|
||||||
|
target.push(item);
|
||||||
|
cb(null, item * 2);
|
||||||
|
}, delay);
|
||||||
|
|
||||||
|
// allow to cancel "leftover" jobs upon error
|
||||||
|
// return function, invoking of which will abort this job
|
||||||
|
return clearTimeout.bind(null, timeoutId);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js).
|
||||||
|
|
||||||
|
### Serial Jobs
|
||||||
|
|
||||||
|
Runs iterator over provided array sequentially. Stores output in the `result` array,
|
||||||
|
on the matching positions. In unlikely event of an error from one of the jobs,
|
||||||
|
will not proceed to the rest of the items in the list
|
||||||
|
and return error along with salvaged data to the main callback function.
|
||||||
|
|
||||||
|
#### Input Array
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var serial = require('asynckit/serial')
|
||||||
|
, assert = require('assert')
|
||||||
|
;
|
||||||
|
|
||||||
|
var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
|
||||||
|
, expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
|
||||||
|
, expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ]
|
||||||
|
, target = []
|
||||||
|
;
|
||||||
|
|
||||||
|
serial(source, asyncJob, function(err, result)
|
||||||
|
{
|
||||||
|
assert.deepEqual(result, expectedResult);
|
||||||
|
assert.deepEqual(target, expectedTarget);
|
||||||
|
});
|
||||||
|
|
||||||
|
// extended interface (item, key, callback)
|
||||||
|
// also supported for arrays
|
||||||
|
function asyncJob(item, key, cb)
|
||||||
|
{
|
||||||
|
target.push(key);
|
||||||
|
|
||||||
|
// it will be automatically made async
|
||||||
|
// even it iterator "returns" in the same event loop
|
||||||
|
cb(null, item * 2);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
More examples could be found in [test/test-serial-array.js](test/test-serial-array.js).
|
||||||
|
|
||||||
|
#### Input Object
|
||||||
|
|
||||||
|
Also it supports named jobs, listed via object.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var serial = require('asynckit').serial
|
||||||
|
, assert = require('assert')
|
||||||
|
;
|
||||||
|
|
||||||
|
var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
|
||||||
|
, expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
|
||||||
|
, expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ]
|
||||||
|
, target = []
|
||||||
|
;
|
||||||
|
|
||||||
|
var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 }
|
||||||
|
, expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 }
|
||||||
|
, expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
|
||||||
|
, target = []
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
serial(source, asyncJob, function(err, result)
|
||||||
|
{
|
||||||
|
assert.deepEqual(result, expectedResult);
|
||||||
|
assert.deepEqual(target, expectedTarget);
|
||||||
|
});
|
||||||
|
|
||||||
|
// shortcut interface (item, callback)
|
||||||
|
// works for object as well as for the arrays
|
||||||
|
function asyncJob(item, cb)
|
||||||
|
{
|
||||||
|
target.push(item);
|
||||||
|
|
||||||
|
// it will be automatically made async
|
||||||
|
// even it iterator "returns" in the same event loop
|
||||||
|
cb(null, item * 2);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
More examples could be found in [test/test-serial-object.js](test/test-serial-object.js).
|
||||||
|
|
||||||
|
_Note: Since _object_ is an _unordered_ collection of properties,
|
||||||
|
it may produce unexpected results with sequential iterations.
|
||||||
|
Whenever order of the jobs' execution is important please use `serialOrdered` method._
|
||||||
|
|
||||||
|
### Ordered Serial Iterations
|
||||||
|
|
||||||
|
TBD
|
||||||
|
|
||||||
|
For example [compare-property](compare-property) package.
|
||||||
|
|
||||||
|
### Streaming interface
|
||||||
|
|
||||||
|
TBD
|
||||||
|
|
||||||
|
## Want to Know More?
|
||||||
|
|
||||||
|
More examples can be found in [test folder](test/).
|
||||||
|
|
||||||
|
Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
AsyncKit is licensed under the MIT license.
|
||||||
76
node_modules/asynckit/bench.js
generated
vendored
Normal file
76
node_modules/asynckit/bench.js
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
/* eslint no-console: "off" */
|
||||||
|
|
||||||
|
var asynckit = require('./')
|
||||||
|
, async = require('async')
|
||||||
|
, assert = require('assert')
|
||||||
|
, expected = 0
|
||||||
|
;
|
||||||
|
|
||||||
|
var Benchmark = require('benchmark');
|
||||||
|
var suite = new Benchmark.Suite;
|
||||||
|
|
||||||
|
var source = [];
|
||||||
|
for (var z = 1; z < 100; z++)
|
||||||
|
{
|
||||||
|
source.push(z);
|
||||||
|
expected += z;
|
||||||
|
}
|
||||||
|
|
||||||
|
suite
|
||||||
|
// add tests
|
||||||
|
|
||||||
|
.add('async.map', function(deferred)
|
||||||
|
{
|
||||||
|
var total = 0;
|
||||||
|
|
||||||
|
async.map(source,
|
||||||
|
function(i, cb)
|
||||||
|
{
|
||||||
|
setImmediate(function()
|
||||||
|
{
|
||||||
|
total += i;
|
||||||
|
cb(null, total);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
function(err, result)
|
||||||
|
{
|
||||||
|
assert.ifError(err);
|
||||||
|
assert.equal(result[result.length - 1], expected);
|
||||||
|
deferred.resolve();
|
||||||
|
});
|
||||||
|
}, {'defer': true})
|
||||||
|
|
||||||
|
|
||||||
|
.add('asynckit.parallel', function(deferred)
|
||||||
|
{
|
||||||
|
var total = 0;
|
||||||
|
|
||||||
|
asynckit.parallel(source,
|
||||||
|
function(i, cb)
|
||||||
|
{
|
||||||
|
setImmediate(function()
|
||||||
|
{
|
||||||
|
total += i;
|
||||||
|
cb(null, total);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
function(err, result)
|
||||||
|
{
|
||||||
|
assert.ifError(err);
|
||||||
|
assert.equal(result[result.length - 1], expected);
|
||||||
|
deferred.resolve();
|
||||||
|
});
|
||||||
|
}, {'defer': true})
|
||||||
|
|
||||||
|
|
||||||
|
// add listeners
|
||||||
|
.on('cycle', function(ev)
|
||||||
|
{
|
||||||
|
console.log(String(ev.target));
|
||||||
|
})
|
||||||
|
.on('complete', function()
|
||||||
|
{
|
||||||
|
console.log('Fastest is ' + this.filter('fastest').map('name'));
|
||||||
|
})
|
||||||
|
// run async
|
||||||
|
.run({ 'async': true });
|
||||||
6
node_modules/asynckit/index.js
generated
vendored
Normal file
6
node_modules/asynckit/index.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
module.exports =
|
||||||
|
{
|
||||||
|
parallel : require('./parallel.js'),
|
||||||
|
serial : require('./serial.js'),
|
||||||
|
serialOrdered : require('./serialOrdered.js')
|
||||||
|
};
|
||||||
63
node_modules/asynckit/package.json
generated
vendored
Normal file
63
node_modules/asynckit/package.json
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
{
|
||||||
|
"name": "asynckit",
|
||||||
|
"version": "0.4.0",
|
||||||
|
"description": "Minimal async jobs utility library, with streams support",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"clean": "rimraf coverage",
|
||||||
|
"lint": "eslint *.js lib/*.js test/*.js",
|
||||||
|
"test": "istanbul cover --reporter=json tape -- 'test/test-*.js' | tap-spec",
|
||||||
|
"win-test": "tape test/test-*.js",
|
||||||
|
"browser": "browserify -t browserify-istanbul test/lib/browserify_adjustment.js test/test-*.js | obake --coverage | tap-spec",
|
||||||
|
"report": "istanbul report",
|
||||||
|
"size": "browserify index.js | size-table asynckit",
|
||||||
|
"debug": "tape test/test-*.js"
|
||||||
|
},
|
||||||
|
"pre-commit": [
|
||||||
|
"clean",
|
||||||
|
"lint",
|
||||||
|
"test",
|
||||||
|
"browser",
|
||||||
|
"report",
|
||||||
|
"size"
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/alexindigo/asynckit.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"async",
|
||||||
|
"jobs",
|
||||||
|
"parallel",
|
||||||
|
"serial",
|
||||||
|
"iterator",
|
||||||
|
"array",
|
||||||
|
"object",
|
||||||
|
"stream",
|
||||||
|
"destroy",
|
||||||
|
"terminate",
|
||||||
|
"abort"
|
||||||
|
],
|
||||||
|
"author": "Alex Indigo <iam@alexindigo.com>",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/alexindigo/asynckit/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/alexindigo/asynckit#readme",
|
||||||
|
"devDependencies": {
|
||||||
|
"browserify": "^13.0.0",
|
||||||
|
"browserify-istanbul": "^2.0.0",
|
||||||
|
"coveralls": "^2.11.9",
|
||||||
|
"eslint": "^2.9.0",
|
||||||
|
"istanbul": "^0.4.3",
|
||||||
|
"obake": "^0.1.2",
|
||||||
|
"phantomjs-prebuilt": "^2.1.7",
|
||||||
|
"pre-commit": "^1.1.3",
|
||||||
|
"reamde": "^1.1.0",
|
||||||
|
"rimraf": "^2.5.2",
|
||||||
|
"size-table": "^0.2.0",
|
||||||
|
"tap-spec": "^4.1.1",
|
||||||
|
"tape": "^4.5.1"
|
||||||
|
},
|
||||||
|
"dependencies": {}
|
||||||
|
}
|
||||||
43
node_modules/asynckit/parallel.js
generated
vendored
Normal file
43
node_modules/asynckit/parallel.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
var iterate = require('./lib/iterate.js')
|
||||||
|
, initState = require('./lib/state.js')
|
||||||
|
, terminator = require('./lib/terminator.js')
|
||||||
|
;
|
||||||
|
|
||||||
|
// Public API
|
||||||
|
module.exports = parallel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs iterator over provided array elements in parallel
|
||||||
|
*
|
||||||
|
* @param {array|object} list - array or object (named list) to iterate over
|
||||||
|
* @param {function} iterator - iterator to run
|
||||||
|
* @param {function} callback - invoked when all elements processed
|
||||||
|
* @returns {function} - jobs terminator
|
||||||
|
*/
|
||||||
|
function parallel(list, iterator, callback)
|
||||||
|
{
|
||||||
|
var state = initState(list);
|
||||||
|
|
||||||
|
while (state.index < (state['keyedList'] || list).length)
|
||||||
|
{
|
||||||
|
iterate(list, iterator, state, function(error, result)
|
||||||
|
{
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
callback(error, result);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// looks like it's the last one
|
||||||
|
if (Object.keys(state.jobs).length === 0)
|
||||||
|
{
|
||||||
|
callback(null, state.results);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
state.index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return terminator.bind(state, callback);
|
||||||
|
}
|
||||||
17
node_modules/asynckit/serial.js
generated
vendored
Normal file
17
node_modules/asynckit/serial.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
var serialOrdered = require('./serialOrdered.js');
|
||||||
|
|
||||||
|
// Public API
|
||||||
|
module.exports = serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs iterator over provided array elements in series
|
||||||
|
*
|
||||||
|
* @param {array|object} list - array or object (named list) to iterate over
|
||||||
|
* @param {function} iterator - iterator to run
|
||||||
|
* @param {function} callback - invoked when all elements processed
|
||||||
|
* @returns {function} - jobs terminator
|
||||||
|
*/
|
||||||
|
function serial(list, iterator, callback)
|
||||||
|
{
|
||||||
|
return serialOrdered(list, iterator, null, callback);
|
||||||
|
}
|
||||||
75
node_modules/asynckit/serialOrdered.js
generated
vendored
Normal file
75
node_modules/asynckit/serialOrdered.js
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
var iterate = require('./lib/iterate.js')
|
||||||
|
, initState = require('./lib/state.js')
|
||||||
|
, terminator = require('./lib/terminator.js')
|
||||||
|
;
|
||||||
|
|
||||||
|
// Public API
|
||||||
|
module.exports = serialOrdered;
|
||||||
|
// sorting helpers
|
||||||
|
module.exports.ascending = ascending;
|
||||||
|
module.exports.descending = descending;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs iterator over provided sorted array elements in series
|
||||||
|
*
|
||||||
|
* @param {array|object} list - array or object (named list) to iterate over
|
||||||
|
* @param {function} iterator - iterator to run
|
||||||
|
* @param {function} sortMethod - custom sort function
|
||||||
|
* @param {function} callback - invoked when all elements processed
|
||||||
|
* @returns {function} - jobs terminator
|
||||||
|
*/
|
||||||
|
function serialOrdered(list, iterator, sortMethod, callback)
|
||||||
|
{
|
||||||
|
var state = initState(list, sortMethod);
|
||||||
|
|
||||||
|
iterate(list, iterator, state, function iteratorHandler(error, result)
|
||||||
|
{
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
callback(error, result);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
state.index++;
|
||||||
|
|
||||||
|
// are we there yet?
|
||||||
|
if (state.index < (state['keyedList'] || list).length)
|
||||||
|
{
|
||||||
|
iterate(list, iterator, state, iteratorHandler);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// done here
|
||||||
|
callback(null, state.results);
|
||||||
|
});
|
||||||
|
|
||||||
|
return terminator.bind(state, callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* -- Sort methods
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sort helper to sort array elements in ascending order
|
||||||
|
*
|
||||||
|
* @param {mixed} a - an item to compare
|
||||||
|
* @param {mixed} b - an item to compare
|
||||||
|
* @returns {number} - comparison result
|
||||||
|
*/
|
||||||
|
function ascending(a, b)
|
||||||
|
{
|
||||||
|
return a < b ? -1 : a > b ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sort helper to sort array elements in descending order
|
||||||
|
*
|
||||||
|
* @param {mixed} a - an item to compare
|
||||||
|
* @param {mixed} b - an item to compare
|
||||||
|
* @returns {number} - comparison result
|
||||||
|
*/
|
||||||
|
function descending(a, b)
|
||||||
|
{
|
||||||
|
return -1 * ascending(a, b);
|
||||||
|
}
|
||||||
21
node_modules/asynckit/stream.js
generated
vendored
Normal file
21
node_modules/asynckit/stream.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
var inherits = require('util').inherits
|
||||||
|
, Readable = require('stream').Readable
|
||||||
|
, ReadableAsyncKit = require('./lib/readable_asynckit.js')
|
||||||
|
, ReadableParallel = require('./lib/readable_parallel.js')
|
||||||
|
, ReadableSerial = require('./lib/readable_serial.js')
|
||||||
|
, ReadableSerialOrdered = require('./lib/readable_serial_ordered.js')
|
||||||
|
;
|
||||||
|
|
||||||
|
// API
|
||||||
|
module.exports =
|
||||||
|
{
|
||||||
|
parallel : ReadableParallel,
|
||||||
|
serial : ReadableSerial,
|
||||||
|
serialOrdered : ReadableSerialOrdered,
|
||||||
|
};
|
||||||
|
|
||||||
|
inherits(ReadableAsyncKit, Readable);
|
||||||
|
|
||||||
|
inherits(ReadableParallel, ReadableAsyncKit);
|
||||||
|
inherits(ReadableSerial, ReadableAsyncKit);
|
||||||
|
inherits(ReadableSerialOrdered, ReadableAsyncKit);
|
||||||
874
node_modules/axios/CHANGELOG.md
generated
vendored
Normal file
874
node_modules/axios/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,874 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [1.6.8](https://github.com/axios/axios/compare/v1.6.7...v1.6.8) (2024-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **AxiosHeaders:** fix AxiosHeaders conversion to an object during config merging ([#6243](https://github.com/axios/axios/issues/6243)) ([2656612](https://github.com/axios/axios/commit/2656612bc10fe2757e9832b708ed773ab340b5cb))
|
||||||
|
* **import:** use named export for EventEmitter; ([7320430](https://github.com/axios/axios/commit/7320430aef2e1ba2b89488a0eaf42681165498b1))
|
||||||
|
* **vulnerability:** update follow-redirects to 1.15.6 ([#6300](https://github.com/axios/axios/issues/6300)) ([8786e0f](https://github.com/axios/axios/commit/8786e0ff55a8c68d4ca989801ad26df924042e27))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/4814473?v=4&s=18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+4572/-3446 (#6238 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+30/-0 (#6231 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/68230846?v=4&s=18" alt="avatar" width="18"/> [Mitchell](https://github.com/Creaous "+9/-9 (#6300 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/53797821?v=4&s=18" alt="avatar" width="18"/> [Emmanuel](https://github.com/mannoeu "+2/-2 (#6196 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/44109284?v=4&s=18" alt="avatar" width="18"/> [Lucas Keller](https://github.com/ljkeller "+3/-0 (#6194 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/72791488?v=4&s=18" alt="avatar" width="18"/> [Aditya Mogili](https://github.com/ADITYA-176 "+1/-1 ()")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/46135319?v=4&s=18" alt="avatar" width="18"/> [Miroslav Petrov](https://github.com/petrovmiroslav "+1/-1 (#6243 )")
|
||||||
|
|
||||||
|
## [1.6.7](https://github.com/axios/axios/compare/v1.6.6...v1.6.7) (2024-01-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* capture async stack only for rejections with native error objects; ([#6203](https://github.com/axios/axios/issues/6203)) ([1a08f90](https://github.com/axios/axios/commit/1a08f90f402336e4d00e9ee82f211c6adb1640b0))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+30/-26 (#6203 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/73059627?v=4&s=18" alt="avatar" width="18"/> [zhoulixiang](https://github.com/zh-lx "+0/-3 (#6186 )")
|
||||||
|
|
||||||
|
## [1.6.6](https://github.com/axios/axios/compare/v1.6.5...v1.6.6) (2024-01-24)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fixed missed dispatchBeforeRedirect argument ([#5778](https://github.com/axios/axios/issues/5778)) ([a1938ff](https://github.com/axios/axios/commit/a1938ff073fcb0f89011f001dfbc1fa1dc995e39))
|
||||||
|
* wrap errors to improve async stack trace ([#5987](https://github.com/axios/axios/issues/5987)) ([123f354](https://github.com/axios/axios/commit/123f354b920f154a209ea99f76b7b2ef3d9ebbab))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/1186084?v=4&s=18" alt="avatar" width="18"/> [Ilya Priven](https://github.com/ikonst "+91/-8 (#5987 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/1884246?v=4&s=18" alt="avatar" width="18"/> [Zao Soula](https://github.com/zaosoula "+6/-6 (#5778 )")
|
||||||
|
|
||||||
|
## [1.6.5](https://github.com/axios/axios/compare/v1.6.4...v1.6.5) (2024-01-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **ci:** refactor notify action as a job of publish action; ([#6176](https://github.com/axios/axios/issues/6176)) ([0736f95](https://github.com/axios/axios/commit/0736f95ce8776366dc9ca569f49ba505feb6373c))
|
||||||
|
* **dns:** fixed lookup error handling; ([#6175](https://github.com/axios/axios/issues/6175)) ([f4f2b03](https://github.com/axios/axios/commit/f4f2b039dd38eb4829e8583caede4ed6d2dd59be))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+41/-6 (#6176 #6175 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/4814473?v=4&s=18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+6/-1 ()")
|
||||||
|
|
||||||
|
## [1.6.4](https://github.com/axios/axios/compare/v1.6.3...v1.6.4) (2024-01-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **security:** fixed formToJSON prototype pollution vulnerability; ([#6167](https://github.com/axios/axios/issues/6167)) ([3c0c11c](https://github.com/axios/axios/commit/3c0c11cade045c4412c242b5727308cff9897a0e))
|
||||||
|
* **security:** fixed security vulnerability in follow-redirects ([#6163](https://github.com/axios/axios/issues/6163)) ([75af1cd](https://github.com/axios/axios/commit/75af1cdff5b3a6ca3766d3d3afbc3115bb0811b8))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/4814473?v=4&s=18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+34/-6 ()")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+34/-3 (#6172 #6167 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/1402060?v=4&s=18" alt="avatar" width="18"/> [Guy Nesher](https://github.com/gnesher "+10/-10 (#6163 )")
|
||||||
|
|
||||||
|
## [1.6.3](https://github.com/axios/axios/compare/v1.6.2...v1.6.3) (2023-12-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Regular Expression Denial of Service (ReDoS) ([#6132](https://github.com/axios/axios/issues/6132)) ([5e7ad38](https://github.com/axios/axios/commit/5e7ad38fb0f819fceb19fb2ee5d5d38f56aa837d))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/4814473?v=4&s=18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+15/-6 (#6145 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/22686401?v=4&s=18" alt="avatar" width="18"/> [Willian Agostini](https://github.com/WillianAgostini "+17/-2 (#6132 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+3/-0 (#6084 )")
|
||||||
|
|
||||||
|
## [1.6.2](https://github.com/axios/axios/compare/v1.6.1...v1.6.2) (2023-11-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **withXSRFToken:** added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ([#6046](https://github.com/axios/axios/issues/6046)) ([cff9967](https://github.com/axios/axios/commit/cff996779b272a5e94c2b52f5503ccf668bc42dc))
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- feat(withXSRFToken): added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ( [#6046](https://api.github.com/repos/axios/axios/pulls/6046) )
|
||||||
|
```
|
||||||
|
|
||||||
|
📢 This PR added 'withXSRFToken' option as a replacement for old withCredentials behaviour.
|
||||||
|
You should now use withXSRFToken along with withCredential to get the old behavior.
|
||||||
|
This functionality is considered as a fix.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+271/-146 (#6081 #6080 #6079 #6078 #6046 #6064 #6063 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/79681367?v=4&s=18" alt="avatar" width="18"/> [Ng Choon Khon (CK)](https://github.com/ckng0221 "+4/-4 (#6073 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/9162827?v=4&s=18" alt="avatar" width="18"/> [Muhammad Noman](https://github.com/mnomanmemon "+2/-2 (#6048 )")
|
||||||
|
|
||||||
|
## [1.6.1](https://github.com/axios/axios/compare/v1.6.0...v1.6.1) (2023-11-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **formdata:** fixed content-type header normalization for non-standard browser environments; ([#6056](https://github.com/axios/axios/issues/6056)) ([dd465ab](https://github.com/axios/axios/commit/dd465ab22bbfa262c6567be6574bf46a057d5288))
|
||||||
|
* **platform:** fixed emulated browser detection in node.js environment; ([#6055](https://github.com/axios/axios/issues/6055)) ([3dc8369](https://github.com/axios/axios/commit/3dc8369e505e32a4e12c22f154c55fd63ac67fbb))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+432/-65 (#6059 #6056 #6055 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/3982806?v=4&s=18" alt="avatar" width="18"/> [Fabian Meyer](https://github.com/meyfa "+5/-2 (#5835 )")
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- feat(withXSRFToken): added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ( [#6046](https://api.github.com/repos/axios/axios/pulls/6046) )
|
||||||
|
```
|
||||||
|
|
||||||
|
📢 This PR added 'withXSRFToken' option as a replacement for old withCredentials behaviour.
|
||||||
|
You should now use withXSRFToken along with withCredential to get the old behavior.
|
||||||
|
This functionality is considered as a fix.
|
||||||
|
```
|
||||||
|
|
||||||
|
# [1.6.0](https://github.com/axios/axios/compare/v1.5.1...v1.6.0) (2023-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **CSRF:** fixed CSRF vulnerability CVE-2023-45857 ([#6028](https://github.com/axios/axios/issues/6028)) ([96ee232](https://github.com/axios/axios/commit/96ee232bd3ee4de2e657333d4d2191cd389e14d0))
|
||||||
|
* **dns:** fixed lookup function decorator to work properly in node v20; ([#6011](https://github.com/axios/axios/issues/6011)) ([5aaff53](https://github.com/axios/axios/commit/5aaff532a6b820bb9ab6a8cd0f77131b47e2adb8))
|
||||||
|
* **types:** fix AxiosHeaders types; ([#5931](https://github.com/axios/axios/issues/5931)) ([a1c8ad0](https://github.com/axios/axios/commit/a1c8ad008b3c13d53e135bbd0862587fb9d3fc09))
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+449/-114 (#6032 #6021 #6011 #5932 #5931 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/63700910?v=4&s=18" alt="avatar" width="18"/> [Valentin Panov](https://github.com/valentin-panov "+4/-4 (#6028 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/76877078?v=4&s=18" alt="avatar" width="18"/> [Rinku Chaudhari](https://github.com/therealrinku "+1/-1 (#5889 )")
|
||||||
|
|
||||||
|
## [1.5.1](https://github.com/axios/axios/compare/v1.5.0...v1.5.1) (2023-09-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **adapters:** improved adapters loading logic to have clear error messages; ([#5919](https://github.com/axios/axios/issues/5919)) ([e410779](https://github.com/axios/axios/commit/e4107797a7a1376f6209fbecfbbce73d3faa7859))
|
||||||
|
* **formdata:** fixed automatic addition of the `Content-Type` header for FormData in non-browser environments; ([#5917](https://github.com/axios/axios/issues/5917)) ([bc9af51](https://github.com/axios/axios/commit/bc9af51b1886d1b3529617702f2a21a6c0ed5d92))
|
||||||
|
* **headers:** allow `content-encoding` header to handle case-insensitive values ([#5890](https://github.com/axios/axios/issues/5890)) ([#5892](https://github.com/axios/axios/issues/5892)) ([4c89f25](https://github.com/axios/axios/commit/4c89f25196525e90a6e75eda9cb31ae0a2e18acd))
|
||||||
|
* **types:** removed duplicated code ([9e62056](https://github.com/axios/axios/commit/9e6205630e1c9cf863adf141c0edb9e6d8d4b149))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+89/-18 (#5919 #5917 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/110460234?v=4&s=18" alt="avatar" width="18"/> [David Dallas](https://github.com/DavidJDallas "+11/-5 ()")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/71556073?v=4&s=18" alt="avatar" width="18"/> [Sean Sattler](https://github.com/fb-sean "+2/-8 ()")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/4294069?v=4&s=18" alt="avatar" width="18"/> [Mustafa Ateş Uzun](https://github.com/0o001 "+4/-4 ()")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/132928043?v=4&s=18" alt="avatar" width="18"/> [Przemyslaw Motacki](https://github.com/sfc-gh-pmotacki "+2/-1 (#5892 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/5492927?v=4&s=18" alt="avatar" width="18"/> [Michael Di Prisco](https://github.com/Cadienvan "+1/-1 ()")
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
# [1.5.0](https://github.com/axios/axios/compare/v1.4.0...v1.5.0) (2023-08-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **adapter:** make adapter loading error more clear by using platform-specific adapters explicitly ([#5837](https://github.com/axios/axios/issues/5837)) ([9a414bb](https://github.com/axios/axios/commit/9a414bb6c81796a95c6c7fe668637825458e8b6d))
|
||||||
|
* **dns:** fixed `cacheable-lookup` integration; ([#5836](https://github.com/axios/axios/issues/5836)) ([b3e327d](https://github.com/axios/axios/commit/b3e327dcc9277bdce34c7ef57beedf644b00d628))
|
||||||
|
* **headers:** added support for setting header names that overlap with class methods; ([#5831](https://github.com/axios/axios/issues/5831)) ([d8b4ca0](https://github.com/axios/axios/commit/d8b4ca0ea5f2f05efa4edfe1e7684593f9f68273))
|
||||||
|
* **headers:** fixed common Content-Type header merging; ([#5832](https://github.com/axios/axios/issues/5832)) ([8fda276](https://github.com/axios/axios/commit/8fda2766b1e6bcb72c3fabc146223083ef13ce17))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* export getAdapter function ([#5324](https://github.com/axios/axios/issues/5324)) ([ca73eb8](https://github.com/axios/axios/commit/ca73eb878df0ae2dace81fe3a7f1fb5986231bf1))
|
||||||
|
* **export:** export adapters without `unsafe` prefix ([#5839](https://github.com/axios/axios/issues/5839)) ([1601f4a](https://github.com/axios/axios/commit/1601f4a27a81ab47fea228f1e244b2c4e3ce28bf))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+66/-29 (#5839 #5837 #5836 #5832 #5831 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/102841186?v=4&s=18" alt="avatar" width="18"/> [夜葬](https://github.com/geekact "+42/-0 (#5324 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/65978976?v=4&s=18" alt="avatar" width="18"/> [Jonathan Budiman](https://github.com/JBudiman00 "+30/-0 (#5788 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/5492927?v=4&s=18" alt="avatar" width="18"/> [Michael Di Prisco](https://github.com/Cadienvan "+3/-5 (#5791 )")
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
# [1.4.0](https://github.com/axios/axios/compare/v1.3.6...v1.4.0) (2023-04-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **formdata:** add `multipart/form-data` content type for FormData payload on custom client environments; ([#5678](https://github.com/axios/axios/issues/5678)) ([bbb61e7](https://github.com/axios/axios/commit/bbb61e70cb1185adfb1cbbb86eaf6652c48d89d1))
|
||||||
|
* **package:** export package internals with unsafe path prefix; ([#5677](https://github.com/axios/axios/issues/5677)) ([df38c94](https://github.com/axios/axios/commit/df38c949f26414d88ba29ec1e353c4d4f97eaf09))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **dns:** added support for a custom lookup function; ([#5339](https://github.com/axios/axios/issues/5339)) ([2701911](https://github.com/axios/axios/commit/2701911260a1faa5cc5e1afe437121b330a3b7bb))
|
||||||
|
* **types:** export `AxiosHeaderValue` type. ([#5525](https://github.com/axios/axios/issues/5525)) ([726f1c8](https://github.com/axios/axios/commit/726f1c8e00cffa0461a8813a9bdcb8f8b9d762cf))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **merge-config:** optimize mergeConfig performance by avoiding duplicate key visits; ([#5679](https://github.com/axios/axios/issues/5679)) ([e6f7053](https://github.com/axios/axios/commit/e6f7053bf1a3e87cf1f9da8677e12e3fe829d68e))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+151/-16 (#5684 #5339 #5679 #5678 #5677 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/47537704?v=4&s=18" alt="avatar" width="18"/> [Arthur Fiorette](https://github.com/arthurfiorette "+19/-19 (#5525 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/43876655?v=4&s=18" alt="avatar" width="18"/> [PIYUSH NEGI](https://github.com/npiyush97 "+2/-18 (#5670 )")
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.3.6](https://github.com/axios/axios/compare/v1.3.5...v1.3.6) (2023-04-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **types:** added transport to RawAxiosRequestConfig ([#5445](https://github.com/axios/axios/issues/5445)) ([6f360a2](https://github.com/axios/axios/commit/6f360a2531d8d70363fd9becef6a45a323f170e2))
|
||||||
|
* **utils:** make isFormData detection logic stricter to avoid unnecessary calling of the `toString` method on the target; ([#5661](https://github.com/axios/axios/issues/5661)) ([aa372f7](https://github.com/axios/axios/commit/aa372f7306295dfd1100c1c2c77ce95c95808e76))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+48/-10 (#5665 #5661 #5663 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/5492927?v=4&s=18" alt="avatar" width="18"/> [Michael Di Prisco](https://github.com/Cadienvan "+2/-0 (#5445 )")
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.3.5](https://github.com/axios/axios/compare/v1.3.4...v1.3.5) (2023-04-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **headers:** fixed isValidHeaderName to support full list of allowed characters; ([#5584](https://github.com/axios/axios/issues/5584)) ([e7decef](https://github.com/axios/axios/commit/e7decef6a99f4627e27ed9ea5b00ce8e201c3841))
|
||||||
|
* **params:** re-added the ability to set the function as `paramsSerializer` config; ([#5633](https://github.com/axios/axios/issues/5633)) ([a56c866](https://github.com/axios/axios/commit/a56c8661209d5ce5a645a05f294a0e08a6c1f6b3))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+28/-10 (#5633 #5584 )")
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.3.4](https://github.com/axios/axios/compare/v1.3.3...v1.3.4) (2023-02-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **blob:** added a check to make sure the Blob class is available in the browser's global scope; ([#5548](https://github.com/axios/axios/issues/5548)) ([3772c8f](https://github.com/axios/axios/commit/3772c8fe74112a56e3e9551f894d899bc3a9443a))
|
||||||
|
* **http:** fixed regression bug when handling synchronous errors inside the adapter; ([#5564](https://github.com/axios/axios/issues/5564)) ([a3b246c](https://github.com/axios/axios/commit/a3b246c9de5c3bc4b5a742e15add55b375479451))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+38/-26 (#5564 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/19550000?v=4&s=18" alt="avatar" width="18"/> [lcysgsg](https://github.com/lcysgsg "+4/-0 (#5548 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/5492927?v=4&s=18" alt="avatar" width="18"/> [Michael Di Prisco](https://github.com/Cadienvan "+3/-0 (#5444 )")
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.3.3](https://github.com/axios/axios/compare/v1.3.2...v1.3.3) (2023-02-13)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **formdata:** added a check to make sure the FormData class is available in the browser's global scope; ([#5545](https://github.com/axios/axios/issues/5545)) ([a6dfa72](https://github.com/axios/axios/commit/a6dfa72010db5ad52db8bd13c0f98e537e8fd05d))
|
||||||
|
* **formdata:** fixed setting NaN as Content-Length for form payload in some cases; ([#5535](https://github.com/axios/axios/issues/5535)) ([c19f7bf](https://github.com/axios/axios/commit/c19f7bf770f90ae8307f4ea3104f227056912da1))
|
||||||
|
* **headers:** fixed the filtering logic of the clear method; ([#5542](https://github.com/axios/axios/issues/5542)) ([ea87ebf](https://github.com/axios/axios/commit/ea87ebfe6d1699af072b9e7cd40faf8f14b0ab93))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+11/-7 (#5545 #5535 #5542 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/19842213?v=4&s=18" alt="avatar" width="18"/> [陈若枫](https://github.com/ruofee "+2/-2 (#5467 )")
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.3.2](https://github.com/axios/axios/compare/v1.3.1...v1.3.2) (2023-02-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **http:** treat http://localhost as base URL for relative paths to avoid `ERR_INVALID_URL` error; ([#5528](https://github.com/axios/axios/issues/5528)) ([128d56f](https://github.com/axios/axios/commit/128d56f4a0fb8f5f2ed6e0dd80bc9225fee9538c))
|
||||||
|
* **http:** use explicit import instead of TextEncoder global; ([#5530](https://github.com/axios/axios/issues/5530)) ([6b3c305](https://github.com/axios/axios/commit/6b3c305fc40c56428e0afabedc6f4d29c2830f6f))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+2/-1 (#5530 #5528 )")
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.3.1](https://github.com/axios/axios/compare/v1.3.0...v1.3.1) (2023-02-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **formdata:** add hotfix to use the asynchronous API to compute the content-length header value; ([#5521](https://github.com/axios/axios/issues/5521)) ([96d336f](https://github.com/axios/axios/commit/96d336f527619f21da012fe1f117eeb53e5a2120))
|
||||||
|
* **serializer:** fixed serialization of array-like objects; ([#5518](https://github.com/axios/axios/issues/5518)) ([08104c0](https://github.com/axios/axios/commit/08104c028c0f9353897b1b6691d74c440fd0c32d))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+27/-8 (#5521 #5518 )")
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
# [1.3.0](https://github.com/axios/axios/compare/v1.2.6...v1.3.0) (2023-01-31)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **headers:** fixed & optimized clear method; ([#5507](https://github.com/axios/axios/issues/5507)) ([9915635](https://github.com/axios/axios/commit/9915635c69d0ab70daca5738488421f67ca60959))
|
||||||
|
* **http:** add zlib headers if missing ([#5497](https://github.com/axios/axios/issues/5497)) ([65e8d1e](https://github.com/axios/axios/commit/65e8d1e28ce829f47a837e45129730e541950d3c))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **fomdata:** added support for spec-compliant FormData & Blob types; ([#5316](https://github.com/axios/axios/issues/5316)) ([6ac574e](https://github.com/axios/axios/commit/6ac574e00a06731288347acea1e8246091196953))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+352/-67 (#5514 #5512 #5510 #5509 #5508 #5316 #5507 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/35015993?v=4&s=18" alt="avatar" width="18"/> [ItsNotGoodName](https://github.com/ItsNotGoodName "+43/-2 (#5497 )")
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.2.6](https://github.com/axios/axios/compare/v1.2.5...v1.2.6) (2023-01-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **headers:** added missed Authorization accessor; ([#5502](https://github.com/axios/axios/issues/5502)) ([342c0ba](https://github.com/axios/axios/commit/342c0ba9a16ea50f5ed7d2366c5c1a2c877e3f26))
|
||||||
|
* **types:** fixed `CommonRequestHeadersList` & `CommonResponseHeadersList` types to be private in commonJS; ([#5503](https://github.com/axios/axios/issues/5503)) ([5a3d0a3](https://github.com/axios/axios/commit/5a3d0a3234d77361a1bc7cedee2da1e11df08e2c))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
-  [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+24/-9 (#5503 #5502 )")
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.2.5](https://github.com/axios/axios/compare/v1.2.4...v1.2.5) (2023-01-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **types:** fixed AxiosHeaders to handle spread syntax by making all methods non-enumerable; ([#5499](https://github.com/axios/axios/issues/5499)) ([580f1e8](https://github.com/axios/axios/commit/580f1e8033a61baa38149d59fd16019de3932c22))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
-  [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+82/-54 (#5499 )")
|
||||||
|
-  [Elliot Ford](https://github.com/EFord36 "+1/-1 (#5462 )")
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.2.4](https://github.com/axios/axios/compare/v1.2.3...v1.2.4) (2023-01-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **types:** renamed `RawAxiosRequestConfig` back to `AxiosRequestConfig`; ([#5486](https://github.com/axios/axios/issues/5486)) ([2a71f49](https://github.com/axios/axios/commit/2a71f49bc6c68495fa419003a3107ed8bd703ad0))
|
||||||
|
* **types:** fix `AxiosRequestConfig` generic; ([#5478](https://github.com/axios/axios/issues/5478)) ([9bce81b](https://github.com/axios/axios/commit/186ea062da8b7d578ae78b1a5c220986b9bce81b))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
-  [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+242/-108 (#5486 #5482 )")
|
||||||
|
-  [Daniel Hillmann](https://github.com/hilleer "+1/-1 (#5478 )")
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.2.3](https://github.com/axios/axios/compare/1.2.2...1.2.3) (2023-01-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **types:** fixed AxiosRequestConfig header interface by refactoring it to RawAxiosRequestConfig; ([#5420](https://github.com/axios/axios/issues/5420)) ([0811963](https://github.com/axios/axios/commit/08119634a22f1d5b19f5c9ea0adccb6d3eebc3bc))
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
-  [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+938/-442 (#5456 #5455 #5453 #5451 #5449 #5447 #5446 #5443 #5442 #5439 #5420 )")
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.2.2] - 2022-12-29
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- fix(ci): fix release script inputs [#5392](https://github.com/axios/axios/pull/5392)
|
||||||
|
- fix(ci): prerelease scipts [#5377](https://github.com/axios/axios/pull/5377)
|
||||||
|
- fix(ci): release scripts [#5376](https://github.com/axios/axios/pull/5376)
|
||||||
|
- fix(ci): typescript tests [#5375](https://github.com/axios/axios/pull/5375)
|
||||||
|
- fix: Brotli decompression [#5353](https://github.com/axios/axios/pull/5353)
|
||||||
|
- fix: add missing HttpStatusCode [#5345](https://github.com/axios/axios/pull/5345)
|
||||||
|
|
||||||
|
### Chores
|
||||||
|
- chore(ci): set conventional-changelog header config [#5406](https://github.com/axios/axios/pull/5406)
|
||||||
|
- chore(ci): fix automatic contributors resolving [#5403](https://github.com/axios/axios/pull/5403)
|
||||||
|
- chore(ci): improved logging for the contributors list generator [#5398](https://github.com/axios/axios/pull/5398)
|
||||||
|
- chore(ci): fix release action [#5397](https://github.com/axios/axios/pull/5397)
|
||||||
|
- chore(ci): fix version bump script by adding bump argument for target version [#5393](https://github.com/axios/axios/pull/5393)
|
||||||
|
- chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2 [#5342](https://github.com/axios/axios/pull/5342)
|
||||||
|
- chore(ci): GitHub Actions Release script [#5384](https://github.com/axios/axios/pull/5384)
|
||||||
|
- chore(ci): release scripts [#5364](https://github.com/axios/axios/pull/5364)
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
-  [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
|
||||||
|
-  [Winnie](https://github.com/winniehell)
|
||||||
|
|
||||||
|
## [1.2.1] - 2022-12-05
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- feat(exports): export mergeConfig [#5151](https://github.com/axios/axios/pull/5151)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- fix(CancelledError): include config [#4922](https://github.com/axios/axios/pull/4922)
|
||||||
|
- fix(general): removing multiple/trailing/leading whitespace [#5022](https://github.com/axios/axios/pull/5022)
|
||||||
|
- fix(headers): decompression for responses without Content-Length header [#5306](https://github.com/axios/axios/pull/5306)
|
||||||
|
- fix(webWorker): exception to sending form data in web worker [#5139](https://github.com/axios/axios/pull/5139)
|
||||||
|
|
||||||
|
### Refactors
|
||||||
|
- refactor(types): AxiosProgressEvent.event type to any [#5308](https://github.com/axios/axios/pull/5308)
|
||||||
|
- refactor(types): add missing types for static AxiosError.from method [#4956](https://github.com/axios/axios/pull/4956)
|
||||||
|
|
||||||
|
### Chores
|
||||||
|
- chore(docs): remove README link to non-existent upgrade guide [#5307](https://github.com/axios/axios/pull/5307)
|
||||||
|
- chore(docs): typo in issue template name [#5159](https://github.com/axios/axios/pull/5159)
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
|
||||||
|
- [Zachary Lysobey](https://github.com/zachlysobey)
|
||||||
|
- [Kevin Ennis](https://github.com/kevincennis)
|
||||||
|
- [Philipp Loose](https://github.com/phloose)
|
||||||
|
- [secondl1ght](https://github.com/secondl1ght)
|
||||||
|
- [wenzheng](https://github.com/0x30)
|
||||||
|
- [Ivan Barsukov](https://github.com/ovarn)
|
||||||
|
- [Arthur Fiorette](https://github.com/arthurfiorette)
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.2.0] - 2022-11-10
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- changed: refactored module exports [#5162](https://github.com/axios/axios/pull/5162)
|
||||||
|
- change: re-added support for loading Axios with require('axios').default [#5225](https://github.com/axios/axios/pull/5225)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- fix: improve AxiosHeaders class [#5224](https://github.com/axios/axios/pull/5224)
|
||||||
|
- fix: TypeScript type definitions for commonjs [#5196](https://github.com/axios/axios/pull/5196)
|
||||||
|
- fix: type definition of use method on AxiosInterceptorManager to match the the README [#5071](https://github.com/axios/axios/pull/5071)
|
||||||
|
- fix: __dirname is not defined in the sandbox [#5269](https://github.com/axios/axios/pull/5269)
|
||||||
|
- fix: AxiosError.toJSON method to avoid circular references [#5247](https://github.com/axios/axios/pull/5247)
|
||||||
|
- fix: Z_BUF_ERROR when content-encoding is set but the response body is empty [#5250](https://github.com/axios/axios/pull/5250)
|
||||||
|
|
||||||
|
### Refactors
|
||||||
|
- refactor: allowing adapters to be loaded by name [#5277](https://github.com/axios/axios/pull/5277)
|
||||||
|
|
||||||
|
### Chores
|
||||||
|
|
||||||
|
- chore: force CI restart [#5243](https://github.com/axios/axios/pull/5243)
|
||||||
|
- chore: update ECOSYSTEM.md [#5077](https://github.com/axios/axios/pull/5077)
|
||||||
|
- chore: update get/index.html [#5116](https://github.com/axios/axios/pull/5116)
|
||||||
|
- chore: update Sandbox UI/UX [#5205](https://github.com/axios/axios/pull/5205)
|
||||||
|
- chore:(actions): remove git credentials after checkout [#5235](https://github.com/axios/axios/pull/5235)
|
||||||
|
- chore(actions): bump actions/dependency-review-action from 2 to 3 [#5266](https://github.com/axios/axios/pull/5266)
|
||||||
|
- chore(packages): bump loader-utils from 1.4.1 to 1.4.2 [#5295](https://github.com/axios/axios/pull/5295)
|
||||||
|
- chore(packages): bump engine.io from 6.2.0 to 6.2.1 [#5294](https://github.com/axios/axios/pull/5294)
|
||||||
|
- chore(packages): bump socket.io-parser from 4.0.4 to 4.0.5 [#5241](https://github.com/axios/axios/pull/5241)
|
||||||
|
- chore(packages): bump loader-utils from 1.4.0 to 1.4.1 [#5245](https://github.com/axios/axios/pull/5245)
|
||||||
|
- chore(docs): update Resources links in README [#5119](https://github.com/axios/axios/pull/5119)
|
||||||
|
- chore(docs): update the link for JSON url [#5265](https://github.com/axios/axios/pull/5265)
|
||||||
|
- chore(docs): fix broken links [#5218](https://github.com/axios/axios/pull/5218)
|
||||||
|
- chore(docs): update and rename UPGRADE_GUIDE.md to MIGRATION_GUIDE.md [#5170](https://github.com/axios/axios/pull/5170)
|
||||||
|
- chore(docs): typo fix line #856 and #920 [#5194](https://github.com/axios/axios/pull/5194)
|
||||||
|
- chore(docs): typo fix #800 [#5193](https://github.com/axios/axios/pull/5193)
|
||||||
|
- chore(docs): fix typos [#5184](https://github.com/axios/axios/pull/5184)
|
||||||
|
- chore(docs): fix punctuation in README.md [#5197](https://github.com/axios/axios/pull/5197)
|
||||||
|
- chore(docs): update readme in the Handling Errors section - issue reference #5260 [#5261](https://github.com/axios/axios/pull/5261)
|
||||||
|
- chore: remove \b from filename [#5207](https://github.com/axios/axios/pull/5207)
|
||||||
|
- chore(docs): update CHANGELOG.md [#5137](https://github.com/axios/axios/pull/5137)
|
||||||
|
- chore: add sideEffects false to package.json [#5025](https://github.com/axios/axios/pull/5025)
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- [Maddy Miller](https://github.com/me4502)
|
||||||
|
- [Amit Saini](https://github.com/amitsainii)
|
||||||
|
- [ecyrbe](https://github.com/ecyrbe)
|
||||||
|
- [Ikko Ashimine](https://github.com/eltociear)
|
||||||
|
- [Geeth Gunnampalli](https://github.com/thetechie7)
|
||||||
|
- [Shreem Asati](https://github.com/shreem-123)
|
||||||
|
- [Frieder Bluemle](https://github.com/friederbluemle)
|
||||||
|
- [윤세영](https://github.com/yunseyeong)
|
||||||
|
- [Claudio Busatto](https://github.com/cjcbusatto)
|
||||||
|
- [Remco Haszing](https://github.com/remcohaszing)
|
||||||
|
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
|
||||||
|
- [Csaba Maulis](https://github.com/om4csaba)
|
||||||
|
- [MoPaMo](https://github.com/MoPaMo)
|
||||||
|
- [Daniel Fjeldstad](https://github.com/w3bdesign)
|
||||||
|
- [Adrien Brunet](https://github.com/adrien-may)
|
||||||
|
- [Frazer Smith](https://github.com/Fdawgs)
|
||||||
|
- [HaiTao](https://github.com/836334258)
|
||||||
|
- [AZM](https://github.com/aziyatali)
|
||||||
|
- [relbns](https://github.com/relbns)
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.1.3] - 2022-10-15
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added custom params serializer support [#5113](https://github.com/axios/axios/pull/5113)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed top-level export to keep them in-line with static properties [#5109](https://github.com/axios/axios/pull/5109)
|
||||||
|
- Stopped including null values to query string. [#5108](https://github.com/axios/axios/pull/5108)
|
||||||
|
- Restored proxy config backwards compatibility with 0.x [#5097](https://github.com/axios/axios/pull/5097)
|
||||||
|
- Added back AxiosHeaders in AxiosHeaderValue [#5103](https://github.com/axios/axios/pull/5103)
|
||||||
|
- Pin CDN install instructions to a specific version [#5060](https://github.com/axios/axios/pull/5060)
|
||||||
|
- Handling of array values fixed for AxiosHeaders [#5085](https://github.com/axios/axios/pull/5085)
|
||||||
|
|
||||||
|
### Chores
|
||||||
|
|
||||||
|
- docs: match badge style, add link to them [#5046](https://github.com/axios/axios/pull/5046)
|
||||||
|
- chore: fixing comments typo [#5054](https://github.com/axios/axios/pull/5054)
|
||||||
|
- chore: update issue template [#5061](https://github.com/axios/axios/pull/5061)
|
||||||
|
- chore: added progress capturing section to the docs; [#5084](https://github.com/axios/axios/pull/5084)
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- [Jason Saayman](https://github.com/jasonsaayman)
|
||||||
|
- [scarf](https://github.com/scarf005)
|
||||||
|
- [Lenz Weber-Tronic](https://github.com/phryneas)
|
||||||
|
- [Arvindh](https://github.com/itsarvindh)
|
||||||
|
- [Félix Legrelle](https://github.com/FelixLgr)
|
||||||
|
- [Patrick Petrovic](https://github.com/ppati000)
|
||||||
|
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
|
||||||
|
- [littledian](https://github.com/littledian)
|
||||||
|
- [ChronosMasterOfAllTime](https://github.com/ChronosMasterOfAllTime)
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.1.2] - 2022-10-07
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed broken exports for UMD builds.
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- [Jason Saayman](https://github.com/jasonsaayman)
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.1.1] - 2022-10-07
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed broken exports for common js. This fix breaks a prior fix, I will fix both issues ASAP but the commonJS use is more impactful.
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- [Jason Saayman](https://github.com/jasonsaayman)
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.1.0] - 2022-10-06
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed missing exports in type definition index.d.ts [#5003](https://github.com/axios/axios/pull/5003)
|
||||||
|
- Fixed query params composing [#5018](https://github.com/axios/axios/pull/5018)
|
||||||
|
- Fixed GenericAbortSignal interface by making it more generic [#5021](https://github.com/axios/axios/pull/5021)
|
||||||
|
- Fixed adding "clear" to AxiosInterceptorManager [#5010](https://github.com/axios/axios/pull/5010)
|
||||||
|
- Fixed commonjs & umd exports [#5030](https://github.com/axios/axios/pull/5030)
|
||||||
|
- Fixed inability to access response headers when using axios 1.x with Jest [#5036](https://github.com/axios/axios/pull/5036)
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- [Trim21](https://github.com/trim21)
|
||||||
|
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
|
||||||
|
- [shingo.sasaki](https://github.com/s-sasaki-0529)
|
||||||
|
- [Ivan Pepelko](https://github.com/ivanpepelko)
|
||||||
|
- [Richard Kořínek](https://github.com/risa)
|
||||||
|
|
||||||
|
### PRs
|
||||||
|
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
|
||||||
|
```
|
||||||
|
|
||||||
|
⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
|
||||||
|
```
|
||||||
|
|
||||||
|
## [1.0.0] - 2022-10-04
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added stack trace to AxiosError [#4624](https://github.com/axios/axios/pull/4624)
|
||||||
|
- Add AxiosError to AxiosStatic [#4654](https://github.com/axios/axios/pull/4654)
|
||||||
|
- Replaced Rollup as our build runner [#4596](https://github.com/axios/axios/pull/4596)
|
||||||
|
- Added generic TS types for the exposed toFormData helper [#4668](https://github.com/axios/axios/pull/4668)
|
||||||
|
- Added listen callback function [#4096](https://github.com/axios/axios/pull/4096)
|
||||||
|
- Added instructions for installing using PNPM [#4207](https://github.com/axios/axios/pull/4207)
|
||||||
|
- Added generic AxiosAbortSignal TS interface to avoid importing AbortController polyfill [#4229](https://github.com/axios/axios/pull/4229)
|
||||||
|
- Added axios-url-template in ECOSYSTEM.md [#4238](https://github.com/axios/axios/pull/4238)
|
||||||
|
- Added a clear() function to the request and response interceptors object so a user can ensure that all interceptors have been removed from an axios instance [#4248](https://github.com/axios/axios/pull/4248)
|
||||||
|
- Added react hook plugin [#4319](https://github.com/axios/axios/pull/4319)
|
||||||
|
- Adding HTTP status code for transformResponse [#4580](https://github.com/axios/axios/pull/4580)
|
||||||
|
- Added blob to the list of protocols supported by the browser [#4678](https://github.com/axios/axios/pull/4678)
|
||||||
|
- Resolving proxy from env on redirect [#4436](https://github.com/axios/axios/pull/4436)
|
||||||
|
- Added enhanced toFormData implementation with additional options [4704](https://github.com/axios/axios/pull/4704)
|
||||||
|
- Adding Canceler parameters config and request [#4711](https://github.com/axios/axios/pull/4711)
|
||||||
|
- Added automatic payload serialization to application/x-www-form-urlencoded [#4714](https://github.com/axios/axios/pull/4714)
|
||||||
|
- Added the ability for webpack users to overwrite built-ins [#4715](https://github.com/axios/axios/pull/4715)
|
||||||
|
- Added string[] to AxiosRequestHeaders type [#4322](https://github.com/axios/axios/pull/4322)
|
||||||
|
- Added the ability for the url-encoded-form serializer to respect the formSerializer config [#4721](https://github.com/axios/axios/pull/4721)
|
||||||
|
- Added isCancel type assert [#4293](https://github.com/axios/axios/pull/4293)
|
||||||
|
- Added data URL support for node.js [#4725](https://github.com/axios/axios/pull/4725)
|
||||||
|
- Adding types for progress event callbacks [#4675](https://github.com/axios/axios/pull/4675)
|
||||||
|
- URL params serializer [#4734](https://github.com/axios/axios/pull/4734)
|
||||||
|
- Added axios.formToJSON method [#4735](https://github.com/axios/axios/pull/4735)
|
||||||
|
- Bower platform add data protocol [#4804](https://github.com/axios/axios/pull/4804)
|
||||||
|
- Use WHATWG URL API instead of url.parse() [#4852](https://github.com/axios/axios/pull/4852)
|
||||||
|
- Add ENUM containing Http Status Codes to typings [#4903](https://github.com/axios/axios/pull/4903)
|
||||||
|
- Improve typing of timeout in index.d.ts [#4934](https://github.com/axios/axios/pull/4934)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Updated AxiosError.config to be optional in the type definition [#4665](https://github.com/axios/axios/pull/4665)
|
||||||
|
- Updated README emphasizing the URLSearchParam built-in interface over other solutions [#4590](https://github.com/axios/axios/pull/4590)
|
||||||
|
- Include request and config when creating a CanceledError instance [#4659](https://github.com/axios/axios/pull/4659)
|
||||||
|
- Changed func-names eslint rule to as-needed [#4492](https://github.com/axios/axios/pull/4492)
|
||||||
|
- Replacing deprecated substr() with slice() as substr() is deprecated [#4468](https://github.com/axios/axios/pull/4468)
|
||||||
|
- Updating HTTP links in README.md to use HTTPS [#4387](https://github.com/axios/axios/pull/4387)
|
||||||
|
- Updated to a better trim() polyfill [#4072](https://github.com/axios/axios/pull/4072)
|
||||||
|
- Updated types to allow specifying partial default headers on instance create [#4185](https://github.com/axios/axios/pull/4185)
|
||||||
|
- Expanded isAxiosError types [#4344](https://github.com/axios/axios/pull/4344)
|
||||||
|
- Updated type definition for axios instance methods [#4224](https://github.com/axios/axios/pull/4224)
|
||||||
|
- Updated eslint config [#4722](https://github.com/axios/axios/pull/4722)
|
||||||
|
- Updated Docs [#4742](https://github.com/axios/axios/pull/4742)
|
||||||
|
- Refactored Axios to use ES2017 [#4787](https://github.com/axios/axios/pull/4787)
|
||||||
|
|
||||||
|
|
||||||
|
### Deprecated
|
||||||
|
- There are multiple deprecations, refactors and fixes provided in this release. Please read through the full release notes to see how this may impact your project and use case.
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- Removed incorrect argument for NetworkError constructor [#4656](https://github.com/axios/axios/pull/4656)
|
||||||
|
- Removed Webpack [#4596](https://github.com/axios/axios/pull/4596)
|
||||||
|
- Removed function that transform arguments to array [#4544](https://github.com/axios/axios/pull/4544)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed grammar in README [#4649](https://github.com/axios/axios/pull/4649)
|
||||||
|
- Fixed code error in README [#4599](https://github.com/axios/axios/pull/4599)
|
||||||
|
- Optimized the code that checks cancellation [#4587](https://github.com/axios/axios/pull/4587)
|
||||||
|
- Fix url pointing to defaults.js in README [#4532](https://github.com/axios/axios/pull/4532)
|
||||||
|
- Use type alias instead of interface for AxiosPromise [#4505](https://github.com/axios/axios/pull/4505)
|
||||||
|
- Fix some word spelling and lint style in code comments [#4500](https://github.com/axios/axios/pull/4500)
|
||||||
|
- Edited readme with 3 updated browser icons of Chrome, FireFox and Safari [#4414](https://github.com/axios/axios/pull/4414)
|
||||||
|
- Bump follow-redirects from 1.14.9 to 1.15.0 [#4673](https://github.com/axios/axios/pull/4673)
|
||||||
|
- Fixing http tests to avoid hanging when assertions fail [#4435](https://github.com/axios/axios/pull/4435)
|
||||||
|
- Fix TS definition for AxiosRequestTransformer [#4201](https://github.com/axios/axios/pull/4201)
|
||||||
|
- Fix grammatical issues in README [#4232](https://github.com/axios/axios/pull/4232)
|
||||||
|
- Fixing instance.defaults.headers type [#4557](https://github.com/axios/axios/pull/4557)
|
||||||
|
- Fixed race condition on immediate requests cancellation [#4261](https://github.com/axios/axios/pull/4261)
|
||||||
|
- Fixing Z_BUF_ERROR when no content [#4701](https://github.com/axios/axios/pull/4701)
|
||||||
|
- Fixing proxy beforeRedirect regression [#4708](https://github.com/axios/axios/pull/4708)
|
||||||
|
- Fixed AxiosError status code type [#4717](https://github.com/axios/axios/pull/4717)
|
||||||
|
- Fixed AxiosError stack capturing [#4718](https://github.com/axios/axios/pull/4718)
|
||||||
|
- Fixing AxiosRequestHeaders typings [#4334](https://github.com/axios/axios/pull/4334)
|
||||||
|
- Fixed max body length defaults [#4731](https://github.com/axios/axios/pull/4731)
|
||||||
|
- Fixed toFormData Blob issue on node>v17 [#4728](https://github.com/axios/axios/pull/4728)
|
||||||
|
- Bump grunt from 1.5.2 to 1.5.3 [#4743](https://github.com/axios/axios/pull/4743)
|
||||||
|
- Fixing content-type header repeated [#4745](https://github.com/axios/axios/pull/4745)
|
||||||
|
- Fixed timeout error message for http [4738](https://github.com/axios/axios/pull/4738)
|
||||||
|
- Request ignores false, 0 and empty string as body values [#4785](https://github.com/axios/axios/pull/4785)
|
||||||
|
- Added back missing minified builds [#4805](https://github.com/axios/axios/pull/4805)
|
||||||
|
- Fixed a type error [#4815](https://github.com/axios/axios/pull/4815)
|
||||||
|
- Fixed a regression bug with unsubscribing from cancel token; [#4819](https://github.com/axios/axios/pull/4819)
|
||||||
|
- Remove repeated compression algorithm [#4820](https://github.com/axios/axios/pull/4820)
|
||||||
|
- The error of calling extend to pass parameters [#4857](https://github.com/axios/axios/pull/4857)
|
||||||
|
- SerializerOptions.indexes allows boolean | null | undefined [#4862](https://github.com/axios/axios/pull/4862)
|
||||||
|
- Require interceptors to return values [#4874](https://github.com/axios/axios/pull/4874)
|
||||||
|
- Removed unused imports [#4949](https://github.com/axios/axios/pull/4949)
|
||||||
|
- Allow null indexes on formSerializer and paramsSerializer [#4960](https://github.com/axios/axios/pull/4960)
|
||||||
|
|
||||||
|
### Chores
|
||||||
|
- Set permissions for GitHub actions [#4765](https://github.com/axios/axios/pull/4765)
|
||||||
|
- Included githubactions in the dependabot config [#4770](https://github.com/axios/axios/pull/4770)
|
||||||
|
- Included dependency review [#4771](https://github.com/axios/axios/pull/4771)
|
||||||
|
- Update security.md [#4784](https://github.com/axios/axios/pull/4784)
|
||||||
|
- Remove unnecessary spaces [#4854](https://github.com/axios/axios/pull/4854)
|
||||||
|
- Simplify the import path of AxiosError [#4875](https://github.com/axios/axios/pull/4875)
|
||||||
|
- Fix Gitpod dead link [#4941](https://github.com/axios/axios/pull/4941)
|
||||||
|
- Enable syntax highlighting for a code block [#4970](https://github.com/axios/axios/pull/4970)
|
||||||
|
- Using Logo Axios in Readme.md [#4993](https://github.com/axios/axios/pull/4993)
|
||||||
|
- Fix markup for note in README [#4825](https://github.com/axios/axios/pull/4825)
|
||||||
|
- Fix typo and formatting, add colons [#4853](https://github.com/axios/axios/pull/4853)
|
||||||
|
- Fix typo in readme [#4942](https://github.com/axios/axios/pull/4942)
|
||||||
|
|
||||||
|
### Security
|
||||||
|
|
||||||
|
- Update SECURITY.md [#4687](https://github.com/axios/axios/pull/4687)
|
||||||
|
|
||||||
|
### Contributors to this release
|
||||||
|
|
||||||
|
- [Bertrand Marron](https://github.com/tusbar)
|
||||||
|
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
|
||||||
|
- [Dan Mooney](https://github.com/danmooney)
|
||||||
|
- [Michael Li](https://github.com/xiaoyu-tamu)
|
||||||
|
- [aong](https://github.com/yxwzaxns)
|
||||||
|
- [Des Preston](https://github.com/despreston)
|
||||||
|
- [Ted Robertson](https://github.com/tredondo)
|
||||||
|
- [zhoulixiang](https://github.com/zh-lx)
|
||||||
|
- [Arthur Fiorette](https://github.com/arthurfiorette)
|
||||||
|
- [Kumar Shanu](https://github.com/Kr-Shanu)
|
||||||
|
- [JALAL](https://github.com/JLL32)
|
||||||
|
- [Jingyi Lin](https://github.com/MageeLin)
|
||||||
|
- [Philipp Loose](https://github.com/phloose)
|
||||||
|
- [Alexander Shchukin](https://github.com/sashsvamir)
|
||||||
|
- [Dave Cardwell](https://github.com/davecardwell)
|
||||||
|
- [Cat Scarlet](https://github.com/catscarlet)
|
||||||
|
- [Luca Pizzini](https://github.com/lpizzinidev)
|
||||||
|
- [Kai](https://github.com/Schweinepriester)
|
||||||
|
- [Maxime Bargiel](https://github.com/mbargiel)
|
||||||
|
- [Brian Helba](https://github.com/brianhelba)
|
||||||
|
- [reslear](https://github.com/reslear)
|
||||||
|
- [Jamie Slome](https://github.com/JamieSlome)
|
||||||
|
- [Landro3](https://github.com/Landro3)
|
||||||
|
- [rafw87](https://github.com/rafw87)
|
||||||
|
- [Afzal Sayed](https://github.com/afzalsayed96)
|
||||||
|
- [Koki Oyatsu](https://github.com/kaishuu0123)
|
||||||
|
- [Dave](https://github.com/wangcch)
|
||||||
|
- [暴走老七](https://github.com/baozouai)
|
||||||
|
- [Spencer](https://github.com/spalger)
|
||||||
|
- [Adrian Wieprzkowicz](https://github.com/Argeento)
|
||||||
|
- [Jamie Telin](https://github.com/lejahmie)
|
||||||
|
- [毛呆](https://github.com/aweikalee)
|
||||||
|
- [Kirill Shakirov](https://github.com/turisap)
|
||||||
|
- [Rraji Abdelbari](https://github.com/estarossa0)
|
||||||
|
- [Jelle Schutter](https://github.com/jelleschutter)
|
||||||
|
- [Tom Ceuppens](https://github.com/KyorCode)
|
||||||
|
- [Johann Cooper](https://github.com/JohannCooper)
|
||||||
|
- [Dimitris Halatsis](https://github.com/mitsos1os)
|
||||||
|
- [chenjigeng](https://github.com/chenjigeng)
|
||||||
|
- [João Gabriel Quaresma](https://github.com/joaoGabriel55)
|
||||||
|
- [Victor Augusto](https://github.com/VictorAugDB)
|
||||||
|
- [neilnaveen](https://github.com/neilnaveen)
|
||||||
|
- [Pavlos](https://github.com/psmoros)
|
||||||
|
- [Kiryl Valkovich](https://github.com/visortelle)
|
||||||
|
- [Naveen](https://github.com/naveensrinivasan)
|
||||||
|
- [wenzheng](https://github.com/0x30)
|
||||||
|
- [hcwhan](https://github.com/hcwhan)
|
||||||
|
- [Bassel Rachid](https://github.com/basselworkforce)
|
||||||
|
- [Grégoire Pineau](https://github.com/lyrixx)
|
||||||
|
- [felipedamin](https://github.com/felipedamin)
|
||||||
|
- [Karl Horky](https://github.com/karlhorky)
|
||||||
|
- [Yue JIN](https://github.com/kingyue737)
|
||||||
|
- [Usman Ali Siddiqui](https://github.com/usman250994)
|
||||||
|
- [WD](https://github.com/techbirds)
|
||||||
|
- [Günther Foidl](https://github.com/gfoidl)
|
||||||
|
- [Stephen Jennings](https://github.com/jennings)
|
||||||
|
- [C.T.Lin](https://github.com/chentsulin)
|
||||||
|
- [mia-z](https://github.com/mia-z)
|
||||||
|
- [Parth Banathia](https://github.com/Parth0105)
|
||||||
|
- [parth0105pluang](https://github.com/parth0105pluang)
|
||||||
|
- [Marco Weber](https://github.com/mrcwbr)
|
||||||
|
- [Luca Pizzini](https://github.com/lpizzinidev)
|
||||||
|
- [Willian Agostini](https://github.com/WillianAgostini)
|
||||||
|
- [Huyen Nguyen](https://github.com/huyenltnguyen)
|
||||||
7
node_modules/axios/LICENSE
generated
vendored
Normal file
7
node_modules/axios/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# Copyright (c) 2014-present Matt Zabriskie & Collaborators
|
||||||
|
|
||||||
|
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.
|
||||||
3
node_modules/axios/MIGRATION_GUIDE.md
generated
vendored
Normal file
3
node_modules/axios/MIGRATION_GUIDE.md
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Migration Guide
|
||||||
|
|
||||||
|
## 0.x.x -> 1.1.0
|
||||||
1650
node_modules/axios/README.md
generated
vendored
Normal file
1650
node_modules/axios/README.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
node_modules/axios/SECURITY.md
generated
vendored
Normal file
6
node_modules/axios/SECURITY.md
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Reporting a Vulnerability
|
||||||
|
|
||||||
|
If you discover a security vulnerability in axios please disclose it via [our huntr page](https://huntr.dev/repos/axios/axios/). Bounty eligibility, CVE assignment, response times and past reports are all there.
|
||||||
|
|
||||||
|
|
||||||
|
Thank you for improving the security of axios.
|
||||||
542
node_modules/axios/index.d.cts
generated
vendored
Normal file
542
node_modules/axios/index.d.cts
generated
vendored
Normal file
@@ -0,0 +1,542 @@
|
|||||||
|
interface RawAxiosHeaders {
|
||||||
|
[key: string]: axios.AxiosHeaderValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
type MethodsHeaders = Partial<{
|
||||||
|
[Key in axios.Method as Lowercase<Key>]: AxiosHeaders;
|
||||||
|
} & {common: AxiosHeaders}>;
|
||||||
|
|
||||||
|
type AxiosHeaderMatcher = (this: AxiosHeaders, value: string, name: string, headers: RawAxiosHeaders) => boolean;
|
||||||
|
|
||||||
|
type AxiosHeaderParser = (this: AxiosHeaders, value: axios.AxiosHeaderValue, header: string) => any;
|
||||||
|
|
||||||
|
type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent'| 'Content-Encoding' | 'Authorization';
|
||||||
|
|
||||||
|
type ContentType = axios.AxiosHeaderValue | 'text/html' | 'text/plain' | 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded' | 'application/octet-stream';
|
||||||
|
|
||||||
|
type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding';
|
||||||
|
|
||||||
|
declare class AxiosHeaders {
|
||||||
|
constructor(
|
||||||
|
headers?: RawAxiosHeaders | AxiosHeaders | string
|
||||||
|
);
|
||||||
|
|
||||||
|
[key: string]: any;
|
||||||
|
|
||||||
|
set(headerName?: string, value?: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||||
|
set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;
|
||||||
|
|
||||||
|
get(headerName: string, parser: RegExp): RegExpExecArray | null;
|
||||||
|
get(headerName: string, matcher?: true | AxiosHeaderParser): axios.AxiosHeaderValue;
|
||||||
|
|
||||||
|
has(header: string, matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
clear(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
normalize(format: boolean): AxiosHeaders;
|
||||||
|
|
||||||
|
concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
|
||||||
|
|
||||||
|
toJSON(asStrings?: boolean): RawAxiosHeaders;
|
||||||
|
|
||||||
|
static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;
|
||||||
|
|
||||||
|
static accessor(header: string | string[]): AxiosHeaders;
|
||||||
|
|
||||||
|
static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
|
||||||
|
|
||||||
|
setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||||
|
getContentType(parser?: RegExp): RegExpExecArray | null;
|
||||||
|
getContentType(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
|
||||||
|
hasContentType(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
setContentLength(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||||
|
getContentLength(parser?: RegExp): RegExpExecArray | null;
|
||||||
|
getContentLength(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
|
||||||
|
hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
setAccept(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||||
|
getAccept(parser?: RegExp): RegExpExecArray | null;
|
||||||
|
getAccept(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
|
||||||
|
hasAccept(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
setUserAgent(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||||
|
getUserAgent(parser?: RegExp): RegExpExecArray | null;
|
||||||
|
getUserAgent(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
|
||||||
|
hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
setContentEncoding(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||||
|
getContentEncoding(parser?: RegExp): RegExpExecArray | null;
|
||||||
|
getContentEncoding(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
|
||||||
|
hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
setAuthorization(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||||
|
getAuthorization(parser?: RegExp): RegExpExecArray | null;
|
||||||
|
getAuthorization(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue;
|
||||||
|
hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
[Symbol.iterator](): IterableIterator<[string, axios.AxiosHeaderValue]>;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare class AxiosError<T = unknown, D = any> extends Error {
|
||||||
|
constructor(
|
||||||
|
message?: string,
|
||||||
|
code?: string,
|
||||||
|
config?: axios.InternalAxiosRequestConfig<D>,
|
||||||
|
request?: any,
|
||||||
|
response?: axios.AxiosResponse<T, D>
|
||||||
|
);
|
||||||
|
|
||||||
|
config?: axios.InternalAxiosRequestConfig<D>;
|
||||||
|
code?: string;
|
||||||
|
request?: any;
|
||||||
|
response?: axios.AxiosResponse<T, D>;
|
||||||
|
isAxiosError: boolean;
|
||||||
|
status?: number;
|
||||||
|
toJSON: () => object;
|
||||||
|
cause?: Error;
|
||||||
|
static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
||||||
|
static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
||||||
|
static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
||||||
|
static readonly ERR_NETWORK = "ERR_NETWORK";
|
||||||
|
static readonly ERR_DEPRECATED = "ERR_DEPRECATED";
|
||||||
|
static readonly ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
||||||
|
static readonly ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
||||||
|
static readonly ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
||||||
|
static readonly ERR_INVALID_URL = "ERR_INVALID_URL";
|
||||||
|
static readonly ERR_CANCELED = "ERR_CANCELED";
|
||||||
|
static readonly ECONNABORTED = "ECONNABORTED";
|
||||||
|
static readonly ETIMEDOUT = "ETIMEDOUT";
|
||||||
|
}
|
||||||
|
|
||||||
|
declare class CanceledError<T> extends AxiosError<T> {
|
||||||
|
}
|
||||||
|
|
||||||
|
declare class Axios {
|
||||||
|
constructor(config?: axios.AxiosRequestConfig);
|
||||||
|
defaults: axios.AxiosDefaults;
|
||||||
|
interceptors: {
|
||||||
|
request: axios.AxiosInterceptorManager<axios.InternalAxiosRequestConfig>;
|
||||||
|
response: axios.AxiosInterceptorManager<axios.AxiosResponse>;
|
||||||
|
};
|
||||||
|
getUri(config?: axios.AxiosRequestConfig): string;
|
||||||
|
request<T = any, R = axios.AxiosResponse<T>, D = any>(config: axios.AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
get<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
delete<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
head<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
options<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
post<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
put<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
patch<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
postForm<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
putForm<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
patchForm<T = any, R = axios.AxiosResponse<T>, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare enum HttpStatusCode {
|
||||||
|
Continue = 100,
|
||||||
|
SwitchingProtocols = 101,
|
||||||
|
Processing = 102,
|
||||||
|
EarlyHints = 103,
|
||||||
|
Ok = 200,
|
||||||
|
Created = 201,
|
||||||
|
Accepted = 202,
|
||||||
|
NonAuthoritativeInformation = 203,
|
||||||
|
NoContent = 204,
|
||||||
|
ResetContent = 205,
|
||||||
|
PartialContent = 206,
|
||||||
|
MultiStatus = 207,
|
||||||
|
AlreadyReported = 208,
|
||||||
|
ImUsed = 226,
|
||||||
|
MultipleChoices = 300,
|
||||||
|
MovedPermanently = 301,
|
||||||
|
Found = 302,
|
||||||
|
SeeOther = 303,
|
||||||
|
NotModified = 304,
|
||||||
|
UseProxy = 305,
|
||||||
|
Unused = 306,
|
||||||
|
TemporaryRedirect = 307,
|
||||||
|
PermanentRedirect = 308,
|
||||||
|
BadRequest = 400,
|
||||||
|
Unauthorized = 401,
|
||||||
|
PaymentRequired = 402,
|
||||||
|
Forbidden = 403,
|
||||||
|
NotFound = 404,
|
||||||
|
MethodNotAllowed = 405,
|
||||||
|
NotAcceptable = 406,
|
||||||
|
ProxyAuthenticationRequired = 407,
|
||||||
|
RequestTimeout = 408,
|
||||||
|
Conflict = 409,
|
||||||
|
Gone = 410,
|
||||||
|
LengthRequired = 411,
|
||||||
|
PreconditionFailed = 412,
|
||||||
|
PayloadTooLarge = 413,
|
||||||
|
UriTooLong = 414,
|
||||||
|
UnsupportedMediaType = 415,
|
||||||
|
RangeNotSatisfiable = 416,
|
||||||
|
ExpectationFailed = 417,
|
||||||
|
ImATeapot = 418,
|
||||||
|
MisdirectedRequest = 421,
|
||||||
|
UnprocessableEntity = 422,
|
||||||
|
Locked = 423,
|
||||||
|
FailedDependency = 424,
|
||||||
|
TooEarly = 425,
|
||||||
|
UpgradeRequired = 426,
|
||||||
|
PreconditionRequired = 428,
|
||||||
|
TooManyRequests = 429,
|
||||||
|
RequestHeaderFieldsTooLarge = 431,
|
||||||
|
UnavailableForLegalReasons = 451,
|
||||||
|
InternalServerError = 500,
|
||||||
|
NotImplemented = 501,
|
||||||
|
BadGateway = 502,
|
||||||
|
ServiceUnavailable = 503,
|
||||||
|
GatewayTimeout = 504,
|
||||||
|
HttpVersionNotSupported = 505,
|
||||||
|
VariantAlsoNegotiates = 506,
|
||||||
|
InsufficientStorage = 507,
|
||||||
|
LoopDetected = 508,
|
||||||
|
NotExtended = 510,
|
||||||
|
NetworkAuthenticationRequired = 511,
|
||||||
|
}
|
||||||
|
|
||||||
|
type InternalAxiosError<T = unknown, D = any> = AxiosError<T, D>;
|
||||||
|
|
||||||
|
declare namespace axios {
|
||||||
|
type AxiosError<T = unknown, D = any> = InternalAxiosError<T, D>;
|
||||||
|
|
||||||
|
type RawAxiosRequestHeaders = Partial<RawAxiosHeaders & {
|
||||||
|
[Key in CommonRequestHeadersList]: AxiosHeaderValue;
|
||||||
|
} & {
|
||||||
|
'Content-Type': ContentType
|
||||||
|
}>;
|
||||||
|
|
||||||
|
type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
|
||||||
|
|
||||||
|
type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;
|
||||||
|
|
||||||
|
type RawCommonResponseHeaders = {
|
||||||
|
[Key in CommonResponseHeadersList]: AxiosHeaderValue;
|
||||||
|
} & {
|
||||||
|
"set-cookie": string[];
|
||||||
|
};
|
||||||
|
|
||||||
|
type RawAxiosResponseHeaders = Partial<RawAxiosHeaders & RawCommonResponseHeaders>;
|
||||||
|
|
||||||
|
type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;
|
||||||
|
|
||||||
|
interface AxiosRequestTransformer {
|
||||||
|
(this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AxiosResponseTransformer {
|
||||||
|
(this: InternalAxiosRequestConfig, data: any, headers: AxiosResponseHeaders, status?: number): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AxiosAdapter {
|
||||||
|
(config: InternalAxiosRequestConfig): AxiosPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AxiosBasicCredentials {
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AxiosProxyConfig {
|
||||||
|
host: string;
|
||||||
|
port: number;
|
||||||
|
auth?: AxiosBasicCredentials;
|
||||||
|
protocol?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
type Method =
|
||||||
|
| 'get' | 'GET'
|
||||||
|
| 'delete' | 'DELETE'
|
||||||
|
| 'head' | 'HEAD'
|
||||||
|
| 'options' | 'OPTIONS'
|
||||||
|
| 'post' | 'POST'
|
||||||
|
| 'put' | 'PUT'
|
||||||
|
| 'patch' | 'PATCH'
|
||||||
|
| 'purge' | 'PURGE'
|
||||||
|
| 'link' | 'LINK'
|
||||||
|
| 'unlink' | 'UNLINK';
|
||||||
|
|
||||||
|
type ResponseType =
|
||||||
|
| 'arraybuffer'
|
||||||
|
| 'blob'
|
||||||
|
| 'document'
|
||||||
|
| 'json'
|
||||||
|
| 'text'
|
||||||
|
| 'stream';
|
||||||
|
|
||||||
|
type responseEncoding =
|
||||||
|
| 'ascii' | 'ASCII'
|
||||||
|
| 'ansi' | 'ANSI'
|
||||||
|
| 'binary' | 'BINARY'
|
||||||
|
| 'base64' | 'BASE64'
|
||||||
|
| 'base64url' | 'BASE64URL'
|
||||||
|
| 'hex' | 'HEX'
|
||||||
|
| 'latin1' | 'LATIN1'
|
||||||
|
| 'ucs-2' | 'UCS-2'
|
||||||
|
| 'ucs2' | 'UCS2'
|
||||||
|
| 'utf-8' | 'UTF-8'
|
||||||
|
| 'utf8' | 'UTF8'
|
||||||
|
| 'utf16le' | 'UTF16LE';
|
||||||
|
|
||||||
|
interface TransitionalOptions {
|
||||||
|
silentJSONParsing?: boolean;
|
||||||
|
forcedJSONParsing?: boolean;
|
||||||
|
clarifyTimeoutError?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface GenericAbortSignal {
|
||||||
|
readonly aborted: boolean;
|
||||||
|
onabort?: ((...args: any) => any) | null;
|
||||||
|
addEventListener?: (...args: any) => any;
|
||||||
|
removeEventListener?: (...args: any) => any;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface FormDataVisitorHelpers {
|
||||||
|
defaultVisitor: SerializerVisitor;
|
||||||
|
convertValue: (value: any) => any;
|
||||||
|
isVisitable: (value: any) => boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SerializerVisitor {
|
||||||
|
(
|
||||||
|
this: GenericFormData,
|
||||||
|
value: any,
|
||||||
|
key: string | number,
|
||||||
|
path: null | Array<string | number>,
|
||||||
|
helpers: FormDataVisitorHelpers
|
||||||
|
): boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SerializerOptions {
|
||||||
|
visitor?: SerializerVisitor;
|
||||||
|
dots?: boolean;
|
||||||
|
metaTokens?: boolean;
|
||||||
|
indexes?: boolean | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// tslint:disable-next-line
|
||||||
|
interface FormSerializerOptions extends SerializerOptions {
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ParamEncoder {
|
||||||
|
(value: any, defaultEncoder: (value: any) => any): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface CustomParamsSerializer {
|
||||||
|
(params: Record<string, any>, options?: ParamsSerializerOptions): string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ParamsSerializerOptions extends SerializerOptions {
|
||||||
|
encode?: ParamEncoder;
|
||||||
|
serialize?: CustomParamsSerializer;
|
||||||
|
}
|
||||||
|
|
||||||
|
type MaxUploadRate = number;
|
||||||
|
|
||||||
|
type MaxDownloadRate = number;
|
||||||
|
|
||||||
|
type BrowserProgressEvent = any;
|
||||||
|
|
||||||
|
interface AxiosProgressEvent {
|
||||||
|
loaded: number;
|
||||||
|
total?: number;
|
||||||
|
progress?: number;
|
||||||
|
bytes: number;
|
||||||
|
rate?: number;
|
||||||
|
estimated?: number;
|
||||||
|
upload?: boolean;
|
||||||
|
download?: boolean;
|
||||||
|
event?: BrowserProgressEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
type Milliseconds = number;
|
||||||
|
|
||||||
|
type AxiosAdapterName = 'xhr' | 'http' | string;
|
||||||
|
|
||||||
|
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
|
||||||
|
|
||||||
|
type AddressFamily = 4 | 6 | undefined;
|
||||||
|
|
||||||
|
interface LookupAddressEntry {
|
||||||
|
address: string;
|
||||||
|
family?: AddressFamily;
|
||||||
|
}
|
||||||
|
|
||||||
|
type LookupAddress = string | LookupAddressEntry;
|
||||||
|
|
||||||
|
interface AxiosRequestConfig<D = any> {
|
||||||
|
url?: string;
|
||||||
|
method?: Method | string;
|
||||||
|
baseURL?: string;
|
||||||
|
transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
|
||||||
|
transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
|
||||||
|
headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders;
|
||||||
|
params?: any;
|
||||||
|
paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
|
||||||
|
data?: D;
|
||||||
|
timeout?: Milliseconds;
|
||||||
|
timeoutErrorMessage?: string;
|
||||||
|
withCredentials?: boolean;
|
||||||
|
adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
|
||||||
|
auth?: AxiosBasicCredentials;
|
||||||
|
responseType?: ResponseType;
|
||||||
|
responseEncoding?: responseEncoding | string;
|
||||||
|
xsrfCookieName?: string;
|
||||||
|
xsrfHeaderName?: string;
|
||||||
|
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
|
||||||
|
onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void;
|
||||||
|
maxContentLength?: number;
|
||||||
|
validateStatus?: ((status: number) => boolean) | null;
|
||||||
|
maxBodyLength?: number;
|
||||||
|
maxRedirects?: number;
|
||||||
|
maxRate?: number | [MaxUploadRate, MaxDownloadRate];
|
||||||
|
beforeRedirect?: (options: Record<string, any>, responseDetails: {headers: Record<string, string>, statusCode: HttpStatusCode}) => void;
|
||||||
|
socketPath?: string | null;
|
||||||
|
transport?: any;
|
||||||
|
httpAgent?: any;
|
||||||
|
httpsAgent?: any;
|
||||||
|
proxy?: AxiosProxyConfig | false;
|
||||||
|
cancelToken?: CancelToken;
|
||||||
|
decompress?: boolean;
|
||||||
|
transitional?: TransitionalOptions;
|
||||||
|
signal?: GenericAbortSignal;
|
||||||
|
insecureHTTPParser?: boolean;
|
||||||
|
env?: {
|
||||||
|
FormData?: new (...args: any[]) => object;
|
||||||
|
};
|
||||||
|
formSerializer?: FormSerializerOptions;
|
||||||
|
family?: AddressFamily;
|
||||||
|
lookup?: ((hostname: string, options: object, cb: (err: Error | null, address: LookupAddress | LookupAddress[], family?: AddressFamily) => void) => void) |
|
||||||
|
((hostname: string, options: object) => Promise<[address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress>);
|
||||||
|
withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Alias
|
||||||
|
type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
|
||||||
|
|
||||||
|
interface InternalAxiosRequestConfig<D = any> extends AxiosRequestConfig {
|
||||||
|
headers: AxiosRequestHeaders;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface HeadersDefaults {
|
||||||
|
common: RawAxiosRequestHeaders;
|
||||||
|
delete: RawAxiosRequestHeaders;
|
||||||
|
get: RawAxiosRequestHeaders;
|
||||||
|
head: RawAxiosRequestHeaders;
|
||||||
|
post: RawAxiosRequestHeaders;
|
||||||
|
put: RawAxiosRequestHeaders;
|
||||||
|
patch: RawAxiosRequestHeaders;
|
||||||
|
options?: RawAxiosRequestHeaders;
|
||||||
|
purge?: RawAxiosRequestHeaders;
|
||||||
|
link?: RawAxiosRequestHeaders;
|
||||||
|
unlink?: RawAxiosRequestHeaders;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
||||||
|
headers: HeadersDefaults;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface CreateAxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
||||||
|
headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AxiosResponse<T = any, D = any> {
|
||||||
|
data: T;
|
||||||
|
status: number;
|
||||||
|
statusText: string;
|
||||||
|
headers: RawAxiosResponseHeaders | AxiosResponseHeaders;
|
||||||
|
config: InternalAxiosRequestConfig<D>;
|
||||||
|
request?: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
type AxiosPromise<T = any> = Promise<AxiosResponse<T>>;
|
||||||
|
|
||||||
|
interface CancelStatic {
|
||||||
|
new (message?: string): Cancel;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Cancel {
|
||||||
|
message: string | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Canceler {
|
||||||
|
(message?: string, config?: AxiosRequestConfig, request?: any): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface CancelTokenStatic {
|
||||||
|
new (executor: (cancel: Canceler) => void): CancelToken;
|
||||||
|
source(): CancelTokenSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface CancelToken {
|
||||||
|
promise: Promise<Cancel>;
|
||||||
|
reason?: Cancel;
|
||||||
|
throwIfRequested(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface CancelTokenSource {
|
||||||
|
token: CancelToken;
|
||||||
|
cancel: Canceler;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AxiosInterceptorOptions {
|
||||||
|
synchronous?: boolean;
|
||||||
|
runWhen?: (config: InternalAxiosRequestConfig) => boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AxiosInterceptorManager<V> {
|
||||||
|
use(onFulfilled?: (value: V) => V | Promise<V>, onRejected?: (error: any) => any, options?: AxiosInterceptorOptions): number;
|
||||||
|
eject(id: number): void;
|
||||||
|
clear(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AxiosInstance extends Axios {
|
||||||
|
<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
|
||||||
|
defaults: Omit<AxiosDefaults, 'headers'> & {
|
||||||
|
headers: HeadersDefaults & {
|
||||||
|
[key: string]: AxiosHeaderValue
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
interface GenericFormData {
|
||||||
|
append(name: string, value: any, options?: any): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface GenericHTMLFormElement {
|
||||||
|
name: string;
|
||||||
|
method: string;
|
||||||
|
submit(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AxiosStatic extends AxiosInstance {
|
||||||
|
create(config?: CreateAxiosDefaults): AxiosInstance;
|
||||||
|
Cancel: CancelStatic;
|
||||||
|
CancelToken: CancelTokenStatic;
|
||||||
|
Axios: typeof Axios;
|
||||||
|
AxiosError: typeof AxiosError;
|
||||||
|
CanceledError: typeof CanceledError;
|
||||||
|
HttpStatusCode: typeof HttpStatusCode;
|
||||||
|
readonly VERSION: string;
|
||||||
|
isCancel(value: any): value is Cancel;
|
||||||
|
all<T>(values: Array<T | Promise<T>>): Promise<T[]>;
|
||||||
|
spread<T, R>(callback: (...args: T[]) => R): (array: T[]) => R;
|
||||||
|
isAxiosError<T = any, D = any>(payload: any): payload is AxiosError<T, D>;
|
||||||
|
toFormData(sourceObj: object, targetFormData?: GenericFormData, options?: FormSerializerOptions): GenericFormData;
|
||||||
|
formToJSON(form: GenericFormData|GenericHTMLFormElement): object;
|
||||||
|
getAdapter(adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined): AxiosAdapter;
|
||||||
|
AxiosHeaders: typeof AxiosHeaders;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare const axios: axios.AxiosStatic;
|
||||||
|
|
||||||
|
export = axios;
|
||||||
559
node_modules/axios/index.d.ts
generated
vendored
Normal file
559
node_modules/axios/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,559 @@
|
|||||||
|
// TypeScript Version: 4.7
|
||||||
|
export type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null;
|
||||||
|
|
||||||
|
interface RawAxiosHeaders {
|
||||||
|
[key: string]: AxiosHeaderValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
type MethodsHeaders = Partial<{
|
||||||
|
[Key in Method as Lowercase<Key>]: AxiosHeaders;
|
||||||
|
} & {common: AxiosHeaders}>;
|
||||||
|
|
||||||
|
type AxiosHeaderMatcher = string | RegExp | ((this: AxiosHeaders, value: string, name: string) => boolean);
|
||||||
|
|
||||||
|
type AxiosHeaderParser = (this: AxiosHeaders, value: AxiosHeaderValue, header: string) => any;
|
||||||
|
|
||||||
|
export class AxiosHeaders {
|
||||||
|
constructor(
|
||||||
|
headers?: RawAxiosHeaders | AxiosHeaders | string
|
||||||
|
);
|
||||||
|
|
||||||
|
[key: string]: any;
|
||||||
|
|
||||||
|
set(headerName?: string, value?: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||||
|
set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders;
|
||||||
|
|
||||||
|
get(headerName: string, parser: RegExp): RegExpExecArray | null;
|
||||||
|
get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue;
|
||||||
|
|
||||||
|
has(header: string, matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
clear(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
normalize(format: boolean): AxiosHeaders;
|
||||||
|
|
||||||
|
concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
|
||||||
|
|
||||||
|
toJSON(asStrings?: boolean): RawAxiosHeaders;
|
||||||
|
|
||||||
|
static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;
|
||||||
|
|
||||||
|
static accessor(header: string | string[]): AxiosHeaders;
|
||||||
|
|
||||||
|
static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
|
||||||
|
|
||||||
|
setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||||
|
getContentType(parser?: RegExp): RegExpExecArray | null;
|
||||||
|
getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||||
|
hasContentType(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
setContentLength(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||||
|
getContentLength(parser?: RegExp): RegExpExecArray | null;
|
||||||
|
getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||||
|
hasContentLength(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
setAccept(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||||
|
getAccept(parser?: RegExp): RegExpExecArray | null;
|
||||||
|
getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||||
|
hasAccept(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
setUserAgent(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||||
|
getUserAgent(parser?: RegExp): RegExpExecArray | null;
|
||||||
|
getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||||
|
hasUserAgent(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
setContentEncoding(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||||
|
getContentEncoding(parser?: RegExp): RegExpExecArray | null;
|
||||||
|
getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||||
|
hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
setAuthorization(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
|
||||||
|
getAuthorization(parser?: RegExp): RegExpExecArray | null;
|
||||||
|
getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
|
||||||
|
hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
|
||||||
|
|
||||||
|
[Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
|
||||||
|
}
|
||||||
|
|
||||||
|
type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent' | 'Content-Encoding' | 'Authorization';
|
||||||
|
|
||||||
|
type ContentType = AxiosHeaderValue | 'text/html' | 'text/plain' | 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded' | 'application/octet-stream';
|
||||||
|
|
||||||
|
export type RawAxiosRequestHeaders = Partial<RawAxiosHeaders & {
|
||||||
|
[Key in CommonRequestHeadersList]: AxiosHeaderValue;
|
||||||
|
} & {
|
||||||
|
'Content-Type': ContentType
|
||||||
|
}>;
|
||||||
|
|
||||||
|
export type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
|
||||||
|
|
||||||
|
type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding';
|
||||||
|
|
||||||
|
type RawCommonResponseHeaders = {
|
||||||
|
[Key in CommonResponseHeadersList]: AxiosHeaderValue;
|
||||||
|
} & {
|
||||||
|
"set-cookie": string[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export type RawAxiosResponseHeaders = Partial<RawAxiosHeaders & RawCommonResponseHeaders>;
|
||||||
|
|
||||||
|
export type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders;
|
||||||
|
|
||||||
|
export interface AxiosRequestTransformer {
|
||||||
|
(this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AxiosResponseTransformer {
|
||||||
|
(this: InternalAxiosRequestConfig, data: any, headers: AxiosResponseHeaders, status?: number): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AxiosAdapter {
|
||||||
|
(config: InternalAxiosRequestConfig): AxiosPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AxiosBasicCredentials {
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AxiosProxyConfig {
|
||||||
|
host: string;
|
||||||
|
port: number;
|
||||||
|
auth?: AxiosBasicCredentials;
|
||||||
|
protocol?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum HttpStatusCode {
|
||||||
|
Continue = 100,
|
||||||
|
SwitchingProtocols = 101,
|
||||||
|
Processing = 102,
|
||||||
|
EarlyHints = 103,
|
||||||
|
Ok = 200,
|
||||||
|
Created = 201,
|
||||||
|
Accepted = 202,
|
||||||
|
NonAuthoritativeInformation = 203,
|
||||||
|
NoContent = 204,
|
||||||
|
ResetContent = 205,
|
||||||
|
PartialContent = 206,
|
||||||
|
MultiStatus = 207,
|
||||||
|
AlreadyReported = 208,
|
||||||
|
ImUsed = 226,
|
||||||
|
MultipleChoices = 300,
|
||||||
|
MovedPermanently = 301,
|
||||||
|
Found = 302,
|
||||||
|
SeeOther = 303,
|
||||||
|
NotModified = 304,
|
||||||
|
UseProxy = 305,
|
||||||
|
Unused = 306,
|
||||||
|
TemporaryRedirect = 307,
|
||||||
|
PermanentRedirect = 308,
|
||||||
|
BadRequest = 400,
|
||||||
|
Unauthorized = 401,
|
||||||
|
PaymentRequired = 402,
|
||||||
|
Forbidden = 403,
|
||||||
|
NotFound = 404,
|
||||||
|
MethodNotAllowed = 405,
|
||||||
|
NotAcceptable = 406,
|
||||||
|
ProxyAuthenticationRequired = 407,
|
||||||
|
RequestTimeout = 408,
|
||||||
|
Conflict = 409,
|
||||||
|
Gone = 410,
|
||||||
|
LengthRequired = 411,
|
||||||
|
PreconditionFailed = 412,
|
||||||
|
PayloadTooLarge = 413,
|
||||||
|
UriTooLong = 414,
|
||||||
|
UnsupportedMediaType = 415,
|
||||||
|
RangeNotSatisfiable = 416,
|
||||||
|
ExpectationFailed = 417,
|
||||||
|
ImATeapot = 418,
|
||||||
|
MisdirectedRequest = 421,
|
||||||
|
UnprocessableEntity = 422,
|
||||||
|
Locked = 423,
|
||||||
|
FailedDependency = 424,
|
||||||
|
TooEarly = 425,
|
||||||
|
UpgradeRequired = 426,
|
||||||
|
PreconditionRequired = 428,
|
||||||
|
TooManyRequests = 429,
|
||||||
|
RequestHeaderFieldsTooLarge = 431,
|
||||||
|
UnavailableForLegalReasons = 451,
|
||||||
|
InternalServerError = 500,
|
||||||
|
NotImplemented = 501,
|
||||||
|
BadGateway = 502,
|
||||||
|
ServiceUnavailable = 503,
|
||||||
|
GatewayTimeout = 504,
|
||||||
|
HttpVersionNotSupported = 505,
|
||||||
|
VariantAlsoNegotiates = 506,
|
||||||
|
InsufficientStorage = 507,
|
||||||
|
LoopDetected = 508,
|
||||||
|
NotExtended = 510,
|
||||||
|
NetworkAuthenticationRequired = 511,
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Method =
|
||||||
|
| 'get' | 'GET'
|
||||||
|
| 'delete' | 'DELETE'
|
||||||
|
| 'head' | 'HEAD'
|
||||||
|
| 'options' | 'OPTIONS'
|
||||||
|
| 'post' | 'POST'
|
||||||
|
| 'put' | 'PUT'
|
||||||
|
| 'patch' | 'PATCH'
|
||||||
|
| 'purge' | 'PURGE'
|
||||||
|
| 'link' | 'LINK'
|
||||||
|
| 'unlink' | 'UNLINK';
|
||||||
|
|
||||||
|
export type ResponseType =
|
||||||
|
| 'arraybuffer'
|
||||||
|
| 'blob'
|
||||||
|
| 'document'
|
||||||
|
| 'json'
|
||||||
|
| 'text'
|
||||||
|
| 'stream';
|
||||||
|
|
||||||
|
export type responseEncoding =
|
||||||
|
| 'ascii' | 'ASCII'
|
||||||
|
| 'ansi' | 'ANSI'
|
||||||
|
| 'binary' | 'BINARY'
|
||||||
|
| 'base64' | 'BASE64'
|
||||||
|
| 'base64url' | 'BASE64URL'
|
||||||
|
| 'hex' | 'HEX'
|
||||||
|
| 'latin1' | 'LATIN1'
|
||||||
|
| 'ucs-2' | 'UCS-2'
|
||||||
|
| 'ucs2' | 'UCS2'
|
||||||
|
| 'utf-8' | 'UTF-8'
|
||||||
|
| 'utf8' | 'UTF8'
|
||||||
|
| 'utf16le' | 'UTF16LE';
|
||||||
|
|
||||||
|
export interface TransitionalOptions {
|
||||||
|
silentJSONParsing?: boolean;
|
||||||
|
forcedJSONParsing?: boolean;
|
||||||
|
clarifyTimeoutError?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GenericAbortSignal {
|
||||||
|
readonly aborted: boolean;
|
||||||
|
onabort?: ((...args: any) => any) | null;
|
||||||
|
addEventListener?: (...args: any) => any;
|
||||||
|
removeEventListener?: (...args: any) => any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FormDataVisitorHelpers {
|
||||||
|
defaultVisitor: SerializerVisitor;
|
||||||
|
convertValue: (value: any) => any;
|
||||||
|
isVisitable: (value: any) => boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SerializerVisitor {
|
||||||
|
(
|
||||||
|
this: GenericFormData,
|
||||||
|
value: any,
|
||||||
|
key: string | number,
|
||||||
|
path: null | Array<string | number>,
|
||||||
|
helpers: FormDataVisitorHelpers
|
||||||
|
): boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SerializerOptions {
|
||||||
|
visitor?: SerializerVisitor;
|
||||||
|
dots?: boolean;
|
||||||
|
metaTokens?: boolean;
|
||||||
|
indexes?: boolean | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// tslint:disable-next-line
|
||||||
|
export interface FormSerializerOptions extends SerializerOptions {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ParamEncoder {
|
||||||
|
(value: any, defaultEncoder: (value: any) => any): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CustomParamsSerializer {
|
||||||
|
(params: Record<string, any>, options?: ParamsSerializerOptions): string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ParamsSerializerOptions extends SerializerOptions {
|
||||||
|
encode?: ParamEncoder;
|
||||||
|
serialize?: CustomParamsSerializer;
|
||||||
|
}
|
||||||
|
|
||||||
|
type MaxUploadRate = number;
|
||||||
|
|
||||||
|
type MaxDownloadRate = number;
|
||||||
|
|
||||||
|
type BrowserProgressEvent = any;
|
||||||
|
|
||||||
|
export interface AxiosProgressEvent {
|
||||||
|
loaded: number;
|
||||||
|
total?: number;
|
||||||
|
progress?: number;
|
||||||
|
bytes: number;
|
||||||
|
rate?: number;
|
||||||
|
estimated?: number;
|
||||||
|
upload?: boolean;
|
||||||
|
download?: boolean;
|
||||||
|
event?: BrowserProgressEvent;
|
||||||
|
}
|
||||||
|
|
||||||
|
type Milliseconds = number;
|
||||||
|
|
||||||
|
type AxiosAdapterName = 'xhr' | 'http' | string;
|
||||||
|
|
||||||
|
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
|
||||||
|
|
||||||
|
export type AddressFamily = 4 | 6 | undefined;
|
||||||
|
|
||||||
|
export interface LookupAddressEntry {
|
||||||
|
address: string;
|
||||||
|
family?: AddressFamily;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type LookupAddress = string | LookupAddressEntry;
|
||||||
|
|
||||||
|
export interface AxiosRequestConfig<D = any> {
|
||||||
|
url?: string;
|
||||||
|
method?: Method | string;
|
||||||
|
baseURL?: string;
|
||||||
|
transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
|
||||||
|
transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
|
||||||
|
headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders;
|
||||||
|
params?: any;
|
||||||
|
paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
|
||||||
|
data?: D;
|
||||||
|
timeout?: Milliseconds;
|
||||||
|
timeoutErrorMessage?: string;
|
||||||
|
withCredentials?: boolean;
|
||||||
|
adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
|
||||||
|
auth?: AxiosBasicCredentials;
|
||||||
|
responseType?: ResponseType;
|
||||||
|
responseEncoding?: responseEncoding | string;
|
||||||
|
xsrfCookieName?: string;
|
||||||
|
xsrfHeaderName?: string;
|
||||||
|
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
|
||||||
|
onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void;
|
||||||
|
maxContentLength?: number;
|
||||||
|
validateStatus?: ((status: number) => boolean) | null;
|
||||||
|
maxBodyLength?: number;
|
||||||
|
maxRedirects?: number;
|
||||||
|
maxRate?: number | [MaxUploadRate, MaxDownloadRate];
|
||||||
|
beforeRedirect?: (options: Record<string, any>, responseDetails: {headers: Record<string, string>, statusCode: HttpStatusCode}) => void;
|
||||||
|
socketPath?: string | null;
|
||||||
|
transport?: any;
|
||||||
|
httpAgent?: any;
|
||||||
|
httpsAgent?: any;
|
||||||
|
proxy?: AxiosProxyConfig | false;
|
||||||
|
cancelToken?: CancelToken;
|
||||||
|
decompress?: boolean;
|
||||||
|
transitional?: TransitionalOptions;
|
||||||
|
signal?: GenericAbortSignal;
|
||||||
|
insecureHTTPParser?: boolean;
|
||||||
|
env?: {
|
||||||
|
FormData?: new (...args: any[]) => object;
|
||||||
|
};
|
||||||
|
formSerializer?: FormSerializerOptions;
|
||||||
|
family?: AddressFamily;
|
||||||
|
lookup?: ((hostname: string, options: object, cb: (err: Error | null, address: LookupAddress | LookupAddress[], family?: AddressFamily) => void) => void) |
|
||||||
|
((hostname: string, options: object) => Promise<[address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress>);
|
||||||
|
withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Alias
|
||||||
|
export type RawAxiosRequestConfig<D = any> = AxiosRequestConfig<D>;
|
||||||
|
|
||||||
|
export interface InternalAxiosRequestConfig<D = any> extends AxiosRequestConfig<D> {
|
||||||
|
headers: AxiosRequestHeaders;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HeadersDefaults {
|
||||||
|
common: RawAxiosRequestHeaders;
|
||||||
|
delete: RawAxiosRequestHeaders;
|
||||||
|
get: RawAxiosRequestHeaders;
|
||||||
|
head: RawAxiosRequestHeaders;
|
||||||
|
post: RawAxiosRequestHeaders;
|
||||||
|
put: RawAxiosRequestHeaders;
|
||||||
|
patch: RawAxiosRequestHeaders;
|
||||||
|
options?: RawAxiosRequestHeaders;
|
||||||
|
purge?: RawAxiosRequestHeaders;
|
||||||
|
link?: RawAxiosRequestHeaders;
|
||||||
|
unlink?: RawAxiosRequestHeaders;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
||||||
|
headers: HeadersDefaults;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateAxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
|
||||||
|
headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial<HeadersDefaults>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AxiosResponse<T = any, D = any> {
|
||||||
|
data: T;
|
||||||
|
status: number;
|
||||||
|
statusText: string;
|
||||||
|
headers: RawAxiosResponseHeaders | AxiosResponseHeaders;
|
||||||
|
config: InternalAxiosRequestConfig<D>;
|
||||||
|
request?: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class AxiosError<T = unknown, D = any> extends Error {
|
||||||
|
constructor(
|
||||||
|
message?: string,
|
||||||
|
code?: string,
|
||||||
|
config?: InternalAxiosRequestConfig<D>,
|
||||||
|
request?: any,
|
||||||
|
response?: AxiosResponse<T, D>
|
||||||
|
);
|
||||||
|
|
||||||
|
config?: InternalAxiosRequestConfig<D>;
|
||||||
|
code?: string;
|
||||||
|
request?: any;
|
||||||
|
response?: AxiosResponse<T, D>;
|
||||||
|
isAxiosError: boolean;
|
||||||
|
status?: number;
|
||||||
|
toJSON: () => object;
|
||||||
|
cause?: Error;
|
||||||
|
static from<T = unknown, D = any>(
|
||||||
|
error: Error | unknown,
|
||||||
|
code?: string,
|
||||||
|
config?: InternalAxiosRequestConfig<D>,
|
||||||
|
request?: any,
|
||||||
|
response?: AxiosResponse<T, D>,
|
||||||
|
customProps?: object,
|
||||||
|
): AxiosError<T, D>;
|
||||||
|
static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
||||||
|
static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
||||||
|
static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
||||||
|
static readonly ERR_NETWORK = "ERR_NETWORK";
|
||||||
|
static readonly ERR_DEPRECATED = "ERR_DEPRECATED";
|
||||||
|
static readonly ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
||||||
|
static readonly ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
||||||
|
static readonly ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
||||||
|
static readonly ERR_INVALID_URL = "ERR_INVALID_URL";
|
||||||
|
static readonly ERR_CANCELED = "ERR_CANCELED";
|
||||||
|
static readonly ECONNABORTED = "ECONNABORTED";
|
||||||
|
static readonly ETIMEDOUT = "ETIMEDOUT";
|
||||||
|
}
|
||||||
|
|
||||||
|
export class CanceledError<T> extends AxiosError<T> {
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AxiosPromise<T = any> = Promise<AxiosResponse<T>>;
|
||||||
|
|
||||||
|
export interface CancelStatic {
|
||||||
|
new (message?: string): Cancel;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Cancel {
|
||||||
|
message: string | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Canceler {
|
||||||
|
(message?: string, config?: AxiosRequestConfig, request?: any): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CancelTokenStatic {
|
||||||
|
new (executor: (cancel: Canceler) => void): CancelToken;
|
||||||
|
source(): CancelTokenSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CancelToken {
|
||||||
|
promise: Promise<Cancel>;
|
||||||
|
reason?: Cancel;
|
||||||
|
throwIfRequested(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CancelTokenSource {
|
||||||
|
token: CancelToken;
|
||||||
|
cancel: Canceler;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AxiosInterceptorOptions {
|
||||||
|
synchronous?: boolean;
|
||||||
|
runWhen?: (config: InternalAxiosRequestConfig) => boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AxiosInterceptorManager<V> {
|
||||||
|
use(onFulfilled?: ((value: V) => V | Promise<V>) | null, onRejected?: ((error: any) => any) | null, options?: AxiosInterceptorOptions): number;
|
||||||
|
eject(id: number): void;
|
||||||
|
clear(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Axios {
|
||||||
|
constructor(config?: AxiosRequestConfig);
|
||||||
|
defaults: AxiosDefaults;
|
||||||
|
interceptors: {
|
||||||
|
request: AxiosInterceptorManager<InternalAxiosRequestConfig>;
|
||||||
|
response: AxiosInterceptorManager<AxiosResponse>;
|
||||||
|
};
|
||||||
|
getUri(config?: AxiosRequestConfig): string;
|
||||||
|
request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
get<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
delete<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
head<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
options<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
post<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
put<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
patch<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
postForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
putForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
patchForm<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AxiosInstance extends Axios {
|
||||||
|
<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
|
||||||
|
|
||||||
|
defaults: Omit<AxiosDefaults, 'headers'> & {
|
||||||
|
headers: HeadersDefaults & {
|
||||||
|
[key: string]: AxiosHeaderValue
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GenericFormData {
|
||||||
|
append(name: string, value: any, options?: any): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GenericHTMLFormElement {
|
||||||
|
name: string;
|
||||||
|
method: string;
|
||||||
|
submit(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getAdapter(adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined): AxiosAdapter;
|
||||||
|
|
||||||
|
export function toFormData(sourceObj: object, targetFormData?: GenericFormData, options?: FormSerializerOptions): GenericFormData;
|
||||||
|
|
||||||
|
export function formToJSON(form: GenericFormData|GenericHTMLFormElement): object;
|
||||||
|
|
||||||
|
export function isAxiosError<T = any, D = any>(payload: any): payload is AxiosError<T, D>;
|
||||||
|
|
||||||
|
export function spread<T, R>(callback: (...args: T[]) => R): (array: T[]) => R;
|
||||||
|
|
||||||
|
export function isCancel(value: any): value is Cancel;
|
||||||
|
|
||||||
|
export function all<T>(values: Array<T | Promise<T>>): Promise<T[]>;
|
||||||
|
|
||||||
|
export interface AxiosStatic extends AxiosInstance {
|
||||||
|
create(config?: CreateAxiosDefaults): AxiosInstance;
|
||||||
|
Cancel: CancelStatic;
|
||||||
|
CancelToken: CancelTokenStatic;
|
||||||
|
Axios: typeof Axios;
|
||||||
|
AxiosError: typeof AxiosError;
|
||||||
|
HttpStatusCode: typeof HttpStatusCode;
|
||||||
|
readonly VERSION: string;
|
||||||
|
isCancel: typeof isCancel;
|
||||||
|
all: typeof all;
|
||||||
|
spread: typeof spread;
|
||||||
|
isAxiosError: typeof isAxiosError;
|
||||||
|
toFormData: typeof toFormData;
|
||||||
|
formToJSON: typeof formToJSON;
|
||||||
|
getAdapter: typeof getAdapter;
|
||||||
|
CanceledError: typeof CanceledError;
|
||||||
|
AxiosHeaders: typeof AxiosHeaders;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare const axios: AxiosStatic;
|
||||||
|
|
||||||
|
export default axios;
|
||||||
43
node_modules/axios/index.js
generated
vendored
Normal file
43
node_modules/axios/index.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import axios from './lib/axios.js';
|
||||||
|
|
||||||
|
// This module is intended to unwrap Axios default export as named.
|
||||||
|
// Keep top-level export same with static properties
|
||||||
|
// so that it can keep same with es module or cjs
|
||||||
|
const {
|
||||||
|
Axios,
|
||||||
|
AxiosError,
|
||||||
|
CanceledError,
|
||||||
|
isCancel,
|
||||||
|
CancelToken,
|
||||||
|
VERSION,
|
||||||
|
all,
|
||||||
|
Cancel,
|
||||||
|
isAxiosError,
|
||||||
|
spread,
|
||||||
|
toFormData,
|
||||||
|
AxiosHeaders,
|
||||||
|
HttpStatusCode,
|
||||||
|
formToJSON,
|
||||||
|
getAdapter,
|
||||||
|
mergeConfig
|
||||||
|
} = axios;
|
||||||
|
|
||||||
|
export {
|
||||||
|
axios as default,
|
||||||
|
Axios,
|
||||||
|
AxiosError,
|
||||||
|
CanceledError,
|
||||||
|
isCancel,
|
||||||
|
CancelToken,
|
||||||
|
VERSION,
|
||||||
|
all,
|
||||||
|
Cancel,
|
||||||
|
isAxiosError,
|
||||||
|
spread,
|
||||||
|
toFormData,
|
||||||
|
AxiosHeaders,
|
||||||
|
HttpStatusCode,
|
||||||
|
formToJSON,
|
||||||
|
getAdapter,
|
||||||
|
mergeConfig
|
||||||
|
}
|
||||||
218
node_modules/axios/package.json
generated
vendored
Normal file
218
node_modules/axios/package.json
generated
vendored
Normal file
@@ -0,0 +1,218 @@
|
|||||||
|
{
|
||||||
|
"name": "axios",
|
||||||
|
"version": "1.6.8",
|
||||||
|
"description": "Promise based HTTP client for the browser and node.js",
|
||||||
|
"main": "index.js",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"types": {
|
||||||
|
"require": "./index.d.cts",
|
||||||
|
"default": "./index.d.ts"
|
||||||
|
},
|
||||||
|
"browser": {
|
||||||
|
"require": "./dist/browser/axios.cjs",
|
||||||
|
"default": "./index.js"
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"require": "./dist/node/axios.cjs",
|
||||||
|
"default": "./index.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"./lib/adapters/http.js": "./lib/adapters/http.js",
|
||||||
|
"./lib/adapters/xhr.js": "./lib/adapters/xhr.js",
|
||||||
|
"./unsafe/*": "./lib/*",
|
||||||
|
"./unsafe/core/settle.js": "./lib/core/settle.js",
|
||||||
|
"./unsafe/core/buildFullPath.js": "./lib/core/buildFullPath.js",
|
||||||
|
"./unsafe/helpers/isAbsoluteURL.js": "./lib/helpers/isAbsoluteURL.js",
|
||||||
|
"./unsafe/helpers/buildURL.js": "./lib/helpers/buildURL.js",
|
||||||
|
"./unsafe/helpers/combineURLs.js": "./lib/helpers/combineURLs.js",
|
||||||
|
"./unsafe/adapters/http.js": "./lib/adapters/http.js",
|
||||||
|
"./unsafe/adapters/xhr.js": "./lib/adapters/xhr.js",
|
||||||
|
"./unsafe/utils.js": "./lib/utils.js",
|
||||||
|
"./package.json": "./package.json"
|
||||||
|
},
|
||||||
|
"type": "module",
|
||||||
|
"types": "index.d.ts",
|
||||||
|
"scripts": {
|
||||||
|
"test": "npm run test:eslint && npm run test:mocha && npm run test:karma && npm run test:dtslint && npm run test:exports",
|
||||||
|
"test:eslint": "node bin/ssl_hotfix.js eslint lib/**/*.js",
|
||||||
|
"test:dtslint": "dtslint --localTs node_modules/typescript/lib",
|
||||||
|
"test:mocha": "node bin/ssl_hotfix.js mocha test/unit/**/*.js --timeout 30000 --exit",
|
||||||
|
"test:exports": "node bin/ssl_hotfix.js mocha test/module/test.js --timeout 30000 --exit",
|
||||||
|
"test:karma": "node bin/ssl_hotfix.js cross-env LISTEN_ADDR=:: karma start karma.conf.cjs --single-run",
|
||||||
|
"test:karma:firefox": "node bin/ssl_hotfix.js cross-env LISTEN_ADDR=:: Browsers=Firefox karma start karma.conf.cjs --single-run",
|
||||||
|
"test:karma:server": "node bin/ssl_hotfix.js cross-env karma start karma.conf.cjs",
|
||||||
|
"test:build:version": "node ./bin/check-build-version.js",
|
||||||
|
"start": "node ./sandbox/server.js",
|
||||||
|
"preversion": "gulp version",
|
||||||
|
"version": "npm run build && git add dist && git add package.json",
|
||||||
|
"prepublishOnly": "npm run test:build:version",
|
||||||
|
"postpublish": "git push && git push --tags",
|
||||||
|
"build": "gulp clear && cross-env NODE_ENV=production rollup -c -m",
|
||||||
|
"examples": "node ./examples/server.js",
|
||||||
|
"coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
|
||||||
|
"fix": "eslint --fix lib/**/*.js",
|
||||||
|
"prepare": "husky install && npm run prepare:hooks",
|
||||||
|
"prepare:hooks": "npx husky set .husky/commit-msg \"npx commitlint --edit $1\"",
|
||||||
|
"release:dry": "release-it --dry-run --no-npm",
|
||||||
|
"release:info": "release-it --release-version",
|
||||||
|
"release:beta:no-npm": "release-it --preRelease=beta --no-npm",
|
||||||
|
"release:beta": "release-it --preRelease=beta",
|
||||||
|
"release:no-npm": "release-it --no-npm",
|
||||||
|
"release:changelog:fix": "node ./bin/injectContributorsList.js && git add CHANGELOG.md",
|
||||||
|
"release": "release-it"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/axios/axios.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"xhr",
|
||||||
|
"http",
|
||||||
|
"ajax",
|
||||||
|
"promise",
|
||||||
|
"node"
|
||||||
|
],
|
||||||
|
"author": "Matt Zabriskie",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/axios/axios/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://axios-http.com",
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.23.9",
|
||||||
|
"@babel/preset-env": "^7.23.9",
|
||||||
|
"@commitlint/cli": "^17.8.1",
|
||||||
|
"@commitlint/config-conventional": "^17.8.1",
|
||||||
|
"@release-it/conventional-changelog": "^5.1.1",
|
||||||
|
"@rollup/plugin-babel": "^5.3.1",
|
||||||
|
"@rollup/plugin-commonjs": "^15.1.0",
|
||||||
|
"@rollup/plugin-json": "^4.1.0",
|
||||||
|
"@rollup/plugin-multi-entry": "^4.1.0",
|
||||||
|
"@rollup/plugin-node-resolve": "^9.0.0",
|
||||||
|
"abortcontroller-polyfill": "^1.7.5",
|
||||||
|
"auto-changelog": "^2.4.0",
|
||||||
|
"body-parser": "^1.20.2",
|
||||||
|
"chalk": "^5.3.0",
|
||||||
|
"coveralls": "^3.1.1",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
|
"dev-null": "^0.1.1",
|
||||||
|
"dtslint": "^4.2.1",
|
||||||
|
"es6-promise": "^4.2.8",
|
||||||
|
"eslint": "^8.56.0",
|
||||||
|
"express": "^4.18.2",
|
||||||
|
"formdata-node": "^5.0.1",
|
||||||
|
"formidable": "^2.1.2",
|
||||||
|
"fs-extra": "^10.1.0",
|
||||||
|
"get-stream": "^3.0.0",
|
||||||
|
"gulp": "^4.0.2",
|
||||||
|
"gzip-size": "^7.0.0",
|
||||||
|
"handlebars": "^4.7.8",
|
||||||
|
"husky": "^8.0.3",
|
||||||
|
"istanbul-instrumenter-loader": "^3.0.1",
|
||||||
|
"jasmine-core": "^2.99.1",
|
||||||
|
"karma": "^6.3.17",
|
||||||
|
"karma-chrome-launcher": "^3.2.0",
|
||||||
|
"karma-firefox-launcher": "^2.1.2",
|
||||||
|
"karma-jasmine": "^1.1.2",
|
||||||
|
"karma-jasmine-ajax": "^0.1.13",
|
||||||
|
"karma-rollup-preprocessor": "^7.0.8",
|
||||||
|
"karma-safari-launcher": "^1.0.0",
|
||||||
|
"karma-sauce-launcher": "^4.3.6",
|
||||||
|
"karma-sinon": "^1.0.5",
|
||||||
|
"karma-sourcemap-loader": "^0.3.8",
|
||||||
|
"memoizee": "^0.4.15",
|
||||||
|
"minimist": "^1.2.8",
|
||||||
|
"mocha": "^10.3.0",
|
||||||
|
"multer": "^1.4.4",
|
||||||
|
"pretty-bytes": "^6.1.1",
|
||||||
|
"release-it": "^15.11.0",
|
||||||
|
"rollup": "^2.79.1",
|
||||||
|
"rollup-plugin-auto-external": "^2.0.0",
|
||||||
|
"rollup-plugin-bundle-size": "^1.0.3",
|
||||||
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
|
"sinon": "^4.5.0",
|
||||||
|
"stream-throttle": "^0.1.3",
|
||||||
|
"string-replace-async": "^3.0.2",
|
||||||
|
"terser-webpack-plugin": "^4.2.3",
|
||||||
|
"typescript": "^4.9.5"
|
||||||
|
},
|
||||||
|
"browser": {
|
||||||
|
"./lib/adapters/http.js": "./lib/helpers/null.js",
|
||||||
|
"./lib/platform/node/index.js": "./lib/platform/browser/index.js",
|
||||||
|
"./lib/platform/node/classes/FormData.js": "./lib/helpers/null.js"
|
||||||
|
},
|
||||||
|
"jsdelivr": "dist/axios.min.js",
|
||||||
|
"unpkg": "dist/axios.min.js",
|
||||||
|
"typings": "./index.d.ts",
|
||||||
|
"dependencies": {
|
||||||
|
"follow-redirects": "^1.15.6",
|
||||||
|
"form-data": "^4.0.0",
|
||||||
|
"proxy-from-env": "^1.1.0"
|
||||||
|
},
|
||||||
|
"bundlesize": [
|
||||||
|
{
|
||||||
|
"path": "./dist/axios.min.js",
|
||||||
|
"threshold": "5kB"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"contributors": [
|
||||||
|
"Matt Zabriskie (https://github.com/mzabriskie)",
|
||||||
|
"Nick Uraltsev (https://github.com/nickuraltsev)",
|
||||||
|
"Jay (https://github.com/jasonsaayman)",
|
||||||
|
"Dmitriy Mozgovoy (https://github.com/DigitalBrainJS)",
|
||||||
|
"Emily Morehouse (https://github.com/emilyemorehouse)",
|
||||||
|
"Rubén Norte (https://github.com/rubennorte)",
|
||||||
|
"Justin Beckwith (https://github.com/JustinBeckwith)",
|
||||||
|
"Martti Laine (https://github.com/codeclown)",
|
||||||
|
"Xianming Zhong (https://github.com/chinesedfan)",
|
||||||
|
"Rikki Gibson (https://github.com/RikkiGibson)",
|
||||||
|
"Remco Haszing (https://github.com/remcohaszing)",
|
||||||
|
"Yasu Flores (https://github.com/yasuf)",
|
||||||
|
"Ben Carp (https://github.com/carpben)"
|
||||||
|
],
|
||||||
|
"sideEffects": false,
|
||||||
|
"release-it": {
|
||||||
|
"git": {
|
||||||
|
"commitMessage": "chore(release): v${version}",
|
||||||
|
"push": true,
|
||||||
|
"commit": true,
|
||||||
|
"tag": true,
|
||||||
|
"requireCommits": false,
|
||||||
|
"requireCleanWorkingDir": false
|
||||||
|
},
|
||||||
|
"github": {
|
||||||
|
"release": true,
|
||||||
|
"draft": true
|
||||||
|
},
|
||||||
|
"npm": {
|
||||||
|
"publish": false,
|
||||||
|
"ignoreVersion": false
|
||||||
|
},
|
||||||
|
"plugins": {
|
||||||
|
"@release-it/conventional-changelog": {
|
||||||
|
"preset": "angular",
|
||||||
|
"infile": "CHANGELOG.md",
|
||||||
|
"header": "# Changelog"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"hooks": {
|
||||||
|
"before:init": "npm test",
|
||||||
|
"after:bump": "gulp version --bump ${version} && npm run build && npm run test:build:version && git add ./dist && git add ./package-lock.json",
|
||||||
|
"before:release": "npm run release:changelog:fix",
|
||||||
|
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commitlint": {
|
||||||
|
"rules": {
|
||||||
|
"header-max-length": [
|
||||||
|
2,
|
||||||
|
"always",
|
||||||
|
130
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"@commitlint/config-conventional"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
19
node_modules/combined-stream/License
generated
vendored
Normal file
19
node_modules/combined-stream/License
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2011 Debuggable Limited <felix@debuggable.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.
|
||||||
138
node_modules/combined-stream/Readme.md
generated
vendored
Normal file
138
node_modules/combined-stream/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
# combined-stream
|
||||||
|
|
||||||
|
A stream that emits multiple other streams one after another.
|
||||||
|
|
||||||
|
**NB** Currently `combined-stream` works with streams version 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatibility with `combined-stream`.
|
||||||
|
|
||||||
|
- [combined-stream2](https://www.npmjs.com/package/combined-stream2): A drop-in streams2-compatible replacement for the combined-stream module.
|
||||||
|
|
||||||
|
- [multistream](https://www.npmjs.com/package/multistream): A stream that emits multiple other streams one after another.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
npm install combined-stream
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Here is a simple example that shows how you can use combined-stream to combine
|
||||||
|
two files into one:
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
var CombinedStream = require('combined-stream');
|
||||||
|
var fs = require('fs');
|
||||||
|
|
||||||
|
var combinedStream = CombinedStream.create();
|
||||||
|
combinedStream.append(fs.createReadStream('file1.txt'));
|
||||||
|
combinedStream.append(fs.createReadStream('file2.txt'));
|
||||||
|
|
||||||
|
combinedStream.pipe(fs.createWriteStream('combined.txt'));
|
||||||
|
```
|
||||||
|
|
||||||
|
While the example above works great, it will pause all source streams until
|
||||||
|
they are needed. If you don't want that to happen, you can set `pauseStreams`
|
||||||
|
to `false`:
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
var CombinedStream = require('combined-stream');
|
||||||
|
var fs = require('fs');
|
||||||
|
|
||||||
|
var combinedStream = CombinedStream.create({pauseStreams: false});
|
||||||
|
combinedStream.append(fs.createReadStream('file1.txt'));
|
||||||
|
combinedStream.append(fs.createReadStream('file2.txt'));
|
||||||
|
|
||||||
|
combinedStream.pipe(fs.createWriteStream('combined.txt'));
|
||||||
|
```
|
||||||
|
|
||||||
|
However, what if you don't have all the source streams yet, or you don't want
|
||||||
|
to allocate the resources (file descriptors, memory, etc.) for them right away?
|
||||||
|
Well, in that case you can simply provide a callback that supplies the stream
|
||||||
|
by calling a `next()` function:
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
var CombinedStream = require('combined-stream');
|
||||||
|
var fs = require('fs');
|
||||||
|
|
||||||
|
var combinedStream = CombinedStream.create();
|
||||||
|
combinedStream.append(function(next) {
|
||||||
|
next(fs.createReadStream('file1.txt'));
|
||||||
|
});
|
||||||
|
combinedStream.append(function(next) {
|
||||||
|
next(fs.createReadStream('file2.txt'));
|
||||||
|
});
|
||||||
|
|
||||||
|
combinedStream.pipe(fs.createWriteStream('combined.txt'));
|
||||||
|
```
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
### CombinedStream.create([options])
|
||||||
|
|
||||||
|
Returns a new combined stream object. Available options are:
|
||||||
|
|
||||||
|
* `maxDataSize`
|
||||||
|
* `pauseStreams`
|
||||||
|
|
||||||
|
The effect of those options is described below.
|
||||||
|
|
||||||
|
### combinedStream.pauseStreams = `true`
|
||||||
|
|
||||||
|
Whether to apply back pressure to the underlaying streams. If set to `false`,
|
||||||
|
the underlaying streams will never be paused. If set to `true`, the
|
||||||
|
underlaying streams will be paused right after being appended, as well as when
|
||||||
|
`delayedStream.pipe()` wants to throttle.
|
||||||
|
|
||||||
|
### combinedStream.maxDataSize = `2 * 1024 * 1024`
|
||||||
|
|
||||||
|
The maximum amount of bytes (or characters) to buffer for all source streams.
|
||||||
|
If this value is exceeded, `combinedStream` emits an `'error'` event.
|
||||||
|
|
||||||
|
### combinedStream.dataSize = `0`
|
||||||
|
|
||||||
|
The amount of bytes (or characters) currently buffered by `combinedStream`.
|
||||||
|
|
||||||
|
### combinedStream.append(stream)
|
||||||
|
|
||||||
|
Appends the given `stream` to the combinedStream object. If `pauseStreams` is
|
||||||
|
set to `true, this stream will also be paused right away.
|
||||||
|
|
||||||
|
`streams` can also be a function that takes one parameter called `next`. `next`
|
||||||
|
is a function that must be invoked in order to provide the `next` stream, see
|
||||||
|
example above.
|
||||||
|
|
||||||
|
Regardless of how the `stream` is appended, combined-stream always attaches an
|
||||||
|
`'error'` listener to it, so you don't have to do that manually.
|
||||||
|
|
||||||
|
Special case: `stream` can also be a String or Buffer.
|
||||||
|
|
||||||
|
### combinedStream.write(data)
|
||||||
|
|
||||||
|
You should not call this, `combinedStream` takes care of piping the appended
|
||||||
|
streams into itself for you.
|
||||||
|
|
||||||
|
### combinedStream.resume()
|
||||||
|
|
||||||
|
Causes `combinedStream` to start drain the streams it manages. The function is
|
||||||
|
idempotent, and also emits a `'resume'` event each time which usually goes to
|
||||||
|
the stream that is currently being drained.
|
||||||
|
|
||||||
|
### combinedStream.pause();
|
||||||
|
|
||||||
|
If `combinedStream.pauseStreams` is set to `false`, this does nothing.
|
||||||
|
Otherwise a `'pause'` event is emitted, this goes to the stream that is
|
||||||
|
currently being drained, so you can use it to apply back pressure.
|
||||||
|
|
||||||
|
### combinedStream.end();
|
||||||
|
|
||||||
|
Sets `combinedStream.writable` to false, emits an `'end'` event, and removes
|
||||||
|
all streams from the queue.
|
||||||
|
|
||||||
|
### combinedStream.destroy();
|
||||||
|
|
||||||
|
Same as `combinedStream.end()`, except it emits a `'close'` event instead of
|
||||||
|
`'end'`.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
combined-stream is licensed under the MIT license.
|
||||||
25
node_modules/combined-stream/package.json
generated
vendored
Normal file
25
node_modules/combined-stream/package.json
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"author": "Felix Geisendörfer <felix@debuggable.com> (http://debuggable.com/)",
|
||||||
|
"name": "combined-stream",
|
||||||
|
"description": "A stream that emits multiple other streams one after another.",
|
||||||
|
"version": "1.0.8",
|
||||||
|
"homepage": "https://github.com/felixge/node-combined-stream",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/felixge/node-combined-stream.git"
|
||||||
|
},
|
||||||
|
"main": "./lib/combined_stream",
|
||||||
|
"scripts": {
|
||||||
|
"test": "node test/run.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"delayed-stream": "~1.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"far": "~0.0.7"
|
||||||
|
},
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
||||||
17
node_modules/combined-stream/yarn.lock
generated
vendored
Normal file
17
node_modules/combined-stream/yarn.lock
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||||
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
|
delayed-stream@~1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
|
||||||
|
|
||||||
|
far@~0.0.7:
|
||||||
|
version "0.0.7"
|
||||||
|
resolved "https://registry.yarnpkg.com/far/-/far-0.0.7.tgz#01c1fd362bcd26ce9cf161af3938aa34619f79a7"
|
||||||
|
dependencies:
|
||||||
|
oop "0.0.3"
|
||||||
|
|
||||||
|
oop@0.0.3:
|
||||||
|
version "0.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/oop/-/oop-0.0.3.tgz#70fa405a5650891a194fdc82ca68dad6dabf4401"
|
||||||
1
node_modules/delayed-stream/.npmignore
generated
vendored
Normal file
1
node_modules/delayed-stream/.npmignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
test
|
||||||
19
node_modules/delayed-stream/License
generated
vendored
Normal file
19
node_modules/delayed-stream/License
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2011 Debuggable Limited <felix@debuggable.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.
|
||||||
7
node_modules/delayed-stream/Makefile
generated
vendored
Normal file
7
node_modules/delayed-stream/Makefile
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
SHELL := /bin/bash
|
||||||
|
|
||||||
|
test:
|
||||||
|
@./test/run.js
|
||||||
|
|
||||||
|
.PHONY: test
|
||||||
|
|
||||||
141
node_modules/delayed-stream/Readme.md
generated
vendored
Normal file
141
node_modules/delayed-stream/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
# delayed-stream
|
||||||
|
|
||||||
|
Buffers events from a stream until you are ready to handle them.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
npm install delayed-stream
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
The following example shows how to write a http echo server that delays its
|
||||||
|
response by 1000 ms.
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
var DelayedStream = require('delayed-stream');
|
||||||
|
var http = require('http');
|
||||||
|
|
||||||
|
http.createServer(function(req, res) {
|
||||||
|
var delayed = DelayedStream.create(req);
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
res.writeHead(200);
|
||||||
|
delayed.pipe(res);
|
||||||
|
}, 1000);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
If you are not using `Stream#pipe`, you can also manually release the buffered
|
||||||
|
events by calling `delayedStream.resume()`:
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
var delayed = DelayedStream.create(req);
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
// Emit all buffered events and resume underlaying source
|
||||||
|
delayed.resume();
|
||||||
|
}, 1000);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Implementation
|
||||||
|
|
||||||
|
In order to use this meta stream properly, here are a few things you should
|
||||||
|
know about the implementation.
|
||||||
|
|
||||||
|
### Event Buffering / Proxying
|
||||||
|
|
||||||
|
All events of the `source` stream are hijacked by overwriting the `source.emit`
|
||||||
|
method. Until node implements a catch-all event listener, this is the only way.
|
||||||
|
|
||||||
|
However, delayed-stream still continues to emit all events it captures on the
|
||||||
|
`source`, regardless of whether you have released the delayed stream yet or
|
||||||
|
not.
|
||||||
|
|
||||||
|
Upon creation, delayed-stream captures all `source` events and stores them in
|
||||||
|
an internal event buffer. Once `delayedStream.release()` is called, all
|
||||||
|
buffered events are emitted on the `delayedStream`, and the event buffer is
|
||||||
|
cleared. After that, delayed-stream merely acts as a proxy for the underlaying
|
||||||
|
source.
|
||||||
|
|
||||||
|
### Error handling
|
||||||
|
|
||||||
|
Error events on `source` are buffered / proxied just like any other events.
|
||||||
|
However, `delayedStream.create` attaches a no-op `'error'` listener to the
|
||||||
|
`source`. This way you only have to handle errors on the `delayedStream`
|
||||||
|
object, rather than in two places.
|
||||||
|
|
||||||
|
### Buffer limits
|
||||||
|
|
||||||
|
delayed-stream provides a `maxDataSize` property that can be used to limit
|
||||||
|
the amount of data being buffered. In order to protect you from bad `source`
|
||||||
|
streams that don't react to `source.pause()`, this feature is enabled by
|
||||||
|
default.
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
### DelayedStream.create(source, [options])
|
||||||
|
|
||||||
|
Returns a new `delayedStream`. Available options are:
|
||||||
|
|
||||||
|
* `pauseStream`
|
||||||
|
* `maxDataSize`
|
||||||
|
|
||||||
|
The description for those properties can be found below.
|
||||||
|
|
||||||
|
### delayedStream.source
|
||||||
|
|
||||||
|
The `source` stream managed by this object. This is useful if you are
|
||||||
|
passing your `delayedStream` around, and you still want to access properties
|
||||||
|
on the `source` object.
|
||||||
|
|
||||||
|
### delayedStream.pauseStream = true
|
||||||
|
|
||||||
|
Whether to pause the underlaying `source` when calling
|
||||||
|
`DelayedStream.create()`. Modifying this property afterwards has no effect.
|
||||||
|
|
||||||
|
### delayedStream.maxDataSize = 1024 * 1024
|
||||||
|
|
||||||
|
The amount of data to buffer before emitting an `error`.
|
||||||
|
|
||||||
|
If the underlaying source is emitting `Buffer` objects, the `maxDataSize`
|
||||||
|
refers to bytes.
|
||||||
|
|
||||||
|
If the underlaying source is emitting JavaScript strings, the size refers to
|
||||||
|
characters.
|
||||||
|
|
||||||
|
If you know what you are doing, you can set this property to `Infinity` to
|
||||||
|
disable this feature. You can also modify this property during runtime.
|
||||||
|
|
||||||
|
### delayedStream.dataSize = 0
|
||||||
|
|
||||||
|
The amount of data buffered so far.
|
||||||
|
|
||||||
|
### delayedStream.readable
|
||||||
|
|
||||||
|
An ECMA5 getter that returns the value of `source.readable`.
|
||||||
|
|
||||||
|
### delayedStream.resume()
|
||||||
|
|
||||||
|
If the `delayedStream` has not been released so far, `delayedStream.release()`
|
||||||
|
is called.
|
||||||
|
|
||||||
|
In either case, `source.resume()` is called.
|
||||||
|
|
||||||
|
### delayedStream.pause()
|
||||||
|
|
||||||
|
Calls `source.pause()`.
|
||||||
|
|
||||||
|
### delayedStream.pipe(dest)
|
||||||
|
|
||||||
|
Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.
|
||||||
|
|
||||||
|
### delayedStream.release()
|
||||||
|
|
||||||
|
Emits and clears all events that have been buffered up so far. This does not
|
||||||
|
resume the underlaying source, use `delayedStream.resume()` instead.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
delayed-stream is licensed under the MIT license.
|
||||||
27
node_modules/delayed-stream/package.json
generated
vendored
Normal file
27
node_modules/delayed-stream/package.json
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"author": "Felix Geisendörfer <felix@debuggable.com> (http://debuggable.com/)",
|
||||||
|
"contributors": [
|
||||||
|
"Mike Atkins <apeherder@gmail.com>"
|
||||||
|
],
|
||||||
|
"name": "delayed-stream",
|
||||||
|
"description": "Buffers events from a stream until you are ready to handle them.",
|
||||||
|
"license": "MIT",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"homepage": "https://github.com/felixge/node-delayed-stream",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/felixge/node-delayed-stream.git"
|
||||||
|
},
|
||||||
|
"main": "./lib/delayed_stream",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.4.0"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "make test"
|
||||||
|
},
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"fake": "0.2.0",
|
||||||
|
"far": "0.0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
18
node_modules/follow-redirects/LICENSE
generated
vendored
Normal file
18
node_modules/follow-redirects/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
Copyright 2014–present Olivier Lalonde <olalonde@gmail.com>, James Talmage <james@talmage.io>, Ruben Verborgh
|
||||||
|
|
||||||
|
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.
|
||||||
155
node_modules/follow-redirects/README.md
generated
vendored
Normal file
155
node_modules/follow-redirects/README.md
generated
vendored
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
## Follow Redirects
|
||||||
|
|
||||||
|
Drop-in replacement for Node's `http` and `https` modules that automatically follows redirects.
|
||||||
|
|
||||||
|
[](https://www.npmjs.com/package/follow-redirects)
|
||||||
|
[](https://github.com/follow-redirects/follow-redirects/actions)
|
||||||
|
[](https://coveralls.io/r/follow-redirects/follow-redirects?branch=master)
|
||||||
|
[](https://www.npmjs.com/package/follow-redirects)
|
||||||
|
[](https://github.com/sponsors/RubenVerborgh)
|
||||||
|
|
||||||
|
`follow-redirects` provides [request](https://nodejs.org/api/http.html#http_http_request_options_callback) and [get](https://nodejs.org/api/http.html#http_http_get_options_callback)
|
||||||
|
methods that behave identically to those found on the native [http](https://nodejs.org/api/http.html#http_http_request_options_callback) and [https](https://nodejs.org/api/https.html#https_https_request_options_callback)
|
||||||
|
modules, with the exception that they will seamlessly follow redirects.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const { http, https } = require('follow-redirects');
|
||||||
|
|
||||||
|
http.get('http://bit.ly/900913', response => {
|
||||||
|
response.on('data', chunk => {
|
||||||
|
console.log(chunk);
|
||||||
|
});
|
||||||
|
}).on('error', err => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
You can inspect the final redirected URL through the `responseUrl` property on the `response`.
|
||||||
|
If no redirection happened, `responseUrl` is the original request URL.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const request = https.request({
|
||||||
|
host: 'bitly.com',
|
||||||
|
path: '/UHfDGO',
|
||||||
|
}, response => {
|
||||||
|
console.log(response.responseUrl);
|
||||||
|
// 'http://duckduckgo.com/robots.txt'
|
||||||
|
});
|
||||||
|
request.end();
|
||||||
|
```
|
||||||
|
|
||||||
|
## Options
|
||||||
|
### Global options
|
||||||
|
Global options are set directly on the `follow-redirects` module:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const followRedirects = require('follow-redirects');
|
||||||
|
followRedirects.maxRedirects = 10;
|
||||||
|
followRedirects.maxBodyLength = 20 * 1024 * 1024; // 20 MB
|
||||||
|
```
|
||||||
|
|
||||||
|
The following global options are supported:
|
||||||
|
|
||||||
|
- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted.
|
||||||
|
|
||||||
|
- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted.
|
||||||
|
|
||||||
|
### Per-request options
|
||||||
|
Per-request options are set by passing an `options` object:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const url = require('url');
|
||||||
|
const { http, https } = require('follow-redirects');
|
||||||
|
|
||||||
|
const options = url.parse('http://bit.ly/900913');
|
||||||
|
options.maxRedirects = 10;
|
||||||
|
options.beforeRedirect = (options, response, request) => {
|
||||||
|
// Use this to adjust the request options upon redirecting,
|
||||||
|
// to inspect the latest response headers,
|
||||||
|
// or to cancel the request by throwing an error
|
||||||
|
|
||||||
|
// response.headers = the redirect response headers
|
||||||
|
// response.statusCode = the redirect response code (eg. 301, 307, etc.)
|
||||||
|
|
||||||
|
// request.url = the requested URL that resulted in a redirect
|
||||||
|
// request.headers = the headers in the request that resulted in a redirect
|
||||||
|
// request.method = the method of the request that resulted in a redirect
|
||||||
|
if (options.hostname === "example.com") {
|
||||||
|
options.auth = "user:password";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
http.request(options);
|
||||||
|
```
|
||||||
|
|
||||||
|
In addition to the [standard HTTP](https://nodejs.org/api/http.html#http_http_request_options_callback) and [HTTPS options](https://nodejs.org/api/https.html#https_https_request_options_callback),
|
||||||
|
the following per-request options are supported:
|
||||||
|
- `followRedirects` (default: `true`) – whether redirects should be followed.
|
||||||
|
|
||||||
|
- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted.
|
||||||
|
|
||||||
|
- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted.
|
||||||
|
|
||||||
|
- `beforeRedirect` (default: `undefined`) – optionally change the request `options` on redirects, or abort the request by throwing an error.
|
||||||
|
|
||||||
|
- `agents` (default: `undefined`) – sets the `agent` option per protocol, since HTTP and HTTPS use different agents. Example value: `{ http: new http.Agent(), https: new https.Agent() }`
|
||||||
|
|
||||||
|
- `trackRedirects` (default: `false`) – whether to store the redirected response details into the `redirects` array on the response object.
|
||||||
|
|
||||||
|
|
||||||
|
### Advanced usage
|
||||||
|
By default, `follow-redirects` will use the Node.js default implementations
|
||||||
|
of [`http`](https://nodejs.org/api/http.html)
|
||||||
|
and [`https`](https://nodejs.org/api/https.html).
|
||||||
|
To enable features such as caching and/or intermediate request tracking,
|
||||||
|
you might instead want to wrap `follow-redirects` around custom protocol implementations:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const { http, https } = require('follow-redirects').wrap({
|
||||||
|
http: require('your-custom-http'),
|
||||||
|
https: require('your-custom-https'),
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
Such custom protocols only need an implementation of the `request` method.
|
||||||
|
|
||||||
|
## Browser Usage
|
||||||
|
|
||||||
|
Due to the way the browser works,
|
||||||
|
the `http` and `https` browser equivalents perform redirects by default.
|
||||||
|
|
||||||
|
By requiring `follow-redirects` this way:
|
||||||
|
```javascript
|
||||||
|
const http = require('follow-redirects/http');
|
||||||
|
const https = require('follow-redirects/https');
|
||||||
|
```
|
||||||
|
you can easily tell webpack and friends to replace
|
||||||
|
`follow-redirect` by the built-in versions:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"follow-redirects/http" : "http",
|
||||||
|
"follow-redirects/https" : "https"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
Pull Requests are always welcome. Please [file an issue](https://github.com/follow-redirects/follow-redirects/issues)
|
||||||
|
detailing your proposal before you invest your valuable time. Additional features and bug fixes should be accompanied
|
||||||
|
by tests. You can run the test suite locally with a simple `npm test` command.
|
||||||
|
|
||||||
|
## Debug Logging
|
||||||
|
|
||||||
|
`follow-redirects` uses the excellent [debug](https://www.npmjs.com/package/debug) for logging. To turn on logging
|
||||||
|
set the environment variable `DEBUG=follow-redirects` for debug output from just this module. When running the test
|
||||||
|
suite it is sometimes advantageous to set `DEBUG=*` to see output from the express server as well.
|
||||||
|
|
||||||
|
## Authors
|
||||||
|
|
||||||
|
- [Ruben Verborgh](https://ruben.verborgh.org/)
|
||||||
|
- [Olivier Lalonde](mailto:olalonde@gmail.com)
|
||||||
|
- [James Talmage](mailto:james@talmage.io)
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
[MIT License](https://github.com/follow-redirects/follow-redirects/blob/master/LICENSE)
|
||||||
15
node_modules/follow-redirects/debug.js
generated
vendored
Normal file
15
node_modules/follow-redirects/debug.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
var debug;
|
||||||
|
|
||||||
|
module.exports = function () {
|
||||||
|
if (!debug) {
|
||||||
|
try {
|
||||||
|
/* eslint global-require: off */
|
||||||
|
debug = require("debug")("follow-redirects");
|
||||||
|
}
|
||||||
|
catch (error) { /* */ }
|
||||||
|
if (typeof debug !== "function") {
|
||||||
|
debug = function () { /* */ };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
debug.apply(null, arguments);
|
||||||
|
};
|
||||||
1
node_modules/follow-redirects/http.js
generated
vendored
Normal file
1
node_modules/follow-redirects/http.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
module.exports = require("./").http;
|
||||||
1
node_modules/follow-redirects/https.js
generated
vendored
Normal file
1
node_modules/follow-redirects/https.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
module.exports = require("./").https;
|
||||||
672
node_modules/follow-redirects/index.js
generated
vendored
Normal file
672
node_modules/follow-redirects/index.js
generated
vendored
Normal file
@@ -0,0 +1,672 @@
|
|||||||
|
var url = require("url");
|
||||||
|
var URL = url.URL;
|
||||||
|
var http = require("http");
|
||||||
|
var https = require("https");
|
||||||
|
var Writable = require("stream").Writable;
|
||||||
|
var assert = require("assert");
|
||||||
|
var debug = require("./debug");
|
||||||
|
|
||||||
|
// Whether to use the native URL object or the legacy url module
|
||||||
|
var useNativeURL = false;
|
||||||
|
try {
|
||||||
|
assert(new URL());
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
useNativeURL = error.code === "ERR_INVALID_URL";
|
||||||
|
}
|
||||||
|
|
||||||
|
// URL fields to preserve in copy operations
|
||||||
|
var preservedUrlFields = [
|
||||||
|
"auth",
|
||||||
|
"host",
|
||||||
|
"hostname",
|
||||||
|
"href",
|
||||||
|
"path",
|
||||||
|
"pathname",
|
||||||
|
"port",
|
||||||
|
"protocol",
|
||||||
|
"query",
|
||||||
|
"search",
|
||||||
|
"hash",
|
||||||
|
];
|
||||||
|
|
||||||
|
// Create handlers that pass events from native requests
|
||||||
|
var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
|
||||||
|
var eventHandlers = Object.create(null);
|
||||||
|
events.forEach(function (event) {
|
||||||
|
eventHandlers[event] = function (arg1, arg2, arg3) {
|
||||||
|
this._redirectable.emit(event, arg1, arg2, arg3);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
// Error types with codes
|
||||||
|
var InvalidUrlError = createErrorType(
|
||||||
|
"ERR_INVALID_URL",
|
||||||
|
"Invalid URL",
|
||||||
|
TypeError
|
||||||
|
);
|
||||||
|
var RedirectionError = createErrorType(
|
||||||
|
"ERR_FR_REDIRECTION_FAILURE",
|
||||||
|
"Redirected request failed"
|
||||||
|
);
|
||||||
|
var TooManyRedirectsError = createErrorType(
|
||||||
|
"ERR_FR_TOO_MANY_REDIRECTS",
|
||||||
|
"Maximum number of redirects exceeded",
|
||||||
|
RedirectionError
|
||||||
|
);
|
||||||
|
var MaxBodyLengthExceededError = createErrorType(
|
||||||
|
"ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
|
||||||
|
"Request body larger than maxBodyLength limit"
|
||||||
|
);
|
||||||
|
var WriteAfterEndError = createErrorType(
|
||||||
|
"ERR_STREAM_WRITE_AFTER_END",
|
||||||
|
"write after end"
|
||||||
|
);
|
||||||
|
|
||||||
|
// istanbul ignore next
|
||||||
|
var destroy = Writable.prototype.destroy || noop;
|
||||||
|
|
||||||
|
// An HTTP(S) request that can be redirected
|
||||||
|
function RedirectableRequest(options, responseCallback) {
|
||||||
|
// Initialize the request
|
||||||
|
Writable.call(this);
|
||||||
|
this._sanitizeOptions(options);
|
||||||
|
this._options = options;
|
||||||
|
this._ended = false;
|
||||||
|
this._ending = false;
|
||||||
|
this._redirectCount = 0;
|
||||||
|
this._redirects = [];
|
||||||
|
this._requestBodyLength = 0;
|
||||||
|
this._requestBodyBuffers = [];
|
||||||
|
|
||||||
|
// Attach a callback if passed
|
||||||
|
if (responseCallback) {
|
||||||
|
this.on("response", responseCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
// React to responses of native requests
|
||||||
|
var self = this;
|
||||||
|
this._onNativeResponse = function (response) {
|
||||||
|
try {
|
||||||
|
self._processResponse(response);
|
||||||
|
}
|
||||||
|
catch (cause) {
|
||||||
|
self.emit("error", cause instanceof RedirectionError ?
|
||||||
|
cause : new RedirectionError({ cause: cause }));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Perform the first request
|
||||||
|
this._performRequest();
|
||||||
|
}
|
||||||
|
RedirectableRequest.prototype = Object.create(Writable.prototype);
|
||||||
|
|
||||||
|
RedirectableRequest.prototype.abort = function () {
|
||||||
|
destroyRequest(this._currentRequest);
|
||||||
|
this._currentRequest.abort();
|
||||||
|
this.emit("abort");
|
||||||
|
};
|
||||||
|
|
||||||
|
RedirectableRequest.prototype.destroy = function (error) {
|
||||||
|
destroyRequest(this._currentRequest, error);
|
||||||
|
destroy.call(this, error);
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Writes buffered data to the current native request
|
||||||
|
RedirectableRequest.prototype.write = function (data, encoding, callback) {
|
||||||
|
// Writing is not allowed if end has been called
|
||||||
|
if (this._ending) {
|
||||||
|
throw new WriteAfterEndError();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate input and shift parameters if necessary
|
||||||
|
if (!isString(data) && !isBuffer(data)) {
|
||||||
|
throw new TypeError("data should be a string, Buffer or Uint8Array");
|
||||||
|
}
|
||||||
|
if (isFunction(encoding)) {
|
||||||
|
callback = encoding;
|
||||||
|
encoding = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ignore empty buffers, since writing them doesn't invoke the callback
|
||||||
|
// https://github.com/nodejs/node/issues/22066
|
||||||
|
if (data.length === 0) {
|
||||||
|
if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Only write when we don't exceed the maximum body length
|
||||||
|
if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
|
||||||
|
this._requestBodyLength += data.length;
|
||||||
|
this._requestBodyBuffers.push({ data: data, encoding: encoding });
|
||||||
|
this._currentRequest.write(data, encoding, callback);
|
||||||
|
}
|
||||||
|
// Error when we exceed the maximum body length
|
||||||
|
else {
|
||||||
|
this.emit("error", new MaxBodyLengthExceededError());
|
||||||
|
this.abort();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Ends the current native request
|
||||||
|
RedirectableRequest.prototype.end = function (data, encoding, callback) {
|
||||||
|
// Shift parameters if necessary
|
||||||
|
if (isFunction(data)) {
|
||||||
|
callback = data;
|
||||||
|
data = encoding = null;
|
||||||
|
}
|
||||||
|
else if (isFunction(encoding)) {
|
||||||
|
callback = encoding;
|
||||||
|
encoding = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write data if needed and end
|
||||||
|
if (!data) {
|
||||||
|
this._ended = this._ending = true;
|
||||||
|
this._currentRequest.end(null, null, callback);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var self = this;
|
||||||
|
var currentRequest = this._currentRequest;
|
||||||
|
this.write(data, encoding, function () {
|
||||||
|
self._ended = true;
|
||||||
|
currentRequest.end(null, null, callback);
|
||||||
|
});
|
||||||
|
this._ending = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Sets a header value on the current native request
|
||||||
|
RedirectableRequest.prototype.setHeader = function (name, value) {
|
||||||
|
this._options.headers[name] = value;
|
||||||
|
this._currentRequest.setHeader(name, value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Clears a header value on the current native request
|
||||||
|
RedirectableRequest.prototype.removeHeader = function (name) {
|
||||||
|
delete this._options.headers[name];
|
||||||
|
this._currentRequest.removeHeader(name);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Global timeout for all underlying requests
|
||||||
|
RedirectableRequest.prototype.setTimeout = function (msecs, callback) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
// Destroys the socket on timeout
|
||||||
|
function destroyOnTimeout(socket) {
|
||||||
|
socket.setTimeout(msecs);
|
||||||
|
socket.removeListener("timeout", socket.destroy);
|
||||||
|
socket.addListener("timeout", socket.destroy);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sets up a timer to trigger a timeout event
|
||||||
|
function startTimer(socket) {
|
||||||
|
if (self._timeout) {
|
||||||
|
clearTimeout(self._timeout);
|
||||||
|
}
|
||||||
|
self._timeout = setTimeout(function () {
|
||||||
|
self.emit("timeout");
|
||||||
|
clearTimer();
|
||||||
|
}, msecs);
|
||||||
|
destroyOnTimeout(socket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stops a timeout from triggering
|
||||||
|
function clearTimer() {
|
||||||
|
// Clear the timeout
|
||||||
|
if (self._timeout) {
|
||||||
|
clearTimeout(self._timeout);
|
||||||
|
self._timeout = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clean up all attached listeners
|
||||||
|
self.removeListener("abort", clearTimer);
|
||||||
|
self.removeListener("error", clearTimer);
|
||||||
|
self.removeListener("response", clearTimer);
|
||||||
|
self.removeListener("close", clearTimer);
|
||||||
|
if (callback) {
|
||||||
|
self.removeListener("timeout", callback);
|
||||||
|
}
|
||||||
|
if (!self.socket) {
|
||||||
|
self._currentRequest.removeListener("socket", startTimer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attach callback if passed
|
||||||
|
if (callback) {
|
||||||
|
this.on("timeout", callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start the timer if or when the socket is opened
|
||||||
|
if (this.socket) {
|
||||||
|
startTimer(this.socket);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this._currentRequest.once("socket", startTimer);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clean up on events
|
||||||
|
this.on("socket", destroyOnTimeout);
|
||||||
|
this.on("abort", clearTimer);
|
||||||
|
this.on("error", clearTimer);
|
||||||
|
this.on("response", clearTimer);
|
||||||
|
this.on("close", clearTimer);
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Proxy all other public ClientRequest methods
|
||||||
|
[
|
||||||
|
"flushHeaders", "getHeader",
|
||||||
|
"setNoDelay", "setSocketKeepAlive",
|
||||||
|
].forEach(function (method) {
|
||||||
|
RedirectableRequest.prototype[method] = function (a, b) {
|
||||||
|
return this._currentRequest[method](a, b);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
// Proxy all public ClientRequest properties
|
||||||
|
["aborted", "connection", "socket"].forEach(function (property) {
|
||||||
|
Object.defineProperty(RedirectableRequest.prototype, property, {
|
||||||
|
get: function () { return this._currentRequest[property]; },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
RedirectableRequest.prototype._sanitizeOptions = function (options) {
|
||||||
|
// Ensure headers are always present
|
||||||
|
if (!options.headers) {
|
||||||
|
options.headers = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Since http.request treats host as an alias of hostname,
|
||||||
|
// but the url module interprets host as hostname plus port,
|
||||||
|
// eliminate the host property to avoid confusion.
|
||||||
|
if (options.host) {
|
||||||
|
// Use hostname if set, because it has precedence
|
||||||
|
if (!options.hostname) {
|
||||||
|
options.hostname = options.host;
|
||||||
|
}
|
||||||
|
delete options.host;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Complete the URL object when necessary
|
||||||
|
if (!options.pathname && options.path) {
|
||||||
|
var searchPos = options.path.indexOf("?");
|
||||||
|
if (searchPos < 0) {
|
||||||
|
options.pathname = options.path;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
options.pathname = options.path.substring(0, searchPos);
|
||||||
|
options.search = options.path.substring(searchPos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Executes the next native request (initial or redirect)
|
||||||
|
RedirectableRequest.prototype._performRequest = function () {
|
||||||
|
// Load the native protocol
|
||||||
|
var protocol = this._options.protocol;
|
||||||
|
var nativeProtocol = this._options.nativeProtocols[protocol];
|
||||||
|
if (!nativeProtocol) {
|
||||||
|
throw new TypeError("Unsupported protocol " + protocol);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If specified, use the agent corresponding to the protocol
|
||||||
|
// (HTTP and HTTPS use different types of agents)
|
||||||
|
if (this._options.agents) {
|
||||||
|
var scheme = protocol.slice(0, -1);
|
||||||
|
this._options.agent = this._options.agents[scheme];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the native request and set up its event handlers
|
||||||
|
var request = this._currentRequest =
|
||||||
|
nativeProtocol.request(this._options, this._onNativeResponse);
|
||||||
|
request._redirectable = this;
|
||||||
|
for (var event of events) {
|
||||||
|
request.on(event, eventHandlers[event]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// RFC7230§5.3.1: When making a request directly to an origin server, […]
|
||||||
|
// a client MUST send only the absolute path […] as the request-target.
|
||||||
|
this._currentUrl = /^\//.test(this._options.path) ?
|
||||||
|
url.format(this._options) :
|
||||||
|
// When making a request to a proxy, […]
|
||||||
|
// a client MUST send the target URI in absolute-form […].
|
||||||
|
this._options.path;
|
||||||
|
|
||||||
|
// End a redirected request
|
||||||
|
// (The first request must be ended explicitly with RedirectableRequest#end)
|
||||||
|
if (this._isRedirect) {
|
||||||
|
// Write the request entity and end
|
||||||
|
var i = 0;
|
||||||
|
var self = this;
|
||||||
|
var buffers = this._requestBodyBuffers;
|
||||||
|
(function writeNext(error) {
|
||||||
|
// Only write if this request has not been redirected yet
|
||||||
|
/* istanbul ignore else */
|
||||||
|
if (request === self._currentRequest) {
|
||||||
|
// Report any write errors
|
||||||
|
/* istanbul ignore if */
|
||||||
|
if (error) {
|
||||||
|
self.emit("error", error);
|
||||||
|
}
|
||||||
|
// Write the next buffer if there are still left
|
||||||
|
else if (i < buffers.length) {
|
||||||
|
var buffer = buffers[i++];
|
||||||
|
/* istanbul ignore else */
|
||||||
|
if (!request.finished) {
|
||||||
|
request.write(buffer.data, buffer.encoding, writeNext);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// End the request if `end` has been called on us
|
||||||
|
else if (self._ended) {
|
||||||
|
request.end();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Processes a response from the current native request
|
||||||
|
RedirectableRequest.prototype._processResponse = function (response) {
|
||||||
|
// Store the redirected response
|
||||||
|
var statusCode = response.statusCode;
|
||||||
|
if (this._options.trackRedirects) {
|
||||||
|
this._redirects.push({
|
||||||
|
url: this._currentUrl,
|
||||||
|
headers: response.headers,
|
||||||
|
statusCode: statusCode,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// RFC7231§6.4: The 3xx (Redirection) class of status code indicates
|
||||||
|
// that further action needs to be taken by the user agent in order to
|
||||||
|
// fulfill the request. If a Location header field is provided,
|
||||||
|
// the user agent MAY automatically redirect its request to the URI
|
||||||
|
// referenced by the Location field value,
|
||||||
|
// even if the specific status code is not understood.
|
||||||
|
|
||||||
|
// If the response is not a redirect; return it as-is
|
||||||
|
var location = response.headers.location;
|
||||||
|
if (!location || this._options.followRedirects === false ||
|
||||||
|
statusCode < 300 || statusCode >= 400) {
|
||||||
|
response.responseUrl = this._currentUrl;
|
||||||
|
response.redirects = this._redirects;
|
||||||
|
this.emit("response", response);
|
||||||
|
|
||||||
|
// Clean up
|
||||||
|
this._requestBodyBuffers = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The response is a redirect, so abort the current request
|
||||||
|
destroyRequest(this._currentRequest);
|
||||||
|
// Discard the remainder of the response to avoid waiting for data
|
||||||
|
response.destroy();
|
||||||
|
|
||||||
|
// RFC7231§6.4: A client SHOULD detect and intervene
|
||||||
|
// in cyclical redirections (i.e., "infinite" redirection loops).
|
||||||
|
if (++this._redirectCount > this._options.maxRedirects) {
|
||||||
|
throw new TooManyRedirectsError();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Store the request headers if applicable
|
||||||
|
var requestHeaders;
|
||||||
|
var beforeRedirect = this._options.beforeRedirect;
|
||||||
|
if (beforeRedirect) {
|
||||||
|
requestHeaders = Object.assign({
|
||||||
|
// The Host header was set by nativeProtocol.request
|
||||||
|
Host: response.req.getHeader("host"),
|
||||||
|
}, this._options.headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
// RFC7231§6.4: Automatic redirection needs to done with
|
||||||
|
// care for methods not known to be safe, […]
|
||||||
|
// RFC7231§6.4.2–3: For historical reasons, a user agent MAY change
|
||||||
|
// the request method from POST to GET for the subsequent request.
|
||||||
|
var method = this._options.method;
|
||||||
|
if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
|
||||||
|
// RFC7231§6.4.4: The 303 (See Other) status code indicates that
|
||||||
|
// the server is redirecting the user agent to a different resource […]
|
||||||
|
// A user agent can perform a retrieval request targeting that URI
|
||||||
|
// (a GET or HEAD request if using HTTP) […]
|
||||||
|
(statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
|
||||||
|
this._options.method = "GET";
|
||||||
|
// Drop a possible entity and headers related to it
|
||||||
|
this._requestBodyBuffers = [];
|
||||||
|
removeMatchingHeaders(/^content-/i, this._options.headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Drop the Host header, as the redirect might lead to a different host
|
||||||
|
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
||||||
|
|
||||||
|
// If the redirect is relative, carry over the host of the last request
|
||||||
|
var currentUrlParts = parseUrl(this._currentUrl);
|
||||||
|
var currentHost = currentHostHeader || currentUrlParts.host;
|
||||||
|
var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
|
||||||
|
url.format(Object.assign(currentUrlParts, { host: currentHost }));
|
||||||
|
|
||||||
|
// Create the redirected request
|
||||||
|
var redirectUrl = resolveUrl(location, currentUrl);
|
||||||
|
debug("redirecting to", redirectUrl.href);
|
||||||
|
this._isRedirect = true;
|
||||||
|
spreadUrlObject(redirectUrl, this._options);
|
||||||
|
|
||||||
|
// Drop confidential headers when redirecting to a less secure protocol
|
||||||
|
// or to a different domain that is not a superdomain
|
||||||
|
if (redirectUrl.protocol !== currentUrlParts.protocol &&
|
||||||
|
redirectUrl.protocol !== "https:" ||
|
||||||
|
redirectUrl.host !== currentHost &&
|
||||||
|
!isSubdomain(redirectUrl.host, currentHost)) {
|
||||||
|
removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Evaluate the beforeRedirect callback
|
||||||
|
if (isFunction(beforeRedirect)) {
|
||||||
|
var responseDetails = {
|
||||||
|
headers: response.headers,
|
||||||
|
statusCode: statusCode,
|
||||||
|
};
|
||||||
|
var requestDetails = {
|
||||||
|
url: currentUrl,
|
||||||
|
method: method,
|
||||||
|
headers: requestHeaders,
|
||||||
|
};
|
||||||
|
beforeRedirect(this._options, responseDetails, requestDetails);
|
||||||
|
this._sanitizeOptions(this._options);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Perform the redirected request
|
||||||
|
this._performRequest();
|
||||||
|
};
|
||||||
|
|
||||||
|
// Wraps the key/value object of protocols with redirect functionality
|
||||||
|
function wrap(protocols) {
|
||||||
|
// Default settings
|
||||||
|
var exports = {
|
||||||
|
maxRedirects: 21,
|
||||||
|
maxBodyLength: 10 * 1024 * 1024,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Wrap each protocol
|
||||||
|
var nativeProtocols = {};
|
||||||
|
Object.keys(protocols).forEach(function (scheme) {
|
||||||
|
var protocol = scheme + ":";
|
||||||
|
var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
|
||||||
|
var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
|
||||||
|
|
||||||
|
// Executes a request, following redirects
|
||||||
|
function request(input, options, callback) {
|
||||||
|
// Parse parameters, ensuring that input is an object
|
||||||
|
if (isURL(input)) {
|
||||||
|
input = spreadUrlObject(input);
|
||||||
|
}
|
||||||
|
else if (isString(input)) {
|
||||||
|
input = spreadUrlObject(parseUrl(input));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
callback = options;
|
||||||
|
options = validateUrl(input);
|
||||||
|
input = { protocol: protocol };
|
||||||
|
}
|
||||||
|
if (isFunction(options)) {
|
||||||
|
callback = options;
|
||||||
|
options = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set defaults
|
||||||
|
options = Object.assign({
|
||||||
|
maxRedirects: exports.maxRedirects,
|
||||||
|
maxBodyLength: exports.maxBodyLength,
|
||||||
|
}, input, options);
|
||||||
|
options.nativeProtocols = nativeProtocols;
|
||||||
|
if (!isString(options.host) && !isString(options.hostname)) {
|
||||||
|
options.hostname = "::1";
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.equal(options.protocol, protocol, "protocol mismatch");
|
||||||
|
debug("options", options);
|
||||||
|
return new RedirectableRequest(options, callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Executes a GET request, following redirects
|
||||||
|
function get(input, options, callback) {
|
||||||
|
var wrappedRequest = wrappedProtocol.request(input, options, callback);
|
||||||
|
wrappedRequest.end();
|
||||||
|
return wrappedRequest;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Expose the properties on the wrapped protocol
|
||||||
|
Object.defineProperties(wrappedProtocol, {
|
||||||
|
request: { value: request, configurable: true, enumerable: true, writable: true },
|
||||||
|
get: { value: get, configurable: true, enumerable: true, writable: true },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return exports;
|
||||||
|
}
|
||||||
|
|
||||||
|
function noop() { /* empty */ }
|
||||||
|
|
||||||
|
function parseUrl(input) {
|
||||||
|
var parsed;
|
||||||
|
/* istanbul ignore else */
|
||||||
|
if (useNativeURL) {
|
||||||
|
parsed = new URL(input);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Ensure the URL is valid and absolute
|
||||||
|
parsed = validateUrl(url.parse(input));
|
||||||
|
if (!isString(parsed.protocol)) {
|
||||||
|
throw new InvalidUrlError({ input });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return parsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolveUrl(relative, base) {
|
||||||
|
/* istanbul ignore next */
|
||||||
|
return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative));
|
||||||
|
}
|
||||||
|
|
||||||
|
function validateUrl(input) {
|
||||||
|
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
||||||
|
throw new InvalidUrlError({ input: input.href || input });
|
||||||
|
}
|
||||||
|
if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
|
||||||
|
throw new InvalidUrlError({ input: input.href || input });
|
||||||
|
}
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
function spreadUrlObject(urlObject, target) {
|
||||||
|
var spread = target || {};
|
||||||
|
for (var key of preservedUrlFields) {
|
||||||
|
spread[key] = urlObject[key];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fix IPv6 hostname
|
||||||
|
if (spread.hostname.startsWith("[")) {
|
||||||
|
spread.hostname = spread.hostname.slice(1, -1);
|
||||||
|
}
|
||||||
|
// Ensure port is a number
|
||||||
|
if (spread.port !== "") {
|
||||||
|
spread.port = Number(spread.port);
|
||||||
|
}
|
||||||
|
// Concatenate path
|
||||||
|
spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
|
||||||
|
|
||||||
|
return spread;
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeMatchingHeaders(regex, headers) {
|
||||||
|
var lastValue;
|
||||||
|
for (var header in headers) {
|
||||||
|
if (regex.test(header)) {
|
||||||
|
lastValue = headers[header];
|
||||||
|
delete headers[header];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (lastValue === null || typeof lastValue === "undefined") ?
|
||||||
|
undefined : String(lastValue).trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
function createErrorType(code, message, baseClass) {
|
||||||
|
// Create constructor
|
||||||
|
function CustomError(properties) {
|
||||||
|
Error.captureStackTrace(this, this.constructor);
|
||||||
|
Object.assign(this, properties || {});
|
||||||
|
this.code = code;
|
||||||
|
this.message = this.cause ? message + ": " + this.cause.message : message;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attach constructor and set default properties
|
||||||
|
CustomError.prototype = new (baseClass || Error)();
|
||||||
|
Object.defineProperties(CustomError.prototype, {
|
||||||
|
constructor: {
|
||||||
|
value: CustomError,
|
||||||
|
enumerable: false,
|
||||||
|
},
|
||||||
|
name: {
|
||||||
|
value: "Error [" + code + "]",
|
||||||
|
enumerable: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return CustomError;
|
||||||
|
}
|
||||||
|
|
||||||
|
function destroyRequest(request, error) {
|
||||||
|
for (var event of events) {
|
||||||
|
request.removeListener(event, eventHandlers[event]);
|
||||||
|
}
|
||||||
|
request.on("error", noop);
|
||||||
|
request.destroy(error);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isSubdomain(subdomain, domain) {
|
||||||
|
assert(isString(subdomain) && isString(domain));
|
||||||
|
var dot = subdomain.length - domain.length - 1;
|
||||||
|
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isString(value) {
|
||||||
|
return typeof value === "string" || value instanceof String;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isFunction(value) {
|
||||||
|
return typeof value === "function";
|
||||||
|
}
|
||||||
|
|
||||||
|
function isBuffer(value) {
|
||||||
|
return typeof value === "object" && ("length" in value);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isURL(value) {
|
||||||
|
return URL && value instanceof URL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Exports
|
||||||
|
module.exports = wrap({ http: http, https: https });
|
||||||
|
module.exports.wrap = wrap;
|
||||||
58
node_modules/follow-redirects/package.json
generated
vendored
Normal file
58
node_modules/follow-redirects/package.json
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
{
|
||||||
|
"name": "follow-redirects",
|
||||||
|
"version": "1.15.6",
|
||||||
|
"description": "HTTP and HTTPS modules that follow redirects.",
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "index.js",
|
||||||
|
"files": [
|
||||||
|
"*.js"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.0"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint *.js test",
|
||||||
|
"test": "nyc mocha"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git@github.com:follow-redirects/follow-redirects.git"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/follow-redirects/follow-redirects",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/follow-redirects/follow-redirects/issues"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"http",
|
||||||
|
"https",
|
||||||
|
"url",
|
||||||
|
"redirect",
|
||||||
|
"client",
|
||||||
|
"location",
|
||||||
|
"utility"
|
||||||
|
],
|
||||||
|
"author": "Ruben Verborgh <ruben@verborgh.org> (https://ruben.verborgh.org/)",
|
||||||
|
"contributors": [
|
||||||
|
"Olivier Lalonde <olalonde@gmail.com> (http://www.syskall.com)",
|
||||||
|
"James Talmage <james@talmage.io>"
|
||||||
|
],
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "individual",
|
||||||
|
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"debug": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"concat-stream": "^2.0.0",
|
||||||
|
"eslint": "^5.16.0",
|
||||||
|
"express": "^4.16.4",
|
||||||
|
"lolex": "^3.1.0",
|
||||||
|
"mocha": "^6.0.2",
|
||||||
|
"nyc": "^14.1.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
19
node_modules/form-data/License
generated
vendored
Normal file
19
node_modules/form-data/License
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors
|
||||||
|
|
||||||
|
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.
|
||||||
358
node_modules/form-data/Readme.md
generated
vendored
Normal file
358
node_modules/form-data/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,358 @@
|
|||||||
|
# Form-Data [](https://www.npmjs.com/package/form-data) [](https://gitter.im/form-data/form-data)
|
||||||
|
|
||||||
|
A library to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications.
|
||||||
|
|
||||||
|
The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd].
|
||||||
|
|
||||||
|
[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface
|
||||||
|
|
||||||
|
[](https://travis-ci.org/form-data/form-data)
|
||||||
|
[](https://travis-ci.org/form-data/form-data)
|
||||||
|
[](https://travis-ci.org/form-data/form-data)
|
||||||
|
|
||||||
|
[](https://coveralls.io/github/form-data/form-data?branch=master)
|
||||||
|
[](https://david-dm.org/form-data/form-data)
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install --save form-data
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
In this example we are constructing a form with 3 fields that contain a string,
|
||||||
|
a buffer and a file stream.
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
var FormData = require('form-data');
|
||||||
|
var fs = require('fs');
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
form.append('my_field', 'my value');
|
||||||
|
form.append('my_buffer', new Buffer(10));
|
||||||
|
form.append('my_file', fs.createReadStream('/foo/bar.jpg'));
|
||||||
|
```
|
||||||
|
|
||||||
|
Also you can use http-response stream:
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
var FormData = require('form-data');
|
||||||
|
var http = require('http');
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
http.request('http://nodejs.org/images/logo.png', function(response) {
|
||||||
|
form.append('my_field', 'my value');
|
||||||
|
form.append('my_buffer', new Buffer(10));
|
||||||
|
form.append('my_logo', response);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
Or @mikeal's [request](https://github.com/request/request) stream:
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
var FormData = require('form-data');
|
||||||
|
var request = require('request');
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
form.append('my_field', 'my value');
|
||||||
|
form.append('my_buffer', new Buffer(10));
|
||||||
|
form.append('my_logo', request('http://nodejs.org/images/logo.png'));
|
||||||
|
```
|
||||||
|
|
||||||
|
In order to submit this form to a web application, call ```submit(url, [callback])``` method:
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
form.submit('http://example.org/', function(err, res) {
|
||||||
|
// res – response object (http.IncomingMessage) //
|
||||||
|
res.resume();
|
||||||
|
});
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods.
|
||||||
|
|
||||||
|
### Custom options
|
||||||
|
|
||||||
|
You can provide custom options, such as `maxDataSize`:
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
var FormData = require('form-data');
|
||||||
|
|
||||||
|
var form = new FormData({ maxDataSize: 20971520 });
|
||||||
|
form.append('my_field', 'my value');
|
||||||
|
form.append('my_buffer', /* something big */);
|
||||||
|
```
|
||||||
|
|
||||||
|
List of available options could be found in [combined-stream](https://github.com/felixge/node-combined-stream/blob/master/lib/combined_stream.js#L7-L15)
|
||||||
|
|
||||||
|
### Alternative submission methods
|
||||||
|
|
||||||
|
You can use node's http client interface:
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
var http = require('http');
|
||||||
|
|
||||||
|
var request = http.request({
|
||||||
|
method: 'post',
|
||||||
|
host: 'example.org',
|
||||||
|
path: '/upload',
|
||||||
|
headers: form.getHeaders()
|
||||||
|
});
|
||||||
|
|
||||||
|
form.pipe(request);
|
||||||
|
|
||||||
|
request.on('response', function(res) {
|
||||||
|
console.log(res.statusCode);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
Or if you would prefer the `'Content-Length'` header to be set for you:
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
form.submit('example.org/upload', function(err, res) {
|
||||||
|
console.log(res.statusCode);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
To use custom headers and pre-known length in parts:
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
var CRLF = '\r\n';
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
var options = {
|
||||||
|
header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,
|
||||||
|
knownLength: 1
|
||||||
|
};
|
||||||
|
|
||||||
|
form.append('my_buffer', buffer, options);
|
||||||
|
|
||||||
|
form.submit('http://example.com/', function(err, res) {
|
||||||
|
if (err) throw err;
|
||||||
|
console.log('Done');
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually:
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
someModule.stream(function(err, stdout, stderr) {
|
||||||
|
if (err) throw err;
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
form.append('file', stdout, {
|
||||||
|
filename: 'unicycle.jpg', // ... or:
|
||||||
|
filepath: 'photos/toys/unicycle.jpg',
|
||||||
|
contentType: 'image/jpeg',
|
||||||
|
knownLength: 19806
|
||||||
|
});
|
||||||
|
|
||||||
|
form.submit('http://example.com/', function(err, res) {
|
||||||
|
if (err) throw err;
|
||||||
|
console.log('Done');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
The `filepath` property overrides `filename` and may contain a relative path. This is typically used when uploading [multiple files from a directory](https://wicg.github.io/entries-api/#dom-htmlinputelement-webkitdirectory).
|
||||||
|
|
||||||
|
For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter:
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
form.submit({
|
||||||
|
host: 'example.com',
|
||||||
|
path: '/probably.php?extra=params',
|
||||||
|
auth: 'username:password'
|
||||||
|
}, function(err, res) {
|
||||||
|
console.log(res.statusCode);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
In case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`:
|
||||||
|
|
||||||
|
``` javascript
|
||||||
|
form.submit({
|
||||||
|
host: 'example.com',
|
||||||
|
path: '/surelynot.php',
|
||||||
|
headers: {'x-test-header': 'test-header-value'}
|
||||||
|
}, function(err, res) {
|
||||||
|
console.log(res.statusCode);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Methods
|
||||||
|
|
||||||
|
- [_Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] )](https://github.com/form-data/form-data#void-append-string-field-mixed-value--mixed-options-).
|
||||||
|
- [_Headers_ getHeaders( [**Headers** _userHeaders_] )](https://github.com/form-data/form-data#array-getheaders-array-userheaders-)
|
||||||
|
- [_String_ getBoundary()](https://github.com/form-data/form-data#string-getboundary)
|
||||||
|
- [_Void_ setBoundary()](https://github.com/form-data/form-data#void-setboundary)
|
||||||
|
- [_Buffer_ getBuffer()](https://github.com/form-data/form-data#buffer-getbuffer)
|
||||||
|
- [_Integer_ getLengthSync()](https://github.com/form-data/form-data#integer-getlengthsync)
|
||||||
|
- [_Integer_ getLength( **function** _callback_ )](https://github.com/form-data/form-data#integer-getlength-function-callback-)
|
||||||
|
- [_Boolean_ hasKnownLength()](https://github.com/form-data/form-data#boolean-hasknownlength)
|
||||||
|
- [_Request_ submit( _params_, **function** _callback_ )](https://github.com/form-data/form-data#request-submit-params-function-callback-)
|
||||||
|
- [_String_ toString()](https://github.com/form-data/form-data#string-tostring)
|
||||||
|
|
||||||
|
#### _Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] )
|
||||||
|
Append data to the form. You can submit about any format (string, integer, boolean, buffer, etc.). However, Arrays are not supported and need to be turned into strings by the user.
|
||||||
|
```javascript
|
||||||
|
var form = new FormData();
|
||||||
|
form.append( 'my_string', 'my value' );
|
||||||
|
form.append( 'my_integer', 1 );
|
||||||
|
form.append( 'my_boolean', true );
|
||||||
|
form.append( 'my_buffer', new Buffer(10) );
|
||||||
|
form.append( 'my_array_as_json', JSON.stringify( ['bird','cute'] ) )
|
||||||
|
```
|
||||||
|
|
||||||
|
You may provide a string for options, or an object.
|
||||||
|
```javascript
|
||||||
|
// Set filename by providing a string for options
|
||||||
|
form.append( 'my_file', fs.createReadStream('/foo/bar.jpg'), 'bar.jpg' );
|
||||||
|
|
||||||
|
// provide an object.
|
||||||
|
form.append( 'my_file', fs.createReadStream('/foo/bar.jpg'), {filename: 'bar.jpg', contentType: 'image/jpeg', knownLength: 19806} );
|
||||||
|
```
|
||||||
|
|
||||||
|
#### _Headers_ getHeaders( [**Headers** _userHeaders_] )
|
||||||
|
This method adds the correct `content-type` header to the provided array of `userHeaders`.
|
||||||
|
|
||||||
|
#### _String_ getBoundary()
|
||||||
|
Return the boundary of the formData. By default, the boundary consists of 26 `-` followed by 24 numbers
|
||||||
|
for example:
|
||||||
|
```javascript
|
||||||
|
--------------------------515890814546601021194782
|
||||||
|
```
|
||||||
|
|
||||||
|
#### _Void_ setBoundary(String _boundary_)
|
||||||
|
Set the boundary string, overriding the default behavior described above.
|
||||||
|
|
||||||
|
_Note: The boundary must be unique and may not appear in the data._
|
||||||
|
|
||||||
|
#### _Buffer_ getBuffer()
|
||||||
|
Return the full formdata request package, as a Buffer. You can insert this Buffer in e.g. Axios to send multipart data.
|
||||||
|
```javascript
|
||||||
|
var form = new FormData();
|
||||||
|
form.append( 'my_buffer', Buffer.from([0x4a,0x42,0x20,0x52,0x6f,0x63,0x6b,0x73]) );
|
||||||
|
form.append( 'my_file', fs.readFileSync('/foo/bar.jpg') );
|
||||||
|
|
||||||
|
axios.post( 'https://example.com/path/to/api',
|
||||||
|
form.getBuffer(),
|
||||||
|
form.getHeaders()
|
||||||
|
)
|
||||||
|
```
|
||||||
|
**Note:** Because the output is of type Buffer, you can only append types that are accepted by Buffer: *string, Buffer, ArrayBuffer, Array, or Array-like Object*. A ReadStream for example will result in an error.
|
||||||
|
|
||||||
|
#### _Integer_ getLengthSync()
|
||||||
|
Same as `getLength` but synchronous.
|
||||||
|
|
||||||
|
_Note: getLengthSync __doesn't__ calculate streams length._
|
||||||
|
|
||||||
|
#### _Integer_ getLength( **function** _callback_ )
|
||||||
|
Returns the `Content-Length` async. The callback is used to handle errors and continue once the length has been calculated
|
||||||
|
```javascript
|
||||||
|
this.getLength(function(err, length) {
|
||||||
|
if (err) {
|
||||||
|
this._error(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// add content length
|
||||||
|
request.setHeader('Content-Length', length);
|
||||||
|
|
||||||
|
...
|
||||||
|
}.bind(this));
|
||||||
|
```
|
||||||
|
|
||||||
|
#### _Boolean_ hasKnownLength()
|
||||||
|
Checks if the length of added values is known.
|
||||||
|
|
||||||
|
#### _Request_ submit( _params_, **function** _callback_ )
|
||||||
|
Submit the form to a web application.
|
||||||
|
```javascript
|
||||||
|
var form = new FormData();
|
||||||
|
form.append( 'my_string', 'Hello World' );
|
||||||
|
|
||||||
|
form.submit( 'http://example.com/', function(err, res) {
|
||||||
|
// res – response object (http.IncomingMessage) //
|
||||||
|
res.resume();
|
||||||
|
} );
|
||||||
|
```
|
||||||
|
|
||||||
|
#### _String_ toString()
|
||||||
|
Returns the form data as a string. Don't use this if you are sending files or buffers, use `getBuffer()` instead.
|
||||||
|
|
||||||
|
### Integration with other libraries
|
||||||
|
|
||||||
|
#### Request
|
||||||
|
|
||||||
|
Form submission using [request](https://github.com/request/request):
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var formData = {
|
||||||
|
my_field: 'my_value',
|
||||||
|
my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),
|
||||||
|
};
|
||||||
|
|
||||||
|
request.post({url:'http://service.com/upload', formData: formData}, function(err, httpResponse, body) {
|
||||||
|
if (err) {
|
||||||
|
return console.error('upload failed:', err);
|
||||||
|
}
|
||||||
|
console.log('Upload successful! Server responded with:', body);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
For more details see [request readme](https://github.com/request/request#multipartform-data-multipart-form-uploads).
|
||||||
|
|
||||||
|
#### node-fetch
|
||||||
|
|
||||||
|
You can also submit a form using [node-fetch](https://github.com/bitinn/node-fetch):
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
form.append('a', 1);
|
||||||
|
|
||||||
|
fetch('http://example.com', { method: 'POST', body: form })
|
||||||
|
.then(function(res) {
|
||||||
|
return res.json();
|
||||||
|
}).then(function(json) {
|
||||||
|
console.log(json);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
#### axios
|
||||||
|
|
||||||
|
In Node.js you can post a file using [axios](https://github.com/axios/axios):
|
||||||
|
```javascript
|
||||||
|
const form = new FormData();
|
||||||
|
const stream = fs.createReadStream(PATH_TO_FILE);
|
||||||
|
|
||||||
|
form.append('image', stream);
|
||||||
|
|
||||||
|
// In Node.js environment you need to set boundary in the header field 'Content-Type' by calling method `getHeaders`
|
||||||
|
const formHeaders = form.getHeaders();
|
||||||
|
|
||||||
|
axios.post('http://example.com', form, {
|
||||||
|
headers: {
|
||||||
|
...formHeaders,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then(response => response)
|
||||||
|
.catch(error => error)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.
|
||||||
|
- ```getLength(cb)``` will send an error as first parameter of callback if stream length cannot be calculated (e.g. send in custom streams w/o using ```knownLength```).
|
||||||
|
- ```submit``` will not add `content-length` if form length is unknown or not calculable.
|
||||||
|
- Starting version `2.x` FormData has dropped support for `node@0.10.x`.
|
||||||
|
- Starting version `3.x` FormData has dropped support for `node@4.x`.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Form-Data is released under the [MIT](License) license.
|
||||||
62
node_modules/form-data/index.d.ts
generated
vendored
Normal file
62
node_modules/form-data/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>
|
||||||
|
// Leon Yu <https://github.com/leonyu>
|
||||||
|
// BendingBender <https://github.com/BendingBender>
|
||||||
|
// Maple Miao <https://github.com/mapleeit>
|
||||||
|
|
||||||
|
/// <reference types="node" />
|
||||||
|
import * as stream from 'stream';
|
||||||
|
import * as http from 'http';
|
||||||
|
|
||||||
|
export = FormData;
|
||||||
|
|
||||||
|
// Extracted because @types/node doesn't export interfaces.
|
||||||
|
interface ReadableOptions {
|
||||||
|
highWaterMark?: number;
|
||||||
|
encoding?: string;
|
||||||
|
objectMode?: boolean;
|
||||||
|
read?(this: stream.Readable, size: number): void;
|
||||||
|
destroy?(this: stream.Readable, error: Error | null, callback: (error: Error | null) => void): void;
|
||||||
|
autoDestroy?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Options extends ReadableOptions {
|
||||||
|
writable?: boolean;
|
||||||
|
readable?: boolean;
|
||||||
|
dataSize?: number;
|
||||||
|
maxDataSize?: number;
|
||||||
|
pauseStreams?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare class FormData extends stream.Readable {
|
||||||
|
constructor(options?: Options);
|
||||||
|
append(key: string, value: any, options?: FormData.AppendOptions | string): void;
|
||||||
|
getHeaders(userHeaders?: FormData.Headers): FormData.Headers;
|
||||||
|
submit(
|
||||||
|
params: string | FormData.SubmitOptions,
|
||||||
|
callback?: (error: Error | null, response: http.IncomingMessage) => void
|
||||||
|
): http.ClientRequest;
|
||||||
|
getBuffer(): Buffer;
|
||||||
|
setBoundary(boundary: string): void;
|
||||||
|
getBoundary(): string;
|
||||||
|
getLength(callback: (err: Error | null, length: number) => void): void;
|
||||||
|
getLengthSync(): number;
|
||||||
|
hasKnownLength(): boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare namespace FormData {
|
||||||
|
interface Headers {
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AppendOptions {
|
||||||
|
header?: string | Headers;
|
||||||
|
knownLength?: number;
|
||||||
|
filename?: string;
|
||||||
|
filepath?: string;
|
||||||
|
contentType?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SubmitOptions extends http.RequestOptions {
|
||||||
|
protocol?: 'https:' | 'http:';
|
||||||
|
}
|
||||||
|
}
|
||||||
68
node_modules/form-data/package.json
generated
vendored
Normal file
68
node_modules/form-data/package.json
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
{
|
||||||
|
"author": "Felix Geisendörfer <felix@debuggable.com> (http://debuggable.com/)",
|
||||||
|
"name": "form-data",
|
||||||
|
"description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.",
|
||||||
|
"version": "4.0.0",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/form-data/form-data.git"
|
||||||
|
},
|
||||||
|
"main": "./lib/form_data",
|
||||||
|
"browser": "./lib/browser",
|
||||||
|
"typings": "./index.d.ts",
|
||||||
|
"scripts": {
|
||||||
|
"pretest": "rimraf coverage test/tmp",
|
||||||
|
"test": "istanbul cover test/run.js",
|
||||||
|
"posttest": "istanbul report lcov text",
|
||||||
|
"lint": "eslint lib/*.js test/*.js test/integration/*.js",
|
||||||
|
"report": "istanbul report lcov text",
|
||||||
|
"ci-lint": "is-node-modern 8 && npm run lint || is-node-not-modern 8",
|
||||||
|
"ci-test": "npm run test && npm run browser && npm run report",
|
||||||
|
"predebug": "rimraf coverage test/tmp",
|
||||||
|
"debug": "verbose=1 ./test/run.js",
|
||||||
|
"browser": "browserify -t browserify-istanbul test/run-browser.js | obake --coverage",
|
||||||
|
"check": "istanbul check-coverage coverage/coverage*.json",
|
||||||
|
"files": "pkgfiles --sort=name",
|
||||||
|
"get-version": "node -e \"console.log(require('./package.json').version)\"",
|
||||||
|
"update-readme": "sed -i.bak 's/\\/master\\.svg/\\/v'$(npm --silent run get-version)'.svg/g' README.md",
|
||||||
|
"restore-readme": "mv README.md.bak README.md",
|
||||||
|
"prepublish": "in-publish && npm run update-readme || not-in-publish",
|
||||||
|
"postpublish": "npm run restore-readme"
|
||||||
|
},
|
||||||
|
"pre-commit": [
|
||||||
|
"lint",
|
||||||
|
"ci-test",
|
||||||
|
"check"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"asynckit": "^0.4.0",
|
||||||
|
"combined-stream": "^1.0.8",
|
||||||
|
"mime-types": "^2.1.12"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^12.0.10",
|
||||||
|
"browserify": "^13.1.1",
|
||||||
|
"browserify-istanbul": "^2.0.0",
|
||||||
|
"coveralls": "^3.0.4",
|
||||||
|
"cross-spawn": "^6.0.5",
|
||||||
|
"eslint": "^6.0.1",
|
||||||
|
"fake": "^0.2.2",
|
||||||
|
"far": "^0.0.7",
|
||||||
|
"formidable": "^1.0.17",
|
||||||
|
"in-publish": "^2.0.0",
|
||||||
|
"is-node-modern": "^1.0.0",
|
||||||
|
"istanbul": "^0.4.5",
|
||||||
|
"obake": "^0.1.2",
|
||||||
|
"puppeteer": "^1.19.0",
|
||||||
|
"pkgfiles": "^2.3.0",
|
||||||
|
"pre-commit": "^1.1.3",
|
||||||
|
"request": "^2.88.0",
|
||||||
|
"rimraf": "^2.7.1",
|
||||||
|
"tape": "^4.6.2",
|
||||||
|
"typescript": "^3.5.2"
|
||||||
|
},
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
||||||
507
node_modules/mime-db/HISTORY.md
generated
vendored
Normal file
507
node_modules/mime-db/HISTORY.md
generated
vendored
Normal file
@@ -0,0 +1,507 @@
|
|||||||
|
1.52.0 / 2022-02-21
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add extensions from IANA for more `image/*` types
|
||||||
|
* Add extension `.asc` to `application/pgp-keys`
|
||||||
|
* Add extensions to various XML types
|
||||||
|
* Add new upstream MIME types
|
||||||
|
|
||||||
|
1.51.0 / 2021-11-08
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Mark `image/vnd.microsoft.icon` as compressible
|
||||||
|
* Mark `image/vnd.ms-dds` as compressible
|
||||||
|
|
||||||
|
1.50.0 / 2021-09-15
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add deprecated iWorks mime types and extensions
|
||||||
|
* Add new upstream MIME types
|
||||||
|
|
||||||
|
1.49.0 / 2021-07-26
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add extension `.trig` to `application/trig`
|
||||||
|
* Add new upstream MIME types
|
||||||
|
|
||||||
|
1.48.0 / 2021-05-30
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add extension `.mvt` to `application/vnd.mapbox-vector-tile`
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Mark `text/yaml` as compressible
|
||||||
|
|
||||||
|
1.47.0 / 2021-04-01
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Remove ambigious extensions from IANA for `application/*+xml` types
|
||||||
|
* Update primary extension to `.es` for `application/ecmascript`
|
||||||
|
|
||||||
|
1.46.0 / 2021-02-13
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add extension `.amr` to `audio/amr`
|
||||||
|
* Add extension `.m4s` to `video/iso.segment`
|
||||||
|
* Add extension `.opus` to `audio/ogg`
|
||||||
|
* Add new upstream MIME types
|
||||||
|
|
||||||
|
1.45.0 / 2020-09-22
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `application/ubjson` with extension `.ubj`
|
||||||
|
* Add `image/avif` with extension `.avif`
|
||||||
|
* Add `image/ktx2` with extension `.ktx2`
|
||||||
|
* Add extension `.dbf` to `application/vnd.dbf`
|
||||||
|
* Add extension `.rar` to `application/vnd.rar`
|
||||||
|
* Add extension `.td` to `application/urc-targetdesc+xml`
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Fix extension of `application/vnd.apple.keynote` to be `.key`
|
||||||
|
|
||||||
|
1.44.0 / 2020-04-22
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add charsets from IANA
|
||||||
|
* Add extension `.cjs` to `application/node`
|
||||||
|
* Add new upstream MIME types
|
||||||
|
|
||||||
|
1.43.0 / 2020-01-05
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `application/x-keepass2` with extension `.kdbx`
|
||||||
|
* Add extension `.mxmf` to `audio/mobile-xmf`
|
||||||
|
* Add extensions from IANA for `application/*+xml` types
|
||||||
|
* Add new upstream MIME types
|
||||||
|
|
||||||
|
1.42.0 / 2019-09-25
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `image/vnd.ms-dds` with extension `.dds`
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Remove compressible from `multipart/mixed`
|
||||||
|
|
||||||
|
1.41.0 / 2019-08-30
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Add `application/toml` with extension `.toml`
|
||||||
|
* Mark `font/ttf` as compressible
|
||||||
|
|
||||||
|
1.40.0 / 2019-04-20
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add extensions from IANA for `model/*` types
|
||||||
|
* Add `text/mdx` with extension `.mdx`
|
||||||
|
|
||||||
|
1.39.0 / 2019-04-04
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add extensions `.siv` and `.sieve` to `application/sieve`
|
||||||
|
* Add new upstream MIME types
|
||||||
|
|
||||||
|
1.38.0 / 2019-02-04
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add extension `.nq` to `application/n-quads`
|
||||||
|
* Add extension `.nt` to `application/n-triples`
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Mark `text/less` as compressible
|
||||||
|
|
||||||
|
1.37.0 / 2018-10-19
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add extensions to HEIC image types
|
||||||
|
* Add new upstream MIME types
|
||||||
|
|
||||||
|
1.36.0 / 2018-08-20
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add Apple file extensions from IANA
|
||||||
|
* Add extensions from IANA for `image/*` types
|
||||||
|
* Add new upstream MIME types
|
||||||
|
|
||||||
|
1.35.0 / 2018-07-15
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add extension `.owl` to `application/rdf+xml`
|
||||||
|
* Add new upstream MIME types
|
||||||
|
- Removes extension `.woff` from `application/font-woff`
|
||||||
|
|
||||||
|
1.34.0 / 2018-06-03
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add extension `.csl` to `application/vnd.citationstyles.style+xml`
|
||||||
|
* Add extension `.es` to `application/ecmascript`
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Add `UTF-8` as default charset for `text/turtle`
|
||||||
|
* Mark all XML-derived types as compressible
|
||||||
|
|
||||||
|
1.33.0 / 2018-02-15
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add extensions from IANA for `message/*` types
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Fix some incorrect OOXML types
|
||||||
|
* Remove `application/font-woff2`
|
||||||
|
|
||||||
|
1.32.0 / 2017-11-29
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Update `text/hjson` to registered `application/hjson`
|
||||||
|
* Add `text/shex` with extension `.shex`
|
||||||
|
|
||||||
|
1.31.0 / 2017-10-25
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `application/raml+yaml` with extension `.raml`
|
||||||
|
* Add `application/wasm` with extension `.wasm`
|
||||||
|
* Add new `font` type from IANA
|
||||||
|
* Add new upstream font extensions
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Add extensions for JPEG-2000 images
|
||||||
|
|
||||||
|
1.30.0 / 2017-08-27
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `application/vnd.ms-outlook`
|
||||||
|
* Add `application/x-arj`
|
||||||
|
* Add extension `.mjs` to `application/javascript`
|
||||||
|
* Add glTF types and extensions
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Add `text/x-org`
|
||||||
|
* Add VirtualBox MIME types
|
||||||
|
* Fix `source` records for `video/*` types that are IANA
|
||||||
|
* Update `font/opentype` to registered `font/otf`
|
||||||
|
|
||||||
|
1.29.0 / 2017-07-10
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `application/fido.trusted-apps+json`
|
||||||
|
* Add extension `.wadl` to `application/vnd.sun.wadl+xml`
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Add `UTF-8` as default charset for `text/css`
|
||||||
|
|
||||||
|
1.28.0 / 2017-05-14
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Add extension `.gz` to `application/gzip`
|
||||||
|
* Update extensions `.md` and `.markdown` to be `text/markdown`
|
||||||
|
|
||||||
|
1.27.0 / 2017-03-16
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Add `image/apng` with extension `.apng`
|
||||||
|
|
||||||
|
1.26.0 / 2017-01-14
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Add extension `.geojson` to `application/geo+json`
|
||||||
|
|
||||||
|
1.25.0 / 2016-11-11
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add new upstream MIME types
|
||||||
|
|
||||||
|
1.24.0 / 2016-09-18
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `audio/mp3`
|
||||||
|
* Add new upstream MIME types
|
||||||
|
|
||||||
|
1.23.0 / 2016-05-01
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Add extension `.3gpp` to `audio/3gpp`
|
||||||
|
|
||||||
|
1.22.0 / 2016-02-15
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `text/slim`
|
||||||
|
* Add extension `.rng` to `application/xml`
|
||||||
|
* Add new upstream MIME types
|
||||||
|
* Fix extension of `application/dash+xml` to be `.mpd`
|
||||||
|
* Update primary extension to `.m4a` for `audio/mp4`
|
||||||
|
|
||||||
|
1.21.0 / 2016-01-06
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add Google document types
|
||||||
|
* Add new upstream MIME types
|
||||||
|
|
||||||
|
1.20.0 / 2015-11-10
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `text/x-suse-ymp`
|
||||||
|
* Add new upstream MIME types
|
||||||
|
|
||||||
|
1.19.0 / 2015-09-17
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `application/vnd.apple.pkpass`
|
||||||
|
* Add new upstream MIME types
|
||||||
|
|
||||||
|
1.18.0 / 2015-09-03
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add new upstream MIME types
|
||||||
|
|
||||||
|
1.17.0 / 2015-08-13
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `application/x-msdos-program`
|
||||||
|
* Add `audio/g711-0`
|
||||||
|
* Add `image/vnd.mozilla.apng`
|
||||||
|
* Add extension `.exe` to `application/x-msdos-program`
|
||||||
|
|
||||||
|
1.16.0 / 2015-07-29
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `application/vnd.uri-map`
|
||||||
|
|
||||||
|
1.15.0 / 2015-07-13
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `application/x-httpd-php`
|
||||||
|
|
||||||
|
1.14.0 / 2015-06-25
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `application/scim+json`
|
||||||
|
* Add `application/vnd.3gpp.ussd+xml`
|
||||||
|
* Add `application/vnd.biopax.rdf+xml`
|
||||||
|
* Add `text/x-processing`
|
||||||
|
|
||||||
|
1.13.0 / 2015-06-07
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add nginx as a source
|
||||||
|
* Add `application/x-cocoa`
|
||||||
|
* Add `application/x-java-archive-diff`
|
||||||
|
* Add `application/x-makeself`
|
||||||
|
* Add `application/x-perl`
|
||||||
|
* Add `application/x-pilot`
|
||||||
|
* Add `application/x-redhat-package-manager`
|
||||||
|
* Add `application/x-sea`
|
||||||
|
* Add `audio/x-m4a`
|
||||||
|
* Add `audio/x-realaudio`
|
||||||
|
* Add `image/x-jng`
|
||||||
|
* Add `text/mathml`
|
||||||
|
|
||||||
|
1.12.0 / 2015-06-05
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `application/bdoc`
|
||||||
|
* Add `application/vnd.hyperdrive+json`
|
||||||
|
* Add `application/x-bdoc`
|
||||||
|
* Add extension `.rtf` to `text/rtf`
|
||||||
|
|
||||||
|
1.11.0 / 2015-05-31
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `audio/wav`
|
||||||
|
* Add `audio/wave`
|
||||||
|
* Add extension `.litcoffee` to `text/coffeescript`
|
||||||
|
* Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data`
|
||||||
|
* Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install`
|
||||||
|
|
||||||
|
1.10.0 / 2015-05-19
|
||||||
|
===================
|
||||||
|
|
||||||
|
* Add `application/vnd.balsamiq.bmpr`
|
||||||
|
* Add `application/vnd.microsoft.portable-executable`
|
||||||
|
* Add `application/x-ns-proxy-autoconfig`
|
||||||
|
|
||||||
|
1.9.1 / 2015-04-19
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Remove `.json` extension from `application/manifest+json`
|
||||||
|
- This is causing bugs downstream
|
||||||
|
|
||||||
|
1.9.0 / 2015-04-19
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Add `application/manifest+json`
|
||||||
|
* Add `application/vnd.micro+json`
|
||||||
|
* Add `image/vnd.zbrush.pcx`
|
||||||
|
* Add `image/x-ms-bmp`
|
||||||
|
|
||||||
|
1.8.0 / 2015-03-13
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Add `application/vnd.citationstyles.style+xml`
|
||||||
|
* Add `application/vnd.fastcopy-disk-image`
|
||||||
|
* Add `application/vnd.gov.sk.xmldatacontainer+xml`
|
||||||
|
* Add extension `.jsonld` to `application/ld+json`
|
||||||
|
|
||||||
|
1.7.0 / 2015-02-08
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Add `application/vnd.gerber`
|
||||||
|
* Add `application/vnd.msa-disk-image`
|
||||||
|
|
||||||
|
1.6.1 / 2015-02-05
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Community extensions ownership transferred from `node-mime`
|
||||||
|
|
||||||
|
1.6.0 / 2015-01-29
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Add `application/jose`
|
||||||
|
* Add `application/jose+json`
|
||||||
|
* Add `application/json-seq`
|
||||||
|
* Add `application/jwk+json`
|
||||||
|
* Add `application/jwk-set+json`
|
||||||
|
* Add `application/jwt`
|
||||||
|
* Add `application/rdap+json`
|
||||||
|
* Add `application/vnd.gov.sk.e-form+xml`
|
||||||
|
* Add `application/vnd.ims.imsccv1p3`
|
||||||
|
|
||||||
|
1.5.0 / 2014-12-30
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Add `application/vnd.oracle.resource+json`
|
||||||
|
* Fix various invalid MIME type entries
|
||||||
|
- `application/mbox+xml`
|
||||||
|
- `application/oscp-response`
|
||||||
|
- `application/vwg-multiplexed`
|
||||||
|
- `audio/g721`
|
||||||
|
|
||||||
|
1.4.0 / 2014-12-21
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Add `application/vnd.ims.imsccv1p2`
|
||||||
|
* Fix various invalid MIME type entries
|
||||||
|
- `application/vnd-acucobol`
|
||||||
|
- `application/vnd-curl`
|
||||||
|
- `application/vnd-dart`
|
||||||
|
- `application/vnd-dxr`
|
||||||
|
- `application/vnd-fdf`
|
||||||
|
- `application/vnd-mif`
|
||||||
|
- `application/vnd-sema`
|
||||||
|
- `application/vnd-wap-wmlc`
|
||||||
|
- `application/vnd.adobe.flash-movie`
|
||||||
|
- `application/vnd.dece-zip`
|
||||||
|
- `application/vnd.dvb_service`
|
||||||
|
- `application/vnd.micrografx-igx`
|
||||||
|
- `application/vnd.sealed-doc`
|
||||||
|
- `application/vnd.sealed-eml`
|
||||||
|
- `application/vnd.sealed-mht`
|
||||||
|
- `application/vnd.sealed-ppt`
|
||||||
|
- `application/vnd.sealed-tiff`
|
||||||
|
- `application/vnd.sealed-xls`
|
||||||
|
- `application/vnd.sealedmedia.softseal-html`
|
||||||
|
- `application/vnd.sealedmedia.softseal-pdf`
|
||||||
|
- `application/vnd.wap-slc`
|
||||||
|
- `application/vnd.wap-wbxml`
|
||||||
|
- `audio/vnd.sealedmedia.softseal-mpeg`
|
||||||
|
- `image/vnd-djvu`
|
||||||
|
- `image/vnd-svf`
|
||||||
|
- `image/vnd-wap-wbmp`
|
||||||
|
- `image/vnd.sealed-png`
|
||||||
|
- `image/vnd.sealedmedia.softseal-gif`
|
||||||
|
- `image/vnd.sealedmedia.softseal-jpg`
|
||||||
|
- `model/vnd-dwf`
|
||||||
|
- `model/vnd.parasolid.transmit-binary`
|
||||||
|
- `model/vnd.parasolid.transmit-text`
|
||||||
|
- `text/vnd-a`
|
||||||
|
- `text/vnd-curl`
|
||||||
|
- `text/vnd.wap-wml`
|
||||||
|
* Remove example template MIME types
|
||||||
|
- `application/example`
|
||||||
|
- `audio/example`
|
||||||
|
- `image/example`
|
||||||
|
- `message/example`
|
||||||
|
- `model/example`
|
||||||
|
- `multipart/example`
|
||||||
|
- `text/example`
|
||||||
|
- `video/example`
|
||||||
|
|
||||||
|
1.3.1 / 2014-12-16
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Fix missing extensions
|
||||||
|
- `application/json5`
|
||||||
|
- `text/hjson`
|
||||||
|
|
||||||
|
1.3.0 / 2014-12-07
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Add `application/a2l`
|
||||||
|
* Add `application/aml`
|
||||||
|
* Add `application/atfx`
|
||||||
|
* Add `application/atxml`
|
||||||
|
* Add `application/cdfx+xml`
|
||||||
|
* Add `application/dii`
|
||||||
|
* Add `application/json5`
|
||||||
|
* Add `application/lxf`
|
||||||
|
* Add `application/mf4`
|
||||||
|
* Add `application/vnd.apache.thrift.compact`
|
||||||
|
* Add `application/vnd.apache.thrift.json`
|
||||||
|
* Add `application/vnd.coffeescript`
|
||||||
|
* Add `application/vnd.enphase.envoy`
|
||||||
|
* Add `application/vnd.ims.imsccv1p1`
|
||||||
|
* Add `text/csv-schema`
|
||||||
|
* Add `text/hjson`
|
||||||
|
* Add `text/markdown`
|
||||||
|
* Add `text/yaml`
|
||||||
|
|
||||||
|
1.2.0 / 2014-11-09
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Add `application/cea`
|
||||||
|
* Add `application/dit`
|
||||||
|
* Add `application/vnd.gov.sk.e-form+zip`
|
||||||
|
* Add `application/vnd.tmd.mediaflex.api+xml`
|
||||||
|
* Type `application/epub+zip` is now IANA-registered
|
||||||
|
|
||||||
|
1.1.2 / 2014-10-23
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Rebuild database for `application/x-www-form-urlencoded` change
|
||||||
|
|
||||||
|
1.1.1 / 2014-10-20
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Mark `application/x-www-form-urlencoded` as compressible.
|
||||||
|
|
||||||
|
1.1.0 / 2014-09-28
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Add `application/font-woff2`
|
||||||
|
|
||||||
|
1.0.3 / 2014-09-25
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Fix engine requirement in package
|
||||||
|
|
||||||
|
1.0.2 / 2014-09-25
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Add `application/coap-group+json`
|
||||||
|
* Add `application/dcd`
|
||||||
|
* Add `application/vnd.apache.thrift.binary`
|
||||||
|
* Add `image/vnd.tencent.tap`
|
||||||
|
* Mark all JSON-derived types as compressible
|
||||||
|
* Update `text/vtt` data
|
||||||
|
|
||||||
|
1.0.1 / 2014-08-30
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Fix extension ordering
|
||||||
|
|
||||||
|
1.0.0 / 2014-08-30
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Add `application/atf`
|
||||||
|
* Add `application/merge-patch+json`
|
||||||
|
* Add `multipart/x-mixed-replace`
|
||||||
|
* Add `source: 'apache'` metadata
|
||||||
|
* Add `source: 'iana'` metadata
|
||||||
|
* Remove badly-assumed charset data
|
||||||
23
node_modules/mime-db/LICENSE
generated
vendored
Normal file
23
node_modules/mime-db/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
(The MIT License)
|
||||||
|
|
||||||
|
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
||||||
|
Copyright (c) 2015-2022 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.
|
||||||
100
node_modules/mime-db/README.md
generated
vendored
Normal file
100
node_modules/mime-db/README.md
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
# mime-db
|
||||||
|
|
||||||
|
[![NPM Version][npm-version-image]][npm-url]
|
||||||
|
[![NPM Downloads][npm-downloads-image]][npm-url]
|
||||||
|
[![Node.js Version][node-image]][node-url]
|
||||||
|
[![Build Status][ci-image]][ci-url]
|
||||||
|
[![Coverage Status][coveralls-image]][coveralls-url]
|
||||||
|
|
||||||
|
This is a large database of mime types and information about them.
|
||||||
|
It consists of a single, public JSON file and does not include any logic,
|
||||||
|
allowing it to remain as un-opinionated as possible with an API.
|
||||||
|
It aggregates data from the following sources:
|
||||||
|
|
||||||
|
- http://www.iana.org/assignments/media-types/media-types.xhtml
|
||||||
|
- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
|
||||||
|
- http://hg.nginx.org/nginx/raw-file/default/conf/mime.types
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install mime-db
|
||||||
|
```
|
||||||
|
|
||||||
|
### Database Download
|
||||||
|
|
||||||
|
If you're crazy enough to use this in the browser, you can just grab the
|
||||||
|
JSON file using [jsDelivr](https://www.jsdelivr.com/). It is recommended to
|
||||||
|
replace `master` with [a release tag](https://github.com/jshttp/mime-db/tags)
|
||||||
|
as the JSON format may change in the future.
|
||||||
|
|
||||||
|
```
|
||||||
|
https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```js
|
||||||
|
var db = require('mime-db')
|
||||||
|
|
||||||
|
// grab data on .js files
|
||||||
|
var data = db['application/javascript']
|
||||||
|
```
|
||||||
|
|
||||||
|
## Data Structure
|
||||||
|
|
||||||
|
The JSON file is a map lookup for lowercased mime types.
|
||||||
|
Each mime type has the following properties:
|
||||||
|
|
||||||
|
- `.source` - where the mime type is defined.
|
||||||
|
If not set, it's probably a custom media type.
|
||||||
|
- `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)
|
||||||
|
- `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml)
|
||||||
|
- `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types)
|
||||||
|
- `.extensions[]` - known extensions associated with this mime type.
|
||||||
|
- `.compressible` - whether a file of this type can be gzipped.
|
||||||
|
- `.charset` - the default charset associated with this type, if any.
|
||||||
|
|
||||||
|
If unknown, every property could be `undefined`.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
To edit the database, only make PRs against `src/custom-types.json` or
|
||||||
|
`src/custom-suffix.json`.
|
||||||
|
|
||||||
|
The `src/custom-types.json` file is a JSON object with the MIME type as the
|
||||||
|
keys and the values being an object with the following keys:
|
||||||
|
|
||||||
|
- `compressible` - leave out if you don't know, otherwise `true`/`false` to
|
||||||
|
indicate whether the data represented by the type is typically compressible.
|
||||||
|
- `extensions` - include an array of file extensions that are associated with
|
||||||
|
the type.
|
||||||
|
- `notes` - human-readable notes about the type, typically what the type is.
|
||||||
|
- `sources` - include an array of URLs of where the MIME type and the associated
|
||||||
|
extensions are sourced from. This needs to be a [primary source](https://en.wikipedia.org/wiki/Primary_source);
|
||||||
|
links to type aggregating sites and Wikipedia are _not acceptable_.
|
||||||
|
|
||||||
|
To update the build, run `npm run build`.
|
||||||
|
|
||||||
|
### Adding Custom Media Types
|
||||||
|
|
||||||
|
The best way to get new media types included in this library is to register
|
||||||
|
them with the IANA. The community registration procedure is outlined in
|
||||||
|
[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types
|
||||||
|
registered with the IANA are automatically pulled into this library.
|
||||||
|
|
||||||
|
If that is not possible / feasible, they can be added directly here as a
|
||||||
|
"custom" type. To do this, it is required to have a primary source that
|
||||||
|
definitively lists the media type. If an extension is going to be listed as
|
||||||
|
associateed with this media type, the source must definitively link the
|
||||||
|
media type and extension as well.
|
||||||
|
|
||||||
|
[ci-image]: https://badgen.net/github/checks/jshttp/mime-db/master?label=ci
|
||||||
|
[ci-url]: https://github.com/jshttp/mime-db/actions?query=workflow%3Aci
|
||||||
|
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-db/master
|
||||||
|
[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master
|
||||||
|
[node-image]: https://badgen.net/npm/node/mime-db
|
||||||
|
[node-url]: https://nodejs.org/en/download
|
||||||
|
[npm-downloads-image]: https://badgen.net/npm/dm/mime-db
|
||||||
|
[npm-url]: https://npmjs.org/package/mime-db
|
||||||
|
[npm-version-image]: https://badgen.net/npm/v/mime-db
|
||||||
8519
node_modules/mime-db/db.json
generated
vendored
Normal file
8519
node_modules/mime-db/db.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
12
node_modules/mime-db/index.js
generated
vendored
Normal file
12
node_modules/mime-db/index.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/*!
|
||||||
|
* mime-db
|
||||||
|
* Copyright(c) 2014 Jonathan Ong
|
||||||
|
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
||||||
|
* MIT Licensed
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module exports.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = require('./db.json')
|
||||||
60
node_modules/mime-db/package.json
generated
vendored
Normal file
60
node_modules/mime-db/package.json
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
{
|
||||||
|
"name": "mime-db",
|
||||||
|
"description": "Media Type Database",
|
||||||
|
"version": "1.52.0",
|
||||||
|
"contributors": [
|
||||||
|
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||||
|
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)",
|
||||||
|
"Robert Kieffer <robert@broofa.com> (http://github.com/broofa)"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"keywords": [
|
||||||
|
"mime",
|
||||||
|
"db",
|
||||||
|
"type",
|
||||||
|
"types",
|
||||||
|
"database",
|
||||||
|
"charset",
|
||||||
|
"charsets"
|
||||||
|
],
|
||||||
|
"repository": "jshttp/mime-db",
|
||||||
|
"devDependencies": {
|
||||||
|
"bluebird": "3.7.2",
|
||||||
|
"co": "4.6.0",
|
||||||
|
"cogent": "1.0.1",
|
||||||
|
"csv-parse": "4.16.3",
|
||||||
|
"eslint": "7.32.0",
|
||||||
|
"eslint-config-standard": "15.0.1",
|
||||||
|
"eslint-plugin-import": "2.25.4",
|
||||||
|
"eslint-plugin-markdown": "2.2.1",
|
||||||
|
"eslint-plugin-node": "11.1.0",
|
||||||
|
"eslint-plugin-promise": "5.1.1",
|
||||||
|
"eslint-plugin-standard": "4.1.0",
|
||||||
|
"gnode": "0.1.2",
|
||||||
|
"media-typer": "1.1.0",
|
||||||
|
"mocha": "9.2.1",
|
||||||
|
"nyc": "15.1.0",
|
||||||
|
"raw-body": "2.5.0",
|
||||||
|
"stream-to-array": "2.3.0"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"HISTORY.md",
|
||||||
|
"LICENSE",
|
||||||
|
"README.md",
|
||||||
|
"db.json",
|
||||||
|
"index.js"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "node scripts/build",
|
||||||
|
"fetch": "node scripts/fetch-apache && gnode scripts/fetch-iana && node scripts/fetch-nginx",
|
||||||
|
"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",
|
||||||
|
"update": "npm run fetch && npm run build",
|
||||||
|
"version": "node scripts/version-history.js && git add HISTORY.md"
|
||||||
|
}
|
||||||
|
}
|
||||||
397
node_modules/mime-types/HISTORY.md
generated
vendored
Normal file
397
node_modules/mime-types/HISTORY.md
generated
vendored
Normal file
@@ -0,0 +1,397 @@
|
|||||||
|
2.1.35 / 2022-03-12
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@1.52.0
|
||||||
|
- Add extensions from IANA for more `image/*` types
|
||||||
|
- Add extension `.asc` to `application/pgp-keys`
|
||||||
|
- Add extensions to various XML types
|
||||||
|
- Add new upstream MIME types
|
||||||
|
|
||||||
|
2.1.34 / 2021-11-08
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@1.51.0
|
||||||
|
- Add new upstream MIME types
|
||||||
|
|
||||||
|
2.1.33 / 2021-10-01
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@1.50.0
|
||||||
|
- Add deprecated iWorks mime types and extensions
|
||||||
|
- Add new upstream MIME types
|
||||||
|
|
||||||
|
2.1.32 / 2021-07-27
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@1.49.0
|
||||||
|
- Add extension `.trig` to `application/trig`
|
||||||
|
- Add new upstream MIME types
|
||||||
|
|
||||||
|
2.1.31 / 2021-06-01
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@1.48.0
|
||||||
|
- Add extension `.mvt` to `application/vnd.mapbox-vector-tile`
|
||||||
|
- Add new upstream MIME types
|
||||||
|
|
||||||
|
2.1.30 / 2021-04-02
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@1.47.0
|
||||||
|
- Add extension `.amr` to `audio/amr`
|
||||||
|
- Remove ambigious extensions from IANA for `application/*+xml` types
|
||||||
|
- Update primary extension to `.es` for `application/ecmascript`
|
||||||
|
|
||||||
|
2.1.29 / 2021-02-17
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@1.46.0
|
||||||
|
- Add extension `.amr` to `audio/amr`
|
||||||
|
- Add extension `.m4s` to `video/iso.segment`
|
||||||
|
- Add extension `.opus` to `audio/ogg`
|
||||||
|
- Add new upstream MIME types
|
||||||
|
|
||||||
|
2.1.28 / 2021-01-01
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@1.45.0
|
||||||
|
- Add `application/ubjson` with extension `.ubj`
|
||||||
|
- Add `image/avif` with extension `.avif`
|
||||||
|
- Add `image/ktx2` with extension `.ktx2`
|
||||||
|
- Add extension `.dbf` to `application/vnd.dbf`
|
||||||
|
- Add extension `.rar` to `application/vnd.rar`
|
||||||
|
- Add extension `.td` to `application/urc-targetdesc+xml`
|
||||||
|
- Add new upstream MIME types
|
||||||
|
- Fix extension of `application/vnd.apple.keynote` to be `.key`
|
||||||
|
|
||||||
|
2.1.27 / 2020-04-23
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@1.44.0
|
||||||
|
- Add charsets from IANA
|
||||||
|
- Add extension `.cjs` to `application/node`
|
||||||
|
- Add new upstream MIME types
|
||||||
|
|
||||||
|
2.1.26 / 2020-01-05
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@1.43.0
|
||||||
|
- Add `application/x-keepass2` with extension `.kdbx`
|
||||||
|
- Add extension `.mxmf` to `audio/mobile-xmf`
|
||||||
|
- Add extensions from IANA for `application/*+xml` types
|
||||||
|
- Add new upstream MIME types
|
||||||
|
|
||||||
|
2.1.25 / 2019-11-12
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@1.42.0
|
||||||
|
- Add new upstream MIME types
|
||||||
|
- Add `application/toml` with extension `.toml`
|
||||||
|
- Add `image/vnd.ms-dds` with extension `.dds`
|
||||||
|
|
||||||
|
2.1.24 / 2019-04-20
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@1.40.0
|
||||||
|
- Add extensions from IANA for `model/*` types
|
||||||
|
- Add `text/mdx` with extension `.mdx`
|
||||||
|
|
||||||
|
2.1.23 / 2019-04-17
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.39.0
|
||||||
|
- Add extensions `.siv` and `.sieve` to `application/sieve`
|
||||||
|
- Add new upstream MIME types
|
||||||
|
|
||||||
|
2.1.22 / 2019-02-14
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.38.0
|
||||||
|
- Add extension `.nq` to `application/n-quads`
|
||||||
|
- Add extension `.nt` to `application/n-triples`
|
||||||
|
- Add new upstream MIME types
|
||||||
|
|
||||||
|
2.1.21 / 2018-10-19
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.37.0
|
||||||
|
- Add extensions to HEIC image types
|
||||||
|
- Add new upstream MIME types
|
||||||
|
|
||||||
|
2.1.20 / 2018-08-26
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.36.0
|
||||||
|
- Add Apple file extensions from IANA
|
||||||
|
- Add extensions from IANA for `image/*` types
|
||||||
|
- Add new upstream MIME types
|
||||||
|
|
||||||
|
2.1.19 / 2018-07-17
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.35.0
|
||||||
|
- Add extension `.csl` to `application/vnd.citationstyles.style+xml`
|
||||||
|
- Add extension `.es` to `application/ecmascript`
|
||||||
|
- Add extension `.owl` to `application/rdf+xml`
|
||||||
|
- Add new upstream MIME types
|
||||||
|
- Add UTF-8 as default charset for `text/turtle`
|
||||||
|
|
||||||
|
2.1.18 / 2018-02-16
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.33.0
|
||||||
|
- Add `application/raml+yaml` with extension `.raml`
|
||||||
|
- Add `application/wasm` with extension `.wasm`
|
||||||
|
- Add `text/shex` with extension `.shex`
|
||||||
|
- Add extensions for JPEG-2000 images
|
||||||
|
- Add extensions from IANA for `message/*` types
|
||||||
|
- Add new upstream MIME types
|
||||||
|
- Update font MIME types
|
||||||
|
- Update `text/hjson` to registered `application/hjson`
|
||||||
|
|
||||||
|
2.1.17 / 2017-09-01
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.30.0
|
||||||
|
- Add `application/vnd.ms-outlook`
|
||||||
|
- Add `application/x-arj`
|
||||||
|
- Add extension `.mjs` to `application/javascript`
|
||||||
|
- Add glTF types and extensions
|
||||||
|
- Add new upstream MIME types
|
||||||
|
- Add `text/x-org`
|
||||||
|
- Add VirtualBox MIME types
|
||||||
|
- Fix `source` records for `video/*` types that are IANA
|
||||||
|
- Update `font/opentype` to registered `font/otf`
|
||||||
|
|
||||||
|
2.1.16 / 2017-07-24
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.29.0
|
||||||
|
- Add `application/fido.trusted-apps+json`
|
||||||
|
- Add extension `.wadl` to `application/vnd.sun.wadl+xml`
|
||||||
|
- Add extension `.gz` to `application/gzip`
|
||||||
|
- Add new upstream MIME types
|
||||||
|
- Update extensions `.md` and `.markdown` to be `text/markdown`
|
||||||
|
|
||||||
|
2.1.15 / 2017-03-23
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.27.0
|
||||||
|
- Add new mime types
|
||||||
|
- Add `image/apng`
|
||||||
|
|
||||||
|
2.1.14 / 2017-01-14
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.26.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.1.13 / 2016-11-18
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.25.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.1.12 / 2016-09-18
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.24.0
|
||||||
|
- Add new mime types
|
||||||
|
- Add `audio/mp3`
|
||||||
|
|
||||||
|
2.1.11 / 2016-05-01
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.23.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.1.10 / 2016-02-15
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.22.0
|
||||||
|
- Add new mime types
|
||||||
|
- Fix extension of `application/dash+xml`
|
||||||
|
- Update primary extension for `audio/mp4`
|
||||||
|
|
||||||
|
2.1.9 / 2016-01-06
|
||||||
|
==================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.21.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.1.8 / 2015-11-30
|
||||||
|
==================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.20.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.1.7 / 2015-09-20
|
||||||
|
==================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.19.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.1.6 / 2015-09-03
|
||||||
|
==================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.18.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.1.5 / 2015-08-20
|
||||||
|
==================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.17.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.1.4 / 2015-07-30
|
||||||
|
==================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.16.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.1.3 / 2015-07-13
|
||||||
|
==================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.15.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.1.2 / 2015-06-25
|
||||||
|
==================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.14.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.1.1 / 2015-06-08
|
||||||
|
==================
|
||||||
|
|
||||||
|
* perf: fix deopt during mapping
|
||||||
|
|
||||||
|
2.1.0 / 2015-06-07
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Fix incorrectly treating extension-less file name as extension
|
||||||
|
- i.e. `'path/to/json'` will no longer return `application/json`
|
||||||
|
* Fix `.charset(type)` to accept parameters
|
||||||
|
* Fix `.charset(type)` to match case-insensitive
|
||||||
|
* Improve generation of extension to MIME mapping
|
||||||
|
* Refactor internals for readability and no argument reassignment
|
||||||
|
* Prefer `application/*` MIME types from the same source
|
||||||
|
* Prefer any type over `application/octet-stream`
|
||||||
|
* deps: mime-db@~1.13.0
|
||||||
|
- Add nginx as a source
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.0.14 / 2015-06-06
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.12.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.0.13 / 2015-05-31
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.11.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.0.12 / 2015-05-19
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.10.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.0.11 / 2015-05-05
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.9.1
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.0.10 / 2015-03-13
|
||||||
|
===================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.8.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.0.9 / 2015-02-09
|
||||||
|
==================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.7.0
|
||||||
|
- Add new mime types
|
||||||
|
- Community extensions ownership transferred from `node-mime`
|
||||||
|
|
||||||
|
2.0.8 / 2015-01-29
|
||||||
|
==================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.6.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.0.7 / 2014-12-30
|
||||||
|
==================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.5.0
|
||||||
|
- Add new mime types
|
||||||
|
- Fix various invalid MIME type entries
|
||||||
|
|
||||||
|
2.0.6 / 2014-12-30
|
||||||
|
==================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.4.0
|
||||||
|
- Add new mime types
|
||||||
|
- Fix various invalid MIME type entries
|
||||||
|
- Remove example template MIME types
|
||||||
|
|
||||||
|
2.0.5 / 2014-12-29
|
||||||
|
==================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.3.1
|
||||||
|
- Fix missing extensions
|
||||||
|
|
||||||
|
2.0.4 / 2014-12-10
|
||||||
|
==================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.3.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.0.3 / 2014-11-09
|
||||||
|
==================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.2.0
|
||||||
|
- Add new mime types
|
||||||
|
|
||||||
|
2.0.2 / 2014-09-28
|
||||||
|
==================
|
||||||
|
|
||||||
|
* deps: mime-db@~1.1.0
|
||||||
|
- Add new mime types
|
||||||
|
- Update charsets
|
||||||
|
|
||||||
|
2.0.1 / 2014-09-07
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Support Node.js 0.6
|
||||||
|
|
||||||
|
2.0.0 / 2014-09-02
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Use `mime-db`
|
||||||
|
* Remove `.define()`
|
||||||
|
|
||||||
|
1.0.2 / 2014-08-04
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Set charset=utf-8 for `text/javascript`
|
||||||
|
|
||||||
|
1.0.1 / 2014-06-24
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Add `text/jsx` type
|
||||||
|
|
||||||
|
1.0.0 / 2014-05-12
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Return `false` for unknown types
|
||||||
|
* Set charset=utf-8 for `application/json`
|
||||||
|
|
||||||
|
0.1.0 / 2014-05-02
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Initial release
|
||||||
23
node_modules/mime-types/LICENSE
generated
vendored
Normal file
23
node_modules/mime-types/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
(The MIT License)
|
||||||
|
|
||||||
|
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
||||||
|
Copyright (c) 2015 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.
|
||||||
113
node_modules/mime-types/README.md
generated
vendored
Normal file
113
node_modules/mime-types/README.md
generated
vendored
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
# mime-types
|
||||||
|
|
||||||
|
[![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][ci-image]][ci-url]
|
||||||
|
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||||
|
|
||||||
|
The ultimate javascript content-type utility.
|
||||||
|
|
||||||
|
Similar to [the `mime@1.x` module](https://www.npmjs.com/package/mime), except:
|
||||||
|
|
||||||
|
- __No fallbacks.__ Instead of naively returning the first available type,
|
||||||
|
`mime-types` simply returns `false`, so do
|
||||||
|
`var type = mime.lookup('unrecognized') || 'application/octet-stream'`.
|
||||||
|
- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.
|
||||||
|
- No `.define()` functionality
|
||||||
|
- Bug fixes for `.lookup(path)`
|
||||||
|
|
||||||
|
Otherwise, the API is compatible with `mime` 1.x.
|
||||||
|
|
||||||
|
## 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):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm install mime-types
|
||||||
|
```
|
||||||
|
|
||||||
|
## Adding Types
|
||||||
|
|
||||||
|
All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db),
|
||||||
|
so open a PR there if you'd like to add mime types.
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
```js
|
||||||
|
var mime = require('mime-types')
|
||||||
|
```
|
||||||
|
|
||||||
|
All functions return `false` if input is invalid or not found.
|
||||||
|
|
||||||
|
### mime.lookup(path)
|
||||||
|
|
||||||
|
Lookup the content-type associated with a file.
|
||||||
|
|
||||||
|
```js
|
||||||
|
mime.lookup('json') // 'application/json'
|
||||||
|
mime.lookup('.md') // 'text/markdown'
|
||||||
|
mime.lookup('file.html') // 'text/html'
|
||||||
|
mime.lookup('folder/file.js') // 'application/javascript'
|
||||||
|
mime.lookup('folder/.htaccess') // false
|
||||||
|
|
||||||
|
mime.lookup('cats') // false
|
||||||
|
```
|
||||||
|
|
||||||
|
### mime.contentType(type)
|
||||||
|
|
||||||
|
Create a full content-type header given a content-type or extension.
|
||||||
|
When given an extension, `mime.lookup` is used to get the matching
|
||||||
|
content-type, otherwise the given content-type is used. Then if the
|
||||||
|
content-type does not already have a `charset` parameter, `mime.charset`
|
||||||
|
is used to get the default charset and add to the returned content-type.
|
||||||
|
|
||||||
|
```js
|
||||||
|
mime.contentType('markdown') // 'text/x-markdown; charset=utf-8'
|
||||||
|
mime.contentType('file.json') // 'application/json; charset=utf-8'
|
||||||
|
mime.contentType('text/html') // 'text/html; charset=utf-8'
|
||||||
|
mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1'
|
||||||
|
|
||||||
|
// from a full path
|
||||||
|
mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8'
|
||||||
|
```
|
||||||
|
|
||||||
|
### mime.extension(type)
|
||||||
|
|
||||||
|
Get the default extension for a content-type.
|
||||||
|
|
||||||
|
```js
|
||||||
|
mime.extension('application/octet-stream') // 'bin'
|
||||||
|
```
|
||||||
|
|
||||||
|
### mime.charset(type)
|
||||||
|
|
||||||
|
Lookup the implied default charset of a content-type.
|
||||||
|
|
||||||
|
```js
|
||||||
|
mime.charset('text/markdown') // 'UTF-8'
|
||||||
|
```
|
||||||
|
|
||||||
|
### var type = mime.types[extension]
|
||||||
|
|
||||||
|
A map of content-types by extension.
|
||||||
|
|
||||||
|
### [extensions...] = mime.extensions[type]
|
||||||
|
|
||||||
|
A map of extensions by content-type.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
[MIT](LICENSE)
|
||||||
|
|
||||||
|
[ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci
|
||||||
|
[ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml
|
||||||
|
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master
|
||||||
|
[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master
|
||||||
|
[node-version-image]: https://badgen.net/npm/node/mime-types
|
||||||
|
[node-version-url]: https://nodejs.org/en/download
|
||||||
|
[npm-downloads-image]: https://badgen.net/npm/dm/mime-types
|
||||||
|
[npm-url]: https://npmjs.org/package/mime-types
|
||||||
|
[npm-version-image]: https://badgen.net/npm/v/mime-types
|
||||||
188
node_modules/mime-types/index.js
generated
vendored
Normal file
188
node_modules/mime-types/index.js
generated
vendored
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
/*!
|
||||||
|
* mime-types
|
||||||
|
* Copyright(c) 2014 Jonathan Ong
|
||||||
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||||
|
* MIT Licensed
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module dependencies.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
var db = require('mime-db')
|
||||||
|
var extname = require('path').extname
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module variables.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/
|
||||||
|
var TEXT_TYPE_REGEXP = /^text\//i
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module exports.
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
|
||||||
|
exports.charset = charset
|
||||||
|
exports.charsets = { lookup: charset }
|
||||||
|
exports.contentType = contentType
|
||||||
|
exports.extension = extension
|
||||||
|
exports.extensions = Object.create(null)
|
||||||
|
exports.lookup = lookup
|
||||||
|
exports.types = Object.create(null)
|
||||||
|
|
||||||
|
// Populate the extensions/types maps
|
||||||
|
populateMaps(exports.extensions, exports.types)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the default charset for a MIME type.
|
||||||
|
*
|
||||||
|
* @param {string} type
|
||||||
|
* @return {boolean|string}
|
||||||
|
*/
|
||||||
|
|
||||||
|
function charset (type) {
|
||||||
|
if (!type || typeof type !== 'string') {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: use media-typer
|
||||||
|
var match = EXTRACT_TYPE_REGEXP.exec(type)
|
||||||
|
var mime = match && db[match[1].toLowerCase()]
|
||||||
|
|
||||||
|
if (mime && mime.charset) {
|
||||||
|
return mime.charset
|
||||||
|
}
|
||||||
|
|
||||||
|
// default text/* to utf-8
|
||||||
|
if (match && TEXT_TYPE_REGEXP.test(match[1])) {
|
||||||
|
return 'UTF-8'
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a full Content-Type header given a MIME type or extension.
|
||||||
|
*
|
||||||
|
* @param {string} str
|
||||||
|
* @return {boolean|string}
|
||||||
|
*/
|
||||||
|
|
||||||
|
function contentType (str) {
|
||||||
|
// TODO: should this even be in this module?
|
||||||
|
if (!str || typeof str !== 'string') {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
var mime = str.indexOf('/') === -1
|
||||||
|
? exports.lookup(str)
|
||||||
|
: str
|
||||||
|
|
||||||
|
if (!mime) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: use content-type or other module
|
||||||
|
if (mime.indexOf('charset') === -1) {
|
||||||
|
var charset = exports.charset(mime)
|
||||||
|
if (charset) mime += '; charset=' + charset.toLowerCase()
|
||||||
|
}
|
||||||
|
|
||||||
|
return mime
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the default extension for a MIME type.
|
||||||
|
*
|
||||||
|
* @param {string} type
|
||||||
|
* @return {boolean|string}
|
||||||
|
*/
|
||||||
|
|
||||||
|
function extension (type) {
|
||||||
|
if (!type || typeof type !== 'string') {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: use media-typer
|
||||||
|
var match = EXTRACT_TYPE_REGEXP.exec(type)
|
||||||
|
|
||||||
|
// get extensions
|
||||||
|
var exts = match && exports.extensions[match[1].toLowerCase()]
|
||||||
|
|
||||||
|
if (!exts || !exts.length) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return exts[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lookup the MIME type for a file path/extension.
|
||||||
|
*
|
||||||
|
* @param {string} path
|
||||||
|
* @return {boolean|string}
|
||||||
|
*/
|
||||||
|
|
||||||
|
function lookup (path) {
|
||||||
|
if (!path || typeof path !== 'string') {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// get the extension ("ext" or ".ext" or full path)
|
||||||
|
var extension = extname('x.' + path)
|
||||||
|
.toLowerCase()
|
||||||
|
.substr(1)
|
||||||
|
|
||||||
|
if (!extension) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return exports.types[extension] || false
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populate the extensions and types maps.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
|
||||||
|
function populateMaps (extensions, types) {
|
||||||
|
// source preference (least -> most)
|
||||||
|
var preference = ['nginx', 'apache', undefined, 'iana']
|
||||||
|
|
||||||
|
Object.keys(db).forEach(function forEachMimeType (type) {
|
||||||
|
var mime = db[type]
|
||||||
|
var exts = mime.extensions
|
||||||
|
|
||||||
|
if (!exts || !exts.length) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// mime -> extensions
|
||||||
|
extensions[type] = exts
|
||||||
|
|
||||||
|
// extension -> mime
|
||||||
|
for (var i = 0; i < exts.length; i++) {
|
||||||
|
var extension = exts[i]
|
||||||
|
|
||||||
|
if (types[extension]) {
|
||||||
|
var from = preference.indexOf(db[types[extension]].source)
|
||||||
|
var to = preference.indexOf(mime.source)
|
||||||
|
|
||||||
|
if (types[extension] !== 'application/octet-stream' &&
|
||||||
|
(from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {
|
||||||
|
// skip the remapping
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the extension -> mime
|
||||||
|
types[extension] = type
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
44
node_modules/mime-types/package.json
generated
vendored
Normal file
44
node_modules/mime-types/package.json
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
"name": "mime-types",
|
||||||
|
"description": "The ultimate javascript content-type utility.",
|
||||||
|
"version": "2.1.35",
|
||||||
|
"contributors": [
|
||||||
|
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||||
|
"Jeremiah Senkpiel <fishrock123@rocketmail.com> (https://searchbeam.jit.su)",
|
||||||
|
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"keywords": [
|
||||||
|
"mime",
|
||||||
|
"types"
|
||||||
|
],
|
||||||
|
"repository": "jshttp/mime-types",
|
||||||
|
"dependencies": {
|
||||||
|
"mime-db": "1.52.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "7.32.0",
|
||||||
|
"eslint-config-standard": "14.1.1",
|
||||||
|
"eslint-plugin-import": "2.25.4",
|
||||||
|
"eslint-plugin-markdown": "2.2.1",
|
||||||
|
"eslint-plugin-node": "11.1.0",
|
||||||
|
"eslint-plugin-promise": "5.2.0",
|
||||||
|
"eslint-plugin-standard": "4.1.0",
|
||||||
|
"mocha": "9.2.2",
|
||||||
|
"nyc": "15.1.0"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"HISTORY.md",
|
||||||
|
"LICENSE",
|
||||||
|
"index.js"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint .",
|
||||||
|
"test": "mocha --reporter spec test/test.js",
|
||||||
|
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
|
||||||
|
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
||||||
|
}
|
||||||
|
}
|
||||||
29
node_modules/proxy-from-env/.eslintrc
generated
vendored
Normal file
29
node_modules/proxy-from-env/.eslintrc
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"array-bracket-spacing": [2, "never"],
|
||||||
|
"block-scoped-var": 2,
|
||||||
|
"brace-style": [2, "1tbs"],
|
||||||
|
"camelcase": 1,
|
||||||
|
"computed-property-spacing": [2, "never"],
|
||||||
|
"curly": 2,
|
||||||
|
"eol-last": 2,
|
||||||
|
"eqeqeq": [2, "smart"],
|
||||||
|
"max-depth": [1, 3],
|
||||||
|
"max-len": [1, 80],
|
||||||
|
"max-statements": [1, 15],
|
||||||
|
"new-cap": 1,
|
||||||
|
"no-extend-native": 2,
|
||||||
|
"no-mixed-spaces-and-tabs": 2,
|
||||||
|
"no-trailing-spaces": 2,
|
||||||
|
"no-unused-vars": 1,
|
||||||
|
"no-use-before-define": [2, "nofunc"],
|
||||||
|
"object-curly-spacing": [2, "never"],
|
||||||
|
"quotes": [2, "single", "avoid-escape"],
|
||||||
|
"semi": [2, "always"],
|
||||||
|
"keyword-spacing": [2, {"before": true, "after": true}],
|
||||||
|
"space-unary-ops": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
10
node_modules/proxy-from-env/.travis.yml
generated
vendored
Normal file
10
node_modules/proxy-from-env/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- node
|
||||||
|
- lts/*
|
||||||
|
script:
|
||||||
|
- npm run lint
|
||||||
|
# test-coverage will also run the tests, but does not print helpful output upon test failure.
|
||||||
|
# So we also run the tests separately.
|
||||||
|
- npm run test
|
||||||
|
- npm run test-coverage && cat coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf coverage
|
||||||
20
node_modules/proxy-from-env/LICENSE
generated
vendored
Normal file
20
node_modules/proxy-from-env/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
The MIT License
|
||||||
|
|
||||||
|
Copyright (C) 2016-2018 Rob Wu <rob@robwu.nl>
|
||||||
|
|
||||||
|
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.
|
||||||
131
node_modules/proxy-from-env/README.md
generated
vendored
Normal file
131
node_modules/proxy-from-env/README.md
generated
vendored
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
# proxy-from-env
|
||||||
|
|
||||||
|
[](https://travis-ci.org/Rob--W/proxy-from-env)
|
||||||
|
[](https://coveralls.io/github/Rob--W/proxy-from-env?branch=master)
|
||||||
|
|
||||||
|
`proxy-from-env` is a Node.js package that exports a function (`getProxyForUrl`)
|
||||||
|
that takes an input URL (a string or
|
||||||
|
[`url.parse`](https://nodejs.org/docs/latest/api/url.html#url_url_parsing)'s
|
||||||
|
return value) and returns the desired proxy URL (also a string) based on
|
||||||
|
standard proxy environment variables. If no proxy is set, an empty string is
|
||||||
|
returned.
|
||||||
|
|
||||||
|
It is your responsibility to actually proxy the request using the given URL.
|
||||||
|
|
||||||
|
Installation:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install proxy-from-env
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example
|
||||||
|
This example shows how the data for a URL can be fetched via the
|
||||||
|
[`http` module](https://nodejs.org/api/http.html), in a proxy-aware way.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var http = require('http');
|
||||||
|
var parseUrl = require('url').parse;
|
||||||
|
var getProxyForUrl = require('proxy-from-env').getProxyForUrl;
|
||||||
|
|
||||||
|
var some_url = 'http://example.com/something';
|
||||||
|
|
||||||
|
// // Example, if there is a proxy server at 10.0.0.1:1234, then setting the
|
||||||
|
// // http_proxy environment variable causes the request to go through a proxy.
|
||||||
|
// process.env.http_proxy = 'http://10.0.0.1:1234';
|
||||||
|
//
|
||||||
|
// // But if the host to be proxied is listed in NO_PROXY, then the request is
|
||||||
|
// // not proxied (but a direct request is made).
|
||||||
|
// process.env.no_proxy = 'example.com';
|
||||||
|
|
||||||
|
var proxy_url = getProxyForUrl(some_url); // <-- Our magic.
|
||||||
|
if (proxy_url) {
|
||||||
|
// Should be proxied through proxy_url.
|
||||||
|
var parsed_some_url = parseUrl(some_url);
|
||||||
|
var parsed_proxy_url = parseUrl(proxy_url);
|
||||||
|
// A HTTP proxy is quite simple. It is similar to a normal request, except the
|
||||||
|
// path is an absolute URL, and the proxied URL's host is put in the header
|
||||||
|
// instead of the server's actual host.
|
||||||
|
httpOptions = {
|
||||||
|
protocol: parsed_proxy_url.protocol,
|
||||||
|
hostname: parsed_proxy_url.hostname,
|
||||||
|
port: parsed_proxy_url.port,
|
||||||
|
path: parsed_some_url.href,
|
||||||
|
headers: {
|
||||||
|
Host: parsed_some_url.host, // = host name + optional port.
|
||||||
|
},
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// Direct request.
|
||||||
|
httpOptions = some_url;
|
||||||
|
}
|
||||||
|
http.get(httpOptions, function(res) {
|
||||||
|
var responses = [];
|
||||||
|
res.on('data', function(chunk) { responses.push(chunk); });
|
||||||
|
res.on('end', function() { console.log(responses.join('')); });
|
||||||
|
});
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Environment variables
|
||||||
|
The environment variables can be specified in lowercase or uppercase, with the
|
||||||
|
lowercase name having precedence over the uppercase variant. A variable that is
|
||||||
|
not set has the same meaning as a variable that is set but has no value.
|
||||||
|
|
||||||
|
### NO\_PROXY
|
||||||
|
|
||||||
|
`NO_PROXY` is a list of host names (optionally with a port). If the input URL
|
||||||
|
matches any of the entries in `NO_PROXY`, then the input URL should be fetched
|
||||||
|
by a direct request (i.e. without a proxy).
|
||||||
|
|
||||||
|
Matching follows the following rules:
|
||||||
|
|
||||||
|
- `NO_PROXY=*` disables all proxies.
|
||||||
|
- Space and commas may be used to separate the entries in the `NO_PROXY` list.
|
||||||
|
- If `NO_PROXY` does not contain any entries, then proxies are never disabled.
|
||||||
|
- If a port is added after the host name, then the ports must match. If the URL
|
||||||
|
does not have an explicit port name, the protocol's default port is used.
|
||||||
|
- Generally, the proxy is only disabled if the host name is an exact match for
|
||||||
|
an entry in the `NO_PROXY` list. The only exceptions are entries that start
|
||||||
|
with a dot or with a wildcard; then the proxy is disabled if the host name
|
||||||
|
ends with the entry.
|
||||||
|
|
||||||
|
See `test.js` for examples of what should match and what does not.
|
||||||
|
|
||||||
|
### \*\_PROXY
|
||||||
|
|
||||||
|
The environment variable used for the proxy depends on the protocol of the URL.
|
||||||
|
For example, `https://example.com` uses the "https" protocol, and therefore the
|
||||||
|
proxy to be used is `HTTPS_PROXY` (_NOT_ `HTTP_PROXY`, which is _only_ used for
|
||||||
|
http:-URLs).
|
||||||
|
|
||||||
|
The library is not limited to http(s), other schemes such as
|
||||||
|
`FTP_PROXY` (ftp:),
|
||||||
|
`WSS_PROXY` (wss:),
|
||||||
|
`WS_PROXY` (ws:)
|
||||||
|
are also supported.
|
||||||
|
|
||||||
|
If present, `ALL_PROXY` is used as fallback if there is no other match.
|
||||||
|
|
||||||
|
|
||||||
|
## External resources
|
||||||
|
The exact way of parsing the environment variables is not codified in any
|
||||||
|
standard. This library is designed to be compatible with formats as expected by
|
||||||
|
existing software.
|
||||||
|
The following resources were used to determine the desired behavior:
|
||||||
|
|
||||||
|
- cURL:
|
||||||
|
https://curl.haxx.se/docs/manpage.html#ENVIRONMENT
|
||||||
|
https://github.com/curl/curl/blob/4af40b3646d3b09f68e419f7ca866ff395d1f897/lib/url.c#L4446-L4514
|
||||||
|
https://github.com/curl/curl/blob/4af40b3646d3b09f68e419f7ca866ff395d1f897/lib/url.c#L4608-L4638
|
||||||
|
|
||||||
|
- wget:
|
||||||
|
https://www.gnu.org/software/wget/manual/wget.html#Proxies
|
||||||
|
http://git.savannah.gnu.org/cgit/wget.git/tree/src/init.c?id=636a5f9a1c508aa39e35a3a8e9e54520a284d93d#n383
|
||||||
|
http://git.savannah.gnu.org/cgit/wget.git/tree/src/retr.c?id=93c1517c4071c4288ba5a4b038e7634e4c6b5482#n1278
|
||||||
|
|
||||||
|
- W3:
|
||||||
|
https://www.w3.org/Daemon/User/Proxies/ProxyClients.html
|
||||||
|
|
||||||
|
- Python's urllib:
|
||||||
|
https://github.com/python/cpython/blob/936135bb97fe04223aa30ca6e98eac8f3ed6b349/Lib/urllib/request.py#L755-L782
|
||||||
|
https://github.com/python/cpython/blob/936135bb97fe04223aa30ca6e98eac8f3ed6b349/Lib/urllib/request.py#L2444-L2479
|
||||||
108
node_modules/proxy-from-env/index.js
generated
vendored
Normal file
108
node_modules/proxy-from-env/index.js
generated
vendored
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
var parseUrl = require('url').parse;
|
||||||
|
|
||||||
|
var DEFAULT_PORTS = {
|
||||||
|
ftp: 21,
|
||||||
|
gopher: 70,
|
||||||
|
http: 80,
|
||||||
|
https: 443,
|
||||||
|
ws: 80,
|
||||||
|
wss: 443,
|
||||||
|
};
|
||||||
|
|
||||||
|
var stringEndsWith = String.prototype.endsWith || function(s) {
|
||||||
|
return s.length <= this.length &&
|
||||||
|
this.indexOf(s, this.length - s.length) !== -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string|object} url - The URL, or the result from url.parse.
|
||||||
|
* @return {string} The URL of the proxy that should handle the request to the
|
||||||
|
* given URL. If no proxy is set, this will be an empty string.
|
||||||
|
*/
|
||||||
|
function getProxyForUrl(url) {
|
||||||
|
var parsedUrl = typeof url === 'string' ? parseUrl(url) : url || {};
|
||||||
|
var proto = parsedUrl.protocol;
|
||||||
|
var hostname = parsedUrl.host;
|
||||||
|
var port = parsedUrl.port;
|
||||||
|
if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') {
|
||||||
|
return ''; // Don't proxy URLs without a valid scheme or host.
|
||||||
|
}
|
||||||
|
|
||||||
|
proto = proto.split(':', 1)[0];
|
||||||
|
// Stripping ports in this way instead of using parsedUrl.hostname to make
|
||||||
|
// sure that the brackets around IPv6 addresses are kept.
|
||||||
|
hostname = hostname.replace(/:\d*$/, '');
|
||||||
|
port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
|
||||||
|
if (!shouldProxy(hostname, port)) {
|
||||||
|
return ''; // Don't proxy URLs that match NO_PROXY.
|
||||||
|
}
|
||||||
|
|
||||||
|
var proxy =
|
||||||
|
getEnv('npm_config_' + proto + '_proxy') ||
|
||||||
|
getEnv(proto + '_proxy') ||
|
||||||
|
getEnv('npm_config_proxy') ||
|
||||||
|
getEnv('all_proxy');
|
||||||
|
if (proxy && proxy.indexOf('://') === -1) {
|
||||||
|
// Missing scheme in proxy, default to the requested URL's scheme.
|
||||||
|
proxy = proto + '://' + proxy;
|
||||||
|
}
|
||||||
|
return proxy;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines whether a given URL should be proxied.
|
||||||
|
*
|
||||||
|
* @param {string} hostname - The host name of the URL.
|
||||||
|
* @param {number} port - The effective port of the URL.
|
||||||
|
* @returns {boolean} Whether the given URL should be proxied.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
function shouldProxy(hostname, port) {
|
||||||
|
var NO_PROXY =
|
||||||
|
(getEnv('npm_config_no_proxy') || getEnv('no_proxy')).toLowerCase();
|
||||||
|
if (!NO_PROXY) {
|
||||||
|
return true; // Always proxy if NO_PROXY is not set.
|
||||||
|
}
|
||||||
|
if (NO_PROXY === '*') {
|
||||||
|
return false; // Never proxy if wildcard is set.
|
||||||
|
}
|
||||||
|
|
||||||
|
return NO_PROXY.split(/[,\s]/).every(function(proxy) {
|
||||||
|
if (!proxy) {
|
||||||
|
return true; // Skip zero-length hosts.
|
||||||
|
}
|
||||||
|
var parsedProxy = proxy.match(/^(.+):(\d+)$/);
|
||||||
|
var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
|
||||||
|
var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
|
||||||
|
if (parsedProxyPort && parsedProxyPort !== port) {
|
||||||
|
return true; // Skip if ports don't match.
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!/^[.*]/.test(parsedProxyHostname)) {
|
||||||
|
// No wildcards, so stop proxying if there is an exact match.
|
||||||
|
return hostname !== parsedProxyHostname;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parsedProxyHostname.charAt(0) === '*') {
|
||||||
|
// Remove leading wildcard.
|
||||||
|
parsedProxyHostname = parsedProxyHostname.slice(1);
|
||||||
|
}
|
||||||
|
// Stop proxying if the hostname ends with the no_proxy host.
|
||||||
|
return !stringEndsWith.call(hostname, parsedProxyHostname);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value for an environment variable.
|
||||||
|
*
|
||||||
|
* @param {string} key - The name of the environment variable.
|
||||||
|
* @return {string} The value of the environment variable.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
function getEnv(key) {
|
||||||
|
return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || '';
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.getProxyForUrl = getProxyForUrl;
|
||||||
34
node_modules/proxy-from-env/package.json
generated
vendored
Normal file
34
node_modules/proxy-from-env/package.json
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"name": "proxy-from-env",
|
||||||
|
"version": "1.1.0",
|
||||||
|
"description": "Offers getProxyForUrl to get the proxy URL for a URL, respecting the *_PROXY (e.g. HTTP_PROXY) and NO_PROXY environment variables.",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint *.js",
|
||||||
|
"test": "mocha ./test.js --reporter spec",
|
||||||
|
"test-coverage": "istanbul cover ./node_modules/.bin/_mocha -- --reporter spec"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/Rob--W/proxy-from-env.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"proxy",
|
||||||
|
"http_proxy",
|
||||||
|
"https_proxy",
|
||||||
|
"no_proxy",
|
||||||
|
"environment"
|
||||||
|
],
|
||||||
|
"author": "Rob Wu <rob@robwu.nl> (https://robwu.nl/)",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/Rob--W/proxy-from-env/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/Rob--W/proxy-from-env#readme",
|
||||||
|
"devDependencies": {
|
||||||
|
"coveralls": "^3.0.9",
|
||||||
|
"eslint": "^6.8.0",
|
||||||
|
"istanbul": "^0.4.5",
|
||||||
|
"mocha": "^7.1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
483
node_modules/proxy-from-env/test.js
generated
vendored
Normal file
483
node_modules/proxy-from-env/test.js
generated
vendored
Normal file
@@ -0,0 +1,483 @@
|
|||||||
|
/* eslint max-statements:0 */
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var assert = require('assert');
|
||||||
|
var parseUrl = require('url').parse;
|
||||||
|
|
||||||
|
var getProxyForUrl = require('./').getProxyForUrl;
|
||||||
|
|
||||||
|
// Runs the callback with process.env temporarily set to env.
|
||||||
|
function runWithEnv(env, callback) {
|
||||||
|
var originalEnv = process.env;
|
||||||
|
process.env = env;
|
||||||
|
try {
|
||||||
|
callback();
|
||||||
|
} finally {
|
||||||
|
process.env = originalEnv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Defines a test case that checks whether getProxyForUrl(input) === expected.
|
||||||
|
function testProxyUrl(env, expected, input) {
|
||||||
|
assert(typeof env === 'object' && env !== null);
|
||||||
|
// Copy object to make sure that the in param does not get modified between
|
||||||
|
// the call of this function and the use of it below.
|
||||||
|
env = JSON.parse(JSON.stringify(env));
|
||||||
|
|
||||||
|
var title = 'getProxyForUrl(' + JSON.stringify(input) + ')' +
|
||||||
|
' === ' + JSON.stringify(expected);
|
||||||
|
|
||||||
|
// Save call stack for later use.
|
||||||
|
var stack = {};
|
||||||
|
Error.captureStackTrace(stack, testProxyUrl);
|
||||||
|
// Only use the last stack frame because that shows where this function is
|
||||||
|
// called, and that is sufficient for our purpose. No need to flood the logs
|
||||||
|
// with an uninteresting stack trace.
|
||||||
|
stack = stack.stack.split('\n', 2)[1];
|
||||||
|
|
||||||
|
it(title, function() {
|
||||||
|
var actual;
|
||||||
|
runWithEnv(env, function() {
|
||||||
|
actual = getProxyForUrl(input);
|
||||||
|
});
|
||||||
|
if (expected === actual) {
|
||||||
|
return; // Good!
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
assert.strictEqual(expected, actual); // Create a formatted error message.
|
||||||
|
// Should not happen because previously we determined expected !== actual.
|
||||||
|
throw new Error('assert.strictEqual passed. This is impossible!');
|
||||||
|
} catch (e) {
|
||||||
|
// Use the original stack trace, so we can see a helpful line number.
|
||||||
|
e.stack = e.message + stack;
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('getProxyForUrl', function() {
|
||||||
|
describe('No proxy variables', function() {
|
||||||
|
var env = {};
|
||||||
|
testProxyUrl(env, '', 'http://example.com');
|
||||||
|
testProxyUrl(env, '', 'https://example.com');
|
||||||
|
testProxyUrl(env, '', 'ftp://example.com');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Invalid URLs', function() {
|
||||||
|
var env = {};
|
||||||
|
env.ALL_PROXY = 'http://unexpected.proxy';
|
||||||
|
testProxyUrl(env, '', 'bogus');
|
||||||
|
testProxyUrl(env, '', '//example.com');
|
||||||
|
testProxyUrl(env, '', '://example.com');
|
||||||
|
testProxyUrl(env, '', '://');
|
||||||
|
testProxyUrl(env, '', '/path');
|
||||||
|
testProxyUrl(env, '', '');
|
||||||
|
testProxyUrl(env, '', 'http:');
|
||||||
|
testProxyUrl(env, '', 'http:/');
|
||||||
|
testProxyUrl(env, '', 'http://');
|
||||||
|
testProxyUrl(env, '', 'prototype://');
|
||||||
|
testProxyUrl(env, '', 'hasOwnProperty://');
|
||||||
|
testProxyUrl(env, '', '__proto__://');
|
||||||
|
testProxyUrl(env, '', undefined);
|
||||||
|
testProxyUrl(env, '', null);
|
||||||
|
testProxyUrl(env, '', {});
|
||||||
|
testProxyUrl(env, '', {host: 'x', protocol: 1});
|
||||||
|
testProxyUrl(env, '', {host: 1, protocol: 'x'});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('http_proxy and HTTP_PROXY', function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTP_PROXY = 'http://http-proxy';
|
||||||
|
|
||||||
|
testProxyUrl(env, '', 'https://example');
|
||||||
|
testProxyUrl(env, 'http://http-proxy', 'http://example');
|
||||||
|
testProxyUrl(env, 'http://http-proxy', parseUrl('http://example'));
|
||||||
|
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.http_proxy = 'http://priority';
|
||||||
|
testProxyUrl(env, 'http://priority', 'http://example');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('http_proxy with non-sensical value', function() {
|
||||||
|
var env = {};
|
||||||
|
// Crazy values should be passed as-is. It is the responsibility of the
|
||||||
|
// one who launches the application that the value makes sense.
|
||||||
|
// TODO: Should we be stricter and perform validation?
|
||||||
|
env.HTTP_PROXY = 'Crazy \n!() { ::// }';
|
||||||
|
testProxyUrl(env, 'Crazy \n!() { ::// }', 'http://wow');
|
||||||
|
|
||||||
|
// The implementation assumes that the HTTP_PROXY environment variable is
|
||||||
|
// somewhat reasonable, and if the scheme is missing, it is added.
|
||||||
|
// Garbage in, garbage out some would say...
|
||||||
|
env.HTTP_PROXY = 'crazy without colon slash slash';
|
||||||
|
testProxyUrl(env, 'http://crazy without colon slash slash', 'http://wow');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('https_proxy and HTTPS_PROXY', function() {
|
||||||
|
var env = {};
|
||||||
|
// Assert that there is no fall back to http_proxy
|
||||||
|
env.HTTP_PROXY = 'http://unexpected.proxy';
|
||||||
|
testProxyUrl(env, '', 'https://example');
|
||||||
|
|
||||||
|
env.HTTPS_PROXY = 'http://https-proxy';
|
||||||
|
testProxyUrl(env, 'http://https-proxy', 'https://example');
|
||||||
|
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.https_proxy = 'http://priority';
|
||||||
|
testProxyUrl(env, 'http://priority', 'https://example');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('ftp_proxy', function() {
|
||||||
|
var env = {};
|
||||||
|
// Something else than http_proxy / https, as a sanity check.
|
||||||
|
env.FTP_PROXY = 'http://ftp-proxy';
|
||||||
|
|
||||||
|
testProxyUrl(env, 'http://ftp-proxy', 'ftp://example');
|
||||||
|
testProxyUrl(env, '', 'ftps://example');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('all_proxy', function() {
|
||||||
|
var env = {};
|
||||||
|
env.ALL_PROXY = 'http://catch-all';
|
||||||
|
testProxyUrl(env, 'http://catch-all', 'https://example');
|
||||||
|
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.all_proxy = 'http://priority';
|
||||||
|
testProxyUrl(env, 'http://priority', 'https://example');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('all_proxy without scheme', function() {
|
||||||
|
var env = {};
|
||||||
|
env.ALL_PROXY = 'noscheme';
|
||||||
|
testProxyUrl(env, 'http://noscheme', 'http://example');
|
||||||
|
testProxyUrl(env, 'https://noscheme', 'https://example');
|
||||||
|
|
||||||
|
// The module does not impose restrictions on the scheme.
|
||||||
|
testProxyUrl(env, 'bogus-scheme://noscheme', 'bogus-scheme://example');
|
||||||
|
|
||||||
|
// But the URL should still be valid.
|
||||||
|
testProxyUrl(env, '', 'bogus');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('no_proxy empty', function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTPS_PROXY = 'http://proxy';
|
||||||
|
|
||||||
|
// NO_PROXY set but empty.
|
||||||
|
env.NO_PROXY = '';
|
||||||
|
testProxyUrl(env, 'http://proxy', 'https://example');
|
||||||
|
|
||||||
|
// No entries in NO_PROXY (comma).
|
||||||
|
env.NO_PROXY = ',';
|
||||||
|
testProxyUrl(env, 'http://proxy', 'https://example');
|
||||||
|
|
||||||
|
// No entries in NO_PROXY (whitespace).
|
||||||
|
env.NO_PROXY = ' ';
|
||||||
|
testProxyUrl(env, 'http://proxy', 'https://example');
|
||||||
|
|
||||||
|
// No entries in NO_PROXY (multiple whitespace / commas).
|
||||||
|
env.NO_PROXY = ',\t,,,\n, ,\r';
|
||||||
|
testProxyUrl(env, 'http://proxy', 'https://example');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('no_proxy=example (single host)', function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTP_PROXY = 'http://proxy';
|
||||||
|
|
||||||
|
env.NO_PROXY = 'example';
|
||||||
|
testProxyUrl(env, '', 'http://example');
|
||||||
|
testProxyUrl(env, '', 'http://example:80');
|
||||||
|
testProxyUrl(env, '', 'http://example:0');
|
||||||
|
testProxyUrl(env, '', 'http://example:1337');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://sub.example');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://prefexample');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example.no');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://a.b.example');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://host/example');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('no_proxy=sub.example (subdomain)', function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTP_PROXY = 'http://proxy';
|
||||||
|
|
||||||
|
env.NO_PROXY = 'sub.example';
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example:80');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example:0');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example:1337');
|
||||||
|
testProxyUrl(env, '', 'http://sub.example');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://no.sub.example');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://sub-example');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example.sub');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('no_proxy=example:80 (host + port)', function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTP_PROXY = 'http://proxy';
|
||||||
|
|
||||||
|
env.NO_PROXY = 'example:80';
|
||||||
|
testProxyUrl(env, '', 'http://example');
|
||||||
|
testProxyUrl(env, '', 'http://example:80');
|
||||||
|
testProxyUrl(env, '', 'http://example:0');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example:1337');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://sub.example');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://prefexample');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example.no');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://a.b.example');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('no_proxy=.example (host suffix)', function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTP_PROXY = 'http://proxy';
|
||||||
|
|
||||||
|
env.NO_PROXY = '.example';
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example:80');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example:1337');
|
||||||
|
testProxyUrl(env, '', 'http://sub.example');
|
||||||
|
testProxyUrl(env, '', 'http://sub.example:80');
|
||||||
|
testProxyUrl(env, '', 'http://sub.example:1337');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://prefexample');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example.no');
|
||||||
|
testProxyUrl(env, '', 'http://a.b.example');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('no_proxy=*', function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTP_PROXY = 'http://proxy';
|
||||||
|
env.NO_PROXY = '*';
|
||||||
|
testProxyUrl(env, '', 'http://example.com');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('no_proxy=*.example (host suffix with *.)', function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTP_PROXY = 'http://proxy';
|
||||||
|
|
||||||
|
env.NO_PROXY = '*.example';
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example:80');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example:1337');
|
||||||
|
testProxyUrl(env, '', 'http://sub.example');
|
||||||
|
testProxyUrl(env, '', 'http://sub.example:80');
|
||||||
|
testProxyUrl(env, '', 'http://sub.example:1337');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://prefexample');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example.no');
|
||||||
|
testProxyUrl(env, '', 'http://a.b.example');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('no_proxy=*example (substring suffix)', function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTP_PROXY = 'http://proxy';
|
||||||
|
|
||||||
|
env.NO_PROXY = '*example';
|
||||||
|
testProxyUrl(env, '', 'http://example');
|
||||||
|
testProxyUrl(env, '', 'http://example:80');
|
||||||
|
testProxyUrl(env, '', 'http://example:1337');
|
||||||
|
testProxyUrl(env, '', 'http://sub.example');
|
||||||
|
testProxyUrl(env, '', 'http://sub.example:80');
|
||||||
|
testProxyUrl(env, '', 'http://sub.example:1337');
|
||||||
|
testProxyUrl(env, '', 'http://prefexample');
|
||||||
|
testProxyUrl(env, '', 'http://a.b.example');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example.no');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://host/example');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('no_proxy=.*example (arbitrary wildcards are NOT supported)',
|
||||||
|
function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTP_PROXY = 'http://proxy';
|
||||||
|
|
||||||
|
env.NO_PROXY = '.*example';
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://example');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://sub.example');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://sub.example');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://prefexample');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://x.prefexample');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://a.b.example');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('no_proxy=[::1],[::2]:80,10.0.0.1,10.0.0.2:80 (IP addresses)',
|
||||||
|
function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTP_PROXY = 'http://proxy';
|
||||||
|
|
||||||
|
env.NO_PROXY = '[::1],[::2]:80,10.0.0.1,10.0.0.2:80';
|
||||||
|
testProxyUrl(env, '', 'http://[::1]/');
|
||||||
|
testProxyUrl(env, '', 'http://[::1]:80/');
|
||||||
|
testProxyUrl(env, '', 'http://[::1]:1337/');
|
||||||
|
|
||||||
|
testProxyUrl(env, '', 'http://[::2]/');
|
||||||
|
testProxyUrl(env, '', 'http://[::2]:80/');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://[::2]:1337/');
|
||||||
|
|
||||||
|
testProxyUrl(env, '', 'http://10.0.0.1/');
|
||||||
|
testProxyUrl(env, '', 'http://10.0.0.1:80/');
|
||||||
|
testProxyUrl(env, '', 'http://10.0.0.1:1337/');
|
||||||
|
|
||||||
|
testProxyUrl(env, '', 'http://10.0.0.2/');
|
||||||
|
testProxyUrl(env, '', 'http://10.0.0.2:80/');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://10.0.0.2:1337/');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('no_proxy=127.0.0.1/32 (CIDR is NOT supported)', function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTP_PROXY = 'http://proxy';
|
||||||
|
|
||||||
|
env.NO_PROXY = '127.0.0.1/32';
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://127.0.0.1');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://127.0.0.1/32');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('no_proxy=127.0.0.1 does NOT match localhost', function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTP_PROXY = 'http://proxy';
|
||||||
|
|
||||||
|
env.NO_PROXY = '127.0.0.1';
|
||||||
|
testProxyUrl(env, '', 'http://127.0.0.1');
|
||||||
|
// We're not performing DNS queries, so this shouldn't match.
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://localhost');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('no_proxy with protocols that have a default port', function() {
|
||||||
|
var env = {};
|
||||||
|
env.WS_PROXY = 'http://ws';
|
||||||
|
env.WSS_PROXY = 'http://wss';
|
||||||
|
env.HTTP_PROXY = 'http://http';
|
||||||
|
env.HTTPS_PROXY = 'http://https';
|
||||||
|
env.GOPHER_PROXY = 'http://gopher';
|
||||||
|
env.FTP_PROXY = 'http://ftp';
|
||||||
|
env.ALL_PROXY = 'http://all';
|
||||||
|
|
||||||
|
env.NO_PROXY = 'xxx:21,xxx:70,xxx:80,xxx:443';
|
||||||
|
|
||||||
|
testProxyUrl(env, '', 'http://xxx');
|
||||||
|
testProxyUrl(env, '', 'http://xxx:80');
|
||||||
|
testProxyUrl(env, 'http://http', 'http://xxx:1337');
|
||||||
|
|
||||||
|
testProxyUrl(env, '', 'ws://xxx');
|
||||||
|
testProxyUrl(env, '', 'ws://xxx:80');
|
||||||
|
testProxyUrl(env, 'http://ws', 'ws://xxx:1337');
|
||||||
|
|
||||||
|
testProxyUrl(env, '', 'https://xxx');
|
||||||
|
testProxyUrl(env, '', 'https://xxx:443');
|
||||||
|
testProxyUrl(env, 'http://https', 'https://xxx:1337');
|
||||||
|
|
||||||
|
testProxyUrl(env, '', 'wss://xxx');
|
||||||
|
testProxyUrl(env, '', 'wss://xxx:443');
|
||||||
|
testProxyUrl(env, 'http://wss', 'wss://xxx:1337');
|
||||||
|
|
||||||
|
testProxyUrl(env, '', 'gopher://xxx');
|
||||||
|
testProxyUrl(env, '', 'gopher://xxx:70');
|
||||||
|
testProxyUrl(env, 'http://gopher', 'gopher://xxx:1337');
|
||||||
|
|
||||||
|
testProxyUrl(env, '', 'ftp://xxx');
|
||||||
|
testProxyUrl(env, '', 'ftp://xxx:21');
|
||||||
|
testProxyUrl(env, 'http://ftp', 'ftp://xxx:1337');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('no_proxy should not be case-sensitive', function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTP_PROXY = 'http://proxy';
|
||||||
|
env.NO_PROXY = 'XXX,YYY,ZzZ';
|
||||||
|
|
||||||
|
testProxyUrl(env, '', 'http://xxx');
|
||||||
|
testProxyUrl(env, '', 'http://XXX');
|
||||||
|
testProxyUrl(env, '', 'http://yyy');
|
||||||
|
testProxyUrl(env, '', 'http://YYY');
|
||||||
|
testProxyUrl(env, '', 'http://ZzZ');
|
||||||
|
testProxyUrl(env, '', 'http://zZz');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('NPM proxy configuration', function() {
|
||||||
|
describe('npm_config_http_proxy should work', function() {
|
||||||
|
var env = {};
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.npm_config_http_proxy = 'http://http-proxy';
|
||||||
|
|
||||||
|
testProxyUrl(env, '', 'https://example');
|
||||||
|
testProxyUrl(env, 'http://http-proxy', 'http://example');
|
||||||
|
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.npm_config_http_proxy = 'http://priority';
|
||||||
|
testProxyUrl(env, 'http://priority', 'http://example');
|
||||||
|
});
|
||||||
|
// eslint-disable-next-line max-len
|
||||||
|
describe('npm_config_http_proxy should take precedence over HTTP_PROXY and npm_config_proxy', function() {
|
||||||
|
var env = {};
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.npm_config_http_proxy = 'http://http-proxy';
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.npm_config_proxy = 'http://unexpected-proxy';
|
||||||
|
env.HTTP_PROXY = 'http://unexpected-proxy';
|
||||||
|
|
||||||
|
testProxyUrl(env, 'http://http-proxy', 'http://example');
|
||||||
|
});
|
||||||
|
describe('npm_config_https_proxy should work', function() {
|
||||||
|
var env = {};
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.npm_config_http_proxy = 'http://unexpected.proxy';
|
||||||
|
testProxyUrl(env, '', 'https://example');
|
||||||
|
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.npm_config_https_proxy = 'http://https-proxy';
|
||||||
|
testProxyUrl(env, 'http://https-proxy', 'https://example');
|
||||||
|
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.npm_config_https_proxy = 'http://priority';
|
||||||
|
testProxyUrl(env, 'http://priority', 'https://example');
|
||||||
|
});
|
||||||
|
// eslint-disable-next-line max-len
|
||||||
|
describe('npm_config_https_proxy should take precedence over HTTPS_PROXY and npm_config_proxy', function() {
|
||||||
|
var env = {};
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.npm_config_https_proxy = 'http://https-proxy';
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.npm_config_proxy = 'http://unexpected-proxy';
|
||||||
|
env.HTTPS_PROXY = 'http://unexpected-proxy';
|
||||||
|
|
||||||
|
testProxyUrl(env, 'http://https-proxy', 'https://example');
|
||||||
|
});
|
||||||
|
describe('npm_config_proxy should work', function() {
|
||||||
|
var env = {};
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.npm_config_proxy = 'http://http-proxy';
|
||||||
|
testProxyUrl(env, 'http://http-proxy', 'http://example');
|
||||||
|
testProxyUrl(env, 'http://http-proxy', 'https://example');
|
||||||
|
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.npm_config_proxy = 'http://priority';
|
||||||
|
testProxyUrl(env, 'http://priority', 'http://example');
|
||||||
|
testProxyUrl(env, 'http://priority', 'https://example');
|
||||||
|
});
|
||||||
|
// eslint-disable-next-line max-len
|
||||||
|
describe('HTTP_PROXY and HTTPS_PROXY should take precedence over npm_config_proxy', function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTP_PROXY = 'http://http-proxy';
|
||||||
|
env.HTTPS_PROXY = 'http://https-proxy';
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.npm_config_proxy = 'http://unexpected-proxy';
|
||||||
|
testProxyUrl(env, 'http://http-proxy', 'http://example');
|
||||||
|
testProxyUrl(env, 'http://https-proxy', 'https://example');
|
||||||
|
});
|
||||||
|
describe('npm_config_no_proxy should work', function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTP_PROXY = 'http://proxy';
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.npm_config_no_proxy = 'example';
|
||||||
|
|
||||||
|
testProxyUrl(env, '', 'http://example');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://otherwebsite');
|
||||||
|
});
|
||||||
|
// eslint-disable-next-line max-len
|
||||||
|
describe('npm_config_no_proxy should take precedence over NO_PROXY', function() {
|
||||||
|
var env = {};
|
||||||
|
env.HTTP_PROXY = 'http://proxy';
|
||||||
|
env.NO_PROXY = 'otherwebsite';
|
||||||
|
// eslint-disable-next-line camelcase
|
||||||
|
env.npm_config_no_proxy = 'example';
|
||||||
|
|
||||||
|
testProxyUrl(env, '', 'http://example');
|
||||||
|
testProxyUrl(env, 'http://proxy', 'http://otherwebsite');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
102
package-lock.json
generated
Normal file
102
package-lock.json
generated
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
{
|
||||||
|
"name": "SusMarket",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"dependencies": {
|
||||||
|
"axios": "^1.6.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/asynckit": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||||
|
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||||
|
},
|
||||||
|
"node_modules/axios": {
|
||||||
|
"version": "1.6.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz",
|
||||||
|
"integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"follow-redirects": "^1.15.6",
|
||||||
|
"form-data": "^4.0.0",
|
||||||
|
"proxy-from-env": "^1.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/combined-stream": {
|
||||||
|
"version": "1.0.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
|
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||||
|
"dependencies": {
|
||||||
|
"delayed-stream": "~1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/delayed-stream": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/follow-redirects": {
|
||||||
|
"version": "1.15.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
|
||||||
|
"integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "individual",
|
||||||
|
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"debug": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/form-data": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
|
||||||
|
"dependencies": {
|
||||||
|
"asynckit": "^0.4.0",
|
||||||
|
"combined-stream": "^1.0.8",
|
||||||
|
"mime-types": "^2.1.12"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mime-db": {
|
||||||
|
"version": "1.52.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||||
|
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mime-types": {
|
||||||
|
"version": "2.1.35",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
||||||
|
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||||
|
"dependencies": {
|
||||||
|
"mime-db": "1.52.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/proxy-from-env": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
5
package.json
Normal file
5
package.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"axios": "^1.6.8"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,9 +7,10 @@ import ScamPage from "./pages/ScamPage";
|
|||||||
import InfoPage from "./pages/InfoPage";
|
import InfoPage from "./pages/InfoPage";
|
||||||
import Header from "./components/Header";
|
import Header from "./components/Header";
|
||||||
import PopupMap from "./components/PopupMap";
|
import PopupMap from "./components/PopupMap";
|
||||||
import React, { useState } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { Routes, Route } from 'react-router-dom';
|
import { Routes, Route } from 'react-router-dom';
|
||||||
import { Product, Category } from "./utils/types";
|
import { Product, Category } from "./utils/types";
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
interface AppPopupMapState {
|
interface AppPopupMapState {
|
||||||
isPopupMapVisible: boolean;
|
isPopupMapVisible: boolean;
|
||||||
@@ -20,6 +21,20 @@ export default function App() {
|
|||||||
isPopupMapVisible: false,
|
isPopupMapVisible: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const [details, setDetails] = useState([]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let data;
|
||||||
|
axios.get('http://localhost:8000')
|
||||||
|
.then(res => {
|
||||||
|
data = res.data;
|
||||||
|
setDetails(data);
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
const togglePopupMap = () => {
|
const togglePopupMap = () => {
|
||||||
setState((prevState) => ({
|
setState((prevState) => ({
|
||||||
...prevState,
|
...prevState,
|
||||||
|
|||||||
@@ -14,9 +14,11 @@ $accent-color: #EB5E28;
|
|||||||
height: 400px;
|
height: 400px;
|
||||||
perspective: 1000px;
|
perspective: 1000px;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
.dev-card__inner {
|
.dev-card__inner {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -27,6 +29,7 @@ $accent-color: #EB5E28;
|
|||||||
|
|
||||||
.dev-card__front, .dev-card__back {
|
.dev-card__front, .dev-card__back {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
z-index: 1;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ body {
|
|||||||
|
|
||||||
.catalog-menu {
|
.catalog-menu {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
z-index: 999;
|
||||||
width: 340px;
|
width: 340px;
|
||||||
height: 495px;
|
height: 495px;
|
||||||
left: 218px;
|
left: 218px;
|
||||||
@@ -431,6 +432,7 @@ body {
|
|||||||
width: 450px;
|
width: 450px;
|
||||||
display: flex;
|
display: flex;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
z-index: 999;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
top: 108px;
|
top: 108px;
|
||||||
transform:translateX(-50%);
|
transform:translateX(-50%);
|
||||||
|
|||||||
Reference in New Issue
Block a user