projen 0.58.13 → 0.58.16

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.
Files changed (165) hide show
  1. package/.jsii +4 -4
  2. package/README.md +2 -2
  3. package/docs/api/API.md +1 -1
  4. package/lib/awscdk/auto-discover.js +5 -5
  5. package/lib/awscdk/awscdk-app-java.js +1 -1
  6. package/lib/awscdk/awscdk-app-py.js +1 -1
  7. package/lib/awscdk/awscdk-app-ts.js +1 -1
  8. package/lib/awscdk/awscdk-construct.js +2 -2
  9. package/lib/awscdk/awscdk-deps-java.js +1 -1
  10. package/lib/awscdk/awscdk-deps-js.js +1 -1
  11. package/lib/awscdk/awscdk-deps.js +1 -1
  12. package/lib/awscdk/cdk-config.js +1 -1
  13. package/lib/awscdk/cdk-tasks.js +1 -1
  14. package/lib/awscdk/integration-test.js +1 -1
  15. package/lib/awscdk/lambda-extension.js +1 -1
  16. package/lib/awscdk/lambda-function.js +2 -2
  17. package/lib/build/build-workflow.js +1 -1
  18. package/lib/cdk/auto-discover-base.js +2 -2
  19. package/lib/cdk/construct-lib.js +1 -1
  20. package/lib/cdk/integration-test-base.js +1 -1
  21. package/lib/cdk/jsii-docgen.js +1 -1
  22. package/lib/cdk/jsii-project.js +1 -1
  23. package/lib/cdk8s/auto-discover.js +2 -2
  24. package/lib/cdk8s/cdk8s-app-ts.js +1 -1
  25. package/lib/cdk8s/cdk8s-construct.js +1 -1
  26. package/lib/cdk8s/integration-test.js +1 -1
  27. package/lib/cdktf/cdktf-construct.js +1 -1
  28. package/lib/circleci/circleci.js +1 -1
  29. package/lib/circleci/model.d.ts +1 -1
  30. package/lib/circleci/model.js +1 -1
  31. package/lib/component.js +1 -1
  32. package/lib/dependencies.js +1 -1
  33. package/lib/dev-env.js +1 -1
  34. package/lib/docker-compose.js +2 -2
  35. package/lib/file.js +1 -1
  36. package/lib/gitattributes.js +1 -1
  37. package/lib/github/auto-approve.js +1 -1
  38. package/lib/github/auto-merge.js +1 -1
  39. package/lib/github/dependabot.js +1 -1
  40. package/lib/github/github-credentials.js +1 -1
  41. package/lib/github/github-project.js +1 -1
  42. package/lib/github/github.js +1 -1
  43. package/lib/github/mergify.js +1 -1
  44. package/lib/github/pr-template.js +1 -1
  45. package/lib/github/pull-request-lint.js +1 -1
  46. package/lib/github/stale.js +1 -1
  47. package/lib/github/task-workflow.js +1 -1
  48. package/lib/github/workflows.js +1 -1
  49. package/lib/gitlab/configuration.js +1 -1
  50. package/lib/gitlab/gitlab-configuration.js +1 -1
  51. package/lib/gitlab/nested-configuration.js +1 -1
  52. package/lib/gitpod.js +1 -1
  53. package/lib/ignore-file.js +1 -1
  54. package/lib/ini.js +1 -1
  55. package/lib/java/java-project.js +1 -1
  56. package/lib/java/junit.js +1 -1
  57. package/lib/java/maven-compile.js +1 -1
  58. package/lib/java/maven-packaging.js +1 -1
  59. package/lib/java/maven-sample.js +1 -1
  60. package/lib/java/pom.js +1 -1
  61. package/lib/java/projenrc.js +1 -1
  62. package/lib/javascript/bundler.js +1 -1
  63. package/lib/javascript/eslint.js +1 -1
  64. package/lib/javascript/jest.js +1 -1
  65. package/lib/javascript/node-package.js +1 -1
  66. package/lib/javascript/node-project.js +1 -1
  67. package/lib/javascript/npm-config.js +1 -1
  68. package/lib/javascript/prettier.js +1 -1
  69. package/lib/javascript/projenrc.js +1 -1
  70. package/lib/javascript/typescript-config.js +1 -1
  71. package/lib/javascript/upgrade-dependencies.js +2 -2
  72. package/lib/json.js +1 -1
  73. package/lib/license.js +1 -1
  74. package/lib/logger.js +1 -1
  75. package/lib/makefile.js +1 -1
  76. package/lib/object-file.js +1 -1
  77. package/lib/project-build.js +1 -1
  78. package/lib/project.js +1 -1
  79. package/lib/projects.js +1 -1
  80. package/lib/projenrc-json.js +1 -1
  81. package/lib/python/pip.js +1 -1
  82. package/lib/python/poetry.js +2 -2
  83. package/lib/python/projenrc.js +1 -1
  84. package/lib/python/pytest-sample.js +1 -1
  85. package/lib/python/pytest.js +1 -1
  86. package/lib/python/python-project.js +1 -1
  87. package/lib/python/python-sample.js +1 -1
  88. package/lib/python/requirements-file.js +1 -1
  89. package/lib/python/setuppy.js +1 -1
  90. package/lib/python/setuptools.js +1 -1
  91. package/lib/python/venv.js +1 -1
  92. package/lib/readme.js +1 -1
  93. package/lib/release/publisher.js +1 -1
  94. package/lib/release/release-trigger.js +1 -1
  95. package/lib/release/release.js +1 -1
  96. package/lib/renovatebot.js +1 -1
  97. package/lib/run-task.js +1 -0
  98. package/lib/sample-file.js +2 -2
  99. package/lib/semver.js +1 -1
  100. package/lib/source-code.js +1 -1
  101. package/lib/task-runtime.js +1 -1
  102. package/lib/task.js +1 -1
  103. package/lib/tasks.js +1 -1
  104. package/lib/testing.js +1 -1
  105. package/lib/textfile.js +1 -1
  106. package/lib/toml.js +1 -1
  107. package/lib/typescript/projenrc.js +1 -1
  108. package/lib/typescript/typescript-typedoc.js +1 -1
  109. package/lib/typescript/typescript.js +3 -3
  110. package/lib/version.js +1 -1
  111. package/lib/vscode/devcontainer.js +1 -1
  112. package/lib/vscode/launch-config.js +1 -1
  113. package/lib/vscode/vscode.js +1 -1
  114. package/lib/web/next.js +3 -3
  115. package/lib/web/postcss.js +1 -1
  116. package/lib/web/react.js +4 -4
  117. package/lib/web/tailwind.js +1 -1
  118. package/lib/xmlfile.js +1 -1
  119. package/lib/yaml.js +1 -1
  120. package/node_modules/xmlbuilder2/node_modules/@types/node/README.md +1 -1
  121. package/node_modules/xmlbuilder2/node_modules/@types/node/assert.d.ts +7 -8
  122. package/node_modules/xmlbuilder2/node_modules/@types/node/async_hooks.d.ts +2 -2
  123. package/node_modules/xmlbuilder2/node_modules/@types/node/buffer.d.ts +11 -5
  124. package/node_modules/xmlbuilder2/node_modules/@types/node/child_process.d.ts +6 -3
  125. package/node_modules/xmlbuilder2/node_modules/@types/node/cluster.d.ts +14 -18
  126. package/node_modules/xmlbuilder2/node_modules/@types/node/console.d.ts +1 -1
  127. package/node_modules/xmlbuilder2/node_modules/@types/node/crypto.d.ts +109 -37
  128. package/node_modules/xmlbuilder2/node_modules/@types/node/dgram.d.ts +2 -2
  129. package/node_modules/xmlbuilder2/node_modules/@types/node/diagnostics_channel.d.ts +2 -1
  130. package/node_modules/xmlbuilder2/node_modules/@types/node/dns/promises.d.ts +2 -2
  131. package/node_modules/xmlbuilder2/node_modules/@types/node/dns.d.ts +2 -2
  132. package/node_modules/xmlbuilder2/node_modules/@types/node/domain.d.ts +3 -2
  133. package/node_modules/xmlbuilder2/node_modules/@types/node/events.d.ts +17 -27
  134. package/node_modules/xmlbuilder2/node_modules/@types/node/fs/promises.d.ts +14 -15
  135. package/node_modules/xmlbuilder2/node_modules/@types/node/fs.d.ts +21 -39
  136. package/node_modules/xmlbuilder2/node_modules/@types/node/http.d.ts +69 -23
  137. package/node_modules/xmlbuilder2/node_modules/@types/node/http2.d.ts +7 -2
  138. package/node_modules/xmlbuilder2/node_modules/@types/node/https.d.ts +1 -1
  139. package/node_modules/xmlbuilder2/node_modules/@types/node/index.d.ts +2 -1
  140. package/node_modules/xmlbuilder2/node_modules/@types/node/inspector.d.ts +10 -13
  141. package/node_modules/xmlbuilder2/node_modules/@types/node/net.d.ts +27 -7
  142. package/node_modules/xmlbuilder2/node_modules/@types/node/os.d.ts +5 -4
  143. package/node_modules/xmlbuilder2/node_modules/@types/node/package.json +2 -2
  144. package/node_modules/xmlbuilder2/node_modules/@types/node/path.d.ts +1 -1
  145. package/node_modules/xmlbuilder2/node_modules/@types/node/perf_hooks.d.ts +10 -2
  146. package/node_modules/xmlbuilder2/node_modules/@types/node/process.d.ts +2 -2
  147. package/node_modules/xmlbuilder2/node_modules/@types/node/punycode.d.ts +1 -1
  148. package/node_modules/xmlbuilder2/node_modules/@types/node/querystring.d.ts +1 -1
  149. package/node_modules/xmlbuilder2/node_modules/@types/node/readline.d.ts +2 -2
  150. package/node_modules/xmlbuilder2/node_modules/@types/node/repl.d.ts +2 -2
  151. package/node_modules/xmlbuilder2/node_modules/@types/node/stream.d.ts +39 -15
  152. package/node_modules/xmlbuilder2/node_modules/@types/node/string_decoder.d.ts +1 -1
  153. package/node_modules/xmlbuilder2/node_modules/@types/node/test.d.ts +142 -0
  154. package/node_modules/xmlbuilder2/node_modules/@types/node/timers.d.ts +1 -1
  155. package/node_modules/xmlbuilder2/node_modules/@types/node/tls.d.ts +17 -9
  156. package/node_modules/xmlbuilder2/node_modules/@types/node/trace_events.d.ts +11 -1
  157. package/node_modules/xmlbuilder2/node_modules/@types/node/tty.d.ts +4 -2
  158. package/node_modules/xmlbuilder2/node_modules/@types/node/url.d.ts +20 -18
  159. package/node_modules/xmlbuilder2/node_modules/@types/node/util.d.ts +20 -9
  160. package/node_modules/xmlbuilder2/node_modules/@types/node/v8.d.ts +19 -1
  161. package/node_modules/xmlbuilder2/node_modules/@types/node/vm.d.ts +5 -3
  162. package/node_modules/xmlbuilder2/node_modules/@types/node/wasi.d.ts +1 -1
  163. package/node_modules/xmlbuilder2/node_modules/@types/node/worker_threads.d.ts +2 -5
  164. package/node_modules/xmlbuilder2/node_modules/@types/node/zlib.d.ts +1 -1
  165. package/package.json +3 -3
