@emulsify/cli 1.11.3 → 1.12.0

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 (149) hide show
  1. package/dist/index.js +3 -1
  2. package/dist/node_modules/.package-lock.json +34 -24
  3. package/dist/node_modules/@types/node/README.md +2 -2
  4. package/dist/node_modules/@types/node/assert.d.ts +23 -1
  5. package/dist/node_modules/@types/node/async_hooks.d.ts +64 -0
  6. package/dist/node_modules/@types/node/buffer.buffer.d.ts +124 -38
  7. package/dist/node_modules/@types/node/buffer.d.ts +19 -17
  8. package/dist/node_modules/@types/node/child_process.d.ts +88 -161
  9. package/dist/node_modules/@types/node/cluster.d.ts +5 -6
  10. package/dist/node_modules/@types/node/constants.d.ts +14 -12
  11. package/dist/node_modules/@types/node/crypto.d.ts +237 -171
  12. package/dist/node_modules/@types/node/dgram.d.ts +15 -14
  13. package/dist/node_modules/@types/node/diagnostics_channel.d.ts +39 -15
  14. package/dist/node_modules/@types/node/dns/promises.d.ts +11 -9
  15. package/dist/node_modules/@types/node/dns.d.ts +28 -21
  16. package/dist/node_modules/@types/node/events.d.ts +81 -35
  17. package/dist/node_modules/@types/node/fs/promises.d.ts +61 -36
  18. package/dist/node_modules/@types/node/fs.d.ts +251 -193
  19. package/dist/node_modules/@types/node/globals.d.ts +146 -442
  20. package/dist/node_modules/@types/node/globals.typedarray.d.ts +17 -0
  21. package/dist/node_modules/@types/node/http.d.ts +137 -32
  22. package/dist/node_modules/@types/node/http2.d.ts +102 -26
  23. package/dist/node_modules/@types/node/https.d.ts +94 -60
  24. package/dist/node_modules/@types/node/index.d.ts +5 -3
  25. package/dist/node_modules/@types/node/{inspector.d.ts → inspector.generated.d.ts} +272 -2
  26. package/dist/node_modules/@types/node/module.d.ts +362 -138
  27. package/dist/node_modules/@types/node/net.d.ts +27 -20
  28. package/dist/node_modules/@types/node/os.d.ts +14 -3
  29. package/dist/node_modules/@types/node/package.json +4 -89
  30. package/dist/node_modules/@types/node/perf_hooks.d.ts +37 -10
  31. package/dist/node_modules/@types/node/process.d.ts +108 -35
  32. package/dist/node_modules/@types/node/querystring.d.ts +2 -3
  33. package/dist/node_modules/@types/node/readline/promises.d.ts +15 -3
  34. package/dist/node_modules/@types/node/readline.d.ts +66 -17
  35. package/dist/node_modules/@types/node/stream/consumers.d.ts +33 -7
  36. package/dist/node_modules/@types/node/stream/web.d.ts +13 -4
  37. package/dist/node_modules/@types/node/stream.d.ts +963 -1014
  38. package/dist/node_modules/@types/node/string_decoder.d.ts +2 -2
  39. package/dist/node_modules/@types/node/test.d.ts +1504 -1655
  40. package/dist/node_modules/@types/node/timers/promises.d.ts +28 -17
  41. package/dist/node_modules/@types/node/timers.d.ts +157 -111
  42. package/dist/node_modules/@types/node/tls.d.ts +105 -67
  43. package/dist/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +120 -37
  44. package/dist/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +15 -0
  45. package/dist/node_modules/@types/node/ts5.6/index.d.ts +5 -3
  46. package/dist/node_modules/@types/node/url.d.ts +10 -1
  47. package/dist/node_modules/@types/node/util.d.ts +43 -10
  48. package/dist/node_modules/@types/node/v8.d.ts +7 -6
  49. package/dist/node_modules/@types/node/vm.d.ts +148 -70
  50. package/dist/node_modules/@types/node/wasi.d.ts +1 -1
  51. package/dist/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  52. package/dist/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  53. package/dist/node_modules/@types/node/web-globals/events.d.ts +97 -0
  54. package/dist/node_modules/@types/node/web-globals/fetch.d.ts +46 -0
  55. package/dist/node_modules/@types/node/worker_threads.d.ts +60 -39
  56. package/dist/node_modules/@types/node/zlib.d.ts +21 -20
  57. package/dist/node_modules/debug/package.json +7 -3
  58. package/dist/node_modules/debug/src/browser.js +2 -1
  59. package/dist/node_modules/debug/src/common.js +57 -39
  60. package/dist/node_modules/fast-uri/.github/dependabot.yml +1 -1
  61. package/dist/node_modules/fast-uri/.github/workflows/ci.yml +81 -3
  62. package/dist/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +6 -2
  63. package/dist/node_modules/fast-uri/LICENSE +3 -1
  64. package/dist/node_modules/fast-uri/README.md +55 -37
  65. package/dist/node_modules/fast-uri/benchmark/benchmark.mjs +159 -0
  66. package/dist/node_modules/fast-uri/benchmark/equal.mjs +51 -0
  67. package/dist/node_modules/fast-uri/benchmark/non-simple-domain.mjs +22 -0
  68. package/dist/node_modules/fast-uri/benchmark/package.json +17 -0
  69. package/dist/node_modules/fast-uri/benchmark/string-array-to-hex-stripped.mjs +24 -0
  70. package/dist/node_modules/fast-uri/benchmark/ws-is-secure.mjs +65 -0
  71. package/dist/node_modules/fast-uri/eslint.config.js +6 -0
  72. package/dist/node_modules/fast-uri/index.js +98 -61
  73. package/dist/node_modules/fast-uri/lib/schemes.js +160 -81
  74. package/dist/node_modules/fast-uri/lib/utils.js +217 -123
  75. package/dist/node_modules/fast-uri/package.json +44 -14
  76. package/dist/node_modules/fast-uri/test/ajv.test.js +7 -3
  77. package/dist/node_modules/fast-uri/test/equal.test.js +7 -2
  78. package/dist/node_modules/fast-uri/test/fixtures/uri-js-parse.json +501 -0
  79. package/dist/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +120 -0
  80. package/dist/node_modules/fast-uri/test/parse.test.js +31 -31
  81. package/dist/node_modules/fast-uri/test/resolve.test.js +52 -49
  82. package/dist/node_modules/fast-uri/test/rfc-3986.test.js +90 -0
  83. package/dist/node_modules/fast-uri/test/serialize.test.js +55 -47
  84. package/dist/node_modules/fast-uri/test/uri-js-compatibility.test.js +33 -0
  85. package/dist/node_modules/fast-uri/test/uri-js.test.js +230 -230
  86. package/dist/node_modules/fast-uri/test/util.test.js +23 -8
  87. package/dist/node_modules/fast-uri/tsconfig.json +9 -0
  88. package/dist/node_modules/fast-uri/types/index.d.ts +16 -9
  89. package/dist/node_modules/fast-uri/types/index.test-d.ts +9 -9
  90. package/dist/node_modules/fs-extra/LICENSE +1 -1
  91. package/dist/node_modules/fs-extra/README.md +3 -1
  92. package/dist/node_modules/fs-extra/lib/copy/copy-sync.js +11 -1
  93. package/dist/node_modules/fs-extra/lib/copy/copy.js +13 -15
  94. package/dist/node_modules/fs-extra/lib/fs/index.js +6 -0
  95. package/dist/node_modules/fs-extra/lib/util/async.js +29 -0
  96. package/dist/node_modules/fs-extra/lib/util/stat.js +2 -1
  97. package/dist/node_modules/fs-extra/package.json +1 -1
  98. package/dist/node_modules/jsonfile/README.md +1 -1
  99. package/dist/node_modules/jsonfile/index.js +3 -3
  100. package/dist/node_modules/jsonfile/package.json +1 -1
  101. package/dist/node_modules/simple-git/dist/cjs/index.js +235 -235
  102. package/dist/node_modules/simple-git/dist/cjs/index.js.map +3 -3
  103. package/dist/node_modules/simple-git/dist/esm/index.js +229 -233
  104. package/dist/node_modules/simple-git/dist/esm/index.js.map +3 -3
  105. package/dist/node_modules/simple-git/dist/src/lib/git-logger.d.ts +1 -1
  106. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-branch.d.ts +1 -1
  107. package/dist/node_modules/simple-git/dist/src/lib/plugins/error-detection.plugin.d.ts +2 -3
  108. package/dist/node_modules/simple-git/dist/src/lib/plugins/simple-git-plugin.d.ts +2 -3
  109. package/dist/node_modules/simple-git/dist/src/lib/plugins/spawn-options-plugin.d.ts +0 -1
  110. package/dist/node_modules/simple-git/dist/src/lib/runners/scheduler.d.ts +1 -1
  111. package/dist/node_modules/simple-git/dist/src/lib/runners/tasks-pending-queue.d.ts +2 -2
  112. package/dist/node_modules/simple-git/dist/src/lib/tasks/apply-patch.d.ts +1 -1
  113. package/dist/node_modules/simple-git/dist/src/lib/tasks/clean.d.ts +1 -1
  114. package/dist/node_modules/simple-git/dist/src/lib/tasks/clone.d.ts +1 -1
  115. package/dist/node_modules/simple-git/dist/src/lib/tasks/log.d.ts +3 -3
  116. package/dist/node_modules/simple-git/dist/src/lib/tasks/push.d.ts +1 -1
  117. package/dist/node_modules/simple-git/dist/src/lib/tasks/remote.d.ts +4 -2
  118. package/dist/node_modules/simple-git/dist/src/lib/tasks/reset.d.ts +3 -3
  119. package/dist/node_modules/simple-git/dist/src/lib/tasks/stash-list.d.ts +1 -1
  120. package/dist/node_modules/simple-git/dist/src/lib/tasks/task.d.ts +2 -2
  121. package/dist/node_modules/simple-git/dist/src/lib/types/handlers.d.ts +1 -1
  122. package/dist/node_modules/simple-git/dist/src/lib/types/index.d.ts +9 -13
  123. package/dist/node_modules/simple-git/dist/src/lib/types/tasks.d.ts +5 -6
  124. package/dist/node_modules/simple-git/dist/src/lib/utils/argument-filters.d.ts +5 -7
  125. package/dist/node_modules/simple-git/dist/src/lib/utils/git-output-streams.d.ts +0 -1
  126. package/dist/node_modules/simple-git/dist/src/lib/utils/line-parser.d.ts +1 -1
  127. package/dist/node_modules/simple-git/dist/src/lib/utils/task-options.d.ts +1 -1
  128. package/dist/node_modules/simple-git/dist/src/lib/utils/util.d.ts +11 -10
  129. package/dist/node_modules/simple-git/package.json +6 -6
  130. package/dist/node_modules/simple-git/readme.md +8 -0
  131. package/dist/node_modules/undici-types/dispatcher.d.ts +1 -0
  132. package/dist/node_modules/undici-types/eventsource.d.ts +0 -2
  133. package/dist/node_modules/undici-types/filereader.d.ts +1 -1
  134. package/dist/node_modules/undici-types/interceptors.d.ts +3 -1
  135. package/dist/node_modules/undici-types/package.json +1 -1
  136. package/dist/node_modules/undici-types/patch.d.ts +0 -38
  137. package/dist/node_modules/undici-types/readable.d.ts +5 -0
  138. package/dist/node_modules/undici-types/webidl.d.ts +6 -0
  139. package/dist/node_modules/undici-types/websocket.d.ts +0 -2
  140. package/dist/package-lock.json +969 -1002
  141. package/dist/package.json +1 -1
  142. package/dist/util/getAvailableStarters.js +2 -2
  143. package/package.json +1 -1
  144. package/dist/node_modules/@types/node/dom-events.d.ts +0 -124
  145. package/dist/node_modules/fast-uri/benchmark.js +0 -105
  146. package/dist/node_modules/fast-uri/lib/scopedChars.js +0 -30
  147. package/dist/node_modules/fast-uri/test/.gitkeep +0 -0
  148. package/dist/node_modules/fast-uri/test/compatibility.test.js +0 -131
  149. package/dist/node_modules/jsonfile/CHANGELOG.md +0 -171
