got 14.5.0 → 14.6.1
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/source/as-promise/index.js +46 -10
- package/dist/source/core/diagnostics-channel.d.ts +89 -0
- package/dist/source/core/diagnostics-channel.js +49 -0
- package/dist/source/core/errors.d.ts +14 -1
- package/dist/source/core/errors.js +27 -19
- package/dist/source/core/index.d.ts +9 -1
- package/dist/source/core/index.js +429 -181
- package/dist/source/core/options.d.ts +245 -11
- package/dist/source/core/options.js +194 -68
- package/dist/source/core/response.d.ts +2 -0
- package/dist/source/core/response.js +2 -2
- package/dist/source/core/timed-out.d.ts +1 -0
- package/dist/source/core/timed-out.js +2 -3
- package/dist/source/core/utils/get-body-size.js +4 -2
- package/dist/source/core/utils/is-unix-socket-url.d.ts +16 -0
- package/dist/source/core/utils/is-unix-socket-url.js +21 -0
- package/dist/source/core/utils/weakable-map.d.ts +0 -1
- package/dist/source/core/utils/weakable-map.js +2 -6
- package/dist/source/create.js +9 -1
- package/dist/source/index.d.ts +1 -0
- package/dist/source/index.js +1 -0
- package/package.json +10 -8
- package/readme.md +1 -0
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
export default class WeakableMap {
|
|
2
|
-
weakMap;
|
|
3
|
-
map;
|
|
4
|
-
constructor() {
|
|
5
|
-
this.weakMap = new WeakMap();
|
|
6
|
-
this.map = new Map();
|
|
7
|
-
}
|
|
2
|
+
weakMap = new WeakMap();
|
|
3
|
+
map = new Map();
|
|
8
4
|
set(key, value) {
|
|
9
5
|
if (typeof key === 'object') {
|
|
10
6
|
this.weakMap.set(key, value);
|
package/dist/source/create.js
CHANGED
|
@@ -139,7 +139,15 @@ const create = (defaults) => {
|
|
|
139
139
|
}
|
|
140
140
|
else {
|
|
141
141
|
normalizedOptions.merge(optionsToMerge);
|
|
142
|
-
|
|
142
|
+
try {
|
|
143
|
+
assert.any([is.urlInstance, is.undefined], optionsToMerge.url);
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
if (error instanceof Error) {
|
|
147
|
+
error.message = `Option 'pagination.paginate.url': ${error.message}`;
|
|
148
|
+
}
|
|
149
|
+
throw error;
|
|
150
|
+
}
|
|
143
151
|
if (optionsToMerge.url !== undefined) {
|
|
144
152
|
normalizedOptions.prefixUrl = '';
|
|
145
153
|
normalizedOptions.url = optionsToMerge.url;
|
package/dist/source/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './core/response.js';
|
|
|
7
7
|
export type { default as Request } from './core/index.js';
|
|
8
8
|
export * from './core/index.js';
|
|
9
9
|
export * from './core/errors.js';
|
|
10
|
+
export * from './core/diagnostics-channel.js';
|
|
10
11
|
export type { Delays } from './core/timed-out.js';
|
|
11
12
|
export { default as calculateRetryDelay } from './core/calculate-retry-delay.js';
|
|
12
13
|
export * from './as-promise/types.js';
|
package/dist/source/index.js
CHANGED
|
@@ -14,6 +14,7 @@ export * from './core/options.js';
|
|
|
14
14
|
export * from './core/response.js';
|
|
15
15
|
export * from './core/index.js';
|
|
16
16
|
export * from './core/errors.js';
|
|
17
|
+
export * from './core/diagnostics-channel.js';
|
|
17
18
|
export { default as calculateRetryDelay } from './core/calculate-retry-delay.js';
|
|
18
19
|
export * from './as-promise/types.js';
|
|
19
20
|
export * from './types.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "got",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.6.1",
|
|
4
4
|
"description": "Human-friendly and powerful HTTP request library for Node.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "sindresorhus/got",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
18
|
"test": "xo && tsc --noEmit && NODE_OPTIONS='--import=tsx/esm' ava",
|
|
19
|
+
"test:coverage": "xo && tsc --noEmit && NODE_OPTIONS='--import=tsx/esm' c8 ava",
|
|
19
20
|
"release": "np",
|
|
20
21
|
"build": "del-cli dist && tsc",
|
|
21
22
|
"prepare": "npm run build"
|
|
@@ -40,6 +41,8 @@
|
|
|
40
41
|
"network",
|
|
41
42
|
"gzip",
|
|
42
43
|
"brotli",
|
|
44
|
+
"zstd",
|
|
45
|
+
"zstandard",
|
|
43
46
|
"requests",
|
|
44
47
|
"human-friendly",
|
|
45
48
|
"axios",
|
|
@@ -52,7 +55,7 @@
|
|
|
52
55
|
"@szmarczak/http-timer": "^5.0.1",
|
|
53
56
|
"cacheable-lookup": "^7.0.0",
|
|
54
57
|
"cacheable-request": "^13.0.12",
|
|
55
|
-
"decompress-response": "^
|
|
58
|
+
"decompress-response": "^10.0.0",
|
|
56
59
|
"form-data-encoder": "^4.0.2",
|
|
57
60
|
"http2-wrapper": "^2.2.1",
|
|
58
61
|
"keyv": "^5.5.3",
|
|
@@ -78,6 +81,8 @@
|
|
|
78
81
|
"benchmark": "^2.1.4",
|
|
79
82
|
"bluebird": "^3.7.2",
|
|
80
83
|
"body-parser": "^1.20.3",
|
|
84
|
+
"c8": "^10.1.3",
|
|
85
|
+
"chunk-data": "^0.1.0",
|
|
81
86
|
"create-cert": "^1.0.6",
|
|
82
87
|
"create-test-server": "^3.0.1",
|
|
83
88
|
"del-cli": "^6.0.0",
|
|
@@ -90,7 +95,6 @@
|
|
|
90
95
|
"nock": "^13.5.5",
|
|
91
96
|
"node-fetch": "^3.3.2",
|
|
92
97
|
"np": "^10.0.5",
|
|
93
|
-
"nyc": "^17.1.0",
|
|
94
98
|
"p-event": "^6.0.1",
|
|
95
99
|
"pem": "^1.14.8",
|
|
96
100
|
"pify": "^6.1.0",
|
|
@@ -117,17 +121,15 @@
|
|
|
117
121
|
},
|
|
118
122
|
"workerThreads": false
|
|
119
123
|
},
|
|
120
|
-
"
|
|
124
|
+
"c8": {
|
|
121
125
|
"reporter": [
|
|
122
126
|
"text",
|
|
123
127
|
"html",
|
|
124
128
|
"lcov"
|
|
125
129
|
],
|
|
126
|
-
"extension": [
|
|
127
|
-
".ts"
|
|
128
|
-
],
|
|
129
130
|
"exclude": [
|
|
130
|
-
"
|
|
131
|
+
"test/**",
|
|
132
|
+
"dist/**"
|
|
131
133
|
]
|
|
132
134
|
},
|
|
133
135
|
"xo": {
|
package/readme.md
CHANGED
|
@@ -127,6 +127,7 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
127
127
|
|
|
128
128
|
#### Integration
|
|
129
129
|
|
|
130
|
+
- [x] [Diagnostics Channel](documentation/diagnostics-channel.md)
|
|
130
131
|
- [x] [TypeScript support](documentation/typescript.md)
|
|
131
132
|
- [x] [AWS](documentation/tips.md#aws)
|
|
132
133
|
- [x] [Testing](documentation/tips.md#testing)
|