cdk-common 2.0.175 → 2.0.178
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/.jsii +9 -3
- package/API.md +5 -0
- package/lib/main.js +1 -1
- package/lib/managed-policies.d.ts +1 -0
- package/lib/managed-policies.js +2 -1
- package/node_modules/@aws-cdk/assert/package.json +10 -10
- package/node_modules/@aws-cdk/cfnspec/CHANGELOG.md +50 -0
- package/node_modules/@aws-cdk/cfnspec/cfn.version +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/build-tools/index.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/build-tools/massage-spec.ts.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/build-tools/patch-set.ts.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/build-tools/scrutiny.ts.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/build-tools/validate-cfn.ts.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/index.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/junit.xml +6718 -6688
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/build-tools/index.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/build-tools/massage-spec.ts.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/build-tools/patch-set.ts.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/build-tools/scrutiny.ts.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/build-tools/validate-cfn.ts.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/index.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/canned-metrics/canned-metrics-schema.ts.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/canned-metrics/index.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/canned-metrics.ts.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/index.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/index.ts.html +3 -3
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/augmentation.ts.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/base-types.ts.html +3 -3
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/index.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/index.ts.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/property.ts.html +13 -13
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/resource-type.ts.html +3 -3
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/specification.ts.html +2 -2
- package/node_modules/@aws-cdk/cfnspec/coverage/lcov.info +55 -55
- package/node_modules/@aws-cdk/cfnspec/coverage/lib/canned-metrics/canned-metrics-schema.ts.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lib/canned-metrics/index.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lib/canned-metrics.ts.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lib/index.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lib/index.ts.html +3 -3
- package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/augmentation.ts.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/base-types.ts.html +3 -3
- package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/index.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/index.ts.html +1 -1
- package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/property.ts.html +13 -13
- package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/resource-type.ts.html +3 -3
- package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/specification.ts.html +2 -2
- package/node_modules/@aws-cdk/cfnspec/package.json +5 -5
- package/node_modules/@aws-cdk/cfnspec/spec/specification.json +120 -8
- package/node_modules/@aws-cdk/cfnspec/tsconfig.tsbuildinfo +93 -57
- package/node_modules/@aws-cdk/cloudformation-diff/package.json +7 -7
- package/node_modules/@types/concat-stream/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/assert.d.ts +7 -8
- package/node_modules/@types/concat-stream/node_modules/@types/node/async_hooks.d.ts +2 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/buffer.d.ts +11 -5
- package/node_modules/@types/concat-stream/node_modules/@types/node/child_process.d.ts +6 -3
- package/node_modules/@types/concat-stream/node_modules/@types/node/cluster.d.ts +14 -18
- package/node_modules/@types/concat-stream/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/crypto.d.ts +109 -37
- package/node_modules/@types/concat-stream/node_modules/@types/node/dgram.d.ts +2 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/diagnostics_channel.d.ts +2 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/dns/promises.d.ts +2 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/dns.d.ts +2 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/domain.d.ts +3 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/events.d.ts +17 -27
- package/node_modules/@types/concat-stream/node_modules/@types/node/fs/promises.d.ts +14 -15
- package/node_modules/@types/concat-stream/node_modules/@types/node/fs.d.ts +21 -39
- package/node_modules/@types/concat-stream/node_modules/@types/node/http.d.ts +69 -23
- package/node_modules/@types/concat-stream/node_modules/@types/node/http2.d.ts +7 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/https.d.ts +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/index.d.ts +2 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/inspector.d.ts +10 -13
- package/node_modules/@types/concat-stream/node_modules/@types/node/net.d.ts +27 -7
- package/node_modules/@types/concat-stream/node_modules/@types/node/os.d.ts +5 -4
- package/node_modules/@types/concat-stream/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/path.d.ts +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/perf_hooks.d.ts +10 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/process.d.ts +2 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/querystring.d.ts +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/readline.d.ts +2 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/repl.d.ts +2 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/stream.d.ts +39 -15
- package/node_modules/@types/concat-stream/node_modules/@types/node/string_decoder.d.ts +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/test.d.ts +142 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/timers.d.ts +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/tls.d.ts +17 -9
- package/node_modules/@types/concat-stream/node_modules/@types/node/trace_events.d.ts +11 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/tty.d.ts +4 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/url.d.ts +25 -19
- package/node_modules/@types/concat-stream/node_modules/@types/node/util.d.ts +20 -9
- package/node_modules/@types/concat-stream/node_modules/@types/node/v8.d.ts +19 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/vm.d.ts +5 -3
- package/node_modules/@types/concat-stream/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/worker_threads.d.ts +2 -5
- package/node_modules/@types/concat-stream/node_modules/@types/node/zlib.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/assert.d.ts +7 -8
- package/node_modules/@types/form-data/node_modules/@types/node/async_hooks.d.ts +2 -2
- package/node_modules/@types/form-data/node_modules/@types/node/buffer.d.ts +11 -5
- package/node_modules/@types/form-data/node_modules/@types/node/child_process.d.ts +6 -3
- package/node_modules/@types/form-data/node_modules/@types/node/cluster.d.ts +14 -18
- package/node_modules/@types/form-data/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/crypto.d.ts +109 -37
- package/node_modules/@types/form-data/node_modules/@types/node/dgram.d.ts +2 -2
- package/node_modules/@types/form-data/node_modules/@types/node/diagnostics_channel.d.ts +2 -1
- package/node_modules/@types/form-data/node_modules/@types/node/dns/promises.d.ts +2 -2
- package/node_modules/@types/form-data/node_modules/@types/node/dns.d.ts +2 -2
- package/node_modules/@types/form-data/node_modules/@types/node/domain.d.ts +3 -2
- package/node_modules/@types/form-data/node_modules/@types/node/events.d.ts +17 -27
- package/node_modules/@types/form-data/node_modules/@types/node/fs/promises.d.ts +14 -15
- package/node_modules/@types/form-data/node_modules/@types/node/fs.d.ts +21 -39
- package/node_modules/@types/form-data/node_modules/@types/node/http.d.ts +69 -23
- package/node_modules/@types/form-data/node_modules/@types/node/http2.d.ts +7 -2
- package/node_modules/@types/form-data/node_modules/@types/node/https.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/index.d.ts +2 -1
- package/node_modules/@types/form-data/node_modules/@types/node/inspector.d.ts +10 -13
- package/node_modules/@types/form-data/node_modules/@types/node/net.d.ts +27 -7
- package/node_modules/@types/form-data/node_modules/@types/node/os.d.ts +5 -4
- package/node_modules/@types/form-data/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/form-data/node_modules/@types/node/path.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/perf_hooks.d.ts +10 -2
- package/node_modules/@types/form-data/node_modules/@types/node/process.d.ts +2 -2
- package/node_modules/@types/form-data/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/querystring.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/readline.d.ts +2 -2
- package/node_modules/@types/form-data/node_modules/@types/node/repl.d.ts +2 -2
- package/node_modules/@types/form-data/node_modules/@types/node/stream.d.ts +39 -15
- package/node_modules/@types/form-data/node_modules/@types/node/string_decoder.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/test.d.ts +142 -0
- package/node_modules/@types/form-data/node_modules/@types/node/timers.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/tls.d.ts +17 -9
- package/node_modules/@types/form-data/node_modules/@types/node/trace_events.d.ts +11 -1
- package/node_modules/@types/form-data/node_modules/@types/node/tty.d.ts +4 -2
- package/node_modules/@types/form-data/node_modules/@types/node/url.d.ts +25 -19
- package/node_modules/@types/form-data/node_modules/@types/node/util.d.ts +20 -9
- package/node_modules/@types/form-data/node_modules/@types/node/v8.d.ts +19 -1
- package/node_modules/@types/form-data/node_modules/@types/node/vm.d.ts +5 -3
- package/node_modules/@types/form-data/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/worker_threads.d.ts +2 -5
- package/node_modules/@types/form-data/node_modules/@types/node/zlib.d.ts +1 -1
- package/package.json +3 -3
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* server.bind(41234);
|
|
24
24
|
* // Prints: server listening 0.0.0.0:41234
|
|
25
25
|
* ```
|
|
26
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
26
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dgram.js)
|
|
27
27
|
*/
|
|
28
28
|
declare module 'dgram' {
|
|
29
29
|
import { AddressInfo } from 'node:net';
|
|
@@ -451,7 +451,7 @@ declare module 'dgram' {
|
|
|
451
451
|
* TTL. If the TTL is decremented to 0 by a router, it will not be forwarded.
|
|
452
452
|
* Changing TTL values is typically done for network probes or when multicasting.
|
|
453
453
|
*
|
|
454
|
-
* The `ttl` argument may be between
|
|
454
|
+
* The `ttl` argument may be between 1 and 255\. The default on most systems
|
|
455
455
|
* is 64.
|
|
456
456
|
*
|
|
457
457
|
* This method throws `EBADF` if called on an unbound socket.
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* should generally include the module name to avoid collisions with data from
|
|
21
21
|
* other modules.
|
|
22
22
|
* @experimental
|
|
23
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
23
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/diagnostics_channel.js)
|
|
24
24
|
*/
|
|
25
25
|
declare module 'diagnostics_channel' {
|
|
26
26
|
/**
|
|
@@ -143,6 +143,7 @@ declare module 'diagnostics_channel' {
|
|
|
143
143
|
* ```
|
|
144
144
|
* @since v15.1.0, v14.17.0
|
|
145
145
|
* @param onMessage The previous subscribed handler to remove
|
|
146
|
+
* @return `true` if the handler was found, `false` otherwise.
|
|
146
147
|
*/
|
|
147
148
|
unsubscribe(onMessage: ChannelListener): void;
|
|
148
149
|
}
|
|
@@ -119,7 +119,7 @@ declare module 'dns/promises' {
|
|
|
119
119
|
*
|
|
120
120
|
* <omitted>
|
|
121
121
|
*
|
|
122
|
-
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the DNS error codes
|
|
122
|
+
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`.
|
|
123
123
|
* @since v10.6.0
|
|
124
124
|
* @param hostname Host name to resolve.
|
|
125
125
|
* @param [rrtype='A'] Resource record type.
|
|
@@ -300,7 +300,7 @@ declare module 'dns/promises' {
|
|
|
300
300
|
* Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
|
|
301
301
|
* array of host names.
|
|
302
302
|
*
|
|
303
|
-
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the DNS error codes
|
|
303
|
+
* On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`.
|
|
304
304
|
* @since v10.6.0
|
|
305
305
|
*/
|
|
306
306
|
function reverse(ip: string): Promise<string[]>;
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
* ```
|
|
43
43
|
*
|
|
44
44
|
* See the `Implementation considerations section` for more information.
|
|
45
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
45
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dns.js)
|
|
46
46
|
*/
|
|
47
47
|
declare module 'dns' {
|
|
48
48
|
import * as dnsPromises from 'node:dns/promises';
|
|
@@ -244,7 +244,7 @@ declare module 'dns' {
|
|
|
244
244
|
*
|
|
245
245
|
* <omitted>
|
|
246
246
|
*
|
|
247
|
-
* On error, `err` is an `Error` object, where `err.code` is one of
|
|
247
|
+
* On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`.
|
|
248
248
|
* @since v0.1.27
|
|
249
249
|
* @param hostname Host name to resolve.
|
|
250
250
|
* @param [rrtype='A'] Resource record type.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* **This module is pending deprecation.** Once a replacement API has been
|
|
3
|
-
* finalized, this module will be fully deprecated. Most developers should
|
|
3
|
+
* finalized, this module will be fully deprecated. Most developers should
|
|
4
|
+
* **not** have cause to use this module. Users who absolutely must have
|
|
4
5
|
* the functionality that domains provide may rely on it for the time being
|
|
5
6
|
* but should expect to have to migrate to a different solution
|
|
6
7
|
* in the future.
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
* will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to
|
|
12
13
|
* exit immediately with an error code.
|
|
13
14
|
* @deprecated Since v1.4.2 - Deprecated
|
|
14
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
15
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/domain.js)
|
|
15
16
|
*/
|
|
16
17
|
declare module 'domain' {
|
|
17
18
|
import EventEmitter = require('node:events');
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* });
|
|
33
33
|
* myEmitter.emit('event');
|
|
34
34
|
* ```
|
|
35
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
35
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/events.js)
|
|
36
36
|
*/
|
|
37
37
|
declare module 'events' {
|
|
38
38
|
interface EventEmitterOptions {
|
|
@@ -50,7 +50,7 @@ declare module 'events' {
|
|
|
50
50
|
listener: (...args: any[]) => void,
|
|
51
51
|
opts?: {
|
|
52
52
|
once: boolean;
|
|
53
|
-
}
|
|
53
|
+
}
|
|
54
54
|
): any;
|
|
55
55
|
}
|
|
56
56
|
interface StaticEventEmitterOptions {
|
|
@@ -154,11 +154,7 @@ declare module 'events' {
|
|
|
154
154
|
* ```
|
|
155
155
|
* @since v11.13.0, v10.16.0
|
|
156
156
|
*/
|
|
157
|
-
static once(
|
|
158
|
-
emitter: NodeEventTarget,
|
|
159
|
-
eventName: string | symbol,
|
|
160
|
-
options?: StaticEventEmitterOptions,
|
|
161
|
-
): Promise<any[]>;
|
|
157
|
+
static once(emitter: NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise<any[]>;
|
|
162
158
|
static once(emitter: DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
|
163
159
|
/**
|
|
164
160
|
* ```js
|
|
@@ -218,11 +214,7 @@ declare module 'events' {
|
|
|
218
214
|
* @param eventName The name of the event being listened for
|
|
219
215
|
* @return that iterates `eventName` events emitted by the `emitter`
|
|
220
216
|
*/
|
|
221
|
-
static on(
|
|
222
|
-
emitter: NodeJS.EventEmitter,
|
|
223
|
-
eventName: string,
|
|
224
|
-
options?: StaticEventEmitterOptions,
|
|
225
|
-
): AsyncIterableIterator<any>;
|
|
217
|
+
static on(emitter: NodeJS.EventEmitter, eventName: string, options?: StaticEventEmitterOptions): AsyncIterableIterator<any>;
|
|
226
218
|
/**
|
|
227
219
|
* A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
|
|
228
220
|
*
|
|
@@ -269,23 +261,21 @@ declare module 'events' {
|
|
|
269
261
|
*/
|
|
270
262
|
static getEventListeners(emitter: DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
|
|
271
263
|
/**
|
|
272
|
-
* By default `EventEmitter`s will print a warning if more than `10` listeners are
|
|
273
|
-
* added for a particular event. This is a useful default that helps finding
|
|
274
|
-
* memory leaks. The `EventEmitter.setMaxListeners()` method allows the default limit to be
|
|
275
|
-
* modified (if eventTargets is empty) or modify the limit specified in every `EventTarget` | `EventEmitter` passed as arguments.
|
|
276
|
-
* The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
|
|
277
|
-
*
|
|
278
264
|
* ```js
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
265
|
+
* const {
|
|
266
|
+
* setMaxListeners,
|
|
267
|
+
* EventEmitter
|
|
268
|
+
* } = require('events');
|
|
269
|
+
*
|
|
270
|
+
* const target = new EventTarget();
|
|
271
|
+
* const emitter = new EventEmitter();
|
|
272
|
+
*
|
|
273
|
+
* setMaxListeners(5, target, emitter);
|
|
287
274
|
* ```
|
|
288
|
-
* @since v15.
|
|
275
|
+
* @since v15.4.0
|
|
276
|
+
* @param n A non-negative number. The maximum number of listeners per `EventTarget` event.
|
|
277
|
+
* @param eventsTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter}
|
|
278
|
+
* objects.
|
|
289
279
|
*/
|
|
290
280
|
static setMaxListeners(n?: number, ...eventTargets: Array<DOMEventTarget | NodeJS.EventEmitter>): void;
|
|
291
281
|
/**
|
|
@@ -164,9 +164,9 @@ declare module 'fs/promises' {
|
|
|
164
164
|
/**
|
|
165
165
|
* `options` may also include a `start` option to allow writing data at some
|
|
166
166
|
* position past the beginning of the file, allowed values are in the
|
|
167
|
-
* \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than
|
|
168
|
-
* it may require the `flags` `open` option to be set to `r+` rather than
|
|
169
|
-
* default `r`. The `encoding` can be any one of those accepted by `Buffer`.
|
|
167
|
+
* \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than
|
|
168
|
+
* replacing it may require the `flags` `open` option to be set to `r+` rather than
|
|
169
|
+
* the default `r`. The `encoding` can be any one of those accepted by `Buffer`.
|
|
170
170
|
*
|
|
171
171
|
* If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
|
|
172
172
|
* then the file descriptor won't be closed, even if there's an error.
|
|
@@ -333,9 +333,8 @@ declare module 'fs/promises' {
|
|
|
333
333
|
/**
|
|
334
334
|
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
|
|
335
335
|
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or
|
|
336
|
-
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object
|
|
337
|
-
*
|
|
338
|
-
* property. The promise is resolved with no arguments upon success.
|
|
336
|
+
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
|
|
337
|
+
* The promise is resolved with no arguments upon success.
|
|
339
338
|
*
|
|
340
339
|
* If `options` is a string, then it specifies the `encoding`.
|
|
341
340
|
*
|
|
@@ -353,20 +352,18 @@ declare module 'fs/promises' {
|
|
|
353
352
|
/**
|
|
354
353
|
* Write `buffer` to the file.
|
|
355
354
|
*
|
|
356
|
-
* If `buffer` is a plain object, it must have an own (not inherited) `toString`function property.
|
|
357
|
-
*
|
|
358
355
|
* The promise is resolved with an object containing two properties:
|
|
359
356
|
*
|
|
360
357
|
* It is unsafe to use `filehandle.write()` multiple times on the same file
|
|
361
358
|
* without waiting for the promise to be resolved (or rejected). For this
|
|
362
|
-
* scenario, use `
|
|
359
|
+
* scenario, use `filehandle.createWriteStream()`.
|
|
363
360
|
*
|
|
364
361
|
* On Linux, positional writes do not work when the file is opened in append mode.
|
|
365
362
|
* The kernel ignores the position argument and always appends the data to
|
|
366
363
|
* the end of the file.
|
|
367
364
|
* @since v10.0.0
|
|
368
365
|
* @param [offset=0] The start position from within `buffer` where the data to write begins.
|
|
369
|
-
* @param [length=buffer.byteLength] The number of bytes from `buffer` to write.
|
|
366
|
+
* @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write.
|
|
370
367
|
* @param position The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position.
|
|
371
368
|
* See the POSIX pwrite(2) documentation for more detail.
|
|
372
369
|
*/
|
|
@@ -432,9 +429,9 @@ declare module 'fs/promises' {
|
|
|
432
429
|
/**
|
|
433
430
|
* Tests a user's permissions for the file or directory specified by `path`.
|
|
434
431
|
* The `mode` argument is an optional integer that specifies the accessibility
|
|
435
|
-
* checks to be performed.
|
|
436
|
-
*
|
|
437
|
-
*
|
|
432
|
+
* checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK`
|
|
433
|
+
* (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
|
|
434
|
+
* possible values of `mode`.
|
|
438
435
|
*
|
|
439
436
|
* If the accessibility check is successful, the promise is resolved with no
|
|
440
437
|
* value. If any of the accessibility checks fail, the promise is rejected
|
|
@@ -854,7 +851,9 @@ declare module 'fs/promises' {
|
|
|
854
851
|
*/
|
|
855
852
|
function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
|
|
856
853
|
/**
|
|
857
|
-
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a
|
|
854
|
+
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
|
|
855
|
+
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or
|
|
856
|
+
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
|
|
858
857
|
*
|
|
859
858
|
* The `encoding` option is ignored if `data` is a buffer.
|
|
860
859
|
*
|
|
@@ -869,7 +868,7 @@ declare module 'fs/promises' {
|
|
|
869
868
|
*
|
|
870
869
|
* Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience
|
|
871
870
|
* method that performs multiple `write` calls internally to write the buffer
|
|
872
|
-
* passed to it. For performance sensitive code consider using `fs.createWriteStream()`.
|
|
871
|
+
* passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`.
|
|
873
872
|
*
|
|
874
873
|
* It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`.
|
|
875
874
|
* Cancelation is "best effort", and some amount of data is likely still
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*
|
|
17
17
|
* All file system operations have synchronous, callback, and promise-based
|
|
18
18
|
* forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM).
|
|
19
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
19
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/fs.js)
|
|
20
20
|
*/
|
|
21
21
|
declare module 'fs' {
|
|
22
22
|
import * as stream from 'node:stream';
|
|
@@ -1123,15 +1123,15 @@ declare module 'fs' {
|
|
|
1123
1123
|
* ```js
|
|
1124
1124
|
* import { symlink } from 'fs';
|
|
1125
1125
|
*
|
|
1126
|
-
* symlink('./mew', './
|
|
1126
|
+
* symlink('./mew', './mewtwo', callback);
|
|
1127
1127
|
* ```
|
|
1128
1128
|
*
|
|
1129
|
-
* The above example creates a symbolic link `mewtwo`
|
|
1130
|
-
*
|
|
1129
|
+
* The above example creates a symbolic link `mewtwo` which points to `mew` in the
|
|
1130
|
+
* same directory:
|
|
1131
1131
|
*
|
|
1132
1132
|
* ```bash
|
|
1133
|
-
* $ tree
|
|
1134
|
-
*
|
|
1133
|
+
* $ tree .
|
|
1134
|
+
* .
|
|
1135
1135
|
* ├── mew
|
|
1136
1136
|
* └── mewtwo -> ./mew
|
|
1137
1137
|
* ```
|
|
@@ -2099,8 +2099,7 @@ declare module 'fs' {
|
|
|
2099
2099
|
*/
|
|
2100
2100
|
export function fsyncSync(fd: number): void;
|
|
2101
2101
|
/**
|
|
2102
|
-
* Write `buffer` to the file specified by `fd`.
|
|
2103
|
-
* must have an own `toString` function property.
|
|
2102
|
+
* Write `buffer` to the file specified by `fd`.
|
|
2104
2103
|
*
|
|
2105
2104
|
* `offset` determines the part of the buffer to be written, and `length` is
|
|
2106
2105
|
* an integer specifying the number of bytes to write.
|
|
@@ -2223,8 +2222,6 @@ declare module 'fs' {
|
|
|
2223
2222
|
}>;
|
|
2224
2223
|
}
|
|
2225
2224
|
/**
|
|
2226
|
-
* If `buffer` is a plain object, it must have an own (not inherited) `toString`function property.
|
|
2227
|
-
*
|
|
2228
2225
|
* For detailed information, see the documentation of the asynchronous version of
|
|
2229
2226
|
* this API: {@link write}.
|
|
2230
2227
|
* @since v0.1.21
|
|
@@ -2296,10 +2293,7 @@ declare module 'fs' {
|
|
|
2296
2293
|
options: ReadAsyncOptions<TBuffer>,
|
|
2297
2294
|
callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void
|
|
2298
2295
|
): void;
|
|
2299
|
-
export function read(
|
|
2300
|
-
fd: number,
|
|
2301
|
-
callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void
|
|
2302
|
-
): void;
|
|
2296
|
+
export function read(fd: number, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void): void;
|
|
2303
2297
|
export namespace read {
|
|
2304
2298
|
/**
|
|
2305
2299
|
* @param fd A file descriptor.
|
|
@@ -2325,9 +2319,7 @@ declare module 'fs' {
|
|
|
2325
2319
|
bytesRead: number;
|
|
2326
2320
|
buffer: TBuffer;
|
|
2327
2321
|
}>;
|
|
2328
|
-
function __promisify__(
|
|
2329
|
-
fd: number
|
|
2330
|
-
): Promise<{
|
|
2322
|
+
function __promisify__(fd: number): Promise<{
|
|
2331
2323
|
bytesRead: number;
|
|
2332
2324
|
buffer: NodeJS.ArrayBufferView;
|
|
2333
2325
|
}>;
|
|
@@ -2595,8 +2587,6 @@ declare module 'fs' {
|
|
|
2595
2587
|
*
|
|
2596
2588
|
* The `mode` option only affects the newly created file. See {@link open} for more details.
|
|
2597
2589
|
*
|
|
2598
|
-
* If `data` is a plain object, it must have an own (not inherited) `toString`function property.
|
|
2599
|
-
*
|
|
2600
2590
|
* ```js
|
|
2601
2591
|
* import { writeFile } from 'fs';
|
|
2602
2592
|
* import { Buffer } from 'buffer';
|
|
@@ -2673,8 +2663,6 @@ declare module 'fs' {
|
|
|
2673
2663
|
/**
|
|
2674
2664
|
* Returns `undefined`.
|
|
2675
2665
|
*
|
|
2676
|
-
* If `data` is a plain object, it must have an own (not inherited) `toString`function property.
|
|
2677
|
-
*
|
|
2678
2666
|
* The `mode` option only affects the newly created file. See {@link open} for more details.
|
|
2679
2667
|
*
|
|
2680
2668
|
* For detailed information, see the documentation of the asynchronous version of
|
|
@@ -3272,9 +3260,9 @@ declare module 'fs' {
|
|
|
3272
3260
|
/**
|
|
3273
3261
|
* Tests a user's permissions for the file or directory specified by `path`.
|
|
3274
3262
|
* The `mode` argument is an optional integer that specifies the accessibility
|
|
3275
|
-
* checks to be performed.
|
|
3276
|
-
*
|
|
3277
|
-
*
|
|
3263
|
+
* checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK`
|
|
3264
|
+
* (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
|
|
3265
|
+
* possible values of `mode`.
|
|
3278
3266
|
*
|
|
3279
3267
|
* The final argument, `callback`, is a callback function that is invoked with
|
|
3280
3268
|
* a possible error argument. If any of the accessibility checks fail, the error
|
|
@@ -3300,14 +3288,9 @@ declare module 'fs' {
|
|
|
3300
3288
|
* console.log(`${file} ${err ? 'is not writable' : 'is writable'}`);
|
|
3301
3289
|
* });
|
|
3302
3290
|
*
|
|
3303
|
-
* // Check if the file
|
|
3304
|
-
* access(file, constants.
|
|
3305
|
-
*
|
|
3306
|
-
* console.error(
|
|
3307
|
-
* `${file} ${err.code === 'ENOENT' ? 'does not exist' : 'is read-only'}`);
|
|
3308
|
-
* } else {
|
|
3309
|
-
* console.log(`${file} exists, and it is writable`);
|
|
3310
|
-
* }
|
|
3291
|
+
* // Check if the file is readable and writable.
|
|
3292
|
+
* access(file, constants.R_OK | constants.W_OK, (err) => {
|
|
3293
|
+
* console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`);
|
|
3311
3294
|
* });
|
|
3312
3295
|
* ```
|
|
3313
3296
|
*
|
|
@@ -3451,10 +3434,9 @@ declare module 'fs' {
|
|
|
3451
3434
|
/**
|
|
3452
3435
|
* Synchronously tests a user's permissions for the file or directory specified
|
|
3453
3436
|
* by `path`. The `mode` argument is an optional integer that specifies the
|
|
3454
|
-
* accessibility checks to be performed.
|
|
3455
|
-
*
|
|
3456
|
-
*
|
|
3457
|
-
* (e.g. `fs.constants.W_OK | fs.constants.R_OK`).
|
|
3437
|
+
* accessibility checks to be performed. `mode` should be either the value`fs.constants.F_OK` or a mask consisting of the bitwise OR of any of`fs.constants.R_OK`, `fs.constants.W_OK`, and
|
|
3438
|
+
* `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
|
|
3439
|
+
* possible values of `mode`.
|
|
3458
3440
|
*
|
|
3459
3441
|
* If any of the accessibility checks fail, an `Error` will be thrown. Otherwise,
|
|
3460
3442
|
* the method will return `undefined`.
|
|
@@ -3557,9 +3539,9 @@ declare module 'fs' {
|
|
|
3557
3539
|
/**
|
|
3558
3540
|
* `options` may also include a `start` option to allow writing data at some
|
|
3559
3541
|
* position past the beginning of the file, allowed values are in the
|
|
3560
|
-
* \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than
|
|
3561
|
-
* it may require the `flags` option to be set to `r+` rather than the
|
|
3562
|
-
* The `encoding` can be any one of those accepted by `Buffer`.
|
|
3542
|
+
* \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than
|
|
3543
|
+
* replacing it may require the `flags` option to be set to `r+` rather than the
|
|
3544
|
+
* default `w`. The `encoding` can be any one of those accepted by `Buffer`.
|
|
3563
3545
|
*
|
|
3564
3546
|
* If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
|
|
3565
3547
|
* then the file descriptor won't be closed, even if there's an error.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* { 'content-length': '123',
|
|
14
14
|
* 'content-type': 'text/plain',
|
|
15
15
|
* 'connection': 'keep-alive',
|
|
16
|
-
* 'host': '
|
|
16
|
+
* 'host': 'example.com',
|
|
17
17
|
* 'accept': '*' }
|
|
18
18
|
* ```
|
|
19
19
|
*
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
* 'content-LENGTH', '123',
|
|
35
35
|
* 'content-type', 'text/plain',
|
|
36
36
|
* 'CONNECTION', 'keep-alive',
|
|
37
|
-
* 'Host', '
|
|
37
|
+
* 'Host', 'example.com',
|
|
38
38
|
* 'accepT', '*' ]
|
|
39
39
|
* ```
|
|
40
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
40
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/http.js)
|
|
41
41
|
*/
|
|
42
42
|
declare module 'http' {
|
|
43
43
|
import * as stream from 'node:stream';
|
|
@@ -211,14 +211,12 @@ declare module 'http' {
|
|
|
211
211
|
* Limit the amount of time the parser will wait to receive the complete HTTP
|
|
212
212
|
* headers.
|
|
213
213
|
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
* See `server.timeout` for more information on how timeout behavior can be
|
|
221
|
-
* customized.
|
|
214
|
+
* If the timeout expires, the server responds with status 408 without
|
|
215
|
+
* forwarding the request to the request listener and then closes the connection.
|
|
216
|
+
*
|
|
217
|
+
* It must be set to a non-zero value (e.g. 120 seconds) to protect against
|
|
218
|
+
* potential Denial-of-Service attacks in case the server is deployed without a
|
|
219
|
+
* reverse proxy in front.
|
|
222
220
|
* @since v11.3.0, v10.14.0
|
|
223
221
|
*/
|
|
224
222
|
headersTimeout: number;
|
|
@@ -392,13 +390,13 @@ declare module 'http' {
|
|
|
392
390
|
* const headers = outgoingMessage.getHeaders();
|
|
393
391
|
* // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] }
|
|
394
392
|
* ```
|
|
395
|
-
* @since
|
|
393
|
+
* @since v7.7.0
|
|
396
394
|
*/
|
|
397
395
|
getHeaders(): OutgoingHttpHeaders;
|
|
398
396
|
/**
|
|
399
397
|
* Returns an array of names of headers of the outgoing outgoingMessage. All
|
|
400
398
|
* names are lowercase.
|
|
401
|
-
* @since
|
|
399
|
+
* @since v7.7.0
|
|
402
400
|
*/
|
|
403
401
|
getHeaderNames(): string[];
|
|
404
402
|
/**
|
|
@@ -408,7 +406,7 @@ declare module 'http' {
|
|
|
408
406
|
* ```js
|
|
409
407
|
* const hasContentType = outgoingMessage.hasHeader('content-type');
|
|
410
408
|
* ```
|
|
411
|
-
* @since
|
|
409
|
+
* @since v7.7.0
|
|
412
410
|
*/
|
|
413
411
|
hasHeader(name: string): boolean;
|
|
414
412
|
/**
|
|
@@ -418,6 +416,7 @@ declare module 'http' {
|
|
|
418
416
|
* outgoingMessage.removeHeader('Content-Encoding');
|
|
419
417
|
* ```
|
|
420
418
|
* @since v0.4.0
|
|
419
|
+
* @param name Header name
|
|
421
420
|
*/
|
|
422
421
|
removeHeader(name: string): void;
|
|
423
422
|
/**
|
|
@@ -608,7 +607,7 @@ declare module 'http' {
|
|
|
608
607
|
* The `request.aborted` property will be `true` if the request has
|
|
609
608
|
* been aborted.
|
|
610
609
|
* @since v0.11.14
|
|
611
|
-
* @deprecated Since v17.0.0 - Check `destroyed` instead.
|
|
610
|
+
* @deprecated Since v17.0.0,v16.12.0 - Check `destroyed` instead.
|
|
612
611
|
*/
|
|
613
612
|
aborted: boolean;
|
|
614
613
|
/**
|
|
@@ -622,13 +621,58 @@ declare module 'http' {
|
|
|
622
621
|
*/
|
|
623
622
|
protocol: string;
|
|
624
623
|
/**
|
|
625
|
-
*
|
|
624
|
+
* When sending request through a keep-alive enabled agent, the underlying socket
|
|
625
|
+
* might be reused. But if server closes connection at unfortunate time, client
|
|
626
|
+
* may run into a 'ECONNRESET' error.
|
|
627
|
+
*
|
|
628
|
+
* ```js
|
|
629
|
+
* const http = require('http');
|
|
630
|
+
*
|
|
631
|
+
* // Server has a 5 seconds keep-alive timeout by default
|
|
632
|
+
* http
|
|
633
|
+
* .createServer((req, res) => {
|
|
634
|
+
* res.write('hello\n');
|
|
635
|
+
* res.end();
|
|
636
|
+
* })
|
|
637
|
+
* .listen(3000);
|
|
638
|
+
*
|
|
639
|
+
* setInterval(() => {
|
|
640
|
+
* // Adapting a keep-alive agent
|
|
641
|
+
* http.get('http://localhost:3000', { agent }, (res) => {
|
|
642
|
+
* res.on('data', (data) => {
|
|
643
|
+
* // Do nothing
|
|
644
|
+
* });
|
|
645
|
+
* });
|
|
646
|
+
* }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout
|
|
647
|
+
* ```
|
|
648
|
+
*
|
|
649
|
+
* By marking a request whether it reused socket or not, we can do
|
|
650
|
+
* automatic error retry base on it.
|
|
651
|
+
*
|
|
652
|
+
* ```js
|
|
653
|
+
* const http = require('http');
|
|
654
|
+
* const agent = new http.Agent({ keepAlive: true });
|
|
655
|
+
*
|
|
656
|
+
* function retriableRequest() {
|
|
657
|
+
* const req = http
|
|
658
|
+
* .get('http://localhost:3000', { agent }, (res) => {
|
|
659
|
+
* // ...
|
|
660
|
+
* })
|
|
661
|
+
* .on('error', (err) => {
|
|
662
|
+
* // Check if retry is needed
|
|
663
|
+
* if (req.reusedSocket && err.code === 'ECONNRESET') {
|
|
664
|
+
* retriableRequest();
|
|
665
|
+
* }
|
|
666
|
+
* });
|
|
667
|
+
* }
|
|
668
|
+
*
|
|
669
|
+
* retriableRequest();
|
|
670
|
+
* ```
|
|
626
671
|
* @since v13.0.0, v12.16.0
|
|
627
672
|
*/
|
|
628
673
|
reusedSocket: boolean;
|
|
629
674
|
/**
|
|
630
675
|
* Limits maximum response headers count. If set to 0, no limit will be applied.
|
|
631
|
-
* @default 2000
|
|
632
676
|
*/
|
|
633
677
|
maxHeadersCount: number;
|
|
634
678
|
constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
|
|
@@ -788,7 +832,7 @@ declare module 'http' {
|
|
|
788
832
|
* The `message.aborted` property will be `true` if the request has
|
|
789
833
|
* been aborted.
|
|
790
834
|
* @since v10.1.0
|
|
791
|
-
* @deprecated Since v17.0.0 - Check `message.destroyed` from
|
|
835
|
+
* @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from <a href="stream.html#class-streamreadable" class="type">stream.Readable</a>.
|
|
792
836
|
*/
|
|
793
837
|
aborted: boolean;
|
|
794
838
|
/**
|
|
@@ -840,7 +884,7 @@ declare module 'http' {
|
|
|
840
884
|
*
|
|
841
885
|
* This property is guaranteed to be an instance of the `net.Socket` class,
|
|
842
886
|
* a subclass of `stream.Duplex`, unless the user specified a socket
|
|
843
|
-
* type other than `net.Socket
|
|
887
|
+
* type other than `net.Socket` or internally nulled.
|
|
844
888
|
* @since v0.3.0
|
|
845
889
|
*/
|
|
846
890
|
socket: Socket;
|
|
@@ -855,7 +899,7 @@ declare module 'http' {
|
|
|
855
899
|
* // { 'user-agent': 'curl/7.22.0',
|
|
856
900
|
* // host: '127.0.0.1:8000',
|
|
857
901
|
* // accept: '*' }
|
|
858
|
-
* console.log(request.
|
|
902
|
+
* console.log(request.getHeaders());
|
|
859
903
|
* ```
|
|
860
904
|
*
|
|
861
905
|
* Duplicates in raw headers are handled in the following ways, depending on the
|
|
@@ -931,14 +975,14 @@ declare module 'http' {
|
|
|
931
975
|
* To parse the URL into its parts:
|
|
932
976
|
*
|
|
933
977
|
* ```js
|
|
934
|
-
* new URL(request.url, `http://${request.
|
|
978
|
+
* new URL(request.url, `http://${request.getHeaders().host}`);
|
|
935
979
|
* ```
|
|
936
980
|
*
|
|
937
|
-
* When `request.url` is `'/status?name=ryan'` and`request.
|
|
981
|
+
* When `request.url` is `'/status?name=ryan'` and`request.getHeaders().host` is `'localhost:3000'`:
|
|
938
982
|
*
|
|
939
983
|
* ```console
|
|
940
984
|
* $ node
|
|
941
|
-
* > new URL(request.url, `http://${request.
|
|
985
|
+
* > new URL(request.url, `http://${request.getHeaders().host}`)
|
|
942
986
|
* URL {
|
|
943
987
|
* href: 'http://localhost:3000/status?name=ryan',
|
|
944
988
|
* origin: 'http://localhost:3000',
|
|
@@ -1137,6 +1181,8 @@ declare module 'http' {
|
|
|
1137
1181
|
// create interface RequestOptions would make the naming more clear to developers
|
|
1138
1182
|
interface RequestOptions extends ClientRequestArgs {}
|
|
1139
1183
|
/**
|
|
1184
|
+
* `options` in `socket.connect()` are also supported.
|
|
1185
|
+
*
|
|
1140
1186
|
* Node.js maintains several connections per server to make HTTP requests.
|
|
1141
1187
|
* This function allows one to transparently issue requests.
|
|
1142
1188
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* const http2 = require('http2');
|
|
7
7
|
* ```
|
|
8
8
|
* @since v8.4.0
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/http2.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'http2' {
|
|
12
12
|
import EventEmitter = require('node:events');
|
|
@@ -83,7 +83,7 @@ declare module 'http2' {
|
|
|
83
83
|
*/
|
|
84
84
|
readonly destroyed: boolean;
|
|
85
85
|
/**
|
|
86
|
-
* Set
|
|
86
|
+
* Set to `true` if the `END_STREAM` flag was set in the request or response
|
|
87
87
|
* HEADERS frame received, indicating that no additional data should be received
|
|
88
88
|
* and the readable side of the `Http2Stream` will be closed.
|
|
89
89
|
* @since v10.11.0
|
|
@@ -846,6 +846,11 @@ declare module 'http2' {
|
|
|
846
846
|
* For HTTP/2 Client `Http2Session` instances only, the `http2session.request()`creates and returns an `Http2Stream` instance that can be used to send an
|
|
847
847
|
* HTTP/2 request to the connected server.
|
|
848
848
|
*
|
|
849
|
+
* When a `ClientHttp2Session` is first created, the socket may not yet be
|
|
850
|
+
* connected. if `clienthttp2session.request()` is called during this time, the
|
|
851
|
+
* actual request will be deferred until the socket is ready to go.
|
|
852
|
+
* If the `session` is closed before the actual request be executed, an`ERR_HTTP2_GOAWAY_SESSION` is thrown.
|
|
853
|
+
*
|
|
849
854
|
* This method is only available if `http2session.type` is equal to`http2.constants.NGHTTP2_SESSION_CLIENT`.
|
|
850
855
|
*
|
|
851
856
|
* ```js
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a
|
|
3
3
|
* separate module.
|
|
4
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
4
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/https.js)
|
|
5
5
|
*/
|
|
6
6
|
declare module 'https' {
|
|
7
7
|
import { Duplex } from 'node:stream';
|