Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async createChildImpl(context: ICreateChildImplContext): Promise {
const client: CosmosDBManagementClient = createAzureClient(this.root, CosmosDBManagementClient);
const wizardContext: ICosmosDBWizardContext = Object.assign(context, this.root);
const promptSteps: AzureWizardPromptStep[] = [
new CosmosDBAccountNameStep(),
new CosmosDBAccountApiStep(),
new ResourceGroupListStep()
];
LocationListStep.addStep(wizardContext, promptSteps);
const wizard = new AzureWizard(wizardContext, {
promptSteps,
executeSteps: [
new CosmosDBAccountCreateStep()
],
title: 'Create new Cosmos DB account'
});
await wizard.prompt();
wizardContext.telemetry.properties.defaultExperience = wizardContext.defaultExperience.api;
context.showCreatingTreeItem(wizardContext.accountName);
await wizard.execute();
// don't wait
public async getSubWizard(wizardContext: IAppServiceWizardContext): Promise | undefined> {
if (!wizardContext.plan) {
const promptSteps: AzureWizardPromptStep[] = [new AppServicePlanNameStep(), new AppServicePlanSkuStep(), new ResourceGroupListStep()];
LocationListStep.addStep(wizardContext, promptSteps);
return {
promptSteps: promptSteps,
executeSteps: [new AppServicePlanCreateStep()]
};
} else {
return undefined;
}
}
public async getSubWizard(wizardContext: IAppServiceWizardContext): Promise | undefined> {
if (!wizardContext.appInsightsComponent && !wizardContext.appInsightsSkip) {
const promptSteps: AzureWizardPromptStep[] = [new AppInsightsNameStep()];
LocationListStep.addStep(wizardContext, promptSteps);
return {
promptSteps: promptSteps,
executeSteps: [new AppInsightsCreateStep()]
};
} else {
return undefined;
}
}