@cdklabs/cdk-ssm-documents 0.0.55 → 0.0.57

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 (379) hide show
  1. package/.jsii +12 -12
  2. package/lib/construct/synth-utils.js +1 -1
  3. package/lib/document/automation-document.js +1 -1
  4. package/lib/document/command-document.js +1 -1
  5. package/lib/document/document-builder.js +2 -2
  6. package/lib/document/ssm-document.js +1 -1
  7. package/lib/domain/aws-service.js +1 -1
  8. package/lib/domain/choice.js +1 -1
  9. package/lib/domain/data-type.js +1 -1
  10. package/lib/domain/enum/install-action.js +2 -2
  11. package/lib/domain/enum/install-uninstall-repair.js +2 -2
  12. package/lib/domain/enum/installation-type.js +2 -2
  13. package/lib/domain/enum/package-name.js +2 -2
  14. package/lib/domain/input.js +1 -1
  15. package/lib/domain/operation.js +1 -1
  16. package/lib/domain/platform.js +1 -1
  17. package/lib/domain/precondition.js +1 -1
  18. package/lib/incident-response/incident-response.js +3 -3
  19. package/lib/interface/approve-hook.js +2 -2
  20. package/lib/interface/auth-method.js +3 -3
  21. package/lib/interface/aws-invoker.js +2 -2
  22. package/lib/interface/downloadable-content.js +8 -8
  23. package/lib/interface/environment.js +3 -3
  24. package/lib/interface/execute-automation-hook/api-execute-automation-hook.js +1 -1
  25. package/lib/interface/observer.js +1 -1
  26. package/lib/interface/on-failure.js +6 -6
  27. package/lib/interface/pause-hook.js +2 -2
  28. package/lib/interface/run-command-hook/api-run-command-hook.js +1 -1
  29. package/lib/interface/run-document-location.js +2 -2
  30. package/lib/interface/sleep-hook.js +2 -2
  31. package/lib/interface/step-ref.js +1 -1
  32. package/lib/interface/variables/boolean-variable.js +2 -2
  33. package/lib/interface/variables/map-list-variable.js +2 -2
  34. package/lib/interface/variables/number-variable.js +2 -2
  35. package/lib/interface/variables/secure-string-variable.js +4 -4
  36. package/lib/interface/variables/string-list-variable.js +2 -2
  37. package/lib/interface/variables/string-map-variable.js +2 -2
  38. package/lib/interface/variables/string-variable.js +4 -4
  39. package/lib/interface/variables/variable.js +2 -2
  40. package/lib/interface/webhook.js +1 -1
  41. package/lib/parent-steps/automation/approve-step.js +1 -1
  42. package/lib/parent-steps/automation/assert-aws-resource-step.js +1 -1
  43. package/lib/parent-steps/automation/aws-api-step.js +1 -1
  44. package/lib/parent-steps/automation/branch-step.js +1 -1
  45. package/lib/parent-steps/automation/change-instance-state-step.js +3 -3
  46. package/lib/parent-steps/automation/copy-image-step.js +1 -1
  47. package/lib/parent-steps/automation/create-image-step.js +1 -1
  48. package/lib/parent-steps/automation/create-stack-step.js +3 -3
  49. package/lib/parent-steps/automation/create-tags-step.js +3 -3
  50. package/lib/parent-steps/automation/delete-image-step.js +1 -1
  51. package/lib/parent-steps/automation/delete-stack-step.js +1 -1
  52. package/lib/parent-steps/automation/execute-automation-step.js +1 -1
  53. package/lib/parent-steps/automation/execute-script-step.js +5 -5
  54. package/lib/parent-steps/automation/execute-state-machine-step.js +1 -1
  55. package/lib/parent-steps/automation/invoke-lambda-function-step.js +1 -1
  56. package/lib/parent-steps/automation/invoke-webhook-step.js +1 -1
  57. package/lib/parent-steps/automation/pause-step.js +1 -1
  58. package/lib/parent-steps/automation/run-command-step.js +3 -3
  59. package/lib/parent-steps/automation/run-instance-step.js +1 -1
  60. package/lib/parent-steps/automation/sleep-step.js +1 -1
  61. package/lib/parent-steps/automation/update-variable.js +1 -1
  62. package/lib/parent-steps/automation/wait-for-resource-step.js +1 -1
  63. package/lib/parent-steps/automation-step.js +1 -1
  64. package/lib/parent-steps/command/applications-step.js +1 -1
  65. package/lib/parent-steps/command/configure-docker-step.js +1 -1
  66. package/lib/parent-steps/command/configure-package-step.js +1 -1
  67. package/lib/parent-steps/command/domain-join-step.js +1 -1
  68. package/lib/parent-steps/command/download-content-step.js +1 -1
  69. package/lib/parent-steps/command/ps-module-step.js +1 -1
  70. package/lib/parent-steps/command/run-docker-action-step.js +1 -1
  71. package/lib/parent-steps/command/run-document-step.js +1 -1
  72. package/lib/parent-steps/command/run-powershell-script-step.js +1 -1
  73. package/lib/parent-steps/command/run-shell-script-step.js +1 -1
  74. package/lib/parent-steps/command/software-inventory-step.js +1 -1
  75. package/lib/parent-steps/command/update-agent-step.js +1 -1
  76. package/lib/parent-steps/command/update-ssm-agent-step.js +1 -1
  77. package/lib/parent-steps/command-step.js +1 -1
  78. package/lib/parent-steps/step.js +1 -1
  79. package/lib/patterns/automation/composite-step.js +2 -2
  80. package/lib/patterns/automation/reboot-instance-and-wait.js +1 -1
  81. package/lib/patterns/automation/string-step.js +1 -1
  82. package/lib/patterns/document/string-document.js +1 -1
  83. package/lib/patterns/document/timed-document.js +1 -1
  84. package/lib/samples/hello-world.js +1 -1
  85. package/lib/simulation/automation/approve-simulation.js +1 -1
  86. package/lib/simulation/automation/assert-aws-resource-simulation.js +1 -1
  87. package/lib/simulation/automation/automation-simulation-base.js +1 -1
  88. package/lib/simulation/automation/aws-api-simulation.js +1 -1
  89. package/lib/simulation/automation/branch-simulation.js +1 -1
  90. package/lib/simulation/automation/change-instance-state-simulation.js +1 -1
  91. package/lib/simulation/automation/copy-image-simulation.js +1 -1
  92. package/lib/simulation/automation/create-image-simulation.js +1 -1
  93. package/lib/simulation/automation/create-stack-simulation.js +1 -1
  94. package/lib/simulation/automation/create-tags-simulation.js +1 -1
  95. package/lib/simulation/automation/delete-image-simulation.js +1 -1
  96. package/lib/simulation/automation/delete-stack-simulation.js +1 -1
  97. package/lib/simulation/automation/execute-script-simulation.js +1 -1
  98. package/lib/simulation/automation/execute-state-machine-simulation.js +1 -1
  99. package/lib/simulation/automation/invoke-lambda-function-simulation.js +1 -1
  100. package/lib/simulation/automation/invoke-webhook-simulation.js +1 -1
  101. package/lib/simulation/automation/pause-simulation.js +1 -1
  102. package/lib/simulation/automation/run-command-simulation.js +1 -1
  103. package/lib/simulation/automation/run-instance-simulation.js +1 -1
  104. package/lib/simulation/automation/sleep-simulation.js +1 -1
  105. package/lib/simulation/automation/update-variable-simulation.js +1 -1
  106. package/lib/simulation/automation/wait-for-resource-simulation.js +1 -1
  107. package/lib/simulation/automation-step-simulation.js +1 -1
  108. package/lib/simulation/command/command-simulation-base.js +1 -1
  109. package/lib/simulation/command/ps-module-simulation.js +1 -1
  110. package/lib/simulation/command/run-powershell-script-simulation.js +1 -1
  111. package/lib/simulation/command/run-shell-script-simulation.js +1 -1
  112. package/lib/simulation/command-step-simulation.js +1 -1
  113. package/lib/simulation/document/automation-simulation.js +1 -1
  114. package/lib/simulation/document/command-simulation.js +1 -1
  115. package/lib/simulation/simulation.js +1 -1
  116. package/node_modules/@aws-sdk/client-cloudformation/package.json +34 -34
  117. package/node_modules/@aws-sdk/client-cloudwatch/dist-types/models/models_0.d.ts +2 -2
  118. package/node_modules/@aws-sdk/client-cloudwatch/package.json +36 -36
  119. package/node_modules/@aws-sdk/client-ec2/README.md +14 -0
  120. package/node_modules/@aws-sdk/client-ec2/dist-cjs/index.js +41 -0
  121. package/node_modules/@aws-sdk/client-ec2/dist-cjs/schemas/schemas_0.js +156 -78
  122. package/node_modules/@aws-sdk/client-ec2/dist-es/EC2.js +6 -0
  123. package/node_modules/@aws-sdk/client-ec2/dist-es/commands/GetCapacityManagerMonitoredTagKeysCommand.js +16 -0
  124. package/node_modules/@aws-sdk/client-ec2/dist-es/commands/UpdateCapacityManagerMonitoredTagKeysCommand.js +16 -0
  125. package/node_modules/@aws-sdk/client-ec2/dist-es/commands/index.js +2 -0
  126. package/node_modules/@aws-sdk/client-ec2/dist-es/models/enums.js +8 -0
  127. package/node_modules/@aws-sdk/client-ec2/dist-es/pagination/GetCapacityManagerMonitoredTagKeysPaginator.js +4 -0
  128. package/node_modules/@aws-sdk/client-ec2/dist-es/pagination/index.js +1 -0
  129. package/node_modules/@aws-sdk/client-ec2/dist-es/schemas/schemas_0.js +96 -18
  130. package/node_modules/@aws-sdk/client-ec2/dist-types/EC2.d.ts +23 -0
  131. package/node_modules/@aws-sdk/client-ec2/dist-types/EC2Client.d.ts +4 -2
  132. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetCapacityManagerMetricDataCommand.d.ts +9 -2
  133. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetCapacityManagerMetricDimensionsCommand.d.ts +9 -2
  134. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetCapacityManagerMonitoredTagKeysCommand.d.ts +87 -0
  135. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetConsoleScreenshotCommand.d.ts +1 -1
  136. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetDeclarativePoliciesReportSummaryCommand.d.ts +1 -2
  137. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/ModifyTrafficMirrorFilterNetworkServicesCommand.d.ts +1 -1
  138. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/ModifyTrafficMirrorFilterRuleCommand.d.ts +1 -1
  139. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/UpdateCapacityManagerMonitoredTagKeysCommand.d.ts +91 -0
  140. package/node_modules/@aws-sdk/client-ec2/dist-types/commands/index.d.ts +2 -0
  141. package/node_modules/@aws-sdk/client-ec2/dist-types/models/enums.d.ts +16 -0
  142. package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_5.d.ts +126 -79
  143. package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_6.d.ts +81 -122
  144. package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_7.d.ts +168 -3
  145. package/node_modules/@aws-sdk/client-ec2/dist-types/pagination/GetCapacityManagerMonitoredTagKeysPaginator.d.ts +7 -0
  146. package/node_modules/@aws-sdk/client-ec2/dist-types/pagination/index.d.ts +1 -0
  147. package/node_modules/@aws-sdk/client-ec2/dist-types/schemas/schemas_0.d.ts +8 -0
  148. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/EC2.d.ts +55 -0
  149. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/EC2Client.d.ts +12 -0
  150. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetCapacityManagerMonitoredTagKeysCommand.d.ts +51 -0
  151. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetConsoleScreenshotCommand.d.ts +1 -1
  152. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetDeclarativePoliciesReportSummaryCommand.d.ts +4 -2
  153. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/ModifyTrafficMirrorFilterNetworkServicesCommand.d.ts +1 -1
  154. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/ModifyTrafficMirrorFilterRuleCommand.d.ts +1 -1
  155. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/UpdateCapacityManagerMonitoredTagKeysCommand.d.ts +51 -0
  156. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/index.d.ts +2 -0
  157. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/enums.d.ts +10 -0
  158. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_5.d.ts +23 -18
  159. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_6.d.ts +19 -34
  160. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_7.d.ts +43 -0
  161. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/pagination/GetCapacityManagerMonitoredTagKeysPaginator.d.ts +11 -0
  162. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/pagination/index.d.ts +1 -0
  163. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/schemas/schemas_0.d.ts +8 -0
  164. package/node_modules/@aws-sdk/client-ec2/package.json +36 -36
  165. package/node_modules/@aws-sdk/client-iam/package.json +35 -35
  166. package/node_modules/@aws-sdk/client-lambda/dist-cjs/models/errors.js +52 -1
  167. package/node_modules/@aws-sdk/client-lambda/dist-cjs/schemas/schemas_0.js +29 -8
  168. package/node_modules/@aws-sdk/client-lambda/dist-es/models/errors.js +48 -0
  169. package/node_modules/@aws-sdk/client-lambda/dist-es/schemas/schemas_0.js +22 -1
  170. package/node_modules/@aws-sdk/client-lambda/dist-types/commands/InvokeCommand.d.ts +9 -0
  171. package/node_modules/@aws-sdk/client-lambda/dist-types/commands/InvokeWithResponseStreamCommand.d.ts +9 -0
  172. package/node_modules/@aws-sdk/client-lambda/dist-types/models/errors.d.ts +66 -0
  173. package/node_modules/@aws-sdk/client-lambda/dist-types/models/models_0.d.ts +6 -6
  174. package/node_modules/@aws-sdk/client-lambda/dist-types/schemas/schemas_0.d.ts +3 -0
  175. package/node_modules/@aws-sdk/client-lambda/dist-types/ts3.4/models/errors.d.ts +30 -0
  176. package/node_modules/@aws-sdk/client-lambda/dist-types/ts3.4/schemas/schemas_0.d.ts +3 -0
  177. package/node_modules/@aws-sdk/client-lambda/package.json +38 -38
  178. package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +5 -0
  179. package/node_modules/@aws-sdk/client-s3/dist-es/models/enums.js +5 -0
  180. package/node_modules/@aws-sdk/client-s3/dist-types/commands/CreateBucketCommand.d.ts +1 -1
  181. package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketLocationCommand.d.ts +1 -1
  182. package/node_modules/@aws-sdk/client-s3/dist-types/models/enums.d.ts +5 -0
  183. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/enums.d.ts +5 -0
  184. package/node_modules/@aws-sdk/client-s3/package.json +50 -50
  185. package/node_modules/@aws-sdk/client-sns/package.json +33 -33
  186. package/node_modules/@aws-sdk/client-sqs/dist-cjs/index.js +2 -0
  187. package/node_modules/@aws-sdk/client-sqs/dist-es/commands/ReceiveMessageCommand.js +2 -0
  188. package/node_modules/@aws-sdk/client-sqs/package.json +36 -36
  189. package/node_modules/@aws-sdk/client-ssm/package.json +34 -34
  190. package/node_modules/@aws-sdk/core/dist-cjs/index.js +69 -50
  191. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +17 -0
  192. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +52 -50
  193. package/node_modules/@aws-sdk/core/dist-es/submodules/client/index.js +1 -0
  194. package/node_modules/@aws-sdk/core/dist-es/submodules/client/longPollMiddleware.js +15 -0
  195. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js +11 -10
  196. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/UnionSerde.js +4 -1
  197. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +4 -5
  198. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +2 -1
  199. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +9 -7
  200. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js +17 -17
  201. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js +3 -8
  202. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +2 -1
  203. package/node_modules/@aws-sdk/core/dist-types/submodules/client/index.d.ts +1 -0
  204. package/node_modules/@aws-sdk/core/dist-types/submodules/client/longPollMiddleware.d.ts +14 -0
  205. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeSerializer.d.ts +2 -2
  206. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.d.ts +1 -0
  207. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/longPollMiddleware.d.ts +15 -0
  208. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeSerializer.d.ts +1 -1
  209. package/node_modules/@aws-sdk/core/package.json +11 -11
  210. package/node_modules/@aws-sdk/crc64-nvme/package.json +2 -2
  211. package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
  212. package/node_modules/@aws-sdk/credential-provider-http/package.json +10 -10
  213. package/node_modules/@aws-sdk/credential-provider-ini/package.json +14 -14
  214. package/node_modules/@aws-sdk/credential-provider-login/package.json +8 -8
  215. package/node_modules/@aws-sdk/credential-provider-node/package.json +12 -12
  216. package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
  217. package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
  218. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -7
  219. package/node_modules/@aws-sdk/middleware-bucket-endpoint/package.json +5 -5
  220. package/node_modules/@aws-sdk/middleware-expect-continue/package.json +4 -4
  221. package/node_modules/@aws-sdk/middleware-flexible-checksums/package.json +10 -10
  222. package/node_modules/@aws-sdk/middleware-host-header/package.json +4 -4
  223. package/node_modules/@aws-sdk/middleware-location-constraint/package.json +3 -3
  224. package/node_modules/@aws-sdk/middleware-logger/package.json +3 -3
  225. package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +4 -4
  226. package/node_modules/@aws-sdk/middleware-sdk-ec2/package.json +8 -8
  227. package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +11 -11
  228. package/node_modules/@aws-sdk/middleware-sdk-sqs/package.json +4 -4
  229. package/node_modules/@aws-sdk/middleware-ssec/package.json +3 -3
  230. package/node_modules/@aws-sdk/middleware-user-agent/package.json +8 -8
  231. package/node_modules/@aws-sdk/nested-clients/package.json +32 -32
  232. package/node_modules/@aws-sdk/region-config-resolver/package.json +5 -5
  233. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +6 -6
  234. package/node_modules/@aws-sdk/token-providers/package.json +7 -7
  235. package/node_modules/@aws-sdk/types/package.json +2 -2
  236. package/node_modules/@aws-sdk/util-endpoints/package.json +5 -5
  237. package/node_modules/@aws-sdk/util-format-url/package.json +4 -4
  238. package/node_modules/@aws-sdk/util-user-agent-browser/package.json +3 -3
  239. package/node_modules/@aws-sdk/util-user-agent-node/package.json +5 -5
  240. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  241. package/node_modules/@smithy/config-resolver/package.json +5 -5
  242. package/node_modules/@smithy/core/dist-cjs/index.js +2 -1
  243. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +32 -14
  244. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +2 -2
  245. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +16 -8
  246. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +17 -10
  247. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +6 -1
  248. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +6 -3
  249. package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/DefaultIdentityProviderConfig.js +2 -1
  250. package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +23 -11
  251. package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +9 -3
  252. package/node_modules/@smithy/core/dist-es/submodules/endpoints/toEndpointV1.js +2 -2
  253. package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +16 -8
  254. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +9 -4
  255. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +8 -6
  256. package/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +6 -1
  257. package/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js +6 -3
  258. package/node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js +2 -1
  259. package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +1 -1
  260. package/node_modules/@smithy/core/package.json +7 -7
  261. package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
  262. package/node_modules/@smithy/eventstream-codec/package.json +2 -2
  263. package/node_modules/@smithy/eventstream-serde-browser/package.json +3 -3
  264. package/node_modules/@smithy/eventstream-serde-config-resolver/package.json +2 -2
  265. package/node_modules/@smithy/eventstream-serde-node/package.json +3 -3
  266. package/node_modules/@smithy/eventstream-serde-universal/package.json +3 -3
  267. package/node_modules/@smithy/fetch-http-handler/package.json +5 -5
  268. package/node_modules/@smithy/hash-blob-browser/package.json +2 -2
  269. package/node_modules/@smithy/hash-node/package.json +2 -2
  270. package/node_modules/@smithy/hash-stream-node/package.json +2 -2
  271. package/node_modules/@smithy/invalid-dependency/package.json +2 -2
  272. package/node_modules/@smithy/md5-js/package.json +2 -2
  273. package/node_modules/@smithy/middleware-compression/package.json +6 -6
  274. package/node_modules/@smithy/middleware-content-length/package.json +3 -3
  275. package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
  276. package/node_modules/@smithy/middleware-retry/package.json +9 -9
  277. package/node_modules/@smithy/middleware-serde/package.json +4 -4
  278. package/node_modules/@smithy/middleware-stack/package.json +2 -2
  279. package/node_modules/@smithy/node-config-provider/package.json +4 -4
  280. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +191 -96
  281. package/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +45 -0
  282. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +71 -35
  283. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js +32 -18
  284. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +44 -43
  285. package/node_modules/@smithy/node-http-handler/dist-types/http2/ClientHttp2SessionRef.d.ts +42 -0
  286. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +34 -14
  287. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +32 -8
  288. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +14 -6
  289. package/node_modules/@smithy/node-http-handler/package.json +5 -5
  290. package/node_modules/@smithy/property-provider/package.json +2 -2
  291. package/node_modules/@smithy/protocol-http/package.json +2 -2
  292. package/node_modules/@smithy/querystring-builder/package.json +2 -2
  293. package/node_modules/@smithy/querystring-parser/package.json +2 -2
  294. package/node_modules/@smithy/service-error-classification/dist-cjs/index.js +5 -0
  295. package/node_modules/@smithy/service-error-classification/dist-es/index.js +4 -0
  296. package/node_modules/@smithy/service-error-classification/dist-types/index.d.ts +6 -0
  297. package/node_modules/@smithy/service-error-classification/package.json +2 -2
  298. package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
  299. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +11 -5
  300. package/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js +11 -5
  301. package/node_modules/@smithy/signature-v4/dist-types/SignatureV4.d.ts +3 -3
  302. package/node_modules/@smithy/signature-v4/package.json +4 -4
  303. package/node_modules/@smithy/smithy-client/dist-cjs/index.js +8 -1
  304. package/node_modules/@smithy/smithy-client/dist-es/command.js +8 -1
  305. package/node_modules/@smithy/smithy-client/package.json +7 -7
  306. package/node_modules/@smithy/types/dist-types/connection/config.d.ts +5 -0
  307. package/node_modules/@smithy/types/dist-types/signature.d.ts +20 -3
  308. package/node_modules/@smithy/types/package.json +1 -1
  309. package/node_modules/@smithy/url-parser/package.json +3 -3
  310. package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
  311. package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
  312. package/node_modules/@smithy/util-endpoints/dist-cjs/index.js +212 -111
  313. package/node_modules/@smithy/util-endpoints/dist-es/bdd/BinaryDecisionDiagram.js +15 -0
  314. package/node_modules/@smithy/util-endpoints/dist-es/decideEndpoint.js +42 -0
  315. package/node_modules/@smithy/util-endpoints/dist-es/index.js +2 -0
  316. package/node_modules/@smithy/util-endpoints/dist-es/lib/coalesce.js +8 -0
  317. package/node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js +2 -1
  318. package/node_modules/@smithy/util-endpoints/dist-es/lib/index.js +3 -0
  319. package/node_modules/@smithy/util-endpoints/dist-es/lib/ite.js +3 -0
  320. package/node_modules/@smithy/util-endpoints/dist-es/lib/split.js +13 -0
  321. package/node_modules/@smithy/util-endpoints/dist-es/lib/substring.js +1 -1
  322. package/node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js +8 -13
  323. package/node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js +4 -1
  324. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js +9 -7
  325. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js +12 -8
  326. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js +14 -13
  327. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js +7 -4
  328. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js +22 -5
  329. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js +4 -4
  330. package/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js +3 -6
  331. package/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js +5 -5
  332. package/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js +4 -4
  333. package/node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js +1 -5
  334. package/node_modules/@smithy/util-endpoints/dist-types/bdd/BinaryDecisionDiagram.d.ts +22 -0
  335. package/node_modules/@smithy/util-endpoints/dist-types/decideEndpoint.d.ts +7 -0
  336. package/node_modules/@smithy/util-endpoints/dist-types/index.d.ts +2 -0
  337. package/node_modules/@smithy/util-endpoints/dist-types/lib/coalesce.d.ts +7 -0
  338. package/node_modules/@smithy/util-endpoints/dist-types/lib/index.d.ts +3 -0
  339. package/node_modules/@smithy/util-endpoints/dist-types/lib/ite.d.ts +6 -0
  340. package/node_modules/@smithy/util-endpoints/dist-types/lib/split.d.ts +11 -0
  341. package/node_modules/@smithy/util-endpoints/dist-types/types/shared.d.ts +3 -3
  342. package/node_modules/@smithy/util-endpoints/dist-types/utils/endpointFunctions.d.ts +2 -11
  343. package/node_modules/@smithy/util-endpoints/dist-types/utils/evaluateCondition.d.ts +6 -3
  344. package/node_modules/@smithy/util-endpoints/dist-types/utils/evaluateConditions.d.ts +3 -3
  345. package/node_modules/@smithy/util-endpoints/dist-types/utils/getEndpointHeaders.d.ts +1 -1
  346. package/node_modules/@smithy/util-endpoints/dist-types/utils/getEndpointProperties.d.ts +2 -2
  347. package/node_modules/@smithy/util-endpoints/dist-types/utils/getReferenceValue.d.ts +3 -1
  348. package/node_modules/@smithy/util-endpoints/package.json +3 -3
  349. package/node_modules/@smithy/util-middleware/package.json +2 -2
  350. package/node_modules/@smithy/util-retry/dist-cjs/index.js +6 -0
  351. package/node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js +3 -0
  352. package/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js +3 -0
  353. package/node_modules/@smithy/util-retry/dist-types/AdaptiveRetryStrategy.d.ts +5 -0
  354. package/node_modules/@smithy/util-retry/dist-types/StandardRetryStrategy.d.ts +5 -0
  355. package/node_modules/@smithy/util-retry/package.json +3 -3
  356. package/node_modules/@smithy/util-stream/package.json +4 -4
  357. package/node_modules/@smithy/util-waiter/package.json +3 -3
  358. package/node_modules/fast-xml-builder/package.json +1 -1
  359. package/node_modules/fast-xml-builder/src/fxb.js +6 -2
  360. package/node_modules/fast-xml-builder/src/orderedJs2Xml.js +16 -2
  361. package/node_modules/path-expression-matcher/README.md +214 -62
  362. package/node_modules/path-expression-matcher/lib/pem.cjs +1 -1
  363. package/node_modules/path-expression-matcher/lib/pem.d.cts +111 -0
  364. package/node_modules/path-expression-matcher/lib/pem.min.js +1 -1
  365. package/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -1
  366. package/node_modules/path-expression-matcher/package.json +1 -1
  367. package/node_modules/path-expression-matcher/src/Expression.js +2 -2
  368. package/node_modules/path-expression-matcher/src/ExpressionSet.js +209 -0
  369. package/node_modules/path-expression-matcher/src/Matcher.js +235 -177
  370. package/node_modules/path-expression-matcher/src/index.d.ts +199 -194
  371. package/node_modules/path-expression-matcher/src/index.js +3 -2
  372. package/node_modules/strnum/package.json +1 -1
  373. package/package.json +10 -10
  374. package/node_modules/strnum/.github/SECURITY.md +0 -5
  375. package/node_modules/strnum/.vscode/launch.json +0 -25
  376. package/node_modules/strnum/algo.stflow +0 -84
  377. package/node_modules/strnum/tests/infinity_test.js +0 -18
  378. package/node_modules/strnum/tests/strnum_test.js +0 -175
  379. package/node_modules/strnum/tests/temp.js +0 -8
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/hash-stream-node",
3
- "version": "4.2.13",
3
+ "version": "4.2.14",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline hash-stream-node",
@@ -23,7 +23,7 @@
23
23
  "license": "Apache-2.0",
