From 84747eca2bd5bbd08d7d566b05d313e955b750d9 Mon Sep 17 00:00:00 2001 From: hkobew Date: Fri, 14 Mar 2025 09:33:47 -0400 Subject: [PATCH 1/6] deps: install v3 client --- package-lock.json | 526 +++++++++++++++++++++++++++++++++++++ packages/core/package.json | 1 + 2 files changed, 527 insertions(+) diff --git a/package-lock.json b/package-lock.json index 57c19d1d7a1..af3126dbc66 100644 --- a/package-lock.json +++ b/package-lock.json @@ -666,6 +666,531 @@ "node": ">=16.0.0" } }, + "node_modules/@aws-sdk/client-cloudcontrol": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-cloudcontrol/-/client-cloudcontrol-3.693.0.tgz", + "integrity": "sha512-kD5uaXjZ7KCLg+JTU6c49Ic1LkM821RNVj82Tgjmx7hS1JpChmf/q0v3XxRQU9GzA4Ip+gDxH/je7dzL9OxBIQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.693.0", + "@aws-sdk/client-sts": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "@smithy/util-waiter": "^3.1.8", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/client-sso": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.693.0.tgz", + "integrity": "sha512-QEynrBC26x6TG9ZMzApR/kZ3lmt4lEIs2D+cHuDxt6fDGzahBUsQFBwJqhizzsM97JJI5YvmJhmihoYjdSSaXA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.693.0.tgz", + "integrity": "sha512-UEDbYlYtK/e86OOMyFR4zEPyenIxDzO2DRdz3fwVW7RzZ94wfmSwBh/8skzPTuY1G7sI064cjHW0b0QG01Sdtg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/client-sts": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.693.0.tgz", + "integrity": "sha512-4S2y7VEtvdnjJX4JPl4kDQlslxXEZFnC50/UXVUYSt/AMc5A/GgspFNA5FVz4E3Gwpfobbf23hR2NBF8AGvYoQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-node": "3.693.0", + "@aws-sdk/middleware-host-header": "3.693.0", + "@aws-sdk/middleware-logger": "3.693.0", + "@aws-sdk/middleware-recursion-detection": "3.693.0", + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/region-config-resolver": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@aws-sdk/util-user-agent-browser": "3.693.0", + "@aws-sdk/util-user-agent-node": "3.693.0", + "@smithy/config-resolver": "^3.0.11", + "@smithy/core": "^2.5.2", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/hash-node": "^3.0.9", + "@smithy/invalid-dependency": "^3.0.9", + "@smithy/middleware-content-length": "^3.0.11", + "@smithy/middleware-endpoint": "^3.2.2", + "@smithy/middleware-retry": "^3.0.26", + "@smithy/middleware-serde": "^3.0.9", + "@smithy/middleware-stack": "^3.0.9", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/url-parser": "^3.0.9", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.26", + "@smithy/util-defaults-mode-node": "^3.0.26", + "@smithy/util-endpoints": "^2.1.5", + "@smithy/util-middleware": "^3.0.9", + "@smithy/util-retry": "^3.0.9", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/core": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.693.0.tgz", + "integrity": "sha512-v6Z/kWmLFqRLDPEwl9hJGhtTgIFHjZugSfF1Yqffdxf4n1AWgtHS7qSegakuMyN5pP4K2tvUD8qHJ+gGe2Bw2A==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/core": "^2.5.2", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/signature-v4": "^4.2.2", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-middleware": "^3.0.9", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.693.0.tgz", + "integrity": "sha512-sL8MvwNJU7ZpD7/d2VVb3by1GknIJUxzTIgYtVkDVA/ojo+KRQSSHxcj0EWWXF5DTSh2Tm+LrEug3y1ZyKHsDA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/fetch-http-handler": "^4.1.0", + "@smithy/node-http-handler": "^3.3.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/protocol-http": "^4.1.6", + "@smithy/smithy-client": "^3.4.3", + "@smithy/types": "^3.7.0", + "@smithy/util-stream": "^3.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.693.0.tgz", + "integrity": "sha512-kvaa4mXhCCOuW7UQnBhYqYfgWmwy7WSBSDClutwSLPZvgrhYj2l16SD2lN4IfYdxARYMJJ1lFYp3/jJG/9Yk4Q==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/credential-provider-env": "3.693.0", + "@aws-sdk/credential-provider-http": "3.693.0", + "@aws-sdk/credential-provider-process": "3.693.0", + "@aws-sdk/credential-provider-sso": "3.693.0", + "@aws-sdk/credential-provider-web-identity": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.693.0.tgz", + "integrity": "sha512-42WMsBjTNnjYxYuM3qD/Nq+8b7UdMopUq5OduMDxoM3mFTV6PXMMnfI4Z1TNnR4tYRvPXAnuNltF6xmjKbSJRA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.693.0", + "@aws-sdk/credential-provider-http": "3.693.0", + "@aws-sdk/credential-provider-ini": "3.693.0", + "@aws-sdk/credential-provider-process": "3.693.0", + "@aws-sdk/credential-provider-sso": "3.693.0", + "@aws-sdk/credential-provider-web-identity": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/credential-provider-imds": "^3.2.6", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.693.0.tgz", + "integrity": "sha512-479UlJxY+BFjj3pJFYUNC0DCMrykuG7wBAXfsvZqQxKUa83DnH5Q1ID/N2hZLkxjGd4ZW0AC3lTOMxFelGzzpQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-sso": "3.693.0", + "@aws-sdk/core": "3.693.0", + "@aws-sdk/token-providers": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.693.0.tgz", + "integrity": "sha512-8LB210Pr6VeCiSb2hIra+sAH4KUBLyGaN50axHtIgufVK8jbKIctTZcVY5TO9Se+1107TsruzeXS7VeqVdJfFA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.693.0.tgz", + "integrity": "sha512-BCki6sAZ5jYwIN/t3ElCiwerHad69ipHwPsDCxJQyeiOnJ8HG+lEpnVIfrnI8A0fLQNSF3Gtx6ahfBpKiv1Oug==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/middleware-logger": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.693.0.tgz", + "integrity": "sha512-dXnXDPr+wIiJ1TLADACI1g9pkSB21KkMIko2u4CJ2JCBoxi5IqeTnVoa6YcC8GdFNVRl+PorZ3Zqfmf1EOTC6w==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.693.0.tgz", + "integrity": "sha512-0LDmM+VxXp0u3rG0xQRWD/q6Ubi7G8I44tBPahevD5CaiDZTkmNTrVUf0VEJgVe0iCKBppACMBDkLB0/ETqkFw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.693.0.tgz", + "integrity": "sha512-/KUq/KEpFFbQmNmpp7SpAtFAdViquDfD2W0QcG07zYBfz9MwE2ig48ALynXm5sMpRmnG7sJXjdvPtTsSVPfkiw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@aws-sdk/util-endpoints": "3.693.0", + "@smithy/core": "^2.5.2", + "@smithy/protocol-http": "^4.1.6", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.693.0.tgz", + "integrity": "sha512-YLUkMsUY0GLW/nfwlZ69cy1u07EZRmsv8Z9m0qW317/EZaVx59hcvmcvb+W4bFqj5E8YImTjoGfE4cZ0F9mkyw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/types": "^3.7.0", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.9", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/token-providers": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.693.0.tgz", + "integrity": "sha512-nDBTJMk1l/YmFULGfRbToOA2wjf+FkQT4dMgYCv+V9uSYsMzQj8A7Tha2dz9yv4vnQgYaEiErQ8d7HVyXcVEoA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/property-provider": "^3.1.9", + "@smithy/shared-ini-file-loader": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sso-oidc": "^3.693.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/util-endpoints": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.693.0.tgz", + "integrity": "sha512-eo4F6DRQ/kxS3gxJpLRv+aDNy76DxQJL5B3DPzpr9Vkq0ygVoi4GT5oIZLVaAVIJmi6k5qq9dLsYZfWLUxJJSg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "@smithy/util-endpoints": "^2.1.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.693.0.tgz", + "integrity": "sha512-6EUfuKOujtddy18OLJUaXfKBgs+UcbZ6N/3QV4iOkubCUdeM1maIqs++B9bhCbWeaeF5ORizJw5FTwnyNjE/mw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.692.0", + "@smithy/types": "^3.7.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.693.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.693.0.tgz", + "integrity": "sha512-td0OVX8m5ZKiXtecIDuzY3Y3UZIzvxEr57Hp21NOwieqKCG2UeyQWWeGPv0FQaU7dpTkvFmVNI+tx9iB8V/Nhg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.693.0", + "@aws-sdk/types": "3.692.0", + "@smithy/node-config-provider": "^3.1.10", + "@smithy/types": "^3.7.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@smithy/is-array-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", + "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@smithy/util-buffer-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", + "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-cloudcontrol/node_modules/@smithy/util-utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", + "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/@aws-sdk/client-cloudformation": { "version": "3.682.0", "license": "Apache-2.0", @@ -23796,6 +24321,7 @@ "@amzn/amazon-q-developer-streaming-client": "file:../../src.gen/@amzn/amazon-q-developer-streaming-client", "@amzn/codewhisperer-streaming": "file:../../src.gen/@amzn/codewhisperer-streaming", "@aws-sdk/client-api-gateway": "<3.696.0", + "@aws-sdk/client-cloudcontrol": "<3.696.0", "@aws-sdk/client-cloudformation": "<3.696.0", "@aws-sdk/client-cloudwatch-logs": "<3.696.0", "@aws-sdk/client-codecatalyst": "<3.696.0", diff --git a/packages/core/package.json b/packages/core/package.json index cca6d60ce03..213fa4b0c6f 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -510,6 +510,7 @@ "@aws-sdk/client-ssm": "<3.696.0", "@aws-sdk/client-sso": "<3.696.0", "@aws-sdk/client-sso-oidc": "<3.696.0", + "@aws-sdk/client-cloudcontrol": "<3.696.0", "@aws-sdk/credential-provider-env": "<3.696.0", "@aws-sdk/credential-provider-process": "<3.696.0", "@aws-sdk/credential-provider-sso": "<3.696.0", From f0f202cf71ddb4d3c69257f419dde2a18e734f30 Mon Sep 17 00:00:00 2001 From: hkobew Date: Fri, 14 Mar 2025 09:34:53 -0400 Subject: [PATCH 2/6] refactor: rename client and file --- packages/core/src/dynamicResources/commands/deleteResource.ts | 2 +- packages/core/src/dynamicResources/commands/saveResource.ts | 2 +- .../src/dynamicResources/explorer/nodes/resourceTypeNode.ts | 2 +- .../core/src/dynamicResources/explorer/nodes/resourcesNode.ts | 4 ++-- .../shared/clients/{cloudControlClient.ts => cloudControl.ts} | 4 +--- .../core/src/test/dynamicResources/awsResourceManager.test.ts | 4 ++-- .../src/test/dynamicResources/commands/deleteResource.test.ts | 4 ++-- .../src/test/dynamicResources/commands/saveResource.test.ts | 2 +- .../test/dynamicResources/explorer/moreResourcesNode.test.ts | 2 +- .../test/dynamicResources/explorer/resourceTypeNode.test.ts | 2 +- 10 files changed, 13 insertions(+), 15 deletions(-) rename packages/core/src/shared/clients/{cloudControlClient.ts => cloudControl.ts} (95%) diff --git a/packages/core/src/dynamicResources/commands/deleteResource.ts b/packages/core/src/dynamicResources/commands/deleteResource.ts index a255321a8aa..8ed475aea61 100644 --- a/packages/core/src/dynamicResources/commands/deleteResource.ts +++ b/packages/core/src/dynamicResources/commands/deleteResource.ts @@ -7,7 +7,7 @@ import * as vscode from 'vscode' import * as nls from 'vscode-nls' import { getLogger } from '../../shared/logger/logger' import { showConfirmationMessage, showViewLogsMessage } from '../../shared/utilities/messages' -import { CloudControlClient } from '../../shared/clients/cloudControlClient' +import { CloudControlClient } from '../../shared/clients/cloudControl' import globals from '../../shared/extensionGlobals' import { telemetry } from '../../shared/telemetry/telemetry' import { millisecondsSince, Result } from '../../shared/telemetry/telemetry' diff --git a/packages/core/src/dynamicResources/commands/saveResource.ts b/packages/core/src/dynamicResources/commands/saveResource.ts index c84f432f256..1f696513c65 100644 --- a/packages/core/src/dynamicResources/commands/saveResource.ts +++ b/packages/core/src/dynamicResources/commands/saveResource.ts @@ -12,7 +12,7 @@ import { compare, Operation } from 'fast-json-patch' import { ResourceNode } from '../explorer/nodes/resourceNode' import { ResourceTypeNode } from '../explorer/nodes/resourceTypeNode' import { AwsResourceManager } from '../awsResourceManager' -import { CloudControlClient } from '../../shared/clients/cloudControlClient' +import { CloudControlClient } from '../../shared/clients/cloudControl' import { CloudControl } from 'aws-sdk' import globals from '../../shared/extensionGlobals' import { telemetry } from '../../shared/telemetry/telemetry' diff --git a/packages/core/src/dynamicResources/explorer/nodes/resourceTypeNode.ts b/packages/core/src/dynamicResources/explorer/nodes/resourceTypeNode.ts index e3d6c2b244e..cba2274b162 100644 --- a/packages/core/src/dynamicResources/explorer/nodes/resourceTypeNode.ts +++ b/packages/core/src/dynamicResources/explorer/nodes/resourceTypeNode.ts @@ -5,7 +5,7 @@ import * as vscode from 'vscode' import { ChildNodeLoader, ChildNodePage } from '../../../awsexplorer/childNodeLoader' -import { CloudControlClient } from '../../../shared/clients/cloudControlClient' +import { CloudControlClient } from '../../../shared/clients/cloudControl' import { getLogger } from '../../../shared/logger/logger' import { AWSTreeNodeBase } from '../../../shared/treeview/nodes/awsTreeNodeBase' import { LoadMoreNode } from '../../../shared/treeview/nodes/loadMoreNode' diff --git a/packages/core/src/dynamicResources/explorer/nodes/resourcesNode.ts b/packages/core/src/dynamicResources/explorer/nodes/resourcesNode.ts index 313ce4e7d2a..0b281b7500b 100644 --- a/packages/core/src/dynamicResources/explorer/nodes/resourcesNode.ts +++ b/packages/core/src/dynamicResources/explorer/nodes/resourcesNode.ts @@ -12,7 +12,7 @@ import { makeChildrenNodes } from '../../../shared/treeview/utils' import { toArrayAsync, updateInPlace } from '../../../shared/utilities/collectionUtils' import { ResourceTypeNode } from './resourceTypeNode' import { CloudFormation } from 'aws-sdk' -import { CloudControlClient, DefaultCloudControlClient } from '../../../shared/clients/cloudControlClient' +import { CloudControlClient, CloudControlClient } from '../../../shared/clients/cloudControl' import { memoizedGetResourceTypes, ResourceTypeMetadata } from '../../model/resources' import { ResourcesSettings } from '../../commands/configure' @@ -24,7 +24,7 @@ export class ResourcesNode extends AWSTreeNodeBase { public constructor( public readonly region: string, public readonly cloudFormation: CloudFormationClient = new DefaultCloudFormationClient(region), - private readonly cloudControl: CloudControlClient = new DefaultCloudControlClient(region), + private readonly cloudControl: CloudControlClient = new CloudControlClient(region), private readonly settings = new ResourcesSettings() ) { super(localize('AWS.explorerNode.resources.label', 'Resources'), vscode.TreeItemCollapsibleState.Collapsed) diff --git a/packages/core/src/shared/clients/cloudControlClient.ts b/packages/core/src/shared/clients/cloudControl.ts similarity index 95% rename from packages/core/src/shared/clients/cloudControlClient.ts rename to packages/core/src/shared/clients/cloudControl.ts index 7eb4ca4817d..d9dc6da9278 100644 --- a/packages/core/src/shared/clients/cloudControlClient.ts +++ b/packages/core/src/shared/clients/cloudControl.ts @@ -5,11 +5,9 @@ import { CloudControl } from 'aws-sdk' import globals from '../extensionGlobals' -import { ClassToInterfaceType } from '../utilities/tsUtils' import { localize } from '../utilities/vsCodeUtils' -export type CloudControlClient = ClassToInterfaceType -export class DefaultCloudControlClient implements CloudControlClient { +export class CloudControlClient { public constructor(public readonly regionCode: string) {} public async createResource(request: CloudControl.CreateResourceInput): Promise { diff --git a/packages/core/src/test/dynamicResources/awsResourceManager.test.ts b/packages/core/src/test/dynamicResources/awsResourceManager.test.ts index 03bd07a25dc..71afbf63700 100644 --- a/packages/core/src/test/dynamicResources/awsResourceManager.test.ts +++ b/packages/core/src/test/dynamicResources/awsResourceManager.test.ts @@ -12,7 +12,7 @@ import { ResourcesNode } from '../../dynamicResources/explorer/nodes/resourcesNo import { ResourceNode } from '../../dynamicResources/explorer/nodes/resourceNode' import { ResourceTypeNode } from '../../dynamicResources/explorer/nodes/resourceTypeNode' import { formatResourceModel, AwsResourceManager } from '../../dynamicResources/awsResourceManager' -import { CloudControlClient, DefaultCloudControlClient } from '../../shared/clients/cloudControlClient' +import { CloudControlClient, CloudControlClient } from '../../shared/clients/cloudControl' import { CloudFormationClient, DefaultCloudFormationClient } from '../../shared/clients/cloudFormationClient' import { makeTemporaryToolkitFolder, readFileAsString } from '../../shared/filesystemUtilities' import { FakeExtensionContext } from '../fakeExtensionContext' @@ -48,7 +48,7 @@ describe('ResourceManager', function () { } beforeEach(async function () { - cloudControl = stub(DefaultCloudControlClient, { + cloudControl = stub(CloudControlClient, { regionCode: '', }) cloudFormation = stub(DefaultCloudFormationClient, { diff --git a/packages/core/src/test/dynamicResources/commands/deleteResource.test.ts b/packages/core/src/test/dynamicResources/commands/deleteResource.test.ts index 068dbf97445..099bf4acda9 100644 --- a/packages/core/src/test/dynamicResources/commands/deleteResource.test.ts +++ b/packages/core/src/test/dynamicResources/commands/deleteResource.test.ts @@ -6,13 +6,13 @@ import * as sinon from 'sinon' import assert from 'assert' import { deleteResource } from '../../../dynamicResources/commands/deleteResource' -import { DefaultCloudControlClient } from '../../../shared/clients/cloudControlClient' +import { CloudControlClient } from '../../../shared/clients/cloudControl' import { assertNoErrorMessages, getTestWindow } from '../../shared/vscode/window' describe('deleteResource', function () { const fakeType = 'fakeType' const fakeIdentifier = 'fakeIdentifier' - const cloudControl = new DefaultCloudControlClient('') + const cloudControl = new CloudControlClient('') let sandbox: sinon.SinonSandbox beforeEach(function () { diff --git a/packages/core/src/test/dynamicResources/commands/saveResource.test.ts b/packages/core/src/test/dynamicResources/commands/saveResource.test.ts index 1e00284aa58..c57317ac89a 100644 --- a/packages/core/src/test/dynamicResources/commands/saveResource.test.ts +++ b/packages/core/src/test/dynamicResources/commands/saveResource.test.ts @@ -6,7 +6,7 @@ import assert from 'assert' import { createResource, updateResource } from '../../../dynamicResources/commands/saveResource' import { AddOperation } from 'fast-json-patch' -import { CloudControlClient } from '../../../shared/clients/cloudControlClient' +import { CloudControlClient } from '../../../shared/clients/cloudControl' import { getTestWindow } from '../../shared/vscode/window' import sinon from 'sinon' diff --git a/packages/core/src/test/dynamicResources/explorer/moreResourcesNode.test.ts b/packages/core/src/test/dynamicResources/explorer/moreResourcesNode.test.ts index 4719c0e87db..8898bdf6b5f 100644 --- a/packages/core/src/test/dynamicResources/explorer/moreResourcesNode.test.ts +++ b/packages/core/src/test/dynamicResources/explorer/moreResourcesNode.test.ts @@ -11,7 +11,7 @@ import { CloudFormationClient } from '../../../shared/clients/cloudFormationClie import { assertNodeListOnlyHasPlaceholderNode } from '../../utilities/explorerNodeAssertions' import { asyncGenerator } from '../../../shared/utilities/collectionUtils' import { CloudFormation } from 'aws-sdk' -import { CloudControlClient } from '../../../shared/clients/cloudControlClient' +import { CloudControlClient } from '../../../shared/clients/cloudControl' import { Settings } from '../../../shared/settings' import { ResourcesSettings } from '../../../dynamicResources/commands/configure' import sinon from 'sinon' diff --git a/packages/core/src/test/dynamicResources/explorer/resourceTypeNode.test.ts b/packages/core/src/test/dynamicResources/explorer/resourceTypeNode.test.ts index 2c69cb7a9c0..96130761f0d 100644 --- a/packages/core/src/test/dynamicResources/explorer/resourceTypeNode.test.ts +++ b/packages/core/src/test/dynamicResources/explorer/resourceTypeNode.test.ts @@ -12,7 +12,7 @@ import { assertNodeListOnlyHasErrorNode, assertNodeListOnlyHasPlaceholderNode, } from '../../utilities/explorerNodeAssertions' -import { CloudControlClient } from '../../../shared/clients/cloudControlClient' +import { CloudControlClient } from '../../../shared/clients/cloudControl' import { CloudControl } from 'aws-sdk' import { ResourceTypeMetadata } from '../../../dynamicResources/model/resources' import sinon from 'sinon' From 299eef735cbc55dcdb339bcc15b22f20914b4392 Mon Sep 17 00:00:00 2001 From: hkobew Date: Fri, 14 Mar 2025 09:37:10 -0400 Subject: [PATCH 3/6] feat: extend client wrapper --- packages/core/src/shared/clients/cloudControl.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/core/src/shared/clients/cloudControl.ts b/packages/core/src/shared/clients/cloudControl.ts index d9dc6da9278..270e22815bc 100644 --- a/packages/core/src/shared/clients/cloudControl.ts +++ b/packages/core/src/shared/clients/cloudControl.ts @@ -4,11 +4,15 @@ */ import { CloudControl } from 'aws-sdk' +import * as CloudControlV3 from '@aws-sdk/client-cloudcontrol' import globals from '../extensionGlobals' import { localize } from '../utilities/vsCodeUtils' +import { ClientWrapper } from './clientWrapper' -export class CloudControlClient { - public constructor(public readonly regionCode: string) {} +export class CloudControlClient extends ClientWrapper { + public constructor(regionCode: string) { + super(regionCode, CloudControlV3.CloudControlClient) + } public async createResource(request: CloudControl.CreateResourceInput): Promise { const client = await this.createSdkClient() From 2edf896405f1ea634fa706986bbd2f0cf59b60ce Mon Sep 17 00:00:00 2001 From: hkobew Date: Fri, 14 Mar 2025 09:48:19 -0400 Subject: [PATCH 4/6] refactor: migrate createResource --- .../explorer/nodes/resourcesNode.ts | 2 +- .../core/src/shared/clients/cloudControl.ts | 78 +++++++++++++++++-- .../awsResourceManager.test.ts | 2 +- 3 files changed, 75 insertions(+), 7 deletions(-) diff --git a/packages/core/src/dynamicResources/explorer/nodes/resourcesNode.ts b/packages/core/src/dynamicResources/explorer/nodes/resourcesNode.ts index 0b281b7500b..53e650fcf34 100644 --- a/packages/core/src/dynamicResources/explorer/nodes/resourcesNode.ts +++ b/packages/core/src/dynamicResources/explorer/nodes/resourcesNode.ts @@ -12,7 +12,7 @@ import { makeChildrenNodes } from '../../../shared/treeview/utils' import { toArrayAsync, updateInPlace } from '../../../shared/utilities/collectionUtils' import { ResourceTypeNode } from './resourceTypeNode' import { CloudFormation } from 'aws-sdk' -import { CloudControlClient, CloudControlClient } from '../../../shared/clients/cloudControl' +import { CloudControlClient } from '../../../shared/clients/cloudControl' import { memoizedGetResourceTypes, ResourceTypeMetadata } from '../../model/resources' import { ResourcesSettings } from '../../commands/configure' diff --git a/packages/core/src/shared/clients/cloudControl.ts b/packages/core/src/shared/clients/cloudControl.ts index 270e22815bc..bffe629a829 100644 --- a/packages/core/src/shared/clients/cloudControl.ts +++ b/packages/core/src/shared/clients/cloudControl.ts @@ -14,12 +14,15 @@ export class CloudControlClient extends ClientWrapper { - const client = await this.createSdkClient() - - const createResponse = await client.createResource(request).promise() + public async createResource( + request: CloudControlV3.CreateResourceInput + ): Promise { + const createResponse: CloudControlV3.CreateResourceOutput = await this.makeRequest( + CloudControlV3.CreateResourceCommand, + request + ) - await this.pollForCompletion(client, createResponse.ProgressEvent!) + await this.pollForCompletionV3(createResponse.ProgressEvent!) return createResponse } @@ -51,6 +54,71 @@ export class CloudControlClient extends ClientWrapper { + return await this.makeRequest(CloudControlV3.GetResourceRequestStatusCommand, request) + } + + private async pollForCompletionV3( + progressEvent: CloudControlV3.ProgressEvent, + baseDelay: number = 500, + maxRetries: number = 10 + ): Promise { + for (let i = 0; i < maxRetries; i++) { + const operationStatus = progressEvent.OperationStatus + + switch (operationStatus) { + case 'SUCCESS': + return + case 'FAILED': + throw new Error( + localize( + 'AWS.message.error.cloudControl.pollResourceStatus.failed', + 'Resource operation failed: {0} ({1})', + progressEvent.StatusMessage, + progressEvent.ErrorCode + ) + ) + case 'CANCEL_COMPLETE': + throw new Error( + localize( + 'AWS.message.error.cloudControl.pollResourceStatus.cancelled', + 'Resource operation cancelled: {0}', + progressEvent.StatusMessage + ) + ) + case 'IN_PROGRESS': + case 'CANCEL_IN_PROGRESS': + case 'PENDING': + break + default: + throw new Error( + localize( + 'AWS.message.error.cloudControl.pollResourceStatus.invalidOperationStatus', + 'Invalid resource operation status: {0}', + operationStatus + ) + ) + } + + if (i + 1 < maxRetries) { + await new Promise((resolve) => globals.clock.setTimeout(resolve, baseDelay * 2 ** i)) + const resourceRequestStatus = await this.getResourceRequestStatus({ + RequestToken: progressEvent.RequestToken, + }) + progressEvent = resourceRequestStatus.ProgressEvent! + } + } + throw new Error( + localize( + 'AWS.message.error.cloudControl.pollResourceStatus.timeout', + 'Failed to get terminal resource operation status for {0} before timeout. Please try again later', + progressEvent.Identifier + ) + ) + } + private async pollForCompletion( client: CloudControl, progressEvent: CloudControl.ProgressEvent, diff --git a/packages/core/src/test/dynamicResources/awsResourceManager.test.ts b/packages/core/src/test/dynamicResources/awsResourceManager.test.ts index 71afbf63700..380d82bc03d 100644 --- a/packages/core/src/test/dynamicResources/awsResourceManager.test.ts +++ b/packages/core/src/test/dynamicResources/awsResourceManager.test.ts @@ -12,7 +12,7 @@ import { ResourcesNode } from '../../dynamicResources/explorer/nodes/resourcesNo import { ResourceNode } from '../../dynamicResources/explorer/nodes/resourceNode' import { ResourceTypeNode } from '../../dynamicResources/explorer/nodes/resourceTypeNode' import { formatResourceModel, AwsResourceManager } from '../../dynamicResources/awsResourceManager' -import { CloudControlClient, CloudControlClient } from '../../shared/clients/cloudControl' +import { CloudControlClient } from '../../shared/clients/cloudControl' import { CloudFormationClient, DefaultCloudFormationClient } from '../../shared/clients/cloudFormationClient' import { makeTemporaryToolkitFolder, readFileAsString } from '../../shared/filesystemUtilities' import { FakeExtensionContext } from '../fakeExtensionContext' From 9bc761e77255c49ac6de751d925e640789f6f425 Mon Sep 17 00:00:00 2001 From: hkobew Date: Fri, 14 Mar 2025 13:16:45 -0400 Subject: [PATCH 5/6] refactor: finish migration --- .../core/src/shared/clients/cloudControl.ts | 107 ++++-------------- .../awsResourceManager.test.ts | 3 +- 2 files changed, 22 insertions(+), 88 deletions(-) diff --git a/packages/core/src/shared/clients/cloudControl.ts b/packages/core/src/shared/clients/cloudControl.ts index bffe629a829..ef6f4407504 100644 --- a/packages/core/src/shared/clients/cloudControl.ts +++ b/packages/core/src/shared/clients/cloudControl.ts @@ -3,7 +3,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { CloudControl } from 'aws-sdk' import * as CloudControlV3 from '@aws-sdk/client-cloudcontrol' import globals from '../extensionGlobals' import { localize } from '../utilities/vsCodeUtils' @@ -22,36 +21,36 @@ export class CloudControlClient extends ClientWrapper { - const client = await this.createSdkClient() - - const deleteResponse = await client.deleteResource(request).promise() + public async deleteResource(request: CloudControlV3.DeleteResourceInput): Promise { + const deleteResponse: CloudControlV3.DeleteResourceOutput = await this.makeRequest( + CloudControlV3.DeleteResourceCommand, + request + ) - await this.pollForCompletion(client, deleteResponse.ProgressEvent!) + await this.pollForCompletion(deleteResponse.ProgressEvent!) } - public async listResources(request: CloudControl.ListResourcesInput): Promise { - const client = await this.createSdkClient() - - return await client.listResources(request).promise() + public async listResources( + request: CloudControlV3.ListResourcesInput + ): Promise { + return await this.makeRequest(CloudControlV3.ListResourcesCommand, request) } - public async getResource(request: CloudControl.GetResourceInput): Promise { - const client = await this.createSdkClient() - - return await client.getResource(request).promise() + public async getResource(request: CloudControlV3.GetResourceInput): Promise { + return await this.makeRequest(CloudControlV3.GetResourceCommand, request) } - public async updateResource(request: CloudControl.UpdateResourceInput): Promise { - const client = await this.createSdkClient() - - const updateResponse = await client.updateResource(request).promise() + public async updateResource(request: CloudControlV3.UpdateResourceInput): Promise { + const updateResponse: CloudControlV3.UpdateResourceOutput = await this.makeRequest( + CloudControlV3.UpdateResourceCommand, + request + ) - await this.pollForCompletion(client, updateResponse.ProgressEvent!) + await this.pollForCompletion(updateResponse.ProgressEvent!) } private async getResourceRequestStatus( @@ -60,7 +59,7 @@ export class CloudControlClient extends ClientWrapper { - for (let i = 0; i < maxRetries; i++) { - const operationStatus = progressEvent.OperationStatus - - switch (operationStatus) { - case 'SUCCESS': - return - case 'FAILED': - throw new Error( - localize( - 'AWS.message.error.cloudControl.pollResourceStatus.failed', - 'Resource operation failed: {0} ({1})', - progressEvent.StatusMessage, - progressEvent.ErrorCode - ) - ) - case 'CANCEL_COMPLETE': - throw new Error( - localize( - 'AWS.message.error.cloudControl.pollResourceStatus.cancelled', - 'Resource operation cancelled: {0}', - progressEvent.StatusMessage - ) - ) - case 'IN_PROGRESS': - case 'CANCEL_IN_PROGRESS': - case 'PENDING': - break - default: - throw new Error( - localize( - 'AWS.message.error.cloudControl.pollResourceStatus.invalidOperationStatus', - 'Invalid resource operation status: {0}', - operationStatus - ) - ) - } - - if (i + 1 < maxRetries) { - await new Promise((resolve) => globals.clock.setTimeout(resolve, baseDelay * 2 ** i)) - const resourceRequestStatus = await client - .getResourceRequestStatus({ - RequestToken: progressEvent.RequestToken!, - }) - .promise() - progressEvent = resourceRequestStatus.ProgressEvent! - } - } - throw new Error( - localize( - 'AWS.message.error.cloudControl.pollResourceStatus.timeout', - 'Failed to get terminal resource operation status for {0} before timeout. Please try again later', - progressEvent.Identifier - ) - ) - } - - private async createSdkClient(): Promise { - return await globals.sdkClientBuilder.createAwsService(CloudControl, undefined, this.regionCode) - } } diff --git a/packages/core/src/test/dynamicResources/awsResourceManager.test.ts b/packages/core/src/test/dynamicResources/awsResourceManager.test.ts index 380d82bc03d..014a0291b61 100644 --- a/packages/core/src/test/dynamicResources/awsResourceManager.test.ts +++ b/packages/core/src/test/dynamicResources/awsResourceManager.test.ts @@ -20,7 +20,8 @@ import { existsSync } from 'fs' // eslint-disable-line no-restricted-imports import { ResourceTypeMetadata } from '../../dynamicResources/model/resources' import globals from '../../shared/extensionGlobals' import { Stub, stub } from '../utilities/stubber' -import { CloudControl, CloudFormation } from 'aws-sdk' +import { CloudFormation } from 'aws-sdk' +import * as CloudControl from '@aws-sdk/client-cloudcontrol' import { fs } from '../../shared' describe('ResourceManager', function () { From bc2c4c1a3382d347101822673af6ec314760ee8a Mon Sep 17 00:00:00 2001 From: hkobew Date: Fri, 14 Mar 2025 13:20:17 -0400 Subject: [PATCH 6/6] rename: remove v3 suffix --- .../core/src/shared/clients/cloudControl.ts | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/packages/core/src/shared/clients/cloudControl.ts b/packages/core/src/shared/clients/cloudControl.ts index ef6f4407504..664ae2db70f 100644 --- a/packages/core/src/shared/clients/cloudControl.ts +++ b/packages/core/src/shared/clients/cloudControl.ts @@ -3,21 +3,19 @@ * SPDX-License-Identifier: Apache-2.0 */ -import * as CloudControlV3 from '@aws-sdk/client-cloudcontrol' +import * as CloudControl from '@aws-sdk/client-cloudcontrol' import globals from '../extensionGlobals' import { localize } from '../utilities/vsCodeUtils' import { ClientWrapper } from './clientWrapper' -export class CloudControlClient extends ClientWrapper { +export class CloudControlClient extends ClientWrapper { public constructor(regionCode: string) { - super(regionCode, CloudControlV3.CloudControlClient) + super(regionCode, CloudControl.CloudControlClient) } - public async createResource( - request: CloudControlV3.CreateResourceInput - ): Promise { - const createResponse: CloudControlV3.CreateResourceOutput = await this.makeRequest( - CloudControlV3.CreateResourceCommand, + public async createResource(request: CloudControl.CreateResourceInput): Promise { + const createResponse: CloudControl.CreateResourceOutput = await this.makeRequest( + CloudControl.CreateResourceCommand, request ) @@ -25,28 +23,26 @@ export class CloudControlClient extends ClientWrapper { - const deleteResponse: CloudControlV3.DeleteResourceOutput = await this.makeRequest( - CloudControlV3.DeleteResourceCommand, + public async deleteResource(request: CloudControl.DeleteResourceInput): Promise { + const deleteResponse: CloudControl.DeleteResourceOutput = await this.makeRequest( + CloudControl.DeleteResourceCommand, request ) await this.pollForCompletion(deleteResponse.ProgressEvent!) } - public async listResources( - request: CloudControlV3.ListResourcesInput - ): Promise { - return await this.makeRequest(CloudControlV3.ListResourcesCommand, request) + public async listResources(request: CloudControl.ListResourcesInput): Promise { + return await this.makeRequest(CloudControl.ListResourcesCommand, request) } - public async getResource(request: CloudControlV3.GetResourceInput): Promise { - return await this.makeRequest(CloudControlV3.GetResourceCommand, request) + public async getResource(request: CloudControl.GetResourceInput): Promise { + return await this.makeRequest(CloudControl.GetResourceCommand, request) } - public async updateResource(request: CloudControlV3.UpdateResourceInput): Promise { - const updateResponse: CloudControlV3.UpdateResourceOutput = await this.makeRequest( - CloudControlV3.UpdateResourceCommand, + public async updateResource(request: CloudControl.UpdateResourceInput): Promise { + const updateResponse: CloudControl.UpdateResourceOutput = await this.makeRequest( + CloudControl.UpdateResourceCommand, request ) @@ -54,13 +50,13 @@ export class CloudControlClient extends ClientWrapper { - return await this.makeRequest(CloudControlV3.GetResourceRequestStatusCommand, request) + request: CloudControl.GetResourceRequestStatusInput + ): Promise { + return await this.makeRequest(CloudControl.GetResourceRequestStatusCommand, request) } private async pollForCompletion( - progressEvent: CloudControlV3.ProgressEvent, + progressEvent: CloudControl.ProgressEvent, baseDelay: number = 500, maxRetries: number = 10 ): Promise {