@songtonyli/dsh-cli 0.1.36 → 0.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/dsh.mjs +1 -1
- package/node_modules/@aws-sdk/core/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-http/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
- package/node_modules/@aws-sdk/credential-provider-login/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-node/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-process/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +6 -6
- package/node_modules/@aws-sdk/eventstream-handler-node/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-eventstream/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-websocket/package.json +7 -7
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +14 -11
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/schemas/schemas_0.js +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/schemas/schemas_0.js +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/schemas/schemas_0.js +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/schemas/schemas_0.js +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js +13 -10
- package/node_modules/@aws-sdk/nested-clients/package.json +8 -8
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +4 -4
- package/node_modules/@aws-sdk/types/package.json +2 -2
- package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/package.json +2 -2
- package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-tui-app/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +100 -42
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +22 -37
- package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +26 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +49 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +12 -7
- package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +22 -22
- package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +0 -15
- package/node_modules/@smithy/core/dist-es/submodules/client/index.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js +8 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js +18 -3
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +49 -8
- package/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +12 -7
- package/node_modules/@smithy/core/package.json +2 -2
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/undici/docs/docs/api/Agent.md +8 -8
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
- package/node_modules/undici/docs/docs/api/Errors.md +25 -0
- package/node_modules/undici/docs/docs/api/Interceptors.md +4 -3
- package/node_modules/undici/docs/docs/api/Pool.md +5 -6
- package/node_modules/undici/lib/api/readable.js +1 -2
- package/node_modules/undici/lib/core/request.js +23 -2
- package/node_modules/undici/lib/core/util.js +0 -39
- package/node_modules/undici/lib/dispatcher/client-h1.js +11 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +52 -8
- package/node_modules/undici/lib/dispatcher/client.js +1 -1
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -2
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
- package/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
- package/node_modules/undici/lib/dispatcher/pool.js +90 -7
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +16 -3
- package/node_modules/undici/lib/handler/deduplication-handler.js +24 -11
- package/node_modules/undici/lib/handler/redirect-handler.js +5 -0
- package/node_modules/undici/lib/handler/retry-handler.js +72 -13
- package/node_modules/undici/lib/interceptor/cache.js +4 -1
- package/node_modules/undici/lib/interceptor/decompress.js +236 -69
- package/node_modules/undici/lib/web/cache/cache.js +17 -8
- package/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
- package/node_modules/undici/lib/web/cookies/index.js +19 -7
- package/node_modules/undici/lib/web/cookies/util.js +3 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -1
- package/node_modules/undici/lib/web/fetch/body.js +22 -15
- package/node_modules/undici/lib/web/fetch/data-url.js +6 -6
- package/node_modules/undici/lib/web/fetch/formdata.js +30 -36
- package/node_modules/undici/lib/web/fetch/headers.js +34 -31
- package/node_modules/undici/lib/web/fetch/index.js +38 -14
- package/node_modules/undici/lib/web/fetch/request.js +74 -79
- package/node_modules/undici/lib/web/fetch/response.js +43 -44
- package/node_modules/undici/lib/web/fetch/util.js +7 -7
- package/node_modules/undici/lib/web/infra/index.js +16 -1
- package/node_modules/undici/lib/web/webidl/index.js +2 -14
- package/node_modules/undici/lib/web/websocket/events.js +43 -26
- package/node_modules/undici/lib/web/websocket/receiver.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
- package/node_modules/undici/lib/web/websocket/websocket.js +44 -41
- package/node_modules/undici/package.json +1 -1
- package/package.json +20 -20
|
@@ -191,6 +191,8 @@ class EventSource extends EventTarget {
|
|
|
191
191
|
* @readonly
|
|
192
192
|
*/
|
|
193
193
|
get readyState () {
|
|
194
|
+
webidl.brandCheck(this, webidl.is.EventSource)
|
|
195
|
+
|
|
194
196
|
return this.#readyState
|
|
195
197
|
}
|
|
196
198
|
|
|
@@ -200,6 +202,8 @@ class EventSource extends EventTarget {
|
|
|
200
202
|
* @returns {string}
|
|
201
203
|
*/
|
|
202
204
|
get url () {
|
|
205
|
+
webidl.brandCheck(this, webidl.is.EventSource)
|
|
206
|
+
|
|
203
207
|
return this.#url
|
|
204
208
|
}
|
|
205
209
|
|
|
@@ -208,6 +212,8 @@ class EventSource extends EventTarget {
|
|
|
208
212
|
* instantiated with CORS credentials set (true), or not (false, the default).
|
|
209
213
|
*/
|
|
210
214
|
get withCredentials () {
|
|
215
|
+
webidl.brandCheck(this, webidl.is.EventSource)
|
|
216
|
+
|
|
211
217
|
return this.#withCredentials
|
|
212
218
|
}
|
|
213
219
|
|
|
@@ -363,7 +369,7 @@ class EventSource extends EventTarget {
|
|
|
363
369
|
* CLOSED.
|
|
364
370
|
*/
|
|
365
371
|
close () {
|
|
366
|
-
webidl.brandCheck(this, EventSource)
|
|
372
|
+
webidl.brandCheck(this, webidl.is.EventSource)
|
|
367
373
|
|
|
368
374
|
if (this.#readyState === CLOSED) return
|
|
369
375
|
this.#readyState = CLOSED
|
|
@@ -372,10 +378,14 @@ class EventSource extends EventTarget {
|
|
|
372
378
|
}
|
|
373
379
|
|
|
374
380
|
get onopen () {
|
|
381
|
+
webidl.brandCheck(this, webidl.is.EventSource)
|
|
382
|
+
|
|
375
383
|
return this.#events.open
|
|
376
384
|
}
|
|
377
385
|
|
|
378
386
|
set onopen (fn) {
|
|
387
|
+
webidl.brandCheck(this, webidl.is.EventSource)
|
|
388
|
+
|
|
379
389
|
if (this.#events.open) {
|
|
380
390
|
this.removeEventListener('open', this.#events.open)
|
|
381
391
|
}
|
|
@@ -391,10 +401,14 @@ class EventSource extends EventTarget {
|
|
|
391
401
|
}
|
|
392
402
|
|
|
393
403
|
get onmessage () {
|
|
404
|
+
webidl.brandCheck(this, webidl.is.EventSource)
|
|
405
|
+
|
|
394
406
|
return this.#events.message
|
|
395
407
|
}
|
|
396
408
|
|
|
397
409
|
set onmessage (fn) {
|
|
410
|
+
webidl.brandCheck(this, webidl.is.EventSource)
|
|
411
|
+
|
|
398
412
|
if (this.#events.message) {
|
|
399
413
|
this.removeEventListener('message', this.#events.message)
|
|
400
414
|
}
|
|
@@ -410,10 +424,14 @@ class EventSource extends EventTarget {
|
|
|
410
424
|
}
|
|
411
425
|
|
|
412
426
|
get onerror () {
|
|
427
|
+
webidl.brandCheck(this, webidl.is.EventSource)
|
|
428
|
+
|
|
413
429
|
return this.#events.error
|
|
414
430
|
}
|
|
415
431
|
|
|
416
432
|
set onerror (fn) {
|
|
433
|
+
webidl.brandCheck(this, webidl.is.EventSource)
|
|
434
|
+
|
|
417
435
|
if (this.#events.error) {
|
|
418
436
|
this.removeEventListener('error', this.#events.error)
|
|
419
437
|
}
|
|
@@ -427,6 +445,12 @@ class EventSource extends EventTarget {
|
|
|
427
445
|
this.#events.error = null
|
|
428
446
|
}
|
|
429
447
|
}
|
|
448
|
+
|
|
449
|
+
static {
|
|
450
|
+
webidl.is.EventSource = (arg) => {
|
|
451
|
+
return arg != null && typeof arg === 'object' && #events in arg
|
|
452
|
+
}
|
|
453
|
+
}
|
|
430
454
|
}
|
|
431
455
|
|
|
432
456
|
const constantsPropertyDescriptors = {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const util = require('../../core/util')
|
|
4
4
|
const {
|
|
5
|
-
ReadableStreamFrom,
|
|
6
5
|
readableStreamClose,
|
|
7
6
|
fullyReadBody,
|
|
8
7
|
extractMimeType
|
|
@@ -197,8 +196,16 @@ function extractBody (object, keepalive = false) {
|
|
|
197
196
|
)
|
|
198
197
|
}
|
|
199
198
|
|
|
200
|
-
stream =
|
|
201
|
-
|
|
199
|
+
stream = webidl.is.ReadableStream(object)
|
|
200
|
+
? object
|
|
201
|
+
: ReadableStream.from(object).pipeThrough(new TransformStream({
|
|
202
|
+
transform (chunk, controller) {
|
|
203
|
+
const bytes = isUint8Array(chunk) ? chunk : Buffer.from(chunk)
|
|
204
|
+
if (bytes.byteLength) {
|
|
205
|
+
controller.enqueue(bytes)
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}))
|
|
202
209
|
}
|
|
203
210
|
|
|
204
211
|
// 11. If source is a byte sequence, then set action to a
|
|
@@ -293,7 +300,7 @@ function cloneBody (body) {
|
|
|
293
300
|
}
|
|
294
301
|
}
|
|
295
302
|
|
|
296
|
-
function bodyMixinMethods (
|
|
303
|
+
function bodyMixinMethods (brandCheck, getInternalState) {
|
|
297
304
|
const methods = {
|
|
298
305
|
blob () {
|
|
299
306
|
// The blob() method steps are to return the result of
|
|
@@ -313,7 +320,7 @@ function bodyMixinMethods (instance, getInternalState) {
|
|
|
313
320
|
// Return a Blob whose contents are bytes and type attribute
|
|
314
321
|
// is mimeType.
|
|
315
322
|
return new Blob([bytes], { type: mimeType })
|
|
316
|
-
},
|
|
323
|
+
}, brandCheck, getInternalState)
|
|
317
324
|
},
|
|
318
325
|
|
|
319
326
|
arrayBuffer () {
|
|
@@ -323,19 +330,19 @@ function bodyMixinMethods (instance, getInternalState) {
|
|
|
323
330
|
// whose contents are bytes.
|
|
324
331
|
return consumeBody(this, (bytes) => {
|
|
325
332
|
return new Uint8Array(bytes).buffer
|
|
326
|
-
},
|
|
333
|
+
}, brandCheck, getInternalState)
|
|
327
334
|
},
|
|
328
335
|
|
|
329
336
|
text () {
|
|
330
337
|
// The text() method steps are to return the result of running
|
|
331
338
|
// consume body with this and UTF-8 decode.
|
|
332
|
-
return consumeBody(this, utf8DecodeBytes,
|
|
339
|
+
return consumeBody(this, utf8DecodeBytes, brandCheck, getInternalState)
|
|
333
340
|
},
|
|
334
341
|
|
|
335
342
|
json () {
|
|
336
343
|
// The json() method steps are to return the result of running
|
|
337
344
|
// consume body with this and parse JSON from bytes.
|
|
338
|
-
return consumeBody(this, parseJSONFromBytes,
|
|
345
|
+
return consumeBody(this, parseJSONFromBytes, brandCheck, getInternalState)
|
|
339
346
|
},
|
|
340
347
|
|
|
341
348
|
formData () {
|
|
@@ -383,7 +390,7 @@ function bodyMixinMethods (instance, getInternalState) {
|
|
|
383
390
|
throw new TypeError(
|
|
384
391
|
'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".'
|
|
385
392
|
)
|
|
386
|
-
},
|
|
393
|
+
}, brandCheck, getInternalState)
|
|
387
394
|
},
|
|
388
395
|
|
|
389
396
|
bytes () {
|
|
@@ -392,7 +399,7 @@ function bodyMixinMethods (instance, getInternalState) {
|
|
|
392
399
|
// result of creating a Uint8Array from bytes in this’s relevant realm.
|
|
393
400
|
return consumeBody(this, (bytes) => {
|
|
394
401
|
return new Uint8Array(bytes)
|
|
395
|
-
},
|
|
402
|
+
}, brandCheck, getInternalState)
|
|
396
403
|
},
|
|
397
404
|
|
|
398
405
|
textStream () {
|
|
@@ -442,20 +449,20 @@ function bodyMixinMethods (instance, getInternalState) {
|
|
|
442
449
|
return methods
|
|
443
450
|
}
|
|
444
451
|
|
|
445
|
-
function mixinBody (prototype, getInternalState) {
|
|
446
|
-
Object.assign(prototype.prototype, bodyMixinMethods(
|
|
452
|
+
function mixinBody (prototype, getInternalState, brandCheck) {
|
|
453
|
+
Object.assign(prototype.prototype, bodyMixinMethods(brandCheck, getInternalState))
|
|
447
454
|
}
|
|
448
455
|
|
|
449
456
|
/**
|
|
450
457
|
* @see https://fetch.spec.whatwg.org/#concept-body-consume-body
|
|
451
458
|
* @param {any} object internal state
|
|
452
459
|
* @param {(value: unknown) => unknown} convertBytesToJSValue
|
|
453
|
-
* @param {
|
|
460
|
+
* @param {import('../../../types/webidl').WebidlIsFunction} brandCheck
|
|
454
461
|
* @param {(target: any) => any} getInternalState
|
|
455
462
|
*/
|
|
456
|
-
function consumeBody (object, convertBytesToJSValue,
|
|
463
|
+
function consumeBody (object, convertBytesToJSValue, brandCheck, getInternalState) {
|
|
457
464
|
try {
|
|
458
|
-
webidl.brandCheck(object,
|
|
465
|
+
webidl.brandCheck(object, brandCheck)
|
|
459
466
|
} catch (e) {
|
|
460
467
|
return Promise.reject(e)
|
|
461
468
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const assert = require('node:assert')
|
|
4
|
-
const { forgivingBase64, collectASequenceOfCodePoints, collectASequenceOfCodePointsFast, isomorphicDecode, removeASCIIWhitespace, removeChars } = require('../infra')
|
|
4
|
+
const { asciiLowercase, forgivingBase64, collectASequenceOfCodePoints, collectASequenceOfCodePointsFast, isomorphicDecode, removeASCIIWhitespace, removeChars } = require('../infra')
|
|
5
5
|
|
|
6
6
|
const encoder = new TextEncoder()
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @see https://mimesniff.spec.whatwg.org/#http-token-code-point
|
|
10
10
|
*/
|
|
11
|
-
const HTTP_TOKEN_CODEPOINTS = /^[-!#$%&'*+.^_
|
|
11
|
+
const HTTP_TOKEN_CODEPOINTS = /^[-!#$%&'*+.^_`|~A-Za-z0-9]+$/u
|
|
12
12
|
const HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/u // eslint-disable-line
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -69,7 +69,7 @@ function dataURLProcessor (dataURL) {
|
|
|
69
69
|
// 11. If mimeType ends with U+003B (;), followed by
|
|
70
70
|
// zero or more U+0020 SPACE, followed by an ASCII
|
|
71
71
|
// case-insensitive match for "base64", then:
|
|
72
|
-
if (
|
|
72
|
+
if (/;\u0020*[Bb][Aa][Ss][Ee]64$/u.test(mimeType)) {
|
|
73
73
|
// 1. Let stringBody be the isomorphic decode of body.
|
|
74
74
|
const stringBody = isomorphicDecode(body)
|
|
75
75
|
|
|
@@ -268,8 +268,8 @@ function parseMIMEType (input) {
|
|
|
268
268
|
return 'failure'
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
-
const typeLowercase = type
|
|
272
|
-
const subtypeLowercase = subtype
|
|
271
|
+
const typeLowercase = asciiLowercase(type)
|
|
272
|
+
const subtypeLowercase = asciiLowercase(subtype)
|
|
273
273
|
|
|
274
274
|
// 10. Let mimeType be a new MIME type record whose type
|
|
275
275
|
// is type, in ASCII lowercase, and subtype is subtype,
|
|
@@ -309,7 +309,7 @@ function parseMIMEType (input) {
|
|
|
309
309
|
|
|
310
310
|
// 4. Set parameterName to parameterName, in ASCII
|
|
311
311
|
// lowercase.
|
|
312
|
-
parameterName = parameterName
|
|
312
|
+
parameterName = asciiLowercase(parameterName)
|
|
313
313
|
|
|
314
314
|
// 5. If position is not past the end of input, then:
|
|
315
315
|
if (position.position < input.length) {
|
|
@@ -10,6 +10,8 @@ const random = runtimeFeatures.has('crypto')
|
|
|
10
10
|
? require('node:crypto').randomInt
|
|
11
11
|
: (max) => Math.floor(Math.random() * max)
|
|
12
12
|
|
|
13
|
+
let getFormDataState, setFormDataState, getFormDataBoundary
|
|
14
|
+
|
|
13
15
|
// https://xhr.spec.whatwg.org/#formdata
|
|
14
16
|
class FormData {
|
|
15
17
|
#state = []
|
|
@@ -28,7 +30,7 @@ class FormData {
|
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
append (name, value, filename = undefined) {
|
|
31
|
-
webidl.brandCheck(this, FormData)
|
|
33
|
+
webidl.brandCheck(this, webidl.is.FormData)
|
|
32
34
|
|
|
33
35
|
const prefix = 'FormData.append'
|
|
34
36
|
webidl.argumentLengthCheck(arguments, 2, prefix)
|
|
@@ -56,7 +58,7 @@ class FormData {
|
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
delete (name) {
|
|
59
|
-
webidl.brandCheck(this, FormData)
|
|
61
|
+
webidl.brandCheck(this, webidl.is.FormData)
|
|
60
62
|
|
|
61
63
|
const prefix = 'FormData.delete'
|
|
62
64
|
webidl.argumentLengthCheck(arguments, 1, prefix)
|
|
@@ -69,7 +71,7 @@ class FormData {
|
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
get (name) {
|
|
72
|
-
webidl.brandCheck(this, FormData)
|
|
74
|
+
webidl.brandCheck(this, webidl.is.FormData)
|
|
73
75
|
|
|
74
76
|
const prefix = 'FormData.get'
|
|
75
77
|
webidl.argumentLengthCheck(arguments, 1, prefix)
|
|
@@ -89,7 +91,7 @@ class FormData {
|
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
getAll (name) {
|
|
92
|
-
webidl.brandCheck(this, FormData)
|
|
94
|
+
webidl.brandCheck(this, webidl.is.FormData)
|
|
93
95
|
|
|
94
96
|
const prefix = 'FormData.getAll'
|
|
95
97
|
webidl.argumentLengthCheck(arguments, 1, prefix)
|
|
@@ -106,7 +108,7 @@ class FormData {
|
|
|
106
108
|
}
|
|
107
109
|
|
|
108
110
|
has (name) {
|
|
109
|
-
webidl.brandCheck(this, FormData)
|
|
111
|
+
webidl.brandCheck(this, webidl.is.FormData)
|
|
110
112
|
|
|
111
113
|
const prefix = 'FormData.has'
|
|
112
114
|
webidl.argumentLengthCheck(arguments, 1, prefix)
|
|
@@ -119,7 +121,7 @@ class FormData {
|
|
|
119
121
|
}
|
|
120
122
|
|
|
121
123
|
set (name, value, filename = undefined) {
|
|
122
|
-
webidl.brandCheck(this, FormData)
|
|
124
|
+
webidl.brandCheck(this, webidl.is.FormData)
|
|
123
125
|
|
|
124
126
|
const prefix = 'FormData.set'
|
|
125
127
|
webidl.argumentLengthCheck(arguments, 2, prefix)
|
|
@@ -184,40 +186,34 @@ class FormData {
|
|
|
184
186
|
return `FormData ${output.slice(output.indexOf(']') + 2)}`
|
|
185
187
|
}
|
|
186
188
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
static getFormDataState (formData) {
|
|
191
|
-
return formData.#state
|
|
192
|
-
}
|
|
189
|
+
static {
|
|
190
|
+
/** @param {FormData} formData */
|
|
191
|
+
getFormDataState = (formData) => formData.#state
|
|
193
192
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
193
|
+
/**
|
|
194
|
+
* @param {FormData} formData
|
|
195
|
+
* @param {any[]} newState
|
|
196
|
+
*/
|
|
197
|
+
setFormDataState = (formData, newState) => {
|
|
198
|
+
formData.#state = newState
|
|
199
|
+
}
|
|
201
200
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
201
|
+
/**
|
|
202
|
+
* @param {FormData} formData
|
|
203
|
+
* @returns {string | null}
|
|
204
|
+
*/
|
|
205
|
+
getFormDataBoundary = (formData) => {
|
|
206
|
+
// eslint-disable-next-line no-return-assign
|
|
207
|
+
return formData.#boundary ??= `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
|
|
208
|
+
}
|
|
209
209
|
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
webidl.is.FormData = (arg) => {
|
|
211
|
+
return arg != null && typeof arg === 'object' && #state in arg
|
|
212
|
+
}
|
|
212
213
|
}
|
|
213
214
|
}
|
|
214
215
|
|
|
215
|
-
|
|
216
|
-
Reflect.deleteProperty(FormData, 'getFormDataState')
|
|
217
|
-
Reflect.deleteProperty(FormData, 'setFormDataState')
|
|
218
|
-
Reflect.deleteProperty(FormData, 'getFormDataBoundary')
|
|
219
|
-
|
|
220
|
-
iteratorMixin('FormData', FormData, getFormDataState, 'name', 'value')
|
|
216
|
+
iteratorMixin('FormData', FormData, getFormDataState, 'name', 'value', webidl.is.FormData)
|
|
221
217
|
|
|
222
218
|
Object.defineProperties(FormData.prototype, {
|
|
223
219
|
append: kEnumerableProperty,
|
|
@@ -273,6 +269,4 @@ function makeEntry (name, value, filename) {
|
|
|
273
269
|
return { name, value }
|
|
274
270
|
}
|
|
275
271
|
|
|
276
|
-
webidl.is.FormData = webidl.util.MakeTypeAssertion(FormData)
|
|
277
|
-
|
|
278
272
|
module.exports = { FormData, makeEntry, setFormDataState, getFormDataBoundary }
|
|
@@ -423,6 +423,8 @@ class HeadersList {
|
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
+
let getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList
|
|
427
|
+
|
|
426
428
|
// https://fetch.spec.whatwg.org/#headers-class
|
|
427
429
|
class Headers {
|
|
428
430
|
#guard
|
|
@@ -458,7 +460,7 @@ class Headers {
|
|
|
458
460
|
|
|
459
461
|
// https://fetch.spec.whatwg.org/#dom-headers-append
|
|
460
462
|
append (name, value) {
|
|
461
|
-
webidl.brandCheck(this, Headers)
|
|
463
|
+
webidl.brandCheck(this, webidl.is.Headers)
|
|
462
464
|
|
|
463
465
|
webidl.argumentLengthCheck(arguments, 2, 'Headers.append')
|
|
464
466
|
|
|
@@ -471,7 +473,7 @@ class Headers {
|
|
|
471
473
|
|
|
472
474
|
// https://fetch.spec.whatwg.org/#dom-headers-delete
|
|
473
475
|
delete (name) {
|
|
474
|
-
webidl.brandCheck(this, Headers)
|
|
476
|
+
webidl.brandCheck(this, webidl.is.Headers)
|
|
475
477
|
|
|
476
478
|
webidl.argumentLengthCheck(arguments, 1, 'Headers.delete')
|
|
477
479
|
|
|
@@ -515,7 +517,7 @@ class Headers {
|
|
|
515
517
|
|
|
516
518
|
// https://fetch.spec.whatwg.org/#dom-headers-get
|
|
517
519
|
get (name) {
|
|
518
|
-
webidl.brandCheck(this, Headers)
|
|
520
|
+
webidl.brandCheck(this, webidl.is.Headers)
|
|
519
521
|
|
|
520
522
|
webidl.argumentLengthCheck(arguments, 1, 'Headers.get')
|
|
521
523
|
|
|
@@ -538,7 +540,7 @@ class Headers {
|
|
|
538
540
|
|
|
539
541
|
// https://fetch.spec.whatwg.org/#dom-headers-has
|
|
540
542
|
has (name) {
|
|
541
|
-
webidl.brandCheck(this, Headers)
|
|
543
|
+
webidl.brandCheck(this, webidl.is.Headers)
|
|
542
544
|
|
|
543
545
|
webidl.argumentLengthCheck(arguments, 1, 'Headers.has')
|
|
544
546
|
|
|
@@ -561,7 +563,7 @@ class Headers {
|
|
|
561
563
|
|
|
562
564
|
// https://fetch.spec.whatwg.org/#dom-headers-set
|
|
563
565
|
set (name, value) {
|
|
564
|
-
webidl.brandCheck(this, Headers)
|
|
566
|
+
webidl.brandCheck(this, webidl.is.Headers)
|
|
565
567
|
|
|
566
568
|
webidl.argumentLengthCheck(arguments, 2, 'Headers.set')
|
|
567
569
|
|
|
@@ -609,7 +611,7 @@ class Headers {
|
|
|
609
611
|
|
|
610
612
|
// https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
|
|
611
613
|
getSetCookie () {
|
|
612
|
-
webidl.brandCheck(this, Headers)
|
|
614
|
+
webidl.brandCheck(this, webidl.is.Headers)
|
|
613
615
|
|
|
614
616
|
// 1. If this’s header list does not contain `Set-Cookie`, then return « ».
|
|
615
617
|
// 2. Return the values of all headers in this’s header list whose name is
|
|
@@ -630,37 +632,38 @@ class Headers {
|
|
|
630
632
|
return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`
|
|
631
633
|
}
|
|
632
634
|
|
|
633
|
-
static
|
|
634
|
-
|
|
635
|
-
|
|
635
|
+
static {
|
|
636
|
+
/** @param {Headers} headers */
|
|
637
|
+
getHeadersGuard = (headers) => headers.#guard
|
|
636
638
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
639
|
+
/**
|
|
640
|
+
* @param {Headers} headers
|
|
641
|
+
* @param {string} guard
|
|
642
|
+
*/
|
|
643
|
+
setHeadersGuard = (headers, guard) => {
|
|
644
|
+
headers.#guard = guard
|
|
645
|
+
}
|
|
640
646
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
+
/**
|
|
648
|
+
* @param {Headers} headers
|
|
649
|
+
*/
|
|
650
|
+
getHeadersList = (headers) => headers.#headersList
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* @param {Headers} target
|
|
654
|
+
* @param {HeadersList} list
|
|
655
|
+
*/
|
|
656
|
+
setHeadersList = (target, list) => {
|
|
657
|
+
target.#headersList = list
|
|
658
|
+
}
|
|
647
659
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
*/
|
|
652
|
-
static setHeadersList (target, list) {
|
|
653
|
-
target.#headersList = list
|
|
660
|
+
webidl.is.Headers = (arg) => {
|
|
661
|
+
return arg != null && typeof arg === 'object' && #guard in arg
|
|
662
|
+
}
|
|
654
663
|
}
|
|
655
664
|
}
|
|
656
665
|
|
|
657
|
-
|
|
658
|
-
Reflect.deleteProperty(Headers, 'getHeadersGuard')
|
|
659
|
-
Reflect.deleteProperty(Headers, 'setHeadersGuard')
|
|
660
|
-
Reflect.deleteProperty(Headers, 'getHeadersList')
|
|
661
|
-
Reflect.deleteProperty(Headers, 'setHeadersList')
|
|
662
|
-
|
|
663
|
-
iteratorMixin('Headers', Headers, headersListSortAndCombine, 0, 1)
|
|
666
|
+
iteratorMixin('Headers', Headers, headersListSortAndCombine, 0, 1, webidl.is.Headers)
|
|
664
667
|
|
|
665
668
|
Object.defineProperties(Headers.prototype, {
|
|
666
669
|
append: kEnumerableProperty,
|
|
@@ -1030,18 +1030,18 @@ function fetchFinale (fetchParams, response) {
|
|
|
1030
1030
|
// `Server-Timing` from response’s internal response’s header list.
|
|
1031
1031
|
// TODO
|
|
1032
1032
|
|
|
1033
|
-
// 3.
|
|
1033
|
+
// 3. If fetchParams’s request’s destination is "document", then set fetchParams’s controller’s
|
|
1034
|
+
// full timing info to fetchParams’s timing info.
|
|
1035
|
+
if (fetchParams.request.destination === 'document') {
|
|
1036
|
+
fetchParams.controller.fullTimingInfo = timingInfo
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
// 4. Let processResponseEndOfBody be the following steps:
|
|
1034
1040
|
const processResponseEndOfBody = () => {
|
|
1035
1041
|
// 1. Let unsafeEndTime be the unsafe shared current time.
|
|
1036
1042
|
const unsafeEndTime = Date.now() // ?
|
|
1037
1043
|
|
|
1038
|
-
// 2.
|
|
1039
|
-
// full timing info to fetchParams’s timing info.
|
|
1040
|
-
if (fetchParams.request.destination === 'document') {
|
|
1041
|
-
fetchParams.controller.fullTimingInfo = timingInfo
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
// 3. Set fetchParams’s controller’s report timing steps to the following steps given a global object global:
|
|
1044
|
+
// 2. Set fetchParams’s controller’s report timing steps to the following steps given a global object global:
|
|
1045
1045
|
fetchParams.controller.reportTimingSteps = () => {
|
|
1046
1046
|
// 1. If fetchParams’s request’s URL’s scheme is not an HTTP(S) scheme, then return.
|
|
1047
1047
|
if (!urlIsHttpHttpsScheme(fetchParams.request.url)) {
|
|
@@ -1090,7 +1090,7 @@ function fetchFinale (fetchParams, response) {
|
|
|
1090
1090
|
}
|
|
1091
1091
|
}
|
|
1092
1092
|
|
|
1093
|
-
//
|
|
1093
|
+
// 3. Let processResponseEndOfBodyTask be the following steps:
|
|
1094
1094
|
const processResponseEndOfBodyTask = () => {
|
|
1095
1095
|
// 1. Set fetchParams’s request’s done flag.
|
|
1096
1096
|
fetchParams.request.done = true
|
|
@@ -1109,11 +1109,11 @@ function fetchFinale (fetchParams, response) {
|
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
1111
|
|
|
1112
|
-
//
|
|
1112
|
+
// 4. Queue a fetch task to run processResponseEndOfBodyTask with fetchParams’s task destination
|
|
1113
1113
|
queueMicrotask(() => processResponseEndOfBodyTask())
|
|
1114
1114
|
}
|
|
1115
1115
|
|
|
1116
|
-
//
|
|
1116
|
+
// 5. If fetchParams’s process response is non-null, then queue a fetch task to run fetchParams’s
|
|
1117
1117
|
// process response given response, with fetchParams’s task destination.
|
|
1118
1118
|
if (fetchParams.processResponse != null) {
|
|
1119
1119
|
queueMicrotask(() => {
|
|
@@ -1122,11 +1122,14 @@ function fetchFinale (fetchParams, response) {
|
|
|
1122
1122
|
})
|
|
1123
1123
|
}
|
|
1124
1124
|
|
|
1125
|
-
//
|
|
1125
|
+
// 6. Let internalResponse be response, if response is a network error; otherwise response’s internal response.
|
|
1126
1126
|
const internalResponse = response.type === 'error' ? response : (response.internalResponse ?? response)
|
|
1127
1127
|
|
|
1128
|
-
//
|
|
1129
|
-
//
|
|
1128
|
+
// 7. If response is a network error, then run the WebDriver BiDi fetch error steps with request.
|
|
1129
|
+
// Otherwise, run the WebDriver BiDi response completed steps with request and response.
|
|
1130
|
+
|
|
1131
|
+
// 8. If internalResponse’s body is null, then run processResponseEndOfBody.
|
|
1132
|
+
// 9. Otherwise:
|
|
1130
1133
|
if (internalResponse.body == null) {
|
|
1131
1134
|
processResponseEndOfBody()
|
|
1132
1135
|
} else {
|
|
@@ -1144,6 +1147,27 @@ function fetchFinale (fetchParams, response) {
|
|
|
1144
1147
|
processResponseEndOfBody()
|
|
1145
1148
|
})
|
|
1146
1149
|
}
|
|
1150
|
+
|
|
1151
|
+
// 10. If fetchParams’s process response consume body is non-null, then:
|
|
1152
|
+
if (fetchParams.processResponseConsumeBody != null) {
|
|
1153
|
+
// 1. Let processBody given nullOrBytes be this step: run fetchParams’s
|
|
1154
|
+
// process response consume body given response and nullOrBytes.
|
|
1155
|
+
const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
|
|
1156
|
+
|
|
1157
|
+
// 2. Let processBodyError be this step: run fetchParams’s process
|
|
1158
|
+
// response consume body given response and failure.
|
|
1159
|
+
const processBodyError = () => fetchParams.processResponseConsumeBody(response, 'failure')
|
|
1160
|
+
|
|
1161
|
+
// 3. If internalResponse’s body is null, then queue a fetch task to run
|
|
1162
|
+
// processBody given null, with fetchParams’s task destination.
|
|
1163
|
+
if (internalResponse.body == null) {
|
|
1164
|
+
queueMicrotask(() => processBody(null))
|
|
1165
|
+
} else {
|
|
1166
|
+
// 4. Otherwise, fully read internalResponse’s body given processBody,
|
|
1167
|
+
// processBodyError, and fetchParams’s task destination.
|
|
1168
|
+
fullyReadBody(internalResponse.body, processBody, processBodyError)
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1147
1171
|
}
|
|
1148
1172
|
|
|
1149
1173
|
// https://fetch.spec.whatwg.org/#http-fetch
|