@chainlink/external-adapter-framework 2.7.2 → 2.9.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 (175) hide show
  1. package/README.md +1 -1
  2. package/adapter/basic.js +21 -4
  3. package/adapter/basic.js.map +1 -1
  4. package/adapter/endpoint.js +13 -0
  5. package/adapter/endpoint.js.map +1 -1
  6. package/adapter/por.js +6 -6
  7. package/adapter/por.js.map +1 -1
  8. package/adapter/price.js +1 -0
  9. package/adapter/price.js.map +1 -1
  10. package/cache/local.js +5 -1
  11. package/cache/local.js.map +1 -1
  12. package/cache/redis.js +3 -1
  13. package/cache/redis.js.map +1 -1
  14. package/cache/response.js +5 -0
  15. package/cache/response.js.map +1 -1
  16. package/config/index.js +9 -6
  17. package/config/index.js.map +1 -1
  18. package/generator-adapter/node_modules/.yarn-integrity +4 -4
  19. package/generator-adapter/node_modules/@types/node/README.md +3 -3
  20. package/generator-adapter/node_modules/@types/node/assert/strict.d.ts +105 -2
  21. package/generator-adapter/node_modules/@types/node/assert.d.ts +162 -101
  22. package/generator-adapter/node_modules/@types/node/async_hooks.d.ts +25 -5
  23. package/generator-adapter/node_modules/@types/node/buffer.buffer.d.ts +9 -0
  24. package/generator-adapter/node_modules/@types/node/buffer.d.ts +9 -5
  25. package/generator-adapter/node_modules/@types/node/child_process.d.ts +67 -44
  26. package/generator-adapter/node_modules/@types/node/cluster.d.ts +19 -20
  27. package/generator-adapter/node_modules/@types/node/compatibility/iterators.d.ts +1 -0
  28. package/generator-adapter/node_modules/@types/node/console.d.ts +19 -18
  29. package/generator-adapter/node_modules/@types/node/crypto.d.ts +1247 -355
  30. package/generator-adapter/node_modules/@types/node/dgram.d.ts +10 -9
  31. package/generator-adapter/node_modules/@types/node/diagnostics_channel.d.ts +1 -3
  32. package/generator-adapter/node_modules/@types/node/dns/promises.d.ts +1 -1
  33. package/generator-adapter/node_modules/@types/node/dns.d.ts +23 -18
  34. package/generator-adapter/node_modules/@types/node/domain.d.ts +1 -1
  35. package/generator-adapter/node_modules/@types/node/events.d.ts +81 -35
  36. package/generator-adapter/node_modules/@types/node/fs/promises.d.ts +62 -22
  37. package/generator-adapter/node_modules/@types/node/fs.d.ts +364 -98
  38. package/generator-adapter/node_modules/@types/node/globals.d.ts +4 -4
  39. package/generator-adapter/node_modules/@types/node/globals.typedarray.d.ts +20 -0
  40. package/generator-adapter/node_modules/@types/node/http.d.ts +120 -32
  41. package/generator-adapter/node_modules/@types/node/http2.d.ts +185 -65
  42. package/generator-adapter/node_modules/@types/node/https.d.ts +92 -63
  43. package/generator-adapter/node_modules/@types/node/index.d.ts +10 -5
  44. package/generator-adapter/node_modules/@types/node/inspector.d.ts +277 -0
  45. package/generator-adapter/node_modules/@types/node/inspector.generated.d.ts +908 -886
  46. package/generator-adapter/node_modules/@types/node/module.d.ts +21 -18
  47. package/generator-adapter/node_modules/@types/node/net.d.ts +35 -16
  48. package/generator-adapter/node_modules/@types/node/os.d.ts +22 -10
  49. package/generator-adapter/node_modules/@types/node/package.json +13 -3
  50. package/generator-adapter/node_modules/@types/node/path.d.ts +1 -1
  51. package/generator-adapter/node_modules/@types/node/perf_hooks.d.ts +28 -16
  52. package/generator-adapter/node_modules/@types/node/process.d.ts +30 -30
  53. package/generator-adapter/node_modules/@types/node/punycode.d.ts +1 -1
  54. package/generator-adapter/node_modules/@types/node/querystring.d.ts +1 -1
  55. package/generator-adapter/node_modules/@types/node/readline/promises.d.ts +1 -1
  56. package/generator-adapter/node_modules/@types/node/readline.d.ts +13 -13
  57. package/generator-adapter/node_modules/@types/node/repl.d.ts +23 -13
  58. package/generator-adapter/node_modules/@types/node/sea.d.ts +10 -1
  59. package/generator-adapter/node_modules/@types/node/sqlite.d.ts +245 -23
  60. package/generator-adapter/node_modules/@types/node/stream/consumers.d.ts +2 -2
  61. package/generator-adapter/node_modules/@types/node/stream/web.d.ts +6 -55
  62. package/generator-adapter/node_modules/@types/node/stream.d.ts +63 -37
  63. package/generator-adapter/node_modules/@types/node/string_decoder.d.ts +3 -3
  64. package/generator-adapter/node_modules/@types/node/test.d.ts +196 -40
  65. package/generator-adapter/node_modules/@types/node/timers/promises.d.ts +1 -1
  66. package/generator-adapter/node_modules/@types/node/timers.d.ts +1 -3
  67. package/generator-adapter/node_modules/@types/node/tls.d.ts +124 -114
  68. package/generator-adapter/node_modules/@types/node/trace_events.d.ts +6 -6
  69. package/generator-adapter/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +10 -2
  70. package/generator-adapter/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  71. package/generator-adapter/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +17 -0
  72. package/generator-adapter/node_modules/@types/node/ts5.6/index.d.ts +12 -5
  73. package/generator-adapter/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  74. package/generator-adapter/node_modules/@types/node/ts5.7/index.d.ts +103 -0
  75. package/generator-adapter/node_modules/@types/node/tty.d.ts +1 -1
  76. package/generator-adapter/node_modules/@types/node/url.d.ts +109 -33
  77. package/generator-adapter/node_modules/@types/node/util.d.ts +31 -305
  78. package/generator-adapter/node_modules/@types/node/v8.d.ts +41 -8
  79. package/generator-adapter/node_modules/@types/node/vm.d.ts +258 -107
  80. package/generator-adapter/node_modules/@types/node/wasi.d.ts +23 -2
  81. package/generator-adapter/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
  82. package/generator-adapter/node_modules/@types/node/web-globals/events.d.ts +3 -0
  83. package/generator-adapter/node_modules/@types/node/web-globals/fetch.d.ts +4 -0
  84. package/generator-adapter/node_modules/@types/node/web-globals/navigator.d.ts +3 -0
  85. package/generator-adapter/node_modules/@types/node/web-globals/streams.d.ts +22 -0
  86. package/generator-adapter/node_modules/@types/node/worker_threads.d.ts +142 -51
  87. package/generator-adapter/node_modules/@types/node/zlib.d.ts +36 -31
  88. package/generator-adapter/node_modules/undici-types/agent.d.ts +12 -11
  89. package/generator-adapter/node_modules/undici-types/api.d.ts +24 -24
  90. package/generator-adapter/node_modules/undici-types/balanced-pool.d.ts +11 -11
  91. package/generator-adapter/node_modules/undici-types/cache-interceptor.d.ts +172 -0
  92. package/generator-adapter/node_modules/undici-types/client-stats.d.ts +15 -0
  93. package/generator-adapter/node_modules/undici-types/client.d.ts +18 -18
  94. package/generator-adapter/node_modules/undici-types/cookies.d.ts +2 -0
  95. package/generator-adapter/node_modules/undici-types/diagnostics-channel.d.ts +18 -10
  96. package/generator-adapter/node_modules/undici-types/dispatcher.d.ts +119 -99
  97. package/generator-adapter/node_modules/undici-types/env-http-proxy-agent.d.ts +4 -3
  98. package/generator-adapter/node_modules/undici-types/errors.d.ts +66 -54
  99. package/generator-adapter/node_modules/undici-types/eventsource.d.ts +9 -4
  100. package/generator-adapter/node_modules/undici-types/fetch.d.ts +18 -16
  101. package/generator-adapter/node_modules/undici-types/formdata.d.ts +7 -7
  102. package/generator-adapter/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  103. package/generator-adapter/node_modules/undici-types/global-origin.d.ts +5 -5
  104. package/generator-adapter/node_modules/undici-types/h2c-client.d.ts +73 -0
  105. package/generator-adapter/node_modules/undici-types/handlers.d.ts +8 -8
  106. package/generator-adapter/node_modules/undici-types/header.d.ts +157 -1
  107. package/generator-adapter/node_modules/undici-types/index.d.ts +56 -47
  108. package/generator-adapter/node_modules/undici-types/interceptors.d.ts +30 -8
  109. package/generator-adapter/node_modules/undici-types/mock-agent.d.ts +36 -18
  110. package/generator-adapter/node_modules/undici-types/mock-call-history.d.ts +111 -0
  111. package/generator-adapter/node_modules/undici-types/mock-client.d.ts +6 -4
  112. package/generator-adapter/node_modules/undici-types/mock-errors.d.ts +3 -3
  113. package/generator-adapter/node_modules/undici-types/mock-interceptor.d.ts +21 -20
  114. package/generator-adapter/node_modules/undici-types/mock-pool.d.ts +6 -4
  115. package/generator-adapter/node_modules/undici-types/package.json +1 -1
  116. package/generator-adapter/node_modules/undici-types/patch.d.ts +0 -4
  117. package/generator-adapter/node_modules/undici-types/pool-stats.d.ts +8 -8
  118. package/generator-adapter/node_modules/undici-types/pool.d.ts +14 -12
  119. package/generator-adapter/node_modules/undici-types/proxy-agent.d.ts +5 -4
  120. package/generator-adapter/node_modules/undici-types/readable.d.ts +18 -15
  121. package/generator-adapter/node_modules/undici-types/retry-agent.d.ts +1 -1
  122. package/generator-adapter/node_modules/undici-types/retry-handler.d.ts +19 -10
  123. package/generator-adapter/node_modules/undici-types/snapshot-agent.d.ts +109 -0
  124. package/generator-adapter/node_modules/undici-types/util.d.ts +3 -3
  125. package/generator-adapter/node_modules/undici-types/utility.d.ts +7 -0
  126. package/generator-adapter/node_modules/undici-types/webidl.d.ts +142 -29
  127. package/generator-adapter/node_modules/undici-types/websocket.d.ts +38 -2
  128. package/generator-adapter/package.json +1 -1
  129. package/metrics/index.js +3 -0
  130. package/metrics/index.js.map +1 -1
  131. package/package.json +9 -9
  132. package/rate-limiting/burst.js +6 -6
  133. package/rate-limiting/burst.js.map +1 -1
  134. package/rate-limiting/fixed-interval.js +2 -3
  135. package/rate-limiting/fixed-interval.js.map +1 -1
  136. package/transports/abstract/streaming.js +7 -10
  137. package/transports/abstract/streaming.js.map +1 -1
  138. package/transports/abstract/subscription.js +4 -0
  139. package/transports/abstract/subscription.js.map +1 -1
  140. package/transports/http.js +5 -3
  141. package/transports/http.js.map +1 -1
  142. package/transports/index.js +1 -3
  143. package/transports/index.js.map +1 -1
  144. package/transports/sse.js +6 -2
  145. package/transports/sse.js.map +1 -1
  146. package/transports/websocket.d.ts +9 -1
  147. package/transports/websocket.js +41 -65
  148. package/transports/websocket.js.map +1 -1
  149. package/util/censor/censor-list.js +1 -1
  150. package/util/censor/censor-list.js.map +1 -1
  151. package/util/group-runner.js +3 -2
  152. package/util/group-runner.js.map +1 -1
  153. package/util/index.js +8 -1
  154. package/util/index.js.map +1 -1
  155. package/util/logger.js +8 -1
  156. package/util/logger.js.map +1 -1
  157. package/util/requester.js +11 -3
  158. package/util/requester.js.map +1 -1
  159. package/util/subscription-set/expiring-sorted-set.js +3 -0
  160. package/util/subscription-set/expiring-sorted-set.js.map +1 -1
  161. package/util/subscription-set/redis-sorted-set.js +3 -0
  162. package/util/subscription-set/redis-sorted-set.js.map +1 -1
  163. package/util/subscription-set/subscription-set.js +5 -0
  164. package/util/subscription-set/subscription-set.js.map +1 -1
  165. package/util/testing-utils.js +13 -6
  166. package/util/testing-utils.js.map +1 -1
  167. package/validation/error.js +13 -0
  168. package/validation/error.js.map +1 -1
  169. package/validation/input-params.js +14 -0
  170. package/validation/input-params.js.map +1 -1
  171. package/generator-adapter/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
  172. package/generator-adapter/node_modules/@types/node/compatibility/index.d.ts +0 -9
  173. package/generator-adapter/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  174. package/generator-adapter/node_modules/undici-types/file.d.ts +0 -39
  175. package/generator-adapter/node_modules/undici-types/filereader.d.ts +0 -54
