@openclaw/cloudflare 2026.11.7 → 2026.11.10-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/dist/.source-module-urls/25ffb9dc262288443a3b3cbbb6080a9aa7ed6d4c205a4189dd4bf02a581c7e07.json +1 -1
  2. package/dist/api.js +1 -2
  3. package/dist/index.js +1 -2
  4. package/dist/runtime-api.js +1 -2
  5. package/dist/s3-backend.js +1 -2
  6. package/dist/settings.js +1 -2
  7. package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +1 -1
  8. package/node_modules/@aws-sdk/client-s3/dist-types/S3Client.d.ts +2 -1
  9. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-cjs/submodules/flexible-checksums/index.js +2 -1
  10. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-cjs/submodules/sha/index.js +464 -40
  11. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-cjs/submodules/xxh/index.js +914 -0
  12. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-es/submodules/flexible-checksums/stringUnionSelector.js +2 -1
  13. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/index.browser.js +2 -0
  14. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/index.js +3 -0
  15. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/sha512/Sha512.js +71 -0
  16. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/sha512/Sha512Js.js +276 -0
  17. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-es/submodules/sha/sha512/Sha512WebCrypto.js +76 -0
  18. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/U64.js +190 -0
  19. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/Xxh3.js +274 -0
  20. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/index.js +3 -0
  21. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/xxhash3_128/Xxh3_128.js +179 -0
  22. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/xxhash3_64/Xxh3_64.js +117 -0
  23. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-es/submodules/xxh/xxhash64/Xxh64.js +150 -0
  24. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/index.browser.d.ts +2 -0
  25. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/index.d.ts +3 -0
  26. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/sha512/Sha512.d.ts +17 -0
  27. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/sha512/Sha512Js.d.ts +29 -0
  28. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/submodules/sha/sha512/Sha512WebCrypto.d.ts +22 -0
  29. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/U64.d.ts +110 -0
  30. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/Xxh3.d.ts +139 -0
  31. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/index.d.ts +3 -0
  32. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/xxhash3_128/Xxh3_128.d.ts +37 -0
  33. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/xxhash3_64/Xxh3_64.d.ts +27 -0
  34. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/submodules/xxh/xxhash64/Xxh64.d.ts +41 -0
  35. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/index.browser.d.ts +2 -0
  36. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/index.d.ts +3 -0
  37. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/sha512/Sha512.d.ts +12 -0
  38. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/sha512/Sha512Js.d.ts +22 -0
  39. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/sha/sha512/Sha512WebCrypto.d.ts +14 -0
  40. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/U64.d.ts +27 -0
  41. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/Xxh3.d.ts +65 -0
  42. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/index.d.ts +3 -0
  43. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/xxhash3_128/Xxh3_128.d.ts +12 -0
  44. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/xxhash3_64/Xxh3_64.d.ts +10 -0
  45. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/dist-types/ts3.4/submodules/xxh/xxhash64/Xxh64.d.ts +17 -0
  46. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/package.json +15 -5
  47. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/xxh.d.ts +5 -0
  48. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/checksums/xxh.js +5 -0
  49. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +26 -13
  50. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +7 -7
  51. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +51 -1
  52. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +2 -1
  53. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js +4 -2
  54. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/parseArn.js +4 -2
  55. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.js +18 -9
  56. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js +6 -3
  57. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js +1 -4
  58. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +1 -0
  59. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.js +51 -0
  60. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-es/submodules/util/util-arn-parser/arn.js +2 -1
  61. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +3 -7
  62. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +1 -0
  63. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.d.ts +25 -0
  64. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +1 -0
  65. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.d.ts +36 -0
  66. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core/package.json +5 -5
  67. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-env/package.json +4 -4
  68. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-http/package.json +5 -5
  69. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-ini/package.json +11 -11
  70. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-login/package.json +5 -5
  71. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
  72. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-process/package.json +4 -4
  73. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-sso/package.json +6 -6
  74. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-web-identity/package.json +5 -5
  75. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/submodules/s3/index.js +34 -16
  76. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/submodules/s3-control/index.js +6 -3
  77. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3/middleware-bucket-endpoint/bucketHostnameUtils.js +6 -3
  78. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityCache.js +8 -4
  79. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityProviderImpl.js +18 -8
  80. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3/middleware-ssec/middleware-ssec.js +2 -1
  81. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3-control/middleware-process-arnables/parse-outpost-arnables.js +4 -2
  82. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3-control/middleware-redirect-from-postid/redirect-from-postid.js +2 -1
  83. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityCache.d.ts +1 -0
  84. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityProviderImpl.d.ts +3 -1
  85. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/ts3.4/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityCache.d.ts +1 -0
  86. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/ts3.4/submodules/s3/middleware-s3-express/classes/S3ExpressIdentityProviderImpl.d.ts +3 -1
  87. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-sdk-s3/package.json +5 -5
  88. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  89. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +8 -1
  90. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  91. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  92. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  93. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/enums.js +7 -0
  94. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/CognitoIdentityClient.d.ts +2 -1
  95. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/Signin.d.ts +1 -2
  96. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/SigninClient.d.ts +3 -3
  97. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/commands/CreateOAuth2TokenCommand.d.ts +5 -59
  98. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/commands/CreateOAuth2TokenWithIAMCommand.d.ts +5 -33
  99. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/index.d.ts +1 -2
  100. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/enums.d.ts +16 -9
  101. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/errors.d.ts +8 -39
  102. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/models_0.d.ts +36 -48
  103. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/SSOClient.d.ts +2 -1
  104. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/SSOOIDCClient.d.ts +2 -1
  105. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/STSClient.d.ts +2 -1
  106. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/enums.d.ts +7 -0
  107. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/nested-clients/package.json +6 -6
  108. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region/package.json +3 -3
  109. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/token-providers/package.json +5 -5
  110. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/types/dist-types/feature-ids.d.ts +3 -0
  111. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/types/dist-types/ts3.4/feature-ids.d.ts +3 -0
  112. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/types/package.json +1 -1
  113. package/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/xml-builder/package.json +1 -1
  114. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/CHANGELOG.md +37 -0
  115. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/index.js +4 -2
  116. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +45 -53
  117. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +51 -19
  118. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/submodules/config/index.browser.js +8 -4
  119. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +16 -8
  120. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/submodules/config/index.native.js +8 -4
  121. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +2 -1
  122. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +10 -5
  123. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +28 -9
  124. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +28 -9
  125. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +91 -58
  126. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +20 -10
  127. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +24 -12
  128. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +13 -4
  129. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +7 -1
  130. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +13 -4
  131. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +6 -3
  132. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js +2 -1
  133. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/normalizeProvider.js +2 -1
  134. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +12 -37
  135. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +8 -4
  136. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +6 -3
  137. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +12 -6
  138. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +4 -2
  139. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +2 -1
  140. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/client/middleware-stack/MiddlewareStack.js +10 -5
  141. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js +16 -2
  142. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/create-aggregated-client.js +2 -1
  143. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js +4 -2
  144. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/checksum.js +2 -1
  145. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/get-value-from-text-node.js +2 -1
  146. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/object-mapping.js +4 -2
  147. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/schemaLogFilter.js +10 -4
  148. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/serde-json.js +2 -1
  149. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getHomeDir.js +8 -4
  150. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/booleanSelector.js +6 -3
  151. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/numberSelector.js +2 -1
  152. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.js +8 -4
  153. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/resolveEndpoint.js +2 -1
  154. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +6 -3
  155. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +12 -1
  156. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js +2 -1
  157. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.js +2 -1
  158. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde/utils.js +2 -1
  159. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.js +4 -2
  160. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/protocols/AbstractRpcV2Protocol.js +35 -0
  161. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +8 -4
  162. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +4 -2
  163. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +6 -2
  164. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/protocols/index.js +1 -0
  165. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/protocols/json/SmithyRpcV2JsonProtocol.js +8 -31
  166. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js +7 -5
  167. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js +7 -5
  168. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js +7 -5
  169. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +11 -8
  170. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js +3 -0
  171. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js +4 -2
  172. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js +2 -1
  173. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retry-pre-sra-deprecated/StandardRetryStrategy.js +6 -3
  174. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js +6 -3
  175. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/util.js +6 -3
  176. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/serde/index.browser.js +1 -0
  177. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/serde/index.js +1 -0
  178. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/serde/index.native.js +1 -0
  179. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js +2 -1
  180. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/serde/util-body-length/calculateBodyLength.browser.js +6 -3
  181. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/transport/httpResponse.js +2 -1
  182. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/transport/normalizeProvider.js +2 -1
  183. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/transport/toEndpointV1.js +2 -1
  184. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +5 -14
  185. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/submodules/protocols/AbstractRpcV2Protocol.d.ts +45 -0
  186. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/submodules/protocols/RpcProtocol.d.ts +12 -0
  187. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/submodules/protocols/index.d.ts +1 -0
  188. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +5 -14
  189. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +1 -0
  190. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/submodules/serde/index.browser.d.ts +1 -0
  191. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +1 -0
  192. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/submodules/serde/index.native.d.ts +1 -0
  193. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +5 -14
  194. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/AbstractRpcV2Protocol.d.ts +45 -0
  195. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/RpcProtocol.d.ts +12 -0
  196. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/index.d.ts +1 -0
  197. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +5 -14
  198. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +1 -0
  199. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.browser.d.ts +1 -0
  200. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.d.ts +1 -0
  201. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.native.d.ts +1 -0
  202. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/package.json +1 -1
  203. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/node-http-handler/CHANGELOG.md +33 -0
  204. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/node-http-handler/dist-cjs/index.js +70 -15
  205. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +2 -1
  206. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +23 -9
  207. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +26 -2
  208. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/node-http-handler/dist-es/resolve-default-socket-timeout.js +4 -0
  209. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +16 -3
  210. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/node-http-handler/dist-types/resolve-default-socket-timeout.d.ts +4 -0
  211. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +6 -1
  212. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/node-http-handler/dist-types/ts3.4/resolve-default-socket-timeout.d.ts +4 -0
  213. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +6 -1
  214. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/node-http-handler/package.json +3 -3
  215. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/signature-v4/CHANGELOG.md +9 -0
  216. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/signature-v4/dist-cjs/index.js +23 -11
  217. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +4 -2
  218. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js +4 -2
  219. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js +5 -1
  220. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js +2 -1
  221. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js +2 -1
  222. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/signature-v4/dist-es/headerUtil.js +6 -3
  223. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js +2 -1
  224. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js +2 -1
  225. package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/signature-v4/package.json +2 -2
  226. package/node_modules/@aws-sdk/client-s3/package.json +11 -11
  227. package/package.json +5 -5
  228. /package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-es/submodules/{protocols → serde}/writeKey.js +0 -0
  229. /package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/submodules/{protocols → serde}/writeKey.d.ts +0 -0
  230. /package/node_modules/@aws-sdk/client-s3/node_modules/@smithy/core/dist-types/ts3.4/submodules/{protocols → serde}/writeKey.d.ts +0 -0
