superagent 5.3.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dist.babelrc +2 -1
- package/.dist.eslintrc +17 -2
- package/.github/FUNDING.yml +4 -0
- package/.lib.eslintrc +4 -1
- package/Makefile +2 -0
- package/README.md +13 -5
- package/SECURITY.md +6 -0
- package/dist/superagent.js +2853 -1295
- package/dist/superagent.min.js +1 -1
- package/docs/index.md +30 -0
- package/docs/tail.html +1 -1
- package/docs/test.html +3085 -3547
- package/index.html +554 -1
- package/lib/agent-base.js +28 -10
- package/lib/client.js +142 -118
- package/lib/is-object.js +4 -4
- package/lib/node/agent.js +39 -18
- package/lib/node/http2wrapper.js +11 -9
- package/lib/node/index.js +180 -143
- package/lib/node/parsers/image.js +1 -1
- package/lib/node/parsers/json.js +7 -7
- package/lib/node/parsers/text.js +1 -1
- package/lib/node/parsers/urlencoded.js +1 -1
- package/lib/node/response.js +15 -15
- package/lib/node/unzip.js +8 -8
- package/lib/request-base.js +110 -61
- package/lib/response-base.js +10 -10
- package/lib/utils.js +53 -19
- package/package.json +84 -71
package/.dist.babelrc
CHANGED
package/.dist.eslintrc
CHANGED
|
@@ -18,7 +18,14 @@
|
|
|
18
18
|
"no-useless-escape": "off",
|
|
19
19
|
"no-cond-assign": "off",
|
|
20
20
|
"no-redeclare": "off",
|
|
21
|
-
"node/no-exports-assign": "off"
|
|
21
|
+
"node/no-exports-assign": "off",
|
|
22
|
+
"no-unsafe-finally": "off",
|
|
23
|
+
"complexity": ["error", 10000],
|
|
24
|
+
"max-statements": "off",
|
|
25
|
+
"no-constant-condition": "off",
|
|
26
|
+
"no-control-regex": "off",
|
|
27
|
+
"no-fallthrough": "off",
|
|
28
|
+
"operator-linebreak": "off"
|
|
22
29
|
},
|
|
23
30
|
"globals": {
|
|
24
31
|
"regeneratorRuntime": "writable"
|
|
@@ -29,7 +36,15 @@
|
|
|
29
36
|
"Array.from",
|
|
30
37
|
"Symbol",
|
|
31
38
|
"Object.getOwnPropertySymbols",
|
|
32
|
-
"Object.setPrototypeOf"
|
|
39
|
+
"Object.setPrototypeOf",
|
|
40
|
+
"Set",
|
|
41
|
+
"Math.trunc",
|
|
42
|
+
"BigInt",
|
|
43
|
+
"Map",
|
|
44
|
+
"Reflect",
|
|
45
|
+
"WeakMap",
|
|
46
|
+
"WeakRef",
|
|
47
|
+
"WeakSet"
|
|
33
48
|
]
|
|
34
49
|
}
|
|
35
50
|
}
|
package/.lib.eslintrc
CHANGED
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
"node/no-unsupported-features/node-builtins": "off",
|
|
12
12
|
"no-func-assign": "off",
|
|
13
13
|
"no-global-assign": ["error", {"exceptions": ["exports"]}],
|
|
14
|
-
"
|
|
14
|
+
"no-fallthrough": "off",
|
|
15
|
+
"no-constant-condition": "off",
|
|
16
|
+
"node/no-exports-assign": "off",
|
|
17
|
+
"no-unsafe-finally": "off"
|
|
15
18
|
},
|
|
16
19
|
"overrides": [
|
|
17
20
|
{
|
package/Makefile
CHANGED
|
@@ -13,6 +13,7 @@ test-node:
|
|
|
13
13
|
--throw-deprecation \
|
|
14
14
|
--reporter $(REPORTER) \
|
|
15
15
|
--timeout 5000 \
|
|
16
|
+
--exit \
|
|
16
17
|
$(NODETESTS)
|
|
17
18
|
|
|
18
19
|
test-node-http2:
|
|
@@ -22,6 +23,7 @@ test-node-http2:
|
|
|
22
23
|
--throw-deprecation \
|
|
23
24
|
--reporter $(REPORTER) \
|
|
24
25
|
--timeout 5000 \
|
|
26
|
+
--exit \
|
|
25
27
|
$(NODETESTS)
|
|
26
28
|
|
|
27
29
|
test-cov: lib-cov
|
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ Browser-ready versions of this module are available via [jsdelivr][], [unpkg][],
|
|
|
83
83
|
This is the solution for you if you're just using `<script>` tags everywhere!
|
|
84
84
|
|
|
85
85
|
```html
|
|
86
|
-
<script src="https://polyfill.io/v3/polyfill.min.js?features=Array.from,Promise,Symbol,Object.setPrototypeOf,Object.getOwnPropertySymbols"></script>
|
|
86
|
+
<script src="https://polyfill.io/v3/polyfill.min.js?features=Array.from,Promise,Symbol,Object.setPrototypeOf,Object.getOwnPropertySymbols,Set,Math.trunc,BigInt,Map,Reflect,WeakMap,WeakRef,WeakSet,BigInt,Map,Reflect,WeakMap,WeakRef,WeakSet"></script>
|
|
87
87
|
<script src="https://cdn.jsdelivr.net/npm/superagent"></script>
|
|
88
88
|
<!-- if you wish to use unpkg.com instead: -->
|
|
89
89
|
<!-- <script src="https://unpkg.com/superagent"></script> -->
|
|
@@ -159,11 +159,11 @@ If you are using [browserify][], [webpack][], [rollup][], or another bundler, th
|
|
|
159
159
|
We recommend using <https://polyfill.io> (specifically with the bundle mentioned in [VanillaJS](#vanillajs) above):
|
|
160
160
|
|
|
161
161
|
```html
|
|
162
|
-
<script src="https://polyfill.io/v3/polyfill.min.js?features=Array.from,Promise,Symbol,Object.setPrototypeOf,Object.getOwnPropertySymbols"></script>
|
|
162
|
+
<script src="https://polyfill.io/v3/polyfill.min.js?features=Array.from,Promise,Symbol,Object.setPrototypeOf,Object.getOwnPropertySymbols,Set,Math.trunc,BigInt,Map,Reflect,WeakMap,WeakRef,WeakSet"></script>
|
|
163
163
|
```
|
|
164
164
|
|
|
165
165
|
* IE 9-10 requires a polyfill for `Promise`, `Array.from`, `Symbol`, `Object.getOwnPropertySymbols`, and `Object.setPrototypeOf`
|
|
166
|
-
* IE 9 requires a polyfill for `window.FormData` (we recommend [formdata-polyfill][])
|
|
166
|
+
* IE 9 requires a polyfill for `window.FormData` (we recommend [formdata-polyfill][]), `Set`, `Math.trunc`, `BigInt`, `Map`, `Reflect`, `WeakMap`, `WeakRef`, and `WeakSet`
|
|
167
167
|
|
|
168
168
|
|
|
169
169
|
## Plugins
|
|
@@ -210,8 +210,16 @@ For SuperAgent extensions such as couchdb and oauth visit the [wiki](https://git
|
|
|
210
210
|
|
|
211
211
|
## Upgrading from previous versions
|
|
212
212
|
|
|
213
|
+
Please see [GitHub releases page](https://github.com/visionmedia/superagent/releases) for the current changelog.
|
|
214
|
+
|
|
213
215
|
Our breaking changes are mostly in rarely used functionality and from stricter error handling.
|
|
214
216
|
|
|
217
|
+
* [6.0 to 6.1](https://github.com/visionmedia/superagent/releases/tag/v6.1.0)
|
|
218
|
+
* 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>)
|
|
219
|
+
* [5.x to 6.x](https://github.com/visionmedia/superagent/releases/tag/v6.0.0):
|
|
220
|
+
* 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)
|
|
221
|
+
* A specific issue with Content-Type matching not being case-insensitive is fixed
|
|
222
|
+
* Set is now required for IE 9, see [Required Browser Features](#required-browser-features) for more insight
|
|
215
223
|
* [4.x to 5.x](https://github.com/visionmedia/superagent/releases/tag/v5.0.0):
|
|
216
224
|
* We've implemented the build setup of [Lass](https://lass.js.org) to simplify our stack and linting
|
|
217
225
|
* 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`)
|
|
@@ -225,7 +233,7 @@ Our breaking changes are mostly in rarely used functionality and from stricter e
|
|
|
225
233
|
* Ensure you're running Node 4 or later. We've dropped support for Node 0.x.
|
|
226
234
|
* Test code that calls `.send()` multiple times. Invalid calls to `.send()` will now throw instead of sending garbage.
|
|
227
235
|
* [1.x to 2.x](https://github.com/visionmedia/superagent/releases/tag/v2.0.0):
|
|
228
|
-
* If you use `.parse()` in the
|
|
236
|
+
* If you use `.parse()` in the *browser* version, rename it to `.serialize()`.
|
|
229
237
|
* 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).
|
|
230
238
|
* If you use `.then()` in Internet Explorer, ensure that you have a polyfill that adds a global `Promise` object.
|
|
231
239
|
* 0.x to 1.x:
|
|
@@ -247,7 +255,7 @@ Our breaking changes are mostly in rarely used functionality and from stricter e
|
|
|
247
255
|
[MIT](LICENSE) © TJ Holowaychuk
|
|
248
256
|
|
|
249
257
|
|
|
250
|
-
##
|
|
258
|
+
##
|
|
251
259
|
|
|
252
260
|
[npm]: https://www.npmjs.com/
|
|
253
261
|
|