@@ -22,26 +22,32 @@
22
22
  * IN THE SOFTWARE.
23
23
  */
24
24
 
25
- // NOTE: These definitions support Node.js and TypeScript 4.9 through 5.6.
25
+ // NOTE: These definitions support Node.js and TypeScript 5.2 through 5.6.
26
26
 
27
- // Reference required TypeScript libs:
27
+ // Reference required TypeScript libraries:
28
28
  /// <reference lib="es2020" />
29
+ /// <reference lib="esnext.disposable" />
29
30
 
30
- // TypeScript backwards-compatibility definitions:
31
- /// <reference path="../compatibility/index.d.ts" />
31
+ // TypeScript library polyfills required for TypeScript <=5.6:
32
+ /// <reference path="./compatibility/float16array.d.ts" />
32
33
 
33
- // Definitions specific to TypeScript 4.9 through 5.6:
34
+ // Iterator definitions required for compatibility with TypeScript <5.6:
35
+ /// <reference path="../compatibility/iterators.d.ts" />
36
+
37
+ // Definitions for Node.js modules specific to TypeScript <=5.6:
34
38
  /// <reference path="./globals.typedarray.d.ts" />
35
39
  /// <reference path="./buffer.buffer.d.ts" />
36
40
 
37
41
  // Definitions for Node.js modules that are not specific to any version of TypeScript:
38
42
  /// <reference path="../globals.d.ts" />
39
43
  /// <reference path="../web-globals/abortcontroller.d.ts" />
44
+ /// <reference path="../web-globals/crypto.d.ts" />
40
45
  /// <reference path="../web-globals/domexception.d.ts" />
41
46
  /// <reference path="../web-globals/events.d.ts" />
42
47
  /// <reference path="../web-globals/fetch.d.ts" />
43
48
  /// <reference path="../web-globals/navigator.d.ts" />
44
49
  /// <reference path="../web-globals/storage.d.ts" />
50
+ /// <reference path="../web-globals/streams.d.ts" />
45
51
  /// <reference path="../assert.d.ts" />
46
52
  /// <reference path="../assert/strict.d.ts" />
47
53
  /// <reference path="../async_hooks.d.ts" />
@@ -62,6 +68,7 @@
62
68
  /// <reference path="../http.d.ts" />
63
69
  /// <reference path="../http2.d.ts" />
64
70
  /// <reference path="../https.d.ts" />
71
+ /// <reference path="../inspector.d.ts" />
65
72
  /// <reference path="../inspector.generated.d.ts" />
66
73
  /// <reference path="../module.d.ts" />
67
74
  /// <reference path="../net.d.ts" />
@@ -0,0 +1,72 @@
1
+ // Interface declaration for Float16Array, required in @types/node v24+.
2
+ // These definitions are specific to TS 5.7.
3
+
4
+ // This needs all of the "common" properties/methods of the TypedArrays,
5
+ // otherwise the type unions `TypedArray` and `ArrayBufferView` will be
6
+ // empty objects.
7
+ interface Float16Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
8
+ readonly BYTES_PER_ELEMENT: number;
9
+ readonly buffer: TArrayBuffer;
10
+ readonly byteLength: number;
11
+ readonly byteOffset: number;
12
+ readonly length: number;
13
+ readonly [Symbol.toStringTag]: "Float16Array";
14
+ at(index: number): number | undefined;
15
+ copyWithin(target: number, start: number, end?: number): this;
16
+ entries(): ArrayIterator<[number, number]>;
17
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
18
+ fill(value: number, start?: number, end?: number): this;
19
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Float16Array<ArrayBuffer>;
20
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
21
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
22
+ findLast<S extends number>(
23
+ predicate: (value: number, index: number, array: this) => value is S,
24
+ thisArg?: any,
25
+ ): S | undefined;
26
+ findLast(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): number | undefined;
27
+ findLastIndex(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): number;
28
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
29
+ includes(searchElement: number, fromIndex?: number): boolean;
30
+ indexOf(searchElement: number, fromIndex?: number): number;
31
+ join(separator?: string): string;
32
+ keys(): ArrayIterator<number>;
33
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
34
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Float16Array<ArrayBuffer>;
35
+ reduce(
36
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
37
+ ): number;
38
+ reduce(
39
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
40
+ initialValue: number,
41
+ ): number;
42
+ reduce<U>(
43
+ callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U,
44
+ initialValue: U,
45
+ ): U;
46
+ reduceRight(
47
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
48
+ ): number;
49
+ reduceRight(
50
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
51
+ initialValue: number,
52
+ ): number;
53
+ reduceRight<U>(
54
+ callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U,
55
+ initialValue: U,
56
+ ): U;
57
+ reverse(): this;
58
+ set(array: ArrayLike<number>, offset?: number): void;
59
+ slice(start?: number, end?: number): Float16Array<ArrayBuffer>;
60
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
61
+ sort(compareFn?: (a: number, b: number) => number): this;
62
+ subarray(begin?: number, end?: number): Float16Array<TArrayBuffer>;
63
+ toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions): string;
64
+ toReversed(): Float16Array<ArrayBuffer>;
65
+ toSorted(compareFn?: (a: number, b: number) => number): Float16Array<ArrayBuffer>;
66
+ toString(): string;
67
+ valueOf(): this;
68
+ values(): ArrayIterator<number>;
69
+ with(index: number, value: number): Float16Array<ArrayBuffer>;
70
+ [Symbol.iterator](): ArrayIterator<number>;
71
+ [index: number]: number;
72
+ }
@@ -0,0 +1,103 @@
1
+ /**
2
+ * License for programmatically and manually incorporated
3
+ * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
4
+ *
5
+ * Copyright Node.js contributors. All rights reserved.
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to
8
+ * deal in the Software without restriction, including without limitation the
9
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10
+ * sell copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22
+ * IN THE SOFTWARE.
23
+ */
24
+
25
+ // NOTE: These definitions support Node.js and TypeScript 5.7.
26
+
27
+ // Reference required TypeScript libraries:
28
+ /// <reference lib="es2020" />
29
+ /// <reference lib="esnext.disposable" />
30
+
31
+ // TypeScript library polyfills required for TypeScript 5.7:
32
+ /// <reference path="./compatibility/float16array.d.ts" />
33
+
34
+ // Iterator definitions required for compatibility with TypeScript <5.6:
35
+ /// <reference path="../compatibility/iterators.d.ts" />
36
+
37
+ // Definitions for Node.js modules specific to TypeScript 5.7+:
38
+ /// <reference path="../globals.typedarray.d.ts" />
39
+ /// <reference path="../buffer.buffer.d.ts" />
40
+
41
+ // Definitions for Node.js modules that are not specific to any version of TypeScript:
42
+ /// <reference path="../globals.d.ts" />
43
+ /// <reference path="../web-globals/abortcontroller.d.ts" />
44
+ /// <reference path="../web-globals/crypto.d.ts" />
45
+ /// <reference path="../web-globals/domexception.d.ts" />
46
+ /// <reference path="../web-globals/events.d.ts" />
47
+ /// <reference path="../web-globals/fetch.d.ts" />
48
+ /// <reference path="../web-globals/navigator.d.ts" />
49
+ /// <reference path="../web-globals/storage.d.ts" />
50
+ /// <reference path="../web-globals/streams.d.ts" />
51
+ /// <reference path="../assert.d.ts" />
52
+ /// <reference path="../assert/strict.d.ts" />
53
+ /// <reference path="../async_hooks.d.ts" />
54
+ /// <reference path="../buffer.d.ts" />
55
+ /// <reference path="../child_process.d.ts" />
56
+ /// <reference path="../cluster.d.ts" />
57
+ /// <reference path="../console.d.ts" />
58
+ /// <reference path="../constants.d.ts" />
59
+ /// <reference path="../crypto.d.ts" />
60
+ /// <reference path="../dgram.d.ts" />
61
+ /// <reference path="../diagnostics_channel.d.ts" />
62
+ /// <reference path="../dns.d.ts" />
63
+ /// <reference path="../dns/promises.d.ts" />
64
+ /// <reference path="../domain.d.ts" />
65
+ /// <reference path="../events.d.ts" />
66
+ /// <reference path="../fs.d.ts" />
67
+ /// <reference path="../fs/promises.d.ts" />
68
+ /// <reference path="../http.d.ts" />
69
+ /// <reference path="../http2.d.ts" />
70
+ /// <reference path="../https.d.ts" />
71
+ /// <reference path="../inspector.d.ts" />
72
+ /// <reference path="../inspector.generated.d.ts" />
73
+ /// <reference path="../module.d.ts" />
74
+ /// <reference path="../net.d.ts" />
75
+ /// <reference path="../os.d.ts" />
76
+ /// <reference path="../path.d.ts" />
77
+ /// <reference path="../perf_hooks.d.ts" />
78
+ /// <reference path="../process.d.ts" />
79
+ /// <reference path="../punycode.d.ts" />
80
+ /// <reference path="../querystring.d.ts" />
81
+ /// <reference path="../readline.d.ts" />
82
+ /// <reference path="../readline/promises.d.ts" />
83
+ /// <reference path="../repl.d.ts" />
84
+ /// <reference path="../sea.d.ts" />
85
+ /// <reference path="../sqlite.d.ts" />
86
+ /// <reference path="../stream.d.ts" />
87
+ /// <reference path="../stream/promises.d.ts" />
88
+ /// <reference path="../stream/consumers.d.ts" />
89
+ /// <reference path="../stream/web.d.ts" />
90
+ /// <reference path="../string_decoder.d.ts" />
91
+ /// <reference path="../test.d.ts" />
92
+ /// <reference path="../timers.d.ts" />
93
+ /// <reference path="../timers/promises.d.ts" />
94
+ /// <reference path="../tls.d.ts" />
95
+ /// <reference path="../trace_events.d.ts" />
96
+ /// <reference path="../tty.d.ts" />
97
+ /// <reference path="../url.d.ts" />
98
+ /// <reference path="../util.d.ts" />
99
+ /// <reference path="../v8.d.ts" />
100
+ /// <reference path="../vm.d.ts" />
101
+ /// <reference path="../wasi.d.ts" />
102
+ /// <reference path="../worker_threads.d.ts" />
103
+ /// <reference path="../zlib.d.ts" />
@@ -21,7 +21,7 @@
21
21
  *