@@ -40,3 +40,4 @@ export { streamCollector } from "./util-stream/stream-collector.browser";
40
40
  export declare const v4: () => string;
41
41
  export declare const generateIdempotencyToken: () => string;
42
42
  export { hasOwn } from "@smithy/core/transport";
43
+ export { writeKey } from "./writeKey";
@@ -38,3 +38,4 @@ export { streamCollector } from "./util-stream/stream-collector";
38
38
  export declare const v4: () => string;
39
39
  export declare const generateIdempotencyToken: () => string;
40
40
  export { hasOwn } from "@smithy/core/transport";
41
+ export { writeKey } from "./writeKey";
@@ -38,3 +38,4 @@ export { streamCollector } from "./util-stream/stream-collector.browser";
38
38
  export declare const v4: () => string;
39
39
  export declare const generateIdempotencyToken: () => string;
40
40
  export { hasOwn } from "@smithy/core/transport";
41
+ export { writeKey } from "./writeKey";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/core",
3
- "version": "3.36.0",
3
+ "version": "3.38.1",
4
4
  "homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/core",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -1,5 +1,38 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.14.1
4
+
5
+ ### Patch Changes
6
+
7
+ - fe13e99: Create one http.Agent for concurrent first requests so destroy() closes every socket.
8
+ - Updated dependencies [6871574]
9
+ - @smithy/core@3.38.1
10
+
11
+ ## 4.14.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 6f250ec: Let clients offer a service default idle timeout to the request handler through updateHttpClientConfig, taken only when the handler has none of its own.
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [6f250ec]
20
+ - Updated dependencies [0f58fed]
21
+ - @smithy/core@3.38.0
22
+
23
+ ## 4.13.0
24
+
25
+ ### Minor Changes
26
+
27
+ - ac9ae43: Let NodeHttpHandler and NodeHttp2Handler apply a service default idle timeout on their own timers, leaving socketTimeout and requestTimeout unchanged.
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies [a90c7be]
32
+ - Updated dependencies [a90c7be]
33
+ - Updated dependencies [a90c7be]
34
+ - @smithy/core@3.37.0
35
+
3
36
  ## 4.12.1
