mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 01:25:37 -05:00
Move protocol client out (#643)
* close * connection is working * formatting * adds all * formatting * formatting and changing how features are initialized * formatting * changed named of typings file * update * updated to use dataprotocol npm * formatting * removed unneeded logging * readd npm shrinkwrap * still not working * removed unnecessary codfe * addressed comments * readded azure resource provider * fix capabilities cacheing * added backwards capat for older protocol * update shrinkwrap * update shrinkwrap * updated shrinkwrap * fixed tests * removed dead code * remove dead code * fix compile * remove backcompat stuff * change location of npm * vbump sqltools * merge master * fix imports * fix build breaks * update for sqlops * update yarn dependencies
This commit is contained in:
@@ -10,7 +10,7 @@ import { Button } from 'sql/base/browser/ui/button/button';
|
||||
import { Builder } from 'vs/base/browser/builder';
|
||||
import * as types from 'vs/base/common/types';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
export function appendRow(container: Builder, label: string, labelClass: string, cellContainerClass: string): Builder {
|
||||
let cellContainer: Builder;
|
||||
@@ -61,7 +61,7 @@ export function getBooleanValueFromStringOrBoolean(value: any): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
export function getCategoryDisplayName(categories: data.CategoryValue[], categoryName: string) {
|
||||
export function getCategoryDisplayName(categories: sqlops.CategoryValue[], categoryName: string) {
|
||||
var displayName: string;
|
||||
categories.forEach(c => {
|
||||
if (c.name === categoryName) {
|
||||
@@ -71,7 +71,7 @@ export function getCategoryDisplayName(categories: data.CategoryValue[], categor
|
||||
return displayName;
|
||||
}
|
||||
|
||||
export function getCategoryName(categories: data.CategoryValue[], categoryDisplayName: string) {
|
||||
export function getCategoryName(categories: sqlops.CategoryValue[], categoryDisplayName: string) {
|
||||
var categoryName: string;
|
||||
categories.forEach(c => {
|
||||
if (c.displayName === categoryDisplayName) {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { IModalOptions, Modal } from './modal';
|
||||
import * as OptionsDialogHelper from './optionsDialogHelper';
|
||||
import { attachButtonStyler, attachModalDialogStyler } from 'sql/common/theme/styler';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { IPartService } from 'vs/workbench/services/part/common/partService';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
@@ -154,9 +154,9 @@ export class OptionsDialog extends Modal {
|
||||
this._optionDescription.innerHtml(option.description);
|
||||
}
|
||||
|
||||
private fillInOptions(container: Builder, options: data.ServiceOption[]): void {
|
||||
private fillInOptions(container: Builder, options: sqlops.ServiceOption[]): void {
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
var option: data.ServiceOption = options[i];
|
||||
var option: sqlops.ServiceOption = options[i];
|
||||
var rowContainer = DialogHelper.appendRow(container, option.displayName, 'optionsDialog-label', 'optionsDialog-input');
|
||||
OptionsDialogHelper.createOptionElement(option, rowContainer, this._optionValues, this._optionElements, this._contextViewService, (name) => this.onOptionLinkClicked(name));
|
||||
}
|
||||
@@ -221,7 +221,7 @@ export class OptionsDialog extends Modal {
|
||||
this._onCloseEvent.fire();
|
||||
}
|
||||
|
||||
public open(options: data.ServiceOption[], optionValues: { [name: string]: any }) {
|
||||
public open(options: sqlops.ServiceOption[], optionValues: { [name: string]: any }) {
|
||||
this._optionValues = optionValues;
|
||||
var firstOption: string;
|
||||
var containerGroup: Builder;
|
||||
@@ -233,7 +233,7 @@ export class OptionsDialog extends Modal {
|
||||
var splitview = new SplitView(containerGroup.getHTMLElement());
|
||||
let categoryMap = OptionsDialogHelper.groupOptionsByCategory(options);
|
||||
for (var category in categoryMap) {
|
||||
var serviceOptions: data.ServiceOption[] = categoryMap[category];
|
||||
var serviceOptions: sqlops.ServiceOption[] = categoryMap[category];
|
||||
var bodyContainer = $().element('table', { class: 'optionsDialog-table' }, (tableContainer: Builder) => {
|
||||
this.fillInOptions(tableContainer, serviceOptions);
|
||||
});
|
||||
|
||||
@@ -12,17 +12,17 @@ import { MessageType } from 'vs/base/browser/ui/inputbox/inputBox';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import { localize } from 'vs/nls';
|
||||
import { ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
|
||||
export interface IOptionElement {
|
||||
optionWidget: any;
|
||||
option: data.ServiceOption;
|
||||
option: sqlops.ServiceOption;
|
||||
optionValue: any;
|
||||
}
|
||||
|
||||
export function createOptionElement(option: data.ServiceOption, rowContainer: Builder, options: { [name: string]: any },
|
||||
export function createOptionElement(option: sqlops.ServiceOption, rowContainer: Builder, options: { [name: string]: any },
|
||||
optionsMap: { [optionName: string]: IOptionElement }, contextViewService: IContextViewService, onFocus: (name) => void): void {
|
||||
let possibleInputs: string[] = [];
|
||||
let optionValue = this.getOptionValueAndCategoryValues(option, options, possibleInputs);
|
||||
@@ -67,8 +67,7 @@ export function createOptionElement(option: data.ServiceOption, rowContainer: Bu
|
||||
inputElement.onfocus = () => onFocus(option.name);
|
||||
}
|
||||
|
||||
export function getOptionValueAndCategoryValues(option: data.ServiceOption, options: { [optionName: string]: any }, possibleInputs: string[]): any {
|
||||
|
||||
export function getOptionValueAndCategoryValues(option: sqlops.ServiceOption, options: { [optionName: string]: any }, possibleInputs: string[]): any {
|
||||
var optionValue = option.defaultValue;
|
||||
if (options[option.name]) {
|
||||
// if the value type is boolean, the option value can be either boolean or string
|
||||
@@ -160,8 +159,8 @@ export function findElement(container: Builder, className: string): HTMLElement
|
||||
return elementBuilder.getHTMLElement();
|
||||
}
|
||||
|
||||
export function groupOptionsByCategory(options: data.ServiceOption[]): { [category: string]: data.ServiceOption[] } {
|
||||
var connectionOptionsMap: { [category: string]: data.ServiceOption[] } = {};
|
||||
export function groupOptionsByCategory(options: sqlops.ServiceOption[]): { [category: string]: sqlops.ServiceOption[] } {
|
||||
var connectionOptionsMap: { [category: string]: sqlops.ServiceOption[] } = {};
|
||||
options.forEach(option => {
|
||||
var groupName = option.groupName;
|
||||
if (groupName === null || groupName === undefined) {
|
||||
|
||||
@@ -22,7 +22,6 @@ import WebView from 'vs/workbench/parts/html/browser/webview';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { IDisposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import data = require('data');
|
||||
|
||||
export class WebViewDialog extends Modal {
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import * as TelemetryKeys from 'sql/common/telemetryKeys';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { Button } from 'sql/base/browser/ui/button/button';
|
||||
import { Modal } from 'sql/base/browser/ui/modal/modal';
|
||||
import { attachModalDialogStyler, attachButtonStyler } from 'sql/common/theme/styler';
|
||||
@@ -40,7 +40,7 @@ export class AccountDialog extends Modal {
|
||||
public viewModel: AccountViewModel;
|
||||
|
||||
// MEMBER VARIABLES ////////////////////////////////////////////////////
|
||||
private _providerViews: { [providerId: string]: FixedListView<data.Account> } = {};
|
||||
private _providerViews: { [providerId: string]: FixedListView<sqlops.Account> } = {};
|
||||
|
||||
private _closeButton: Button;
|
||||
private _delegate: AccountListDelegate;
|
||||
@@ -174,8 +174,8 @@ export class AccountDialog extends Modal {
|
||||
|
||||
// Create a fixed list view for the account provider
|
||||
let providerViewContainer = DOM.$('.provider-view');
|
||||
let accountList = new List<data.Account>(providerViewContainer, this._delegate, [this._accountRenderer]);
|
||||
let providerView = new FixedListView<data.Account>(
|
||||
let accountList = new List<sqlops.Account>(providerViewContainer, this._delegate, [this._accountRenderer]);
|
||||
let providerView = new FixedListView<sqlops.Account>(
|
||||
undefined,
|
||||
false,
|
||||
newProvider.addedProvider.displayName,
|
||||
@@ -205,7 +205,7 @@ export class AccountDialog extends Modal {
|
||||
this._providerViews[newProvider.addedProvider.id] = providerView;
|
||||
}
|
||||
|
||||
private removeProvider(removedProvider: data.AccountProviderMetadata) {
|
||||
private removeProvider(removedProvider: sqlops.AccountProviderMetadata) {
|
||||
// Skip removing the provider if it doesn't exist
|
||||
let providerView = this._providerViews[removedProvider.id];
|
||||
if (!providerView) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { IAccountManagementService } from 'sql/services/accountManagement/interfaces';
|
||||
import { AccountProviderAddedEventParams, UpdateAccountListEventParams } from 'sql/services/accountManagement/eventTypes';
|
||||
@@ -18,18 +18,18 @@ export class AccountViewModel {
|
||||
private _addProviderEmitter: Emitter<AccountProviderAddedEventParams>;
|
||||
public get addProviderEvent(): Event<AccountProviderAddedEventParams> { return this._addProviderEmitter.event; }
|
||||
|
||||
private _removeProviderEmitter: Emitter<data.AccountProviderMetadata>;
|
||||
public get removeProviderEvent(): Event<data.AccountProviderMetadata> { return this._removeProviderEmitter.event; }
|
||||
private _removeProviderEmitter: Emitter<sqlops.AccountProviderMetadata>;
|
||||
public get removeProviderEvent(): Event<sqlops.AccountProviderMetadata> { return this._removeProviderEmitter.event; }
|
||||
|
||||
private _updateAccountListEmitter: Emitter<UpdateAccountListEventParams>;
|
||||
public get updateAccountListEvent(): Event<UpdateAccountListEventParams> { return this._updateAccountListEmitter.event; }
|
||||
|
||||
constructor(@IAccountManagementService private _accountManagementService: IAccountManagementService) {
|
||||
constructor( @IAccountManagementService private _accountManagementService: IAccountManagementService) {
|
||||
let self = this;
|
||||
|
||||
// Create our event emitters
|
||||
this._addProviderEmitter = new Emitter<AccountProviderAddedEventParams>();
|
||||
this._removeProviderEmitter = new Emitter<data.AccountProviderMetadata>();
|
||||
this._removeProviderEmitter = new Emitter<sqlops.AccountProviderMetadata>();
|
||||
this._updateAccountListEmitter = new Emitter<UpdateAccountListEventParams>();
|
||||
|
||||
// Register handlers for any changes to the providers or accounts
|
||||
@@ -53,22 +53,22 @@ export class AccountViewModel {
|
||||
// 3) Build parameters to add a provider and return it
|
||||
return this._accountManagementService.getAccountProviderMetadata()
|
||||
.then(
|
||||
(providers: data.AccountProviderMetadata[]) => {
|
||||
let promises = providers.map(provider => {
|
||||
return self._accountManagementService.getAccountsForProvider(provider.id)
|
||||
.then(
|
||||
accounts => <AccountProviderAddedEventParams> {
|
||||
addedProvider: provider,
|
||||
initialAccounts: accounts
|
||||
},
|
||||
() => { /* Swallow failures at getting accounts, we'll just hide that provider */ });
|
||||
});
|
||||
return Promise.all(promises);
|
||||
},
|
||||
() => {
|
||||
/* Swallow failures and just pretend we don't have any providers */
|
||||
return [];
|
||||
}
|
||||
(providers: sqlops.AccountProviderMetadata[]) => {
|
||||
let promises = providers.map(provider => {
|
||||
return self._accountManagementService.getAccountsForProvider(provider.id)
|
||||
.then(
|
||||
accounts => <AccountProviderAddedEventParams>{
|
||||
addedProvider: provider,
|
||||
initialAccounts: accounts
|
||||
},
|
||||
() => { /* Swallow failures at getting accounts, we'll just hide that provider */ });
|
||||
});
|
||||
return Promise.all(promises);
|
||||
},
|
||||
() => {
|
||||
/* Swallow failures and just pretend we don't have any providers */
|
||||
return [];
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { DropdownList } from 'sql/base/browser/ui/dropdownList/dropdownList';
|
||||
import { attachDropdownStyler } from 'sql/common/theme/styler';
|
||||
import { AddAccountAction, RefreshAccountAction } from 'sql/parts/accountManagement/common/accountActions';
|
||||
@@ -29,7 +29,7 @@ import { AccountPickerViewModel } from 'sql/parts/accountManagement/accountPicke
|
||||
export class AccountPicker extends Disposable {
|
||||
public static ACCOUNTPICKERLIST_HEIGHT = 47;
|
||||
public viewModel: AccountPickerViewModel;
|
||||
private _accountList: List<data.Account>;
|
||||
private _accountList: List<sqlops.Account>;
|
||||
private _rootElement: HTMLElement;
|
||||
private _refreshContainer: HTMLElement;
|
||||
private _listContainer: HTMLElement;
|
||||
@@ -46,8 +46,8 @@ export class AccountPicker extends Disposable {
|
||||
private _addAccountStartEmitter: Emitter<void>;
|
||||
public get addAccountStartEvent(): Event<void> { return this._addAccountStartEmitter.event; }
|
||||
|
||||
private _onAccountSelectionChangeEvent: Emitter<data.Account>;
|
||||
public get onAccountSelectionChangeEvent(): Event<data.Account> { return this._onAccountSelectionChangeEvent.event; }
|
||||
private _onAccountSelectionChangeEvent: Emitter<sqlops.Account>;
|
||||
public get onAccountSelectionChangeEvent(): Event<sqlops.Account> { return this._onAccountSelectionChangeEvent.event; }
|
||||
|
||||
constructor(
|
||||
private _providerId: string,
|
||||
@@ -61,7 +61,7 @@ export class AccountPicker extends Disposable {
|
||||
this._addAccountCompleteEmitter = new Emitter<void>();
|
||||
this._addAccountErrorEmitter = new Emitter<string>();
|
||||
this._addAccountStartEmitter = new Emitter<void>();
|
||||
this._onAccountSelectionChangeEvent = new Emitter<data.Account>();
|
||||
this._onAccountSelectionChangeEvent = new Emitter<sqlops.Account>();
|
||||
|
||||
// Create the view model, wire up the events, and initialize with baseline data
|
||||
this.viewModel = this._instantiationService.createInstance(AccountPickerViewModel, this._providerId);
|
||||
@@ -89,7 +89,7 @@ export class AccountPicker extends Disposable {
|
||||
let delegate = new AccountListDelegate(AccountPicker.ACCOUNTPICKERLIST_HEIGHT);
|
||||
let accountRenderer = new AccountPickerListRenderer();
|
||||
this._listContainer = DOM.$('div.account-list-container');
|
||||
this._accountList = new List<data.Account>(this._listContainer, delegate, [accountRenderer]);
|
||||
this._accountList = new List<sqlops.Account>(this._listContainer, delegate, [accountRenderer]);
|
||||
this._register(attachListStyler(this._accountList, this._themeService));
|
||||
|
||||
this._rootElement = DOM.$('div.account-picker-container');
|
||||
@@ -108,7 +108,7 @@ export class AccountPicker extends Disposable {
|
||||
|
||||
this._dropdown = this._register(new DropdownList(this._rootElement, option, this._listContainer, this._accountList, this._themeService, addAccountAction));
|
||||
this._register(attachDropdownStyler(this._dropdown, this._themeService));
|
||||
this._register(this._accountList.onSelectionChange((e: IListEvent<data.Account>) => {
|
||||
this._register(this._accountList.onSelectionChange((e: IListEvent<sqlops.Account>) => {
|
||||
if (e.elements.length === 1) {
|
||||
this._dropdown.renderLabel();
|
||||
this.onAccountSelectionChange(e.elements[0]);
|
||||
@@ -134,7 +134,7 @@ export class AccountPicker extends Disposable {
|
||||
|
||||
// Load the initial contents of the view model
|
||||
this.viewModel.initialize()
|
||||
.then((accounts: data.Account[]) => {
|
||||
.then((accounts: sqlops.Account[]) => {
|
||||
this.updateAccountList(accounts);
|
||||
});
|
||||
}
|
||||
@@ -147,7 +147,7 @@ export class AccountPicker extends Disposable {
|
||||
}
|
||||
|
||||
// PRIVATE HELPERS /////////////////////////////////////////////////////
|
||||
private onAccountSelectionChange(account: data.Account) {
|
||||
private onAccountSelectionChange(account: sqlops.Account) {
|
||||
this.viewModel.selectedAccount = account;
|
||||
if (account && account.isStale) {
|
||||
this._refreshAccountAction.account = account;
|
||||
@@ -194,7 +194,7 @@ export class AccountPicker extends Disposable {
|
||||
return null;
|
||||
}
|
||||
|
||||
private updateAccountList(accounts: data.Account[]): void {
|
||||
private updateAccountList(accounts: sqlops.Account[]): void {
|
||||
// keep the selection to the current one
|
||||
let selectedElements = this._accountList.getSelectedElements();
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
import { IAccountPickerService } from 'sql/parts/accountManagement/common/interfaces';
|
||||
import { AccountPicker } from 'sql/parts/accountManagement/accountPicker/accountPicker';
|
||||
@@ -26,8 +26,8 @@ export class AccountPickerService implements IAccountPickerService {
|
||||
private _addAccountStartEmitter: Emitter<void>;
|
||||
public get addAccountStartEvent(): Event<void> { return this._addAccountStartEmitter.event; }
|
||||
|
||||
private _onAccountSelectionChangeEvent: Emitter<data.Account>;
|
||||
public get onAccountSelectionChangeEvent(): Event<data.Account> { return this._onAccountSelectionChangeEvent.event; }
|
||||
private _onAccountSelectionChangeEvent: Emitter<sqlops.Account>;
|
||||
public get onAccountSelectionChangeEvent(): Event<sqlops.Account> { return this._onAccountSelectionChangeEvent.event; }
|
||||
|
||||
constructor(
|
||||
@IInstantiationService private _instantiationService: IInstantiationService
|
||||
@@ -36,13 +36,13 @@ export class AccountPickerService implements IAccountPickerService {
|
||||
this._addAccountCompleteEmitter = new Emitter<void>();
|
||||
this._addAccountErrorEmitter = new Emitter<string>();
|
||||
this._addAccountStartEmitter = new Emitter<void>();
|
||||
this._onAccountSelectionChangeEvent = new Emitter<data.Account>();
|
||||
this._onAccountSelectionChangeEvent = new Emitter<sqlops.Account>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get selected account
|
||||
*/
|
||||
public get selectedAccount(): data.Account {
|
||||
public get selectedAccount(): sqlops.Account {
|
||||
return this._accountPicker.viewModel.selectedAccount;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
|
||||
import { IAccountManagementService } from 'sql/services/accountManagement/interfaces';
|
||||
@@ -18,7 +18,7 @@ export class AccountPickerViewModel {
|
||||
private _updateAccountListEmitter: Emitter<UpdateAccountListEventParams>;
|
||||
public get updateAccountListEvent(): Event<UpdateAccountListEventParams> { return this._updateAccountListEmitter.event; }
|
||||
|
||||
public selectedAccount: data.Account;
|
||||
public selectedAccount: sqlops.Account;
|
||||
|
||||
constructor(
|
||||
private _providerId: string,
|
||||
@@ -38,7 +38,7 @@ export class AccountPickerViewModel {
|
||||
* Loads an initial list of accounts from the account management service
|
||||
* @return {Thenable<Account[]>} Promise to return the list of accounts
|
||||
*/
|
||||
public initialize(): Thenable<data.Account[]> {
|
||||
public initialize(): Thenable<sqlops.Account[]> {
|
||||
// Load a baseline of the accounts for the provider
|
||||
return this._accountManagementService.getAccountsForProvider(this._providerId)
|
||||
.then(null, () => {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { localize } from 'vs/nls';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
@@ -55,16 +55,16 @@ export class AddAccountAction extends Action {
|
||||
return new TPromise((resolve, reject) => {
|
||||
self._accountManagementService.addAccount(self._providerId)
|
||||
.then(
|
||||
() => {
|
||||
self._addAccountCompleteEmitter.fire();
|
||||
resolve(true);
|
||||
},
|
||||
err => {
|
||||
error(`Error while adding account: ${err}`);
|
||||
self._addAccountErrorEmitter.fire(err);
|
||||
self._addAccountCompleteEmitter.fire();
|
||||
reject(err);
|
||||
}
|
||||
() => {
|
||||
self._addAccountCompleteEmitter.fire();
|
||||
resolve(true);
|
||||
},
|
||||
err => {
|
||||
error(`Error while adding account: ${err}`);
|
||||
self._addAccountErrorEmitter.fire(err);
|
||||
self._addAccountCompleteEmitter.fire();
|
||||
reject(err);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -78,7 +78,7 @@ export class RemoveAccountAction extends Action {
|
||||
public static LABEL = localize('removeAccount', 'Remove account');
|
||||
|
||||
constructor(
|
||||
private _account: data.Account,
|
||||
private _account: sqlops.Account,
|
||||
@IMessageService private _messageService: IMessageService,
|
||||
@IErrorMessageService private _errorMessageService: IErrorMessageService,
|
||||
@IAccountManagementService private _accountManagementService: IAccountManagementService
|
||||
@@ -143,7 +143,7 @@ export class ApplyFilterAction extends Action {
|
||||
export class RefreshAccountAction extends Action {
|
||||
public static ID = 'account.refresh';
|
||||
public static LABEL = localize('refreshAccount', 'Reenter your credentials');
|
||||
public account: data.Account;
|
||||
public account: sqlops.Account;
|
||||
|
||||
constructor(
|
||||
@IAccountManagementService private _accountManagementService: IAccountManagementService
|
||||
@@ -156,14 +156,14 @@ export class RefreshAccountAction extends Action {
|
||||
if (self.account) {
|
||||
self._accountManagementService.refreshAccount(self.account)
|
||||
.then(
|
||||
() => {
|
||||
resolve(true);
|
||||
},
|
||||
err => {
|
||||
error(`Error while refreshing account: ${err}`);
|
||||
reject(err);
|
||||
}
|
||||
);
|
||||
() => {
|
||||
resolve(true);
|
||||
},
|
||||
err => {
|
||||
error(`Error while refreshing account: ${err}`);
|
||||
reject(err);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
let errorMessage = localize('NoAccountToRefresh', 'There is no account to refresh');
|
||||
reject(errorMessage);
|
||||
|
||||
@@ -15,20 +15,20 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
|
||||
import { RemoveAccountAction, RefreshAccountAction } from 'sql/parts/accountManagement/common/accountActions';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
export class AccountListDelegate implements IDelegate<data.Account> {
|
||||
export class AccountListDelegate implements IDelegate<sqlops.Account> {
|
||||
|
||||
constructor(
|
||||
private _height: number
|
||||
) {
|
||||
}
|
||||
|
||||
public getHeight(element: data.Account): number {
|
||||
public getHeight(element: sqlops.Account): number {
|
||||
return this._height;
|
||||
}
|
||||
|
||||
public getTemplateId(element: data.Account): string {
|
||||
public getTemplateId(element: sqlops.Account): string {
|
||||
return 'accountListRenderer';
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ export interface AccountListTemplate {
|
||||
actions?: ActionBar;
|
||||
}
|
||||
|
||||
export class AccountPickerListRenderer implements IRenderer<data.Account, AccountListTemplate> {
|
||||
export class AccountPickerListRenderer implements IRenderer<sqlops.Account, AccountListTemplate> {
|
||||
public static TEMPLATE_ID = 'accountListRenderer';
|
||||
|
||||
public get templateId(): string {
|
||||
@@ -64,7 +64,7 @@ export class AccountPickerListRenderer implements IRenderer<data.Account, Accoun
|
||||
return tableTemplate;
|
||||
}
|
||||
|
||||
public renderElement(account: data.Account, index: number, templateData: AccountListTemplate): void {
|
||||
public renderElement(account: sqlops.Account, index: number, templateData: AccountListTemplate): void {
|
||||
// Set the account icon
|
||||
templateData.icon.classList.add('account-logo', account.displayInfo.accountType);
|
||||
|
||||
@@ -101,7 +101,7 @@ export class AccountListRenderer extends AccountPickerListRenderer {
|
||||
return tableTemplate;
|
||||
}
|
||||
|
||||
public renderElement(account: data.Account, index: number, templateData: AccountListTemplate): void {
|
||||
public renderElement(account: sqlops.Account, index: number, templateData: AccountListTemplate): void {
|
||||
super.renderElement(account, index, templateData);
|
||||
if (account.isStale) {
|
||||
templateData.content.innerText = localize('refreshCredentials', 'You need to refresh the credentials for this account.');
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import Event from 'vs/base/common/event';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
|
||||
@@ -26,7 +26,7 @@ export interface IResourceProviderService {
|
||||
/**
|
||||
* Register a resource provider
|
||||
*/
|
||||
registerProvider(providerId: string, provider: data.ResourceProvider): void;
|
||||
registerProvider(providerId: string, provider: sqlops.ResourceProvider): void;
|
||||
|
||||
/**
|
||||
* Unregister a resource provider
|
||||
@@ -36,7 +36,7 @@ export interface IResourceProviderService {
|
||||
/**
|
||||
* Create a firewall rule
|
||||
*/
|
||||
createFirewallRule(selectedAccount: data.Account, firewallruleInfo: data.FirewallRuleInfo, resourceProviderId: string): Promise<data.CreateFirewallRuleResponse>;
|
||||
createFirewallRule(selectedAccount: sqlops.Account, firewallruleInfo: sqlops.FirewallRuleInfo, resourceProviderId: string): Promise<sqlops.CreateFirewallRuleResponse>;
|
||||
|
||||
/**
|
||||
* handle a firewall rule
|
||||
@@ -56,6 +56,6 @@ export interface IAccountPickerService {
|
||||
addAccountCompleteEvent: Event<void>;
|
||||
addAccountErrorEvent: Event<string>;
|
||||
addAccountStartEvent: Event<void>;
|
||||
onAccountSelectionChangeEvent: Event<data.Account>;
|
||||
selectedAccount: data.Account;
|
||||
onAccountSelectionChangeEvent: Event<sqlops.Account>;
|
||||
selectedAccount: sqlops.Account;
|
||||
}
|
||||
|
||||
@@ -14,12 +14,12 @@ import * as TelemetryKeys from 'sql/common/telemetryKeys';
|
||||
import * as TelemetryUtils from 'sql/common/telemetryUtilities';
|
||||
import { FirewallRuleDialogController } from 'sql/parts/accountManagement/firewallRuleDialog/firewallRuleDialogController';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
export class ResourceProviderService implements IResourceProviderService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
private _providers: { [handle: string]: data.ResourceProvider; } = Object.create(null);
|
||||
private _providers: { [handle: string]: sqlops.ResourceProvider; } = Object.create(null);
|
||||
private _firewallRuleDialogController: FirewallRuleDialogController;
|
||||
|
||||
constructor(
|
||||
@@ -44,8 +44,8 @@ export class ResourceProviderService implements IResourceProviderService {
|
||||
/**
|
||||
* Create a firewall rule
|
||||
*/
|
||||
public createFirewallRule(selectedAccount: data.Account, firewallruleInfo: data.FirewallRuleInfo, resourceProviderId: string): Promise<data.CreateFirewallRuleResponse> {
|
||||
return new Promise<data.CreateFirewallRuleResponse>((resolve, reject) => {
|
||||
public createFirewallRule(selectedAccount: sqlops.Account, firewallruleInfo: sqlops.FirewallRuleInfo, resourceProviderId: string): Promise<sqlops.CreateFirewallRuleResponse> {
|
||||
return new Promise<sqlops.CreateFirewallRuleResponse>((resolve, reject) => {
|
||||
let provider = this._providers[resourceProviderId];
|
||||
if (provider) {
|
||||
TelemetryUtils.addTelemetry(this._telemetryService, TelemetryKeys.FirewallRuleRequested, { provider: resourceProviderId });
|
||||
@@ -96,7 +96,7 @@ export class ResourceProviderService implements IResourceProviderService {
|
||||
/**
|
||||
* Register a resource provider
|
||||
*/
|
||||
public registerProvider(providerId: string, provider: data.ResourceProvider): void {
|
||||
public registerProvider(providerId: string, provider: sqlops.ResourceProvider): void {
|
||||
this._providers[providerId] = provider;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IWindowsService } from 'vs/platform/windows/common/windows';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { Button } from 'sql/base/browser/ui/button/button';
|
||||
import { Modal } from 'sql/base/browser/ui/modal/modal';
|
||||
import { FirewallRuleViewModel } from 'sql/parts/accountManagement/firewallRuleDialog/firewallRuleViewModel';
|
||||
@@ -291,7 +291,7 @@ export class FirewallRuleDialog extends Modal {
|
||||
}
|
||||
}
|
||||
|
||||
public onAccountSelectionChange(account: data.Account): void {
|
||||
public onAccountSelectionChange(account: sqlops.Account): void {
|
||||
this.viewModel.selectedAccount = account;
|
||||
if (account && !account.isStale) {
|
||||
this._createButton.enabled = true;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { localize } from 'vs/nls';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
import { IErrorMessageService } from 'sql/parts/connection/common/connectionManagement';
|
||||
@@ -62,7 +62,7 @@ export class FirewallRuleDialogController {
|
||||
let resourceProviderId = this._resourceProviderId;
|
||||
|
||||
this._accountManagementService.getSecurityToken(this._firewallRuleDialog.viewModel.selectedAccount).then(tokenMappings => {
|
||||
let firewallRuleInfo: data.FirewallRuleInfo = {
|
||||
let firewallRuleInfo: sqlops.FirewallRuleInfo = {
|
||||
startIpAddress: this._firewallRuleDialog.viewModel.isIPAddressSelected ? this._firewallRuleDialog.viewModel.defaultIPAddress : this._firewallRuleDialog.viewModel.fromSubnetIPRange,
|
||||
endIpAddress: this._firewallRuleDialog.viewModel.isIPAddressSelected ? this._firewallRuleDialog.viewModel.defaultIPAddress : this._firewallRuleDialog.viewModel.toSubnetIPRange,
|
||||
serverName: this._connection.serverName,
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
/**
|
||||
* View model for firewall rule dialog
|
||||
*/
|
||||
export class FirewallRuleViewModel {
|
||||
public isIPAddressSelected: boolean;
|
||||
public selectedAccount: data.Account;
|
||||
public selectedAccount: sqlops.Account;
|
||||
|
||||
private _defaultIPAddress: string;
|
||||
private _defaultFromSubnetIPRange: string;
|
||||
|
||||
@@ -18,32 +18,32 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
export const IAdminService = createDecorator<IAdminService>(SERVICE_ID);
|
||||
|
||||
export interface IAdminService {
|
||||
_serviceBrand: any;
|
||||
|
||||
registerProvider(providerId: string, provider: data.AdminServicesProvider): void;
|
||||
registerProvider(providerId: string, provider: sqlops.AdminServicesProvider): void;
|
||||
|
||||
showCreateDatabaseWizard(uri: string, connection: IConnectionProfile): Promise<any>;
|
||||
|
||||
showCreateLoginWizard(uri: string, connection: IConnectionProfile): Promise<any>;
|
||||
|
||||
createDatabase(connectionUri: string, database: data.DatabaseInfo): Thenable<data.CreateDatabaseResponse>;
|
||||
createDatabase(connectionUri: string, database: sqlops.DatabaseInfo): Thenable<sqlops.CreateDatabaseResponse>;
|
||||
|
||||
getDefaultDatabaseInfo(connectionUri: string): Thenable<data.DatabaseInfo>;
|
||||
getDefaultDatabaseInfo(connectionUri: string): Thenable<sqlops.DatabaseInfo>;
|
||||
|
||||
getDatabaseInfo(connectionUri: string): Thenable<data.DatabaseInfo>;
|
||||
getDatabaseInfo(connectionUri: string): Thenable<sqlops.DatabaseInfo>;
|
||||
}
|
||||
|
||||
export class AdminService implements IAdminService {
|
||||
_serviceBrand: any;
|
||||
|
||||
private _providers: { [handle: string]: data.AdminServicesProvider; } = Object.create(null);
|
||||
private _providers: { [handle: string]: sqlops.AdminServicesProvider; } = Object.create(null);
|
||||
|
||||
private _providerOptions: { [handle: string]: data.AdminServicesOptions; } = Object.create(null);
|
||||
private _providerOptions: { [handle: string]: sqlops.AdminServicesOptions; } = Object.create(null);
|
||||
|
||||
constructor(
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@@ -58,7 +58,7 @@ export class AdminService implements IAdminService {
|
||||
}
|
||||
}
|
||||
|
||||
private _runAction<T>(uri: string, action: (handler: data.AdminServicesProvider) => Thenable<T>): Thenable<T> {
|
||||
private _runAction<T>(uri: string, action: (handler: sqlops.AdminServicesProvider) => Thenable<T>): Thenable<T> {
|
||||
let providerId: string = this._connectionService.getProviderIdFromUri(uri);
|
||||
|
||||
if (!providerId) {
|
||||
@@ -81,7 +81,7 @@ export class AdminService implements IAdminService {
|
||||
});
|
||||
}
|
||||
|
||||
public createDatabase(connectionUri: string, database: data.DatabaseInfo): Thenable<data.CreateDatabaseResponse> {
|
||||
public createDatabase(connectionUri: string, database: sqlops.DatabaseInfo): Thenable<sqlops.CreateDatabaseResponse> {
|
||||
let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri);
|
||||
if (providerId) {
|
||||
let provider = this._providers[providerId];
|
||||
@@ -104,7 +104,7 @@ export class AdminService implements IAdminService {
|
||||
});
|
||||
}
|
||||
|
||||
public createLogin(connectionUri: string, login: data.LoginInfo): Thenable<data.CreateLoginResponse> {
|
||||
public createLogin(connectionUri: string, login: sqlops.LoginInfo): Thenable<sqlops.CreateLoginResponse> {
|
||||
let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri);
|
||||
if (providerId) {
|
||||
let provider = this._providers[providerId];
|
||||
@@ -115,7 +115,7 @@ export class AdminService implements IAdminService {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
public getDefaultDatabaseInfo(connectionUri: string): Thenable<data.DatabaseInfo> {
|
||||
public getDefaultDatabaseInfo(connectionUri: string): Thenable<sqlops.DatabaseInfo> {
|
||||
let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri);
|
||||
if (providerId) {
|
||||
let provider = this._providers[providerId];
|
||||
@@ -126,13 +126,13 @@ export class AdminService implements IAdminService {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
public getDatabaseInfo(connectionUri: string): Thenable<data.DatabaseInfo> {
|
||||
public getDatabaseInfo(connectionUri: string): Thenable<sqlops.DatabaseInfo> {
|
||||
return this._runAction(connectionUri, (runner) => {
|
||||
return runner.getDatabaseInfo(connectionUri);
|
||||
});
|
||||
}
|
||||
|
||||
public registerProvider(providerId: string, provider: data.AdminServicesProvider): void {
|
||||
public registerProvider(providerId: string, provider: sqlops.AdminServicesProvider): void {
|
||||
this._providers[providerId] = provider;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,18 +11,18 @@ import { ConnectionManagementInfo } from 'sql/parts/connection/common/connection
|
||||
import { IAdminService } from 'sql/parts/admin/common/adminService';
|
||||
import { ITaskDialogComponent } from 'sql/parts/tasks/common/tasks';
|
||||
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as nls from 'vs/nls';
|
||||
|
||||
export const CREATEDATABASE_SELECTOR: string = 'createdatabase-component';
|
||||
|
||||
export interface DatabaseFile {
|
||||
logicalName: string;
|
||||
fileType: string;
|
||||
filegroup: string;
|
||||
initialSize: string;
|
||||
autogrow: string;
|
||||
path: string;
|
||||
logicalName: string;
|
||||
fileType: string;
|
||||
filegroup: string;
|
||||
initialSize: string;
|
||||
autogrow: string;
|
||||
path: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@@ -31,43 +31,43 @@ export interface DatabaseFile {
|
||||
})
|
||||
export class CreateDatabaseComponent implements ITaskDialogComponent {
|
||||
|
||||
private _adminService: IAdminService;
|
||||
private _adminService: IAdminService;
|
||||
|
||||
public formSubmitted: boolean = false;
|
||||
public formSubmitted: boolean = false;
|
||||
|
||||
public ownerUri: string;
|
||||
|
||||
public connection: ConnectionManagementInfo;
|
||||
|
||||
public databaseFiles: DatabaseFile[] = [];
|
||||
public databaseFiles: DatabaseFile[] = [];
|
||||
|
||||
// tslint:disable:no-unused-variable
|
||||
private readonly databaseFilesLabel: string = nls.localize('createDatabase.databaseFiles', 'Database files:');
|
||||
private readonly noRecordsFoundLabel: string = nls.localize('createDatabase.noRecordsFound', 'No records found');
|
||||
// tslint:enable:no-unused-variable
|
||||
// tslint:disable:no-unused-variable
|
||||
private readonly databaseFilesLabel: string = nls.localize('createDatabase.databaseFiles', 'Database files:');
|
||||
private readonly noRecordsFoundLabel: string = nls.localize('createDatabase.noRecordsFound', 'No records found');
|
||||
// tslint:enable:no-unused-variable
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeDetectorRef: ChangeDetectorRef,
|
||||
@Inject(BOOTSTRAP_SERVICE_ID) private _bootstrapService: IBootstrapService
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeDetectorRef: ChangeDetectorRef,
|
||||
@Inject(BOOTSTRAP_SERVICE_ID) private _bootstrapService: IBootstrapService
|
||||
) {
|
||||
this._adminService = this._bootstrapService.adminService;
|
||||
this._adminService = this._bootstrapService.adminService;
|
||||
}
|
||||
|
||||
private getDatabaseInfo(form: NgForm): data.DatabaseInfo {
|
||||
return <data.DatabaseInfo>{
|
||||
options: {
|
||||
name: form.value.databaseName,
|
||||
owner: form.value.databaseOwner
|
||||
}
|
||||
};
|
||||
}
|
||||
private getDatabaseInfo(form: NgForm): sqlops.DatabaseInfo {
|
||||
return <sqlops.DatabaseInfo>{
|
||||
options: {
|
||||
name: form.value.databaseName,
|
||||
owner: form.value.databaseOwner
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public onSubmit(form: NgForm): void {
|
||||
this._adminService.createDatabase(this.ownerUri, this.getDatabaseInfo(form));
|
||||
this.formSubmitted = true;
|
||||
this._changeDetectorRef.detectChanges();
|
||||
}
|
||||
public onSubmit(form: NgForm): void {
|
||||
this._adminService.createDatabase(this.ownerUri, this.getDatabaseInfo(form));
|
||||
this.formSubmitted = true;
|
||||
this._changeDetectorRef.detectChanges();
|
||||
}
|
||||
|
||||
public onOk(): void { }
|
||||
|
||||
@@ -75,24 +75,24 @@ export class CreateDatabaseComponent implements ITaskDialogComponent {
|
||||
|
||||
public onCancel(): void { }
|
||||
|
||||
public onSelectOwner(): void { }
|
||||
public onSelectOwner(): void { }
|
||||
|
||||
public injectBootstapper(parameters: TaskDialogComponentParams ): void {
|
||||
let self = this;
|
||||
this.ownerUri = parameters.ownerUri;
|
||||
this._adminService.getDefaultDatabaseInfo(this.ownerUri).then(dbInfo => {
|
||||
let databaseFilesCount = dbInfo.options['databaseFilesCount'];
|
||||
for (let i = 0; i < databaseFilesCount; ++i) {
|
||||
self.databaseFiles[i] = {
|
||||
logicalName: dbInfo.options['databaseFiles.' + i + '.name'],
|
||||
fileType: dbInfo.options['databaseFiles.' + i + '.databaseFileType'],
|
||||
filegroup: dbInfo.options['databaseFiles.' + i + '.fileGroup'],
|
||||
initialSize: dbInfo.options['databaseFiles.' + i + '.initialSize'],
|
||||
autogrow: dbInfo.options['databaseFiles.' + i + '.autogrowth'],
|
||||
path: dbInfo.options['databaseFiles.' + i + '.folder']
|
||||
};
|
||||
}
|
||||
self._changeDetectorRef.detectChanges();
|
||||
public injectBootstapper(parameters: TaskDialogComponentParams): void {
|
||||
let self = this;
|
||||
this.ownerUri = parameters.ownerUri;
|
||||
this._adminService.getDefaultDatabaseInfo(this.ownerUri).then(dbInfo => {
|
||||
let databaseFilesCount = dbInfo.options['databaseFilesCount'];
|
||||
for (let i = 0; i < databaseFilesCount; ++i) {
|
||||
self.databaseFiles[i] = {
|
||||
logicalName: dbInfo.options['databaseFiles.' + i + '.name'],
|
||||
fileType: dbInfo.options['databaseFiles.' + i + '.databaseFileType'],
|
||||
filegroup: dbInfo.options['databaseFiles.' + i + '.fileGroup'],
|
||||
initialSize: dbInfo.options['databaseFiles.' + i + '.initialSize'],
|
||||
autogrow: dbInfo.options['databaseFiles.' + i + '.autogrowth'],
|
||||
path: dbInfo.options['databaseFiles.' + i + '.folder']
|
||||
};
|
||||
}
|
||||
self._changeDetectorRef.detectChanges();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,12 +9,12 @@ import * as Utils from './utils';
|
||||
import { IConnectionProfile, IConnectionProfileStore } from './interfaces';
|
||||
import { IConnectionConfig } from './iconnectionConfig';
|
||||
import { ConnectionProfileGroup, IConnectionProfileGroup } from './connectionProfileGroup';
|
||||
import { ConfigurationEditingService, IConfigurationValue, IConfigurationValue as TConfigurationValue } from 'vs/workbench/services/configuration/node/configurationEditingService';
|
||||
import { ConfigurationEditingService, IConfigurationValue } from 'vs/workbench/services/configuration/node/configurationEditingService';
|
||||
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
|
||||
import { ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
import { ConnectionProfile } from './connectionProfile';
|
||||
import { ICapabilitiesService } from 'sql/services/capabilities/capabilitiesService';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as nls from 'vs/nls';
|
||||
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
@@ -29,7 +29,7 @@ export interface ISaveGroupResult {
|
||||
*/
|
||||
export class ConnectionConfig implements IConnectionConfig {
|
||||
|
||||
private _providerCapabilitiesMap: { [providerName: string]: data.DataProtocolServerCapabilities };
|
||||
private _providerCapabilitiesMap: { [providerName: string]: sqlops.DataProtocolServerCapabilities };
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
@@ -37,7 +37,7 @@ export class ConnectionConfig implements IConnectionConfig {
|
||||
private _configurationEditService: ConfigurationEditingService,
|
||||
private _workspaceConfigurationService: IWorkspaceConfigurationService,
|
||||
private _capabilitiesService: ICapabilitiesService,
|
||||
cachedMetadata?: data.DataProtocolServerCapabilities[]
|
||||
cachedMetadata?: sqlops.DataProtocolServerCapabilities[]
|
||||
) {
|
||||
this._providerCapabilitiesMap = {};
|
||||
this.setCachedMetadata(cachedMetadata);
|
||||
@@ -48,7 +48,7 @@ export class ConnectionConfig implements IConnectionConfig {
|
||||
}
|
||||
}
|
||||
|
||||
public setCachedMetadata(cachedMetadata: data.DataProtocolServerCapabilities[]): void {
|
||||
public setCachedMetadata(cachedMetadata: sqlops.DataProtocolServerCapabilities[]): void {
|
||||
if (cachedMetadata) {
|
||||
cachedMetadata.forEach(item => {
|
||||
this.updateCapabilitiesCache(item.providerName, item);
|
||||
@@ -81,13 +81,13 @@ export class ConnectionConfig implements IConnectionConfig {
|
||||
return allGroups;
|
||||
}
|
||||
|
||||
private updateCapabilitiesCache(providerName: string, providerCapabilities: data.DataProtocolServerCapabilities): void {
|
||||
private updateCapabilitiesCache(providerName: string, providerCapabilities: sqlops.DataProtocolServerCapabilities): void {
|
||||
if (providerName && providerCapabilities) {
|
||||
this._providerCapabilitiesMap[providerName] = providerCapabilities;
|
||||
}
|
||||
}
|
||||
|
||||
private getCapabilitiesFromCache(providerName: string): data.DataProtocolServerCapabilities {
|
||||
private getCapabilitiesFromCache(providerName: string): sqlops.DataProtocolServerCapabilities {
|
||||
if (providerName in this._providerCapabilitiesMap) {
|
||||
return this._providerCapabilitiesMap[providerName];
|
||||
}
|
||||
@@ -99,8 +99,8 @@ export class ConnectionConfig implements IConnectionConfig {
|
||||
* Gets the data from the metadata stored in the config
|
||||
* @param providerName Provider Name
|
||||
*/
|
||||
public getCapabilities(providerName: string): data.DataProtocolServerCapabilities {
|
||||
let result: data.DataProtocolServerCapabilities = this.getCapabilitiesFromCache(providerName);
|
||||
public getCapabilities(providerName: string): sqlops.DataProtocolServerCapabilities {
|
||||
let result: sqlops.DataProtocolServerCapabilities = this.getCapabilitiesFromCache(providerName);
|
||||
if (result) {
|
||||
return result;
|
||||
} else {
|
||||
@@ -159,7 +159,7 @@ export class ConnectionConfig implements IConnectionConfig {
|
||||
});
|
||||
}
|
||||
|
||||
private getConnectionProfileInstance(profile: IConnectionProfile, groupId: string, providerCapabilities: data.DataProtocolServerCapabilities): ConnectionProfile {
|
||||
private getConnectionProfileInstance(profile: IConnectionProfile, groupId: string, providerCapabilities: sqlops.DataProtocolServerCapabilities): ConnectionProfile {
|
||||
let connectionProfile = profile as ConnectionProfile;
|
||||
if (connectionProfile === undefined) {
|
||||
connectionProfile = new ConnectionProfile(providerCapabilities, profile);
|
||||
@@ -519,7 +519,7 @@ export class ConnectionConfig implements IConnectionConfig {
|
||||
*/
|
||||
private getConfiguration(key: string): any {
|
||||
let configs: any;
|
||||
configs = this._workspaceConfigurationService.inspect<IConnectionProfileStore[] | IConnectionProfileGroup[] | data.DataProtocolServerCapabilities[]>(key);
|
||||
configs = this._workspaceConfigurationService.inspect<IConnectionProfileStore[] | IConnectionProfileGroup[] | sqlops.DataProtocolServerCapabilities[]>(key);
|
||||
return configs;
|
||||
}
|
||||
|
||||
@@ -530,7 +530,7 @@ export class ConnectionConfig implements IConnectionConfig {
|
||||
*/
|
||||
private writeConfiguration(
|
||||
key: string,
|
||||
profiles: IConnectionProfileStore[] | IConnectionProfileGroup[] | data.DataProtocolServerCapabilities[],
|
||||
profiles: IConnectionProfileStore[] | IConnectionProfileGroup[] | sqlops.DataProtocolServerCapabilities[],
|
||||
target: ConfigurationTarget = ConfigurationTarget.USER): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
let configValue: IConfigurationValue = {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { ConnectionSummary } from 'data';
|
||||
import { ConnectionSummary } from 'sqlops';
|
||||
import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar';
|
||||
import * as LocalizedConstants from 'sql/parts/connection/common/localizedConstants';
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import Event from 'vs/base/common/event';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import { IConnectionProfileGroup, ConnectionProfileGroup } from 'sql/parts/connection/common/connectionProfileGroup';
|
||||
import { ConnectionProfile } from 'sql/parts/connection/common/connectionProfile';
|
||||
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
@@ -81,7 +81,7 @@ export interface IConnectionManagementService {
|
||||
onConnect: Event<IConnectionParams>;
|
||||
onDisconnect: Event<IConnectionParams>;
|
||||
onConnectionChanged: Event<IConnectionParams>;
|
||||
onLanguageFlavorChanged: Event<data.DidChangeLanguageFlavorParams>;
|
||||
onLanguageFlavorChanged: Event<sqlops.DidChangeLanguageFlavorParams>;
|
||||
|
||||
/**
|
||||
* Opens the connection dialog to create new connection
|
||||
@@ -124,11 +124,11 @@ export interface IConnectionManagementService {
|
||||
/**
|
||||
* Adds the successful connection to MRU and send the connection error back to the connection handler for failed connections
|
||||
*/
|
||||
onConnectionComplete(handle: number, connectionInfoSummary: data.ConnectionInfoSummary): void;
|
||||
onConnectionComplete(handle: number, connectionInfoSummary: sqlops.ConnectionInfoSummary): void;
|
||||
|
||||
onIntelliSenseCacheComplete(handle: number, connectionUri: string): void;
|
||||
|
||||
onConnectionChangedNotification(handle: number, changedConnInfo: data.ChangedConnectionInfo);
|
||||
onConnectionChangedNotification(handle: number, changedConnInfo: sqlops.ChangedConnectionInfo);
|
||||
|
||||
getConnectionGroups(): ConnectionProfileGroup[];
|
||||
|
||||
@@ -150,7 +150,7 @@ export interface IConnectionManagementService {
|
||||
|
||||
deleteConnectionGroup(group: ConnectionProfileGroup): Promise<boolean>;
|
||||
|
||||
getAdvancedProperties(): data.ConnectionOption[];
|
||||
getAdvancedProperties(): sqlops.ConnectionOption[];
|
||||
|
||||
getConnectionId(connectionProfile: IConnectionProfile): string;
|
||||
|
||||
@@ -180,12 +180,12 @@ export interface IConnectionManagementService {
|
||||
|
||||
addSavedPassword(connectionProfile: IConnectionProfile): Promise<IConnectionProfile>;
|
||||
|
||||
listDatabases(connectionUri: string): Thenable<data.ListDatabasesResult>;
|
||||
listDatabases(connectionUri: string): Thenable<sqlops.ListDatabasesResult>;
|
||||
|
||||
/**
|
||||
* Register a connection provider
|
||||
*/
|
||||
registerProvider(providerId: string, provider: data.ConnectionProvider): void;
|
||||
registerProvider(providerId: string, provider: sqlops.ConnectionProvider): void;
|
||||
|
||||
editGroup(group: ConnectionProfileGroup): Promise<void>;
|
||||
|
||||
@@ -216,7 +216,7 @@ export interface IConnectionManagementService {
|
||||
|
||||
hasRegisteredServers(): boolean;
|
||||
|
||||
getCapabilities(providerName: string): data.DataProtocolServerCapabilities;
|
||||
getCapabilities(providerName: string): sqlops.DataProtocolServerCapabilities;
|
||||
|
||||
canChangeConnectionConfig(profile: ConnectionProfile, newGroupID: string): boolean;
|
||||
|
||||
@@ -305,7 +305,7 @@ export interface INewConnectionParams {
|
||||
connectionType: ConnectionType;
|
||||
input?: IConnectableInput;
|
||||
runQueryOnCompletion?: RunQueryOnConnectionMode;
|
||||
querySelection?: data.ISelectionData;
|
||||
querySelection?: sqlops.ISelectionData;
|
||||
showDashboard?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import { ConnectionProfile } from 'sql/parts/connection/common/connectionProfile';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { StopWatch } from 'vs/base/common/stopwatch';
|
||||
|
||||
/**
|
||||
@@ -64,7 +64,7 @@ export class ConnectionManagementInfo {
|
||||
/**
|
||||
* Information about the connected server.
|
||||
*/
|
||||
serverInfo: data.ServerInfo;
|
||||
serverInfo: sqlops.ServerInfo;
|
||||
|
||||
/**
|
||||
* Owner uri assigned to the connection
|
||||
|
||||
@@ -31,7 +31,7 @@ import { IResourceProviderService } from 'sql/parts/accountManagement/common/int
|
||||
import { IAngularEventingService, AngularEventType } from 'sql/services/angularEventing/angularEventingService';
|
||||
import * as QueryConstants from 'sql/parts/query/common/constants';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
import * as nls from 'vs/nls';
|
||||
import * as errors from 'vs/base/common/errors';
|
||||
@@ -64,7 +64,7 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
|
||||
private disposables: IDisposable[] = [];
|
||||
|
||||
private _providers: { [handle: string]: data.ConnectionProvider; } = Object.create(null);
|
||||
private _providers: { [handle: string]: sqlops.ConnectionProvider; } = Object.create(null);
|
||||
|
||||
private _uriToProvider: { [uri: string]: string; } = Object.create(null);
|
||||
|
||||
@@ -76,7 +76,7 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
private _onDisconnect: Emitter<IConnectionParams>;
|
||||
private _onConnectRequestSent: Emitter<void>;
|
||||
private _onConnectionChanged: Emitter<IConnectionParams>;
|
||||
private _onLanguageFlavorChanged: Emitter<data.DidChangeLanguageFlavorParams>;
|
||||
private _onLanguageFlavorChanged: Emitter<sqlops.DidChangeLanguageFlavorParams>;
|
||||
|
||||
private _connectionGlobalStatus: ConnectionGlobalStatus;
|
||||
|
||||
@@ -126,7 +126,7 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
this._onDisconnect = new Emitter<IConnectionParams>();
|
||||
this._onConnectionChanged = new Emitter<IConnectionParams>();
|
||||
this._onConnectRequestSent = new Emitter<void>();
|
||||
this._onLanguageFlavorChanged = new Emitter<data.DidChangeLanguageFlavorParams>();
|
||||
this._onLanguageFlavorChanged = new Emitter<sqlops.DidChangeLanguageFlavorParams>();
|
||||
|
||||
this._onProvidersReady = new Deferred();
|
||||
|
||||
@@ -182,7 +182,7 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
return this._onConnectRequestSent.event;
|
||||
}
|
||||
|
||||
public get onLanguageFlavorChanged(): Event<data.DidChangeLanguageFlavorParams> {
|
||||
public get onLanguageFlavorChanged(): Event<sqlops.DidChangeLanguageFlavorParams> {
|
||||
return this._onLanguageFlavorChanged.event;
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
private _providerCount: number = 0;
|
||||
|
||||
// Connection Provider Registration
|
||||
public registerProvider(providerId: string, provider: data.ConnectionProvider): void {
|
||||
public registerProvider(providerId: string, provider: sqlops.ConnectionProvider): void {
|
||||
this._providers[providerId] = provider;
|
||||
|
||||
// temporarily close splash screen when a connection provider has been registered
|
||||
@@ -655,7 +655,7 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
return this._connectionStore.clearRecentlyUsed();
|
||||
}
|
||||
|
||||
public clearRecentConnection(connectionProfile: IConnectionProfile) : void {
|
||||
public clearRecentConnection(connectionProfile: IConnectionProfile): void {
|
||||
this._connectionStore.removeConnectionToMemento(connectionProfile, Constants.recentConnections);
|
||||
}
|
||||
|
||||
@@ -679,7 +679,7 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
return Object.keys(this._providers);
|
||||
}
|
||||
|
||||
public getCapabilities(providerName: string): data.DataProtocolServerCapabilities {
|
||||
public getCapabilities(providerName: string): sqlops.DataProtocolServerCapabilities {
|
||||
let capabilities = this._capabilitiesService.getCapabilities();
|
||||
if (capabilities !== undefined && capabilities.length > 0) {
|
||||
return capabilities.find(c => c.providerName === providerName);
|
||||
@@ -687,7 +687,7 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public getAdvancedProperties(): data.ConnectionOption[] {
|
||||
public getAdvancedProperties(): sqlops.ConnectionOption[] {
|
||||
|
||||
let capabilities = this._capabilitiesService.getCapabilities();
|
||||
if (capabilities !== undefined && capabilities.length > 0) {
|
||||
@@ -832,13 +832,13 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
});
|
||||
}
|
||||
|
||||
private sendListDatabasesRequest(uri: string): Thenable<data.ListDatabasesResult> {
|
||||
private sendListDatabasesRequest(uri: string): Thenable<sqlops.ListDatabasesResult> {
|
||||
let providerId: string = this.getProviderIdFromUri(uri);
|
||||
if (!providerId) {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
return new Promise<data.ListDatabasesResult>((resolve, reject) => {
|
||||
return new Promise<sqlops.ListDatabasesResult>((resolve, reject) => {
|
||||
let provider = this._providers[providerId];
|
||||
provider.listDatabases(uri).then(result => {
|
||||
if (result && result.databaseNames) {
|
||||
@@ -895,7 +895,7 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
});
|
||||
}
|
||||
|
||||
public onConnectionComplete(handle: number, info: data.ConnectionInfoSummary): void {
|
||||
public onConnectionComplete(handle: number, info: sqlops.ConnectionInfoSummary): void {
|
||||
const self = this;
|
||||
let connection = this._connectionStatusManager.onConnectionComplete(info);
|
||||
|
||||
@@ -923,7 +923,7 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
}
|
||||
}
|
||||
|
||||
public onConnectionChangedNotification(handle: number, changedConnInfo: data.ChangedConnectionInfo): void {
|
||||
public onConnectionChangedNotification(handle: number, changedConnInfo: sqlops.ChangedConnectionInfo): void {
|
||||
let profile: IConnectionProfile = this._connectionStatusManager.onConnectionChanged(changedConnInfo);
|
||||
this._notifyConnectionChanged(profile, changedConnInfo.connectionUri);
|
||||
}
|
||||
@@ -1023,28 +1023,26 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
const self = this;
|
||||
|
||||
return new Promise<IConnectionResult>((resolve, reject) => {
|
||||
this._capabilitiesService.onCapabilitiesReady().then(() => {
|
||||
let connectionInfo = this._connectionStatusManager.addConnection(connection, uri);
|
||||
// Setup the handler for the connection complete notification to call
|
||||
connectionInfo.connectHandler = ((connectResult, errorMessage, errorCode, callStack) => {
|
||||
let connectionMngInfo = this._connectionStatusManager.findConnection(uri);
|
||||
if (connectionMngInfo && connectionMngInfo.deleted) {
|
||||
let connectionInfo = this._connectionStatusManager.addConnection(connection, uri);
|
||||
// Setup the handler for the connection complete notification to call
|
||||
connectionInfo.connectHandler = ((connectResult, errorMessage, errorCode, callStack) => {
|
||||
let connectionMngInfo = this._connectionStatusManager.findConnection(uri);
|
||||
if (connectionMngInfo && connectionMngInfo.deleted) {
|
||||
this._connectionStatusManager.deleteConnection(uri);
|
||||
resolve({ connected: connectResult, errorMessage: undefined, errorCode: undefined, callStack: undefined, errorHandled: true });
|
||||
} else {
|
||||
if (errorMessage) {
|
||||
// Connection to the server failed
|
||||
this._connectionStatusManager.deleteConnection(uri);
|
||||
resolve({ connected: connectResult, errorMessage: undefined, errorCode: undefined, callStack: undefined, errorHandled: true });
|
||||
resolve({ connected: connectResult, errorMessage: errorMessage, errorCode: errorCode, callStack: callStack });
|
||||
} else {
|
||||
if (errorMessage) {
|
||||
// Connection to the server failed
|
||||
this._connectionStatusManager.deleteConnection(uri);
|
||||
resolve({ connected: connectResult, errorMessage: errorMessage, errorCode: errorCode, callStack: callStack });
|
||||
} else {
|
||||
resolve({ connected: connectResult, errorMessage: errorMessage, errorCode: errorCode, callStack: callStack });
|
||||
}
|
||||
resolve({ connected: connectResult, errorMessage: errorMessage, errorCode: errorCode, callStack: callStack });
|
||||
}
|
||||
});
|
||||
|
||||
// send connection request
|
||||
self.sendConnectRequest(connection, uri);
|
||||
}
|
||||
});
|
||||
|
||||
// send connection request
|
||||
self.sendConnectRequest(connection, uri);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1197,7 +1195,7 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
return this._connectionStatusManager.isConnected(fileUri) ? this._connectionStatusManager.findConnection(fileUri) : undefined;
|
||||
}
|
||||
|
||||
public listDatabases(connectionUri: string): Thenable<data.ListDatabasesResult> {
|
||||
public listDatabases(connectionUri: string): Thenable<sqlops.ListDatabasesResult> {
|
||||
const self = this;
|
||||
if (self.isConnected(connectionUri)) {
|
||||
return self.sendListDatabasesRequest(connectionUri);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import { ConnectionProfileGroup } from './connectionProfileGroup';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { ProviderConnectionInfo } from 'sql/parts/connection/common/providerConnectionInfo';
|
||||
import * as interfaces from 'sql/parts/connection/common/interfaces';
|
||||
import { equalsIgnoreCase } from 'vs/base/common/strings';
|
||||
@@ -28,7 +28,7 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
||||
public saveProfile: boolean;
|
||||
|
||||
public isDisconnecting: boolean = false;
|
||||
public constructor(serverCapabilities?: data.DataProtocolServerCapabilities, model?: interfaces.IConnectionProfile) {
|
||||
public constructor(serverCapabilities?: sqlops.DataProtocolServerCapabilities, model?: interfaces.IConnectionProfile) {
|
||||
super(serverCapabilities, model);
|
||||
if (model) {
|
||||
this.groupId = model.groupId;
|
||||
@@ -137,7 +137,7 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
||||
return super.getOptionsKey();
|
||||
}
|
||||
|
||||
public onProviderRegistered(serverCapabilities: data.DataProtocolServerCapabilities): void {
|
||||
public onProviderRegistered(serverCapabilities: sqlops.DataProtocolServerCapabilities): void {
|
||||
if (serverCapabilities.providerName === this.providerName) {
|
||||
this.setServerCapabilities(serverCapabilities);
|
||||
}
|
||||
@@ -164,13 +164,13 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
||||
return result;
|
||||
}
|
||||
|
||||
public toConnectionInfo(): data.ConnectionInfo {
|
||||
public toConnectionInfo(): sqlops.ConnectionInfo {
|
||||
return {
|
||||
options: this.options
|
||||
};
|
||||
}
|
||||
|
||||
public static createFromStoredProfile(profile: interfaces.IConnectionProfileStore, serverCapabilities: data.DataProtocolServerCapabilities): ConnectionProfile {
|
||||
public static createFromStoredProfile(profile: interfaces.IConnectionProfileStore, serverCapabilities: sqlops.DataProtocolServerCapabilities): ConnectionProfile {
|
||||
let connectionInfo = new ConnectionProfile(serverCapabilities, undefined);
|
||||
connectionInfo.options = profile.options;
|
||||
|
||||
@@ -187,7 +187,7 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
||||
return connectionInfo;
|
||||
}
|
||||
|
||||
public static convertToConnectionProfile(serverCapabilities: data.DataProtocolServerCapabilities, conn: interfaces.IConnectionProfile): ConnectionProfile {
|
||||
public static convertToConnectionProfile(serverCapabilities: sqlops.DataProtocolServerCapabilities, conn: interfaces.IConnectionProfile): ConnectionProfile {
|
||||
if (conn) {
|
||||
let connectionProfile: ConnectionProfile = undefined;
|
||||
let connectionProfileInstance = conn as ConnectionProfile;
|
||||
@@ -205,7 +205,7 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
||||
}
|
||||
|
||||
public static convertToProfileStore(
|
||||
serverCapabilities: data.DataProtocolServerCapabilities,
|
||||
serverCapabilities: sqlops.DataProtocolServerCapabilities,
|
||||
connectionProfile: interfaces.IConnectionProfile): interfaces.IConnectionProfileStore {
|
||||
if (connectionProfile) {
|
||||
let connectionInfo = ConnectionProfile.convertToConnectionProfile(serverCapabilities, connectionProfile);
|
||||
|
||||
@@ -9,21 +9,21 @@ import { ICapabilitiesService } from 'sql/services/capabilities/capabilitiesServ
|
||||
import { ConnectionProfile } from 'sql/parts/connection/common/connectionProfile';
|
||||
import { IConnectionProfile } from './interfaces';
|
||||
import * as Utils from './utils';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { StopWatch } from 'vs/base/common/stopwatch';
|
||||
|
||||
export class ConnectionStatusManager {
|
||||
|
||||
private _connections: { [id: string]: ConnectionManagementInfo };
|
||||
private _providerCapabilitiesMap: { [providerName: string]: data.DataProtocolServerCapabilities };
|
||||
private _providerCapabilitiesMap: { [providerName: string]: sqlops.DataProtocolServerCapabilities };
|
||||
|
||||
constructor( @ICapabilitiesService private _capabilitiesService: ICapabilitiesService) {
|
||||
this._connections = {};
|
||||
this._providerCapabilitiesMap = {};
|
||||
}
|
||||
|
||||
public getCapabilities(providerName: string): data.DataProtocolServerCapabilities {
|
||||
let result: data.DataProtocolServerCapabilities;
|
||||
public getCapabilities(providerName: string): sqlops.DataProtocolServerCapabilities {
|
||||
let result: sqlops.DataProtocolServerCapabilities;
|
||||
|
||||
if (providerName in this._providerCapabilitiesMap) {
|
||||
result = this._providerCapabilitiesMap[providerName];
|
||||
@@ -126,7 +126,7 @@ export class ConnectionStatusManager {
|
||||
return newId;
|
||||
}
|
||||
|
||||
public onConnectionComplete(summary: data.ConnectionInfoSummary): ConnectionManagementInfo {
|
||||
public onConnectionComplete(summary: sqlops.ConnectionInfoSummary): ConnectionManagementInfo {
|
||||
let connection = this._connections[summary.ownerUri];
|
||||
connection.serviceTimer.stop();
|
||||
connection.connecting = false;
|
||||
@@ -139,7 +139,7 @@ export class ConnectionStatusManager {
|
||||
* Updates database name after connection is complete
|
||||
* @param summary connection summary
|
||||
*/
|
||||
public updateDatabaseName(summary: data.ConnectionInfoSummary): void {
|
||||
public updateDatabaseName(summary: sqlops.ConnectionInfoSummary): void {
|
||||
let connection = this._connections[summary.ownerUri];
|
||||
|
||||
//Check if the existing connection database name is different the one in the summary
|
||||
@@ -174,7 +174,7 @@ export class ConnectionStatusManager {
|
||||
return ownerUriToReturn;
|
||||
}
|
||||
|
||||
public onConnectionChanged(changedConnInfo: data.ChangedConnectionInfo): IConnectionProfile {
|
||||
public onConnectionChanged(changedConnInfo: sqlops.ChangedConnectionInfo): IConnectionProfile {
|
||||
let connection = this._connections[changedConnInfo.connectionUri];
|
||||
if (connection && connection.connectionProfile) {
|
||||
connection.connectionProfile.serverName = changedConnInfo.connection.serverName;
|
||||
|
||||
@@ -18,9 +18,10 @@ import { ConnectionProfileGroup, IConnectionProfileGroup } from './connectionPro
|
||||
import { ConfigurationEditingService } from 'vs/workbench/services/configuration/node/configurationEditingService';
|
||||
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
|
||||
import { ICapabilitiesService } from 'sql/services/capabilities/capabilitiesService';
|
||||
import * as data from 'data';
|
||||
import { ConnectionOptionSpecialType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
const MAX_CONNECTIONS_DEFAULT = 25;
|
||||
|
||||
/**
|
||||
@@ -213,9 +214,9 @@ export class ConnectionStore {
|
||||
});
|
||||
}
|
||||
|
||||
private getCachedServerCapabilities(): data.DataProtocolServerCapabilities[] {
|
||||
private getCachedServerCapabilities(): sqlops.DataProtocolServerCapabilities[] {
|
||||
if (this._memento) {
|
||||
let metadata: data.DataProtocolServerCapabilities[] = this._memento[Constants.capabilitiesOptions];
|
||||
let metadata: sqlops.DataProtocolServerCapabilities[] = this._memento[Constants.capabilitiesOptions];
|
||||
return metadata;
|
||||
} else {
|
||||
return undefined;
|
||||
@@ -234,7 +235,7 @@ export class ConnectionStore {
|
||||
* Gets the list of recently used connections. These will not include the password - a separate call to
|
||||
* {addSavedPassword} is needed to fill that before connecting
|
||||
*
|
||||
* @returns {data.ConnectionInfo} the array of connections, empty if none are found
|
||||
* @returns {sqlops.ConnectionInfo} the array of connections, empty if none are found
|
||||
*/
|
||||
public getRecentlyUsedConnections(): ConnectionProfile[] {
|
||||
let configValues: IConnectionProfile[] = this._memento[Constants.recentConnections];
|
||||
@@ -275,7 +276,7 @@ export class ConnectionStore {
|
||||
* Gets the list of active connections. These will not include the password - a separate call to
|
||||
* {addSavedPassword} is needed to fill that before connecting
|
||||
*
|
||||
* @returns {data.ConnectionInfo} the array of connections, empty if none are found
|
||||
* @returns {sqlops.ConnectionInfo} the array of connections, empty if none are found
|
||||
*/
|
||||
public getActiveConnections(): ConnectionProfile[] {
|
||||
let configValues: IConnectionProfile[] = this._memento[Constants.activeConnections];
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import { IConnectionProfile } from './interfaces';
|
||||
import { IConnectionProfileGroup, ConnectionProfileGroup } from './connectionProfileGroup';
|
||||
import { ConnectionProfile } from './connectionProfile';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
/**
|
||||
* Interface for a configuration file that stores connection profiles.
|
||||
@@ -23,8 +23,8 @@ export interface IConnectionConfig {
|
||||
getAllGroups(): IConnectionProfileGroup[];
|
||||
changeGroupIdForConnectionGroup(source: ConnectionProfileGroup, target: ConnectionProfileGroup): Promise<void>;
|
||||
changeGroupIdForConnection(source: ConnectionProfile, targetGroupId: string): Promise<void>;
|
||||
setCachedMetadata(cachedMetaData: data.DataProtocolServerCapabilities[]): void;
|
||||
getCapabilities(providerName: string): data.DataProtocolServerCapabilities;
|
||||
setCachedMetadata(cachedMetaData: sqlops.DataProtocolServerCapabilities[]): void;
|
||||
getCapabilities(providerName: string): sqlops.DataProtocolServerCapabilities;
|
||||
editGroup(group: ConnectionProfileGroup): Promise<void>;
|
||||
deleteConnection(profile: ConnectionProfile): Promise<void>;
|
||||
deleteGroup(group: ConnectionProfileGroup): Promise<void>;
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
// A Connection Profile contains all the properties of connection credentials, with additional
|
||||
// optional name and details on whether password should be saved
|
||||
export interface IConnectionProfile extends data.ConnectionInfo {
|
||||
export interface IConnectionProfile extends sqlops.ConnectionInfo {
|
||||
serverName: string;
|
||||
databaseName: string;
|
||||
userName: string;
|
||||
|
||||
@@ -5,21 +5,21 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as interfaces from 'sql/parts/connection/common/interfaces';
|
||||
import { ConnectionOptionSpecialType, ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
import * as Constants from 'sql/parts/connection/common/constants';
|
||||
|
||||
export class ProviderConnectionInfo implements data.ConnectionInfo {
|
||||
export class ProviderConnectionInfo implements sqlops.ConnectionInfo {
|
||||
|
||||
options: { [name: string]: any };
|
||||
|
||||
public providerName: string;
|
||||
protected _serverCapabilities: data.DataProtocolServerCapabilities;
|
||||
protected _serverCapabilities: sqlops.DataProtocolServerCapabilities;
|
||||
private static readonly SqlAuthentication = 'SqlLogin';
|
||||
public static readonly ProviderPropertyName = 'providerName';
|
||||
|
||||
public constructor(serverCapabilities?: data.DataProtocolServerCapabilities, model?: interfaces.IConnectionProfile) {
|
||||
public constructor(serverCapabilities?: sqlops.DataProtocolServerCapabilities, model?: interfaces.IConnectionProfile) {
|
||||
this.options = {};
|
||||
if (serverCapabilities) {
|
||||
this._serverCapabilities = serverCapabilities;
|
||||
@@ -47,11 +47,11 @@ export class ProviderConnectionInfo implements data.ConnectionInfo {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public get serverCapabilities(): data.DataProtocolServerCapabilities {
|
||||
public get serverCapabilities(): sqlops.DataProtocolServerCapabilities {
|
||||
return this._serverCapabilities;
|
||||
}
|
||||
|
||||
public setServerCapabilities(value: data.DataProtocolServerCapabilities) {
|
||||
public setServerCapabilities(value: sqlops.DataProtocolServerCapabilities) {
|
||||
this._serverCapabilities = value;
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ export class ProviderConnectionInfo implements data.ConnectionInfo {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public getProviderOptions(): data.ConnectionOption[] {
|
||||
public getProviderOptions(): sqlops.ConnectionOption[] {
|
||||
return this._serverCapabilities.connectionProvider.options;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// // import { AdvancedPropertiesDialog } from 'sql/parts/connection/connectionDialog/advancedPropertiesDialog';
|
||||
import { OptionsDialog } from 'sql/base/browser/ui/modal/optionsDialog';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import { localize } from 'vs/nls';
|
||||
import * as TelemetryKeys from 'sql/common/telemetryKeys';
|
||||
|
||||
@@ -28,7 +28,7 @@ export class AdvancedPropertiesController {
|
||||
this._options = this._advancedDialog.optionValues;
|
||||
}
|
||||
|
||||
public showDialog(providerOptions: data.ConnectionOption[], container: HTMLElement, options: { [name: string]: any }): void {
|
||||
public showDialog(providerOptions: sqlops.ConnectionOption[], container: HTMLElement, options: { [name: string]: any }): void {
|
||||
this._options = options;
|
||||
this._container = container;
|
||||
var serviceOptions = providerOptions.map(option => AdvancedPropertiesController.connectionOptionToServiceOption(option));
|
||||
@@ -51,7 +51,7 @@ export class AdvancedPropertiesController {
|
||||
this._advancedDialog = dialog;
|
||||
}
|
||||
|
||||
public static connectionOptionToServiceOption(connectionOption: data.ConnectionOption): data.ServiceOption {
|
||||
public static connectionOptionToServiceOption(connectionOption: sqlops.ConnectionOption): sqlops.ServiceOption {
|
||||
return {
|
||||
name: connectionOption.name,
|
||||
displayName: connectionOption.displayName,
|
||||
|
||||
@@ -12,7 +12,7 @@ import { AdvancedPropertiesController } from 'sql/parts/connection/connectionDia
|
||||
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
import { ConnectionProfileGroup, IConnectionProfileGroup } from 'sql/parts/connection/common/connectionProfileGroup';
|
||||
import * as Constants from 'sql/parts/connection/common/constants';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as Utils from 'sql/parts/connection/common/utils';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ConnectionOptionSpecialType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
@@ -24,14 +24,14 @@ export class ConnectionController implements IConnectionComponentController {
|
||||
private _connectionWidget: ConnectionWidget;
|
||||
private _advancedController: AdvancedPropertiesController;
|
||||
private _model: IConnectionProfile;
|
||||
private _providerOptions: data.ConnectionOption[];
|
||||
private _providerOptions: sqlops.ConnectionOption[];
|
||||
private _providerName: string;
|
||||
/* key: uri, value : list of databases */
|
||||
private _databaseCache = new Map<string, string[]>();
|
||||
|
||||
constructor(container: HTMLElement,
|
||||
connectionManagementService: IConnectionManagementService,
|
||||
sqlCapabilities: data.DataProtocolServerCapabilities,
|
||||
sqlCapabilities: sqlops.DataProtocolServerCapabilities,
|
||||
callback: IConnectionComponentCallbacks,
|
||||
providerName: string,
|
||||
@IInstantiationService private _instantiationService: IInstantiationService ) {
|
||||
|
||||
@@ -18,7 +18,7 @@ import { ICapabilitiesService } from 'sql/services/capabilities/capabilitiesServ
|
||||
import { ConnectionProfile } from 'sql/parts/connection/common/connectionProfile';
|
||||
import { localize } from 'vs/nls';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
import { IPartService } from 'vs/workbench/services/part/common/partService';
|
||||
import { withElementById } from 'vs/base/browser/builder';
|
||||
@@ -69,7 +69,7 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
||||
private _model: ConnectionProfile;
|
||||
private _params: INewConnectionParams;
|
||||
private _inputModel: IConnectionProfile;
|
||||
private _capabilitiesMaps: { [providerDisplayName: string]: data.DataProtocolServerCapabilities };
|
||||
private _capabilitiesMaps: { [providerDisplayName: string]: sqlops.DataProtocolServerCapabilities };
|
||||
private _providerNameToDisplayNameMap: { [providerDisplayName: string]: string };
|
||||
private _providerTypes: string[];
|
||||
private _currentProviderType: string = 'Microsoft SQL Server';
|
||||
@@ -270,7 +270,7 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
||||
return newProfile;
|
||||
}
|
||||
|
||||
private cacheCapabilities(capabilities: data.DataProtocolServerCapabilities) {
|
||||
private cacheCapabilities(capabilities: sqlops.DataProtocolServerCapabilities) {
|
||||
if (capabilities) {
|
||||
this._providerTypes.push(capabilities.providerDisplayName);
|
||||
this._capabilitiesMaps[capabilities.providerName] = capabilities;
|
||||
|
||||
@@ -23,7 +23,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import * as styler from 'vs/platform/theme/common/styler';
|
||||
import { attachInputBoxStyler, attachButtonStyler, attachEditableDropdownStyler } from 'sql/common/theme/styler';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { localize } from 'vs/nls';
|
||||
import { OS, OperatingSystem } from 'vs/base/common/platform';
|
||||
@@ -44,7 +44,7 @@ export class ConnectionWidget {
|
||||
private _callbacks: IConnectionComponentCallbacks;
|
||||
private _authTypeSelectBox: SelectBox;
|
||||
private _toDispose: lifecycle.IDisposable[];
|
||||
private _optionsMaps: { [optionType: number]: data.ConnectionOption };
|
||||
private _optionsMaps: { [optionType: number]: sqlops.ConnectionOption };
|
||||
private _tableContainer: Builder;
|
||||
private _focusedBeforeHandleOnConnection: HTMLElement;
|
||||
private _providerName: string;
|
||||
@@ -77,7 +77,7 @@ export class ConnectionWidget {
|
||||
color: undefined,
|
||||
description: undefined,
|
||||
};
|
||||
constructor(options: data.ConnectionOption[],
|
||||
constructor(options: sqlops.ConnectionOption[],
|
||||
callbacks: IConnectionComponentCallbacks,
|
||||
providerName: string,
|
||||
@IThemeService private _themeService: IThemeService,
|
||||
|
||||
@@ -16,7 +16,7 @@ import { TabConfig } from 'sql/parts/dashboard/common/dashboardWidget';
|
||||
import { DashboardServiceInterface } from 'sql/parts/dashboard/services/dashboardServiceInterface.service';
|
||||
import { IDashboardWebview } from 'sql/services/dashboardWebview/common/dashboardWebviewService';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { memoize } from 'vs/base/common/decorators';
|
||||
|
||||
@Component({
|
||||
@@ -55,9 +55,9 @@ export class WebviewContent implements OnInit, IDashboardWebview {
|
||||
}
|
||||
|
||||
@memoize
|
||||
public get connection(): data.connection.Connection {
|
||||
public get connection(): sqlops.connection.Connection {
|
||||
let currentConnection = this._dashboardService.connectionManagementService.connectionInfo.connectionProfile;
|
||||
let connection: data.connection.Connection = {
|
||||
let connection: sqlops.connection.Connection = {
|
||||
providerName: currentConnection.providerName,
|
||||
connectionId: currentConnection.id,
|
||||
options: currentConnection.options
|
||||
@@ -66,7 +66,7 @@ export class WebviewContent implements OnInit, IDashboardWebview {
|
||||
}
|
||||
|
||||
@memoize
|
||||
public get serverInfo(): data.ServerInfo {
|
||||
public get serverInfo(): sqlops.ServerInfo {
|
||||
return this._dashboardService.connectionManagementService.connectionInfo.serverInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as data from 'data';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
|
||||
import { IDashboardTab } from 'sql/platform/dashboard/common/dashboardRegistry';
|
||||
|
||||
@@ -24,7 +24,7 @@ import { AngularEventType, IAngularEvent } from 'sql/services/angularEventing/an
|
||||
import { IDashboardTab } from 'sql/platform/dashboard/common/dashboardRegistry';
|
||||
import { PinConfig } from 'sql/parts/dashboard/common/dashboardWidget';
|
||||
|
||||
import { ProviderMetadata, DatabaseInfo, SimpleExecuteResult } from 'data';
|
||||
import { ProviderMetadata, DatabaseInfo, SimpleExecuteResult } from 'sqlops';
|
||||
|
||||
/* VS imports */
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
|
||||
@@ -16,7 +16,7 @@ import { ICapabilitiesService } from 'sql/services/capabilities/capabilitiesServ
|
||||
import { ConnectionManagementInfo } from 'sql/parts/connection/common/connectionManagementInfo';
|
||||
import * as Constants from 'sql/parts/connection/common/constants';
|
||||
|
||||
import { ObjectMetadata } from 'data';
|
||||
import { ObjectMetadata } from 'sqlops';
|
||||
|
||||
import * as tree from 'vs/base/parts/tree/browser/tree';
|
||||
import * as TreeDefaults from 'vs/base/parts/tree/browser/treeDefaults';
|
||||
|
||||
@@ -18,7 +18,7 @@ import { Extensions, IInsightRegistry } from 'sql/platform/dashboard/common/insi
|
||||
import { insertValueRegex } from 'sql/parts/insights/common/interfaces';
|
||||
import { RunInsightQueryAction } from './actions';
|
||||
|
||||
import { SimpleExecuteResult } from 'data';
|
||||
import { SimpleExecuteResult } from 'sqlops';
|
||||
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import * as types from 'vs/base/common/types';
|
||||
|
||||
@@ -12,7 +12,7 @@ import { toDisposableSubscription } from 'sql/parts/common/rxjsUtils';
|
||||
import { error } from 'sql/base/common/log';
|
||||
import { IDashboardRegistry, Extensions as DashboardExtensions } from 'sql/platform/dashboard/common/dashboardRegistry';
|
||||
|
||||
import { DatabaseInfo, ServerInfo } from 'data';
|
||||
import { DatabaseInfo, ServerInfo } from 'sqlops';
|
||||
|
||||
import { EventType, addDisposableListener } from 'vs/base/browser/dom';
|
||||
import * as types from 'vs/base/common/types';
|
||||
|
||||
@@ -15,7 +15,7 @@ import { DashboardWidget, IDashboardWidget, WidgetConfig, WIDGET_CONFIG } from '
|
||||
import { DashboardServiceInterface } from 'sql/parts/dashboard/services/dashboardServiceInterface.service';
|
||||
import { IDashboardWebview } from 'sql/services/dashboardWebview/common/dashboardWebviewService';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
interface IWebviewWidgetConfig {
|
||||
id: string;
|
||||
@@ -64,9 +64,9 @@ export class WebviewWidget extends DashboardWidget implements IDashboardWidget,
|
||||
}
|
||||
|
||||
@memoize
|
||||
public get connection(): data.connection.Connection {
|
||||
public get connection(): sqlops.connection.Connection {
|
||||
let currentConnection = this._dashboardService.connectionManagementService.connectionInfo.connectionProfile;
|
||||
let connection: data.connection.Connection = {
|
||||
let connection: sqlops.connection.Connection = {
|
||||
providerName: currentConnection.providerName,
|
||||
connectionId: currentConnection.id,
|
||||
options: currentConnection.options
|
||||
@@ -75,7 +75,7 @@ export class WebviewWidget extends DashboardWidget implements IDashboardWidget,
|
||||
}
|
||||
|
||||
@memoize
|
||||
public get serverInfo(): data.ServerInfo {
|
||||
public get serverInfo(): sqlops.ServerInfo {
|
||||
return this._dashboardService.connectionManagementService.connectionInfo.serverInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import Event from 'vs/base/common/event';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
import { DashboardComponentParams } from 'sql/services/bootstrap/bootstrapParams';
|
||||
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
@@ -53,15 +53,15 @@ export const IBackupService = createDecorator<IBackupService>(SERVICE_ID);
|
||||
export interface IBackupService {
|
||||
_serviceBrand: any;
|
||||
|
||||
getBackupConfigInfo(connectionUri: string): Thenable<data.BackupConfigInfo>;
|
||||
getBackupConfigInfo(connectionUri: string): Thenable<sqlops.BackupConfigInfo>;
|
||||
|
||||
/**
|
||||
* Backup a data source using the provided connection
|
||||
*/
|
||||
backup(connectionUri: string, backupInfo: { [key: string]: any }, taskExecutionMode: data.TaskExecutionMode): Thenable<data.BackupResponse>;
|
||||
backup(connectionUri: string, backupInfo: { [key: string]: any }, taskExecutionMode: sqlops.TaskExecutionMode): Thenable<sqlops.BackupResponse>;
|
||||
|
||||
/**
|
||||
* Register a disaster recovery provider
|
||||
*/
|
||||
registerProvider(providerId: string, provider: data.BackupProvider): void;
|
||||
registerProvider(providerId: string, provider: sqlops.BackupProvider): void;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as Constants from 'sql/common/constants';
|
||||
import * as TelemetryKeys from 'sql/common/telemetryKeys';
|
||||
import * as TelemetryUtils from 'sql/common/telemetryUtilities';
|
||||
@@ -26,7 +26,7 @@ import { ProviderConnectionInfo } from 'sql/parts/connection/common/providerConn
|
||||
export class BackupService implements IBackupService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
private _providers: { [handle: string]: data.BackupProvider; } = Object.create(null);
|
||||
private _providers: { [handle: string]: sqlops.BackupProvider; } = Object.create(null);
|
||||
|
||||
constructor(
|
||||
@IConnectionManagementService private _connectionService: IConnectionManagementService,
|
||||
@@ -37,7 +37,7 @@ export class BackupService implements IBackupService {
|
||||
/**
|
||||
* Get database metadata needed to populate backup UI
|
||||
*/
|
||||
public getBackupConfigInfo(connectionUri: string): Thenable<data.BackupConfigInfo> {
|
||||
public getBackupConfigInfo(connectionUri: string): Thenable<sqlops.BackupConfigInfo> {
|
||||
let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri);
|
||||
if (providerId) {
|
||||
let provider = this._providers[providerId];
|
||||
@@ -51,8 +51,8 @@ export class BackupService implements IBackupService {
|
||||
/**
|
||||
* Backup a data source using the provided connection
|
||||
*/
|
||||
public backup(connectionUri: string, backupInfo: { [key: string]: any }, taskExecutionMode: TaskExecutionMode): Thenable<data.BackupResponse> {
|
||||
return new Promise<data.BackupResponse>((resolve, reject) => {
|
||||
public backup(connectionUri: string, backupInfo: { [key: string]: any }, taskExecutionMode: TaskExecutionMode): Thenable<sqlops.BackupResponse> {
|
||||
return new Promise<sqlops.BackupResponse>((resolve, reject) => {
|
||||
let providerResult = this.getProvider(connectionUri);
|
||||
if (providerResult) {
|
||||
TelemetryUtils.addTelemetry(this._telemetryService, TelemetryKeys.BackupCreated, { provider: providerResult.providerName });
|
||||
@@ -67,7 +67,7 @@ export class BackupService implements IBackupService {
|
||||
});
|
||||
}
|
||||
|
||||
private getProvider(connectionUri: string): { provider: data.BackupProvider, providerName: string } {
|
||||
private getProvider(connectionUri: string): { provider: sqlops.BackupProvider, providerName: string } {
|
||||
let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri);
|
||||
if (providerId) {
|
||||
return { provider: this._providers[providerId], providerName: providerId };
|
||||
@@ -79,7 +79,7 @@ export class BackupService implements IBackupService {
|
||||
/**
|
||||
* Register a disaster recovery provider
|
||||
*/
|
||||
public registerProvider(providerId: string, provider: data.BackupProvider): void {
|
||||
public registerProvider(providerId: string, provider: sqlops.BackupProvider): void {
|
||||
this._providers[providerId] = provider;
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ export class BackupUiService implements IBackupUiService {
|
||||
public _serviceBrand: any;
|
||||
private _backupDialogs: { [providerName: string]: BackupDialog | OptionsDialog } = {};
|
||||
private _currentProvider: string;
|
||||
private _optionsMap: { [providerName: string]: data.ServiceOption[] } = {};
|
||||
private _optionsMap: { [providerName: string]: sqlops.ServiceOption[] } = {};
|
||||
private _optionValues: { [optionName: string]: any } = {};
|
||||
private _connectionUri: string;
|
||||
private static _connectionUniqueId: number = 0;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
|
||||
@@ -21,27 +21,27 @@ export interface IRestoreService {
|
||||
/**
|
||||
* Register a disaster recovery provider
|
||||
*/
|
||||
registerProvider(providerId: string, provider: data.RestoreProvider): void;
|
||||
registerProvider(providerId: string, provider: sqlops.RestoreProvider): void;
|
||||
|
||||
/**
|
||||
* Restore a data source using a backup file or database
|
||||
*/
|
||||
restore(connectionUri: string, restoreInfo: data.RestoreInfo): Thenable<data.RestoreResponse>;
|
||||
restore(connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable<sqlops.RestoreResponse>;
|
||||
|
||||
/**
|
||||
* Gets restore plan to do the restore operation on a database
|
||||
*/
|
||||
getRestorePlan(connectionUri: string, restoreInfo: data.RestoreInfo): Thenable<data.RestorePlanResponse>;
|
||||
getRestorePlan(connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable<sqlops.RestorePlanResponse>;
|
||||
|
||||
/**
|
||||
* Gets restore config Info
|
||||
*/
|
||||
getRestoreConfigInfo(connectionUri: string): Thenable<data.RestoreConfigInfo>;
|
||||
getRestoreConfigInfo(connectionUri: string): Thenable<sqlops.RestoreConfigInfo>;
|
||||
|
||||
/**
|
||||
* Cancel restore plan
|
||||
*/
|
||||
cancelRestorePlan(connectionUri: string, restoreInfo: data.RestoreInfo): Thenable<boolean>;
|
||||
cancelRestorePlan(connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable<boolean>;
|
||||
}
|
||||
|
||||
export const IRestoreDialogController = createDecorator<IRestoreDialogController>('restoreDialogService');
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import * as Constants from 'sql/common/constants';
|
||||
import * as TelemetryKeys from 'sql/common/telemetryKeys';
|
||||
@@ -29,7 +29,7 @@ import { TaskStatus, TaskNode } from 'sql/parts/taskHistory/common/taskNode';
|
||||
export class RestoreService implements IRestoreService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
private _providers: { [handle: string]: data.RestoreProvider; } = Object.create(null);
|
||||
private _providers: { [handle: string]: sqlops.RestoreProvider; } = Object.create(null);
|
||||
|
||||
constructor(
|
||||
@IConnectionManagementService private _connectionService: IConnectionManagementService,
|
||||
@@ -40,8 +40,8 @@ export class RestoreService implements IRestoreService {
|
||||
/**
|
||||
* Gets restore config Info
|
||||
*/
|
||||
getRestoreConfigInfo(connectionUri: string): Thenable<data.RestoreConfigInfo> {
|
||||
return new Promise<data.RestoreConfigInfo>((resolve, reject) => {
|
||||
getRestoreConfigInfo(connectionUri: string): Thenable<sqlops.RestoreConfigInfo> {
|
||||
return new Promise<sqlops.RestoreConfigInfo>((resolve, reject) => {
|
||||
let providerResult = this.getProvider(connectionUri);
|
||||
if (providerResult) {
|
||||
providerResult.provider.getRestoreConfigInfo(connectionUri).then(result => {
|
||||
@@ -58,8 +58,8 @@ export class RestoreService implements IRestoreService {
|
||||
/**
|
||||
* Restore a data source using a backup file or database
|
||||
*/
|
||||
restore(connectionUri: string, restoreInfo: data.RestoreInfo): Thenable<data.RestoreResponse> {
|
||||
return new Promise<data.RestoreResponse>((resolve, reject) => {
|
||||
restore(connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable<sqlops.RestoreResponse> {
|
||||
return new Promise<sqlops.RestoreResponse>((resolve, reject) => {
|
||||
let providerResult = this.getProvider(connectionUri);
|
||||
if (providerResult) {
|
||||
TelemetryUtils.addTelemetry(this._telemetryService, TelemetryKeys.RestoreRequested, { provider: providerResult.providerName });
|
||||
@@ -74,7 +74,7 @@ export class RestoreService implements IRestoreService {
|
||||
});
|
||||
}
|
||||
|
||||
private getProvider(connectionUri: string): { provider: data.RestoreProvider, providerName: string } {
|
||||
private getProvider(connectionUri: string): { provider: sqlops.RestoreProvider, providerName: string } {
|
||||
let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri);
|
||||
if (providerId) {
|
||||
return { provider: this._providers[providerId], providerName: providerId };
|
||||
@@ -86,8 +86,8 @@ export class RestoreService implements IRestoreService {
|
||||
/**
|
||||
* Gets restore plan to do the restore operation on a database
|
||||
*/
|
||||
getRestorePlan(connectionUri: string, restoreInfo: data.RestoreInfo): Thenable<data.RestorePlanResponse> {
|
||||
return new Promise<data.RestorePlanResponse>((resolve, reject) => {
|
||||
getRestorePlan(connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable<sqlops.RestorePlanResponse> {
|
||||
return new Promise<sqlops.RestorePlanResponse>((resolve, reject) => {
|
||||
let providerResult = this.getProvider(connectionUri);
|
||||
if (providerResult) {
|
||||
providerResult.provider.getRestorePlan(connectionUri, restoreInfo).then(result => {
|
||||
@@ -105,7 +105,7 @@ export class RestoreService implements IRestoreService {
|
||||
/**
|
||||
* Cancels a restore plan
|
||||
*/
|
||||
cancelRestorePlan(connectionUri: string, restoreInfo: data.RestoreInfo): Thenable<boolean> {
|
||||
cancelRestorePlan(connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable<boolean> {
|
||||
return new Promise<boolean>((resolve, reject) => {
|
||||
let providerResult = this.getProvider(connectionUri);
|
||||
if (providerResult) {
|
||||
@@ -124,7 +124,7 @@ export class RestoreService implements IRestoreService {
|
||||
/**
|
||||
* Register a disaster recovery provider
|
||||
*/
|
||||
public registerProvider(providerId: string, provider: data.RestoreProvider): void {
|
||||
public registerProvider(providerId: string, provider: sqlops.RestoreProvider): void {
|
||||
this._providers[providerId] = provider;
|
||||
}
|
||||
}
|
||||
@@ -232,7 +232,7 @@ export class RestoreDialogController implements IRestoreDialogController {
|
||||
});
|
||||
}
|
||||
|
||||
private setRestoreOption(overwriteTargetDatabase: boolean = false): data.RestoreInfo {
|
||||
private setRestoreOption(overwriteTargetDatabase: boolean = false): sqlops.RestoreInfo {
|
||||
let restoreInfo = undefined;
|
||||
|
||||
let providerId: string = this.getCurrentProviderId();
|
||||
@@ -263,8 +263,8 @@ export class RestoreDialogController implements IRestoreDialogController {
|
||||
return restoreInfo;
|
||||
}
|
||||
|
||||
private getRestoreOption(): data.ServiceOption[] {
|
||||
let options: data.ServiceOption[] = [];
|
||||
private getRestoreOption(): sqlops.ServiceOption[] {
|
||||
let options: sqlops.ServiceOption[] = [];
|
||||
let providerId: string = this.getCurrentProviderId();
|
||||
let providerCapabilities = this._capabilitiesService.getCapabilities().find(c => c.providerName === providerId);
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
export class MssqlRestoreInfo implements data.RestoreInfo {
|
||||
export class MssqlRestoreInfo implements sqlops.RestoreInfo {
|
||||
|
||||
options: { [name: string]: any };
|
||||
taskExecutionMode: data.TaskExecutionMode;
|
||||
taskExecutionMode: sqlops.TaskExecutionMode;
|
||||
|
||||
public constructor() {
|
||||
this.options = {};
|
||||
|
||||
@@ -37,7 +37,7 @@ import { IBootstrapService } from 'sql/services/bootstrap/bootstrapService';
|
||||
import { Dropdown } from 'sql/base/browser/ui/editableDropdown/dropdown';
|
||||
import { TabbedPanel, PanelTabIdentifier } from 'sql/base/browser/ui/panel/panel';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import { ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
|
||||
@@ -117,7 +117,7 @@ export class RestoreDialog extends Modal {
|
||||
public onDatabaseListFocused: Event<void> = this._onDatabaseListFocused.event;
|
||||
|
||||
constructor(
|
||||
optionsMetadata: data.ServiceOption[],
|
||||
optionsMetadata: sqlops.ServiceOption[],
|
||||
@IPartService partService: IPartService,
|
||||
@IThemeService private _themeService: IThemeService,
|
||||
@IContextViewService private _contextViewService: IContextViewService,
|
||||
@@ -802,7 +802,7 @@ export class RestoreDialog extends Modal {
|
||||
}
|
||||
}
|
||||
|
||||
private updateRestoreDatabaseFiles(dbFiles: data.RestoreDatabaseFileInfo[]) {
|
||||
private updateRestoreDatabaseFiles(dbFiles: sqlops.RestoreDatabaseFileInfo[]) {
|
||||
this._fileListData.clear();
|
||||
if (dbFiles) {
|
||||
let data = [];
|
||||
@@ -823,7 +823,7 @@ export class RestoreDialog extends Modal {
|
||||
}
|
||||
}
|
||||
|
||||
private updateBackupSetsToRestore(backupSetsToRestore: data.DatabaseFileInfo[]) {
|
||||
private updateBackupSetsToRestore(backupSetsToRestore: sqlops.DatabaseFileInfo[]) {
|
||||
if (this._isBackupFileCheckboxChanged) {
|
||||
let selectedRow = [];
|
||||
for (let i = 0; i < backupSetsToRestore.length; i++) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as DialogHelper from 'sql/base/browser/ui/modal/dialogHelper';
|
||||
import * as types from 'vs/base/common/types';
|
||||
|
||||
@@ -12,7 +12,7 @@ import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
|
||||
export interface RestoreOptionsElement {
|
||||
optionMetadata: data.ServiceOption;
|
||||
optionMetadata: sqlops.ServiceOption;
|
||||
defaultValue: any;
|
||||
currentValue: any;
|
||||
}
|
||||
@@ -62,15 +62,15 @@ export class RestoreViewModel {
|
||||
private _onSetRestoreOption = new Emitter<RestoreOptionParam>();
|
||||
public onSetRestoreOption: Event<RestoreOptionParam> = this._onSetRestoreOption.event;
|
||||
|
||||
private _onUpdateBackupSetsToRestore = new Emitter<data.DatabaseFileInfo[]>();
|
||||
public onUpdateBackupSetsToRestore: Event<data.DatabaseFileInfo[]> = this._onUpdateBackupSetsToRestore.event;
|
||||
private _onUpdateBackupSetsToRestore = new Emitter<sqlops.DatabaseFileInfo[]>();
|
||||
public onUpdateBackupSetsToRestore: Event<sqlops.DatabaseFileInfo[]> = this._onUpdateBackupSetsToRestore.event;
|
||||
|
||||
private _onUpdateRestoreDatabaseFiles = new Emitter<data.RestoreDatabaseFileInfo[]>();
|
||||
public onUpdateRestoreDatabaseFiles: Event<data.RestoreDatabaseFileInfo[]> = this._onUpdateRestoreDatabaseFiles.event;
|
||||
private _onUpdateRestoreDatabaseFiles = new Emitter<sqlops.RestoreDatabaseFileInfo[]>();
|
||||
public onUpdateRestoreDatabaseFiles: Event<sqlops.RestoreDatabaseFileInfo[]> = this._onUpdateRestoreDatabaseFiles.event;
|
||||
|
||||
private _optionsMap: { [name: string]: RestoreOptionsElement } = {};
|
||||
|
||||
constructor(optionsMetadata: data.ServiceOption[]) {
|
||||
constructor(optionsMetadata: sqlops.ServiceOption[]) {
|
||||
optionsMetadata.forEach(optionMetadata => {
|
||||
let defaultValue = this.getDisplayValue(optionMetadata, optionMetadata.defaultValue);
|
||||
this._optionsMap[optionMetadata.name] = {
|
||||
@@ -84,7 +84,7 @@ export class RestoreViewModel {
|
||||
/**
|
||||
* Get option display value
|
||||
*/
|
||||
public getDisplayValue(optionMetadata: data.ServiceOption, optionValue: any): any {
|
||||
public getDisplayValue(optionMetadata: sqlops.ServiceOption, optionValue: any): any {
|
||||
let displayValue: any;
|
||||
switch (optionMetadata.valueType) {
|
||||
case ServiceOptionType.boolean:
|
||||
@@ -119,7 +119,7 @@ export class RestoreViewModel {
|
||||
/**
|
||||
* Get option metadata from the option map
|
||||
*/
|
||||
public getOptionMetadata(optionName: string): data.ServiceOption {
|
||||
public getOptionMetadata(optionName: string): sqlops.ServiceOption {
|
||||
return this._optionsMap[optionName] ? this._optionsMap[optionName].optionMetadata : undefined;
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ export class RestoreViewModel {
|
||||
/**
|
||||
* On restore plan response will update all the information from restore plan response
|
||||
*/
|
||||
public onRestorePlanResponse(restorePlanResponse: data.RestorePlanResponse): void {
|
||||
public onRestorePlanResponse(restorePlanResponse: sqlops.RestorePlanResponse): void {
|
||||
if (restorePlanResponse.planDetails && restorePlanResponse.planDetails['lastBackupTaken']) {
|
||||
this.updateLastBackupTaken(restorePlanResponse.planDetails['lastBackupTaken'].currentValue);
|
||||
}
|
||||
@@ -187,7 +187,7 @@ export class RestoreViewModel {
|
||||
/**
|
||||
* Update options with plan details
|
||||
*/
|
||||
public updateOptionWithPlanDetail(planDetails: { [key: string]: data.RestorePlanDetailInfo }): void {
|
||||
public updateOptionWithPlanDetail(planDetails: { [key: string]: sqlops.RestorePlanDetailInfo }): void {
|
||||
if (planDetails) {
|
||||
for (var key in planDetails) {
|
||||
let optionElement = this._optionsMap[key];
|
||||
@@ -234,7 +234,7 @@ export class RestoreViewModel {
|
||||
/**
|
||||
* Update backup sets to restore
|
||||
*/
|
||||
public updateBackupSetsToRestore(backupSetsToRestore: data.DatabaseFileInfo[]): void {
|
||||
public updateBackupSetsToRestore(backupSetsToRestore: sqlops.DatabaseFileInfo[]): void {
|
||||
this.selectedBackupSets = null;
|
||||
if (backupSetsToRestore) {
|
||||
this.selectedBackupSets = [];
|
||||
|
||||
@@ -10,7 +10,7 @@ import { IMessageService, Severity } from 'vs/platform/message/common/message';
|
||||
import { IQueryModelService } from 'sql/parts/query/execution/queryModel';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { EditSessionReadyParams } from 'data';
|
||||
import { EditSessionReadyParams } from 'sqlops';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import nls = require('vs/nls');
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { IConnectionManagementService, IErrorMessageService } from 'sql/parts/connection/common/connectionManagement';
|
||||
import { FileBrowserTree } from 'sql/parts/fileBrowser/common/fileBrowserTree';
|
||||
import { FileNode } from 'sql/parts/fileBrowser/common/fileNode';
|
||||
@@ -20,10 +20,10 @@ import * as strings from 'vs/base/common/strings';
|
||||
|
||||
export class FileBrowserService implements IFileBrowserService {
|
||||
public _serviceBrand: any;
|
||||
private _providers: { [handle: string]: data.FileBrowserProvider; } = Object.create(null);
|
||||
private _providers: { [handle: string]: sqlops.FileBrowserProvider; } = Object.create(null);
|
||||
private _onAddFileTree = new Emitter<FileBrowserTree>();
|
||||
private _onExpandFolder = new Emitter<FileNode>();
|
||||
private _onPathValidate = new Emitter<data.FileBrowserValidatedParams>();
|
||||
private _onPathValidate = new Emitter<sqlops.FileBrowserValidatedParams>();
|
||||
private _pathToFileNodeMap: { [path: string]: FileNode } = {};
|
||||
private _expandResolveMap: { [key: string]: any } = {};
|
||||
static fileNodeId: number = 0;
|
||||
@@ -33,7 +33,7 @@ export class FileBrowserService implements IFileBrowserService {
|
||||
@IErrorMessageService private _errorMessageService: IErrorMessageService) {
|
||||
}
|
||||
|
||||
public registerProvider(providerId: string, provider: data.FileBrowserProvider): void {
|
||||
public registerProvider(providerId: string, provider: sqlops.FileBrowserProvider): void {
|
||||
this._providers[providerId] = provider;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ export class FileBrowserService implements IFileBrowserService {
|
||||
return this._onExpandFolder.event;
|
||||
}
|
||||
|
||||
public get onPathValidate(): Event<data.FileBrowserValidatedParams> {
|
||||
public get onPathValidate(): Event<sqlops.FileBrowserValidatedParams> {
|
||||
return this._onPathValidate.event;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ export class FileBrowserService implements IFileBrowserService {
|
||||
});
|
||||
}
|
||||
|
||||
public onFileBrowserOpened(handle: number, fileBrowserOpenedParams: data.FileBrowserOpenedParams) {
|
||||
public onFileBrowserOpened(handle: number, fileBrowserOpenedParams: sqlops.FileBrowserOpenedParams) {
|
||||
if (fileBrowserOpenedParams.succeeded === true
|
||||
&& fileBrowserOpenedParams.fileTree
|
||||
&& fileBrowserOpenedParams.fileTree.rootNode
|
||||
@@ -98,7 +98,7 @@ export class FileBrowserService implements IFileBrowserService {
|
||||
});
|
||||
}
|
||||
|
||||
public onFolderNodeExpanded(handle: number, fileBrowserExpandedParams: data.FileBrowserExpandedParams) {
|
||||
public onFolderNodeExpanded(handle: number, fileBrowserExpandedParams: sqlops.FileBrowserExpandedParams) {
|
||||
var mapKey = this.generateResolveMapKey(fileBrowserExpandedParams.ownerUri, fileBrowserExpandedParams.expandPath);
|
||||
var expandResolve = this._expandResolveMap[mapKey];
|
||||
if (expandResolve) {
|
||||
@@ -135,11 +135,11 @@ export class FileBrowserService implements IFileBrowserService {
|
||||
});
|
||||
}
|
||||
|
||||
public onFilePathsValidated(handle: number, fileBrowserValidatedParams: data.FileBrowserValidatedParams) {
|
||||
public onFilePathsValidated(handle: number, fileBrowserValidatedParams: sqlops.FileBrowserValidatedParams) {
|
||||
this._onPathValidate.fire(fileBrowserValidatedParams);
|
||||
}
|
||||
|
||||
public closeFileBrowser(ownerUri: string): Thenable<data.FileBrowserCloseResponse> {
|
||||
public closeFileBrowser(ownerUri: string): Thenable<sqlops.FileBrowserCloseResponse> {
|
||||
let provider = this.getProvider(ownerUri);
|
||||
if (provider) {
|
||||
return provider.closeFileBrowser(ownerUri);
|
||||
@@ -150,7 +150,7 @@ export class FileBrowserService implements IFileBrowserService {
|
||||
private generateResolveMapKey(ownerUri: string, expandPath: string): string {
|
||||
return ownerUri + ':' + expandPath;
|
||||
}
|
||||
private getProvider(connectionUri: string): data.FileBrowserProvider {
|
||||
private getProvider(connectionUri: string): sqlops.FileBrowserProvider {
|
||||
let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri);
|
||||
if (providerId) {
|
||||
return this._providers[providerId];
|
||||
@@ -159,7 +159,7 @@ export class FileBrowserService implements IFileBrowserService {
|
||||
}
|
||||
}
|
||||
|
||||
private convertFileTree(parentNode: FileNode, fileTreeNode: data.FileTreeNode, expandPath: string, ownerUri: string): FileBrowserTree {
|
||||
private convertFileTree(parentNode: FileNode, fileTreeNode: sqlops.FileTreeNode, expandPath: string, ownerUri: string): FileBrowserTree {
|
||||
FileBrowserService.fileNodeId += 1;
|
||||
var expandedNodes: FileNode[] = [];
|
||||
var selectedNode: FileNode;
|
||||
@@ -208,7 +208,7 @@ export class FileBrowserService implements IFileBrowserService {
|
||||
return { rootNode: fileNode, selectedNode: selectedNode, expandedNodes: expandedNodes };
|
||||
}
|
||||
|
||||
private convertChildren(expandedNode: FileNode, childrenToConvert: data.FileTreeNode[], ownerUri: string): FileNode[] {
|
||||
private convertChildren(expandedNode: FileNode, childrenToConvert: sqlops.FileTreeNode[], ownerUri: string): FileNode[] {
|
||||
var childrenNodes = [];
|
||||
|
||||
for (var i = 0; i < childrenToConvert.length; i++) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { FileBrowserTree } from 'sql/parts/fileBrowser/common/fileBrowserTree';
|
||||
import { FileNode } from 'sql/parts/fileBrowser/common/fileNode';
|
||||
import Event from 'vs/base/common/event';
|
||||
@@ -19,7 +19,7 @@ export interface IFileBrowserDialogController {
|
||||
*/
|
||||
showDialog(ownerUri: string,
|
||||
expandPath: string,
|
||||
fileFilters: [{label: string, filters: string[]}],
|
||||
fileFilters: [{ label: string, filters: string[] }],
|
||||
fileValidationServiceType: string,
|
||||
isWide: boolean,
|
||||
handleOnOk: (path: string) => void): void;
|
||||
@@ -30,12 +30,12 @@ export interface IFileBrowserService {
|
||||
_serviceBrand: any;
|
||||
onAddFileTree: Event<FileBrowserTree>;
|
||||
onExpandFolder: Event<FileNode>;
|
||||
onPathValidate: Event<data.FileBrowserValidatedParams>;
|
||||
onPathValidate: Event<sqlops.FileBrowserValidatedParams>;
|
||||
|
||||
/**
|
||||
* Register file browser provider
|
||||
*/
|
||||
registerProvider(providerId: string, provider: data.FileBrowserProvider): void;
|
||||
registerProvider(providerId: string, provider: sqlops.FileBrowserProvider): void;
|
||||
|
||||
/**
|
||||
* Open file browser
|
||||
@@ -45,7 +45,7 @@ export interface IFileBrowserService {
|
||||
/**
|
||||
* Event called when file browser is opened
|
||||
*/
|
||||
onFileBrowserOpened(handle: number, fileBrowserOpenedParams: data.FileBrowserOpenedParams);
|
||||
onFileBrowserOpened(handle: number, fileBrowserOpenedParams: sqlops.FileBrowserOpenedParams);
|
||||
|
||||
/**
|
||||
* Expand folder node
|
||||
@@ -55,7 +55,7 @@ export interface IFileBrowserService {
|
||||
/**
|
||||
* Event called when children nodes are retrieved
|
||||
*/
|
||||
onFolderNodeExpanded(handle: number, fileBrowserExpandedParams: data.FileBrowserExpandedParams);
|
||||
onFolderNodeExpanded(handle: number, fileBrowserExpandedParams: sqlops.FileBrowserExpandedParams);
|
||||
|
||||
/**
|
||||
* Validate selected file paths
|
||||
@@ -65,10 +65,10 @@ export interface IFileBrowserService {
|
||||
/**
|
||||
* Event called when the validation is complete
|
||||
*/
|
||||
onFilePathsValidated(handle: number, fileBrowserValidatedParams: data.FileBrowserValidatedParams);
|
||||
onFilePathsValidated(handle: number, fileBrowserValidatedParams: sqlops.FileBrowserValidatedParams);
|
||||
|
||||
/**
|
||||
* Close file browser
|
||||
*/
|
||||
closeFileBrowser(ownerUri: string): Thenable<data.FileBrowserCloseResponse>;
|
||||
closeFileBrowser(ownerUri: string): Thenable<sqlops.FileBrowserCloseResponse>;
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import { Observable } from 'rxjs/Observable';
|
||||
import { Subject } from 'rxjs/Subject';
|
||||
import { Observer } from 'rxjs/Observer';
|
||||
|
||||
import { ResultSetSubset, EditUpdateCellResult, EditSubsetResult, EditCreateRowResult } from 'data';
|
||||
import { ResultSetSubset, EditUpdateCellResult, EditSubsetResult, EditCreateRowResult } from 'sqlops';
|
||||
import { IQueryModelService } from 'sql/parts/query/execution/queryModel';
|
||||
import { ResultSerializer } from 'sql/parts/query/common/resultSerializer';
|
||||
import { ISaveRequest } from 'sql/parts/grid/common/interfaces';
|
||||
|
||||
@@ -11,7 +11,7 @@ import * as Utils from 'sql/parts/connection/common/utils';
|
||||
import { IInsightsDialogModel, insertValueRegex } from 'sql/parts/insights/common/interfaces';
|
||||
import { error } from 'sql/base/common/log';
|
||||
|
||||
import { DbCellValue, IDbColumn, QueryExecuteSubsetResult } from 'data';
|
||||
import { DbCellValue, IDbColumn, QueryExecuteSubsetResult } from 'sqlops';
|
||||
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import * as types from 'vs/base/common/types';
|
||||
|
||||
@@ -8,7 +8,7 @@ import { IProfilerSession, IProfilerService, ProfilerSessionID, IProfilerSession
|
||||
import { ProfilerState } from './profilerState';
|
||||
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { EditorInput } from 'vs/workbench/common/editor';
|
||||
@@ -123,9 +123,9 @@ export class ProfilerInput extends EditorInput implements IProfilerSession {
|
||||
return this._state;
|
||||
}
|
||||
|
||||
public onMoreRows(eventMessage: data.ProfilerSessionEvents) {
|
||||
public onMoreRows(eventMessage: sqlops.ProfilerSessionEvents) {
|
||||
for (let i: number = 0; i < eventMessage.events.length && i < 500; ++i) {
|
||||
let e: data.ProfilerEvent = eventMessage.events[i];
|
||||
let e: sqlops.ProfilerEvent = eventMessage.events[i];
|
||||
let data = {};
|
||||
data['EventClass'] = e.name;
|
||||
data['StartTime'] = e.timestamp;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
import { ProfilerInput } from 'sql/parts/profiler/editor/profilerInput';
|
||||
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
const PROFILER_SERVICE_ID = 'profilerService';
|
||||
export const IProfilerService = createDecorator<IProfilerService>(PROFILER_SERVICE_ID);
|
||||
@@ -24,7 +24,7 @@ export interface IProfilerSession {
|
||||
/**
|
||||
* Called by the service when more rows are available to render
|
||||
*/
|
||||
onMoreRows(events: data.ProfilerSessionEvents);
|
||||
onMoreRows(events: sqlops.ProfilerSessionEvents);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ export interface IProfilerService {
|
||||
/**
|
||||
* Registers a backend provider for profiler session. ex: mssql
|
||||
*/
|
||||
registerProvider(providerId: string, provider: data.ProfilerProvider): void;
|
||||
registerProvider(providerId: string, provider: sqlops.ProfilerProvider): void;
|
||||
/**
|
||||
* Registers a session with the service that acts as the UI for a profiler session
|
||||
* @returns An unique id that should be used to make subsequent calls to this service
|
||||
@@ -64,7 +64,7 @@ export interface IProfilerService {
|
||||
/**
|
||||
* The method called by the service provider for when more rows are available to render
|
||||
*/
|
||||
onMoreRows(params: data.ProfilerSessionEvents): void;
|
||||
onMoreRows(params: sqlops.ProfilerSessionEvents): void;
|
||||
/**
|
||||
* Gets a list of the session templates that are specified in the settings
|
||||
* @param provider An optional string to limit the session template to a specific
|
||||
|
||||
@@ -12,7 +12,7 @@ import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
import { ProfilerInput } from 'sql/parts/profiler/editor/profilerInput';
|
||||
import { ProfilerColumnEditorDialog } from 'sql/parts/profiler/dialog/profilerColumnEditorDialog';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
@@ -44,7 +44,7 @@ class TwoWayMap<T, K> {
|
||||
|
||||
export class ProfilerService implements IProfilerService {
|
||||
public _serviceBrand: any;
|
||||
private _providers = new Map<string, data.ProfilerProvider>();
|
||||
private _providers = new Map<string, sqlops.ProfilerProvider>();
|
||||
private _idMap = new TwoWayMap<ProfilerSessionID, string>();
|
||||
private _sessionMap = new Map<ProfilerSessionID, IProfilerSession>();
|
||||
private _dialog: ProfilerColumnEditorDialog;
|
||||
@@ -55,7 +55,7 @@ export class ProfilerService implements IProfilerService {
|
||||
@IInstantiationService private _instantiationService: IInstantiationService
|
||||
) { }
|
||||
|
||||
public registerProvider(providerId: string, provider: data.ProfilerProvider): void {
|
||||
public registerProvider(providerId: string, provider: sqlops.ProfilerProvider): void {
|
||||
this._providers.set(providerId, provider);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ export class ProfilerService implements IProfilerService {
|
||||
return uri;
|
||||
}
|
||||
|
||||
public onMoreRows(params: data.ProfilerSessionEvents): void {
|
||||
public onMoreRows(params: sqlops.ProfilerSessionEvents): void {
|
||||
|
||||
this._sessionMap.get(this._idMap.reverseGet(params.sessionId)).onMoreRows(params);
|
||||
}
|
||||
@@ -102,7 +102,7 @@ export class ProfilerService implements IProfilerService {
|
||||
return this._runAction(id, provider => provider.stopSession(this._idMap.get(id)));
|
||||
}
|
||||
|
||||
private _runAction<T>(id: ProfilerSessionID, action: (handler: data.ProfilerProvider) => Thenable<T>): Thenable<T> {
|
||||
private _runAction<T>(id: ProfilerSessionID, action: (handler: sqlops.ProfilerProvider) => Thenable<T>): Thenable<T> {
|
||||
// let providerId = this._connectionService.getProviderIdFromUri(this._idMap.get(id));
|
||||
let providerId = 'MSSQL';
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import * as pfs from 'vs/base/node/pfs';
|
||||
import * as path from 'path';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
declare var __dirname;
|
||||
|
||||
@@ -30,7 +30,7 @@ const columns = [
|
||||
'BinaryData'
|
||||
];
|
||||
|
||||
export class ProfilerTestBackend implements data.ProfilerProvider {
|
||||
export class ProfilerTestBackend implements sqlops.ProfilerProvider {
|
||||
public readonly providerId = 'MSSQL';
|
||||
private index = 0;
|
||||
private timeOutMap = new Map<string, number>();
|
||||
@@ -44,7 +44,7 @@ export class ProfilerTestBackend implements data.ProfilerProvider {
|
||||
return TPromise.as(true);
|
||||
}
|
||||
|
||||
registerOnSessionEventsAvailable(handler: (response: data.ProfilerSessionEvents) => any) {
|
||||
registerOnSessionEventsAvailable(handler: (response: sqlops.ProfilerSessionEvents) => any) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import nls = require('vs/nls');
|
||||
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
||||
import * as WorkbenchUtils from 'sql/workbench/common/sqlWorkbenchUtils';
|
||||
|
||||
import { DidChangeLanguageFlavorParams } from 'data';
|
||||
import { DidChangeLanguageFlavorParams } from 'sqlops';
|
||||
|
||||
export interface ISqlProviderEntry extends IPickOpenEntry {
|
||||
providerId: string;
|
||||
|
||||
@@ -12,7 +12,7 @@ import { IQueryModelService } from 'sql/parts/query/execution/queryModel';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { ISelectionData, ExecutionPlanOptions } from 'data';
|
||||
import { ISelectionData, ExecutionPlanOptions } from 'sqlops';
|
||||
import { IQueryEditorService } from 'sql/parts/query/common/queryEditorService';
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ import QueryRunner from 'sql/parts/query/execution/queryRunner';
|
||||
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import * as TelemetryKeys from 'sql/common/telemetryKeys';
|
||||
import * as TelemetryUtils from 'sql/common/telemetryUtilities';
|
||||
@@ -23,21 +23,21 @@ export interface IQueryManagementService {
|
||||
addQueryRequestHandler(queryType: string, runner: IQueryRequestHandler): IDisposable;
|
||||
registerRunner(runner: QueryRunner, uri: string): void;
|
||||
|
||||
cancelQuery(ownerUri: string): Thenable<data.QueryCancelResult>;
|
||||
runQuery(ownerUri: string, selection: data.ISelectionData, runOptions?: data.ExecutionPlanOptions): Thenable<void>;
|
||||
cancelQuery(ownerUri: string): Thenable<sqlops.QueryCancelResult>;
|
||||
runQuery(ownerUri: string, selection: sqlops.ISelectionData, runOptions?: sqlops.ExecutionPlanOptions): Thenable<void>;
|
||||
runQueryStatement(ownerUri: string, line: number, column: number): Thenable<void>;
|
||||
runQueryString(ownerUri: string, queryString: string): Thenable<void>;
|
||||
runQueryAndReturn(ownerUri: string, queryString: string): Thenable<data.SimpleExecuteResult>;
|
||||
getQueryRows(rowData: data.QueryExecuteSubsetParams): Thenable<data.QueryExecuteSubsetResult>;
|
||||
runQueryAndReturn(ownerUri: string, queryString: string): Thenable<sqlops.SimpleExecuteResult>;
|
||||
getQueryRows(rowData: sqlops.QueryExecuteSubsetParams): Thenable<sqlops.QueryExecuteSubsetResult>;
|
||||
disposeQuery(ownerUri: string): Thenable<void>;
|
||||
saveResults(requestParams: data.SaveResultsRequestParams): Thenable<data.SaveResultRequestResult>;
|
||||
saveResults(requestParams: sqlops.SaveResultsRequestParams): Thenable<sqlops.SaveResultRequestResult>;
|
||||
|
||||
// Callbacks
|
||||
onQueryComplete(result: data.QueryExecuteCompleteNotificationResult): void;
|
||||
onBatchStart(batchInfo: data.QueryExecuteBatchNotificationParams): void;
|
||||
onBatchComplete(batchInfo: data.QueryExecuteBatchNotificationParams): void;
|
||||
onResultSetComplete(resultSetInfo: data.QueryExecuteResultSetCompleteNotificationParams): void;
|
||||
onMessage(message: data.QueryExecuteMessageParams): void;
|
||||
onQueryComplete(result: sqlops.QueryExecuteCompleteNotificationResult): void;
|
||||
onBatchStart(batchInfo: sqlops.QueryExecuteBatchNotificationParams): void;
|
||||
onBatchComplete(batchInfo: sqlops.QueryExecuteBatchNotificationParams): void;
|
||||
onResultSetComplete(resultSetInfo: sqlops.QueryExecuteResultSetCompleteNotificationParams): void;
|
||||
onMessage(message: sqlops.QueryExecuteMessageParams): void;
|
||||
|
||||
// Edit Data Callbacks
|
||||
onEditSessionReady(ownerUri: string, success: boolean, message: string): void;
|
||||
@@ -45,38 +45,38 @@ export interface IQueryManagementService {
|
||||
// Edit Data Functions
|
||||
initializeEdit(ownerUri: string, schemaName: string, objectName: string, objectType: string, rowLimit: number): Thenable<void>;
|
||||
disposeEdit(ownerUri: string): Thenable<void>;
|
||||
updateCell(ownerUri: string, rowId: number, columnId: number, newValue: string): Thenable<data.EditUpdateCellResult>;
|
||||
updateCell(ownerUri: string, rowId: number, columnId: number, newValue: string): Thenable<sqlops.EditUpdateCellResult>;
|
||||
commitEdit(ownerUri): Thenable<void>;
|
||||
createRow(ownerUri: string): Thenable<data.EditCreateRowResult>;
|
||||
createRow(ownerUri: string): Thenable<sqlops.EditCreateRowResult>;
|
||||
deleteRow(ownerUri: string, rowId: number): Thenable<void>;
|
||||
revertCell(ownerUri: string, rowId: number, columnId: number): Thenable<data.EditRevertCellResult>;
|
||||
revertCell(ownerUri: string, rowId: number, columnId: number): Thenable<sqlops.EditRevertCellResult>;
|
||||
revertRow(ownerUri: string, rowId: number): Thenable<void>;
|
||||
getEditRows(rowData: data.EditSubsetParams): Thenable<data.EditSubsetResult>;
|
||||
getEditRows(rowData: sqlops.EditSubsetParams): Thenable<sqlops.EditSubsetResult>;
|
||||
}
|
||||
|
||||
/*
|
||||
* An object that can handle basic request-response actions related to queries
|
||||
*/
|
||||
export interface IQueryRequestHandler {
|
||||
cancelQuery(ownerUri: string): Thenable<data.QueryCancelResult>;
|
||||
runQuery(ownerUri: string, selection: data.ISelectionData, runOptions?: data.ExecutionPlanOptions): Thenable<void>;
|
||||
cancelQuery(ownerUri: string): Thenable<sqlops.QueryCancelResult>;
|
||||
runQuery(ownerUri: string, selection: sqlops.ISelectionData, runOptions?: sqlops.ExecutionPlanOptions): Thenable<void>;
|
||||
runQueryStatement(ownerUri: string, line: number, column: number): Thenable<void>;
|
||||
runQueryString(ownerUri: string, queryString: string): Thenable<void>;
|
||||
runQueryAndReturn(ownerUri: string, queryString: string): Thenable<data.SimpleExecuteResult>;
|
||||
getQueryRows(rowData: data.QueryExecuteSubsetParams): Thenable<data.QueryExecuteSubsetResult>;
|
||||
runQueryAndReturn(ownerUri: string, queryString: string): Thenable<sqlops.SimpleExecuteResult>;
|
||||
getQueryRows(rowData: sqlops.QueryExecuteSubsetParams): Thenable<sqlops.QueryExecuteSubsetResult>;
|
||||
disposeQuery(ownerUri: string): Thenable<void>;
|
||||
saveResults(requestParams: data.SaveResultsRequestParams): Thenable<data.SaveResultRequestResult>;
|
||||
saveResults(requestParams: sqlops.SaveResultsRequestParams): Thenable<sqlops.SaveResultRequestResult>;
|
||||
|
||||
// Edit Data actions
|
||||
initializeEdit(ownerUri: string, schemaName: string, objectName: string, objectType: string, rowLimit: number): Thenable<void>;
|
||||
disposeEdit(ownerUri: string): Thenable<void>;
|
||||
updateCell(ownerUri: string, rowId: number, columnId: number, newValue: string): Thenable<data.EditUpdateCellResult>;
|
||||
updateCell(ownerUri: string, rowId: number, columnId: number, newValue: string): Thenable<sqlops.EditUpdateCellResult>;
|
||||
commitEdit(ownerUri): Thenable<void>;
|
||||
createRow(ownerUri: string): Thenable<data.EditCreateRowResult>;
|
||||
createRow(ownerUri: string): Thenable<sqlops.EditCreateRowResult>;
|
||||
deleteRow(ownerUri: string, rowId: number): Thenable<void>;
|
||||
revertCell(ownerUri: string, rowId: number, columnId: number): Thenable<data.EditRevertCellResult>;
|
||||
revertCell(ownerUri: string, rowId: number, columnId: number): Thenable<sqlops.EditRevertCellResult>;
|
||||
revertRow(ownerUri: string, rowId: number): Thenable<void>;
|
||||
getEditRows(rowData: data.EditSubsetParams): Thenable<data.EditSubsetResult>;
|
||||
getEditRows(rowData: sqlops.EditSubsetParams): Thenable<sqlops.EditSubsetResult>;
|
||||
}
|
||||
|
||||
export class QueryManagementService implements IQueryManagementService {
|
||||
@@ -141,7 +141,7 @@ export class QueryManagementService implements IQueryManagementService {
|
||||
};
|
||||
}
|
||||
|
||||
private addTelemetry(eventName: string, ownerUri: string, runOptions?: data.ExecutionPlanOptions): void {
|
||||
private addTelemetry(eventName: string, ownerUri: string, runOptions?: sqlops.ExecutionPlanOptions): void {
|
||||
let providerId: string = this._connectionService.getProviderIdFromUri(ownerUri);
|
||||
let data: TelemetryUtils.IConnectionTelemetryData = {
|
||||
provider: providerId,
|
||||
@@ -169,13 +169,13 @@ export class QueryManagementService implements IQueryManagementService {
|
||||
}
|
||||
}
|
||||
|
||||
public cancelQuery(ownerUri: string): Thenable<data.QueryCancelResult> {
|
||||
public cancelQuery(ownerUri: string): Thenable<sqlops.QueryCancelResult> {
|
||||
this.addTelemetry(TelemetryKeys.CancelQuery, ownerUri);
|
||||
return this._runAction(ownerUri, (runner) => {
|
||||
return runner.cancelQuery(ownerUri);
|
||||
});
|
||||
}
|
||||
public runQuery(ownerUri: string, selection: data.ISelectionData, runOptions?: data.ExecutionPlanOptions): Thenable<void> {
|
||||
public runQuery(ownerUri: string, selection: sqlops.ISelectionData, runOptions?: sqlops.ExecutionPlanOptions): Thenable<void> {
|
||||
this.addTelemetry(TelemetryKeys.RunQuery, ownerUri, runOptions);
|
||||
return this._runAction(ownerUri, (runner) => {
|
||||
return runner.runQuery(ownerUri, selection, runOptions);
|
||||
@@ -192,12 +192,12 @@ export class QueryManagementService implements IQueryManagementService {
|
||||
return runner.runQueryString(ownerUri, queryString);
|
||||
});
|
||||
}
|
||||
public runQueryAndReturn(ownerUri: string, queryString: string): Thenable<data.SimpleExecuteResult> {
|
||||
public runQueryAndReturn(ownerUri: string, queryString: string): Thenable<sqlops.SimpleExecuteResult> {
|
||||
return this._runAction(ownerUri, (runner) => {
|
||||
return runner.runQueryAndReturn(ownerUri, queryString);
|
||||
});
|
||||
}
|
||||
public getQueryRows(rowData: data.QueryExecuteSubsetParams): Thenable<data.QueryExecuteSubsetResult> {
|
||||
public getQueryRows(rowData: sqlops.QueryExecuteSubsetParams): Thenable<sqlops.QueryExecuteSubsetResult> {
|
||||
return this._runAction(rowData.ownerUri, (runner) => {
|
||||
return runner.getQueryRows(rowData);
|
||||
});
|
||||
@@ -208,36 +208,36 @@ export class QueryManagementService implements IQueryManagementService {
|
||||
});
|
||||
}
|
||||
|
||||
public saveResults(requestParams: data.SaveResultsRequestParams): Thenable<data.SaveResultRequestResult> {
|
||||
public saveResults(requestParams: sqlops.SaveResultsRequestParams): Thenable<sqlops.SaveResultRequestResult> {
|
||||
return this._runAction(requestParams.ownerUri, (runner) => {
|
||||
return runner.saveResults(requestParams);
|
||||
});
|
||||
}
|
||||
|
||||
public onQueryComplete(result: data.QueryExecuteCompleteNotificationResult): void {
|
||||
public onQueryComplete(result: sqlops.QueryExecuteCompleteNotificationResult): void {
|
||||
this._notify(result.ownerUri, (runner: QueryRunner) => {
|
||||
runner.handleQueryComplete(result);
|
||||
});
|
||||
}
|
||||
public onBatchStart(batchInfo: data.QueryExecuteBatchNotificationParams): void {
|
||||
public onBatchStart(batchInfo: sqlops.QueryExecuteBatchNotificationParams): void {
|
||||
this._notify(batchInfo.ownerUri, (runner: QueryRunner) => {
|
||||
runner.handleBatchStart(batchInfo);
|
||||
});
|
||||
}
|
||||
|
||||
public onBatchComplete(batchInfo: data.QueryExecuteBatchNotificationParams): void {
|
||||
public onBatchComplete(batchInfo: sqlops.QueryExecuteBatchNotificationParams): void {
|
||||
this._notify(batchInfo.ownerUri, (runner: QueryRunner) => {
|
||||
runner.handleBatchComplete(batchInfo);
|
||||
});
|
||||
}
|
||||
|
||||
public onResultSetComplete(resultSetInfo: data.QueryExecuteResultSetCompleteNotificationParams): void {
|
||||
public onResultSetComplete(resultSetInfo: sqlops.QueryExecuteResultSetCompleteNotificationParams): void {
|
||||
this._notify(resultSetInfo.ownerUri, (runner: QueryRunner) => {
|
||||
runner.handleResultSetComplete(resultSetInfo);
|
||||
});
|
||||
}
|
||||
|
||||
public onMessage(message: data.QueryExecuteMessageParams): void {
|
||||
public onMessage(message: sqlops.QueryExecuteMessageParams): void {
|
||||
this._notify(message.ownerUri, (runner: QueryRunner) => {
|
||||
runner.handleMessage(message);
|
||||
});
|
||||
@@ -256,7 +256,7 @@ export class QueryManagementService implements IQueryManagementService {
|
||||
});
|
||||
}
|
||||
|
||||
public updateCell(ownerUri: string, rowId: number, columnId: number, newValue: string): Thenable<data.EditUpdateCellResult> {
|
||||
public updateCell(ownerUri: string, rowId: number, columnId: number, newValue: string): Thenable<sqlops.EditUpdateCellResult> {
|
||||
return this._runAction(ownerUri, (runner) => {
|
||||
return runner.updateCell(ownerUri, rowId, columnId, newValue);
|
||||
});
|
||||
@@ -268,7 +268,7 @@ export class QueryManagementService implements IQueryManagementService {
|
||||
});
|
||||
}
|
||||
|
||||
public createRow(ownerUri: string): Thenable<data.EditCreateRowResult> {
|
||||
public createRow(ownerUri: string): Thenable<sqlops.EditCreateRowResult> {
|
||||
return this._runAction(ownerUri, (runner) => {
|
||||
return runner.createRow(ownerUri);
|
||||
});
|
||||
@@ -286,7 +286,7 @@ export class QueryManagementService implements IQueryManagementService {
|
||||
});
|
||||
}
|
||||
|
||||
public revertCell(ownerUri: string, rowId: number, columnId: number): Thenable<data.EditRevertCellResult> {
|
||||
public revertCell(ownerUri: string, rowId: number, columnId: number): Thenable<sqlops.EditRevertCellResult> {
|
||||
return this._runAction(ownerUri, (runner) => {
|
||||
return runner.revertCell(ownerUri, rowId, columnId);
|
||||
});
|
||||
@@ -298,7 +298,7 @@ export class QueryManagementService implements IQueryManagementService {
|
||||
});
|
||||
}
|
||||
|
||||
public getEditRows(rowData: data.EditSubsetParams): Thenable<data.EditSubsetResult> {
|
||||
public getEditRows(rowData: sqlops.EditSubsetParams): Thenable<sqlops.EditSubsetResult> {
|
||||
return this._runAction(rowData.ownerUri, (runner) => {
|
||||
return runner.getEditRows(rowData);
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@ import * as ConnectionConstants from 'sql/parts/connection/common/constants';
|
||||
import * as Constants from 'sql/parts/query/common/constants';
|
||||
import * as LocalizedConstants from 'sql/parts/query/common/localizedConstants';
|
||||
import * as WorkbenchUtils from 'sql/workbench/common/sqlWorkbenchUtils';
|
||||
import { SaveResultsRequestParams } from 'data';
|
||||
import { SaveResultsRequestParams } from 'sqlops';
|
||||
import { IQueryManagementService } from 'sql/parts/query/common/queryManagement';
|
||||
import { ISaveRequest, SaveFormat } from 'sql/parts/grid/common/interfaces';
|
||||
import * as PathUtilities from 'sql/common/pathUtilities';
|
||||
|
||||
@@ -27,7 +27,7 @@ import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/c
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { ISelectionData } from 'data';
|
||||
import { ISelectionData } from 'sqlops';
|
||||
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
|
||||
import { CodeEditor } from 'vs/editor/browser/codeEditor';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
@@ -737,7 +737,7 @@ export class QueryEditor extends BaseEditor {
|
||||
}
|
||||
|
||||
private _doLayoutSql() {
|
||||
if ( this._resultsEditorContainer) {
|
||||
if (this._resultsEditorContainer) {
|
||||
this._resultsEditorContainer.style.width = '0px';
|
||||
this._resultsEditorContainer.style.height = '0px';
|
||||
this._resultsEditorContainer.style.left = '0px';
|
||||
|
||||
@@ -10,7 +10,7 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
import { IQueryManagementService } from 'sql/parts/query/common/queryManagement';
|
||||
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
||||
@@ -281,37 +281,37 @@ export class RunQueryShortcutAction extends Action {
|
||||
let dbName = this.getDatabaseName(editor);
|
||||
let query = `exec dbo.sp_sproc_columns @procedure_name = N'${escapeSqlString(shortcutText, singleQuote)}', @procedure_owner = null, @procedure_qualifier = N'${escapeSqlString(dbName, singleQuote)}'`;
|
||||
return this._queryManagementService.runQueryAndReturn(editor.uri, query)
|
||||
.then(result => {
|
||||
switch(this.isProcWithSingleArgument(result)) {
|
||||
case 1:
|
||||
// sproc was found and it meets criteria of having 1 string param
|
||||
// if selection is quoted, leave as-is. Else quote
|
||||
let trimmedText = parameterText.trim();
|
||||
if (trimmedText.length > 0) {
|
||||
if (trimmedText.charAt(0) !== singleQuote || trimmedText.charAt(trimmedText.length - 1) !== singleQuote) {
|
||||
// Note: SSMS uses the original text, but this causes issues if you have spaces. We intentionally use
|
||||
// trimmed text since it's likely to be more accurate in this case. For non-quoted cases it shouldn't matter
|
||||
return `'${trimmedText}'`;
|
||||
.then(result => {
|
||||
switch (this.isProcWithSingleArgument(result)) {
|
||||
case 1:
|
||||
// sproc was found and it meets criteria of having 1 string param
|
||||
// if selection is quoted, leave as-is. Else quote
|
||||
let trimmedText = parameterText.trim();
|
||||
if (trimmedText.length > 0) {
|
||||
if (trimmedText.charAt(0) !== singleQuote || trimmedText.charAt(trimmedText.length - 1) !== singleQuote) {
|
||||
// Note: SSMS uses the original text, but this causes issues if you have spaces. We intentionally use
|
||||
// trimmed text since it's likely to be more accurate in this case. For non-quoted cases it shouldn't matter
|
||||
return `'${trimmedText}'`;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case -1:
|
||||
break;
|
||||
case -1:
|
||||
// sproc was found but didn't meet criteria, so append as-is
|
||||
case 0:
|
||||
// sproc wasn't found, just append as-is and hope it works
|
||||
break;
|
||||
}
|
||||
return parameterText;
|
||||
}, err => {
|
||||
return parameterText;
|
||||
});
|
||||
case 0:
|
||||
// sproc wasn't found, just append as-is and hope it works
|
||||
break;
|
||||
}
|
||||
return parameterText;
|
||||
}, err => {
|
||||
return parameterText;
|
||||
});
|
||||
}
|
||||
return TPromise.as(parameterText);
|
||||
}
|
||||
return TPromise.as('');
|
||||
}
|
||||
|
||||
private isProcWithSingleArgument(result: data.SimpleExecuteResult): number {
|
||||
private isProcWithSingleArgument(result: sqlops.SimpleExecuteResult): number {
|
||||
let columnTypeOrdinal = this.getColumnIndex(result.columnInfo, 'COLUMN_TYPE');
|
||||
let dataTypeOrdinal = this.getColumnIndex(result.columnInfo, 'DATA_TYPE');
|
||||
if (columnTypeOrdinal && dataTypeOrdinal) {
|
||||
@@ -345,7 +345,7 @@ export class RunQueryShortcutAction extends Action {
|
||||
return -1; // Couldn't process so return default value
|
||||
}
|
||||
|
||||
private getColumnIndex(columnInfo: data.IDbColumn[], columnName: string): number {
|
||||
private getColumnIndex(columnInfo: sqlops.IDbColumn[], columnName: string): number {
|
||||
return columnInfo ? columnInfo.findIndex(c => c.columnName === columnName) : undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import { IContextViewService } from 'vs/platform/contextview/browser/contextView
|
||||
import { IMessageService, Severity } from 'vs/platform/message/common/message';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
import { ISelectionData } from 'data';
|
||||
import { ISelectionData } from 'sqlops';
|
||||
import {
|
||||
IConnectionManagementService,
|
||||
IConnectionParams,
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
EditCreateRowResult,
|
||||
EditRevertCellResult,
|
||||
ExecutionPlanOptions
|
||||
} from 'data';
|
||||
} from 'sqlops';
|
||||
|
||||
export const SERVICE_ID = 'queryModelService';
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import { QueryInput } from 'sql/parts/query/common/queryInput';
|
||||
import { QueryStatusbarItem } from 'sql/parts/query/execution/queryStatus';
|
||||
import { SqlFlavorStatusbarItem } from 'sql/parts/query/common/flavorStatus';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { ISlickRange } from 'angular2-slickgrid';
|
||||
|
||||
import * as nls from 'vs/nls';
|
||||
@@ -41,7 +41,7 @@ class QueryInfo {
|
||||
public queryRunner: QueryRunner;
|
||||
public dataService: DataService;
|
||||
public queryEventQueue: QueryEvent[];
|
||||
public selection: Array<data.ISelectionData>;
|
||||
public selection: Array<sqlops.ISelectionData>;
|
||||
public queryInput: QueryInput;
|
||||
public selectionSnippet: string;
|
||||
|
||||
@@ -66,12 +66,12 @@ export class QueryModelService implements IQueryModelService {
|
||||
private _queryInfoMap: Map<string, QueryInfo>;
|
||||
private _onRunQueryStart: Emitter<string>;
|
||||
private _onRunQueryComplete: Emitter<string>;
|
||||
private _onEditSessionReady: Emitter<data.EditSessionReadyParams>;
|
||||
private _onEditSessionReady: Emitter<sqlops.EditSessionReadyParams>;
|
||||
|
||||
// EVENTS /////////////////////////////////////////////////////////////
|
||||
public get onRunQueryStart(): Event<string> { return this._onRunQueryStart.event; }
|
||||
public get onRunQueryComplete(): Event<string> { return this._onRunQueryComplete.event; }
|
||||
public get onEditSessionReady(): Event<data.EditSessionReadyParams> { return this._onEditSessionReady.event; }
|
||||
public get onEditSessionReady(): Event<sqlops.EditSessionReadyParams> { return this._onEditSessionReady.event; }
|
||||
|
||||
// CONSTRUCTOR /////////////////////////////////////////////////////////
|
||||
constructor(
|
||||
@@ -81,7 +81,7 @@ export class QueryModelService implements IQueryModelService {
|
||||
this._queryInfoMap = new Map<string, QueryInfo>();
|
||||
this._onRunQueryStart = new Emitter<string>();
|
||||
this._onRunQueryComplete = new Emitter<string>();
|
||||
this._onEditSessionReady = new Emitter<data.EditSessionReadyParams>();
|
||||
this._onEditSessionReady = new Emitter<sqlops.EditSessionReadyParams>();
|
||||
|
||||
// Register Statusbar items
|
||||
(<statusbar.IStatusbarRegistry>platform.Registry.as(statusbar.Extensions.Statusbar)).registerStatusbarItem(new statusbar.StatusbarItemDescriptor(
|
||||
@@ -141,13 +141,13 @@ export class QueryModelService implements IQueryModelService {
|
||||
/**
|
||||
* Get more data rows from the current resultSets from the service layer
|
||||
*/
|
||||
public getQueryRows(uri: string, rowStart: number, numberOfRows: number, batchId: number, resultId: number): Thenable<data.ResultSetSubset> {
|
||||
public getQueryRows(uri: string, rowStart: number, numberOfRows: number, batchId: number, resultId: number): Thenable<sqlops.ResultSetSubset> {
|
||||
return this._getQueryInfo(uri).queryRunner.getQueryRows(rowStart, numberOfRows, batchId, resultId).then(results => {
|
||||
return results.resultSubset;
|
||||
});
|
||||
}
|
||||
|
||||
public getEditRows(uri: string, rowStart: number, numberOfRows: number): Thenable<data.EditSubsetResult> {
|
||||
public getEditRows(uri: string, rowStart: number, numberOfRows: number): Thenable<sqlops.EditSubsetResult> {
|
||||
return this._queryInfoMap.get(uri).queryRunner.getEditRows(rowStart, numberOfRows).then(results => {
|
||||
return results;
|
||||
});
|
||||
@@ -191,15 +191,15 @@ export class QueryModelService implements IQueryModelService {
|
||||
/**
|
||||
* Run a query for the given URI with the given text selection
|
||||
*/
|
||||
public runQuery(uri: string, selection: data.ISelectionData,
|
||||
title: string, queryInput: QueryInput, runOptions?: data.ExecutionPlanOptions): void {
|
||||
public runQuery(uri: string, selection: sqlops.ISelectionData,
|
||||
title: string, queryInput: QueryInput, runOptions?: sqlops.ExecutionPlanOptions): void {
|
||||
this.doRunQuery(uri, selection, title, queryInput, false, runOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the current SQL statement for the given URI
|
||||
*/
|
||||
public runQueryStatement(uri: string, selection: data.ISelectionData,
|
||||
public runQueryStatement(uri: string, selection: sqlops.ISelectionData,
|
||||
title: string, queryInput: QueryInput): void {
|
||||
this.doRunQuery(uri, selection, title, queryInput, true);
|
||||
}
|
||||
@@ -215,9 +215,9 @@ export class QueryModelService implements IQueryModelService {
|
||||
/**
|
||||
* Run Query implementation
|
||||
*/
|
||||
private doRunQuery(uri: string, selection: data.ISelectionData | string,
|
||||
private doRunQuery(uri: string, selection: sqlops.ISelectionData | string,
|
||||
title: string, queryInput: QueryInput,
|
||||
runCurrentStatement: boolean, runOptions?: data.ExecutionPlanOptions): void {
|
||||
runCurrentStatement: boolean, runOptions?: sqlops.ExecutionPlanOptions): void {
|
||||
// Reuse existing query runner if it exists
|
||||
let queryRunner: QueryRunner;
|
||||
let info: QueryInfo;
|
||||
@@ -422,7 +422,7 @@ export class QueryModelService implements IQueryModelService {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
public updateCell(ownerUri: string, rowId: number, columnId: number, newValue: string): Thenable<data.EditUpdateCellResult> {
|
||||
public updateCell(ownerUri: string, rowId: number, columnId: number, newValue: string): Thenable<sqlops.EditUpdateCellResult> {
|
||||
// Get existing query runner
|
||||
let queryRunner = this._getQueryRunner(ownerUri);
|
||||
if (queryRunner) {
|
||||
@@ -446,7 +446,7 @@ export class QueryModelService implements IQueryModelService {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
public createRow(ownerUri: string): Thenable<data.EditCreateRowResult> {
|
||||
public createRow(ownerUri: string): Thenable<sqlops.EditCreateRowResult> {
|
||||
// Get existing query runner
|
||||
let queryRunner = this._getQueryRunner(ownerUri);
|
||||
if (queryRunner) {
|
||||
@@ -464,7 +464,7 @@ export class QueryModelService implements IQueryModelService {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
public revertCell(ownerUri: string, rowId: number, columnId: number): Thenable<data.EditRevertCellResult> {
|
||||
public revertCell(ownerUri: string, rowId: number, columnId: number): Thenable<sqlops.EditRevertCellResult> {
|
||||
// Get existing query runner
|
||||
let queryRunner = this._getQueryRunner(ownerUri);
|
||||
if (queryRunner) {
|
||||
@@ -539,9 +539,9 @@ export class QueryModelService implements IQueryModelService {
|
||||
|
||||
// TODO remove this funciton and its usages when #821 in vscode-mssql is fixed and
|
||||
// the SqlToolsService version is updated in this repo - coquagli 4/19/2017
|
||||
private _validateSelection(selection: data.ISelectionData): data.ISelectionData {
|
||||
private _validateSelection(selection: sqlops.ISelectionData): sqlops.ISelectionData {
|
||||
if (!selection) {
|
||||
selection = <data.ISelectionData>{};
|
||||
selection = <sqlops.ISelectionData>{};
|
||||
}
|
||||
selection.endColumn = selection ? Math.max(0, selection.endColumn) : 0;
|
||||
selection.endLine = selection ? Math.max(0, selection.endLine) : 0;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
import * as Constants from 'sql/parts/query/common/constants';
|
||||
import * as WorkbenchUtils from 'sql/workbench/common/sqlWorkbenchUtils';
|
||||
@@ -41,10 +41,10 @@ export const enum EventType {
|
||||
export interface IEventType {
|
||||
start: void;
|
||||
complete: string;
|
||||
message: data.IResultMessage;
|
||||
batchStart: data.BatchSummary;
|
||||
batchComplete: data.BatchSummary;
|
||||
resultSet: data.ResultSetSummary;
|
||||
message: sqlops.IResultMessage;
|
||||
batchStart: sqlops.BatchSummary;
|
||||
batchComplete: sqlops.BatchSummary;
|
||||
resultSet: sqlops.ResultSetSummary;
|
||||
editSessionReady: IEditSessionReadyEvent;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ export default class QueryRunner {
|
||||
private _totalElapsedMilliseconds: number = 0;
|
||||
private _isExecuting: boolean = false;
|
||||
private _hasCompleted: boolean = false;
|
||||
private _batchSets: data.BatchSummary[] = [];
|
||||
private _batchSets: sqlops.BatchSummary[] = [];
|
||||
private _eventEmitter = new EventEmitter();
|
||||
|
||||
// CONSTRUCTOR /////////////////////////////////////////////////////////
|
||||
@@ -79,7 +79,7 @@ export default class QueryRunner {
|
||||
return this._hasCompleted;
|
||||
}
|
||||
|
||||
get batchSets(): data.BatchSummary[] {
|
||||
get batchSets(): sqlops.BatchSummary[] {
|
||||
return this._batchSets;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ export default class QueryRunner {
|
||||
/**
|
||||
* Cancels the running query, if there is one
|
||||
*/
|
||||
public cancelQuery(): Thenable<data.QueryCancelResult> {
|
||||
public cancelQuery(): Thenable<sqlops.QueryCancelResult> {
|
||||
return this._queryManagementService.cancelQuery(this.uri);
|
||||
}
|
||||
|
||||
@@ -100,13 +100,13 @@ export default class QueryRunner {
|
||||
* Runs the query with the provided query
|
||||
* @param input Query string to execute
|
||||
*/
|
||||
public runQuery(input: string, runOptions?: data.ExecutionPlanOptions): Thenable<void>;
|
||||
public runQuery(input: string, runOptions?: sqlops.ExecutionPlanOptions): Thenable<void>;
|
||||
/**
|
||||
* Runs the query by pulling the query from the document using the provided selection data
|
||||
* @param input selection data
|
||||
*/
|
||||
public runQuery(input: data.ISelectionData, runOptions?: data.ExecutionPlanOptions): Thenable<void>;
|
||||
public runQuery(input, runOptions?: data.ExecutionPlanOptions): Thenable<void> {
|
||||
public runQuery(input: sqlops.ISelectionData, runOptions?: sqlops.ExecutionPlanOptions): Thenable<void>;
|
||||
public runQuery(input, runOptions?: sqlops.ExecutionPlanOptions): Thenable<void> {
|
||||
return this.doRunQuery(input, false, runOptions);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ export default class QueryRunner {
|
||||
* Runs the current SQL statement by pulling the query from the document using the provided selection data
|
||||
* @param input selection data
|
||||
*/
|
||||
public runQueryStatement(input: data.ISelectionData): Thenable<void> {
|
||||
public runQueryStatement(input: sqlops.ISelectionData): Thenable<void> {
|
||||
return this.doRunQuery(input, true);
|
||||
}
|
||||
|
||||
@@ -122,9 +122,9 @@ export default class QueryRunner {
|
||||
* Implementation that runs the query with the provided query
|
||||
* @param input Query string to execute
|
||||
*/
|
||||
private doRunQuery(input: string, runCurrentStatement: boolean, runOptions?: data.ExecutionPlanOptions): Thenable<void>;
|
||||
private doRunQuery(input: data.ISelectionData, runCurrentStatement: boolean, runOptions?: data.ExecutionPlanOptions): Thenable<void>;
|
||||
private doRunQuery(input, runCurrentStatement: boolean, runOptions?: data.ExecutionPlanOptions): Thenable<void> {
|
||||
private doRunQuery(input: string, runCurrentStatement: boolean, runOptions?: sqlops.ExecutionPlanOptions): Thenable<void>;
|
||||
private doRunQuery(input: sqlops.ISelectionData, runCurrentStatement: boolean, runOptions?: sqlops.ExecutionPlanOptions): Thenable<void>;
|
||||
private doRunQuery(input, runCurrentStatement: boolean, runOptions?: sqlops.ExecutionPlanOptions): Thenable<void> {
|
||||
let ownerUri = this.uri;
|
||||
this._batchSets = [];
|
||||
this._hasCompleted = false;
|
||||
@@ -160,20 +160,20 @@ export default class QueryRunner {
|
||||
// Attempting to launch the query failed, show the error message
|
||||
const eol = this.getEolString();
|
||||
let message = nls.localize('query.ExecutionFailedError', 'Execution failed due to an unexpected error: {0}\t{1}', eol, error);
|
||||
this.handleMessage(<data.QueryExecuteMessageParams> {
|
||||
this.handleMessage(<sqlops.QueryExecuteMessageParams>{
|
||||
ownerUri: this.uri,
|
||||
message: {
|
||||
isError: true,
|
||||
message: message
|
||||
}
|
||||
});
|
||||
this.handleQueryComplete(<data.QueryExecuteCompleteNotificationResult> { ownerUri: this.uri });
|
||||
this.handleQueryComplete(<sqlops.QueryExecuteCompleteNotificationResult>{ ownerUri: this.uri });
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle a QueryComplete from the service layer
|
||||
*/
|
||||
public handleQueryComplete(result: data.QueryExecuteCompleteNotificationResult): void {
|
||||
public handleQueryComplete(result: sqlops.QueryExecuteCompleteNotificationResult): void {
|
||||
|
||||
// Store the batch sets we got back as a source of "truth"
|
||||
this._isExecuting = false;
|
||||
@@ -194,7 +194,7 @@ export default class QueryRunner {
|
||||
/**
|
||||
* Handle a BatchStart from the service layer
|
||||
*/
|
||||
public handleBatchStart(result: data.QueryExecuteBatchNotificationParams): void {
|
||||
public handleBatchStart(result: sqlops.QueryExecuteBatchNotificationParams): void {
|
||||
let batch = result.batchSummary;
|
||||
|
||||
// Recalculate the start and end lines, relative to the result line offset
|
||||
@@ -214,8 +214,8 @@ export default class QueryRunner {
|
||||
/**
|
||||
* Handle a BatchComplete from the service layer
|
||||
*/
|
||||
public handleBatchComplete(result: data.QueryExecuteBatchNotificationParams): void {
|
||||
let batch: data.BatchSummary = result.batchSummary;
|
||||
public handleBatchComplete(result: sqlops.QueryExecuteBatchNotificationParams): void {
|
||||
let batch: sqlops.BatchSummary = result.batchSummary;
|
||||
|
||||
// Store the batch again to get the rest of the data
|
||||
this.batchSets[batch.id] = batch;
|
||||
@@ -231,17 +231,17 @@ export default class QueryRunner {
|
||||
/**
|
||||
* Handle a ResultSetComplete from the service layer
|
||||
*/
|
||||
public handleResultSetComplete(result: data.QueryExecuteResultSetCompleteNotificationParams): void {
|
||||
public handleResultSetComplete(result: sqlops.QueryExecuteResultSetCompleteNotificationParams): void {
|
||||
if (result && result.resultSetSummary) {
|
||||
let resultSet = result.resultSetSummary;
|
||||
let batchSet: data.BatchSummary;
|
||||
let batchSet: sqlops.BatchSummary;
|
||||
if (!resultSet.batchId) {
|
||||
// Missing the batchId. In this case, default to always using the first batch in the list
|
||||
// or create one in the case the DMP extension didn't obey the contract perfectly
|
||||
if (this.batchSets.length > 0) {
|
||||
batchSet = this.batchSets[0];
|
||||
} else {
|
||||
batchSet = <data.BatchSummary>{
|
||||
batchSet = <sqlops.BatchSummary>{
|
||||
id: 0,
|
||||
selection: undefined,
|
||||
hasError: false,
|
||||
@@ -263,7 +263,7 @@ export default class QueryRunner {
|
||||
/**
|
||||
* Handle a Mssage from the service layer
|
||||
*/
|
||||
public handleMessage(obj: data.QueryExecuteMessageParams): void {
|
||||
public handleMessage(obj: sqlops.QueryExecuteMessageParams): void {
|
||||
let message = obj.message;
|
||||
message.time = new Date(message.time).toLocaleTimeString();
|
||||
|
||||
@@ -274,9 +274,9 @@ export default class QueryRunner {
|
||||
/**
|
||||
* Get more data rows from the current resultSets from the service layer
|
||||
*/
|
||||
public getQueryRows(rowStart: number, numberOfRows: number, batchIndex: number, resultSetIndex: number): Thenable<data.QueryExecuteSubsetResult> {
|
||||
public getQueryRows(rowStart: number, numberOfRows: number, batchIndex: number, resultSetIndex: number): Thenable<sqlops.QueryExecuteSubsetResult> {
|
||||
const self = this;
|
||||
let rowData: data.QueryExecuteSubsetParams = <data.QueryExecuteSubsetParams>{
|
||||
let rowData: sqlops.QueryExecuteSubsetParams = <sqlops.QueryExecuteSubsetParams>{
|
||||
ownerUri: this.uri,
|
||||
resultSetIndex: resultSetIndex,
|
||||
rowsCount: numberOfRows,
|
||||
@@ -284,7 +284,7 @@ export default class QueryRunner {
|
||||
batchIndex: batchIndex
|
||||
};
|
||||
|
||||
return new Promise<data.QueryExecuteSubsetResult>((resolve, reject) => {
|
||||
return new Promise<sqlops.QueryExecuteSubsetResult>((resolve, reject) => {
|
||||
self._queryManagementService.getQueryRows(rowData).then(result => {
|
||||
resolve(result);
|
||||
}, error => {
|
||||
@@ -322,15 +322,15 @@ export default class QueryRunner {
|
||||
* @param rowStart The index of the row to start returning (inclusive)
|
||||
* @param numberOfRows The number of rows to return
|
||||
*/
|
||||
public getEditRows(rowStart: number, numberOfRows: number): Thenable<data.EditSubsetResult> {
|
||||
public getEditRows(rowStart: number, numberOfRows: number): Thenable<sqlops.EditSubsetResult> {
|
||||
const self = this;
|
||||
let rowData: data.EditSubsetParams = {
|
||||
let rowData: sqlops.EditSubsetParams = {
|
||||
ownerUri: this.uri,
|
||||
rowCount: numberOfRows,
|
||||
rowStartIndex: rowStart
|
||||
};
|
||||
|
||||
return new Promise<data.EditSubsetResult>((resolve, reject) => {
|
||||
return new Promise<sqlops.EditSubsetResult>((resolve, reject) => {
|
||||
self._queryManagementService.getEditRows(rowData).then(result => {
|
||||
if (!result.hasOwnProperty('rowCount')) {
|
||||
let error = `Nothing returned from subset query`;
|
||||
@@ -350,7 +350,7 @@ export default class QueryRunner {
|
||||
this._eventEmitter.emit(EventType.EDIT_SESSION_READY, { ownerUri, success, message });
|
||||
}
|
||||
|
||||
public updateCell(ownerUri: string, rowId: number, columnId: number, newValue: string): Thenable<data.EditUpdateCellResult> {
|
||||
public updateCell(ownerUri: string, rowId: number, columnId: number, newValue: string): Thenable<sqlops.EditUpdateCellResult> {
|
||||
return this._queryManagementService.updateCell(ownerUri, rowId, columnId, newValue);
|
||||
}
|
||||
|
||||
@@ -358,7 +358,7 @@ export default class QueryRunner {
|
||||
return this._queryManagementService.commitEdit(ownerUri);
|
||||
}
|
||||
|
||||
public createRow(ownerUri: string): Thenable<data.EditCreateRowResult> {
|
||||
public createRow(ownerUri: string): Thenable<sqlops.EditCreateRowResult> {
|
||||
return this._queryManagementService.createRow(ownerUri).then(result => {
|
||||
return result;
|
||||
});
|
||||
@@ -368,7 +368,7 @@ export default class QueryRunner {
|
||||
return this._queryManagementService.deleteRow(ownerUri, rowId);
|
||||
}
|
||||
|
||||
public revertCell(ownerUri: string, rowId: number, columnId: number): Thenable<data.EditRevertCellResult> {
|
||||
public revertCell(ownerUri: string, rowId: number, columnId: number): Thenable<sqlops.EditRevertCellResult> {
|
||||
return this._queryManagementService.revertCell(ownerUri, rowId, columnId).then(result => {
|
||||
return result;
|
||||
});
|
||||
@@ -468,7 +468,7 @@ export default class QueryRunner {
|
||||
|
||||
private getColumnHeaders(batchId: number, resultId: number, range: ISlickRange): string[] {
|
||||
let headers: string[] = undefined;
|
||||
let batchSummary: data.BatchSummary = this.batchSets[batchId];
|
||||
let batchSummary: sqlops.BatchSummary = this.batchSets[batchId];
|
||||
if (batchSummary !== undefined) {
|
||||
let resultSetSummary = batchSummary.resultSetSummaries[resultId];
|
||||
headers = resultSetSummary.columnInfo.slice(range.fromCell, range.toCell + 1).map((info, i) => {
|
||||
@@ -495,7 +495,7 @@ export default class QueryRunner {
|
||||
// get config copyRemoveNewLine option from vscode config
|
||||
let showBatchTime: boolean = WorkbenchUtils.getSqlConfigValue<boolean>(this._workspaceConfigurationService, Constants.configShowBatchTime);
|
||||
if (showBatchTime) {
|
||||
let message: data.IResultMessage = {
|
||||
let message: sqlops.IResultMessage = {
|
||||
batchId: batchId,
|
||||
message: nls.localize('elapsedBatchTime', 'Batch execution time: {0}', executionTime),
|
||||
time: undefined,
|
||||
|
||||
@@ -12,7 +12,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
|
||||
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
||||
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as nls from 'vs/nls';
|
||||
import * as TelemetryKeys from 'sql/common/telemetryKeys';
|
||||
import * as TelemetryUtils from 'sql/common/telemetryUtilities';
|
||||
@@ -27,26 +27,26 @@ export const IObjectExplorerService = createDecorator<IObjectExplorerService>(SE
|
||||
export interface IObjectExplorerService {
|
||||
_serviceBrand: any;
|
||||
|
||||
createNewSession(providerId: string, connection: ConnectionProfile): Thenable<data.ObjectExplorerSessionResponse>;
|
||||
createNewSession(providerId: string, connection: ConnectionProfile): Thenable<sqlops.ObjectExplorerSessionResponse>;
|
||||
|
||||
closeSession(providerId: string, session: data.ObjectExplorerSession): Thenable<data.ObjectExplorerCloseSessionResponse>;
|
||||
closeSession(providerId: string, session: sqlops.ObjectExplorerSession): Thenable<sqlops.ObjectExplorerCloseSessionResponse>;
|
||||
|
||||
expandNode(providerId: string, session: data.ObjectExplorerSession, nodePath: string): Thenable<data.ObjectExplorerExpandInfo>;
|
||||
expandNode(providerId: string, session: sqlops.ObjectExplorerSession, nodePath: string): Thenable<sqlops.ObjectExplorerExpandInfo>;
|
||||
|
||||
refreshNode(providerId: string, session: data.ObjectExplorerSession, nodePath: string): Thenable<data.ObjectExplorerExpandInfo>;
|
||||
refreshNode(providerId: string, session: sqlops.ObjectExplorerSession, nodePath: string): Thenable<sqlops.ObjectExplorerExpandInfo>;
|
||||
|
||||
expandTreeNode(session: data.ObjectExplorerSession, parentTree: TreeNode): Thenable<TreeNode[]>;
|
||||
expandTreeNode(session: sqlops.ObjectExplorerSession, parentTree: TreeNode): Thenable<TreeNode[]>;
|
||||
|
||||
refreshTreeNode(session: data.ObjectExplorerSession, parentTree: TreeNode): Thenable<TreeNode[]>;
|
||||
refreshTreeNode(session: sqlops.ObjectExplorerSession, parentTree: TreeNode): Thenable<TreeNode[]>;
|
||||
|
||||
onSessionCreated(handle: number, sessionResponse: data.ObjectExplorerSession);
|
||||
onSessionCreated(handle: number, sessionResponse: sqlops.ObjectExplorerSession);
|
||||
|
||||
onNodeExpanded(handle: number, sessionResponse: data.ObjectExplorerExpandInfo);
|
||||
onNodeExpanded(handle: number, sessionResponse: sqlops.ObjectExplorerExpandInfo);
|
||||
|
||||
/**
|
||||
* Register a ObjectExplorer provider
|
||||
*/
|
||||
registerProvider(providerId: string, provider: data.ObjectExplorerProvider): void;
|
||||
registerProvider(providerId: string, provider: sqlops.ObjectExplorerProvider): void;
|
||||
|
||||
getObjectExplorerNode(connection: IConnectionProfile): TreeNode;
|
||||
|
||||
@@ -74,7 +74,7 @@ interface SessionStatus {
|
||||
}
|
||||
|
||||
interface NodeStatus {
|
||||
expandHandler: (result: data.ObjectExplorerExpandInfo) => void;
|
||||
expandHandler: (result: sqlops.ObjectExplorerExpandInfo) => void;
|
||||
}
|
||||
|
||||
export interface ObjectExplorerNodeEventArgs {
|
||||
@@ -89,7 +89,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
||||
|
||||
private _disposables: IDisposable[] = [];
|
||||
|
||||
private _providers: { [handle: string]: data.ObjectExplorerProvider; } = Object.create(null);
|
||||
private _providers: { [handle: string]: sqlops.ObjectExplorerProvider; } = Object.create(null);
|
||||
|
||||
private _activeObjectExplorerNodes: { [id: string]: TreeNode };
|
||||
private _sessions: { [sessionId: string]: SessionStatus };
|
||||
@@ -145,7 +145,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
||||
/**
|
||||
* Gets called when expanded node response is ready
|
||||
*/
|
||||
public onNodeExpanded(handle: number, expandResponse: data.ObjectExplorerExpandInfo) {
|
||||
public onNodeExpanded(handle: number, expandResponse: sqlops.ObjectExplorerExpandInfo) {
|
||||
|
||||
if (expandResponse.errorMessage) {
|
||||
error(expandResponse.errorMessage);
|
||||
@@ -162,7 +162,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
||||
/**
|
||||
* Gets called when session is created
|
||||
*/
|
||||
public onSessionCreated(handle: number, session: data.ObjectExplorerSession) {
|
||||
public onSessionCreated(handle: number, session: sqlops.ObjectExplorerSession) {
|
||||
let connection: ConnectionProfile = undefined;
|
||||
let errorMessage: string = undefined;
|
||||
if (this._sessions[session.sessionId]) {
|
||||
@@ -216,9 +216,9 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
||||
return this._activeObjectExplorerNodes[connection.id];
|
||||
}
|
||||
|
||||
public createNewSession(providerId: string, connection: ConnectionProfile): Thenable<data.ObjectExplorerSessionResponse> {
|
||||
public createNewSession(providerId: string, connection: ConnectionProfile): Thenable<sqlops.ObjectExplorerSessionResponse> {
|
||||
let self = this;
|
||||
return new Promise<data.ObjectExplorerSessionResponse>((resolve, reject) => {
|
||||
return new Promise<sqlops.ObjectExplorerSessionResponse>((resolve, reject) => {
|
||||
let provider = this._providers[providerId];
|
||||
if (provider) {
|
||||
provider.createNewSession(connection.toConnectionInfo()).then(result => {
|
||||
@@ -236,8 +236,8 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
||||
});
|
||||
}
|
||||
|
||||
public expandNode(providerId: string, session: data.ObjectExplorerSession, nodePath: string): Thenable<data.ObjectExplorerExpandInfo> {
|
||||
return new Promise<data.ObjectExplorerExpandInfo>((resolve, reject) => {
|
||||
public expandNode(providerId: string, session: sqlops.ObjectExplorerSession, nodePath: string): Thenable<sqlops.ObjectExplorerExpandInfo> {
|
||||
return new Promise<sqlops.ObjectExplorerExpandInfo>((resolve, reject) => {
|
||||
let provider = this._providers[providerId];
|
||||
if (provider) {
|
||||
TelemetryUtils.addTelemetry(this._telemetryService, TelemetryKeys.ObjectExplorerExpand, { refresh: 0, provider: providerId });
|
||||
@@ -251,7 +251,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
||||
}
|
||||
});
|
||||
}
|
||||
private callExpandOrRefreshFromProvider(provider: data.ObjectExplorerProvider, nodeInfo: data.ExpandNodeInfo, refresh: boolean = false) {
|
||||
private callExpandOrRefreshFromProvider(provider: sqlops.ObjectExplorerProvider, nodeInfo: sqlops.ExpandNodeInfo, refresh: boolean = false) {
|
||||
if (refresh) {
|
||||
return provider.refreshNode(nodeInfo);
|
||||
} else {
|
||||
@@ -260,12 +260,12 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
||||
}
|
||||
|
||||
private expandOrRefreshNode(
|
||||
provider: data.ObjectExplorerProvider,
|
||||
session: data.ObjectExplorerSession,
|
||||
provider: sqlops.ObjectExplorerProvider,
|
||||
session: sqlops.ObjectExplorerSession,
|
||||
nodePath: string,
|
||||
refresh: boolean = false): Thenable<data.ObjectExplorerExpandInfo> {
|
||||
refresh: boolean = false): Thenable<sqlops.ObjectExplorerExpandInfo> {
|
||||
let self = this;
|
||||
return new Promise<data.ObjectExplorerExpandInfo>((resolve, reject) => {
|
||||
return new Promise<sqlops.ObjectExplorerExpandInfo>((resolve, reject) => {
|
||||
if (session.sessionId in self._sessions && self._sessions[session.sessionId]) {
|
||||
self._sessions[session.sessionId].nodes[nodePath] = {
|
||||
expandHandler: ((expandResult) => {
|
||||
@@ -291,7 +291,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
||||
});
|
||||
}
|
||||
|
||||
public refreshNode(providerId: string, session: data.ObjectExplorerSession, nodePath: string): Thenable<data.ObjectExplorerExpandInfo> {
|
||||
public refreshNode(providerId: string, session: sqlops.ObjectExplorerSession, nodePath: string): Thenable<sqlops.ObjectExplorerExpandInfo> {
|
||||
let provider = this._providers[providerId];
|
||||
if (provider) {
|
||||
TelemetryUtils.addTelemetry(this._telemetryService, TelemetryKeys.ObjectExplorerExpand, { refresh: 1, provider: providerId });
|
||||
@@ -300,7 +300,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
public closeSession(providerId: string, session: data.ObjectExplorerSession): Thenable<data.ObjectExplorerCloseSessionResponse> {
|
||||
public closeSession(providerId: string, session: sqlops.ObjectExplorerSession): Thenable<sqlops.ObjectExplorerCloseSessionResponse> {
|
||||
let provider = this._providers[providerId];
|
||||
if (provider) {
|
||||
return provider.closeSession({
|
||||
@@ -314,7 +314,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
||||
/**
|
||||
* Register a ObjectExplorer provider
|
||||
*/
|
||||
public registerProvider(providerId: string, provider: data.ObjectExplorerProvider): void {
|
||||
public registerProvider(providerId: string, provider: sqlops.ObjectExplorerProvider): void {
|
||||
this._providers[providerId] = provider;
|
||||
}
|
||||
|
||||
@@ -322,15 +322,15 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
||||
this._disposables = dispose(this._disposables);
|
||||
}
|
||||
|
||||
public expandTreeNode(session: data.ObjectExplorerSession, parentTree: TreeNode): Thenable<TreeNode[]> {
|
||||
public expandTreeNode(session: sqlops.ObjectExplorerSession, parentTree: TreeNode): Thenable<TreeNode[]> {
|
||||
return this.expandOrRefreshTreeNode(session, parentTree);
|
||||
}
|
||||
|
||||
public refreshTreeNode(session: data.ObjectExplorerSession, parentTree: TreeNode): Thenable<TreeNode[]> {
|
||||
public refreshTreeNode(session: sqlops.ObjectExplorerSession, parentTree: TreeNode): Thenable<TreeNode[]> {
|
||||
return this.expandOrRefreshTreeNode(session, parentTree, true);
|
||||
}
|
||||
|
||||
private callExpandOrRefreshFromService(providerId: string, session: data.ObjectExplorerSession, nodePath: string, refresh: boolean = false): Thenable<data.ObjectExplorerExpandInfo> {
|
||||
private callExpandOrRefreshFromService(providerId: string, session: sqlops.ObjectExplorerSession, nodePath: string, refresh: boolean = false): Thenable<sqlops.ObjectExplorerExpandInfo> {
|
||||
if (refresh) {
|
||||
return this.refreshNode(providerId, session, nodePath);
|
||||
} else {
|
||||
@@ -339,7 +339,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
||||
}
|
||||
|
||||
private expandOrRefreshTreeNode(
|
||||
session: data.ObjectExplorerSession,
|
||||
session: sqlops.ObjectExplorerSession,
|
||||
parentTree: TreeNode,
|
||||
refresh: boolean = false): Thenable<TreeNode[]> {
|
||||
return new Promise<TreeNode[]>((resolve, reject) => {
|
||||
@@ -360,7 +360,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
||||
});
|
||||
}
|
||||
|
||||
private toTreeNode(nodeInfo: data.NodeInfo, parent: TreeNode): TreeNode {
|
||||
private toTreeNode(nodeInfo: sqlops.NodeInfo, parent: TreeNode): TreeNode {
|
||||
// Show the status for database nodes with a status field
|
||||
let isLeaf: boolean = nodeInfo.isLeaf;
|
||||
if (nodeInfo.nodeType === NodeType.Database) {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import { ConnectionProfile } from 'sql/parts/connection/common/connectionProfile';
|
||||
import { NodeType } from 'sql/parts/registeredServer/common/nodeType';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
import * as UUID from 'vs/base/common/uuid';
|
||||
|
||||
@@ -66,9 +66,9 @@ export class TreeNode {
|
||||
|
||||
public connection: ConnectionProfile;
|
||||
|
||||
public session: data.ObjectExplorerSession;
|
||||
public session: sqlops.ObjectExplorerSession;
|
||||
|
||||
public metadata: data.ObjectMetadata;
|
||||
public metadata: sqlops.ObjectMetadata;
|
||||
|
||||
public getConnectionProfile(): ConnectionProfile {
|
||||
var currentNode: TreeNode = this;
|
||||
@@ -93,7 +93,7 @@ export class TreeNode {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public getSession(): data.ObjectExplorerSession {
|
||||
public getSession(): sqlops.ObjectExplorerSession {
|
||||
var currentNode: TreeNode = this;
|
||||
while (!currentNode.session && currentNode.parent) {
|
||||
currentNode = currentNode.parent;
|
||||
@@ -109,7 +109,7 @@ export class TreeNode {
|
||||
}
|
||||
|
||||
constructor(nodeTypeId: string, label: string, isAlwaysLeaf: boolean, nodePath: string,
|
||||
nodeSubType: string, nodeStatus: string, parent: TreeNode, metadata: data.ObjectMetadata) {
|
||||
nodeSubType: string, nodeStatus: string, parent: TreeNode, metadata: sqlops.ObjectMetadata) {
|
||||
this.nodeTypeId = nodeTypeId;
|
||||
this.label = label;
|
||||
this.isAlwaysLeaf = isAlwaysLeaf;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { TaskNode, TaskStatus, TaskExecutionMode } from 'sql/parts/taskHistory/common/taskNode';
|
||||
import { IQueryEditorService } from 'sql/parts/query/common/queryEditorService';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -26,18 +26,18 @@ export interface ITaskService {
|
||||
handleTaskComplete(eventArgs: TaskStatusChangeArgs): void;
|
||||
getAllTasks(): TaskNode;
|
||||
getNumberOfInProgressTasks(): number;
|
||||
onNewTaskCreated(handle: number, taskInfo: data.TaskInfo);
|
||||
onTaskStatusChanged(handle: number, taskProgressInfo: data.TaskProgressInfo);
|
||||
onNewTaskCreated(handle: number, taskInfo: sqlops.TaskInfo);
|
||||
onTaskStatusChanged(handle: number, taskProgressInfo: sqlops.TaskProgressInfo);
|
||||
cancelTask(providerId: string, taskId: string): Thenable<boolean>;
|
||||
/**
|
||||
* Register a ObjectExplorer provider
|
||||
*/
|
||||
registerProvider(providerId: string, provider: data.TaskServicesProvider): void;
|
||||
registerProvider(providerId: string, provider: sqlops.TaskServicesProvider): void;
|
||||
}
|
||||
|
||||
export interface TaskStatusChangeArgs {
|
||||
taskId: string;
|
||||
status: data.TaskStatus;
|
||||
status: sqlops.TaskStatus;
|
||||
message?: string;
|
||||
script?: string;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ export class TaskService implements ITaskService {
|
||||
private _taskQueue: TaskNode;
|
||||
private _onTaskComplete = new Emitter<TaskNode>();
|
||||
private _onAddNewTask = new Emitter<TaskNode>();
|
||||
private _providers: { [handle: string]: data.TaskServicesProvider; } = Object.create(null);
|
||||
private _providers: { [handle: string]: sqlops.TaskServicesProvider; } = Object.create(null);
|
||||
|
||||
constructor(
|
||||
@ILifecycleService lifecycleService: ILifecycleService,
|
||||
@@ -65,17 +65,17 @@ export class TaskService implements ITaskService {
|
||||
/**
|
||||
* Register a ObjectExplorer provider
|
||||
*/
|
||||
public registerProvider(providerId: string, provider: data.TaskServicesProvider): void {
|
||||
public registerProvider(providerId: string, provider: sqlops.TaskServicesProvider): void {
|
||||
this._providers[providerId] = provider;
|
||||
}
|
||||
|
||||
public onNewTaskCreated(handle: number, taskInfo: data.TaskInfo) {
|
||||
public onNewTaskCreated(handle: number, taskInfo: sqlops.TaskInfo) {
|
||||
let node: TaskNode = new TaskNode(taskInfo.name, taskInfo.serverName, taskInfo.databaseName, taskInfo.taskId, taskInfo.taskExecutionMode, taskInfo.isCancelable);
|
||||
node.providerName = taskInfo.providerName;
|
||||
this.handleNewTask(node);
|
||||
}
|
||||
|
||||
public onTaskStatusChanged(handle: number, taskProgressInfo: data.TaskProgressInfo) {
|
||||
public onTaskStatusChanged(handle: number, taskProgressInfo: sqlops.TaskProgressInfo) {
|
||||
this.handleTaskComplete({
|
||||
taskId: taskProgressInfo.taskId,
|
||||
status: taskProgressInfo.status,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as nls from 'vs/nls';
|
||||
import * as platform from 'vs/platform/registry/common/platform';
|
||||
import * as statusbar from 'vs/workbench/browser/parts/statusbar/statusbar';
|
||||
@@ -39,8 +39,8 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
private _addAccountProviderEmitter: Emitter<AccountProviderAddedEventParams>;
|
||||
public get addAccountProviderEvent(): Event<AccountProviderAddedEventParams> { return this._addAccountProviderEmitter.event; }
|
||||
|
||||
private _removeAccountProviderEmitter: Emitter<data.AccountProviderMetadata>;
|
||||
public get removeAccountProviderEvent(): Event<data.AccountProviderMetadata> { return this._removeAccountProviderEmitter.event; }
|
||||
private _removeAccountProviderEmitter: Emitter<sqlops.AccountProviderMetadata>;
|
||||
public get removeAccountProviderEvent(): Event<sqlops.AccountProviderMetadata> { return this._removeAccountProviderEmitter.event; }
|
||||
|
||||
private _updateAccountListEmitter: Emitter<UpdateAccountListEventParams>;
|
||||
public get updateAccountListEvent(): Event<UpdateAccountListEventParams> { return this._updateAccountListEmitter.event; }
|
||||
@@ -61,7 +61,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
|
||||
// Setup the event emitters
|
||||
this._addAccountProviderEmitter = new Emitter<AccountProviderAddedEventParams>();
|
||||
this._removeAccountProviderEmitter = new Emitter<data.AccountProviderMetadata>();
|
||||
this._removeAccountProviderEmitter = new Emitter<sqlops.AccountProviderMetadata>();
|
||||
this._updateAccountListEmitter = new Emitter<UpdateAccountListEventParams>();
|
||||
|
||||
// Register status bar item
|
||||
@@ -87,7 +87,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
* account's properties have been updated (usually when the account goes stale).
|
||||
* @param {Account} updatedAccount Account with the updated properties
|
||||
*/
|
||||
public accountUpdated(updatedAccount: data.Account): Thenable<void> {
|
||||
public accountUpdated(updatedAccount: sqlops.Account): Thenable<void> {
|
||||
let self = this;
|
||||
|
||||
// 1) Update the account in the store
|
||||
@@ -155,7 +155,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
* @param {Account} account account to refresh
|
||||
* @return {Thenable<Account>} Promise to return an account
|
||||
*/
|
||||
public refreshAccount(account: data.Account): Thenable<data.Account> {
|
||||
public refreshAccount(account: sqlops.Account): Thenable<sqlops.Account> {
|
||||
let self = this;
|
||||
|
||||
return this.doWithProvider(account.key.providerId, (provider) => {
|
||||
@@ -186,7 +186,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
* Retrieves metadata of all providers that have been registered
|
||||
* @returns {Thenable<AccountProviderMetadata[]>} Registered account providers
|
||||
*/
|
||||
public getAccountProviderMetadata(): Thenable<data.AccountProviderMetadata[]> {
|
||||
public getAccountProviderMetadata(): Thenable<sqlops.AccountProviderMetadata[]> {
|
||||
return Promise.resolve(Object.values(this._providers).map(provider => provider.metadata));
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
* @param {string} providerId ID of the provider the returned accounts belong to
|
||||
* @returns {Thenable<Account[]>} Promise to return a list of accounts
|
||||
*/
|
||||
public getAccountsForProvider(providerId: string): Thenable<data.Account[]> {
|
||||
public getAccountsForProvider(providerId: string): Thenable<sqlops.Account[]> {
|
||||
let self = this;
|
||||
|
||||
// Make sure the provider exists before attempting to retrieve accounts
|
||||
@@ -219,7 +219,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
* @param {Account} account Account to generate security token for
|
||||
* @return {Thenable<{}>} Promise to return the security token
|
||||
*/
|
||||
public getSecurityToken(account: data.Account): Thenable<{}> {
|
||||
public getSecurityToken(account: sqlops.Account): Thenable<{}> {
|
||||
return this.doWithProvider(account.key.providerId, provider => {
|
||||
return provider.provider.getSecurityToken(account);
|
||||
});
|
||||
@@ -231,7 +231,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
* @returns {Thenable<void>} Promise with result of account removal, true if account was
|
||||
* removed, false otherwise.
|
||||
*/
|
||||
public removeAccount(accountKey: data.AccountKey): Thenable<boolean> {
|
||||
public removeAccount(accountKey: sqlops.AccountKey): Thenable<boolean> {
|
||||
let self = this;
|
||||
|
||||
// Step 1) Remove the account
|
||||
@@ -309,8 +309,8 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
public cancelAutoOAuthDeviceCode(providerId: string): void {
|
||||
this.doWithProvider(providerId, provider => provider.provider.autoOAuthCancelled())
|
||||
.then( // Swallow errors
|
||||
null,
|
||||
err => { console.warn(`Error when cancelling auto OAuth: ${err}`); }
|
||||
null,
|
||||
err => { console.warn(`Error when cancelling auto OAuth: ${err}`); }
|
||||
)
|
||||
.then(() => this.autoOAuthDialogController.closeAutoOAuthDialog());
|
||||
}
|
||||
@@ -326,10 +326,10 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
// SERVICE MANAGEMENT METHODS //////////////////////////////////////////
|
||||
/**
|
||||
* Called by main thread to register an account provider from extension
|
||||
* @param {data.AccountProviderMetadata} providerMetadata Metadata of the provider that is being registered
|
||||
* @param {data.AccountProvider} provider References to the methods of the provider
|
||||
* @param {sqlops.AccountProviderMetadata} providerMetadata Metadata of the provider that is being registered
|
||||
* @param {sqlops.AccountProvider} provider References to the methods of the provider
|
||||
*/
|
||||
public registerProvider(providerMetadata: data.AccountProviderMetadata, provider: data.AccountProvider): Thenable<void> {
|
||||
public registerProvider(providerMetadata: sqlops.AccountProviderMetadata, provider: sqlops.AccountProvider): Thenable<void> {
|
||||
let self = this;
|
||||
|
||||
// Store the account provider
|
||||
@@ -346,10 +346,10 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
// 4) Write the accounts back to the store
|
||||
// 5) Fire the event to let folks know we have another account provider now
|
||||
return this._accountStore.getAccountsByProvider(providerMetadata.id)
|
||||
.then((accounts: data.Account[]) => {
|
||||
.then((accounts: sqlops.Account[]) => {
|
||||
return provider.initialize(accounts);
|
||||
})
|
||||
.then((accounts: data.Account[]) => {
|
||||
.then((accounts: sqlops.Account[]) => {
|
||||
self._providers[providerMetadata.id].accounts = accounts;
|
||||
let writePromises = accounts.map(account => {
|
||||
return self._accountStore.addOrUpdate(account);
|
||||
@@ -376,7 +376,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
}
|
||||
}
|
||||
|
||||
public unregisterProvider(providerMetadata: data.AccountProviderMetadata): void {
|
||||
public unregisterProvider(providerMetadata: sqlops.AccountProviderMetadata): void {
|
||||
// Delete this account provider
|
||||
delete this._providers[providerMetadata.id];
|
||||
|
||||
@@ -400,7 +400,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
private fireAccountListUpdate(provider: AccountProviderWithMetadata, sort: boolean) {
|
||||
// Step 1) Get and sort the list
|
||||
if (sort) {
|
||||
provider.accounts.sort((a: data.Account, b: data.Account) => {
|
||||
provider.accounts.sort((a: sqlops.Account, b: sqlops.Account) => {
|
||||
if (a.displayInfo.displayName < b.displayInfo.displayName) {
|
||||
return -1;
|
||||
}
|
||||
@@ -419,7 +419,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
this._updateAccountListEmitter.fire(eventArg);
|
||||
}
|
||||
|
||||
private spliceModifiedAccount(provider: AccountProviderWithMetadata, modifiedAccount: data.Account) {
|
||||
private spliceModifiedAccount(provider: AccountProviderWithMetadata, modifiedAccount: sqlops.Account) {
|
||||
// Find the updated account and splice the updated one in
|
||||
let indexToRemove: number = provider.accounts.findIndex(account => {
|
||||
return account.key.accountId === modifiedAccount.key.accountId;
|
||||
@@ -434,7 +434,7 @@ export class AccountManagementService implements IAccountManagementService {
|
||||
* Joins together an account provider, its metadata, and its accounts, used in the provider list
|
||||
*/
|
||||
export interface AccountProviderWithMetadata {
|
||||
metadata: data.AccountProviderMetadata;
|
||||
provider: data.AccountProvider;
|
||||
accounts: data.Account[];
|
||||
metadata: sqlops.AccountProviderMetadata;
|
||||
provider: sqlops.AccountProvider;
|
||||
accounts: sqlops.Account[];
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { AccountAdditionResult } from 'sql/services/accountManagement/eventTypes';
|
||||
import { IAccountStore } from 'sql/services/accountManagement/interfaces';
|
||||
|
||||
@@ -19,7 +19,7 @@ export default class AccountStore implements IAccountStore {
|
||||
constructor(private _memento: object) { }
|
||||
|
||||
// PUBLIC METHODS //////////////////////////////////////////////////////
|
||||
public addOrUpdate(newAccount: data.Account): Thenable<AccountAdditionResult> {
|
||||
public addOrUpdate(newAccount: sqlops.Account): Thenable<AccountAdditionResult> {
|
||||
let self = this;
|
||||
|
||||
return this.doOperation(() => {
|
||||
@@ -36,7 +36,7 @@ export default class AccountStore implements IAccountStore {
|
||||
});
|
||||
}
|
||||
|
||||
public getAccountsByProvider(providerId: string): Thenable<data.Account[]> {
|
||||
public getAccountsByProvider(providerId: string): Thenable<sqlops.Account[]> {
|
||||
let self = this;
|
||||
|
||||
return this.doOperation(() => {
|
||||
@@ -45,7 +45,7 @@ export default class AccountStore implements IAccountStore {
|
||||
});
|
||||
}
|
||||
|
||||
public getAllAccounts(): Thenable<data.Account[]> {
|
||||
public getAllAccounts(): Thenable<sqlops.Account[]> {
|
||||
let self = this;
|
||||
|
||||
return this.doOperation(() => {
|
||||
@@ -53,7 +53,7 @@ export default class AccountStore implements IAccountStore {
|
||||
});
|
||||
}
|
||||
|
||||
public remove(key: data.AccountKey): Thenable<boolean> {
|
||||
public remove(key: sqlops.AccountKey): Thenable<boolean> {
|
||||
let self = this;
|
||||
|
||||
return this.doOperation(() => {
|
||||
@@ -64,7 +64,7 @@ export default class AccountStore implements IAccountStore {
|
||||
});
|
||||
}
|
||||
|
||||
public update(key: data.AccountKey, updateOperation: (account: data.Account) => void): Thenable<boolean> {
|
||||
public update(key: sqlops.AccountKey, updateOperation: (account: sqlops.Account) => void): Thenable<boolean> {
|
||||
let self = this;
|
||||
|
||||
return this.doOperation(() => {
|
||||
@@ -76,12 +76,12 @@ export default class AccountStore implements IAccountStore {
|
||||
}
|
||||
|
||||
// PRIVATE METHODS /////////////////////////////////////////////////////
|
||||
private static findAccountByKey(key1: data.AccountKey, key2: data.AccountKey): boolean {
|
||||
private static findAccountByKey(key1: sqlops.AccountKey, key2: sqlops.AccountKey): boolean {
|
||||
// Provider ID and Account ID must match
|
||||
return key1.providerId === key2.providerId && key1.accountId === key2.accountId;
|
||||
}
|
||||
|
||||
private static mergeAccounts(source: data.Account, target: data.Account): void {
|
||||
private static mergeAccounts(source: sqlops.Account, target: sqlops.Account): void {
|
||||
// Take any display info changes
|
||||
target.displayInfo = source.displayInfo;
|
||||
|
||||
@@ -109,7 +109,7 @@ export default class AccountStore implements IAccountStore {
|
||||
return <Promise<T>>this._activeOperation;
|
||||
}
|
||||
|
||||
private addToAccountList(accounts: data.Account[], accountToAdd: data.Account): AccountListOperationResult {
|
||||
private addToAccountList(accounts: sqlops.Account[], accountToAdd: sqlops.Account): AccountListOperationResult {
|
||||
// Check if the entry already exists
|
||||
let match = accounts.findIndex(account => AccountStore.findAccountByKey(account.key, accountToAdd.key));
|
||||
if (match >= 0) {
|
||||
@@ -134,7 +134,7 @@ export default class AccountStore implements IAccountStore {
|
||||
};
|
||||
}
|
||||
|
||||
private removeFromAccountList(accounts: data.Account[], accountToRemove: data.AccountKey): AccountListOperationResult {
|
||||
private removeFromAccountList(accounts: sqlops.Account[], accountToRemove: sqlops.AccountKey): AccountListOperationResult {
|
||||
// Check if the entry exists
|
||||
let match = accounts.findIndex(account => AccountStore.findAccountByKey(account.key, accountToRemove));
|
||||
if (match >= 0) {
|
||||
@@ -151,7 +151,7 @@ export default class AccountStore implements IAccountStore {
|
||||
};
|
||||
}
|
||||
|
||||
private updateAccountList(accounts: data.Account[], accountToUpdate: data.AccountKey, updateOperation: (account: data.Account) => void): AccountListOperationResult {
|
||||
private updateAccountList(accounts: sqlops.Account[], accountToUpdate: sqlops.AccountKey, updateOperation: (account: sqlops.Account) => void): AccountListOperationResult {
|
||||
// Check if the entry exists
|
||||
let match = accounts.findIndex(account => AccountStore.findAccountByKey(account.key, accountToUpdate));
|
||||
if (match < 0) {
|
||||
@@ -178,7 +178,7 @@ export default class AccountStore implements IAccountStore {
|
||||
}
|
||||
|
||||
// MEMENTO IO METHODS //////////////////////////////////////////////////
|
||||
private readFromMemento(): Thenable<data.Account[]> {
|
||||
private readFromMemento(): Thenable<sqlops.Account[]> {
|
||||
// Initialize the account list if it isn't already
|
||||
let accounts = this._memento[AccountStore.MEMENTO_KEY];
|
||||
if (!accounts) {
|
||||
@@ -191,7 +191,7 @@ export default class AccountStore implements IAccountStore {
|
||||
return Promise.resolve(accounts);
|
||||
}
|
||||
|
||||
private writeToMemento(accounts: data.Account[]): Thenable<void> {
|
||||
private writeToMemento(accounts: sqlops.Account[]): Thenable<void> {
|
||||
// Store a shallow copy of the account list to disconnect the memento list from the active list
|
||||
this._memento[AccountStore.MEMENTO_KEY] = JSON.parse(JSON.stringify(accounts));
|
||||
return Promise.resolve();
|
||||
@@ -200,5 +200,5 @@ export default class AccountStore implements IAccountStore {
|
||||
|
||||
interface AccountListOperationResult extends AccountAdditionResult {
|
||||
accountRemoved: boolean;
|
||||
updatedAccounts: data.Account[];
|
||||
updatedAccounts: sqlops.Account[];
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
/**
|
||||
* Result from calling add/update on the account store
|
||||
@@ -24,7 +24,7 @@ export interface AccountAdditionResult {
|
||||
/**
|
||||
* The account that was added/updated (with any updates applied)
|
||||
*/
|
||||
changedAccount: data.Account;
|
||||
changedAccount: sqlops.Account;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -34,12 +34,12 @@ export interface AccountProviderAddedEventParams {
|
||||
/**
|
||||
* The provider that was registered
|
||||
*/
|
||||
addedProvider: data.AccountProviderMetadata;
|
||||
addedProvider: sqlops.AccountProviderMetadata;
|
||||
|
||||
/**
|
||||
* The accounts that were rehydrated with the provider
|
||||
*/
|
||||
initialAccounts: data.Account[];
|
||||
initialAccounts: sqlops.Account[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,5 +54,5 @@ export interface UpdateAccountListEventParams {
|
||||
/**
|
||||
* Updated list of accounts, sorted appropriately
|
||||
*/
|
||||
accountList: data.Account[];
|
||||
accountList: sqlops.Account[];
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import Event from 'vs/base/common/event';
|
||||
import { AccountAdditionResult, AccountProviderAddedEventParams, UpdateAccountListEventParams } from 'sql/services/accountManagement/eventTypes';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -18,13 +18,13 @@ export interface IAccountManagementService {
|
||||
_serviceBrand: any;
|
||||
|
||||
// ACCOUNT MANAGEMENT METHODS //////////////////////////////////////////
|
||||
accountUpdated(account: data.Account): Thenable<void>;
|
||||
accountUpdated(account: sqlops.Account): Thenable<void>;
|
||||
addAccount(providerId: string): Thenable<void>;
|
||||
getAccountProviderMetadata(): Thenable<data.AccountProviderMetadata[]>;
|
||||
getAccountsForProvider(providerId: string): Thenable<data.Account[]>;
|
||||
getSecurityToken(account: data.Account): Thenable<{}>;
|
||||
removeAccount(accountKey: data.AccountKey): Thenable<boolean>;
|
||||
refreshAccount(account: data.Account): Thenable<data.Account>;
|
||||
getAccountProviderMetadata(): Thenable<sqlops.AccountProviderMetadata[]>;
|
||||
getAccountsForProvider(providerId: string): Thenable<sqlops.Account[]>;
|
||||
getSecurityToken(account: sqlops.Account): Thenable<{}>;
|
||||
removeAccount(accountKey: sqlops.AccountKey): Thenable<boolean>;
|
||||
refreshAccount(account: sqlops.Account): Thenable<sqlops.Account>;
|
||||
|
||||
// UI METHODS //////////////////////////////////////////////////////////
|
||||
openAccountListDialog(): Thenable<void>;
|
||||
@@ -34,13 +34,13 @@ export interface IAccountManagementService {
|
||||
copyUserCodeAndOpenBrowser(userCode: string, uri: string): void;
|
||||
|
||||
// SERVICE MANAGEMENT METHODS /////////////////////////////////////////
|
||||
registerProvider(providerMetadata: data.AccountProviderMetadata, provider: data.AccountProvider): void;
|
||||
registerProvider(providerMetadata: sqlops.AccountProviderMetadata, provider: sqlops.AccountProvider): void;
|
||||
shutdown(): void;
|
||||
unregisterProvider(providerMetadata: data.AccountProviderMetadata): void;
|
||||
unregisterProvider(providerMetadata: sqlops.AccountProviderMetadata): void;
|
||||
|
||||
// EVENTING ////////////////////////////////////////////////////////////
|
||||
readonly addAccountProviderEvent: Event<AccountProviderAddedEventParams>;
|
||||
readonly removeAccountProviderEvent: Event<data.AccountProviderMetadata>;
|
||||
readonly removeAccountProviderEvent: Event<sqlops.AccountProviderMetadata>;
|
||||
readonly updateAccountListEvent: Event<UpdateAccountListEventParams>;
|
||||
}
|
||||
|
||||
@@ -50,20 +50,20 @@ export interface IAccountStore {
|
||||
* @param {Account} account Account to add/update
|
||||
* @return {Thenable<AccountAdditionResult>} Results of the add/update operation
|
||||
*/
|
||||
addOrUpdate(account: data.Account): Thenable<AccountAdditionResult>;
|
||||
addOrUpdate(account: sqlops.Account): Thenable<AccountAdditionResult>;
|
||||
|
||||
/**
|
||||
* Retrieves all accounts, filtered by provider ID
|
||||
* @param {string} providerId ID of the provider to filter by
|
||||
* @return {Thenable<Account[]>} Promise to return all accounts that belong to the provided provider
|
||||
*/
|
||||
getAccountsByProvider(providerId: string): Thenable<data.Account[]>;
|
||||
getAccountsByProvider(providerId: string): Thenable<sqlops.Account[]>;
|
||||
|
||||
/**
|
||||
* Retrieves all accounts in the store. Returns empty array if store is not initialized
|
||||
* @return {Thenable<Account[]>} Promise to return all accounts
|
||||
*/
|
||||
getAllAccounts(): Thenable<data.Account[]>;
|
||||
getAllAccounts(): Thenable<sqlops.Account[]>;
|
||||
|
||||
/**
|
||||
* Removes an account.
|
||||
@@ -72,7 +72,7 @@ export interface IAccountStore {
|
||||
* @param key - The key of an account.
|
||||
* @returns True if the account was removed, false if the account doesn't exist
|
||||
*/
|
||||
remove(key: data.AccountKey): Thenable<boolean>;
|
||||
remove(key: sqlops.AccountKey): Thenable<boolean>;
|
||||
|
||||
/**
|
||||
* Updates the custom properties stored with an account.
|
||||
@@ -82,5 +82,5 @@ export interface IAccountStore {
|
||||
* @param updateOperation - Operation to perform on the matching account
|
||||
* @returns True if the account was modified, false if the account doesn't exist
|
||||
*/
|
||||
update(key: data.AccountKey, updateOperation: (account: data.Account) => void): Thenable<boolean>;
|
||||
update(key: sqlops.AccountKey, updateOperation: (account: sqlops.Account) => void): Thenable<boolean>;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { ConnectionManagementInfo } from 'sql/parts/connection/common/connection
|
||||
import * as Constants from 'sql/common/constants';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import { Deferred } from 'sql/base/common/promise';
|
||||
@@ -31,12 +31,12 @@ export interface ICapabilitiesService {
|
||||
/**
|
||||
* Retrieve a list of registered capabilities providers
|
||||
*/
|
||||
getCapabilities(): data.DataProtocolServerCapabilities[];
|
||||
getCapabilities(): sqlops.DataProtocolServerCapabilities[];
|
||||
|
||||
/**
|
||||
* Register a capabilities provider
|
||||
*/
|
||||
registerProvider(provider: data.CapabilitiesProvider): void;
|
||||
registerProvider(provider: sqlops.CapabilitiesProvider): void;
|
||||
|
||||
/**
|
||||
* Returns true if the feature is available for given connection
|
||||
@@ -46,7 +46,7 @@ export interface ICapabilitiesService {
|
||||
/**
|
||||
* Event raised when a provider is registered
|
||||
*/
|
||||
onProviderRegisteredEvent: Event<data.DataProtocolServerCapabilities>;
|
||||
onProviderRegisteredEvent: Event<sqlops.DataProtocolServerCapabilities>;
|
||||
|
||||
/**
|
||||
* Promise fulfilled when Capabilities are ready
|
||||
@@ -63,15 +63,15 @@ export class CapabilitiesService implements ICapabilitiesService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
|
||||
private static DATA_PROVIDER_CATEGORY: string = 'Data Provider'
|
||||
private static DATA_PROVIDER_CATEGORY: string = 'Data Provider';
|
||||
|
||||
private _providers: data.CapabilitiesProvider[] = [];
|
||||
private _providers: sqlops.CapabilitiesProvider[] = [];
|
||||
|
||||
private _capabilities: data.DataProtocolServerCapabilities[] = [];
|
||||
private _capabilities: sqlops.DataProtocolServerCapabilities[] = [];
|
||||
|
||||
private _onProviderRegistered: Emitter<data.DataProtocolServerCapabilities>;
|
||||
private _onProviderRegistered: Emitter<sqlops.DataProtocolServerCapabilities>;
|
||||
|
||||
private _clientCapabilties: data.DataProtocolClientCapabilities = {
|
||||
private _clientCapabilties: sqlops.DataProtocolClientCapabilities = {
|
||||
|
||||
hostName: HOST_NAME,
|
||||
hostVersion: HOST_VERSION
|
||||
@@ -92,7 +92,7 @@ export class CapabilitiesService implements ICapabilitiesService {
|
||||
constructor( @IExtensionManagementService private extensionManagementService: IExtensionManagementService,
|
||||
@IExtensionEnablementService private extensionEnablementService: IExtensionEnablementService) {
|
||||
|
||||
this._onProviderRegistered = new Emitter<data.DataProtocolServerCapabilities>();
|
||||
this._onProviderRegistered = new Emitter<sqlops.DataProtocolServerCapabilities>();
|
||||
this.disposables.push(this._onProviderRegistered);
|
||||
this._onCapabilitiesReady = new Deferred();
|
||||
|
||||
@@ -140,7 +140,7 @@ export class CapabilitiesService implements ICapabilitiesService {
|
||||
/**
|
||||
* Retrieve a list of registered server capabilities
|
||||
*/
|
||||
public getCapabilities(): data.DataProtocolServerCapabilities[] {
|
||||
public getCapabilities(): sqlops.DataProtocolServerCapabilities[] {
|
||||
return this._capabilities;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ export class CapabilitiesService implements ICapabilitiesService {
|
||||
* Register the capabilities provider and query the provider for its capabilities
|
||||
* @param provider
|
||||
*/
|
||||
public registerProvider(provider: data.CapabilitiesProvider): void {
|
||||
public registerProvider(provider: sqlops.CapabilitiesProvider): void {
|
||||
this._providers.push(provider);
|
||||
|
||||
// request the capabilities from server
|
||||
@@ -200,7 +200,7 @@ export class CapabilitiesService implements ICapabilitiesService {
|
||||
}
|
||||
|
||||
// Event Emitters
|
||||
public get onProviderRegisteredEvent(): Event<data.DataProtocolServerCapabilities> {
|
||||
public get onProviderRegisteredEvent(): Event<sqlops.DataProtocolServerCapabilities> {
|
||||
return this._onProviderRegistered.event;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import { Deferred } from 'sql/base/common/promise';
|
||||
|
||||
export const SERVICE_ID = 'credentialsService';
|
||||
@@ -15,7 +15,7 @@ export const SERVICE_ID = 'credentialsService';
|
||||
export interface CredentialManagementEvents {
|
||||
onSaveCredential(credentialId: string, password: string): Thenable<boolean>;
|
||||
|
||||
onReadCredential(credentialId: string): Thenable<data.Credential>;
|
||||
onReadCredential(credentialId: string): Thenable<sqlops.Credential>;
|
||||
|
||||
onDeleteCredential(credentialId: string): Thenable<boolean>;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ export interface ICredentialsService {
|
||||
|
||||
saveCredential(credentialId: string, password: string): Thenable<boolean>;
|
||||
|
||||
readCredential(credentialId: string): Thenable<data.Credential>;
|
||||
readCredential(credentialId: string): Thenable<sqlops.Credential>;
|
||||
|
||||
deleteCredential(credentialId: string): Thenable<boolean>;
|
||||
|
||||
@@ -66,7 +66,7 @@ export class CredentialsService implements ICredentialsService {
|
||||
return this._onServerEventsReady.promise.then(() => this._serverEvents[this._lastHandle].onSaveCredential(credentialId, password));
|
||||
}
|
||||
|
||||
public readCredential(credentialId: string): Thenable<data.Credential> {
|
||||
public readCredential(credentialId: string): Thenable<sqlops.Credential> {
|
||||
return this._onServerEventsReady.promise.then(() => this._serverEvents[this._lastHandle].onReadCredential(credentialId));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import Event from 'vs/base/common/event';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
export const SERVICE_ID = 'dashboardWebviewService';
|
||||
|
||||
export interface IDashboardWebview {
|
||||
readonly id: string;
|
||||
readonly connection: data.connection.Connection;
|
||||
readonly serverInfo: data.ServerInfo;
|
||||
readonly connection: sqlops.connection.Connection;
|
||||
readonly serverInfo: sqlops.ServerInfo;
|
||||
setHtml(html: string): void;
|
||||
onMessage: Event<string>;
|
||||
sendMessage(message: string);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
export const SERVICE_ID = 'metadataService';
|
||||
|
||||
@@ -17,18 +17,18 @@ export const IMetadataService = createDecorator<IMetadataService>(SERVICE_ID);
|
||||
export interface IMetadataService {
|
||||
_serviceBrand: any;
|
||||
|
||||
getMetadata(connectionUri: string): Thenable<data.ProviderMetadata>;
|
||||
getMetadata(connectionUri: string): Thenable<sqlops.ProviderMetadata>;
|
||||
|
||||
getDatabaseNames(connectionUri: string): Thenable<string[]>;
|
||||
|
||||
getTableInfo(connectionUri: string, metadata: data.ObjectMetadata): Thenable<data.ColumnMetadata[]>;
|
||||
getTableInfo(connectionUri: string, metadata: sqlops.ObjectMetadata): Thenable<sqlops.ColumnMetadata[]>;
|
||||
|
||||
getViewInfo(connectionUri: string, metadata: data.ObjectMetadata): Thenable<data.ColumnMetadata[]>;
|
||||
getViewInfo(connectionUri: string, metadata: sqlops.ObjectMetadata): Thenable<sqlops.ColumnMetadata[]>;
|
||||
|
||||
/**
|
||||
* Register a metadata provider
|
||||
*/
|
||||
registerProvider(providerId: string, provider: data.MetadataProvider): void;
|
||||
registerProvider(providerId: string, provider: sqlops.MetadataProvider): void;
|
||||
}
|
||||
|
||||
export class MetadataService implements IMetadataService {
|
||||
@@ -37,12 +37,12 @@ export class MetadataService implements IMetadataService {
|
||||
|
||||
private _disposables: IDisposable[] = [];
|
||||
|
||||
private _providers: { [handle: string]: data.MetadataProvider; } = Object.create(null);
|
||||
private _providers: { [handle: string]: sqlops.MetadataProvider; } = Object.create(null);
|
||||
|
||||
constructor(@IConnectionManagementService private _connectionService: IConnectionManagementService) {
|
||||
constructor( @IConnectionManagementService private _connectionService: IConnectionManagementService) {
|
||||
}
|
||||
|
||||
public getMetadata(connectionUri: string): Thenable<data.ProviderMetadata> {
|
||||
public getMetadata(connectionUri: string): Thenable<sqlops.ProviderMetadata> {
|
||||
let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri);
|
||||
if (providerId) {
|
||||
let provider = this._providers[providerId];
|
||||
@@ -66,7 +66,7 @@ export class MetadataService implements IMetadataService {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
public getTableInfo(connectionUri: string, metadata: data.ObjectMetadata): Thenable<data.ColumnMetadata[]> {
|
||||
public getTableInfo(connectionUri: string, metadata: sqlops.ObjectMetadata): Thenable<sqlops.ColumnMetadata[]> {
|
||||
let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri);
|
||||
if (providerId) {
|
||||
let provider = this._providers[providerId];
|
||||
@@ -78,7 +78,7 @@ export class MetadataService implements IMetadataService {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
public getViewInfo(connectionUri: string, metadata: data.ObjectMetadata): Thenable<data.ColumnMetadata[]> {
|
||||
public getViewInfo(connectionUri: string, metadata: sqlops.ObjectMetadata): Thenable<sqlops.ColumnMetadata[]> {
|
||||
let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri);
|
||||
if (providerId) {
|
||||
let provider = this._providers[providerId];
|
||||
@@ -93,7 +93,7 @@ export class MetadataService implements IMetadataService {
|
||||
/**
|
||||
* Register a metadata provider
|
||||
*/
|
||||
public registerProvider(providerId: string, provider: data.MetadataProvider): void {
|
||||
public registerProvider(providerId: string, provider: sqlops.MetadataProvider): void {
|
||||
this._providers[providerId] = provider;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
||||
import { ScriptOperation } from 'sql/workbench/common/taskUtilities';
|
||||
import data = require('data');
|
||||
import { warn, error } from 'sql/base/common/log';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { error } from 'sql/base/common/log';
|
||||
export const SERVICE_ID = 'scriptingService';
|
||||
|
||||
export const IScriptingService = createDecorator<IScriptingService>(SERVICE_ID);
|
||||
@@ -18,22 +18,22 @@ export const IScriptingService = createDecorator<IScriptingService>(SERVICE_ID);
|
||||
export interface IScriptingService {
|
||||
_serviceBrand: any;
|
||||
|
||||
script(connectionUri: string, metadata: data.ObjectMetadata, operation: ScriptOperation, paramDetails: data.ScriptingParamDetails): Thenable<data.ScriptingResult>;
|
||||
script(connectionUri: string, metadata: sqlops.ObjectMetadata, operation: ScriptOperation, paramDetails: sqlops.ScriptingParamDetails): Thenable<sqlops.ScriptingResult>;
|
||||
|
||||
/**
|
||||
* Register a scripting provider
|
||||
*/
|
||||
registerProvider(providerId: string, provider: data.ScriptingProvider): void;
|
||||
registerProvider(providerId: string, provider: sqlops.ScriptingProvider): void;
|
||||
|
||||
/**
|
||||
* Callback method for when scripting is complete
|
||||
*/
|
||||
onScriptingComplete(handle: number, scriptingCompleteResult: data.ScriptingCompleteResult): void;
|
||||
onScriptingComplete(handle: number, scriptingCompleteResult: sqlops.ScriptingCompleteResult): void;
|
||||
|
||||
/**
|
||||
* Returns the result for an operation if the operation failed
|
||||
*/
|
||||
getOperationFailedResult(operationId: string): data.ScriptingCompleteResult;
|
||||
getOperationFailedResult(operationId: string): sqlops.ScriptingCompleteResult;
|
||||
}
|
||||
|
||||
export class ScriptingService implements IScriptingService {
|
||||
@@ -42,9 +42,9 @@ export class ScriptingService implements IScriptingService {
|
||||
|
||||
private disposables: IDisposable[] = [];
|
||||
|
||||
private _providers: { [handle: string]: data.ScriptingProvider; } = Object.create(null);
|
||||
private _providers: { [handle: string]: sqlops.ScriptingProvider; } = Object.create(null);
|
||||
|
||||
private failedScriptingOperations: { [operationId: string]: data.ScriptingCompleteResult } = {};
|
||||
private failedScriptingOperations: { [operationId: string]: sqlops.ScriptingCompleteResult } = {};
|
||||
constructor( @IConnectionManagementService private _connectionService: IConnectionManagementService) { }
|
||||
|
||||
/**
|
||||
@@ -54,13 +54,13 @@ export class ScriptingService implements IScriptingService {
|
||||
* @param operation
|
||||
* @param paramDetails
|
||||
*/
|
||||
public script(connectionUri: string, metadata: data.ObjectMetadata, operation: ScriptOperation, paramDetails: data.ScriptingParamDetails): Thenable<data.ScriptingResult> {
|
||||
public script(connectionUri: string, metadata: sqlops.ObjectMetadata, operation: ScriptOperation, paramDetails: sqlops.ScriptingParamDetails): Thenable<sqlops.ScriptingResult> {
|
||||
let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri);
|
||||
|
||||
if (providerId) {
|
||||
let provider = this._providers[providerId];
|
||||
if (provider) {
|
||||
return provider.scriptAsOperation(connectionUri, operation, metadata, paramDetails)
|
||||
return provider.scriptAsOperation(connectionUri, operation, metadata, paramDetails);
|
||||
}
|
||||
}
|
||||
return Promise.resolve(undefined);
|
||||
@@ -71,7 +71,7 @@ export class ScriptingService implements IScriptingService {
|
||||
* @param handle
|
||||
* @param scriptingCompleteResult
|
||||
*/
|
||||
public onScriptingComplete(handle: number, scriptingCompleteResult: data.ScriptingCompleteResult): void {
|
||||
public onScriptingComplete(handle: number, scriptingCompleteResult: sqlops.ScriptingCompleteResult): void {
|
||||
if (scriptingCompleteResult && scriptingCompleteResult.hasError && scriptingCompleteResult.errorMessage) {
|
||||
error(`Scripting failed. error: ${scriptingCompleteResult.errorMessage}`);
|
||||
if (scriptingCompleteResult.operationId) {
|
||||
@@ -84,7 +84,7 @@ export class ScriptingService implements IScriptingService {
|
||||
* Returns the result for an operation if the operation failed
|
||||
* @param operationId Operation Id
|
||||
*/
|
||||
public getOperationFailedResult(operationId: string): data.ScriptingCompleteResult {
|
||||
public getOperationFailedResult(operationId: string): sqlops.ScriptingCompleteResult {
|
||||
if (operationId && operationId in this.failedScriptingOperations) {
|
||||
return this.failedScriptingOperations[operationId];
|
||||
} else {
|
||||
@@ -95,7 +95,7 @@ export class ScriptingService implements IScriptingService {
|
||||
/**
|
||||
* Register a scripting provider
|
||||
*/
|
||||
public registerProvider(providerId: string, provider: data.ScriptingProvider): void {
|
||||
public registerProvider(providerId: string, provider: sqlops.ScriptingProvider): void {
|
||||
this._providers[providerId] = provider;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
|
||||
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
||||
import { ICapabilitiesService } from 'sql/services/capabilities/capabilitiesService';
|
||||
import * as Constants from 'sql/common/constants';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
export const SERVICE_ID = 'serializationService';
|
||||
|
||||
export interface SerializationProviderEvents {
|
||||
onSaveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable<data.SaveResultRequestResult>;
|
||||
onSaveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable<sqlops.SaveResultRequestResult>;
|
||||
}
|
||||
|
||||
export const ISerializationService = createDecorator<ISerializationService>(SERVICE_ID);
|
||||
@@ -23,13 +23,13 @@ export const ISerializationService = createDecorator<ISerializationService>(SERV
|
||||
export interface ISerializationService {
|
||||
_serviceBrand: any;
|
||||
|
||||
saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable<data.SaveResultRequestResult>;
|
||||
saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable<sqlops.SaveResultRequestResult>;
|
||||
|
||||
disabledSaveAs(): Thenable<data.SaveResultRequestResult>;
|
||||
disabledSaveAs(): Thenable<sqlops.SaveResultRequestResult>;
|
||||
|
||||
addEventListener(handle: number, events: SerializationProviderEvents): IDisposable;
|
||||
|
||||
getSerializationFeatureMetadataProvider(ownerUri: string): data.FeatureMetadataProvider;
|
||||
getSerializationFeatureMetadataProvider(ownerUri: string): sqlops.FeatureMetadataProvider;
|
||||
}
|
||||
|
||||
export class SerializationService implements ISerializationService {
|
||||
@@ -59,7 +59,7 @@ export class SerializationService implements ISerializationService {
|
||||
};
|
||||
}
|
||||
|
||||
public saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable<data.SaveResultRequestResult> {
|
||||
public saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable<sqlops.SaveResultRequestResult> {
|
||||
if (this._serverEvents === undefined || this._serverEvents[this._lastHandle] === undefined) {
|
||||
return this.disabledSaveAs();
|
||||
}
|
||||
@@ -67,12 +67,12 @@ export class SerializationService implements ISerializationService {
|
||||
return this._serverEvents[this._lastHandle].onSaveAs(saveFormat, savePath, results, appendToFile);
|
||||
}
|
||||
|
||||
public disabledSaveAs(): Thenable<data.SaveResultRequestResult> {
|
||||
return Promise.resolve({messages: Constants.SerializationDisabled});
|
||||
public disabledSaveAs(): Thenable<sqlops.SaveResultRequestResult> {
|
||||
return Promise.resolve({ messages: Constants.SerializationDisabled });
|
||||
|
||||
}
|
||||
|
||||
public getSerializationFeatureMetadataProvider(ownerUri: string) : data.FeatureMetadataProvider {
|
||||
public getSerializationFeatureMetadataProvider(ownerUri: string): sqlops.FeatureMetadataProvider {
|
||||
let providerId: string = this._connectionService.getProviderIdFromUri(ownerUri);
|
||||
let providerCapabilities = this._capabilitiesService.getCapabilities().find(c => c.providerName === providerId);
|
||||
|
||||
|
||||
2
src/sql/data.d.ts → src/sql/sqlops.d.ts
vendored
2
src/sql/data.d.ts → src/sql/sqlops.d.ts
vendored
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare module 'data' {
|
||||
declare module 'sqlops' {
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
// EXPORTED NAMESPACES /////////////////////////////////////////////////
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { Disposable } from 'vs/workbench/api/node/extHostTypes';
|
||||
@@ -27,28 +27,28 @@ export class ExtHostAccountManagement extends ExtHostAccountManagementShape {
|
||||
|
||||
// PUBLIC METHODS //////////////////////////////////////////////////////
|
||||
// - MAIN THREAD AVAILABLE METHODS /////////////////////////////////////
|
||||
public $clear(handle: number, accountKey: data.AccountKey): Thenable<void> {
|
||||
return this._withProvider(handle, (provider: data.AccountProvider) => provider.clear(accountKey));
|
||||
public $clear(handle: number, accountKey: sqlops.AccountKey): Thenable<void> {
|
||||
return this._withProvider(handle, (provider: sqlops.AccountProvider) => provider.clear(accountKey));
|
||||
}
|
||||
|
||||
public $getSecurityToken(handle: number, account: data.Account): Thenable<{}> {
|
||||
return this._withProvider(handle, (provider: data.AccountProvider) => provider.getSecurityToken(account));
|
||||
public $getSecurityToken(handle: number, account: sqlops.Account): Thenable<{}> {
|
||||
return this._withProvider(handle, (provider: sqlops.AccountProvider) => provider.getSecurityToken(account));
|
||||
}
|
||||
|
||||
public $initialize(handle: number, restoredAccounts: data.Account[]): Thenable<data.Account[]> {
|
||||
return this._withProvider(handle, (provider: data.AccountProvider) => provider.initialize(restoredAccounts));
|
||||
public $initialize(handle: number, restoredAccounts: sqlops.Account[]): Thenable<sqlops.Account[]> {
|
||||
return this._withProvider(handle, (provider: sqlops.AccountProvider) => provider.initialize(restoredAccounts));
|
||||
}
|
||||
|
||||
public $prompt(handle: number): Thenable<data.Account> {
|
||||
return this._withProvider(handle, (provider: data.AccountProvider) => provider.prompt());
|
||||
public $prompt(handle: number): Thenable<sqlops.Account> {
|
||||
return this._withProvider(handle, (provider: sqlops.AccountProvider) => provider.prompt());
|
||||
}
|
||||
|
||||
public $refresh(handle: number, account: data.Account): Thenable<data.Account> {
|
||||
return this._withProvider(handle, (provider: data.AccountProvider) => provider.refresh(account));
|
||||
public $refresh(handle: number, account: sqlops.Account): Thenable<sqlops.Account> {
|
||||
return this._withProvider(handle, (provider: sqlops.AccountProvider) => provider.refresh(account));
|
||||
}
|
||||
|
||||
public $autoOAuthCancelled(handle: number): Thenable<void> {
|
||||
return this._withProvider(handle, (provider: data.AccountProvider) => provider.autoOAuthCancelled());
|
||||
return this._withProvider(handle, (provider: sqlops.AccountProvider) => provider.autoOAuthCancelled());
|
||||
}
|
||||
|
||||
// - EXTENSION HOST AVAILABLE METHODS //////////////////////////////////
|
||||
@@ -60,11 +60,11 @@ export class ExtHostAccountManagement extends ExtHostAccountManagementShape {
|
||||
this._proxy.$endAutoOAuthDeviceCode();
|
||||
}
|
||||
|
||||
public $accountUpdated(updatedAccount: data.Account): void {
|
||||
public $accountUpdated(updatedAccount: sqlops.Account): void {
|
||||
this._proxy.$accountUpdated(updatedAccount);
|
||||
}
|
||||
|
||||
public $registerAccountProvider(providerMetadata: data.AccountProviderMetadata, provider: data.AccountProvider): Disposable {
|
||||
public $registerAccountProvider(providerMetadata: sqlops.AccountProviderMetadata, provider: sqlops.AccountProvider): Disposable {
|
||||
let self = this;
|
||||
|
||||
// Look for any account providers that have the same provider ID
|
||||
@@ -105,7 +105,7 @@ export class ExtHostAccountManagement extends ExtHostAccountManagementShape {
|
||||
return this._handlePool++;
|
||||
}
|
||||
|
||||
private _withProvider<R>(handle: number, callback: (provider: data.AccountProvider) => Thenable<R>): Thenable<R> {
|
||||
private _withProvider<R>(handle: number, callback: (provider: sqlops.AccountProvider) => Thenable<R>): Thenable<R> {
|
||||
let provider = this._providers[handle];
|
||||
if (provider === undefined) {
|
||||
return TPromise.wrapError(new Error(`Provider ${handle} not found.`));
|
||||
@@ -115,8 +115,8 @@ export class ExtHostAccountManagement extends ExtHostAccountManagementShape {
|
||||
}
|
||||
|
||||
interface AccountProviderWithMetadata {
|
||||
metadata: data.AccountProviderMetadata;
|
||||
provider: data.AccountProvider;
|
||||
metadata: sqlops.AccountProviderMetadata;
|
||||
provider: sqlops.AccountProvider;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { ExtHostConnectionManagementShape, SqlMainContext, MainThreadConnectionManagementShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
export class ExtHostConnectionManagement extends ExtHostConnectionManagementShape {
|
||||
|
||||
@@ -19,11 +19,11 @@ export class ExtHostConnectionManagement extends ExtHostConnectionManagementShap
|
||||
this._proxy = threadService.get(SqlMainContext.MainThreadConnectionManagement);
|
||||
}
|
||||
|
||||
public $getActiveConnections(): Thenable<data.connection.Connection[]> {
|
||||
public $getActiveConnections(): Thenable<sqlops.connection.Connection[]> {
|
||||
return this._proxy.$getActiveConnections();
|
||||
}
|
||||
|
||||
public $getCurrentConnection(): Thenable<data.connection.Connection> {
|
||||
public $getCurrentConnection(): Thenable<sqlops.connection.Connection> {
|
||||
return this._proxy.$getCurrentConnection();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,32 +8,32 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { SqlMainContext, MainThreadCredentialManagementShape, ExtHostCredentialManagementShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
import * as vscode from 'vscode';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { Disposable } from 'vs/workbench/api/node/extHostTypes';
|
||||
|
||||
class CredentialAdapter {
|
||||
public provider: data.CredentialProvider;
|
||||
public provider: sqlops.CredentialProvider;
|
||||
|
||||
constructor(provider: data.CredentialProvider) {
|
||||
constructor(provider: sqlops.CredentialProvider) {
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
public saveCredential(credentialId: string, password: string): Thenable<boolean> {
|
||||
public saveCredential(credentialId: string, password: string): Thenable<boolean> {
|
||||
return this.provider.saveCredential(credentialId, password);
|
||||
}
|
||||
|
||||
public readCredential(credentialId: string): Thenable<data.Credential> {
|
||||
public readCredential(credentialId: string): Thenable<sqlops.Credential> {
|
||||
return this.provider.readCredential(credentialId);
|
||||
}
|
||||
|
||||
public deleteCredential(credentialId: string): Thenable<boolean> {
|
||||
public deleteCredential(credentialId: string): Thenable<boolean> {
|
||||
return this.provider.deleteCredential(credentialId);
|
||||
}
|
||||
}
|
||||
|
||||
type Adapter = CredentialAdapter;
|
||||
|
||||
export class ExtHostCredentialManagement extends ExtHostCredentialManagementShape {
|
||||
export class ExtHostCredentialManagement extends ExtHostCredentialManagementShape {
|
||||
// MEMBER VARIABLES ////////////////////////////////////////////////////
|
||||
private _adapter: { [handle: number]: Adapter } = Object.create(null);
|
||||
private _handlePool: number = 0;
|
||||
@@ -54,7 +54,7 @@ export class ExtHostCredentialManagement extends ExtHostCredentialManagementShap
|
||||
}
|
||||
|
||||
// PUBLIC METHODS //////////////////////////////////////////////////////
|
||||
public $registerCredentialProvider(provider: data.CredentialProvider): vscode.Disposable {
|
||||
public $registerCredentialProvider(provider: sqlops.CredentialProvider): vscode.Disposable {
|
||||
// Store the credential provider
|
||||
provider.handle = this._nextHandle();
|
||||
this._adapter[provider.handle] = new CredentialAdapter(provider);
|
||||
@@ -67,7 +67,7 @@ export class ExtHostCredentialManagement extends ExtHostCredentialManagementShap
|
||||
return this._createDisposable(provider.handle);
|
||||
}
|
||||
|
||||
public $getCredentialProvider(namespaceId: string): Thenable<data.CredentialProvider> {
|
||||
public $getCredentialProvider(namespaceId: string): Thenable<sqlops.CredentialProvider> {
|
||||
let self = this;
|
||||
|
||||
if (!namespaceId) {
|
||||
@@ -84,11 +84,11 @@ export class ExtHostCredentialManagement extends ExtHostCredentialManagementShap
|
||||
return this._withAdapter(0, CredentialAdapter, adapter => adapter.saveCredential(credentialId, password));
|
||||
}
|
||||
|
||||
public $readCredential(credentialId: string): Thenable<data.Credential> {
|
||||
public $readCredential(credentialId: string): Thenable<sqlops.Credential> {
|
||||
return this._withAdapter(0, CredentialAdapter, adapter => adapter.readCredential(credentialId));
|
||||
}
|
||||
|
||||
public $deleteCredential(credentialId: string): Thenable<boolean> {
|
||||
public $deleteCredential(credentialId: string): Thenable<boolean> {
|
||||
return this._withAdapter(0, CredentialAdapter, adapter => adapter.deleteCredential(credentialId));
|
||||
}
|
||||
|
||||
@@ -105,9 +105,9 @@ export class ExtHostCredentialManagement extends ExtHostCredentialManagementShap
|
||||
return `${namespaceId}|${credentialId}`;
|
||||
}
|
||||
|
||||
private _createNamespacedCredentialProvider(namespaceId: string, adapter: CredentialAdapter): Thenable<data.CredentialProvider> {
|
||||
private _createNamespacedCredentialProvider(namespaceId: string, adapter: CredentialAdapter): Thenable<sqlops.CredentialProvider> {
|
||||
// Create a provider that wraps the methods in a namespace
|
||||
let provider: data.CredentialProvider = {
|
||||
let provider: sqlops.CredentialProvider = {
|
||||
handle: adapter.provider.handle,
|
||||
deleteCredential: (credentialId: string) => {
|
||||
let namespacedId = ExtHostCredentialManagement._getNamespacedCredentialId(namespaceId, credentialId);
|
||||
@@ -136,7 +136,7 @@ export class ExtHostCredentialManagement extends ExtHostCredentialManagementShap
|
||||
return this._handlePool++;
|
||||
}
|
||||
|
||||
private _withAdapter<A, R>(handle: number, ctor: { new (...args: any[]): A }, callback: (adapter: A) => Thenable<R>): Thenable<R> {
|
||||
private _withAdapter<A, R>(handle: number, ctor: { new(...args: any[]): A }, callback: (adapter: A) => Thenable<R>): Thenable<R> {
|
||||
let adapter = this._adapter[handle];
|
||||
if (!(adapter instanceof ctor)) {
|
||||
return TPromise.wrapError(new Error('no adapter found'));
|
||||
|
||||
@@ -11,9 +11,9 @@ import { Emitter } from 'vs/base/common/event';
|
||||
import { deepClone } from 'vs/base/common/objects';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
class ExtHostDashboardWebview implements data.DashboardWebview {
|
||||
class ExtHostDashboardWebview implements sqlops.DashboardWebview {
|
||||
|
||||
private _html: string;
|
||||
public onMessageEmitter = new Emitter<any>();
|
||||
@@ -22,8 +22,8 @@ class ExtHostDashboardWebview implements data.DashboardWebview {
|
||||
constructor(
|
||||
private readonly _proxy: MainThreadDashboardWebviewShape,
|
||||
private readonly _handle: number,
|
||||
private readonly _connection: data.connection.Connection,
|
||||
private readonly _serverInfo: data.ServerInfo
|
||||
private readonly _connection: sqlops.connection.Connection,
|
||||
private readonly _serverInfo: sqlops.ServerInfo
|
||||
) { }
|
||||
|
||||
public postMessage(message: any): Thenable<any> {
|
||||
@@ -38,11 +38,11 @@ class ExtHostDashboardWebview implements data.DashboardWebview {
|
||||
return this.onClosedEmitter.event;
|
||||
}
|
||||
|
||||
public get connection(): data.connection.Connection {
|
||||
public get connection(): sqlops.connection.Connection {
|
||||
return deepClone(this._connection);
|
||||
}
|
||||
|
||||
public get serverInfo(): data.ServerInfo {
|
||||
public get serverInfo(): sqlops.ServerInfo {
|
||||
return deepClone(this._serverInfo);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ export class ExtHostDashboardWebviews implements ExtHostDashboardWebviewsShape {
|
||||
private readonly _proxy: MainThreadDashboardWebviewShape;
|
||||
|
||||
private readonly _webviews = new Map<number, ExtHostDashboardWebview>();
|
||||
private readonly _handlers = new Map<string, (webview: data.DashboardWebview) => void>();
|
||||
private readonly _handlers = new Map<string, (webview: sqlops.DashboardWebview) => void>();
|
||||
|
||||
constructor(
|
||||
mainContext: IMainContext
|
||||
@@ -81,12 +81,12 @@ export class ExtHostDashboardWebviews implements ExtHostDashboardWebviewsShape {
|
||||
this._webviews.delete(handle);
|
||||
}
|
||||
|
||||
$registerProvider(widgetId: string, handler: (webview: data.DashboardWebview) => void): void {
|
||||
$registerProvider(widgetId: string, handler: (webview: sqlops.DashboardWebview) => void): void {
|
||||
this._handlers.set(widgetId, handler);
|
||||
this._proxy.$registerProvider(widgetId);
|
||||
}
|
||||
|
||||
$registerWidget(handle: number, id: string, connection: data.connection.Connection, serverInfo: data.ServerInfo): void {
|
||||
$registerWidget(handle: number, id: string, connection: sqlops.connection.Connection, serverInfo: sqlops.ServerInfo): void {
|
||||
let webview = new ExtHostDashboardWebview(this._proxy, handle, connection, serverInfo);
|
||||
this._webviews.set(handle, webview);
|
||||
this._handlers.get(id)(webview);
|
||||
|
||||
@@ -8,19 +8,19 @@ import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { SqlMainContext, MainThreadDataProtocolShape, ExtHostDataProtocolShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
import * as vscode from 'vscode';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { Disposable } from 'vs/workbench/api/node/extHostTypes';
|
||||
|
||||
export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
|
||||
|
||||
private readonly _onDidChangeLanguageFlavor = new Emitter<data.DidChangeLanguageFlavorParams>();
|
||||
private readonly _onDidChangeLanguageFlavor = new Emitter<sqlops.DidChangeLanguageFlavorParams>();
|
||||
|
||||
readonly onDidChangeLanguageFlavor: Event<data.DidChangeLanguageFlavorParams> = this._onDidChangeLanguageFlavor.event;
|
||||
readonly onDidChangeLanguageFlavor: Event<sqlops.DidChangeLanguageFlavorParams> = this._onDidChangeLanguageFlavor.event;
|
||||
|
||||
private _proxy: MainThreadDataProtocolShape;
|
||||
|
||||
private static _handlePool: number = 0;
|
||||
private _adapter = new Map<number, data.DataProvider>();
|
||||
private _adapter = new Map<number, sqlops.DataProvider>();
|
||||
|
||||
constructor(
|
||||
threadService: IThreadService
|
||||
@@ -40,7 +40,7 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
|
||||
return ExtHostDataProtocol._handlePool++;
|
||||
}
|
||||
|
||||
private _resolveProvider<P extends data.DataProvider>(handle: number): P {
|
||||
private _resolveProvider<P extends sqlops.DataProvider>(handle: number): P {
|
||||
let provider = this._adapter.get(handle) as P;
|
||||
if (provider) {
|
||||
return provider;
|
||||
@@ -49,115 +49,115 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
|
||||
}
|
||||
}
|
||||
|
||||
private registerProvider(provider: data.DataProvider): vscode.Disposable {
|
||||
private registerProvider(provider: sqlops.DataProvider): vscode.Disposable {
|
||||
provider.handle = this._nextHandle();
|
||||
this._adapter.set(provider.handle, provider);
|
||||
return this._createDisposable(provider.handle);
|
||||
};
|
||||
|
||||
$registerConnectionProvider(provider: data.ConnectionProvider): vscode.Disposable {
|
||||
$registerConnectionProvider(provider: sqlops.ConnectionProvider): vscode.Disposable {
|
||||
let rt = this.registerProvider(provider);
|
||||
this._proxy.$registerConnectionProvider(provider.providerId, provider.handle);
|
||||
return rt;
|
||||
}
|
||||
|
||||
$registerBackupProvider(provider: data.BackupProvider): vscode.Disposable {
|
||||
$registerBackupProvider(provider: sqlops.BackupProvider): vscode.Disposable {
|
||||
let rt = this.registerProvider(provider);
|
||||
this._proxy.$registerBackupProvider(provider.providerId, provider.handle);
|
||||
return rt;
|
||||
}
|
||||
|
||||
$registerRestoreProvider(provider: data.RestoreProvider): vscode.Disposable {
|
||||
$registerRestoreProvider(provider: sqlops.RestoreProvider): vscode.Disposable {
|
||||
let rt = this.registerProvider(provider);
|
||||
this._proxy.$registerRestoreProvider(provider.providerId, provider.handle);
|
||||
return rt;
|
||||
}
|
||||
|
||||
$registerScriptingProvider(provider: data.ScriptingProvider): vscode.Disposable {
|
||||
$registerScriptingProvider(provider: sqlops.ScriptingProvider): vscode.Disposable {
|
||||
let rt = this.registerProvider(provider);
|
||||
this._proxy.$registerScriptingProvider(provider.providerId, provider.handle);
|
||||
return rt;
|
||||
}
|
||||
|
||||
$registerQueryProvider(provider: data.QueryProvider): vscode.Disposable {
|
||||
$registerQueryProvider(provider: sqlops.QueryProvider): vscode.Disposable {
|
||||
let rt = this.registerProvider(provider);
|
||||
this._proxy.$registerQueryProvider(provider.providerId, provider.handle);
|
||||
return rt;
|
||||
}
|
||||
|
||||
$registerMetadataProvider(provider: data.MetadataProvider): vscode.Disposable {
|
||||
$registerMetadataProvider(provider: sqlops.MetadataProvider): vscode.Disposable {
|
||||
let rt = this.registerProvider(provider);
|
||||
this._proxy.$registerMetadataProvider(provider.providerId, provider.handle);
|
||||
return rt;
|
||||
}
|
||||
|
||||
$registerTaskServicesProvider(provider: data.TaskServicesProvider): vscode.Disposable {
|
||||
$registerTaskServicesProvider(provider: sqlops.TaskServicesProvider): vscode.Disposable {
|
||||
let rt = this.registerProvider(provider);
|
||||
this._proxy.$registerTaskServicesProvider(provider.providerId, provider.handle);
|
||||
return rt;
|
||||
}
|
||||
|
||||
$registerFileBrowserProvider(provider: data.FileBrowserProvider): vscode.Disposable {
|
||||
$registerFileBrowserProvider(provider: sqlops.FileBrowserProvider): vscode.Disposable {
|
||||
let rt = this.registerProvider(provider);
|
||||
this._proxy.$registerFileBrowserProvider(provider.providerId, provider.handle);
|
||||
return rt;
|
||||
}
|
||||
|
||||
$registerObjectExplorerProvider(provider: data.ObjectExplorerProvider): vscode.Disposable {
|
||||
$registerObjectExplorerProvider(provider: sqlops.ObjectExplorerProvider): vscode.Disposable {
|
||||
let rt = this.registerProvider(provider);
|
||||
this._proxy.$registerObjectExplorerProvider(provider.providerId, provider.handle);
|
||||
return rt;
|
||||
}
|
||||
|
||||
$registerProfilerProvider(provider: data.ProfilerProvider): vscode.Disposable {
|
||||
$registerProfilerProvider(provider: sqlops.ProfilerProvider): vscode.Disposable {
|
||||
let rt = this.registerProvider(provider);
|
||||
this._proxy.$registerProfilerProvider(provider.providerId, provider.handle);
|
||||
return rt;
|
||||
}
|
||||
|
||||
$registerAdminServicesProvider(provider: data.AdminServicesProvider): vscode.Disposable {
|
||||
$registerAdminServicesProvider(provider: sqlops.AdminServicesProvider): vscode.Disposable {
|
||||
let rt = this.registerProvider(provider);
|
||||
this._proxy.$registerAdminServicesProvider(provider.providerId, provider.handle);
|
||||
return rt;
|
||||
}
|
||||
|
||||
$registerCapabilitiesServiceProvider(provider: data.CapabilitiesProvider): vscode.Disposable {
|
||||
$registerCapabilitiesServiceProvider(provider: sqlops.CapabilitiesProvider): vscode.Disposable {
|
||||
let rt = this.registerProvider(provider);
|
||||
this._proxy.$registerCapabilitiesServiceProvider(provider.providerId, provider.handle);
|
||||
return rt;
|
||||
}
|
||||
|
||||
// Capabilities Discovery handlers
|
||||
$getServerCapabilities(handle: number, client: data.DataProtocolClientCapabilities): Thenable<data.DataProtocolServerCapabilities> {
|
||||
return this._resolveProvider<data.CapabilitiesProvider>(handle).getServerCapabilities(client);
|
||||
$getServerCapabilities(handle: number, client: sqlops.DataProtocolClientCapabilities): Thenable<sqlops.DataProtocolServerCapabilities> {
|
||||
return this._resolveProvider<sqlops.CapabilitiesProvider>(handle).getServerCapabilities(client);
|
||||
}
|
||||
|
||||
// Connection Management handlers
|
||||
$connect(handle: number, connectionUri: string, connection: data.ConnectionInfo): Thenable<boolean> {
|
||||
return this._resolveProvider<data.ConnectionProvider>(handle).connect(connectionUri, connection);
|
||||
$connect(handle: number, connectionUri: string, connection: sqlops.ConnectionInfo): Thenable<boolean> {
|
||||
return this._resolveProvider<sqlops.ConnectionProvider>(handle).connect(connectionUri, connection);
|
||||
}
|
||||
|
||||
$disconnect(handle: number, connectionUri: string): Thenable<boolean> {
|
||||
return this._resolveProvider<data.ConnectionProvider>(handle).disconnect(connectionUri);
|
||||
return this._resolveProvider<sqlops.ConnectionProvider>(handle).disconnect(connectionUri);
|
||||
}
|
||||
|
||||
$cancelConnect(handle: number, connectionUri: string): Thenable<boolean> {
|
||||
return this._resolveProvider<data.ConnectionProvider>(handle).cancelConnect(connectionUri);
|
||||
return this._resolveProvider<sqlops.ConnectionProvider>(handle).cancelConnect(connectionUri);
|
||||
}
|
||||
|
||||
$changeDatabase(handle: number, connectionUri: string, newDatabase: string): Thenable<boolean> {
|
||||
return this._resolveProvider<data.ConnectionProvider>(handle).changeDatabase(connectionUri, newDatabase);
|
||||
return this._resolveProvider<sqlops.ConnectionProvider>(handle).changeDatabase(connectionUri, newDatabase);
|
||||
}
|
||||
|
||||
$listDatabases(handle: number, connectionUri: string): Thenable<data.ListDatabasesResult> {
|
||||
return this._resolveProvider<data.ConnectionProvider>(handle).listDatabases(connectionUri);
|
||||
$listDatabases(handle: number, connectionUri: string): Thenable<sqlops.ListDatabasesResult> {
|
||||
return this._resolveProvider<sqlops.ConnectionProvider>(handle).listDatabases(connectionUri);
|
||||
}
|
||||
|
||||
$rebuildIntelliSenseCache(handle: number, connectionUri: string): Thenable<void> {
|
||||
return this._resolveProvider<data.ConnectionProvider>(handle).rebuildIntelliSenseCache(connectionUri);
|
||||
return this._resolveProvider<sqlops.ConnectionProvider>(handle).rebuildIntelliSenseCache(connectionUri);
|
||||
}
|
||||
|
||||
$onConnectComplete(handle: number, connectionInfoSummary: data.ConnectionInfoSummary): void {
|
||||
$onConnectComplete(handle: number, connectionInfoSummary: sqlops.ConnectionInfoSummary): void {
|
||||
this._proxy.$onConnectionComplete(handle, connectionInfoSummary);
|
||||
}
|
||||
|
||||
@@ -165,100 +165,100 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
|
||||
this._proxy.$onIntelliSenseCacheComplete(handle, connectionUri);
|
||||
}
|
||||
|
||||
public $onConnectionChanged(handle: number, changedConnInfo: data.ChangedConnectionInfo): void {
|
||||
public $onConnectionChanged(handle: number, changedConnInfo: sqlops.ChangedConnectionInfo): void {
|
||||
this._proxy.$onConnectionChangeNotification(handle, changedConnInfo);
|
||||
}
|
||||
|
||||
// Protocol-wide Event Handlers
|
||||
public $languageFlavorChanged(params: data.DidChangeLanguageFlavorParams): void {
|
||||
public $languageFlavorChanged(params: sqlops.DidChangeLanguageFlavorParams): void {
|
||||
this._onDidChangeLanguageFlavor.fire(params);
|
||||
}
|
||||
|
||||
// Query Management handlers
|
||||
|
||||
$cancelQuery(handle: number, ownerUri: string): Thenable<data.QueryCancelResult> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).cancelQuery(ownerUri);
|
||||
$cancelQuery(handle: number, ownerUri: string): Thenable<sqlops.QueryCancelResult> {
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).cancelQuery(ownerUri);
|
||||
}
|
||||
|
||||
$runQuery(handle: number, ownerUri: string, selection: data.ISelectionData, runOptions?: data.ExecutionPlanOptions): Thenable<void> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).runQuery(ownerUri, selection, runOptions);
|
||||
$runQuery(handle: number, ownerUri: string, selection: sqlops.ISelectionData, runOptions?: sqlops.ExecutionPlanOptions): Thenable<void> {
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).runQuery(ownerUri, selection, runOptions);
|
||||
}
|
||||
|
||||
$runQueryStatement(handle: number, ownerUri: string, line: number, column: number): Thenable<void> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).runQueryStatement(ownerUri, line, column);
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).runQueryStatement(ownerUri, line, column);
|
||||
}
|
||||
|
||||
$runQueryString(handle: number, ownerUri: string, queryString: string): Thenable<void> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).runQueryString(ownerUri, queryString);
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).runQueryString(ownerUri, queryString);
|
||||
}
|
||||
|
||||
$runQueryAndReturn(handle: number, ownerUri: string, queryString: string): Thenable<data.SimpleExecuteResult> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).runQueryAndReturn(ownerUri, queryString);
|
||||
$runQueryAndReturn(handle: number, ownerUri: string, queryString: string): Thenable<sqlops.SimpleExecuteResult> {
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).runQueryAndReturn(ownerUri, queryString);
|
||||
}
|
||||
|
||||
$getQueryRows(handle: number, rowData: data.QueryExecuteSubsetParams): Thenable<data.QueryExecuteSubsetResult> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).getQueryRows(rowData);
|
||||
$getQueryRows(handle: number, rowData: sqlops.QueryExecuteSubsetParams): Thenable<sqlops.QueryExecuteSubsetResult> {
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).getQueryRows(rowData);
|
||||
}
|
||||
|
||||
$disposeQuery(handle: number, ownerUri: string): Thenable<void> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).disposeQuery(ownerUri);
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).disposeQuery(ownerUri);
|
||||
}
|
||||
|
||||
$onQueryComplete(handle: number, result: data.QueryExecuteCompleteNotificationResult): void {
|
||||
$onQueryComplete(handle: number, result: sqlops.QueryExecuteCompleteNotificationResult): void {
|
||||
this._proxy.$onQueryComplete(handle, result);
|
||||
}
|
||||
$onBatchStart(handle: number, batchInfo: data.QueryExecuteBatchNotificationParams): void {
|
||||
$onBatchStart(handle: number, batchInfo: sqlops.QueryExecuteBatchNotificationParams): void {
|
||||
this._proxy.$onBatchStart(handle, batchInfo);
|
||||
}
|
||||
$onBatchComplete(handle: number, batchInfo: data.QueryExecuteBatchNotificationParams): void {
|
||||
$onBatchComplete(handle: number, batchInfo: sqlops.QueryExecuteBatchNotificationParams): void {
|
||||
this._proxy.$onBatchComplete(handle, batchInfo);
|
||||
}
|
||||
$onResultSetComplete(handle: number, resultSetInfo: data.QueryExecuteResultSetCompleteNotificationParams): void {
|
||||
$onResultSetComplete(handle: number, resultSetInfo: sqlops.QueryExecuteResultSetCompleteNotificationParams): void {
|
||||
this._proxy.$onResultSetComplete(handle, resultSetInfo);
|
||||
}
|
||||
$onQueryMessage(handle: number, message: data.QueryExecuteMessageParams): void {
|
||||
$onQueryMessage(handle: number, message: sqlops.QueryExecuteMessageParams): void {
|
||||
this._proxy.$onQueryMessage(handle, message);
|
||||
}
|
||||
|
||||
$saveResults(handle: number, requestParams: data.SaveResultsRequestParams): Thenable<data.SaveResultRequestResult> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).saveResults(requestParams);
|
||||
$saveResults(handle: number, requestParams: sqlops.SaveResultsRequestParams): Thenable<sqlops.SaveResultRequestResult> {
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).saveResults(requestParams);
|
||||
}
|
||||
|
||||
// Edit Data handlers
|
||||
$commitEdit(handle: number, ownerUri: string): Thenable<void> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).commitEdit(ownerUri);
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).commitEdit(ownerUri);
|
||||
}
|
||||
|
||||
$createRow(handle: number, ownerUri: string): Thenable<data.EditCreateRowResult> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).createRow(ownerUri);
|
||||
$createRow(handle: number, ownerUri: string): Thenable<sqlops.EditCreateRowResult> {
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).createRow(ownerUri);
|
||||
}
|
||||
|
||||
$deleteRow(handle: number, ownerUri: string, rowId: number): Thenable<void> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).deleteRow(ownerUri, rowId);
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).deleteRow(ownerUri, rowId);
|
||||
}
|
||||
|
||||
$disposeEdit(handle: number, ownerUri: string): Thenable<void> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).disposeEdit(ownerUri);
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).disposeEdit(ownerUri);
|
||||
}
|
||||
|
||||
$initializeEdit(handle: number, ownerUri: string, schemaName: string, objectName: string, objectType: string, rowLimit: number): Thenable<void> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).initializeEdit(ownerUri, schemaName, objectName, objectType, rowLimit);
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).initializeEdit(ownerUri, schemaName, objectName, objectType, rowLimit);
|
||||
}
|
||||
|
||||
$revertCell(handle: number, ownerUri: string, rowId: number, columnId: number): Thenable<data.EditRevertCellResult> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).revertCell(ownerUri, rowId, columnId);
|
||||
$revertCell(handle: number, ownerUri: string, rowId: number, columnId: number): Thenable<sqlops.EditRevertCellResult> {
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).revertCell(ownerUri, rowId, columnId);
|
||||
}
|
||||
|
||||
$revertRow(handle: number, ownerUri: string, rowId: number): Thenable<void> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).revertRow(ownerUri, rowId);
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).revertRow(ownerUri, rowId);
|
||||
}
|
||||
|
||||
$updateCell(handle: number, ownerUri: string, rowId: number, columnId: number, newValue: string): Thenable<data.EditUpdateCellResult> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).updateCell(ownerUri, rowId, columnId, newValue);
|
||||
$updateCell(handle: number, ownerUri: string, rowId: number, columnId: number, newValue: string): Thenable<sqlops.EditUpdateCellResult> {
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).updateCell(ownerUri, rowId, columnId, newValue);
|
||||
}
|
||||
|
||||
$getEditRows(handle: number, rowData: data.EditSubsetParams): Thenable<data.EditSubsetResult> {
|
||||
return this._resolveProvider<data.QueryProvider>(handle).getEditRows(rowData);
|
||||
$getEditRows(handle: number, rowData: sqlops.EditSubsetParams): Thenable<sqlops.EditSubsetResult> {
|
||||
return this._resolveProvider<sqlops.QueryProvider>(handle).getEditRows(rowData);
|
||||
}
|
||||
|
||||
$onEditSessionReady(handle: number, ownerUri: string, success: boolean, message: string): void {
|
||||
@@ -266,155 +266,155 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
|
||||
}
|
||||
|
||||
// Metadata handlers
|
||||
public $getMetadata(handle: number, connectionUri: string): Thenable<data.ProviderMetadata> {
|
||||
return this._resolveProvider<data.MetadataProvider>(handle).getMetadata(connectionUri);
|
||||
public $getMetadata(handle: number, connectionUri: string): Thenable<sqlops.ProviderMetadata> {
|
||||
return this._resolveProvider<sqlops.MetadataProvider>(handle).getMetadata(connectionUri);
|
||||
}
|
||||
|
||||
public $getDatabases(handle: number, connectionUri: string): Thenable<string[]> {
|
||||
return this._resolveProvider<data.MetadataProvider>(handle).getDatabases(connectionUri);
|
||||
return this._resolveProvider<sqlops.MetadataProvider>(handle).getDatabases(connectionUri);
|
||||
}
|
||||
|
||||
public $getTableInfo(handle: number, connectionUri: string, metadata: data.ObjectMetadata): Thenable<data.ColumnMetadata[]> {
|
||||
return this._resolveProvider<data.MetadataProvider>(handle).getTableInfo(connectionUri, metadata);
|
||||
public $getTableInfo(handle: number, connectionUri: string, metadata: sqlops.ObjectMetadata): Thenable<sqlops.ColumnMetadata[]> {
|
||||
return this._resolveProvider<sqlops.MetadataProvider>(handle).getTableInfo(connectionUri, metadata);
|
||||
}
|
||||
|
||||
public $getViewInfo(handle: number, connectionUri: string, metadata: data.ObjectMetadata): Thenable<data.ColumnMetadata[]> {
|
||||
return this._resolveProvider<data.MetadataProvider>(handle).getViewInfo(connectionUri, metadata);
|
||||
public $getViewInfo(handle: number, connectionUri: string, metadata: sqlops.ObjectMetadata): Thenable<sqlops.ColumnMetadata[]> {
|
||||
return this._resolveProvider<sqlops.MetadataProvider>(handle).getViewInfo(connectionUri, metadata);
|
||||
}
|
||||
|
||||
// Object Explorer Service
|
||||
public $createObjectExplorerSession(handle: number, connInfo: data.ConnectionInfo): Thenable<data.ObjectExplorerSessionResponse> {
|
||||
return this._resolveProvider<data.ObjectExplorerProvider>(handle).createNewSession(connInfo);
|
||||
public $createObjectExplorerSession(handle: number, connInfo: sqlops.ConnectionInfo): Thenable<sqlops.ObjectExplorerSessionResponse> {
|
||||
return this._resolveProvider<sqlops.ObjectExplorerProvider>(handle).createNewSession(connInfo);
|
||||
}
|
||||
|
||||
public $expandObjectExplorerNode(handle: number, nodeInfo: data.ExpandNodeInfo): Thenable<boolean> {
|
||||
return this._resolveProvider<data.ObjectExplorerProvider>(handle).expandNode(nodeInfo);
|
||||
public $expandObjectExplorerNode(handle: number, nodeInfo: sqlops.ExpandNodeInfo): Thenable<boolean> {
|
||||
return this._resolveProvider<sqlops.ObjectExplorerProvider>(handle).expandNode(nodeInfo);
|
||||
}
|
||||
|
||||
public $refreshObjectExplorerNode(handle: number, nodeInfo: data.ExpandNodeInfo): Thenable<boolean> {
|
||||
return this._resolveProvider<data.ObjectExplorerProvider>(handle).refreshNode(nodeInfo);
|
||||
public $refreshObjectExplorerNode(handle: number, nodeInfo: sqlops.ExpandNodeInfo): Thenable<boolean> {
|
||||
return this._resolveProvider<sqlops.ObjectExplorerProvider>(handle).refreshNode(nodeInfo);
|
||||
}
|
||||
|
||||
public $closeObjectExplorerSession(handle: number, closeSessionInfo: data.ObjectExplorerCloseSessionInfo): Thenable<data.ObjectExplorerCloseSessionResponse> {
|
||||
return this._resolveProvider<data.ObjectExplorerProvider>(handle).closeSession(closeSessionInfo);
|
||||
public $closeObjectExplorerSession(handle: number, closeSessionInfo: sqlops.ObjectExplorerCloseSessionInfo): Thenable<sqlops.ObjectExplorerCloseSessionResponse> {
|
||||
return this._resolveProvider<sqlops.ObjectExplorerProvider>(handle).closeSession(closeSessionInfo);
|
||||
}
|
||||
|
||||
public $onObjectExplorerSessionCreated(handle: number, response: data.ObjectExplorerSession): void {
|
||||
public $onObjectExplorerSessionCreated(handle: number, response: sqlops.ObjectExplorerSession): void {
|
||||
this._proxy.$onObjectExplorerSessionCreated(handle, response);
|
||||
}
|
||||
|
||||
public $onObjectExplorerNodeExpanded(handle: number, response: data.ObjectExplorerExpandInfo): void {
|
||||
public $onObjectExplorerNodeExpanded(handle: number, response: sqlops.ObjectExplorerExpandInfo): void {
|
||||
this._proxy.$onObjectExplorerNodeExpanded(handle, response);
|
||||
}
|
||||
|
||||
// Task Service
|
||||
public $getAllTasks(handle: number, listTasksParams: data.ListTasksParams): Thenable<data.ListTasksResponse> {
|
||||
return this._resolveProvider<data.TaskServicesProvider>(handle).getAllTasks(listTasksParams);
|
||||
public $getAllTasks(handle: number, listTasksParams: sqlops.ListTasksParams): Thenable<sqlops.ListTasksResponse> {
|
||||
return this._resolveProvider<sqlops.TaskServicesProvider>(handle).getAllTasks(listTasksParams);
|
||||
}
|
||||
|
||||
public $cancelTask(handle: number, cancelTaskParams: data.CancelTaskParams): Thenable<boolean> {
|
||||
return this._resolveProvider<data.TaskServicesProvider>(handle).cancelTask(cancelTaskParams);
|
||||
public $cancelTask(handle: number, cancelTaskParams: sqlops.CancelTaskParams): Thenable<boolean> {
|
||||
return this._resolveProvider<sqlops.TaskServicesProvider>(handle).cancelTask(cancelTaskParams);
|
||||
}
|
||||
|
||||
public $onTaskStatusChanged(handle: number, response: data.TaskProgressInfo): void {
|
||||
public $onTaskStatusChanged(handle: number, response: sqlops.TaskProgressInfo): void {
|
||||
this._proxy.$onTaskStatusChanged(handle, response);
|
||||
}
|
||||
|
||||
public $onTaskCreated(handle: number, response: data.TaskInfo): void {
|
||||
public $onTaskCreated(handle: number, response: sqlops.TaskInfo): void {
|
||||
this._proxy.$onTaskCreated(handle, response);
|
||||
}
|
||||
|
||||
// Scripting handlers
|
||||
|
||||
public $scriptAsOperation(handle: number, connectionUri: string, operation: data.ScriptOperation, metadata: data.ObjectMetadata, paramDetails: data.ScriptingParamDetails): Thenable<data.ScriptingResult> {
|
||||
return this._resolveProvider<data.ScriptingProvider>(handle).scriptAsOperation(connectionUri, operation, metadata, paramDetails);
|
||||
public $scriptAsOperation(handle: number, connectionUri: string, operation: sqlops.ScriptOperation, metadata: sqlops.ObjectMetadata, paramDetails: sqlops.ScriptingParamDetails): Thenable<sqlops.ScriptingResult> {
|
||||
return this._resolveProvider<sqlops.ScriptingProvider>(handle).scriptAsOperation(connectionUri, operation, metadata, paramDetails);
|
||||
}
|
||||
|
||||
public $onScriptingComplete(handle: number, scriptingCompleteResult: data.ScriptingCompleteResult): void {
|
||||
public $onScriptingComplete(handle: number, scriptingCompleteResult: sqlops.ScriptingCompleteResult): void {
|
||||
this._proxy.$onScriptingComplete(handle, scriptingCompleteResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new database on the provided connection
|
||||
*/
|
||||
public $createDatabase(handle: number, connectionUri: string, database: data.DatabaseInfo): Thenable<data.CreateDatabaseResponse> {
|
||||
return this._resolveProvider<data.AdminServicesProvider>(handle).createDatabase(connectionUri, database);
|
||||
public $createDatabase(handle: number, connectionUri: string, database: sqlops.DatabaseInfo): Thenable<sqlops.CreateDatabaseResponse> {
|
||||
return this._resolveProvider<sqlops.AdminServicesProvider>(handle).createDatabase(connectionUri, database);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new database on the provided connection
|
||||
*/
|
||||
public $getDefaultDatabaseInfo(handle: number, connectionUri: string): Thenable<data.DatabaseInfo> {
|
||||
return this._resolveProvider<data.AdminServicesProvider>(handle).getDefaultDatabaseInfo(connectionUri);
|
||||
public $getDefaultDatabaseInfo(handle: number, connectionUri: string): Thenable<sqlops.DatabaseInfo> {
|
||||
return this._resolveProvider<sqlops.AdminServicesProvider>(handle).getDefaultDatabaseInfo(connectionUri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the info on a database
|
||||
*/
|
||||
public $getDatabaseInfo(handle: number, connectionUri: string): Thenable<data.DatabaseInfo> {
|
||||
return this._resolveProvider<data.AdminServicesProvider>(handle).getDatabaseInfo(connectionUri);
|
||||
public $getDatabaseInfo(handle: number, connectionUri: string): Thenable<sqlops.DatabaseInfo> {
|
||||
return this._resolveProvider<sqlops.AdminServicesProvider>(handle).getDatabaseInfo(connectionUri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new login on the provided connection
|
||||
*/
|
||||
public $createLogin(handle: number, connectionUri: string, login: data.LoginInfo): Thenable<data.CreateLoginResponse> {
|
||||
return this._resolveProvider<data.AdminServicesProvider>(handle).createLogin(connectionUri, login);
|
||||
public $createLogin(handle: number, connectionUri: string, login: sqlops.LoginInfo): Thenable<sqlops.CreateLoginResponse> {
|
||||
return this._resolveProvider<sqlops.AdminServicesProvider>(handle).createLogin(connectionUri, login);
|
||||
}
|
||||
|
||||
/**
|
||||
* Backup a database
|
||||
*/
|
||||
public $backup(handle: number, connectionUri: string, backupInfo: { [key: string]: any }, taskExecutionMode: data.TaskExecutionMode): Thenable<data.BackupResponse> {
|
||||
return this._resolveProvider<data.BackupProvider>(handle).backup(connectionUri, backupInfo, taskExecutionMode);
|
||||
public $backup(handle: number, connectionUri: string, backupInfo: { [key: string]: any }, taskExecutionMode: sqlops.TaskExecutionMode): Thenable<sqlops.BackupResponse> {
|
||||
return this._resolveProvider<sqlops.BackupProvider>(handle).backup(connectionUri, backupInfo, taskExecutionMode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new database on the provided connection
|
||||
*/
|
||||
public $getBackupConfigInfo(handle: number, connectionUri: string): Thenable<data.BackupConfigInfo> {
|
||||
return this._resolveProvider<data.BackupProvider>(handle).getBackupConfigInfo(connectionUri);
|
||||
public $getBackupConfigInfo(handle: number, connectionUri: string): Thenable<sqlops.BackupConfigInfo> {
|
||||
return this._resolveProvider<sqlops.BackupProvider>(handle).getBackupConfigInfo(connectionUri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Restores a database
|
||||
*/
|
||||
public $restore(handle: number, connectionUri: string, restoreInfo: data.RestoreInfo): Thenable<data.RestoreResponse> {
|
||||
return this._resolveProvider<data.RestoreProvider>(handle).restore(connectionUri, restoreInfo);
|
||||
public $restore(handle: number, connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable<sqlops.RestoreResponse> {
|
||||
return this._resolveProvider<sqlops.RestoreProvider>(handle).restore(connectionUri, restoreInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a plan for restoring a database
|
||||
*/
|
||||
public $getRestorePlan(handle: number, connectionUri: string, restoreInfo: data.RestoreInfo): Thenable<data.RestorePlanResponse> {
|
||||
return this._resolveProvider<data.RestoreProvider>(handle).getRestorePlan(connectionUri, restoreInfo);
|
||||
public $getRestorePlan(handle: number, connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable<sqlops.RestorePlanResponse> {
|
||||
return this._resolveProvider<sqlops.RestoreProvider>(handle).getRestorePlan(connectionUri, restoreInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* cancels a restore plan
|
||||
*/
|
||||
public $cancelRestorePlan(handle: number, connectionUri: string, restoreInfo: data.RestoreInfo): Thenable<boolean> {
|
||||
return this._resolveProvider<data.RestoreProvider>(handle).cancelRestorePlan(connectionUri, restoreInfo);
|
||||
public $cancelRestorePlan(handle: number, connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable<boolean> {
|
||||
return this._resolveProvider<sqlops.RestoreProvider>(handle).cancelRestorePlan(connectionUri, restoreInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets restore config Info
|
||||
*/
|
||||
public $getRestoreConfigInfo(handle: number, connectionUri: string): Thenable<data.RestoreConfigInfo> {
|
||||
return this._resolveProvider<data.RestoreProvider>(handle).getRestoreConfigInfo(connectionUri);
|
||||
public $getRestoreConfigInfo(handle: number, connectionUri: string): Thenable<sqlops.RestoreConfigInfo> {
|
||||
return this._resolveProvider<sqlops.RestoreProvider>(handle).getRestoreConfigInfo(connectionUri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a file browser
|
||||
*/
|
||||
public $openFileBrowser(handle: number, ownerUri: string, expandPath: string, fileFilters: string[], changeFilter: boolean): Thenable<boolean> {
|
||||
return this._resolveProvider<data.FileBrowserProvider>(handle).openFileBrowser(ownerUri, expandPath, fileFilters, changeFilter);
|
||||
return this._resolveProvider<sqlops.FileBrowserProvider>(handle).openFileBrowser(ownerUri, expandPath, fileFilters, changeFilter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send event when opening browser is complete
|
||||
*/
|
||||
public $onFileBrowserOpened(handle: number, response: data.FileBrowserOpenedParams): void {
|
||||
public $onFileBrowserOpened(handle: number, response: sqlops.FileBrowserOpenedParams): void {
|
||||
this._proxy.$onFileBrowserOpened(handle, response);
|
||||
}
|
||||
|
||||
@@ -422,13 +422,13 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
|
||||
* Expand a folder node
|
||||
*/
|
||||
public $expandFolderNode(handle: number, ownerUri: string, expandPath: string): Thenable<boolean> {
|
||||
return this._resolveProvider<data.FileBrowserProvider>(handle).expandFolderNode(ownerUri, expandPath);
|
||||
return this._resolveProvider<sqlops.FileBrowserProvider>(handle).expandFolderNode(ownerUri, expandPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send event when expansion is complete
|
||||
*/
|
||||
public $onFolderNodeExpanded(handle: number, response: data.FileBrowserExpandedParams): void {
|
||||
public $onFolderNodeExpanded(handle: number, response: sqlops.FileBrowserExpandedParams): void {
|
||||
this._proxy.$onFolderNodeExpanded(handle, response);
|
||||
}
|
||||
|
||||
@@ -436,21 +436,21 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
|
||||
* Validate selected file path
|
||||
*/
|
||||
public $validateFilePaths(handle: number, ownerUri: string, serviceType: string, selectedFiles: string[]): Thenable<boolean> {
|
||||
return this._resolveProvider<data.FileBrowserProvider>(handle).validateFilePaths(ownerUri, serviceType, selectedFiles);
|
||||
return this._resolveProvider<sqlops.FileBrowserProvider>(handle).validateFilePaths(ownerUri, serviceType, selectedFiles);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send event when validation is complete
|
||||
*/
|
||||
public $onFilePathsValidated(handle: number, response: data.FileBrowserValidatedParams) {
|
||||
public $onFilePathsValidated(handle: number, response: sqlops.FileBrowserValidatedParams) {
|
||||
this._proxy.$onFilePathsValidated(handle, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close file browser
|
||||
*/
|
||||
public $closeFileBrowser(handle: number, ownerUri: string): Thenable<data.FileBrowserCloseResponse> {
|
||||
return this._resolveProvider<data.FileBrowserProvider>(handle).closeFileBrowser(ownerUri);
|
||||
public $closeFileBrowser(handle: number, ownerUri: string): Thenable<sqlops.FileBrowserCloseResponse> {
|
||||
return this._resolveProvider<sqlops.FileBrowserProvider>(handle).closeFileBrowser(ownerUri);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -461,20 +461,20 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
|
||||
* Start a profiler session
|
||||
*/
|
||||
public $startSession(handle: number, sessionId: string): Thenable<boolean> {
|
||||
return this._resolveProvider<data.ProfilerProvider>(handle).startSession(sessionId);
|
||||
return this._resolveProvider<sqlops.ProfilerProvider>(handle).startSession(sessionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop a profiler session
|
||||
*/
|
||||
public $stopSession(handle: number, sessionId: string): Thenable<boolean> {
|
||||
return this._resolveProvider<data.ProfilerProvider>(handle).stopSession(sessionId);
|
||||
return this._resolveProvider<sqlops.ProfilerProvider>(handle).stopSession(sessionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Profiler session events available notification
|
||||
*/
|
||||
public $onSessionEventsAvailable(handle: number, response: data.ProfilerSessionEvents): void {
|
||||
public $onSessionEventsAvailable(handle: number, response: sqlops.ProfilerSessionEvents): void {
|
||||
this._proxy.$onSessionEventsAvailable(handle, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
import { SqlMainContext, MainThreadModalDialogShape, ExtHostModalDialogsShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import * as vscode from 'vscode';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
|
||||
class ExtHostDialog implements data.ModalDialog {
|
||||
class ExtHostDialog implements sqlops.ModalDialog {
|
||||
private _title: string;
|
||||
private _html: string;
|
||||
private _okTitle: string;
|
||||
@@ -97,7 +97,7 @@ export class ExtHostModalDialogs implements ExtHostModalDialogsShape {
|
||||
|
||||
createDialog(
|
||||
title: string
|
||||
): data.ModalDialog {
|
||||
): sqlops.ModalDialog {
|
||||
console.log(title);
|
||||
const handle = ExtHostModalDialogs._handlePool++;
|
||||
this._proxy.$createDialog(handle);
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as data from 'data';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import {Disposable} from 'vs/workbench/api/node/extHostTypes';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { Disposable } from 'vs/workbench/api/node/extHostTypes';
|
||||
import {
|
||||
ExtHostResourceProviderShape,
|
||||
MainThreadResourceProviderShape,
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
export class ExtHostResourceProvider extends ExtHostResourceProviderShape {
|
||||
private _handlePool: number = 0;
|
||||
private _proxy: MainThreadResourceProviderShape;
|
||||
private _providers: {[handle: number]: ResourceProviderWithMetadata} = {};
|
||||
private _providers: { [handle: number]: ResourceProviderWithMetadata } = {};
|
||||
|
||||
constructor(threadService: IThreadService) {
|
||||
super();
|
||||
@@ -27,15 +27,15 @@ export class ExtHostResourceProvider extends ExtHostResourceProviderShape {
|
||||
|
||||
// PUBLIC METHODS //////////////////////////////////////////////////////
|
||||
// - MAIN THREAD AVAILABLE METHODS /////////////////////////////////////
|
||||
public $createFirewallRule(handle: number, account: data.Account, firewallRuleInfo: data.FirewallRuleInfo): Thenable<data.CreateFirewallRuleResponse> {
|
||||
return this._withProvider(handle, (provider: data.ResourceProvider) => provider.createFirewallRule(account, firewallRuleInfo));
|
||||
public $createFirewallRule(handle: number, account: sqlops.Account, firewallRuleInfo: sqlops.FirewallRuleInfo): Thenable<sqlops.CreateFirewallRuleResponse> {
|
||||
return this._withProvider(handle, (provider: sqlops.ResourceProvider) => provider.createFirewallRule(account, firewallRuleInfo));
|
||||
}
|
||||
public $handleFirewallRule(handle: number, errorCode: number, errorMessage: string, connectionTypeId: string): Thenable<data.HandleFirewallRuleResponse> {
|
||||
return this._withProvider(handle, (provider: data.ResourceProvider) => provider.handleFirewallRule(errorCode, errorMessage, connectionTypeId));
|
||||
public $handleFirewallRule(handle: number, errorCode: number, errorMessage: string, connectionTypeId: string): Thenable<sqlops.HandleFirewallRuleResponse> {
|
||||
return this._withProvider(handle, (provider: sqlops.ResourceProvider) => provider.handleFirewallRule(errorCode, errorMessage, connectionTypeId));
|
||||
}
|
||||
|
||||
// - EXTENSION HOST AVAILABLE METHODS //////////////////////////////////
|
||||
public $registerResourceProvider(providerMetadata: data.ResourceProviderMetadata, provider: data.ResourceProvider): Disposable {
|
||||
public $registerResourceProvider(providerMetadata: sqlops.ResourceProviderMetadata, provider: sqlops.ResourceProvider): Disposable {
|
||||
let self = this;
|
||||
|
||||
// Look for any account providers that have the same provider ID
|
||||
@@ -76,7 +76,7 @@ export class ExtHostResourceProvider extends ExtHostResourceProviderShape {
|
||||
return this._handlePool++;
|
||||
}
|
||||
|
||||
private _withProvider<R>(handle: number, callback: (provider: data.ResourceProvider) => Thenable<R>): Thenable<R> {
|
||||
private _withProvider<R>(handle: number, callback: (provider: sqlops.ResourceProvider) => Thenable<R>): Thenable<R> {
|
||||
let provider = this._providers[handle];
|
||||
if (provider === undefined) {
|
||||
return TPromise.wrapError(new Error(`Provider ${handle} not found.`));
|
||||
@@ -86,8 +86,8 @@ export class ExtHostResourceProvider extends ExtHostResourceProviderShape {
|
||||
}
|
||||
|
||||
interface ResourceProviderWithMetadata {
|
||||
metadata: data.ResourceProviderMetadata;
|
||||
provider: data.ResourceProvider;
|
||||
metadata: sqlops.ResourceProviderMetadata;
|
||||
provider: sqlops.ResourceProvider;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,17 +8,17 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { SqlMainContext, MainThreadSerializationProviderShape, ExtHostSerializationProviderShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
import * as vscode from 'vscode';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { Disposable } from 'vs/workbench/api/node/extHostTypes';
|
||||
|
||||
class SerializationAdapter {
|
||||
private _provider: data.SerializationProvider;
|
||||
private _provider: sqlops.SerializationProvider;
|
||||
|
||||
constructor(provider: data.SerializationProvider) {
|
||||
constructor(provider: sqlops.SerializationProvider) {
|
||||
this._provider = provider;
|
||||
}
|
||||
|
||||
public saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable<data.SaveResultRequestResult> {
|
||||
public saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable<sqlops.SaveResultRequestResult> {
|
||||
return this._provider.saveAs(saveFormat, savePath, results, appendToFile);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class SerializationAdapter {
|
||||
|
||||
type Adapter = SerializationAdapter;
|
||||
|
||||
export class ExtHostSerializationProvider extends ExtHostSerializationProviderShape {
|
||||
export class ExtHostSerializationProvider extends ExtHostSerializationProviderShape {
|
||||
|
||||
private _proxy: MainThreadSerializationProviderShape;
|
||||
|
||||
@@ -44,7 +44,7 @@ export class ExtHostSerializationProvider extends ExtHostSerializationProviderSh
|
||||
return ExtHostSerializationProvider._handlePool++;
|
||||
}
|
||||
|
||||
private _withAdapter<A, R>(handle: number, ctor: { new (...args: any[]): A }, callback: (adapter: A) => Thenable<R>): Thenable<R> {
|
||||
private _withAdapter<A, R>(handle: number, ctor: { new(...args: any[]): A }, callback: (adapter: A) => Thenable<R>): Thenable<R> {
|
||||
let adapter = this._adapter[handle];
|
||||
if (!(adapter instanceof ctor)) {
|
||||
return TPromise.wrapError(new Error('no adapter found'));
|
||||
@@ -59,14 +59,14 @@ export class ExtHostSerializationProvider extends ExtHostSerializationProviderSh
|
||||
this._proxy = threadService.get(SqlMainContext.MainThreadSerializationProvider);
|
||||
}
|
||||
|
||||
public $registerSerializationProvider(provider: data.SerializationProvider): vscode.Disposable {
|
||||
public $registerSerializationProvider(provider: sqlops.SerializationProvider): vscode.Disposable {
|
||||
provider.handle = this._nextHandle();
|
||||
this._adapter[provider.handle] = new SerializationAdapter(provider);
|
||||
this._proxy.$registerSerializationProvider(provider.handle);
|
||||
return this._createDisposable(provider.handle);
|
||||
}
|
||||
|
||||
public $saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable<data.SaveResultRequestResult> {
|
||||
public $saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable<sqlops.SaveResultRequestResult> {
|
||||
return this._withAdapter(0, SerializationAdapter, adapter => adapter.saveAs(saveFormat, savePath, results, appendToFile));
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IAccountManagementService } from 'sql/services/accountManagement/interfaces';
|
||||
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||
@@ -19,7 +19,7 @@ import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostC
|
||||
|
||||
@extHostNamedCustomer(SqlMainContext.MainThreadAccountManagement)
|
||||
export class MainThreadAccountManagement implements MainThreadAccountManagementShape {
|
||||
private _providerMetadata: { [handle: number]: data.AccountProviderMetadata };
|
||||
private _providerMetadata: { [handle: number]: sqlops.AccountProviderMetadata };
|
||||
private _proxy: ExtHostAccountManagementShape;
|
||||
private _toDispose: IDisposable[];
|
||||
|
||||
@@ -42,31 +42,31 @@ export class MainThreadAccountManagement implements MainThreadAccountManagementS
|
||||
return this._accountManagementService.endAutoOAuthDeviceCode();
|
||||
}
|
||||
|
||||
$accountUpdated(updatedAccount: data.Account): void {
|
||||
$accountUpdated(updatedAccount: sqlops.Account): void {
|
||||
this._accountManagementService.accountUpdated(updatedAccount);
|
||||
}
|
||||
|
||||
public $registerAccountProvider(providerMetadata: data.AccountProviderMetadata, handle: number): Thenable<any> {
|
||||
public $registerAccountProvider(providerMetadata: sqlops.AccountProviderMetadata, handle: number): Thenable<any> {
|
||||
let self = this;
|
||||
|
||||
// Create the account provider that interfaces with the extension via the proxy and register it
|
||||
let accountProvider: data.AccountProvider = {
|
||||
let accountProvider: sqlops.AccountProvider = {
|
||||
autoOAuthCancelled(): Thenable<void> {
|
||||
return self._proxy.$autoOAuthCancelled(handle);
|
||||
},
|
||||
clear(accountKey: data.AccountKey): Thenable<void> {
|
||||
clear(accountKey: sqlops.AccountKey): Thenable<void> {
|
||||
return self._proxy.$clear(handle, accountKey);
|
||||
},
|
||||
getSecurityToken(account: data.Account): Thenable<{}> {
|
||||
getSecurityToken(account: sqlops.Account): Thenable<{}> {
|
||||
return self._proxy.$getSecurityToken(handle, account);
|
||||
},
|
||||
initialize(restoredAccounts: data.Account[]): Thenable<data.Account[]> {
|
||||
initialize(restoredAccounts: sqlops.Account[]): Thenable<sqlops.Account[]> {
|
||||
return self._proxy.$initialize(handle, restoredAccounts);
|
||||
},
|
||||
prompt(): Thenable<data.Account> {
|
||||
prompt(): Thenable<sqlops.Account> {
|
||||
return self._proxy.$prompt(handle);
|
||||
},
|
||||
refresh(account: data.Account): Thenable<data.Account> {
|
||||
refresh(account: sqlops.Account): Thenable<sqlops.Account> {
|
||||
return self._proxy.$refresh(handle, account);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import { SqlExtHostContext, SqlMainContext, ExtHostConnectionManagementShape, MainThreadConnectionManagementShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
|
||||
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
||||
@@ -37,11 +37,11 @@ export class MainThreadConnectionManagement implements MainThreadConnectionManag
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
}
|
||||
|
||||
public $getActiveConnections(): Thenable<data.connection.Connection[]> {
|
||||
public $getActiveConnections(): Thenable<sqlops.connection.Connection[]> {
|
||||
return Promise.resolve(this._connectionManagementService.getActiveConnections().map(profile => this.convertConnection(profile)));
|
||||
}
|
||||
|
||||
public $getCurrentConnection(): Thenable<data.connection.Connection> {
|
||||
public $getCurrentConnection(): Thenable<sqlops.connection.Connection> {
|
||||
return Promise.resolve(this.convertConnection(TaskUtilities.getCurrentGlobalConnection(this._objectExplorerService, this._connectionManagementService, this._workbenchEditorService, true)));
|
||||
}
|
||||
|
||||
@@ -49,12 +49,12 @@ export class MainThreadConnectionManagement implements MainThreadConnectionManag
|
||||
return Promise.resolve(this._connectionManagementService.getActiveConnectionCredentials(connectionId));
|
||||
}
|
||||
|
||||
private convertConnection(profile: IConnectionProfile): data.connection.Connection {
|
||||
private convertConnection(profile: IConnectionProfile): sqlops.connection.Connection {
|
||||
if (!profile) {
|
||||
return undefined;
|
||||
}
|
||||
profile = this._connectionManagementService.removeConnectionProfileCredentials(profile);
|
||||
let connection: data.connection.Connection = {
|
||||
let connection: sqlops.connection.Connection = {
|
||||
providerName: profile.providerName,
|
||||
connectionId: profile.id,
|
||||
options: profile.options
|
||||
|
||||
@@ -8,9 +8,10 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import {
|
||||
SqlExtHostContext, ExtHostCredentialManagementShape,
|
||||
MainThreadCredentialManagementShape, SqlMainContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
MainThreadCredentialManagementShape, SqlMainContext
|
||||
} from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
import { ICredentialsService } from 'sql/services/credentials/credentialsService';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
|
||||
|
||||
@@ -43,7 +44,7 @@ export class MainThreadCredentialManagement implements MainThreadCredentialManag
|
||||
onSaveCredential(credentialId: string, password: string): Thenable<boolean> {
|
||||
return self._proxy.$saveCredential(credentialId, password);
|
||||
},
|
||||
onReadCredential(credentialId: string): Thenable<data.Credential> {
|
||||
onReadCredential(credentialId: string): Thenable<sqlops.Credential> {
|
||||
return self._proxy.$readCredential(credentialId);
|
||||
},
|
||||
onDeleteCredential(credentialId: string): Thenable<boolean> {
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
||||
import { ICapabilitiesService } from 'sql/services/capabilities/capabilitiesService';
|
||||
import { IQueryManagementService } from 'sql/parts/query/common/queryManagement';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { IMetadataService } from 'sql/services/metadata/metadataService';
|
||||
import { IObjectExplorerService } from 'sql/parts/registeredServer/common/objectExplorerService';
|
||||
import { IScriptingService } from 'sql/services/scripting/scriptingService';
|
||||
@@ -26,6 +26,8 @@ import { ISerializationService } from 'sql/services/serialization/serializationS
|
||||
import { IFileBrowserService } from 'sql/parts/fileBrowser/common/interfaces';
|
||||
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
|
||||
import { IMessageService } from 'vs/platform/message/common/message';
|
||||
import severity from 'vs/base/common/severity';
|
||||
|
||||
/**
|
||||
* Main thread class for handling data protocol management registration.
|
||||
@@ -53,7 +55,8 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
@ITaskService private _taskService: ITaskService,
|
||||
@IProfilerService private _profilerService: IProfilerService,
|
||||
@ISerializationService private _serializationService: ISerializationService,
|
||||
@IFileBrowserService private _fileBrowserService: IFileBrowserService
|
||||
@IFileBrowserService private _fileBrowserService: IFileBrowserService,
|
||||
@IMessageService private _messageService: IMessageService
|
||||
) {
|
||||
if (extHostContext) {
|
||||
this._proxy = extHostContext.get(SqlExtHostContext.ExtHostDataProtocol);
|
||||
@@ -69,8 +72,8 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
|
||||
public $registerConnectionProvider(providerId: string, handle: number): TPromise<any> {
|
||||
const self = this;
|
||||
this._connectionManagementService.registerProvider(providerId, <data.ConnectionProvider>{
|
||||
connect(connectionUri: string, connectionInfo: data.ConnectionInfo): Thenable<boolean> {
|
||||
this._connectionManagementService.registerProvider(providerId, <sqlops.ConnectionProvider>{
|
||||
connect(connectionUri: string, connectionInfo: sqlops.ConnectionInfo): Thenable<boolean> {
|
||||
return self._proxy.$connect(handle, connectionUri, connectionInfo);
|
||||
},
|
||||
disconnect(connectionUri: string): Thenable<boolean> {
|
||||
@@ -82,7 +85,7 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
cancelConnect(connectionUri: string): Thenable<boolean> {
|
||||
return self._proxy.$cancelConnect(handle, connectionUri);
|
||||
},
|
||||
listDatabases(connectionUri: string): Thenable<data.ListDatabasesResult> {
|
||||
listDatabases(connectionUri: string): Thenable<sqlops.ListDatabasesResult> {
|
||||
return self._proxy.$listDatabases(handle, connectionUri);
|
||||
},
|
||||
rebuildIntelliSenseCache(connectionUri: string): Thenable<void> {
|
||||
@@ -96,10 +99,10 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
public $registerQueryProvider(providerId: string, handle: number): TPromise<any> {
|
||||
const self = this;
|
||||
this._queryManagementService.addQueryRequestHandler(providerId, {
|
||||
cancelQuery(ownerUri: string): Thenable<data.QueryCancelResult> {
|
||||
cancelQuery(ownerUri: string): Thenable<sqlops.QueryCancelResult> {
|
||||
return self._proxy.$cancelQuery(handle, ownerUri);
|
||||
},
|
||||
runQuery(ownerUri: string, selection: data.ISelectionData, runOptions?: data.ExecutionPlanOptions): Thenable<void> {
|
||||
runQuery(ownerUri: string, selection: sqlops.ISelectionData, runOptions?: sqlops.ExecutionPlanOptions): Thenable<void> {
|
||||
return self._proxy.$runQuery(handle, ownerUri, selection, runOptions);
|
||||
},
|
||||
runQueryStatement(ownerUri: string, line: number, column: number): Thenable<void> {
|
||||
@@ -108,16 +111,16 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
runQueryString(ownerUri: string, queryString: string): Thenable<void> {
|
||||
return self._proxy.$runQueryString(handle, ownerUri, queryString);
|
||||
},
|
||||
runQueryAndReturn(ownerUri: string, queryString: string): Thenable<data.SimpleExecuteResult> {
|
||||
runQueryAndReturn(ownerUri: string, queryString: string): Thenable<sqlops.SimpleExecuteResult> {
|
||||
return self._proxy.$runQueryAndReturn(handle, ownerUri, queryString);
|
||||
},
|
||||
getQueryRows(rowData: data.QueryExecuteSubsetParams): Thenable<data.QueryExecuteSubsetResult> {
|
||||
getQueryRows(rowData: sqlops.QueryExecuteSubsetParams): Thenable<sqlops.QueryExecuteSubsetResult> {
|
||||
return self._proxy.$getQueryRows(handle, rowData);
|
||||
},
|
||||
disposeQuery(ownerUri: string): Thenable<void> {
|
||||
return self._proxy.$disposeQuery(handle, ownerUri);
|
||||
},
|
||||
saveResults(requestParams: data.SaveResultsRequestParams): Thenable<data.SaveResultRequestResult> {
|
||||
saveResults(requestParams: sqlops.SaveResultsRequestParams): Thenable<sqlops.SaveResultRequestResult> {
|
||||
let serializationProvider = self._serializationService.getSerializationFeatureMetadataProvider(requestParams.ownerUri);
|
||||
if (serializationProvider && serializationProvider.enabled) {
|
||||
return self._proxy.$saveResults(handle, requestParams);
|
||||
@@ -132,13 +135,13 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
initializeEdit(ownerUri: string, schemaName: string, objectName: string, objectType: string, rowLimit: number): Thenable<void> {
|
||||
return self._proxy.$initializeEdit(handle, ownerUri, schemaName, objectName, objectType, rowLimit);
|
||||
},
|
||||
updateCell(ownerUri: string, rowId: number, columnId: number, newValue: string): Thenable<data.EditUpdateCellResult> {
|
||||
updateCell(ownerUri: string, rowId: number, columnId: number, newValue: string): Thenable<sqlops.EditUpdateCellResult> {
|
||||
return self._proxy.$updateCell(handle, ownerUri, rowId, columnId, newValue);
|
||||
},
|
||||
commitEdit(ownerUri): Thenable<void> {
|
||||
return self._proxy.$commitEdit(handle, ownerUri);
|
||||
},
|
||||
createRow(ownerUri: string): Thenable<data.EditCreateRowResult> {
|
||||
createRow(ownerUri: string): Thenable<sqlops.EditCreateRowResult> {
|
||||
return self._proxy.$createRow(handle, ownerUri);
|
||||
},
|
||||
deleteRow(ownerUri: string, rowId: number): Thenable<void> {
|
||||
@@ -147,13 +150,13 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
disposeEdit(ownerUri: string): Thenable<void> {
|
||||
return self._proxy.$disposeEdit(handle, ownerUri);
|
||||
},
|
||||
revertCell(ownerUri: string, rowId: number, columnId: number): Thenable<data.EditRevertCellResult> {
|
||||
revertCell(ownerUri: string, rowId: number, columnId: number): Thenable<sqlops.EditRevertCellResult> {
|
||||
return self._proxy.$revertCell(handle, ownerUri, rowId, columnId);
|
||||
},
|
||||
revertRow(ownerUri: string, rowId: number): Thenable<void> {
|
||||
return self._proxy.$revertRow(handle, ownerUri, rowId);
|
||||
},
|
||||
getEditRows(rowData: data.EditSubsetParams): Thenable<data.EditSubsetResult> {
|
||||
getEditRows(rowData: sqlops.EditSubsetParams): Thenable<sqlops.EditSubsetResult> {
|
||||
return self._proxy.$getEditRows(handle, rowData);
|
||||
}
|
||||
});
|
||||
@@ -163,11 +166,11 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
|
||||
public $registerBackupProvider(providerId: string, handle: number): TPromise<any> {
|
||||
const self = this;
|
||||
this._backupService.registerProvider(providerId, <data.BackupProvider>{
|
||||
backup(connectionUri: string, backupInfo: { [key: string]: any }, taskExecutionMode: data.TaskExecutionMode): Thenable<data.BackupResponse> {
|
||||
this._backupService.registerProvider(providerId, <sqlops.BackupProvider>{
|
||||
backup(connectionUri: string, backupInfo: { [key: string]: any }, taskExecutionMode: sqlops.TaskExecutionMode): Thenable<sqlops.BackupResponse> {
|
||||
return self._proxy.$backup(handle, connectionUri, backupInfo, taskExecutionMode);
|
||||
},
|
||||
getBackupConfigInfo(connectionUri: string): Thenable<data.BackupConfigInfo> {
|
||||
getBackupConfigInfo(connectionUri: string): Thenable<sqlops.BackupConfigInfo> {
|
||||
return self._proxy.$getBackupConfigInfo(handle, connectionUri);
|
||||
}
|
||||
});
|
||||
@@ -177,17 +180,17 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
|
||||
public $registerRestoreProvider(providerId: string, handle: number): TPromise<any> {
|
||||
const self = this;
|
||||
this._restoreService.registerProvider(providerId, <data.RestoreProvider>{
|
||||
getRestorePlan(connectionUri: string, restoreInfo: data.RestoreInfo): Thenable<data.RestorePlanResponse> {
|
||||
this._restoreService.registerProvider(providerId, <sqlops.RestoreProvider>{
|
||||
getRestorePlan(connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable<sqlops.RestorePlanResponse> {
|
||||
return self._proxy.$getRestorePlan(handle, connectionUri, restoreInfo);
|
||||
},
|
||||
cancelRestorePlan(connectionUri: string, restoreInfo: data.RestoreInfo): Thenable<boolean> {
|
||||
cancelRestorePlan(connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable<boolean> {
|
||||
return self._proxy.$cancelRestorePlan(handle, connectionUri, restoreInfo);
|
||||
},
|
||||
restore(connectionUri: string, restoreInfo: data.RestoreInfo): Thenable<data.RestoreResponse> {
|
||||
restore(connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable<sqlops.RestoreResponse> {
|
||||
return self._proxy.$restore(handle, connectionUri, restoreInfo);
|
||||
},
|
||||
getRestoreConfigInfo(connectionUri: string): Thenable<data.RestoreConfigInfo> {
|
||||
getRestoreConfigInfo(connectionUri: string): Thenable<sqlops.RestoreConfigInfo> {
|
||||
return self._proxy.$getRestoreConfigInfo(handle, connectionUri);
|
||||
}
|
||||
});
|
||||
@@ -197,17 +200,17 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
|
||||
public $registerMetadataProvider(providerId: string, handle: number): TPromise<any> {
|
||||
const self = this;
|
||||
this._metadataService.registerProvider(providerId, <data.MetadataProvider>{
|
||||
getMetadata(connectionUri: string): Thenable<data.ProviderMetadata> {
|
||||
this._metadataService.registerProvider(providerId, <sqlops.MetadataProvider>{
|
||||
getMetadata(connectionUri: string): Thenable<sqlops.ProviderMetadata> {
|
||||
return self._proxy.$getMetadata(handle, connectionUri);
|
||||
},
|
||||
getDatabases(connectionUri: string): Thenable<string[]> {
|
||||
return self._proxy.$getDatabases(handle, connectionUri);
|
||||
},
|
||||
getTableInfo(connectionUri: string, metadata: data.ObjectMetadata): Thenable<data.ColumnMetadata[]> {
|
||||
getTableInfo(connectionUri: string, metadata: sqlops.ObjectMetadata): Thenable<sqlops.ColumnMetadata[]> {
|
||||
return self._proxy.$getTableInfo(handle, connectionUri, metadata);
|
||||
},
|
||||
getViewInfo(connectionUri: string, metadata: data.ObjectMetadata): Thenable<data.ColumnMetadata[]> {
|
||||
getViewInfo(connectionUri: string, metadata: sqlops.ObjectMetadata): Thenable<sqlops.ColumnMetadata[]> {
|
||||
return self._proxy.$getViewInfo(handle, connectionUri, metadata);
|
||||
}
|
||||
});
|
||||
@@ -217,17 +220,17 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
|
||||
public $registerObjectExplorerProvider(providerId: string, handle: number): TPromise<any> {
|
||||
const self = this;
|
||||
this._objectExplorerService.registerProvider(providerId, <data.ObjectExplorerProvider>{
|
||||
createNewSession(connection: data.ConnectionInfo): Thenable<data.ObjectExplorerSessionResponse> {
|
||||
this._objectExplorerService.registerProvider(providerId, <sqlops.ObjectExplorerProvider>{
|
||||
createNewSession(connection: sqlops.ConnectionInfo): Thenable<sqlops.ObjectExplorerSessionResponse> {
|
||||
return self._proxy.$createObjectExplorerSession(handle, connection);
|
||||
},
|
||||
expandNode(nodeInfo: data.ExpandNodeInfo): Thenable<boolean> {
|
||||
expandNode(nodeInfo: sqlops.ExpandNodeInfo): Thenable<boolean> {
|
||||
return self._proxy.$expandObjectExplorerNode(handle, nodeInfo);
|
||||
},
|
||||
refreshNode(nodeInfo: data.ExpandNodeInfo): Thenable<boolean> {
|
||||
refreshNode(nodeInfo: sqlops.ExpandNodeInfo): Thenable<boolean> {
|
||||
return self._proxy.$refreshObjectExplorerNode(handle, nodeInfo);
|
||||
},
|
||||
closeSession(closeSessionInfo: data.ObjectExplorerCloseSessionInfo): Thenable<data.ObjectExplorerCloseSessionResponse> {
|
||||
closeSession(closeSessionInfo: sqlops.ObjectExplorerCloseSessionInfo): Thenable<sqlops.ObjectExplorerCloseSessionResponse> {
|
||||
return self._proxy.$closeObjectExplorerSession(handle, closeSessionInfo);
|
||||
}
|
||||
});
|
||||
@@ -237,11 +240,11 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
|
||||
public $registerTaskServicesProvider(providerId: string, handle: number): TPromise<any> {
|
||||
const self = this;
|
||||
this._taskService.registerProvider(providerId, <data.TaskServicesProvider>{
|
||||
getAllTasks(listTasksParams: data.ListTasksParams): Thenable<data.ListTasksResponse> {
|
||||
this._taskService.registerProvider(providerId, <sqlops.TaskServicesProvider>{
|
||||
getAllTasks(listTasksParams: sqlops.ListTasksParams): Thenable<sqlops.ListTasksResponse> {
|
||||
return self._proxy.$getAllTasks(handle, listTasksParams);
|
||||
},
|
||||
cancelTask(cancelTaskParams: data.CancelTaskParams): Thenable<boolean> {
|
||||
cancelTask(cancelTaskParams: sqlops.CancelTaskParams): Thenable<boolean> {
|
||||
return self._proxy.$cancelTask(handle, cancelTaskParams);
|
||||
}
|
||||
});
|
||||
@@ -251,8 +254,8 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
|
||||
public $registerScriptingProvider(providerId: string, handle: number): TPromise<any> {
|
||||
const self = this;
|
||||
this._scriptingService.registerProvider(providerId, <data.ScriptingProvider>{
|
||||
scriptAsOperation(connectionUri: string, operation: data.ScriptOperation, metadata: data.ObjectMetadata, paramDetails: data.ScriptingParamDetails): Thenable<data.ScriptingResult> {
|
||||
this._scriptingService.registerProvider(providerId, <sqlops.ScriptingProvider>{
|
||||
scriptAsOperation(connectionUri: string, operation: sqlops.ScriptOperation, metadata: sqlops.ObjectMetadata, paramDetails: sqlops.ScriptingParamDetails): Thenable<sqlops.ScriptingResult> {
|
||||
return self._proxy.$scriptAsOperation(handle, connectionUri, operation, metadata, paramDetails);
|
||||
}
|
||||
});
|
||||
@@ -262,7 +265,7 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
|
||||
public $registerFileBrowserProvider(providerId: string, handle: number): TPromise<any> {
|
||||
const self = this;
|
||||
this._fileBrowserService.registerProvider(providerId, <data.FileBrowserProvider>{
|
||||
this._fileBrowserService.registerProvider(providerId, <sqlops.FileBrowserProvider>{
|
||||
openFileBrowser(ownerUri: string, expandPath: string, fileFilters: string[], changeFilter: boolean): Thenable<boolean> {
|
||||
return self._proxy.$openFileBrowser(handle, ownerUri, expandPath, fileFilters, changeFilter);
|
||||
},
|
||||
@@ -272,7 +275,7 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
validateFilePaths(ownerUri: string, serviceType: string, selectedFiles: string[]): Thenable<boolean> {
|
||||
return self._proxy.$validateFilePaths(handle, ownerUri, serviceType, selectedFiles);
|
||||
},
|
||||
closeFileBrowser(ownerUri: string): Thenable<data.FileBrowserCloseResponse> {
|
||||
closeFileBrowser(ownerUri: string): Thenable<sqlops.FileBrowserCloseResponse> {
|
||||
return self._proxy.$closeFileBrowser(handle, ownerUri);
|
||||
}
|
||||
});
|
||||
@@ -282,7 +285,7 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
|
||||
public $registerProfilerProvider(providerId: string, handle: number): TPromise<any> {
|
||||
const self = this;
|
||||
this._profilerService.registerProvider(providerId, <data.ProfilerProvider>{
|
||||
this._profilerService.registerProvider(providerId, <sqlops.ProfilerProvider>{
|
||||
startSession(sessionId: string): Thenable<boolean> {
|
||||
return self._proxy.$startSession(handle, sessionId);
|
||||
},
|
||||
@@ -305,17 +308,17 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
|
||||
public $registerAdminServicesProvider(providerId: string, handle: number): TPromise<any> {
|
||||
const self = this;
|
||||
this._adminService.registerProvider(providerId, <data.AdminServicesProvider>{
|
||||
createDatabase(connectionUri: string, database: data.DatabaseInfo): Thenable<data.CreateDatabaseResponse> {
|
||||
this._adminService.registerProvider(providerId, <sqlops.AdminServicesProvider>{
|
||||
createDatabase(connectionUri: string, database: sqlops.DatabaseInfo): Thenable<sqlops.CreateDatabaseResponse> {
|
||||
return self._proxy.$createDatabase(handle, connectionUri, database);
|
||||
},
|
||||
getDefaultDatabaseInfo(connectionUri: string): Thenable<data.DatabaseInfo> {
|
||||
getDefaultDatabaseInfo(connectionUri: string): Thenable<sqlops.DatabaseInfo> {
|
||||
return self._proxy.$getDefaultDatabaseInfo(handle, connectionUri);
|
||||
},
|
||||
getDatabaseInfo(connectionUri: string): Thenable<data.DatabaseInfo> {
|
||||
getDatabaseInfo(connectionUri: string): Thenable<sqlops.DatabaseInfo> {
|
||||
return self._proxy.$getDatabaseInfo(handle, connectionUri);
|
||||
},
|
||||
createLogin(connectionUri: string, login: data.LoginInfo): Thenable<data.CreateLoginResponse> {
|
||||
createLogin(connectionUri: string, login: sqlops.LoginInfo): Thenable<sqlops.CreateLoginResponse> {
|
||||
return self._proxy.$createLogin(handle, connectionUri, login);
|
||||
}
|
||||
});
|
||||
@@ -325,8 +328,8 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
|
||||
public $registerCapabilitiesServiceProvider(providerId: string, handle: number): TPromise<any> {
|
||||
const self = this;
|
||||
this._capabilitiesService.registerProvider(<data.CapabilitiesProvider>{
|
||||
getServerCapabilities(client: data.DataProtocolClientCapabilities): Thenable<data.DataProtocolServerCapabilities> {
|
||||
this._capabilitiesService.registerProvider(<sqlops.CapabilitiesProvider>{
|
||||
getServerCapabilities(client: sqlops.DataProtocolClientCapabilities): Thenable<sqlops.DataProtocolServerCapabilities> {
|
||||
return self._proxy.$getServerCapabilities(handle, client);
|
||||
}
|
||||
});
|
||||
@@ -335,7 +338,7 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
}
|
||||
|
||||
// Connection Management handlers
|
||||
public $onConnectionComplete(handle: number, connectionInfoSummary: data.ConnectionInfoSummary): void {
|
||||
public $onConnectionComplete(handle: number, connectionInfoSummary: sqlops.ConnectionInfoSummary): void {
|
||||
this._connectionManagementService.onConnectionComplete(handle, connectionInfoSummary);
|
||||
}
|
||||
|
||||
@@ -343,24 +346,24 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
this._connectionManagementService.onIntelliSenseCacheComplete(handle, connectionUri);
|
||||
}
|
||||
|
||||
public $onConnectionChangeNotification(handle: number, changedConnInfo: data.ChangedConnectionInfo): void {
|
||||
public $onConnectionChangeNotification(handle: number, changedConnInfo: sqlops.ChangedConnectionInfo): void {
|
||||
this._connectionManagementService.onConnectionChangedNotification(handle, changedConnInfo);
|
||||
}
|
||||
|
||||
// Query Management handlers
|
||||
public $onQueryComplete(handle: number, result: data.QueryExecuteCompleteNotificationResult): void {
|
||||
public $onQueryComplete(handle: number, result: sqlops.QueryExecuteCompleteNotificationResult): void {
|
||||
this._queryManagementService.onQueryComplete(result);
|
||||
}
|
||||
public $onBatchStart(handle: number, batchInfo: data.QueryExecuteBatchNotificationParams): void {
|
||||
public $onBatchStart(handle: number, batchInfo: sqlops.QueryExecuteBatchNotificationParams): void {
|
||||
this._queryManagementService.onBatchStart(batchInfo);
|
||||
}
|
||||
public $onBatchComplete(handle: number, batchInfo: data.QueryExecuteBatchNotificationParams): void {
|
||||
public $onBatchComplete(handle: number, batchInfo: sqlops.QueryExecuteBatchNotificationParams): void {
|
||||
this._queryManagementService.onBatchComplete(batchInfo);
|
||||
}
|
||||
public $onResultSetComplete(handle: number, resultSetInfo: data.QueryExecuteResultSetCompleteNotificationParams): void {
|
||||
public $onResultSetComplete(handle: number, resultSetInfo: sqlops.QueryExecuteResultSetCompleteNotificationParams): void {
|
||||
this._queryManagementService.onResultSetComplete(resultSetInfo);
|
||||
}
|
||||
public $onQueryMessage(handle: number, message: data.QueryExecuteMessageParams): void {
|
||||
public $onQueryMessage(handle: number, message: sqlops.QueryExecuteMessageParams): void {
|
||||
this._queryManagementService.onMessage(message);
|
||||
}
|
||||
public $onEditSessionReady(handle: number, ownerUri: string, success: boolean, message: string): void {
|
||||
@@ -368,43 +371,43 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
}
|
||||
|
||||
// Script Handlers
|
||||
public $onScriptingComplete(handle: number, scriptingCompleteResult: data.ScriptingCompleteResult): void {
|
||||
public $onScriptingComplete(handle: number, scriptingCompleteResult: sqlops.ScriptingCompleteResult): void {
|
||||
this._scriptingService.onScriptingComplete(handle, scriptingCompleteResult);
|
||||
}
|
||||
|
||||
//OE handlers
|
||||
public $onObjectExplorerSessionCreated(handle: number, sessionResponse: data.ObjectExplorerSession): void {
|
||||
public $onObjectExplorerSessionCreated(handle: number, sessionResponse: sqlops.ObjectExplorerSession): void {
|
||||
this._objectExplorerService.onSessionCreated(handle, sessionResponse);
|
||||
}
|
||||
|
||||
public $onObjectExplorerNodeExpanded(handle: number, expandResponse: data.ObjectExplorerExpandInfo): void {
|
||||
public $onObjectExplorerNodeExpanded(handle: number, expandResponse: sqlops.ObjectExplorerExpandInfo): void {
|
||||
this._objectExplorerService.onNodeExpanded(handle, expandResponse);
|
||||
}
|
||||
|
||||
//Tasks handlers
|
||||
public $onTaskCreated(handle: number, taskInfo: data.TaskInfo): void {
|
||||
public $onTaskCreated(handle: number, taskInfo: sqlops.TaskInfo): void {
|
||||
this._taskService.onNewTaskCreated(handle, taskInfo);
|
||||
}
|
||||
|
||||
public $onTaskStatusChanged(handle: number, taskProgressInfo: data.TaskProgressInfo): void {
|
||||
public $onTaskStatusChanged(handle: number, taskProgressInfo: sqlops.TaskProgressInfo): void {
|
||||
this._taskService.onTaskStatusChanged(handle, taskProgressInfo);
|
||||
}
|
||||
|
||||
//File browser handlers
|
||||
public $onFileBrowserOpened(handle: number, response: data.FileBrowserOpenedParams): void {
|
||||
public $onFileBrowserOpened(handle: number, response: sqlops.FileBrowserOpenedParams): void {
|
||||
this._fileBrowserService.onFileBrowserOpened(handle, response);
|
||||
}
|
||||
|
||||
public $onFolderNodeExpanded(handle: number, response: data.FileBrowserExpandedParams): void {
|
||||
public $onFolderNodeExpanded(handle: number, response: sqlops.FileBrowserExpandedParams): void {
|
||||
this._fileBrowserService.onFolderNodeExpanded(handle, response);
|
||||
}
|
||||
|
||||
public $onFilePathsValidated(handle: number, response: data.FileBrowserValidatedParams): void {
|
||||
public $onFilePathsValidated(handle: number, response: sqlops.FileBrowserValidatedParams): void {
|
||||
this._fileBrowserService.onFilePathsValidated(handle, response);
|
||||
}
|
||||
|
||||
// Profiler handlers
|
||||
public $onSessionEventsAvailable(handle: number, response: data.ProfilerSessionEvents): void {
|
||||
public $onSessionEventsAvailable(handle: number, response: sqlops.ProfilerSessionEvents): void {
|
||||
this._profilerService.onMoreRows(response);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as data from 'data';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IResourceProviderService } from 'sql/parts/accountManagement/common/interfaces';
|
||||
import {dispose, IDisposable} from 'vs/base/common/lifecycle';
|
||||
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import {
|
||||
ExtHostResourceProviderShape,
|
||||
MainThreadResourceProviderShape,
|
||||
@@ -20,7 +20,7 @@ import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostC
|
||||
|
||||
@extHostNamedCustomer(SqlMainContext.MainThreadResourceProvider)
|
||||
export class MainThreadResourceProvider implements MainThreadResourceProviderShape {
|
||||
private _providerMetadata: {[handle: number]: data.AccountProviderMetadata};
|
||||
private _providerMetadata: { [handle: number]: sqlops.AccountProviderMetadata };
|
||||
private _proxy: ExtHostResourceProviderShape;
|
||||
private _toDispose: IDisposable[];
|
||||
|
||||
@@ -35,15 +35,15 @@ export class MainThreadResourceProvider implements MainThreadResourceProviderSha
|
||||
this._toDispose = [];
|
||||
}
|
||||
|
||||
public $registerResourceProvider(providerMetadata: data.ResourceProviderMetadata, handle: number): Thenable<any> {
|
||||
public $registerResourceProvider(providerMetadata: sqlops.ResourceProviderMetadata, handle: number): Thenable<any> {
|
||||
let self = this;
|
||||
|
||||
// Create the account provider that interfaces with the extension via the proxy and register it
|
||||
let resourceProvider: data.ResourceProvider = {
|
||||
createFirewallRule(account: data.Account, firewallruleInfo: data.FirewallRuleInfo): Thenable<data.CreateFirewallRuleResponse> {
|
||||
let resourceProvider: sqlops.ResourceProvider = {
|
||||
createFirewallRule(account: sqlops.Account, firewallruleInfo: sqlops.FirewallRuleInfo): Thenable<sqlops.CreateFirewallRuleResponse> {
|
||||
return self._proxy.$createFirewallRule(handle, account, firewallruleInfo);
|
||||
},
|
||||
handleFirewallRule(errorCode: number, errorMessage: string, connectionTypeId: string): Thenable<data.HandleFirewallRuleResponse> {
|
||||
handleFirewallRule(errorCode: number, errorMessage: string, connectionTypeId: string): Thenable<sqlops.HandleFirewallRuleResponse> {
|
||||
return self._proxy.$handleFirewallRule(handle, errorCode, errorMessage, connectionTypeId);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import {
|
||||
SqlExtHostContext, ExtHostSerializationProviderShape,
|
||||
MainThreadSerializationProviderShape, SqlMainContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
MainThreadSerializationProviderShape, SqlMainContext
|
||||
} from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
import { ISerializationService } from 'sql/services/serialization/serializationService';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
|
||||
|
||||
@@ -42,7 +42,7 @@ export class MainThreadSerializationProvider implements MainThreadSerializationP
|
||||
let self = this;
|
||||
|
||||
this._registrations[handle] = this.serializationService.addEventListener(handle, {
|
||||
onSaveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable<data.SaveResultRequestResult> {
|
||||
onSaveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable<sqlops.SaveResultRequestResult> {
|
||||
return self._proxy.$saveAs(saveFormat, savePath, results, appendToFile);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -13,7 +13,7 @@ import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'
|
||||
import { realpath } from 'fs';
|
||||
import * as extHostTypes from 'vs/workbench/api/node/extHostTypes';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as vscode from 'vscode';
|
||||
import { SqlExtHostContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
import { ExtHostAccountManagement } from 'sql/workbench/api/node/extHostAccountManagement';
|
||||
@@ -33,7 +33,7 @@ import { ExtHostConnectionManagement } from 'sql/workbench/api/node/extHostConne
|
||||
|
||||
export interface ISqlExtensionApiFactory {
|
||||
vsCodeFactory(extension: IExtensionDescription): typeof vscode;
|
||||
dataFactory(extension: IExtensionDescription): typeof data;
|
||||
sqlopsFactory(extension: IExtensionDescription): typeof sqlops;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,10 +61,10 @@ export function createApiFactory(
|
||||
|
||||
return {
|
||||
vsCodeFactory: vsCodeFactory,
|
||||
dataFactory: function (extension: IExtensionDescription): typeof data {
|
||||
sqlopsFactory: function (extension: IExtensionDescription): typeof sqlops {
|
||||
// namespace: accounts
|
||||
const accounts: typeof data.accounts = {
|
||||
registerAccountProvider(providerMetadata: data.AccountProviderMetadata, provider: data.AccountProvider): vscode.Disposable {
|
||||
const accounts: typeof sqlops.accounts = {
|
||||
registerAccountProvider(providerMetadata: sqlops.AccountProviderMetadata, provider: sqlops.AccountProvider): vscode.Disposable {
|
||||
return extHostAccountManagement.$registerAccountProvider(providerMetadata, provider);
|
||||
},
|
||||
beginAutoOAuthDeviceCode(providerId: string, title: string, message: string, userCode: string, uri: string): Thenable<void> {
|
||||
@@ -73,17 +73,17 @@ export function createApiFactory(
|
||||
endAutoOAuthDeviceCode(): void {
|
||||
return extHostAccountManagement.$endAutoOAuthDeviceCode();
|
||||
},
|
||||
accountUpdated(updatedAccount: data.Account): void {
|
||||
accountUpdated(updatedAccount: sqlops.Account): void {
|
||||
return extHostAccountManagement.$accountUpdated(updatedAccount);
|
||||
}
|
||||
};
|
||||
|
||||
// namespace: connection
|
||||
const connection: typeof data.connection = {
|
||||
getActiveConnections(): Thenable<data.connection.Connection[]> {
|
||||
const connection: typeof sqlops.connection = {
|
||||
getActiveConnections(): Thenable<sqlops.connection.Connection[]> {
|
||||
return extHostConnectionManagement.$getActiveConnections();
|
||||
},
|
||||
getCurrentConnection(): Thenable<data.connection.Connection> {
|
||||
getCurrentConnection(): Thenable<sqlops.connection.Connection> {
|
||||
return extHostConnectionManagement.$getCurrentConnection();
|
||||
},
|
||||
getCredentials(connectionId: string): Thenable<{ [name: string]: string }> {
|
||||
@@ -92,32 +92,32 @@ export function createApiFactory(
|
||||
};
|
||||
|
||||
// namespace: credentials
|
||||
const credentials: typeof data.credentials = {
|
||||
registerProvider(provider: data.CredentialProvider): vscode.Disposable {
|
||||
const credentials: typeof sqlops.credentials = {
|
||||
registerProvider(provider: sqlops.CredentialProvider): vscode.Disposable {
|
||||
return extHostCredentialManagement.$registerCredentialProvider(provider);
|
||||
},
|
||||
getProvider(namespaceId: string): Thenable<data.CredentialProvider> {
|
||||
getProvider(namespaceId: string): Thenable<sqlops.CredentialProvider> {
|
||||
return extHostCredentialManagement.$getCredentialProvider(namespaceId);
|
||||
}
|
||||
};
|
||||
|
||||
// namespace: serialization
|
||||
const serialization: typeof data.serialization = {
|
||||
registerProvider(provider: data.SerializationProvider): vscode.Disposable {
|
||||
const serialization: typeof sqlops.serialization = {
|
||||
registerProvider(provider: sqlops.SerializationProvider): vscode.Disposable {
|
||||
return extHostSerializationProvider.$registerSerializationProvider(provider);
|
||||
},
|
||||
};
|
||||
|
||||
// namespace: serialization
|
||||
const resources: typeof data.resources = {
|
||||
registerResourceProvider(providerMetadata: data.ResourceProviderMetadata, provider: data.ResourceProvider): vscode.Disposable {
|
||||
const resources: typeof sqlops.resources = {
|
||||
registerResourceProvider(providerMetadata: sqlops.ResourceProviderMetadata, provider: sqlops.ResourceProvider): vscode.Disposable {
|
||||
return extHostResourceProvider.$registerResourceProvider(providerMetadata, provider);
|
||||
}
|
||||
};
|
||||
|
||||
let registerConnectionProvider = (provider: data.ConnectionProvider): vscode.Disposable => {
|
||||
let registerConnectionProvider = (provider: sqlops.ConnectionProvider): vscode.Disposable => {
|
||||
// Connection callbacks
|
||||
provider.registerOnConnectionComplete((connSummary: data.ConnectionInfoSummary) => {
|
||||
provider.registerOnConnectionComplete((connSummary: sqlops.ConnectionInfoSummary) => {
|
||||
extHostDataProvider.$onConnectComplete(provider.handle, connSummary);
|
||||
});
|
||||
|
||||
@@ -125,31 +125,31 @@ export function createApiFactory(
|
||||
extHostDataProvider.$onIntelliSenseCacheComplete(provider.handle, connectionUri);
|
||||
});
|
||||
|
||||
provider.registerOnConnectionChanged((changedConnInfo: data.ChangedConnectionInfo) => {
|
||||
provider.registerOnConnectionChanged((changedConnInfo: sqlops.ChangedConnectionInfo) => {
|
||||
extHostDataProvider.$onConnectionChanged(provider.handle, changedConnInfo);
|
||||
});
|
||||
|
||||
return extHostDataProvider.$registerConnectionProvider(provider);
|
||||
};
|
||||
|
||||
let registerQueryProvider = (provider: data.QueryProvider): vscode.Disposable => {
|
||||
provider.registerOnQueryComplete((result: data.QueryExecuteCompleteNotificationResult) => {
|
||||
let registerQueryProvider = (provider: sqlops.QueryProvider): vscode.Disposable => {
|
||||
provider.registerOnQueryComplete((result: sqlops.QueryExecuteCompleteNotificationResult) => {
|
||||
extHostDataProvider.$onQueryComplete(provider.handle, result);
|
||||
});
|
||||
|
||||
provider.registerOnBatchStart((batchInfo: data.QueryExecuteBatchNotificationParams) => {
|
||||
provider.registerOnBatchStart((batchInfo: sqlops.QueryExecuteBatchNotificationParams) => {
|
||||
extHostDataProvider.$onBatchStart(provider.handle, batchInfo);
|
||||
});
|
||||
|
||||
provider.registerOnBatchComplete((batchInfo: data.QueryExecuteBatchNotificationParams) => {
|
||||
provider.registerOnBatchComplete((batchInfo: sqlops.QueryExecuteBatchNotificationParams) => {
|
||||
extHostDataProvider.$onBatchComplete(provider.handle, batchInfo);
|
||||
});
|
||||
|
||||
provider.registerOnResultSetComplete((resultSetInfo: data.QueryExecuteResultSetCompleteNotificationParams) => {
|
||||
provider.registerOnResultSetComplete((resultSetInfo: sqlops.QueryExecuteResultSetCompleteNotificationParams) => {
|
||||
extHostDataProvider.$onResultSetComplete(provider.handle, resultSetInfo);
|
||||
});
|
||||
|
||||
provider.registerOnMessage((message: data.QueryExecuteMessageParams) => {
|
||||
provider.registerOnMessage((message: sqlops.QueryExecuteMessageParams) => {
|
||||
extHostDataProvider.$onQueryMessage(provider.handle, message);
|
||||
});
|
||||
|
||||
@@ -160,84 +160,84 @@ export function createApiFactory(
|
||||
return extHostDataProvider.$registerQueryProvider(provider);
|
||||
};
|
||||
|
||||
let registerObjectExplorerProvider = (provider: data.ObjectExplorerProvider): vscode.Disposable => {
|
||||
provider.registerOnSessionCreated((response: data.ObjectExplorerSession) => {
|
||||
let registerObjectExplorerProvider = (provider: sqlops.ObjectExplorerProvider): vscode.Disposable => {
|
||||
provider.registerOnSessionCreated((response: sqlops.ObjectExplorerSession) => {
|
||||
extHostDataProvider.$onObjectExplorerSessionCreated(provider.handle, response);
|
||||
});
|
||||
|
||||
provider.registerOnExpandCompleted((response: data.ObjectExplorerExpandInfo) => {
|
||||
provider.registerOnExpandCompleted((response: sqlops.ObjectExplorerExpandInfo) => {
|
||||
extHostDataProvider.$onObjectExplorerNodeExpanded(provider.handle, response);
|
||||
});
|
||||
|
||||
return extHostDataProvider.$registerObjectExplorerProvider(provider);
|
||||
};
|
||||
|
||||
let registerTaskServicesProvider = (provider: data.TaskServicesProvider): vscode.Disposable => {
|
||||
provider.registerOnTaskCreated((response: data.TaskInfo) => {
|
||||
let registerTaskServicesProvider = (provider: sqlops.TaskServicesProvider): vscode.Disposable => {
|
||||
provider.registerOnTaskCreated((response: sqlops.TaskInfo) => {
|
||||
extHostDataProvider.$onTaskCreated(provider.handle, response);
|
||||
});
|
||||
|
||||
provider.registerOnTaskStatusChanged((response: data.TaskProgressInfo) => {
|
||||
provider.registerOnTaskStatusChanged((response: sqlops.TaskProgressInfo) => {
|
||||
extHostDataProvider.$onTaskStatusChanged(provider.handle, response);
|
||||
});
|
||||
|
||||
return extHostDataProvider.$registerTaskServicesProvider(provider);
|
||||
};
|
||||
|
||||
let registerFileBrowserProvider = (provider: data.FileBrowserProvider): vscode.Disposable => {
|
||||
provider.registerOnFileBrowserOpened((response: data.FileBrowserOpenedParams) => {
|
||||
let registerFileBrowserProvider = (provider: sqlops.FileBrowserProvider): vscode.Disposable => {
|
||||
provider.registerOnFileBrowserOpened((response: sqlops.FileBrowserOpenedParams) => {
|
||||
extHostDataProvider.$onFileBrowserOpened(provider.handle, response);
|
||||
});
|
||||
|
||||
provider.registerOnFolderNodeExpanded((response: data.FileBrowserExpandedParams) => {
|
||||
provider.registerOnFolderNodeExpanded((response: sqlops.FileBrowserExpandedParams) => {
|
||||
extHostDataProvider.$onFolderNodeExpanded(provider.handle, response);
|
||||
});
|
||||
|
||||
provider.registerOnFilePathsValidated((response: data.FileBrowserValidatedParams) => {
|
||||
provider.registerOnFilePathsValidated((response: sqlops.FileBrowserValidatedParams) => {
|
||||
extHostDataProvider.$onFilePathsValidated(provider.handle, response);
|
||||
});
|
||||
|
||||
return extHostDataProvider.$registerFileBrowserProvider(provider);
|
||||
};
|
||||
|
||||
let registerScriptingProvider = (provider: data.ScriptingProvider): vscode.Disposable => {
|
||||
provider.registerOnScriptingComplete((response: data.ScriptingCompleteResult) => {
|
||||
let registerScriptingProvider = (provider: sqlops.ScriptingProvider): vscode.Disposable => {
|
||||
provider.registerOnScriptingComplete((response: sqlops.ScriptingCompleteResult) => {
|
||||
extHostDataProvider.$onScriptingComplete(provider.handle, response);
|
||||
});
|
||||
|
||||
return extHostDataProvider.$registerScriptingProvider(provider);
|
||||
};
|
||||
|
||||
let registerProfilerProvider = (provider: data.ProfilerProvider): vscode.Disposable => {
|
||||
provider.registerOnSessionEventsAvailable((response: data.ProfilerSessionEvents) => {
|
||||
let registerProfilerProvider = (provider: sqlops.ProfilerProvider): vscode.Disposable => {
|
||||
provider.registerOnSessionEventsAvailable((response: sqlops.ProfilerSessionEvents) => {
|
||||
extHostDataProvider.$onSessionEventsAvailable(provider.handle, response);
|
||||
});
|
||||
|
||||
return extHostDataProvider.$registerProfilerProvider(provider);
|
||||
};
|
||||
|
||||
let registerBackupProvider = (provider: data.BackupProvider): vscode.Disposable => {
|
||||
let registerBackupProvider = (provider: sqlops.BackupProvider): vscode.Disposable => {
|
||||
return extHostDataProvider.$registerBackupProvider(provider);
|
||||
};
|
||||
|
||||
let registerRestoreProvider = (provider: data.RestoreProvider): vscode.Disposable => {
|
||||
let registerRestoreProvider = (provider: sqlops.RestoreProvider): vscode.Disposable => {
|
||||
return extHostDataProvider.$registerRestoreProvider(provider);
|
||||
};
|
||||
|
||||
let registerMetadataProvider = (provider: data.MetadataProvider): vscode.Disposable => {
|
||||
let registerMetadataProvider = (provider: sqlops.MetadataProvider): vscode.Disposable => {
|
||||
return extHostDataProvider.$registerMetadataProvider(provider);
|
||||
};
|
||||
|
||||
let registerCapabilitiesServiceProvider = (provider: data.CapabilitiesProvider): vscode.Disposable => {
|
||||
let registerCapabilitiesServiceProvider = (provider: sqlops.CapabilitiesProvider): vscode.Disposable => {
|
||||
return extHostDataProvider.$registerCapabilitiesServiceProvider(provider);
|
||||
};
|
||||
|
||||
let registerAdminServicesProvider = (provider: data.AdminServicesProvider): vscode.Disposable => {
|
||||
let registerAdminServicesProvider = (provider: sqlops.AdminServicesProvider): vscode.Disposable => {
|
||||
return extHostDataProvider.$registerAdminServicesProvider(provider);
|
||||
};
|
||||
|
||||
// namespace: dataprotocol
|
||||
const dataprotocol: typeof data.dataprotocol = {
|
||||
const dataprotocol: typeof sqlops.dataprotocol = {
|
||||
registerBackupProvider,
|
||||
registerConnectionProvider,
|
||||
registerFileBrowserProvider,
|
||||
@@ -250,7 +250,7 @@ export function createApiFactory(
|
||||
registerQueryProvider,
|
||||
registerAdminServicesProvider,
|
||||
registerCapabilitiesServiceProvider,
|
||||
onDidChangeLanguageFlavor(listener: (e: data.DidChangeLanguageFlavorParams) => any, thisArgs?: any, disposables?: extHostTypes.Disposable[]) {
|
||||
onDidChangeLanguageFlavor(listener: (e: sqlops.DidChangeLanguageFlavorParams) => any, thisArgs?: any, disposables?: extHostTypes.Disposable[]) {
|
||||
return extHostDataProvider.onDidChangeLanguageFlavor(listener, thisArgs, disposables);
|
||||
}
|
||||
};
|
||||
@@ -262,7 +262,7 @@ export function createApiFactory(
|
||||
};
|
||||
|
||||
const dashboard = {
|
||||
registerWebviewProvider(widgetId: string, handler: (webview: data.DashboardWebview) => void) {
|
||||
registerWebviewProvider(widgetId: string, handler: (webview: sqlops.DashboardWebview) => void) {
|
||||
extHostWebviewWidgets.$registerProvider(widgetId, handler);
|
||||
}
|
||||
};
|
||||
@@ -316,13 +316,13 @@ function createExtensionPathIndex(extensionService: ExtHostExtensionService): TP
|
||||
}
|
||||
|
||||
function defineAPI(factory: ISqlExtensionApiFactory, extensionPaths: TrieMap<IExtensionDescription>): void {
|
||||
type ApiImpl = typeof vscode | typeof data;
|
||||
type ApiImpl = typeof vscode | typeof sqlops;
|
||||
|
||||
// each extension is meant to get its own api implementation
|
||||
const extApiImpl = new Map<string, typeof vscode>();
|
||||
const dataExtApiImpl = new Map<string, typeof data>();
|
||||
const dataExtApiImpl = new Map<string, typeof sqlops>();
|
||||
let defaultApiImpl: typeof vscode;
|
||||
let defaultDataApiImpl: typeof data;
|
||||
let defaultDataApiImpl: typeof sqlops;
|
||||
|
||||
// The module factory looks for an entry in the API map for an extension. If found, it reuses this.
|
||||
// If not, it loads it & saves it in the map
|
||||
@@ -360,11 +360,11 @@ function defineAPI(factory: ISqlExtensionApiFactory, extensionPaths: TrieMap<IEx
|
||||
defaultApiImpl,
|
||||
(impl) => defaultApiImpl = <typeof vscode>impl,
|
||||
parent);
|
||||
} else if (request === 'data') {
|
||||
} else if (request === 'sqlops') {
|
||||
return getModuleFactory(dataExtApiImpl,
|
||||
(ext) => factory.dataFactory(ext),
|
||||
(ext) => factory.sqlopsFactory(ext),
|
||||
defaultDataApiImpl,
|
||||
(impl) => defaultDataApiImpl = <typeof data>impl,
|
||||
(impl) => defaultDataApiImpl = <typeof sqlops>impl,
|
||||
parent);
|
||||
} else {
|
||||
// Allow standard node_module load to occur
|
||||
|
||||
@@ -7,21 +7,21 @@
|
||||
import {
|
||||
createMainContextProxyIdentifier as createMainId,
|
||||
createExtHostContextProxyIdentifier as createExtId,
|
||||
ProxyIdentifier, IThreadService
|
||||
ProxyIdentifier
|
||||
} from 'vs/workbench/services/thread/common/threadService';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
export abstract class ExtHostAccountManagementShape {
|
||||
$autoOAuthCancelled(handle: number): Thenable<void> { throw ni(); }
|
||||
$clear(handle: number, accountKey: data.AccountKey): Thenable<void> { throw ni(); }
|
||||
$getSecurityToken(handle: number, account: data.Account): Thenable<{}> { throw ni(); }
|
||||
$initialize(handle: number, restoredAccounts: data.Account[]): Thenable<data.Account[]> { throw ni(); }
|
||||
$prompt(handle: number): Thenable<data.Account> { throw ni(); }
|
||||
$refresh(handle: number, account: data.Account): Thenable<data.Account> { throw ni(); }
|
||||
$clear(handle: number, accountKey: sqlops.AccountKey): Thenable<void> { throw ni(); }
|
||||
$getSecurityToken(handle: number, account: sqlops.Account): Thenable<{}> { throw ni(); }
|
||||
$initialize(handle: number, restoredAccounts: sqlops.Account[]): Thenable<sqlops.Account[]> { throw ni(); }
|
||||
$prompt(handle: number): Thenable<sqlops.Account> { throw ni(); }
|
||||
$refresh(handle: number, account: sqlops.Account): Thenable<sqlops.Account> { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class ExtHostConnectionManagementShape { }
|
||||
@@ -31,7 +31,7 @@ export abstract class ExtHostDataProtocolShape {
|
||||
/**
|
||||
* Establish a connection to a data source using the provided ConnectionInfo instance.
|
||||
*/
|
||||
$connect(handle: number, connectionUri: string, connection: data.ConnectionInfo): Thenable<boolean> { throw ni(); }
|
||||
$connect(handle: number, connectionUri: string, connection: sqlops.ConnectionInfo): Thenable<boolean> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Disconnect from a data source using the provided connectionUri string.
|
||||
@@ -53,7 +53,7 @@ export abstract class ExtHostDataProtocolShape {
|
||||
* @param handle the handle to use when looking up a provider
|
||||
* @param connectionUri URI identifying a connected resource
|
||||
*/
|
||||
$listDatabases(handle: number, connectionUri: string): Thenable<data.ListDatabasesResult> { throw ni(); }
|
||||
$listDatabases(handle: number, connectionUri: string): Thenable<sqlops.ListDatabasesResult> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Notifies all listeners on the Extension Host side that a language change occurred
|
||||
@@ -61,63 +61,63 @@ export abstract class ExtHostDataProtocolShape {
|
||||
* and other events
|
||||
* @param params information on what URI was changed and the new language
|
||||
*/
|
||||
$languageFlavorChanged(params: data.DidChangeLanguageFlavorParams): void { throw ni(); }
|
||||
$languageFlavorChanged(params: sqlops.DidChangeLanguageFlavorParams): void { throw ni(); }
|
||||
|
||||
/**
|
||||
* Callback when a connection request has completed
|
||||
*/
|
||||
$onConnectComplete(handle: number, connectionInfoSummary: data.ConnectionInfoSummary): void { throw ni(); }
|
||||
$onConnectComplete(handle: number, connectionInfoSummary: sqlops.ConnectionInfoSummary): void { throw ni(); }
|
||||
|
||||
/**
|
||||
* Callback when a IntelliSense cache has been built
|
||||
*/
|
||||
$onIntelliSenseCacheComplete(handle: number, connectionUri: string): void { throw ni(); }
|
||||
|
||||
$getServerCapabilities(handle: number, client: data.DataProtocolClientCapabilities): Thenable<data.DataProtocolServerCapabilities> { throw ni(); }
|
||||
$getServerCapabilities(handle: number, client: sqlops.DataProtocolClientCapabilities): Thenable<sqlops.DataProtocolServerCapabilities> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Metadata service methods
|
||||
*
|
||||
*/
|
||||
$getMetadata(handle: number, connectionUri: string): Thenable<data.ProviderMetadata> { throw ni(); }
|
||||
$getMetadata(handle: number, connectionUri: string): Thenable<sqlops.ProviderMetadata> { throw ni(); }
|
||||
|
||||
$getDatabases(handle: number, connectionUri: string): Thenable<string[]> { throw ni(); }
|
||||
|
||||
$getTableInfo(handle: number, connectionUri: string, metadata: data.ObjectMetadata): Thenable<data.ColumnMetadata[]> { throw ni(); }
|
||||
$getTableInfo(handle: number, connectionUri: string, metadata: sqlops.ObjectMetadata): Thenable<sqlops.ColumnMetadata[]> { throw ni(); }
|
||||
|
||||
$getViewInfo(handle: number, connectionUri: string, metadata: data.ObjectMetadata): Thenable<data.ColumnMetadata[]> { throw ni(); }
|
||||
$getViewInfo(handle: number, connectionUri: string, metadata: sqlops.ObjectMetadata): Thenable<sqlops.ColumnMetadata[]> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Object Explorer
|
||||
*/
|
||||
$createObjectExplorerSession(handle: number, connInfo: data.ConnectionInfo): Thenable<data.ObjectExplorerSessionResponse> { throw ni(); }
|
||||
$createObjectExplorerSession(handle: number, connInfo: sqlops.ConnectionInfo): Thenable<sqlops.ObjectExplorerSessionResponse> { throw ni(); }
|
||||
|
||||
$expandObjectExplorerNode(handle: number, nodeInfo: data.ExpandNodeInfo): Thenable<boolean> { throw ni(); }
|
||||
$expandObjectExplorerNode(handle: number, nodeInfo: sqlops.ExpandNodeInfo): Thenable<boolean> { throw ni(); }
|
||||
|
||||
$refreshObjectExplorerNode(handle: number, nodeInfo: data.ExpandNodeInfo): Thenable<boolean> { throw ni(); }
|
||||
$refreshObjectExplorerNode(handle: number, nodeInfo: sqlops.ExpandNodeInfo): Thenable<boolean> { throw ni(); }
|
||||
|
||||
$closeObjectExplorerSession(handle: number, closeSessionInfo: data.ObjectExplorerCloseSessionInfo): Thenable<data.ObjectExplorerCloseSessionResponse> { throw ni(); }
|
||||
$closeObjectExplorerSession(handle: number, closeSessionInfo: sqlops.ObjectExplorerCloseSessionInfo): Thenable<sqlops.ObjectExplorerCloseSessionResponse> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Tasks
|
||||
*/
|
||||
$getAllTasks(handle: number, listTasksParams: data.ListTasksParams): Thenable<data.ListTasksResponse> { throw ni(); }
|
||||
$cancelTask(handle: number, cancelTaskParams: data.CancelTaskParams): Thenable<boolean> { throw ni(); }
|
||||
$getAllTasks(handle: number, listTasksParams: sqlops.ListTasksParams): Thenable<sqlops.ListTasksResponse> { throw ni(); }
|
||||
$cancelTask(handle: number, cancelTaskParams: sqlops.CancelTaskParams): Thenable<boolean> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Scripting methods
|
||||
*/
|
||||
$scriptAsOperation(handle: number, connectionUri: string, operation: data.ScriptOperation, metadata: data.ObjectMetadata, paramDetails: data.ScriptingParamDetails): Thenable<data.ScriptingResult> { throw ni(); }
|
||||
$scriptAsOperation(handle: number, connectionUri: string, operation: sqlops.ScriptOperation, metadata: sqlops.ObjectMetadata, paramDetails: sqlops.ScriptingParamDetails): Thenable<sqlops.ScriptingResult> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Cancels the currently running query for a URI
|
||||
*/
|
||||
$cancelQuery(handle: number, ownerUri: string): Thenable<data.QueryCancelResult> { throw ni(); }
|
||||
$cancelQuery(handle: number, ownerUri: string): Thenable<sqlops.QueryCancelResult> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Runs a query for a text selection inside a document
|
||||
*/
|
||||
$runQuery(handle: number, ownerUri: string, selection: data.ISelectionData, runOptions?: data.ExecutionPlanOptions): Thenable<void> { throw ni(); }
|
||||
$runQuery(handle: number, ownerUri: string, selection: sqlops.ISelectionData, runOptions?: sqlops.ExecutionPlanOptions): Thenable<void> { throw ni(); }
|
||||
/**
|
||||
* Runs the current SQL statement query for a text document
|
||||
*/
|
||||
@@ -129,11 +129,11 @@ export abstract class ExtHostDataProtocolShape {
|
||||
/**
|
||||
* Runs a query for a provided query and returns result
|
||||
*/
|
||||
$runQueryAndReturn(handle: number, ownerUri: string, queryString: string): Thenable<data.SimpleExecuteResult> { throw ni(); }
|
||||
$runQueryAndReturn(handle: number, ownerUri: string, queryString: string): Thenable<sqlops.SimpleExecuteResult> { throw ni(); }
|
||||
/**
|
||||
* Gets a subset of rows in a result set in order to display in the UI
|
||||
*/
|
||||
$getQueryRows(handle: number, rowData: data.QueryExecuteSubsetParams): Thenable<data.QueryExecuteSubsetResult> { throw ni(); }
|
||||
$getQueryRows(handle: number, rowData: sqlops.QueryExecuteSubsetParams): Thenable<sqlops.QueryExecuteSubsetResult> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Disposes the cached information regarding a query
|
||||
@@ -148,29 +148,29 @@ export abstract class ExtHostDataProtocolShape {
|
||||
/**
|
||||
* Callback when a query has completed
|
||||
*/
|
||||
$onQueryComplete(handle: number, result: data.QueryExecuteCompleteNotificationResult): void { throw ni(); }
|
||||
$onQueryComplete(handle: number, result: sqlops.QueryExecuteCompleteNotificationResult): void { throw ni(); }
|
||||
/**
|
||||
* Callback when a batch has started. This enables the UI to display when batch execution has started
|
||||
*/
|
||||
$onBatchStart(handle: number, batchInfo: data.QueryExecuteBatchNotificationParams): void { throw ni(); }
|
||||
$onBatchStart(handle: number, batchInfo: sqlops.QueryExecuteBatchNotificationParams): void { throw ni(); }
|
||||
/**
|
||||
* Callback when a batch is complete. This includes updated information on result sets, time to execute, and
|
||||
* other relevant batch information
|
||||
*/
|
||||
$onBatchComplete(handle: number, batchInfo: data.QueryExecuteBatchNotificationParams): void { throw ni(); }
|
||||
$onBatchComplete(handle: number, batchInfo: sqlops.QueryExecuteBatchNotificationParams): void { throw ni(); }
|
||||
/**
|
||||
* Callback when a result set has been returned from query execution and can be displayed
|
||||
*/
|
||||
$onResultSetComplete(handle: number, resultSetInfo: data.QueryExecuteResultSetCompleteNotificationParams): void { throw ni(); }
|
||||
$onResultSetComplete(handle: number, resultSetInfo: sqlops.QueryExecuteResultSetCompleteNotificationParams): void { throw ni(); }
|
||||
/**
|
||||
* Callback when a message generated during query execution is issued
|
||||
*/
|
||||
$onQueryMessage(handle: number, message: data.QueryExecuteMessageParams): void { throw ni(); }
|
||||
$onQueryMessage(handle: number, message: sqlops.QueryExecuteMessageParams): void { throw ni(); }
|
||||
|
||||
/**
|
||||
* Requests saving of the results from a result set into a specific format (CSV, JSON, Excel)
|
||||
*/
|
||||
$saveResults(handle: number, requestParams: data.SaveResultsRequestParams): Thenable<data.SaveResultRequestResult> { throw ni(); }
|
||||
$saveResults(handle: number, requestParams: sqlops.SaveResultsRequestParams): Thenable<sqlops.SaveResultRequestResult> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Commits all pending edits in an edit session
|
||||
@@ -180,7 +180,7 @@ export abstract class ExtHostDataProtocolShape {
|
||||
/**
|
||||
* Creates a new row in the edit session
|
||||
*/
|
||||
$createRow(handle: number, ownerUri: string): Thenable<data.EditCreateRowResult> { throw ni(); }
|
||||
$createRow(handle: number, ownerUri: string): Thenable<sqlops.EditCreateRowResult> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Marks the selected row for deletion in the edit session
|
||||
@@ -195,7 +195,7 @@ export abstract class ExtHostDataProtocolShape {
|
||||
/**
|
||||
* Reverts any pending changes for the requested cell and returns the original value
|
||||
*/
|
||||
$revertCell(handle: number, ownerUri: string, rowId: number, columnId: number): Thenable<data.EditRevertCellResult> { throw ni(); }
|
||||
$revertCell(handle: number, ownerUri: string, rowId: number, columnId: number): Thenable<sqlops.EditRevertCellResult> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Reverts any pending changes for the requested row
|
||||
@@ -205,12 +205,12 @@ export abstract class ExtHostDataProtocolShape {
|
||||
/**
|
||||
* Updates a cell value in the requested row. Returns if there are any corrections to the value
|
||||
*/
|
||||
$updateCell(handle: number, ownerUri: string, rowId: number, columId: number, newValue: string): Thenable<data.EditUpdateCellResult> { throw ni(); }
|
||||
$updateCell(handle: number, ownerUri: string, rowId: number, columId: number, newValue: string): Thenable<sqlops.EditUpdateCellResult> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Gets a subset of rows in a result set, merging pending edit changes in order to display in the UI
|
||||
*/
|
||||
$getEditRows(handle: number, rowData: data.EditSubsetParams): Thenable<data.EditSubsetResult> { throw ni(); }
|
||||
$getEditRows(handle: number, rowData: sqlops.EditSubsetParams): Thenable<sqlops.EditSubsetResult> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Diposes an initialized edit session and cleans up pending edits
|
||||
@@ -220,52 +220,52 @@ export abstract class ExtHostDataProtocolShape {
|
||||
/**
|
||||
* Create a new database on the provided connection
|
||||
*/
|
||||
$createDatabase(handle: number, connectionUri: string, database: data.DatabaseInfo): Thenable<data.CreateDatabaseResponse> { throw ni(); }
|
||||
$createDatabase(handle: number, connectionUri: string, database: sqlops.DatabaseInfo): Thenable<sqlops.CreateDatabaseResponse> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Get the default database prototype
|
||||
*/
|
||||
$getDefaultDatabaseInfo(handle: number, connectionUri: string): Thenable<data.DatabaseInfo> { throw ni(); }
|
||||
$getDefaultDatabaseInfo(handle: number, connectionUri: string): Thenable<sqlops.DatabaseInfo> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Get the database info
|
||||
*/
|
||||
$getDatabaseInfo(handle: number, connectionUri: string): Thenable<data.DatabaseInfo> { throw ni(); }
|
||||
$getDatabaseInfo(handle: number, connectionUri: string): Thenable<sqlops.DatabaseInfo> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Create a new login on the provided connection
|
||||
*/
|
||||
$createLogin(handle: number, connectionUri: string, login: data.LoginInfo): Thenable<data.CreateLoginResponse> { throw ni(); }
|
||||
$createLogin(handle: number, connectionUri: string, login: sqlops.LoginInfo): Thenable<sqlops.CreateLoginResponse> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Backup a database
|
||||
*/
|
||||
$backup(handle: number, connectionUri: string, backupInfo: { [key: string]: any }, taskExecutionMode: data.TaskExecutionMode): Thenable<data.BackupResponse> { throw ni(); }
|
||||
$backup(handle: number, connectionUri: string, backupInfo: { [key: string]: any }, taskExecutionMode: sqlops.TaskExecutionMode): Thenable<sqlops.BackupResponse> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Get the extended database prototype
|
||||
*/
|
||||
$getBackupConfigInfo(handle: number, connectionUri: string): Thenable<data.BackupConfigInfo> { throw ni(); }
|
||||
$getBackupConfigInfo(handle: number, connectionUri: string): Thenable<sqlops.BackupConfigInfo> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Restores a database
|
||||
*/
|
||||
$restore(handle: number, connectionUri: string, restoreInfo: data.RestoreInfo): Thenable<data.RestoreResponse> { throw ni(); }
|
||||
$restore(handle: number, connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable<sqlops.RestoreResponse> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Gets a plan for restoring a database
|
||||
*/
|
||||
$getRestorePlan(handle: number, connectionUri: string, restoreInfo: data.RestoreInfo): Thenable<data.RestorePlanResponse> { throw ni(); }
|
||||
$getRestorePlan(handle: number, connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable<sqlops.RestorePlanResponse> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Cancels a plan
|
||||
*/
|
||||
$cancelRestorePlan(handle: number, connectionUri: string, restoreInfo: data.RestoreInfo): Thenable<boolean> { throw ni(); }
|
||||
$cancelRestorePlan(handle: number, connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable<boolean> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Gets restore config Info
|
||||
*/
|
||||
$getRestoreConfigInfo(handle: number, connectionUri: string): Thenable<data.RestoreConfigInfo> { throw ni(); }
|
||||
$getRestoreConfigInfo(handle: number, connectionUri: string): Thenable<sqlops.RestoreConfigInfo> { throw ni(); }
|
||||
|
||||
|
||||
/**
|
||||
@@ -287,7 +287,7 @@ export abstract class ExtHostDataProtocolShape {
|
||||
/**
|
||||
* Close file browser
|
||||
*/
|
||||
$closeFileBrowser(handle: number, ownerUri: string): Thenable<data.FileBrowserCloseResponse> { throw ni(); }
|
||||
$closeFileBrowser(handle: number, ownerUri: string): Thenable<sqlops.FileBrowserCloseResponse> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Profiler Provider methods
|
||||
@@ -312,12 +312,12 @@ export abstract class ExtHostResourceProviderShape {
|
||||
/**
|
||||
* Create a firewall rule
|
||||
*/
|
||||
$createFirewallRule(handle: number, account: data.Account, firewallRuleInfo: data.FirewallRuleInfo): Thenable<data.CreateFirewallRuleResponse> { throw ni(); }
|
||||
$createFirewallRule(handle: number, account: sqlops.Account, firewallRuleInfo: sqlops.FirewallRuleInfo): Thenable<sqlops.CreateFirewallRuleResponse> { throw ni(); }
|
||||
|
||||
/**
|
||||
* Handle firewall rule
|
||||
*/
|
||||
$handleFirewallRule(handle: number, errorCode: number, errorMessage: string, connectionTypeId: string): Thenable<data.HandleFirewallRuleResponse> { throw ni(); }
|
||||
$handleFirewallRule(handle: number, errorCode: number, errorMessage: string, connectionTypeId: string): Thenable<sqlops.HandleFirewallRuleResponse> { throw ni(); }
|
||||
|
||||
}
|
||||
|
||||
@@ -327,7 +327,7 @@ export abstract class ExtHostResourceProviderShape {
|
||||
export abstract class ExtHostCredentialManagementShape {
|
||||
$saveCredential(credentialId: string, password: string): Thenable<boolean> { throw ni(); }
|
||||
|
||||
$readCredential(credentialId: string): Thenable<data.Credential> { throw ni(); }
|
||||
$readCredential(credentialId: string): Thenable<sqlops.Credential> { throw ni(); }
|
||||
|
||||
$deleteCredential(credentialId: string): Thenable<boolean> { throw ni(); }
|
||||
}
|
||||
@@ -336,21 +336,21 @@ export abstract class ExtHostCredentialManagementShape {
|
||||
* Serialization provider extension host class.
|
||||
*/
|
||||
export abstract class ExtHostSerializationProviderShape {
|
||||
$saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable<data.SaveResultRequestResult> { throw ni(); }
|
||||
$saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable<sqlops.SaveResultRequestResult> { throw ni(); }
|
||||
}
|
||||
|
||||
export interface MainThreadAccountManagementShape extends IDisposable {
|
||||
$registerAccountProvider(providerMetadata: data.AccountProviderMetadata, handle: number): Thenable<any>;
|
||||
$registerAccountProvider(providerMetadata: sqlops.AccountProviderMetadata, handle: number): Thenable<any>;
|
||||
$unregisterAccountProvider(handle: number): Thenable<any>;
|
||||
|
||||
$beginAutoOAuthDeviceCode(providerId: string, title: string, message: string, userCode: string, uri: string): Thenable<void>;
|
||||
$endAutoOAuthDeviceCode(): void;
|
||||
|
||||
$accountUpdated(updatedAccount: data.Account): void;
|
||||
$accountUpdated(updatedAccount: sqlops.Account): void;
|
||||
}
|
||||
|
||||
export interface MainThreadResourceProviderShape extends IDisposable {
|
||||
$registerResourceProvider(providerMetadata: data.ResourceProviderMetadata, handle: number): Thenable<any>;
|
||||
$registerResourceProvider(providerMetadata: sqlops.ResourceProviderMetadata, handle: number): Thenable<any>;
|
||||
$unregisterResourceProvider(handle: number): Thenable<any>;
|
||||
}
|
||||
|
||||
@@ -368,23 +368,23 @@ export interface MainThreadDataProtocolShape extends IDisposable {
|
||||
$registerCapabilitiesServiceProvider(providerId: string, handle: number): TPromise<any>;
|
||||
$registerAdminServicesProvider(providerId: string, handle: number): TPromise<any>;
|
||||
$unregisterProvider(handle: number): TPromise<any>;
|
||||
$onConnectionComplete(handle: number, connectionInfoSummary: data.ConnectionInfoSummary): void;
|
||||
$onConnectionComplete(handle: number, connectionInfoSummary: sqlops.ConnectionInfoSummary): void;
|
||||
$onIntelliSenseCacheComplete(handle: number, connectionUri: string): void;
|
||||
$onConnectionChangeNotification(handle: number, changedConnInfo: data.ChangedConnectionInfo): void;
|
||||
$onQueryComplete(handle: number, result: data.QueryExecuteCompleteNotificationResult): void;
|
||||
$onBatchStart(handle: number, batchInfo: data.QueryExecuteBatchNotificationParams): void;
|
||||
$onBatchComplete(handle: number, batchInfo: data.QueryExecuteBatchNotificationParams): void;
|
||||
$onResultSetComplete(handle: number, resultSetInfo: data.QueryExecuteResultSetCompleteNotificationParams): void;
|
||||
$onQueryMessage(handle: number, message: data.QueryExecuteMessageParams): void;
|
||||
$onObjectExplorerSessionCreated(handle: number, message: data.ObjectExplorerSession): void;
|
||||
$onObjectExplorerNodeExpanded(handle: number, message: data.ObjectExplorerExpandInfo): void;
|
||||
$onTaskCreated(handle: number, sessionResponse: data.TaskInfo): void;
|
||||
$onTaskStatusChanged(handle: number, sessionResponse: data.TaskProgressInfo): void;
|
||||
$onFileBrowserOpened(handle: number, response: data.FileBrowserOpenedParams): void;
|
||||
$onFolderNodeExpanded(handle: number, response: data.FileBrowserExpandedParams): void;
|
||||
$onFilePathsValidated(handle: number, response: data.FileBrowserValidatedParams): void;
|
||||
$onScriptingComplete(handle: number, message: data.ScriptingCompleteResult): void;
|
||||
$onSessionEventsAvailable(handle: number, response: data.ProfilerSessionEvents): void;
|
||||
$onConnectionChangeNotification(handle: number, changedConnInfo: sqlops.ChangedConnectionInfo): void;
|
||||
$onQueryComplete(handle: number, result: sqlops.QueryExecuteCompleteNotificationResult): void;
|
||||
$onBatchStart(handle: number, batchInfo: sqlops.QueryExecuteBatchNotificationParams): void;
|
||||
$onBatchComplete(handle: number, batchInfo: sqlops.QueryExecuteBatchNotificationParams): void;
|
||||
$onResultSetComplete(handle: number, resultSetInfo: sqlops.QueryExecuteResultSetCompleteNotificationParams): void;
|
||||
$onQueryMessage(handle: number, message: sqlops.QueryExecuteMessageParams): void;
|
||||
$onObjectExplorerSessionCreated(handle: number, message: sqlops.ObjectExplorerSession): void;
|
||||
$onObjectExplorerNodeExpanded(handle: number, message: sqlops.ObjectExplorerExpandInfo): void;
|
||||
$onTaskCreated(handle: number, sessionResponse: sqlops.TaskInfo): void;
|
||||
$onTaskStatusChanged(handle: number, sessionResponse: sqlops.TaskProgressInfo): void;
|
||||
$onFileBrowserOpened(handle: number, response: sqlops.FileBrowserOpenedParams): void;
|
||||
$onFolderNodeExpanded(handle: number, response: sqlops.FileBrowserExpandedParams): void;
|
||||
$onFilePathsValidated(handle: number, response: sqlops.FileBrowserValidatedParams): void;
|
||||
$onScriptingComplete(handle: number, message: sqlops.ScriptingCompleteResult): void;
|
||||
$onSessionEventsAvailable(handle: number, response: sqlops.ProfilerSessionEvents): void;
|
||||
|
||||
/**
|
||||
* Callback when a session has completed initialization
|
||||
@@ -393,8 +393,8 @@ export interface MainThreadDataProtocolShape extends IDisposable {
|
||||
}
|
||||
|
||||
export interface MainThreadConnectionManagementShape extends IDisposable {
|
||||
$getActiveConnections(): Thenable<data.connection.Connection[]>;
|
||||
$getCurrentConnection(): Thenable<data.connection.Connection>;
|
||||
$getActiveConnections(): Thenable<sqlops.connection.Connection[]>;
|
||||
$getCurrentConnection(): Thenable<sqlops.connection.Connection>;
|
||||
$getCredentials(connectionId: string): Thenable<{ [name: string]: string }>;
|
||||
}
|
||||
|
||||
@@ -450,10 +450,10 @@ export interface ExtHostModalDialogsShape {
|
||||
}
|
||||
|
||||
export interface ExtHostDashboardWebviewsShape {
|
||||
$registerProvider(widgetId: string, handler: (webview: data.DashboardWebview) => void): void;
|
||||
$registerProvider(widgetId: string, handler: (webview: sqlops.DashboardWebview) => void): void;
|
||||
$onMessage(handle: number, message: any): void;
|
||||
$onClosed(handle: number): void;
|
||||
$registerWidget(handle: number, id: string, connection: data.connection.Connection, serverInfo: data.ServerInfo): void;
|
||||
$registerWidget(handle: number, id: string, connection: sqlops.connection.Connection, serverInfo: sqlops.ServerInfo): void;
|
||||
}
|
||||
|
||||
export interface MainThreadDashboardWebviewShape extends IDisposable {
|
||||
|
||||
@@ -15,7 +15,7 @@ import { IAngularEventingService, AngularEventType } from 'sql/services/angularE
|
||||
import { IInsightsDialogService } from 'sql/parts/insights/common/interfaces';
|
||||
import { IAdminService } from 'sql/parts/admin/common/adminService';
|
||||
import * as Constants from 'sql/common/constants';
|
||||
import { ObjectMetadata } from 'data';
|
||||
import { ObjectMetadata } from 'sqlops';
|
||||
import { ScriptOperation } from 'sql/workbench/common/taskUtilities';
|
||||
import { TaskAction } from 'sql/platform/tasks/taskRegistry';
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import { IInsightsConfig } from 'sql/parts/dashboard/widgets/insights/interfaces
|
||||
import { IInsightsDialogService } from 'sql/parts/insights/common/interfaces';
|
||||
import { ConnectionManagementInfo } from 'sql/parts/connection/common/connectionManagementInfo';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import nls = require('vs/nls');
|
||||
import os = require('os');
|
||||
import path = require('path');
|
||||
@@ -134,10 +134,10 @@ export function connectIfNotAlreadyConnected(connectionProfile: IConnectionProfi
|
||||
/**
|
||||
* Select the top rows from an object
|
||||
*/
|
||||
export function scriptSelect(connectionProfile: IConnectionProfile, metadata: data.ObjectMetadata, connectionService: IConnectionManagementService, queryEditorService: IQueryEditorService, scriptingService: IScriptingService): Promise<void> {
|
||||
export function scriptSelect(connectionProfile: IConnectionProfile, metadata: sqlops.ObjectMetadata, connectionService: IConnectionManagementService, queryEditorService: IQueryEditorService, scriptingService: IScriptingService): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
connectionService.connectIfNotConnected(connectionProfile).then(connectionResult => {
|
||||
let paramDetails: data.ScriptingParamDetails = getScriptingParamDetails(connectionService, connectionResult, metadata);
|
||||
let paramDetails: sqlops.ScriptingParamDetails = getScriptingParamDetails(connectionService, connectionResult, metadata);
|
||||
scriptingService.script(connectionResult, metadata, ScriptOperation.Select, paramDetails).then(result => {
|
||||
if (result.script) {
|
||||
queryEditorService.newSqlEditor(result.script).then((owner: IConnectableInput) => {
|
||||
@@ -190,7 +190,7 @@ export function editData(connectionProfile: IConnectionProfile, tableName: strin
|
||||
/**
|
||||
* Script the object as a statement based on the provided action (except Select)
|
||||
*/
|
||||
export function script(connectionProfile: IConnectionProfile, metadata: data.ObjectMetadata,
|
||||
export function script(connectionProfile: IConnectionProfile, metadata: sqlops.ObjectMetadata,
|
||||
connectionService: IConnectionManagementService,
|
||||
queryEditorService: IQueryEditorService,
|
||||
scriptingService: IScriptingService,
|
||||
@@ -402,9 +402,9 @@ function getStartPos(script: string, operation: ScriptOperation, typeName: strin
|
||||
}
|
||||
|
||||
|
||||
function getScriptingParamDetails(connectionService: IConnectionManagementService, ownerUri: string, metadata: data.ObjectMetadata): data.ScriptingParamDetails {
|
||||
let serverInfo: data.ServerInfo = getServerInfo(connectionService, ownerUri);
|
||||
let paramDetails: data.ScriptingParamDetails = {
|
||||
function getScriptingParamDetails(connectionService: IConnectionManagementService, ownerUri: string, metadata: sqlops.ObjectMetadata): sqlops.ScriptingParamDetails {
|
||||
let serverInfo: sqlops.ServerInfo = getServerInfo(connectionService, ownerUri);
|
||||
let paramDetails: sqlops.ScriptingParamDetails = {
|
||||
filePath: getFilePath(metadata),
|
||||
scriptCompatibilityOption: scriptCompatibilityOptionMap[serverInfo.serverMajorVersion],
|
||||
targetDatabaseEngineEdition: targetDatabaseEngineEditionMap[serverInfo.engineEditionId],
|
||||
@@ -413,7 +413,7 @@ function getScriptingParamDetails(connectionService: IConnectionManagementServic
|
||||
return paramDetails;
|
||||
}
|
||||
|
||||
function getFilePath(metadata: data.ObjectMetadata): string {
|
||||
function getFilePath(metadata: sqlops.ObjectMetadata): string {
|
||||
let schemaName: string = metadata.schema;
|
||||
let objectName: string = metadata.name;
|
||||
let timestamp = Date.now().toString();
|
||||
@@ -424,7 +424,7 @@ function getFilePath(metadata: data.ObjectMetadata): string {
|
||||
}
|
||||
}
|
||||
|
||||
function getServerInfo(connectionService: IConnectionManagementService, ownerUri: string): data.ServerInfo {
|
||||
function getServerInfo(connectionService: IConnectionManagementService, ownerUri: string): sqlops.ServerInfo {
|
||||
let connection: ConnectionManagementInfo = connectionService.getConnectionInfo(ownerUri);
|
||||
return connection.serverInfo;
|
||||
}
|
||||
Reference in New Issue
Block a user