22
22
  * In most cases, there should be little to no reason for an application to
23
23
  * manually create instances of the `tty.ReadStream` and `tty.WriteStream` classes.
24
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/tty.js)
24
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/tty.js)
25
25
  */
26
26
  declare module "tty" {
27
27
  import * as net from "node:net";
@@ -5,10 +5,10 @@
5
5
  * ```js
6
6
  * import url from 'node:url';
7
7
  * ```
8
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/url.js)
8
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/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`
@@ -71,20 +71,44 @@ declare module "url" {
71
71
  * A `URIError` is thrown if the `auth` property is present but cannot be decoded.
72
72
  *
73
73
  * `url.parse()` uses a lenient, non-standard algorithm for parsing URL
74
- * strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487) and incorrect handling of usernames and passwords. Do not use with untrusted
75
- * input. CVEs are not issued for `url.parse()` vulnerabilities. Use the `WHATWG URL` API instead.
74
+ * strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487)
75
+ * and incorrect handling of usernames and passwords. Do not use with untrusted
76
+ * input. CVEs are not issued for `url.parse()` vulnerabilities. Use the
77
+ * [WHATWG URL](https://nodejs.org/docs/latest-v24.x/api/url.html#the-whatwg-url-api) API instead, for example:
78
+ *
79
+ * ```js
80
+ * function getURL(req) {
81
+ * const proto = req.headers['x-forwarded-proto'] || 'https';
82
+ * const host = req.headers['x-forwarded-host'] || req.headers.host || 'example.com';
83
+ * return new URL(req.url || '/', `${proto}://${host}`);
84
+ * }
85
+ * ```
86
+ *
87
+ * The example above assumes well-formed headers are forwarded from a reverse
88
+ * proxy to your Node.js server. If you are not using a reverse proxy, you should
89
+ * use the example below:
90
+ *
91
+ * ```js
92
+ * function getURL(req) {
93
+ * return new URL(req.url || '/', 'https://example.com');
94
+ * }
95
+ * ```
76
96
  * @since v0.1.25
77
97
  * @deprecated Use the WHATWG URL API instead.
78
98
  * @param urlString The URL string to parse.
79
- * @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property
80
- * on the returned URL object will be an unparsed, undecoded string.
81
- * @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the
82
- * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`.
99
+ * @param parseQueryString If `true`, the `query` property will always
100
+ * be set to an object returned by the [`querystring`](https://nodejs.org/docs/latest-v24.x/api/querystring.html) module's `parse()`
101
+ * method. If `false`, the `query` property on the returned URL object will be an
102
+ * unparsed, undecoded string. **Default:** `false`.
103
+ * @param slashesDenoteHost If `true`, the first token after the literal
104
+ * string `//` and preceding the next `/` will be interpreted as the `host`.
105
+ * For instance, given `//foo/bar`, the result would be
106
+ * `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`.
107
+ * **Default:** `false`.
83
108
  */
84
- function parse(urlString: string): UrlWithStringQuery;
85
109
  function parse(
86
110
  urlString: string,
87
- parseQueryString: false | undefined,
111
+ parseQueryString?: false,
88
112
  slashesDenoteHost?: boolean,
89
113
  ): UrlWithStringQuery;
90
114
  function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
@@ -320,12 +344,12 @@ declare module "url" {
320
344
  * representation of the path, a `Buffer` is returned. This conversion is
321
345
  * helpful when the input URL contains percent-encoded segments that are
322
346
  * not valid UTF-8 / Unicode sequences.
323
- * @since v22.18.0
347
+ * @since v24.3.0
324
348
  * @param url The file URL string or URL object to convert to a path.
325
349
  * @returns The fully-resolved platform-specific Node.js file path
326
350
  * as a `Buffer`.
327
351
  */
328
- function fileURLToPathBuffer(url: string | URL, options?: FileUrlToPathOptions): Buffer;
352
+ function fileURLToPathBuffer(url: string | URL, options?: FileUrlToPathOptions): NonSharedBuffer;
329
353
  /**
330
354
  * This function ensures that `path` is resolved absolutely, and that the URL
331
355
  * control characters are correctly encoded when converting into a File URL.
@@ -455,12 +479,15 @@ declare module "url" {
455
479
  */
456
480
  static canParse(input: string, base?: string): boolean;
457
481
  /**
458
- * 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.
459
- * Returns `null` if `input` is not a valid.
460
- * @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
461
- * `converted to a string` first.
462
- * @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.
482
+ * Parses a string as a URL. If `base` is provided, it will be used as the base
483
+ * URL for the purpose of resolving non-absolute `input` URLs. Returns `null`
484
+ * if the parameters can't be resolved to a valid URL.
463
485
  * @since v22.1.0
486
+ * @param input The absolute or relative input URL to parse. If `input`
487
+ * is relative, then `base` is required. If `input` is absolute, the `base`
488
+ * is ignored. If `input` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first.
489
+ * @param base The base URL to resolve against if the `input` is not
490
+ * absolute. If `base` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first.
464
491
  */
465
492
  static parse(input: string, base?: string): URL | null;
466
493
  constructor(input: string | { toString: () => string }, base?: string | URL);
@@ -766,6 +793,54 @@ declare module "url" {
766
793
  */
767
794
  toJSON(): string;
768
795
  }
796
+ interface URLPatternComponentResult {
797
+ input: string;
798
+ groups: Record<string, string | undefined>;
799
+ }
800
+ interface URLPatternInit {
801
+ protocol?: string;
802
+ username?: string;
803
+ password?: string;
804
+ hostname?: string;
805
+ port?: string;
806
+ pathname?: string;
807
+ search?: string;
808
+ hash?: string;
809
+ baseURL?: string;
810
+ }
811
+ interface URLPatternOptions {
812
+ ignoreCase?: boolean;
813
+ }
814
+ interface URLPatternResult {
815
+ inputs: (string | URLPatternInit)[];
816
+ protocol: URLPatternComponentResult;
817
+ username: URLPatternComponentResult;
818
+ password: URLPatternComponentResult;
819
+ hostname: URLPatternComponentResult;
820
+ port: URLPatternComponentResult;
821
+ pathname: URLPatternComponentResult;
822
+ search: URLPatternComponentResult;
823
+ hash: URLPatternComponentResult;
824
+ }
825
+ /**
826
+ * @since v23.8.0
827
+ * @experimental
828
+ */
829
+ class URLPattern {
830
+ constructor(input: string | URLPatternInit, baseURL: string, options?: URLPatternOptions);
831
+ constructor(input?: string | URLPatternInit, options?: URLPatternOptions);
832
+ exec(input?: string | URLPatternInit, baseURL?: string): URLPatternResult | null;
833
+ readonly hasRegExpGroups: boolean;
834
+ readonly hash: string;
835
+ readonly hostname: string;
836
+ readonly password: string;
837
+ readonly pathname: string;
838
+ readonly port: string;
839
+ readonly protocol: string;
840
+ readonly search: string;
841
+ test(input?: string | URLPatternInit, baseURL?: string): boolean;
842
+ readonly username: string;
843
+ }
769
844
  interface URLSearchParamsIterator<T> extends NodeJS.Iterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
770
845
  [Symbol.iterator](): URLSearchParamsIterator<T>;
771
846
  }
@@ -946,34 +1021,35 @@ declare module "url" {
946
1021
  values(): URLSearchParamsIterator<string>;
947
1022
  [Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
948
1023
  }
949
- import { URL as _URL, URLSearchParams as _URLSearchParams } from "url";
1024
+ import {
1025
+ URL as _URL,
1026
+ URLPattern as _URLPattern,
1027
+ URLPatternInit as _URLPatternInit,
1028
+ URLPatternResult as _URLPatternResult,
1029
+ URLSearchParams as _URLSearchParams,
1030
+ } from "url";
950
1031
  global {
951
- interface URLSearchParams extends _URLSearchParams {}
952
1032
  interface URL extends _URL {}
953
- interface Global {
954
- URL: typeof _URL;
955
- URLSearchParams: typeof _URLSearchParams;
956
- }
957
- /**
958
- * `URL` class is a global reference for `import { URL } from 'url'`
959
- * https://nodejs.org/api/url.html#the-whatwg-url-api
960
- * @since v10.0.0
961
- */
962
1033
  var URL: typeof globalThis extends {
963
1034
  onmessage: any;
964
1035
  URL: infer T;
965
1036
  } ? T
966
1037
  : typeof _URL;
967
- /**
968
- * `URLSearchParams` class is a global reference for `import { URLSearchParams } from 'node:url'`
969
- * https://nodejs.org/api/url.html#class-urlsearchparams
970
- * @since v10.0.0
971
- */
1038
+ interface URLSearchParams extends _URLSearchParams {}
972
1039
  var URLSearchParams: typeof globalThis extends {
973
1040
  onmessage: any;
974
1041
  URLSearchParams: infer T;
975
1042
  } ? T
976
1043
  : typeof _URLSearchParams;
1044
+ interface URLPatternInit extends _URLPatternInit {}
1045
+ interface URLPatternResult extends _URLPatternResult {}
1046
+ interface URLPattern extends _URLPattern {}
1047
+ var URLPattern: typeof globalThis extends {
1048
+ onmessage: any;
1049
+ scheduler: any; // Must be a var introduced at the same time as URLPattern.
1050
+ URLPattern: infer T;
1051
+ } ? T
1052
+ : typeof _URLPattern;
977
1053
  }
978
1054
  }
979
1055
  declare module "node:url" {