@@ -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/v17.0.0/lib/fs.js)
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', './example/mewtwo', callback);
1126
+ * symlink('./mew', './mewtwo', callback);
1127
1127
  * ```
1128
1128
  *
1129
- * The above example creates a symbolic link `mewtwo` in the `example` which points
1130
- * to `mew` in the same directory:
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 example/
1134
- * example/
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`. If `buffer` is a normal object, it
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. Check `File access constants` for possible values
3276
- * of `mode`. It is possible to create a mask consisting of the bitwise OR of
3277
- * two or more values (e.g. `fs.constants.W_OK | fs.constants.R_OK`).
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 exists in the current directory, and if it is writable.
3304
- * access(file, constants.F_OK | constants.W_OK, (err) => {
3305
- * if (err) {
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. Check `File access constants` for
3455
- * possible values of `mode`. It is possible to create a mask consisting of
3456
- * the bitwise OR of two or more values
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 replacing
3561
- * it may require the `flags` option to be set to `r+` rather than the default `w`.
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': 'mysite.com',
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', 'mysite.com',
37
+ * 'Host', 'example.com',
38
38
  * 'accepT', '*' ]
39
39
  * ```
40
- * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/http.js)
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
- * In case of inactivity, the rules defined in `server.timeout` apply. However,
215
- * that inactivity based timeout would still allow the connection to be kept open
216
- * if the headers are being sent very slowly (by default, up to a byte per 2
217
- * minutes). In order to prevent this, whenever header data arrives an additional
218
- * check is made that more than `server.headersTimeout` milliseconds has not
219
- * passed since the connection was established. If the check fails, a `'timeout'`event is emitted on the server object, and (by default) the socket is destroyed.
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 v8.0.0
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 v8.0.0
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 v8.0.0
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
- * Whether the request is send through a reused socket.
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 &#x26;&#x26; 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 [stream.Readable](https://nodejs.org/dist/latest-v17.x/docs/api/stream.html#class-streamreadable).
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.headers);
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.headers.host}`);
978
+ * new URL(request.url, `http://${request.getHeaders().host}`);
935
979
  * ```
936
980
  *
937
- * When `request.url` is `'/status?name=ryan'` and`request.headers.host` is `'localhost:3000'`:
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.headers.host}`)
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/v17.0.0/lib/http2.js)
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 the `true` if the `END_STREAM` flag was set in the request or response
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/v17.0.0/lib/https.js)
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';
@@ -1,4 +1,4 @@
1
- // Type definitions for non-npm package Node.js 17.0
1
+ // Type definitions for non-npm package Node.js 18.0
2
2
  // Project: https://nodejs.org/
