diff --git a/src/commands.ts b/src/commands.ts index ad3d0f2..cefcf58 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -3,7 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CommandCallback, IActionContext, IParsedError, openUrl, parseError, registerCommandWithTreeNodeUnwrapping, registerErrorHandler, registerReportIssueCommand } from '@microsoft/vscode-azext-utils'; +import { type CommandCallback, type IActionContext, type IParsedError} from '@microsoft/vscode-azext-utils'; +import { openUrl, parseError, registerCommandWithTreeNodeUnwrapping, registerErrorHandler, registerReportIssueCommand } from '@microsoft/vscode-azext-utils'; import { instrumentOperation } from 'vscode-extension-telemetry-wrapper'; import { showError } from './utils'; import { createHubSetting } from './workflows/hubSetting/create/createHubSetting'; diff --git a/src/extension.ts b/src/extension.ts index 57dc81a..11d4d11 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -6,9 +6,10 @@ 'use strict'; import { registerAzureUtilsExtensionVariables } from '@microsoft/vscode-azext-azureutils'; -import { IActionContext, TreeElementStateManager, callWithTelemetryAndErrorHandling, createAzExtOutputChannel, createExperimentationService, registerUIExtensionVariables } from '@microsoft/vscode-azext-utils'; +import { type IActionContext} from '@microsoft/vscode-azext-utils'; +import { TreeElementStateManager, callWithTelemetryAndErrorHandling, createAzExtOutputChannel, createExperimentationService, registerUIExtensionVariables } from '@microsoft/vscode-azext-utils'; import { getAzureResourcesExtensionApi } from '@microsoft/vscode-azureresources-api'; -import * as vscode from 'vscode'; +import type * as vscode from 'vscode'; import { registerCommands } from './commands'; import { ext } from './extensionVariables'; import { ServicesDataProvider } from "./tree/ServicesDataProvider"; diff --git a/src/extensionVariables.ts b/src/extensionVariables.ts index 0fa7283..00e8bb4 100644 --- a/src/extensionVariables.ts +++ b/src/extensionVariables.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IAzExtOutputChannel, IExperimentationServiceAdapter, TreeElementStateManager } from "@microsoft/vscode-azext-utils"; -import { AzureResourcesExtensionApi } from "@microsoft/vscode-azureresources-api"; -import { ExtensionContext } from "vscode"; -import { ServicesDataProvider } from "./tree/ServicesDataProvider"; -import { HubSettingFileSystem } from "./workflows/hub/update/HubSettingFileSystem"; +import { type IAzExtOutputChannel, type IExperimentationServiceAdapter, type TreeElementStateManager } from "@microsoft/vscode-azext-utils"; +import { type AzureResourcesExtensionApi } from "@microsoft/vscode-azureresources-api"; +import { type ExtensionContext } from "vscode"; +import { type ServicesDataProvider } from "./tree/ServicesDataProvider"; +import { type HubSettingFileSystem } from "./workflows/hub/update/HubSettingFileSystem"; /** * Namespace for common variables used throughout the extension. They must be initialized in the activate() method of extension.ts diff --git a/src/tree/ServicesDataProvider.ts b/src/tree/ServicesDataProvider.ts index c0d5686..22c984d 100644 --- a/src/tree/ServicesDataProvider.ts +++ b/src/tree/ServicesDataProvider.ts @@ -1,5 +1,6 @@ -import { IActionContext, TreeElementBase, callWithTelemetryAndErrorHandling, nonNullProp } from "@microsoft/vscode-azext-utils"; -import { AzureResource, AzureResourceBranchDataProvider } from '@microsoft/vscode-azureresources-api'; +import { type IActionContext, type TreeElementBase} from "@microsoft/vscode-azext-utils"; +import { callWithTelemetryAndErrorHandling, nonNullProp } from "@microsoft/vscode-azext-utils"; +import { type AzureResource, type AzureResourceBranchDataProvider } from '@microsoft/vscode-azureresources-api'; import * as vscode from 'vscode'; import { ext } from "../../extension.bundle"; import { ServiceItem } from "./service/ServiceItem"; diff --git a/src/tree/hub/HubItem.ts b/src/tree/hub/HubItem.ts index e350f8e..7aa88fd 100644 --- a/src/tree/hub/HubItem.ts +++ b/src/tree/hub/HubItem.ts @@ -1,13 +1,16 @@ -import { AzureWizard, DeleteConfirmationStep, IActionContext, TreeElementBase, createContextValue, createGenericElement, createSubscriptionContext, nonNullValueAndProp } from "@microsoft/vscode-azext-utils"; -import { AzureSubscription, type ViewPropertiesModel } from '@microsoft/vscode-azureresources-api'; +import { type IActionContext, type TreeElementBase} from "@microsoft/vscode-azext-utils"; +import { AzureWizard, DeleteConfirmationStep, createContextValue, createGenericElement, createSubscriptionContext, nonNullValueAndProp } from "@microsoft/vscode-azext-utils"; +import { type AzureSubscription} from '@microsoft/vscode-azureresources-api'; +import { type ViewPropertiesModel } from '@microsoft/vscode-azureresources-api'; import * as vscode from 'vscode'; import { ThemeIcon } from "vscode"; import { ext } from "../../../extension.bundle"; import { createActivityContext, createPortalUrl, createWebPubSubHubsClient, localize } from '../../utils'; -import { IDeleteHubSettingContext } from "../../workflows/hubSetting/delete/IDeleteHubContext"; +import { type IDeleteHubSettingContext } from "../../workflows/hubSetting/delete/IDeleteHubContext"; import { DeleteServiceStep } from "../../workflows/service/delete/DeleteServiceStep"; -import { CreateWebPubSubHubModel, WebPubSubHubModel } from "../models"; -import { ServiceItem } from "../service/ServiceItem"; +import { type WebPubSubHubModel } from "../models"; +import { CreateWebPubSubHubModel } from "../models"; +import { type ServiceItem } from "../service/ServiceItem"; import { EventHandlersItem } from "./properties/EventHandlersItem"; import { EventListenersItem } from "./properties/EventListenersItem"; diff --git a/src/tree/hub/HubsItem.ts b/src/tree/hub/HubsItem.ts index 1621ad0..34fc207 100644 --- a/src/tree/hub/HubsItem.ts +++ b/src/tree/hub/HubsItem.ts @@ -1,11 +1,14 @@ import { uiUtils } from "@microsoft/vscode-azext-azureutils"; -import { IActionContext, TreeElementBase, callWithTelemetryAndErrorHandling, createContextValue, createSubscriptionContext } from "@microsoft/vscode-azext-utils"; -import { AzureSubscription, type ViewPropertiesModel } from '@microsoft/vscode-azureresources-api'; +import { type IActionContext, type TreeElementBase} from "@microsoft/vscode-azext-utils"; +import { callWithTelemetryAndErrorHandling, createContextValue, createSubscriptionContext } from "@microsoft/vscode-azext-utils"; +import { type AzureSubscription} from '@microsoft/vscode-azureresources-api'; +import { type ViewPropertiesModel } from '@microsoft/vscode-azureresources-api'; import * as vscode from 'vscode'; import { ThemeIcon } from "vscode"; import { createWebPubSubHubsAPIClient } from "../../utils"; -import { CreateWebPubSubHubModel, WebPubSubHubModel } from "../models"; -import { ServiceItem } from "../service/ServiceItem"; +import { type WebPubSubHubModel } from "../models"; +import { CreateWebPubSubHubModel } from "../models"; +import { type ServiceItem } from "../service/ServiceItem"; import { treeUtils } from "../treeUtils"; import { HubItem } from "./HubItem"; diff --git a/src/tree/hub/properties/EventHandlerItem.ts b/src/tree/hub/properties/EventHandlerItem.ts index 45e17ec..958f437 100644 --- a/src/tree/hub/properties/EventHandlerItem.ts +++ b/src/tree/hub/properties/EventHandlerItem.ts @@ -1,9 +1,10 @@ -import { EventHandler } from "@azure/arm-webpubsub"; -import { TreeElementBase, createContextValue } from "@microsoft/vscode-azext-utils"; -import { ViewPropertiesModel } from "@microsoft/vscode-azureresources-api"; +import { type EventHandler } from "@azure/arm-webpubsub"; +import { type TreeElementBase} from "@microsoft/vscode-azext-utils"; +import { createContextValue } from "@microsoft/vscode-azext-utils"; +import { type ViewPropertiesModel } from "@microsoft/vscode-azureresources-api"; import * as vscode from 'vscode'; import { MarkdownString, ThemeIcon } from "vscode"; -import { EventHandlersItem } from "./EventHandlersItem"; +import { type EventHandlersItem } from "./EventHandlersItem"; export class EventHandlerItem implements TreeElementBase { diff --git a/src/tree/hub/properties/EventHandlersItem.ts b/src/tree/hub/properties/EventHandlersItem.ts index ca26e7d..e5d893d 100644 --- a/src/tree/hub/properties/EventHandlersItem.ts +++ b/src/tree/hub/properties/EventHandlersItem.ts @@ -1,9 +1,10 @@ -import { EventHandler } from "@azure/arm-webpubsub"; -import { TreeElementBase, createContextValue } from "@microsoft/vscode-azext-utils"; -import { ViewPropertiesModel } from "@microsoft/vscode-azureresources-api"; +import { type EventHandler } from "@azure/arm-webpubsub"; +import { type TreeElementBase} from "@microsoft/vscode-azext-utils"; +import { createContextValue } from "@microsoft/vscode-azext-utils"; +import { type ViewPropertiesModel } from "@microsoft/vscode-azureresources-api"; import * as vscode from 'vscode'; import { ThemeIcon } from "vscode"; -import { HubItem } from "../HubItem"; +import { type HubItem } from "../HubItem"; import { EventHandlerItem } from "./EventHandlerItem"; diff --git a/src/tree/hub/properties/EventListenerItem.ts b/src/tree/hub/properties/EventListenerItem.ts index c1a537a..d83f42e 100644 --- a/src/tree/hub/properties/EventListenerItem.ts +++ b/src/tree/hub/properties/EventListenerItem.ts @@ -1,7 +1,8 @@ -import { EventListener } from "@azure/arm-webpubsub"; -import { TreeElementBase, createContextValue } from "@microsoft/vscode-azext-utils"; -import { ViewPropertiesModel } from "@microsoft/vscode-azureresources-api"; -import { HubsItem } from "src/tree/hub/HubsItem"; +import { type EventListener } from "@azure/arm-webpubsub"; +import { type TreeElementBase} from "@microsoft/vscode-azext-utils"; +import { createContextValue } from "@microsoft/vscode-azext-utils"; +import { type ViewPropertiesModel } from "@microsoft/vscode-azureresources-api"; +import { type HubsItem } from "src/tree/hub/HubsItem"; import * as vscode from 'vscode'; import { MarkdownString, ThemeIcon } from "vscode"; diff --git a/src/tree/hub/properties/EventListenersItem.ts b/src/tree/hub/properties/EventListenersItem.ts index 8438a8c..0f0a0d2 100644 --- a/src/tree/hub/properties/EventListenersItem.ts +++ b/src/tree/hub/properties/EventListenersItem.ts @@ -1,6 +1,7 @@ -import { EventListener } from "@azure/arm-webpubsub"; -import { TreeElementBase, createContextValue } from "@microsoft/vscode-azext-utils"; -import { ViewPropertiesModel } from "@microsoft/vscode-azureresources-api"; +import { type EventListener } from "@azure/arm-webpubsub"; +import { type TreeElementBase} from "@microsoft/vscode-azext-utils"; +import { createContextValue } from "@microsoft/vscode-azext-utils"; +import { type ViewPropertiesModel } from "@microsoft/vscode-azureresources-api"; import * as vscode from 'vscode'; import { ThemeIcon } from "vscode"; import { EventListenerItem } from "./EventListenerItem"; diff --git a/src/tree/models.ts b/src/tree/models.ts index 0f8cbbc..dd38949 100644 --- a/src/tree/models.ts +++ b/src/tree/models.ts @@ -1,4 +1,4 @@ -import { Resource, WebPubSubHub, WebPubSubResource } from "@azure/arm-webpubsub"; +import { type Resource, type WebPubSubHub, type WebPubSubResource } from "@azure/arm-webpubsub"; import { getResourceGroupFromId } from "@microsoft/vscode-azext-azureutils"; import { nonNullProp } from "@microsoft/vscode-azext-utils"; diff --git a/src/tree/pickitem/pickSubscription.ts b/src/tree/pickitem/pickSubscription.ts index 7834b00..b9d875b 100644 --- a/src/tree/pickitem/pickSubscription.ts +++ b/src/tree/pickitem/pickSubscription.ts @@ -3,8 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AzureWizard, QuickPickAzureSubscriptionStep, TreeElementBase, type IActionContext } from "@microsoft/vscode-azext-utils"; -import { AzureResourceBranchDataProvider, AzureSubscription } from "@microsoft/vscode-azureresources-api"; +import { type TreeElementBase} from "@microsoft/vscode-azext-utils"; +import { AzureWizard, QuickPickAzureSubscriptionStep, type IActionContext } from "@microsoft/vscode-azext-utils"; +import { type AzureResourceBranchDataProvider, type AzureSubscription } from "@microsoft/vscode-azureresources-api"; // Modified from function subscriptionExperience(context, tdp) diff --git a/src/tree/service/ServiceItem.ts b/src/tree/service/ServiceItem.ts index 4bede26..48b473a 100644 --- a/src/tree/service/ServiceItem.ts +++ b/src/tree/service/ServiceItem.ts @@ -1,11 +1,13 @@ -import { KnownServiceKind, WebPubSubResource } from "@azure/arm-webpubsub"; +import { type WebPubSubResource } from "@azure/arm-webpubsub"; +import { KnownServiceKind } from "@azure/arm-webpubsub"; import { getResourceGroupFromId, uiUtils } from "@microsoft/vscode-azext-azureutils"; -import { IActionContext, TreeElementBase, TreeItemIconPath, createContextValue, createSubscriptionContext } from "@microsoft/vscode-azext-utils"; -import { AzureResource, AzureSubscription, ViewPropertiesModel } from '@microsoft/vscode-azureresources-api'; +import { type IActionContext, type TreeElementBase, type TreeItemIconPath} from "@microsoft/vscode-azext-utils"; +import { createContextValue, createSubscriptionContext } from "@microsoft/vscode-azext-utils"; +import { type AzureResource, type AzureSubscription, type ViewPropertiesModel } from '@microsoft/vscode-azureresources-api'; import * as vscode from 'vscode'; import { createWebPubSubHubsAPIClient } from "../../utils"; import { HubsItem } from "../hub/HubsItem"; -import { WebPubSubModel } from "../models"; +import { type WebPubSubModel } from "../models"; import { treeUtils } from "../treeUtils"; import { ServicePropertiesItem } from "./ServicePropertiesItem"; diff --git a/src/tree/service/ServicePropertiesItem.ts b/src/tree/service/ServicePropertiesItem.ts index 28cda96..c7cc74b 100644 --- a/src/tree/service/ServicePropertiesItem.ts +++ b/src/tree/service/ServicePropertiesItem.ts @@ -1,10 +1,12 @@ -import { KnownWebPubSubSkuTier, ProvisioningState } from "@azure/arm-webpubsub"; -import { TreeElementBase, TreeItemIconPath, createContextValue, createGenericElement } from "@microsoft/vscode-azext-utils"; -import { ViewPropertiesModel } from "@microsoft/vscode-azureresources-api"; +import { type ProvisioningState } from "@azure/arm-webpubsub"; +import { KnownWebPubSubSkuTier } from "@azure/arm-webpubsub"; +import { type TreeElementBase, type TreeItemIconPath} from "@microsoft/vscode-azext-utils"; +import { createContextValue, createGenericElement } from "@microsoft/vscode-azext-utils"; +import { type ViewPropertiesModel } from "@microsoft/vscode-azureresources-api"; import * as vscode from 'vscode'; import { ThemeIcon } from "vscode"; import { localize } from "../../utils"; -import { WebPubSubModel } from "../models"; +import { type WebPubSubModel } from "../models"; export class ServicePropertiesItem implements TreeElementBase { diff --git a/src/tree/treeUtils.ts b/src/tree/treeUtils.ts index edd77b1..60e436b 100644 --- a/src/tree/treeUtils.ts +++ b/src/tree/treeUtils.ts @@ -1,4 +1,4 @@ -import { TreeElementBase, TreeItemIconPath } from "@microsoft/vscode-azext-utils"; +import { type TreeElementBase, type TreeItemIconPath } from "@microsoft/vscode-azext-utils"; import * as vscode from 'vscode'; import { ext } from "../../extension.bundle"; diff --git a/src/utils.ts b/src/utils.ts index 32ced43..9f256f8 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -5,14 +5,17 @@ // tslint:disable-next-line:no-require-imports no-implicit-dependencies import { WebPubSubManagementClient } from "@azure/arm-webpubsub"; -import { AzExtClientContext, OpenInPortalOptions, createAzureClient } from "@microsoft/vscode-azext-azureutils"; -import { ExecuteActivityContext, IActionContext, IGenericTreeItemOptions, TreeItemIconPath, createSubscriptionContext } from "@microsoft/vscode-azext-utils"; +import { type AzExtClientContext, type OpenInPortalOptions} from "@microsoft/vscode-azext-azureutils"; +import { createAzureClient } from "@microsoft/vscode-azext-azureutils"; +import { type ExecuteActivityContext, type IActionContext, type IGenericTreeItemOptions, type TreeItemIconPath} from "@microsoft/vscode-azext-utils"; +import { createSubscriptionContext } from "@microsoft/vscode-azext-utils"; import { type AzureResourcesExtensionApiWithActivity } from "@microsoft/vscode-azext-utils/activity"; -import { AzureSubscription } from "@microsoft/vscode-azureresources-api"; +import { type AzureSubscription } from "@microsoft/vscode-azureresources-api"; import * as fs from "fs"; import * as path from 'path'; import * as vscode from 'vscode'; -import { ConfigurationTarget, ExtensionContext, ProgressLocation, Uri, WorkspaceConfiguration, WorkspaceFolder, window, workspace } from 'vscode'; +import { type ExtensionContext, type WorkspaceConfiguration, type WorkspaceFolder} from 'vscode'; +import { ConfigurationTarget, ProgressLocation, Uri, window, workspace } from 'vscode'; import * as nls from 'vscode-nls'; import { settingsFile, vscodeFolder } from "./constants"; import { ext } from "./extensionVariables"; diff --git a/src/workflows/common/contexts.ts b/src/workflows/common/contexts.ts index 7844f45..7f5376e 100644 --- a/src/workflows/common/contexts.ts +++ b/src/workflows/common/contexts.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AggregationType } from "@azure/arm-monitor"; -import { EventHandler, KeyType } from "@azure/arm-webpubsub"; -import { ExecuteActivityContext, IActionContext, ISubscriptionContext } from "@microsoft/vscode-azext-utils"; +import { type AggregationType } from "@azure/arm-monitor"; +import { type EventHandler, type KeyType } from "@azure/arm-webpubsub"; +import { type ExecuteActivityContext, type IActionContext, type ISubscriptionContext } from "@microsoft/vscode-azext-utils"; export interface IPickServiceContext extends IActionContext, ExecuteActivityContext { diff --git a/src/workflows/common/getKeyTypeStep.ts b/src/workflows/common/getKeyTypeStep.ts index ea17a53..9c89113 100644 --- a/src/workflows/common/getKeyTypeStep.ts +++ b/src/workflows/common/getKeyTypeStep.ts @@ -1,7 +1,9 @@ -import { KeyType, KnownKeyType } from "@azure/arm-webpubsub"; -import { AzureWizardPromptStep, IAzureQuickPickItem } from "@microsoft/vscode-azext-utils"; +import { type KeyType} from "@azure/arm-webpubsub"; +import { KnownKeyType } from "@azure/arm-webpubsub"; +import { type IAzureQuickPickItem } from "@microsoft/vscode-azext-utils"; +import { AzureWizardPromptStep } from "@microsoft/vscode-azext-utils"; import { localize } from "../../utils"; -import { IPickKeyContext } from "./contexts"; +import { type IPickKeyContext } from "./contexts"; const keyTypePickItems: IAzureQuickPickItem[] = [ { label: "Primary", data: KnownKeyType.Primary }, diff --git a/src/workflows/hub/update/HubSettingFileSystem.ts b/src/workflows/hub/update/HubSettingFileSystem.ts index 273c73a..7134c76 100644 --- a/src/workflows/hub/update/HubSettingFileSystem.ts +++ b/src/workflows/hub/update/HubSettingFileSystem.ts @@ -1,11 +1,14 @@ -import { WebPubSubHubProperties, WebPubSubManagementClient } from "@azure/arm-webpubsub"; +import { type WebPubSubHubProperties} from "@azure/arm-webpubsub"; +import { WebPubSubManagementClient } from "@azure/arm-webpubsub"; import { createAzureClient } from "@microsoft/vscode-azext-azureutils"; import { ext } from "@microsoft/vscode-azext-github"; -import { AzExtTreeFileSystem, AzExtTreeFileSystemItem, IActionContext, createSubscriptionContext } from "@microsoft/vscode-azext-utils"; -import { AzureSubscription } from "@microsoft/vscode-azureresources-api"; +import { type AzExtTreeFileSystemItem, type IActionContext} from "@microsoft/vscode-azext-utils"; +import { AzExtTreeFileSystem, createSubscriptionContext } from "@microsoft/vscode-azext-utils"; +import { type AzureSubscription } from "@microsoft/vscode-azureresources-api"; import * as jsonc from 'jsonc-parser'; import * as os from "os"; -import { Diagnostic, DiagnosticSeverity, FileStat, FileType, MessageItem, Uri, commands, languages, window } from "vscode"; +import { type Diagnostic, type FileStat, type MessageItem, type Uri} from "vscode"; +import { DiagnosticSeverity, FileType, commands, languages, window } from "vscode"; import { localize } from "../../../utils"; const insertKeyHere: string = localize('insertTagName', ''); diff --git a/src/workflows/hubSetting/common/CreateOrUpdateHubSettingStep.ts b/src/workflows/hubSetting/common/CreateOrUpdateHubSettingStep.ts index 56b3186..e88fa72 100644 --- a/src/workflows/hubSetting/common/CreateOrUpdateHubSettingStep.ts +++ b/src/workflows/hubSetting/common/CreateOrUpdateHubSettingStep.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { WebPubSubManagementClient } from "@azure/arm-webpubsub"; +import { type WebPubSubManagementClient } from "@azure/arm-webpubsub"; import { AzureWizardExecuteStep } from "@microsoft/vscode-azext-utils"; -import { Progress } from "vscode"; +import { type Progress } from "vscode"; import { localize, nonNullProp } from "../../../utils"; -import { ICreateOrUpdateHubSettingContext } from "../create/ICreateEventHandlerContext"; +import { type ICreateOrUpdateHubSettingContext } from "../create/ICreateEventHandlerContext"; export class CreateOrUpdateHubSettingStep extends AzureWizardExecuteStep { public priority: number = 135; @@ -19,7 +19,7 @@ export class CreateOrUpdateHubSettingStep extends AzureWizardExecuteStep { @@ -104,7 +104,7 @@ export class InputUserEventsStep extends AzureNameStep { node = node ? node : await pickHubs(context); - let service: ServiceItem = node instanceof HubsItem ? node.service : node.hubs.service; + const service: ServiceItem = node instanceof HubsItem ? node.service : node.hubs.service; const subContext = createSubscriptionContext(service.subscription); const wizardContext: ICreateOrUpdateHubSettingContext = { diff --git a/src/workflows/hubSetting/delete/DeleteHubConfirmationStep.ts b/src/workflows/hubSetting/delete/DeleteHubConfirmationStep.ts index aa9af81..84695dd 100644 --- a/src/workflows/hubSetting/delete/DeleteHubConfirmationStep.ts +++ b/src/workflows/hubSetting/delete/DeleteHubConfirmationStep.ts @@ -5,7 +5,7 @@ import { AzureWizardPromptStep, DialogResponses, nonNullValue, UserCancelledError } from '@microsoft/vscode-azext-utils'; import { localize, settingUtils } from "../../../utils"; -import { IDeleteHubSettingContext } from './IDeleteHubContext'; +import { type IDeleteHubSettingContext } from './IDeleteHubContext'; export class DeleteHubConfirmationStep extends AzureWizardPromptStep { private hubName?: string; diff --git a/src/workflows/hubSetting/delete/DeleteHubStep.ts b/src/workflows/hubSetting/delete/DeleteHubStep.ts index 7c1e378..7387636 100644 --- a/src/workflows/hubSetting/delete/DeleteHubStep.ts +++ b/src/workflows/hubSetting/delete/DeleteHubStep.ts @@ -8,7 +8,7 @@ import { AzureWizardExecuteStep, parseError } from "@microsoft/vscode-azext-util import { type Progress } from "vscode"; import { ext } from "../../../extensionVariables"; import { createWebPubSubHubsAPIClient, localize } from '../../../utils'; -import { IDeleteHubSettingContext } from "./IDeleteHubContext"; +import { type IDeleteHubSettingContext } from "./IDeleteHubContext"; export class DeleteHubSettingStep extends AzureWizardExecuteStep { public priority: number = 110; diff --git a/src/workflows/hubSetting/delete/IDeleteHubContext.ts b/src/workflows/hubSetting/delete/IDeleteHubContext.ts index f8a0bb1..e5286e6 100644 --- a/src/workflows/hubSetting/delete/IDeleteHubContext.ts +++ b/src/workflows/hubSetting/delete/IDeleteHubContext.ts @@ -4,6 +4,6 @@ *--------------------------------------------------------------------------------------------*/ -import { IPickHubSettingContext } from "src/workflows/common/contexts"; +import { type IPickHubSettingContext } from "src/workflows/common/contexts"; -export interface IDeleteHubSettingContext extends IPickHubSettingContext { } +export type IDeleteHubSettingContext = IPickHubSettingContext diff --git a/src/workflows/hubSetting/delete/deleteHubSetting.ts b/src/workflows/hubSetting/delete/deleteHubSetting.ts index e34f212..5ff8196 100644 --- a/src/workflows/hubSetting/delete/deleteHubSetting.ts +++ b/src/workflows/hubSetting/delete/deleteHubSetting.ts @@ -5,13 +5,13 @@ import { AzureWizard, createSubscriptionContext, type IActionContext } from "@microsoft/vscode-azext-utils"; import { ext } from "../../../extensionVariables"; -import { HubItem } from "../../../tree/hub/HubItem"; +import { type HubItem } from "../../../tree/hub/HubItem"; import { pickHub } from "../../../tree/pickitem/pickHub"; import * as utils from "../../../utils"; import { createActivityContext, localize } from "../../../utils"; import { DeleteHubConfirmationStep } from "./DeleteHubConfirmationStep"; import { DeleteHubSettingStep } from "./DeleteHubStep"; -import { IDeleteHubSettingContext } from "./IDeleteHubContext"; +import { type IDeleteHubSettingContext } from "./IDeleteHubContext"; export async function deleteHubSetting(context: IActionContext, node?: HubItem): Promise { diff --git a/src/workflows/hubSetting/eventHandler/create/CreateEventHandlerStep.ts b/src/workflows/hubSetting/eventHandler/create/CreateEventHandlerStep.ts index a0d0404..3054e1a 100644 --- a/src/workflows/hubSetting/eventHandler/create/CreateEventHandlerStep.ts +++ b/src/workflows/hubSetting/eventHandler/create/CreateEventHandlerStep.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { WebPubSubManagementClient } from "@azure/arm-webpubsub"; +import { type WebPubSubManagementClient } from "@azure/arm-webpubsub"; import { AzureWizardExecuteStep } from "@microsoft/vscode-azext-utils"; -import { Progress } from "vscode"; +import { type Progress } from "vscode"; import { localize, nonNullProp } from "../../../../utils"; -import { ICreateEventHandlerContext } from "./ICreateEventHandlerContext"; +import { type ICreateEventHandlerContext } from "./ICreateEventHandlerContext"; export class CreateEventHandlerStep extends AzureWizardExecuteStep { public priority: number = 135; @@ -19,7 +19,7 @@ export class CreateEventHandlerStep extends AzureWizardExecuteStep): Promise { const message: string = localize('creatingEventHandler', `Creating Event Handler in Hub ${context.hubName}`); progress.report({ message }); - var hubProperties = context.hubProperties; + const hubProperties = context.hubProperties; if (!hubProperties.eventHandlers) hubProperties.eventHandlers = []; hubProperties.eventHandlers.push(context.eventHandler); diff --git a/src/workflows/hubSetting/eventHandler/create/ICreateEventHandlerContext.ts b/src/workflows/hubSetting/eventHandler/create/ICreateEventHandlerContext.ts index 8b15b85..b1aa1d5 100644 --- a/src/workflows/hubSetting/eventHandler/create/ICreateEventHandlerContext.ts +++ b/src/workflows/hubSetting/eventHandler/create/ICreateEventHandlerContext.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { EventHandler, WebPubSubHubProperties } from "@azure/arm-webpubsub"; -import { IPickHubSettingContext } from "src/workflows/common/contexts"; +import { type EventHandler, type WebPubSubHubProperties } from "@azure/arm-webpubsub"; +import { type IPickHubSettingContext } from "src/workflows/common/contexts"; export interface ICreateEventHandlerContext extends IPickHubSettingContext { eventHandler: EventHandler; diff --git a/src/workflows/hubSetting/eventHandler/create/createEventHandler.ts b/src/workflows/hubSetting/eventHandler/create/createEventHandler.ts index 9897a3d..fc29848 100644 --- a/src/workflows/hubSetting/eventHandler/create/createEventHandler.ts +++ b/src/workflows/hubSetting/eventHandler/create/createEventHandler.ts @@ -5,17 +5,18 @@ import { WebPubSubManagementClient } from "@azure/arm-webpubsub"; import { createAzureClient } from "@microsoft/vscode-azext-azureutils"; -import { AzureWizard, IActionContext, createSubscriptionContext } from "@microsoft/vscode-azext-utils"; +import { type IActionContext} from "@microsoft/vscode-azext-utils"; +import { AzureWizard, createSubscriptionContext } from "@microsoft/vscode-azext-utils"; import { ext } from "../../../../extensionVariables"; import { HubItem } from "../../../../tree/hub/HubItem"; import { EventHandlersItem } from "../../../../tree/hub/properties/EventHandlersItem"; import { pickHub } from "../../../../tree/pickitem/pickHub"; -import { ServiceItem } from "../../../../tree/service/ServiceItem"; +import { type ServiceItem } from "../../../../tree/service/ServiceItem"; import * as utils from "../../../../utils"; import { createActivityContext, localize } from "../../../../utils"; import { InputUrlTemplateStep, InputUserEventsStep, SelectSystemEventsStep } from "../../create/InputHubSettingStep"; import { CreateEventHandlerStep } from "./CreateEventHandlerStep"; -import { ICreateEventHandlerContext } from "./ICreateEventHandlerContext"; +import { type ICreateEventHandlerContext } from "./ICreateEventHandlerContext"; export async function createEventHandler(context: IActionContext, node?: HubItem | EventHandlersItem): Promise { let serivce: ServiceItem, hub: HubItem; diff --git a/src/workflows/hubSetting/eventHandler/delete/DeleteEventHandlerStep.ts b/src/workflows/hubSetting/eventHandler/delete/DeleteEventHandlerStep.ts index 10fe4df..756307b 100644 --- a/src/workflows/hubSetting/eventHandler/delete/DeleteEventHandlerStep.ts +++ b/src/workflows/hubSetting/eventHandler/delete/DeleteEventHandlerStep.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { WebPubSubManagementClient } from "@azure/arm-webpubsub"; +import { type WebPubSubManagementClient } from "@azure/arm-webpubsub"; import { AzureWizardExecuteStep } from "@microsoft/vscode-azext-utils"; -import { Progress } from "vscode"; +import { type Progress } from "vscode"; import { localize, nonNullProp } from "../../../../utils"; -import { IDeleteEventHandlerContext } from "./IDeleteEventHandlerContext"; +import { type IDeleteEventHandlerContext } from "./IDeleteEventHandlerContext"; export class DeleteEventHandlerStep extends AzureWizardExecuteStep { public priority: number = 135; @@ -20,7 +20,7 @@ export class DeleteEventHandlerStep extends AzureWizardExecuteStep { const eventHandler: EventHandlerItem = node ? node : await pickEventHandler(context); diff --git a/src/workflows/hubSetting/localTunnel/startLocalTunnel.ts b/src/workflows/hubSetting/localTunnel/startLocalTunnel.ts index 3a71239..f87eedd 100644 --- a/src/workflows/hubSetting/localTunnel/startLocalTunnel.ts +++ b/src/workflows/hubSetting/localTunnel/startLocalTunnel.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IActionContext } from "@microsoft/vscode-azext-utils"; +import { type IActionContext } from "@microsoft/vscode-azext-utils"; import * as vscode from "vscode"; import { localTunnelPackageName, localTunnelTerminalName } from "../../../constants"; -import { HubItem } from "../../../tree/hub/HubItem"; +import { type HubItem } from "../../../tree/hub/HubItem"; import { pickHub } from "../../../tree/pickitem/pickHub"; import { createEndpointFromHostName, localize } from "../../../utils"; diff --git a/src/workflows/hubSetting/update/updateHubSetting.ts b/src/workflows/hubSetting/update/updateHubSetting.ts index 2ebc0dd..ea77683 100644 --- a/src/workflows/hubSetting/update/updateHubSetting.ts +++ b/src/workflows/hubSetting/update/updateHubSetting.ts @@ -8,12 +8,12 @@ import { WebPubSubManagementClient } from "@azure/arm-webpubsub"; import { createAzureClient } from "@microsoft/vscode-azext-azureutils"; import { AzureWizard, createSubscriptionContext, type IActionContext } from "@microsoft/vscode-azext-utils"; import { ext } from "../../../extensionVariables"; -import { HubItem } from "../../../tree/hub/HubItem"; +import { type HubItem } from "../../../tree/hub/HubItem"; import { pickHub } from "../../../tree/pickitem/pickHub"; import * as utils from "../../../utils"; import { createActivityContext, localize } from "../../../utils"; import { CreateOrUpdateHubSettingStep } from "../common/CreateOrUpdateHubSettingStep"; -import { ICreateOrUpdateHubSettingContext } from "../create/ICreateEventHandlerContext"; +import { type ICreateOrUpdateHubSettingContext } from "../create/ICreateEventHandlerContext"; export async function updateHubSetting(context: IActionContext, node?: HubItem): Promise { const { service, hub: webPubSubHub } = node ?? await pickHub(context, { diff --git a/src/workflows/service/checkHealth/CheckHealthStep.ts b/src/workflows/service/checkHealth/CheckHealthStep.ts index e3047a9..c858c21 100644 --- a/src/workflows/service/checkHealth/CheckHealthStep.ts +++ b/src/workflows/service/checkHealth/CheckHealthStep.ts @@ -9,7 +9,7 @@ import * as vscode from 'vscode'; import { type Progress } from "vscode"; import { ext } from "../../../extensionVariables"; import { localize } from "../../../utils"; -import { ICheckHealthContext } from "./ICheckHealthContext"; +import { type ICheckHealthContext } from "./ICheckHealthContext"; export class CheckHealthStep extends AzureWizardExecuteStep { public priority: number = 110; @@ -43,7 +43,7 @@ export class CheckHealthStep extends AzureWizardExecuteStep 'checkHealthError', `Failed to check health of "${context.webPubSubName}", resource group "${context.resourceGroupName}"`) ); - }; + } return true; } } diff --git a/src/workflows/service/checkHealth/ICheckHealthContext.ts b/src/workflows/service/checkHealth/ICheckHealthContext.ts index 9976af1..8b6d458 100644 --- a/src/workflows/service/checkHealth/ICheckHealthContext.ts +++ b/src/workflows/service/checkHealth/ICheckHealthContext.ts @@ -1,4 +1,4 @@ -import { IPickServiceContext } from "src/workflows/common/contexts"; +import { type IPickServiceContext } from "src/workflows/common/contexts"; export interface ICheckHealthContext extends IPickServiceContext { endpoint?: string; diff --git a/src/workflows/service/checkHealth/checkHealth.ts b/src/workflows/service/checkHealth/checkHealth.ts index 6f6a1d1..4240d02 100644 --- a/src/workflows/service/checkHealth/checkHealth.ts +++ b/src/workflows/service/checkHealth/checkHealth.ts @@ -6,11 +6,11 @@ import { AzureWizard, createSubscriptionContext, type IActionContext } from "@microsoft/vscode-azext-utils"; import { ext } from "../../../extensionVariables"; import { pickService } from "../../../tree/pickitem/pickService"; -import { ServiceItem } from "../../../tree/service/ServiceItem"; +import { type ServiceItem } from "../../../tree/service/ServiceItem"; import * as utils from "../../../utils"; import { createActivityContext, createEndpointFromHostName, localize } from "../../../utils"; import { CheckHealthStep } from "./CheckHealthStep"; -import { ICheckHealthContext } from "./ICheckHealthContext"; +import { type ICheckHealthContext } from "./ICheckHealthContext"; export async function checkServiceHealth(context: IActionContext, node?: ServiceItem): Promise { const { subscription, webPubSub } = node ?? await pickService(context, { diff --git a/src/workflows/service/copyConnectionString/CopyConnectionStringStep.ts b/src/workflows/service/copyConnectionString/CopyConnectionStringStep.ts index 66d404d..02ffced 100644 --- a/src/workflows/service/copyConnectionString/CopyConnectionStringStep.ts +++ b/src/workflows/service/copyConnectionString/CopyConnectionStringStep.ts @@ -5,7 +5,7 @@ import { KnownKeyType } from "@azure/arm-webpubsub"; import { AzureWizardExecuteStep, parseError } from "@microsoft/vscode-azext-utils"; -import { IPickKeyContext } from "src/workflows/common/contexts"; +import { type IPickKeyContext } from "src/workflows/common/contexts"; import * as vscode from 'vscode'; import { env, type Progress } from "vscode"; import { ext } from "../../../extensionVariables"; @@ -24,7 +24,7 @@ export class CopyConnectionStringStep extends AzureWizardExecuteStep { public priority: number = 110; @@ -24,7 +24,7 @@ export class CopyEndpointStep extends AzureWizardExecuteStep { const { subscription, webPubSub } = node ?? await pickService(context, { diff --git a/src/workflows/service/create/CreateServiceStep.ts b/src/workflows/service/create/CreateServiceStep.ts index 446e48c..63111cf 100644 --- a/src/workflows/service/create/CreateServiceStep.ts +++ b/src/workflows/service/create/CreateServiceStep.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { WebPubSubManagementClient } from "@azure/arm-webpubsub"; +import { type WebPubSubManagementClient } from "@azure/arm-webpubsub"; import { AzureWizardExecuteStep } from "@microsoft/vscode-azext-utils"; -import { Progress } from "vscode"; +import { type Progress } from "vscode"; import { localize, nonNullProp } from "../../../utils"; -import { ICreateServiceContext } from "./ICreateServiceContext"; +import { type ICreateServiceContext } from "./ICreateServiceContext"; export class CreateServiceStep extends AzureWizardExecuteStep { public priority: number = 135; diff --git a/src/workflows/service/create/ICreateServiceContext.ts b/src/workflows/service/create/ICreateServiceContext.ts index 37fc29d..1eecbc4 100644 --- a/src/workflows/service/create/ICreateServiceContext.ts +++ b/src/workflows/service/create/ICreateServiceContext.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Sku } from "@azure/arm-webpubsub"; -import { IResourceGroupWizardContext } from '@microsoft/vscode-azext-azureutils'; -import { ExecuteActivityContext } from "@microsoft/vscode-azext-utils"; +import { type Sku } from "@azure/arm-webpubsub"; +import { type IResourceGroupWizardContext } from '@microsoft/vscode-azext-azureutils'; +import { type ExecuteActivityContext } from "@microsoft/vscode-azext-utils"; export interface ICreateServiceContext extends IResourceGroupWizardContext, ExecuteActivityContext { webPubSubName?: string; diff --git a/src/workflows/service/create/InputSerivceSkuUnitCountStep.ts b/src/workflows/service/create/InputSerivceSkuUnitCountStep.ts index 4ea0854..5eb9b3d 100644 --- a/src/workflows/service/create/InputSerivceSkuUnitCountStep.ts +++ b/src/workflows/service/create/InputSerivceSkuUnitCountStep.ts @@ -1,8 +1,9 @@ import { KnownWebPubSubSkuTier } from "@azure/arm-webpubsub"; -import { AzureWizardPromptStep, IAzureQuickPickItem } from "@microsoft/vscode-azext-utils"; +import { type IAzureQuickPickItem } from "@microsoft/vscode-azext-utils"; +import { AzureWizardPromptStep } from "@microsoft/vscode-azext-utils"; import { tierToUnitCountList } from "../../../constants"; import { localize } from "../../../utils"; -import { ICreateServiceContext } from "./ICreateServiceContext"; +import { type ICreateServiceContext } from "./ICreateServiceContext"; export class InputSerivceSkuUnitCountStep extends AzureWizardPromptStep { public async prompt(context: ICreateServiceContext): Promise { @@ -10,7 +11,7 @@ export class InputSerivceSkuUnitCountStep extends AzureWizardPromptStep[] = []; + const picks: IAzureQuickPickItem[] = []; const tier: string | undefined = context.Sku.sku.tier switch (tier) { case KnownWebPubSubSkuTier.Free: diff --git a/src/workflows/service/create/InputServiceKindStep.ts b/src/workflows/service/create/InputServiceKindStep.ts index 2db853f..ae0105d 100644 --- a/src/workflows/service/create/InputServiceKindStep.ts +++ b/src/workflows/service/create/InputServiceKindStep.ts @@ -1,7 +1,9 @@ -import { KnownServiceKind, ServiceKind } from "@azure/arm-webpubsub"; -import { AzureWizardPromptStep, IAzureQuickPickItem } from "@microsoft/vscode-azext-utils"; +import { type ServiceKind } from "@azure/arm-webpubsub"; +import { KnownServiceKind } from "@azure/arm-webpubsub"; +import { type IAzureQuickPickItem } from "@microsoft/vscode-azext-utils"; +import { AzureWizardPromptStep } from "@microsoft/vscode-azext-utils"; import { localize } from "../../../utils"; -import { ICreateServiceContext } from "./ICreateServiceContext"; +import { type ICreateServiceContext } from "./ICreateServiceContext"; const serviceKindPickItems: IAzureQuickPickItem[] = [ { label: "Web PubSub", data: KnownServiceKind.WebPubSub, detail: "Supports the native Web PubSub API and provides SDKs in various languages" }, diff --git a/src/workflows/service/create/InputServiceNameStep.ts b/src/workflows/service/create/InputServiceNameStep.ts index 38b9a5f..63fb294 100644 --- a/src/workflows/service/create/InputServiceNameStep.ts +++ b/src/workflows/service/create/InputServiceNameStep.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { WebPubSubSkuTier } from "@azure/arm-webpubsub"; +import { type WebPubSubSkuTier } from "@azure/arm-webpubsub"; import { AzureNameStep } from "@microsoft/vscode-azext-utils"; import { localize } from "../../../utils"; -import { ICreateServiceContext } from "./ICreateServiceContext"; +import { type ICreateServiceContext } from "./ICreateServiceContext"; export class InputServiceNameStep extends AzureNameStep { //refer: https://dev.azure.com/msazure/AzureDMSS/_git/AzureDMSS-PortalExtension?path=%2Fsrc%2FSpringCloudPortalExt%2FClient%2FCreateApplication%2FCreateApplicationBlade.ts&version=GBdev&line=463&lineEnd=463&lineStartColumn=25&lineEndColumn=55&lineStyle=plain&_a=contents diff --git a/src/workflows/service/create/InputServiceSkuTierStep.ts b/src/workflows/service/create/InputServiceSkuTierStep.ts index 8664cf1..75ff709 100644 --- a/src/workflows/service/create/InputServiceSkuTierStep.ts +++ b/src/workflows/service/create/InputServiceSkuTierStep.ts @@ -1,7 +1,9 @@ -import { KnownWebPubSubSkuTier, WebPubSubSkuTier } from "@azure/arm-webpubsub"; -import { AzureWizardPromptStep, IAzureQuickPickItem } from "@microsoft/vscode-azext-utils"; +import { type WebPubSubSkuTier } from "@azure/arm-webpubsub"; +import { KnownWebPubSubSkuTier } from "@azure/arm-webpubsub"; +import { type IAzureQuickPickItem } from "@microsoft/vscode-azext-utils"; +import { AzureWizardPromptStep } from "@microsoft/vscode-azext-utils"; import { localize } from "../../../utils"; -import { ICreateServiceContext } from "./ICreateServiceContext"; +import { type ICreateServiceContext } from "./ICreateServiceContext"; import { getSkuTierFromSkuName } from "./InputServiceNameStep"; const skuTierPickItems: IAzureQuickPickItem[] = [ diff --git a/src/workflows/service/create/createService.ts b/src/workflows/service/create/createService.ts index 3a0036f..84b0fba 100644 --- a/src/workflows/service/create/createService.ts +++ b/src/workflows/service/create/createService.ts @@ -1,16 +1,18 @@ -import { ResourceSku, WebPubSubManagementClient } from "@azure/arm-webpubsub"; +import { type ResourceSku} from "@azure/arm-webpubsub"; +import { WebPubSubManagementClient } from "@azure/arm-webpubsub"; import { LocationListStep, ResourceGroupListStep, VerifyProvidersStep, createAzureClient } from "@microsoft/vscode-azext-azureutils"; -import { AzureWizard, AzureWizardExecuteStep, AzureWizardPromptStep, IActionContext, azureResourceExperience, createSubscriptionContext, subscriptionExperience } from "@microsoft/vscode-azext-utils"; -import { AzureSubscription } from "@microsoft/vscode-azureresources-api"; +import { type AzureWizardExecuteStep, type AzureWizardPromptStep, type IActionContext} from "@microsoft/vscode-azext-utils"; +import { AzureWizard, azureResourceExperience, createSubscriptionContext, subscriptionExperience } from "@microsoft/vscode-azext-utils"; +import { type AzureSubscription } from "@microsoft/vscode-azureresources-api"; import * as vscode from "vscode"; import { signalrProvider, webPubSubWebProvider } from "../../../constants"; import { ext } from "../../../extensionVariables"; -import { ServiceItem } from "../../../tree/service/ServiceItem"; +import { type ServiceItem } from "../../../tree/service/ServiceItem"; import * as utils from "../../../utils"; import { createActivityContext } from "../../../utils"; import { createHubSetting } from "../../hubSetting/create/createHubSetting"; import { CreateServiceStep } from "./CreateServiceStep"; -import { ICreateServiceContext } from "./ICreateServiceContext"; +import { type ICreateServiceContext } from "./ICreateServiceContext"; import { InputSerivceSkuUnitCountStep } from "./InputSerivceSkuUnitCountStep"; import { InputServiceKindStep } from "./InputServiceKindStep"; import { InputServiceNameStep } from "./InputServiceNameStep"; @@ -19,7 +21,7 @@ import { InputServiceSkuTierStep } from "./InputServiceSkuTierStep"; export async function createService(context: IActionContext, node?: { subscription: AzureSubscription; }): Promise { const tdp = ext.rgApiV2.resources.azureResourceTreeDataProvider; - var selectKindContext: any = { ...context, kind: "" }; + const selectKindContext: any = { ...context, kind: "" }; const inputServiceKind = new InputServiceKindStep(); await inputServiceKind.prompt(selectKindContext); diff --git a/src/workflows/service/delete/DeleteServiceConfirmStep.ts b/src/workflows/service/delete/DeleteServiceConfirmStep.ts index 29b7374..8b6ffe6 100644 --- a/src/workflows/service/delete/DeleteServiceConfirmStep.ts +++ b/src/workflows/service/delete/DeleteServiceConfirmStep.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { AzureWizardPromptStep, DialogResponses, nonNullValue, UserCancelledError } from '@microsoft/vscode-azext-utils'; -import { IPickServiceContext } from "src/workflows/common/contexts"; +import { type IPickServiceContext } from "src/workflows/common/contexts"; import { localize, settingUtils } from "../../../utils"; export class DeleteServiceConfirmStep extends AzureWizardPromptStep { diff --git a/src/workflows/service/delete/DeleteServiceStep.ts b/src/workflows/service/delete/DeleteServiceStep.ts index 6d57c0f..e8e2ae9 100644 --- a/src/workflows/service/delete/DeleteServiceStep.ts +++ b/src/workflows/service/delete/DeleteServiceStep.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { AzureWizardExecuteStep, parseError } from "@microsoft/vscode-azext-utils"; -import { IPickServiceContext } from "src/workflows/common/contexts"; +import { type IPickServiceContext } from "src/workflows/common/contexts"; import { type Progress } from "vscode"; import { ext } from "../../../extensionVariables"; import { createWebPubSubHubsAPIClient, localize } from '../../../utils'; @@ -23,7 +23,7 @@ export class DeleteServiceStep extends AzureWizardExecuteStep", diff --git a/src/workflows/service/generateClientUrl/generateClientUrl.ts b/src/workflows/service/generateClientUrl/generateClientUrl.ts index 7c7e7d3..1535703 100644 --- a/src/workflows/service/generateClientUrl/generateClientUrl.ts +++ b/src/workflows/service/generateClientUrl/generateClientUrl.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import { AzureWizard, createSubscriptionContext, type IActionContext } from "@microsoft/vscode-azext-utils"; -import { IPickKeyContext, IPickServiceContext } from "src/workflows/common/contexts"; +import { type IPickKeyContext, type IPickServiceContext } from "src/workflows/common/contexts"; import { ext } from "../../../extensionVariables"; import { pickService } from "../../../tree/pickitem/pickService"; -import { ServiceItem } from "../../../tree/service/ServiceItem"; +import { type ServiceItem } from "../../../tree/service/ServiceItem"; import * as utils from "../../../utils"; import { createActivityContext, localize } from "../../../utils"; import { GetKeyTypeStep } from "../../common/getKeyTypeStep"; diff --git a/src/workflows/service/openLiveTraceTool/OpenLiveTraceToolStep.ts b/src/workflows/service/openLiveTraceTool/OpenLiveTraceToolStep.ts index 21ea47b..04167a8 100644 --- a/src/workflows/service/openLiveTraceTool/OpenLiveTraceToolStep.ts +++ b/src/workflows/service/openLiveTraceTool/OpenLiveTraceToolStep.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { AzureWizardExecuteStep, parseError } from "@microsoft/vscode-azext-utils"; -import { IPickServiceContext } from "src/workflows/common/contexts"; +import { type IPickServiceContext } from "src/workflows/common/contexts"; import * as vscode from 'vscode'; import { window, type Progress } from "vscode"; import { ext } from "../../../extensionVariables"; @@ -24,7 +24,7 @@ export class OpenLiveTraceToolStep extends AzureWizardExecuteStep { 'regenerateKeyError', 'Failed to regenerate key for "{0}" in resource group "{1}"', context.webPubSubName, context.resourceGroupName )); - }; + } const client = await createWebPubSubHubsAPIClient([context, context.subscription!]); diff --git a/src/workflows/service/regenerateKey/regenerateKey.ts b/src/workflows/service/regenerateKey/regenerateKey.ts index 95d4371..981521b 100644 --- a/src/workflows/service/regenerateKey/regenerateKey.ts +++ b/src/workflows/service/regenerateKey/regenerateKey.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import { AzureWizard, createSubscriptionContext, type IActionContext } from "@microsoft/vscode-azext-utils"; -import { IPickKeyContext } from "src/workflows/common/contexts"; +import { type IPickKeyContext } from "src/workflows/common/contexts"; import { pickService } from "../../../tree/pickitem/pickService"; -import { ServiceItem } from "../../../tree/service/ServiceItem"; +import { type ServiceItem } from "../../../tree/service/ServiceItem"; import * as utils from "../../../utils"; import { createActivityContext, localize } from "../../../utils"; import { GetKeyTypeStep } from "../../common/getKeyTypeStep"; diff --git a/src/workflows/service/restart/RestartWebPubSubConfirmationStep.ts b/src/workflows/service/restart/RestartWebPubSubConfirmationStep.ts index 79e0826..22cf68c 100644 --- a/src/workflows/service/restart/RestartWebPubSubConfirmationStep.ts +++ b/src/workflows/service/restart/RestartWebPubSubConfirmationStep.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { AzureWizardPromptStep, DialogResponses, nonNullValue, UserCancelledError } from '@microsoft/vscode-azext-utils'; -import { IPickServiceContext } from "src/workflows/common/contexts"; +import { type IPickServiceContext } from "src/workflows/common/contexts"; import { localize, settingUtils } from "../../../utils"; export class RestartWebPubSubConfirmationStep extends AzureWizardPromptStep { diff --git a/src/workflows/service/restart/RestartWebPubSubStep.ts b/src/workflows/service/restart/RestartWebPubSubStep.ts index 4d55c10..4944a5a 100644 --- a/src/workflows/service/restart/RestartWebPubSubStep.ts +++ b/src/workflows/service/restart/RestartWebPubSubStep.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { AzureWizardExecuteStep, parseError } from "@microsoft/vscode-azext-utils"; -import { IPickServiceContext } from "src/workflows/common/contexts"; +import { type IPickServiceContext } from "src/workflows/common/contexts"; import { type Progress } from "vscode"; import { ext } from "../../../extensionVariables"; import { createWebPubSubHubsAPIClient, localize } from '../../../utils'; @@ -23,7 +23,7 @@ export class RestartWebPubSubStep extends AzureWizardExecuteStep[] = [ { label: "Minimum", data: KnownAggregationTypeEnum.Minimum }, @@ -11,7 +14,7 @@ const completeAggregationTypePickItems: IAzureQuickPickItem[] = ]; const mapMetricNameToAggregationPickItems = (metricsName: MetricName): IAzureQuickPickItem[] => { - var pickIndexs: number[] = []; + let pickIndexs: number[] = []; switch (metricsName) { case KnownMetricNameEnum.ServerLoad: case KnownMetricNameEnum.ConnectionQuotaUtilization: diff --git a/src/workflows/service/viewMetric/InputMetricNameStep.ts b/src/workflows/service/viewMetric/InputMetricNameStep.ts index 1a62477..5e26fec 100644 --- a/src/workflows/service/viewMetric/InputMetricNameStep.ts +++ b/src/workflows/service/viewMetric/InputMetricNameStep.ts @@ -1,6 +1,8 @@ -import { AzureWizardPromptStep, IAzureQuickPickItem } from "@microsoft/vscode-azext-utils"; +import { type IAzureQuickPickItem } from "@microsoft/vscode-azext-utils"; +import { AzureWizardPromptStep } from "@microsoft/vscode-azext-utils"; import { localize } from "../../../utils"; -import { IPickMetricsContext, KnownMetricNameEnum, MetricName } from "../../common/contexts"; +import { type IPickMetricsContext, type MetricName } from "../../common/contexts"; +import { KnownMetricNameEnum } from "../../common/contexts"; const metricNamePickItems: IAzureQuickPickItem[] = [ { label: "Server Load", data: KnownMetricNameEnum.ServerLoad }, diff --git a/src/workflows/service/viewMetric/InputTimespanStep.ts b/src/workflows/service/viewMetric/InputTimespanStep.ts index 4713b5e..06119ab 100644 --- a/src/workflows/service/viewMetric/InputTimespanStep.ts +++ b/src/workflows/service/viewMetric/InputTimespanStep.ts @@ -1,6 +1,7 @@ -import { AzureWizardPromptStep, IAzureQuickPickItem } from "@microsoft/vscode-azext-utils"; +import { type IAzureQuickPickItem } from "@microsoft/vscode-azext-utils"; +import { AzureWizardPromptStep } from "@microsoft/vscode-azext-utils"; import { localize } from "../../../utils"; -import { IPickMetricsContext } from "../../common/contexts"; +import { type IPickMetricsContext } from "../../common/contexts"; const hourDelta = 60 * 60 * 1000; const dayDelta = 24 * hourDelta; diff --git a/src/workflows/service/viewMetric/ViewMetricsStep.ts b/src/workflows/service/viewMetric/ViewMetricsStep.ts index 45d4e03..7c4d07b 100644 --- a/src/workflows/service/viewMetric/ViewMetricsStep.ts +++ b/src/workflows/service/viewMetric/ViewMetricsStep.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { AggregationType } from "@azure/arm-monitor"; +import { type AggregationType } from "@azure/arm-monitor"; import { AzureWizardExecuteStep, parseError } from "@microsoft/vscode-azext-utils"; -import { IPickKeyContext, IPickMetricsContext, MetricName } from "src/workflows/common/contexts"; +import { type IPickKeyContext, type IPickMetricsContext, type MetricName } from "src/workflows/common/contexts"; import * as vscode from "vscode"; import { ext } from "../../../extensionVariables"; import { createWebPubSubHubsAPIClient, localize } from '../../../utils'; @@ -53,7 +53,7 @@ const getChartDefinitionContext = (resourceName: string, resourceId: string, met const getMetricPortalUrl = (resourceName: string, resourceId: string, startTime: Date, endTime: Date, metricName: MetricName, aggregationType: AggregationType) => { const timeContext = getTimeContext(startTime, endTime); const chartDefinitionContext = getChartDefinitionContext(resourceName, resourceId, metricName, aggregationType); - var url = "https://ms.portal.azure.com/#@microsoft.onmicrosoft.com/blade/Microsoft_Azure_MonitoringMetrics/Metrics.ReactView/Referer/MetricsExplorer/ResourceId/"; + let url = "https://ms.portal.azure.com/#@microsoft.onmicrosoft.com/blade/Microsoft_Azure_MonitoringMetrics/Metrics.ReactView/Referer/MetricsExplorer/ResourceId/"; url += encodeURIComponent(resourceId); url += `/TimeContext/${encodeURIComponent(JSON.stringify(timeContext))}`; url += `/ChartDefinition/${encodeURIComponent(JSON.stringify(chartDefinitionContext))}`; @@ -73,7 +73,7 @@ export class ViewMetricStep extends AzureWizardExecuteStep 'invalidCopyConnectionStringParms', `Failed to copy connection string of "${context.webPubSubName}" in resource group "${context.resourceGroupName}"`) ); - }; + } try { const resourceId = `/subscriptions/${context.subscription?.subscriptionPath}/resourceGroups/${context.resourceGroupName}/providers/Microsoft.SignalRService/WebPubSub/${context.webPubSubName}`; const metricsProtalUri = getMetricPortalUrl( diff --git a/src/workflows/service/viewMetric/viewMetrics.ts b/src/workflows/service/viewMetric/viewMetrics.ts index 3387886..71a5414 100644 --- a/src/workflows/service/viewMetric/viewMetrics.ts +++ b/src/workflows/service/viewMetric/viewMetrics.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import { AzureWizard, createSubscriptionContext, type IActionContext } from "@microsoft/vscode-azext-utils"; -import { IPickMetricsContext, IPickServiceContext } from "src/workflows/common/contexts"; +import { type IPickMetricsContext, type IPickServiceContext } from "src/workflows/common/contexts"; import { pickService } from "../../../tree/pickitem/pickService"; -import { ServiceItem } from "../../../tree/service/ServiceItem"; +import { type ServiceItem } from "../../../tree/service/ServiceItem"; import * as utils from "../../../utils"; import { createActivityContext, localize } from "../../../utils"; import { InputAggregationTypeStep } from "./InputAggregationTypeStep"; diff --git a/src/workflows/trivial/helloWorld.ts b/src/workflows/trivial/helloWorld.ts index 3068a7f..9f1b3df 100644 --- a/src/workflows/trivial/helloWorld.ts +++ b/src/workflows/trivial/helloWorld.ts @@ -1,4 +1,4 @@ -import { IActionContext } from "@microsoft/vscode-azext-utils"; +import { type IActionContext } from "@microsoft/vscode-azext-utils"; import * as vscode from "vscode"; export async function helloWorld(context: IActionContext): Promise {