import * as appservice from 'vscode-azureappservice' ; import { IActionContext } from 'vscode-azureextensionui' ; import { ext } from '../extensionVariables' ; import { SlotTreeItem } from '../tree/SlotTreeItem' ; export async function swapSlot ( context , sourceSlotNode ? ) { if ( ! sourceSlotNode ) { sourceSlotNode = await ext . tree . showTreeItemPicker < SlotTreeItem > ( SlotTreeItem . contextValue , { ... context , suppressCreatePick : true } ) ; } const deploymentSlots = < SlotTreeItem [ ] > await sourceSlotNode . parent . getCachedChildren ( context ) ; await appservice . swapSlot ( context , sourceSlotNode . site , deploymentSlots . map ( ds => ds . site ) ) ; await sourceSlotNode . parent . parent . refresh ( context ) ; }