3
3
  // Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4
4
  // DefinitelyTyped <https://github.com/DefinitelyTyped>
@@ -114,6 +114,7 @@
114
114
  /// <reference path="stream/consumers.d.ts" />
115
115
  /// <reference path="stream/web.d.ts" />
116
116
  /// <reference path="string_decoder.d.ts" />
117
+ /// <reference path="test.d.ts" />
117
118
  /// <reference path="timers.d.ts" />
118
119
  /// <reference path="timers/promises.d.ts" />
119
120
  /// <reference path="tls.d.ts" />
@@ -15,7 +15,7 @@
15
15
  * ```js
16
16
  * const inspector = require('inspector');
17
17
  * ```
18
- * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/inspector.js)
18
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/inspector.js)
19
19
  */
20
20
  declare module 'inspector' {
21
21
  import EventEmitter = require('node:events');
@@ -1688,7 +1688,7 @@ declare module 'inspector' {
1688
1688
  /**
1689
1689
  * Controls how the trace buffer stores data.
1690
1690
  */
1691
- recordMode?: string;
1691
+ recordMode?: string | undefined;
1692
1692
  /**
1693
1693
  * Included category filters.
1694
1694
  */
@@ -1778,12 +1778,6 @@ declare module 'inspector' {
1778
1778
  * @since v8.0.0
1779
1779
  */
1780
1780
  connect(): void;
1781
- /**
1782
- * Connects a session to the main thread inspector back-end. An exception will
1783
- * be thrown if this API was not called on a Worker thread.
1784
- * @since v12.11.0
1785
- */
1786
- connectToMainThread(): void;
1787
1781
  /**
1788
1782
  * Immediately close the session. All pending message callbacks will be called
1789
1783
  * with an error. `session.connect()` will need to be called to be able to send
@@ -2695,7 +2689,7 @@ declare module 'inspector' {
2695
2689
  prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this;
2696
2690
  }
2697
2691
  /**
2698
- * Activate inspector on host and port. Equivalent to `node --inspect=[[host:]port]`, but can be done programmatically after node has
2692
+ * Activate inspector on host and port. Equivalent to`node --inspect=[[host:]port]`, but can be done programmatically after node has
2699
2693
  * started.
2700
2694
  *
2701
2695
  * If wait is `true`, will block until a client has connected to the inspect port
@@ -2717,12 +2711,12 @@ declare module 'inspector' {
2717
2711
  * ```console
2718
2712
  * $ node --inspect -p 'inspector.url()'
2719
2713
  * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
2720
- * For help see https://nodejs.org/en/docs/inspector
2714
+ * For help, see: https://nodejs.org/en/docs/inspector
2721
2715
  * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34
2722
2716
  *
2723
2717
  * $ node --inspect=localhost:3000 -p 'inspector.url()'
2724
2718
  * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
2725
- * For help see https://nodejs.org/en/docs/inspector
2719
+ * For help, see: https://nodejs.org/en/docs/inspector
2726
2720
  * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a
2727
2721
  *
2728
2722
  * $ node -p 'inspector.url()'
@@ -2738,7 +2732,10 @@ declare module 'inspector' {
2738
2732
  */
2739
2733
  function waitForDebugger(): void;
2740
2734
  }
2735
+ /**
2736
+ * The inspector module provides an API for interacting with the V8 inspector.
2737
+ */
2741
2738
  declare module 'node:inspector' {
2742
- import EventEmitter = require('inspector');
2743
- export = EventEmitter;
2739
+ import inspector = require('inspector');
2740
+ export = inspector;
2744
2741
  }
@@ -10,7 +10,7 @@
10
10
  * ```js
11
11
  * const net = require('net');
12
12
  * ```
13
- * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/net.js)
13
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/net.js)
14
14
  */
