@songtonyli/dsh-cli 0.1.36 → 0.1.37
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/@deepseek-ai/dsh-client-ui-primitives/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +2 -2
- package/node_modules/@deepseek-ai/dsh-tui-app/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +85 -33
- 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 +4 -4
|
@@ -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
|
|
@@ -83,6 +83,7 @@ function buildAbort (acRef) {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
let patchMethodWarning = false
|
|
86
|
+
let setRequestSignal, getRequestDispatcher, setRequestDispatcher, setRequestHeaders, getRequestState, setRequestState, removeRequestAbortListener
|
|
86
87
|
|
|
87
88
|
// https://fetch.spec.whatwg.org/#request-class
|
|
88
89
|
class Request {
|
|
@@ -600,7 +601,7 @@ class Request {
|
|
|
600
601
|
|
|
601
602
|
// Returns request’s HTTP method, which is "GET" by default.
|
|
602
603
|
get method () {
|
|
603
|
-
webidl.brandCheck(this, Request)
|
|
604
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
604
605
|
|
|
605
606
|
// The method getter steps are to return this’s request’s method.
|
|
606
607
|
return this.#state.method
|
|
@@ -608,7 +609,7 @@ class Request {
|
|
|
608
609
|
|
|
609
610
|
// Returns the URL of request as a string.
|
|
610
611
|
get url () {
|
|
611
|
-
webidl.brandCheck(this, Request)
|
|
612
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
612
613
|
|
|
613
614
|
// The url getter steps are to return this’s request’s URL, serialized.
|
|
614
615
|
return URLSerializer(this.#state.url)
|
|
@@ -618,7 +619,7 @@ class Request {
|
|
|
618
619
|
// Note that headers added in the network layer by the user agent will not
|
|
619
620
|
// be accounted for in this object, e.g., the "Host" header.
|
|
620
621
|
get headers () {
|
|
621
|
-
webidl.brandCheck(this, Request)
|
|
622
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
622
623
|
|
|
623
624
|
// The headers getter steps are to return this’s headers.
|
|
624
625
|
return this.#headers
|
|
@@ -627,7 +628,7 @@ class Request {
|
|
|
627
628
|
// Returns the kind of resource requested by request, e.g., "document"
|
|
628
629
|
// or "script".
|
|
629
630
|
get destination () {
|
|
630
|
-
webidl.brandCheck(this, Request)
|
|
631
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
631
632
|
|
|
632
633
|
// The destination getter are to return this’s request’s destination.
|
|
633
634
|
return this.#state.destination
|
|
@@ -639,7 +640,7 @@ class Request {
|
|
|
639
640
|
// during fetching to determine the value of the `Referer` header of the
|
|
640
641
|
// request being made.
|
|
641
642
|
get referrer () {
|
|
642
|
-
webidl.brandCheck(this, Request)
|
|
643
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
643
644
|
|
|
644
645
|
// 1. If this’s request’s referrer is "no-referrer", then return the
|
|
645
646
|
// empty string.
|
|
@@ -661,7 +662,7 @@ class Request {
|
|
|
661
662
|
// This is used during fetching to compute the value of the request’s
|
|
662
663
|
// referrer.
|
|
663
664
|
get referrerPolicy () {
|
|
664
|
-
webidl.brandCheck(this, Request)
|
|
665
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
665
666
|
|
|
666
667
|
// The referrerPolicy getter steps are to return this’s request’s referrer policy.
|
|
667
668
|
return this.#state.referrerPolicy
|
|
@@ -671,7 +672,7 @@ class Request {
|
|
|
671
672
|
// whether the request will use CORS, or will be restricted to same-origin
|
|
672
673
|
// URLs.
|
|
673
674
|
get mode () {
|
|
674
|
-
webidl.brandCheck(this, Request)
|
|
675
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
675
676
|
|
|
676
677
|
// The mode getter steps are to return this’s request’s mode.
|
|
677
678
|
return this.#state.mode
|
|
@@ -681,7 +682,7 @@ class Request {
|
|
|
681
682
|
// which is a string indicating whether credentials will be sent with the
|
|
682
683
|
// request always, never, or only when sent to a same-origin URL.
|
|
683
684
|
get credentials () {
|
|
684
|
-
webidl.brandCheck(this, Request)
|
|
685
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
685
686
|
|
|
686
687
|
// The credentials getter steps are to return this’s request’s credentials mode.
|
|
687
688
|
return this.#state.credentials
|
|
@@ -691,7 +692,7 @@ class Request {
|
|
|
691
692
|
// which is a string indicating how the request will
|
|
692
693
|
// interact with the browser’s cache when fetching.
|
|
693
694
|
get cache () {
|
|
694
|
-
webidl.brandCheck(this, Request)
|
|
695
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
695
696
|
|
|
696
697
|
// The cache getter steps are to return this’s request’s cache mode.
|
|
697
698
|
return this.#state.cache
|
|
@@ -702,7 +703,7 @@ class Request {
|
|
|
702
703
|
// request will be handled during fetching. A request
|
|
703
704
|
// will follow redirects by default.
|
|
704
705
|
get redirect () {
|
|
705
|
-
webidl.brandCheck(this, Request)
|
|
706
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
706
707
|
|
|
707
708
|
// The redirect getter steps are to return this’s request’s redirect mode.
|
|
708
709
|
return this.#state.redirect
|
|
@@ -712,7 +713,7 @@ class Request {
|
|
|
712
713
|
// cryptographic hash of the resource being fetched. Its value
|
|
713
714
|
// consists of multiple hashes separated by whitespace. [SRI]
|
|
714
715
|
get integrity () {
|
|
715
|
-
webidl.brandCheck(this, Request)
|
|
716
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
716
717
|
|
|
717
718
|
// The integrity getter steps are to return this’s request’s integrity
|
|
718
719
|
// metadata.
|
|
@@ -722,7 +723,7 @@ class Request {
|
|
|
722
723
|
// Returns a boolean indicating whether or not request can outlive the
|
|
723
724
|
// global in which it was created.
|
|
724
725
|
get keepalive () {
|
|
725
|
-
webidl.brandCheck(this, Request)
|
|
726
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
726
727
|
|
|
727
728
|
// The keepalive getter steps are to return this’s request’s keepalive.
|
|
728
729
|
return this.#state.keepalive
|
|
@@ -731,7 +732,7 @@ class Request {
|
|
|
731
732
|
// Returns a boolean indicating whether or not request is for a reload
|
|
732
733
|
// navigation.
|
|
733
734
|
get isReloadNavigation () {
|
|
734
|
-
webidl.brandCheck(this, Request)
|
|
735
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
735
736
|
|
|
736
737
|
// The isReloadNavigation getter steps are to return true if this’s
|
|
737
738
|
// request’s reload-navigation flag is set; otherwise false.
|
|
@@ -741,7 +742,7 @@ class Request {
|
|
|
741
742
|
// Returns a boolean indicating whether or not request is for a history
|
|
742
743
|
// navigation (a.k.a. back-forward navigation).
|
|
743
744
|
get isHistoryNavigation () {
|
|
744
|
-
webidl.brandCheck(this, Request)
|
|
745
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
745
746
|
|
|
746
747
|
// The isHistoryNavigation getter steps are to return true if this’s request’s
|
|
747
748
|
// history-navigation flag is set; otherwise false.
|
|
@@ -752,33 +753,33 @@ class Request {
|
|
|
752
753
|
// object indicating whether or not request has been aborted, and its
|
|
753
754
|
// abort event handler.
|
|
754
755
|
get signal () {
|
|
755
|
-
webidl.brandCheck(this, Request)
|
|
756
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
756
757
|
|
|
757
758
|
// The signal getter steps are to return this’s signal.
|
|
758
759
|
return this.#signal
|
|
759
760
|
}
|
|
760
761
|
|
|
761
762
|
get body () {
|
|
762
|
-
webidl.brandCheck(this, Request)
|
|
763
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
763
764
|
|
|
764
765
|
return this.#state.body ? this.#state.body.stream : null
|
|
765
766
|
}
|
|
766
767
|
|
|
767
768
|
get bodyUsed () {
|
|
768
|
-
webidl.brandCheck(this, Request)
|
|
769
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
769
770
|
|
|
770
771
|
return !!this.#state.body && util.isDisturbed(this.#state.body.stream)
|
|
771
772
|
}
|
|
772
773
|
|
|
773
774
|
get duplex () {
|
|
774
|
-
webidl.brandCheck(this, Request)
|
|
775
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
775
776
|
|
|
776
777
|
return 'half'
|
|
777
778
|
}
|
|
778
779
|
|
|
779
780
|
// Returns a clone of request.
|
|
780
781
|
clone () {
|
|
781
|
-
webidl.brandCheck(this, Request)
|
|
782
|
+
webidl.brandCheck(this, webidl.is.Request)
|
|
782
783
|
|
|
783
784
|
// 1. If this is unusable, then throw a TypeError.
|
|
784
785
|
if (bodyUnusable(this.#state)) {
|
|
@@ -840,73 +841,69 @@ class Request {
|
|
|
840
841
|
return `Request ${nodeUtil.formatWithOptions(options, properties)}`
|
|
841
842
|
}
|
|
842
843
|
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
844
|
+
static {
|
|
845
|
+
/**
|
|
846
|
+
* @param {Request} request
|
|
847
|
+
* @param {AbortSignal} newSignal
|
|
848
|
+
*/
|
|
849
|
+
setRequestSignal = (request, newSignal) => {
|
|
850
|
+
request.#signal = newSignal
|
|
851
|
+
}
|
|
851
852
|
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
853
|
+
/**
|
|
854
|
+
* @param {Request} request
|
|
855
|
+
*/
|
|
856
|
+
getRequestDispatcher = (request) => {
|
|
857
|
+
return request.#dispatcher
|
|
858
|
+
}
|
|
858
859
|
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
860
|
+
/**
|
|
861
|
+
* @param {Request} request
|
|
862
|
+
* @param {import('../../dispatcher/dispatcher')} newDispatcher
|
|
863
|
+
*/
|
|
864
|
+
setRequestDispatcher = (request, newDispatcher) => {
|
|
865
|
+
request.#dispatcher = newDispatcher
|
|
866
|
+
}
|
|
866
867
|
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
868
|
+
/**
|
|
869
|
+
* @param {Request} request
|
|
870
|
+
* @param {Headers} newHeaders
|
|
871
|
+
*/
|
|
872
|
+
setRequestHeaders = (request, newHeaders) => {
|
|
873
|
+
request.#headers = newHeaders
|
|
874
|
+
}
|
|
874
875
|
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
876
|
+
/**
|
|
877
|
+
* @param {Request} request
|
|
878
|
+
*/
|
|
879
|
+
getRequestState = (request) => {
|
|
880
|
+
return request.#state
|
|
881
|
+
}
|
|
881
882
|
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
883
|
+
/**
|
|
884
|
+
* @param {Request} request
|
|
885
|
+
* @param {any} newState
|
|
886
|
+
*/
|
|
887
|
+
setRequestState = (request, newState) => {
|
|
888
|
+
request.#state = newState
|
|
889
|
+
}
|
|
889
890
|
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
891
|
+
/**
|
|
892
|
+
* Removes the `abort` listener that makes this request's signal follow the
|
|
893
|
+
* signal passed to its constructor, if any. Idempotent.
|
|
894
|
+
* @param {Request} request
|
|
895
|
+
*/
|
|
896
|
+
removeRequestAbortListener = (request) => {
|
|
897
|
+
request.#abortCleanup?.()
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
webidl.is.Request = (arg) => {
|
|
901
|
+
return arg != null && typeof arg === 'object' && #state in arg
|
|
902
|
+
}
|
|
897
903
|
}
|
|
898
904
|
}
|
|
899
905
|
|
|
900
|
-
|
|
901
|
-
Reflect.deleteProperty(Request, 'setRequestSignal')
|
|
902
|
-
Reflect.deleteProperty(Request, 'getRequestDispatcher')
|
|
903
|
-
Reflect.deleteProperty(Request, 'setRequestDispatcher')
|
|
904
|
-
Reflect.deleteProperty(Request, 'setRequestHeaders')
|
|
905
|
-
Reflect.deleteProperty(Request, 'getRequestState')
|
|
906
|
-
Reflect.deleteProperty(Request, 'setRequestState')
|
|
907
|
-
Reflect.deleteProperty(Request, 'removeRequestAbortListener')
|
|
908
|
-
|
|
909
|
-
mixinBody(Request, getRequestState)
|
|
906
|
+
mixinBody(Request, getRequestState, webidl.is.Request)
|
|
910
907
|
|
|
911
908
|
// https://fetch.spec.whatwg.org/#requests
|
|
912
909
|
function makeRequest (init) {
|
|
@@ -1021,8 +1018,6 @@ Object.defineProperties(Request.prototype, {
|
|
|
1021
1018
|
}
|
|
1022
1019
|
})
|
|
1023
1020
|
|
|
1024
|
-
webidl.is.Request = webidl.util.MakeTypeAssertion(Request)
|
|
1025
|
-
|
|
1026
1021
|
/**
|
|
1027
1022
|
* @param {*} V
|
|
1028
1023
|
* @returns {import('../../../types/fetch').Request|string}
|