superagent 6.0.0 → 7.0.2
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 +15 -2
- package/.github/FUNDING.yml +4 -0
- package/Makefile +2 -0
- package/README.md +9 -5
- package/SECURITY.md +6 -0
- package/dist/superagent.js +2790 -1289
- package/dist/superagent.min.js +1 -1
- package/docs/test.html +3085 -3547
- package/index.html +554 -1
- package/lib/agent-base.js +28 -10
- package/lib/client.js +141 -117
- package/lib/is-object.js +4 -4
- package/lib/node/agent.js +39 -18
- package/lib/node/http2wrapper.js +11 -10
- package/lib/node/index.js +174 -138
- package/lib/node/parsers/json.js +7 -7
- 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 +51 -25
- package/lib/response-base.js +10 -10
- package/lib/utils.js +19 -19
- package/package.json +81 -74
package/.dist.babelrc
CHANGED
package/.dist.eslintrc
CHANGED
|
@@ -19,7 +19,13 @@
|
|
|
19
19
|
"no-cond-assign": "off",
|
|
20
20
|
"no-redeclare": "off",
|
|
21
21
|
"node/no-exports-assign": "off",
|
|
22
|
-
"no-unsafe-finally": "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"
|
|
23
29
|
},
|
|
24
30
|
"globals": {
|
|
25
31
|
"regeneratorRuntime": "writable"
|
|
@@ -31,7 +37,14 @@
|
|
|
31
37
|
"Symbol",
|
|
32
38
|
"Object.getOwnPropertySymbols",
|
|
33
39
|
"Object.setPrototypeOf",
|
|
34
|
-
"Set"
|
|
40
|
+
"Set",
|
|
41
|
+
"Math.trunc",
|
|
42
|
+
"BigInt",
|
|
43
|
+
"Map",
|
|
44
|
+
"Reflect",
|
|
45
|
+
"WeakMap",
|
|
46
|
+
"WeakRef",
|
|
47
|
+
"WeakSet"
|
|
35
48
|
]
|
|
36
49
|
}
|
|
37
50
|
}
|
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,Set"></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,Set"></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][]) and `
|
|
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,12 @@ 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>)
|
|
215
219
|
* [5.x to 6.x](https://github.com/visionmedia/superagent/releases/tag/v6.0.0):
|
|
216
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)
|
|
217
221
|
* A specific issue with Content-Type matching not being case-insensitive is fixed
|
|
@@ -229,7 +233,7 @@ Our breaking changes are mostly in rarely used functionality and from stricter e
|
|
|
229
233
|
* Ensure you're running Node 4 or later. We've dropped support for Node 0.x.
|
|
230
234
|
* Test code that calls `.send()` multiple times. Invalid calls to `.send()` will now throw instead of sending garbage.
|
|
231
235
|
* [1.x to 2.x](https://github.com/visionmedia/superagent/releases/tag/v2.0.0):
|
|
232
|
-
* If you use `.parse()` in the
|
|
236
|
+
* If you use `.parse()` in the *browser* version, rename it to `.serialize()`.
|
|
233
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).
|
|
234
238
|
* If you use `.then()` in Internet Explorer, ensure that you have a polyfill that adds a global `Promise` object.
|
|
235
239
|
* 0.x to 1.x:
|
|
@@ -251,7 +255,7 @@ Our breaking changes are mostly in rarely used functionality and from stricter e
|
|
|
251
255
|
[MIT](LICENSE) © TJ Holowaychuk
|
|
252
256
|
|
|
253
257
|
|
|
254
|
-
##
|
|
258
|
+
##
|
|
255
259
|
|
|
256
260
|
[npm]: https://www.npmjs.com/
|
|
257
261
|
|