@psnext/slingcli 3.5.20261007-3 → 3.5.20261019-1
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/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +12 -3
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +94 -1589
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +12 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +1 -7
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +1 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +1 -3
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +2 -8
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +2 -3
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +2 -3
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +10 -10
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +2 -3
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +2 -3
- package/node_modules/@aws-sdk/core/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-env/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-http/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +10 -10
- package/node_modules/@aws-sdk/credential-provider-login/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-node/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-process/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +37 -19
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +37 -19
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +4 -4
- package/node_modules/@aws-sdk/eventstream-handler-node/package.json +2 -2
- package/node_modules/@aws-sdk/middleware-eventstream/package.json +2 -2
- package/node_modules/@aws-sdk/middleware-websocket/package.json +4 -4
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +11 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +6 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +6 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +13 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +9 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/models/CognitoIdentityServiceException.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/models/errors.js +9 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/SigninServiceException.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/errors.js +4 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/SSOServiceException.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/errors.js +4 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/SSOOIDCServiceException.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/errors.js +11 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js +7 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/models/CognitoIdentityServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/models/errors.d.ts +9 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/SigninServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/errors.d.ts +4 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/models/SSOServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/models/errors.d.ts +4 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/models/SSOOIDCServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/models/errors.d.ts +11 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/models/STSServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/models/errors.d.ts +7 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/models/CognitoIdentityServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/models/errors.d.ts +9 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/SigninServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/errors.d.ts +4 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/models/SSOServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/models/errors.d.ts +4 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/models/SSOOIDCServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/models/errors.d.ts +11 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/models/STSServiceException.d.ts +1 -0
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/models/errors.d.ts +7 -0
- package/node_modules/@aws-sdk/nested-clients/package.json +4 -4
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +2 -0
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.js +21 -86
- package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js +3 -103
- package/node_modules/@earendil-works/pi-codemode/package.json +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-TFS67BSI.js → chunk-23QDZLZG.js} +20 -14
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-IB6ONE3U.js → chunk-QPFSTNX5.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{virtual-modules-P5ROWYIG.js → virtual-modules-GRXGP6ZA.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli-runtime.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Agent.md +8 -8
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Client.md +11 -6
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Dispatcher.md +12 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Errors.md +101 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Fetch.md +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Interceptors.md +17 -9
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Pool.md +5 -6
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/index.md +22 -13
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/type-map.json +66 -66
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/readable.js +1 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/connect.js +10 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/constants.js +12 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/errors.js +38 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/request.js +39 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/util.js +26 -40
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/agent.js +6 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h1.js +127 -84
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h2.js +97 -21
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client.js +10 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/pool-base.js +117 -19
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/pool.js +99 -13
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/proxy-agent.js +34 -11
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/cache-handler.js +153 -15
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/deduplication-handler.js +126 -52
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/redirect-handler.js +31 -6
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/retry-handler.js +116 -24
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/cache.js +15 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/decompress.js +253 -73
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dns.js +11 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/response-error.js +72 -28
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/milo/LICENSE.md +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/milo/no-simd.js +1002 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/milo/simd.js +1002 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-agent.js +11 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/util/cache.js +11 -5
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cache/cache.js +17 -8
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/index.js +19 -7
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/util.js +21 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource.js +50 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/body.js +69 -53
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/data-url.js +6 -6
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/formdata.js +30 -36
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/headers.js +36 -33
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/index.js +54 -29
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/request.js +74 -79
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/response.js +43 -44
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/util.js +7 -7
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/infra/index.js +16 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/webidl/index.js +2 -14
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/connection.js +33 -12
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/events.js +43 -26
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/receiver.js +27 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/stream/websocketstream.js +19 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/websocket.js +44 -41
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/package.json +7 -5
- package/node_modules/@earendil-works/pi-coding-agent/package.json +2 -2
- package/node_modules/@hono/node-server/README.md +2 -0
- package/node_modules/@hono/node-server/dist/index.cjs +1 -1
- package/node_modules/@hono/node-server/dist/index.mjs +1 -1
- package/node_modules/@hono/node-server/dist/serve-static.cjs +2 -1
- package/node_modules/@hono/node-server/dist/serve-static.mjs +2 -1
- package/node_modules/@hono/node-server/package.json +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +2 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +2 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +1695 -3
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/cache/EndpointCache.js +2 -1
- package/node_modules/@smithy/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js +6 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/UnionSerde.js +26 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/common.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/index.js +8 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/json/SmithyRpcV2JsonProtocol.js +102 -0
- package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js +8 -1
- package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js +8 -1
- package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js +13 -2
- package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +11 -1
- package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/parseJsonBody.js +16 -1
- package/node_modules/@smithy/core/dist-es/submodules/protocols/writeKey.js +3 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/ConfigurableSerdeContext.d.ts +8 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/UnionSerde.d.ts +24 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/common.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/index.d.ts +9 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/json/JsonSettings.d.ts +13 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +28 -0
- package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/parseJsonBody.d.ts +16 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/writeKey.d.ts +4 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/ConfigurableSerdeContext.d.ts +8 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/UnionSerde.d.ts +24 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/common.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/index.d.ts +9 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/JsonSettings.d.ts +13 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +28 -0
- package/node_modules/{@aws-sdk → @smithy}/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonCodec.d.ts +15 -11
- package/node_modules/{@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json → @smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v1}/JsonSettings.d.ts +7 -4
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +14 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +29 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +51 -0
- package/node_modules/{@aws-sdk → @smithy}/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +13 -9
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +30 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +60 -0
- package/node_modules/{@aws-sdk → @smithy}/core/dist-types/ts3.4/submodules/protocols/json/detectBufferParsing.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +21 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +15 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +11 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +38 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/writeKey.d.ts +4 -0
- package/node_modules/@smithy/core/package.json +2 -1
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/util.d.ts +6 -3
- package/node_modules/content-disposition/README.md +105 -35
- package/node_modules/content-disposition/dist/index.d.ts +72 -0
- package/node_modules/content-disposition/dist/index.js +388 -0
- package/node_modules/content-disposition/dist/index.js.map +1 -0
- package/node_modules/content-disposition/package.json +31 -19
- package/node_modules/express/Readme.md +15 -9
- package/node_modules/express/lib/application.js +2 -2
- package/node_modules/express/lib/request.js +32 -19
- package/node_modules/express/lib/response.js +27 -30
- package/node_modules/express/node_modules/content-type/LICENSE +22 -0
- package/node_modules/express/node_modules/content-type/README.md +71 -0
- package/node_modules/express/node_modules/content-type/dist/index.d.ts +46 -0
- package/node_modules/express/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/express/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/express/node_modules/content-type/package.json +52 -0
- package/node_modules/express/package.json +10 -10
- package/node_modules/fast-uri/.github/workflows/release.yml +35 -0
- package/node_modules/fast-uri/README.md +8 -0
- package/node_modules/fast-uri/index.js +98 -18
- package/node_modules/fast-uri/lib/utils.js +52 -0
- package/node_modules/fast-uri/package.json +1 -1
- package/node_modules/fast-uri/test/host-delimiter-security.test.js +94 -0
- package/node_modules/fast-uri/test/relative-normalization-security.test.js +156 -0
- package/node_modules/fast-uri/test/reserved-path-normalization.test.js +32 -4
- package/node_modules/fast-uri/test/scheme-validation.test.js +53 -14
- package/node_modules/ip-address/README.md +70 -70
- package/node_modules/ip-address/dist/ipv6.js +7 -4
- package/node_modules/ip-address/dist/ipv6.js.map +1 -1
- package/node_modules/ip-address/dist/v6/constants.d.ts +3 -0
- package/node_modules/ip-address/dist/v6/constants.js +3 -0
- package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
- package/node_modules/ip-address/package.json +2 -1
- package/node_modules/jose/README.md +2 -2
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +5 -4
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +4 -4
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +5 -4
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +5 -5
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +5 -4
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +5 -5
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +5 -4
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +5 -5
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +5 -4
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +6 -5
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +9 -6
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +7 -5
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +7 -6
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +1 -1
- package/node_modules/jose/dist/types/jwt/sign.d.ts +1 -1
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +1 -1
- package/node_modules/jose/dist/types/jwt/verify.d.ts +3 -5
- package/node_modules/jose/dist/types/key/export.d.ts +1 -1
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +1 -1
- package/node_modules/jose/dist/types/key/import.d.ts +2 -2
- package/node_modules/jose/dist/types/types.d.ts +165 -107
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +2 -2
- package/node_modules/jose/dist/types/util/errors.d.ts +1 -1
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +3 -3
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +8 -8
- package/node_modules/jose/dist/webapi/jwks/local.js +2 -1
- package/node_modules/jose/dist/webapi/jwks/remote.js +4 -4
- package/node_modules/jose/dist/webapi/jws/general/sign.js +3 -3
- package/node_modules/jose/dist/webapi/jws/general/verify.js +3 -3
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +2 -2
- package/node_modules/jose/dist/webapi/jwt/sign.js +2 -2
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +3 -3
- package/node_modules/jose/dist/webapi/key/generate_secret.js +4 -4
- package/node_modules/jose/dist/webapi/lib/asn1.js +2 -2
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +4 -4
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +8 -8
- package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +14 -14
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +3 -3
- package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +2 -2
- package/node_modules/jose/dist/webapi/lib/jws_sign.js +11 -11
- package/node_modules/jose/dist/webapi/lib/jws_verify.js +19 -16
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +44 -43
- package/node_modules/jose/dist/webapi/lib/key.js +4 -4
- package/node_modules/jose/dist/webapi/lib/key_management.js +17 -17
- package/node_modules/jose/dist/webapi/lib/validate.js +10 -10
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +12 -12
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +5 -5
- package/node_modules/jose/package.json +1 -1
- package/node_modules/qs/.github/THREAT_MODEL.md +4 -2
- package/node_modules/qs/CHANGELOG.md +38 -14
- package/node_modules/qs/README.md +31 -3
- package/node_modules/qs/dist/qs.js +20 -20
- package/node_modules/qs/lib/parse.js +94 -4
- package/node_modules/qs/lib/stringify.js +4 -4
- package/node_modules/qs/lib/utils.js +130 -6
- package/node_modules/qs/package.json +4 -4
- package/node_modules/qs/test/parse.js +174 -0
- package/node_modules/qs/test/stringify.js +263 -33
- package/node_modules/qs/test/utils.js +184 -0
- package/node_modules/undici/docs/docs/api/Client.md +2 -0
- package/node_modules/undici/lib/core/connect.js +10 -4
- package/node_modules/undici/lib/core/symbols.js +1 -0
- package/node_modules/undici/lib/dispatcher/agent.js +6 -2
- package/node_modules/undici/lib/dispatcher/client-h1.js +0 -2
- package/node_modules/undici/lib/dispatcher/client-h2.js +0 -4
- package/node_modules/undici/lib/dispatcher/client.js +3 -2
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +12 -0
- package/node_modules/undici/lib/handler/cache-handler.js +48 -0
- package/node_modules/undici/lib/handler/deduplication-handler.js +57 -13
- package/node_modules/undici/lib/handler/redirect-handler.js +8 -1
- package/node_modules/undici/lib/interceptor/decompress.js +15 -5
- package/node_modules/undici/lib/web/cookies/index.js +3 -1
- package/node_modules/undici/lib/web/cookies/parse.js +138 -137
- package/node_modules/undici/lib/web/cookies/util.js +21 -2
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +90 -9
- package/node_modules/undici/lib/web/eventsource/eventsource.js +4 -1
- package/node_modules/undici/lib/web/fetch/index.js +3 -3
- package/node_modules/undici/lib/web/infra/index.js +14 -0
- package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
- package/node_modules/undici/lib/web/websocket/receiver.js +13 -0
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/client.d.ts +14 -0
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
- package/node_modules/zod/src/v4/core/compile.ts +9 -0
- package/node_modules/zod/src/v4/core/schemas.ts +35 -1
- package/node_modules/zod/src/v4/core/util.ts +13 -0
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/v4/core/compile.cjs +8 -0
- package/node_modules/zod/v4/core/compile.js +8 -0
- package/node_modules/zod/v4/core/schemas.cjs +30 -0
- package/node_modules/zod/v4/core/schemas.d.cts +3 -1
- package/node_modules/zod/v4/core/schemas.d.ts +3 -1
- package/node_modules/zod/v4/core/schemas.js +30 -0
- package/node_modules/zod/v4/core/util.cjs +15 -0
- package/node_modules/zod/v4/core/util.d.cts +2 -0
- package/node_modules/zod/v4/core/util.d.ts +2 -0
- package/node_modules/zod/v4/core/util.js +14 -0
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/package.json +5 -4
- package/slingshot/index.js +124 -124
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +0 -13
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +0 -18
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -27
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +0 -15
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +0 -39
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +0 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +0 -7
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +0 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +0 -14
- package/node_modules/content-disposition/index.js +0 -536
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/JsonSettings.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonCodec.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonSettings.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/detectBufferParsing.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/jsonReplacer.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/jsonReviver.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/needsReviver.js +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v1/JsonCodec.d.ts +0 -0
- /package/node_modules/{@aws-sdk/core/dist-types/submodules/protocols/json → @smithy/core/dist-types/submodules/protocols/json/codec-v1}/JsonSettings.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/detectBufferParsing.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/jsonReplacer.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/jsonReviver.d.ts +0 -0
- /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/needsReviver.d.ts +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const util = require('../core/util')
|
|
4
|
+
const { kRedirectCacheControl } = require('../core/symbols')
|
|
4
5
|
const {
|
|
5
6
|
parseCacheControlHeader,
|
|
6
7
|
hasInvalidCacheControlDirective,
|
|
@@ -13,6 +14,63 @@ const { parseHttpDate } = require('../util/date.js')
|
|
|
13
14
|
|
|
14
15
|
function noop () {}
|
|
15
16
|
|
|
17
|
+
class CacheController {
|
|
18
|
+
#blocked = false
|
|
19
|
+
#downstreamPaused = false
|
|
20
|
+
|
|
21
|
+
constructor (target) {
|
|
22
|
+
this.target = target
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
block () {
|
|
26
|
+
this.#blocked = true
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
release () {
|
|
30
|
+
this.#blocked = false
|
|
31
|
+
if (!this.#downstreamPaused) {
|
|
32
|
+
this.target.resume()
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
pause () {
|
|
37
|
+
this.#downstreamPaused = true
|
|
38
|
+
this.target.pause()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
resume () {
|
|
42
|
+
this.#downstreamPaused = false
|
|
43
|
+
if (!this.#blocked) {
|
|
44
|
+
this.target.resume()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
abort (reason) {
|
|
49
|
+
this.target.abort(reason)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
get paused () { return this.#downstreamPaused }
|
|
53
|
+
get aborted () { return this.target.aborted }
|
|
54
|
+
get reason () { return this.target.reason }
|
|
55
|
+
get rawHeaders () { return this.target.rawHeaders }
|
|
56
|
+
set rawHeaders (value) { this.target.rawHeaders = value }
|
|
57
|
+
get rawTrailers () { return this.target.rawTrailers }
|
|
58
|
+
set rawTrailers (value) { this.target.rawTrailers = value }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @param {string | URL} a
|
|
63
|
+
* @param {string | URL} b
|
|
64
|
+
* @returns {boolean}
|
|
65
|
+
*/
|
|
66
|
+
function sameOrigin (a, b) {
|
|
67
|
+
try {
|
|
68
|
+
return new URL(String(a)).origin === new URL(String(b)).origin
|
|
69
|
+
} catch {
|
|
70
|
+
return String(a) === String(b)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
16
74
|
// Status codes that we can use some heuristics on to cache
|
|
17
75
|
const HEURISTICALLY_CACHEABLE_STATUS_CODES = [
|
|
18
76
|
200, 203, 204, 206, 300, 301, 308, 404, 405, 410, 414, 501
|
|
@@ -149,11 +207,24 @@ class CacheHandler {
|
|
|
149
207
|
*/
|
|
150
208
|
#handler
|
|
151
209
|
|
|
210
|
+
/**
|
|
211
|
+
* @type {CacheController | undefined}
|
|
212
|
+
*/
|
|
213
|
+
#downstreamController
|
|
214
|
+
|
|
152
215
|
/**
|
|
153
216
|
* @type {import('node:stream').Writable | undefined}
|
|
154
217
|
*/
|
|
155
218
|
#writeStream
|
|
156
219
|
|
|
220
|
+
/**
|
|
221
|
+
* The URLs visited while following redirects, shared by reference from the
|
|
222
|
+
* redirect handler through the request context. Carries the suppressed hops'
|
|
223
|
+
* cache-control under {@link kRedirectCacheControl}.
|
|
224
|
+
* @type {URL[] | undefined}
|
|
225
|
+
*/
|
|
226
|
+
#history
|
|
227
|
+
|
|
157
228
|
/**
|
|
158
229
|
* @param {import('../../types/cache-interceptor.d.ts').default.CacheHandlerOptions} opts
|
|
159
230
|
* @param {import('../../types/cache-interceptor.d.ts').default.CacheKey} cacheKey
|
|
@@ -170,7 +241,15 @@ class CacheHandler {
|
|
|
170
241
|
onRequestStart (controller, context) {
|
|
171
242
|
this.#writeStream?.destroy()
|
|
172
243
|
this.#writeStream = undefined
|
|
173
|
-
this.#
|
|
244
|
+
this.#downstreamController = new CacheController(controller)
|
|
245
|
+
// The redirect handler threads the list of visited URLs through the
|
|
246
|
+
// handler-chain context. Keep a reference to it (it is mutated as redirects
|
|
247
|
+
// are followed) so onResponseStart can tell which request actually produced
|
|
248
|
+
// the response. Unlike the request options object, this reference is not
|
|
249
|
+
// broken by an interceptor that copies the options between the cache and
|
|
250
|
+
// the redirect.
|
|
251
|
+
this.#history = context?.history
|
|
252
|
+
this.#handler.onRequestStart?.(this.#downstreamController, context)
|
|
174
253
|
}
|
|
175
254
|
|
|
176
255
|
onBodySent (chunk) {
|
|
@@ -181,8 +260,8 @@ class CacheHandler {
|
|
|
181
260
|
this.#handler.onRequestSent?.()
|
|
182
261
|
}
|
|
183
262
|
|
|
184
|
-
onRequestUpgrade (
|
|
185
|
-
this.#handler.onRequestUpgrade?.(
|
|
263
|
+
onRequestUpgrade (_controller, statusCode, headers, socket) {
|
|
264
|
+
this.#handler.onRequestUpgrade?.(this.#downstreamController, statusCode, headers, socket)
|
|
186
265
|
}
|
|
187
266
|
|
|
188
267
|
/**
|
|
@@ -199,7 +278,7 @@ class CacheHandler {
|
|
|
199
278
|
) {
|
|
200
279
|
const downstreamOnHeaders = () =>
|
|
201
280
|
this.#handler.onResponseStart?.(
|
|
202
|
-
|
|
281
|
+
this.#downstreamController,
|
|
203
282
|
statusCode,
|
|
204
283
|
resHeaders,
|
|
205
284
|
statusMessage
|
|
@@ -217,6 +296,35 @@ class CacheHandler {
|
|
|
217
296
|
return downstreamOnHeaders()
|
|
218
297
|
}
|
|
219
298
|
|
|
299
|
+
// A cross-origin redirect can change the origin that actually produced the
|
|
300
|
+
// final response. Keying that response on the original (trusted) origin
|
|
301
|
+
// would let a redirect target control an entry for a URL the application
|
|
302
|
+
// trusts. The final request is the last URL in the redirect history; only
|
|
303
|
+
// cache when its origin still matches the cache key origin.
|
|
304
|
+
if (this.#history && this.#history.length > 0) {
|
|
305
|
+
const finalUrl = this.#history[this.#history.length - 1]
|
|
306
|
+
if (!sameOrigin(finalUrl.origin, this.#cacheKey.origin)) {
|
|
307
|
+
return downstreamOnHeaders()
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// A redirect hop that is not forwarded can still carry a restrictive
|
|
312
|
+
// storage policy (for example `no-store`, or `private` for a shared cache).
|
|
313
|
+
// Honor it, otherwise a redirect that must not be stored could be laundered
|
|
314
|
+
// into a cacheable final response under the original key.
|
|
315
|
+
const redirectCacheControl = this.#history?.[kRedirectCacheControl]
|
|
316
|
+
if (redirectCacheControl) {
|
|
317
|
+
for (const hopCacheControl of redirectCacheControl) {
|
|
318
|
+
const hopDirectives = hopCacheControl ? parseCacheControlHeader(hopCacheControl) : {}
|
|
319
|
+
if (
|
|
320
|
+
hopDirectives['no-store'] === true ||
|
|
321
|
+
(this.#cacheType === 'shared' && hopDirectives.private === true)
|
|
322
|
+
) {
|
|
323
|
+
return downstreamOnHeaders()
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
220
328
|
const cacheControlHeader = resHeaders['cache-control']
|
|
221
329
|
const cacheControlDirectives = cacheControlHeader ? parseCacheControlHeader(cacheControlHeader) : {}
|
|
222
330
|
|
|
@@ -323,10 +431,21 @@ class CacheHandler {
|
|
|
323
431
|
// Not modified, re-use the cached value
|
|
324
432
|
// https://www.rfc-editor.org/rfc/rfc9111.html#name-handling-304-not-modified
|
|
325
433
|
if (statusCode === 304) {
|
|
434
|
+
let done = false
|
|
435
|
+
const finish304 = () => {
|
|
436
|
+
if (done) {
|
|
437
|
+
return
|
|
438
|
+
}
|
|
439
|
+
done = true
|
|
440
|
+
this.#downstreamController.release()
|
|
441
|
+
}
|
|
442
|
+
|
|
326
443
|
const handle304 = (cachedValue) => {
|
|
327
444
|
if (!cachedValue) {
|
|
328
445
|
// Do not create a new cache entry, as a 304 won't have a body - so cannot be cached.
|
|
329
|
-
|
|
446
|
+
downstreamOnHeaders()
|
|
447
|
+
finish304()
|
|
448
|
+
return
|
|
330
449
|
}
|
|
331
450
|
|
|
332
451
|
// Re-use the cached value: statuscode, statusmessage, headers and body
|
|
@@ -341,6 +460,7 @@ class CacheHandler {
|
|
|
341
460
|
this.#writeStream = this.#store.createWriteStream(this.#cacheKey, value)
|
|
342
461
|
|
|
343
462
|
if (!this.#writeStream || !cachedValue?.body) {
|
|
463
|
+
finish304()
|
|
344
464
|
return
|
|
345
465
|
}
|
|
346
466
|
|
|
@@ -348,20 +468,26 @@ class CacheHandler {
|
|
|
348
468
|
const bodyIterator = cachedValue.body.values()
|
|
349
469
|
|
|
350
470
|
const streamCachedBody = () => {
|
|
471
|
+
if (done) {
|
|
472
|
+
return
|
|
473
|
+
}
|
|
351
474
|
for (const chunk of bodyIterator) {
|
|
352
|
-
const full = this.#writeStream
|
|
353
|
-
this.#handler.onResponseData?.(
|
|
475
|
+
const full = this.#writeStream?.write(chunk) === false
|
|
476
|
+
this.#handler.onResponseData?.(this.#downstreamController, chunk)
|
|
354
477
|
// when stream is full stop writing until we get a 'drain' event
|
|
355
478
|
if (full) {
|
|
356
|
-
|
|
479
|
+
return
|
|
357
480
|
}
|
|
358
481
|
}
|
|
482
|
+
finish304()
|
|
359
483
|
}
|
|
360
484
|
|
|
361
485
|
this.#writeStream
|
|
362
486
|
.on('error', function () {
|
|
363
487
|
handler.#writeStream = undefined
|
|
364
488
|
handler.#store.delete(handler.#cacheKey)
|
|
489
|
+
// Keep replaying downstream without the store
|
|
490
|
+
streamCachedBody()
|
|
365
491
|
})
|
|
366
492
|
.on('drain', () => {
|
|
367
493
|
streamCachedBody()
|
|
@@ -369,6 +495,8 @@ class CacheHandler {
|
|
|
369
495
|
.on('close', function () {
|
|
370
496
|
if (handler.#writeStream === this) {
|
|
371
497
|
handler.#writeStream = undefined
|
|
498
|
+
// Keep replaying downstream without the store
|
|
499
|
+
streamCachedBody()
|
|
372
500
|
}
|
|
373
501
|
})
|
|
374
502
|
|
|
@@ -377,15 +505,17 @@ class CacheHandler {
|
|
|
377
505
|
// Readable stream body (e.g. from async/remote cache stores)
|
|
378
506
|
cachedValue.body
|
|
379
507
|
.on('data', (chunk) => {
|
|
380
|
-
this.#writeStream
|
|
381
|
-
this.#handler.onResponseData?.(
|
|
508
|
+
this.#writeStream?.write(chunk)
|
|
509
|
+
this.#handler.onResponseData?.(this.#downstreamController, chunk)
|
|
382
510
|
})
|
|
383
511
|
.on('end', () => {
|
|
384
|
-
this.#writeStream
|
|
512
|
+
this.#writeStream?.end()
|
|
513
|
+
finish304()
|
|
385
514
|
})
|
|
386
515
|
.on('error', () => {
|
|
387
516
|
this.#writeStream = undefined
|
|
388
517
|
this.#store.delete(this.#cacheKey)
|
|
518
|
+
finish304()
|
|
389
519
|
})
|
|
390
520
|
|
|
391
521
|
this.#writeStream
|
|
@@ -398,6 +528,8 @@ class CacheHandler {
|
|
|
398
528
|
handler.#writeStream = undefined
|
|
399
529
|
}
|
|
400
530
|
})
|
|
531
|
+
} else {
|
|
532
|
+
finish304()
|
|
401
533
|
}
|
|
402
534
|
}
|
|
403
535
|
|
|
@@ -405,8 +537,14 @@ class CacheHandler {
|
|
|
405
537
|
* @type {import('../../types/cache-interceptor.d.ts').default.CacheValue}
|
|
406
538
|
*/
|
|
407
539
|
const result = this.#store.get(this.#cacheKey)
|
|
540
|
+
// A 304 ends before the cached body is replayed. Keep the origin
|
|
541
|
+
// response paused until replay is complete.
|
|
542
|
+
this.#downstreamController.block()
|
|
543
|
+
controller.pause()
|
|
408
544
|
if (result && typeof result.then === 'function') {
|
|
409
|
-
result.then(handle304)
|
|
545
|
+
result.then(handle304, () => handle304(undefined)).catch((err) => {
|
|
546
|
+
controller.abort(err)
|
|
547
|
+
})
|
|
410
548
|
} else {
|
|
411
549
|
handle304(result)
|
|
412
550
|
}
|
|
@@ -449,18 +587,18 @@ class CacheHandler {
|
|
|
449
587
|
controller.pause()
|
|
450
588
|
}
|
|
451
589
|
|
|
452
|
-
this.#handler.onResponseData?.(
|
|
590
|
+
this.#handler.onResponseData?.(this.#downstreamController, chunk)
|
|
453
591
|
}
|
|
454
592
|
|
|
455
593
|
onResponseEnd (controller, trailers) {
|
|
456
594
|
this.#writeStream?.end()
|
|
457
|
-
this.#handler.onResponseEnd?.(
|
|
595
|
+
this.#handler.onResponseEnd?.(this.#downstreamController, trailers)
|
|
458
596
|
}
|
|
459
597
|
|
|
460
598
|
onResponseError (controller, err) {
|
|
461
599
|
this.#writeStream?.destroy(err)
|
|
462
600
|
this.#writeStream = undefined
|
|
463
|
-
this.#handler.onResponseError?.(
|
|
601
|
+
this.#handler.onResponseError?.(this.#downstreamController, err)
|
|
464
602
|
}
|
|
465
603
|
}
|
|
466
604
|
|
|
@@ -16,6 +16,7 @@ const DEFAULT_MAX_BUFFER_SIZE = 5 * 1024 * 1024
|
|
|
16
16
|
* @property {number} bufferedBytes
|
|
17
17
|
* @property {object | null} pendingTrailers
|
|
18
18
|
* @property {boolean} done
|
|
19
|
+
* @property {boolean} [pendingStart] onRequestStart deferred until the primary request's context is known
|
|
19
20
|
*/
|
|
20
21
|
|
|
21
22
|
/**
|
|
@@ -30,6 +31,20 @@ class DeduplicationHandler {
|
|
|
30
31
|
*/
|
|
31
32
|
#primaryHandler
|
|
32
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Whether the primary request has started (onRequestStart received). Until
|
|
36
|
+
* then the request context is unknown and cannot be given to waiting handlers.
|
|
37
|
+
* @type {boolean}
|
|
38
|
+
*/
|
|
39
|
+
#requestStarted = false
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The primary request context, replayed to waiting handlers so they observe
|
|
43
|
+
* the same redirect history as the primary.
|
|
44
|
+
* @type {any}
|
|
45
|
+
*/
|
|
46
|
+
#context = null
|
|
47
|
+
|
|
33
48
|
/**
|
|
34
49
|
* @type {WaitingHandler[]}
|
|
35
50
|
*/
|
|
@@ -112,20 +127,30 @@ class DeduplicationHandler {
|
|
|
112
127
|
const waitingController = waitingHandler.controller
|
|
113
128
|
|
|
114
129
|
try {
|
|
115
|
-
|
|
130
|
+
if (this.#requestStarted) {
|
|
131
|
+
// The primary request has started, so its context (including the
|
|
132
|
+
// redirect history) is known and can be delivered immediately.
|
|
133
|
+
handler.onRequestStart?.(waitingController, this.#context)
|
|
116
134
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
135
|
+
if (waitingController.aborted) {
|
|
136
|
+
waitingHandler.done = true
|
|
137
|
+
return true
|
|
138
|
+
}
|
|
121
139
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
140
|
+
if (this.#responseStarted) {
|
|
141
|
+
handler.onResponseStart?.(
|
|
142
|
+
waitingController,
|
|
143
|
+
this.#statusCode,
|
|
144
|
+
this.#headers,
|
|
145
|
+
this.#statusMessage
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
} else {
|
|
149
|
+
// The primary request has not started yet. Defer onRequestStart until
|
|
150
|
+
// its context is known, so the waiting handler observes the same
|
|
151
|
+
// redirect history as the primary (a cache handler relies on it to
|
|
152
|
+
// reject cross-origin redirect responses).
|
|
153
|
+
waitingHandler.pendingStart = true
|
|
129
154
|
}
|
|
130
155
|
} catch {
|
|
131
156
|
// Ignore errors from waiting handlers
|
|
@@ -146,6 +171,24 @@ class DeduplicationHandler {
|
|
|
146
171
|
*/
|
|
147
172
|
onRequestStart (controller, context) {
|
|
148
173
|
this.#controller = controller
|
|
174
|
+
if (!this.#requestStarted) {
|
|
175
|
+
this.#requestStarted = true
|
|
176
|
+
this.#context = context
|
|
177
|
+
// Deliver the now-known context to handlers that joined before the
|
|
178
|
+
// primary request started.
|
|
179
|
+
for (const waitingHandler of this.#waitingHandlers) {
|
|
180
|
+
if (waitingHandler.pendingStart && !waitingHandler.done && !waitingHandler.controller.aborted) {
|
|
181
|
+
waitingHandler.pendingStart = false
|
|
182
|
+
try {
|
|
183
|
+
waitingHandler.handler.onRequestStart?.(waitingHandler.controller, context)
|
|
184
|
+
} catch {
|
|
185
|
+
// Ignore errors from waiting handlers
|
|
186
|
+
waitingHandler.done = true
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
this.#pruneDoneWaitingHandlers()
|
|
191
|
+
}
|
|
149
192
|
this.#primaryHandler.onRequestStart?.(controller, context)
|
|
150
193
|
}
|
|
151
194
|
|
|
@@ -252,37 +295,40 @@ class DeduplicationHandler {
|
|
|
252
295
|
}
|
|
253
296
|
|
|
254
297
|
this.#completed = true
|
|
255
|
-
this
|
|
298
|
+
// Remove the completed request before callbacks can redispatch into this
|
|
299
|
+
// interceptor. Cleanup must not depend on downstream handlers succeeding.
|
|
300
|
+
this.#cleanup()
|
|
256
301
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
302
|
+
try {
|
|
303
|
+
this.#primaryHandler.onResponseEnd?.(controller, trailers)
|
|
304
|
+
} catch (err) {
|
|
305
|
+
// Completion callbacks may throw to initiate a retry. The transport's
|
|
306
|
+
// error callback would be ignored now that this handler is completed.
|
|
307
|
+
this.#primaryHandler.onResponseError?.(controller, err)
|
|
308
|
+
} finally {
|
|
309
|
+
for (const waitingHandler of this.#waitingHandlers) {
|
|
310
|
+
if (waitingHandler.done || waitingHandler.controller.aborted) {
|
|
311
|
+
waitingHandler.done = true
|
|
312
|
+
continue
|
|
313
|
+
}
|
|
262
314
|
|
|
263
|
-
|
|
315
|
+
this.#flushWaitingHandler(waitingHandler)
|
|
264
316
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
317
|
+
if (waitingHandler.done || waitingHandler.controller.aborted) {
|
|
318
|
+
waitingHandler.done = true
|
|
319
|
+
continue
|
|
320
|
+
}
|
|
269
321
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
322
|
+
if (waitingHandler.controller.paused) {
|
|
323
|
+
waitingHandler.pendingTrailers = trailers
|
|
324
|
+
continue
|
|
325
|
+
}
|
|
274
326
|
|
|
275
|
-
|
|
276
|
-
waitingHandler.handler.onResponseEnd?.(waitingHandler.controller, trailers)
|
|
277
|
-
} catch {
|
|
278
|
-
// Ignore errors from waiting handlers
|
|
327
|
+
this.#endWaitingHandler(waitingHandler, trailers)
|
|
279
328
|
}
|
|
280
329
|
|
|
281
|
-
|
|
330
|
+
this.#pruneDoneWaitingHandlers()
|
|
282
331
|
}
|
|
283
|
-
|
|
284
|
-
this.#pruneDoneWaitingHandlers()
|
|
285
|
-
this.#onComplete?.()
|
|
286
332
|
}
|
|
287
333
|
|
|
288
334
|
/**
|
|
@@ -296,15 +342,23 @@ class DeduplicationHandler {
|
|
|
296
342
|
|
|
297
343
|
this.#aborted = true
|
|
298
344
|
this.#completed = true
|
|
345
|
+
this.#cleanup()
|
|
299
346
|
|
|
300
|
-
|
|
347
|
+
try {
|
|
348
|
+
this.#primaryHandler.onResponseError?.(controller, err)
|
|
349
|
+
} finally {
|
|
350
|
+
for (const waitingHandler of this.#waitingHandlers) {
|
|
351
|
+
this.#errorWaitingHandler(waitingHandler, err)
|
|
352
|
+
}
|
|
301
353
|
|
|
302
|
-
|
|
303
|
-
this.#errorWaitingHandler(waitingHandler, err)
|
|
354
|
+
this.#waitingHandlers = []
|
|
304
355
|
}
|
|
356
|
+
}
|
|
305
357
|
|
|
306
|
-
|
|
307
|
-
this.#onComplete
|
|
358
|
+
#cleanup () {
|
|
359
|
+
const onComplete = this.#onComplete
|
|
360
|
+
this.#onComplete = null
|
|
361
|
+
onComplete?.()
|
|
308
362
|
}
|
|
309
363
|
|
|
310
364
|
/**
|
|
@@ -319,7 +373,8 @@ class DeduplicationHandler {
|
|
|
319
373
|
bufferedChunks: [],
|
|
320
374
|
bufferedBytes: 0,
|
|
321
375
|
pendingTrailers: null,
|
|
322
|
-
done: false
|
|
376
|
+
done: false,
|
|
377
|
+
pendingStart: false
|
|
323
378
|
}
|
|
324
379
|
|
|
325
380
|
const state = {
|
|
@@ -344,14 +399,7 @@ class DeduplicationHandler {
|
|
|
344
399
|
!state.paused &&
|
|
345
400
|
!state.aborted
|
|
346
401
|
) {
|
|
347
|
-
|
|
348
|
-
waitingHandler.handler.onResponseEnd?.(waitingHandler.controller, waitingHandler.pendingTrailers)
|
|
349
|
-
} catch {
|
|
350
|
-
// Ignore errors from waiting handlers
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
waitingHandler.pendingTrailers = null
|
|
354
|
-
waitingHandler.done = true
|
|
402
|
+
this.#endWaitingHandler(waitingHandler, waitingHandler.pendingTrailers)
|
|
355
403
|
}
|
|
356
404
|
|
|
357
405
|
this.#pruneDoneWaitingHandlers()
|
|
@@ -405,7 +453,7 @@ class DeduplicationHandler {
|
|
|
405
453
|
|
|
406
454
|
if (waitingHandler.bufferedBytes > this.#maxBufferSize) {
|
|
407
455
|
const err = new RequestAbortedError(`Deduplicated waiting handler exceeded maxBufferSize (${this.#maxBufferSize} bytes) while paused`)
|
|
408
|
-
|
|
456
|
+
waitingHandler.controller.abort(err)
|
|
409
457
|
}
|
|
410
458
|
}
|
|
411
459
|
|
|
@@ -440,6 +488,27 @@ class DeduplicationHandler {
|
|
|
440
488
|
}
|
|
441
489
|
}
|
|
442
490
|
|
|
491
|
+
/**
|
|
492
|
+
* @param {WaitingHandler} waitingHandler
|
|
493
|
+
* @param {object} trailers
|
|
494
|
+
*/
|
|
495
|
+
#endWaitingHandler (waitingHandler, trailers) {
|
|
496
|
+
waitingHandler.done = true
|
|
497
|
+
waitingHandler.pendingTrailers = null
|
|
498
|
+
|
|
499
|
+
try {
|
|
500
|
+
waitingHandler.handler.onResponseEnd?.(waitingHandler.controller, trailers)
|
|
501
|
+
} catch (err) {
|
|
502
|
+
// This is a response failure, not a consumer abort. Aborting the waiting
|
|
503
|
+
// controller here would prevent downstream handlers from retrying.
|
|
504
|
+
try {
|
|
505
|
+
waitingHandler.handler.onResponseError?.(waitingHandler.controller, err)
|
|
506
|
+
} catch {
|
|
507
|
+
// An error callback must not prevent other waiting handlers completing.
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
443
512
|
/**
|
|
444
513
|
* @param {WaitingHandler} waitingHandler
|
|
445
514
|
* @param {Error} err
|
|
@@ -454,8 +523,13 @@ class DeduplicationHandler {
|
|
|
454
523
|
waitingHandler.bufferedChunks = []
|
|
455
524
|
waitingHandler.bufferedBytes = 0
|
|
456
525
|
|
|
457
|
-
//
|
|
458
|
-
|
|
526
|
+
// A response failure is not a consumer abort: retry handlers must be able
|
|
527
|
+
// to retry it just as they would a failure of the primary request.
|
|
528
|
+
try {
|
|
529
|
+
waitingHandler.handler.onResponseError?.(waitingHandler.controller, err)
|
|
530
|
+
} catch {
|
|
531
|
+
// Ignore errors from waiting handlers
|
|
532
|
+
}
|
|
459
533
|
}
|
|
460
534
|
|
|
461
535
|
#pruneDoneWaitingHandlers () {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
const util = require('../core/util')
|
|
4
4
|
const assert = require('node:assert')
|
|
5
|
-
const { InvalidArgumentError } = require('../core/errors')
|
|
6
|
-
const { kRequestOrigin } = require('../core/symbols')
|
|
5
|
+
const { InvalidArgumentError, MaxRedirectsError } = require('../core/errors')
|
|
6
|
+
const { kRequestOrigin, kRedirectCacheControl } = require('../core/symbols')
|
|
7
7
|
|
|
8
8
|
const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
|
|
9
9
|
|
|
@@ -38,6 +38,15 @@ class RedirectHandler {
|
|
|
38
38
|
this.maxRedirections = maxRedirections
|
|
39
39
|
this.handler = handler
|
|
40
40
|
this.history = []
|
|
41
|
+
// `cache-control` of each intermediate (suppressed) redirect hop. An outer
|
|
42
|
+
// cache uses it to preserve a hop's storage policy (e.g. `no-store`) that
|
|
43
|
+
// would otherwise be lost because the hop's response is not forwarded. It
|
|
44
|
+
// travels as a non-enumerable property of the history array so it reaches
|
|
45
|
+
// the cache without becoming part of the public request/response context.
|
|
46
|
+
Object.defineProperty(this.history, kRedirectCacheControl, {
|
|
47
|
+
value: [],
|
|
48
|
+
enumerable: false
|
|
49
|
+
})
|
|
41
50
|
}
|
|
42
51
|
|
|
43
52
|
onRequestStart (controller, context) {
|
|
@@ -57,8 +66,9 @@ class RedirectHandler {
|
|
|
57
66
|
}
|
|
58
67
|
|
|
59
68
|
onResponseStart (controller, statusCode, headers, statusMessage) {
|
|
60
|
-
if (
|
|
61
|
-
|
|
69
|
+
if (statusCode < 200) {
|
|
70
|
+
this.handler.onResponseStart?.(controller, statusCode, headers, statusMessage)
|
|
71
|
+
return
|
|
62
72
|
}
|
|
63
73
|
|
|
64
74
|
let removeContentHeaders = statusCode === 303
|
|
@@ -86,9 +96,19 @@ class RedirectHandler {
|
|
|
86
96
|
this.opts.body = null
|
|
87
97
|
}
|
|
88
98
|
|
|
89
|
-
this.location =
|
|
99
|
+
this.location = util.isDisturbed(this.opts.body) || redirectableStatusCodes.indexOf(statusCode) === -1
|
|
90
100
|
? null
|
|
91
|
-
: headers.location
|
|
101
|
+
: headers.location || null
|
|
102
|
+
|
|
103
|
+
// Only a redirect that would otherwise be followed counts against the
|
|
104
|
+
// limit. The final response after exactly maxRedirections redirects, or a
|
|
105
|
+
// 3xx without a Location header, is delivered as usual.
|
|
106
|
+
if (this.location && this.history.length >= this.maxRedirections) {
|
|
107
|
+
if (this.opts.throwOnMaxRedirect) {
|
|
108
|
+
throw new MaxRedirectsError()
|
|
109
|
+
}
|
|
110
|
+
this.location = null
|
|
111
|
+
}
|
|
92
112
|
|
|
93
113
|
const requestOrigin = this.opts[kRequestOrigin] === undefined
|
|
94
114
|
? this.opts.origin
|
|
@@ -103,6 +123,11 @@ class RedirectHandler {
|
|
|
103
123
|
return
|
|
104
124
|
}
|
|
105
125
|
|
|
126
|
+
// This hop's response is suppressed (only its Location is used). Record its
|
|
127
|
+
// cache-control so an outer cache can honor a restrictive policy that would
|
|
128
|
+
// otherwise be lost when the final response is stored.
|
|
129
|
+
this.history[kRedirectCacheControl].push(headers['cache-control'])
|
|
130
|
+
|
|
106
131
|
const baseUrl = requestOrigin
|
|
107
132
|
? new URL(this.opts.path, requestOrigin)
|
|
108
133
|
: undefined
|