diff --git a/appservice/package-lock.json b/appservice/package-lock.json index 37aee50003..23d8739a8b 100644 --- a/appservice/package-lock.json +++ b/appservice/package-lock.json @@ -1,17 +1,17 @@ { "name": "@microsoft/vscode-azext-azureappservice", - "version": "3.2.2", + "version": "3.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@microsoft/vscode-azext-azureappservice", - "version": "3.2.2", + "version": "3.3.0", "license": "MIT", "dependencies": { "@azure/abort-controller": "^1.0.4", "@azure/arm-appinsights": "^5.0.0-beta.4", - "@azure/arm-appservice": "^14.0.0", + "@azure/arm-appservice": "^15.0.0", "@azure/arm-operationalinsights": "^8.0.1", "@azure/arm-resourcegraph": "^5.0.0-beta.3", "@azure/arm-resources-subscriptions": "^2.0.1", @@ -20,7 +20,7 @@ "@azure/storage-blob": "^12.3.0", "@microsoft/vscode-azext-azureutils": "^3.0.0", "@microsoft/vscode-azext-github": "^1.0.0", - "@microsoft/vscode-azext-utils": "^2.2.0", + "@microsoft/vscode-azext-utils": "^2.5.0", "dayjs": "^1.11.2", "fs-extra": "^10.0.0", "p-retry": "^3.0.1", @@ -32,7 +32,7 @@ "devDependencies": { "@azure/core-auth": "^1.4.0", "@microsoft/eslint-config-azuretools": "^0.2.1", - "@microsoft/vscode-azext-dev": "^2.0.0", + "@microsoft/vscode-azext-dev": "^2.0.4", "@types/fs-extra": "^9.0.13", "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", @@ -82,16 +82,16 @@ } }, "node_modules/@azure/arm-appservice": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@azure/arm-appservice/-/arm-appservice-14.1.0.tgz", - "integrity": "sha512-dRhYI8HQ49DQrT91RzIjIa22bs2Pw/2mPtW+4a6ED5lzQ6IMPP0XEPXSSqqkPKedZRXRaZqazi16/QjuidJPnQ==", + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@azure/arm-appservice/-/arm-appservice-15.0.0.tgz", + "integrity": "sha512-huJ2uFDXB7w0cYKqxhzYOHuTsuLCY1e0xmWFF8G3KpDbQGnFDM3AVNtxWPas50OxuSWClblqSaExiS/XnWhTTg==", "dependencies": { "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", + "@azure/core-auth": "^1.6.0", "@azure/core-client": "^1.7.0", "@azure/core-lro": "^2.5.4", "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.12.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "engines": { @@ -219,15 +219,27 @@ "integrity": "sha512-kmv8CGrPfN9SwMwrkiBK9VTQYxdFQEGe0BmQk+M8io56P9KNzpAxcWE/1fxJj7uouwN4kXF0BHW8DNlgx+wtCg==" }, "node_modules/@azure/core-auth": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.4.0.tgz", - "integrity": "sha512-HFrcTgmuSuukRf/EdPmqBrc5l6Q5Uu+2TbuhaKbgaCpP2TfAeiNaQPAadxO+CYBRHGUzIDteMAjFspFLDLnKVQ==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.7.2.tgz", + "integrity": "sha512-Igm/S3fDYmnMq1uKS38Ae1/m37B3zigdlZw+kocwEhh5GjyKjPrXKO2J6rzpC1wAxrNil/jX9BJRqBshyjnF3g==", "dependencies": { - "@azure/abort-controller": "^1.0.0", - "tslib": "^2.2.0" + "@azure/abort-controller": "^2.0.0", + "@azure/core-util": "^1.1.0", + "tslib": "^2.6.2" }, "engines": { - "node": ">=12.0.0" + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-auth/node_modules/@azure/abort-controller": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", + "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, "node_modules/@azure/core-client": { @@ -726,9 +738,9 @@ } }, "node_modules/@microsoft/vscode-azext-dev": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-dev/-/vscode-azext-dev-2.0.0.tgz", - "integrity": "sha512-fnj7UqLAHgLgLewPixzU4s20W+cEFHdLQ0CXsgCDdwQ2zw8ToyB9bn9HGr93UfWvQtktCPaPDgUmwXWpdd9ocg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-dev/-/vscode-azext-dev-2.0.4.tgz", + "integrity": "sha512-+XZenjPrfsEc3OPMOdPBVCgPsTvx6h1BVItf5mUoRC3lfN3Gv8OZF80VIETnC9Gj5nB+9nDpQWDzj9V/+2ZS/g==", "dev": true, "dependencies": { "assert": "^2.0.0", @@ -1050,9 +1062,9 @@ } }, "node_modules/@microsoft/vscode-azext-utils": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-utils/-/vscode-azext-utils-2.2.0.tgz", - "integrity": "sha512-YnAM4YySBfJoQvInqyRMEbQ5pctA06Irdr/0Il5DanKR3C/B7to0MTob2mQWr31cFTYkLskBY0/ySuWYcH4voA==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-utils/-/vscode-azext-utils-2.5.1.tgz", + "integrity": "sha512-K9S25xSZ5jEy5ofsLGdgzdXkyqzYhdJuBNkSRMa/7Qt6S+YtspQ4qwX6gNGvlMHE3gPAXDHqxvn+yPmm4s5uYg==", "dependencies": { "@microsoft/vscode-azureresources-api": "^2.0.4", "@vscode/extension-telemetry": "^0.9.0", @@ -2188,12 +2200,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -3457,9 +3469,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -6335,9 +6347,9 @@ } }, "node_modules/tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -6759,15 +6771,15 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "node_modules/ws": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", - "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -6912,16 +6924,16 @@ } }, "@azure/arm-appservice": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@azure/arm-appservice/-/arm-appservice-14.1.0.tgz", - "integrity": "sha512-dRhYI8HQ49DQrT91RzIjIa22bs2Pw/2mPtW+4a6ED5lzQ6IMPP0XEPXSSqqkPKedZRXRaZqazi16/QjuidJPnQ==", + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@azure/arm-appservice/-/arm-appservice-15.0.0.tgz", + "integrity": "sha512-huJ2uFDXB7w0cYKqxhzYOHuTsuLCY1e0xmWFF8G3KpDbQGnFDM3AVNtxWPas50OxuSWClblqSaExiS/XnWhTTg==", "requires": { "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", + "@azure/core-auth": "^1.6.0", "@azure/core-client": "^1.7.0", "@azure/core-lro": "^2.5.4", "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.12.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" } }, @@ -7025,12 +7037,23 @@ "integrity": "sha512-kmv8CGrPfN9SwMwrkiBK9VTQYxdFQEGe0BmQk+M8io56P9KNzpAxcWE/1fxJj7uouwN4kXF0BHW8DNlgx+wtCg==" }, "@azure/core-auth": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.4.0.tgz", - "integrity": "sha512-HFrcTgmuSuukRf/EdPmqBrc5l6Q5Uu+2TbuhaKbgaCpP2TfAeiNaQPAadxO+CYBRHGUzIDteMAjFspFLDLnKVQ==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.7.2.tgz", + "integrity": "sha512-Igm/S3fDYmnMq1uKS38Ae1/m37B3zigdlZw+kocwEhh5GjyKjPrXKO2J6rzpC1wAxrNil/jX9BJRqBshyjnF3g==", "requires": { - "@azure/abort-controller": "^1.0.0", - "tslib": "^2.2.0" + "@azure/abort-controller": "^2.0.0", + "@azure/core-util": "^1.1.0", + "tslib": "^2.6.2" + }, + "dependencies": { + "@azure/abort-controller": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", + "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", + "requires": { + "tslib": "^2.6.2" + } + } } }, "@azure/core-client": { @@ -7444,9 +7467,9 @@ } }, "@microsoft/vscode-azext-dev": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-dev/-/vscode-azext-dev-2.0.0.tgz", - "integrity": "sha512-fnj7UqLAHgLgLewPixzU4s20W+cEFHdLQ0CXsgCDdwQ2zw8ToyB9bn9HGr93UfWvQtktCPaPDgUmwXWpdd9ocg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-dev/-/vscode-azext-dev-2.0.4.tgz", + "integrity": "sha512-+XZenjPrfsEc3OPMOdPBVCgPsTvx6h1BVItf5mUoRC3lfN3Gv8OZF80VIETnC9Gj5nB+9nDpQWDzj9V/+2ZS/g==", "dev": true, "requires": { "assert": "^2.0.0", @@ -7689,9 +7712,9 @@ } }, "@microsoft/vscode-azext-utils": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-utils/-/vscode-azext-utils-2.2.0.tgz", - "integrity": "sha512-YnAM4YySBfJoQvInqyRMEbQ5pctA06Irdr/0Il5DanKR3C/B7to0MTob2mQWr31cFTYkLskBY0/ySuWYcH4voA==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-utils/-/vscode-azext-utils-2.5.1.tgz", + "integrity": "sha512-K9S25xSZ5jEy5ofsLGdgzdXkyqzYhdJuBNkSRMa/7Qt6S+YtspQ4qwX6gNGvlMHE3gPAXDHqxvn+yPmm4s5uYg==", "requires": { "@microsoft/vscode-azureresources-api": "^2.0.4", "@vscode/extension-telemetry": "^0.9.0", @@ -8599,12 +8622,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browser-stdout": { @@ -9553,9 +9576,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" @@ -11612,9 +11635,9 @@ } }, "tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" }, "tsutils": { "version": "3.21.0", @@ -11934,9 +11957,9 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "ws": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", - "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "requires": {} }, "xml": { diff --git a/appservice/package.json b/appservice/package.json index 7968962b29..9ae575a7a2 100644 --- a/appservice/package.json +++ b/appservice/package.json @@ -1,7 +1,7 @@ { "name": "@microsoft/vscode-azext-azureappservice", "author": "Microsoft Corporation", - "version": "3.2.2", + "version": "3.3.0", "description": "Common tools for developing Azure App Service extensions for VS Code", "tags": [ "azure", @@ -33,7 +33,7 @@ "dependencies": { "@azure/abort-controller": "^1.0.4", "@azure/arm-appinsights": "^5.0.0-beta.4", - "@azure/arm-appservice": "^14.0.0", + "@azure/arm-appservice": "^15.0.0", "@azure/arm-operationalinsights": "^8.0.1", "@azure/arm-resourcegraph": "^5.0.0-beta.3", "@azure/arm-resources-subscriptions": "^2.0.1", @@ -42,7 +42,7 @@ "@azure/storage-blob": "^12.3.0", "@microsoft/vscode-azext-azureutils": "^3.0.0", "@microsoft/vscode-azext-github": "^1.0.0", - "@microsoft/vscode-azext-utils": "^2.2.0", + "@microsoft/vscode-azext-utils": "^2.5.0", "dayjs": "^1.11.2", "fs-extra": "^10.0.0", "p-retry": "^3.0.1", @@ -58,7 +58,7 @@ "devDependencies": { "@azure/core-auth": "^1.4.0", "@microsoft/eslint-config-azuretools": "^0.2.1", - "@microsoft/vscode-azext-dev": "^2.0.0", + "@microsoft/vscode-azext-dev": "^2.0.4", "@types/fs-extra": "^9.0.13", "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", diff --git a/appservice/src/deploy/waitForDeploymentToComplete.ts b/appservice/src/deploy/waitForDeploymentToComplete.ts index 50fa91e230..d1daedb21f 100644 --- a/appservice/src/deploy/waitForDeploymentToComplete.ts +++ b/appservice/src/deploy/waitForDeploymentToComplete.ts @@ -34,7 +34,8 @@ export async function waitForDeploymentToComplete(context: IActionContext & Part const kuduClient = await site.createClient(context); const { expectedId, token, locationUrl } = options; - const pollingInterval = options.pollingInterval ?? 5000; + // recommended to poll every second or the deployment id can be recycled before we find it + const pollingInterval = options.pollingInterval ?? 1000; while (!token?.isCancellationRequested) { if (locationUrl) { diff --git a/auth/package-lock.json b/auth/package-lock.json index dc128c7bd0..912ca750b4 100644 --- a/auth/package-lock.json +++ b/auth/package-lock.json @@ -267,9 +267,9 @@ "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "node_modules/@azure/identity": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.2.0.tgz", - "integrity": "sha512-ve3aYv79qXOJ8wRxQ5jO0eIz2DZ4o0TyME4m4vlGV5YyePddVZ+pFMzusAMODNAflYAAv1cBIhKnd4xytmXyig==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.2.1.tgz", + "integrity": "sha512-U8hsyC9YPcEIzoaObJlRDvp7KiF0MGS7xcWbyJSVvXRkC/HXo1f0oYeBYmEvVgRfacw7GHf6D6yAoh9JHz6A5Q==", "dev": true, "dependencies": { "@azure/abort-controller": "^1.0.0", @@ -280,7 +280,7 @@ "@azure/core-util": "^1.3.0", "@azure/logger": "^1.0.0", "@azure/msal-browser": "^3.11.1", - "@azure/msal-node": "^2.6.6", + "@azure/msal-node": "^2.9.2", "events": "^3.0.0", "jws": "^4.0.0", "open": "^8.0.0", @@ -340,12 +340,12 @@ } }, "node_modules/@azure/msal-node": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.7.0.tgz", - "integrity": "sha512-wXD8LkUvHICeSWZydqg6o8Yvv+grlBEcmLGu+QEI4FcwFendbTEZrlSygnAXXSOCVaGAirWLchca35qrgpO6Jw==", + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.9.2.tgz", + "integrity": "sha512-8tvi6Cos3m+0KmRbPjgkySXi+UQU/QiuVRFnrxIwt5xZlEEFa69O04RTaNESGgImyBBlYbo2mfE8/U8Bbdk1WQ==", "dev": true, "dependencies": { - "@azure/msal-common": "14.9.0", + "@azure/msal-common": "14.12.0", "jsonwebtoken": "^9.0.0", "uuid": "^8.3.0" }, @@ -353,6 +353,15 @@ "node": ">=16" } }, + "node_modules/@azure/msal-node/node_modules/@azure/msal-common": { + "version": "14.12.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.12.0.tgz", + "integrity": "sha512-IDDXmzfdwmDkv4SSmMEyAniJf6fDu3FJ7ncOjlxkDuT85uSnLEhZi3fGZpoR7T4XZpOMx9teM9GXBgrfJgyeBw==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", diff --git a/dev/index.d.ts b/dev/index.d.ts index e038232980..6e89668f68 100644 --- a/dev/index.d.ts +++ b/dev/index.d.ts @@ -5,7 +5,7 @@ import type { Environment } from "@azure/ms-rest-azure-env"; import * as cp from "child_process"; -import { Disposable, Event, InputBoxOptions, LogLevel, LogOutputChannel, MessageItem, MessageOptions, OpenDialogOptions, QuickPickItem, QuickPickOptions, Uri } from "vscode"; +import { Disposable, Event, InputBoxOptions, LogLevel, LogOutputChannel, MessageItem, MessageOptions, OpenDialogOptions, QuickPickItem, QuickPickOptions, Uri, WorkspaceFolder, WorkspaceFolderPickOptions } from "vscode"; import * as webpack from 'webpack'; /** @@ -206,7 +206,7 @@ export declare enum TestInput { } export type PromptResult = { - value: string | QuickPickItem | QuickPickItem[] | MessageItem | Uri[]; + value: string | QuickPickItem | QuickPickItem[] | MessageItem | Uri[] | WorkspaceFolder; /** * True if the user did not change from the default value, currently only supported for `showInputBox` @@ -234,6 +234,7 @@ export declare class TestUserInput { public showWarningMessage(message: string, ...items: T[]): Promise; public showWarningMessage(message: string, options: MessageOptions, ...items: T[]): Promise; public showOpenDialog(options: OpenDialogOptions): Promise; + public showWorkspaceFolderPick(options: WorkspaceFolderPickOptions): Promise; } export interface TestActionContext { diff --git a/dev/package-lock.json b/dev/package-lock.json index 5c332ed7dc..186d7bc79b 100644 --- a/dev/package-lock.json +++ b/dev/package-lock.json @@ -1,12 +1,12 @@ { "name": "@microsoft/vscode-azext-dev", - "version": "2.0.2", + "version": "2.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@microsoft/vscode-azext-dev", - "version": "2.0.2", + "version": "2.0.4", "license": "MIT", "dependencies": { "assert": "^2.0.0", @@ -43,7 +43,7 @@ "@types/mocha": "^7.0.2", "@types/node": "^16.0.0", "@types/terser-webpack-plugin": "^5.0.0", - "@types/vscode": "^1.76.0", + "@types/vscode": "^1.82.0", "@typescript-eslint/eslint-plugin": "^5.53.0", "@vscode/test-electron": "^2.3.8", "eslint": "^8.34.0", @@ -444,9 +444,9 @@ } }, "node_modules/@types/vscode": { - "version": "1.76.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.76.0.tgz", - "integrity": "sha512-CQcY3+Fe5hNewHnOEAVYj4dd1do/QHliXaknAEYSXx2KEHUzFibDZSKptCon+HPgK55xx20pR+PBJjf0MomnBA==", + "version": "1.82.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.82.0.tgz", + "integrity": "sha512-VSHV+VnpF8DEm8LNrn8OJ8VuUNcBzN3tMvKrNpbhhfuVjFm82+6v44AbDhLvVFgCzn6vs94EJNTp7w8S6+Q1Rw==", "dev": true }, "node_modules/@types/webpack": { diff --git a/dev/package.json b/dev/package.json index 75038b4ad5..23018d7252 100644 --- a/dev/package.json +++ b/dev/package.json @@ -1,7 +1,7 @@ { "name": "@microsoft/vscode-azext-dev", "author": "Microsoft Corporation", - "version": "2.0.2", + "version": "2.0.4", "description": "Common dev dependency tools for developing Azure extensions for VS Code", "tags": [ "azure", @@ -42,7 +42,7 @@ "@types/mocha": "^7.0.2", "@types/node": "^16.0.0", "@types/terser-webpack-plugin": "^5.0.0", - "@types/vscode": "^1.76.0", + "@types/vscode": "^1.82.0", "@typescript-eslint/eslint-plugin": "^5.53.0", "@vscode/test-electron": "^2.3.8", "eslint": "^8.34.0", diff --git a/dev/src/TestUserInput.ts b/dev/src/TestUserInput.ts index 9712d7a9ec..f75b8a42df 100644 --- a/dev/src/TestUserInput.ts +++ b/dev/src/TestUserInput.ts @@ -171,6 +171,35 @@ export class TestUserInput implements types.TestUserInput { this._onDidFinishPromptEmitter.fire({ value: result }); return result; } + + public async showWorkspaceFolderPick(options: vscodeTypes.WorkspaceFolderPickOptions): Promise { + let result: vscodeTypes.WorkspaceFolder; + const input: string | RegExp | TestInput | undefined = this._inputs.shift(); + + if (input === undefined) { + throw new Error(`No more inputs left for call to showWorkspaceFolderPick. Placeholder: ${options.placeHolder}`); + } else if (typeof input === 'string' || input instanceof RegExp) { + const workspaceFolders: readonly vscodeTypes.WorkspaceFolder[] | undefined = this._vscode.workspace.workspaceFolders; + const workspaceFolder: vscodeTypes.WorkspaceFolder | undefined = workspaceFolders?.find(workspace => { + const valuesToTest: string[] = [workspace.name, workspace.uri.path]; + if (typeof input === 'string') { + return !!valuesToTest.find(v => v === input); + } else { + return !!valuesToTest.find(v => v.match(input)); + } + }); + + if (!workspaceFolder) { + throw new Error(`Did not find workspace folder with name matching '${input}'.`); + } + result = workspaceFolder; + } else { + throw new Error(`Unexpected input '${input}' for showWorkspaceFolderPick.`); + } + + this._onDidFinishPromptEmitter.fire({ value: result }); + return result; + } } diff --git a/github/package-lock.json b/github/package-lock.json index 10434edeac..9e35d4dd4d 100644 --- a/github/package-lock.json +++ b/github/package-lock.json @@ -991,12 +991,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -1831,9 +1831,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" diff --git a/utils/index.d.ts b/utils/index.d.ts index ff019f78a2..8d7e7a3780 100644 --- a/utils/index.d.ts +++ b/utils/index.d.ts @@ -7,7 +7,7 @@ import type { Environment } from '@azure/ms-rest-azure-env'; import type { AzExtResourceType, AzureResource, AzureSubscription, ResourceModelBase } from '@microsoft/vscode-azureresources-api'; -import { AuthenticationSession, CancellationToken, CancellationTokenSource, Disposable, Event, ExtensionContext, FileChangeEvent, FileChangeType, FileStat, FileSystemProvider, FileType, InputBoxOptions, LogOutputChannel, MarkdownString, MessageItem, MessageOptions, OpenDialogOptions, OutputChannel, Progress, ProviderResult, QuickPickItem, TextDocumentShowOptions, ThemeIcon, TreeDataProvider, TreeItem, TreeItemCollapsibleState, TreeView, Uri, QuickPickOptions as VSCodeQuickPickOptions } from 'vscode'; +import { AuthenticationSession, CancellationToken, CancellationTokenSource, Disposable, Event, ExtensionContext, FileChangeEvent, FileChangeType, FileStat, FileSystemProvider, FileType, InputBoxOptions, LogOutputChannel, MarkdownString, MessageItem, MessageOptions, OpenDialogOptions, OutputChannel, Progress, ProviderResult, QuickPickItem, TextDocumentShowOptions, ThemeIcon, TreeDataProvider, TreeItem, TreeItemCollapsibleState, TreeView, Uri, QuickPickOptions as VSCodeQuickPickOptions, WorkspaceFolder, WorkspaceFolderPickOptions } from 'vscode'; import { TargetPopulation } from 'vscode-tas-client'; import type { Activity, ActivityTreeItemOptions, AppResource, OnErrorActivityData, OnProgressActivityData, OnStartActivityData, OnSuccessActivityData } from './hostapi'; // This must remain `import type` or else a circular reference will result @@ -884,7 +884,7 @@ export interface IParsedError { } export type PromptResult = { - value: string | QuickPickItem | QuickPickItem[] | MessageItem | Uri[]; + value: string | QuickPickItem | QuickPickItem[] | MessageItem | Uri[] | WorkspaceFolder; /** * True if the user did not change from the default value, currently only supported for `showInputBox` @@ -959,6 +959,15 @@ export interface IAzureUserInput { * @returns A promise that resolves to the selected resources. */ showOpenDialog(options: AzExtOpenDialogOptions): Promise; + + /** + * Shows a selection list of existing workspace folders to choose from. + * + * @param options Configures the behavior of the workspace folder list. + * @throws `UserCancelledError` if the user cancels. + * @returns A promise that resolves to the selected `WorkspaceFolder`. + */ + showWorkspaceFolderPick(options: AzExtWorkspaceFolderPickOptions): Promise; } /** @@ -1086,6 +1095,11 @@ export interface AzExtInputBoxOptions extends InputBoxOptions, AzExtUserInputOpt */ export interface AzExtOpenDialogOptions extends OpenDialogOptions, AzExtUserInputOptions { } +/** +* Provides additional options for workspace folder picks used in Azure Extensions +*/ +export type AzExtWorkspaceFolderPickOptions = WorkspaceFolderPickOptions & AzExtUserInputOptions; + /** * A queue of inputs that should be used by an {@link IAzureUserInput} implementation to answer prompts instead of showing prompts to the user. * If the head of the queue is undefined or null, then the {@link IAzureUserInput} implementation should show a prompt to the user. @@ -1107,6 +1121,7 @@ export declare class AzExtUserInputWithInputQueue implements IAzureUserInput { showWarningMessage(message: string, ...items: T[]): Promise; showWarningMessage(message: string, options: IAzureMessageOptions, ...items: T[]): Promise; showOpenDialog(options: AzExtOpenDialogOptions): Promise; + showWorkspaceFolderPick(options: AzExtWorkspaceFolderPickOptions): Promise; } export interface IWizardOptions { @@ -2231,6 +2246,7 @@ export interface IAzureAgentInput { showWarningMessage(message: string, ...items: T[]): Promise; showWarningMessage(message: string, options: IAzureMessageOptions, ...items: T[]): Promise; showOpenDialog(options: AzExtOpenDialogOptions): Promise; + showWorkspaceFolderPick(options: AzExtWorkspaceFolderPickOptions): Promise; } // #endregion diff --git a/utils/package-lock.json b/utils/package-lock.json index d5639bbde7..e06a07f21b 100644 --- a/utils/package-lock.json +++ b/utils/package-lock.json @@ -1,12 +1,12 @@ { "name": "@microsoft/vscode-azext-utils", - "version": "2.5.0", + "version": "2.5.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@microsoft/vscode-azext-utils", - "version": "2.5.0", + "version": "2.5.1", "license": "MIT", "dependencies": { "@microsoft/vscode-azureresources-api": "^2.0.4", @@ -21,13 +21,13 @@ }, "devDependencies": { "@microsoft/eslint-config-azuretools": "^0.2.1", - "@microsoft/vscode-azext-dev": "^2.0.0", + "@microsoft/vscode-azext-dev": "^2.0.4", "@types/html-to-text": "^8.1.0", "@types/mocha": "^7.0.2", "@types/node": "^16.0.0", "@types/semver": "^7.3.9", "@types/uuid": "^9.0.1", - "@types/vscode": "1.76.0", + "@types/vscode": "^1.82.0", "@typescript-eslint/eslint-plugin": "^5.53.0", "@vscode/test-electron": "^2.3.8", "eslint": "^8.34.0", @@ -317,9 +317,9 @@ } }, "node_modules/@microsoft/vscode-azext-dev": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-dev/-/vscode-azext-dev-2.0.0.tgz", - "integrity": "sha512-fnj7UqLAHgLgLewPixzU4s20W+cEFHdLQ0CXsgCDdwQ2zw8ToyB9bn9HGr93UfWvQtktCPaPDgUmwXWpdd9ocg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-dev/-/vscode-azext-dev-2.0.4.tgz", + "integrity": "sha512-+XZenjPrfsEc3OPMOdPBVCgPsTvx6h1BVItf5mUoRC3lfN3Gv8OZF80VIETnC9Gj5nB+9nDpQWDzj9V/+2ZS/g==", "dev": true, "dependencies": { "assert": "^2.0.0", @@ -736,9 +736,9 @@ "dev": true }, "node_modules/@types/vscode": { - "version": "1.76.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.76.0.tgz", - "integrity": "sha512-CQcY3+Fe5hNewHnOEAVYj4dd1do/QHliXaknAEYSXx2KEHUzFibDZSKptCon+HPgK55xx20pR+PBJjf0MomnBA==", + "version": "1.82.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.82.0.tgz", + "integrity": "sha512-VSHV+VnpF8DEm8LNrn8OJ8VuUNcBzN3tMvKrNpbhhfuVjFm82+6v44AbDhLvVFgCzn6vs94EJNTp7w8S6+Q1Rw==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { diff --git a/utils/package.json b/utils/package.json index 5d59f3867a..29952a087d 100644 --- a/utils/package.json +++ b/utils/package.json @@ -1,7 +1,7 @@ { "name": "@microsoft/vscode-azext-utils", "author": "Microsoft Corporation", - "version": "2.5.0", + "version": "2.5.1", "description": "Common UI tools for developing Azure extensions for VS Code", "tags": [ "azure", @@ -46,13 +46,13 @@ }, "devDependencies": { "@microsoft/eslint-config-azuretools": "^0.2.1", - "@microsoft/vscode-azext-dev": "^2.0.0", + "@microsoft/vscode-azext-dev": "^2.0.4", "@types/html-to-text": "^8.1.0", "@types/mocha": "^7.0.2", "@types/node": "^16.0.0", "@types/semver": "^7.3.9", "@types/uuid": "^9.0.1", - "@types/vscode": "1.76.0", + "@types/vscode": "^1.82.0", "@typescript-eslint/eslint-plugin": "^5.53.0", "@vscode/test-electron": "^2.3.8", "eslint": "^8.34.0", diff --git a/utils/src/userInput/AzExtUserInput.ts b/utils/src/userInput/AzExtUserInput.ts index cb50a9fddc..d690d9c639 100644 --- a/utils/src/userInput/AzExtUserInput.ts +++ b/utils/src/userInput/AzExtUserInput.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event, EventEmitter, MessageItem, Uri } from 'vscode'; +import { Event, EventEmitter, MessageItem, Uri, WorkspaceFolder } from 'vscode'; import * as types from '../../index'; import { UserCancelledError } from '../errors'; import { IInternalActionContext, IInternalAzureWizard } from './IInternalActionContext'; @@ -11,6 +11,7 @@ import { showInputBox } from './showInputBox'; import { showOpenDialog } from './showOpenDialog'; import { showQuickPick } from './showQuickPick'; import { showWarningMessage } from './showWarningMessage'; +import { showWorkspaceFolderPick } from './showWorkspaceFolderPick'; export class AzExtUserInput implements types.IAzureUserInput { public wizard?: IInternalAzureWizard; @@ -79,6 +80,21 @@ export class AzExtUserInput implements types.IAzureUserInput { } } + public async showWorkspaceFolderPick(options: types.AzExtWorkspaceFolderPickOptions): Promise { + addStepTelemetry(this._context, options.stepName, 'WorkspaceFolderPick', options.placeHolder); + if (this._context.ui.wizard?.cancellationToken.isCancellationRequested) { + throw new UserCancelledError(); + } + try { + this._isPrompting = true; + const result = await showWorkspaceFolderPick(options); + this._onDidFinishPromptEmitter.fire({ value: result }); + return result; + } finally { + this._isPrompting = false; + } + } + public async showWarningMessage(message: string, ...items: T[]): Promise; public async showWarningMessage(message: string, options: types.IAzureMessageOptions, ...items: T[]): Promise; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/utils/src/userInput/AzExtUserInputWithInputQueue.ts b/utils/src/userInput/AzExtUserInputWithInputQueue.ts index 8f1c5830ce..feeb37abd6 100644 --- a/utils/src/userInput/AzExtUserInputWithInputQueue.ts +++ b/utils/src/userInput/AzExtUserInputWithInputQueue.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from "vscode"; -import { AzExtInputBoxOptions, AzExtOpenDialogOptions, AzureUserInputQueue, IAzureMessageOptions, IAzureQuickPickItem, IAzureQuickPickOptions, IAzureUserInput, PromptResult, type AzExtUserInputWithInputQueue as AzExtUserInputWithInputQueueType } from "../../"; +import { AzExtInputBoxOptions, AzExtOpenDialogOptions, AzExtWorkspaceFolderPickOptions, AzureUserInputQueue, IAzureMessageOptions, IAzureQuickPickItem, IAzureQuickPickOptions, IAzureUserInput, PromptResult, type AzExtUserInputWithInputQueue as AzExtUserInputWithInputQueueType } from "../../"; import { UserCancelledError } from "../errors"; import { AzExtUserInput, addStepTelemetry } from "./AzExtUserInput"; import { IInternalActionContext } from "./IInternalActionContext"; @@ -100,6 +100,26 @@ export class AzExtUserInputWithInputQueue implements AzExtUserInputWithInputQueu return result; } + public async showWorkspaceFolderPick(options: AzExtWorkspaceFolderPickOptions): Promise { + addStepTelemetry(this._context, options.stepName, 'WorkspaceFolderPick', options.placeHolder); + if (this._context.ui.wizard?.cancellationToken.isCancellationRequested) { + throw new UserCancelledError(); + } + this._isPrompting = true; + + let result: vscode.WorkspaceFolder; + const nextItemInQueue = (this._inputsQueue.shift() as vscode.WorkspaceFolder | null | undefined); + if (!nextItemInQueue) { + result = await this._realAzureUserInput.showWorkspaceFolderPick(options); + } else { + result = nextItemInQueue; + this._onDidFinishPromptEmitter.fire({ value: result }); + } + + this._isPrompting = false; + return result; + } + public async showWarningMessage(message: string, ...items: T[]): Promise; public async showWarningMessage(message: string, options: IAzureMessageOptions, ...items: T[]): Promise; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/utils/src/userInput/showWorkspaceFolderPick.ts b/utils/src/userInput/showWorkspaceFolderPick.ts new file mode 100644 index 0000000000..afa15eb2e1 --- /dev/null +++ b/utils/src/userInput/showWorkspaceFolderPick.ts @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { WorkspaceFolder, WorkspaceFolderPickOptions, l10n, window } from "vscode"; +import { UserCancelledError } from "../errors"; + +export async function showWorkspaceFolderPick(options?: WorkspaceFolderPickOptions): Promise { + const folder: WorkspaceFolder | undefined = await window.showWorkspaceFolderPick({ + ...options, + placeHolder: options?.placeHolder ?? l10n.t('Select a workspace folder') + }); + + if (!folder) { + throw new UserCancelledError('selectWorkspaceFolder'); + } + + return folder; +} diff --git a/utils/test/AzureAgentInputTypeCheck.test.ts b/utils/test/AzureAgentInputTypeCheck.test.ts index 5421e9f925..c76af8e49d 100644 --- a/utils/test/AzureAgentInputTypeCheck.test.ts +++ b/utils/test/AzureAgentInputTypeCheck.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from "assert"; -import { Event, MessageItem, QuickPickItem, Uri } from "vscode"; -import { AgentInputBoxOptions, AgentQuickPickItem, AgentQuickPickOptions, AzExtInputBoxOptions, AzExtOpenDialogOptions, IAzureAgentInput, IAzureMessageOptions, IAzureQuickPickOptions, IAzureUserInput, PromptResult } from ".."; +import { Event, MessageItem, QuickPickItem, Uri, WorkspaceFolder } from "vscode"; +import { AgentInputBoxOptions, AgentQuickPickItem, AgentQuickPickOptions, AzExtInputBoxOptions, AzExtOpenDialogOptions, AzExtWorkspaceFolderPickOptions, IAzureAgentInput, IAzureMessageOptions, IAzureQuickPickOptions, IAzureUserInput, PromptResult } from ".."; class MockAzureUserInput implements IAzureUserInput { onDidFinishPrompt: Event; @@ -25,6 +25,9 @@ class MockAzureUserInput implements IAzureUserInput { showOpenDialog(_options: AzExtOpenDialogOptions): Promise { throw new Error("Method not implemented."); } + showWorkspaceFolderPick(_options: AzExtWorkspaceFolderPickOptions): Promise { + throw new Error("Method not implemented."); + } } class MockAzureAgentInput implements IAzureAgentInput { @@ -45,6 +48,9 @@ class MockAzureAgentInput implements IAzureAgentInput { showOpenDialog(_options: AzExtOpenDialogOptions): Promise { throw new Error("Method not implemented."); } + showWorkspaceFolderPick(_options: AzExtWorkspaceFolderPickOptions): Promise { + throw new Error("Method not implemented."); + } } const mockAzureUserInput: IAzureUserInput = new MockAzureUserInput();