4
37
 
5
38
  ### Patch Changes
@@ -31,8 +31,9 @@ const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"];
31
31
  const getTransformedHeaders = (headers) => {
32
32
  const transformedHeaders = {};
33
33
  for (const name in headers) {
34
- if (!hasOwn(headers, name))
34
+ if (!hasOwn(headers, name)) {
35
35
  continue;
36
+ }
36
37
  const headerValues = headers[name];
37
38
  transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
38
39
  }
@@ -123,13 +124,26 @@ const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }, deferTimeMs
123
124
  return timing.setTimeout(registerListener, deferTimeMs);
124
125
  };
125
126
 
127
+ const resolveDefaultSocketTimeout = (config) => {
128
+ const value = config?.defaultSocketTimeout;
129
+ return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : undefined;
130
+ };
131
+
126
132
  const DEFER_EVENT_LISTENER_TIME = 3000;
127
- const setSocketTimeout = (request, reject, timeoutInMs = 0) => {
133
+ const setSocketTimeout = (request, reject, timeoutInMs = 0, destroyResponseBodyOnTimeout = false) => {
134
+ let response;
135
+ if (destroyResponseBodyOnTimeout) {
136
+ request.once("response", (res) => (response = res));
137
+ }
128
138
  const registerTimeout = (offset) => {
129
139
  const timeout = timeoutInMs - offset;
130
140
  const onTimeout = () => {
141
+ const error = Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (${destroyResponseBodyOnTimeout ? "service default socket timeout" : "configured by client requestHandler"}).`), { name: "TimeoutError" });
142
+ if (destroyResponseBodyOnTimeout) {
143
+ response?.destroy(error);
144
+ }
131
145
  request.destroy();
132
- reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`), { name: "TimeoutError" }));
146
+ reject(error);
133
147
  };
134
148
  if (request.socket) {
135
149
  request.socket.setTimeout(timeout, onTimeout);
@@ -143,7 +157,12 @@ const setSocketTimeout = (request, reject, timeoutInMs = 0) => {
143
157
  registerTimeout(0);
144
158
  return 0;
145
159
  }
146
- return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME);
160
+ const deferralId = timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME);
161
+ if (destroyResponseBodyOnTimeout) {
162
+ request.once("close", () => timing.clearTimeout(deferralId));
163
+ return 0;
164
+ }
165
+ return deferralId;
147
166
  };