15
15
  declare module 'net' {
16
16
  import * as stream from 'node:stream';
@@ -650,7 +650,7 @@ declare module 'net' {
650
650
  *
651
651
  * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to.
652
652
  *
653
- * Here is an example of an TCP echo server which listens for connections
653
+ * Here is an example of a TCP echo server which listens for connections
654
654
  * on port 8124:
655
655
  *
656
656
  * ```js
@@ -729,19 +729,39 @@ declare module 'net' {
729
729
  function createConnection(port: number, host?: string, connectionListener?: () => void): Socket;
730
730
  function createConnection(path: string, connectionListener?: () => void): Socket;
731
731
  /**
732
- * Tests if input is an IP address. Returns `0` for invalid strings,
733
- * returns `4` for IP version 4 addresses, and returns `6` for IP version 6
734
- * addresses.
732
+ * Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4
733
+ * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`.
734
+ *
735
+ * ```js
736
+ * net.isIP('::1'); // returns 6
737
+ * net.isIP('127.0.0.1'); // returns 4
738
+ * net.isIP('127.000.000.001'); // returns 0
739
+ * net.isIP('127.0.0.1/24'); // returns 0
740
+ * net.isIP('fhqwhgads'); // returns 0
741
+ * ```
735
742
  * @since v0.3.0
736
743
  */
737
744
  function isIP(input: string): number;
738
745
  /**
739
- * Returns `true` if input is a version 4 IP address, otherwise returns `false`.
746
+ * Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no
747
+ * leading zeroes. Otherwise, returns `false`.
748
+ *
749
+ * ```js
750
+ * net.isIPv4('127.0.0.1'); // returns true
751
+ * net.isIPv4('127.000.000.001'); // returns false
752
+ * net.isIPv4('127.0.0.1/24'); // returns false
753
+ * net.isIPv4('fhqwhgads'); // returns false
754
+ * ```
740
755
  * @since v0.3.0
741
756
  */
742
757
  function isIPv4(input: string): boolean;
743
758
  /**
744
- * Returns `true` if input is a version 6 IP address, otherwise returns `false`.
759
+ * Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`.
760
+ *
761
+ * ```js
762
+ * net.isIPv6('::1'); // returns true
763
+ * net.isIPv6('fhqwhgads'); // returns false
764
+ * ```
745
765
  * @since v0.3.0
746
766
  */
747
767
  function isIPv6(input: string): boolean;
@@ -5,7 +5,7 @@
5
5
  * ```js
6
6
  * const os = require('os');
7
7
  * ```
8
- * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/os.js)
8
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/os.js)
9
9
  */
