diff --git a/appservice/package-lock.json b/appservice/package-lock.json index c2afbf732c..4028d9f2f4 100644 --- a/appservice/package-lock.json +++ b/appservice/package-lock.json @@ -14,10 +14,8 @@ "@azure/arm-appservice": "^13.0.2", "@azure/arm-operationalinsights": "^8.0.1", "@azure/arm-resourcegraph": "^4.0.0", - "@azure/arm-resources": "^5.0.0", - "@azure/arm-subscriptions": "^5.0.0", + "@azure/arm-resources-subscriptions": "^2.0.1", "@azure/ms-rest-azure-env": "^2.0.0", - "@azure/ms-rest-js": "^2.3.0", "@azure/storage-blob": "^12.3.0", "@microsoft/vscode-azext-azureutils": "^0.3.7", "@microsoft/vscode-azext-utils": "^0.4.0", @@ -213,23 +211,6 @@ "node": ">=12.0.0" } }, - "node_modules/@azure/arm-subscriptions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@azure/arm-subscriptions/-/arm-subscriptions-5.0.0.tgz", - "integrity": "sha512-kka1Gsy5fvQvYbe3gRsMl2hYCFMdQRHuOSSRUAsQUwAEqIJCu/hLZ/CNKcYusIMrA0SWzrjlFYVklo/uUKYolg==", - "dependencies": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.0.0", - "@azure/core-lro": "^2.2.0", - "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.1.0", - "tslib": "^2.2.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/@azure/core-asynciterator-polyfill": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.0.tgz", @@ -8828,20 +8809,6 @@ "tslib": "^2.2.0" } }, - "@azure/arm-subscriptions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@azure/arm-subscriptions/-/arm-subscriptions-5.0.0.tgz", - "integrity": "sha512-kka1Gsy5fvQvYbe3gRsMl2hYCFMdQRHuOSSRUAsQUwAEqIJCu/hLZ/CNKcYusIMrA0SWzrjlFYVklo/uUKYolg==", - "requires": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.0.0", - "@azure/core-lro": "^2.2.0", - "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.1.0", - "tslib": "^2.2.0" - } - }, "@azure/core-asynciterator-polyfill": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.0.tgz", diff --git a/appservice/package.json b/appservice/package.json index 4f7daf6bc9..3e745f8a31 100644 --- a/appservice/package.json +++ b/appservice/package.json @@ -37,10 +37,8 @@ "@azure/arm-appservice": "^13.0.2", "@azure/arm-operationalinsights": "^8.0.1", "@azure/arm-resourcegraph": "^4.0.0", - "@azure/arm-resources": "^5.0.0", - "@azure/arm-subscriptions": "^5.0.0", + "@azure/arm-resources-subscriptions": "^2.0.1", "@azure/ms-rest-azure-env": "^2.0.0", - "@azure/ms-rest-js": "^2.3.0", "@azure/storage-blob": "^12.3.0", "@microsoft/vscode-azext-azureutils": "^0.3.7", "@microsoft/vscode-azext-utils": "^0.4.0", diff --git a/azure/index.d.ts b/azure/index.d.ts index 254c7e01eb..bb150cf7c5 100644 --- a/azure/index.d.ts +++ b/azure/index.d.ts @@ -5,15 +5,16 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import type { ExtendedLocation, ResourceGroup } from '@azure/arm-resources'; import type { Location } from '@azure/arm-resources-subscriptions'; -import type { Environment } from '@azure/ms-rest-azure-env'; -import type { HttpOperationResponse, RequestPrepareOptions, ServiceClient } from '@azure/ms-rest-js'; +import type { StorageAccount } from '@azure/arm-storage'; +import type { ServiceClient, ServiceClientOptions } from '@azure/core-client'; import type { PagedAsyncIterableIterator } from '@azure/core-paging'; +import type { PipelineRequestOptions, PipelineResponse } from '@azure/core-rest-pipeline'; +import type { Environment } from '@azure/ms-rest-azure-env'; +import type { AzExtParentTreeItem, AzExtServiceClientCredentials, AzExtServiceClientCredentialsT2, AzExtTreeItem, AzureNameStep, AzureWizardExecuteStep, AzureWizardPromptStep, IActionContext, IAzureNamingRules, IAzureQuickPickItem, IAzureQuickPickOptions, IRelatedNameWizardContext, ISubscriptionActionContext, ISubscriptionContext, IWizardOptions, UIExtensionVariables } from '@microsoft/vscode-azext-utils'; +import { AzureSubscription } from '@microsoft/vscode-azureresources-api'; import { Disposable, Progress, Uri } from 'vscode'; -import type { AzExtParentTreeItem, AzExtServiceClientCredentials, AzExtServiceClientCredentialsT1, AzExtServiceClientCredentialsT2, AzExtTreeItem, AzureNameStep, AzureWizardExecuteStep, AzureWizardPromptStep, IActionContext, IAzureNamingRules, IAzureQuickPickItem, IAzureQuickPickOptions, IRelatedNameWizardContext, ISubscriptionActionContext, ISubscriptionContext, IWizardOptions, UIExtensionVariables } from '@microsoft/vscode-azext-utils'; -import { ExtendedLocation, ResourceGroup } from '@azure/arm-resources'; -import type { StorageAccount } from '@azure/arm-storage'; -import type { AzureSubscription } from '@microsoft/vscode-azureresources-api'; export type OpenInPortalOptions = { /** @@ -25,7 +26,7 @@ export type OpenInPortalOptions = { /** * Implement this class to display resources under a standard subscription tree item */ -export abstract class SubscriptionTreeItemBase extends AzExtParentTreeItem { +export declare abstract class SubscriptionTreeItemBase extends AzExtParentTreeItem { public static readonly contextValue: string; public readonly contextValue: string; public readonly label: string; @@ -232,7 +233,7 @@ export declare class ResourceGroupListStep extends AzureWizardPromptStep { +export declare class ResourceGroupNameStep extends AzureWizardPromptStep { public prompt(wizardContext: T): Promise; public shouldPrompt(wizardContext: T): boolean; } @@ -349,26 +350,10 @@ export interface IAzureUtilsExtensionVariables extends UIExtensionVariables { */ export declare function registerAzureUtilsExtensionVariables(extVars: IAzureUtilsExtensionVariables): void; -export interface IMinimumServiceClientOptions { - acceptLanguage?: string, - baseUri?: string; - /** - * Pass in endpoint as a workaround for https://github.com/Azure/azure-sdk-for-js/issues/20651. - * Value should be the same as `baseUri`. - */ - endpoint?: string; - userAgent?: string | ((defaultUserAgent: string) => string); - - /** - * NOTE: Using "any" to allow for the use of different versions of "@azure/ms-rest-js", which are largely compatible for our purposes - */ - requestPolicyFactories?: any[] | ((defaultRequestPolicyFactories: any[]) => (void | any[])); -} - /** * Credential type to be used for creating generic http rest clients */ -export type AzExtGenericCredentials = AzExtServiceClientCredentialsT1 | AzExtServiceClientCredentialsT2 | AzExtServiceClientCredentials; +export type AzExtGenericCredentials = AzExtServiceClientCredentialsT2 | AzExtServiceClientCredentials; export type AzExtGenericClientInfo = AzExtGenericCredentials | { credentials: AzExtGenericCredentials; environment: Environment; } | undefined; /** @@ -377,18 +362,19 @@ export type AzExtGenericClientInfo = AzExtGenericCredentials | { credentials: Az * 2. Uses resourceManagerEndpointUrl to support sovereigns (if clientInfo corresponds to an Azure environment) * @param clientInfo The client/credentials info or `undefined` if no credentials are needed */ -export function createGenericClient(context: IActionContext, clientInfo: AzExtGenericClientInfo): Promise; +export declare function createGenericClient(context: IActionContext, clientInfo: AzExtGenericClientInfo | undefined): Promise; -export type AzExtRequestPrepareOptions = RequestPrepareOptions & { rejectUnauthorized?: boolean } +export type AzExtRequestPrepareOptions = PipelineRequestOptions & { rejectUnauthorized?: boolean } +export type AzExtPipelineResponse = PipelineResponse & { parsedBody?: any } /** * Send request with a timeout specified and turn off retry policy (because retrying could take a lot longer) * @param timeout The timeout in milliseconds * @param clientInfo The client/credentials info or `undefined` if no credentials are needed */ -export function sendRequestWithTimeout(context: IActionContext, options: AzExtRequestPrepareOptions, timeout: number, clientInfo: AzExtGenericClientInfo): Promise; +export declare function sendRequestWithTimeout(context: IActionContext, options: AzExtRequestPrepareOptions, timeout: number, clientInfo: AzExtGenericClientInfo): Promise; -export type AzExtClientType = new (credentials: AzExtServiceClientCredentials, subscriptionId: string, options?: IMinimumServiceClientOptions) => T; +export type AzExtClientType = new (credentials: AzExtServiceClientCredentials, subscriptionId: string, options?: ServiceClientOptions) => T; /** * Convenience type to give us multiple ways to specify subscription info and action context depending on the scenario @@ -398,23 +384,23 @@ export type AzExtClientContext = ISubscriptionActionContext | [IActionContext, I /** * Converts `AzExtClientContext` into a single object: `ISubscriptionActionContext` */ -export function parseClientContext(clientContext: AzExtClientContext): ISubscriptionActionContext; +export declare function parseClientContext(clientContext: AzExtClientContext): ISubscriptionActionContext; /** * Creates an Azure client, ensuring best practices are followed. For example: * 1. Adds extension-specific user agent * 2. Uses resourceManagerEndpointUrl to support sovereigns */ -export function createAzureClient(context: AzExtClientContext, clientType: AzExtClientType): T; +export declare function createAzureClient(context: AzExtClientContext, clientType: AzExtClientType): T; -export type AzExtSubscriptionClientType = new (credentials: AzExtServiceClientCredentials, options?: IMinimumServiceClientOptions) => T; +export type AzExtSubscriptionClientType = new (credentials: AzExtServiceClientCredentials, options?: ServiceClientOptions) => T; /** * Creates an Azure subscription client, ensuring best practices are followed. For example: * 1. Adds extension-specific user agent * 2. Uses resourceManagerEndpointUrl to support sovereigns */ -export function createAzureSubscriptionClient(context: AzExtClientContext, clientType: AzExtSubscriptionClientType): T; +export declare function createAzureSubscriptionClient(context: AzExtClientContext, clientType: AzExtSubscriptionClientType): T; export declare namespace uiUtils { export function listAllIterator(iterator: PagedAsyncIterableIterator): Promise diff --git a/azure/package-lock.json b/azure/package-lock.json index 1bfefe2703..f23d0eadab 100644 --- a/azure/package-lock.json +++ b/azure/package-lock.json @@ -1,25 +1,28 @@ { "name": "@microsoft/vscode-azext-azureutils", - "version": "0.3.9", + "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@microsoft/vscode-azext-azureutils", - "version": "0.3.9", + "version": "1.0.0", "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.3", + "@azure/core-client": "^1.6.0", + "@azure/core-rest-pipeline": "^1.9.0", + "@microsoft/vscode-azext-utils": "0.4.3-alpha", "semver": "^7.3.7", + "uuid": "^9.0.0", "vscode-nls": "^5.0.1" }, "devDependencies": { + "@azure/core-auth": "^1.3.2", "@azure/core-paging": "^1.2.1", "@azure/ms-rest-azure-env": "^2.0.0", "@azure/ms-rest-nodeauth": "^3.1.1", @@ -29,6 +32,7 @@ "@types/mocha": "^7.0.2", "@types/node": "^14.0.0", "@types/semver": "^7.3.9", + "@types/uuid": "^9.0.1", "@types/vscode": "1.64.0", "@typescript-eslint/eslint-plugin": "^5.53.0", "@vscode/test-electron": "^2.1.5", @@ -122,20 +126,20 @@ "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "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": { @@ -182,9 +186,9 @@ "integrity": "sha512-kmv8CGrPfN9SwMwrkiBK9VTQYxdFQEGe0BmQk+M8io56P9KNzpAxcWE/1fxJj7uouwN4kXF0BHW8DNlgx+wtCg==" }, "node_modules/@azure/core-auth": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.3.2.tgz", - "integrity": "sha512-7CU6DmCHIZp5ZPiZ9r3J17lTKMmYsm/zGvNkjArQwPkrLlZ1TZ+EUYfGgh2X31OLMVAQCTJZW4cXHJi02EbJnA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.4.0.tgz", + "integrity": "sha512-HFrcTgmuSuukRf/EdPmqBrc5l6Q5Uu+2TbuhaKbgaCpP2TfAeiNaQPAadxO+CYBRHGUzIDteMAjFspFLDLnKVQ==", "dependencies": { "@azure/abort-controller": "^1.0.0", "tslib": "^2.2.0" @@ -199,18 +203,29 @@ "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "node_modules/@azure/core-client": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.5.0.tgz", - "integrity": "sha512-YNk8i9LT6YcFdFO+RRU0E4Ef+A8Y5lhXo6lz61rwbG8Uo7kSqh0YqK04OexiilM43xd6n3Y9yBhLnb1NFNI9dA==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.7.0.tgz", + "integrity": "sha512-fgaLVlF3xGg8JAt7Hl7vkKIJcCAA9NpsvIvb44qaEOW6CaJ+IaHKL7oWe5+oGOVR+y/z2Gd2joyvslqwDvRfTw==", "dependencies": { "@azure/abort-controller": "^1.0.0", - "@azure/core-asynciterator-polyfill": "^1.0.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.5.0", - "@azure/core-tracing": "1.0.0-preview.13", + "@azure/core-auth": "^1.4.0", + "@azure/core-rest-pipeline": "^1.9.1", + "@azure/core-tracing": "^1.0.0", + "@azure/core-util": "^1.0.0", "@azure/logger": "^1.0.0", "tslib": "^2.2.0" }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@azure/core-client/node_modules/@azure/core-tracing": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.1.tgz", + "integrity": "sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw==", + "dependencies": { + "tslib": "^2.2.0" + }, "engines": { "node": ">=12.0.0" } @@ -257,23 +272,23 @@ "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "node_modules/@azure/core-rest-pipeline": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.9.0.tgz", - "integrity": "sha512-uvM3mY+Vegk0F2r4Eh0yPdsXTUyafTQkeX0USnz1Eyangxm2Bib0w0wkJVZW8fpks7Lcv0ztIdCFTrN7H8uptg==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.10.1.tgz", + "integrity": "sha512-Kji9k6TOFRDB5ZMTw8qUf2IJ+CeJtsuMdAHox9eqpTf1cefiNMpzrfnF6sINEBZJsaVaWgQ0o48B6kcUH68niA==", "dependencies": { "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", + "@azure/core-auth": "^1.4.0", "@azure/core-tracing": "^1.0.1", "@azure/core-util": "^1.0.0", "@azure/logger": "^1.0.0", "form-data": "^4.0.0", - "http-proxy-agent": "^4.0.1", + "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "tslib": "^2.2.0", "uuid": "^8.3.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" } }, "node_modules/@azure/core-rest-pipeline/node_modules/@azure/core-tracing": { @@ -287,6 +302,14 @@ "node": ">=12.0.0" } }, + "node_modules/@azure/core-rest-pipeline/node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "engines": { + "node": ">= 10" + } + }, "node_modules/@azure/core-rest-pipeline/node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -300,11 +323,32 @@ "node": ">= 6" } }, + "node_modules/@azure/core-rest-pipeline/node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/@azure/core-rest-pipeline/node_modules/tslib": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, + "node_modules/@azure/core-rest-pipeline/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@azure/core-tracing": { "version": "1.0.0-preview.13", "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz", @@ -375,6 +419,7 @@ "version": "2.6.0", "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.0.tgz", "integrity": "sha512-4C5FCtvEzWudblB+h92/TYYPiq7tuElX8icVYToxOdggnYqeec4Se14mjse5miInKtZahiFHdl8lZA/jziEc5g==", + "dev": true, "dependencies": { "@azure/core-auth": "^1.1.4", "abort-controller": "^3.0.0", @@ -387,6 +432,15 @@ "xml2js": "^0.4.19" } }, + "node_modules/@azure/ms-rest-js/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@azure/ms-rest-nodeauth": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/@azure/ms-rest-nodeauth/-/ms-rest-nodeauth-3.1.1.tgz", @@ -1263,19 +1317,21 @@ } }, "node_modules/@microsoft/vscode-azext-utils": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-utils/-/vscode-azext-utils-0.4.3.tgz", - "integrity": "sha512-lyK/OnZZcHmhZCGa9OnQvephkiHF98yY8vjsCLRNbhP9G09UUbXVt0yaL0AwGAUg+C9GYdCkPKUDlBo/fuHWgw==", + "version": "0.4.3-alpha", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-utils/-/vscode-azext-utils-0.4.3-alpha.tgz", + "integrity": "sha512-UdZ/WQAKLGPDk6ugjUxr13DnwBM7ptzuzWq1id2rVvmklzVKm75KTvONV3Lp2IbwwNy/w9I8OxcDxYauVOSZxQ==", "dependencies": { "@microsoft/vscode-azureresources-api": "^2.0.2", "@vscode/extension-telemetry": "^0.6.2", + "crypto-randomuuid": "^1.0.0", "dayjs": "^1.11.2", "escape-string-regexp": "^2.0.0", - "html-to-text": "^8.2.0", - "open": "^8.0.4", "semver": "^7.3.7", + "text-encoding": "^0.7.0", + "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-azureresources-api": { @@ -1362,22 +1418,11 @@ "node": ">=8.0.0" } }, - "node_modules/@selderee/plugin-htmlparser2": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@selderee/plugin-htmlparser2/-/plugin-htmlparser2-0.6.0.tgz", - "integrity": "sha512-J3jpy002TyBjd4N/p6s+s90eX42H2eRhK3SbsZuvTDv977/E8p2U3zikdiehyJja66do7FlxLomZLPlvl2/xaA==", - "dependencies": { - "domhandler": "^4.2.0", - "selderee": "^0.6.0" - }, - "funding": { - "url": "https://ko-fi.com/killymxi" - } - }, "node_modules/@tootallnate/once": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true, "engines": { "node": ">= 6" } @@ -1454,6 +1499,12 @@ "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", "dev": true }, + "node_modules/@types/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA==", + "dev": true + }, "node_modules/@types/vscode": { "version": "1.64.0", "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.64.0.tgz", @@ -1920,6 +1971,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dev": true, "dependencies": { "event-target-shim": "^5.0.0" }, @@ -2790,7 +2842,8 @@ "node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true }, "node_modules/commondir": { "version": "1.0.1", @@ -2992,6 +3045,11 @@ "node": "*" } }, + "node_modules/crypto-randomuuid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/crypto-randomuuid/-/crypto-randomuuid-1.0.0.tgz", + "integrity": "sha512-/RC5F4l1SCqD/jazwUF6+t34Cd8zTSAGZ7rvvZu1whZUhD2a5MOGKjSGowoGcpj/cbVZk1ZODIooJEQQq3nNAA==" + }, "node_modules/date-utils": { "version": "1.2.21", "resolved": "https://registry.npmjs.org/date-utils/-/date-utils-1.2.21.tgz", @@ -3040,22 +3098,6 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "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==", - "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", @@ -3223,11 +3265,6 @@ "node": ">=8" } }, - "node_modules/discontinuous-range": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz", - "integrity": "sha512-c68LpLbO+7kP/b1Hr1qs8/BJ09F5khZGTxqxZuhzxpmwJKOgRFHJWIb9/KmqnqHhLdO55aOxFH/EGBvUQbL/RQ==" - }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -3240,57 +3277,6 @@ "node": ">=6.0.0" } }, - "node_modules/dom-serializer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", - "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", - "dependencies": { - "domelementtype": "^2.0.1", - "domhandler": "^4.2.0", - "entities": "^2.0.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ] - }, - "node_modules/domhandler": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", - "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", - "dependencies": { - "domelementtype": "^2.2.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/domutils": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", - "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", - "dependencies": { - "dom-serializer": "^1.0.1", - "domelementtype": "^2.2.0", - "domhandler": "^4.2.0" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, "node_modules/duplexer2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", @@ -3409,14 +3395,6 @@ "node": ">=10.13.0" } }, - "node_modules/entities": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", - "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/es-abstract": { "version": "1.21.2", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.2.tgz", @@ -3978,6 +3956,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "dev": true, "engines": { "node": ">=6" } @@ -4378,6 +4357,7 @@ "version": "2.5.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "dev": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -4780,6 +4760,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, "bin": { "he": "bin/he" } @@ -4795,43 +4776,6 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "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==", - "dependencies": { - "@selderee/plugin-htmlparser2": "^0.6.0", - "deepmerge": "^4.2.2", - "he": "^1.2.0", - "htmlparser2": "^6.1.0", - "minimist": "^1.2.6", - "selderee": "^0.6.0" - }, - "bin": { - "html-to-text": "bin/cli.js" - }, - "engines": { - "node": ">=10.23.2" - } - }, - "node_modules/htmlparser2": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz", - "integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==", - "funding": [ - "https://github.com/fb55/htmlparser2?sponsor=1", - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], - "dependencies": { - "domelementtype": "^2.0.1", - "domhandler": "^4.0.0", - "domutils": "^2.5.2", - "entities": "^2.0.0" - } - }, "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -4852,6 +4796,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, "dependencies": { "@tootallnate/once": "1", "agent-base": "6", @@ -4974,6 +4919,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", + "dev": true, "engines": { "node": ">=4" } @@ -5102,20 +5048,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", @@ -5356,17 +5288,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", @@ -5771,7 +5692,8 @@ "node_modules/minimist": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true }, "node_modules/minipass": { "version": "3.3.6", @@ -6048,11 +5970,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/moo": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.1.tgz", - "integrity": "sha512-I1mnb5xn4fO80BH9BLcF0yLypy2UKl+Cb01Fu0hJRkJjlCRtxZMWkTdAtDd5ZqCOxtCkhmRwyI57vWT+1iZ67w==" - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -6088,27 +6005,6 @@ "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", "dev": true }, - "node_modules/nearley": { - "version": "2.20.1", - "resolved": "https://registry.npmjs.org/nearley/-/nearley-2.20.1.tgz", - "integrity": "sha512-+Mc8UaAebFzgV+KpI5n7DasuuQCHA89dmwm7JXw3TV43ukfNQ9DnBH3Mdb2g/I4Fdxc26pwimBWvjIw0UAILSQ==", - "dependencies": { - "commander": "^2.19.0", - "moo": "^0.5.0", - "railroad-diagrams": "^1.0.0", - "randexp": "0.4.6" - }, - "bin": { - "nearley-railroad": "bin/nearley-railroad.js", - "nearley-test": "bin/nearley-test.js", - "nearley-unparse": "bin/nearley-unparse.js", - "nearleyc": "bin/nearleyc.js" - }, - "funding": { - "type": "individual", - "url": "https://nearley.js.org/#give-to-nearley" - } - }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -6158,6 +6054,7 @@ "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dev": true, "dependencies": { "whatwg-url": "^5.0.0" }, @@ -6305,22 +6202,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", @@ -6432,18 +6313,6 @@ "safe-buffer": "^5.1.1" } }, - "node_modules/parseley": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/parseley/-/parseley-0.7.0.tgz", - "integrity": "sha512-xyOytsdDu077M3/46Am+2cGXEKM9U9QclBDv7fimY7e+BBlxh2JcBp2mgNsmkyA9uvgyTjVzDi7cP1v4hcFxbw==", - "dependencies": { - "moo": "^0.5.1", - "nearley": "^2.20.1" - }, - "funding": { - "url": "https://ko-fi.com/killymxi" - } - }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -6635,7 +6504,8 @@ "node_modules/psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true }, "node_modules/public-encrypt": { "version": "4.0.3", @@ -6661,6 +6531,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, "engines": { "node": ">=6" } @@ -6719,23 +6590,6 @@ } ] }, - "node_modules/railroad-diagrams": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz", - "integrity": "sha512-cz93DjNeLY0idrCNOH6PviZGRN9GJhsdm9hpn1YCS879fj4W+x5IFJhhkRZcwVgMmFF7R82UA/7Oh+R8lLZg6A==" - }, - "node_modules/randexp": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz", - "integrity": "sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==", - "dependencies": { - "discontinuous-range": "1.0.0", - "ret": "~0.1.10" - }, - "engines": { - "node": ">=0.12" - } - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -6871,14 +6725,6 @@ "node": ">=4" } }, - "node_modules/ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "engines": { - "node": ">=0.12" - } - }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -6980,7 +6826,8 @@ "node_modules/sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true }, "node_modules/schema-utils": { "version": "2.7.1", @@ -7000,17 +6847,6 @@ "url": "https://opencollective.com/webpack" } }, - "node_modules/selderee": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/selderee/-/selderee-0.6.0.tgz", - "integrity": "sha512-ibqWGV5aChDvfVdqNYuaJP/HnVBhlRGSRrlbttmlMpHcLuTqqbMH36QkSs9GEgj5M88JDYLI8eyP94JaQ8xRlg==", - "dependencies": { - "parseley": "^0.7.0" - }, - "funding": { - "url": "https://ko-fi.com/killymxi" - } - }, "node_modules/semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -7498,6 +7334,24 @@ "randombytes": "^2.1.0" } }, + "node_modules/terser/node_modules/acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/text-encoding": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.7.0.tgz", + "integrity": "sha512-oJQ3f1hrOnbRLOcwKz0Liq2IcrvDeZRHXhd9RgLrsT+DjWY/nty1Hi7v3dtkaEYbPYe0mUoOfzRrMwfXXwgPUA==", + "deprecated": "no longer maintained" + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -7538,6 +7392,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", + "dev": true, "dependencies": { "ip-regex": "^2.1.0", "psl": "^1.1.28", @@ -7550,7 +7405,8 @@ "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", + "dev": true }, "node_modules/traverse": { "version": "0.3.9", @@ -7616,6 +7472,7 @@ "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "dev": true, "engines": { "node": ">=0.6.11 <=0.7.0 || >=0.7.3" } @@ -7875,9 +7732,9 @@ } }, "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "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" } @@ -7907,6 +7764,11 @@ "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", @@ -7923,7 +7785,8 @@ "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", + "dev": true }, "node_modules/webpack": { "version": "5.76.1", @@ -8013,6 +7876,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dev": true, "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -8203,6 +8067,7 @@ "version": "0.4.23", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "dev": true, "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" @@ -8215,6 +8080,7 @@ "version": "11.0.1", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "dev": true, "engines": { "node": ">=4.0" } @@ -8384,16 +8250,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" }, "dependencies": { @@ -8442,9 +8308,9 @@ "integrity": "sha512-kmv8CGrPfN9SwMwrkiBK9VTQYxdFQEGe0BmQk+M8io56P9KNzpAxcWE/1fxJj7uouwN4kXF0BHW8DNlgx+wtCg==" }, "@azure/core-auth": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.3.2.tgz", - "integrity": "sha512-7CU6DmCHIZp5ZPiZ9r3J17lTKMmYsm/zGvNkjArQwPkrLlZ1TZ+EUYfGgh2X31OLMVAQCTJZW4cXHJi02EbJnA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.4.0.tgz", + "integrity": "sha512-HFrcTgmuSuukRf/EdPmqBrc5l6Q5Uu+2TbuhaKbgaCpP2TfAeiNaQPAadxO+CYBRHGUzIDteMAjFspFLDLnKVQ==", "requires": { "@azure/abort-controller": "^1.0.0", "tslib": "^2.2.0" @@ -8458,19 +8324,27 @@ } }, "@azure/core-client": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.5.0.tgz", - "integrity": "sha512-YNk8i9LT6YcFdFO+RRU0E4Ef+A8Y5lhXo6lz61rwbG8Uo7kSqh0YqK04OexiilM43xd6n3Y9yBhLnb1NFNI9dA==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.7.0.tgz", + "integrity": "sha512-fgaLVlF3xGg8JAt7Hl7vkKIJcCAA9NpsvIvb44qaEOW6CaJ+IaHKL7oWe5+oGOVR+y/z2Gd2joyvslqwDvRfTw==", "requires": { "@azure/abort-controller": "^1.0.0", - "@azure/core-asynciterator-polyfill": "^1.0.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.5.0", - "@azure/core-tracing": "1.0.0-preview.13", + "@azure/core-auth": "^1.4.0", + "@azure/core-rest-pipeline": "^1.9.1", + "@azure/core-tracing": "^1.0.0", + "@azure/core-util": "^1.0.0", "@azure/logger": "^1.0.0", "tslib": "^2.2.0" }, "dependencies": { + "@azure/core-tracing": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.1.tgz", + "integrity": "sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw==", + "requires": { + "tslib": "^2.2.0" + } + }, "tslib": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", @@ -8513,17 +8387,17 @@ } }, "@azure/core-rest-pipeline": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.9.0.tgz", - "integrity": "sha512-uvM3mY+Vegk0F2r4Eh0yPdsXTUyafTQkeX0USnz1Eyangxm2Bib0w0wkJVZW8fpks7Lcv0ztIdCFTrN7H8uptg==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.10.1.tgz", + "integrity": "sha512-Kji9k6TOFRDB5ZMTw8qUf2IJ+CeJtsuMdAHox9eqpTf1cefiNMpzrfnF6sINEBZJsaVaWgQ0o48B6kcUH68niA==", "requires": { "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", + "@azure/core-auth": "^1.4.0", "@azure/core-tracing": "^1.0.1", "@azure/core-util": "^1.0.0", "@azure/logger": "^1.0.0", "form-data": "^4.0.0", - "http-proxy-agent": "^4.0.1", + "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "tslib": "^2.2.0", "uuid": "^8.3.0" @@ -8537,6 +8411,11 @@ "tslib": "^2.2.0" } }, + "@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==" + }, "form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -8547,10 +8426,25 @@ "mime-types": "^2.1.12" } }, + "http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "requires": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + } + }, "tslib": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" } } }, @@ -8621,6 +8515,7 @@ "version": "2.6.0", "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.0.tgz", "integrity": "sha512-4C5FCtvEzWudblB+h92/TYYPiq7tuElX8icVYToxOdggnYqeec4Se14mjse5miInKtZahiFHdl8lZA/jziEc5g==", + "dev": true, "requires": { "@azure/core-auth": "^1.1.4", "abort-controller": "^3.0.0", @@ -8631,6 +8526,14 @@ "tunnel": "0.0.6", "uuid": "^8.3.2", "xml2js": "^0.4.19" + }, + "dependencies": { + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true + } } }, "@azure/ms-rest-nodeauth": { @@ -9330,19 +9233,21 @@ } }, "@microsoft/vscode-azext-utils": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-utils/-/vscode-azext-utils-0.4.3.tgz", - "integrity": "sha512-lyK/OnZZcHmhZCGa9OnQvephkiHF98yY8vjsCLRNbhP9G09UUbXVt0yaL0AwGAUg+C9GYdCkPKUDlBo/fuHWgw==", + "version": "0.4.3-alpha", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-utils/-/vscode-azext-utils-0.4.3-alpha.tgz", + "integrity": "sha512-UdZ/WQAKLGPDk6ugjUxr13DnwBM7ptzuzWq1id2rVvmklzVKm75KTvONV3Lp2IbwwNy/w9I8OxcDxYauVOSZxQ==", "requires": { "@microsoft/vscode-azureresources-api": "^2.0.2", "@vscode/extension-telemetry": "^0.6.2", + "crypto-randomuuid": "^1.0.0", "dayjs": "^1.11.2", "escape-string-regexp": "^2.0.0", - "html-to-text": "^8.2.0", - "open": "^8.0.4", "semver": "^7.3.7", + "text-encoding": "^0.7.0", + "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" } }, "@microsoft/vscode-azureresources-api": { @@ -9409,19 +9314,11 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.4.tgz", "integrity": "sha512-BuJuXRSJNQ3QoKA6GWWDyuLpOUck+9hAXNMCnrloc1aWVoy6Xq6t9PUV08aBZ4Lutqq2LEHM486bpZqoViScog==" }, - "@selderee/plugin-htmlparser2": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@selderee/plugin-htmlparser2/-/plugin-htmlparser2-0.6.0.tgz", - "integrity": "sha512-J3jpy002TyBjd4N/p6s+s90eX42H2eRhK3SbsZuvTDv977/E8p2U3zikdiehyJja66do7FlxLomZLPlvl2/xaA==", - "requires": { - "domhandler": "^4.2.0", - "selderee": "^0.6.0" - } - }, "@tootallnate/once": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true }, "@types/eslint": { "version": "8.21.2", @@ -9495,6 +9392,12 @@ "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", "dev": true }, + "@types/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA==", + "dev": true + }, "@types/vscode": { "version": "1.64.0", "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.64.0.tgz", @@ -9839,6 +9742,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dev": true, "requires": { "event-target-shim": "^5.0.0" } @@ -10515,7 +10419,8 @@ "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true }, "commondir": { "version": "1.0.1", @@ -10684,6 +10589,11 @@ "randomfill": "^1.0.3" } }, + "crypto-randomuuid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/crypto-randomuuid/-/crypto-randomuuid-1.0.0.tgz", + "integrity": "sha512-/RC5F4l1SCqD/jazwUF6+t34Cd8zTSAGZ7rvvZu1whZUhD2a5MOGKjSGowoGcpj/cbVZk1ZODIooJEQQq3nNAA==" + }, "date-utils": { "version": "1.2.21", "resolved": "https://registry.npmjs.org/date-utils/-/date-utils-1.2.21.tgz", @@ -10715,16 +10625,6 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "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==" - }, "define-properties": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", @@ -10858,11 +10758,6 @@ "path-type": "^4.0.0" } }, - "discontinuous-range": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz", - "integrity": "sha512-c68LpLbO+7kP/b1Hr1qs8/BJ09F5khZGTxqxZuhzxpmwJKOgRFHJWIb9/KmqnqHhLdO55aOxFH/EGBvUQbL/RQ==" - }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -10872,39 +10767,6 @@ "esutils": "^2.0.2" } }, - "dom-serializer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", - "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", - "requires": { - "domelementtype": "^2.0.1", - "domhandler": "^4.2.0", - "entities": "^2.0.0" - } - }, - "domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==" - }, - "domhandler": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", - "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", - "requires": { - "domelementtype": "^2.2.0" - } - }, - "domutils": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", - "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", - "requires": { - "dom-serializer": "^1.0.1", - "domelementtype": "^2.2.0", - "domhandler": "^4.2.0" - } - }, "duplexer2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", @@ -11018,11 +10880,6 @@ "tapable": "^2.2.0" } }, - "entities": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", - "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==" - }, "es-abstract": { "version": "1.21.2", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.2.tgz", @@ -11455,7 +11312,8 @@ "event-target-shim": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "dev": true }, "events": { "version": "3.3.0", @@ -11781,6 +11639,7 @@ "version": "2.5.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -12069,7 +11928,8 @@ "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true }, "hmac-drbg": { "version": "1.0.1", @@ -12082,30 +11942,6 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "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==", - "requires": { - "@selderee/plugin-htmlparser2": "^0.6.0", - "deepmerge": "^4.2.2", - "he": "^1.2.0", - "htmlparser2": "^6.1.0", - "minimist": "^1.2.6", - "selderee": "^0.6.0" - } - }, - "htmlparser2": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz", - "integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==", - "requires": { - "domelementtype": "^2.0.1", - "domhandler": "^4.0.0", - "domutils": "^2.5.2", - "entities": "^2.0.0" - } - }, "http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -12123,6 +11959,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, "requires": { "@tootallnate/once": "1", "agent-base": "6", @@ -12217,7 +12054,8 @@ "ip-regex": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=" + "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", + "dev": true }, "ipaddr.js": { "version": "1.9.1", @@ -12304,11 +12142,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", @@ -12465,14 +12298,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", @@ -12800,7 +12625,8 @@ "minimist": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true }, "minipass": { "version": "3.3.6", @@ -13004,11 +12830,6 @@ "lodash": "^4.17.15" } }, - "moo": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.1.tgz", - "integrity": "sha512-I1mnb5xn4fO80BH9BLcF0yLypy2UKl+Cb01Fu0hJRkJjlCRtxZMWkTdAtDd5ZqCOxtCkhmRwyI57vWT+1iZ67w==" - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -13038,17 +12859,6 @@ "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", "dev": true }, - "nearley": { - "version": "2.20.1", - "resolved": "https://registry.npmjs.org/nearley/-/nearley-2.20.1.tgz", - "integrity": "sha512-+Mc8UaAebFzgV+KpI5n7DasuuQCHA89dmwm7JXw3TV43ukfNQ9DnBH3Mdb2g/I4Fdxc26pwimBWvjIw0UAILSQ==", - "requires": { - "commander": "^2.19.0", - "moo": "^0.5.0", - "railroad-diagrams": "^1.0.0", - "randexp": "0.4.6" - } - }, "negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -13094,6 +12904,7 @@ "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dev": true, "requires": { "whatwg-url": "^5.0.0" } @@ -13191,16 +13002,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", @@ -13288,15 +13089,6 @@ "safe-buffer": "^5.1.1" } }, - "parseley": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/parseley/-/parseley-0.7.0.tgz", - "integrity": "sha512-xyOytsdDu077M3/46Am+2cGXEKM9U9QclBDv7fimY7e+BBlxh2JcBp2mgNsmkyA9uvgyTjVzDi7cP1v4hcFxbw==", - "requires": { - "moo": "^0.5.1", - "nearley": "^2.20.1" - } - }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -13443,7 +13235,8 @@ "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true }, "public-encrypt": { "version": "4.0.3", @@ -13470,7 +13263,8 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true }, "qs": { "version": "6.11.0", @@ -13499,20 +13293,6 @@ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, - "railroad-diagrams": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz", - "integrity": "sha512-cz93DjNeLY0idrCNOH6PviZGRN9GJhsdm9hpn1YCS879fj4W+x5IFJhhkRZcwVgMmFF7R82UA/7Oh+R8lLZg6A==" - }, - "randexp": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz", - "integrity": "sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==", - "requires": { - "discontinuous-range": "1.0.0", - "ret": "~0.1.10" - } - }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -13615,11 +13395,6 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" - }, "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -13680,7 +13455,8 @@ "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true }, "schema-utils": { "version": "2.7.1", @@ -13693,14 +13469,6 @@ "ajv-keywords": "^3.5.2" } }, - "selderee": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/selderee/-/selderee-0.6.0.tgz", - "integrity": "sha512-ibqWGV5aChDvfVdqNYuaJP/HnVBhlRGSRrlbttmlMpHcLuTqqbMH36QkSs9GEgj5M88JDYLI8eyP94JaQ8xRlg==", - "requires": { - "parseley": "^0.7.0" - } - }, "semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -14046,6 +13814,14 @@ "acorn": "^8.5.0", "commander": "^2.20.0", "source-map-support": "~0.5.20" + }, + "dependencies": { + "acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "dev": true + } } }, "terser-webpack-plugin": { @@ -14083,6 +13859,11 @@ } } }, + "text-encoding": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.7.0.tgz", + "integrity": "sha512-oJQ3f1hrOnbRLOcwKz0Liq2IcrvDeZRHXhd9RgLrsT+DjWY/nty1Hi7v3dtkaEYbPYe0mUoOfzRrMwfXXwgPUA==" + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -14114,6 +13895,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", + "dev": true, "requires": { "ip-regex": "^2.1.0", "psl": "^1.1.28", @@ -14123,7 +13905,8 @@ "tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", + "dev": true }, "traverse": { "version": "0.3.9", @@ -14172,7 +13955,8 @@ "tunnel": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "dev": true }, "type-check": { "version": "0.4.0", @@ -14383,9 +14167,9 @@ "dev": true }, "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" }, "vary": { "version": "1.1.2", @@ -14406,6 +14190,11 @@ "tas-client": "0.1.45" } }, + "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", @@ -14419,7 +14208,8 @@ "webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", + "dev": true }, "webpack": { "version": "5.76.1", @@ -14486,6 +14276,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dev": true, "requires": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -14634,6 +14425,7 @@ "version": "0.4.23", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "dev": true, "requires": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" @@ -14642,7 +14434,8 @@ "xmlbuilder": { "version": "11.0.1", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", - "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "dev": true }, "xpath.js": { "version": "1.1.0", diff --git a/azure/package.json b/azure/package.json index 8803304059..09ed3d84a6 100644 --- a/azure/package.json +++ b/azure/package.json @@ -1,7 +1,7 @@ { "name": "@microsoft/vscode-azext-azureutils", "author": "Microsoft Corporation", - "version": "0.3.9", + "version": "1.0.0", "description": "Common Azure utils for developing Azure extensions for VS Code", "tags": [ "azure", @@ -35,14 +35,17 @@ "@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.3", + "@azure/core-client": "^1.6.0", + "@azure/core-rest-pipeline": "^1.9.0", + "@microsoft/vscode-azext-utils": "0.4.3-alpha", "semver": "^7.3.7", + "uuid": "^9.0.0", "vscode-nls": "^5.0.1" }, "devDependencies": { + "@azure/core-auth": "^1.3.2", "@azure/core-paging": "^1.2.1", "@azure/ms-rest-azure-env": "^2.0.0", "@azure/ms-rest-nodeauth": "^3.1.1", @@ -52,6 +55,7 @@ "@types/mocha": "^7.0.2", "@types/node": "^14.0.0", "@types/semver": "^7.3.9", + "@types/uuid": "^9.0.1", "@types/vscode": "1.64.0", "@typescript-eslint/eslint-plugin": "^5.53.0", "@vscode/test-electron": "^2.1.5", diff --git a/azure/src/GenericServiceClient.ts b/azure/src/GenericServiceClient.ts deleted file mode 100644 index 4e4a3d01ed..0000000000 --- a/azure/src/GenericServiceClient.ts +++ /dev/null @@ -1,31 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { HttpOperationResponse, RequestPrepareOptions, ServiceClient, WebResourceLike } from '@azure/ms-rest-js'; -import * as vscode from 'vscode'; -import * as types from '../index'; - -export class GenericServiceClient extends ServiceClient { - constructor(credentials: types.AzExtGenericCredentials | undefined, options: types.IMinimumServiceClientOptions) { - super(credentials, options); - this.baseUri = options.baseUri?.endsWith('/') ? options.baseUri.slice(0, -1) : options.baseUri; - } - - public async sendRequest(options: RequestPrepareOptions | WebResourceLike): Promise { - if (this.baseUri && options.url && !options.url.startsWith('http')) { - if (!options.url.startsWith('/')) { - options.url = `/${options.url}`; - } - - options.url = this.baseUri + options.url; - } - - options['baseUrl'] = this.baseUri; - options.headers ||= {}; - options.headers['accept-language'] = vscode.env.language; - - return await super.sendRequest(options); - } -} diff --git a/azure/src/azure-account.api.d.ts b/azure/src/azure-account.api.d.ts index 563de4d97e..f4ab0e8922 100644 --- a/azure/src/azure-account.api.d.ts +++ b/azure/src/azure-account.api.d.ts @@ -4,44 +4,44 @@ *--------------------------------------------------------------------------------------------*/ import type { Subscription } from '@azure/arm-resources-subscriptions'; -import { TokenCredential } from '@azure/core-auth'; -import { Environment } from '@azure/ms-rest-azure-env'; +import type { TokenCredential } from '@azure/core-auth'; +import type { Environment } from '@azure/ms-rest-azure-env'; import type { TokenCredentialsBase } from '@azure/ms-rest-nodeauth'; -import { ReadStream } from 'fs'; -import { CancellationToken, Event, Progress, Terminal } from 'vscode'; +import type { ReadStream } from 'fs'; +import type { CancellationToken, Event, Progress, Terminal } from 'vscode'; export type AzureLoginStatus = 'Initializing' | 'LoggingIn' | 'LoggedIn' | 'LoggedOut'; export interface AzureAccountExtensionApi { - readonly apiVersion: string; - readonly status: AzureLoginStatus; - readonly filters: AzureResourceFilter[]; - readonly sessions: AzureSession[]; - readonly subscriptions: AzureSubscription[]; - readonly onStatusChanged: Event; - readonly onFiltersChanged: Event; - readonly onSessionsChanged: Event; - readonly onSubscriptionsChanged: Event; - readonly waitForFilters: () => Promise; - readonly waitForLogin: () => Promise; - readonly waitForSubscriptions: () => Promise; - createCloudShell(os: 'Linux' | 'Windows'): CloudShell; + readonly apiVersion: string; + readonly status: AzureLoginStatus; + readonly filters: AzureResourceFilter[]; + readonly sessions: AzureSession[]; + readonly subscriptions: AzureSubscription[]; + readonly onStatusChanged: Event; + readonly onFiltersChanged: Event; + readonly onSessionsChanged: Event; + readonly onSubscriptionsChanged: Event; + readonly waitForFilters: () => Promise; + readonly waitForLogin: () => Promise; + readonly waitForSubscriptions: () => Promise; + createCloudShell(os: 'Linux' | 'Windows'): CloudShell; } export interface AzureSession { - readonly environment: Environment; - readonly userId: string; - readonly tenantId: string; + readonly environment: Environment; + readonly userId: string; + readonly tenantId: string; - /** - * The credentials object for azure-sdk-for-js modules https://github.com/azure/azure-sdk-for-js - */ - readonly credentials2: TokenCredentialsBase & TokenCredential; + /** + * The credentials object for azure-sdk-for-js modules https://github.com/azure/azure-sdk-for-js + */ + readonly credentials2: TokenCredentialsBase & TokenCredential; } export interface AzureSubscription { - readonly session: AzureSession; - readonly subscription: Subscription; + readonly session: AzureSession; + readonly subscription: Subscription; } export type AzureResourceFilter = AzureSubscription; @@ -49,16 +49,16 @@ export type AzureResourceFilter = AzureSubscription; export type CloudShellStatus = 'Connecting' | 'Connected' | 'Disconnected'; export interface UploadOptions { - contentLength?: number; - progress?: Progress<{ message?: string; increment?: number }>; - token?: CancellationToken; + contentLength?: number; + progress?: Progress<{ message?: string; increment?: number }>; + token?: CancellationToken; } export interface CloudShell { - readonly status: CloudShellStatus; - readonly onStatusChanged: Event; - readonly waitForConnection: () => Promise; - readonly terminal: Promise; - readonly session: Promise; - readonly uploadFile: (filename: string, stream: ReadStream, options?: UploadOptions) => Promise; + readonly status: CloudShellStatus; + readonly onStatusChanged: Event; + readonly waitForConnection: () => Promise; + readonly terminal: Promise; + readonly session: Promise; + readonly uploadFile: (filename: string, stream: ReadStream, options?: UploadOptions) => Promise; } diff --git a/azure/src/createAzureClient.ts b/azure/src/createAzureClient.ts index 86734df3d8..3a10ed4a85 100644 --- a/azure/src/createAzureClient.ts +++ b/azure/src/createAzureClient.ts @@ -3,16 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BaseRequestPolicy, BasicAuthenticationCredentials, HttpOperationResponse, RequestPolicy, RequestPolicyFactory, RequestPolicyOptions, RestError, ServiceClient, TokenCredentials, WebResource, WebResourceLike } from '@azure/ms-rest-js'; -import { randomUUID } from 'crypto'; -import { Agent } from 'http'; +import { ServiceClient } from '@azure/core-client'; +import { createPipelineRequest, defaultRetryPolicy, Pipeline, PipelineOptions, PipelinePolicy, PipelineRequest, PipelineResponse, RestError, RetryPolicyOptions, SendRequest, userAgentPolicy } from '@azure/core-rest-pipeline'; +import { appendExtensionUserAgent, AzExtTreeItem, IActionContext, ISubscriptionActionContext, ISubscriptionContext, parseError } from '@microsoft/vscode-azext-utils'; import { Agent as HttpsAgent } from 'https'; +import { v4 as uuidv4 } from "uuid"; import * as vscode from "vscode"; import * as types from '../index'; -import type { GenericServiceClient } from './GenericServiceClient'; import { localize } from './localize'; import { parseJson, removeBom } from './utils/parseJson'; -import { appendExtensionUserAgent, AzExtTreeItem, IActionContext, ISubscriptionActionContext, ISubscriptionContext, maskValue, parseError } from '@microsoft/vscode-azext-utils'; export type InternalAzExtClientContext = ISubscriptionActionContext | [IActionContext, ISubscriptionContext | AzExtTreeItem]; @@ -35,41 +34,37 @@ export function parseClientContext(clientContext: InternalAzExtClientContext): I } } -export function createAzureClient(clientContext: InternalAzExtClientContext, clientType: types.AzExtClientType): T { +export function createAzureClient(clientContext: InternalAzExtClientContext, clientType: types.AzExtClientType): T { const context = parseClientContext(clientContext); - return new clientType(context.credentials, context.subscriptionId, { - acceptLanguage: vscode.env.language, - baseUri: context.environment.resourceManagerEndpointUrl, + const client = new clientType(context.credentials, context.subscriptionId, { endpoint: context.environment.resourceManagerEndpointUrl, - userAgent: appendExtensionUserAgent, - requestPolicyFactories: (defaultFactories: RequestPolicyFactory[]) => addAzExtFactories(context, context.credentials, defaultFactories), }); + + addAzExtPipeline(context, client.pipeline); + return client; } -export function createAzureSubscriptionClient(clientContext: InternalAzExtClientContext, clientType: types.AzExtSubscriptionClientType): T { +export function createAzureSubscriptionClient(clientContext: InternalAzExtClientContext, clientType: types.AzExtSubscriptionClientType): T { const context = parseClientContext(clientContext); - return new clientType(context.credentials, { - acceptLanguage: vscode.env.language, - baseUri: context.environment.resourceManagerEndpointUrl, - endpoint: context.environment.resourceManagerEndpointUrl, - userAgent: appendExtensionUserAgent, - requestPolicyFactories: (defaultFactories: RequestPolicyFactory[]) => addAzExtFactories(context, context.credentials, defaultFactories), + const client = new clientType(context.credentials, { + endpoint: context.environment.resourceManagerEndpointUrl }); + + addAzExtPipeline(context, client.pipeline); + return client; } -export async function sendRequestWithTimeout(context: IActionContext, options: types.AzExtRequestPrepareOptions, timeout: number, clientInfo: types.AzExtGenericClientInfo): Promise { - let request: WebResource = new WebResource(); - request = request.prepare(options); - request.timeout = timeout; +export async function sendRequestWithTimeout(context: IActionContext, options: types.AzExtRequestPrepareOptions, timeout: number, clientInfo: types.AzExtGenericClientInfo): Promise { + const request: PipelineRequest = createPipelineRequest({ + ...options, + timeout + }); - if (options.rejectUnauthorized !== undefined) { - request.agentSettings = { - http: new Agent(), - https: new HttpsAgent({ rejectUnauthorized: options.rejectUnauthorized }) - } + if (options.rejectUnauthorized) { + request.agent = new HttpsAgent({ rejectUnauthorized: options.rejectUnauthorized }); } - const client: GenericServiceClient = await createGenericClient(context, clientInfo, { noRetryPolicy: true }); + const client = await createGenericClient(context, clientInfo, { noRetryPolicy: true }); return await client.sendRequest(request); } @@ -77,89 +72,83 @@ interface IGenericClientOptions { noRetryPolicy?: boolean; } -export async function createGenericClient(context: IActionContext, clientInfo: types.AzExtGenericClientInfo, options?: IGenericClientOptions): Promise { +export async function createGenericClient(context: IActionContext, clientInfo: types.AzExtGenericClientInfo | undefined, options?: IGenericClientOptions): Promise { let credentials: types.AzExtGenericCredentials | undefined; - let baseUri: string | undefined; + let endpoint: string | undefined; if (clientInfo && 'credentials' in clientInfo) { credentials = clientInfo.credentials; - baseUri = clientInfo.environment.resourceManagerEndpointUrl; + endpoint = clientInfo.environment.resourceManagerEndpointUrl; } else { credentials = clientInfo; } - const gsc: typeof import('./GenericServiceClient') = await import('./GenericServiceClient'); + const retryOptions: RetryPolicyOptions | undefined = options?.noRetryPolicy ? { maxRetries: 0 } : undefined; - return new gsc.GenericServiceClient(credentials, { - baseUri, - endpoint: baseUri, - userAgent: appendExtensionUserAgent, - requestPolicyFactories: (defaultFactories: RequestPolicyFactory[]) => addAzExtFactories(context, credentials, defaultFactories), - noRetryPolicy: options?.noRetryPolicy + const client = new ServiceClient({ + credential: credentials, + endpoint }); + + addAzExtPipeline(context, client.pipeline, endpoint, { retryOptions }); + return client; } -function addAzExtFactories(context: IActionContext, credentials: types.AzExtGenericCredentials | undefined, defaultFactories: RequestPolicyFactory[]): RequestPolicyFactory[] { - // NOTE: Factories at the end of the array are executed first, and we want these to happen before the deserialization factory - defaultFactories.push( - { - create: (nextPolicy, options): RequestPolicy => new RemoveBOMPolicy(nextPolicy, options) - }, - { - create: (nextPolicy, options): RequestPolicy => new MissingContentTypePolicy(nextPolicy, options) - } - ); +function addAzExtPipeline(context: IActionContext, pipeline: Pipeline, endpoint?: string, options?: PipelineOptions): Pipeline { + // ServiceClient has default pipeline policies that the core-client SDKs require. Rather than building an entirely custom pipeline, + // it's easier to just remove the default policies and add ours as-needed + + // ServiceClient adds a default retry policy, so we need to remove it and add ours + if (options?.retryOptions) { + pipeline.removePolicy(defaultRetryPolicy()); + pipeline.addPolicy(defaultRetryPolicy(options?.retryOptions)); + } + // ServiceClient adds a default userAgent policy and you can't have duplicate policies, so we need to remove it and add ours + pipeline.removePolicy(userAgentPolicy()); + pipeline.addPolicy(userAgentPolicy({ userAgentPrefix: appendExtensionUserAgent() })); + + // Policies to apply before the request + pipeline.addPolicy(new AcceptLanguagePolicy(), { phase: 'Serialize' }); if (vscode.env.isTelemetryEnabled) { - defaultFactories.push( - { - create: (nextPolicy, options): RequestPolicy => new CorrelationIdPolicy(nextPolicy, options, context) - } - ) + pipeline.addPolicy(new CorrelationIdPolicy(context), { phase: 'Serialize' }); + } + if (endpoint) { + pipeline.addPolicy(new AddEndpointPolicy(endpoint), { phase: 'Serialize' }); } - // We want these to execute last - defaultFactories.unshift( - { - create: (nextPolicy, options): RequestPolicy => new MaskCredentialsPolicy(nextPolicy, options, credentials) - }, - { - create: (nextPolicy, options): RequestPolicy => new StatusCodePolicy(nextPolicy, options) - } - ); + // Policies to apply after the response + pipeline.addPolicy(new MissingContentTypePolicy(), { phase: 'Deserialize' }); + pipeline.addPolicy(new RemoveBOMPolicy(), { phase: 'Deserialize', beforePolicies: [MissingContentTypePolicy.Name] }); + pipeline.addPolicy(new StatusCodePolicy() /*intentionally not in a phase*/); - return defaultFactories; + return pipeline; } -const contentTypeName: string = 'Content-Type'; - /** * Automatically add id to correlate our telemetry with the platform team's telemetry */ -class CorrelationIdPolicy extends BaseRequestPolicy { - private _context: IActionContext; - constructor(nextPolicy: RequestPolicy, requestPolicyOptions: RequestPolicyOptions, context: IActionContext) { - super(nextPolicy, requestPolicyOptions); - this._context = context; +export class CorrelationIdPolicy implements PipelinePolicy { + public readonly name = 'CorrelationIdPolicy'; + + constructor(private readonly context: IActionContext) { } - public async sendRequest(request: WebResourceLike): Promise { + public async sendRequest(request: PipelineRequest, next: SendRequest): Promise { const headerName = 'x-ms-correlation-request-id'; - const id: string = this._context.telemetry.properties[headerName] ||= randomUUID(); + const id: string = this.context.telemetry.properties[headerName] ||= uuidv4(); request.headers.set(headerName, id); - return await this._nextPolicy.sendRequest(request); + return await next(request); } } /** * Removes the BOM character if it exists in bodyAsText for a json response, to prevent a parse error */ -class RemoveBOMPolicy extends BaseRequestPolicy { - constructor(nextPolicy: RequestPolicy, requestPolicyOptions: RequestPolicyOptions) { - super(nextPolicy, requestPolicyOptions); - } +class RemoveBOMPolicy implements PipelinePolicy { + public readonly name = 'RemoveBOMPolicy'; - public async sendRequest(request: WebResourceLike): Promise { - const response: HttpOperationResponse = await this._nextPolicy.sendRequest(request); + public async sendRequest(request: PipelineRequest, next: SendRequest): Promise { + const response: PipelineResponse = await next(request); const contentType: string | undefined = response.headers.get(contentTypeName); if (contentType && /json/i.test(contentType) && response.bodyAsText) { response.bodyAsText = removeBom(response.bodyAsText); @@ -168,17 +157,18 @@ class RemoveBOMPolicy extends BaseRequestPolicy { } } +const contentTypeName: string = 'Content-Type'; + /** * The Azure SDK will assume "JSON" if no content-type is specified, which can cause false-positive parse errors. * This will be a little smarter and try to detect if it's json or generic data */ -class MissingContentTypePolicy extends BaseRequestPolicy { - constructor(nextPolicy: RequestPolicy, requestPolicyOptions: RequestPolicyOptions) { - super(nextPolicy, requestPolicyOptions); - } +class MissingContentTypePolicy implements PipelinePolicy { + public static readonly Name = 'MissingContentTypePolicy'; + public readonly name = MissingContentTypePolicy.Name; - public async sendRequest(request: WebResourceLike): Promise { - const response: HttpOperationResponse = await this._nextPolicy.sendRequest(request); + public async sendRequest(request: PipelineRequest, next: SendRequest): Promise { + const response: PipelineResponse = await next(request); if (!response.headers.get(contentTypeName) && response.bodyAsText) { try { parseJson(response.bodyAsText); @@ -191,54 +181,59 @@ class MissingContentTypePolicy extends BaseRequestPolicy { } } -/** - * The Azure SDK will only throw errors for bad status codes if it has an "operationSpec", but none of our "generic" requests will have that - */ -class StatusCodePolicy extends BaseRequestPolicy { - constructor(nextPolicy: RequestPolicy, requestPolicyOptions: RequestPolicyOptions) { - super(nextPolicy, requestPolicyOptions); +// Add the "Accept-Language" header +class AcceptLanguagePolicy implements PipelinePolicy { + public readonly name = 'AcceptLanguagePolicy'; + + public async sendRequest(request: PipelineRequest, next: SendRequest): Promise { + request.headers.set('Accept-Language', vscode.env.language); + return await next(request); } +} - public async sendRequest(request: WebResourceLike): Promise { - const response: HttpOperationResponse = await this._nextPolicy.sendRequest(request); - if (!request.operationSpec && (response.status < 200 || response.status >= 300)) { - const errorMessage: string = response.bodyAsText ? - parseError(response.parsedBody || response.bodyAsText).message : - localize('unexpectedStatusCode', 'Unexpected status code: {0}', response.status); - throw new RestError(errorMessage, undefined, response.status, request, response, response.bodyAsText); - } else { - return response; +// Adds the endpoint to the request URL, if it is not present +class AddEndpointPolicy implements PipelinePolicy { + public readonly name = 'AddEndpointPolicy'; + + public constructor(private readonly endpoint: string) { } + + public async sendRequest(request: PipelineRequest, next: SendRequest): Promise { + if (this.endpoint && request.url && !request.url.startsWith('http')) { + if (!request.url.startsWith('/')) { + request.url = `/${request.url}`; + } + + request.url = this.endpoint + request.url; } + + return await next(request); } } /** - * In the highly unlikely event that a request error includes the original credentials used for the request, - * this policy will make sure those credentials get masked in the error message + * When SDK calls error, they'll throw a RestError during the response. + * However, with generic requests, it will pass any status code as a resolved response, + * so check the status and throw our own RestError */ -class MaskCredentialsPolicy extends BaseRequestPolicy { - private _credentials: types.AzExtGenericCredentials | undefined; - constructor(nextPolicy: RequestPolicy, requestPolicyOptions: RequestPolicyOptions, credentials: types.AzExtGenericCredentials | undefined,) { - super(nextPolicy, requestPolicyOptions); - this._credentials = credentials; - } +class StatusCodePolicy implements PipelinePolicy { + public readonly name = 'StatusCodePolicy'; - public async sendRequest(request: WebResourceLike): Promise { - try { - return await this._nextPolicy.sendRequest(request); - } catch (error) { - const pe = parseError(error); - if (this._credentials) { - const tokenOrPassword = (>this._credentials).token || (>this._credentials).password; - - const maskedMessage = maskValue(pe.message, tokenOrPassword); - const maskedErrorType = maskValue(pe.errorType, tokenOrPassword); - if (pe.message !== maskedMessage || pe.errorType !== maskedErrorType) { - throw Object.assign(new Error(maskedMessage), { code: maskedErrorType }); - } - } - - throw error; + public async sendRequest(request: PipelineRequest, next: SendRequest): Promise { + const response: types.AzExtPipelineResponse = await next(request); + if (response.status < 200 || response.status >= 300) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const errorMessage: string = response.bodyAsText ? + parseError(response.parsedBody || response.bodyAsText).message : + localize('unexpectedStatusCode', 'Unexpected status code: {0}', response.status); + throw new RestError(errorMessage, { + code: response.bodyAsText || '', + statusCode: response.status, + request, + response + }); + } else { + return response; } } } + diff --git a/azure/src/tree/AzureAccountTreeItemBase.ts b/azure/src/tree/AzureAccountTreeItemBase.ts index 6e1ee9994e..6fff556dae 100644 --- a/azure/src/tree/AzureAccountTreeItemBase.ts +++ b/azure/src/tree/AzureAccountTreeItemBase.ts @@ -10,7 +10,7 @@ import { AzureAccountExtensionApi, AzureLoginStatus, AzureResourceFilter } from import { localize } from '../localize'; import { getIconPath } from './IconPath'; import { SubscriptionTreeItemBase } from './SubscriptionTreeItemBase'; -import { AzExtServiceClientCredentials, nonNullProp, nonNullValue, UserCancelledError, registerEvent, AzureWizardPromptStep, AzExtParentTreeItem, AzExtTreeItem, GenericTreeItem, addExtensionValueToMask, IActionContext, ISubscriptionActionContext, TreeItemIconPath, ISubscriptionContext } from '@microsoft/vscode-azext-utils'; +import { addExtensionValueToMask, AzExtParentTreeItem, AzExtServiceClientCredentials, AzExtTreeItem, AzureWizardPromptStep, GenericTreeItem, IActionContext, ISubscriptionActionContext, ISubscriptionContext, nonNullProp, nonNullValue, registerEvent, TreeItemIconPath, UserCancelledError } from '@microsoft/vscode-azext-utils'; const signInLabel: string = localize('signInLabel', 'Sign in to Azure...'); const createAccountLabel: string = localize('createAccountLabel', 'Create an Azure Account...'); diff --git a/azure/src/wizard/LocationListStep.ts b/azure/src/wizard/LocationListStep.ts index 0fb2c53d99..7c926cb629 100644 --- a/azure/src/wizard/LocationListStep.ts +++ b/azure/src/wizard/LocationListStep.ts @@ -8,10 +8,9 @@ import type { Location } from '@azure/arm-resources-subscriptions'; import * as types from '../../index'; import { createResourcesClient, createSubscriptionsClient } from '../clients'; import { resourcesProvider } from '../constants'; -import { AzureWizardPromptStep, IActionContext, IAzureQuickPickItem, IAzureQuickPickOptions } from '@microsoft/vscode-azext-utils'; +import { AzureWizardPromptStep, IActionContext, IAzureQuickPickItem, IAzureQuickPickOptions, nonNullProp, nonNullValue } from '@microsoft/vscode-azext-utils'; import { localize } from '../localize'; import { ext } from '../extensionVariables'; -import { nonNullProp, nonNullValue } from '@microsoft/vscode-azext-utils'; import { uiUtils } from '../utils/uiUtils'; interface ILocationWizardContextInternal extends types.ILocationWizardContext { diff --git a/azure/test/request.test.ts b/azure/test/request.test.ts index b93ae295da..47f2e357fe 100644 --- a/azure/test/request.test.ts +++ b/azure/test/request.test.ts @@ -3,23 +3,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { BasicAuthenticationCredentials, HttpOperationResponse, Serializer, TokenCredentials, WebResource } from '@azure/ms-rest-js'; +import { createTestActionContext } from '@microsoft/vscode-azext-dev'; import * as assert from 'assert'; import * as http from 'http'; -import { createTestActionContext } from '@microsoft/vscode-azext-dev'; -import { createGenericClient, sendRequestWithTimeout } from '../src/createAzureClient'; +import * as types from '../index'; +import { sendRequestWithTimeout } from '../src/createAzureClient'; import { assertThrowsAsync } from './assertThrowsAsync'; -type ResponseData = { status: number; contentType?: string; body?: string; } | ((response: http.ServerResponse) => void); +type ResponseData = { statusCode: number; contentType?: string; body?: string; } | ((response: http.ServerResponse) => void); suite('request', () => { let url: string; let server: http.Server; let testResponses: ResponseData[] = []; - async function sendTestRequest(...responses: ResponseData[]): Promise { + async function sendTestRequest(...responses: ResponseData[]): Promise { testResponses = responses; - return await sendRequestWithTimeout(await createTestActionContext(), { method: 'GET', url }, 2000, undefined); + return await sendRequestWithTimeout(await createTestActionContext(), { method: 'GET', url, allowInsecureConnection: true }, 2000, undefined); } suiteSetup(() => { @@ -34,7 +34,7 @@ suite('request', () => { if (testResponse.contentType) { headers["Content-Type"] = testResponse.contentType; } - response.writeHead(testResponse.status, headers); + response.writeHead(testResponse.statusCode, headers); response.end(testResponse.body); } }); @@ -52,101 +52,66 @@ suite('request', () => { }); test('200', async () => { - const response = await sendTestRequest({ status: 200 }); + const response = await sendTestRequest({ statusCode: 200 }); assert.strictEqual(response.parsedBody, undefined); }); test('200, text body, no content type', async () => { - const response = await sendTestRequest({ status: 200, body: 'Hello World!' }); + const response = await sendTestRequest({ statusCode: 200, body: 'Hello World!' }); assert.strictEqual(response.parsedBody, undefined); }); test('200, json body, no content type', async () => { - const response = await sendTestRequest({ status: 200, body: '{ "data": "Hello World!" }' }); + const response = await sendTestRequest({ statusCode: 200, body: '{ "data": "Hello World!" }' }); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access assert.strictEqual(response.parsedBody.data, 'Hello World!'); }); test('200, text body, text content type', async () => { - const response = await sendTestRequest({ status: 200, body: 'cant parse this', contentType: 'text/plain' }); + const response = await sendTestRequest({ statusCode: 200, body: 'cant parse this', contentType: 'text/plain' }); assert.strictEqual(response.parsedBody, undefined); }); test('200, text body, json content type', async () => { - await assertThrowsAsync(async () => await sendTestRequest({ status: 200, body: 'cant parse this', contentType: 'application/json' }), /SyntaxError.*json/i); + await assertThrowsAsync(async () => await sendTestRequest({ statusCode: 200, body: 'cant parse this', contentType: 'application/json' }), /SyntaxError.*json/i); }); test('200, json body, text content type', async () => { - const response = await sendTestRequest({ status: 200, body: '{ "data": "Hello World!" }', contentType: 'text/plain' }); + const response = await sendTestRequest({ statusCode: 200, body: '{ "data": "Hello World!" }', contentType: 'text/plain' }); assert.strictEqual(response.parsedBody, undefined); }); test('200, json body, json content type', async () => { - const response = await sendTestRequest({ status: 200, body: '{ "data": "Hello World!" }', contentType: 'application/json' }); + const response = await sendTestRequest({ statusCode: 200, body: '{ "data": "Hello World!" }', contentType: 'application/json' }); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access assert.strictEqual(response.parsedBody.data, 'Hello World!'); }); test('200, json body, no content type, with bom', async () => { - const response = await sendTestRequest({ status: 200, body: `\ufeff{ "data": "Hello World!" }` }); + const response = await sendTestRequest({ statusCode: 200, body: `\ufeff{ "data": "Hello World!" }` }); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access assert.strictEqual(response.parsedBody.data, 'Hello World!'); }); test('200, json body, json content type, with bom', async () => { - const response = await sendTestRequest({ status: 200, body: `\ufeff{ "data": "Hello World!" }`, contentType: 'application/json' }); + const response = await sendTestRequest({ statusCode: 200, body: `\ufeff{ "data": "Hello World!" }`, contentType: 'application/json' }); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access assert.strictEqual(response.parsedBody.data, 'Hello World!'); }); test('400', async () => { - await assertThrowsAsync(async () => await sendTestRequest({ status: 400 }), /400/); + await assertThrowsAsync(async () => await sendTestRequest({ statusCode: 400 }), /400/); }); test('400 with error message', async () => { - await assertThrowsAsync(async () => await sendTestRequest({ status: 400, body: 'oops' }), /oops/); + await assertThrowsAsync(async () => await sendTestRequest({ statusCode: 400, body: 'oops' }), /oops/); }); test('400 with json error message', async () => { - await assertThrowsAsync(async () => await sendTestRequest({ status: 400, body: '{ "message": "oops" }' }), (err: Error) => err.message.includes('oops') && !err.message.includes('message')); + await assertThrowsAsync(async () => await sendTestRequest({ statusCode: 400, body: '{ "message": "oops" }' }), (err: Error) => err.message.includes('oops') && !err.message.includes('message')); }); test('ECONNRESET', async () => { await assertThrowsAsync(async () => await sendTestRequest(res => res.destroy()), /socket hang up/i); }); - - test('operationSpec with unexpected error', async () => { - testResponses = [{ status: 404, body: 'oops' }]; - - const request = new WebResource(url); - request.operationSpec = { httpMethod: "GET", responses: { 200: {}, default: {} }, serializer: new Serializer() }; - const client = await createGenericClient(await createTestActionContext(), undefined); - await assertThrowsAsync(async () => await client.sendRequest(request), /oops/); - }); - - test('operationSpec with expected error', async () => { - testResponses = [{ status: 404, body: 'oops' }]; - - const request = new WebResource(url); - request.operationSpec = { httpMethod: "GET", responses: { 200: {}, 404: {}, default: {} }, serializer: new Serializer() }; - const client = await createGenericClient(await createTestActionContext(), undefined); - const response = await client.sendRequest(request); - assert.strictEqual(response.parsedBody, undefined); - }); - - test('Basic credentials are masked in error message', async () => { - const password: string = 'notActuallyCredentials'; - testResponses = [{ status: 404, body: password }]; - - const client = await createGenericClient(await createTestActionContext(), new BasicAuthenticationCredentials('userName', password)); - await assertThrowsAsync(async () => await client.sendRequest({ method: 'GET', url }), (err: Error) => err.message === '---'); - }); - - test('Token credentials are masked in error message', async () => { - const token: string = 'notActuallyCredentials'; - testResponses = [{ status: 404, body: token }]; - - const client = await createGenericClient(await createTestActionContext(), new TokenCredentials(token)); - await assertThrowsAsync(async () => await client.sendRequest({ method: 'GET', url }), (err: Error) => err.message === '---'); - }); }); diff --git a/dev/package-lock.json b/dev/package-lock.json index 5d51ae4395..27ab51eb88 100644 --- a/dev/package-lock.json +++ b/dev/package-lock.json @@ -1,12 +1,12 @@ { "name": "@microsoft/vscode-azext-dev", - "version": "0.2.0", + "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@microsoft/vscode-azext-dev", - "version": "0.2.0", + "version": "1.0.0", "license": "MIT", "dependencies": { "@azure/arm-subscriptions": "^2.0.0", diff --git a/dev/package.json b/dev/package.json index f92b0f519a..aebf7e2f45 100644 --- a/dev/package.json +++ b/dev/package.json @@ -1,7 +1,7 @@ { "name": "@microsoft/vscode-azext-dev", "author": "Microsoft Corporation", - "version": "0.2.0", + "version": "1.0.0", "description": "Common dev dependency tools for developing Azure extensions for VS Code", "tags": [ "azure", diff --git a/dev/src/webpack/getDefaultWebpackConfig.ts b/dev/src/webpack/getDefaultWebpackConfig.ts index 42b58c8ec4..ad10892e3b 100644 --- a/dev/src/webpack/getDefaultWebpackConfig.ts +++ b/dev/src/webpack/getDefaultWebpackConfig.ts @@ -194,8 +194,6 @@ export function getDefaultWebpackConfig(options: DefaultWebpackOptions): webpack // Webpack 5 no longer polyfills Node.js core modules automatically. // see // for the list of Node.js core module polyfills. - "net": require.resolve("net-browserify"), - "crypto": require.resolve("crypto-browserify"), "path": require.resolve("path-browserify"), "os": require.resolve("os-browserify/browser"), "url": require.resolve("url/"), @@ -211,6 +209,10 @@ export function getDefaultWebpackConfig(options: DefaultWebpackOptions): webpack "async_hooks": false, "child_process": false, "fs": false, + 'html-to-text': false, + // there are browserify versions of these, but they cause more problems than they solve + 'net': false, + 'crypto': false, //caller-supplied fallbacks ...(options.resolveFallbackAliases || []) } : undefined, diff --git a/utils/index.d.ts b/utils/index.d.ts index cf2e3ffdaa..0a08b0b126 100644 --- a/utils/index.d.ts +++ b/utils/index.d.ts @@ -6,10 +6,10 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import type { Environment } from '@azure/ms-rest-azure-env'; -import { AuthenticationSession, CancellationToken, CancellationTokenSource, Disposable, Event, ExtensionContext, FileChangeEvent, FileChangeType, FileStat, FileSystemProvider, FileType, InputBoxOptions, LogOutputChannel, MarkdownString, MessageItem, MessageOptions, OpenDialogOptions, OutputChannel, Progress, ProviderResult, QuickPickItem, QuickPickOptions as VSCodeQuickPickOptions, TextDocumentShowOptions, ThemeIcon, TreeDataProvider, TreeItem, TreeItemCollapsibleState, TreeView, Uri } from 'vscode'; +import type { AzExtResourceType, AzureResource, AzureSubscription } from '@microsoft/vscode-azureresources-api'; +import { AuthenticationSession, CancellationToken, CancellationTokenSource, Disposable, Event, ExtensionContext, FileChangeEvent, FileChangeType, FileStat, FileSystemProvider, FileType, InputBoxOptions, LogOutputChannel, MarkdownString, MessageItem, MessageOptions, OpenDialogOptions, OutputChannel, Progress, ProviderResult, QuickPickItem, TextDocumentShowOptions, ThemeIcon, TreeDataProvider, TreeItem, TreeItemCollapsibleState, TreeView, Uri, QuickPickOptions as VSCodeQuickPickOptions } from 'vscode'; import { TargetPopulation } from 'vscode-tas-client'; import type { Activity, ActivityTreeItemOptions, AppResource, OnErrorActivityData, OnProgressActivityData, OnStartActivityData, OnSuccessActivityData } from './hostapi'; // This must remain `import type` or else a circular reference will result -import type { AzureSubscription, AzureResource, AzExtResourceType } from '@microsoft/vscode-azureresources-api'; export declare interface RunWithTemporaryDescriptionOptions { description: string; @@ -148,12 +148,13 @@ export interface ITreeItemPickerContext extends IActionContext { } /** - * Loose type to use for T1 and T2 versions of "@azure/ms-rest-js". The Azure Account extension returns + * Loose type to use for T2 versions of Azure credentials. The Azure Account extension returns * credentials that will satisfy both T1 and T2 requirements */ export type AzExtServiceClientCredentials = AzExtServiceClientCredentialsT1 & AzExtServiceClientCredentialsT2; /** + * TODO: Remove from both utils and dev package index.d.ts. Can't do that right now because dev package still has T1 dependencies. * Loose interface to allow for the use of different versions of "@azure/ms-rest-js" * There's several cases where we don't control which "credentials" interface gets used, causing build errors even though the functionality itself seems to be compatible * For example: https://github.com/Azure/azure-sdk-for-js/issues/10045 diff --git a/utils/package-lock.json b/utils/package-lock.json index 15b558071b..16aef5fd78 100644 --- a/utils/package-lock.json +++ b/utils/package-lock.json @@ -1,12 +1,12 @@ { "name": "@microsoft/vscode-azext-utils", - "version": "0.5.2", + "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@microsoft/vscode-azext-utils", - "version": "0.5.2", + "version": "1.0.0", "license": "MIT", "dependencies": { "@microsoft/vscode-azureresources-api": "^2.0.2", @@ -14,10 +14,11 @@ "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" }, "devDependencies": { "@azure/ms-rest-azure-env": "^2.0.0", @@ -27,6 +28,7 @@ "@types/mocha": "^7.0.2", "@types/node": "^16.0.0", "@types/semver": "^7.3.9", + "@types/uuid": "^9.0.1", "@types/vscode": "1.76.0", "@typescript-eslint/eslint-plugin": "^5.53.0", "@vscode/test-electron": "^2.1.5", @@ -121,6 +123,15 @@ "xml2js": "^0.4.19" } }, + "node_modules/@azure/ms-rest-js/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@azure/ms-rest-nodeauth": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/@azure/ms-rest-nodeauth/-/ms-rest-nodeauth-3.1.1.tgz", @@ -1171,6 +1182,12 @@ "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", "dev": true }, + "node_modules/@types/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA==", + "dev": true + }, "node_modules/@types/vscode": { "version": "1.76.0", "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.76.0.tgz", @@ -2723,9 +2740,9 @@ } }, "node_modules/dayjs": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.2.tgz", - "integrity": "sha512-F4LXf1OeU9hrSYRPTTj/6FbO4HTjPKXvEIC1P2kcnFurViINCVk3ZV0xAS3XVx9MkMsXbbqlK6hjseaYbgKEHw==" + "version": "1.11.7", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.7.tgz", + "integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==" }, "node_modules/debug": { "version": "4.3.3", @@ -2763,21 +2780,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.0", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.0.tgz", + "integrity": "sha512-z2wJZXrmeHdvYJp/Ux55wIjqo81G5Bp4c+oELTW+7ar6SogWHajt5a9gO3s3IDaGSAXjDk0vlQKN3rms8ab3og==", "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", @@ -4521,9 +4530,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", @@ -4830,20 +4839,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", @@ -5084,17 +5079,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", @@ -5779,9 +5763,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", @@ -6037,22 +6021,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", @@ -7233,6 +7201,18 @@ "randombytes": "^2.1.0" } }, + "node_modules/terser/node_modules/acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -7613,10 +7593,9 @@ } }, "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, + "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" } @@ -7646,6 +7625,11 @@ "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", @@ -8128,6 +8112,14 @@ "tunnel": "0.0.6", "uuid": "^8.3.2", "xml2js": "^0.4.19" + }, + "dependencies": { + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true + } } }, "@azure/ms-rest-nodeauth": { @@ -8978,6 +8970,12 @@ "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", "dev": true }, + "@types/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA==", + "dev": true + }, "@types/vscode": { "version": "1.76.0", "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.76.0.tgz", @@ -10178,9 +10176,9 @@ "dev": true }, "dayjs": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.2.tgz", - "integrity": "sha512-F4LXf1OeU9hrSYRPTTj/6FbO4HTjPKXvEIC1P2kcnFurViINCVk3ZV0xAS3XVx9MkMsXbbqlK6hjseaYbgKEHw==" + "version": "1.11.7", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.7.tgz", + "integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==" }, "debug": { "version": "4.3.3", @@ -10204,14 +10202,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.0", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.0.tgz", + "integrity": "sha512-z2wJZXrmeHdvYJp/Ux55wIjqo81G5Bp4c+oELTW+7ar6SogWHajt5a9gO3s3IDaGSAXjDk0vlQKN3rms8ab3og==" }, "define-properties": { "version": "1.2.0", @@ -11574,9 +11567,9 @@ } }, "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", @@ -11798,11 +11791,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", @@ -11959,14 +11947,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", @@ -12501,9 +12481,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", @@ -12689,16 +12669,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", @@ -13547,6 +13517,14 @@ "acorn": "^8.5.0", "commander": "^2.20.0", "source-map-support": "~0.5.20" + }, + "dependencies": { + "acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "dev": true + } } }, "terser-webpack-plugin": { @@ -13887,10 +13865,9 @@ "dev": true }, "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" }, "vary": { "version": "1.1.2", @@ -13911,6 +13888,11 @@ "tas-client": "0.1.45" } }, + "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/utils/package.json b/utils/package.json index e716e0ce0d..f2621b94cd 100644 --- a/utils/package.json +++ b/utils/package.json @@ -1,7 +1,7 @@ { "name": "@microsoft/vscode-azext-utils", "author": "Microsoft Corporation", - "version": "0.5.2", + "version": "1.0.0", "description": "Common UI tools for developing Azure extensions for VS Code", "tags": [ "azure", @@ -37,10 +37,11 @@ "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" }, "devDependencies": { "@azure/ms-rest-azure-env": "^2.0.0", @@ -50,6 +51,7 @@ "@types/mocha": "^7.0.2", "@types/node": "^16.0.0", "@types/semver": "^7.3.9", + "@types/uuid": "^9.0.1", "@types/vscode": "1.76.0", "@typescript-eslint/eslint-plugin": "^5.53.0", "@vscode/test-electron": "^2.1.5", diff --git a/utils/src/activityLog/Activity.ts b/utils/src/activityLog/Activity.ts index 0711445478..2b913eceee 100644 --- a/utils/src/activityLog/Activity.ts +++ b/utils/src/activityLog/Activity.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { randomUUID } from "crypto"; +import { v4 as uuidv4 } from "uuid"; import { CancellationTokenSource, EventEmitter } from "vscode"; -import * as types from '../../index'; import * as hTypes from '../../hostapi'; +import * as types from '../../index'; import { parseError } from "../parseError"; export enum ActivityStatus { @@ -40,7 +40,7 @@ export abstract class ActivityBase implements hTypes.Activity { abstract errorState(error?: types.IParsedError): hTypes.ActivityTreeItemOptions; public constructor(task: types.ActivityTask) { - this.id = randomUUID(); + this.id = uuidv4(); this.task = task; this.onStart = this._onStartEmitter.event; diff --git a/utils/src/utils/nonNull.ts b/utils/src/utils/nonNull.ts index 256c8330d9..9604eebd82 100644 --- a/utils/src/utils/nonNull.ts +++ b/utils/src/utils/nonNull.ts @@ -3,8 +3,6 @@ * Licensed under the MIT License. See License.md in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isNullOrUndefined } from 'util'; - /** * Retrieves a property by name from an object and checks that it's not null and not undefined. It is strongly typed * for the property and will give a compile error if the given name is not a property of the source. @@ -48,3 +46,7 @@ export function nonNullOrEmptyValue(value: string | undefined, propertyNameOrMes export function nonNullValueAndProp(source: TSource | undefined, name: TKey): NonNullable { return nonNullProp(nonNullValue(source, name), name); } + +function isNullOrUndefined(value: unknown): value is null | undefined { + return value === null || value === undefined; +} diff --git a/utils/src/utils/openUrl.ts b/utils/src/utils/openUrl.ts index ddc7381ab2..94355295e0 100644 --- a/utils/src/utils/openUrl.ts +++ b/utils/src/utils/openUrl.ts @@ -3,11 +3,14 @@ * Licensed under the MIT License. See License.md in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import open = require("open"); +import { Uri, env } from 'vscode'; -export async function openUrl(url: string): Promise { - // Using this functionality is blocked by https://github.com/Microsoft/vscode/issues/85930 - // await vscode.commands.executeCommand('vscode.open', vscode.Uri.parse(url)); +export async function openUrl(url: string | Uri): Promise { + // Workaround according to https://github.com/Microsoft/vscode/issues/85930 + // When a string is passed to openExternal, it is not encoded by VS Code which seems + // to be what is causing issues with some URLs. + // https://github.com/microsoft/vscode/blob/2edb004e8386b2a86b26e8f30ea6969f4f26ffa7/src/vs/editor/browser/services/openerService.ts#L223-L226 + // So if a URI is causing errors, try passing a string - await open(url); + await env.openExternal(url as unknown as Uri); } diff --git a/utils/test/AzExtFsExtra.test.ts b/utils/test/AzExtFsExtra.test.ts index aeb2b7f257..ca1db4dd32 100644 --- a/utils/test/AzExtFsExtra.test.ts +++ b/utils/test/AzExtFsExtra.test.ts @@ -11,7 +11,6 @@ import { AzExtFsExtra } from '../src/utils/AzExtFsExtra'; import { randomUtils } from '../src/utils/randomUtils'; import { assertThrowsAsync } from './assertThrowsAsync'; - suite('AzExtFsExtra', function (this: Mocha.Suite): void { let workspacePath: string; let testFolderPath: string;