mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 17:23:25 -05:00
port c679d5e1f0 (#12780)
Co-authored-by: Arvind Ranasaria <ranasaria@outlook.com>
This commit is contained in:
128
extensions/azdata/src/api.ts
Normal file
128
extensions/azdata/src/api.ts
Normal file
@@ -0,0 +1,128 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as azdataExt from 'azdata-ext';
|
||||
import * as vscode from 'vscode';
|
||||
import { IAzdataTool, isEulaAccepted, promptForEula } from './azdata';
|
||||
import Logger from './common/logger';
|
||||
import { NoAzdataError } from './common/utils';
|
||||
import * as constants from './constants';
|
||||
import * as loc from './localizedConstants';
|
||||
import { AzdataToolService } from './services/azdataToolService';
|
||||
|
||||
function throwIfNoAzdataOrEulaNotAccepted(azdata: IAzdataTool | undefined, eulaAccepted: boolean): asserts azdata {
|
||||
throwIfNoAzdata(azdata);
|
||||
if (!eulaAccepted) {
|
||||
Logger.log(loc.eulaNotAccepted);
|
||||
throw new Error(loc.eulaNotAccepted);
|
||||
}
|
||||
}
|
||||
|
||||
export function throwIfNoAzdata(localAzdata: IAzdataTool | undefined): asserts localAzdata {
|
||||
if (!localAzdata) {
|
||||
Logger.log(loc.noAzdata);
|
||||
throw new NoAzdataError();
|
||||
}
|
||||
}
|
||||
|
||||
export function getExtensionApi(memento: vscode.Memento, azdataToolService: AzdataToolService, localAzdataDiscovered: Promise<IAzdataTool | undefined>): azdataExt.IExtension {
|
||||
return {
|
||||
isEulaAccepted: async () => {
|
||||
throwIfNoAzdata(await localAzdataDiscovered); // ensure that we have discovered Azdata
|
||||
return !!memento.get<boolean>(constants.eulaAccepted);
|
||||
},
|
||||
promptForEula: async (requireUserAction: boolean = true): Promise<boolean> => {
|
||||
await localAzdataDiscovered;
|
||||
return promptForEula(memento, true /* userRequested */, requireUserAction);
|
||||
},
|
||||
azdata: getAzdataApi(localAzdataDiscovered, azdataToolService, memento)
|
||||
};
|
||||
}
|
||||
|
||||
export function getAzdataApi(localAzdataDiscovered: Promise<IAzdataTool | undefined>, azdataToolService: AzdataToolService, memento: vscode.Memento): azdataExt.IAzdataApi {
|
||||
return {
|
||||
arc: {
|
||||
dc: {
|
||||
create: async (namespace: string, name: string, connectivityMode: string, resourceGroup: string, location: string, subscription: string, profileName?: string, storageClass?: string) => {
|
||||
await localAzdataDiscovered;
|
||||
throwIfNoAzdataOrEulaNotAccepted(azdataToolService.localAzdata, isEulaAccepted(memento));
|
||||
return azdataToolService.localAzdata.arc.dc.create(namespace, name, connectivityMode, resourceGroup, location, subscription, profileName, storageClass);
|
||||
},
|
||||
endpoint: {
|
||||
list: async () => {
|
||||
await localAzdataDiscovered;
|
||||
throwIfNoAzdataOrEulaNotAccepted(azdataToolService.localAzdata, isEulaAccepted(memento));
|
||||
return azdataToolService.localAzdata.arc.dc.endpoint.list();
|
||||
}
|
||||
},
|
||||
config: {
|
||||
list: async () => {
|
||||
await localAzdataDiscovered;
|
||||
throwIfNoAzdataOrEulaNotAccepted(azdataToolService.localAzdata, isEulaAccepted(memento));
|
||||
return azdataToolService.localAzdata.arc.dc.config.list();
|
||||
},
|
||||
show: async () => {
|
||||
await localAzdataDiscovered;
|
||||
throwIfNoAzdataOrEulaNotAccepted(azdataToolService.localAzdata, isEulaAccepted(memento));
|
||||
return azdataToolService.localAzdata.arc.dc.config.show();
|
||||
}
|
||||
}
|
||||
},
|
||||
postgres: {
|
||||
server: {
|
||||
list: async () => {
|
||||
await localAzdataDiscovered;
|
||||
throwIfNoAzdataOrEulaNotAccepted(azdataToolService.localAzdata, isEulaAccepted(memento));
|
||||
return azdataToolService.localAzdata.arc.postgres.server.list();
|
||||
},
|
||||
show: async (name: string) => {
|
||||
await localAzdataDiscovered;
|
||||
throwIfNoAzdataOrEulaNotAccepted(azdataToolService.localAzdata, isEulaAccepted(memento));
|
||||
return azdataToolService.localAzdata.arc.postgres.server.show(name);
|
||||
}
|
||||
}
|
||||
},
|
||||
sql: {
|
||||
mi: {
|
||||
delete: async (name: string) => {
|
||||
await localAzdataDiscovered;
|
||||
throwIfNoAzdataOrEulaNotAccepted(azdataToolService.localAzdata, isEulaAccepted(memento));
|
||||
return azdataToolService.localAzdata.arc.sql.mi.delete(name);
|
||||
},
|
||||
list: async () => {
|
||||
await localAzdataDiscovered;
|
||||
throwIfNoAzdataOrEulaNotAccepted(azdataToolService.localAzdata, isEulaAccepted(memento));
|
||||
return azdataToolService.localAzdata.arc.sql.mi.list();
|
||||
},
|
||||
show: async (name: string) => {
|
||||
await localAzdataDiscovered;
|
||||
throwIfNoAzdataOrEulaNotAccepted(azdataToolService.localAzdata, isEulaAccepted(memento));
|
||||
return azdataToolService.localAzdata.arc.sql.mi.show(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
getPath: async () => {
|
||||
await localAzdataDiscovered;
|
||||
throwIfNoAzdata(azdataToolService.localAzdata);
|
||||
return azdataToolService.localAzdata.getPath();
|
||||
},
|
||||
login: async (endpoint: string, username: string, password: string) => {
|
||||
throwIfNoAzdataOrEulaNotAccepted(azdataToolService.localAzdata, isEulaAccepted(memento));
|
||||
return azdataToolService.localAzdata.login(endpoint, username, password);
|
||||
},
|
||||
getSemVersion: async () => {
|
||||
await localAzdataDiscovered;
|
||||
throwIfNoAzdata(azdataToolService.localAzdata);
|
||||
return azdataToolService.localAzdata.getSemVersion();
|
||||
},
|
||||
version: async () => {
|
||||
await localAzdataDiscovered;
|
||||
throwIfNoAzdata(azdataToolService.localAzdata);
|
||||
return azdataToolService.localAzdata.version();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ export interface IAzdataTool extends azdataExt.IAzdataApi {
|
||||
/**
|
||||
* An object to interact with the azdata tool installed on the box.
|
||||
*/
|
||||
export class AzdataTool implements IAzdataTool {
|
||||
export class AzdataTool implements azdataExt.IAzdataApi {
|
||||
|
||||
private _semVersion: SemVer;
|
||||
constructor(private _path: string, version: string) {
|
||||
@@ -47,14 +47,14 @@ export class AzdataTool implements IAzdataTool {
|
||||
* before fetching this value to ensure that correct value is returned. This is almost always correct unless
|
||||
* Azdata has gotten reinstalled in the background after this IAzdataApi object was constructed.
|
||||
*/
|
||||
public getSemVersion() {
|
||||
public async getSemVersion(): Promise<SemVer> {
|
||||
return this._semVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the path where azdata tool is installed
|
||||
*/
|
||||
public getPath() {
|
||||
public async getPath(): Promise<string> {
|
||||
return this._path;
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ export async function findAzdata(): Promise<IAzdataTool> {
|
||||
try {
|
||||
const azdata = await findSpecificAzdata();
|
||||
await vscode.commands.executeCommand('setContext', azdataFound, true); // save a context key that azdata was found so that command for installing azdata is no longer available in commandPalette and that for updating it is.
|
||||
Logger.log(loc.foundExistingAzdata(azdata.getPath(), azdata.getSemVersion().raw));
|
||||
Logger.log(loc.foundExistingAzdata(await azdata.getPath(), (await azdata.getSemVersion()).raw));
|
||||
return azdata;
|
||||
} catch (err) {
|
||||
Logger.log(loc.couldNotFindAzdata(err));
|
||||
@@ -277,11 +277,11 @@ export async function checkAndInstallAzdata(userRequested: boolean = false): Pro
|
||||
export async function checkAndUpdateAzdata(currentAzdata?: IAzdataTool, userRequested: boolean = false): Promise<boolean> {
|
||||
if (currentAzdata !== undefined) {
|
||||
const newSemVersion = await discoverLatestAvailableAzdataVersion();
|
||||
if (newSemVersion.compare(currentAzdata.getSemVersion()) === 1) {
|
||||
Logger.log(loc.foundAzdataVersionToUpdateTo(newSemVersion.raw, currentAzdata.getSemVersion().raw));
|
||||
if (newSemVersion.compare(await currentAzdata.getSemVersion()) === 1) {
|
||||
Logger.log(loc.foundAzdataVersionToUpdateTo(newSemVersion.raw, (await currentAzdata.getSemVersion()).raw));
|
||||
return await promptToUpdateAzdata(newSemVersion.raw, userRequested);
|
||||
} else {
|
||||
Logger.log(loc.currentlyInstalledVersionIsLatest(currentAzdata.getSemVersion().raw));
|
||||
Logger.log(loc.currentlyInstalledVersionIsLatest((await currentAzdata.getSemVersion()).raw));
|
||||
}
|
||||
} else {
|
||||
Logger.log(loc.updateCheckSkipped);
|
||||
@@ -376,6 +376,17 @@ async function promptToUpdateAzdata(newVersion: string, userRequested: boolean =
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns true if Eula has been accepted.
|
||||
*
|
||||
* @param memento The memento that stores the eulaAccepted state
|
||||
*/
|
||||
export function isEulaAccepted(memento: vscode.Memento): boolean {
|
||||
return !!memento.get<boolean>(eulaAccepted);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prompts user to accept EULA. Stores and returns the user response to EULA prompt.
|
||||
* @param memento - memento where the user response is stored.
|
||||
|
||||
@@ -3,7 +3,20 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as azdataExt from 'azdata-ext';
|
||||
import * as which from 'which';
|
||||
import * as loc from '../localizedConstants';
|
||||
|
||||
|
||||
export class NoAzdataError extends Error implements azdataExt.ErrorWithLink {
|
||||
constructor() {
|
||||
super(loc.noAzdata);
|
||||
}
|
||||
|
||||
public get messageWithLink(): string {
|
||||
return loc.noAzdataWithLink;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches for the first instance of the specified executable in the PATH environment variable
|
||||
|
||||
@@ -4,31 +4,34 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as azdataExt from 'azdata-ext';
|
||||
import * as rd from 'resource-deployment';
|
||||
import * as vscode from 'vscode';
|
||||
import { checkAndInstallAzdata, checkAndUpdateAzdata, findAzdata, IAzdataTool, promptForEula } from './azdata';
|
||||
import { getExtensionApi } from './api';
|
||||
import { checkAndInstallAzdata, checkAndUpdateAzdata, findAzdata, isEulaAccepted, promptForEula } from './azdata';
|
||||
import Logger from './common/logger';
|
||||
import * as constants from './constants';
|
||||
import * as loc from './localizedConstants';
|
||||
import { ArcControllerConfigProfilesOptionsSource } from './providers/arcControllerConfigProfilesOptionsSource';
|
||||
import { AzdataToolService } from './services/azdataToolService';
|
||||
|
||||
let localAzdata: IAzdataTool | undefined = undefined;
|
||||
let eulaAccepted: boolean = false;
|
||||
export async function activate(context: vscode.ExtensionContext): Promise<azdataExt.IExtension> {
|
||||
const azdataToolService = new AzdataToolService();
|
||||
let eulaAccepted: boolean = false;
|
||||
vscode.commands.registerCommand('azdata.acceptEula', async () => {
|
||||
eulaAccepted = await promptForEula(context.globalState, true /* userRequested */);
|
||||
|
||||
await promptForEula(context.globalState, true /* userRequested */);
|
||||
});
|
||||
|
||||
vscode.commands.registerCommand('azdata.install', async () => {
|
||||
localAzdata = await checkAndInstallAzdata(true /* userRequested */);
|
||||
azdataToolService.localAzdata = await checkAndInstallAzdata(true /* userRequested */);
|
||||
});
|
||||
|
||||
vscode.commands.registerCommand('azdata.update', async () => {
|
||||
if (await checkAndUpdateAzdata(localAzdata, true /* userRequested */)) { // if an update was performed
|
||||
localAzdata = await findAzdata(); // find and save the currently installed azdata
|
||||
if (await checkAndUpdateAzdata(azdataToolService.localAzdata, true /* userRequested */)) { // if an update was performed
|
||||
azdataToolService.localAzdata = await findAzdata(); // find and save the currently installed azdata
|
||||
}
|
||||
});
|
||||
|
||||
eulaAccepted = !!context.globalState.get<boolean>(constants.eulaAccepted); // fetch eula acceptance state from memento
|
||||
eulaAccepted = isEulaAccepted(context.globalState); // fetch eula acceptance state from memento
|
||||
await vscode.commands.executeCommand('setContext', constants.eulaAccepted, eulaAccepted); // set a context key for current value of eulaAccepted state retrieved from memento so that command for accepting eula is available/unavailable in commandPalette appropriately.
|
||||
Logger.log(loc.eulaAcceptedStateOnStartup(eulaAccepted));
|
||||
if (!eulaAccepted) {
|
||||
@@ -42,110 +45,38 @@ export async function activate(context: vscode.ExtensionContext): Promise<azdata
|
||||
}
|
||||
|
||||
// Don't block on this since we want the extension to finish activating without needing user input
|
||||
checkAndInstallAzdata() // install if not installed and user wants it.
|
||||
const localAzdataDiscovered = checkAndInstallAzdata() // install if not installed and user wants it.
|
||||
.then(async azdataTool => {
|
||||
localAzdata = azdataTool;
|
||||
if (localAzdata !== undefined) {
|
||||
if (azdataTool !== undefined) {
|
||||
azdataToolService.localAzdata = azdataTool;
|
||||
if (!eulaAccepted) {
|
||||
// Don't block on this since we want extension to finish activating without requiring user actions.
|
||||
// If EULA has not been accepted then we will check again while executing azdata commands.
|
||||
promptForEula(context.globalState)
|
||||
.then(async (userResponse: boolean) => {
|
||||
eulaAccepted = userResponse;
|
||||
})
|
||||
.catch((err) => console.log(err));
|
||||
}
|
||||
try {
|
||||
//update if available and user wants it.
|
||||
if (await checkAndUpdateAzdata(localAzdata)) { // if an update was performed
|
||||
localAzdata = await findAzdata(); // find and save the currently installed azdata
|
||||
if (await checkAndUpdateAzdata(azdataToolService.localAzdata)) { // if an update was performed
|
||||
azdataToolService.localAzdata = await findAzdata(); // find and save the currently installed azdata
|
||||
}
|
||||
} catch (err) {
|
||||
vscode.window.showWarningMessage(loc.updateError(err));
|
||||
}
|
||||
}
|
||||
return azdataTool;
|
||||
});
|
||||
|
||||
return {
|
||||
isEulaAccepted: () => !!context.globalState.get<boolean>(constants.eulaAccepted),
|
||||
promptForEula: (onError: boolean = true): Promise<boolean> => promptForEula(context.globalState, true /* userRequested */, onError),
|
||||
azdata: {
|
||||
arc: {
|
||||
dc: {
|
||||
create: async (namespace: string, name: string, connectivityMode: string, resourceGroup: string, location: string, subscription: string, profileName?: string, storageClass?: string) => {
|
||||
throwIfNoAzdataOrEulaNotAccepted();
|
||||
return localAzdata!.arc.dc.create(namespace, name, connectivityMode, resourceGroup, location, subscription, profileName, storageClass);
|
||||
},
|
||||
endpoint: {
|
||||
list: async () => {
|
||||
throwIfNoAzdataOrEulaNotAccepted();
|
||||
return localAzdata!.arc.dc.endpoint.list();
|
||||
}
|
||||
},
|
||||
config: {
|
||||
list: async () => {
|
||||
throwIfNoAzdataOrEulaNotAccepted();
|
||||
return localAzdata!.arc.dc.config.list();
|
||||
},
|
||||
show: async () => {
|
||||
throwIfNoAzdataOrEulaNotAccepted();
|
||||
return localAzdata!.arc.dc.config.show();
|
||||
}
|
||||
}
|
||||
},
|
||||
postgres: {
|
||||
server: {
|
||||
list: async () => {
|
||||
throwIfNoAzdataOrEulaNotAccepted();
|
||||
return localAzdata!.arc.postgres.server.list();
|
||||
},
|
||||
show: async (name: string) => {
|
||||
throwIfNoAzdataOrEulaNotAccepted();
|
||||
return localAzdata!.arc.postgres.server.show(name);
|
||||
}
|
||||
}
|
||||
},
|
||||
sql: {
|
||||
mi: {
|
||||
delete: async (name: string) => {
|
||||
throwIfNoAzdataOrEulaNotAccepted();
|
||||
return localAzdata!.arc.sql.mi.delete(name);
|
||||
},
|
||||
list: async () => {
|
||||
throwIfNoAzdataOrEulaNotAccepted();
|
||||
return localAzdata!.arc.sql.mi.list();
|
||||
},
|
||||
show: async (name: string) => {
|
||||
throwIfNoAzdataOrEulaNotAccepted();
|
||||
return localAzdata!.arc.sql.mi.show(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
getPath: () => {
|
||||
throwIfNoAzdata();
|
||||
return localAzdata!.getPath();
|
||||
},
|
||||
login: async (endpoint: string, username: string, password: string) => {
|
||||
throwIfNoAzdataOrEulaNotAccepted();
|
||||
return localAzdata!.login(endpoint, username, password);
|
||||
},
|
||||
getSemVersion: () => {
|
||||
throwIfNoAzdata();
|
||||
return localAzdata!.getSemVersion();
|
||||
},
|
||||
version: async () => {
|
||||
throwIfNoAzdata();
|
||||
return localAzdata!.version();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
const azdataApi = getExtensionApi(context.globalState, azdataToolService, localAzdataDiscovered);
|
||||
|
||||
function throwIfNoAzdataOrEulaNotAccepted(): void {
|
||||
throwIfNoAzdata();
|
||||
if (!eulaAccepted) {
|
||||
Logger.log(loc.eulaNotAccepted);
|
||||
throw new Error(loc.eulaNotAccepted);
|
||||
}
|
||||
}
|
||||
// register option source(s)
|
||||
const rdApi = <rd.IExtension>vscode.extensions.getExtension(rd.extension.name)?.exports;
|
||||
rdApi.registerOptionsSourceProvider(new ArcControllerConfigProfilesOptionsSource(azdataApi));
|
||||
|
||||
function throwIfNoAzdata() {
|
||||
if (!localAzdata) {
|
||||
Logger.log(loc.noAzdata);
|
||||
throw new Error(loc.noAzdata);
|
||||
}
|
||||
return azdataApi;
|
||||
}
|
||||
|
||||
export function deactivate(): void { }
|
||||
|
||||
@@ -45,6 +45,7 @@ export const platformUnsupported = (platform: string): string => localize('azdat
|
||||
export const unexpectedCommandError = (errMsg: string): string => localize('azdata.unexpectedCommandError', "Unexpected error executing command: {0}", errMsg);
|
||||
export const unexpectedExitCode = (code: number, err: string): string => localize('azdata.unexpectedExitCode', "Unexpected exit code from command: {1} ({0})", code, err);
|
||||
export const noAzdata = localize('azdata.NoAzdata', "No Azure Data CLI is available, [install the Azure Data CLI](command:azdata.install) to enable the features that require it.");
|
||||
export const noAzdataWithLink = localize('azdata.noAzdataWithLink', "No Azure Data CLI is available, [install the Azure Data CLI](command:azdata.install) to enable the features that require it.");
|
||||
export const skipInstall = (config: string): string => localize('azdata.skipInstall', "Skipping installation of azdata, since the operation was not user requested and config option: {0}.{1} is {2}", azdataConfigSection, azdataInstallKey, config);
|
||||
export const skipUpdate = (config: string): string => localize('azdata.skipUpdate', "Skipping update of azdata, since the operation was not user requested and config option: {0}.{1} is {2}", azdataConfigSection, azdataUpdateKey, config);
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as rd from 'resource-deployment';
|
||||
import * as azdataExt from 'azdata-ext';
|
||||
|
||||
/**
|
||||
* Class that provides options sources for an Arc Data Controller
|
||||
*/
|
||||
export class ArcControllerConfigProfilesOptionsSource implements rd.IOptionsSourceProvider {
|
||||
readonly optionsSourceId = 'arc.controller.config.profiles';
|
||||
constructor(private _azdataExtApi: azdataExt.IExtension) { }
|
||||
async getOptions(): Promise<string[]> {
|
||||
if (!this._azdataExtApi.isEulaAccepted()) { // if eula has not yet be accepted then give user a chance to accept it
|
||||
await this._azdataExtApi.promptForEula();
|
||||
}
|
||||
return (await this._azdataExtApi.azdata.arc.dc.config.list()).result;
|
||||
}
|
||||
}
|
||||
29
extensions/azdata/src/services/azdataToolService.ts
Normal file
29
extensions/azdata/src/services/azdataToolService.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IAzdataTool } from '../azdata';
|
||||
|
||||
export class AzdataToolService {
|
||||
private _localAzdata: IAzdataTool | undefined;
|
||||
constructor() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the localAzdata that was last saved
|
||||
*/
|
||||
get localAzdata(): IAzdataTool | undefined {
|
||||
return this._localAzdata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the localAzdata that was last saved
|
||||
*
|
||||
* @param memento The memento that stores the localAzdata object
|
||||
*/
|
||||
set localAzdata(azdata: IAzdataTool | undefined) {
|
||||
this._localAzdata = azdata;
|
||||
}
|
||||
}
|
||||
|
||||
13
extensions/azdata/src/typings/azdata-ext.d.ts
vendored
13
extensions/azdata/src/typings/azdata-ext.d.ts
vendored
@@ -16,6 +16,10 @@ declare module 'azdata-ext' {
|
||||
name = 'Microsoft.azdata'
|
||||
}
|
||||
|
||||
export interface ErrorWithLink extends Error {
|
||||
messageWithLink: string;
|
||||
}
|
||||
|
||||
export interface DcEndpointListResult {
|
||||
description: string, // "Management Proxy"
|
||||
endpoint: string, // "https://10.91.86.39:30777"
|
||||
@@ -227,14 +231,14 @@ declare module 'azdata-ext' {
|
||||
}
|
||||
}
|
||||
},
|
||||
getPath(): string,
|
||||
getPath(): Promise<string>,
|
||||
login(endpoint: string, username: string, password: string): Promise<AzdataOutput<any>>,
|
||||
/**
|
||||
* The semVersion corresponding to this installation of azdata. version() method should have been run
|
||||
* before fetching this value to ensure that correct value is returned. This is almost always correct unless
|
||||
* Azdata has gotten reinstalled in the background after this IAzdataApi object was constructed.
|
||||
*/
|
||||
getSemVersion(): SemVer,
|
||||
getSemVersion(): Promise<SemVer>,
|
||||
version(): Promise<AzdataOutput<string>>
|
||||
}
|
||||
|
||||
@@ -244,7 +248,7 @@ declare module 'azdata-ext' {
|
||||
/**
|
||||
* returns true if AZDATA CLI EULA has been previously accepted by the user.
|
||||
*/
|
||||
isEulaAccepted(): boolean;
|
||||
isEulaAccepted(): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* Prompts user to accept EULA. Stores and returns the user response to EULA prompt.
|
||||
@@ -253,6 +257,7 @@ declare module 'azdata-ext' {
|
||||
* pre-requisite, the calling code has to ensure that the EULA has not yet been previously accepted by the user. The code can use @see isEulaAccepted() call to ascertain this.
|
||||
* returns true if the user accepted the EULA.
|
||||
*/
|
||||
promptForEula(requireUserAction?: boolean): Promise<boolean>
|
||||
promptForEula(requireUserAction?: boolean): Promise<boolean>;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
1
extensions/azdata/src/typings/refs.d.ts
vendored
1
extensions/azdata/src/typings/refs.d.ts
vendored
@@ -6,3 +6,4 @@
|
||||
/// <reference path='../../../../src/sql/azdata.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/azdata.proposed.d.ts'/>
|
||||
/// <reference path='../../../../src/vs/vscode.d.ts'/>
|
||||
/// <reference path='../../../resource-deployment/src/typings/resource-deployment.d.ts'/>
|
||||
|
||||
Reference in New Issue
Block a user