@@ -9,6 +9,7 @@
9
9
  * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/tls.js)
10
10
  */
11
11
  declare module "tls" {
12
+ import { NonSharedBuffer } from "node:buffer";
12
13
  import { X509Certificate } from "node:crypto";
13
14
  import * as net from "node:net";
14
15
  import * as stream from "stream";
@@ -49,7 +50,7 @@ declare module "tls" {
49
50
  /**
50
51
  * The DER encoded X.509 certificate data.
51
52
  */
52
- raw: Buffer;
53
+ raw: NonSharedBuffer;
53
54
  /**
54
55
  * The certificate subject.
55
56
  */
@@ -115,7 +116,7 @@ declare module "tls" {
115
116
  /**
116
117
  * The public key.
117
118
  */
118
- pubkey?: Buffer;
119
+ pubkey?: NonSharedBuffer;
119
120
  /**
120
121
  * The ASN.1 name of the OID of the elliptic curve.
121
122
  * Well-known curves are identified by an OID.
@@ -295,7 +296,7 @@ declare module "tls" {
295
296
  * @since v9.9.0
296
297
  * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet.
297
298
  */
298
- getFinished(): Buffer | undefined;
299
+ getFinished(): NonSharedBuffer | undefined;
299
300
  /**
300
301
  * Returns an object representing the peer's certificate. If the peer does not
301
302
  * provide a certificate, an empty object will be returned. If the socket has been
@@ -322,7 +323,7 @@ declare module "tls" {
322
323
  * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so
323
324
  * far.
324
325
  */
325
- getPeerFinished(): Buffer | undefined;
326
+ getPeerFinished(): NonSharedBuffer | undefined;
326
327
  /**
327
328
  * Returns a string containing the negotiated SSL/TLS protocol version of the
328
329
  * current connection. The value `'unknown'` will be returned for connected
@@ -352,7 +353,7 @@ declare module "tls" {
352
353
  * must use the `'session'` event (it also works for TLSv1.2 and below).
353
354
  * @since v0.11.4
354
355
  */
355
- getSession(): Buffer | undefined;
356
+ getSession(): NonSharedBuffer | undefined;
356
357
  /**
357
358
  * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information.
358
359
  * @since v12.11.0
@@ -367,7 +368,7 @@ declare module "tls" {
367
368
  * See `Session Resumption` for more information.
368
369
  * @since v0.11.4
369
370
  */
370
- getTLSTicket(): Buffer | undefined;
371
+ getTLSTicket(): NonSharedBuffer | undefined;
371
372
  /**
372
373
  * See `Session Resumption` for more information.
373
374
  * @since v0.5.6
@@ -398,6 +399,14 @@ declare module "tls" {
398
399
  },
399
400
  callback: (err: Error | null) => void,
400
401
  ): undefined | boolean;
402
+ /**
403
+ * The `tlsSocket.setKeyCert()` method sets the private key and certificate to use for the socket.
404
+ * This is mainly useful if you wish to select a server certificate from a TLS server's `ALPNCallback`.
405
+ * @since v22.5.0, v20.17.0
406
+ * @param context An object containing at least `key` and `cert` properties from the {@link createSecureContext()} `options`,
407
+ * or a TLS context object created with {@link createSecureContext()} itself.
408
+ */
409
+ setKeyCert(context: SecureContextOptions | SecureContext): void;
401
410
  /**
402
411
  * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size.
403
412
  * Returns `true` if setting the limit succeeded; `false` otherwise.
@@ -470,37 +479,37 @@ declare module "tls" {
470
479
  * @param context Optionally provide a context.
471
480
  * @return requested bytes of the keying material
472
481
  */
473
- exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer;
482
+ exportKeyingMaterial(length: number, label: string, context: Buffer): NonSharedBuffer;
474
483
  addListener(event: string, listener: (...args: any[]) => void): this;
475
- addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
484
+ addListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
476
485
  addListener(event: "secureConnect", listener: () => void): this;
477
- addListener(event: "session", listener: (session: Buffer) => void): this;
478
- addListener(event: "keylog", listener: (line: Buffer) => void): this;
486
+ addListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
487
+ addListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
479
488
  emit(event: string | symbol, ...args: any[]): boolean;
480
- emit(event: "OCSPResponse", response: Buffer): boolean;
489
+ emit(event: "OCSPResponse", response: NonSharedBuffer): boolean;
481
490
  emit(event: "secureConnect"): boolean;
482
- emit(event: "session", session: Buffer): boolean;
483
- emit(event: "keylog", line: Buffer): boolean;
491
+ emit(event: "session", session: NonSharedBuffer): boolean;
492
+ emit(event: "keylog", line: NonSharedBuffer): boolean;
484
493
  on(event: string, listener: (...args: any[]) => void): this;
485
- on(event: "OCSPResponse", listener: (response: Buffer) => void): this;
494
+ on(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
486
495
  on(event: "secureConnect", listener: () => void): this;
487
- on(event: "session", listener: (session: Buffer) => void): this;
488
- on(event: "keylog", listener: (line: Buffer) => void): this;
496
+ on(event: "session", listener: (session: NonSharedBuffer) => void): this;
497
+ on(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
489
498
  once(event: string, listener: (...args: any[]) => void): this;
490
- once(event: "OCSPResponse", listener: (response: Buffer) => void): this;
499
+ once(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
491
500
  once(event: "secureConnect", listener: () => void): this;
492
- once(event: "session", listener: (session: Buffer) => void): this;
493
- once(event: "keylog", listener: (line: Buffer) => void): this;
501
+ once(event: "session", listener: (session: NonSharedBuffer) => void): this;
502
+ once(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
494
503
  prependListener(event: string, listener: (...args: any[]) => void): this;
495
- prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
504
+ prependListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
496
505
  prependListener(event: "secureConnect", listener: () => void): this;
497
- prependListener(event: "session", listener: (session: Buffer) => void): this;
498
- prependListener(event: "keylog", listener: (line: Buffer) => void): this;
506
+ prependListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
507
+ prependListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
499
508
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
500
- prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
509
+ prependOnceListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
501
510
  prependOnceListener(event: "secureConnect", listener: () => void): this;
502
- prependOnceListener(event: "session", listener: (session: Buffer) => void): this;
503
- prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this;
511
+ prependOnceListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
512
+ prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
504
513
  }
505
514
  interface CommonConnectionOptions {
506
515
  /**
@@ -523,7 +532,7 @@ declare module "tls" {
523
532
  * An array of strings or a Buffer naming possible ALPN protocols.
524
533
  * (Protocols should be ordered by their priority.)
525
534
  */
526
- ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined;
535
+ ALPNProtocols?: readonly string[] | NodeJS.ArrayBufferView | undefined;
527
536
  /**
528
537
  * SNICallback(servername, cb) <Function> A function that will be
529
538
  * called if the client supports SNI TLS extension. Two arguments
@@ -578,7 +587,7 @@ declare module "tls" {
578
587
  * requires explicitly specifying a cipher suite with the `ciphers` option.
579
588
  * More information can be found in the RFC 4279.
580
589
  */
581
- pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null;
590
+ pskCallback?: ((socket: TLSSocket, identity: string) => NodeJS.ArrayBufferView | null) | undefined;
582
591
  /**
583
592
  * hint to send to a client to help
584
593
  * with selecting the identity during TLS-PSK negotiation. Will be ignored
@@ -588,7 +597,7 @@ declare module "tls" {
588
597
  pskIdentityHint?: string | undefined;
589
598
  }
590
599
  interface PSKCallbackNegotation {
591
- psk: DataView | NodeJS.TypedArray;
600
+ psk: NodeJS.ArrayBufferView;
592
601
  identity: string;
593
602
  }
594
603
  interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
@@ -619,7 +628,7 @@ declare module "tls" {
619
628
  * compatible with the selected cipher's digest.
620
629
  * `identity` must use UTF-8 encoding.
621
630
  */
622
- pskCallback?(hint: string | null): PSKCallbackNegotation | null;
631
+ pskCallback?: ((hint: string | null) => PSKCallbackNegotation | null) | undefined;
623
632
  }
624
633
  /**
625
634
  * Accepts encrypted connections using TLS or SSL.
@@ -639,7 +648,7 @@ declare module "tls" {
639
648
  * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc), or a TLS context object created
640
649
  * with {@link createSecureContext} itself.
641
650
  */
642
- addContext(hostname: string, context: SecureContextOptions): void;
651
+ addContext(hostname: string, context: SecureContextOptions | SecureContext): void;
643
652
  /**
644
653
  * Returns the session ticket keys.
645
654
  *
@@ -647,7 +656,7 @@ declare module "tls" {
647
656
  * @since v3.0.0
648
657
  * @return A 48-byte buffer containing the session ticket keys.
649
658
  */
650
- getTicketKeys(): Buffer;
659
+ getTicketKeys(): NonSharedBuffer;
651
660
  /**
652
661
  * The `server.setSecureContext()` method replaces the secure context of an
653
662
  * existing server. Existing connections to the server are not interrupted.
@@ -679,115 +688,138 @@ declare module "tls" {
679
688
  addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
680
689
  addListener(
681
690
  event: "newSession",
682
- listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
691
+ listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
683
692
  ): this;
684
693
  addListener(
685
694
  event: "OCSPRequest",
686
695
  listener: (
687
- certificate: Buffer,
688
- issuer: Buffer,
689
- callback: (err: Error | null, resp: Buffer) => void,
696
+ certificate: NonSharedBuffer,
697
+ issuer: NonSharedBuffer,
698
+ callback: (err: Error | null, resp: Buffer | null) => void,
690
699
  ) => void,
691
700
  ): this;
692
701
  addListener(
693
702
  event: "resumeSession",
694
- listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
703
+ listener: (
704
+ sessionId: NonSharedBuffer,
705
+ callback: (err: Error | null, sessionData: Buffer | null) => void,
706
+ ) => void,
695
707
  ): this;
696
708
  addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
697
- addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
709
+ addListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
698
710
  emit(event: string | symbol, ...args: any[]): boolean;
699
711
  emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
700
- emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean;
712
+ emit(
713
+ event: "newSession",
714
+ sessionId: NonSharedBuffer,
715
+ sessionData: NonSharedBuffer,
716
+ callback: () => void,
717
+ ): boolean;
701
718
  emit(
702
719
  event: "OCSPRequest",
703
- certificate: Buffer,
704
- issuer: Buffer,
705
- callback: (err: Error | null, resp: Buffer) => void,
720
+ certificate: NonSharedBuffer,
721
+ issuer: NonSharedBuffer,
722
+ callback: (err: Error | null, resp: Buffer | null) => void,
706
723
  ): boolean;
707
724
  emit(
708
725
  event: "resumeSession",
709
- sessionId: Buffer,
726
+ sessionId: NonSharedBuffer,
710
727
  callback: (err: Error | null, sessionData: Buffer | null) => void,
711
728
  ): boolean;
712
729
  emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
713
- emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean;
730
+ emit(event: "keylog", line: NonSharedBuffer, tlsSocket: TLSSocket): boolean;
714
731
  on(event: string, listener: (...args: any[]) => void): this;
715
732
  on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
716
- on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
733
+ on(
734
+ event: "newSession",
735
+ listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
736
+ ): this;
717
737
  on(
718
738
  event: "OCSPRequest",
719
739
  listener: (
720
- certificate: Buffer,
721
- issuer: Buffer,
722
- callback: (err: Error | null, resp: Buffer) => void,
740
+ certificate: NonSharedBuffer,
741
+ issuer: NonSharedBuffer,
742
+ callback: (err: Error | null, resp: Buffer | null) => void,
723
743
  ) => void,
724
744
  ): this;
725
745
  on(
726
746
  event: "resumeSession",
727
- listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
747
+ listener: (
748
+ sessionId: NonSharedBuffer,
749
+ callback: (err: Error | null, sessionData: Buffer | null) => void,
750
+ ) => void,
728
751
  ): this;
729
752
  on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
730
- on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
753
+ on(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
731
754
  once(event: string, listener: (...args: any[]) => void): this;
732
755
  once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
733
756
  once(
734
757
  event: "newSession",
735
- listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
758
+ listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
736
759
  ): this;
737
760
  once(
738
761
  event: "OCSPRequest",
739
762
  listener: (
740
- certificate: Buffer,
741
- issuer: Buffer,
742
- callback: (err: Error | null, resp: Buffer) => void,
763
+ certificate: NonSharedBuffer,
764
+ issuer: NonSharedBuffer,
765
+ callback: (err: Error | null, resp: Buffer | null) => void,
743
766
  ) => void,
744
767
  ): this;
745
768
  once(
746
769
  event: "resumeSession",
747
- listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
770
+ listener: (
771
+ sessionId: NonSharedBuffer,
772
+ callback: (err: Error | null, sessionData: Buffer | null) => void,
773
+ ) => void,
748
774
  ): this;
749
775
  once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
750
- once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
776
+ once(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
751
777
  prependListener(event: string, listener: (...args: any[]) => void): this;
752
778
  prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
753
779
  prependListener(
754
780
  event: "newSession",
755
- listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
781
+ listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
756
782
  ): this;
757
783
  prependListener(
758
784
  event: "OCSPRequest",
759
785
  listener: (
760
- certificate: Buffer,
761
- issuer: Buffer,
762
- callback: (err: Error | null, resp: Buffer) => void,
786
+ certificate: NonSharedBuffer,
787
+ issuer: NonSharedBuffer,
788
+ callback: (err: Error | null, resp: Buffer | null) => void,
763
789
  ) => void,
764
790
  ): this;
765
791
  prependListener(
766
792
  event: "resumeSession",
767
- listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
793
+ listener: (
794
+ sessionId: NonSharedBuffer,
795
+ callback: (err: Error | null, sessionData: Buffer | null) => void,
796
+ ) => void,
768
797
  ): this;
769
798
  prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
770
- prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
799
+ prependListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
771
800
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
772
801
  prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
773
802
  prependOnceListener(
774
803
  event: "newSession",
775
- listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void,
804
+ listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
776
805
  ): this;
777
806
  prependOnceListener(
778
807
  event: "OCSPRequest",
779
808
  listener: (
780
- certificate: Buffer,
781
- issuer: Buffer,
782
- callback: (err: Error | null, resp: Buffer) => void,
809
+ certificate: NonSharedBuffer,
810
+ issuer: NonSharedBuffer,
811
+ callback: (err: Error | null, resp: Buffer | null) => void,
783
812
  ) => void,
784
813
  ): this;
785
814
  prependOnceListener(
786
815
  event: "resumeSession",
787
- listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
816
+ listener: (
817
+ sessionId: NonSharedBuffer,
818
+ callback: (err: Error | null, sessionData: Buffer | null) => void,
819
+ ) => void,
788
820
  ): this;
789
821
  prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
790
- prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
822
+ prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
791
823
  }
792
824
  /**
793
825
  * @deprecated since v0.11.3 Use `tls.TLSSocket` instead.
@@ -809,6 +841,12 @@ declare module "tls" {
809
841
  * This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error.
810
842
  */
811
843
  ALPNCallback?: ((arg: { servername: string; protocols: string[] }) => string | undefined) | undefined;
844
+ /**
845
+ * Treat intermediate (non-self-signed)
846
+ * certificates in the trust CA certificate list as trusted.
847
+ * @since v22.9.0, v20.18.0
848
+ */
849
+ allowPartialTrustChain?: boolean | undefined;
812
850
  /**
813
851
  * Optionally override the trusted CA certificates. Default is to trust
814
852
  * the well-known CAs curated by Mozilla. Mozilla's CAs are completely
@@ -24,7 +24,7 @@ declare module "buffer" {
24
24
  * @param array The octets to store.
25
25
  * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
26
26
  */
27
- new(array: Uint8Array): Buffer;
27
+ new(array: ArrayLike<number>): Buffer;
28
28
  /**
29
29
  * Produces a Buffer backed by the same allocated memory as
30
30
  * the given {ArrayBuffer}/{SharedArrayBuffer}.
@@ -32,21 +32,7 @@ declare module "buffer" {
32
32
  * @param arrayBuffer The ArrayBuffer with which to share memory.
33
33
  * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
34
34
  */
35
- new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
36
- /**
37
- * Allocates a new buffer containing the given {array} of octets.
38
- *
39
- * @param array The octets to store.
40
- * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
41
- */
42
- new(array: readonly any[]): Buffer;
43
- /**
44
- * Copies the passed {buffer} data onto a new {Buffer} instance.
45
- *
46
- * @param buffer The buffer to copy.
47
- * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
48
- */
49
- new(buffer: Buffer): Buffer;
35
+ new(arrayBuffer: ArrayBufferLike): Buffer;
50
36
  /**
51
37
  * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
52
38
  * Array entries outside that range will be truncated to fit into it.
@@ -58,40 +44,121 @@ declare module "buffer" {
58
44
  * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
59
45
  * ```
60
46
  *
61
- * If `array` is an `Array`\-like object (that is, one with a `length` property of
47
+ * If `array` is an `Array`-like object (that is, one with a `length` property of
62
48
  * type `number`), it is treated as if it is an array, unless it is a `Buffer` or
63
- * a `Uint8Array`. This means all other `TypedArray` variants get treated as an `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`.
49
+ * a `Uint8Array`. This means all other `TypedArray` variants get treated as an
50
+ * `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use
51
+ * `Buffer.copyBytesFrom()`.
64
52
  *
65
53
  * A `TypeError` will be thrown if `array` is not an `Array` or another type
66
54
  * appropriate for `Buffer.from()` variants.
67
55
  *
68
- * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does.
56
+ * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal
57
+ * `Buffer` pool like `Buffer.allocUnsafe()` does.
69
58
  * @since v5.10.0
70
59
  */
60
+ from(array: WithImplicitCoercion<ArrayLike<number>>): Buffer;
61
+ /**
62
+ * This creates a view of the `ArrayBuffer` without copying the underlying
63
+ * memory. For example, when passed a reference to the `.buffer` property of a
64
+ * `TypedArray` instance, the newly created `Buffer` will share the same
65
+ * allocated memory as the `TypedArray`'s underlying `ArrayBuffer`.
66
+ *
67
+ * ```js
68
+ * import { Buffer } from 'node:buffer';
69
+ *
70
+ * const arr = new Uint16Array(2);
71
+ *
72
+ * arr[0] = 5000;
73
+ * arr[1] = 4000;
74
+ *
75
+ * // Shares memory with `arr`.
76
+ * const buf = Buffer.from(arr.buffer);
77
+ *
78
+ * console.log(buf);
79
+ * // Prints: <Buffer 88 13 a0 0f>
80
+ *
81
+ * // Changing the original Uint16Array changes the Buffer also.
82
+ * arr[1] = 6000;
83
+ *
84
+ * console.log(buf);
85
+ * // Prints: <Buffer 88 13 70 17>
86
+ * ```
87
+ *
88
+ * The optional `byteOffset` and `length` arguments specify a memory range within
89
+ * the `arrayBuffer` that will be shared by the `Buffer`.
90
+ *
91
+ * ```js
92
+ * import { Buffer } from 'node:buffer';
93
+ *
94
+ * const ab = new ArrayBuffer(10);
95
+ * const buf = Buffer.from(ab, 0, 2);
96
+ *
97
+ * console.log(buf.length);
98
+ * // Prints: 2
99
+ * ```
100
+ *
101
+ * A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer` or a
102
+ * `SharedArrayBuffer` or another type appropriate for `Buffer.from()`
103
+ * variants.
104
+ *
105
+ * It is important to remember that a backing `ArrayBuffer` can cover a range
106
+ * of memory that extends beyond the bounds of a `TypedArray` view. A new
107
+ * `Buffer` created using the `buffer` property of a `TypedArray` may extend
108
+ * beyond the range of the `TypedArray`:
109
+ *
110
+ * ```js
111
+ * import { Buffer } from 'node:buffer';
112
+ *
113
+ * const arrA = Uint8Array.from([0x63, 0x64, 0x65, 0x66]); // 4 elements
114
+ * const arrB = new Uint8Array(arrA.buffer, 1, 2); // 2 elements
115
+ * console.log(arrA.buffer === arrB.buffer); // true
116
+ *
117
+ * const buf = Buffer.from(arrB.buffer);
118
+ * console.log(buf);
119
+ * // Prints: <Buffer 63 64 65 66>
120
+ * ```
121
+ * @since v5.10.0
122
+ * @param arrayBuffer An `ArrayBuffer`, `SharedArrayBuffer`, for example the
123
+ * `.buffer` property of a `TypedArray`.
124
+ * @param byteOffset Index of first byte to expose. **Default:** `0`.
125
+ * @param length Number of bytes to expose. **Default:**
126
+ * `arrayBuffer.byteLength - byteOffset`.
127
+ */
71
128
  from(
72
- arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>,
129
+ arrayBuffer: WithImplicitCoercion<ArrayBufferLike>,
73
130
  byteOffset?: number,
74
131
  length?: number,
75
132
  ): Buffer;
76
133
  /**
77
- * Creates a new Buffer using the passed {data}
78
- * @param data data to create a new Buffer
79
- */
80
- from(data: Uint8Array | readonly number[]): Buffer;
81
- from(data: WithImplicitCoercion<Uint8Array | readonly number[] | string>): Buffer;
82
- /**
83
- * Creates a new Buffer containing the given JavaScript string {str}.
84
- * If provided, the {encoding} parameter identifies the character encoding.
85
- * If not provided, {encoding} defaults to 'utf8'.
134
+ * Creates a new `Buffer` containing `string`. The `encoding` parameter identifies
135
+ * the character encoding to be used when converting `string` into bytes.
136
+ *
137
+ * ```js
138
+ * import { Buffer } from 'node:buffer';
139
+ *
140
+ * const buf1 = Buffer.from('this is a tést');
141
+ * const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');
142
+ *
143
+ * console.log(buf1.toString());
144
+ * // Prints: this is a tést
145
+ * console.log(buf2.toString());
146
+ * // Prints: this is a tést
147
+ * console.log(buf1.toString('latin1'));
148
+ * // Prints: this is a tést
149
+ * ```
150
+ *
151
+ * A `TypeError` will be thrown if `string` is not a string or another type
152
+ * appropriate for `Buffer.from()` variants.
153
+ *
154
+ * `Buffer.from(string)` may also use the internal `Buffer` pool like
155
+ * `Buffer.allocUnsafe()` does.
156
+ * @since v5.10.0
157
+ * @param string A string to encode.
158
+ * @param encoding The encoding of `string`. **Default:** `'utf8'`.
86
159
  */
87
- from(
88
- str:
89
- | WithImplicitCoercion<string>
90
- | {
91
- [Symbol.toPrimitive](hint: "string"): string;
92
- },
93
- encoding?: BufferEncoding,
94
- ): Buffer;
160
+ from(string: WithImplicitCoercion<string>, encoding?: BufferEncoding): Buffer;
161
+ from(arrayOrString: WithImplicitCoercion<ArrayLike<number> | string>): Buffer;
95
162
  /**
96
163
  * Creates a new Buffer using the passed {data}
97
164
  * @param values to create a new Buffer
@@ -381,5 +448,21 @@ declare module "buffer" {
381
448
  */
382
449
  subarray(start?: number, end?: number): Buffer;
383
450
  }
451
+ /**
452
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
453
+ * TypeScript versions earlier than 5.7.
454
+ */
455
+ type NonSharedBuffer = Buffer;
456
+ /**
457
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
458
+ * TypeScript versions earlier than 5.7.
459
+ */
460
+ type AllowSharedBuffer = Buffer;
384
461
  }
462
+ /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
463
+ var SlowBuffer: {
464
+ /** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
465
+ new(size: number): Buffer;
466
+ prototype: Buffer;
467
+ };
385
468
  }
@@ -15,5 +15,20 @@ declare global {
15
15
  | Float32Array
16
16
  | Float64Array;
17
17
  type ArrayBufferView = TypedArray | DataView;
18
+
19
+ type NonSharedUint8Array = Uint8Array;
20
+ type NonSharedUint8ClampedArray = Uint8ClampedArray;
21
+ type NonSharedUint16Array = Uint16Array;
22
+ type NonSharedUint32Array = Uint32Array;
23
+ type NonSharedInt8Array = Int8Array;
24
+ type NonSharedInt16Array = Int16Array;
25
+ type NonSharedInt32Array = Int32Array;
26
+ type NonSharedBigUint64Array = BigUint64Array;
27
+ type NonSharedBigInt64Array = BigInt64Array;
28
+ type NonSharedFloat32Array = Float32Array;
29
+ type NonSharedFloat64Array = Float64Array;
30
+ type NonSharedDataView = DataView;
31
+ type NonSharedTypedArray = TypedArray;
32
+ type NonSharedArrayBufferView = ArrayBufferView;
18
33
  }
19
34
  }
@@ -36,6 +36,10 @@
36
36
 
37
37
  // Definitions for Node.js modules that are not specific to any version of TypeScript:
38
38
  /// <reference path="../globals.d.ts" />
39
+ /// <reference path="../web-globals/abortcontroller.d.ts" />
40
+ /// <reference path="../web-globals/domexception.d.ts" />
41
+ /// <reference path="../web-globals/events.d.ts" />
42
+ /// <reference path="../web-globals/fetch.d.ts" />
39
43
  /// <reference path="../assert.d.ts" />
40
44
  /// <reference path="../assert/strict.d.ts" />
41
45
  /// <reference path="../async_hooks.d.ts" />
@@ -49,16 +53,14 @@
49
53
  /// <reference path="../diagnostics_channel.d.ts" />
50
54
  /// <reference path="../dns.d.ts" />
51
55
  /// <reference path="../dns/promises.d.ts" />
52
- /// <reference path="../dns/promises.d.ts" />
53
56
  /// <reference path="../domain.d.ts" />
54
- /// <reference path="../dom-events.d.ts" />
55
57
  /// <reference path="../events.d.ts" />
56
58
  /// <reference path="../fs.d.ts" />
57
59
  /// <reference path="../fs/promises.d.ts" />
58
60
  /// <reference path="../http.d.ts" />
59
61
  /// <reference path="../http2.d.ts" />
60
62
  /// <reference path="../https.d.ts" />
61
- /// <reference path="../inspector.d.ts" />
63
+ /// <reference path="../inspector.generated.d.ts" />
62
64
  /// <reference path="../module.d.ts" />
63
65
  /// <reference path="../net.d.ts" />
64
66
  /// <reference path="../os.d.ts" />
@@ -8,7 +8,7 @@
8
8
  * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/url.js)
9
9
  */
10
10
  declare module "url" {
11
- import { Blob as NodeBlob } from "node:buffer";
11
+ import { Blob as NodeBlob, NonSharedBuffer } from "node:buffer";
12
12
  import { ClientRequestArgs } from "node:http";
13
13
  import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring";
14
14
  // Input to `url.format`
@@ -437,6 +437,15 @@ declare module "url" {
437
437
  * @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first.
438
438
  */
439
439
  static canParse(input: string, base?: string): boolean;
440
+ /**
441
+ * Parses a string as a URL. If `base` is provided, it will be used as the base URL for the purpose of resolving non-absolute `input` URLs.
442
+ * Returns `null` if `input` is not a valid.
443
+ * @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is
444
+ * `converted to a string` first.
445
+ * @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first.
446
+ * @since v20.18.0
447
+ */
448
+ static parse(input: string, base?: string): URL | null;
440
449
  constructor(input: string | { toString: () => string }, base?: string | URL);
441
450
  /**
442
451
  * Gets and sets the fragment portion of the URL.