undici 7.14.0 → 7.16.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 (63) hide show
  1. package/README.md +1 -1
  2. package/docs/docs/api/Agent.md +1 -0
  3. package/docs/docs/api/Dispatcher.md +59 -0
  4. package/docs/docs/api/Errors.md +0 -1
  5. package/index-fetch.js +2 -2
  6. package/index.js +6 -9
  7. package/lib/api/api-request.js +22 -8
  8. package/lib/api/readable.js +7 -5
  9. package/lib/core/errors.js +217 -13
  10. package/lib/core/request.js +5 -1
  11. package/lib/core/util.js +45 -11
  12. package/lib/dispatcher/agent.js +44 -23
  13. package/lib/dispatcher/client-h1.js +20 -9
  14. package/lib/dispatcher/client-h2.js +13 -3
  15. package/lib/dispatcher/client.js +57 -57
  16. package/lib/dispatcher/dispatcher-base.js +12 -7
  17. package/lib/dispatcher/env-http-proxy-agent.js +12 -16
  18. package/lib/dispatcher/fixed-queue.js +15 -39
  19. package/lib/dispatcher/h2c-client.js +6 -6
  20. package/lib/dispatcher/pool-base.js +60 -43
  21. package/lib/dispatcher/pool.js +2 -2
  22. package/lib/dispatcher/proxy-agent.js +14 -9
  23. package/lib/global.js +19 -1
  24. package/lib/interceptor/cache.js +61 -0
  25. package/lib/interceptor/decompress.js +253 -0
  26. package/lib/llhttp/constants.d.ts +99 -1
  27. package/lib/llhttp/constants.js +34 -1
  28. package/lib/llhttp/llhttp-wasm.js +1 -1
  29. package/lib/llhttp/llhttp_simd-wasm.js +1 -1
  30. package/lib/llhttp/utils.d.ts +2 -2
  31. package/lib/llhttp/utils.js +3 -6
  32. package/lib/mock/mock-agent.js +4 -4
  33. package/lib/mock/mock-errors.js +10 -0
  34. package/lib/mock/mock-utils.js +12 -10
  35. package/lib/util/cache.js +6 -7
  36. package/lib/util/date.js +534 -140
  37. package/lib/web/cookies/index.js +1 -1
  38. package/lib/web/cookies/parse.js +2 -2
  39. package/lib/web/eventsource/eventsource-stream.js +2 -2
  40. package/lib/web/eventsource/eventsource.js +34 -29
  41. package/lib/web/eventsource/util.js +1 -9
  42. package/lib/web/fetch/body.js +20 -26
  43. package/lib/web/fetch/index.js +15 -16
  44. package/lib/web/fetch/response.js +2 -4
  45. package/lib/web/fetch/util.js +8 -230
  46. package/lib/web/subresource-integrity/Readme.md +9 -0
  47. package/lib/web/subresource-integrity/subresource-integrity.js +306 -0
  48. package/lib/web/webidl/index.js +203 -42
  49. package/lib/web/websocket/connection.js +4 -3
  50. package/lib/web/websocket/events.js +1 -1
  51. package/lib/web/websocket/stream/websocketerror.js +22 -1
  52. package/lib/web/websocket/stream/websocketstream.js +16 -7
  53. package/lib/web/websocket/websocket.js +32 -42
  54. package/package.json +9 -7
  55. package/types/agent.d.ts +1 -0
  56. package/types/diagnostics-channel.d.ts +0 -1
  57. package/types/errors.d.ts +5 -15
  58. package/types/interceptors.d.ts +5 -0
  59. package/types/snapshot-agent.d.ts +5 -3
  60. package/types/webidl.d.ts +82 -21
  61. package/lib/api/util.js +0 -95
  62. package/lib/llhttp/constants.js.map +0 -1
  63. package/lib/llhttp/utils.js.map +0 -1
