add: unit and integration testing
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca>
|
||||
|
||||
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.
|
||||
+273
@@ -0,0 +1,273 @@
|
||||
# superagent
|
||||
|
||||
[](https://github.com/forwardemail/superagent/actions/workflows/ci.yml)
|
||||
[](https://codecov.io/gh/ladjs/superagent)
|
||||
[](https://github.com/sindresorhus/xo)
|
||||
[](https://github.com/prettier/prettier)
|
||||
[](https://lass.js.org)
|
||||
[](LICENSE)
|
||||
|
||||
> Small progressive client-side HTTP request library, and Node.js module with the same API, supporting many high-level HTTP client features. Maintained for [Forward Email](https://github.com/forwardemail) and [Lad](https://github.com/ladjs).
|
||||
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Install](#install)
|
||||
* [Usage](#usage)
|
||||
* [Node](#node)
|
||||
* [Browser](#browser)
|
||||
* [Supported Platforms](#supported-platforms)
|
||||
* [Required Browser Features](#required-browser-features)
|
||||
* [Plugins](#plugins)
|
||||
* [Upgrading from previous versions](#upgrading-from-previous-versions)
|
||||
* [Contributors](#contributors)
|
||||
* [License](#license)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
[npm][]:
|
||||
|
||||
```sh
|
||||
npm install superagent
|
||||
```
|
||||
|
||||
[yarn][]:
|
||||
|
||||
```sh
|
||||
yarn add superagent
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
### Node
|
||||
|
||||
```js
|
||||
const superagent = require('superagent');
|
||||
|
||||
// callback
|
||||
superagent
|
||||
.post('/api/pet')
|
||||
.send({ name: 'Manny', species: 'cat' }) // sends a JSON post body
|
||||
.set('X-API-Key', 'foobar')
|
||||
.set('accept', 'json')
|
||||
.end((err, res) => {
|
||||
// Calling the end function will send the request
|
||||
});
|
||||
|
||||
// promise with then/catch
|
||||
superagent.post('/api/pet').then(console.log).catch(console.error);
|
||||
|
||||
// promise with async/await
|
||||
(async () => {
|
||||
try {
|
||||
const res = await superagent.post('/api/pet');
|
||||
console.log(res);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
})();
|
||||
```
|
||||
|
||||
### Browser
|
||||
|
||||
**The browser-ready, minified version of `superagent` is only 50 KB (minified and gzipped).**
|
||||
|
||||
Browser-ready versions of this module are available via [jsdelivr][], [unpkg][], and also in the `node_modules/superagent/dist` folder in downloads of the `superagent` package.
|
||||
|
||||
> Note that we also provide unminified versions with `.js` instead of `.min.js` file extensions.
|
||||
|
||||
#### VanillaJS
|
||||
|
||||
This is the solution for you if you're just using `<script>` tags everywhere!
|
||||
|
||||
```html
|
||||
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=WeakRef,BigInt"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/superagent"></script>
|
||||
<!-- if you wish to use unpkg.com instead: -->
|
||||
<!-- <script src="https://unpkg.com/superagent"></script> -->
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
// superagent is exposed as `window.superagent`
|
||||
// if you wish to use "request" instead please
|
||||
// uncomment the following line of code:
|
||||
// `window.request = superagent;`
|
||||
superagent
|
||||
.post('/api/pet')
|
||||
.send({ name: 'Manny', species: 'cat' }) // sends a JSON post body
|
||||
.set('X-API-Key', 'foobar')
|
||||
.set('accept', 'json')
|
||||
.end(function (err, res) {
|
||||
// Calling the end function will send the request
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
```
|
||||
|
||||
#### Bundler
|
||||
|
||||
If you are using [browserify][], [webpack][], [rollup][], or another bundler, then you can follow the same usage as [Node](#node) above.
|
||||
|
||||
|
||||
## Supported Platforms
|
||||
|
||||
* Node: v14.18.0+
|
||||
* Browsers (see [.browserslistrc](.browserslistrc)):
|
||||
|
||||
```sh
|
||||
npx browserslist
|
||||
```
|
||||
|
||||
```sh
|
||||
and_chr 102
|
||||
and_ff 101
|
||||
and_qq 10.4
|
||||
and_uc 12.12
|
||||
android 101
|
||||
chrome 103
|
||||
chrome 102
|
||||
chrome 101
|
||||
chrome 100
|
||||
edge 103
|
||||
edge 102
|
||||
edge 101
|
||||
firefox 101
|
||||
firefox 100
|
||||
firefox 91
|
||||
ios_saf 15.5
|
||||
ios_saf 15.4
|
||||
ios_saf 15.2-15.3
|
||||
ios_saf 15.0-15.1
|
||||
ios_saf 14.5-14.8
|
||||
ios_saf 14.0-14.4
|
||||
ios_saf 12.2-12.5
|
||||
kaios 2.5
|
||||
op_mini all
|
||||
op_mob 64
|
||||
opera 86
|
||||
opera 85
|
||||
safari 15.5
|
||||
safari 15.4
|
||||
samsung 17.0
|
||||
samsung 16.0
|
||||
```
|
||||
|
||||
### Required Browser Features
|
||||
|
||||
We recommend using <https://cdnjs.cloudflare.com/polyfill/> (specifically with the bundle mentioned in [VanillaJS](#vanillajs) above):
|
||||
|
||||
```html
|
||||
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=WeakRef,BigInt"></script>
|
||||
```
|
||||
|
||||
* WeakRef is not supported in Opera 85, iOS Safari 12.2-12.5
|
||||
* BigInt is not supported in iOS Safari 12.2-12.5
|
||||
|
||||
|
||||
## Plugins
|
||||
|
||||
SuperAgent is easily extended via plugins.
|
||||
|
||||
```js
|
||||
const nocache = require('superagent-no-cache');
|
||||
const superagent = require('superagent');
|
||||
const prefix = require('superagent-prefix')('/static');
|
||||
|
||||
superagent
|
||||
.get('/some-url')
|
||||
.query({ action: 'edit', city: 'London' }) // query string
|
||||
.use(prefix) // Prefixes *only* this request
|
||||
.use(nocache) // Prevents caching of *only* this request
|
||||
.end((err, res) => {
|
||||
// Do something
|
||||
});
|
||||
```
|
||||
|
||||
Existing plugins:
|
||||
|
||||
* [superagent-no-cache](https://github.com/johntron/superagent-no-cache) - prevents caching by including Cache-Control header
|
||||
* [superagent-prefix](https://github.com/johntron/superagent-prefix) - prefixes absolute URLs (useful in test environment)
|
||||
* [superagent-suffix](https://github.com/timneutkens1/superagent-suffix) - suffix URLs with a given path
|
||||
* [superagent-mock](https://github.com/M6Web/superagent-mock) - simulate HTTP calls by returning data fixtures based on the requested URL
|
||||
* [superagent-mocker](https://github.com/shuvalov-anton/superagent-mocker) — simulate REST API
|
||||
* [superagent-cache](https://github.com/jpodwys/superagent-cache) - A global SuperAgent patch with built-in, flexible caching
|
||||
* [superagent-cache-plugin](https://github.com/jpodwys/superagent-cache-plugin) - A SuperAgent plugin with built-in, flexible caching
|
||||
* [superagent-jsonapify](https://github.com/alex94puchades/superagent-jsonapify) - A lightweight [json-api](http://jsonapi.org/format/) client addon for superagent
|
||||
* [superagent-serializer](https://github.com/zzarcon/superagent-serializer) - Converts server payload into different cases
|
||||
* [superagent-httpbackend](https://www.npmjs.com/package/superagent-httpbackend) - stub out requests using AngularJS' $httpBackend syntax
|
||||
* [superagent-throttle](https://github.com/leviwheatcroft/superagent-throttle) - queues and intelligently throttles requests
|
||||
* [superagent-charset](https://github.com/magicdawn/superagent-charset) - add charset support for node's SuperAgent
|
||||
* [superagent-verbose-errors](https://github.com/jcoreio/superagent-verbose-errors) - include response body in error messages for failed requests
|
||||
* [superagent-declare](https://github.com/damoclark/superagent-declare) - A simple [declarative](https://en.wikipedia.org/wiki/Declarative_programming) API for SuperAgent
|
||||
* [superagent-node-http-timings](https://github.com/webuniverseio/superagent-node-http-timings) - measure http timings in node.js
|
||||
* [superagent-cheerio](https://github.com/mmmmmrob/superagent-cheerio) - add [cheerio](https://www.npmjs.com/package/cheerio) to your response content automatically. Adds `res.$` for HTML and XML response bodies.
|
||||
* [@certible/superagent-aws-sign](https://github.com/certible/superagent-aws-sign) - Sign AWS endpoint requests, it uses the aws4 to authenticate the SuperAgent requests
|
||||
|
||||
Please prefix your plugin with `superagent-*` so that it can easily be found by others.
|
||||
|
||||
For SuperAgent extensions such as couchdb and oauth visit the [wiki](https://github.com/ladjs/superagent/wiki).
|
||||
|
||||
|
||||
## Upgrading from previous versions
|
||||
|
||||
Please see [GitHub releases page](https://github.com/ladjs/superagent/releases) for the current changelog.
|
||||
|
||||
Our breaking changes are mostly in rarely used functionality and from stricter error handling.
|
||||
|
||||
* [6.0 to 6.1](https://github.com/ladjs/superagent/releases/tag/v6.1.0)
|
||||
* Browser behaviour changed to match Node when serializing `application/x-www-form-urlencoded`, using `arrayFormat: 'indices'` semantics of `qs` library. (See: <https://www.npmjs.com/package/qs#stringifying>)
|
||||
* [5.x to 6.x](https://github.com/ladjs/superagent/releases/tag/v6.0.0):
|
||||
* Retry behavior is still opt-in, however we now have a more fine-grained list of status codes and error codes that we retry against (see updated docs)
|
||||
* A specific issue with Content-Type matching not being case-insensitive is fixed
|
||||
* Set is now required for IE 9, see [Required Browser Features](#required-browser-features) for more insight
|
||||
* [4.x to 5.x](https://github.com/ladjs/superagent/releases/tag/v5.0.0):
|
||||
* We've implemented the build setup of [Lass](https://lass.js.org) to simplify our stack and linting
|
||||
* Unminified browserified build size has been reduced from 48KB to 20KB (via `tinyify` and the latest version of Babel using `@babel/preset-env` and `.browserslistrc`)
|
||||
* Linting support has been added using `caniuse-lite` and `eslint-plugin-compat`
|
||||
* We can now target what versions of Node we wish to support more easily using `.babelrc`
|
||||
* [3.x to 4.x](https://github.com/ladjs/superagent/releases/tag/v4.0.0-alpha.1):
|
||||
* Ensure you're running Node 6 or later. We've dropped support for Node 4.
|
||||
* We've started using ES6 and for compatibility with Internet Explorer you may need to use Babel.
|
||||
* We suggest migrating from `.end()` callbacks to `.then()` or `await`.
|
||||
* [2.x to 3.x](https://github.com/ladjs/superagent/releases/tag/v3.0.0):
|
||||
* Ensure you're running Node 4 or later. We've dropped support for Node 0.x.
|
||||
* Test code that calls `.send()` multiple times. Invalid calls to `.send()` will now throw instead of sending garbage.
|
||||
* [1.x to 2.x](https://github.com/ladjs/superagent/releases/tag/v2.0.0):
|
||||
* If you use `.parse()` in the *browser* version, rename it to `.serialize()`.
|
||||
* If you rely on `undefined` in query-string values being sent literally as the text "undefined", switch to checking for missing value instead. `?key=undefined` is now `?key` (without a value).
|
||||
* If you use `.then()` in Internet Explorer, ensure that you have a polyfill that adds a global `Promise` object.
|
||||
* 0.x to 1.x:
|
||||
* Instead of 1-argument callback `.end(function(res){})` use `.then(res => {})`.
|
||||
|
||||
|
||||
## Contributors
|
||||
|
||||
| Name |
|
||||
| ------------------- |
|
||||
| **Kornel Lesiński** |
|
||||
| **Peter Lyons** |
|
||||
| **Hunter Loftis** |
|
||||
| **Nick Baugh** |
|
||||
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE) © TJ Holowaychuk
|
||||
|
||||
|
||||
##
|
||||
|
||||
[npm]: https://www.npmjs.com/
|
||||
|
||||
[yarn]: https://yarnpkg.com/
|
||||
|
||||
[jsdelivr]: https://www.jsdelivr.com/
|
||||
|
||||
[unpkg]: https://unpkg.com/
|
||||
|
||||
[browserify]: https://github.com/browserify/browserify
|
||||
|
||||
[webpack]: https://github.com/webpack/webpack
|
||||
|
||||
[rollup]: https://github.com/rollup/rollup
|
||||
+3471
File diff suppressed because it is too large
Load Diff
+1
File diff suppressed because one or more lines are too long
+25
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
|
||||
const defaults = ['use', 'on', 'once', 'set', 'query', 'type', 'accept', 'auth', 'withCredentials', 'sortQuery', 'retry', 'ok', 'redirects', 'timeout', 'buffer', 'serialize', 'parse', 'ca', 'key', 'pfx', 'cert', 'disableTLSCerts'];
|
||||
class Agent {
|
||||
constructor() {
|
||||
this._defaults = [];
|
||||
}
|
||||
_setDefaults(request) {
|
||||
for (const def of this._defaults) {
|
||||
request[def.fn](...def.args);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const fn of defaults) {
|
||||
// Default setting for all requests from this agent
|
||||
Agent.prototype[fn] = function (...args) {
|
||||
this._defaults.push({
|
||||
fn,
|
||||
args
|
||||
});
|
||||
return this;
|
||||
};
|
||||
}
|
||||
module.exports = Agent;
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJkZWZhdWx0cyIsIkFnZW50IiwiY29uc3RydWN0b3IiLCJfZGVmYXVsdHMiLCJfc2V0RGVmYXVsdHMiLCJyZXF1ZXN0IiwiZGVmIiwiZm4iLCJhcmdzIiwicHJvdG90eXBlIiwicHVzaCIsIm1vZHVsZSIsImV4cG9ydHMiXSwic291cmNlcyI6WyIuLi9zcmMvYWdlbnQtYmFzZS5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJjb25zdCBkZWZhdWx0cyA9IFtcbiAgJ3VzZScsXG4gICdvbicsXG4gICdvbmNlJyxcbiAgJ3NldCcsXG4gICdxdWVyeScsXG4gICd0eXBlJyxcbiAgJ2FjY2VwdCcsXG4gICdhdXRoJyxcbiAgJ3dpdGhDcmVkZW50aWFscycsXG4gICdzb3J0UXVlcnknLFxuICAncmV0cnknLFxuICAnb2snLFxuICAncmVkaXJlY3RzJyxcbiAgJ3RpbWVvdXQnLFxuICAnYn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QU1DLEtBQUssQ0FBQztFQUNWQyxXQUFXQSxDQUFBLEVBQUk7SUFDYixJQUFJLENBQUNDLFNBQVMsR0FBRyxFQUFFO0VBQ3JCO0VBRUFDLFlBQVlBLENBQUVDLE9BQU8sRUFBRTtJQUNyQixLQUFLLE1BQU1DLEdBQUcsSUFBSSxJQUFJLENBQUNILFNBQVMsRUFBRTtNQUNoQ0UsT0FBTyxDQUFDQyxHQUFHLENBQUNDLEVBQUUsQ0FBQyxDQUFDLEdBQUdELEdBQUcsQ0FBQ0UsSUFBSSxDQUFDO0lBQzlCO0VBQ0Y7QUFDRjtBQUVBLEtBQUssTUFBTUQsRUFBRSxJQUFJUCxRQUFRLEVBQUU7RUFDekI7RUFDQUMsS0FBSyxDQUFDUSxTQUFTLENBQUNGLEVBQUUsQ0FBQyxHQUFHLFVBQVUsR0FBR0MsSUFBSSxFQUFFO0lBQ3ZDLElBQUksQ0FBQ0wsU0FBUyxDQUFDTyxJQUFJLENBQUM7TUFBRUgsRUFBRTtNQUFFQztJQUFLLENBQUMsQ0FBQztJQUNqQyxPQUFPLElBQUk7RUFDYixDQUFDO0FBQ0g7QUFHQUcsTUFBTSxDQUFDQyxPQUFPLEdBQUdYLEtBQUsiLCJpZ25vcmVMaXN0IjpbXX0=
|
||||
+957
File diff suppressed because one or more lines are too long
+101
File diff suppressed because one or more lines are too long
+20
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
const zlib = require('zlib');
|
||||
const utils = require('../utils');
|
||||
const {
|
||||
isGzipOrDeflateEncoding,
|
||||
isBrotliEncoding
|
||||
} = utils;
|
||||
exports.chooseDecompresser = res => {
|
||||
let decompresser;
|
||||
if (isGzipOrDeflateEncoding(res)) {
|
||||
decompresser = zlib.createUnzip();
|
||||
} else if (isBrotliEncoding(res)) {
|
||||
decompresser = zlib.createBrotliDecompress();
|
||||
} else {
|
||||
throw new Error('unknown content-encoding');
|
||||
}
|
||||
return decompresser;
|
||||
};
|
||||
//# sourceMappingURL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0FBQztBQUNqQyxNQUFNO0VBQUVFLHVCQUF1QjtFQUFFQztBQUFpQixDQUFDLEdBQUdGLEtBQUs7QUFFM0RHLE9BQU8sQ0FBQ0Msa0JBQWtCLEdBQUlDLEdBQUcsSUFBSztFQUNwQyxJQUFJQyxZQUFZO0VBQ2hCLElBQUlMLHVCQUF1QixDQUFDSSxHQUFHLENBQUMsRUFBRTtJQUNoQ0MsWUFBWSxHQUFHUixJQUFJLENBQUNTLFdBQVcsQ0FBQyxDQUFDO0VBQ25DLENBQUMsTUFBTSxJQUFJTCxnQkFBZ0IsQ0FBQ0csR0FBRyxDQUFDLEVBQUU7SUFDaENDLFlBQVksR0FBR1IsSUFBSSxDQUFDVSxzQkFBc0IsQ0FBQyxDQUFDO0VBQzlDLENBQUMsTUFBTTtJQUNMLE1BQU0sSUFBSUMsS0FBSyxDQUFDLDBCQUEwQixDQUFDO0VBQzdDO0VBQ0EsT0FBT0gsWUFBWTtBQUNyQixDQUFDIiwiaWdub3JlTGlzdCI6W119
|
||||
+158
File diff suppressed because one or more lines are too long
+1332
File diff suppressed because one or more lines are too long
+13
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = (res, fn) => {
|
||||
const data = []; // Binary data needs binary storage
|
||||
|
||||
res.on('data', chunk => {
|
||||
data.push(chunk);
|
||||
});
|
||||
res.on('end', () => {
|
||||
fn(null, Buffer.concat(data));
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwicmVzIiwiZm4iLCJkYXRhIiwib24iLCJjaHVuayIsInB1c2giLCJCdWZmZXIiLCJjb25jYXQiXSwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbm9kZS9wYXJzZXJzL2ltYWdlLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gKHJlcywgZm4pID0+IHtcbiAgY29uc3QgZGF0YSA9IFtdOyAvLyBCaW5hcnkgZGF0YSBuZWVkcyBiaW5hcnkgc3RvcmFnZVxuXG4gIHJlcy5vbignZGF0YScsIChjaHVuaykgPT4ge1xuICAgIGRhdGEucHVzaChjaHVuayk7XG4gIH0pO1xuICByZXMub24oJ2VuZCcsICgpID0+IHtcbiAgICBmbihudWxsLCBCdWZmZXIuY29uY2F0KGRhdGEpKTtcbiAgfSk7XG59O1xuIl0sIm1hcHBpbmdzIjoiOztBQUFBQSxNQUFNLENBQUNDLE9BQU8sR0FBRyxDQUFDQyxHQUFHLEVBQUVDLEVBQUUsS0FBSztFQUM1QixNQUFNQyxJQUFJLEdBQUcsRUFBRSxDQUFDLENBQUM7O0VBRWpCRixHQUFHLENBQUNHLEVBQUUsQ0FBQyxNQUFNLEVBQUdDLEtBQUssSUFBSztJQUN4QkYsSUFBSSxDQUFDRyxJQUFJLENBQUNELEtBQUssQ0FBQztFQUNsQixDQUFDLENBQUM7RUFDRkosR0FBRyxDQUFDRyxFQUFFLENBQUMsS0FBSyxFQUFFLE1BQU07SUFDbEJGLEVBQUUsQ0FBQyxJQUFJLEVBQUVLLE1BQU0sQ0FBQ0MsTUFBTSxDQUFDTCxJQUFJLENBQUMsQ0FBQztFQUMvQixDQUFDLENBQUM7QUFDSixDQUFDIiwiaWdub3JlTGlzdCI6W119
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
exports['application/x-www-form-urlencoded'] = require('./urlencoded');
|
||||
exports['application/json'] = require('./json');
|
||||
exports.text = require('./text');
|
||||
exports['application/json-seq'] = exports.text;
|
||||
const binary = require('./image');
|
||||
exports['application/octet-stream'] = binary;
|
||||
exports['application/pdf'] = binary;
|
||||
exports.image = binary;
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJleHBvcnRzIiwicmVxdWlyZSIsInRleHQiLCJiaW5hcnkiLCJpbWFnZSJdLCJzb3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0ksS0FBSyxHQUFHRCxNQUFNIiwiaWdub3JlTGlzdCI6W119
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function (res, fn) {
|
||||
res.text = '';
|
||||
res.setEncoding('utf8');
|
||||
res.on('data', chunk => {
|
||||
res.text += chunk;
|
||||
});
|
||||
res.on('end', () => {
|
||||
let body;
|
||||
let error;
|
||||
try {
|
||||
body = res.text && JSON.parse(res.text);
|
||||
} catch (err) {
|
||||
error = err;
|
||||
// issue #675: return the raw response if the response parsing fails
|
||||
error.rawResponse = res.text || null;
|
||||
// issue #876: return the http status code if the response parsing fails
|
||||
error.statusCode = res.statusCode;
|
||||
} finally {
|
||||
fn(error, body);
|
||||
}
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwicmVzIiwiZm4iLCJ0ZXh0Iiwic2V0RW5jb2RpbmciLCJvbiIsImNodW5rIiwiYm9keSIsImVycm9yIiwiSlNPTiIsInBhcnNlIiwiZXJyIiwicmF3UmVzcG9uc2UiLCJzdGF0dXNDb2RlIl0sInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL25vZGUvcGFyc2Vycy9qc29uLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKHJlcywgZm4pIHtcbiAgcmVzLnRleHQgPSAnJztcbiAgcmVzLnNldEVuY29kaW5nKCd1dGY4Jyk7XG4gIHJlcy5vbignZGF0YScsIChjaHVuaykgPT4ge1xuICAgIHJlcy50ZXh0ICs9IGNodW5rO1xuICB9KTtcbiAgcmVzLm9uKCdlbmQnLCAoKSA9PiB7XG4gICAgbGV0IGJvZHk7XG4gICAgbGV0IGVycm9yO1xuICAgIHRyeSB7XG4gICAgICBib2R5ID0gcmVzLnRleHQgJiYgSlNPTi5wYXJzZShyZXMudGV4dC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BRztNQUNYO01BQ0FILEtBQUssQ0FBQ0ksV0FBVyxHQUFHWCxHQUFHLENBQUNFLElBQUksSUFBSSxJQUFJO01BQ3BDO01BQ0FLLEtBQUssQ0FBQ0ssVUFBVSxHQUFHWixHQUFHLENBQUNZLFVBQVU7SUFDbkMsQ0FBQyxTQUFTO01BQ1JYLEVBQUUsQ0FBQ00sS0FBSyxFQUFFRCxJQUFJLENBQUM7SUFDakI7RUFDRixDQUFDLENBQUM7QUFDSixDQUFDIiwiaWdub3JlTGlzdCI6W119
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = (res, fn) => {
|
||||
res.text = '';
|
||||
res.setEncoding('utf8');
|
||||
res.on('data', chunk => {
|
||||
res.text += chunk;
|
||||
});
|
||||
res.on('end', fn);
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwicmVzIiwiZm4iLCJ0ZXh0Iiwic2V0RW5jb2RpbmciLCJvbiIsImNodW5rIl0sInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL25vZGUvcGFyc2Vycy90ZXh0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gKHJlcywgZm4pID0+IHtcbiAgcmVzLnRleHQgPSAnJztcbiAgcmVzLnNldEVuY29kaW5nKCd1dGY4Jyk7XG4gIHJlcy5vbignZGF0YScsIChjaHVuaykgPT4ge1xuICAgIHJlcy50ZXh0ICs9IGNodW5rO1xuICB9KTtcbiAgcmVzLm9uKCdlbmQnLCBmbik7XG59O1xuIl0sIm1hcHBpbmdzIjoiOztBQUFBQSxNQUFNLENBQUNDLE9BQU8sR0FBRyxDQUFDQyxHQUFHLEVBQUVDLEVBQUUsS0FBSztFQUM1QkQsR0FBRyxDQUFDRSxJQUFJLEdBQUcsRUFBRTtFQUNiRixHQUFHLENBQUNHLFdBQVcsQ0FBQyxNQUFNLENBQUM7RUFDdkJILEdBQUcsQ0FBQ0ksRUFBRSxDQUFDLE1BQU0sRUFBR0MsS0FBSyxJQUFLO0lBQ3hCTCxHQUFHLENBQUNFLElBQUksSUFBSUcsS0FBSztFQUNuQixDQUFDLENBQUM7RUFDRkwsR0FBRyxDQUFDSSxFQUFFLENBQUMsS0FBSyxFQUFFSCxFQUFFLENBQUM7QUFDbkIsQ0FBQyIsImlnbm9yZUxpc3QiOltdfQ==
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
const qs = require('qs');
|
||||
module.exports = (res, fn) => {
|
||||
res.text = '';
|
||||
res.setEncoding('ascii');
|
||||
res.on('data', chunk => {
|
||||
res.text += chunk;
|
||||
});
|
||||
res.on('end', () => {
|
||||
try {
|
||||
fn(null, qs.parse(res.text));
|
||||
} catch (err) {
|
||||
fn(err);
|
||||
}
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJxcyIsInJlcXVpcmUiLCJtb2R1bGUiLCJleHBvcnRzIiwicmVzIiwiZm4iLCJ0ZXh0Iiwic2V0RW5jb2RpbmciLCJvbiIsImNodW5rIiwicGFyc2UiLCJlcnIiXSwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbm9kZS9wYXJzZXJzL3VybGVuY29kZWQuanMiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBNb2R1bGUgZGVwZW5kZW5jaWVzLlxuICovXG5cbmNvbnN0IHFzID0gcmVxdWlyZSgncXMnKTtcblxubW9kdWxlLmV4cG9ydHMgPSAocmVzLCBmbikgPT4ge1xuICByZXMudGV4dCA9ICcnO1xuICByZXMuc2V0RW5jb2RpbmcoJ2FzY2lpJyk7XG4gIHJlcy5vbignZGF0YScsIChjaHVuaykgPT4ge1xuICAgIHJlcy50ZXh0ICs9IGNodW5rO1xuICB9KTtcbiAgcmVzLm9uKCdlbmQnLCAoKSA9PiB7XG4gICAgdHJ5IHtcbiAgICAgIGZuKG51bGwsIHFzLnBhcnNlKHJlcy50ZXh0KSk7XG4gICAgfSBjYXRjaCAoZXJyKSB7XG4gICAgICBmbihlcnIpO1xuICAgIH1cbiAgfSk7XG59O1xuIl0sIm1hcHBpbmdzIjoiOztBQUFBO0FBQ0E7QUFDQTs7QUFFQSxNQUFNQSxFQUFFLEdBQUdDLE9BQU8sQ0FBQyxJQUFJLENBQUM7QUFFeEJDLE1BQU0sQ0FBQ0MsT0FBTyxHQUFHLENBQUNDLEdBQUcsRUFBRUMsRUFBRSxLQUFLO0VBQzVCRCxHQUFHLENBQUNFLElBQUksR0FBRyxFQUFFO0VBQ2JGLEdBQUcsQ0FBQ0csV0FBVyxDQUFDLE9BQU8sQ0FBQztFQUN4QkgsR0FBRyxDQUFDSSxFQUFFLENBQUMsTUFBTSxFQUFHQyxLQUFLLElBQUs7SUFDeEJMLEdBQUcsQ0FBQ0UsSUFBSSxJQUFJRyxLQUFLO0VBQ25CLENBQUMsQ0FBQztFQUNGTCxHQUFHLENBQUNJLEVBQUUsQ0FBQyxLQUFLLEVBQUUsTUFBTTtJQUNsQixJQUFJO01BQ0ZILEVBQUUsQ0FBQyxJQUFJLEVBQUVMLEVBQUUsQ0FBQ1UsS0FBSyxDQUFDTixHQUFHLENBQUNFLElBQUksQ0FBQyxDQUFDO0lBQzlCLENBQUMsQ0FBQyxPQUFPSyxHQUFHLEVBQUU7TUFDWk4sRUFBRSxDQUFDTSxHQUFHLENBQUM7SUFDVDtFQUNGLENBQUMsQ0FBQztBQUNKLENBQUMiLCJpZ25vcmVMaXN0IjpbXX0=
|
||||
+143
File diff suppressed because one or more lines are too long
+74
File diff suppressed because one or more lines are too long
+720
File diff suppressed because one or more lines are too long
+120
File diff suppressed because one or more lines are too long
+126
File diff suppressed because one or more lines are too long
+132
@@ -0,0 +1,132 @@
|
||||
{
|
||||
"name": "superagent",
|
||||
"description": "elegant & feature rich browser / node HTTP with a fluent API",
|
||||
"version": "10.3.0",
|
||||
"author": "TJ Holowaychuk <tj@vision-media.ca>",
|
||||
"browser": {
|
||||
"./src/node/index.js": "./src/client.js",
|
||||
"./lib/node/index.js": "./lib/client.js",
|
||||
"./test/support/server.js": "./test/support/blank.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ladjs/superagent/issues"
|
||||
},
|
||||
"contributors": [
|
||||
"Kornel Lesiński <kornel@geekhood.net>",
|
||||
"Peter Lyons <pete@peterlyons.com>",
|
||||
"Hunter Loftis <hunter@hunterloftis.com>",
|
||||
"Nick Baugh <niftylettuce@gmail.com>"
|
||||
],
|
||||
"dependencies": {
|
||||
"component-emitter": "^1.3.1",
|
||||
"cookiejar": "^2.1.4",
|
||||
"debug": "^4.3.7",
|
||||
"fast-safe-stringify": "^2.1.1",
|
||||
"form-data": "^4.0.5",
|
||||
"formidable": "^3.5.4",
|
||||
"methods": "^1.1.2",
|
||||
"mime": "2.6.0",
|
||||
"qs": "^6.14.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.20.7",
|
||||
"@babel/core": "^7.20.12",
|
||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||
"@babel/preset-env": "^7.20.2",
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@commitlint/cli": "^19.8.1",
|
||||
"@commitlint/config-conventional": "^19.8.1",
|
||||
"babelify": "^10.0.0",
|
||||
"Base64": "^1.1.0",
|
||||
"basic-auth-connect": "^1.0.0",
|
||||
"body-parser": "^1.20.4",
|
||||
"browserify": "^17.0.0",
|
||||
"cookie-parser": "^1.4.7",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^8.32.0",
|
||||
"eslint-config-xo-lass": "2",
|
||||
"eslint-plugin-compat": "4.0.2",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"express": "^4.18.3",
|
||||
"express-session": "^1.17.3",
|
||||
"fixpack": "^4.0.0",
|
||||
"get-port": "4.2.0",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^15.5.2",
|
||||
"marked": "^4.2.12",
|
||||
"mocha": "^6.2.3",
|
||||
"multer": "1.4.5-lts.1",
|
||||
"nyc": "^15.1.0",
|
||||
"remark-cli": "^11.0.0",
|
||||
"remark-preset-github": "4.0.4",
|
||||
"rimraf": "3",
|
||||
"should": "^13.2.3",
|
||||
"should-http": "^0.1.1",
|
||||
"tinyify": "3.0.0",
|
||||
"xo": "^0.53.1",
|
||||
"zuul": "^3.12.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.18.0"
|
||||
},
|
||||
"files": [
|
||||
"dist/*.js",
|
||||
"lib/**/*.js"
|
||||
],
|
||||
"homepage": "https://github.com/ladjs/superagent",
|
||||
"jsdelivr": "dist/superagent.min.js",
|
||||
"keywords": [
|
||||
"agent",
|
||||
"ajax",
|
||||
"ajax",
|
||||
"api",
|
||||
"async",
|
||||
"await",
|
||||
"axios",
|
||||
"cancel",
|
||||
"client",
|
||||
"frisbee",
|
||||
"got",
|
||||
"http",
|
||||
"http",
|
||||
"https",
|
||||
"ky",
|
||||
"promise",
|
||||
"promise",
|
||||
"promises",
|
||||
"request",
|
||||
"request",
|
||||
"requests",
|
||||
"response",
|
||||
"rest",
|
||||
"retry",
|
||||
"super",
|
||||
"superagent",
|
||||
"timeout",
|
||||
"transform",
|
||||
"xhr",
|
||||
"xmlhttprequest"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/node/index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/ladjs/superagent.git"
|
||||
},
|
||||
"scripts": {
|
||||
"browserify": "browserify src/node/index.js -o dist/superagent.js -s superagent -g [ babelify --configFile ./.dist.babelrc ]",
|
||||
"build": "npm run build:clean && npm run build:lib && npm run build:dist",
|
||||
"build:clean": "rimraf lib dist",
|
||||
"build:dist": "npm run browserify && npm run minify",
|
||||
"build:lib": "babel --config-file ./.lib.babelrc src --out-dir lib",
|
||||
"build:test": "babel --config-file ./.test.babelrc test --out-dir lib/node/test",
|
||||
"coverage": "nyc report --reporter=text-lcov > coverage.lcov",
|
||||
"lint": "eslint -c .eslintrc src test && remark . -qfo && eslint -c .lib.eslintrc lib/**/*.js && eslint -c .dist.eslintrc dist/**/*.js",
|
||||
"minify": "cross-env NODE_ENV=production browserify src/node/index.js -o dist/superagent.min.js -s superagent -g [ babelify --configFile ./.dist.babelrc ] -p tinyify",
|
||||
"nyc": "cross-env NODE_ENV=test nyc ava",
|
||||
"test": "npm run build && npm run lint && make test",
|
||||
"test-http2": "npm run build && npm run lint && make test-node-http2",
|
||||
"prepare": "husky"
|
||||
},
|
||||
"unpkg": "dist/superagent.min.js"
|
||||
}
|
||||
Reference in New Issue
Block a user