10
10
  declare module 'os' {
11
11
  interface CpuInfo {
@@ -387,7 +387,7 @@ declare module 'os' {
387
387
  const EOL: string;
388
388
  /**
389
389
  * Returns the operating system CPU architecture for which the Node.js binary was
390
- * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, `'x32'`, and `'x64'`.
390
+ * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`.
391
391
  *
392
392
  * The return value is equivalent to `process.arch`.
393
393
  * @since v0.5.0
@@ -402,8 +402,9 @@ declare module 'os' {
402
402
  */
403
403
  function version(): string;
404
404
  /**
405
- * Returns a string identifying the operating system platform. The value is set
406
- * at compile time. Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`, `'openbsd'`, `'sunos'`, and `'win32'`.
405
+ * Returns a string identifying the operating system platform for which
406
+ * the Node.js binary was compiled. The value is set at compile time.
407
+ * Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`.
407
408
  *
408
409
  * The return value is equivalent to `process.platform`.
409
410
  *
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "17.0.43",
3
+ "version": "18.0.0",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -220,6 +220,6 @@
220
220
  },
221
221
  "scripts": {},
222
222
  "dependencies": {},
223
- "typesPublisherContentHash": "07ffbd7cfc77d74142b28276aefd1b438afc4ef0738fcdb918f5d9bb8d615e98",
223
+ "typesPublisherContentHash": "7b0d8dcde4896c79ad74f0d57a24996d6812633e45ed2abd06201f1b078dd9db",
224
224
  "typeScriptVersion": "4.0"
225
225
  }
@@ -13,7 +13,7 @@ declare module 'path/win32' {
13
13
  * ```js
14
14
  * const path = require('path');
15
15
  * ```
16
- * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/path.js)
16
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/path.js)
17
17
  */
18
18
  declare module 'path' {
19
19
  namespace path {
@@ -26,7 +26,7 @@
26
26
  * performance.measure('A to B', 'A', 'B');
27
27
  * });
28
28
  * ```
29
- * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/perf_hooks.js)
29
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/perf_hooks.js)
30
30
  */
31
31
  declare module 'perf_hooks' {
32
32
  import { AsyncResource } from 'node:async_hooks';
@@ -270,6 +270,9 @@ declare module 'perf_hooks' {
270
270
  * * }
271
271
  * * ]
272
272
  *
273
+ *
274
+ * performance.clearMarks();
275
+ * performance.clearMeasures();
273
276
  * observer.disconnect();
274
277
  * });
275
278
  * obs.observe({ type: 'mark' });
@@ -317,6 +320,9 @@ declare module 'perf_hooks' {
317
320
  * * ]
318
321
  *
319
322
  * console.log(perfObserverList.getEntriesByName('test', 'measure')); // []
323
+ *
324
+ * performance.clearMarks();
325
+ * performance.clearMeasures();
320
326
  * observer.disconnect();
321
327
  * });
322
328
  * obs.observe({ entryTypes: ['mark', 'measure'] });
@@ -355,6 +361,8 @@ declare module 'perf_hooks' {
355
361
  * * }
356
362
  * * ]
357
363
  *
364
+ * performance.clearMarks();
365
+ * performance.clearMeasures();
358
366
  * observer.disconnect();
359
367
  * });
360
368
  * obs.observe({ type: 'mark' });
@@ -384,7 +392,7 @@ declare module 'perf_hooks' {
384
392
  * } = require('perf_hooks');
385
393
  *
386
394
  * const obs = new PerformanceObserver((list, observer) => {
387
- * // Called three times synchronously. `list` contains one item.
395
+ * // Called once asynchronously. `list` contains three items.
388
396
  * });
389
397
  * obs.observe({ type: 'mark' });
390
398
  *
@@ -1041,7 +1041,7 @@ declare module 'process' {
1041
1041
  title: string;
1042
1042
  /**
1043
1043
  * The operating system CPU architecture for which the Node.js binary was compiled.
1044
- * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'s390'`, `'s390x'`, `'x32'`, and `'x64'`.
1044
+ * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`.
1045
1045
  *
1046
1046
  * ```js
1047
1047
  * import { arch } from 'process';
@@ -1053,7 +1053,7 @@ declare module 'process' {
1053
1053
  readonly arch: Architecture;
1054
1054
  /**
1055
1055
  * The `process.platform` property returns a string identifying the operating
1056
- * system platform on which the Node.js process is running.
1056
+ * system platform for which the Node.js binary was compiled.
1057
1057
  *
1058
1058
  * Currently possible values are:
1059
1059
  *