@@ -28,7 +28,6 @@ const { channels } = require('../../core/diagnostics')
28
28
  /**
29
29
  * @typedef {object} Handler
30
30
  * @property {(response: any, extensions?: string[]) => void} onConnectionEstablished
31
- * @property {(code: number, reason: any) => void} onFail
32
31
  * @property {(opcode: number, data: Buffer) => void} onMessage
33
32
  * @property {(error: Error) => void} onParserError
34
33
  * @property {() => void} onParserDrain
@@ -64,7 +63,6 @@ class WebSocket extends EventTarget {
64
63
  /** @type {Handler} */
65
64
  #handler = {
66
65
  onConnectionEstablished: (response, extensions) => this.#onConnectionEstablished(response, extensions),
67
- onFail: (code, reason, cause) => this.#onFail(code, reason, cause),
68
66
  onMessage: (opcode, data) => this.#onMessage(opcode, data),
69
67
  onParserError: (err) => failWebsocketConnection(this.#handler, null, err.message),
70
68
  onParserDrain: () => this.#onParserDrain(),
@@ -195,7 +193,7 @@ class WebSocket extends EventTarget {
195
193
  const prefix = 'WebSocket.close'
196
194
 
197
195
  if (code !== undefined) {
198
- code = webidl.converters['unsigned short'](code, prefix, 'code', { clamp: true })
196
+ code = webidl.converters['unsigned short'](code, prefix, 'code', webidl.attributes.Clamp)
199
197
  }
200
198
 
201
199
  if (reason !== undefined) {
@@ -355,9 +353,11 @@ class WebSocket extends EventTarget {
355
353
  this.removeEventListener('open', this.#events.open)
356
354
  }
357
355
 
358
- if (typeof fn === 'function') {
356
+ const listener = webidl.converters.EventHandlerNonNull(fn)
357
+
358
+ if (listener !== null) {
359
+ this.addEventListener('open', listener)
359
360
  this.#events.open = fn
360
- this.addEventListener('open', fn)
361
361
  } else {
362
362
  this.#events.open = null
363
363
  }
@@ -376,9 +376,11 @@ class WebSocket extends EventTarget {
376
376
  this.removeEventListener('error', this.#events.error)
377
377
  }
378
378
 
379
- if (typeof fn === 'function') {
379
+ const listener = webidl.converters.EventHandlerNonNull(fn)
380
+
381
+ if (listener !== null) {
382
+ this.addEventListener('error', listener)
380
383
  this.#events.error = fn
381
- this.addEventListener('error', fn)
382
384
  } else {
383
385
  this.#events.error = null
384
386
  }
@@ -397,9 +399,11 @@ class WebSocket extends EventTarget {
397
399
  this.removeEventListener('close', this.#events.close)
398
400
  }
399
401
 
400
- if (typeof fn === 'function') {
402
+ const listener = webidl.converters.EventHandlerNonNull(fn)
403
+
404
+ if (listener !== null) {
405
+ this.addEventListener('close', listener)
401
406
  this.#events.close = fn
402
- this.addEventListener('close', fn)
403
407
  } else {
404
408
  this.#events.close = null
405
409
  }
@@ -418,9 +422,11 @@ class WebSocket extends EventTarget {
418
422
  this.removeEventListener('message', this.#events.message)
419
423
  }
420
424
 
421
- if (typeof fn === 'function') {
425
+ const listener = webidl.converters.EventHandlerNonNull(fn)
426
+
427
+ if (listener !== null) {
428
+ this.addEventListener('message', listener)
422
429
  this.#events.message = fn
423
- this.addEventListener('message', fn)
424
430
  } else {
425
431
  this.#events.message = null
426
432
  }
@@ -498,26 +504,6 @@ class WebSocket extends EventTarget {
498
504
  }
499
505
  }
500
506
 
501
- #onFail (code, reason, cause) {
502
- if (reason) {
503
- // TODO: process.nextTick
504
- fireEvent('error', this, (type, init) => new ErrorEvent(type, init), {
505
- error: new Error(reason, cause ? { cause } : undefined),
506
- message: reason
507
- })
508
- }
509
-
510
- if (!this.#handler.wasEverConnected) {
511
- this.#handler.readyState = states.CLOSED
512
-
513
- // If the WebSocket connection could not be established, it is also said
514
- // that _The WebSocket Connection is Closed_, but not _cleanly_.
515
- fireEvent('close', this, (type, init) => new CloseEvent(type, init), {
516
- wasClean: false, code, reason
517
- })
518
- }
519
- }
520
-
521
507
  #onMessage (type, data) {
522
508
  // 1. If ready state is not OPEN (1), then return.
523
509
  if (this.#handler.readyState !== states.OPEN) {
@@ -578,18 +564,11 @@ class WebSocket extends EventTarget {
578
564
  let code = 1005
579
565
  let reason = ''
580
566
 
581
- const result = this.#parser.closingInfo
567
+ const result = this.#parser?.closingInfo
582
568
 
583
569
  if (result && !result.error) {
584
570
  code = result.code ?? 1005
585
571
  reason = result.reason
586
- } else if (!this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
587
- // If _The WebSocket
588
- // Connection is Closed_ and no Close control frame was received by the
589
- // endpoint (such as could occur if the underlying transport connection
590
- // is lost), _The WebSocket Connection Close Code_ is considered to be
591
- // 1006.
592
- code = 1006
593
572
  }
594
573
 
595
574
  // 1. Change the ready state to CLOSED (3).
@@ -599,7 +578,18 @@ class WebSocket extends EventTarget {
599
578
  // connection, or if the WebSocket connection was closed
600
579
  // after being flagged as full, fire an event named error
601
580
  // at the WebSocket object.
602
- // TODO
581
+ if (!this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
582
+ // If _The WebSocket
583
+ // Connection is Closed_ and no Close control frame was received by the
584
+ // endpoint (such as could occur if the underlying transport connection
585
+ // is lost), _The WebSocket Connection Close Code_ is considered to be
586
+ // 1006.
587
+ code = 1006
588
+
589
+ fireEvent('error', this, (type, init) => new ErrorEvent(type, init), {
590
+ error: new TypeError(reason)
591
+ })
592
+ }
603
593
 
604
594
  // 3. Fire an event named close at the WebSocket object,
605
595
  // using CloseEvent, with the wasClean attribute
@@ -708,7 +698,7 @@ webidl.converters.WebSocketInit = webidl.dictionaryConverter([
708
698
  {
709
699
  key: 'protocols',
710
700
  converter: webidl.converters['DOMString or sequence<DOMString>'],
711
- defaultValue: () => new Array(0)
701
+ defaultValue: () => []
712
702
  },
713
703
  {
714
704
  key: 'dispatcher',
@@ -735,7 +725,7 @@ webidl.converters.WebSocketSendData = function (V) {
735
725
  return V
736
726
  }
737
727
 
738
- if (ArrayBuffer.isView(V) || isArrayBuffer(V)) {
728
+ if (webidl.is.BufferSource(V)) {
739
729
  return V
740
730
  }
741
731
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici",
3
- "version": "7.14.0",
3
+ "version": "7.16.0",
4
4
  "description": "An HTTP/1.1 client, written from scratch for Node.js",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {
@@ -67,18 +67,19 @@
67
67
  "generate-pem": "node scripts/generate-pem.js",
68
68
  "lint": "eslint --cache",
69
69
  "lint:fix": "eslint --fix --cache",
70
- "test": "npm run test:javascript && cross-env NODE_V8_COVERAGE= npm run test:typescript",
70
+ "test": "npm run test:javascript && cross-env NODE_V8_COVERAGE= npm run test:typescript",
71
71
  "test:javascript": "npm run test:javascript:no-jest && npm run test:jest",
72
- "test:javascript:no-jest": "npm run generate-pem && npm run test:unit && npm run test:node-fetch && npm run test:cache && npm run test:cache-interceptor && npm run test:interceptors && npm run test:fetch && npm run test:cookies && npm run test:eventsource && npm run test:wpt && npm run test:websocket && npm run test:node-test && npm run test:cache-tests",
72
+ "test:javascript:no-jest": "npm run generate-pem && npm run test:unit && npm run test:fetch && npm run test:node-fetch && npm run test:cache && npm run test:cache-interceptor && npm run test:interceptors && npm run test:cookies && npm run test:eventsource && npm run test:subresource-integrity && npm run test:wpt && npm run test:websocket && npm run test:node-test && npm run test:cache-tests",
73
73
  "test:javascript:without-intl": "npm run test:javascript:no-jest",
74
74
  "test:busboy": "borp -p \"test/busboy/*.js\"",
75
75
  "test:cache": "borp -p \"test/cache/*.js\"",
76
- "test:sqlite": "NODE_OPTIONS=--experimental-sqlite borp -p \"test/cache-interceptor/*.js\"",
76
+ "test:sqlite": "cross-env NODE_OPTIONS=--experimental-sqlite borp -p \"test/cache-interceptor/*.js\"",
77
77
  "test:cache-interceptor": "borp -p \"test/cache-interceptor/*.js\"",
78
78
  "test:cookies": "borp -p \"test/cookie/*.js\"",
79
79
  "test:eventsource": "npm run build:node && borp --expose-gc -p \"test/eventsource/*.js\"",
80
80
  "test:fuzzing": "node test/fuzzing/fuzzing.test.js",
81
81
  "test:fetch": "npm run build:node && borp --timeout 180000 --expose-gc --concurrency 1 -p \"test/fetch/*.js\" && npm run test:webidl && npm run test:busboy",
82
+ "test:subresource-integrity": "borp -p \"test/subresource-integrity/*.js\"",
82
83
  "test:h2": "npm run test:h2:core && npm run test:h2:fetch",
83
84
  "test:h2:core": "borp -p \"test/+(http2|h2)*.js\"",
84
85
  "test:h2:fetch": "npm run build:node && borp -p \"test/fetch/http2*.js\"",
@@ -94,8 +95,8 @@
94
95
  "test:websocket": "borp -p \"test/websocket/**/*.js\"",
95
96
  "test:websocket:autobahn": "node test/autobahn/client.js",
96
97
  "test:websocket:autobahn:report": "node test/autobahn/report.js",
97
- "test:wpt": "node test/wpt/start-fetch.mjs && node test/wpt/start-mimesniff.mjs && node test/wpt/start-xhr.mjs && node test/wpt/start-websockets.mjs && node test/wpt/start-cacheStorage.mjs && node test/wpt/start-eventsource.mjs",
98
- "test:wpt:withoutintl": "node test/wpt/start-fetch.mjs && node test/wpt/start-mimesniff.mjs && node test/wpt/start-xhr.mjs && node test/wpt/start-cacheStorage.mjs && node test/wpt/start-eventsource.mjs",
98
+ "test:wpt:setup": "node test/web-platform-tests/wpt-runner.mjs setup",
99
+ "test:wpt": "npm run test:wpt:setup && node test/web-platform-tests/wpt-runner.mjs run /fetch /mimesniff /xhr /websockets /serviceWorkers /eventsource",
99
100
  "test:cache-tests": "node test/cache-interceptor/cache-tests.mjs --ci",
100
101
  "coverage": "npm run coverage:clean && cross-env NODE_V8_COVERAGE=./coverage/tmp npm run test:javascript && npm run coverage:report",
101
102
  "coverage:ci": "npm run coverage:clean && cross-env NODE_V8_COVERAGE=./coverage/tmp npm run test:javascript && npm run coverage:report:ci",
@@ -107,7 +108,7 @@
107
108
  "prepare": "husky && node ./scripts/platform-shell.js"
108
109
  },
109
110
  "devDependencies": {
110
- "@fastify/busboy": "3.1.1",
111
+ "@fastify/busboy": "3.2.0",
111
112
  "@matteo.collina/tspl": "^0.2.0",
112
113
  "@metcoder95/https-pem": "^1.0.0",
113
114
  "@sinonjs/fake-timers": "^12.0.0",
@@ -122,6 +123,7 @@
122
123
  "fast-check": "^4.1.1",
123
124
  "husky": "^9.0.7",
124
125
  "jest": "^30.0.5",
126
+ "jsondiffpatch": "^0.7.3",
125
127
  "neostandard": "^0.12.0",
126
128
  "node-forge": "^1.3.1",
127
129
  "proxy": "^2.1.1",
package/types/agent.d.ts CHANGED
@@ -24,6 +24,7 @@ declare namespace Agent {
24
24
  factory?(origin: string | URL, opts: Object): Dispatcher;
25
25
 
26
26
  interceptors?: { Agent?: readonly Dispatcher.DispatchInterceptor[] } & Pool.Options['interceptors']
27
+ maxOrigins?: number
27
28
  }
28
29
 
29
30
  export interface DispatchOptions extends Dispatcher.DispatchOptions {
@@ -16,7 +16,6 @@ declare namespace DiagnosticsChannel {
16
16
  statusText: string;
17
17
  headers: Array<Buffer>;
18
18
  }
19
- type Error = unknown
20
19
  interface ConnectParams {
21
20
  host: URL['host'];
22
21
  hostname: URL['hostname'];
package/types/errors.d.ts CHANGED
@@ -49,21 +49,6 @@ declare namespace Errors {
49
49
  headers: IncomingHttpHeaders | string[] | null
50
50
  }
51
51
 
52
- export class ResponseStatusCodeError extends UndiciError {
53
- constructor (
54
- message?: string,
55
- statusCode?: number,
56
- headers?: IncomingHttpHeaders | string[] | null,
57
- body?: null | Record<string, any> | string
58
- )
59
- name: 'ResponseStatusCodeError'
60
- code: 'UND_ERR_RESPONSE_STATUS_CODE'
61
- body: null | Record<string, any> | string
62
- status: number
63
- statusCode: number
64
- headers: IncomingHttpHeaders | string[] | null
65
- }
66
-
67
52
  /** Passed an invalid argument. */
68
53
  export class InvalidArgumentError extends UndiciError {
69
54
  name: 'InvalidArgumentError'
@@ -168,4 +153,9 @@ declare namespace Errors {
168
153
  name: 'SecureProxyConnectionError'
169
154
  code: 'UND_ERR_PRX_TLS'
170
155
  }
156
+
157
+ class MaxOriginsReachedError extends UndiciError {
158
+ name: 'MaxOriginsReachedError'
159
+ code: 'UND_ERR_MAX_ORIGINS_REACHED'
160
+ }
171
161
  }
@@ -9,6 +9,10 @@ declare namespace Interceptors {
9
9
  export type DumpInterceptorOpts = { maxSize?: number }
10
10
  export type RetryInterceptorOpts = RetryHandler.RetryOptions
11
11
  export type RedirectInterceptorOpts = { maxRedirections?: number }
12
+ export type DecompressInterceptorOpts = {
13
+ skipErrorResponses?: boolean
14
+ skipStatusCodes?: number[]
15
+ }
12
16
 
13
17
  export type ResponseErrorInterceptorOpts = { throwOnError: boolean }
14
18
  export type CacheInterceptorOpts = CacheHandler.CacheOptions
@@ -28,6 +32,7 @@ declare namespace Interceptors {
28
32
  export function dump (opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
29
33
  export function retry (opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
30
34
  export function redirect (opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
35
+ export function decompress (opts?: DecompressInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
31
36
  export function responseError (opts?: ResponseErrorInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
32
37
  export function dns (opts?: DNSInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
33
38
  export function cache (opts?: CacheInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
@@ -18,9 +18,11 @@ declare class SnapshotRecorder {
18
18
  }
19
19
 
20
20
  declare namespace SnapshotRecorder {
21
+ type SnapshotRecorderMode = 'record' | 'playback' | 'update'
22
+
21
23
  export interface Options {
22
24
  snapshotPath?: string
23
- mode?: 'record' | 'playback' | 'update'
25
+ mode?: SnapshotRecorderMode
24
26
  maxSnapshots?: number
25
27
  autoFlush?: boolean
26
28
  flushInterval?: number
@@ -77,7 +79,7 @@ declare class SnapshotAgent extends MockAgent {
77
79
  saveSnapshots (filePath?: string): Promise<void>
78
80
  loadSnapshots (filePath?: string): Promise<void>
79
81
  getRecorder (): SnapshotRecorder
80
- getMode (): 'record' | 'playback' | 'update'
82
+ getMode (): SnapshotRecorder.SnapshotRecorderMode
81
83
  clearSnapshots (): void
82
84
  resetCallCounts (): void
83
85
  deleteSnapshot (requestOpts: any): boolean
@@ -87,7 +89,7 @@ declare class SnapshotAgent extends MockAgent {
87
89
 
88
90
  declare namespace SnapshotAgent {
89
91
  export interface Options extends MockAgent.Options {
90
- mode?: 'record' | 'playback' | 'update'
92
+ mode?: SnapshotRecorder.SnapshotRecorderMode
91
93
  snapshotPath?: string
92
94
  maxSnapshots?: number
93
95
  autoFlush?: boolean
package/types/webidl.d.ts CHANGED
@@ -10,11 +10,6 @@ type SequenceConverter<T> = (object: unknown, iterable?: IterableIterator<T>) =>
10
10
 
11
11
  type RecordConverter<K extends string, V> = (object: unknown) => Record<K, V>
12
12
 
13
- interface ConvertToIntOpts {
14
- clamp?: boolean
15
- enforceRange?: boolean
16
- }
17
-
18
13
  interface WebidlErrors {
19
14
  /**
20
15
  * @description Instantiate an error
@@ -74,7 +69,7 @@ interface WebidlUtil {
74
69
  V: unknown,
75
70
  bitLength: number,
76
71
  signedness: 'signed' | 'unsigned',
77
- opts?: ConvertToIntOpts
72
+ flags?: number
78
73
  ): number
79
74
 
80
75
  /**
@@ -94,15 +89,17 @@ interface WebidlUtil {
94
89
  * This is only effective in some newer Node.js versions.
95
90
  */
96
91
  markAsUncloneable (V: any): void
92
+
93
+ IsResizableArrayBuffer (V: ArrayBufferLike): boolean
94
+
95
+ HasFlag (flag: number, attributes: number): boolean
97
96
  }
98
97
 
99
98
  interface WebidlConverters {
100
99
  /**
101
100
  * @see https://webidl.spec.whatwg.org/#es-DOMString
102
101
  */
103
- DOMString (V: unknown, prefix: string, argument: string, opts?: {
104
- legacyNullToEmptyString: boolean
105
- }): string
102
+ DOMString (V: unknown, prefix: string, argument: string, flags?: number): string
106
103
 
107
104
  /**
108
105
  * @see https://webidl.spec.whatwg.org/#es-ByteString
@@ -142,39 +139,78 @@ interface WebidlConverters {
142
139
  /**
143
140
  * @see https://webidl.spec.whatwg.org/#es-unsigned-short
144
141
  */
145
- ['unsigned short'] (V: unknown, opts?: ConvertToIntOpts): number
142
+ ['unsigned short'] (V: unknown, flags?: number): number
146
143
 
147
144
  /**
148
145
  * @see https://webidl.spec.whatwg.org/#idl-ArrayBuffer
149
146
  */
150
- ArrayBuffer (V: unknown): ArrayBufferLike
151
- ArrayBuffer (V: unknown, opts: { allowShared: false }): ArrayBuffer
147
+ ArrayBuffer (
148
+ V: unknown,
149
+ prefix: string,
150
+ argument: string,
151
+ options?: { allowResizable: boolean }
152
+ ): ArrayBuffer
153
+
154
+ /**
155
+ * @see https://webidl.spec.whatwg.org/#idl-SharedArrayBuffer
156
+ */
157
+ SharedArrayBuffer (
158
+ V: unknown,
159
+ prefix: string,
160
+ argument: string,
161
+ options?: { allowResizable: boolean }
162
+ ): SharedArrayBuffer
152
163
 
153
164
  /**
154
165
  * @see https://webidl.spec.whatwg.org/#es-buffer-source-types
155
166
  */
156
167
  TypedArray (
157
168
  V: unknown,
158
- TypedArray: NodeJS.TypedArray | ArrayBufferLike
159
- ): NodeJS.TypedArray | ArrayBufferLike
160
- TypedArray (
169
+ T: new () => NodeJS.TypedArray,
170
+ prefix: string,
171
+ argument: string,
172
+ flags?: number
173
+ ): NodeJS.TypedArray
174
+
175
+ /**
176
+ * @see https://webidl.spec.whatwg.org/#es-buffer-source-types
177
+ */
178
+ DataView (
161
179
  V: unknown,
162
- TypedArray: NodeJS.TypedArray | ArrayBufferLike,
163
- opts?: { allowShared: false }
164
- ): NodeJS.TypedArray | ArrayBuffer
180
+ prefix: string,
181
+ argument: string,
182
+ flags?: number
183
+ ): DataView
165
184
 
166
185
  /**
167
186
  * @see https://webidl.spec.whatwg.org/#es-buffer-source-types
168
187
  */
169
- DataView (V: unknown, opts?: { allowShared: boolean }): DataView
188
+ ArrayBufferView (
189
+ V: unknown,
190
+ prefix: string,
191
+ argument: string,
192
+ flags?: number
193
+ ): NodeJS.ArrayBufferView
170
194
 
171
195
  /**
172
196
  * @see https://webidl.spec.whatwg.org/#BufferSource
173
197
  */
174
198
  BufferSource (
175
199
  V: unknown,
176
- opts?: { allowShared: boolean }
177
- ): NodeJS.TypedArray | ArrayBufferLike | DataView
200
+ prefix: string,
201
+ argument: string,
202
+ flags?: number
203
+ ): ArrayBuffer | NodeJS.ArrayBufferView
204
+
205
+ /**
206
+ * @see https://webidl.spec.whatwg.org/#AllowSharedBufferSource
207
+ */
208
+ AllowSharedBufferSource (
209
+ V: unknown,
210
+ prefix: string,
211
+ argument: string,
212
+ flags?: number
213
+ ): ArrayBuffer | SharedArrayBuffer | NodeJS.ArrayBufferView
178
214
 
179
215
  ['sequence<ByteString>']: SequenceConverter<string>
180
216
 
@@ -192,6 +228,13 @@ interface WebidlConverters {
192
228
  */
193
229
  RequestInit (V: unknown): undici.RequestInit
194
230
 
231
+ /**
232
+ * @see https://html.spec.whatwg.org/multipage/webappapis.html#eventhandlernonnull
233
+ */
234
+ EventHandlerNonNull (V: unknown): Function | null
235
+
236
+ WebSocketStreamWrite (V: unknown): ArrayBuffer | NodeJS.TypedArray | string
237
+
195
238
  [Key: string]: (...args: any[]) => unknown
196
239
  }
197
240
 
@@ -210,6 +253,10 @@ interface WebidlIs {
210
253
  AbortSignal: WebidlIsFunction<AbortSignal>
211
254
  MessagePort: WebidlIsFunction<MessagePort>
212
255
  USVString: WebidlIsFunction<string>
256
+ /**
257
+ * @see https://webidl.spec.whatwg.org/#BufferSource
258
+ */
259
+ BufferSource: WebidlIsFunction<ArrayBuffer | NodeJS.TypedArray>
213
260
  }
214
261
 
215
262
  export interface Webidl {
@@ -217,6 +264,7 @@ export interface Webidl {
217
264
  util: WebidlUtil
218
265
  converters: WebidlConverters
219
266
  is: WebidlIs
267
+ attributes: WebIDLExtendedAttributes
220
268
 
221
269
  /**
222
270
  * @description Performs a brand-check on {@param V} to ensure it is a
@@ -278,3 +326,16 @@ export interface Webidl {
278
326
 
279
327
  argumentLengthCheck (args: { length: number }, min: number, context: string): void
280
328
  }
329
+
330
+ interface WebIDLExtendedAttributes {
331
+ /** https://webidl.spec.whatwg.org/#Clamp */
332
+ Clamp: number
333
+ /** https://webidl.spec.whatwg.org/#EnforceRange */
334
+ EnforceRange: number
335
+ /** https://webidl.spec.whatwg.org/#AllowShared */
336
+ AllowShared: number
337
+ /** https://webidl.spec.whatwg.org/#AllowResizable */
338
+ AllowResizable: number
339
+ /** https://webidl.spec.whatwg.org/#LegacyNullToEmptyString */
340
+ LegacyNullToEmptyString: number
341
+ }
package/lib/api/util.js DELETED
@@ -1,95 +0,0 @@
1
- 'use strict'
2
-
3
- const assert = require('node:assert')
4
- const {
5
- ResponseStatusCodeError
6
- } = require('../core/errors')
7
-
8
- const { chunksDecode } = require('./readable')
9
- const CHUNK_LIMIT = 128 * 1024
10
-
11
- async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
12
- assert(body)
13
-
14
- let chunks = []
15
- let length = 0
16
-
17
- try {
18
- for await (const chunk of body) {
19
- chunks.push(chunk)
20
- length += chunk.length
21
- if (length > CHUNK_LIMIT) {
22
- chunks = []
23
- length = 0
24
- break
25
- }
26
- }
27
- } catch {
28
- chunks = []
29
- length = 0
30
- // Do nothing....
31
- }
32
-
33
- const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`
34
-
35
- if (statusCode === 204 || !contentType || !length) {
36
- queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers)))
37
- return
38
- }
39
-
40
- const stackTraceLimit = Error.stackTraceLimit
41
- Error.stackTraceLimit = 0
42
- let payload
43
-
44
- try {
45
- if (isContentTypeApplicationJson(contentType)) {
46
- payload = JSON.parse(chunksDecode(chunks, length))
47
- } else if (isContentTypeText(contentType)) {
48
- payload = chunksDecode(chunks, length)
49
- }
50
- } catch {
51
- // process in a callback to avoid throwing in the microtask queue
52
- } finally {
53
- Error.stackTraceLimit = stackTraceLimit
54
- }
55
- queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload)))
56
- }
57
-
58
- const isContentTypeApplicationJson = (contentType) => {
59
- return (
60
- contentType.length > 15 &&
61
- contentType[11] === '/' &&
62
- contentType[0] === 'a' &&
63
- contentType[1] === 'p' &&
64
- contentType[2] === 'p' &&
65
- contentType[3] === 'l' &&
66
- contentType[4] === 'i' &&
67
- contentType[5] === 'c' &&
68
- contentType[6] === 'a' &&
69
- contentType[7] === 't' &&
70
- contentType[8] === 'i' &&
71
- contentType[9] === 'o' &&
72
- contentType[10] === 'n' &&
73
- contentType[12] === 'j' &&
74
- contentType[13] === 's' &&
75
- contentType[14] === 'o' &&
76
- contentType[15] === 'n'
77
- )
78
- }
79
-
80
- const isContentTypeText = (contentType) => {
81
- return (
82
- contentType.length > 4 &&
83
- contentType[4] === '/' &&
84
- contentType[0] === 't' &&
85
- contentType[1] === 'e' &&
86
- contentType[2] === 'x' &&
87
- contentType[3] === 't'
88
- )
89
- }
90
-
91
- module.exports = {
92
- getResolveErrorBodyCallback,
93
- isContentTypeApplicationJson,
94
- isContentTypeText
95
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/llhttp/constants.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AAIpC,QAAQ;AAEK,QAAA,KAAK,GAAY;IAC5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