@psnext/slingcli 3.5.20261007-2 → 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/bin/sling-startup-output.js +47 -0
- package/bin/sling.js +29 -2
- 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-JPNA2XH6.js → chunk-23QDZLZG.js} +22 -16
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-4RGLMKVY.js → chunk-QPFSTNX5.js} +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{virtual-modules-SXTR3NIO.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/dist/modes/interactive/components/pi-logo.js +8 -0
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +6 -3
- package/node_modules/@earendil-works/pi-coding-agent/docs/mcp.md +1 -0
- 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 +214 -214
- 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/@esbuild/linux-x64/README.md +0 -3
- package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
- package/node_modules/@esbuild/linux-x64/package.json +0 -20
- package/node_modules/content-disposition/index.js +0 -536
- package/node_modules/esbuild/LICENSE.md +0 -21
- package/node_modules/esbuild/README.md +0 -3
- package/node_modules/esbuild/bin/esbuild +0 -0
- package/node_modules/esbuild/install.js +0 -300
- package/node_modules/esbuild/lib/main.d.ts +0 -720
- package/node_modules/esbuild/lib/main.js +0 -2536
- package/node_modules/esbuild/package.json +0 -74
- /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,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const { createInflate, createGunzip, createBrotliDecompress, createZstdDecompress } = require('node:zlib')
|
|
3
|
+
const { createInflate, createGunzip, createBrotliDecompress, createZstdDecompress, constants } = require('node:zlib')
|
|
4
4
|
const { pipeline, Transform: TransformStream } = require('node:stream')
|
|
5
5
|
const { InvalidArgumentError, ResponseExceededMaxSizeError } = require('../core/errors')
|
|
6
6
|
const DecoratorHandler = require('../handler/decorator-handler')
|
|
@@ -9,19 +9,77 @@ const DecoratorHandler = require('../handler/decorator-handler')
|
|
|
9
9
|
/** @typedef {import('node:stream').Transform} Controller */
|
|
10
10
|
/** @typedef {Transform&import('node:zlib').Zlib} DecompressorStream */
|
|
11
11
|
|
|
12
|
+
class DecompressController {
|
|
13
|
+
#onPause
|
|
14
|
+
#onResume
|
|
15
|
+
#onAbort
|
|
16
|
+
#paused = false
|
|
17
|
+
|
|
18
|
+
constructor (onPause, onResume, onAbort) {
|
|
19
|
+
this.#onPause = onPause
|
|
20
|
+
this.#onResume = onResume
|
|
21
|
+
this.#onAbort = onAbort
|
|
22
|
+
this.target = null
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
pause () {
|
|
26
|
+
if (this.#paused) {
|
|
27
|
+
return
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
this.#paused = true
|
|
31
|
+
this.#onPause()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
resume () {
|
|
35
|
+
if (!this.#paused) {
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
this.#paused = false
|
|
40
|
+
this.#onResume()
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
abort (reason) {
|
|
44
|
+
this.target?.abort(reason)
|
|
45
|
+
this.#onAbort(reason)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
get paused () { return this.#paused }
|
|
49
|
+
get aborted () { return this.target?.aborted ?? false }
|
|
50
|
+
get reason () { return this.target?.reason ?? null }
|
|
51
|
+
get rawHeaders () { return this.target?.rawHeaders ?? null }
|
|
52
|
+
set rawHeaders (value) {
|
|
53
|
+
if (this.target) {
|
|
54
|
+
this.target.rawHeaders = value
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get rawTrailers () { return this.target?.rawTrailers ?? null }
|
|
59
|
+
set rawTrailers (value) {
|
|
60
|
+
if (this.target) {
|
|
61
|
+
this.target.rawTrailers = value
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// `compress` and `x-compress` are deliberately absent. RFC 9110 section
|
|
67
|
+
// 8.4.1.1 defines them as the UNIX compress (LZW) format, which zlib cannot
|
|
68
|
+
// read, so inflating them turns a readable response into a Z_DATA_ERROR.
|
|
69
|
+
// fetch() leaves them alone, and so does this interceptor.
|
|
12
70
|
/** @type {Record<string, () => DecompressorStream>} */
|
|
13
71
|
const supportedEncodings = {
|
|
72
|
+
__proto__: null,
|
|
14
73
|
gzip: createGunzip,
|
|
15
74
|
'x-gzip': createGunzip,
|
|
16
75
|
br: createBrotliDecompress,
|
|
17
76
|
deflate: createInflate,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
zstd: createZstdDecompress
|
|
77
|
+
// https://www.rfc-editor.org/rfc/rfc9659.html#section-3
|
|
78
|
+
zstd: createZstdDecompress.bind(null, { params: { [constants.ZSTD_d_windowLogMax]: 23 } })
|
|
21
79
|
}
|
|
22
80
|
|
|
23
81
|
const defaultSkipStatusCodes = /** @type {const} */ ([204, 304])
|
|
24
|
-
const defaultMaxSize =
|
|
82
|
+
const defaultMaxSize = 0
|
|
25
83
|
|
|
26
84
|
/**
|
|
27
85
|
* Limits the output of one stage in a decompression chain.
|
|
@@ -53,7 +111,7 @@ let warningEmitted = /** @type {boolean} */ (false)
|
|
|
53
111
|
* @typedef {Object} DecompressHandlerOptions
|
|
54
112
|
* @property {number[]|Readonly<number[]>} [skipStatusCodes=[204, 304]] - List of status codes to skip decompression for
|
|
55
113
|
* @property {boolean} [skipErrorResponses] - Whether to skip decompression for error responses (status codes >= 400)
|
|
56
|
-
* @property {number} [maxSize=
|
|
114
|
+
* @property {number} [maxSize=0] - Maximum decompressed response size in bytes. 0 disables the limit
|
|
57
115
|
*/
|
|
58
116
|
|
|
59
117
|
class DecompressHandler extends DecoratorHandler {
|
|
@@ -73,16 +131,140 @@ class DecompressHandler extends DecoratorHandler {
|
|
|
73
131
|
#terminated = false
|
|
74
132
|
/** @type {boolean} */
|
|
75
133
|
#inputEnded = false
|
|
134
|
+
/** @type {boolean} */
|
|
135
|
+
#inputBackpressured = false
|
|
136
|
+
/** @type {boolean} */
|
|
137
|
+
#upstreamPaused = false
|
|
138
|
+
/** @type {boolean} */
|
|
139
|
+
#draining = false
|
|
140
|
+
/** @type {boolean} */
|
|
141
|
+
#drainRequested = false
|
|
142
|
+
/** @type {boolean} */
|
|
143
|
+
#completionPending = false
|
|
144
|
+
/** @type {DecompressorStream | undefined} */
|
|
145
|
+
#finalDecompressor
|
|
146
|
+
/** @type {DecompressController} */
|
|
147
|
+
#controller
|
|
76
148
|
|
|
77
149
|
constructor (handler, { skipStatusCodes = defaultSkipStatusCodes, skipErrorResponses = true, maxSize = defaultMaxSize } = {}) {
|
|
78
|
-
if (!Number.isSafeInteger(maxSize) || maxSize <
|
|
79
|
-
throw new InvalidArgumentError('maxSize must be a
|
|
150
|
+
if (!Number.isSafeInteger(maxSize) || maxSize < 0) {
|
|
151
|
+
throw new InvalidArgumentError('maxSize must be a non-negative integer')
|
|
80
152
|
}
|
|
81
153
|
|
|
82
154
|
super(handler)
|
|
83
155
|
this.#skipStatusCodes = skipStatusCodes
|
|
84
156
|
this.#skipErrorResponses = skipErrorResponses
|
|
85
157
|
this.#maxSize = maxSize
|
|
158
|
+
this.#controller = new DecompressController(
|
|
159
|
+
() => this.#onDownstreamPause(),
|
|
160
|
+
() => this.#onDownstreamResume(),
|
|
161
|
+
reason => {
|
|
162
|
+
if (this.#inputEnded && !this.#terminated) {
|
|
163
|
+
this.onResponseError(this.#controller, reason)
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
#onDownstreamPause () {
|
|
170
|
+
this.#pauseUpstream()
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
#onDownstreamResume () {
|
|
174
|
+
const drainWasDeferred = this.#draining
|
|
175
|
+
this.#drainOutput()
|
|
176
|
+
if (!drainWasDeferred) {
|
|
177
|
+
this.#resumeUpstreamIfNeeded()
|
|
178
|
+
this.#finishIfReady()
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
#pauseUpstream () {
|
|
183
|
+
if (!this.#upstreamPaused && !this.#terminated) {
|
|
184
|
+
this.#upstreamPaused = true
|
|
185
|
+
this.#controller.target?.pause()
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
#resumeUpstreamIfNeeded () {
|
|
190
|
+
if (this.#upstreamPaused && !this.#controller.paused && !this.#inputBackpressured) {
|
|
191
|
+
this.#upstreamPaused = false
|
|
192
|
+
if (!this.#inputEnded) {
|
|
193
|
+
this.#controller.target?.resume()
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
#drainOutput () {
|
|
199
|
+
if (this.#terminated || this.#controller.paused || !this.#finalDecompressor) {
|
|
200
|
+
return
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (this.#draining) {
|
|
204
|
+
this.#drainRequested = true
|
|
205
|
+
return
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
this.#draining = true
|
|
209
|
+
try {
|
|
210
|
+
do {
|
|
211
|
+
this.#drainRequested = false
|
|
212
|
+
let chunk
|
|
213
|
+
while (!this.#terminated && !this.#controller.paused && (chunk = this.#finalDecompressor.read()) !== null) {
|
|
214
|
+
if (this.#maxSize > 0) {
|
|
215
|
+
const decompressedSize = this.#decompressedSize + chunk.length
|
|
216
|
+
if (decompressedSize > this.#maxSize) {
|
|
217
|
+
this.#fail(new ResponseExceededMaxSizeError(
|
|
218
|
+
`Decompressed response size (${decompressedSize}) exceeded maxSize (${this.#maxSize})`
|
|
219
|
+
))
|
|
220
|
+
return
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
this.#decompressedSize = decompressedSize
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
try {
|
|
227
|
+
const result = super.onResponseData(this.#controller, chunk)
|
|
228
|
+
if (result === false && !this.#controller.paused) {
|
|
229
|
+
this.#controller.pause()
|
|
230
|
+
}
|
|
231
|
+
} catch (err) {
|
|
232
|
+
this.#fail(err)
|
|
233
|
+
return
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
} while (this.#drainRequested && !this.#terminated && !this.#controller.paused)
|
|
237
|
+
} finally {
|
|
238
|
+
this.#draining = false
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
this.#resumeUpstreamIfNeeded()
|
|
242
|
+
this.#finishIfReady()
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
#finishIfReady () {
|
|
246
|
+
if (this.#terminated || !this.#completionPending || this.#controller.paused || this.#draining) {
|
|
247
|
+
return
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
this.#cleanupDecompressors()
|
|
251
|
+
try {
|
|
252
|
+
super.onResponseEnd(this.#controller, this.#trailers)
|
|
253
|
+
} catch (err) {
|
|
254
|
+
this.#fail(err)
|
|
255
|
+
return
|
|
256
|
+
}
|
|
257
|
+
this.#terminated = true
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
#onDecompressionEnd () {
|
|
261
|
+
if (this.#terminated) {
|
|
262
|
+
return
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
this.#completionPending = true
|
|
266
|
+
this.#drainOutput()
|
|
267
|
+
this.#finishIfReady()
|
|
86
268
|
}
|
|
87
269
|
|
|
88
270
|
/**
|
|
@@ -138,7 +320,7 @@ class DecompressHandler extends DecoratorHandler {
|
|
|
138
320
|
const streams = []
|
|
139
321
|
for (let i = 0; i < decompressors.length; i++) {
|
|
140
322
|
streams.push(decompressors[i])
|
|
141
|
-
if (i < decompressors.length - 1) {
|
|
323
|
+
if (i < decompressors.length - 1 && this.#maxSize > 0) {
|
|
142
324
|
streams.push(createMaxSizeLimiter(this.#maxSize))
|
|
143
325
|
}
|
|
144
326
|
}
|
|
@@ -148,11 +330,10 @@ class DecompressHandler extends DecoratorHandler {
|
|
|
148
330
|
|
|
149
331
|
/**
|
|
150
332
|
* Stops decompression and reports an error.
|
|
151
|
-
* @param {Controller} controller - The controller to coordinate with
|
|
152
333
|
* @param {Error} error - The decompression error
|
|
153
334
|
* @returns {void}
|
|
154
335
|
*/
|
|
155
|
-
#fail (
|
|
336
|
+
#fail (error) {
|
|
156
337
|
if (this.#terminated) {
|
|
157
338
|
return
|
|
158
339
|
}
|
|
@@ -160,75 +341,41 @@ class DecompressHandler extends DecoratorHandler {
|
|
|
160
341
|
if (this.#inputEnded) {
|
|
161
342
|
// The request is already marked complete once the compressed input ends,
|
|
162
343
|
// so controller.abort() can no longer propagate decoder flush errors.
|
|
163
|
-
this.onResponseError(controller, error)
|
|
344
|
+
this.onResponseError(this.#controller, error)
|
|
164
345
|
} else {
|
|
165
|
-
controller.abort(error)
|
|
346
|
+
this.#controller.abort(error)
|
|
166
347
|
}
|
|
167
348
|
}
|
|
168
349
|
|
|
169
350
|
/**
|
|
170
|
-
* Sets up event handlers for
|
|
351
|
+
* Sets up event handlers for the final decompressor stream.
|
|
171
352
|
* @param {DecompressorStream} decompressor - The decompressor stream
|
|
172
|
-
* @param {Controller} controller - The controller to coordinate with
|
|
173
353
|
* @returns {void}
|
|
174
354
|
*/
|
|
175
|
-
#setupDecompressorEvents (decompressor
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
let chunk
|
|
182
|
-
while ((chunk = decompressor.read()) !== null) {
|
|
183
|
-
const decompressedSize = this.#decompressedSize + chunk.length
|
|
184
|
-
if (decompressedSize > this.#maxSize) {
|
|
185
|
-
this.#fail(controller, new ResponseExceededMaxSizeError(
|
|
186
|
-
`Decompressed response size (${decompressedSize}) exceeded maxSize (${this.#maxSize})`
|
|
187
|
-
))
|
|
188
|
-
return
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
this.#decompressedSize = decompressedSize
|
|
192
|
-
const result = super.onResponseData(controller, chunk)
|
|
193
|
-
if (result === false) {
|
|
194
|
-
break
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
})
|
|
198
|
-
|
|
199
|
-
decompressor.on('error', (error) => {
|
|
200
|
-
this.#fail(controller, error)
|
|
201
|
-
})
|
|
355
|
+
#setupDecompressorEvents (decompressor) {
|
|
356
|
+
this.#finalDecompressor = decompressor
|
|
357
|
+
decompressor.on('readable', () => this.#drainOutput())
|
|
358
|
+
decompressor.on('error', (error) => this.#fail(error))
|
|
202
359
|
}
|
|
203
360
|
|
|
204
361
|
/**
|
|
205
362
|
* Sets up event handling for a single decompressor
|
|
206
|
-
* @param {Controller} controller - The controller to handle events
|
|
207
363
|
* @returns {void}
|
|
208
364
|
*/
|
|
209
|
-
#setupSingleDecompressor (
|
|
365
|
+
#setupSingleDecompressor () {
|
|
210
366
|
const decompressor = this.#decompressors[0]
|
|
211
|
-
this.#setupDecompressorEvents(decompressor
|
|
367
|
+
this.#setupDecompressorEvents(decompressor)
|
|
212
368
|
|
|
213
|
-
decompressor.on('end', () =>
|
|
214
|
-
if (this.#terminated) {
|
|
215
|
-
return
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
this.#terminated = true
|
|
219
|
-
this.#cleanupDecompressors()
|
|
220
|
-
super.onResponseEnd(controller, this.#trailers)
|
|
221
|
-
})
|
|
369
|
+
decompressor.on('end', () => this.#onDecompressionEnd())
|
|
222
370
|
}
|
|
223
371
|
|
|
224
372
|
/**
|
|
225
373
|
* Sets up event handling for multiple chained decompressors using pipeline
|
|
226
|
-
* @param {Controller} controller - The controller to handle events
|
|
227
374
|
* @returns {void}
|
|
228
375
|
*/
|
|
229
|
-
#setupMultipleDecompressors (
|
|
376
|
+
#setupMultipleDecompressors () {
|
|
230
377
|
const lastDecompressor = this.#decompressors[this.#decompressors.length - 1]
|
|
231
|
-
this.#setupDecompressorEvents(lastDecompressor
|
|
378
|
+
this.#setupDecompressorEvents(lastDecompressor)
|
|
232
379
|
|
|
233
380
|
pipeline(this.#decompressors, (err) => {
|
|
234
381
|
if (this.#terminated) {
|
|
@@ -236,13 +383,26 @@ class DecompressHandler extends DecoratorHandler {
|
|
|
236
383
|
}
|
|
237
384
|
|
|
238
385
|
if (err) {
|
|
239
|
-
this.#fail(
|
|
386
|
+
this.#fail(err)
|
|
240
387
|
return
|
|
241
388
|
}
|
|
242
389
|
|
|
243
|
-
this.#
|
|
244
|
-
|
|
245
|
-
|
|
390
|
+
this.#onDecompressionEnd()
|
|
391
|
+
})
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
#setupInputBackpressure () {
|
|
395
|
+
const decompressor = this.#decompressors[0]
|
|
396
|
+
decompressor.on('drain', () => {
|
|
397
|
+
if (this.#terminated) {
|
|
398
|
+
return
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
this.#inputBackpressured = false
|
|
402
|
+
if (!this.#controller.paused) {
|
|
403
|
+
this.#drainOutput()
|
|
404
|
+
this.#resumeUpstreamIfNeeded()
|
|
405
|
+
}
|
|
246
406
|
})
|
|
247
407
|
}
|
|
248
408
|
|
|
@@ -252,6 +412,16 @@ class DecompressHandler extends DecoratorHandler {
|
|
|
252
412
|
*/
|
|
253
413
|
#cleanupDecompressors () {
|
|
254
414
|
this.#decompressors.length = 0
|
|
415
|
+
this.#finalDecompressor = undefined
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
onRequestStart (controller, context) {
|
|
419
|
+
this.#controller.target = controller
|
|
420
|
+
return super.onRequestStart(this.#controller, context)
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
onRequestUpgrade (controller, statusCode, headers, socket) {
|
|
424
|
+
return super.onRequestUpgrade(this.#controller, statusCode, headers, socket)
|
|
255
425
|
}
|
|
256
426
|
|
|
257
427
|
/**
|
|
@@ -262,18 +432,24 @@ class DecompressHandler extends DecoratorHandler {
|
|
|
262
432
|
* @returns {void}
|
|
263
433
|
*/
|
|
264
434
|
onResponseStart (controller, statusCode, headers, statusMessage) {
|
|
265
|
-
|
|
435
|
+
// Repeated field lines reach us as an array. RFC 9110 section 5.3 lets a
|
|
436
|
+
// recipient join them with commas, which yields the single-line form the
|
|
437
|
+
// decompression chain already handles.
|
|
438
|
+
const rawContentEncoding = headers['content-encoding']
|
|
439
|
+
const contentEncoding = Array.isArray(rawContentEncoding)
|
|
440
|
+
? rawContentEncoding.join(',')
|
|
441
|
+
: rawContentEncoding
|
|
266
442
|
|
|
267
443
|
// If content encoding is not supported or status code is in skip list
|
|
268
444
|
if (this.#shouldSkipDecompression(contentEncoding, statusCode)) {
|
|
269
|
-
return super.onResponseStart(controller, statusCode, headers, statusMessage)
|
|
445
|
+
return super.onResponseStart(this.#controller, statusCode, headers, statusMessage)
|
|
270
446
|
}
|
|
271
447
|
|
|
272
448
|
const decompressors = this.#createDecompressionChain(contentEncoding.toLowerCase())
|
|
273
449
|
|
|
274
450
|
if (decompressors.length === 0) {
|
|
275
451
|
this.#cleanupDecompressors()
|
|
276
|
-
return super.onResponseStart(controller, statusCode, headers, statusMessage)
|
|
452
|
+
return super.onResponseStart(this.#controller, statusCode, headers, statusMessage)
|
|
277
453
|
}
|
|
278
454
|
|
|
279
455
|
this.#decompressors = decompressors
|
|
@@ -281,8 +457,8 @@ class DecompressHandler extends DecoratorHandler {
|
|
|
281
457
|
// Remove compression headers since we're decompressing
|
|
282
458
|
const { 'content-encoding': _, 'content-length': __, ...newHeaders } = headers
|
|
283
459
|
|
|
284
|
-
if (controller
|
|
285
|
-
const rawHeaders = controller.rawHeaders
|
|
460
|
+
if (this.#controller.rawHeaders) {
|
|
461
|
+
const rawHeaders = this.#controller.rawHeaders
|
|
286
462
|
|
|
287
463
|
if (Array.isArray(rawHeaders)) {
|
|
288
464
|
const filteredHeaders = []
|
|
@@ -308,13 +484,14 @@ class DecompressHandler extends DecoratorHandler {
|
|
|
308
484
|
}
|
|
309
485
|
}
|
|
310
486
|
|
|
487
|
+
this.#setupInputBackpressure()
|
|
311
488
|
if (this.#decompressors.length === 1) {
|
|
312
|
-
this.#setupSingleDecompressor(
|
|
489
|
+
this.#setupSingleDecompressor()
|
|
313
490
|
} else {
|
|
314
|
-
this.#setupMultipleDecompressors(
|
|
491
|
+
this.#setupMultipleDecompressors()
|
|
315
492
|
}
|
|
316
493
|
|
|
317
|
-
return super.onResponseStart(controller, statusCode, newHeaders, statusMessage)
|
|
494
|
+
return super.onResponseStart(this.#controller, statusCode, newHeaders, statusMessage)
|
|
318
495
|
}
|
|
319
496
|
|
|
320
497
|
/**
|
|
@@ -324,10 +501,13 @@ class DecompressHandler extends DecoratorHandler {
|
|
|
324
501
|
*/
|
|
325
502
|
onResponseData (controller, chunk) {
|
|
326
503
|
if (this.#decompressors.length > 0) {
|
|
327
|
-
this.#decompressors[0].write(chunk)
|
|
504
|
+
if (!this.#decompressors[0].write(chunk)) {
|
|
505
|
+
this.#inputBackpressured = true
|
|
506
|
+
this.#pauseUpstream()
|
|
507
|
+
}
|
|
328
508
|
return
|
|
329
509
|
}
|
|
330
|
-
super.onResponseData(controller, chunk)
|
|
510
|
+
return super.onResponseData(this.#controller, chunk)
|
|
331
511
|
}
|
|
332
512
|
|
|
333
513
|
/**
|
|
@@ -342,7 +522,7 @@ class DecompressHandler extends DecoratorHandler {
|
|
|
342
522
|
this.#decompressors[0].end()
|
|
343
523
|
return
|
|
344
524
|
}
|
|
345
|
-
super.onResponseEnd(controller, trailers)
|
|
525
|
+
return super.onResponseEnd(this.#controller, trailers)
|
|
346
526
|
}
|
|
347
527
|
|
|
348
528
|
/**
|
|
@@ -360,7 +540,7 @@ class DecompressHandler extends DecoratorHandler {
|
|
|
360
540
|
decompressor.destroy()
|
|
361
541
|
}
|
|
362
542
|
this.#cleanupDecompressors()
|
|
363
|
-
super.onResponseError(controller, err)
|
|
543
|
+
super.onResponseError(this.#controller, err)
|
|
364
544
|
}
|
|
365
545
|
}
|
|
366
546
|
|
package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dns.js
CHANGED
|
@@ -190,6 +190,16 @@ class DNSInstance {
|
|
|
190
190
|
newOpts.affinity
|
|
191
191
|
)
|
|
192
192
|
|
|
193
|
+
// The lookup succeeded, but nothing it returned is usable here: with
|
|
194
|
+
// dualStack disabled and an affinity set, records of the other family
|
|
195
|
+
// cannot be picked. Running the lookup again would return the same
|
|
196
|
+
// records, so report it the way an empty result is reported.
|
|
197
|
+
if (ip == null) {
|
|
198
|
+
this.storage.delete(origin.hostname)
|
|
199
|
+
cb(new InformationalError('No DNS entries found'))
|
|
200
|
+
return
|
|
201
|
+
}
|
|
202
|
+
|
|
193
203
|
let port
|
|
194
204
|
if (typeof ip.port === 'number') {
|
|
195
205
|
port = `:${ip.port}`
|
|
@@ -346,6 +356,7 @@ class DNSInstance {
|
|
|
346
356
|
// We delete expired records
|
|
347
357
|
// It is possible that they have different TTL, so we manage them individually
|
|
348
358
|
family.ips.splice(position, 1)
|
|
359
|
+
return this.pickFamily(origin, ipFamily)
|
|
349
360
|
}
|
|
350
361
|
|
|
351
362
|
return ip
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
// const { parseHeaders } = require('../core/util')
|
|
4
4
|
const DecoratorHandler = require('../handler/decorator-handler')
|
|
5
|
-
const { ResponseError } = require('../core/errors')
|
|
5
|
+
const { InvalidArgumentError, ResponseError } = require('../core/errors')
|
|
6
|
+
|
|
7
|
+
const defaultMaxSize = 1024 * 1024
|
|
6
8
|
|
|
7
9
|
class ResponseErrorHandler extends DecoratorHandler {
|
|
8
10
|
#statusCode
|
|
@@ -10,9 +12,13 @@ class ResponseErrorHandler extends DecoratorHandler {
|
|
|
10
12
|
#decoder
|
|
11
13
|
#headers
|
|
12
14
|
#body
|
|
15
|
+
#bodySize
|
|
16
|
+
#bodyTruncated
|
|
17
|
+
#maxSize
|
|
13
18
|
|
|
14
|
-
constructor (
|
|
19
|
+
constructor ({ maxSize }, { handler }) {
|
|
15
20
|
super(handler)
|
|
21
|
+
this.#maxSize = maxSize
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
#checkContentType (contentType) {
|
|
@@ -25,6 +31,8 @@ class ResponseErrorHandler extends DecoratorHandler {
|
|
|
25
31
|
this.#decoder = null
|
|
26
32
|
this.#headers = null
|
|
27
33
|
this.#body = ''
|
|
34
|
+
this.#bodySize = 0
|
|
35
|
+
this.#bodyTruncated = false
|
|
28
36
|
|
|
29
37
|
return super.onRequestStart(controller, context)
|
|
30
38
|
}
|
|
@@ -43,39 +51,69 @@ class ResponseErrorHandler extends DecoratorHandler {
|
|
|
43
51
|
}
|
|
44
52
|
}
|
|
45
53
|
|
|
54
|
+
#createResponseError () {
|
|
55
|
+
this.#body += this.#decoder?.decode(undefined, { stream: false }) ?? ''
|
|
56
|
+
this.#decoder = null
|
|
57
|
+
|
|
58
|
+
if (!this.#bodyTruncated && this.#checkContentType('application/json')) {
|
|
59
|
+
try {
|
|
60
|
+
this.#body = JSON.parse(this.#body)
|
|
61
|
+
} catch {
|
|
62
|
+
// Do nothing...
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
let err
|
|
67
|
+
const stackTraceLimit = Error.stackTraceLimit
|
|
68
|
+
Error.stackTraceLimit = 0
|
|
69
|
+
try {
|
|
70
|
+
err = new ResponseError('Response Error', this.#statusCode, {
|
|
71
|
+
body: this.#body,
|
|
72
|
+
bodyTruncated: this.#bodyTruncated,
|
|
73
|
+
headers: this.#headers
|
|
74
|
+
})
|
|
75
|
+
} finally {
|
|
76
|
+
Error.stackTraceLimit = stackTraceLimit
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return err
|
|
80
|
+
}
|
|
81
|
+
|
|
46
82
|
onResponseData (controller, chunk) {
|
|
47
83
|
if (this.#statusCode < 400) {
|
|
48
84
|
return super.onResponseData(controller, chunk)
|
|
49
85
|
}
|
|
50
86
|
|
|
51
|
-
|
|
87
|
+
if (this.#decoder == null) {
|
|
88
|
+
return
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (this.#maxSize === 0) {
|
|
92
|
+
this.#body += this.#decoder.decode(chunk, { stream: true })
|
|
93
|
+
return
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const remaining = this.#maxSize - this.#bodySize
|
|
97
|
+
|
|
98
|
+
if (chunk.length <= remaining) {
|
|
99
|
+
this.#bodySize += chunk.length
|
|
100
|
+
this.#body += this.#decoder.decode(chunk, { stream: true })
|
|
101
|
+
return
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (remaining > 0) {
|
|
105
|
+
this.#body += this.#decoder.decode(chunk.subarray(0, remaining), { stream: true })
|
|
106
|
+
this.#bodySize = this.#maxSize
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
this.#bodyTruncated = true
|
|
110
|
+
this.#body += this.#decoder.decode(undefined, { stream: false })
|
|
111
|
+
this.#decoder = null
|
|
52
112
|
}
|
|
53
113
|
|
|
54
114
|
onResponseEnd (controller, trailers) {
|
|
55
115
|
if (this.#statusCode >= 400) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (this.#checkContentType('application/json')) {
|
|
59
|
-
try {
|
|
60
|
-
this.#body = JSON.parse(this.#body)
|
|
61
|
-
} catch {
|
|
62
|
-
// Do nothing...
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
let err
|
|
67
|
-
const stackTraceLimit = Error.stackTraceLimit
|
|
68
|
-
Error.stackTraceLimit = 0
|
|
69
|
-
try {
|
|
70
|
-
err = new ResponseError('Response Error', this.#statusCode, {
|
|
71
|
-
body: this.#body,
|
|
72
|
-
headers: this.#headers
|
|
73
|
-
})
|
|
74
|
-
} finally {
|
|
75
|
-
Error.stackTraceLimit = stackTraceLimit
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
super.onResponseError(controller, err)
|
|
116
|
+
super.onResponseError(controller, this.#createResponseError())
|
|
79
117
|
} else {
|
|
80
118
|
super.onResponseEnd(controller, trailers)
|
|
81
119
|
}
|
|
@@ -86,10 +124,16 @@ class ResponseErrorHandler extends DecoratorHandler {
|
|
|
86
124
|
}
|
|
87
125
|
}
|
|
88
126
|
|
|
89
|
-
module.exports = () => {
|
|
127
|
+
module.exports = (opts = {}) => {
|
|
128
|
+
const { maxSize = defaultMaxSize } = opts
|
|
129
|
+
|
|
130
|
+
if (!Number.isSafeInteger(maxSize) || maxSize < 0) {
|
|
131
|
+
throw new InvalidArgumentError('maxSize must be a non-negative integer')
|
|
132
|
+
}
|
|
133
|
+
|
|
90
134
|
return (dispatch) => {
|
|
91
135
|
return function Intercept (opts, handler) {
|
|
92
|
-
return dispatch(opts, new ResponseErrorHandler(
|
|
136
|
+
return dispatch(opts, new ResponseErrorHandler({ maxSize }, { handler }))
|
|
93
137
|
}
|
|
94
138
|
}
|
|
95
139
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023, and above Paolo Insogna, NearForm and other contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|