24
24
  "sideEffects": false,
25
25
  "dependencies": {
26
- "@smithy/types": "^4.14.0",
26
+ "@smithy/types": "^4.14.1",
27
27
  "@smithy/util-utf8": "^4.2.2",
28
28
  "tslib": "^2.6.2"
29
29
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/invalid-dependency",
3
- "version": "4.2.13",
3
+ "version": "4.2.14",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline invalid-dependency",
@@ -23,7 +23,7 @@
23
23
  "license": "Apache-2.0",
24
24
  "sideEffects": false,
25
25
  "dependencies": {
26
- "@smithy/types": "^4.14.0",
26
+ "@smithy/types": "^4.14.1",
27
27
  "tslib": "^2.6.2"
28
28
  },
29
29
  "typesVersions": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/md5-js",
3
- "version": "4.2.13",
3
+ "version": "4.2.14",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline md5-js",
@@ -33,7 +33,7 @@
33
33
  "typedoc": "0.23.23"
34
34
  },
35
35
  "dependencies": {
36
- "@smithy/types": "^4.14.0",
36
+ "@smithy/types": "^4.14.1",
37
37
  "@smithy/util-utf8": "^4.2.2",
38
38
  "tslib": "^2.6.2"
39
39
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-compression",
3
- "version": "4.3.43",
3
+ "version": "4.3.45",
4
4
  "description": "Middleware and Plugin for request compression.",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
@@ -15,13 +15,13 @@
15
15
  "main": "./dist-cjs/index.js",
16
16
  "module": "./dist-es/index.js",
17
17
  "dependencies": {
18
- "@smithy/core": "^3.23.14",
18
+ "@smithy/core": "^3.23.16",
19
19
  "@smithy/is-array-buffer": "^4.2.2",
20
- "@smithy/node-config-provider": "^4.3.13",
21
- "@smithy/protocol-http": "^5.3.13",
22
- "@smithy/types": "^4.14.0",
20
+ "@smithy/node-config-provider": "^4.3.14",
21
+ "@smithy/protocol-http": "^5.3.14",
22
+ "@smithy/types": "^4.14.1",
23
23
  "@smithy/util-config-provider": "^4.2.2",
24
- "@smithy/util-middleware": "^4.2.13",
24
+ "@smithy/util-middleware": "^4.2.14",
25
25
  "@smithy/util-utf8": "^4.2.2",
26
26
  "fflate": "0.8.1",
27
27
  "tslib": "^2.6.2"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-content-length",
3
- "version": "4.2.13",
3
+ "version": "4.2.14",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline middleware-content-length",
@@ -24,8 +24,8 @@
24
24
  "license": "Apache-2.0",
25
25
  "sideEffects": false,
26
26
  "dependencies": {
27
- "@smithy/protocol-http": "^5.3.13",
28
- "@smithy/types": "^4.14.0",
27
+ "@smithy/protocol-http": "^5.3.14",
28
+ "@smithy/types": "^4.14.1",
29
29
  "tslib": "^2.6.2"
30
30
  },
31
31
  "engines": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-endpoint",
3
- "version": "4.4.29",
3
+ "version": "4.4.31",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline middleware-endpoint",
@@ -24,13 +24,13 @@
24
24
  "license": "Apache-2.0",
25
25
  "sideEffects": false,
26
26
  "dependencies": {
27
- "@smithy/core": "^3.23.14",
28
- "@smithy/middleware-serde": "^4.2.17",
29
- "@smithy/node-config-provider": "^4.3.13",
30
- "@smithy/shared-ini-file-loader": "^4.4.8",
31
- "@smithy/types": "^4.14.0",
32
- "@smithy/url-parser": "^4.2.13",
33
- "@smithy/util-middleware": "^4.2.13",
27
+ "@smithy/core": "^3.23.16",
28
+ "@smithy/middleware-serde": "^4.2.19",
29
+ "@smithy/node-config-provider": "^4.3.14",
30
+ "@smithy/shared-ini-file-loader": "^4.4.9",
31
+ "@smithy/types": "^4.14.1",
32
+ "@smithy/url-parser": "^4.2.14",
33
+ "@smithy/util-middleware": "^4.2.14",
34
34
  "tslib": "^2.6.2"
35
35
  },
36
36
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-retry",
3
- "version": "4.5.0",
3
+ "version": "4.5.4",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline middleware-retry",
@@ -33,14 +33,14 @@
33
33
  "license": "Apache-2.0",
34
34
  "sideEffects": false,
35
35
  "dependencies": {
36
- "@smithy/core": "^3.23.14",
37
- "@smithy/node-config-provider": "^4.3.13",
38
- "@smithy/protocol-http": "^5.3.13",
39
- "@smithy/service-error-classification": "^4.2.13",
40
- "@smithy/smithy-client": "^4.12.9",
41
- "@smithy/types": "^4.14.0",
42
- "@smithy/util-middleware": "^4.2.13",
43
- "@smithy/util-retry": "^4.3.0",
36
+ "@smithy/core": "^3.23.16",
37
+ "@smithy/node-config-provider": "^4.3.14",
38
+ "@smithy/protocol-http": "^5.3.14",
39
+ "@smithy/service-error-classification": "^4.3.0",
40
+ "@smithy/smithy-client": "^4.12.12",
41
+ "@smithy/types": "^4.14.1",
42
+ "@smithy/util-middleware": "^4.2.14",
43
+ "@smithy/util-retry": "^4.3.3",
44
44
  "@smithy/uuid": "^1.1.2",
45
45
  "tslib": "^2.6.2"
46
46
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-serde",
3
- "version": "4.2.17",
3
+ "version": "4.2.19",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline middleware-serde",
@@ -25,9 +25,9 @@
25
25
  "license": "Apache-2.0",
26
26
  "sideEffects": false,
27
27
  "dependencies": {
28
- "@smithy/core": "^3.23.14",
29
- "@smithy/protocol-http": "^5.3.13",
30
- "@smithy/types": "^4.14.0",
28
+ "@smithy/core": "^3.23.16",
29
+ "@smithy/protocol-http": "^5.3.14",
30
+ "@smithy/types": "^4.14.1",
31
31
  "tslib": "^2.6.2"
32
32
  },
33
33
  "engines": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-stack",
3
- "version": "4.2.13",
3
+ "version": "4.2.14",
4
4
  "description": "Provides a means for composing multiple middleware functions into a single handler",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
@@ -26,7 +26,7 @@
26
26
  "module": "./dist-es/index.js",
27
27
  "types": "./dist-types/index.d.ts",
28
28
  "dependencies": {
29
- "@smithy/types": "^4.14.0",
29
+ "@smithy/types": "^4.14.1",
30
30
  "tslib": "^2.6.2"
31
31
  },
32
32
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/node-config-provider",
3
- "version": "4.3.13",
3
+ "version": "4.3.14",
4
4
  "description": "Load config default values from ini config files and environmental variable",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
@@ -25,9 +25,9 @@
25
25
  "module": "./dist-es/index.js",
26
26
  "types": "./dist-types/index.d.ts",
27
27
  "dependencies": {
28
- "@smithy/property-provider": "^4.2.13",
29
- "@smithy/shared-ini-file-loader": "^4.4.8",
30
- "@smithy/types": "^4.14.0",
28
+ "@smithy/property-provider": "^4.2.14",
29
+ "@smithy/shared-ini-file-loader": "^4.4.9",
30
+ "@smithy/types": "^4.14.1",
31
31
  "tslib": "^2.6.2"
32
32
  },
33
33
  "devDependencies": {
@@ -425,58 +425,119 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
425
425
  }
426
426
  }
427
427
 
428
+ const ids = new Uint16Array(1);
429
+ class ClientHttp2SessionRef {
430
+ id = ids[0]++;
431
+ total = 0;
432
+ max = 0;
433
+ session;
434
+ refs = 0;
435
+ constructor(session) {
436
+ session.unref();
437
+ this.session = session;
438
+ }
439
+ retain() {
440
+ if (this.session.destroyed) {
441
+ throw new Error("@smithy/node-http-handler - cannot acquire reference to destroyed session.");
442
+ }
443
+ this.refs += 1;
444
+ this.total += 1;
445
+ this.max = Math.max(this.refs, this.max);
446
+ this.session.ref();
447
+ }
448
+ free() {
449
+ if (this.session.destroyed) {
450
+ return;
451
+ }
452
+ this.refs -= 1;
453
+ if (this.refs === 0) {
454
+ this.session.unref();
455
+ }
456
+ if (this.refs < 0) {
457
+ throw new Error("@smithy/node-http-handler - ClientHttp2Session refcount at zero, cannot decrement.");
458
+ }
459
+ }
460
+ deref() {
461
+ return this.session;
462
+ }
463
+ destroy() {
464
+ this.refs = 0;
465
+ if (!this.session.destroyed) {
466
+ this.session.destroy();
467
+ }
468
+ }
469
+ useCount() {
470
+ return this.refs;
471
+ }
472
+ }
473
+
428
474
  class NodeHttp2ConnectionPool {
429
475
  sessions = [];
476
+ maxConcurrency = 0;
430
477
  constructor(sessions) {
431
- this.sessions = sessions ?? [];
478
+ this.sessions = (sessions ?? []).map((session) => new ClientHttp2SessionRef(session));
432
479
  }
433
480
  poll() {
434
- if (this.sessions.length > 0) {
435
- return this.sessions.shift();
481
+ let cleanup = false;
482
+ for (const session of this.sessions) {
483
+ if (session.deref().destroyed) {
484
+ cleanup = true;
485
+ continue;
486
+ }
487
+ if (!this.maxConcurrency || session.useCount() < this.maxConcurrency) {
488
+ return session;
489
+ }
490
+ }
491
+ if (cleanup) {
492
+ for (const session of this.sessions) {
493
+ if (session.deref().destroyed) {
494
+ this.remove(session);
495
+ }
496
+ }
436
497
  }
437
498
  }
438
- offerLast(session) {
439
- this.sessions.push(session);
440
- }
441
- contains(session) {
442
- return this.sessions.includes(session);
499
+ offerLast(ref) {
500
+ this.sessions.push(ref);
443
501
  }
444
- remove(session) {
445
- this.sessions = this.sessions.filter((s) => s !== session);
502
+ remove(ref) {
503
+ const ix = this.sessions.indexOf(ref);
504
+ if (ix > -1) {
505
+ this.sessions.splice(ix, 1);
506
+ }
446
507
  }
447
508
  [Symbol.iterator]() {
448
509
  return this.sessions[Symbol.iterator]();
449
510
  }
450
- destroy(connection) {
451
- for (const session of this.sessions) {
452
- if (session === connection) {
453
- if (!session.destroyed) {
454
- session.destroy();
455
- }
456
- }
457
- }
511
+ setMaxConcurrency(maxConcurrency) {
512
+ this.maxConcurrency = maxConcurrency;
513
+ }
514
+ destroy(ref) {
515
+ this.remove(ref);
516
+ ref.destroy();
458
517
  }
459
518
  }
460
519
 
461
520
  class NodeHttp2ConnectionManager {
521
+ config;
522
+ connectionPools = new Map();
462
523
  constructor(config) {
463
524
  this.config = config;
464
525
  if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) {
465
526
  throw new RangeError("maxConcurrency must be greater than zero.");
466
527
  }
467
528
  }
468
- config;
469
- sessionCache = new Map();
470
529
  lease(requestContext, connectionConfiguration) {
471
530
  const url = this.getUrlString(requestContext);
472
- const existingPool = this.sessionCache.get(url);
473
- if (existingPool) {
474
- const existingSession = existingPool.poll();
475
- if (existingSession && !this.config.disableConcurrency) {
476
- return existingSession;
531
+ const pool = this.getPool(url);
532
+ if (!this.config.disableConcurrency && !connectionConfiguration.isEventStream) {
533
+ const available = pool.poll();
534
+ if (available) {
535
+ available.retain();
536
+ return available;
477
537
  }
478
538
  }
479
- const session = http2.connect(url);
539
+ const ref = new ClientHttp2SessionRef(http2.connect(url));
540
+ const session = ref.deref();
480
541
  if (this.config.maxConcurrency) {
481
542
  session.settings({ maxConcurrentStreams: this.config.maxConcurrency }, (err) => {
482
543
  if (err) {
@@ -487,47 +548,48 @@ class NodeHttp2ConnectionManager {
487
548
  }
488
549
  });
489
550
  }
490
- session.unref();
491
551
  const destroySessionCb = () => {
492
552
  session.destroy();
493
- this.deleteSession(url, session);
553
+ this.removeFromPool(url, ref);
494
554
  };
495
555
  session.on("goaway", destroySessionCb);
496
556
  session.on("error", destroySessionCb);
497
557
  session.on("frameError", destroySessionCb);
498
- session.on("close", () => this.deleteSession(url, session));
558
+ session.on("close", () => this.removeFromPool(url, ref));
499
559
  if (connectionConfiguration.requestTimeout) {
500
560
  session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb);
501
561
  }
502
- const connectionPool = this.sessionCache.get(url) || new NodeHttp2ConnectionPool();
503
- connectionPool.offerLast(session);
504
- this.sessionCache.set(url, connectionPool);
505
- return session;
562
+ pool.offerLast(ref);
563
+ ref.retain();
564
+ return ref;
506
565
  }
507
- deleteSession(authority, session) {
508
- const existingConnectionPool = this.sessionCache.get(authority);
509
- if (!existingConnectionPool) {
510
- return;
511
- }
512
- if (!existingConnectionPool.contains(session)) {
513
- return;
514
- }
515
- existingConnectionPool.remove(session);
516
- this.sessionCache.set(authority, existingConnectionPool);
566
+ release(_requestContext, ref) {
567
+ ref.free();
517
568
  }
518
- release(requestContext, session) {
519
- const cacheKey = this.getUrlString(requestContext);
520
- this.sessionCache.get(cacheKey)?.offerLast(session);
569
+ createIsolatedSession(requestContext, connectionConfiguration) {
570
+ const url = this.getUrlString(requestContext);
571
+ const ref = new ClientHttp2SessionRef(http2.connect(url));
572
+ const session = ref.deref();
573
+ session.settings({ maxConcurrentStreams: 1 });
574
+ const destroySession = () => {
575
+ session.destroy();
576
+ };
577
+ session.on("goaway", destroySession);
578
+ session.on("error", destroySession);
579
+ session.on("frameError", destroySession);
580
+ session.on("close", destroySession);
581
+ if (connectionConfiguration.requestTimeout) {
582
+ session.setTimeout(connectionConfiguration.requestTimeout, destroySession);
583
+ }
584
+ ref.retain();
585
+ return ref;
521
586
  }
522
587
  destroy() {
523
- for (const [key, connectionPool] of this.sessionCache) {
524
- for (const session of connectionPool) {
525
- if (!session.destroyed) {
526
- session.destroy();
527
- }
528
- connectionPool.remove(session);
588
+ for (const [url, connectionPool] of this.connectionPools) {
589
+ for (const session of [...connectionPool]) {
590
+ session.destroy();
529
591
  }
530
- this.sessionCache.delete(key);
592
+ this.connectionPools.delete(url);
531
593
  }
532
594
  }
533
595
  setMaxConcurrentStreams(maxConcurrentStreams) {
@@ -535,10 +597,42 @@ class NodeHttp2ConnectionManager {
535
597
  throw new RangeError("maxConcurrentStreams must be greater than zero.");
536
598
  }
537
599
  this.config.maxConcurrency = maxConcurrentStreams;
600
+ for (const pool of this.connectionPools.values()) {
601
+ pool.setMaxConcurrency(maxConcurrentStreams);
602
+ }
538
603
  }
539
604
  setDisableConcurrentStreams(disableConcurrentStreams) {
540
605
  this.config.disableConcurrency = disableConcurrentStreams;
541
606
  }
607
+ debug() {
608
+ const pools = {};
609
+ for (const [url, pool] of this.connectionPools) {
610
+ const sessions = [];
611
+ for (const ref of pool) {
612
+ sessions.push({
613
+ id: ref.id,
614
+ active: ref.useCount(),
615
+ maxConcurrent: ref.max,
616
+ totalRequests: ref.total,
617
+ });
618
+ }
619
+ pools[url] = { sessions };
620
+ }
621
+ return pools;
622
+ }
623
+ removeFromPool(authority, ref) {
624
+ this.connectionPools.get(authority)?.remove(ref);
625
+ }
626
+ getPool(url) {
627
+ if (!this.connectionPools.has(url)) {
628
+ const pool = new NodeHttp2ConnectionPool();
629
+ if (this.config.maxConcurrency) {
630
+ pool.setMaxConcurrency(this.config.maxConcurrency);
631
+ }
632
+ this.connectionPools.set(url, pool);
633
+ }
634
+ return this.connectionPools.get(url);
635
+ }
542
636
  getUrlString(request) {
543
637
  return request.destination.toString();
544
638
  }
@@ -572,15 +666,17 @@ class NodeHttp2Handler {
572
666
  destroy() {
573
667
  this.connectionManager.destroy();
574
668
  }
575
- async handle(request, { abortSignal, requestTimeout } = {}) {
669
+ async handle(request, { abortSignal, requestTimeout, isEventStream } = {}) {
576
670
  if (!this.config) {
577
671
  this.config = await this.configProvider;
578
- this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false);
579
- if (this.config.maxConcurrentStreams) {
580
- this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams);
672
+ const { disableConcurrentStreams, maxConcurrentStreams } = this.config;
673
+ this.connectionManager.setDisableConcurrentStreams(disableConcurrentStreams ?? false);
674
+ if (maxConcurrentStreams) {
675
+ this.connectionManager.setMaxConcurrentStreams(maxConcurrentStreams);
581
676
  }
582
677
  }
583
678
  const { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config;
679
+ const useIsolatedSession = disableConcurrentStreams || isEventStream;
584
680
  const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout;
585
681
  return new Promise((_resolve, _reject) => {
586
682
  let fulfilled = false;
@@ -608,18 +704,22 @@ class NodeHttp2Handler {
608
704
  }
609
705
  const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`;
610
706
  const requestContext = { destination: new URL(authority) };
611
- const session = this.connectionManager.lease(requestContext, {
707
+ const connectConfig = {
612
708
  requestTimeout: this.config?.sessionTimeout,
613
- disableConcurrentStreams: disableConcurrentStreams || false,
614
- });
709
+ isEventStream,
710
+ };
711
+ const ref = useIsolatedSession
712
+ ? this.connectionManager.createIsolatedSession(requestContext, connectConfig)
713
+ : this.connectionManager.lease(requestContext, connectConfig);
714
+ const session = ref.deref();
615
715
  const rejectWithDestroy = (err) => {
616
- if (disableConcurrentStreams) {
617
- this.destroySession(session);
716
+ if (useIsolatedSession) {
717
+ ref.destroy();
618
718
  }
619
719
  fulfilled = true;
620
720
  reject(err);
621
721
  };
622
- const queryString = querystringBuilder.buildQueryString(query || {});
722
+ const queryString = querystringBuilder.buildQueryString(query ?? {});
623
723
  let path = request.path;
624
724
  if (queryString) {
625
725
  path += `?${queryString}`;
@@ -627,28 +727,14 @@ class NodeHttp2Handler {
627
727
  if (request.fragment) {
628
728
  path += `#${request.fragment}`;
629
729
  }
630
- const req = session.request({
730
+ const clientHttp2Stream = session.request({
631
731
  ...request.headers,
632
732
  [http2.constants.HTTP2_HEADER_PATH]: path,
633
733
  [http2.constants.HTTP2_HEADER_METHOD]: method,
634
734
  });
635
- session.ref();
636
- req.on("response", (headers) => {
637
- const httpResponse = new protocolHttp.HttpResponse({
638
- statusCode: headers[":status"] || -1,
639
- headers: getTransformedHeaders(headers),
640
- body: req,
641
- });
642
- fulfilled = true;
643
- resolve({ response: httpResponse });
644
- if (disableConcurrentStreams) {
645
- session.close();
646
- this.connectionManager.deleteSession(authority, session);
647
- }
648
- });
649
735
  if (effectiveRequestTimeout) {
650
- req.setTimeout(effectiveRequestTimeout, () => {
651
- req.close();
736
+ clientHttp2Stream.setTimeout(effectiveRequestTimeout, () => {
737
+ clientHttp2Stream.close();
652
738
  const timeoutError = new Error(`Stream timed out because of no activity for ${effectiveRequestTimeout} ms`);
653
739
  timeoutError.name = "TimeoutError";
654
740
  rejectWithDestroy(timeoutError);
@@ -656,36 +742,50 @@ class NodeHttp2Handler {
656
742
  }
657
743
  if (abortSignal) {
658
744
  const onAbort = () => {
659
- req.close();
745
+ clientHttp2Stream.close();
660
746
  const abortError = buildAbortError(abortSignal);
661
747
  rejectWithDestroy(abortError);
662
748
  };
663
749
  if (typeof abortSignal.addEventListener === "function") {
664
750
  const signal = abortSignal;
665
751
  signal.addEventListener("abort", onAbort, { once: true });
666
- req.once("close", () => signal.removeEventListener("abort", onAbort));
752
+ clientHttp2Stream.once("close", () => signal.removeEventListener("abort", onAbort));
667
753
  }
668
754
  else {
669
755
  abortSignal.onabort = onAbort;
670
756
  }
671
757
  }
672
- req.on("frameError", (type, code, id) => {
758
+ clientHttp2Stream.on("frameError", (type, code, id) => {
673
759
  rejectWithDestroy(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`));
674
760
  });
675
- req.on("error", rejectWithDestroy);
676
- req.on("aborted", () => {
677
- rejectWithDestroy(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${req.rstCode}.`));
761
+ clientHttp2Stream.on("error", rejectWithDestroy);
762
+ clientHttp2Stream.on("aborted", () => {
763
+ rejectWithDestroy(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${clientHttp2Stream.rstCode}.`));
678
764
  });
679
- req.on("close", () => {
680
- session.unref();
681
- if (disableConcurrentStreams) {
682
- session.destroy();
765
+ clientHttp2Stream.on("response", (headers) => {
766
+ const httpResponse = new protocolHttp.HttpResponse({
767
+ statusCode: headers[":status"] ?? -1,
768
+ headers: getTransformedHeaders(headers),
769
+ body: clientHttp2Stream,
770
+ });
771
+ fulfilled = true;
772
+ resolve({ response: httpResponse });
773
+ if (useIsolatedSession) {
774
+ session.close();
775
+ }
776
+ });
777
+ clientHttp2Stream.on("close", () => {
778
+ if (useIsolatedSession) {
779
+ ref.destroy();
780
+ }
781
+ else {
782
+ this.connectionManager.release(requestContext, ref);
683
783
  }
684
784
  if (!fulfilled) {
685
785
  rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response"));
686
786
  }
687
787
  });
688
- writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout);
788
+ writeRequestBodyPromise = writeRequestBody(clientHttp2Stream, request, effectiveRequestTimeout);
689
789
  });
690
790
  }
691
791
  updateHttpClientConfig(key, value) {
@@ -700,11 +800,6 @@ class NodeHttp2Handler {
700
800
  httpHandlerConfigs() {
701
801
  return this.config ?? {};
702
802
  }
703
- destroySession(session) {
704
- if (!session.destroyed) {
705
- session.destroy();
706
- }
707
- }
708
803
  }
709
804
 
710
805
  class Collector extends node_stream.Writable {