got 12.0.0 → 12.0.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.
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { Buffer } from 'node:buffer';
|
|
3
3
|
import { URL, URLSearchParams } from 'node:url';
|
|
4
4
|
import { checkServerIdentity } from 'node:tls';
|
|
5
|
-
import
|
|
5
|
+
import http from 'node:http';
|
|
6
|
+
import https from 'node:https';
|
|
6
7
|
import type { Readable } from 'node:stream';
|
|
7
8
|
import type { Socket } from 'node:net';
|
|
8
9
|
import type { SecureContextOptions, DetailedPeerCertificate } from 'node:tls';
|
|
@@ -1174,7 +1175,7 @@ export default class Options {
|
|
|
1174
1175
|
(hostname: string, options: import("cacheable-lookup").LookupOptions, callback: (error: NodeJS.ErrnoException | null, address: string, family: import("cacheable-lookup").IPFamily) => void): void;
|
|
1175
1176
|
} | undefined;
|
|
1176
1177
|
family: DnsLookupIpVersion;
|
|
1177
|
-
agent: false | Agents |
|
|
1178
|
+
agent: false | Agents | http.Agent | undefined;
|
|
1178
1179
|
setHost: boolean;
|
|
1179
1180
|
method: Method;
|
|
1180
1181
|
maxHeaderSize: number | undefined;
|
|
@@ -1192,7 +1193,7 @@ export default class Options {
|
|
|
1192
1193
|
socketPath?: string | undefined;
|
|
1193
1194
|
path?: string | null | undefined;
|
|
1194
1195
|
auth?: string | null | undefined;
|
|
1195
|
-
_defaultAgent?:
|
|
1196
|
+
_defaultAgent?: http.Agent | undefined;
|
|
1196
1197
|
clientCertEngine?: string | undefined;
|
|
1197
1198
|
privateKeyEngine?: string | undefined;
|
|
1198
1199
|
privateKeyIdentifier?: string | undefined;
|
|
@@ -1206,8 +1207,8 @@ export default class Options {
|
|
|
1206
1207
|
immutableMinTimeToLive?: number | undefined;
|
|
1207
1208
|
ignoreCargoCult?: boolean | undefined;
|
|
1208
1209
|
};
|
|
1209
|
-
getRequestFunction(): RequestFunction | typeof
|
|
1210
|
-
getFallbackRequestFunction(): RequestFunction | typeof
|
|
1210
|
+
getRequestFunction(): RequestFunction | typeof https.request | undefined;
|
|
1211
|
+
getFallbackRequestFunction(): RequestFunction | typeof https.request | undefined;
|
|
1211
1212
|
freeze(): void;
|
|
1212
1213
|
}
|
|
1213
1214
|
export {};
|
|
@@ -2,8 +2,9 @@ import process from 'node:process';
|
|
|
2
2
|
import { promisify, inspect } from 'node:util';
|
|
3
3
|
import { URL, URLSearchParams } from 'node:url';
|
|
4
4
|
import { checkServerIdentity } from 'node:tls';
|
|
5
|
-
|
|
6
|
-
import
|
|
5
|
+
// DO NOT use destructuring for `https.request` and `http.request` as it's not compatible with `nock`.
|
|
6
|
+
import http from 'node:http';
|
|
7
|
+
import https from 'node:https';
|
|
7
8
|
import is, { assert } from '@sindresorhus/is';
|
|
8
9
|
import lowercaseKeys from 'lowercase-keys';
|
|
9
10
|
import CacheableLookup from 'cacheable-lookup';
|
|
@@ -1582,9 +1583,9 @@ export default class Options {
|
|
|
1582
1583
|
}
|
|
1583
1584
|
return http2wrapper.auto;
|
|
1584
1585
|
}
|
|
1585
|
-
return
|
|
1586
|
+
return https.request;
|
|
1586
1587
|
}
|
|
1587
|
-
return
|
|
1588
|
+
return http.request;
|
|
1588
1589
|
}
|
|
1589
1590
|
freeze() {
|
|
1590
1591
|
const options = this._internals;
|
package/dist/source/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { got };
|
|
|
4
4
|
export { default as Options } from './core/options.js';
|
|
5
5
|
export * from './core/options.js';
|
|
6
6
|
export * from './core/response.js';
|
|
7
|
+
export type { default as Request } from './core/index.js';
|
|
7
8
|
export * from './core/index.js';
|
|
8
9
|
export * from './core/errors.js';
|
|
9
10
|
export { Delays } from './core/timed-out.js';
|