148
167
 
149
168
  const MIN_WAIT_TIME = 6_000;
@@ -234,8 +253,9 @@ class NodeHttpHandler {
234
253
  }
235
254
  if (sockets && requests) {
236
255
  for (const origin in sockets) {
237
- if (!hasOwn(sockets, origin))
256
+ if (!hasOwn(sockets, origin)) {
238
257
  continue;
258
+ }
239
259
  const socketsInUse = sockets[origin]?.length ?? 0;
240
260
  const requestsEnqueued = requests[origin]?.length ?? 0;
241
261
  if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
@@ -383,7 +403,13 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
383
403
  const effectiveRequestTimeout = requestTimeout ?? config.requestTimeout;
384
404
  connectionTimeoutId = setConnectionTimeout(req, reject, config.connectionTimeout);
385
405
  requestTimeoutId = setRequestTimeout(req, reject, effectiveRequestTimeout, config.throwOnRequestTimeout, logger ?? console);
386
- socketTimeoutId = setSocketTimeout(req, reject, config.socketTimeout);
406
+ const defaultSocketTimeout = config.socketTimeout === undefined ? resolveDefaultSocketTimeout(config) : undefined;
407
+ if (defaultSocketTimeout) {
408
+ socketTimeoutId = setSocketTimeout(req, reject, defaultSocketTimeout, true);
409
+ }
410
+ else {
411
+ socketTimeoutId = setSocketTimeout(req, reject, config.socketTimeout);
412
+ }
387
413
  const httpAgent = nodeHttpsOptions.agent;
388
414
  if (typeof httpAgent === "object" && "keepAlive" in httpAgent) {
389
415
  keepAliveTimeoutId = setSocketKeepAlive(req, {
@@ -400,11 +426,15 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
400
426
  updateHttpClientConfig(key, value) {
401
427
  this.config = undefined;
402
428
  this.configProvider = this.configProvider.then((config) => {
403
- if (key === Symbol.for("logger")) {
404
- return {
405
- ...config,
406
- logger: config.logger ?? value,
407
- };
429
+ switch (key) {
430
+ case Symbol.for("logger"):
431
+ key = "logger";
432
+ value = config.logger ?? value;
433
+ break;
434
+ case Symbol.for("@smithy/defaultSocketTimeout"):
435
+ key = "defaultSocketTimeout";
436
+ value = resolveDefaultSocketTimeout(config) ?? value;
437
+ break;
408
438
  }
409
439
  return {
410
440
  ...config,
@@ -419,13 +449,15 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
419
449
  const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, logger, } = options || {};
420
450
  const keepAlive = true;
421
451
  const maxSockets = 50;
452
+ let httpAgentPromise;
422
453
  return {
423
454
  connectionTimeout,
424
455
  requestTimeout,
425
456
  socketTimeout,
457
+ defaultSocketTimeout: resolveDefaultSocketTimeout(options),
426
458
  socketAcquisitionWarningTimeout,
427
459
  throwOnRequestTimeout,
428
- httpAgentProvider: async () => {
460
+ httpAgentProvider: () => (httpAgentPromise ??= (async () => {
429
461
  const node_http = require('node:http');
430
462
  const { Agent, request } = node_http.default ?? node_http;
431
463
  hRequest = request;
@@ -435,7 +467,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
435
467
  return httpAgent;
436
468
  }
437
469
  return new hAgent({ keepAlive, maxSockets, ...httpAgent });
438
- },
470
+ })()),
439
471
  httpsAgent: (() => {
440
472
  if (httpsAgent instanceof node_https.Agent || typeof httpsAgent?.destroy === "function") {
441
473
  this.externalAgent = true;
@@ -710,7 +742,8 @@ class NodeHttp2Handler {
710
742
  }
711
743
  async handle(request, { abortSignal, requestTimeout, isEventStream } = {}) {
712
744
  if (!this.config) {
713
- this.config = await this.configProvider;
745
+ const config = await this.configProvider;
746
+ this.config = { ...config, defaultSocketTimeout: resolveDefaultSocketTimeout(config) };
714
747
  const { disableConcurrentStreams, maxConcurrentStreams, nodeHttp2ConnectOptions } = this.config;
715
748
  this.connectionManager.setDisableConcurrentStreams(disableConcurrentStreams ?? false);
716
749
  if (maxConcurrentStreams) {
@@ -720,9 +753,12 @@ class NodeHttp2Handler {
720
753
  this.connectionManager.setNodeHttp2ConnectOptions(nodeHttp2ConnectOptions);
721
754
  }
722
755
  }
723
- const { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config;
756
+ const { requestTimeout: configRequestTimeout, disableConcurrentStreams, sessionTimeout } = this.config;
724
757
  const useIsolatedSession = disableConcurrentStreams || isEventStream;
725
758
  const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout;
759
+ const defaultSocketTimeout = effectiveRequestTimeout === undefined && sessionTimeout === undefined
760
+ ? this.config.defaultSocketTimeout
761
+ : undefined;
726
762
  return new Promise((_resolve, _reject) => {
727
763
  let fulfilled = false;
728
764
  let writeRequestBodyPromise = undefined;
@@ -785,6 +821,19 @@ class NodeHttp2Handler {
785
821
  rejectWithDestroy(timeoutError);
786
822
  });
787
823
  }
824
+ else if (defaultSocketTimeout) {
825
+ clientHttp2Stream.setTimeout(defaultSocketTimeout, () => {
826
+ const timeoutError = new Error(`Stream timed out because of no activity for ${defaultSocketTimeout} ms`);
827
+ timeoutError.name = "TimeoutError";
828
+ fulfilled = true;
829
+ reject(timeoutError);
830
+ clientHttp2Stream.destroy(timeoutError);
831
+ if (useIsolatedSession) {
832
+ ref.destroy();
833
+ }
834
+ });
835
+ clientHttp2Stream.once("response", () => clientHttp2Stream.setTimeout(defaultSocketTimeout));
836
+ }
788
837
  if (abortSignal) {
789
838
  const onAbort = () => {
790
839
  clientHttp2Stream.close();
@@ -843,6 +892,12 @@ class NodeHttp2Handler {
843
892
  updateHttpClientConfig(key, value) {
844
893
  this.config = undefined;
845
894
  this.configProvider = this.configProvider.then((config) => {
895
+ switch (key) {
896
+ case Symbol.for("@smithy/defaultSocketTimeout"):
897
+ key = "defaultSocketTimeout";
898
+ value = resolveDefaultSocketTimeout(config) ?? value;
899
+ break;
900
+ }
846
901
  return {
847
902
  ...config,
848
903
  [key]: value,
@@ -2,8 +2,9 @@ import { hasOwn } from "@smithy/core/serde";
2
2
  const getTransformedHeaders = (headers) => {
3
3
  const transformedHeaders = {};
4
4
  for (const name in headers) {
5
- if (!hasOwn(headers, name))
5
+ if (!hasOwn(headers, name)) {
6
6
  continue;
7
+ }
7
8
  const headerValues = headers[name];
8
9
  transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
9
10
  }
@@ -7,6 +7,7 @@ import { node_https } from "./node-https";
7
7
  import { setConnectionTimeout } from "./set-connection-timeout";
8
8
  import { setRequestTimeout } from "./set-request-timeout";
9
9
  import { setSocketKeepAlive } from "./set-socket-keep-alive";
10
+ import { resolveDefaultSocketTimeout } from "./resolve-default-socket-timeout";
10
11
  import { setSocketTimeout } from "./set-socket-timeout";
11
12
  import { timing } from "./timing";
12
13
  import { writeRequestBody } from "./write-request-body";
@@ -36,8 +37,9 @@ export class NodeHttpHandler {
36
37
  }
37
38
  if (sockets && requests) {
38
39
  for (const origin in sockets) {
39
- if (!hasOwn(sockets, origin))
40
+ if (!hasOwn(sockets, origin)) {
40
41
  continue;
42
+ }
41
43
  const socketsInUse = sockets[origin]?.length ?? 0;
42
44
  const requestsEnqueued = requests[origin]?.length ?? 0;
43
45
  if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
@@ -185,7 +187,13 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
185
187
  const effectiveRequestTimeout = requestTimeout ?? config.requestTimeout;
186
188
  connectionTimeoutId = setConnectionTimeout(req, reject, config.connectionTimeout);
187
189
  requestTimeoutId = setRequestTimeout(req, reject, effectiveRequestTimeout, config.throwOnRequestTimeout, logger ?? console);
188
- socketTimeoutId = setSocketTimeout(req, reject, config.socketTimeout);
190
+ const defaultSocketTimeout = config.socketTimeout === undefined ? resolveDefaultSocketTimeout(config) : undefined;
191
+ if (defaultSocketTimeout) {
192
+ socketTimeoutId = setSocketTimeout(req, reject, defaultSocketTimeout, true);
193
+ }
194
+ else {
195
+ socketTimeoutId = setSocketTimeout(req, reject, config.socketTimeout);
196
+ }
189
197
  const httpAgent = nodeHttpsOptions.agent;
190
198
  if (typeof httpAgent === "object" && "keepAlive" in httpAgent) {
191
199
  keepAliveTimeoutId = setSocketKeepAlive(req, {
@@ -202,11 +210,15 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
202
210
  updateHttpClientConfig(key, value) {
203
211
  this.config = undefined;
204
212
  this.configProvider = this.configProvider.then((config) => {
205
- if (key === Symbol.for("logger")) {
206
- return {
207
- ...config,
208
- logger: config.logger ?? value,
209
- };
213
+ switch (key) {
214
+ case Symbol.for("logger"):
215
+ key = "logger";
216
+ value = config.logger ?? value;
217
+ break;
218
+ case Symbol.for("@smithy/defaultSocketTimeout"):
219
+ key = "defaultSocketTimeout";
220
+ value = resolveDefaultSocketTimeout(config) ?? value;
221
+ break;
210
222
  }
211
223
  return {
212
224
  ...config,
@@ -221,13 +233,15 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
221
233
  const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, logger, } = options || {};
222
234
  const keepAlive = true;
223
235
  const maxSockets = 50;
236
+ let httpAgentPromise;
224
237
  return {
225
238
  connectionTimeout,
226
239
  requestTimeout,
227
240
  socketTimeout,
241
+ defaultSocketTimeout: resolveDefaultSocketTimeout(options),
228
242
  socketAcquisitionWarningTimeout,
229
243
  throwOnRequestTimeout,
230
- httpAgentProvider: async () => {
244
+ httpAgentProvider: () => (httpAgentPromise ??= (async () => {
231
245
  const node_http = await import("node:http");
232
246
  const { Agent, request } = node_http.default ?? node_http;
233
247
  hRequest = request;
@@ -237,7 +251,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
237
251
  return httpAgent;
238
252
  }
239
253
  return new hAgent({ keepAlive, maxSockets, ...httpAgent });
240
- },
254
+ })()),
241
255
  httpsAgent: (() => {
242
256
  if (httpsAgent instanceof node_https.Agent || typeof httpsAgent?.destroy === "function") {
243
257
  this.externalAgent = true;
@@ -3,6 +3,7 @@ import { buildAbortError } from "./build-abort-error";
3
3
  import { getTransformedHeaders } from "./get-transformed-headers";
4
4
  import { node_http2 } from "./node-http2";
5
5
  import { NodeHttp2ConnectionManager } from "./node-http2-connection-manager";
6
+ import { resolveDefaultSocketTimeout } from "./resolve-default-socket-timeout";
6
7
  import { writeRequestBody } from "./write-request-body";
7
8
  const { constants } = node_http2;
8
9
  export class NodeHttp2Handler {
@@ -35,7 +36,8 @@ export class NodeHttp2Handler {
35
36
  }
36
37
  async handle(request, { abortSignal, requestTimeout, isEventStream } = {}) {
37
38
  if (!this.config) {
38
- this.config = await this.configProvider;
39
+ const config = await this.configProvider;
40
+ this.config = { ...config, defaultSocketTimeout: resolveDefaultSocketTimeout(config) };
39
41
  const { disableConcurrentStreams, maxConcurrentStreams, nodeHttp2ConnectOptions } = this.config;
40
42
  this.connectionManager.setDisableConcurrentStreams(disableConcurrentStreams ?? false);
41
43
  if (maxConcurrentStreams) {
@@ -45,9 +47,12 @@ export class NodeHttp2Handler {
45
47
  this.connectionManager.setNodeHttp2ConnectOptions(nodeHttp2ConnectOptions);
46
48
  }
47
49
  }
48
- const { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config;
50
+ const { requestTimeout: configRequestTimeout, disableConcurrentStreams, sessionTimeout } = this.config;
49
51
  const useIsolatedSession = disableConcurrentStreams || isEventStream;
50
52
  const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout;
53
+ const defaultSocketTimeout = effectiveRequestTimeout === undefined && sessionTimeout === undefined
54
+ ? this.config.defaultSocketTimeout
55
+ : undefined;
51
56
  return new Promise((_resolve, _reject) => {
52
57
  let fulfilled = false;
53
58
  let writeRequestBodyPromise = undefined;
@@ -110,6 +115,19 @@ export class NodeHttp2Handler {
110
115
  rejectWithDestroy(timeoutError);
111
116
  });
112
117
  }
118
+ else if (defaultSocketTimeout) {
119
+ clientHttp2Stream.setTimeout(defaultSocketTimeout, () => {
120
+ const timeoutError = new Error(`Stream timed out because of no activity for ${defaultSocketTimeout} ms`);
121
+ timeoutError.name = "TimeoutError";
122
+ fulfilled = true;
123
+ reject(timeoutError);
124
+ clientHttp2Stream.destroy(timeoutError);
125
+ if (useIsolatedSession) {
126
+ ref.destroy();
127
+ }
128
+ });
129
+ clientHttp2Stream.once("response", () => clientHttp2Stream.setTimeout(defaultSocketTimeout));
130
+ }
113
131
  if (abortSignal) {
114
132
  const onAbort = () => {
115
133
  clientHttp2Stream.close();
@@ -168,6 +186,12 @@ export class NodeHttp2Handler {
168
186
  updateHttpClientConfig(key, value) {
169
187
  this.config = undefined;
170
188
  this.configProvider = this.configProvider.then((config) => {
189
+ switch (key) {
190
+ case Symbol.for("@smithy/defaultSocketTimeout"):
191
+ key = "defaultSocketTimeout";
192
+ value = resolveDefaultSocketTimeout(config) ?? value;
193
+ break;
194
+ }
171
195
  return {
172
196
  ...config,
173
197
  [key]: value,
@@ -0,0 +1,4 @@
1
+ export const resolveDefaultSocketTimeout = (config) => {
2
+ const value = config?.defaultSocketTimeout;
3
+ return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : undefined;
4
+ };
@@ -1,11 +1,19 @@
1
1
  import { timing } from "./timing";
2
2
  const DEFER_EVENT_LISTENER_TIME = 3000;
3
- export const setSocketTimeout = (request, reject, timeoutInMs = 0) => {
3
+ export const setSocketTimeout = (request, reject, timeoutInMs = 0, destroyResponseBodyOnTimeout = false) => {
4
+ let response;
5
+ if (destroyResponseBodyOnTimeout) {
6
+ request.once("response", (res) => (response = res));
7
+ }
4
8
  const registerTimeout = (offset) => {
5
9
  const timeout = timeoutInMs - offset;
6
10
  const onTimeout = () => {
11
+ const error = Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (${destroyResponseBodyOnTimeout ? "service default socket timeout" : "configured by client requestHandler"}).`), { name: "TimeoutError" });
12
+ if (destroyResponseBodyOnTimeout) {
13
+ response?.destroy(error);
14
+ }
7
15
  request.destroy();
8
- reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`), { name: "TimeoutError" }));
16
+ reject(error);
9
17
  };
10
18
  if (request.socket) {
11
19
  request.socket.setTimeout(timeout, onTimeout);
@@ -19,5 +27,10 @@ export const setSocketTimeout = (request, reject, timeoutInMs = 0) => {
19
27
  registerTimeout(0);
20
28
  return 0;
21
29
  }
22
- return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME);
30
+ const deferralId = timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME);
31
+ if (destroyResponseBodyOnTimeout) {
32
+ request.once("close", () => timing.clearTimeout(deferralId));
33
+ return 0;
34
+ }
35
+ return deferralId;
23
36
  };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export declare const resolveDefaultSocketTimeout: (config: unknown) => number | undefined;
@@ -1,2 +1,7 @@
1
1
  import type { ClientRequest } from "node:http";
2
- export declare const setSocketTimeout: (request: ClientRequest, reject: (err: Error) => void, timeoutInMs?: number) => NodeJS.Timeout | number;
2
+ /**
3
+ * @internal
4
+ * @param destroyResponseBodyOnTimeout - set by the service default. On timeout the response
5
+ * body is destroyed with the TimeoutError, and the timeout stays armed through the body.
6
+ */
7
+ export declare const setSocketTimeout: (request: ClientRequest, reject: (err: Error) => void, timeoutInMs?: number, destroyResponseBodyOnTimeout?: boolean) => NodeJS.Timeout | number;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export declare const resolveDefaultSocketTimeout: (config: unknown) => number | undefined;
@@ -1,2 +1,7 @@
1
1
  import { ClientRequest } from "node:http";
2
- export declare const setSocketTimeout: (request: ClientRequest, reject: (err: Error) => void, timeoutInMs?: number) => NodeJS.Timeout | number;
2
+ /**
3
+ * @internal
4
+ * @param destroyResponseBodyOnTimeout - set by the service default. On timeout the response
5
+ * body is destroyed with the TimeoutError, and the timeout stays armed through the body.
6
+ */
7
+ export declare const setSocketTimeout: (request: ClientRequest, reject: (err: Error) => void, timeoutInMs?: number, destroyResponseBodyOnTimeout?: boolean) => NodeJS.Timeout | number;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/node-http-handler",
3
- "version": "4.12.1",
3
+ "version": "4.14.1",
4
4
  "description": "Provides a way to make requests",
5
5
  "homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/node-http-handler",
6
6
  "license": "Apache-2.0",
@@ -39,8 +39,8 @@
39
39
  "test:watch": "yarn g:vitest watch"
40
40
  },
41
41
  "dependencies": {
42
- "@smithy/core": "^3.33.3",
43
- "@smithy/types": "^4.18.0",
42
+ "@smithy/core": "^3.38.1",
43
+ "@smithy/types": "^4.19.0",
44
44
  "tslib": "^2.6.2"
45
45
  },
46
46
  "devDependencies": {
@@ -1,5 +1,14 @@
1
1
  # Change Log
2
2
 
3
+ ## 5.7.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 0f58fed: Export the shared `writeKey` helper and include headers named after Object prototype properties in canonical request signatures.
8
+ - Updated dependencies [6f250ec]
9
+ - Updated dependencies [0f58fed]
10
+ - @smithy/core@3.38.0
11
+
3
12
  ## 5.7.4
4
13
 
5
14
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- const { hasOwn, fromUtf8, fromHex, toHex, toUint8Array, isArrayBuffer } = require("@smithy/core/serde");
1
+ const { hasOwn, fromUtf8, fromHex, toHex, toUint8Array, writeKey, isArrayBuffer } = require("@smithy/core/serde");
2
2
  const { normalizeProvider } = require("@smithy/core/client");
3
3
  const { escapeUri, HttpRequest } = require("@smithy/core/protocols");
4
4
 
@@ -6,8 +6,9 @@ class HeaderFormatter {
6
6
  format(headers) {
7
7
  const chunks = [];
8
8
  for (const headerName in headers) {
9
- if (!hasOwn(headers, headerName))
9
+ if (!hasOwn(headers, headerName)) {
10
10
  continue;
11
+ }
11
12
  const bytes = fromUtf8(headerName);
12
13
  chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));
13
14
  }
@@ -124,8 +125,9 @@ function negate(bytes) {
124
125
  }
125
126
  for (let i = 7; i > -1; i--) {
126
127
  bytes[i]++;
127
- if (bytes[i] !== 0)
128
+ if (bytes[i] !== 0) {
128
129
  break;
130
+ }
129
131
  }
130
132
  }
131
133
 
@@ -177,8 +179,9 @@ const getCanonicalQuery = ({ query = {} }) => {
177
179
  const keys = [];
178
180
  const serialized = {};
179
181
  for (const key in query) {
180
- if (!hasOwn(query, key))
182
+ if (!hasOwn(query, key)) {
181
183
  continue;
184
+ }
182
185
  if (key.toLowerCase() === SIGNATURE_HEADER) {
183
186
  continue;
184
187
  }
@@ -257,10 +260,12 @@ ${toHex(hashedRequest)}`;
257
260
  if (this.uriEscapePath) {
258
261
  const normalizedPathSegments = [];
259
262
  for (const pathSegment of path.split("/")) {
260
- if (pathSegment?.length === 0)
263
+ if (pathSegment?.length === 0) {
261
264
  continue;
262
- if (pathSegment === ".")
265
+ }
266
+ if (pathSegment === ".") {
263
267
  continue;
268
+ }
264
269
  if (pathSegment === "..") {
265
270
  normalizedPathSegments.pop();
266
271
  }
@@ -331,7 +336,7 @@ const getCanonicalHeaders = ({ headers }, unsignableHeaders, signableHeaders) =>
331
336
  continue;
332
337
  }
333
338
  const canonicalHeaderName = headerName.toLowerCase();
334
- if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS ||
339
+ if (hasOwn(ALWAYS_UNSIGNABLE_HEADERS, canonicalHeaderName) ||
335
340
  unsignableHeaders?.has(canonicalHeaderName) ||
336
341
  PROXY_HEADER_PATTERN.test(canonicalHeaderName) ||
337
342
  SEC_HEADER_PATTERN.test(canonicalHeaderName)) {
@@ -339,6 +344,9 @@ const getCanonicalHeaders = ({ headers }, unsignableHeaders, signableHeaders) =>
339
344
  continue;
340
345
  }
341
346
  }
347
+ if (canonicalHeaderName === "__proto__") {
348
+ writeKey(canonical);
349
+ }
342
350
  canonical[canonicalHeaderName] = headers[headerName]
343
351
  .replace(/[\r\n]/g, " ")
344
352
  .replace(/[ \t]+/g, " ")
@@ -349,8 +357,9 @@ const getCanonicalHeaders = ({ headers }, unsignableHeaders, signableHeaders) =>
349
357
 
350
358
  const getPayloadHash = async ({ headers, body }, hashConstructor) => {
351
359
  for (const headerName in headers) {
352
- if (!hasOwn(headers, headerName))
360
+ if (!hasOwn(headers, headerName)) {
353
361
  continue;
362
+ }
354
363
  if (headerName.toLowerCase() === SHA256_HEADER) {
355
364
  return headers[headerName];
356
365
  }
@@ -369,8 +378,9 @@ const getPayloadHash = async ({ headers, body }, hashConstructor) => {
369
378
  const hasHeader = (soughtHeader, headers) => {
370
379
  soughtHeader = soughtHeader.toLowerCase();
371
380
  for (const headerName in headers) {
372
- if (!hasOwn(headers, headerName))
381
+ if (!hasOwn(headers, headerName)) {
373
382
  continue;
383
+ }
374
384
  if (soughtHeader === headerName.toLowerCase()) {
375
385
  return true;
376
386
  }
@@ -381,8 +391,9 @@ const hasHeader = (soughtHeader, headers) => {
381
391
  const moveHeadersToQuery = (request, options = {}) => {
382
392
  const { headers, query = {} } = HttpRequest.clone(request);
383
393
  for (const name in headers) {
384
- if (!hasOwn(headers, name))
394
+ if (!hasOwn(headers, name)) {
385
395
  continue;
396
+ }
386
397
  const lname = name.toLowerCase();
387
398
  if ((lname.slice(0, 6) === "x-amz-" && !options.unhoistableHeaders?.has(lname)) ||
388
399
  options.hoistableHeaders?.has(lname)) {
@@ -400,8 +411,9 @@ const moveHeadersToQuery = (request, options = {}) => {
400
411
  const prepareRequest = (request) => {
401
412
  request = HttpRequest.clone(request);
402
413
  for (const headerName in request.headers) {
403
- if (!hasOwn(request.headers, headerName))
414
+ if (!hasOwn(request.headers, headerName)) {
404
415
  continue;
416
+ }
405
417
  if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {
406
418
  delete request.headers[headerName];
407
419
  }
@@ -4,8 +4,9 @@ export class HeaderFormatter {
4
4
  format(headers) {
5
5
  const chunks = [];
6
6
  for (const headerName in headers) {
7
- if (!hasOwn(headers, headerName))
7
+ if (!hasOwn(headers, headerName)) {
8
8
  continue;
9
+ }
9
10
  const bytes = fromUtf8(headerName);
10
11
  chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));
11
12
  }
@@ -122,7 +123,8 @@ function negate(bytes) {
122
123
  }
123
124
  for (let i = 7; i > -1; i--) {
124
125
  bytes[i]++;
125
- if (bytes[i] !== 0)
126
+ if (bytes[i] !== 0) {
126
127
  break;
128
+ }
127
129
  }
128
130
  }