From dbaaf07f04e49bff4e8492a62bdf4defb2566048 Mon Sep 17 00:00:00 2001 From: Nathan Turinski Date: Tue, 28 Mar 2023 16:51:54 -0700 Subject: [PATCH 1/9] Update vscode typing --- appsettings/package-lock.json | 14 +++++++------- appsettings/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/appsettings/package-lock.json b/appsettings/package-lock.json index 15a61e8f47..613391ad3e 100644 --- a/appsettings/package-lock.json +++ b/appsettings/package-lock.json @@ -19,7 +19,7 @@ "@types/fs-extra": "^9.0.13", "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", - "@types/vscode": "1.64.0", + "@types/vscode": "1.76.0", "@typescript-eslint/eslint-plugin": "^5.53.0", "@vscode/test-electron": "^2.1.5", "eslint": "^8.34.0", @@ -1418,9 +1418,9 @@ "dev": true }, "node_modules/@types/vscode": { - "version": "1.64.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.64.0.tgz", - "integrity": "sha512-bSlAWz5WtcSL3cO9tAT/KpEH9rv5OBnm93OIIFwdCshaAiqr2bp1AUyEwW9MWeCvZBHEXc3V0fTYVdVyzDNwHA==", + "version": "1.76.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.76.0.tgz", + "integrity": "sha512-CQcY3+Fe5hNewHnOEAVYj4dd1do/QHliXaknAEYSXx2KEHUzFibDZSKptCon+HPgK55xx20pR+PBJjf0MomnBA==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { @@ -9399,9 +9399,9 @@ "dev": true }, "@types/vscode": { - "version": "1.64.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.64.0.tgz", - "integrity": "sha512-bSlAWz5WtcSL3cO9tAT/KpEH9rv5OBnm93OIIFwdCshaAiqr2bp1AUyEwW9MWeCvZBHEXc3V0fTYVdVyzDNwHA==", + "version": "1.76.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.76.0.tgz", + "integrity": "sha512-CQcY3+Fe5hNewHnOEAVYj4dd1do/QHliXaknAEYSXx2KEHUzFibDZSKptCon+HPgK55xx20pR+PBJjf0MomnBA==", "dev": true }, "@typescript-eslint/eslint-plugin": { diff --git a/appsettings/package.json b/appsettings/package.json index 8a638273fa..9a10706b28 100644 --- a/appsettings/package.json +++ b/appsettings/package.json @@ -42,7 +42,7 @@ "@types/fs-extra": "^9.0.13", "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", - "@types/vscode": "1.64.0", + "@types/vscode": "1.76.0", "@typescript-eslint/eslint-plugin": "^5.53.0", "@vscode/test-electron": "^2.1.5", "eslint": "^8.34.0", From 4e6d62b052389fb4b5d8c422e74ae651df575dda Mon Sep 17 00:00:00 2001 From: Nathan Turinski Date: Tue, 11 Apr 2023 15:29:05 -0700 Subject: [PATCH 2/9] Convert appservice package to use pipelines ServiceClient rather than ms-rest-js --- appservice/package-lock.json | 465 +++++++++--------- appservice/package.json | 14 +- appservice/src/SiteClient.ts | 74 +-- appservice/src/TunnelProxy.ts | 20 +- .../src/createAppService/SiteNameStep.ts | 4 +- .../getAppInsightsSupportedLocation.ts | 10 +- .../src/createAppService/setLocationsTask.ts | 18 +- appservice/src/createSlot.ts | 4 +- appservice/src/deploy/runWithZipStream.ts | 6 +- appservice/src/editScmType.ts | 4 +- appservice/src/github/GitHubBranchListStep.ts | 64 +-- appservice/src/github/GitHubOrgListStep.ts | 48 +- appservice/src/github/GitHubRepoListStep.ts | 64 +-- .../github/IConnectToGitHubWizardContext.ts | 30 +- appservice/src/github/connectToGitHub.ts | 405 +++++++-------- appservice/src/index.ts | 2 +- appservice/src/pingFunctionApp.ts | 15 +- appservice/src/siteFiles.ts | 19 +- appservice/src/startStreamingLogs.ts | 18 +- appservice/src/utils/azureClients.ts | 5 +- appservice/src/utils/azureUtils.ts | 18 +- 21 files changed, 653 insertions(+), 654 deletions(-) diff --git a/appservice/package-lock.json b/appservice/package-lock.json index 20b4145dba..69b0eab187 100644 --- a/appservice/package-lock.json +++ b/appservice/package-lock.json @@ -13,12 +13,13 @@ "@azure/arm-appinsights": "^5.0.0-beta.4", "@azure/arm-appservice": "^13.0.2", "@azure/arm-operationalinsights": "^8.0.1", - "@azure/arm-resourcegraph": "^4.0.0", + "@azure/arm-resourcegraph": "^4.2.1", "@azure/arm-resources-subscriptions": "^2.0.1", + "@azure/core-rest-pipeline": "^1.10.3", "@azure/ms-rest-azure-env": "^2.0.0", "@azure/storage-blob": "^12.3.0", - "@microsoft/vscode-azext-azureutils": "^0.3.7", - "@microsoft/vscode-azext-utils": "^0.4.0", + "@microsoft/vscode-azext-azureutils": "file:../azure/microsoft-vscode-azext-azureutils-1.1.3.tgz", + "@microsoft/vscode-azext-utils": "^1.1.0", "dayjs": "^1.11.2", "fs-extra": "^10.0.0", "globby": "^11.0.2", @@ -30,14 +31,15 @@ "yazl": "^2.5.1" }, "devDependencies": { + "@azure/core-auth": "^1.4.0", "@microsoft/eslint-config-azuretools": "^0.2.0", - "@microsoft/vscode-azext-azureappsettings": "^0.0.1", - "@microsoft/vscode-azext-dev": "^1.0.4", + "@microsoft/vscode-azext-azureappsettings": "^0.0.2", + "@microsoft/vscode-azext-dev": "^1.2.0", "@types/fs-extra": "^9.0.13", "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/p-retry": "^2.0.0", - "@types/vscode": "1.64.0", + "@types/vscode": "1.76.0", "@types/ws": "^8.5.3", "@types/yazl": "^2.4.2", "@typescript-eslint/eslint-plugin": "^5.53.0", @@ -177,20 +179,20 @@ } }, "node_modules/@azure/arm-storage": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/@azure/arm-storage/-/arm-storage-17.0.0.tgz", - "integrity": "sha512-WS9eT3/vDQ7a1z/8K5BkPhoAi0ilo94yCSws4KyWq6UIA3RaXBDpYYAlN0TOxad9rPeOnWXWcB9gLw3DmjZ4wg==", + "version": "18.1.0", + "resolved": "https://registry.npmjs.org/@azure/arm-storage/-/arm-storage-18.1.0.tgz", + "integrity": "sha512-/31M6UzDD4NjsOT3mVAM2PhLyyT8/SfvL3PgFerk91BBnUy7toJXzzSsBO0Ysx7I1Pvjo6jSkTPs3D4Kz9CGDg==", "dependencies": { "@azure/abort-controller": "^1.0.0", "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.0.0", + "@azure/core-client": "^1.6.1", "@azure/core-lro": "^2.2.0", "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.1.0", + "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" } }, "node_modules/@azure/arm-storage-profile-2020-09-01-hybrid": { @@ -328,20 +330,19 @@ } }, "node_modules/@azure/core-rest-pipeline": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.10.0.tgz", - "integrity": "sha512-m6c4iAalfaf6sytOOQhLKFprEHSkSjQuRgkW7MTMnAN+GENDDL4XZJp7WKFnq9VpKUE+ggq+rp5xX9GI93lumw==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.10.3.tgz", + "integrity": "sha512-AMQb0ttiGJ0MIV/r+4TVra6U4+90mPeOveehFnrqKlo7dknPJYdJ61wOzYJXJjDxF8LcCtSogfRelkq+fCGFTw==", "dependencies": { "@azure/abort-controller": "^1.0.0", "@azure/core-auth": "^1.4.0", "@azure/core-tracing": "^1.0.1", - "@azure/core-util": "^1.0.0", + "@azure/core-util": "^1.3.0", "@azure/logger": "^1.0.0", "form-data": "^4.0.0", "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", - "tslib": "^2.2.0", - "uuid": "^8.3.0" + "tslib": "^2.2.0" }, "engines": { "node": ">=14.0.0" @@ -392,25 +393,26 @@ } }, "node_modules/@azure/core-util": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.0.0.tgz", - "integrity": "sha512-yWshY9cdPthlebnb3Zuz/j0Lv4kjU6u7PR5sW7A9FF7EX+0irMRJAtyTq5TPiDHJfjH8gTSlnIYFj9m7Ed76IQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.3.0.tgz", + "integrity": "sha512-ANP0Er7R2KHHHjwmKzPF9wbd0gXvOX7yRRHeYL1eNd/OaNrMLyfZH/FQasHRVAf6rMXX+EAUpvYwLMFDHDI5Gw==", "dependencies": { + "@azure/abort-controller": "^1.0.0", "tslib": "^2.2.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" } }, "node_modules/@azure/logger": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.3.tgz", - "integrity": "sha512-aK4s3Xxjrx3daZr3VylxejK3vG5ExXck5WOHDJ8in/k9AqlfIyFMMT1uG7u8mNjX+QRILTIn0/Xgschfh/dQ9g==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.4.tgz", + "integrity": "sha512-ustrPY8MryhloQj7OWGe+HrYx+aoiOxzbXTtgblbV3xwCqpzUK36phH3XNHQKj3EPonyFUuDTfR3qFhTEAuZEg==", "dependencies": { "tslib": "^2.2.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" } }, "node_modules/@azure/ms-rest-azure-env": { @@ -630,46 +632,46 @@ "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==" }, "node_modules/@microsoft/1ds-core-js": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-3.2.4.tgz", - "integrity": "sha512-ZkbCb63JF7hN+YQ8e/4nRe6vAIBMpoF8PQNiYiXSzYtdhXZ/pM3jB9/7g0O5LR4h/2IU1amAq0kpBgPbd6NWqg==", + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-3.2.9.tgz", + "integrity": "sha512-3pCfM2TzHn3gU9pxHztduKcVRdb/nzruvPFfHPZD0IM0mb0h6TGo2isELF3CTMahTx50RAC51ojNIw2/7VRkOg==", "dependencies": { - "@microsoft/applicationinsights-core-js": "2.8.5", - "@microsoft/applicationinsights-shims": "^2.0.1", - "@microsoft/dynamicproto-js": "^1.1.6" + "@microsoft/applicationinsights-core-js": "2.8.10", + "@microsoft/applicationinsights-shims": "^2.0.2", + "@microsoft/dynamicproto-js": "^1.1.7" } }, "node_modules/@microsoft/1ds-post-js": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-3.2.4.tgz", - "integrity": "sha512-SblhGNkd8C6kzewq+Gc/ViN2oYp1/TJFw0Y4rOfHXCr6siznInBggm5ehqZd/QPXh/7MYqCx4Gpw9Rra18fO0g==", + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-3.2.9.tgz", + "integrity": "sha512-D/RtqkQ2Nr4cuoGqmhi5QTmi3cBlxehIThJ1u3BaH9H/YkLNTKEcHZRWTXy14bXheCefNHciLuadg37G2Kekcg==", "dependencies": { - "@microsoft/1ds-core-js": "3.2.4", - "@microsoft/applicationinsights-shims": "^2.0.1", - "@microsoft/dynamicproto-js": "^1.1.6" + "@microsoft/1ds-core-js": "3.2.9", + "@microsoft/applicationinsights-shims": "^2.0.2", + "@microsoft/dynamicproto-js": "^1.1.7" } }, "node_modules/@microsoft/applicationinsights-core-js": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.5.tgz", - "integrity": "sha512-7/EgK6r8GiDVluo84skCMNthgnPa6P7TXiJqHBJbuCf11N4YqkZoGjKs+Fo7h6XIPuYMUHVMNLpBObI7oS7HsQ==", + "version": "2.8.10", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.10.tgz", + "integrity": "sha512-jQrufDW0+sV8fBhRvzIPNGiCC6dELH+Ug0DM5CfN9757TBqZJz8CSWyDjex39as8+jD0F/8HRU9QdmrVgq5vFg==", "dependencies": { - "@microsoft/applicationinsights-shims": "2.0.1", - "@microsoft/dynamicproto-js": "^1.1.6" + "@microsoft/applicationinsights-shims": "2.0.2", + "@microsoft/dynamicproto-js": "^1.1.7" }, "peerDependencies": { "tslib": "*" } }, "node_modules/@microsoft/applicationinsights-shims": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-2.0.1.tgz", - "integrity": "sha512-G0MXf6R6HndRbDy9BbEj0zrLeuhwt2nsXk2zKtF0TnYo39KgYqhYC2ayIzKPTm2KAE+xzD7rgyLdZnrcRvt9WQ==" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-2.0.2.tgz", + "integrity": "sha512-PoHEgsnmcqruLNHZ/amACqdJ6YYQpED0KSRe6J7gIJTtpZC1FfFU9b1fmDKDKtFoUSrPzEh1qzO3kmRZP0betg==" }, "node_modules/@microsoft/dynamicproto-js": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.6.tgz", - "integrity": "sha512-D1Oivw1A4bIXhzBIy3/BBPn3p2On+kpO2NiYt9shICDK7L/w+cR6FFBUsBZ05l6iqzTeL+Jm8lAYn0g6G7DmDg==" + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.9.tgz", + "integrity": "sha512-n1VPsljTSkthsAFYdiWfC+DKzK2WwcRp83Y1YAqdX552BstvsDjft9YXppjUzp11BPsapDoO1LDgrDB0XVsfNQ==" }, "node_modules/@microsoft/eslint-config-azuretools": { "version": "0.2.0", @@ -686,35 +688,47 @@ } }, "node_modules/@microsoft/vscode-azext-azureappsettings": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-azureappsettings/-/vscode-azext-azureappsettings-0.0.1.tgz", - "integrity": "sha512-WS1kMGx0yGxikrJn/fc/YEeQcicOwfbIYkGW9DucmCy4VJAOexeXC28Rbv+HXd/JBnPKA6O49bEkrJLOzuUbQg==", + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-azureappsettings/-/vscode-azext-azureappsettings-0.0.2.tgz", + "integrity": "sha512-Z+afAkpX/tqzPqsLFncZdEFPyNLaVpCYmQkjpqisYR51fvghedy5M0X2piTr6VsE7Ydd0jwuIZjPPf2l/pPE5g==", "dev": true, "dependencies": { - "@microsoft/vscode-azext-utils": "^0.4.0", + "@microsoft/vscode-azext-utils": "^1.1.0", "vscode-nls": "^5.0.1" } }, "node_modules/@microsoft/vscode-azext-azureutils": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-azureutils/-/vscode-azext-azureutils-0.3.7.tgz", - "integrity": "sha512-GZVHRWD1V5ACVH3r6/4RvPc5fStoR3dBVn2A9azdvWtODVt+ZasApED8nOfEbMNfbXYdop9iWtSvF9+FMXmu1g==", + "version": "1.1.3", + "resolved": "file:../azure/microsoft-vscode-azext-azureutils-1.1.3.tgz", + "integrity": "sha512-G+hi9Vv39V+STU3b4eViEHKUYCU4BoNgh3maxsCL/ysgOymViuwLU6gcnL/NIokLyv//NNkpVaqlgX+7039Y3Q==", + "license": "MIT", "dependencies": { "@azure/arm-resources": "^5.0.0", "@azure/arm-resources-profile-2020-09-01-hybrid": "^2.0.0", "@azure/arm-resources-subscriptions": "^2.0.0", - "@azure/arm-storage": "^17.0.0", + "@azure/arm-storage": "^18.0.0", "@azure/arm-storage-profile-2020-09-01-hybrid": "^2.0.0", - "@azure/ms-rest-js": "^2.2.1", - "@microsoft/vscode-azext-utils": "^0.4.0", + "@azure/core-client": "^1.6.0", + "@azure/core-rest-pipeline": "^1.9.0", + "@azure/logger": "^1.0.4", + "@microsoft/vscode-azext-utils": "^1.0.0", "semver": "^7.3.7", + "uuid": "^9.0.0", "vscode-nls": "^5.0.1" } }, + "node_modules/@microsoft/vscode-azext-azureutils/node_modules/uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@microsoft/vscode-azext-dev": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-dev/-/vscode-azext-dev-1.0.4.tgz", - "integrity": "sha512-84adRC2BjJ+na66bK8zwXqZt9AJ8Y2qkPwR2GJ0a2pZMtxfEw2z7lvjF3Qvicy7ZbDr2Gwmnw61gphkrdtmt/A==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-dev/-/vscode-azext-dev-1.2.0.tgz", + "integrity": "sha512-RjhKcHTdcO6AtUJWzm7BoQwIS2Ln5g7LxRDHkzHdH+ClHWBqJ2bvN9amfgXTQyrFwasLrDRwJ7psXGONAnfRPQ==", "dev": true, "dependencies": { "@azure/arm-subscriptions": "^2.0.0", @@ -1049,20 +1063,35 @@ "dev": true }, "node_modules/@microsoft/vscode-azext-utils": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-utils/-/vscode-azext-utils-0.4.0.tgz", - "integrity": "sha512-1mnYfVah6pULYXExR7nkDqFdU1oA8bddtWlPANcWatSjB5qZ4qKFWrnkR3DqGvVItPptiNzKHYRmNBwJ+NAG9g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-utils/-/vscode-azext-utils-1.1.0.tgz", + "integrity": "sha512-rxKCApwQBEebcY2byLm2VOT+KA7S2DyuBXyLZtBBmfN6L0a81dHZwZo8ug2CAs08POS1Ql1vzLbVa8CLeF83KA==", "dependencies": { + "@microsoft/vscode-azureresources-api": "^2.0.2", "@vscode/extension-telemetry": "^0.6.2", "dayjs": "^1.11.2", "escape-string-regexp": "^2.0.0", "html-to-text": "^8.2.0", - "open": "^8.0.4", "semver": "^7.3.7", + "uuid": "^9.0.0", "vscode-nls": "^5.0.1", - "vscode-tas-client": "^0.1.47" + "vscode-tas-client": "^0.1.47", + "vscode-uri": "^3.0.6" + } + }, + "node_modules/@microsoft/vscode-azext-utils/node_modules/uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "bin": { + "uuid": "dist/bin/uuid" } }, + "node_modules/@microsoft/vscode-azureresources-api": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azureresources-api/-/vscode-azureresources-api-2.0.4.tgz", + "integrity": "sha512-LridV1h2rCydrBzEpwy+pUIUx61GpZNwrK04G7LdlhoxHrzuM/WAoy8jXaSC/FSKSsXD1QXuE6u/YofEfsuKeg==" + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -1286,9 +1315,9 @@ } }, "node_modules/@types/vscode": { - "version": "1.64.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.64.0.tgz", - "integrity": "sha512-bSlAWz5WtcSL3cO9tAT/KpEH9rv5OBnm93OIIFwdCshaAiqr2bp1AUyEwW9MWeCvZBHEXc3V0fTYVdVyzDNwHA==", + "version": "1.76.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.76.0.tgz", + "integrity": "sha512-CQcY3+Fe5hNewHnOEAVYj4dd1do/QHliXaknAEYSXx2KEHUzFibDZSKptCon+HPgK55xx20pR+PBJjf0MomnBA==", "dev": true }, "node_modules/@types/ws": { @@ -2608,21 +2637,13 @@ "dev": true }, "node_modules/deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "engines": { "node": ">=0.10.0" } }, - "node_modules/define-lazy-prop": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", - "engines": { - "node": ">=8" - } - }, "node_modules/define-properties": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", @@ -3941,9 +3962,9 @@ } }, "node_modules/html-to-text": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/html-to-text/-/html-to-text-8.2.0.tgz", - "integrity": "sha512-CLXExYn1b++Lgri+ZyVvbUEFwzkLZppjjZOwB7X1qv2jIi8MrMEvxWX5KQ7zATAzTvcqgmtO00M2kCRMtEdOKQ==", + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/html-to-text/-/html-to-text-8.2.1.tgz", + "integrity": "sha512-aN/3JvAk8qFsWVeE9InWAWueLXrbkoVZy0TkzaGhoRBC2gCFEeRLDDJN3/ijIGHohy6H+SZzUQWN/hcYtaPK8w==", "dependencies": { "@selderee/plugin-htmlparser2": "^0.6.0", "deepmerge": "^4.2.2", @@ -4210,20 +4231,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "bin": { - "is-docker": "cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -4461,17 +4468,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dependencies": { - "is-docker": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -5079,9 +5075,9 @@ } }, "node_modules/moo": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.1.tgz", - "integrity": "sha512-I1mnb5xn4fO80BH9BLcF0yLypy2UKl+Cb01Fu0hJRkJjlCRtxZMWkTdAtDd5ZqCOxtCkhmRwyI57vWT+1iZ67w==" + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", + "integrity": "sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==" }, "node_modules/ms": { "version": "2.1.2", @@ -5260,22 +5256,6 @@ "wrappy": "1" } }, - "node_modules/open": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", - "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", - "dependencies": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -6241,9 +6221,9 @@ } }, "node_modules/tas-client": { - "version": "0.1.45", - "resolved": "https://registry.npmjs.org/tas-client/-/tas-client-0.1.45.tgz", - "integrity": "sha512-IG9UmCpDbDPK23UByQ27rLybkRZYEx2eC9EkieXdwPKKjZPD2zPwfQmyGnZrZet4FUt3yj0ytkwz+liR9Nz/nA==", + "version": "0.1.58", + "resolved": "https://registry.npmjs.org/tas-client/-/tas-client-0.1.58.tgz", + "integrity": "sha512-fOWii4wQXuo9Zl0oXgvjBzZWzKc5MmUR6XQWX93WU2c1SaP1plPo/zvXP8kpbZ9fvegFOHdapszYqMTRq/SRtg==", "dependencies": { "axios": "^0.26.1" } @@ -6690,16 +6670,21 @@ "integrity": "sha512-hHQV6iig+M21lTdItKPkJAaWrxALQb/nqpVffakO4knJOh3DrU2SXOMzUzNgo1eADPzu3qSsJY1weCzvR52q9A==" }, "node_modules/vscode-tas-client": { - "version": "0.1.47", - "resolved": "https://registry.npmjs.org/vscode-tas-client/-/vscode-tas-client-0.1.47.tgz", - "integrity": "sha512-SlEPDi+0gwxor4ANzBtXwqROPQdQkClHeVJgnkvdDF5Xnl407htCsabTPAq4Di8muObORtLchqQS/k1ocaGDEg==", + "version": "0.1.63", + "resolved": "https://registry.npmjs.org/vscode-tas-client/-/vscode-tas-client-0.1.63.tgz", + "integrity": "sha512-TY5TPyibzi6rNmuUB7eRVqpzLzNfQYrrIl/0/F8ukrrbzOrKVvS31hM3urE+tbaVrnT+TMYXL16GhX57vEowhA==", "dependencies": { - "tas-client": "0.1.45" + "tas-client": "0.1.58" }, "engines": { "vscode": "^1.19.1" } }, + "node_modules/vscode-uri": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.7.tgz", + "integrity": "sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA==" + }, "node_modules/watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", @@ -7149,16 +7134,16 @@ } }, "@azure/arm-storage": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/@azure/arm-storage/-/arm-storage-17.0.0.tgz", - "integrity": "sha512-WS9eT3/vDQ7a1z/8K5BkPhoAi0ilo94yCSws4KyWq6UIA3RaXBDpYYAlN0TOxad9rPeOnWXWcB9gLw3DmjZ4wg==", + "version": "18.1.0", + "resolved": "https://registry.npmjs.org/@azure/arm-storage/-/arm-storage-18.1.0.tgz", + "integrity": "sha512-/31M6UzDD4NjsOT3mVAM2PhLyyT8/SfvL3PgFerk91BBnUy7toJXzzSsBO0Ysx7I1Pvjo6jSkTPs3D4Kz9CGDg==", "requires": { "@azure/abort-controller": "^1.0.0", "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.0.0", + "@azure/core-client": "^1.6.1", "@azure/core-lro": "^2.2.0", "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.1.0", + "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" } }, @@ -7274,20 +7259,19 @@ } }, "@azure/core-rest-pipeline": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.10.0.tgz", - "integrity": "sha512-m6c4iAalfaf6sytOOQhLKFprEHSkSjQuRgkW7MTMnAN+GENDDL4XZJp7WKFnq9VpKUE+ggq+rp5xX9GI93lumw==", + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.10.3.tgz", + "integrity": "sha512-AMQb0ttiGJ0MIV/r+4TVra6U4+90mPeOveehFnrqKlo7dknPJYdJ61wOzYJXJjDxF8LcCtSogfRelkq+fCGFTw==", "requires": { "@azure/abort-controller": "^1.0.0", "@azure/core-auth": "^1.4.0", "@azure/core-tracing": "^1.0.1", - "@azure/core-util": "^1.0.0", + "@azure/core-util": "^1.3.0", "@azure/logger": "^1.0.0", "form-data": "^4.0.0", "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", - "tslib": "^2.2.0", - "uuid": "^8.3.0" + "tslib": "^2.2.0" }, "dependencies": { "@azure/core-tracing": { @@ -7325,17 +7309,18 @@ } }, "@azure/core-util": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.0.0.tgz", - "integrity": "sha512-yWshY9cdPthlebnb3Zuz/j0Lv4kjU6u7PR5sW7A9FF7EX+0irMRJAtyTq5TPiDHJfjH8gTSlnIYFj9m7Ed76IQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.3.0.tgz", + "integrity": "sha512-ANP0Er7R2KHHHjwmKzPF9wbd0gXvOX7yRRHeYL1eNd/OaNrMLyfZH/FQasHRVAf6rMXX+EAUpvYwLMFDHDI5Gw==", "requires": { + "@azure/abort-controller": "^1.0.0", "tslib": "^2.2.0" } }, "@azure/logger": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.3.tgz", - "integrity": "sha512-aK4s3Xxjrx3daZr3VylxejK3vG5ExXck5WOHDJ8in/k9AqlfIyFMMT1uG7u8mNjX+QRILTIn0/Xgschfh/dQ9g==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.4.tgz", + "integrity": "sha512-ustrPY8MryhloQj7OWGe+HrYx+aoiOxzbXTtgblbV3xwCqpzUK36phH3XNHQKj3EPonyFUuDTfR3qFhTEAuZEg==", "requires": { "tslib": "^2.2.0" } @@ -7530,43 +7515,43 @@ "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==" }, "@microsoft/1ds-core-js": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-3.2.4.tgz", - "integrity": "sha512-ZkbCb63JF7hN+YQ8e/4nRe6vAIBMpoF8PQNiYiXSzYtdhXZ/pM3jB9/7g0O5LR4h/2IU1amAq0kpBgPbd6NWqg==", + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-3.2.9.tgz", + "integrity": "sha512-3pCfM2TzHn3gU9pxHztduKcVRdb/nzruvPFfHPZD0IM0mb0h6TGo2isELF3CTMahTx50RAC51ojNIw2/7VRkOg==", "requires": { - "@microsoft/applicationinsights-core-js": "2.8.5", - "@microsoft/applicationinsights-shims": "^2.0.1", - "@microsoft/dynamicproto-js": "^1.1.6" + "@microsoft/applicationinsights-core-js": "2.8.10", + "@microsoft/applicationinsights-shims": "^2.0.2", + "@microsoft/dynamicproto-js": "^1.1.7" } }, "@microsoft/1ds-post-js": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-3.2.4.tgz", - "integrity": "sha512-SblhGNkd8C6kzewq+Gc/ViN2oYp1/TJFw0Y4rOfHXCr6siznInBggm5ehqZd/QPXh/7MYqCx4Gpw9Rra18fO0g==", + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-3.2.9.tgz", + "integrity": "sha512-D/RtqkQ2Nr4cuoGqmhi5QTmi3cBlxehIThJ1u3BaH9H/YkLNTKEcHZRWTXy14bXheCefNHciLuadg37G2Kekcg==", "requires": { - "@microsoft/1ds-core-js": "3.2.4", - "@microsoft/applicationinsights-shims": "^2.0.1", - "@microsoft/dynamicproto-js": "^1.1.6" + "@microsoft/1ds-core-js": "3.2.9", + "@microsoft/applicationinsights-shims": "^2.0.2", + "@microsoft/dynamicproto-js": "^1.1.7" } }, "@microsoft/applicationinsights-core-js": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.5.tgz", - "integrity": "sha512-7/EgK6r8GiDVluo84skCMNthgnPa6P7TXiJqHBJbuCf11N4YqkZoGjKs+Fo7h6XIPuYMUHVMNLpBObI7oS7HsQ==", + "version": "2.8.10", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.10.tgz", + "integrity": "sha512-jQrufDW0+sV8fBhRvzIPNGiCC6dELH+Ug0DM5CfN9757TBqZJz8CSWyDjex39as8+jD0F/8HRU9QdmrVgq5vFg==", "requires": { - "@microsoft/applicationinsights-shims": "2.0.1", - "@microsoft/dynamicproto-js": "^1.1.6" + "@microsoft/applicationinsights-shims": "2.0.2", + "@microsoft/dynamicproto-js": "^1.1.7" } }, "@microsoft/applicationinsights-shims": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-2.0.1.tgz", - "integrity": "sha512-G0MXf6R6HndRbDy9BbEj0zrLeuhwt2nsXk2zKtF0TnYo39KgYqhYC2ayIzKPTm2KAE+xzD7rgyLdZnrcRvt9WQ==" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-2.0.2.tgz", + "integrity": "sha512-PoHEgsnmcqruLNHZ/amACqdJ6YYQpED0KSRe6J7gIJTtpZC1FfFU9b1fmDKDKtFoUSrPzEh1qzO3kmRZP0betg==" }, "@microsoft/dynamicproto-js": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.6.tgz", - "integrity": "sha512-D1Oivw1A4bIXhzBIy3/BBPn3p2On+kpO2NiYt9shICDK7L/w+cR6FFBUsBZ05l6iqzTeL+Jm8lAYn0g6G7DmDg==" + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.9.tgz", + "integrity": "sha512-n1VPsljTSkthsAFYdiWfC+DKzK2WwcRp83Y1YAqdX552BstvsDjft9YXppjUzp11BPsapDoO1LDgrDB0XVsfNQ==" }, "@microsoft/eslint-config-azuretools": { "version": "0.2.0", @@ -7578,35 +7563,44 @@ } }, "@microsoft/vscode-azext-azureappsettings": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-azureappsettings/-/vscode-azext-azureappsettings-0.0.1.tgz", - "integrity": "sha512-WS1kMGx0yGxikrJn/fc/YEeQcicOwfbIYkGW9DucmCy4VJAOexeXC28Rbv+HXd/JBnPKA6O49bEkrJLOzuUbQg==", + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-azureappsettings/-/vscode-azext-azureappsettings-0.0.2.tgz", + "integrity": "sha512-Z+afAkpX/tqzPqsLFncZdEFPyNLaVpCYmQkjpqisYR51fvghedy5M0X2piTr6VsE7Ydd0jwuIZjPPf2l/pPE5g==", "dev": true, "requires": { - "@microsoft/vscode-azext-utils": "^0.4.0", + "@microsoft/vscode-azext-utils": "^1.1.0", "vscode-nls": "^5.0.1" } }, "@microsoft/vscode-azext-azureutils": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-azureutils/-/vscode-azext-azureutils-0.3.7.tgz", - "integrity": "sha512-GZVHRWD1V5ACVH3r6/4RvPc5fStoR3dBVn2A9azdvWtODVt+ZasApED8nOfEbMNfbXYdop9iWtSvF9+FMXmu1g==", + "version": "file:..\\azure\\microsoft-vscode-azext-azureutils-1.1.3.tgz", + "integrity": "sha512-G+hi9Vv39V+STU3b4eViEHKUYCU4BoNgh3maxsCL/ysgOymViuwLU6gcnL/NIokLyv//NNkpVaqlgX+7039Y3Q==", "requires": { "@azure/arm-resources": "^5.0.0", "@azure/arm-resources-profile-2020-09-01-hybrid": "^2.0.0", "@azure/arm-resources-subscriptions": "^2.0.0", - "@azure/arm-storage": "^17.0.0", + "@azure/arm-storage": "^18.0.0", "@azure/arm-storage-profile-2020-09-01-hybrid": "^2.0.0", - "@azure/ms-rest-js": "^2.2.1", - "@microsoft/vscode-azext-utils": "^0.4.0", + "@azure/core-client": "^1.6.0", + "@azure/core-rest-pipeline": "^1.9.0", + "@azure/logger": "^1.0.4", + "@microsoft/vscode-azext-utils": "^1.0.0", "semver": "^7.3.7", + "uuid": "^9.0.0", "vscode-nls": "^5.0.1" + }, + "dependencies": { + "uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" + } } }, "@microsoft/vscode-azext-dev": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-dev/-/vscode-azext-dev-1.0.4.tgz", - "integrity": "sha512-84adRC2BjJ+na66bK8zwXqZt9AJ8Y2qkPwR2GJ0a2pZMtxfEw2z7lvjF3Qvicy7ZbDr2Gwmnw61gphkrdtmt/A==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-dev/-/vscode-azext-dev-1.2.0.tgz", + "integrity": "sha512-RjhKcHTdcO6AtUJWzm7BoQwIS2Ln5g7LxRDHkzHdH+ClHWBqJ2bvN9amfgXTQyrFwasLrDRwJ7psXGONAnfRPQ==", "dev": true, "requires": { "@azure/arm-subscriptions": "^2.0.0", @@ -7861,20 +7855,34 @@ } }, "@microsoft/vscode-azext-utils": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-utils/-/vscode-azext-utils-0.4.0.tgz", - "integrity": "sha512-1mnYfVah6pULYXExR7nkDqFdU1oA8bddtWlPANcWatSjB5qZ4qKFWrnkR3DqGvVItPptiNzKHYRmNBwJ+NAG9g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-utils/-/vscode-azext-utils-1.1.0.tgz", + "integrity": "sha512-rxKCApwQBEebcY2byLm2VOT+KA7S2DyuBXyLZtBBmfN6L0a81dHZwZo8ug2CAs08POS1Ql1vzLbVa8CLeF83KA==", "requires": { + "@microsoft/vscode-azureresources-api": "^2.0.2", "@vscode/extension-telemetry": "^0.6.2", "dayjs": "^1.11.2", "escape-string-regexp": "^2.0.0", "html-to-text": "^8.2.0", - "open": "^8.0.4", "semver": "^7.3.7", + "uuid": "^9.0.0", "vscode-nls": "^5.0.1", - "vscode-tas-client": "^0.1.47" + "vscode-tas-client": "^0.1.47", + "vscode-uri": "^3.0.6" + }, + "dependencies": { + "uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" + } } }, + "@microsoft/vscode-azureresources-api": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azureresources-api/-/vscode-azureresources-api-2.0.4.tgz", + "integrity": "sha512-LridV1h2rCydrBzEpwy+pUIUx61GpZNwrK04G7LdlhoxHrzuM/WAoy8jXaSC/FSKSsXD1QXuE6u/YofEfsuKeg==" + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -8071,9 +8079,9 @@ } }, "@types/vscode": { - "version": "1.64.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.64.0.tgz", - "integrity": "sha512-bSlAWz5WtcSL3cO9tAT/KpEH9rv5OBnm93OIIFwdCshaAiqr2bp1AUyEwW9MWeCvZBHEXc3V0fTYVdVyzDNwHA==", + "version": "1.76.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.76.0.tgz", + "integrity": "sha512-CQcY3+Fe5hNewHnOEAVYj4dd1do/QHliXaknAEYSXx2KEHUzFibDZSKptCon+HPgK55xx20pR+PBJjf0MomnBA==", "dev": true }, "@types/ws": { @@ -9046,14 +9054,9 @@ "dev": true }, "deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" - }, - "define-lazy-prop": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==" + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==" }, "define-properties": { "version": "1.2.0", @@ -10050,9 +10053,9 @@ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" }, "html-to-text": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/html-to-text/-/html-to-text-8.2.0.tgz", - "integrity": "sha512-CLXExYn1b++Lgri+ZyVvbUEFwzkLZppjjZOwB7X1qv2jIi8MrMEvxWX5KQ7zATAzTvcqgmtO00M2kCRMtEdOKQ==", + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/html-to-text/-/html-to-text-8.2.1.tgz", + "integrity": "sha512-aN/3JvAk8qFsWVeE9InWAWueLXrbkoVZy0TkzaGhoRBC2gCFEeRLDDJN3/ijIGHohy6H+SZzUQWN/hcYtaPK8w==", "requires": { "@selderee/plugin-htmlparser2": "^0.6.0", "deepmerge": "^4.2.2", @@ -10243,11 +10246,6 @@ "has-tostringtag": "^1.0.0" } }, - "is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==" - }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -10401,14 +10399,6 @@ "call-bind": "^1.0.2" } }, - "is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "requires": { - "is-docker": "^2.0.0" - } - }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -10874,9 +10864,9 @@ } }, "moo": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.1.tgz", - "integrity": "sha512-I1mnb5xn4fO80BH9BLcF0yLypy2UKl+Cb01Fu0hJRkJjlCRtxZMWkTdAtDd5ZqCOxtCkhmRwyI57vWT+1iZ67w==" + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", + "integrity": "sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==" }, "ms": { "version": "2.1.2", @@ -10998,16 +10988,6 @@ "wrappy": "1" } }, - "open": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", - "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", - "requires": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" - } - }, "optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -11688,9 +11668,9 @@ } }, "tas-client": { - "version": "0.1.45", - "resolved": "https://registry.npmjs.org/tas-client/-/tas-client-0.1.45.tgz", - "integrity": "sha512-IG9UmCpDbDPK23UByQ27rLybkRZYEx2eC9EkieXdwPKKjZPD2zPwfQmyGnZrZet4FUt3yj0ytkwz+liR9Nz/nA==", + "version": "0.1.58", + "resolved": "https://registry.npmjs.org/tas-client/-/tas-client-0.1.58.tgz", + "integrity": "sha512-fOWii4wQXuo9Zl0oXgvjBzZWzKc5MmUR6XQWX93WU2c1SaP1plPo/zvXP8kpbZ9fvegFOHdapszYqMTRq/SRtg==", "requires": { "axios": "^0.26.1" }, @@ -12046,13 +12026,18 @@ "integrity": "sha512-hHQV6iig+M21lTdItKPkJAaWrxALQb/nqpVffakO4knJOh3DrU2SXOMzUzNgo1eADPzu3qSsJY1weCzvR52q9A==" }, "vscode-tas-client": { - "version": "0.1.47", - "resolved": "https://registry.npmjs.org/vscode-tas-client/-/vscode-tas-client-0.1.47.tgz", - "integrity": "sha512-SlEPDi+0gwxor4ANzBtXwqROPQdQkClHeVJgnkvdDF5Xnl407htCsabTPAq4Di8muObORtLchqQS/k1ocaGDEg==", + "version": "0.1.63", + "resolved": "https://registry.npmjs.org/vscode-tas-client/-/vscode-tas-client-0.1.63.tgz", + "integrity": "sha512-TY5TPyibzi6rNmuUB7eRVqpzLzNfQYrrIl/0/F8ukrrbzOrKVvS31hM3urE+tbaVrnT+TMYXL16GhX57vEowhA==", "requires": { - "tas-client": "0.1.45" + "tas-client": "0.1.58" } }, + "vscode-uri": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.7.tgz", + "integrity": "sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA==" + }, "watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", diff --git a/appservice/package.json b/appservice/package.json index 93af774822..6d71d3ef65 100644 --- a/appservice/package.json +++ b/appservice/package.json @@ -36,12 +36,13 @@ "@azure/arm-appinsights": "^5.0.0-beta.4", "@azure/arm-appservice": "^13.0.2", "@azure/arm-operationalinsights": "^8.0.1", - "@azure/arm-resourcegraph": "^4.0.0", + "@azure/arm-resourcegraph": "^4.2.1", "@azure/arm-resources-subscriptions": "^2.0.1", + "@azure/core-rest-pipeline": "^1.10.3", "@azure/ms-rest-azure-env": "^2.0.0", "@azure/storage-blob": "^12.3.0", - "@microsoft/vscode-azext-azureutils": "^0.3.7", - "@microsoft/vscode-azext-utils": "^0.4.0", + "@microsoft/vscode-azext-azureutils": "file:../azure/microsoft-vscode-azext-azureutils-1.1.3.tgz", + "@microsoft/vscode-azext-utils": "^1.1.0", "dayjs": "^1.11.2", "fs-extra": "^10.0.0", "globby": "^11.0.2", @@ -53,14 +54,15 @@ "yazl": "^2.5.1" }, "devDependencies": { + "@azure/core-auth": "^1.4.0", "@microsoft/eslint-config-azuretools": "^0.2.0", - "@microsoft/vscode-azext-azureappsettings": "^0.0.1", - "@microsoft/vscode-azext-dev": "^1.0.4", + "@microsoft/vscode-azext-azureappsettings": "^0.0.2", + "@microsoft/vscode-azext-dev": "^1.2.0", "@types/fs-extra": "^9.0.13", "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/p-retry": "^2.0.0", - "@types/vscode": "1.64.0", + "@types/vscode": "1.76.0", "@types/ws": "^8.5.3", "@types/yazl": "^2.4.2", "@typescript-eslint/eslint-plugin": "^5.53.0", diff --git a/appservice/src/SiteClient.ts b/appservice/src/SiteClient.ts index 2d36e09b42..0b851e3f80 100644 --- a/appservice/src/SiteClient.ts +++ b/appservice/src/SiteClient.ts @@ -4,16 +4,18 @@ *--------------------------------------------------------------------------------------------*/ import type { AppServicePlan, FunctionEnvelope, FunctionSecrets, HostKeys, HostNameSslState, Site, SiteConfigResource, SiteLogsConfig, SiteSourceControl, SlotConfigNamesResource, SourceControl, StringDictionary, User, WebAppsListFunctionKeysResponse, WebJob, WebSiteInstanceStatus, WebSiteManagementClient } from '@azure/arm-appservice'; -import type { HttpOperationResponse, HttpRequestBody, HttpResponse, RequestPrepareOptions, ServiceClient } from '@azure/ms-rest-js'; -import { createGenericClient, uiUtils } from '@microsoft/vscode-azext-azureutils'; +import { ServiceClient } from '@azure/core-client'; +import { RequestBodyType, createHttpHeaders, createPipelineRequest } from '@azure/core-rest-pipeline'; +import { AppSettingsClientProvider, IAppSettingsClient } from '@microsoft/vscode-azext-azureappsettings'; +import { AzExtPipelineResponse, createGenericClient, uiUtils } from '@microsoft/vscode-azext-azureutils'; import { IActionContext, ISubscriptionContext, nonNullProp, nonNullValue, parseError } from '@microsoft/vscode-azext-utils'; import { KuduModels } from 'vscode-azurekudu'; import { AppKind } from './createAppService/AppKind'; -import { AppSettingsClientProvider, IAppSettingsClient } from '@microsoft/vscode-azext-azureappsettings'; import { tryGetAppServicePlan, tryGetWebApp, tryGetWebAppSlot } from './tryGetSiteResource'; import { createWebSiteClient } from './utils/azureClients'; import { convertQueryParamsValuesToString } from './utils/kuduUtils'; + export class ParsedSite implements AppSettingsClientProvider { public readonly id: string; public readonly isSlot: boolean; @@ -310,44 +312,47 @@ export class SiteClient implements IAppSettingsClient { await this._client.webApps.listFunctionKeys(this._site.resourceGroup, this._site.siteName, functionName); } - public async zipPushDeploy(context: IActionContext, file: HttpRequestBody, queryParameters: KuduModels.PushDeploymentZipPushDeployOptionalParams): Promise { + public async zipPushDeploy(context: IActionContext, file: RequestBodyType, queryParameters: KuduModels.PushDeploymentZipPushDeployOptionalParams): Promise { const client: ServiceClient = await createGenericClient(context, this._site.subscription); - const options: RequestPrepareOptions = { + const queryOptions = convertQueryParamsValuesToString(queryParameters); + const queryString = Object.keys(queryOptions).map(key => key + '=' + queryOptions[key]).join('&'); + const request = createPipelineRequest({ method: 'POST', - url: `${this._site.kuduUrl}/api/zipdeploy`, + url: `${this._site.kuduUrl}/api/zipdeploy?${queryString}`, body: file, - bodyIsStream: true, - queryParameters: convertQueryParamsValuesToString(queryParameters) - }; + }); - return await client.sendRequest(options); + return await client.sendRequest(request); } - public async warPushDeploy(context: IActionContext, file: HttpRequestBody, queryParameters: KuduModels.PushDeploymentWarPushDeployOptionalParams): Promise { + public async warPushDeploy(context: IActionContext, file: RequestBodyType, queryParameters: KuduModels.PushDeploymentWarPushDeployOptionalParams): Promise { const client: ServiceClient = await createGenericClient(context, this._site.subscription); - return await client.sendRequest({ + const queryOptions = convertQueryParamsValuesToString(queryParameters); + const queryString = Object.keys(queryOptions).map(key => key + '=' + queryOptions[key]).join('&'); + const request = createPipelineRequest({ method: 'POST', - url: `${this._site.kuduUrl}/api/wardeploy`, + url: `${this._site.kuduUrl}/api/wardeploy?${queryString}`, body: file, - queryParameters: convertQueryParamsValuesToString(queryParameters) }); + + return await client.sendRequest(request); } - public async deploy(context: IActionContext, id: string): Promise { + public async deploy(context: IActionContext, id: string): Promise { const client: ServiceClient = await createGenericClient(context, this._site.subscription); - return await client.sendRequest({ + return await client.sendRequest(createPipelineRequest({ method: 'PUT', url: `${this._site.kuduUrl}/api/deployments/${id}` - }); + })); } // the ARM call doesn't give all of the metadata we require so ping the scm directly public async getDeployResults(context: IActionContext): Promise { const client: ServiceClient = await createGenericClient(context, this._site.subscription); - const response: HttpOperationResponse = await client.sendRequest({ + const response: AzExtPipelineResponse = await client.sendRequest(createPipelineRequest({ method: 'GET', url: `${this._site.kuduUrl}/api/deployments` - }); + })); const results = response.parsedBody as (KuduModels.DeployResult & { received_time: string })[]; // old kuduClient parsed recived_time: string as receivedTime: Date so we need to do the same @@ -361,20 +366,20 @@ export class SiteClient implements IAppSettingsClient { // the ARM call doesn't give all of the metadata we require so ping the scm directly public async getDeployResult(context: IActionContext, deployId: string): Promise { const client: ServiceClient = await createGenericClient(context, this._site.subscription); - const response: HttpOperationResponse = await client.sendRequest({ + const response: AzExtPipelineResponse = await client.sendRequest(createPipelineRequest({ method: 'GET', url: `${this._site.kuduUrl}/api/deployments/${deployId}` - }); + })); return response.parsedBody as KuduModels.DeployResult; } // no equivalent ARM call public async getLogEntry(context: IActionContext, deployId: string): Promise { const client: ServiceClient = await createGenericClient(context, this._site.subscription); - const response: HttpOperationResponse = await client.sendRequest({ + const response: AzExtPipelineResponse = await client.sendRequest(createPipelineRequest({ method: 'GET', url: `${this._site.kuduUrl}/api/deployments/${deployId}/log` - }); + })); const entries = response.parsedBody as (KuduModels.LogEntry & { log_time: string, details_url: string })[]; // old kuduClient parsed log_time: string as logTime: Date so we need to do the same @@ -389,10 +394,10 @@ export class SiteClient implements IAppSettingsClient { // no equivalent ARM call public async getLogEntryDetails(context: IActionContext, deployId: string, logId: string): Promise { const client: ServiceClient = await createGenericClient(context, this._site.subscription); - const response: HttpOperationResponse = await client.sendRequest({ + const response: AzExtPipelineResponse = await client.sendRequest(createPipelineRequest({ method: 'GET', url: `${this._site.kuduUrl}/api/deployments/${deployId}/log/${logId}` - }); + })); const entries = response.parsedBody as (KuduModels.LogEntry & { log_time: string, details_url: string })[]; return entries.map(e => { @@ -403,24 +408,25 @@ export class SiteClient implements IAppSettingsClient { }) as KuduModels.LogEntry[]; } - public async vfsGetItem(context: IActionContext, path: string): Promise { + public async vfsGetItem(context: IActionContext, path: string): Promise { const client: ServiceClient = await createGenericClient(context, this._site.subscription); - const response: HttpOperationResponse = await client.sendRequest({ + const response: AzExtPipelineResponse = await client.sendRequest(createPipelineRequest({ method: 'GET', url: `${this._site.kuduUrl}/api/vfs/${path}?api-version=2022-03-01`, - }); - return response as HttpResponse; + })); + return response as AzExtPipelineResponse; } - public async vfsPutItem(context: IActionContext, data: string | ArrayBuffer, path: string, headers?: {}): Promise { + public async vfsPutItem(context: IActionContext, data: string | ArrayBuffer, path: string, rawHeaders?: {}): Promise { const client: ServiceClient = await createGenericClient(context, this._site.subscription); - const response: HttpOperationResponse = await client.sendRequest({ + const headers = createHttpHeaders(rawHeaders); + const response: AzExtPipelineResponse = await client.sendRequest(createPipelineRequest({ method: 'PUT', url: `${this._site.kuduUrl}/api/vfs/${path}?api-version=2022-03-01`, body: typeof data === 'string' ? data : data.toString(), headers - }); - return response as HttpResponse; + })); + return response as AzExtPipelineResponse; } /** @@ -431,7 +437,7 @@ export class SiteClient implements IAppSettingsClient { private async getCachedSku(context: IActionContext): Promise { if (!this._cachedSku) { const client: ServiceClient = await createGenericClient(context, this._site.subscription); - const response: HttpOperationResponse = await client.sendRequest({ method: 'GET', url: `${this._site.id}?api-version=2016-08-01` }); + const response: AzExtPipelineResponse = await client.sendRequest(createPipelineRequest({ method: 'GET', url: `${this._site.id}?api-version=2016-08-01` })); this._cachedSku = (<{ properties: { sku?: string } }>response.parsedBody).properties.sku; } return this._cachedSku; diff --git a/appservice/src/TunnelProxy.ts b/appservice/src/TunnelProxy.ts index f6e9cf4f5c..e59da6884c 100644 --- a/appservice/src/TunnelProxy.ts +++ b/appservice/src/TunnelProxy.ts @@ -4,15 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import type { User } from '@azure/arm-appservice'; -import { BasicAuthenticationCredentials, HttpOperationResponse, RestError, ServiceClient } from '@azure/ms-rest-js'; -import { createGenericClient } from '@microsoft/vscode-azext-azureutils'; -import { IActionContext, IParsedError, nonNullProp, parseError, UserCancelledError } from '@microsoft/vscode-azext-utils'; -import { createServer, Server, Socket } from 'net'; +import { ServiceClient } from '@azure/core-client'; +import { RestError, createPipelineRequest } from "@azure/core-rest-pipeline"; +import { AzExtPipelineResponse, addBasicAuthenticationCredentialsToClient, createGenericClient } from '@microsoft/vscode-azext-azureutils'; +import { IActionContext, IParsedError, UserCancelledError, nonNullProp, parseError } from '@microsoft/vscode-azext-utils'; +import { Server, Socket, createServer } from 'net'; import { CancellationToken, Disposable } from 'vscode'; import * as ws from 'ws'; +import { ParsedSite } from './SiteClient'; import { ext } from './extensionVariables'; import { localize } from './localize'; -import { ParsedSite } from './SiteClient'; import { delay } from './utils/delay'; /** @@ -82,7 +83,7 @@ export class TunnelProxy { const client: ServiceClient = await createGenericClient(context, undefined); let statusCode: number | undefined; try { - const response: HttpOperationResponse = await client.sendRequest({ method: 'GET', url: this._site.defaultHostUrl }); + const response: AzExtPipelineResponse = await client.sendRequest(createPipelineRequest({ method: 'GET', url: this._site.defaultHostUrl })); statusCode = response.status; } catch (error) { if (error instanceof RestError) { @@ -97,14 +98,15 @@ export class TunnelProxy { private async checkTunnelStatus(context: IActionContext): Promise { const publishingUserName: string = nonNullProp(this._publishCredential, 'publishingUserName'); const password: string = nonNullProp(this._publishCredential, 'publishingPassword'); - const client: ServiceClient = await createGenericClient(context, new BasicAuthenticationCredentials(publishingUserName, password)); + const client: ServiceClient = await createGenericClient(context, undefined); + addBasicAuthenticationCredentialsToClient(client, publishingUserName, password); let tunnelStatus: ITunnelStatus; try { - const response: HttpOperationResponse = await client.sendRequest({ + const response: AzExtPipelineResponse = await client.sendRequest(createPipelineRequest({ method: 'GET', url: `https://${this._site.kuduHostName}/AppServiceTunnel/Tunnel.ashx?GetStatus&GetStatusAPIVer=2` - }); + })); ext.outputChannel.appendLog(`[Tunnel] Checking status, body: ${response.bodyAsText}`); tunnelStatus = response.parsedBody; } catch (error) { diff --git a/appservice/src/createAppService/SiteNameStep.ts b/appservice/src/createAppService/SiteNameStep.ts index 5643da3ea7..ebce48edc5 100644 --- a/appservice/src/createAppService/SiteNameStep.ts +++ b/appservice/src/createAppService/SiteNameStep.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import type { ResourceNameAvailability } from '@azure/arm-appservice'; -import { ServiceClient } from '@azure/ms-rest-js'; -import { ResourceGroupListStep, StorageAccountListStep, resourceGroupNamingRules, storageAccountNamingRules, createGenericClient } from '@microsoft/vscode-azext-azureutils'; +import { ServiceClient } from '@azure/core-client'; +import { ResourceGroupListStep, StorageAccountListStep, createGenericClient, resourceGroupNamingRules, storageAccountNamingRules } from '@microsoft/vscode-azext-azureutils'; import { AzureNameStep, IAzureNamingRules } from '@microsoft/vscode-azext-utils'; import { localize } from '../localize'; import { checkNameAvailability } from '../utils/azureUtils'; diff --git a/appservice/src/createAppService/getAppInsightsSupportedLocation.ts b/appservice/src/createAppService/getAppInsightsSupportedLocation.ts index 11cccf7263..188e7777bf 100644 --- a/appservice/src/createAppService/getAppInsightsSupportedLocation.ts +++ b/appservice/src/createAppService/getAppInsightsSupportedLocation.ts @@ -4,8 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import type { Provider, ProviderResourceType, ResourceManagementClient } from '@azure/arm-resources'; -import type { HttpOperationResponse, ServiceClient } from "@azure/ms-rest-js"; -import { AzExtLocation, createGenericClient } from "@microsoft/vscode-azext-azureutils"; +import { ServiceClient } from '@azure/core-client'; +import { createPipelineRequest } from '@azure/core-rest-pipeline'; +import { AzExtLocation, AzExtPipelineResponse, createGenericClient } from "@microsoft/vscode-azext-azureutils"; import { IActionContext, nonNullProp } from "@microsoft/vscode-azext-utils"; import { createResourceClient } from "../utils/azureClients"; import { areLocationNamesEqual } from "../utils/azureUtils"; @@ -36,10 +37,11 @@ export async function getAppInsightsSupportedLocation(context: IAppServiceWizard async function getPairedRegions(context: IActionContext, locationName: string): Promise { try { const client: ServiceClient = await createGenericClient(context, undefined); - const response: HttpOperationResponse = await client.sendRequest({ + const response: AzExtPipelineResponse = await client.sendRequest(createPipelineRequest({ method: 'GET', url: 'https://appinsights.azureedge.net/portal/regionMapping.json' - }); + })); + const regionMappingJson: RegionMappingJsonResponse = response.parsedBody; if (regionMappingJson.regions[locationName]) { diff --git a/appservice/src/createAppService/setLocationsTask.ts b/appservice/src/createAppService/setLocationsTask.ts index b383ebddb7..eff4729820 100644 --- a/appservice/src/createAppService/setLocationsTask.ts +++ b/appservice/src/createAppService/setLocationsTask.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import type { GeoRegion, ListGeoRegionsOptionalParams, SkuName } from '@azure/arm-appservice'; -import { HttpOperationResponse } from '@azure/ms-rest-js'; -import { createGenericClient, LocationListStep } from '@microsoft/vscode-azext-azureutils'; +import { createPipelineRequest } from '@azure/core-rest-pipeline'; +import { AzExtPipelineResponse, LocationListStep, createGenericClient } from '@microsoft/vscode-azext-azureutils'; import { nonNullProp } from '@microsoft/vscode-azext-utils'; import { webProvider } from '../constants'; import { AppKind, WebsiteOS } from './AppKind'; @@ -36,19 +36,13 @@ export async function getWebLocations(context: IAppServiceWizardContext): Promis options.sku = context.newPlanSku.tier.replace(/\s/g, ''); } + const queryString = Object.keys(options).map(key => key + '=' + options[key]).join('&'); // Temporary fix for https://github.com/Azure/azure-rest-api-specs/issues/18071 const genericClient = await createGenericClient(context, context); - const result: HttpOperationResponse = await genericClient.sendRequest({ + const result: AzExtPipelineResponse = await genericClient.sendRequest(createPipelineRequest({ method: 'GET', - pathTemplate: `/subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions`, - queryParameters: { - 'api-version': '2020-09-01', - ...options, - }, - pathParameters: { - subscriptionId: context.subscriptionId, - } - }); + url: `/subscriptions/${context.subscriptionId}/providers/Microsoft.Web/geoRegions?${queryString}` + })); return (result.parsedBody).value.map((l: GeoRegion) => nonNullProp(l, 'name')); } diff --git a/appservice/src/createSlot.ts b/appservice/src/createSlot.ts index af528fb78e..eed3bf8b45 100644 --- a/appservice/src/createSlot.ts +++ b/appservice/src/createSlot.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import type { CheckNameAvailabilityResponse, NameValuePair, Site, StringDictionary, WebSiteManagementClient } from "@azure/arm-appservice"; -import { ServiceClient } from "@azure/ms-rest-js"; +import { ServiceClient } from '@azure/core-client'; import { createGenericClient } from "@microsoft/vscode-azext-azureutils"; import { IActionContext, IAzureNamingRules, IAzureQuickPickItem, ICreateChildImplContext } from "@microsoft/vscode-azext-utils"; import { ProgressLocation, window } from "vscode"; +import { ParsedSite } from './SiteClient'; import { getNewFileShareName } from "./createAppService/getNewFileShareName"; import { ext } from "./extensionVariables"; import { localize } from "./localize"; -import { ParsedSite } from './SiteClient'; import { createWebSiteClient } from "./utils/azureClients"; import { checkNameAvailability } from "./utils/azureUtils"; diff --git a/appservice/src/deploy/runWithZipStream.ts b/appservice/src/deploy/runWithZipStream.ts index bb2ff437f9..d6cda37811 100644 --- a/appservice/src/deploy/runWithZipStream.ts +++ b/appservice/src/deploy/runWithZipStream.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { HttpOperationResponse } from '@azure/ms-rest-js'; +import { AzExtPipelineResponse } from '@microsoft/vscode-azext-azureutils'; import { IActionContext } from '@microsoft/vscode-azext-utils'; import * as fse from 'fs-extra'; import * as globby from 'globby'; @@ -21,8 +21,8 @@ export async function runWithZipStream(context: IActionContext, options: { fsPath: string, site: ParsedSite, pathFileMap?: Map - callback: (zipStream: Readable) => Promise -}): Promise { + callback: (zipStream: Readable) => Promise +}): Promise { function onFileSize(size: number): void { context.telemetry.measurements.zipFileSize = size; diff --git a/appservice/src/editScmType.ts b/appservice/src/editScmType.ts index 72dbd9c3b9..d14461a523 100644 --- a/appservice/src/editScmType.ts +++ b/appservice/src/editScmType.ts @@ -7,7 +7,7 @@ import type { SiteConfigResource, User } from '@azure/arm-appservice'; import { IActionContext, IAzureQuickPickItem, IAzureQuickPickOptions, ISubscriptionContext, nonNullProp, UserCancelledError } from '@microsoft/vscode-azext-utils'; import { window } from 'vscode'; import { ext } from './extensionVariables'; -import { connectToGitHub } from './github/connectToGitHub'; +// import { connectToGitHub } from './github/connectToGitHub'; import { localize } from './localize'; import { ScmType } from './ScmType'; import { ParsedSite } from './SiteClient'; @@ -26,7 +26,7 @@ export async function editScmType(context: IActionContext, site: ParsedSite, sub // GitHub cannot be configured if there is an existing configuration source-- a limitation of Azure await editScmType(context, site, subscriptionContext, ScmType.None, false); } - await connectToGitHub(site, Object.assign(context, subscriptionContext)); + // await connectToGitHub(site, Object.assign(context, subscriptionContext)); } else { config.scmType = newScmType; // to update one property, a complete config file must be sent diff --git a/appservice/src/github/GitHubBranchListStep.ts b/appservice/src/github/GitHubBranchListStep.ts index c8f5c90d08..e96b8475a4 100644 --- a/appservice/src/github/GitHubBranchListStep.ts +++ b/appservice/src/github/GitHubBranchListStep.ts @@ -1,37 +1,37 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ +// /*--------------------------------------------------------------------------------------------- +// * Copyright (c) Microsoft Corporation. All rights reserved. +// * Licensed under the MIT License. See License.txt in the project root for license information. +// *--------------------------------------------------------------------------------------------*/ -import { AzureWizardPromptStep, IAzureQuickPickItem, nonNullProp } from '@microsoft/vscode-azext-utils'; -import { localize } from '../localize'; -import { getGitHubQuickPicksWithLoadMore, gitHubBranchData, ICachedQuickPicks } from './connectToGitHub'; -import { IConnectToGitHubWizardContext } from './IConnectToGitHubWizardContext'; +// import { AzureWizardPromptStep, IAzureQuickPickItem, nonNullProp } from '@microsoft/vscode-azext-utils'; +// import { localize } from '../localize'; +// import { getGitHubQuickPicksWithLoadMore, gitHubBranchData, ICachedQuickPicks } from './connectToGitHub'; +// import { IConnectToGitHubWizardContext } from './IConnectToGitHubWizardContext'; -export class GitHubBranchListStep extends AzureWizardPromptStep { - public async prompt(context: IConnectToGitHubWizardContext): Promise { - const placeHolder: string = localize('chooseBranch', 'Choose branch'); - let branchData: gitHubBranchData | string; - const picksCache: ICachedQuickPicks = { picks: [] }; - let url: string = `${nonNullProp(context, 'repoData').url}/branches`; - // eslint-disable-next-line no-constant-condition - while (true) { - branchData = (await context.ui.showQuickPick(this.getBranchPicks(context, picksCache, url), { placeHolder })).data; - if (typeof branchData === 'string') { - url = branchData; - } else { - break; - } - } +// export class GitHubBranchListStep extends AzureWizardPromptStep { +// public async prompt(context: IConnectToGitHubWizardContext): Promise { +// const placeHolder: string = localize('chooseBranch', 'Choose branch'); +// let branchData: gitHubBranchData | string; +// const picksCache: ICachedQuickPicks = { picks: [] }; +// let url: string = `${nonNullProp(context, 'repoData').url}/branches`; +// // eslint-disable-next-line no-constant-condition +// while (true) { +// branchData = (await context.ui.showQuickPick(this.getBranchPicks(context, picksCache, url), { placeHolder })).data; +// if (typeof branchData === 'string') { +// url = branchData; +// } else { +// break; +// } +// } - context.branchData = branchData; - } +// context.branchData = branchData; +// } - public shouldPrompt(context: IConnectToGitHubWizardContext): boolean { - return !context.branchData; - } +// public shouldPrompt(context: IConnectToGitHubWizardContext): boolean { +// return !context.branchData; +// } - private async getBranchPicks(context: IConnectToGitHubWizardContext, picksCache: ICachedQuickPicks, url: string): Promise[]> { - return await getGitHubQuickPicksWithLoadMore(context, picksCache, url, 'name'); - } -} +// private async getBranchPicks(context: IConnectToGitHubWizardContext, picksCache: ICachedQuickPicks, url: string): Promise[]> { +// return await getGitHubQuickPicksWithLoadMore(context, picksCache, url, 'name'); +// } +// } diff --git a/appservice/src/github/GitHubOrgListStep.ts b/appservice/src/github/GitHubOrgListStep.ts index 1edba92b73..04c593f39d 100644 --- a/appservice/src/github/GitHubOrgListStep.ts +++ b/appservice/src/github/GitHubOrgListStep.ts @@ -1,30 +1,30 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ +// /*--------------------------------------------------------------------------------------------- +// * Copyright (c) Microsoft Corporation. All rights reserved. +// * Licensed under the MIT License. See License.txt in the project root for license information. +// *--------------------------------------------------------------------------------------------*/ -import { AzureWizardPromptStep, IAzureQuickPickItem } from '@microsoft/vscode-azext-utils'; -import { localize } from '../localize'; -import { createQuickPickFromJsons, getGitHubJsonResponse, gitHubOrgData } from './connectToGitHub'; -import { IConnectToGitHubWizardContext } from './IConnectToGitHubWizardContext'; +// import { AzureWizardPromptStep, IAzureQuickPickItem } from '@microsoft/vscode-azext-utils'; +// import { localize } from '../localize'; +// import { createQuickPickFromJsons, getGitHubJsonResponse, gitHubOrgData } from './connectToGitHub'; +// import { IConnectToGitHubWizardContext } from './IConnectToGitHubWizardContext'; -export class GitHubOrgListStep extends AzureWizardPromptStep { - public async prompt(context: IConnectToGitHubWizardContext): Promise { - const placeHolder: string = localize('chooseOrg', 'Choose organization.'); - context.orgData = (await context.ui.showQuickPick(this.getOrganizations(context), { placeHolder })).data; - } +// export class GitHubOrgListStep extends AzureWizardPromptStep { +// public async prompt(context: IConnectToGitHubWizardContext): Promise { +// const placeHolder: string = localize('chooseOrg', 'Choose organization.'); +// context.orgData = (await context.ui.showQuickPick(this.getOrganizations(context), { placeHolder })).data; +// } - public shouldPrompt(context: IConnectToGitHubWizardContext): boolean { - return !context.orgData; - } +// public shouldPrompt(context: IConnectToGitHubWizardContext): boolean { +// return !context.orgData; +// } - private async getOrganizations(context: IConnectToGitHubWizardContext): Promise[]> { - const [userData]: [gitHubOrgData[], string | undefined] = await getGitHubJsonResponse(context, 'https://api.github.com/user'); - let quickPickItems: IAzureQuickPickItem[] = createQuickPickFromJsons(userData, 'login'); +// private async getOrganizations(context: IConnectToGitHubWizardContext): Promise[]> { +// const [userData]: [gitHubOrgData[], string | undefined] = await getGitHubJsonResponse(context, 'https://api.github.com/user'); +// let quickPickItems: IAzureQuickPickItem[] = createQuickPickFromJsons(userData, 'login'); - const [orgData]: [gitHubOrgData[], string | undefined] = await getGitHubJsonResponse(context, 'https://api.github.com/user/orgs'); - quickPickItems = quickPickItems.concat(createQuickPickFromJsons(orgData, 'login')); +// const [orgData]: [gitHubOrgData[], string | undefined] = await getGitHubJsonResponse(context, 'https://api.github.com/user/orgs'); +// quickPickItems = quickPickItems.concat(createQuickPickFromJsons(orgData, 'login')); - return quickPickItems; - } -} +// return quickPickItems; +// } +// } diff --git a/appservice/src/github/GitHubRepoListStep.ts b/appservice/src/github/GitHubRepoListStep.ts index d286cb7988..1755b0b18a 100644 --- a/appservice/src/github/GitHubRepoListStep.ts +++ b/appservice/src/github/GitHubRepoListStep.ts @@ -1,38 +1,38 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ +// /*--------------------------------------------------------------------------------------------- +// * Copyright (c) Microsoft Corporation. All rights reserved. +// * Licensed under the MIT License. See License.txt in the project root for license information. +// *--------------------------------------------------------------------------------------------*/ -import { AzureWizardPromptStep, IAzureQuickPickItem, nonNullProp } from '@microsoft/vscode-azext-utils'; -import { localize } from '../localize'; -import { getGitHubQuickPicksWithLoadMore, gitHubRepoData, ICachedQuickPicks } from './connectToGitHub'; -import { IConnectToGitHubWizardContext } from './IConnectToGitHubWizardContext'; +// import { AzureWizardPromptStep, IAzureQuickPickItem, nonNullProp } from '@microsoft/vscode-azext-utils'; +// import { localize } from '../localize'; +// import { getGitHubQuickPicksWithLoadMore, gitHubRepoData, ICachedQuickPicks } from './connectToGitHub'; +// import { IConnectToGitHubWizardContext } from './IConnectToGitHubWizardContext'; -export class GitHubRepoListStep extends AzureWizardPromptStep { - public async prompt(context: IConnectToGitHubWizardContext): Promise { - const placeHolder: string = localize('chooseRepo', 'Choose repository'); - let repoData: gitHubRepoData | string; - const picksCache: ICachedQuickPicks = { picks: [] }; +// export class GitHubRepoListStep extends AzureWizardPromptStep { +// public async prompt(context: IConnectToGitHubWizardContext): Promise { +// const placeHolder: string = localize('chooseRepo', 'Choose repository'); +// let repoData: gitHubRepoData | string; +// const picksCache: ICachedQuickPicks = { picks: [] }; - let url: string = nonNullProp(context, 'orgData').repos_url; - // eslint-disable-next-line no-constant-condition - while (true) { - repoData = (await context.ui.showQuickPick(this.getRepositories(context, picksCache, url), { placeHolder })).data; - if (typeof repoData === 'string') { - url = repoData; - } else { - break; - } - } +// let url: string = nonNullProp(context, 'orgData').repos_url; +// // eslint-disable-next-line no-constant-condition +// while (true) { +// repoData = (await context.ui.showQuickPick(this.getRepositories(context, picksCache, url), { placeHolder })).data; +// if (typeof repoData === 'string') { +// url = repoData; +// } else { +// break; +// } +// } - context.repoData = repoData; - } +// context.repoData = repoData; +// } - public shouldPrompt(context: IConnectToGitHubWizardContext): boolean { - return !context.repoData; - } +// public shouldPrompt(context: IConnectToGitHubWizardContext): boolean { +// return !context.repoData; +// } - private async getRepositories(context: IConnectToGitHubWizardContext, picksCache: ICachedQuickPicks, url: string): Promise[]> { - return await getGitHubQuickPicksWithLoadMore(context, picksCache, url, 'name'); - } -} +// private async getRepositories(context: IConnectToGitHubWizardContext, picksCache: ICachedQuickPicks, url: string): Promise[]> { +// return await getGitHubQuickPicksWithLoadMore(context, picksCache, url, 'name'); +// } +// } diff --git a/appservice/src/github/IConnectToGitHubWizardContext.ts b/appservice/src/github/IConnectToGitHubWizardContext.ts index 017e9f570d..426e03180a 100644 --- a/appservice/src/github/IConnectToGitHubWizardContext.ts +++ b/appservice/src/github/IConnectToGitHubWizardContext.ts @@ -1,17 +1,17 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ +// /*--------------------------------------------------------------------------------------------- +// * Copyright (c) Microsoft Corporation. All rights reserved. +// * Licensed under the MIT License. See License.txt in the project root for license information. +// *--------------------------------------------------------------------------------------------*/ -import type { ServiceClient } from '@azure/ms-rest-js'; -import { IActionContext, ISubscriptionContext } from '@microsoft/vscode-azext-utils'; -import { ParsedSite } from '../SiteClient'; -import { gitHubBranchData, gitHubOrgData, gitHubRepoData } from './connectToGitHub'; +// import type { ServiceClient } from '@azure/core-client'; +// import type { IActionContext, ISubscriptionContext } from '@microsoft/vscode-azext-utils'; +// import { ParsedSite } from '../SiteClient'; +// import { gitHubBranchData, gitHubOrgData, gitHubRepoData } from './connectToGitHub'; -export interface IConnectToGitHubWizardContext extends IActionContext, ISubscriptionContext { - orgData?: gitHubOrgData; - repoData?: gitHubRepoData; - branchData?: gitHubBranchData; - site?: ParsedSite; - gitHubClient?: ServiceClient; -} +// export interface IConnectToGitHubWizardContext extends IActionContext, ISubscriptionContext { +// orgData?: gitHubOrgData; +// repoData?: gitHubRepoData; +// branchData?: gitHubBranchData; +// site?: ParsedSite; +// gitHubClient?: ServiceClient; +// } diff --git a/appservice/src/github/connectToGitHub.ts b/appservice/src/github/connectToGitHub.ts index e9cf9abfab..78981c518d 100644 --- a/appservice/src/github/connectToGitHub.ts +++ b/appservice/src/github/connectToGitHub.ts @@ -1,200 +1,205 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import type { SiteSourceControl } from '@azure/arm-appservice'; -import { HttpOperationResponse, ServiceClient, TokenCredentials } from '@azure/ms-rest-js'; -import { createGenericClient, openInPortal } from '@microsoft/vscode-azext-azureutils'; -import { AzureWizard, DialogResponses, IAzureQuickPickItem, IParsedError, nonNullProp, parseError } from '@microsoft/vscode-azext-utils'; -import { isArray } from 'util'; -import * as vscode from 'vscode'; -import { ext } from '../extensionVariables'; -import { localize } from '../localize'; -import { ParsedSite } from '../SiteClient'; -import { openUrl } from '../utils/openUrl'; -import { verifyNoRunFromPackageSetting } from '../verifyNoRunFromPackageSetting'; -import { GitHubBranchListStep } from './GitHubBranchListStep'; -import { GitHubOrgListStep } from './GitHubOrgListStep'; -import { GitHubRepoListStep } from './GitHubRepoListStep'; -import { IConnectToGitHubWizardContext } from './IConnectToGitHubWizardContext'; - -export type gitHubOrgData = { login: string, repos_url: string }; -export type gitHubRepoData = { name: string, repos_url: string, url: string, html_url: string }; -export type gitHubBranchData = { name: string }; -export type gitHubLink = { prev?: string, next?: string, last?: string, first?: string }; - -export async function connectToGitHub(site: ParsedSite, context: IConnectToGitHubWizardContext): Promise { - const title: string = localize('connectGitHubRepo', 'Connect GitHub repository'); - context.site = site; - - const wizard: AzureWizard = new AzureWizard(context, { - title, - promptSteps: [ - new GitHubOrgListStep(), - new GitHubRepoListStep(), - new GitHubBranchListStep() - ] - }); - - await wizard.prompt(); - - const siteSourceControl: SiteSourceControl = { - repoUrl: nonNullProp(context, 'repoData').html_url, - branch: nonNullProp(context, 'branchData').name, - isManualIntegration: false, - deploymentRollbackEnabled: true, - isMercurial: false - }; - - const repoName: string = `${nonNullProp(context, 'orgData').login}/${nonNullProp(context, 'repoData').name}`; - - const client = await site.createClient(context); - try { - const connectingToGithub: string = localize('ConnectingToGithub', '"{0}" is being connected to repo "{1}". This may take several minutes...', site.fullName, repoName); - const connectedToGithub: string = localize('ConnectedToGithub', 'Repo "{0}" is connected and deployed to "{1}".', repoName, site.fullName); - await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: connectingToGithub }, async (): Promise => { - ext.outputChannel.appendLog(connectingToGithub); - await verifyNoRunFromPackageSetting(context, site); - await client.updateSourceControl(siteSourceControl); - void vscode.window.showInformationMessage(connectedToGithub); - ext.outputChannel.appendLog(connectedToGithub); - }); - } catch (err) { - try { - // a resync will fix the first broken build - // https://github.com/projectkudu/kudu/issues/2277 - await client.syncRepository(); - } catch (error) { - const parsedError: IParsedError = parseError(error); - // The portal returns 200, but is expecting a 204 which causes it to throw an error even after a successful sync - if (parsedError.message.indexOf('"statusCode":200') === -1) { - throw error; - } - } - } -} - -async function showGitHubAuthPrompt(context: IConnectToGitHubWizardContext, site: ParsedSite): Promise { - const invalidToken: string = localize('tokenExpired', 'Azure\'s GitHub token is invalid. Authorize in the "Deployment Center"'); - const goToPortal: vscode.MessageItem = { title: localize('goToPortal', 'Go to Portal') }; - let input: vscode.MessageItem | undefined = DialogResponses.learnMore; - while (input === DialogResponses.learnMore) { - input = await vscode.window.showErrorMessage(invalidToken, { modal: true }, goToPortal, DialogResponses.learnMore); - if (input === DialogResponses.learnMore) { - - context.telemetry.properties.githubLearnMore = 'true'; - - await openUrl('https://aka.ms/B7g6sw'); - } - } - - if (input === goToPortal) { - context.telemetry.properties.githubGoToPortal = 'true'; - await openInPortal(context, `${site.id}/vstscd`); - } -} - -export async function getGitHubJsonResponse(context: IConnectToGitHubWizardContext, url: string): Promise<[T, string | undefined]> { - context.gitHubClient = context.gitHubClient || await createGitHubClient(context); - - // Reference for GitHub REST routes - // https://developer.github.com/v3/ - // Note: blank after user implies look up authorized user - try { - const response: HttpOperationResponse = await context.gitHubClient.sendRequest({ method: 'GET', url }); - const headerLink: string | undefined = response.headers.get('link'); - const nextLink: string | undefined = headerLink && parseLinkHeaderToGitHubLinkObject(headerLink).next; - return [response.parsedBody, nextLink]; - } catch (error) { - const parsedError: IParsedError = parseError(error); - if (parsedError.message.indexOf('Bad credentials') > -1) { - // the default error is just "Bad credentials," which is an unhelpful error message - await showGitHubAuthPrompt(context, nonNullProp(context, 'site')); - context.errorHandling.suppressDisplay = true; - } - throw error; - } -} - -/** - * @param label Property of JSON that will be used as the QuickPicks label - * @param description Optional property of JSON that will be used as QuickPicks description - * @param data Optional property of JSON that will be used as QuickPicks data saved as a NameValue pair - */ -export function createQuickPickFromJsons(jsons: T[], label: string): IAzureQuickPickItem[] { - const quickPicks: IAzureQuickPickItem[] = []; - if (!isArray(jsons)) { - jsons = [jsons]; - } - - for (const json of jsons) { - if (!json[label]) { - // skip this JSON if it doesn't have this label - continue; - } - - quickPicks.push({ - label: json[label], - data: json - }); - } - - return quickPicks; -} - -function parseLinkHeaderToGitHubLinkObject(linkHeader: string): gitHubLink { - const linkUrls: string[] = linkHeader.split(', '); - const linkMap: gitHubLink = {}; - - // link header response is "; rel="prev", ; rel="next"" - const relative: string = 'rel='; - for (const url of linkUrls) { - linkMap[url.substring(url.indexOf(relative) + relative.length + 1, url.length - 1)] = url.substring(url.indexOf('<') + 1, url.indexOf('>')); - } - return linkMap; -} - -export interface ICachedQuickPicks { - picks: IAzureQuickPickItem[]; -} - -export async function getGitHubQuickPicksWithLoadMore(context: IConnectToGitHubWizardContext, cache: ICachedQuickPicks, originalUrl: string, labelName: string, timeoutSeconds: number = 10): Promise[]> { - const timeoutMs: number = timeoutSeconds * 1000; - const startTime: number = Date.now(); - let gitHubQuickPicks: T[] = []; - let url: string | undefined = originalUrl; - do { - const [result, nextLink]: [T[], string | undefined] = await getGitHubJsonResponse(context, url); - gitHubQuickPicks = gitHubQuickPicks.concat(result); - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - url = nextLink; - } while (url && startTime + timeoutMs > Date.now()); - - cache.picks = cache.picks.concat(createQuickPickFromJsons(gitHubQuickPicks, labelName)); - cache.picks.sort((a: vscode.QuickPickItem, b: vscode.QuickPickItem) => a.label.localeCompare(b.label)); - - if (url) { - return ([]>[{ - label: '$(sync) Load More', - suppressPersistence: true, - data: url - }]).concat(cache.picks); - } else { - return cache.picks; - } -} - -export async function createGitHubClient(context: IConnectToGitHubWizardContext): Promise { - const site = nonNullProp(context, 'site'); - const client = await site.createClient(context); - const oAuth2Token: string | undefined = (await client.listSourceControls())[0].token; - if (!oAuth2Token) { - await showGitHubAuthPrompt(context, site); - context.errorHandling.suppressDisplay = true; - const noToken: string = localize('noToken', 'No oAuth2 Token.'); - throw new Error(noToken); - } - - return createGenericClient(context, new TokenCredentials(oAuth2Token)); -} +// /*--------------------------------------------------------------------------------------------- +// * Copyright (c) Microsoft Corporation. All rights reserved. +// * Licensed under the MIT License. See License.txt in the project root for license information. +// *--------------------------------------------------------------------------------------------*/ + +// import type { SiteSourceControl } from '@azure/arm-appservice'; +// import { AccessToken, GetTokenOptions, TokenCredential } from '@azure/core-auth'; +// import { ServiceClient } from '@azure/core-client'; +// import { AzExtPipelineResponse, createGenericClient, openInPortal } from '@microsoft/vscode-azext-azureutils'; +// import { AzureWizard, DialogResponses, IAzureQuickPickItem, IParsedError, nonNullProp, parseError } from '@microsoft/vscode-azext-utils'; +// import { isArray } from 'util'; +// import * as vscode from 'vscode'; +// import { ParsedSite } from '../SiteClient'; +// import { ext } from '../extensionVariables'; +// import { localize } from '../localize'; +// import { openUrl } from '../utils/openUrl'; +// import { verifyNoRunFromPackageSetting } from '../verifyNoRunFromPackageSetting'; +// import { GitHubBranchListStep } from './GitHubBranchListStep'; +// import { GitHubOrgListStep } from './GitHubOrgListStep'; +// import { GitHubRepoListStep } from './GitHubRepoListStep'; +// import { IConnectToGitHubWizardContext } from './IConnectToGitHubWizardContext'; + +// export type gitHubOrgData = { login: string, repos_url: string }; +// export type gitHubRepoData = { name: string, repos_url: string, url: string, html_url: string }; +// export type gitHubBranchData = { name: string }; +// export type gitHubLink = { prev?: string, next?: string, last?: string, first?: string }; + +// export async function connectToGitHub(site: ParsedSite, context: IConnectToGitHubWizardContext): Promise { +// const title: string = localize('connectGitHubRepo', 'Connect GitHub repository'); +// context.site = site; + +// const wizard: AzureWizard = new AzureWizard(context, { +// title, +// promptSteps: [ +// new GitHubOrgListStep(), +// new GitHubRepoListStep(), +// new GitHubBranchListStep() +// ] +// }); + +// await wizard.prompt(); + +// const siteSourceControl: SiteSourceControl = { +// repoUrl: nonNullProp(context, 'repoData').html_url, +// branch: nonNullProp(context, 'branchData').name, +// isManualIntegration: false, +// deploymentRollbackEnabled: true, +// isMercurial: false +// }; + +// const repoName: string = `${nonNullProp(context, 'orgData').login}/${nonNullProp(context, 'repoData').name}`; + +// const client = await site.createClient(context); +// try { +// const connectingToGithub: string = localize('ConnectingToGithub', '"{0}" is being connected to repo "{1}". This may take several minutes...', site.fullName, repoName); +// const connectedToGithub: string = localize('ConnectedToGithub', 'Repo "{0}" is connected and deployed to "{1}".', repoName, site.fullName); +// await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: connectingToGithub }, async (): Promise => { +// ext.outputChannel.appendLog(connectingToGithub); +// await verifyNoRunFromPackageSetting(context, site); +// await client.updateSourceControl(siteSourceControl); +// void vscode.window.showInformationMessage(connectedToGithub); +// ext.outputChannel.appendLog(connectedToGithub); +// }); +// } catch (err) { +// try { +// // a resync will fix the first broken build +// // https://github.com/projectkudu/kudu/issues/2277 +// await client.syncRepository(); +// } catch (error) { +// const parsedError: IParsedError = parseError(error); +// // The portal returns 200, but is expecting a 204 which causes it to throw an error even after a successful sync +// if (parsedError.message.indexOf('"statusCode":200') === -1) { +// throw error; +// } +// } +// } +// } + +// async function showGitHubAuthPrompt(context: IConnectToGitHubWizardContext, site: ParsedSite): Promise { +// const invalidToken: string = localize('tokenExpired', 'Azure\'s GitHub token is invalid. Authorize in the "Deployment Center"'); +// const goToPortal: vscode.MessageItem = { title: localize('goToPortal', 'Go to Portal') }; +// let input: vscode.MessageItem | undefined = DialogResponses.learnMore; +// while (input === DialogResponses.learnMore) { +// input = await vscode.window.showErrorMessage(invalidToken, { modal: true }, goToPortal, DialogResponses.learnMore); +// if (input === DialogResponses.learnMore) { + +// context.telemetry.properties.githubLearnMore = 'true'; + +// await openUrl('https://aka.ms/B7g6sw'); +// } +// } + +// if (input === goToPortal) { +// context.telemetry.properties.githubGoToPortal = 'true'; +// await openInPortal(context, `${site.id}/vstscd`); +// } +// } + +// export async function getGitHubJsonResponse(context: IConnectToGitHubWizardContext, url: string): Promise<[T, string | undefined]> { +// context.gitHubClient = context.gitHubClient || await createGitHubClient(context); + +// // Reference for GitHub REST routes +// // https://developer.github.com/v3/ +// // Note: blank after user implies look up authorized user +// try { +// const response: AzExtPipelineResponse = await context.gitHubClient.sendRequest({ method: 'GET', url }); +// const headerLink: string | undefined = response.headers.get('link'); +// const nextLink: string | undefined = headerLink && parseLinkHeaderToGitHubLinkObject(headerLink).next; +// return [response.parsedBody, nextLink]; +// } catch (error) { +// const parsedError: IParsedError = parseError(error); +// if (parsedError.message.indexOf('Bad credentials') > -1) { +// // the default error is just "Bad credentials," which is an unhelpful error message +// await showGitHubAuthPrompt(context, nonNullProp(context, 'site')); +// context.errorHandling.suppressDisplay = true; +// } +// throw error; +// } +// } + +// /** +// * @param label Property of JSON that will be used as the QuickPicks label +// * @param description Optional property of JSON that will be used as QuickPicks description +// * @param data Optional property of JSON that will be used as QuickPicks data saved as a NameValue pair +// */ +// export function createQuickPickFromJsons(jsons: T[], label: string): IAzureQuickPickItem[] { +// const quickPicks: IAzureQuickPickItem[] = []; +// if (!isArray(jsons)) { +// jsons = [jsons]; +// } + +// for (const json of jsons) { +// if (!json[label]) { +// // skip this JSON if it doesn't have this label +// continue; +// } + +// quickPicks.push({ +// label: json[label], +// data: json +// }); +// } + +// return quickPicks; +// } + +// function parseLinkHeaderToGitHubLinkObject(linkHeader: string): gitHubLink { +// const linkUrls: string[] = linkHeader.split(', '); +// const linkMap: gitHubLink = {}; + +// // link header response is "; rel="prev", ; rel="next"" +// const relative: string = 'rel='; +// for (const url of linkUrls) { +// linkMap[url.substring(url.indexOf(relative) + relative.length + 1, url.length - 1)] = url.substring(url.indexOf('<') + 1, url.indexOf('>')); +// } +// return linkMap; +// } + +// export interface ICachedQuickPicks { +// picks: IAzureQuickPickItem[]; +// } + +// export async function getGitHubQuickPicksWithLoadMore(context: IConnectToGitHubWizardContext, cache: ICachedQuickPicks, originalUrl: string, labelName: string, timeoutSeconds: number = 10): Promise[]> { +// const timeoutMs: number = timeoutSeconds * 1000; +// const startTime: number = Date.now(); +// let gitHubQuickPicks: T[] = []; +// let url: string | undefined = originalUrl; +// do { +// const [result, nextLink]: [T[], string | undefined] = await getGitHubJsonResponse(context, url); +// gitHubQuickPicks = gitHubQuickPicks.concat(result); +// // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment +// url = nextLink; +// } while (url && startTime + timeoutMs > Date.now()); + +// cache.picks = cache.picks.concat(createQuickPickFromJsons(gitHubQuickPicks, labelName)); +// cache.picks.sort((a: vscode.QuickPickItem, b: vscode.QuickPickItem) => a.label.localeCompare(b.label)); + +// if (url) { +// return ([]>[{ +// label: '$(sync) Load More', +// suppressPersistence: true, +// data: url +// }]).concat(cache.picks); +// } else { +// return cache.picks; +// } +// } + +// export async function createGitHubClient(context: IConnectToGitHubWizardContext): Promise { +// const site = nonNullProp(context, 'site'); +// const client = await site.createClient(context); +// const oAuth2Token: string | undefined = (await client.listSourceControls())[0].token; +// const +// if (!oAuth2Token) { +// await showGitHubAuthPrompt(context, site); +// context.errorHandling.suppressDisplay = true; +// const noToken: string = localize('noToken', 'No oAuth2 Token.'); +// throw new Error(noToken); +// } + +// return createGenericClient(context, { credentials: new GitHubCredential(oAuth2Token), environment: { baseUrl: 'https://api.github.com' } }); +// } + + +// } diff --git a/appservice/src/index.ts b/appservice/src/index.ts index ebdb6f21f6..5866598d6d 100644 --- a/appservice/src/index.ts +++ b/appservice/src/index.ts @@ -32,7 +32,7 @@ export * from './deploy/showDeployConfirmation'; export { disconnectRepo } from './disconnectRepo'; export * from './editScmType'; export { registerAppServiceExtensionVariables } from './extensionVariables'; -export { IConnectToGitHubWizardContext } from './github/IConnectToGitHubWizardContext'; +// export { IConnectToGitHubWizardContext } from './github/IConnectToGitHubWizardContext'; export * from './pingFunctionApp'; export * from './registerSiteCommand'; export * from './remoteDebug/remoteDebugCommon'; diff --git a/appservice/src/pingFunctionApp.ts b/appservice/src/pingFunctionApp.ts index 28a6f796a7..a24f6b37ae 100644 --- a/appservice/src/pingFunctionApp.ts +++ b/appservice/src/pingFunctionApp.ts @@ -3,7 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import type { ServiceClient } from '@azure/ms-rest-js'; +import { ServiceClient } from '@azure/core-client'; +import { createHttpHeaders, createPipelineRequest } from '@azure/core-rest-pipeline'; import { createGenericClient } from '@microsoft/vscode-azext-azureutils'; import { IActionContext } from '@microsoft/vscode-azext-utils'; import { ParsedSite } from './SiteClient'; @@ -11,11 +12,13 @@ import { ParsedSite } from './SiteClient'; export async function pingFunctionApp(context: IActionContext, site: ParsedSite): Promise { const client = await site.createClient(context); const genericClient: ServiceClient = await createGenericClient(context, undefined); - await genericClient.sendRequest({ + const headers = createHttpHeaders({ + 'x-functions-key': (await client.listHostKeys()).masterKey || '' + }); + + await genericClient.sendRequest(createPipelineRequest({ method: 'GET', url: `${site.defaultHostUrl}/admin/host/status`, - headers: { - 'x-functions-key': (await client.listHostKeys()).masterKey - } - }); + headers + })); } diff --git a/appservice/src/siteFiles.ts b/appservice/src/siteFiles.ts index 76bde69b65..74f0fd1154 100644 --- a/appservice/src/siteFiles.ts +++ b/appservice/src/siteFiles.ts @@ -3,8 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { HttpOperationResponse, RestError, ServiceClient } from '@azure/ms-rest-js'; -import { createGenericClient } from '@microsoft/vscode-azext-azureutils'; +import { ServiceClient } from '@azure/core-client'; +import { RestError, createPipelineRequest } from '@azure/core-rest-pipeline'; +import { AzExtPipelineResponse, createGenericClient } from '@microsoft/vscode-azext-azureutils'; import { IActionContext, IParsedError, parseError } from '@microsoft/vscode-azext-utils'; import * as retry from 'p-retry'; import * as path from 'path'; @@ -22,7 +23,7 @@ export interface ISiteFileMetadata { } export async function getFile(context: IActionContext, site: ParsedSite, filePath: string): Promise { - let response: HttpOperationResponse; + let response: AzExtPipelineResponse; try { response = await getFsResponse(context, site, filePath); } catch (error) { @@ -37,7 +38,7 @@ export async function getFile(context: IActionContext, site: ParsedSite, filePat } export async function listFiles(context: IActionContext, site: ParsedSite, filePath: string): Promise { - const response: HttpOperationResponse = await getFsResponse(context, site, filePath); + const response: AzExtPipelineResponse = await getFsResponse(context, site, filePath); // eslint-disable-next-line @typescript-eslint/no-unsafe-return return Array.isArray(response.parsedBody) ? response.parsedBody : []; } @@ -49,14 +50,14 @@ export async function listFiles(context: IActionContext, site: ParsedSite, fileP export async function putFile(context: IActionContext, site: ParsedSite, data: string | ArrayBuffer, filePath: string, etag: string | undefined): Promise { const options: {} = etag ? { ['If-Match']: etag } : {}; const kuduClient = await site.createClient(context); - const result: HttpOperationResponse = (await kuduClient.vfsPutItem(context, data, filePath, options)); + const result: AzExtPipelineResponse = (await kuduClient.vfsPutItem(context, data, filePath, options)); return result.headers.get('etag'); } /** * Kudu APIs don't work for Linux consumption function apps and ARM APIs don't seem to work for web apps. We'll just have to use both */ -async function getFsResponse(context: IActionContext, site: ParsedSite, filePath: string): Promise { +async function getFsResponse(context: IActionContext, site: ParsedSite, filePath: string): Promise { try { if (site.isFunctionApp) { const linuxHome: string = '/home'; @@ -74,13 +75,13 @@ async function getFsResponse(context: IActionContext, site: ParsedSite, filePath const serviceUnavailable: RegExp = /ServiceUnavailable/i; const client: ServiceClient = await createGenericClient(context, site.subscription); - return await retry( + return await retry( async () => { try { - return await client.sendRequest({ + return await client.sendRequest(createPipelineRequest({ method: 'GET', url: `${site.id}/hostruntime/admin/vfs/${filePath}/?api-version=2022-03-01` - }); + })); } catch (error) { const parsedError: IParsedError = parseError(error); if (!(badGateway.test(parsedError.message) || serviceUnavailable.test(parsedError.message))) { diff --git a/appservice/src/startStreamingLogs.ts b/appservice/src/startStreamingLogs.ts index f5dbb1cd7b..799468cdf4 100644 --- a/appservice/src/startStreamingLogs.ts +++ b/appservice/src/startStreamingLogs.ts @@ -5,15 +5,16 @@ import { AbortController } from '@azure/abort-controller'; import type { User } from '@azure/arm-appservice'; -import { BasicAuthenticationCredentials, HttpOperationResponse, ServiceClient } from '@azure/ms-rest-js'; -import { createGenericClient } from '@microsoft/vscode-azext-azureutils'; -import { callWithTelemetryAndErrorHandling, IActionContext, nonNullProp, parseError } from '@microsoft/vscode-azext-utils'; +import { ServiceClient } from '@azure/core-client'; +import { createPipelineRequest } from "@azure/core-rest-pipeline"; +import { AzExtPipelineResponse, addBasicAuthenticationCredentialsToClient, createGenericClient } from '@microsoft/vscode-azext-azureutils'; +import { IActionContext, callWithTelemetryAndErrorHandling, nonNullProp, parseError } from '@microsoft/vscode-azext-utils'; import { setInterval } from 'timers'; import * as vscode from 'vscode'; +import { ParsedSite } from './SiteClient'; import { ext } from './extensionVariables'; import { localize } from './localize'; import { pingFunctionApp } from './pingFunctionApp'; -import { ParsedSite } from './SiteClient'; export interface ILogStream extends vscode.Disposable { isConnected: boolean; @@ -57,15 +58,16 @@ export async function startStreamingLogs(context: IActionContext, site: ParsedSi timerId = setInterval(async () => await pingFunctionApp(streamContext, site), 60 * 1000); } - const genericClient: ServiceClient = await createGenericClient(streamContext, new BasicAuthenticationCredentials(nonNullProp(creds, 'publishingUserName'), nonNullProp(creds, 'publishingPassword'))); + const genericClient: ServiceClient = await createGenericClient(streamContext, undefined); + + addBasicAuthenticationCredentialsToClient(genericClient, nonNullProp(creds, 'publishingUserName'), nonNullProp(creds, 'publishingPassword')); const abortController: AbortController = new AbortController(); - const logsResponse: HttpOperationResponse = await genericClient.sendRequest({ + const logsResponse: AzExtPipelineResponse = await genericClient.sendRequest(createPipelineRequest({ method: 'GET', url: `${site.kuduUrl}/api/logstream/${logsPath}`, - streamResponseBody: true, abortSignal: abortController.signal - }); + })); await new Promise((onLogStreamEnded: () => void, reject: (err: Error) => void): void => { const newLogStream: ILogStream = { diff --git a/appservice/src/utils/azureClients.ts b/appservice/src/utils/azureClients.ts index ffd201be50..9a87d6d659 100644 --- a/appservice/src/utils/azureClients.ts +++ b/appservice/src/utils/azureClients.ts @@ -8,7 +8,7 @@ import type { WebSiteManagementClient } from '@azure/arm-appservice'; import type { OperationalInsightsManagementClient } from '@azure/arm-operationalinsights'; import type { ResourceGraphClient } from '@azure/arm-resourcegraph'; import type { ResourceManagementClient } from '@azure/arm-resources'; -import { AzExtClientContext, createAzureClient, createAzureSubscriptionClient } from '@microsoft/vscode-azext-azureutils'; +import { AzExtClientContext, AzExtSubscriptionClientType, createAzureClient, createAzureSubscriptionClient } from '@microsoft/vscode-azext-azureutils'; // Lazy-load @azure packages to improve startup performance. // NOTE: The client is the only import that matters, the rest of the types disappear when compiled to JavaScript @@ -26,7 +26,8 @@ export async function createResourceClient(context: AzExtClientContext): Promise } export async function createResourceGraphClient(context: AzExtClientContext): Promise { - return createAzureSubscriptionClient(context, (await import('@azure/arm-resourcegraph')).ResourceGraphClient); + const client = (await import('@azure/arm-resourcegraph')).ResourceGraphClient as AzExtSubscriptionClientType; + return createAzureSubscriptionClient(context, client); } export async function createOperationalInsightsManagementClient(context: AzExtClientContext): Promise { diff --git a/appservice/src/utils/azureUtils.ts b/appservice/src/utils/azureUtils.ts index 157a7e8bb8..e35210b1eb 100644 --- a/appservice/src/utils/azureUtils.ts +++ b/appservice/src/utils/azureUtils.ts @@ -5,7 +5,9 @@ *--------------------------------------------------------------------------------------------*/ import { CheckNameAvailabilityResponse } from "@azure/arm-appservice"; -import { HttpOperationResponse, ServiceClient } from "@azure/ms-rest-js"; +import { ServiceClient } from '@azure/core-client'; +import { createPipelineRequest } from "@azure/core-rest-pipeline"; +import { AzExtPipelineResponse } from "@microsoft/vscode-azext-azureutils"; export function areLocationNamesEqual(name1: string | undefined, name2: string | undefined): boolean { return normalizeLocationName(name1) === normalizeLocationName(name2); @@ -16,20 +18,14 @@ function normalizeLocationName(name: string | undefined): string { } // temporary workaround for https://github.com/Azure/azure-sdk-for-js/issues/20728 -export async function checkNameAvailability(client: ServiceClient, subscriptionId: string, name: string, type: 'Site' | 'Slot' ): Promise { - const result: HttpOperationResponse = await client.sendRequest({ +export async function checkNameAvailability(client: ServiceClient, subscriptionId: string, name: string, type: 'Site' | 'Slot'): Promise { + const result: AzExtPipelineResponse = await client.sendRequest(createPipelineRequest({ method: 'POST', - pathTemplate: `/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability`, - queryParameters: { - 'api-version': '2021-02-01', - }, - pathParameters: { - subscriptionId - }, + url: `/subscriptions/${subscriptionId}/providers/Microsoft.Web/checknameavailability?api-version=2021-02-01`, body: { name, type } - }); + })); return result.parsedBody; } From 2a11a61e2ab1ac3a775610042de99ab598550e9e Mon Sep 17 00:00:00 2001 From: Nathan Turinski Date: Tue, 18 Jul 2023 16:45:10 -0700 Subject: [PATCH 3/9] Add appendFile to declarations and bump --- utils/index.d.ts | 1 + utils/package-lock.json | 4 ++-- utils/package.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/utils/index.d.ts b/utils/index.d.ts index 66fda1f148..c20c6b90d0 100644 --- a/utils/index.d.ts +++ b/utils/index.d.ts @@ -1564,6 +1564,7 @@ export declare namespace AzExtFsExtra { export function ensureFile(resource: Uri | string): Promise; export function readFile(resource: Uri | string): Promise; export function writeFile(resource: Uri | string, contents: string): Promise; + export function appendFile(resource: Uri | string, contents: string): Promise; export function pathExists(resource: Uri | string): Promise; export function readJSON(resource: Uri | string): Promise /** diff --git a/utils/package-lock.json b/utils/package-lock.json index 0eb3af6be8..29f8062936 100644 --- a/utils/package-lock.json +++ b/utils/package-lock.json @@ -1,12 +1,12 @@ { "name": "@microsoft/vscode-azext-utils", - "version": "2.0.1", + "version": "2.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@microsoft/vscode-azext-utils", - "version": "2.0.1", + "version": "2.0.2", "license": "MIT", "dependencies": { "@microsoft/vscode-azureresources-api": "^2.0.4", diff --git a/utils/package.json b/utils/package.json index 95402063dd..f5efea7f2c 100644 --- a/utils/package.json +++ b/utils/package.json @@ -1,7 +1,7 @@ { "name": "@microsoft/vscode-azext-utils", "author": "Microsoft Corporation", - "version": "2.0.1", + "version": "2.0.2", "description": "Common UI tools for developing Azure extensions for VS Code", "tags": [ "azure", From 84f8a660bc2ec358f125940ef8046a224d89d3a5 Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 18 Jul 2023 16:47:30 -0700 Subject: [PATCH 4/9] Update package-lock.json --- appservice/package-lock.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/appservice/package-lock.json b/appservice/package-lock.json index 28f082f2eb..5c8ee3a707 100644 --- a/appservice/package-lock.json +++ b/appservice/package-lock.json @@ -645,14 +645,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/@microsoft/vscode-azext-azureutils/node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "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", From d25f1617c0b8400310c96cb51113ba88df488764 Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 20 Jul 2023 15:30:31 -0700 Subject: [PATCH 5/9] Add a seperator option for appendFile --- utils/index.d.ts | 6 ++++-- utils/src/utils/AzExtFsExtra.ts | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/utils/index.d.ts b/utils/index.d.ts index c20c6b90d0..5f994d2c1c 100644 --- a/utils/index.d.ts +++ b/utils/index.d.ts @@ -1563,8 +1563,10 @@ export declare namespace AzExtFsExtra { export function ensureDir(resource: Uri | string): Promise; export function ensureFile(resource: Uri | string): Promise; export function readFile(resource: Uri | string): Promise; - export function writeFile(resource: Uri | string, contents: string): Promise; - export function appendFile(resource: Uri | string, contents: string): Promise; + /** + * @param seperator By default, will append "\r\n\r\n" between existing content and new content to be appended + */ + export function appendFile(resource: Uri | string, contents: string, seperator: string = '\r\n\r\n'): Promise; export function pathExists(resource: Uri | string): Promise; export function readJSON(resource: Uri | string): Promise /** diff --git a/utils/src/utils/AzExtFsExtra.ts b/utils/src/utils/AzExtFsExtra.ts index 7be662625d..d298313f84 100644 --- a/utils/src/utils/AzExtFsExtra.ts +++ b/utils/src/utils/AzExtFsExtra.ts @@ -73,10 +73,10 @@ export namespace AzExtFsExtra { await workspace.fs.writeFile(uri, Buffer.from(contents)); } - export async function appendFile(resource: Uri | string, contents: string): Promise { + export async function appendFile(resource: Uri | string, contents: string, seperator: string = '\r\n\r\n'): Promise { const uri = convertToUri(resource); const existingContent = await AzExtFsExtra.readFile(uri); - await AzExtFsExtra.writeFile(uri, existingContent + '\r\n\r\n' + contents); + await AzExtFsExtra.writeFile(uri, existingContent + seperator + contents); } export async function pathExists(resource: Uri | string): Promise { From 516971f1ef0ff2174e2603c78ea09ffc940893df Mon Sep 17 00:00:00 2001 From: Nathan Turinski Date: Thu, 20 Jul 2023 15:56:17 -0700 Subject: [PATCH 6/9] Remove seperator default in declaration --- utils/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/index.d.ts b/utils/index.d.ts index 5f994d2c1c..9fb292cb21 100644 --- a/utils/index.d.ts +++ b/utils/index.d.ts @@ -1566,7 +1566,7 @@ export declare namespace AzExtFsExtra { /** * @param seperator By default, will append "\r\n\r\n" between existing content and new content to be appended */ - export function appendFile(resource: Uri | string, contents: string, seperator: string = '\r\n\r\n'): Promise; + export function appendFile(resource: Uri | string, contents: string, seperator?: string): Promise; export function pathExists(resource: Uri | string): Promise; export function readJSON(resource: Uri | string): Promise /** From f63ba0edd0ef8e420b1ee788d00a6ad5f1dec528 Mon Sep 17 00:00:00 2001 From: Nathan Date: Fri, 21 Jul 2023 15:12:09 -0700 Subject: [PATCH 7/9] I'm so bad at spelling Co-authored-by: Brandon Waterloo [MSFT] <36966225+bwateratmsft@users.noreply.github.com> --- utils/index.d.ts | 2 +- utils/src/utils/AzExtFsExtra.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/index.d.ts b/utils/index.d.ts index 9fb292cb21..6c4d7d98ae 100644 --- a/utils/index.d.ts +++ b/utils/index.d.ts @@ -1566,7 +1566,7 @@ export declare namespace AzExtFsExtra { /** * @param seperator By default, will append "\r\n\r\n" between existing content and new content to be appended */ - export function appendFile(resource: Uri | string, contents: string, seperator?: string): Promise; + export function appendFile(resource: Uri | string, contents: string, separator?: string): Promise; export function pathExists(resource: Uri | string): Promise; export function readJSON(resource: Uri | string): Promise /** diff --git a/utils/src/utils/AzExtFsExtra.ts b/utils/src/utils/AzExtFsExtra.ts index d298313f84..e829954dfb 100644 --- a/utils/src/utils/AzExtFsExtra.ts +++ b/utils/src/utils/AzExtFsExtra.ts @@ -73,7 +73,7 @@ export namespace AzExtFsExtra { await workspace.fs.writeFile(uri, Buffer.from(contents)); } - export async function appendFile(resource: Uri | string, contents: string, seperator: string = '\r\n\r\n'): Promise { + export async function appendFile(resource: Uri | string, contents: string, separator: string = '\r\n\r\n'): Promise { const uri = convertToUri(resource); const existingContent = await AzExtFsExtra.readFile(uri); await AzExtFsExtra.writeFile(uri, existingContent + seperator + contents); From 559ebb05f51ab0cf8a1c10ae95256d22a99d1bba Mon Sep 17 00:00:00 2001 From: Nathan Date: Fri, 21 Jul 2023 15:12:29 -0700 Subject: [PATCH 8/9] Update utils/index.d.ts --- utils/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/index.d.ts b/utils/index.d.ts index 6c4d7d98ae..4599f557bc 100644 --- a/utils/index.d.ts +++ b/utils/index.d.ts @@ -1564,7 +1564,7 @@ export declare namespace AzExtFsExtra { export function ensureFile(resource: Uri | string): Promise; export function readFile(resource: Uri | string): Promise; /** - * @param seperator By default, will append "\r\n\r\n" between existing content and new content to be appended + * @param separator By default, will append "\r\n\r\n" between existing content and new content to be appended */ export function appendFile(resource: Uri | string, contents: string, separator?: string): Promise; export function pathExists(resource: Uri | string): Promise; From 7375e0ca27947c61eb7fc703ba11607c6f453ba3 Mon Sep 17 00:00:00 2001 From: Nathan Date: Fri, 21 Jul 2023 15:12:45 -0700 Subject: [PATCH 9/9] Update utils/src/utils/AzExtFsExtra.ts --- utils/src/utils/AzExtFsExtra.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/src/utils/AzExtFsExtra.ts b/utils/src/utils/AzExtFsExtra.ts index e829954dfb..ccf7855f34 100644 --- a/utils/src/utils/AzExtFsExtra.ts +++ b/utils/src/utils/AzExtFsExtra.ts @@ -76,7 +76,7 @@ export namespace AzExtFsExtra { export async function appendFile(resource: Uri | string, contents: string, separator: string = '\r\n\r\n'): Promise { const uri = convertToUri(resource); const existingContent = await AzExtFsExtra.readFile(uri); - await AzExtFsExtra.writeFile(uri, existingContent + seperator + contents); + await AzExtFsExtra.writeFile(uri, existingContent + separator + contents); } export async function pathExists(resource: Uri | string): Promise {