mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Update product references from 'sqlops' to 'azdata' (#4259)
* Update extensions to use azdata * Switch core code to use azdata
This commit is contained in:
@@ -1,26 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
export class AgentUtils {
|
||||
|
||||
private static _agentService: sqlops.AgentServicesProvider;
|
||||
private static _connectionService: sqlops.ConnectionProvider;
|
||||
private static _queryProvider: sqlops.QueryProvider;
|
||||
private static _agentService: azdata.AgentServicesProvider;
|
||||
private static _connectionService: azdata.ConnectionProvider;
|
||||
private static _queryProvider: azdata.QueryProvider;
|
||||
|
||||
public static async getAgentService(): Promise<sqlops.AgentServicesProvider> {
|
||||
public static async getAgentService(): Promise<azdata.AgentServicesProvider> {
|
||||
if (!AgentUtils._agentService) {
|
||||
let currentConnection = await azdata.connection.getCurrentConnection();
|
||||
this._agentService = sqlops.dataprotocol.getProvider<sqlops.AgentServicesProvider>(currentConnection.providerId, sqlops.DataProviderType.AgentServicesProvider);
|
||||
this._agentService = azdata.dataprotocol.getProvider<azdata.AgentServicesProvider>(currentConnection.providerId, azdata.DataProviderType.AgentServicesProvider);
|
||||
}
|
||||
return AgentUtils._agentService;
|
||||
}
|
||||
|
||||
public static async getDatabases(ownerUri: string): Promise<string[]> {
|
||||
if (!AgentUtils._connectionService) {
|
||||
let currentConnection = await sqlops.connection.getCurrentConnection();
|
||||
this._connectionService = sqlops.dataprotocol.getProvider<sqlops.ConnectionProvider>(currentConnection.providerName, sqlops.DataProviderType.ConnectionProvider);
|
||||
let currentConnection = await azdata.connection.getCurrentConnection();
|
||||
this._connectionService = azdata.dataprotocol.getProvider<azdata.ConnectionProvider>(currentConnection.providerId, azdata.DataProviderType.ConnectionProvider);
|
||||
}
|
||||
return AgentUtils._connectionService.listDatabases(ownerUri).then(result => {
|
||||
if (result && result.databaseNames && result.databaseNames.length > 0) {
|
||||
@@ -29,10 +28,10 @@ export class AgentUtils {
|
||||
});
|
||||
}
|
||||
|
||||
public static async getQueryProvider(): Promise<sqlops.QueryProvider> {
|
||||
public static async getQueryProvider(): Promise<azdata.QueryProvider> {
|
||||
if (!AgentUtils._queryProvider) {
|
||||
let currentConnection = await sqlops.connection.getCurrentConnection();
|
||||
this._queryProvider = sqlops.dataprotocol.getProvider<sqlops.QueryProvider>(currentConnection.providerName, sqlops.DataProviderType.QueryProvider);
|
||||
let currentConnection = await azdata.connection.getCurrentConnection();
|
||||
this._queryProvider = azdata.dataprotocol.getProvider<azdata.QueryProvider>(currentConnection.providerId, azdata.DataProviderType.QueryProvider);
|
||||
}
|
||||
return this._queryProvider;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
import * as vscode from 'vscode';
|
||||
import * as data from 'sqlops';
|
||||
import * as data from 'azdata';
|
||||
|
||||
/**
|
||||
* Wrapper class to act as a facade over VSCode and Data APIs and allow us to test / mock callbacks into
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as vscode from 'vscode';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { AgentUtils } from '../agentUtils';
|
||||
import { IAgentDialogData, AgentDialogMode } from '../interfaces';
|
||||
import { JobData } from './jobData';
|
||||
@@ -51,7 +51,7 @@ export class AlertData implements IAgentDialogData {
|
||||
|
||||
constructor(
|
||||
ownerUri:string,
|
||||
alertInfo: sqlops.AgentAlertInfo,
|
||||
alertInfo: azdata.AgentAlertInfo,
|
||||
jobModel?: JobData,
|
||||
viaJobDialog: boolean = false
|
||||
) {
|
||||
@@ -111,7 +111,7 @@ export class AlertData implements IAgentDialogData {
|
||||
}
|
||||
}
|
||||
|
||||
public toAgentAlertInfo(): sqlops.AgentAlertInfo {
|
||||
public toAgentAlertInfo(): azdata.AgentAlertInfo {
|
||||
return {
|
||||
id: this.id,
|
||||
name: this.name,
|
||||
@@ -119,7 +119,7 @@ export class AlertData implements IAgentDialogData {
|
||||
eventDescriptionKeyword: this.eventDescriptionKeyword,
|
||||
eventSource: this.eventSource,
|
||||
hasNotification: this.hasNotification,
|
||||
includeEventDescription: sqlops.NotifyMethods.none, // this.includeEventDescription,
|
||||
includeEventDescription: azdata.NotifyMethods.none, // this.includeEventDescription,
|
||||
isEnabled: this.isEnabled,
|
||||
jobId: this.jobId,
|
||||
jobName: this.jobName,
|
||||
@@ -139,13 +139,13 @@ export class AlertData implements IAgentDialogData {
|
||||
};
|
||||
}
|
||||
|
||||
private static getAlertTypeFromString(alertTypeString: string): sqlops.AlertType {
|
||||
private static getAlertTypeFromString(alertTypeString: string): azdata.AlertType {
|
||||
if (alertTypeString === AlertData.AlertTypePerformanceConditionString) {
|
||||
return sqlops.AlertType.sqlServerPerformanceCondition;
|
||||
return azdata.AlertType.sqlServerPerformanceCondition;
|
||||
} else if (alertTypeString === AlertData.AlertTypeWmiEventString) {
|
||||
return sqlops.AlertType.wmiEvent;
|
||||
return azdata.AlertType.wmiEvent;
|
||||
} else {
|
||||
return sqlops.AlertType.sqlServerEvent;
|
||||
return azdata.AlertType.sqlServerEvent;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { AgentUtils } from '../agentUtils';
|
||||
import { IAgentDialogData, AgentDialogMode } from '../interfaces';
|
||||
@@ -25,8 +25,8 @@ export class JobData implements IAgentDialogData {
|
||||
private _jobCategories: string[];
|
||||
private _operators: string[];
|
||||
private _defaultOwner: string;
|
||||
private _jobCompletionActionConditions: sqlops.CategoryValue[];
|
||||
private _jobCategoryIdsMap: sqlops.AgentJobCategory[];
|
||||
private _jobCompletionActionConditions: azdata.CategoryValue[];
|
||||
private _jobCategoryIdsMap: azdata.AgentJobCategory[];
|
||||
|
||||
public dialogMode: AgentDialogMode = AgentDialogMode.CREATE;
|
||||
public name: string;
|
||||
@@ -36,23 +36,23 @@ export class JobData implements IAgentDialogData {
|
||||
public category: string;
|
||||
public categoryId: number;
|
||||
public owner: string;
|
||||
public emailLevel: sqlops.JobCompletionActionCondition = sqlops.JobCompletionActionCondition.OnFailure;
|
||||
public pageLevel: sqlops.JobCompletionActionCondition = sqlops.JobCompletionActionCondition.OnFailure;
|
||||
public eventLogLevel: sqlops.JobCompletionActionCondition = sqlops.JobCompletionActionCondition.OnFailure;
|
||||
public deleteLevel: sqlops.JobCompletionActionCondition = sqlops.JobCompletionActionCondition.OnSuccess;
|
||||
public emailLevel: azdata.JobCompletionActionCondition = azdata.JobCompletionActionCondition.OnFailure;
|
||||
public pageLevel: azdata.JobCompletionActionCondition = azdata.JobCompletionActionCondition.OnFailure;
|
||||
public eventLogLevel: azdata.JobCompletionActionCondition = azdata.JobCompletionActionCondition.OnFailure;
|
||||
public deleteLevel: azdata.JobCompletionActionCondition = azdata.JobCompletionActionCondition.OnSuccess;
|
||||
public operatorToEmail: string;
|
||||
public operatorToPage: string;
|
||||
public jobSteps: sqlops.AgentJobStepInfo[];
|
||||
public jobSchedules: sqlops.AgentJobScheduleInfo[];
|
||||
public alerts: sqlops.AgentAlertInfo[];
|
||||
public jobSteps: azdata.AgentJobStepInfo[];
|
||||
public jobSchedules: azdata.AgentJobScheduleInfo[];
|
||||
public alerts: azdata.AgentAlertInfo[];
|
||||
public jobId: string;
|
||||
public startStepId: number;
|
||||
public categoryType: number;
|
||||
|
||||
constructor(
|
||||
ownerUri: string,
|
||||
jobInfo: sqlops.AgentJobInfo = undefined,
|
||||
private _agentService: sqlops.AgentServicesProvider = undefined) {
|
||||
jobInfo: azdata.AgentJobInfo = undefined,
|
||||
private _agentService: azdata.AgentServicesProvider = undefined) {
|
||||
|
||||
this._ownerUri = ownerUri;
|
||||
if (jobInfo) {
|
||||
@@ -77,7 +77,7 @@ export class JobData implements IAgentDialogData {
|
||||
return this._jobCategories;
|
||||
}
|
||||
|
||||
public get jobCategoryIdsMap(): sqlops.AgentJobCategory[] {
|
||||
public get jobCategoryIdsMap(): azdata.AgentJobCategory[] {
|
||||
return this._jobCategoryIdsMap;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ export class JobData implements IAgentDialogData {
|
||||
return this._defaultOwner;
|
||||
}
|
||||
|
||||
public get JobCompletionActionConditions(): sqlops.CategoryValue[] {
|
||||
public get JobCompletionActionConditions(): azdata.CategoryValue[] {
|
||||
return this._jobCompletionActionConditions;
|
||||
}
|
||||
|
||||
@@ -112,18 +112,18 @@ export class JobData implements IAgentDialogData {
|
||||
|
||||
this._jobCompletionActionConditions = [{
|
||||
displayName: this.JobCompletionActionCondition_OnSuccess,
|
||||
name: sqlops.JobCompletionActionCondition.OnSuccess.toString()
|
||||
name: azdata.JobCompletionActionCondition.OnSuccess.toString()
|
||||
}, {
|
||||
displayName: this.JobCompletionActionCondition_OnFailure,
|
||||
name: sqlops.JobCompletionActionCondition.OnFailure.toString()
|
||||
name: azdata.JobCompletionActionCondition.OnFailure.toString()
|
||||
}, {
|
||||
displayName: this.JobCompletionActionCondition_Always,
|
||||
name: sqlops.JobCompletionActionCondition.Always.toString()
|
||||
name: azdata.JobCompletionActionCondition.Always.toString()
|
||||
}];
|
||||
}
|
||||
|
||||
public async save() {
|
||||
let jobInfo: sqlops.AgentJobInfo = this.toAgentJobInfo();
|
||||
let jobInfo: azdata.AgentJobInfo = this.toAgentJobInfo();
|
||||
let result = this.dialogMode === AgentDialogMode.CREATE
|
||||
? await this._agentService.createJob(this.ownerUri, jobInfo)
|
||||
: await this._agentService.updateJob(this.ownerUri, this.originalName, jobInfo);
|
||||
@@ -146,7 +146,7 @@ export class JobData implements IAgentDialogData {
|
||||
};
|
||||
}
|
||||
|
||||
public toAgentJobInfo(): sqlops.AgentJobInfo {
|
||||
public toAgentJobInfo(): azdata.AgentJobInfo {
|
||||
return {
|
||||
name: this.name,
|
||||
owner: this.owner,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as vscode from 'vscode';
|
||||
import { AgentUtils } from '../agentUtils';
|
||||
@@ -95,7 +95,7 @@ export class JobStepData implements IAgentDialogData {
|
||||
};
|
||||
}
|
||||
|
||||
public static convertToJobStepData(jobStepInfo: sqlops.AgentJobStepInfo, jobData: JobData) {
|
||||
public static convertToJobStepData(jobStepInfo: azdata.AgentJobStepInfo, jobData: JobData) {
|
||||
let stepData = new JobStepData(jobData.ownerUri, jobData);
|
||||
stepData.ownerUri = jobData.ownerUri;
|
||||
stepData.jobId = jobStepInfo.jobId;
|
||||
@@ -127,8 +127,8 @@ export class JobStepData implements IAgentDialogData {
|
||||
return stepData;
|
||||
}
|
||||
|
||||
public static convertToAgentJobStepInfo(jobStepData: JobStepData): sqlops.AgentJobStepInfo {
|
||||
let result: sqlops.AgentJobStepInfo = {
|
||||
public static convertToAgentJobStepInfo(jobStepData: JobStepData): azdata.AgentJobStepInfo {
|
||||
let result: azdata.AgentJobStepInfo = {
|
||||
jobId: jobStepData.jobId,
|
||||
jobName: jobStepData.jobName,
|
||||
script: jobStepData.script,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { AgentUtils } from '../agentUtils';
|
||||
import { IAgentDialogData, AgentDialogMode } from '../interfaces';
|
||||
|
||||
@@ -29,7 +29,7 @@ export class OperatorData implements IAgentDialogData {
|
||||
weekdayPagerStartTime: string;
|
||||
weekdayPagerEndTime: string;
|
||||
|
||||
constructor(ownerUri:string, operatorInfo: sqlops.AgentOperatorInfo) {
|
||||
constructor(ownerUri:string, operatorInfo: azdata.AgentOperatorInfo) {
|
||||
this.ownerUri = ownerUri;
|
||||
|
||||
if (operatorInfo) {
|
||||
@@ -50,7 +50,7 @@ export class OperatorData implements IAgentDialogData {
|
||||
}
|
||||
}
|
||||
|
||||
public toAgentOperatorInfo(): sqlops.AgentOperatorInfo {
|
||||
public toAgentOperatorInfo(): azdata.AgentOperatorInfo {
|
||||
return {
|
||||
name: this.name,
|
||||
id: this.id,
|
||||
@@ -61,7 +61,7 @@ export class OperatorData implements IAgentDialogData {
|
||||
lastPagerDate: this.lastPagerDate,
|
||||
pagerAddress: this.pagerAddress,
|
||||
categoryName: this.categoryName,
|
||||
pagerDays: sqlops.WeekDays.weekDays, //this.pagerDays,
|
||||
pagerDays: azdata.WeekDays.weekDays, //this.pagerDays,
|
||||
saturdayPagerEndTime: this.saturdayPagerEndTime,
|
||||
saturdayPagerStartTime: this.saturdayPagerStartTime,
|
||||
sundayPagerEndTime: this.sundayPagerEndTime,
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { AgentUtils } from '../agentUtils';
|
||||
import { IAgentDialogData, AgentDialogMode } from '../interfaces';
|
||||
|
||||
export class PickScheduleData implements IAgentDialogData {
|
||||
public dialogMode: AgentDialogMode = AgentDialogMode.VIEW;
|
||||
public ownerUri: string;
|
||||
public schedules: sqlops.AgentJobScheduleInfo[];
|
||||
public selectedSchedule: sqlops.AgentJobScheduleInfo;
|
||||
public schedules: azdata.AgentJobScheduleInfo[];
|
||||
public selectedSchedule: azdata.AgentJobScheduleInfo;
|
||||
private jobName: string;
|
||||
|
||||
constructor(ownerUri:string, jobName: string) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { AgentUtils } from '../agentUtils';
|
||||
import { IAgentDialogData, AgentDialogMode } from '../interfaces';
|
||||
|
||||
@@ -19,7 +19,7 @@ export class ProxyData implements IAgentDialogData {
|
||||
credentialId: number;
|
||||
isEnabled: boolean;
|
||||
|
||||
constructor(ownerUri:string, proxyInfo: sqlops.AgentProxyInfo) {
|
||||
constructor(ownerUri:string, proxyInfo: azdata.AgentProxyInfo) {
|
||||
this.ownerUri = ownerUri;
|
||||
|
||||
if (proxyInfo) {
|
||||
@@ -40,7 +40,7 @@ export class ProxyData implements IAgentDialogData {
|
||||
}
|
||||
}
|
||||
|
||||
public toAgentProxyInfo(): sqlops.AgentProxyInfo {
|
||||
public toAgentProxyInfo(): azdata.AgentProxyInfo {
|
||||
return {
|
||||
id: this.id,
|
||||
accountName: this.accountName,
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { AgentUtils } from '../agentUtils';
|
||||
import { IAgentDialogData, AgentDialogMode } from '../interfaces';
|
||||
|
||||
export class ScheduleData implements IAgentDialogData {
|
||||
public dialogMode: AgentDialogMode = AgentDialogMode.CREATE;
|
||||
public ownerUri: string;
|
||||
public schedules: sqlops.AgentJobScheduleInfo[];
|
||||
public selectedSchedule: sqlops.AgentJobScheduleInfo;
|
||||
public schedules: azdata.AgentJobScheduleInfo[];
|
||||
public selectedSchedule: azdata.AgentJobScheduleInfo;
|
||||
|
||||
constructor(ownerUri:string) {
|
||||
this.ownerUri = ownerUri;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { IAgentDialogData, AgentDialogMode } from '../interfaces';
|
||||
|
||||
@@ -18,7 +18,7 @@ export abstract class AgentDialog<T extends IAgentDialogData> {
|
||||
|
||||
protected _onSuccess: vscode.EventEmitter<T> = new vscode.EventEmitter<T>();
|
||||
public readonly onSuccess: vscode.Event<T> = this._onSuccess.event;
|
||||
public dialog: sqlops.window.Dialog;
|
||||
public dialog: azdata.window.Dialog;
|
||||
|
||||
// Dialog Name for Telemetry
|
||||
public dialogName: string;
|
||||
@@ -32,11 +32,11 @@ export abstract class AgentDialog<T extends IAgentDialogData> {
|
||||
|
||||
protected abstract async updateModel();
|
||||
|
||||
protected abstract async initializeDialog(dialog: sqlops.window.Dialog);
|
||||
protected abstract async initializeDialog(dialog: azdata.window.Dialog);
|
||||
|
||||
public async openDialog(dialogName?: string) {
|
||||
let event = dialogName ? dialogName : null;
|
||||
this.dialog = sqlops.window.createModelViewDialog(this.title, event);
|
||||
this.dialog = azdata.window.createModelViewDialog(this.title, event);
|
||||
|
||||
await this.model.initialize();
|
||||
|
||||
@@ -48,7 +48,7 @@ export abstract class AgentDialog<T extends IAgentDialogData> {
|
||||
this.dialog.cancelButton.label = AgentDialog.CancelButtonText;
|
||||
this.dialog.cancelButton.onClick(async () => await this.cancel());
|
||||
|
||||
sqlops.window.openDialog(this.dialog);
|
||||
azdata.window.openDialog(this.dialog);
|
||||
}
|
||||
|
||||
protected async execute() {
|
||||
@@ -60,18 +60,18 @@ export abstract class AgentDialog<T extends IAgentDialogData> {
|
||||
protected async cancel() {
|
||||
}
|
||||
|
||||
protected getActualConditionValue(checkbox: sqlops.CheckBoxComponent, dropdown: sqlops.DropDownComponent): sqlops.JobCompletionActionCondition {
|
||||
return checkbox.checked ? Number(this.getDropdownValue(dropdown)) : sqlops.JobCompletionActionCondition.Never;
|
||||
protected getActualConditionValue(checkbox: azdata.CheckBoxComponent, dropdown: azdata.DropDownComponent): azdata.JobCompletionActionCondition {
|
||||
return checkbox.checked ? Number(this.getDropdownValue(dropdown)) : azdata.JobCompletionActionCondition.Never;
|
||||
}
|
||||
|
||||
protected getDropdownValue(dropdown: sqlops.DropDownComponent): string {
|
||||
protected getDropdownValue(dropdown: azdata.DropDownComponent): string {
|
||||
return (typeof dropdown.value === 'string') ? dropdown.value : dropdown.value.name;
|
||||
}
|
||||
|
||||
protected setConditionDropdownSelectedValue(dropdown: sqlops.DropDownComponent, selectedValue: number) {
|
||||
protected setConditionDropdownSelectedValue(dropdown: azdata.DropDownComponent, selectedValue: number) {
|
||||
let idx: number = 0;
|
||||
for (idx = 0; idx < dropdown.values.length; idx++) {
|
||||
if (Number((<sqlops.CategoryValue>dropdown.values[idx]).name) === selectedValue) {
|
||||
if (Number((<azdata.CategoryValue>dropdown.values[idx]).name) === selectedValue) {
|
||||
dropdown.value = dropdown.values[idx];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { AgentDialog } from './agentDialog';
|
||||
import { AgentUtils } from '../agentUtils';
|
||||
import { AlertData } from '../data/alertData';
|
||||
@@ -121,37 +121,37 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
||||
private readonly EditAlertDialog = 'EditAlertDialogOpened';
|
||||
|
||||
// UI Components
|
||||
private generalTab: sqlops.window.DialogTab;
|
||||
private responseTab: sqlops.window.DialogTab;
|
||||
private optionsTab: sqlops.window.DialogTab;
|
||||
private generalTab: azdata.window.DialogTab;
|
||||
private responseTab: azdata.window.DialogTab;
|
||||
private optionsTab: azdata.window.DialogTab;
|
||||
|
||||
// General tab controls
|
||||
private nameTextBox: sqlops.InputBoxComponent;
|
||||
private typeDropDown: sqlops.DropDownComponent;
|
||||
private severityDropDown: sqlops.DropDownComponent;
|
||||
private databaseDropDown: sqlops.DropDownComponent;
|
||||
private enabledCheckBox: sqlops.CheckBoxComponent;
|
||||
private errorNumberRadioButton: sqlops.RadioButtonComponent;
|
||||
private severityRadioButton: sqlops.RadioButtonComponent;
|
||||
private errorNumberTextBox: sqlops.InputBoxComponent;
|
||||
private nameTextBox: azdata.InputBoxComponent;
|
||||
private typeDropDown: azdata.DropDownComponent;
|
||||
private severityDropDown: azdata.DropDownComponent;
|
||||
private databaseDropDown: azdata.DropDownComponent;
|
||||
private enabledCheckBox: azdata.CheckBoxComponent;
|
||||
private errorNumberRadioButton: azdata.RadioButtonComponent;
|
||||
private severityRadioButton: azdata.RadioButtonComponent;
|
||||
private errorNumberTextBox: azdata.InputBoxComponent;
|
||||
|
||||
private raiseAlertMessageCheckBox: sqlops.CheckBoxComponent;
|
||||
private raiseAlertMessageTextBox: sqlops.InputBoxComponent;
|
||||
private raiseAlertMessageCheckBox: azdata.CheckBoxComponent;
|
||||
private raiseAlertMessageTextBox: azdata.InputBoxComponent;
|
||||
|
||||
// Response tab controls
|
||||
private executeJobTextBox: sqlops.InputBoxComponent;
|
||||
private executeJobCheckBox: sqlops.CheckBoxComponent;
|
||||
private newJobButton: sqlops.ButtonComponent;
|
||||
private notifyOperatorsCheckBox: sqlops.CheckBoxComponent;
|
||||
private operatorsTable: sqlops.TableComponent;
|
||||
private newOperatorButton: sqlops.ButtonComponent;
|
||||
private executeJobTextBox: azdata.InputBoxComponent;
|
||||
private executeJobCheckBox: azdata.CheckBoxComponent;
|
||||
private newJobButton: azdata.ButtonComponent;
|
||||
private notifyOperatorsCheckBox: azdata.CheckBoxComponent;
|
||||
private operatorsTable: azdata.TableComponent;
|
||||
private newOperatorButton: azdata.ButtonComponent;
|
||||
|
||||
// Options tab controls
|
||||
private additionalMessageTextBox: sqlops.InputBoxComponent;
|
||||
private includeErrorInEmailTextBox: sqlops.CheckBoxComponent;
|
||||
private includeErrorInPagerTextBox: sqlops.CheckBoxComponent;
|
||||
private delayMinutesTextBox: sqlops.InputBoxComponent;
|
||||
private delaySecondsTextBox: sqlops.InputBoxComponent;
|
||||
private additionalMessageTextBox: azdata.InputBoxComponent;
|
||||
private includeErrorInEmailTextBox: azdata.CheckBoxComponent;
|
||||
private includeErrorInPagerTextBox: azdata.CheckBoxComponent;
|
||||
private delayMinutesTextBox: azdata.InputBoxComponent;
|
||||
private delaySecondsTextBox: azdata.InputBoxComponent;
|
||||
|
||||
private isEdit: boolean = false;
|
||||
private databases: string[];
|
||||
@@ -162,7 +162,7 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
||||
constructor(
|
||||
ownerUri: string,
|
||||
jobModel: JobData,
|
||||
alertInfo: sqlops.AgentAlertInfo = undefined,
|
||||
alertInfo: azdata.AgentAlertInfo = undefined,
|
||||
viaJobDialog: boolean = false
|
||||
) {
|
||||
super(ownerUri,
|
||||
@@ -175,13 +175,13 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
||||
this.dialogName = this.isEdit ? this.EditAlertDialog : this.NewAlertDialog;
|
||||
}
|
||||
|
||||
protected async initializeDialog(dialog: sqlops.window.Dialog) {
|
||||
protected async initializeDialog(dialog: azdata.window.Dialog) {
|
||||
this.databases = await AgentUtils.getDatabases(this.ownerUri);
|
||||
this.databases.unshift(AlertDialog.AllDatabases);
|
||||
|
||||
this.generalTab = sqlops.window.createTab(AlertDialog.GeneralTabText);
|
||||
this.responseTab = sqlops.window.createTab(AlertDialog.ResponseTabText);
|
||||
this.optionsTab = sqlops.window.createTab(AlertDialog.OptionsTabText);
|
||||
this.generalTab = azdata.window.createTab(AlertDialog.GeneralTabText);
|
||||
this.responseTab = azdata.window.createTab(AlertDialog.ResponseTabText);
|
||||
this.optionsTab = azdata.window.createTab(AlertDialog.OptionsTabText);
|
||||
|
||||
this.initializeGeneralTab(this.databases, dialog);
|
||||
this.initializeResponseTab();
|
||||
@@ -190,7 +190,7 @@ export class AlertDialog extends AgentDialog<AlertData> {
|
||||
dialog.content = [this.generalTab, this.responseTab, this.optionsTab];
|
||||
}
|
||||
|
||||
private initializeGeneralTab(databases: string[], dialog: sqlops.window.Dialog) {
|
||||
private initializeGeneralTab(databases: string[], dialog: azdata.window.Dialog) {
|
||||
this.generalTab.registerContent(async view => {
|
||||
// create controls
|
||||
this.nameTextBox = view.modelBuilder.inputBox().component();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { JobData } from '../data/jobData';
|
||||
import { JobStepDialog } from './jobStepDialog';
|
||||
import { PickScheduleDialog } from './pickScheduleDialog';
|
||||
@@ -73,60 +73,60 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
private readonly EditJobDialogEvent: string = 'EditJobDialogOpened';
|
||||
|
||||
// UI Components
|
||||
private generalTab: sqlops.window.DialogTab;
|
||||
private stepsTab: sqlops.window.DialogTab;
|
||||
private alertsTab: sqlops.window.DialogTab;
|
||||
private schedulesTab: sqlops.window.DialogTab;
|
||||
private notificationsTab: sqlops.window.DialogTab;
|
||||
private generalTab: azdata.window.DialogTab;
|
||||
private stepsTab: azdata.window.DialogTab;
|
||||
private alertsTab: azdata.window.DialogTab;
|
||||
private schedulesTab: azdata.window.DialogTab;
|
||||
private notificationsTab: azdata.window.DialogTab;
|
||||
|
||||
// General tab controls
|
||||
private nameTextBox: sqlops.InputBoxComponent;
|
||||
private ownerTextBox: sqlops.InputBoxComponent;
|
||||
private categoryDropdown: sqlops.DropDownComponent;
|
||||
private descriptionTextBox: sqlops.InputBoxComponent;
|
||||
private enabledCheckBox: sqlops.CheckBoxComponent;
|
||||
private nameTextBox: azdata.InputBoxComponent;
|
||||
private ownerTextBox: azdata.InputBoxComponent;
|
||||
private categoryDropdown: azdata.DropDownComponent;
|
||||
private descriptionTextBox: azdata.InputBoxComponent;
|
||||
private enabledCheckBox: azdata.CheckBoxComponent;
|
||||
|
||||
// Steps tab controls
|
||||
private stepsTable: sqlops.TableComponent;
|
||||
private newStepButton: sqlops.ButtonComponent;
|
||||
private moveStepUpButton: sqlops.ButtonComponent;
|
||||
private moveStepDownButton: sqlops.ButtonComponent;
|
||||
private editStepButton: sqlops.ButtonComponent;
|
||||
private deleteStepButton: sqlops.ButtonComponent;
|
||||
private stepsTable: azdata.TableComponent;
|
||||
private newStepButton: azdata.ButtonComponent;
|
||||
private moveStepUpButton: azdata.ButtonComponent;
|
||||
private moveStepDownButton: azdata.ButtonComponent;
|
||||
private editStepButton: azdata.ButtonComponent;
|
||||
private deleteStepButton: azdata.ButtonComponent;
|
||||
|
||||
// Schedule tab controls
|
||||
private removeScheduleButton: sqlops.ButtonComponent;
|
||||
private removeScheduleButton: azdata.ButtonComponent;
|
||||
|
||||
// Notifications tab controls
|
||||
private notificationsTabTopLabel: sqlops.TextComponent;
|
||||
private emailCheckBox: sqlops.CheckBoxComponent;
|
||||
private emailOperatorDropdown: sqlops.DropDownComponent;
|
||||
private emailConditionDropdown: sqlops.DropDownComponent;
|
||||
private pagerCheckBox: sqlops.CheckBoxComponent;
|
||||
private pagerOperatorDropdown: sqlops.DropDownComponent;
|
||||
private pagerConditionDropdown: sqlops.DropDownComponent;
|
||||
private eventLogCheckBox: sqlops.CheckBoxComponent;
|
||||
private eventLogConditionDropdown: sqlops.DropDownComponent;
|
||||
private deleteJobCheckBox: sqlops.CheckBoxComponent;
|
||||
private deleteJobConditionDropdown: sqlops.DropDownComponent;
|
||||
private startStepDropdown: sqlops.DropDownComponent;
|
||||
private notificationsTabTopLabel: azdata.TextComponent;
|
||||
private emailCheckBox: azdata.CheckBoxComponent;
|
||||
private emailOperatorDropdown: azdata.DropDownComponent;
|
||||
private emailConditionDropdown: azdata.DropDownComponent;
|
||||
private pagerCheckBox: azdata.CheckBoxComponent;
|
||||
private pagerOperatorDropdown: azdata.DropDownComponent;
|
||||
private pagerConditionDropdown: azdata.DropDownComponent;
|
||||
private eventLogCheckBox: azdata.CheckBoxComponent;
|
||||
private eventLogConditionDropdown: azdata.DropDownComponent;
|
||||
private deleteJobCheckBox: azdata.CheckBoxComponent;
|
||||
private deleteJobConditionDropdown: azdata.DropDownComponent;
|
||||
private startStepDropdown: azdata.DropDownComponent;
|
||||
|
||||
// Schedule tab controls
|
||||
private schedulesTable: sqlops.TableComponent;
|
||||
private pickScheduleButton: sqlops.ButtonComponent;
|
||||
private schedulesTable: azdata.TableComponent;
|
||||
private pickScheduleButton: azdata.ButtonComponent;
|
||||
|
||||
// Alert tab controls
|
||||
private alertsTable: sqlops.TableComponent;
|
||||
private newAlertButton: sqlops.ButtonComponent;
|
||||
private alertsTable: azdata.TableComponent;
|
||||
private newAlertButton: azdata.ButtonComponent;
|
||||
private isEdit: boolean = false;
|
||||
|
||||
// Job objects
|
||||
private steps: sqlops.AgentJobStepInfo[];
|
||||
private schedules: sqlops.AgentJobScheduleInfo[];
|
||||
private alerts: sqlops.AgentAlertInfo[] = [];
|
||||
private startStepDropdownValues: sqlops.CategoryValue[] = [];
|
||||
private steps: azdata.AgentJobStepInfo[];
|
||||
private schedules: azdata.AgentJobScheduleInfo[];
|
||||
private alerts: azdata.AgentAlertInfo[] = [];
|
||||
private startStepDropdownValues: azdata.CategoryValue[] = [];
|
||||
|
||||
constructor(ownerUri: string, jobInfo: sqlops.AgentJobInfo = undefined) {
|
||||
constructor(ownerUri: string, jobInfo: azdata.AgentJobInfo = undefined) {
|
||||
super(
|
||||
ownerUri,
|
||||
new JobData(ownerUri, jobInfo),
|
||||
@@ -139,11 +139,11 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
}
|
||||
|
||||
protected async initializeDialog() {
|
||||
this.generalTab = sqlops.window.createTab(this.GeneralTabText);
|
||||
this.stepsTab = sqlops.window.createTab(this.StepsTabText);
|
||||
this.alertsTab = sqlops.window.createTab(this.AlertsTabText);
|
||||
this.schedulesTab = sqlops.window.createTab(this.SchedulesTabText);
|
||||
this.notificationsTab = sqlops.window.createTab(this.NotificationsTabText);
|
||||
this.generalTab = azdata.window.createTab(this.GeneralTabText);
|
||||
this.stepsTab = azdata.window.createTab(this.StepsTabText);
|
||||
this.alertsTab = azdata.window.createTab(this.AlertsTabText);
|
||||
this.schedulesTab = azdata.window.createTab(this.SchedulesTabText);
|
||||
this.notificationsTab = azdata.window.createTab(this.NotificationsTabText);
|
||||
this.initializeGeneralTab();
|
||||
this.initializeStepsTab();
|
||||
this.initializeAlertsTab();
|
||||
@@ -636,7 +636,7 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
});
|
||||
}
|
||||
|
||||
private createRowContainer(view: sqlops.ModelView): sqlops.FlexBuilder {
|
||||
private createRowContainer(view: azdata.ModelView): azdata.FlexBuilder {
|
||||
return view.modelBuilder.flexContainer().withLayout({
|
||||
flexFlow: 'row',
|
||||
alignItems: 'left',
|
||||
@@ -644,7 +644,7 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
});
|
||||
}
|
||||
|
||||
private convertStepsToData(jobSteps: sqlops.AgentJobStepInfo[]): any[][] {
|
||||
private convertStepsToData(jobSteps: azdata.AgentJobStepInfo[]): any[][] {
|
||||
let result = [];
|
||||
jobSteps.forEach(jobStep => {
|
||||
let cols = [];
|
||||
@@ -658,7 +658,7 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
return result;
|
||||
}
|
||||
|
||||
private convertSchedulesToData(jobSchedules: sqlops.AgentJobScheduleInfo[]): any[][] {
|
||||
private convertSchedulesToData(jobSchedules: azdata.AgentJobScheduleInfo[]): any[][] {
|
||||
let result = [];
|
||||
jobSchedules.forEach(schedule => {
|
||||
let cols = [];
|
||||
@@ -670,7 +670,7 @@ export class JobDialog extends AgentDialog<JobData> {
|
||||
return result;
|
||||
}
|
||||
|
||||
private convertAlertsToData(alerts: sqlops.AgentAlertInfo[]): any[][] {
|
||||
private convertAlertsToData(alerts: azdata.AgentAlertInfo[]): any[][] {
|
||||
let result = [];
|
||||
alerts.forEach(alert => {
|
||||
let cols = [];
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { JobStepData } from '../data/jobStepData';
|
||||
import { AgentUtils } from '../agentUtils';
|
||||
@@ -74,42 +74,42 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
|
||||
// UI Components
|
||||
|
||||
// Dialogs
|
||||
private fileBrowserDialog: sqlops.window.Dialog;
|
||||
private fileBrowserDialog: azdata.window.Dialog;
|
||||
|
||||
// Dialog tabs
|
||||
private generalTab: sqlops.window.DialogTab;
|
||||
private advancedTab: sqlops.window.DialogTab;
|
||||
private generalTab: azdata.window.DialogTab;
|
||||
private advancedTab: azdata.window.DialogTab;
|
||||
|
||||
//Input boxes
|
||||
private nameTextBox: sqlops.InputBoxComponent;
|
||||
private commandTextBox: sqlops.InputBoxComponent;
|
||||
private selectedPathTextBox: sqlops.InputBoxComponent;
|
||||
private retryAttemptsBox: sqlops.InputBoxComponent;
|
||||
private retryIntervalBox: sqlops.InputBoxComponent;
|
||||
private outputFileNameBox: sqlops.InputBoxComponent;
|
||||
private fileBrowserNameBox: sqlops.InputBoxComponent;
|
||||
private userInputBox: sqlops.InputBoxComponent;
|
||||
private processExitCodeBox: sqlops.InputBoxComponent;
|
||||
private nameTextBox: azdata.InputBoxComponent;
|
||||
private commandTextBox: azdata.InputBoxComponent;
|
||||
private selectedPathTextBox: azdata.InputBoxComponent;
|
||||
private retryAttemptsBox: azdata.InputBoxComponent;
|
||||
private retryIntervalBox: azdata.InputBoxComponent;
|
||||
private outputFileNameBox: azdata.InputBoxComponent;
|
||||
private fileBrowserNameBox: azdata.InputBoxComponent;
|
||||
private userInputBox: azdata.InputBoxComponent;
|
||||
private processExitCodeBox: azdata.InputBoxComponent;
|
||||
|
||||
// Dropdowns
|
||||
private typeDropdown: sqlops.DropDownComponent;
|
||||
private runAsDropdown: sqlops.DropDownComponent;
|
||||
private databaseDropdown: sqlops.DropDownComponent;
|
||||
private successActionDropdown: sqlops.DropDownComponent;
|
||||
private failureActionDropdown: sqlops.DropDownComponent;
|
||||
private fileTypeDropdown: sqlops.DropDownComponent;
|
||||
private typeDropdown: azdata.DropDownComponent;
|
||||
private runAsDropdown: azdata.DropDownComponent;
|
||||
private databaseDropdown: azdata.DropDownComponent;
|
||||
private successActionDropdown: azdata.DropDownComponent;
|
||||
private failureActionDropdown: azdata.DropDownComponent;
|
||||
private fileTypeDropdown: azdata.DropDownComponent;
|
||||
|
||||
// Buttons
|
||||
private openButton: sqlops.ButtonComponent;
|
||||
private parseButton: sqlops.ButtonComponent;
|
||||
private outputFileBrowserButton: sqlops.ButtonComponent;
|
||||
private openButton: azdata.ButtonComponent;
|
||||
private parseButton: azdata.ButtonComponent;
|
||||
private outputFileBrowserButton: azdata.ButtonComponent;
|
||||
|
||||
// Checkbox
|
||||
private appendToExistingFileCheckbox: sqlops.CheckBoxComponent;
|
||||
private logToTableCheckbox: sqlops.CheckBoxComponent;
|
||||
private logStepOutputHistoryCheckbox: sqlops.CheckBoxComponent;
|
||||
private appendToExistingFileCheckbox: azdata.CheckBoxComponent;
|
||||
private logToTableCheckbox: azdata.CheckBoxComponent;
|
||||
private logStepOutputHistoryCheckbox: azdata.CheckBoxComponent;
|
||||
|
||||
private fileBrowserTree: sqlops.FileBrowserTreeComponent;
|
||||
private fileBrowserTree: azdata.FileBrowserTreeComponent;
|
||||
private jobModel: JobData;
|
||||
public jobName: string;
|
||||
private server: string;
|
||||
@@ -120,7 +120,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
|
||||
ownerUri: string,
|
||||
server: string,
|
||||
jobModel: JobData,
|
||||
jobStepInfo?: sqlops.AgentJobStepInfo,
|
||||
jobStepInfo?: azdata.AgentJobStepInfo,
|
||||
viaJobDialog: boolean = false
|
||||
) {
|
||||
super(ownerUri,
|
||||
@@ -138,12 +138,12 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
|
||||
}
|
||||
|
||||
private initializeUIComponents() {
|
||||
this.generalTab = sqlops.window.createTab(this.GeneralTabText);
|
||||
this.advancedTab = sqlops.window.createTab(this.AdvancedTabText);
|
||||
this.generalTab = azdata.window.createTab(this.GeneralTabText);
|
||||
this.advancedTab = azdata.window.createTab(this.AdvancedTabText);
|
||||
this.dialog.content = [this.generalTab, this.advancedTab];
|
||||
}
|
||||
|
||||
private createCommands(view, queryProvider: sqlops.QueryProvider) {
|
||||
private createCommands(view, queryProvider: azdata.QueryProvider) {
|
||||
this.openButton = view.modelBuilder.button()
|
||||
.withProperties({
|
||||
label: this.OpenCommandText,
|
||||
@@ -181,7 +181,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
|
||||
.component();
|
||||
}
|
||||
|
||||
private createGeneralTab(databases: string[], queryProvider: sqlops.QueryProvider) {
|
||||
private createGeneralTab(databases: string[], queryProvider: azdata.QueryProvider) {
|
||||
this.generalTab.registerContent(async (view) => {
|
||||
this.nameTextBox = view.modelBuilder.inputBox()
|
||||
.withProperties({
|
||||
@@ -425,8 +425,8 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
|
||||
|
||||
private openFileBrowserDialog() {
|
||||
let fileBrowserTitle = this.FileBrowserDialogTitle + `${this.server}`;
|
||||
this.fileBrowserDialog = sqlops.window.createModelViewDialog(fileBrowserTitle);
|
||||
let fileBrowserTab = sqlops.window.createTab('File Browser');
|
||||
this.fileBrowserDialog = azdata.window.createModelViewDialog(fileBrowserTitle);
|
||||
let fileBrowserTab = azdata.window.createTab('File Browser');
|
||||
this.fileBrowserDialog.content = [fileBrowserTab];
|
||||
fileBrowserTab.registerContent(async (view) => {
|
||||
this.fileBrowserTree = view.modelBuilder.fileBrowserTree()
|
||||
@@ -470,7 +470,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
|
||||
});
|
||||
this.fileBrowserDialog.okButton.label = this.OkButtonText;
|
||||
this.fileBrowserDialog.cancelButton.label = this.CancelButtonText;
|
||||
sqlops.window.openDialog(this.fileBrowserDialog);
|
||||
azdata.window.openDialog(this.fileBrowserDialog);
|
||||
}
|
||||
|
||||
private createTSQLOptions(view) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { OperatorData } from '../data/operatorData';
|
||||
import * as nls from 'vscode-nls';
|
||||
@@ -48,33 +48,33 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
|
||||
private readonly EditOperatorDialog = 'EditOperatorDialogOpened';
|
||||
|
||||
// UI Components
|
||||
private generalTab: sqlops.window.DialogTab;
|
||||
private notificationsTab: sqlops.window.DialogTab;
|
||||
private generalTab: azdata.window.DialogTab;
|
||||
private notificationsTab: azdata.window.DialogTab;
|
||||
|
||||
// General tab controls
|
||||
private nameTextBox: sqlops.InputBoxComponent;
|
||||
private enabledCheckBox: sqlops.CheckBoxComponent;
|
||||
private emailNameTextBox: sqlops.InputBoxComponent;
|
||||
private pagerEmailNameTextBox: sqlops.InputBoxComponent;
|
||||
private pagerMondayCheckBox: sqlops.CheckBoxComponent;
|
||||
private pagerTuesdayCheckBox: sqlops.CheckBoxComponent;
|
||||
private pagerWednesdayCheckBox: sqlops.CheckBoxComponent;
|
||||
private pagerThursdayCheckBox: sqlops.CheckBoxComponent;
|
||||
private pagerFridayCheckBox: sqlops.CheckBoxComponent;
|
||||
private pagerSaturdayCheckBox: sqlops.CheckBoxComponent;
|
||||
private pagerSundayCheckBox: sqlops.CheckBoxComponent;
|
||||
private weekdayPagerStartTimeInput: sqlops.InputBoxComponent;
|
||||
private weekdayPagerEndTimeInput: sqlops.InputBoxComponent;
|
||||
private saturdayPagerStartTimeInput: sqlops.InputBoxComponent;
|
||||
private saturdayPagerEndTimeInput: sqlops.InputBoxComponent;
|
||||
private sundayPagerStartTimeInput: sqlops.InputBoxComponent;
|
||||
private sundayPagerEndTimeInput: sqlops.InputBoxComponent;
|
||||
private nameTextBox: azdata.InputBoxComponent;
|
||||
private enabledCheckBox: azdata.CheckBoxComponent;
|
||||
private emailNameTextBox: azdata.InputBoxComponent;
|
||||
private pagerEmailNameTextBox: azdata.InputBoxComponent;
|
||||
private pagerMondayCheckBox: azdata.CheckBoxComponent;
|
||||
private pagerTuesdayCheckBox: azdata.CheckBoxComponent;
|
||||
private pagerWednesdayCheckBox: azdata.CheckBoxComponent;
|
||||
private pagerThursdayCheckBox: azdata.CheckBoxComponent;
|
||||
private pagerFridayCheckBox: azdata.CheckBoxComponent;
|
||||
private pagerSaturdayCheckBox: azdata.CheckBoxComponent;
|
||||
private pagerSundayCheckBox: azdata.CheckBoxComponent;
|
||||
private weekdayPagerStartTimeInput: azdata.InputBoxComponent;
|
||||
private weekdayPagerEndTimeInput: azdata.InputBoxComponent;
|
||||
private saturdayPagerStartTimeInput: azdata.InputBoxComponent;
|
||||
private saturdayPagerEndTimeInput: azdata.InputBoxComponent;
|
||||
private sundayPagerStartTimeInput: azdata.InputBoxComponent;
|
||||
private sundayPagerEndTimeInput: azdata.InputBoxComponent;
|
||||
|
||||
// Notification tab controls
|
||||
private alertsTable: sqlops.TableComponent;
|
||||
private alertsTable: azdata.TableComponent;
|
||||
private isEdit: boolean = false;
|
||||
|
||||
constructor(ownerUri: string, operatorInfo: sqlops.AgentOperatorInfo = undefined) {
|
||||
constructor(ownerUri: string, operatorInfo: azdata.AgentOperatorInfo = undefined) {
|
||||
super(
|
||||
ownerUri,
|
||||
new OperatorData(ownerUri, operatorInfo),
|
||||
@@ -83,9 +83,9 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
|
||||
this.dialogName = this.isEdit ? this.EditOperatorDialog : this.NewOperatorDialog;
|
||||
}
|
||||
|
||||
protected async initializeDialog(dialog: sqlops.window.Dialog) {
|
||||
this.generalTab = sqlops.window.createTab(OperatorDialog.GeneralTabText);
|
||||
this.notificationsTab = sqlops.window.createTab(OperatorDialog.NotificationsTabText);
|
||||
protected async initializeDialog(dialog: azdata.window.Dialog) {
|
||||
this.generalTab = azdata.window.createTab(OperatorDialog.GeneralTabText);
|
||||
this.notificationsTab = azdata.window.createTab(OperatorDialog.NotificationsTabText);
|
||||
|
||||
this.initializeGeneralTab();
|
||||
this.initializeNotificationTab();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { PickScheduleData } from '../data/pickScheduleData';
|
||||
|
||||
@@ -25,8 +25,8 @@ export class PickScheduleDialog {
|
||||
|
||||
|
||||
// UI Components
|
||||
private dialog: sqlops.window.Dialog;
|
||||
private schedulesTable: sqlops.TableComponent;
|
||||
private dialog: azdata.window.Dialog;
|
||||
private schedulesTable: azdata.TableComponent;
|
||||
|
||||
private model: PickScheduleData;
|
||||
|
||||
@@ -39,13 +39,13 @@ export class PickScheduleDialog {
|
||||
|
||||
public async showDialog() {
|
||||
await this.model.initialize();
|
||||
this.dialog = sqlops.window.createModelViewDialog(this.DialogTitle);
|
||||
this.dialog = azdata.window.createModelViewDialog(this.DialogTitle);
|
||||
this.initializeContent();
|
||||
this.dialog.okButton.onClick(async () => await this.execute());
|
||||
this.dialog.cancelButton.onClick(async () => await this.cancel());
|
||||
this.dialog.okButton.label = this.OkButtonText;
|
||||
this.dialog.cancelButton.label = this.CancelButtonText;
|
||||
sqlops.window.openDialog(this.dialog);
|
||||
azdata.window.openDialog(this.dialog);
|
||||
}
|
||||
|
||||
private initializeContent() {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { AgentDialog } from './agentDialog';
|
||||
import { ProxyData } from '../data/proxyData';
|
||||
|
||||
@@ -40,28 +40,28 @@ export class ProxyDialog extends AgentDialog<ProxyData> {
|
||||
private readonly EditProxyDialog = 'EditProxyDialogOpened';
|
||||
|
||||
// UI Components
|
||||
private generalTab: sqlops.window.DialogTab;
|
||||
private generalTab: azdata.window.DialogTab;
|
||||
|
||||
// General tab controls
|
||||
private proxyNameTextBox: sqlops.InputBoxComponent;
|
||||
private credentialNameDropDown: sqlops.DropDownComponent;
|
||||
private descriptionTextBox: sqlops.InputBoxComponent;
|
||||
private subsystemCheckBox: sqlops.CheckBoxComponent;
|
||||
private operatingSystemCheckBox: sqlops.CheckBoxComponent;
|
||||
private replicationSnapshotCheckBox: sqlops.CheckBoxComponent;
|
||||
private replicationTransactionLogCheckBox: sqlops.CheckBoxComponent;
|
||||
private replicationDistributorCheckBox: sqlops.CheckBoxComponent;
|
||||
private replicationMergeCheckbox: sqlops.CheckBoxComponent;
|
||||
private replicationQueueReaderCheckbox: sqlops.CheckBoxComponent;
|
||||
private sqlQueryCheckBox: sqlops.CheckBoxComponent;
|
||||
private sqlCommandCheckBox: sqlops.CheckBoxComponent;
|
||||
private sqlIntegrationServicesPackageCheckbox: sqlops.CheckBoxComponent;
|
||||
private powershellCheckBox: sqlops.CheckBoxComponent;
|
||||
private proxyNameTextBox: azdata.InputBoxComponent;
|
||||
private credentialNameDropDown: azdata.DropDownComponent;
|
||||
private descriptionTextBox: azdata.InputBoxComponent;
|
||||
private subsystemCheckBox: azdata.CheckBoxComponent;
|
||||
private operatingSystemCheckBox: azdata.CheckBoxComponent;
|
||||
private replicationSnapshotCheckBox: azdata.CheckBoxComponent;
|
||||
private replicationTransactionLogCheckBox: azdata.CheckBoxComponent;
|
||||
private replicationDistributorCheckBox: azdata.CheckBoxComponent;
|
||||
private replicationMergeCheckbox: azdata.CheckBoxComponent;
|
||||
private replicationQueueReaderCheckbox: azdata.CheckBoxComponent;
|
||||
private sqlQueryCheckBox: azdata.CheckBoxComponent;
|
||||
private sqlCommandCheckBox: azdata.CheckBoxComponent;
|
||||
private sqlIntegrationServicesPackageCheckbox: azdata.CheckBoxComponent;
|
||||
private powershellCheckBox: azdata.CheckBoxComponent;
|
||||
|
||||
private credentials: sqlops.CredentialInfo[];
|
||||
private credentials: azdata.CredentialInfo[];
|
||||
private isEdit: boolean = false;
|
||||
|
||||
constructor(ownerUri: string, proxyInfo: sqlops.AgentProxyInfo = undefined, credentials: sqlops.CredentialInfo[]) {
|
||||
constructor(ownerUri: string, proxyInfo: azdata.AgentProxyInfo = undefined, credentials: azdata.CredentialInfo[]) {
|
||||
super(
|
||||
ownerUri,
|
||||
new ProxyData(ownerUri, proxyInfo),
|
||||
@@ -71,8 +71,8 @@ export class ProxyDialog extends AgentDialog<ProxyData> {
|
||||
this.dialogName = this.isEdit ? this.EditProxyDialog : this.NewProxyDialog;
|
||||
}
|
||||
|
||||
protected async initializeDialog(dialog: sqlops.window.Dialog) {
|
||||
this.generalTab = sqlops.window.createTab(ProxyDialog.GeneralTabText);
|
||||
protected async initializeDialog(dialog: azdata.window.Dialog) {
|
||||
this.generalTab = azdata.window.createTab(ProxyDialog.GeneralTabText);
|
||||
|
||||
|
||||
this.initializeGeneralTab();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { ScheduleData } from '../data/scheduleData';
|
||||
|
||||
@@ -21,8 +21,8 @@ export class ScheduleDialog {
|
||||
private readonly SchedulesLabelText: string = localize('scheduleDialog.schedules', 'Schedules');
|
||||
|
||||
// UI Components
|
||||
private dialog: sqlops.window.Dialog;
|
||||
private schedulesTable: sqlops.TableComponent;
|
||||
private dialog: azdata.window.Dialog;
|
||||
private schedulesTable: azdata.TableComponent;
|
||||
|
||||
private model: ScheduleData;
|
||||
|
||||
@@ -35,14 +35,14 @@ export class ScheduleDialog {
|
||||
|
||||
public async showDialog() {
|
||||
await this.model.initialize();
|
||||
this.dialog = sqlops.window.createModelViewDialog(this.DialogTitle);
|
||||
this.dialog = azdata.window.createModelViewDialog(this.DialogTitle);
|
||||
this.initializeContent();
|
||||
this.dialog.okButton.onClick(async () => await this.execute());
|
||||
this.dialog.cancelButton.onClick(async () => await this.cancel());
|
||||
this.dialog.okButton.label = this.OkButtonText;
|
||||
this.dialog.cancelButton.label = this.CancelButtonText;
|
||||
|
||||
sqlops.window.openDialog(this.dialog);
|
||||
azdata.window.openDialog(this.dialog);
|
||||
}
|
||||
|
||||
private initializeContent() {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { AlertDialog } from './dialogs/alertDialog';
|
||||
import { JobDialog } from './dialogs/jobDialog';
|
||||
@@ -38,11 +38,11 @@ export class MainController {
|
||||
* Activates the extension
|
||||
*/
|
||||
public activate(): void {
|
||||
vscode.commands.registerCommand('agent.openJobDialog', (ownerUri: string, jobInfo: sqlops.AgentJobInfo) => {
|
||||
vscode.commands.registerCommand('agent.openJobDialog', (ownerUri: string, jobInfo: azdata.AgentJobInfo) => {
|
||||
let dialog = new JobDialog(ownerUri, jobInfo);
|
||||
dialog.dialogName ? dialog.openDialog(dialog.dialogName) : dialog.openDialog();
|
||||
});
|
||||
vscode.commands.registerCommand('agent.openNewStepDialog', (ownerUri: string, server: string, jobInfo: sqlops.AgentJobInfo, jobStepInfo: sqlops.AgentJobStepInfo) => {
|
||||
vscode.commands.registerCommand('agent.openNewStepDialog', (ownerUri: string, server: string, jobInfo: azdata.AgentJobInfo, jobStepInfo: azdata.AgentJobStepInfo) => {
|
||||
AgentUtils.getAgentService().then((agentService) => {
|
||||
let jobData: JobData = new JobData(ownerUri, jobInfo, agentService);
|
||||
let dialog = new JobStepDialog(ownerUri, server, jobData, jobStepInfo, false);
|
||||
@@ -53,18 +53,18 @@ export class MainController {
|
||||
let dialog = new PickScheduleDialog(ownerUri, jobName);
|
||||
dialog.showDialog();
|
||||
});
|
||||
vscode.commands.registerCommand('agent.openAlertDialog', (ownerUri: string, jobInfo: sqlops.AgentJobInfo, alertInfo: sqlops.AgentAlertInfo) => {
|
||||
vscode.commands.registerCommand('agent.openAlertDialog', (ownerUri: string, jobInfo: azdata.AgentJobInfo, alertInfo: azdata.AgentAlertInfo) => {
|
||||
AgentUtils.getAgentService().then((agentService) => {
|
||||
let jobData: JobData = new JobData(ownerUri, jobInfo, agentService);
|
||||
let dialog = new AlertDialog(ownerUri, jobData, alertInfo, false);
|
||||
dialog.dialogName ? dialog.openDialog(dialog.dialogName) : dialog.openDialog();
|
||||
});
|
||||
});
|
||||
vscode.commands.registerCommand('agent.openOperatorDialog', (ownerUri: string, operatorInfo: sqlops.AgentOperatorInfo) => {
|
||||
vscode.commands.registerCommand('agent.openOperatorDialog', (ownerUri: string, operatorInfo: azdata.AgentOperatorInfo) => {
|
||||
let dialog = new OperatorDialog(ownerUri, operatorInfo);
|
||||
dialog.dialogName ? dialog.openDialog(dialog.dialogName) : dialog.openDialog();
|
||||
});
|
||||
vscode.commands.registerCommand('agent.openProxyDialog', (ownerUri: string, proxyInfo: sqlops.AgentProxyInfo, credentials: sqlops.CredentialInfo[]) => {
|
||||
vscode.commands.registerCommand('agent.openProxyDialog', (ownerUri: string, proxyInfo: azdata.AgentProxyInfo, credentials: azdata.CredentialInfo[]) => {
|
||||
let dialog = new ProxyDialog(ownerUri, proxyInfo, credentials);
|
||||
dialog.dialogName ? dialog.openDialog(dialog.dialogName) : dialog.openDialog();
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import * as assert from 'assert';
|
||||
import 'mocha';
|
||||
import * as vscode from 'vscode';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { JobData } from '../data/jobData';
|
||||
import { TestAgentService } from './testAgentService';
|
||||
|
||||
|
||||
@@ -4,104 +4,104 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
export class TestAgentService implements sqlops.AgentServicesProvider {
|
||||
export class TestAgentService implements azdata.AgentServicesProvider {
|
||||
handle?: number;
|
||||
readonly providerId: string = 'Test Provider';
|
||||
|
||||
// Job management methods
|
||||
getJobs(ownerUri: string): Thenable<sqlops.AgentJobsResult> {
|
||||
getJobs(ownerUri: string): Thenable<azdata.AgentJobsResult> {
|
||||
return undefined;
|
||||
}
|
||||
getJobHistory(ownerUri: string, jobId: string, jobName: string): Thenable<sqlops.AgentJobHistoryResult> {
|
||||
getJobHistory(ownerUri: string, jobId: string, jobName: string): Thenable<azdata.AgentJobHistoryResult> {
|
||||
return undefined;
|
||||
}
|
||||
jobAction(ownerUri: string, jobName: string, action: string): Thenable<sqlops.ResultStatus> {
|
||||
jobAction(ownerUri: string, jobName: string, action: string): Thenable<azdata.ResultStatus> {
|
||||
return undefined;
|
||||
}
|
||||
createJob(ownerUri: string, jobInfo: sqlops.AgentJobInfo): Thenable<sqlops.CreateAgentJobResult> {
|
||||
createJob(ownerUri: string, jobInfo: azdata.AgentJobInfo): Thenable<azdata.CreateAgentJobResult> {
|
||||
return undefined;
|
||||
}
|
||||
updateJob(ownerUri: string, originalJobName: string, jobInfo: sqlops.AgentJobInfo): Thenable<sqlops.UpdateAgentJobResult> {
|
||||
updateJob(ownerUri: string, originalJobName: string, jobInfo: azdata.AgentJobInfo): Thenable<azdata.UpdateAgentJobResult> {
|
||||
return undefined;
|
||||
}
|
||||
deleteJob(ownerUri: string, jobInfo: sqlops.AgentJobInfo): Thenable<sqlops.ResultStatus> {
|
||||
deleteJob(ownerUri: string, jobInfo: azdata.AgentJobInfo): Thenable<azdata.ResultStatus> {
|
||||
return undefined;
|
||||
}
|
||||
getJobDefaults(ownerUri: string): Thenable<sqlops.AgentJobDefaultsResult> {
|
||||
getJobDefaults(ownerUri: string): Thenable<azdata.AgentJobDefaultsResult> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Job Step management methods
|
||||
createJobStep(ownerUri: string, jobInfo: sqlops.AgentJobStepInfo): Thenable<sqlops.CreateAgentJobStepResult> {
|
||||
createJobStep(ownerUri: string, jobInfo: azdata.AgentJobStepInfo): Thenable<azdata.CreateAgentJobStepResult> {
|
||||
return undefined;
|
||||
}
|
||||
updateJobStep(ownerUri: string, originalJobStepName: string, jobInfo: sqlops.AgentJobStepInfo): Thenable<sqlops.UpdateAgentJobStepResult> {
|
||||
updateJobStep(ownerUri: string, originalJobStepName: string, jobInfo: azdata.AgentJobStepInfo): Thenable<azdata.UpdateAgentJobStepResult> {
|
||||
return undefined;
|
||||
}
|
||||
deleteJobStep(ownerUri: string, jobInfo: sqlops.AgentJobStepInfo): Thenable<sqlops.ResultStatus> {
|
||||
deleteJobStep(ownerUri: string, jobInfo: azdata.AgentJobStepInfo): Thenable<azdata.ResultStatus> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Alert management methods
|
||||
getAlerts(ownerUri: string): Thenable<sqlops.AgentAlertsResult> {
|
||||
getAlerts(ownerUri: string): Thenable<azdata.AgentAlertsResult> {
|
||||
return undefined;
|
||||
}
|
||||
createAlert(ownerUri: string, alertInfo: sqlops.AgentAlertInfo): Thenable<sqlops.CreateAgentAlertResult> {
|
||||
createAlert(ownerUri: string, alertInfo: azdata.AgentAlertInfo): Thenable<azdata.CreateAgentAlertResult> {
|
||||
return undefined;
|
||||
}
|
||||
updateAlert(ownerUri: string, originalAlertName: string, alertInfo: sqlops.AgentAlertInfo): Thenable<sqlops.UpdateAgentAlertResult> {
|
||||
updateAlert(ownerUri: string, originalAlertName: string, alertInfo: azdata.AgentAlertInfo): Thenable<azdata.UpdateAgentAlertResult> {
|
||||
return undefined;
|
||||
}
|
||||
deleteAlert(ownerUri: string, alertInfo: sqlops.AgentAlertInfo): Thenable<sqlops.ResultStatus> {
|
||||
deleteAlert(ownerUri: string, alertInfo: azdata.AgentAlertInfo): Thenable<azdata.ResultStatus> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Operator management methods
|
||||
getOperators(ownerUri: string): Thenable<sqlops.AgentOperatorsResult> {
|
||||
getOperators(ownerUri: string): Thenable<azdata.AgentOperatorsResult> {
|
||||
return undefined;
|
||||
}
|
||||
createOperator(ownerUri: string, operatorInfo: sqlops.AgentOperatorInfo): Thenable<sqlops.CreateAgentOperatorResult> {
|
||||
createOperator(ownerUri: string, operatorInfo: azdata.AgentOperatorInfo): Thenable<azdata.CreateAgentOperatorResult> {
|
||||
return undefined;
|
||||
}
|
||||
updateOperator(ownerUri: string, originalOperatorName: string, operatorInfo: sqlops.AgentOperatorInfo): Thenable<sqlops.UpdateAgentOperatorResult> {
|
||||
updateOperator(ownerUri: string, originalOperatorName: string, operatorInfo: azdata.AgentOperatorInfo): Thenable<azdata.UpdateAgentOperatorResult> {
|
||||
return undefined;
|
||||
}
|
||||
deleteOperator(ownerUri: string, operatorInfo: sqlops.AgentOperatorInfo): Thenable<sqlops.ResultStatus> {
|
||||
deleteOperator(ownerUri: string, operatorInfo: azdata.AgentOperatorInfo): Thenable<azdata.ResultStatus> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Proxy management methods
|
||||
getProxies(ownerUri: string): Thenable<sqlops.AgentProxiesResult> {
|
||||
getProxies(ownerUri: string): Thenable<azdata.AgentProxiesResult> {
|
||||
return undefined;
|
||||
}
|
||||
createProxy(ownerUri: string, proxyInfo: sqlops.AgentProxyInfo): Thenable<sqlops.CreateAgentOperatorResult> {
|
||||
createProxy(ownerUri: string, proxyInfo: azdata.AgentProxyInfo): Thenable<azdata.CreateAgentOperatorResult> {
|
||||
return undefined;
|
||||
}
|
||||
updateProxy(ownerUri: string, originalProxyName: string, proxyInfo: sqlops.AgentProxyInfo): Thenable<sqlops.UpdateAgentOperatorResult> {
|
||||
updateProxy(ownerUri: string, originalProxyName: string, proxyInfo: azdata.AgentProxyInfo): Thenable<azdata.UpdateAgentOperatorResult> {
|
||||
return undefined;
|
||||
}
|
||||
deleteProxy(ownerUri: string, proxyInfo: sqlops.AgentProxyInfo): Thenable<sqlops.ResultStatus> {
|
||||
deleteProxy(ownerUri: string, proxyInfo: azdata.AgentProxyInfo): Thenable<azdata.ResultStatus> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Agent Credential method
|
||||
getCredentials(ownerUri: string): Thenable<sqlops.GetCredentialsResult> {
|
||||
getCredentials(ownerUri: string): Thenable<azdata.GetCredentialsResult> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Job Schedule management methods
|
||||
getJobSchedules(ownerUri: string): Thenable<sqlops.AgentJobSchedulesResult> {
|
||||
getJobSchedules(ownerUri: string): Thenable<azdata.AgentJobSchedulesResult> {
|
||||
return undefined;
|
||||
}
|
||||
createJobSchedule(ownerUri: string, scheduleInfo: sqlops.AgentJobScheduleInfo): Thenable<sqlops.CreateAgentJobScheduleResult> {
|
||||
createJobSchedule(ownerUri: string, scheduleInfo: azdata.AgentJobScheduleInfo): Thenable<azdata.CreateAgentJobScheduleResult> {
|
||||
return undefined;
|
||||
}
|
||||
updateJobSchedule(ownerUri: string, originalScheduleName: string, scheduleInfo: sqlops.AgentJobScheduleInfo): Thenable<sqlops.UpdateAgentJobScheduleResult> {
|
||||
updateJobSchedule(ownerUri: string, originalScheduleName: string, scheduleInfo: azdata.AgentJobScheduleInfo): Thenable<azdata.UpdateAgentJobScheduleResult> {
|
||||
return undefined;
|
||||
}
|
||||
deleteJobSchedule(ownerUri: string, scheduleInfo: sqlops.AgentJobScheduleInfo): Thenable<sqlops.ResultStatus> {
|
||||
deleteJobSchedule(ownerUri: string, scheduleInfo: azdata.AgentJobScheduleInfo): Thenable<azdata.ResultStatus> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
2
extensions/agent/src/typings/ref.d.ts
vendored
2
extensions/agent/src/typings/ref.d.ts
vendored
@@ -6,6 +6,4 @@
|
||||
/// <reference path='../../../../src/vs/vscode.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/azdata.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/azdata.proposed.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/sqlops.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/sqlops.proposed.d.ts'/>
|
||||
/// <reference types='@types/node'/>
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as adal from 'adal-node';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as request from 'request';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as vscode from 'vscode';
|
||||
@@ -22,7 +22,7 @@ import TokenCache from './tokenCache';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export class AzureAccountProvider implements sqlops.AccountProvider {
|
||||
export class AzureAccountProvider implements azdata.AccountProvider {
|
||||
// CONSTANTS ///////////////////////////////////////////////////////////
|
||||
private static WorkSchoolAccountType: string = 'work_school';
|
||||
private static MicrosoftAccountType: string = 'microsoft';
|
||||
@@ -57,7 +57,7 @@ export class AzureAccountProvider implements sqlops.AccountProvider {
|
||||
* @param {"data".AccountKey} accountKey Key identifying the account to delete tokens for
|
||||
* @returns {Thenable<void>} Promise to clear requested tokens from the token cache
|
||||
*/
|
||||
public clear(accountKey: sqlops.AccountKey): Thenable<void> {
|
||||
public clear(accountKey: azdata.AccountKey): Thenable<void> {
|
||||
return this.doIfInitialized(() => this.clearAccountTokens(accountKey));
|
||||
}
|
||||
|
||||
@@ -69,14 +69,14 @@ export class AzureAccountProvider implements sqlops.AccountProvider {
|
||||
return this._tokenCache.clear();
|
||||
}
|
||||
|
||||
public getSecurityToken(account: AzureAccount, resource: sqlops.AzureResource): Thenable<AzureAccountSecurityTokenCollection> {
|
||||
public getSecurityToken(account: AzureAccount, resource: azdata.AzureResource): Thenable<AzureAccountSecurityTokenCollection> {
|
||||
return this.doIfInitialized(() => this.getAccessTokens(account, resource));
|
||||
}
|
||||
|
||||
public initialize(restoredAccounts: sqlops.Account[]): Thenable<sqlops.Account[]> {
|
||||
public initialize(restoredAccounts: azdata.Account[]): Thenable<azdata.Account[]> {
|
||||
let self = this;
|
||||
|
||||
let rehydrationTasks: Thenable<sqlops.Account>[] = [];
|
||||
let rehydrationTasks: Thenable<azdata.Account>[] = [];
|
||||
for (let account of restoredAccounts) {
|
||||
// Purge any invalid accounts
|
||||
if (!account) {
|
||||
@@ -90,7 +90,7 @@ export class AzureAccountProvider implements sqlops.AccountProvider {
|
||||
|
||||
// Attempt to get fresh tokens. If this fails then the account is stale.
|
||||
// NOTE: Based on ADAL implementation, getting tokens should use the refresh token if necessary
|
||||
let task = this.getAccessTokens(account, sqlops.AzureResource.ResourceManagement)
|
||||
let task = this.getAccessTokens(account, azdata.AzureResource.ResourceManagement)
|
||||
.then(
|
||||
() => {
|
||||
return account;
|
||||
@@ -145,7 +145,7 @@ export class AzureAccountProvider implements sqlops.AccountProvider {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
private clearAccountTokens(accountKey: sqlops.AccountKey): Thenable<void> {
|
||||
private clearAccountTokens(accountKey: azdata.AccountKey): Thenable<void> {
|
||||
// Put together a query to look up any tokens associated with the account key
|
||||
let query = <adal.TokenResponse>{ userId: accountKey.accountId };
|
||||
|
||||
@@ -161,12 +161,12 @@ export class AzureAccountProvider implements sqlops.AccountProvider {
|
||||
: Promise.reject(localize('accountProviderNotInitialized', 'Account provider not initialized, cannot perform action'));
|
||||
}
|
||||
|
||||
private getAccessTokens(account: AzureAccount, resource: sqlops.AzureResource): Thenable<AzureAccountSecurityTokenCollection> {
|
||||
private getAccessTokens(account: AzureAccount, resource: azdata.AzureResource): Thenable<AzureAccountSecurityTokenCollection> {
|
||||
let self = this;
|
||||
|
||||
const resourceIdMap = new Map<sqlops.AzureResource, string>([
|
||||
[sqlops.AzureResource.ResourceManagement, self._metadata.settings.armResource.id],
|
||||
[sqlops.AzureResource.Sql, self._metadata.settings.sqlResource.id]
|
||||
const resourceIdMap = new Map<azdata.AzureResource, string>([
|
||||
[azdata.AzureResource.ResourceManagement, self._metadata.settings.armResource.id],
|
||||
[azdata.AzureResource.Sql, self._metadata.settings.sqlResource.id]
|
||||
]);
|
||||
|
||||
let accessTokenPromises: Thenable<void>[] = [];
|
||||
@@ -185,7 +185,7 @@ export class AzureAccountProvider implements sqlops.AccountProvider {
|
||||
if (error) {
|
||||
// TODO: We'll assume for now that the account is stale, though that might not be accurate
|
||||
account.isStale = true;
|
||||
sqlops.accounts.accountUpdated(account);
|
||||
azdata.accounts.accountUpdated(account);
|
||||
|
||||
reject(error);
|
||||
return;
|
||||
@@ -245,7 +245,7 @@ export class AzureAccountProvider implements sqlops.AccountProvider {
|
||||
let title = isAddAccount ?
|
||||
localize('addAccount', 'Add {0} account', self._metadata.displayName) :
|
||||
localize('refreshAccount', 'Refresh {0} account', self._metadata.displayName);
|
||||
return sqlops.accounts.beginAutoOAuthDeviceCode(self._metadata.id, title, oAuth.userCodeInfo.message, oAuth.userCodeInfo.userCode, oAuth.userCodeInfo.verificationUrl)
|
||||
return azdata.accounts.beginAutoOAuthDeviceCode(self._metadata.id, title, oAuth.userCodeInfo.message, oAuth.userCodeInfo.userCode, oAuth.userCodeInfo.verificationUrl)
|
||||
.then(() => {
|
||||
return new Promise<adal.TokenResponse>((resolve, reject) => {
|
||||
let context = oAuth.context;
|
||||
@@ -254,14 +254,14 @@ export class AzureAccountProvider implements sqlops.AccountProvider {
|
||||
if (err) {
|
||||
if (self._autoOAuthCancelled) {
|
||||
// Auto OAuth was cancelled by the user, indicate this with the error we return
|
||||
reject(<sqlops.UserCancelledSignInError>{ userCancelledSignIn: true });
|
||||
reject(<azdata.UserCancelledSignInError>{ userCancelledSignIn: true });
|
||||
} else {
|
||||
// Auto OAuth failed for some other reason
|
||||
sqlops.accounts.endAutoOAuthDeviceCode();
|
||||
azdata.accounts.endAutoOAuthDeviceCode();
|
||||
reject(err);
|
||||
}
|
||||
} else {
|
||||
sqlops.accounts.endAutoOAuthDeviceCode();
|
||||
azdata.accounts.endAutoOAuthDeviceCode();
|
||||
resolve(<adal.TokenResponse>response);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as constants from '../constants';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as events from 'events';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as path from 'path';
|
||||
@@ -27,7 +27,7 @@ export class AzureAccountProviderService implements vscode.Disposable {
|
||||
// MEMBER VARIABLES ////////////////////////////////////////////////////////
|
||||
private _accountDisposals: { [accountProviderId: string]: vscode.Disposable };
|
||||
private _accountProviders: { [accountProviderId: string]: AzureAccountProvider };
|
||||
private _credentialProvider: sqlops.CredentialProvider;
|
||||
private _credentialProvider: azdata.CredentialProvider;
|
||||
private _configChangePromiseChain: Thenable<void>;
|
||||
private _currentConfig: vscode.WorkspaceConfiguration;
|
||||
private _event: events.EventEmitter;
|
||||
@@ -55,7 +55,7 @@ export class AzureAccountProviderService implements vscode.Disposable {
|
||||
// 2a) Store the credential provider for use later
|
||||
// 2b) Register the configuration change handler
|
||||
// 2c) Perform an initial config change handling
|
||||
return sqlops.credentials.getProvider(AzureAccountProviderService.CredentialNamespace)
|
||||
return azdata.credentials.getProvider(AzureAccountProviderService.CredentialNamespace)
|
||||
.then(credProvider => {
|
||||
self._credentialProvider = credProvider;
|
||||
|
||||
@@ -138,7 +138,7 @@ export class AzureAccountProviderService implements vscode.Disposable {
|
||||
let tokenCache = new CredentialServiceTokenCache(self._credentialProvider, tokenCacheKey, tokenCachePath);
|
||||
let accountProvider = new AzureAccountProvider(<AzureAccountProviderMetadata>provider.metadata, tokenCache);
|
||||
self._accountProviders[provider.metadata.id] = accountProvider;
|
||||
self._accountDisposals[provider.metadata.id] = sqlops.accounts.registerAccountProvider(provider.metadata, accountProvider);
|
||||
self._accountDisposals[provider.metadata.id] = azdata.accounts.registerAccountProvider(provider.metadata, accountProvider);
|
||||
resolve();
|
||||
} catch (e) {
|
||||
console.error(`Failed to register account provider: ${e}`);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
/**
|
||||
* Represents a tenant (an Azure Active Directory instance) to which a user has access
|
||||
@@ -123,7 +123,7 @@ export interface ProviderSettings {
|
||||
/**
|
||||
* Extension of account provider metadata to override settings type for Azure account providers
|
||||
*/
|
||||
export interface AzureAccountProviderMetadata extends sqlops.AccountProviderMetadata {
|
||||
export interface AzureAccountProviderMetadata extends azdata.AccountProviderMetadata {
|
||||
/**
|
||||
* Azure specific account provider settings.
|
||||
*/
|
||||
@@ -148,7 +148,7 @@ export interface AzureAccountProperties {
|
||||
/**
|
||||
* Override of the Account type to enforce properties that are AzureAccountProperties
|
||||
*/
|
||||
export interface AzureAccount extends sqlops.Account {
|
||||
export interface AzureAccount extends azdata.Account {
|
||||
/**
|
||||
* AzureAccountProperties specifically used for Azure accounts
|
||||
*/
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as adal from 'adal-node';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as crypto from 'crypto';
|
||||
import * as fs from 'fs';
|
||||
|
||||
@@ -19,7 +19,7 @@ export default class TokenCache implements adal.TokenCache {
|
||||
private _activeOperation: Thenable<any>;
|
||||
|
||||
constructor(
|
||||
private _credentialProvider: sqlops.CredentialProvider,
|
||||
private _credentialProvider: azdata.CredentialProvider,
|
||||
private _credentialServiceKey: string,
|
||||
private _cacheSerializationPath: string
|
||||
) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
import * as constants from './constants';
|
||||
|
||||
@@ -19,64 +19,64 @@ import * as constants from './constants';
|
||||
*/
|
||||
export class ApiWrapper {
|
||||
// Data APIs
|
||||
public registerConnectionProvider(provider: sqlops.ConnectionProvider): vscode.Disposable {
|
||||
return sqlops.dataprotocol.registerConnectionProvider(provider);
|
||||
public registerConnectionProvider(provider: azdata.ConnectionProvider): vscode.Disposable {
|
||||
return azdata.dataprotocol.registerConnectionProvider(provider);
|
||||
}
|
||||
|
||||
public registerObjectExplorerProvider(provider: sqlops.ObjectExplorerProvider): vscode.Disposable {
|
||||
return sqlops.dataprotocol.registerObjectExplorerProvider(provider);
|
||||
public registerObjectExplorerProvider(provider: azdata.ObjectExplorerProvider): vscode.Disposable {
|
||||
return azdata.dataprotocol.registerObjectExplorerProvider(provider);
|
||||
}
|
||||
|
||||
public registerTaskServicesProvider(provider: sqlops.TaskServicesProvider): vscode.Disposable {
|
||||
return sqlops.dataprotocol.registerTaskServicesProvider(provider);
|
||||
public registerTaskServicesProvider(provider: azdata.TaskServicesProvider): vscode.Disposable {
|
||||
return azdata.dataprotocol.registerTaskServicesProvider(provider);
|
||||
}
|
||||
|
||||
public registerFileBrowserProvider(provider: sqlops.FileBrowserProvider): vscode.Disposable {
|
||||
return sqlops.dataprotocol.registerFileBrowserProvider(provider);
|
||||
public registerFileBrowserProvider(provider: azdata.FileBrowserProvider): vscode.Disposable {
|
||||
return azdata.dataprotocol.registerFileBrowserProvider(provider);
|
||||
}
|
||||
|
||||
public registerCapabilitiesServiceProvider(provider: sqlops.CapabilitiesProvider): vscode.Disposable {
|
||||
return sqlops.dataprotocol.registerCapabilitiesServiceProvider(provider);
|
||||
public registerCapabilitiesServiceProvider(provider: azdata.CapabilitiesProvider): vscode.Disposable {
|
||||
return azdata.dataprotocol.registerCapabilitiesServiceProvider(provider);
|
||||
}
|
||||
|
||||
public registerModelViewProvider(widgetId: string, handler: (modelView: sqlops.ModelView) => void): void {
|
||||
return sqlops.ui.registerModelViewProvider(widgetId, handler);
|
||||
public registerModelViewProvider(widgetId: string, handler: (modelView: azdata.ModelView) => void): void {
|
||||
return azdata.ui.registerModelViewProvider(widgetId, handler);
|
||||
}
|
||||
|
||||
public registerWebviewProvider(widgetId: string, handler: (webview: sqlops.DashboardWebview) => void): void {
|
||||
return sqlops.dashboard.registerWebviewProvider(widgetId, handler);
|
||||
public registerWebviewProvider(widgetId: string, handler: (webview: azdata.DashboardWebview) => void): void {
|
||||
return azdata.dashboard.registerWebviewProvider(widgetId, handler);
|
||||
}
|
||||
|
||||
public createDialog(title: string): sqlops.window.Dialog {
|
||||
return sqlops.window.createModelViewDialog(title);
|
||||
public createDialog(title: string): azdata.window.Dialog {
|
||||
return azdata.window.createModelViewDialog(title);
|
||||
}
|
||||
|
||||
public openDialog(dialog: sqlops.window.Dialog): void {
|
||||
return sqlops.window.openDialog(dialog);
|
||||
public openDialog(dialog: azdata.window.Dialog): void {
|
||||
return azdata.window.openDialog(dialog);
|
||||
}
|
||||
|
||||
public closeDialog(dialog: sqlops.window.Dialog): void {
|
||||
return sqlops.window.closeDialog(dialog);
|
||||
public closeDialog(dialog: azdata.window.Dialog): void {
|
||||
return azdata.window.closeDialog(dialog);
|
||||
}
|
||||
|
||||
public registerTaskHandler(taskId: string, handler: (profile: sqlops.IConnectionProfile) => void): void {
|
||||
sqlops.tasks.registerTask(taskId, handler);
|
||||
public registerTaskHandler(taskId: string, handler: (profile: azdata.IConnectionProfile) => void): void {
|
||||
azdata.tasks.registerTask(taskId, handler);
|
||||
}
|
||||
|
||||
public startBackgroundOperation(operationInfo: sqlops.BackgroundOperationInfo): void {
|
||||
sqlops.tasks.startBackgroundOperation(operationInfo);
|
||||
public startBackgroundOperation(operationInfo: azdata.BackgroundOperationInfo): void {
|
||||
azdata.tasks.startBackgroundOperation(operationInfo);
|
||||
}
|
||||
|
||||
public getActiveConnections(): Thenable<sqlops.connection.Connection[]> {
|
||||
return sqlops.connection.getActiveConnections();
|
||||
public getActiveConnections(): Thenable<azdata.connection.Connection[]> {
|
||||
return azdata.connection.getActiveConnections();
|
||||
}
|
||||
|
||||
public getCurrentConnection(): Thenable<sqlops.connection.Connection> {
|
||||
return sqlops.connection.getCurrentConnection();
|
||||
public getCurrentConnection(): Thenable<azdata.connection.ConnectionProfile> {
|
||||
return azdata.connection.getCurrentConnection();
|
||||
}
|
||||
|
||||
public createModelViewEditor(title: string, options?: sqlops.ModelViewEditorOptions): sqlops.workspace.ModelViewEditor {
|
||||
return sqlops.workspace.createModelViewEditor(title, options);
|
||||
public createModelViewEditor(title: string, options?: azdata.ModelViewEditorOptions): azdata.workspace.ModelViewEditor {
|
||||
return azdata.workspace.createModelViewEditor(title, options);
|
||||
}
|
||||
|
||||
// VSCode APIs
|
||||
@@ -195,31 +195,31 @@ export class ApiWrapper {
|
||||
return vscode.window.createOutputChannel(name);
|
||||
}
|
||||
|
||||
public createWizardPage(title: string): sqlops.window.WizardPage {
|
||||
return sqlops.window.createWizardPage(title);
|
||||
public createWizardPage(title: string): azdata.window.WizardPage {
|
||||
return azdata.window.createWizardPage(title);
|
||||
}
|
||||
|
||||
public registerCompletionItemProvider(selector: vscode.DocumentSelector, provider: vscode.CompletionItemProvider, ...triggerCharacters: string[]): vscode.Disposable {
|
||||
return vscode.languages.registerCompletionItemProvider(selector, provider, ...triggerCharacters);
|
||||
}
|
||||
|
||||
public createTab(title: string): sqlops.window.DialogTab {
|
||||
return sqlops.window.createTab(title);
|
||||
public createTab(title: string): azdata.window.DialogTab {
|
||||
return azdata.window.createTab(title);
|
||||
}
|
||||
|
||||
// Account APIs
|
||||
public getAllAccounts(): Thenable<sqlops.Account[]> {
|
||||
return sqlops.accounts.getAllAccounts();
|
||||
public getAllAccounts(): Thenable<azdata.Account[]> {
|
||||
return azdata.accounts.getAllAccounts();
|
||||
}
|
||||
|
||||
public getSecurityToken(account: sqlops.Account, resource: sqlops.AzureResource): Thenable<{}> {
|
||||
return sqlops.accounts.getSecurityToken(account, resource);
|
||||
public getSecurityToken(account: azdata.Account, resource: azdata.AzureResource): Thenable<{}> {
|
||||
return azdata.accounts.getSecurityToken(account, resource);
|
||||
}
|
||||
|
||||
public readonly onDidChangeAccounts = sqlops.accounts.onDidChangeAccounts;
|
||||
public readonly onDidChangeAccounts = azdata.accounts.onDidChangeAccounts;
|
||||
|
||||
// Connection APIs
|
||||
public openConnectionDialog(providers: string[], initialConnectionProfile?: sqlops.IConnectionProfile, connectionCompletionOptions?: sqlops.IConnectionCompletionOptions): Thenable<sqlops.connection.Connection> {
|
||||
return sqlops.connection.openConnectionDialog(providers, initialConnectionProfile, connectionCompletionOptions);
|
||||
public openConnectionDialog(providers: string[], initialConnectionProfile?: azdata.IConnectionProfile, connectionCompletionOptions?: azdata.IConnectionCompletionOptions): Thenable<azdata.connection.Connection> {
|
||||
return azdata.connection.openConnectionDialog(providers, initialConnectionProfile, connectionCompletionOptions);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { TreeDataProvider } from 'vscode';
|
||||
import { DataProvider, Account } from 'sqlops';
|
||||
import { TreeItem } from 'sqlops';
|
||||
import { DataProvider, Account } from 'azdata';
|
||||
import { TreeItem } from 'azdata';
|
||||
|
||||
export namespace azureResource {
|
||||
export interface IAzureResourceProvider extends DataProvider {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import { window, QuickPickItem } from 'vscode';
|
||||
import { AzureResource } from 'sqlops';
|
||||
import { AzureResource } from 'azdata';
|
||||
import { TokenCredentials } from 'ms-rest';
|
||||
import { AppContext } from '../appContext';
|
||||
import * as nls from 'vscode-nls';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import { ServiceClientCredentials } from 'ms-rest';
|
||||
import { Account, DidChangeAccountsParams } from 'sqlops';
|
||||
import { Account, DidChangeAccountsParams } from 'azdata';
|
||||
import { Event } from 'vscode';
|
||||
|
||||
import { azureResource } from './azure-resource';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
|
||||
import { NodeInfo } from 'sqlops';
|
||||
import { NodeInfo } from 'azdata';
|
||||
|
||||
import { TreeNode } from './treeNode';
|
||||
import { AzureResourceItemType } from './constants';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import { IConnectionProfile } from 'sqlops';
|
||||
import { IConnectionProfile } from 'azdata';
|
||||
import { AppContext } from '../../../appContext';
|
||||
|
||||
import { TreeNode } from '../../treeNode';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import { AzureResource } from 'sqlops';
|
||||
import { AzureResource } from 'azdata';
|
||||
import { TreeItem, TreeItemCollapsibleState, ExtensionContext } from 'vscode';
|
||||
import { TokenCredentials } from 'ms-rest';
|
||||
import * as nls from 'vscode-nls';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import { IConnectionProfile } from 'sqlops';
|
||||
import { IConnectionProfile } from 'azdata';
|
||||
import { AppContext } from '../../../appContext';
|
||||
|
||||
import { TreeNode } from '../../treeNode';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import { AzureResource } from 'sqlops';
|
||||
import { AzureResource } from 'azdata';
|
||||
import { TreeItem, TreeItemCollapsibleState, ExtensionContext } from 'vscode';
|
||||
import { TokenCredentials } from 'ms-rest';
|
||||
import * as nls from 'vscode-nls';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import { extensions, TreeItem } from 'vscode';
|
||||
import { Account } from 'sqlops';
|
||||
import { Account } from 'azdata';
|
||||
|
||||
import { azureResource } from './azure-resource';
|
||||
import { IAzureResourceNodeWithProviderId } from './interfaces';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import { NodeInfo } from 'sqlops';
|
||||
import { NodeInfo } from 'azdata';
|
||||
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import { Event } from 'vscode';
|
||||
import { Account, DidChangeAccountsParams } from 'sqlops';
|
||||
import { Account, DidChangeAccountsParams } from 'azdata';
|
||||
import { ApiWrapper } from '../../apiWrapper';
|
||||
|
||||
import { IAzureResourceAccountService } from '../interfaces';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import { WorkspaceConfiguration, ConfigurationTarget } from 'vscode';
|
||||
import { Account } from 'sqlops';
|
||||
import { Account } from 'azdata';
|
||||
|
||||
import { azureResource } from '../azure-resource';
|
||||
import { IAzureResourceSubscriptionFilterService, IAzureResourceCacheService } from '../interfaces';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import { Account } from 'sqlops';
|
||||
import { Account } from 'azdata';
|
||||
import { ServiceClientCredentials } from 'ms-rest';
|
||||
import { SubscriptionClient } from 'azure-arm-resource';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
|
||||
import { NodeInfo } from 'sqlops';
|
||||
import { NodeInfo } from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
|
||||
import { Account, NodeInfo, AzureResource } from 'sqlops';
|
||||
import { Account, NodeInfo, AzureResource } from 'azdata';
|
||||
import { TokenCredentials } from 'ms-rest';
|
||||
import { AppContext } from '../../appContext';
|
||||
import * as nls from 'vscode-nls';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
|
||||
import { Account, NodeInfo } from 'sqlops';
|
||||
import { Account, NodeInfo } from 'azdata';
|
||||
import { AppContext } from '../../appContext';
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
@@ -35,7 +35,7 @@ export class AzureResourceTreeProvider implements TreeDataProvider<TreeNode>, IA
|
||||
if (!this.isSystemInitialized && !this._loadingTimer) {
|
||||
this._loadingTimer = setInterval(async () => {
|
||||
try {
|
||||
// Call sqlops.accounts.getAllAccounts() to determine whether the system has been initialized.
|
||||
// Call azdata.accounts.getAllAccounts() to determine whether the system has been initialized.
|
||||
await this.appContext.getService<IAzureResourceAccountService>(AzureResourceServiceNames.accountService).getAccounts();
|
||||
|
||||
// System has been initialized
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
type TreeNodePredicate = (node: TreeNode) => boolean;
|
||||
@@ -66,7 +66,7 @@ export abstract class TreeNode {
|
||||
public abstract getChildren(refreshChildren: boolean): TreeNode[] | Promise<TreeNode[]>;
|
||||
public abstract getTreeItem(): vscode.TreeItem | Promise<vscode.TreeItem>;
|
||||
|
||||
public abstract getNodeInfo(): sqlops.NodeInfo;
|
||||
public abstract getNodeInfo(): azdata.NodeInfo;
|
||||
|
||||
/**
|
||||
* The value to use for this node in the node path
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import ControllerBase from './controllerBase';
|
||||
import { DidChangeAccountsParams } from 'sqlops';
|
||||
import { DidChangeAccountsParams } from 'azdata';
|
||||
|
||||
import {
|
||||
IAzureResourceCacheService,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import * as should from 'should';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import 'mocha';
|
||||
|
||||
@@ -24,7 +24,7 @@ let mockApiWrapper: TypeMoq.IMock<ApiWrapper>;
|
||||
let mockExtensionContext: TypeMoq.IMock<vscode.ExtensionContext>;
|
||||
|
||||
// Mock test data
|
||||
const mockAccount: sqlops.Account = {
|
||||
const mockAccount: azdata.Account = {
|
||||
key: {
|
||||
accountId: 'mock_account',
|
||||
providerId: 'mock_provider'
|
||||
@@ -103,7 +103,7 @@ describe('AzureResourceDatabaseTreeDataProvider.getChildren', function(): void {
|
||||
mockApiWrapper = TypeMoq.Mock.ofType<ApiWrapper>();
|
||||
mockExtensionContext = TypeMoq.Mock.ofType<vscode.ExtensionContext>();
|
||||
|
||||
mockApiWrapper.setup((o) => o.getSecurityToken(mockAccount, sqlops.AzureResource.ResourceManagement)).returns(() => Promise.resolve(mockTokens));
|
||||
mockApiWrapper.setup((o) => o.getSecurityToken(mockAccount, azdata.AzureResource.ResourceManagement)).returns(() => Promise.resolve(mockTokens));
|
||||
mockDatabaseService.setup((o) => o.getDatabases(mockSubscription, TypeMoq.It.isAny())).returns(() => Promise.resolve(mockDatabases));
|
||||
mockExtensionContext.setup((o) => o.asAbsolutePath(TypeMoq.It.isAnyString())).returns(() => TypeMoq.It.isAnyString());
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import * as should from 'should';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import 'mocha';
|
||||
|
||||
@@ -24,7 +24,7 @@ let mockApiWrapper: TypeMoq.IMock<ApiWrapper>;
|
||||
let mockExtensionContext: TypeMoq.IMock<vscode.ExtensionContext>;
|
||||
|
||||
// Mock test data
|
||||
const mockAccount: sqlops.Account = {
|
||||
const mockAccount: azdata.Account = {
|
||||
key: {
|
||||
accountId: 'mock_account',
|
||||
providerId: 'mock_provider'
|
||||
@@ -103,7 +103,7 @@ describe('AzureResourceDatabaseServerTreeDataProvider.getChildren', function():
|
||||
mockApiWrapper = TypeMoq.Mock.ofType<ApiWrapper>();
|
||||
mockExtensionContext = TypeMoq.Mock.ofType<vscode.ExtensionContext>();
|
||||
|
||||
mockApiWrapper.setup((o) => o.getSecurityToken(mockAccount, sqlops.AzureResource.ResourceManagement)).returns(() => Promise.resolve(mockTokens));
|
||||
mockApiWrapper.setup((o) => o.getSecurityToken(mockAccount, azdata.AzureResource.ResourceManagement)).returns(() => Promise.resolve(mockTokens));
|
||||
mockDatabaseServerService.setup((o) => o.getDatabaseServers(mockSubscription, TypeMoq.It.isAny())).returns(() => Promise.resolve(mockDatabaseServers));
|
||||
mockExtensionContext.setup((o) => o.asAbsolutePath(TypeMoq.It.isAnyString())).returns(() => TypeMoq.It.isAnyString());
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import * as should from 'should';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import 'mocha';
|
||||
import { fail } from 'assert';
|
||||
|
||||
@@ -15,7 +15,7 @@ import { azureResource } from '../../azureResource/azure-resource';
|
||||
import { AzureResourceService } from '../../azureResource/resourceService';
|
||||
|
||||
// Mock test data
|
||||
const mockAccount: sqlops.Account = {
|
||||
const mockAccount: azdata.Account = {
|
||||
key: {
|
||||
accountId: 'mock_account',
|
||||
providerId: 'mock_provider'
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import * as should from 'should';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import 'mocha';
|
||||
|
||||
@@ -18,7 +18,7 @@ import { AzureResourceResourceTreeNode } from '../../azureResource/resourceTreeN
|
||||
const resourceService = AzureResourceService.getInstance();
|
||||
|
||||
// Mock test data
|
||||
const mockAccount: sqlops.Account = {
|
||||
const mockAccount: azdata.Account = {
|
||||
key: {
|
||||
accountId: 'mock_account',
|
||||
providerId: 'mock_provider'
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import * as should from 'should';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import 'mocha';
|
||||
import { TokenCredentials } from 'ms-rest';
|
||||
@@ -42,7 +42,7 @@ let mockTreeChangeHandler: TypeMoq.IMock<IAzureResourceTreeChangeHandler>;
|
||||
// Mock test data
|
||||
const mockTenantId = 'mock_tenant_id';
|
||||
|
||||
const mockAccount: sqlops.Account = {
|
||||
const mockAccount: azdata.Account = {
|
||||
key: {
|
||||
accountId: 'mock_account',
|
||||
providerId: 'mock_provider'
|
||||
@@ -105,7 +105,7 @@ describe('AzureResourceAccountTreeNode.info', function(): void {
|
||||
mockAppContext.registerService<IAzureResourceSubscriptionFilterService>(AzureResourceServiceNames.subscriptionFilterService, mockSubscriptionFilterService.object);
|
||||
mockAppContext.registerService<IAzureResourceTenantService>(AzureResourceServiceNames.tenantService, mockTenantService.object);
|
||||
|
||||
mockApiWrapper.setup((o) => o.getSecurityToken(mockAccount, sqlops.AzureResource.ResourceManagement)).returns(() => Promise.resolve(mockTokens));
|
||||
mockApiWrapper.setup((o) => o.getSecurityToken(mockAccount, azdata.AzureResource.ResourceManagement)).returns(() => Promise.resolve(mockTokens));
|
||||
mockCacheService.setup((o) => o.generateKey(TypeMoq.It.isAnyString())).returns(() => generateGuid());
|
||||
mockCacheService.setup((o) => o.get(TypeMoq.It.isAnyString())).returns(() => mockSubscriptionCache);
|
||||
mockCacheService.setup((o) => o.update(TypeMoq.It.isAnyString(), TypeMoq.It.isAny())).returns(() => mockSubscriptionCache = mockSubscriptions);
|
||||
@@ -193,7 +193,7 @@ describe('AzureResourceAccountTreeNode.getChildren', function(): void {
|
||||
mockAppContext.registerService<IAzureResourceSubscriptionFilterService>(AzureResourceServiceNames.subscriptionFilterService, mockSubscriptionFilterService.object);
|
||||
mockAppContext.registerService<IAzureResourceTenantService>(AzureResourceServiceNames.tenantService, mockTenantService.object);
|
||||
|
||||
mockApiWrapper.setup((o) => o.getSecurityToken(mockAccount, sqlops.AzureResource.ResourceManagement)).returns(() => Promise.resolve(mockTokens));
|
||||
mockApiWrapper.setup((o) => o.getSecurityToken(mockAccount, azdata.AzureResource.ResourceManagement)).returns(() => Promise.resolve(mockTokens));
|
||||
mockCacheService.setup((o) => o.generateKey(TypeMoq.It.isAnyString())).returns(() => generateGuid());
|
||||
mockCacheService.setup((o) => o.get(TypeMoq.It.isAnyString())).returns(() => mockSubscriptionCache);
|
||||
mockCacheService.setup((o) => o.update(TypeMoq.It.isAnyString(), TypeMoq.It.isAny())).returns(() => mockSubscriptionCache = mockSubscriptions);
|
||||
@@ -208,7 +208,7 @@ describe('AzureResourceAccountTreeNode.getChildren', function(): void {
|
||||
|
||||
const children = await accountTreeNode.getChildren();
|
||||
|
||||
mockApiWrapper.verify((o) => o.getSecurityToken(mockAccount, sqlops.AzureResource.ResourceManagement), TypeMoq.Times.once());
|
||||
mockApiWrapper.verify((o) => o.getSecurityToken(mockAccount, azdata.AzureResource.ResourceManagement), TypeMoq.Times.once());
|
||||
mockSubscriptionService.verify((o) => o.getSubscriptions(mockAccount, mockCredential), TypeMoq.Times.once());
|
||||
mockCacheService.verify((o) => o.get(TypeMoq.It.isAnyString()), TypeMoq.Times.exactly(0));
|
||||
mockCacheService.verify((o) => o.update(TypeMoq.It.isAnyString(), TypeMoq.It.isAny()), TypeMoq.Times.once());
|
||||
@@ -243,7 +243,7 @@ describe('AzureResourceAccountTreeNode.getChildren', function(): void {
|
||||
await accountTreeNode.getChildren();
|
||||
const children = await accountTreeNode.getChildren();
|
||||
|
||||
mockApiWrapper.verify((o) => o.getSecurityToken(mockAccount, sqlops.AzureResource.ResourceManagement), TypeMoq.Times.once());
|
||||
mockApiWrapper.verify((o) => o.getSecurityToken(mockAccount, azdata.AzureResource.ResourceManagement), TypeMoq.Times.once());
|
||||
mockSubscriptionService.verify((o) => o.getSubscriptions(mockAccount, mockCredential), TypeMoq.Times.once());
|
||||
mockCacheService.verify((o) => o.get(TypeMoq.It.isAnyString()), TypeMoq.Times.once());
|
||||
mockCacheService.verify((o) => o.update(TypeMoq.It.isAnyString(), TypeMoq.It.isAny()), TypeMoq.Times.once());
|
||||
@@ -299,7 +299,7 @@ describe('AzureResourceAccountTreeNode.getChildren', function(): void {
|
||||
|
||||
const children = await accountTreeNode.getChildren();
|
||||
|
||||
mockApiWrapper.verify((o) => o.getSecurityToken(mockAccount, sqlops.AzureResource.ResourceManagement), TypeMoq.Times.once());
|
||||
mockApiWrapper.verify((o) => o.getSecurityToken(mockAccount, azdata.AzureResource.ResourceManagement), TypeMoq.Times.once());
|
||||
mockSubscriptionService.verify((o) => o.getSubscriptions(mockAccount, mockCredential), TypeMoq.Times.once());
|
||||
mockSubscriptionFilterService.verify((o) => o.getSelectedSubscriptions(mockAccount), TypeMoq.Times.once());
|
||||
mockCacheService.verify((o) => o.get(TypeMoq.It.isAnyString()), TypeMoq.Times.never());
|
||||
@@ -332,7 +332,7 @@ describe('AzureResourceAccountTreeNode.clearCache', function() : void {
|
||||
mockAppContext.registerService<IAzureResourceSubscriptionFilterService>(AzureResourceServiceNames.subscriptionFilterService, mockSubscriptionFilterService.object);
|
||||
mockAppContext.registerService<IAzureResourceTenantService>(AzureResourceServiceNames.tenantService, mockTenantService.object);
|
||||
|
||||
mockApiWrapper.setup((o) => o.getSecurityToken(mockAccount, sqlops.AzureResource.ResourceManagement)).returns(() => Promise.resolve(mockTokens));
|
||||
mockApiWrapper.setup((o) => o.getSecurityToken(mockAccount, azdata.AzureResource.ResourceManagement)).returns(() => Promise.resolve(mockTokens));
|
||||
mockCacheService.setup((o) => o.generateKey(TypeMoq.It.isAnyString())).returns(() => generateGuid());
|
||||
mockCacheService.setup((o) => o.get(TypeMoq.It.isAnyString())).returns(() => mockSubscriptionCache);
|
||||
mockCacheService.setup((o) => o.update(TypeMoq.It.isAnyString(), TypeMoq.It.isAny())).returns(() => mockSubscriptionCache = mockSubscriptions);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import * as should from 'should';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import 'mocha';
|
||||
import { AppContext } from '../../../appContext';
|
||||
@@ -32,7 +32,7 @@ let mockCacheService: TypeMoq.IMock<IAzureResourceCacheService>;
|
||||
let mockTreeChangeHandler: TypeMoq.IMock<IAzureResourceTreeChangeHandler>;
|
||||
|
||||
// Mock test data
|
||||
const mockAccount: sqlops.Account = {
|
||||
const mockAccount: azdata.Account = {
|
||||
key: {
|
||||
accountId: 'mock_account',
|
||||
providerId: 'mock_provider'
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import * as vscode from 'vscode';
|
||||
import * as should from 'should';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import 'mocha';
|
||||
import { AppContext } from '../../../appContext';
|
||||
import { ApiWrapper } from '../../../apiWrapper';
|
||||
@@ -30,7 +30,7 @@ let mockCacheService: TypeMoq.IMock<IAzureResourceCacheService>;
|
||||
let mockAccountService: TypeMoq.IMock<IAzureResourceAccountService>;
|
||||
|
||||
// Mock test data
|
||||
const mockAccount1: sqlops.Account = {
|
||||
const mockAccount1: azdata.Account = {
|
||||
key: {
|
||||
accountId: 'mock_account_1',
|
||||
providerId: 'mock_provider'
|
||||
@@ -43,7 +43,7 @@ const mockAccount1: sqlops.Account = {
|
||||
properties: undefined,
|
||||
isStale: false
|
||||
};
|
||||
const mockAccount2: sqlops.Account = {
|
||||
const mockAccount2: azdata.Account = {
|
||||
key: {
|
||||
accountId: 'mock_account_2',
|
||||
providerId: 'mock_provider'
|
||||
|
||||
4
extensions/azurecore/src/typings/ref.d.ts
vendored
4
extensions/azurecore/src/typings/ref.d.ts
vendored
@@ -4,6 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
/// <reference path='../../../../src/vs/vscode.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/sqlops.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/sqlops.proposed.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/azdata.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/azdata.proposed.d.ts'/>
|
||||
/// <reference types='@types/node'/>
|
||||
@@ -4,6 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
/// <reference path='../../../../src/vs/vscode.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/sqlops.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/sqlops.proposed.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/azdata.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/azdata.proposed.d.ts'/>
|
||||
/// <reference types='@types/node'/>
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { WizardPageBase } from '../../wizardPageBase';
|
||||
import { CreateClusterWizard } from '../createClusterWizard';
|
||||
import * as nls from 'vscode-nls';
|
||||
@@ -25,7 +25,7 @@ export class ClusterProfilePage extends WizardPageBase<CreateClusterWizard> {
|
||||
});
|
||||
}
|
||||
|
||||
protected initialize(view: sqlops.ModelView): Thenable<void> {
|
||||
protected initialize(view: azdata.ModelView): Thenable<void> {
|
||||
let formBuilder = view.modelBuilder.formContainer();
|
||||
let form = formBuilder.component();
|
||||
return view.initializeModel(form);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as os from 'os';
|
||||
import { WizardPageBase } from '../../wizardPageBase';
|
||||
@@ -17,10 +17,10 @@ const localize = nls.loadMessageBundle();
|
||||
const ClusterRadioButtonGroupName = 'cluster';
|
||||
|
||||
export class SelectExistingClusterPage extends WizardPageBase<CreateClusterWizard> {
|
||||
private existingClusterControl: sqlops.FlexContainer;
|
||||
private clusterContextsLabel: sqlops.TextComponent;
|
||||
private errorLoadingClustersLabel: sqlops.TextComponent;
|
||||
private clusterContextContainer: sqlops.DivContainer;
|
||||
private existingClusterControl: azdata.FlexContainer;
|
||||
private clusterContextsLabel: azdata.TextComponent;
|
||||
private errorLoadingClustersLabel: azdata.TextComponent;
|
||||
private clusterContextContainer: azdata.DivContainer;
|
||||
|
||||
constructor(wizard: CreateClusterWizard) {
|
||||
super(localize('bdc-create.selectTargetClusterPageTitle', 'Where do you want to deploy this SQL Server big data cluster?'),
|
||||
@@ -28,7 +28,7 @@ export class SelectExistingClusterPage extends WizardPageBase<CreateClusterWizar
|
||||
wizard);
|
||||
}
|
||||
|
||||
protected initialize(view: sqlops.ModelView): Thenable<void> {
|
||||
protected initialize(view: azdata.ModelView): Thenable<void> {
|
||||
this.initExistingClusterControl(view);
|
||||
let formBuilder = view.modelBuilder.formContainer().withFormItems(
|
||||
[
|
||||
@@ -56,14 +56,14 @@ export class SelectExistingClusterPage extends WizardPageBase<CreateClusterWizar
|
||||
if (!clusterSelected) {
|
||||
this.wizard.wizardObject.message = {
|
||||
text: localize('bdc-create.ClusterContextNotSelectedMessage', 'Please select a cluster context.'),
|
||||
level: sqlops.window.MessageLevel.Error
|
||||
level: azdata.window.MessageLevel.Error
|
||||
};
|
||||
}
|
||||
return clusterSelected;
|
||||
});
|
||||
}
|
||||
|
||||
private initExistingClusterControl(view: sqlops.ModelView): void {
|
||||
private initExistingClusterControl(view: azdata.ModelView): void {
|
||||
let self = this;
|
||||
let configFileLabel = view.modelBuilder.text().withProperties({ value: localize('bdc-create.kubeConfigFileLabelText', 'Kube config file path') }).component();
|
||||
let configFileInput = view.modelBuilder.inputBox().withProperties({ width: '300px' }).component();
|
||||
@@ -104,7 +104,7 @@ export class SelectExistingClusterPage extends WizardPageBase<CreateClusterWizar
|
||||
let clusters = await self.wizard.model.loadClusters();
|
||||
if (clusters.length !== 0) {
|
||||
let options = clusters.map(cluster => {
|
||||
let option = view.modelBuilder.radioButton().withProperties<sqlops.RadioButtonProperties>({
|
||||
let option = view.modelBuilder.radioButton().withProperties<azdata.RadioButtonProperties>({
|
||||
label: cluster.contextName,
|
||||
checked: cluster.active,
|
||||
name: ClusterRadioButtonGroupName
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { WizardPageBase } from '../../wizardPageBase';
|
||||
import { TargetClusterTypeInfo, ToolInstallationStatus, ToolInfo } from '../../../interfaces';
|
||||
import * as nls from 'vscode-nls';
|
||||
@@ -16,13 +16,13 @@ const InstallToolsButtonText = localize('bdc-create.InstallToolsText', 'Install
|
||||
const InstallingButtonText = localize('bdc-create.InstallingButtonText', 'Installing...');
|
||||
|
||||
export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWizard> {
|
||||
private cards: sqlops.CardComponent[];
|
||||
private toolsTable: sqlops.TableComponent;
|
||||
private formBuilder: sqlops.FormBuilder;
|
||||
private form: sqlops.FormContainer;
|
||||
private installToolsButton: sqlops.window.Button;
|
||||
private toolsLoadingWrapper: sqlops.LoadingComponent;
|
||||
private refreshToolsButton: sqlops.window.Button;
|
||||
private cards: azdata.CardComponent[];
|
||||
private toolsTable: azdata.TableComponent;
|
||||
private formBuilder: azdata.FormBuilder;
|
||||
private form: azdata.FormContainer;
|
||||
private installToolsButton: azdata.window.Button;
|
||||
private toolsLoadingWrapper: azdata.LoadingComponent;
|
||||
private refreshToolsButton: azdata.window.Button;
|
||||
private isValid: boolean = false;
|
||||
private isLoading: boolean = false;
|
||||
private requiredTools: ToolInfo[];
|
||||
@@ -31,7 +31,7 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
|
||||
super(localize('bdc-create.selectTargetClusterTypePageTitle', 'Where do you want to deploy this SQL Server big data cluster?'),
|
||||
localize('bdc-create.selectTargetClusterTypePageDescription', 'Choose the target environment and then install the required tools.'),
|
||||
wizard);
|
||||
this.installToolsButton = sqlops.window.createButton(InstallToolsButtonText);
|
||||
this.installToolsButton = azdata.window.createButton(InstallToolsButtonText);
|
||||
this.installToolsButton.hidden = true;
|
||||
this.installToolsButton.onClick(async () => {
|
||||
this.wizard.wizardObject.message = null;
|
||||
@@ -54,7 +54,7 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
|
||||
});
|
||||
this.wizard.addButton(this.installToolsButton);
|
||||
|
||||
this.refreshToolsButton = sqlops.window.createButton(localize('bdc-create.RefreshToolsButtonText', 'Refresh Status'));
|
||||
this.refreshToolsButton = azdata.window.createButton(localize('bdc-create.RefreshToolsButtonText', 'Refresh Status'));
|
||||
this.refreshToolsButton.hidden = true;
|
||||
this.refreshToolsButton.onClick(() => {
|
||||
this.updateRequiredToolStatus();
|
||||
@@ -62,7 +62,7 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
|
||||
this.wizard.addButton(this.refreshToolsButton);
|
||||
}
|
||||
|
||||
protected initialize(view: sqlops.ModelView): Thenable<void> {
|
||||
protected initialize(view: azdata.ModelView): Thenable<void> {
|
||||
let self = this;
|
||||
self.registerNavigationValidator();
|
||||
return self.wizard.model.getAllTargetClusterTypeInfo().then((clusterTypes) => {
|
||||
@@ -74,20 +74,20 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
|
||||
});
|
||||
let cardsContainer = view.modelBuilder.flexContainer().withItems(self.cards, { flex: '0 0 auto' }).withLayout({ flexFlow: 'row', alignItems: 'left' }).component();
|
||||
|
||||
let toolColumn: sqlops.TableColumn = {
|
||||
let toolColumn: azdata.TableColumn = {
|
||||
value: localize('bdc-create.toolNameColumnHeader', 'Tool'),
|
||||
width: 100
|
||||
};
|
||||
let descriptionColumn: sqlops.TableColumn = {
|
||||
let descriptionColumn: azdata.TableColumn = {
|
||||
value: localize('bdc-create.toolDescriptionColumnHeader', 'Description'),
|
||||
width: 200
|
||||
};
|
||||
let statusColumn: sqlops.TableColumn = {
|
||||
let statusColumn: azdata.TableColumn = {
|
||||
value: localize('bdc-create.toolStatusColumnHeader', 'Status'),
|
||||
width: 100
|
||||
};
|
||||
|
||||
self.toolsTable = view.modelBuilder.table().withProperties<sqlops.TableComponentProperties>({
|
||||
self.toolsTable = view.modelBuilder.table().withProperties<azdata.TableComponentProperties>({
|
||||
height: 150,
|
||||
data: [],
|
||||
columns: [toolColumn, descriptionColumn, statusColumn],
|
||||
@@ -125,7 +125,7 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
|
||||
this.wizard.wizardObject.registerNavigationValidator(() => {
|
||||
if (this.isLoading) {
|
||||
let messageText = localize('bdc-create.ToolsRefreshingText', 'Please wait while the required tools status is being refreshed.');
|
||||
let messageLevel = sqlops.window.MessageLevel.Information;
|
||||
let messageLevel = azdata.window.MessageLevel.Information;
|
||||
this.wizard.wizardObject.message = {
|
||||
level: messageLevel,
|
||||
text: messageText
|
||||
@@ -137,7 +137,7 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
|
||||
localize('bdc-create.TargetClusterTypeNotSelectedText', 'Please select a target cluster type.') :
|
||||
localize('bdc-create.MissingToolsText', 'Please install the required tools.');
|
||||
this.wizard.wizardObject.message = {
|
||||
level: sqlops.window.MessageLevel.Error,
|
||||
level: azdata.window.MessageLevel.Error,
|
||||
text: messageText
|
||||
};
|
||||
}
|
||||
@@ -150,10 +150,10 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
|
||||
this.refreshToolsButton.hidden = true;
|
||||
}
|
||||
|
||||
private createCard(view: sqlops.ModelView, targetClusterTypeInfo: TargetClusterTypeInfo): sqlops.CardComponent {
|
||||
private createCard(view: azdata.ModelView, targetClusterTypeInfo: TargetClusterTypeInfo): azdata.CardComponent {
|
||||
let self = this;
|
||||
let card = view.modelBuilder.card().withProperties<sqlops.CardProperties>({
|
||||
cardType: sqlops.CardType.VerticalButton,
|
||||
let card = view.modelBuilder.card().withProperties<azdata.CardProperties>({
|
||||
cardType: azdata.CardType.VerticalButton,
|
||||
iconPath: {
|
||||
dark: self.wizard.context.asAbsolutePath(targetClusterTypeInfo.iconPath.dark),
|
||||
light: self.wizard.context.asAbsolutePath(targetClusterTypeInfo.iconPath.light)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { WizardPageBase } from '../../wizardPageBase';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { ClusterPorts, ContainerRegistryInfo } from '../../../interfaces';
|
||||
@@ -22,7 +22,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
wizard);
|
||||
}
|
||||
|
||||
protected initialize(view: sqlops.ModelView): Thenable<void> {
|
||||
protected initialize(view: azdata.ModelView): Thenable<void> {
|
||||
let clusterPorts: ClusterPorts;
|
||||
let containerRegistryInfo: ContainerRegistryInfo;
|
||||
|
||||
@@ -41,7 +41,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
label: localize('bdc-create.AdminUsernameText', 'Admin username'),
|
||||
isRequiredField: true,
|
||||
inputWidth: UserNameInputWidth
|
||||
}, (inputBox: sqlops.InputBoxComponent) => {
|
||||
}, (inputBox: azdata.InputBoxComponent) => {
|
||||
this.wizard.model.adminUserName = inputBox.value;
|
||||
});
|
||||
let adminPasswordInput = this.createInputWithLabel(view, {
|
||||
@@ -49,7 +49,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
isRequiredField: true,
|
||||
inputType: 'password',
|
||||
inputWidth: UserNameInputWidth
|
||||
}, (inputBox: sqlops.InputBoxComponent) => {
|
||||
}, (inputBox: azdata.InputBoxComponent) => {
|
||||
this.wizard.model.adminPassword = inputBox.value;
|
||||
});
|
||||
|
||||
@@ -59,7 +59,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
isRequiredField: true,
|
||||
inputWidth: PortInputWidth,
|
||||
initialValue: clusterPorts.sql
|
||||
}, (inputBox: sqlops.InputBoxComponent) => {
|
||||
}, (inputBox: azdata.InputBoxComponent) => {
|
||||
this.wizard.model.sqlPort = inputBox.value;
|
||||
});
|
||||
let knoxPortInput = this.createInputWithLabel(view, {
|
||||
@@ -67,7 +67,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
isRequiredField: true,
|
||||
inputWidth: PortInputWidth,
|
||||
initialValue: clusterPorts.knox
|
||||
}, (inputBox: sqlops.InputBoxComponent) => {
|
||||
}, (inputBox: azdata.InputBoxComponent) => {
|
||||
this.wizard.model.knoxPort = inputBox.value;
|
||||
});
|
||||
let controllerPortInput = this.createInputWithLabel(view, {
|
||||
@@ -75,7 +75,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
isRequiredField: true,
|
||||
inputWidth: PortInputWidth,
|
||||
initialValue: clusterPorts.controller
|
||||
}, (inputBox: sqlops.InputBoxComponent) => {
|
||||
}, (inputBox: azdata.InputBoxComponent) => {
|
||||
this.wizard.model.controllerPort = inputBox.value;
|
||||
});
|
||||
let proxyPortInput = this.createInputWithLabel(view, {
|
||||
@@ -83,7 +83,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
isRequiredField: true,
|
||||
inputWidth: PortInputWidth,
|
||||
initialValue: clusterPorts.proxy
|
||||
}, (inputBox: sqlops.InputBoxComponent) => {
|
||||
}, (inputBox: azdata.InputBoxComponent) => {
|
||||
this.wizard.model.proxyPort = inputBox.value;
|
||||
});
|
||||
let grafanaPortInput = this.createInputWithLabel(view, {
|
||||
@@ -91,7 +91,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
isRequiredField: true,
|
||||
inputWidth: PortInputWidth,
|
||||
initialValue: clusterPorts.grafana
|
||||
}, (inputBox: sqlops.InputBoxComponent) => {
|
||||
}, (inputBox: azdata.InputBoxComponent) => {
|
||||
this.wizard.model.grafanaPort = inputBox.value;
|
||||
});
|
||||
let kibanaPortInput = this.createInputWithLabel(view, {
|
||||
@@ -99,10 +99,10 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
isRequiredField: true,
|
||||
inputWidth: PortInputWidth,
|
||||
initialValue: clusterPorts.kibana
|
||||
}, (inputBox: sqlops.InputBoxComponent) => {
|
||||
}, (inputBox: azdata.InputBoxComponent) => {
|
||||
this.wizard.model.kibanaPort = inputBox.value;
|
||||
});
|
||||
let restorePortSettingsButton = view.modelBuilder.button().withProperties<sqlops.ButtonProperties>({
|
||||
let restorePortSettingsButton = view.modelBuilder.button().withProperties<azdata.ButtonProperties>({
|
||||
label: RestoreDefaultValuesText,
|
||||
width: 200
|
||||
}).component();
|
||||
@@ -122,7 +122,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
isRequiredField: true,
|
||||
inputWidth: UserNameInputWidth,
|
||||
initialValue: containerRegistryInfo.registry
|
||||
}, (inputBox: sqlops.InputBoxComponent) => {
|
||||
}, (inputBox: azdata.InputBoxComponent) => {
|
||||
this.wizard.model.containerRegistry = inputBox.value;
|
||||
});
|
||||
|
||||
@@ -131,7 +131,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
isRequiredField: true,
|
||||
inputWidth: UserNameInputWidth,
|
||||
initialValue: containerRegistryInfo.repository
|
||||
}, (inputBox: sqlops.InputBoxComponent) => {
|
||||
}, (inputBox: azdata.InputBoxComponent) => {
|
||||
this.wizard.model.containerRepository = inputBox.value;
|
||||
});
|
||||
|
||||
@@ -140,7 +140,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
isRequiredField: true,
|
||||
inputWidth: UserNameInputWidth,
|
||||
initialValue: containerRegistryInfo.imageTag
|
||||
}, (inputBox: sqlops.InputBoxComponent) => {
|
||||
}, (inputBox: azdata.InputBoxComponent) => {
|
||||
this.wizard.model.containerRegistry = inputBox.value;
|
||||
});
|
||||
|
||||
@@ -149,7 +149,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
isRequiredField: false,
|
||||
inputWidth: UserNameInputWidth,
|
||||
placeHolder: registryUserNamePasswordHintText
|
||||
}, (inputBox: sqlops.InputBoxComponent) => {
|
||||
}, (inputBox: azdata.InputBoxComponent) => {
|
||||
this.wizard.model.containerRegistryUserName = inputBox.value;
|
||||
});
|
||||
|
||||
@@ -159,10 +159,10 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
inputWidth: UserNameInputWidth,
|
||||
placeHolder: registryUserNamePasswordHintText,
|
||||
inputType: 'password'
|
||||
}, (inputBox: sqlops.InputBoxComponent) => {
|
||||
}, (inputBox: azdata.InputBoxComponent) => {
|
||||
this.wizard.model.containerRegistryPassword = inputBox.value;
|
||||
});
|
||||
let restoreContainerSettingsButton = view.modelBuilder.button().withProperties<sqlops.ButtonProperties>({
|
||||
let restoreContainerSettingsButton = view.modelBuilder.button().withProperties<azdata.ButtonProperties>({
|
||||
label: RestoreDefaultValuesText,
|
||||
width: 200
|
||||
}).component();
|
||||
@@ -179,16 +179,16 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
let acceptEulaCheckbox = view.modelBuilder.checkBox().component();
|
||||
acceptEulaCheckbox.checked = false;
|
||||
|
||||
let eulaLink: sqlops.LinkArea = {
|
||||
let eulaLink: azdata.LinkArea = {
|
||||
text: localize('bdc-create.LicenseAgreementText', 'License Agreement'),
|
||||
url: 'https://docs.microsoft.com/en-us/sql/getting-started/about-the-sql-server-license-terms?view=sql-server-2014'
|
||||
};
|
||||
let privacyPolicyLink: sqlops.LinkArea = {
|
||||
let privacyPolicyLink: azdata.LinkArea = {
|
||||
text: localize('bdc-create.PrivacyPolicyText', 'Privacy Policy'),
|
||||
url: 'https://privacy.microsoft.com/en-us/privacystatement'
|
||||
};
|
||||
|
||||
let checkboxText = view.modelBuilder.text().withProperties<sqlops.TextComponentProperties>({
|
||||
let checkboxText = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
|
||||
value: localize({
|
||||
key: 'bdc-create.AcceptTermsText',
|
||||
comment: ['{0} is the place holder for License Agreement, {1} is the place holder for Privacy Policy']
|
||||
@@ -217,14 +217,14 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
});
|
||||
}
|
||||
|
||||
private createInputWithLabel(view: sqlops.ModelView, options: {
|
||||
private createInputWithLabel(view: azdata.ModelView, options: {
|
||||
label: string,
|
||||
isRequiredField: boolean,
|
||||
inputWidth: string,
|
||||
inputType?: string,
|
||||
initialValue?: string,
|
||||
placeHolder?: string
|
||||
}, textChangedHandler: (inputBox: sqlops.InputBoxComponent) => void): { row: sqlops.FlexContainer, input: sqlops.InputBoxComponent } {
|
||||
}, textChangedHandler: (inputBox: azdata.InputBoxComponent) => void): { row: azdata.FlexContainer, input: azdata.InputBoxComponent } {
|
||||
let inputType = !!options.inputType ? options.inputType : 'text';
|
||||
let input = view.modelBuilder.inputBox().withProperties({
|
||||
required: options.isRequiredField,
|
||||
@@ -245,7 +245,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
|
||||
};
|
||||
}
|
||||
|
||||
private createRow(view: sqlops.ModelView, items: sqlops.Component[]): sqlops.FlexContainer {
|
||||
private createRow(view: azdata.ModelView, items: azdata.Component[]): azdata.FlexContainer {
|
||||
return view.modelBuilder.flexContainer().withItems(items, { CSSStyles: { 'margin-right': '5px' } }).withLayout({ flexFlow: 'row', alignItems: 'center' }).component();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { WizardPageBase } from '../../wizardPageBase';
|
||||
import { CreateClusterWizard } from '../createClusterWizard';
|
||||
import * as nls from 'vscode-nls';
|
||||
@@ -16,7 +16,7 @@ export class SummaryPage extends WizardPageBase<CreateClusterWizard> {
|
||||
super(localize('bdc-create.summaryPageTitle', 'Summary'), '', wizard);
|
||||
}
|
||||
|
||||
protected initialize(view: sqlops.ModelView): Thenable<void> {
|
||||
protected initialize(view: azdata.ModelView): Thenable<void> {
|
||||
let formBuilder = view.modelBuilder.formContainer();
|
||||
let form = formBuilder.component();
|
||||
return view.initializeModel(form);
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { ExtensionContext } from 'vscode';
|
||||
import { WizardPageBase } from './wizardPageBase';
|
||||
|
||||
export abstract class WizardBase<T,W> {
|
||||
|
||||
public wizardObject: sqlops.window.Wizard;
|
||||
private customButtons: sqlops.window.Button[];
|
||||
public wizardObject: azdata.window.Wizard;
|
||||
private customButtons: azdata.window.Button[];
|
||||
private pages: WizardPageBase<W>[];
|
||||
|
||||
constructor(public model: T, public context: ExtensionContext, private title: string) {
|
||||
@@ -19,7 +19,7 @@ export abstract class WizardBase<T,W> {
|
||||
}
|
||||
|
||||
public open(): Thenable<void> {
|
||||
this.wizardObject = sqlops.window.createWizard(this.title);
|
||||
this.wizardObject = azdata.window.createWizard(this.title);
|
||||
this.initialize();
|
||||
this.wizardObject.customButtons = this.customButtons;
|
||||
this.wizardObject.onPageChanged((e) => {
|
||||
@@ -34,7 +34,7 @@ export abstract class WizardBase<T,W> {
|
||||
|
||||
protected abstract initialize(): void;
|
||||
|
||||
public addButton(button: sqlops.window.Button) {
|
||||
public addButton(button: azdata.window.Button) {
|
||||
this.customButtons.push(button);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
export abstract class WizardPageBase<T> {
|
||||
private _page: sqlops.window.WizardPage;
|
||||
private _page: azdata.window.WizardPage;
|
||||
|
||||
public get pageObject(): sqlops.window.WizardPage {
|
||||
public get pageObject(): azdata.window.WizardPage {
|
||||
return this._page;
|
||||
}
|
||||
|
||||
@@ -18,14 +18,14 @@ export abstract class WizardPageBase<T> {
|
||||
}
|
||||
|
||||
constructor(title: string, description: string, private _wizard: T) {
|
||||
this._page = sqlops.window.createWizardPage(title);
|
||||
this._page = azdata.window.createWizardPage(title);
|
||||
this._page.description = description;
|
||||
this._page.registerContent((view: sqlops.ModelView) => {
|
||||
this._page.registerContent((view: azdata.ModelView) => {
|
||||
return this.initialize(view);
|
||||
});
|
||||
}
|
||||
|
||||
protected abstract initialize(view: sqlops.ModelView): Thenable<void>;
|
||||
protected abstract initialize(view: azdata.ModelView): Thenable<void>;
|
||||
|
||||
public onEnter(): void { }
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as constants from '../constants';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import ControllerBase from './controllerBase';
|
||||
import * as vscode from 'vscode';
|
||||
import { FlatFileWizard } from '../wizard/flatFileWizard';
|
||||
@@ -41,10 +41,10 @@ export default class MainController extends ControllerBase {
|
||||
}
|
||||
|
||||
private initializeFlatFileProvider(provider: FlatFileProvider) {
|
||||
sqlops.tasks.registerTask('flatFileImport.start', (profile: sqlops.IConnectionProfile, ...args: any[]) => new FlatFileWizard(provider).start(profile, args));
|
||||
azdata.tasks.registerTask('flatFileImport.start', (profile: azdata.IConnectionProfile, ...args: any[]) => new FlatFileWizard(provider).start(profile, args));
|
||||
}
|
||||
|
||||
private initializeDacFxWizard() {
|
||||
sqlops.tasks.registerTask('dacFx.start', (profile: sqlops.IConnectionProfile, ...args: any[]) => new DataTierApplicationWizard().start(profile, args));
|
||||
azdata.tasks.registerTask('dacFx.start', (profile: azdata.IConnectionProfile, ...args: any[]) => new DataTierApplicationWizard().start(profile, args));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as contracts from './contracts';
|
||||
import { SqlOpsDataClient } from 'dataprotocol-client/lib/main';
|
||||
@@ -21,7 +21,7 @@ export interface IServiceApi {
|
||||
|
||||
export interface IModelViewDefinition {
|
||||
id: string;
|
||||
modelView: sqlops.ModelView;
|
||||
modelView: azdata.ModelView;
|
||||
}
|
||||
|
||||
export class ServiceApiManager implements IServiceApi {
|
||||
@@ -53,7 +53,7 @@ export class ServiceApiManager implements IServiceApi {
|
||||
return this._onRegisteredModelView.event;
|
||||
}
|
||||
|
||||
public registerModelView(id: string, modelView: sqlops.ModelView): void {
|
||||
public registerModelView(id: string, modelView: azdata.ModelView): void {
|
||||
this._onRegisteredModelView.fire({
|
||||
id: id,
|
||||
modelView: modelView
|
||||
|
||||
2
extensions/import/src/typings/ref.d.ts
vendored
2
extensions/import/src/typings/ref.d.ts
vendored
@@ -6,4 +6,6 @@
|
||||
/// <reference path='../../../../src/vs/vscode.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/sqlops.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/sqlops.proposed.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/azdata.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/azdata.proposed.d.ts'/>
|
||||
/// <reference types='@types/node'/>
|
||||
@@ -4,14 +4,14 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { BaseDataModel } from './models';
|
||||
|
||||
export abstract class BasePage {
|
||||
|
||||
protected readonly wizardPage: sqlops.window.WizardPage;
|
||||
protected readonly wizardPage: azdata.window.WizardPage;
|
||||
protected readonly model: BaseDataModel;
|
||||
protected readonly view: sqlops.ModelView;
|
||||
protected readonly view: azdata.ModelView;
|
||||
|
||||
/**
|
||||
* This method constructs all the elements of the page.
|
||||
@@ -48,7 +48,7 @@ export abstract class BasePage {
|
||||
public abstract setupNavigationValidator();
|
||||
|
||||
protected async getServerValues(): Promise<{ connection, displayName, name }[]> {
|
||||
let cons = await sqlops.connection.getActiveConnections();
|
||||
let cons = await azdata.connection.getActiveConnections();
|
||||
// This user has no active connections ABORT MISSION
|
||||
if (!cons || cons.length === 0) {
|
||||
return undefined;
|
||||
@@ -103,7 +103,7 @@ export abstract class BasePage {
|
||||
protected async getDatabaseValues(): Promise<{ displayName, name }[]> {
|
||||
let idx = -1;
|
||||
let count = -1;
|
||||
let values = (await sqlops.connection.listDatabases(this.model.server.connectionId)).map(db => {
|
||||
let values = (await azdata.connection.listDatabases(this.model.server.connectionId)).map(db => {
|
||||
count++;
|
||||
if (this.model.database && db === this.model.database) {
|
||||
idx = count;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
@@ -16,19 +16,19 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
export abstract class DacFxConfigPage extends BasePage {
|
||||
|
||||
protected readonly wizardPage: sqlops.window.WizardPage;
|
||||
protected readonly wizardPage: azdata.window.WizardPage;
|
||||
protected readonly instance: DataTierApplicationWizard;
|
||||
protected readonly model: DacFxDataModel;
|
||||
protected readonly view: sqlops.ModelView;
|
||||
protected serverDropdown: sqlops.DropDownComponent;
|
||||
protected databaseTextBox: sqlops.InputBoxComponent;
|
||||
protected databaseDropdown: sqlops.DropDownComponent;
|
||||
protected databaseLoader: sqlops.LoadingComponent;
|
||||
protected fileTextBox: sqlops.InputBoxComponent;
|
||||
protected fileButton: sqlops.ButtonComponent;
|
||||
protected readonly view: azdata.ModelView;
|
||||
protected serverDropdown: azdata.DropDownComponent;
|
||||
protected databaseTextBox: azdata.InputBoxComponent;
|
||||
protected databaseDropdown: azdata.DropDownComponent;
|
||||
protected databaseLoader: azdata.LoadingComponent;
|
||||
protected fileTextBox: azdata.InputBoxComponent;
|
||||
protected fileButton: azdata.ButtonComponent;
|
||||
protected fileExtension: string;
|
||||
|
||||
protected constructor(instance: DataTierApplicationWizard, wizardPage: sqlops.window.WizardPage, model: DacFxDataModel, view: sqlops.ModelView) {
|
||||
protected constructor(instance: DataTierApplicationWizard, wizardPage: azdata.window.WizardPage, model: DacFxDataModel, view: azdata.ModelView) {
|
||||
super();
|
||||
this.instance = instance;
|
||||
this.wizardPage = wizardPage;
|
||||
@@ -42,7 +42,7 @@ export abstract class DacFxConfigPage extends BasePage {
|
||||
});
|
||||
}
|
||||
|
||||
protected async createServerDropdown(isTargetServer: boolean): Promise<sqlops.FormComponent> {
|
||||
protected async createServerDropdown(isTargetServer: boolean): Promise<azdata.FormComponent> {
|
||||
this.serverDropdown = this.view.modelBuilder.dropDown().withProperties({
|
||||
required: true
|
||||
}).component();
|
||||
@@ -78,7 +78,7 @@ export abstract class DacFxConfigPage extends BasePage {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected async createDatabaseTextBox(): Promise<sqlops.FormComponent> {
|
||||
protected async createDatabaseTextBox(): Promise<azdata.FormComponent> {
|
||||
this.databaseTextBox = this.view.modelBuilder.inputBox().withProperties({
|
||||
required: true
|
||||
}).component();
|
||||
@@ -93,14 +93,14 @@ export abstract class DacFxConfigPage extends BasePage {
|
||||
};
|
||||
}
|
||||
|
||||
protected async createDatabaseDropdown(): Promise<sqlops.FormComponent> {
|
||||
protected async createDatabaseDropdown(): Promise<azdata.FormComponent> {
|
||||
this.databaseDropdown = this.view.modelBuilder.dropDown().withProperties({
|
||||
required: true
|
||||
}).component();
|
||||
|
||||
// Handle database changes
|
||||
this.databaseDropdown.onValueChanged(async () => {
|
||||
this.model.database = (<sqlops.CategoryValue>this.databaseDropdown.value).name;
|
||||
this.model.database = (<azdata.CategoryValue>this.databaseDropdown.value).name;
|
||||
this.fileTextBox.value = this.generateFilePath();
|
||||
this.model.filePath = this.fileTextBox.value;
|
||||
});
|
||||
@@ -152,7 +152,7 @@ export abstract class DacFxConfigPage extends BasePage {
|
||||
}
|
||||
}
|
||||
|
||||
interface ConnectionDropdownValue extends sqlops.CategoryValue {
|
||||
connection: sqlops.connection.Connection;
|
||||
interface ConnectionDropdownValue extends azdata.CategoryValue {
|
||||
connection: azdata.connection.Connection;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
'use strict';
|
||||
|
||||
import { ImportDataModel } from './models';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { FlatFileProvider } from '../../services/contracts';
|
||||
import { FlatFileWizard } from '../flatFileWizard';
|
||||
import { BasePage } from './basePage';
|
||||
|
||||
export abstract class ImportPage extends BasePage {
|
||||
|
||||
protected readonly wizardPage: sqlops.window.WizardPage;
|
||||
protected readonly wizardPage: azdata.window.WizardPage;
|
||||
protected readonly instance: FlatFileWizard;
|
||||
protected readonly model: ImportDataModel;
|
||||
protected readonly view: sqlops.ModelView;
|
||||
protected readonly view: azdata.ModelView;
|
||||
protected readonly provider: FlatFileProvider;
|
||||
|
||||
protected constructor(instance: FlatFileWizard, wizardPage: sqlops.window.WizardPage, model: ImportDataModel, view: sqlops.ModelView, provider: FlatFileProvider) {
|
||||
protected constructor(instance: FlatFileWizard, wizardPage: azdata.window.WizardPage, model: ImportDataModel, view: azdata.ModelView, provider: FlatFileProvider) {
|
||||
super();
|
||||
this.instance = instance;
|
||||
this.wizardPage = wizardPage;
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
export interface BaseDataModel {
|
||||
server: sqlops.connection.Connection;
|
||||
server: azdata.connection.Connection;
|
||||
serverId: string;
|
||||
database: string;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { SelectOperationPage } from './pages/selectOperationpage';
|
||||
import { DeployConfigPage } from './pages/deployConfigPage';
|
||||
import { DeployPlanPage } from './pages/deployPlanPage';
|
||||
@@ -20,10 +20,10 @@ import { BasePage } from './api/basePage';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
class Page {
|
||||
wizardPage: sqlops.window.WizardPage;
|
||||
wizardPage: azdata.window.WizardPage;
|
||||
dacFxPage: BasePage;
|
||||
|
||||
constructor(wizardPage: sqlops.window.WizardPage) {
|
||||
constructor(wizardPage: azdata.window.WizardPage) {
|
||||
this.wizardPage = wizardPage;
|
||||
}
|
||||
}
|
||||
@@ -69,8 +69,8 @@ export enum ExportOperationPath {
|
||||
}
|
||||
|
||||
export class DataTierApplicationWizard {
|
||||
public wizard: sqlops.window.Wizard;
|
||||
private connection: sqlops.connection.Connection;
|
||||
public wizard: azdata.window.Wizard;
|
||||
private connection: azdata.connection.ConnectionProfile;
|
||||
private model: DacFxDataModel;
|
||||
public pages: Map<string, Page> = new Map<string, Page>();
|
||||
public selectedOperation: Operation;
|
||||
@@ -81,26 +81,27 @@ export class DataTierApplicationWizard {
|
||||
public async start(p: any, ...args: any[]) {
|
||||
this.model = <DacFxDataModel>{};
|
||||
|
||||
let profile = p ? <sqlops.IConnectionProfile>p.connectionProfile : undefined;
|
||||
let profile = p ? <azdata.IConnectionProfile>p.connectionProfile : undefined;
|
||||
if (profile) {
|
||||
this.model.serverId = profile.id;
|
||||
this.model.database = profile.databaseName;
|
||||
}
|
||||
|
||||
this.connection = await sqlops.connection.getCurrentConnection();
|
||||
this.connection = await azdata.connection.getCurrentConnection();
|
||||
if (!this.connection) {
|
||||
this.connection = await sqlops.connection.openConnectionDialog();
|
||||
// @TODO: remove cast once azdata update complete - karlb 3/1/2019
|
||||
this.connection = <azdata.connection.ConnectionProfile><any>await azdata.connection.openConnectionDialog();
|
||||
}
|
||||
|
||||
this.wizard = sqlops.window.createWizard('Data-tier Application Wizard');
|
||||
let selectOperationWizardPage = sqlops.window.createWizardPage(localize('dacFx.selectOperationPageName', 'Select an Operation'));
|
||||
let deployConfigWizardPage = sqlops.window.createWizardPage(localize('dacFx.deployConfigPageName', 'Select Deploy Dacpac Settings'));
|
||||
let deployPlanWizardPage = sqlops.window.createWizardPage(localize('dacFx.deployPlanPage', 'Review the deploy plan'));
|
||||
let deployActionWizardPage = sqlops.window.createWizardPage(localize('dacFx.deployActionPageName', 'Select Action'));
|
||||
let summaryWizardPage = sqlops.window.createWizardPage(localize('dacFx.summaryPageName', 'Summary'));
|
||||
let extractConfigWizardPage = sqlops.window.createWizardPage(localize('dacFx.extractConfigPageName', 'Select Extract Dacpac Settings'));
|
||||
let importConfigWizardPage = sqlops.window.createWizardPage(localize('dacFx.importConfigPageName', 'Select Import Bacpac Settings'));
|
||||
let exportConfigWizardPage = sqlops.window.createWizardPage(localize('dacFx.exportConfigPageName', 'Select Export Bacpac Settings'));
|
||||
this.wizard = azdata.window.createWizard('Data-tier Application Wizard');
|
||||
let selectOperationWizardPage = azdata.window.createWizardPage(localize('dacFx.selectOperationPageName', 'Select an Operation'));
|
||||
let deployConfigWizardPage = azdata.window.createWizardPage(localize('dacFx.deployConfigPageName', 'Select Deploy Dacpac Settings'));
|
||||
let deployPlanWizardPage = azdata.window.createWizardPage(localize('dacFx.deployPlanPage', 'Review the deploy plan'));
|
||||
let deployActionWizardPage = azdata.window.createWizardPage(localize('dacFx.deployActionPageName', 'Select Action'));
|
||||
let summaryWizardPage = azdata.window.createWizardPage(localize('dacFx.summaryPageName', 'Summary'));
|
||||
let extractConfigWizardPage = azdata.window.createWizardPage(localize('dacFx.extractConfigPageName', 'Select Extract Dacpac Settings'));
|
||||
let importConfigWizardPage = azdata.window.createWizardPage(localize('dacFx.importConfigPageName', 'Select Import Bacpac Settings'));
|
||||
let exportConfigWizardPage = azdata.window.createWizardPage(localize('dacFx.exportConfigPageName', 'Select Export Bacpac Settings'));
|
||||
|
||||
this.pages.set('selectOperation', new Page(selectOperationWizardPage));
|
||||
this.pages.set('deployConfig', new Page(deployConfigWizardPage));
|
||||
@@ -190,7 +191,7 @@ export class DataTierApplicationWizard {
|
||||
this.wizard.open();
|
||||
}
|
||||
|
||||
public registerNavigationValidator(validator: (pageChangeInfo: sqlops.window.WizardPageChangeInfo) => boolean) {
|
||||
public registerNavigationValidator(validator: (pageChangeInfo: azdata.window.WizardPageChangeInfo) => boolean) {
|
||||
this.wizard.registerNavigationValidator(validator);
|
||||
}
|
||||
|
||||
@@ -255,9 +256,9 @@ export class DataTierApplicationWizard {
|
||||
|
||||
private async deploy() {
|
||||
let service = await DataTierApplicationWizard.getService(this.model.server.providerName);
|
||||
let ownerUri = await sqlops.connection.getUriForConnection(this.model.server.connectionId);
|
||||
let ownerUri = await azdata.connection.getUriForConnection(this.model.server.connectionId);
|
||||
|
||||
let result = await service.deployDacpac(this.model.filePath, this.model.database, this.model.upgradeExisting, ownerUri, sqlops.TaskExecutionMode.execute);
|
||||
let result = await service.deployDacpac(this.model.filePath, this.model.database, this.model.upgradeExisting, ownerUri, azdata.TaskExecutionMode.execute);
|
||||
if (!result || !result.success) {
|
||||
vscode.window.showErrorMessage(
|
||||
localize('alertData.deployErrorMessage', "Deploy failed '{0}'", result.errorMessage ? result.errorMessage : 'Unknown'));
|
||||
@@ -266,9 +267,9 @@ export class DataTierApplicationWizard {
|
||||
|
||||
private async extract() {
|
||||
let service = await DataTierApplicationWizard.getService(this.model.server.providerName);
|
||||
let ownerUri = await sqlops.connection.getUriForConnection(this.model.server.connectionId);
|
||||
let ownerUri = await azdata.connection.getUriForConnection(this.model.server.connectionId);
|
||||
|
||||
let result = await service.extractDacpac(this.model.database, this.model.filePath, this.model.database, this.model.version, ownerUri, sqlops.TaskExecutionMode.execute);
|
||||
let result = await service.extractDacpac(this.model.database, this.model.filePath, this.model.database, this.model.version, ownerUri, azdata.TaskExecutionMode.execute);
|
||||
if (!result || !result.success) {
|
||||
vscode.window.showErrorMessage(
|
||||
localize('alertData.extractErrorMessage', "Extract failed '{0}'", result.errorMessage ? result.errorMessage : 'Unknown'));
|
||||
@@ -277,9 +278,9 @@ export class DataTierApplicationWizard {
|
||||
|
||||
private async export() {
|
||||
let service = await DataTierApplicationWizard.getService(this.model.server.providerName);
|
||||
let ownerUri = await sqlops.connection.getUriForConnection(this.model.server.connectionId);
|
||||
let ownerUri = await azdata.connection.getUriForConnection(this.model.server.connectionId);
|
||||
|
||||
let result = await service.exportBacpac(this.model.database, this.model.filePath, ownerUri, sqlops.TaskExecutionMode.execute);
|
||||
let result = await service.exportBacpac(this.model.database, this.model.filePath, ownerUri, azdata.TaskExecutionMode.execute);
|
||||
if (!result || !result.success) {
|
||||
vscode.window.showErrorMessage(
|
||||
localize('alertData.exportErrorMessage', "Export failed '{0}'", result.errorMessage ? result.errorMessage : 'Unknown'));
|
||||
@@ -288,9 +289,9 @@ export class DataTierApplicationWizard {
|
||||
|
||||
private async import() {
|
||||
let service = await DataTierApplicationWizard.getService(this.model.server.providerName);
|
||||
let ownerUri = await sqlops.connection.getUriForConnection(this.model.server.connectionId);
|
||||
let ownerUri = await azdata.connection.getUriForConnection(this.model.server.connectionId);
|
||||
|
||||
let result = await service.importBacpac(this.model.filePath, this.model.database, ownerUri, sqlops.TaskExecutionMode.execute);
|
||||
let result = await service.importBacpac(this.model.filePath, this.model.database, ownerUri, azdata.TaskExecutionMode.execute);
|
||||
if (!result || !result.success) {
|
||||
vscode.window.showErrorMessage(
|
||||
localize('alertData.importErrorMessage', "Import failed '{0}'", result.errorMessage ? result.errorMessage : 'Unknown'));
|
||||
@@ -303,14 +304,14 @@ export class DataTierApplicationWizard {
|
||||
}
|
||||
|
||||
let service = await DataTierApplicationWizard.getService(this.model.server.providerName);
|
||||
let ownerUri = await sqlops.connection.getUriForConnection(this.model.server.connectionId);
|
||||
let ownerUri = await azdata.connection.getUriForConnection(this.model.server.connectionId);
|
||||
this.wizard.message = {
|
||||
text: localize('dacfx.scriptGeneratingMessage', 'You can view the status of script generation in the Task History once the wizard is closed'),
|
||||
level: sqlops.window.MessageLevel.Information,
|
||||
level: azdata.window.MessageLevel.Information,
|
||||
description: ''
|
||||
};
|
||||
|
||||
let result = await service.generateDeployScript(this.model.filePath, this.model.database, this.model.scriptFilePath, ownerUri, sqlops.TaskExecutionMode.execute);
|
||||
let result = await service.generateDeployScript(this.model.filePath, this.model.database, this.model.scriptFilePath, ownerUri, azdata.TaskExecutionMode.execute);
|
||||
if (!result || !result.success) {
|
||||
vscode.window.showErrorMessage(
|
||||
localize('alertData.deployErrorMessage', "Deploy failed '{0}'", result.errorMessage ? result.errorMessage : 'Unknown'));
|
||||
@@ -360,9 +361,9 @@ export class DataTierApplicationWizard {
|
||||
|
||||
public async generateDeployPlan(): Promise<string> {
|
||||
let service = await DataTierApplicationWizard.getService(this.model.server.providerName);
|
||||
let ownerUri = await sqlops.connection.getUriForConnection(this.model.server.connectionId);
|
||||
let ownerUri = await azdata.connection.getUriForConnection(this.model.server.connectionId);
|
||||
|
||||
let result = await service.generateDeployPlan(this.model.filePath, this.model.database, ownerUri, sqlops.TaskExecutionMode.execute);
|
||||
let result = await service.generateDeployPlan(this.model.filePath, this.model.database, ownerUri, azdata.TaskExecutionMode.execute);
|
||||
|
||||
if (!result || !result.success) {
|
||||
vscode.window.showErrorMessage(
|
||||
@@ -372,8 +373,8 @@ export class DataTierApplicationWizard {
|
||||
return result.report;
|
||||
}
|
||||
|
||||
private static async getService(providerName: string): Promise<sqlops.DacFxServicesProvider> {
|
||||
let service = sqlops.dataprotocol.getProvider<sqlops.DacFxServicesProvider>(providerName, sqlops.DataProviderType.DacFxServicesProvider);
|
||||
private static async getService(providerName: string): Promise<azdata.DacFxServicesProvider> {
|
||||
let service = azdata.dataprotocol.getProvider<azdata.DacFxServicesProvider>(providerName, azdata.DataProviderType.DacFxServicesProvider);
|
||||
return service;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { FlatFileProvider } from '../services/contracts';
|
||||
import { ImportDataModel } from './api/models';
|
||||
import { ImportPage } from './api/importPage';
|
||||
@@ -20,9 +20,9 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
export class FlatFileWizard {
|
||||
private readonly provider: FlatFileProvider;
|
||||
private wizard: sqlops.window.Wizard;
|
||||
private wizard: azdata.window.Wizard;
|
||||
|
||||
private importAnotherFileButton: sqlops.window.Button;
|
||||
private importAnotherFileButton: azdata.window.Button;
|
||||
|
||||
constructor(provider: FlatFileProvider) {
|
||||
this.provider = provider;
|
||||
@@ -31,7 +31,7 @@ export class FlatFileWizard {
|
||||
public async start(p: any, ...args: any[]) {
|
||||
let model = <ImportDataModel>{};
|
||||
|
||||
let profile = p ? <sqlops.IConnectionProfile>p.connectionProfile : null;
|
||||
let profile = p ? <azdata.IConnectionProfile>p.connectionProfile : null;
|
||||
if (profile) {
|
||||
model.serverId = profile.id;
|
||||
model.database = profile.databaseName;
|
||||
@@ -40,17 +40,17 @@ export class FlatFileWizard {
|
||||
let pages: Map<number, ImportPage> = new Map<number, ImportPage>();
|
||||
|
||||
|
||||
let connections = await sqlops.connection.getActiveConnections();
|
||||
let connections = await azdata.connection.getActiveConnections();
|
||||
if (!connections || connections.length === 0) {
|
||||
vscode.window.showErrorMessage(localize('import.needConnection', 'Please connect to a server before using this wizard.'));
|
||||
return;
|
||||
}
|
||||
|
||||
this.wizard = sqlops.window.createWizard(localize('flatFileImport.wizardName', 'Import flat file wizard'));
|
||||
let page1 = sqlops.window.createWizardPage(localize('flatFileImport.page1Name', 'Specify Input File'));
|
||||
let page2 = sqlops.window.createWizardPage(localize('flatFileImport.page2Name', 'Preview Data'));
|
||||
let page3 = sqlops.window.createWizardPage(localize('flatFileImport.page3Name', 'Modify Columns'));
|
||||
let page4 = sqlops.window.createWizardPage(localize('flatFileImport.page4Name', 'Summary'));
|
||||
this.wizard = azdata.window.createWizard(localize('flatFileImport.wizardName', 'Import flat file wizard'));
|
||||
let page1 = azdata.window.createWizardPage(localize('flatFileImport.page1Name', 'Specify Input File'));
|
||||
let page2 = azdata.window.createWizardPage(localize('flatFileImport.page2Name', 'Preview Data'));
|
||||
let page3 = azdata.window.createWizardPage(localize('flatFileImport.page3Name', 'Modify Columns'));
|
||||
let page4 = azdata.window.createWizardPage(localize('flatFileImport.page4Name', 'Summary'));
|
||||
|
||||
let fileConfigPage: FileConfigPage;
|
||||
|
||||
@@ -86,7 +86,7 @@ export class FlatFileWizard {
|
||||
});
|
||||
|
||||
|
||||
this.importAnotherFileButton = sqlops.window.createButton(localize('flatFileImport.importNewFile', 'Import new file'));
|
||||
this.importAnotherFileButton = azdata.window.createButton(localize('flatFileImport.importNewFile', 'Import new file'));
|
||||
this.importAnotherFileButton.onClick(() => {
|
||||
//TODO replace this with proper cleanup for all the pages
|
||||
this.wizard.close();
|
||||
@@ -129,7 +129,7 @@ export class FlatFileWizard {
|
||||
this.importAnotherFileButton.hidden = !visibility;
|
||||
}
|
||||
|
||||
public registerNavigationValidator(validator: (pageChangeInfo: sqlops.window.WizardPageChangeInfo) => boolean) {
|
||||
public registerNavigationValidator(validator: (pageChangeInfo: azdata.window.WizardPageChangeInfo) => boolean) {
|
||||
this.wizard.registerNavigationValidator(validator);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { DacFxDataModel } from '../api/models';
|
||||
import { DataTierApplicationWizard, Operation } from '../dataTierApplicationWizard';
|
||||
@@ -14,16 +14,16 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
export class DacFxSummaryPage extends BasePage {
|
||||
|
||||
protected readonly wizardPage: sqlops.window.WizardPage;
|
||||
protected readonly wizardPage: azdata.window.WizardPage;
|
||||
protected readonly instance: DataTierApplicationWizard;
|
||||
protected readonly model: DacFxDataModel;
|
||||
protected readonly view: sqlops.ModelView;
|
||||
protected readonly view: azdata.ModelView;
|
||||
|
||||
private form: sqlops.FormContainer;
|
||||
private table: sqlops.TableComponent;
|
||||
private loader: sqlops.LoadingComponent;
|
||||
private form: azdata.FormContainer;
|
||||
private table: azdata.TableComponent;
|
||||
private loader: azdata.LoadingComponent;
|
||||
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: sqlops.window.WizardPage, model: DacFxDataModel, view: sqlops.ModelView) {
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: azdata.window.WizardPage, model: DacFxDataModel, view: azdata.ModelView) {
|
||||
super();
|
||||
this.instance = instance;
|
||||
this.wizardPage = wizardPage;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as vscode from 'vscode';
|
||||
import * as path from 'path';
|
||||
@@ -17,16 +17,16 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
export class DeployActionPage extends DacFxConfigPage {
|
||||
|
||||
protected readonly wizardPage: sqlops.window.WizardPage;
|
||||
protected readonly wizardPage: azdata.window.WizardPage;
|
||||
protected readonly instance: DataTierApplicationWizard;
|
||||
protected readonly model: DacFxDataModel;
|
||||
protected readonly view: sqlops.ModelView;
|
||||
private deployRadioButton: sqlops.RadioButtonComponent;
|
||||
private deployScriptRadioButton: sqlops.RadioButtonComponent;
|
||||
private scriptRadioButton: sqlops.RadioButtonComponent;
|
||||
private form: sqlops.FormContainer;
|
||||
protected readonly view: azdata.ModelView;
|
||||
private deployRadioButton: azdata.RadioButtonComponent;
|
||||
private deployScriptRadioButton: azdata.RadioButtonComponent;
|
||||
private scriptRadioButton: azdata.RadioButtonComponent;
|
||||
private form: azdata.FormContainer;
|
||||
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: sqlops.window.WizardPage, model: DacFxDataModel, view: sqlops.ModelView) {
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: azdata.window.WizardPage, model: DacFxDataModel, view: azdata.ModelView) {
|
||||
super(instance, wizardPage, model, view);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ export class DeployActionPage extends DacFxConfigPage {
|
||||
return true;
|
||||
}
|
||||
|
||||
private async createDeployRadioButton(): Promise<sqlops.FormComponent> {
|
||||
private async createDeployRadioButton(): Promise<azdata.FormComponent> {
|
||||
this.deployRadioButton = this.view.modelBuilder.radioButton()
|
||||
.withProperties({
|
||||
name: 'selectedDeployAction',
|
||||
@@ -78,7 +78,7 @@ export class DeployActionPage extends DacFxConfigPage {
|
||||
};
|
||||
}
|
||||
|
||||
private async createDeployScriptRadioButton(): Promise<sqlops.FormComponent> {
|
||||
private async createDeployScriptRadioButton(): Promise<azdata.FormComponent> {
|
||||
this.deployScriptRadioButton = this.view.modelBuilder.radioButton()
|
||||
.withProperties({
|
||||
name: 'selectedDeployAction',
|
||||
@@ -97,7 +97,7 @@ export class DeployActionPage extends DacFxConfigPage {
|
||||
};
|
||||
}
|
||||
|
||||
private async createScriptRadioButton(): Promise<sqlops.FormComponent> {
|
||||
private async createScriptRadioButton(): Promise<azdata.FormComponent> {
|
||||
this.scriptRadioButton = this.view.modelBuilder.radioButton()
|
||||
.withProperties({
|
||||
name: 'selectedDeployAction',
|
||||
@@ -118,7 +118,7 @@ export class DeployActionPage extends DacFxConfigPage {
|
||||
};
|
||||
}
|
||||
|
||||
private async createFileBrowser(): Promise<sqlops.FormComponentGroup> {
|
||||
private async createFileBrowser(): Promise<azdata.FormComponentGroup> {
|
||||
this.createFileBrowserParts();
|
||||
|
||||
//default filepath
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as vscode from 'vscode';
|
||||
import * as path from 'path';
|
||||
@@ -17,16 +17,16 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
export class DeployConfigPage extends DacFxConfigPage {
|
||||
|
||||
protected readonly wizardPage: sqlops.window.WizardPage;
|
||||
protected readonly wizardPage: azdata.window.WizardPage;
|
||||
protected readonly instance: DataTierApplicationWizard;
|
||||
protected readonly model: DacFxDataModel;
|
||||
protected readonly view: sqlops.ModelView;
|
||||
private databaseDropdownComponent: sqlops.FormComponent;
|
||||
private databaseComponent: sqlops.FormComponent;
|
||||
private formBuilder: sqlops.FormBuilder;
|
||||
private form: sqlops.FormContainer;
|
||||
protected readonly view: azdata.ModelView;
|
||||
private databaseDropdownComponent: azdata.FormComponent;
|
||||
private databaseComponent: azdata.FormComponent;
|
||||
private formBuilder: azdata.FormBuilder;
|
||||
private form: azdata.FormContainer;
|
||||
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: sqlops.window.WizardPage, model: DacFxDataModel, view: sqlops.ModelView) {
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: azdata.window.WizardPage, model: DacFxDataModel, view: azdata.ModelView) {
|
||||
super(instance, wizardPage, model, view);
|
||||
this.fileExtension = '.bacpac';
|
||||
}
|
||||
@@ -63,7 +63,7 @@ export class DeployConfigPage extends DacFxConfigPage {
|
||||
return r1 && r2;
|
||||
}
|
||||
|
||||
private async createFileBrowser(): Promise<sqlops.FormComponent> {
|
||||
private async createFileBrowser(): Promise<azdata.FormComponent> {
|
||||
this.createFileBrowserParts();
|
||||
|
||||
this.fileButton.onDidClick(async (click) => {
|
||||
@@ -104,7 +104,7 @@ export class DeployConfigPage extends DacFxConfigPage {
|
||||
};
|
||||
}
|
||||
|
||||
private async createRadiobuttons(): Promise<sqlops.FormComponent> {
|
||||
private async createRadiobuttons(): Promise<azdata.FormComponent> {
|
||||
let upgradeRadioButton = this.view.modelBuilder.radioButton()
|
||||
.withProperties({
|
||||
name: 'updateExisting',
|
||||
@@ -121,7 +121,7 @@ export class DeployConfigPage extends DacFxConfigPage {
|
||||
this.model.upgradeExisting = true;
|
||||
this.formBuilder.removeFormItem(this.databaseComponent);
|
||||
this.formBuilder.addFormItem(this.databaseDropdownComponent, { horizontal: true, componentWidth: 400 });
|
||||
this.model.database = (<sqlops.CategoryValue>this.databaseDropdown.value).name;
|
||||
this.model.database = (<azdata.CategoryValue>this.databaseDropdown.value).name;
|
||||
|
||||
// add deploy plan and generate script pages
|
||||
let deployPlanPage = this.instance.pages.get('deployPlan');
|
||||
@@ -159,13 +159,13 @@ export class DeployConfigPage extends DacFxConfigPage {
|
||||
};
|
||||
}
|
||||
|
||||
protected async createDeployDatabaseDropdown(): Promise<sqlops.FormComponent> {
|
||||
protected async createDeployDatabaseDropdown(): Promise<azdata.FormComponent> {
|
||||
this.databaseDropdown = this.view.modelBuilder.dropDown().withProperties({
|
||||
required: true
|
||||
}).component();
|
||||
//Handle database changes
|
||||
this.databaseDropdown.onValueChanged(async () => {
|
||||
this.model.database = (<sqlops.CategoryValue>this.databaseDropdown.value).name;
|
||||
this.model.database = (<azdata.CategoryValue>this.databaseDropdown.value).name;
|
||||
});
|
||||
this.databaseLoader = this.view.modelBuilder.loadingComponent().withItem(this.databaseDropdown).component();
|
||||
return {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as parser from 'htmlparser2';
|
||||
import { DacFxDataModel } from '../api/models';
|
||||
@@ -37,20 +37,20 @@ export class DeployPlanResult {
|
||||
}
|
||||
|
||||
export class DeployPlanPage extends DacFxConfigPage {
|
||||
protected readonly wizardPage: sqlops.window.WizardPage;
|
||||
protected readonly wizardPage: azdata.window.WizardPage;
|
||||
protected readonly instance: DataTierApplicationWizard;
|
||||
protected readonly model: DacFxDataModel;
|
||||
protected readonly view: sqlops.ModelView;
|
||||
private formBuilder: sqlops.FormBuilder;
|
||||
private form: sqlops.FormContainer;
|
||||
private table: sqlops.TableComponent;
|
||||
private loader: sqlops.LoadingComponent;
|
||||
private dataLossCheckbox: sqlops.CheckBoxComponent;
|
||||
private dataLossText: sqlops.TextComponent;
|
||||
private dataLossComponentGroup: sqlops.FormComponentGroup;
|
||||
private noDataLossTextComponent: sqlops.FormComponent;
|
||||
protected readonly view: azdata.ModelView;
|
||||
private formBuilder: azdata.FormBuilder;
|
||||
private form: azdata.FormContainer;
|
||||
private table: azdata.TableComponent;
|
||||
private loader: azdata.LoadingComponent;
|
||||
private dataLossCheckbox: azdata.CheckBoxComponent;
|
||||
private dataLossText: azdata.TextComponent;
|
||||
private dataLossComponentGroup: azdata.FormComponentGroup;
|
||||
private noDataLossTextComponent: azdata.FormComponent;
|
||||
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: sqlops.window.WizardPage, model: DacFxDataModel, view: sqlops.ModelView) {
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: azdata.window.WizardPage, model: DacFxDataModel, view: azdata.ModelView) {
|
||||
super(instance, wizardPage, model, view);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ export class DeployPlanPage extends DacFxConfigPage {
|
||||
}
|
||||
}
|
||||
|
||||
private async createDataLossCheckbox(): Promise<sqlops.FormComponent> {
|
||||
private async createDataLossCheckbox(): Promise<azdata.FormComponent> {
|
||||
this.dataLossCheckbox = this.view.modelBuilder.checkBox()
|
||||
.withValidation(component => component.checked === true)
|
||||
.withProperties({
|
||||
@@ -130,7 +130,7 @@ export class DeployPlanPage extends DacFxConfigPage {
|
||||
};
|
||||
}
|
||||
|
||||
private async createNoDataLossText(): Promise<sqlops.FormComponent> {
|
||||
private async createNoDataLossText(): Promise<azdata.FormComponent> {
|
||||
let noDataLossText = this.view.modelBuilder.text()
|
||||
.withProperties({
|
||||
value: localize('dacfx.noDataLossText', 'No data loss will occur from the listed deploy actions.')
|
||||
@@ -142,7 +142,7 @@ export class DeployPlanPage extends DacFxConfigPage {
|
||||
};
|
||||
}
|
||||
|
||||
private async createDataLossComponents(): Promise<sqlops.FormComponentGroup> {
|
||||
private async createDataLossComponents(): Promise<azdata.FormComponentGroup> {
|
||||
let dataLossComponent = await this.createDataLossCheckbox();
|
||||
this.dataLossText = this.view.modelBuilder.text()
|
||||
.withProperties({
|
||||
@@ -176,8 +176,8 @@ export class DeployPlanPage extends DacFxConfigPage {
|
||||
return columnData;
|
||||
}
|
||||
|
||||
private getTableColumns(dataloss: boolean): sqlops.TableColumn[] {
|
||||
let columns: sqlops.TableColumn[] = [
|
||||
private getTableColumns(dataloss: boolean): azdata.TableColumn[] {
|
||||
let columns: azdata.TableColumn[] = [
|
||||
{
|
||||
value: localize('dacfx.operationColumn', 'Operation'),
|
||||
width: 75,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as vscode from 'vscode';
|
||||
import { DacFxDataModel } from '../api/models';
|
||||
@@ -15,14 +15,14 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
export class ExportConfigPage extends DacFxConfigPage {
|
||||
|
||||
protected readonly wizardPage: sqlops.window.WizardPage;
|
||||
protected readonly wizardPage: azdata.window.WizardPage;
|
||||
protected readonly instance: DataTierApplicationWizard;
|
||||
protected readonly model: DacFxDataModel;
|
||||
protected readonly view: sqlops.ModelView;
|
||||
protected readonly view: azdata.ModelView;
|
||||
|
||||
private form: sqlops.FormContainer;
|
||||
private form: azdata.FormContainer;
|
||||
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: sqlops.window.WizardPage, model: DacFxDataModel, view: sqlops.ModelView) {
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: azdata.window.WizardPage, model: DacFxDataModel, view: azdata.ModelView) {
|
||||
super(instance, wizardPage, model, view);
|
||||
this.fileExtension = '.bacpac';
|
||||
}
|
||||
@@ -61,7 +61,7 @@ export class ExportConfigPage extends DacFxConfigPage {
|
||||
});
|
||||
}
|
||||
|
||||
private async createFileBrowser(): Promise<sqlops.FormComponent> {
|
||||
private async createFileBrowser(): Promise<azdata.FormComponent> {
|
||||
this.createFileBrowserParts();
|
||||
|
||||
// default filepath
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as vscode from 'vscode';
|
||||
import { DacFxDataModel } from '../api/models';
|
||||
@@ -15,15 +15,15 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
export class ExtractConfigPage extends DacFxConfigPage {
|
||||
|
||||
protected readonly wizardPage: sqlops.window.WizardPage;
|
||||
protected readonly wizardPage: azdata.window.WizardPage;
|
||||
protected readonly instance: DataTierApplicationWizard;
|
||||
protected readonly model: DacFxDataModel;
|
||||
protected readonly view: sqlops.ModelView;
|
||||
protected readonly view: azdata.ModelView;
|
||||
|
||||
private form: sqlops.FormContainer;
|
||||
private versionTextBox: sqlops.InputBoxComponent;
|
||||
private form: azdata.FormContainer;
|
||||
private versionTextBox: azdata.InputBoxComponent;
|
||||
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: sqlops.window.WizardPage, model: DacFxDataModel, view: sqlops.ModelView) {
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: azdata.window.WizardPage, model: DacFxDataModel, view: azdata.ModelView) {
|
||||
super(instance, wizardPage, model, view);
|
||||
this.fileExtension = '.dacpac';
|
||||
}
|
||||
@@ -64,7 +64,7 @@ export class ExtractConfigPage extends DacFxConfigPage {
|
||||
});
|
||||
}
|
||||
|
||||
private async createFileBrowser(): Promise<sqlops.FormComponent> {
|
||||
private async createFileBrowser(): Promise<azdata.FormComponent> {
|
||||
this.createFileBrowserParts();
|
||||
|
||||
// default filepath
|
||||
@@ -101,7 +101,7 @@ export class ExtractConfigPage extends DacFxConfigPage {
|
||||
};
|
||||
}
|
||||
|
||||
private async createVersionTextBox(): Promise<sqlops.FormComponent> {
|
||||
private async createVersionTextBox(): Promise<azdata.FormComponent> {
|
||||
this.versionTextBox = this.view.modelBuilder.inputBox().withProperties({
|
||||
required: true
|
||||
}).component();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { ImportDataModel } from '../api/models';
|
||||
@@ -16,20 +16,20 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
export class FileConfigPage extends ImportPage {
|
||||
|
||||
private serverDropdown: sqlops.DropDownComponent;
|
||||
private databaseDropdown: sqlops.DropDownComponent;
|
||||
private fileTextBox: sqlops.InputBoxComponent;
|
||||
private fileButton: sqlops.ButtonComponent;
|
||||
private tableNameTextBox: sqlops.InputBoxComponent;
|
||||
private schemaDropdown: sqlops.DropDownComponent;
|
||||
private form: sqlops.FormContainer;
|
||||
private serverDropdown: azdata.DropDownComponent;
|
||||
private databaseDropdown: azdata.DropDownComponent;
|
||||
private fileTextBox: azdata.InputBoxComponent;
|
||||
private fileButton: azdata.ButtonComponent;
|
||||
private tableNameTextBox: azdata.InputBoxComponent;
|
||||
private schemaDropdown: azdata.DropDownComponent;
|
||||
private form: azdata.FormContainer;
|
||||
|
||||
private databaseLoader: sqlops.LoadingComponent;
|
||||
private schemaLoader: sqlops.LoadingComponent;
|
||||
private databaseLoader: azdata.LoadingComponent;
|
||||
private schemaLoader: azdata.LoadingComponent;
|
||||
|
||||
private tableNames: string[] = [];
|
||||
|
||||
public constructor(instance: FlatFileWizard, wizardPage: sqlops.window.WizardPage, model: ImportDataModel, view: sqlops.ModelView, provider: FlatFileProvider) {
|
||||
public constructor(instance: FlatFileWizard, wizardPage: azdata.window.WizardPage, model: ImportDataModel, view: azdata.ModelView, provider: FlatFileProvider) {
|
||||
super(instance, wizardPage, model, view, provider);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ export class FileConfigPage extends ImportPage {
|
||||
});
|
||||
}
|
||||
|
||||
private async createServerDropdown(): Promise<sqlops.FormComponent> {
|
||||
private async createServerDropdown(): Promise<azdata.FormComponent> {
|
||||
this.serverDropdown = this.view.modelBuilder.dropDown().withProperties({
|
||||
required: true
|
||||
}).component();
|
||||
@@ -116,14 +116,14 @@ export class FileConfigPage extends ImportPage {
|
||||
return true;
|
||||
}
|
||||
|
||||
private async createDatabaseDropdown(): Promise<sqlops.FormComponent> {
|
||||
private async createDatabaseDropdown(): Promise<azdata.FormComponent> {
|
||||
this.databaseDropdown = this.view.modelBuilder.dropDown().withProperties({
|
||||
required: true
|
||||
}).component();
|
||||
|
||||
// Handle database changes
|
||||
this.databaseDropdown.onValueChanged(async (db) => {
|
||||
this.model.database = (<sqlops.CategoryValue>this.databaseDropdown.value).name;
|
||||
this.model.database = (<azdata.CategoryValue>this.databaseDropdown.value).name;
|
||||
//this.populateTableNames();
|
||||
this.populateSchemaDropdown();
|
||||
});
|
||||
@@ -159,7 +159,7 @@ export class FileConfigPage extends ImportPage {
|
||||
return true;
|
||||
}
|
||||
|
||||
private async createFileBrowser(): Promise<sqlops.FormComponent> {
|
||||
private async createFileBrowser(): Promise<azdata.FormComponent> {
|
||||
this.fileTextBox = this.view.modelBuilder.inputBox().withProperties({
|
||||
required: true
|
||||
}).component();
|
||||
@@ -218,7 +218,7 @@ export class FileConfigPage extends ImportPage {
|
||||
};
|
||||
}
|
||||
|
||||
private async createTableNameBox(): Promise<sqlops.FormComponent> {
|
||||
private async createTableNameBox(): Promise<azdata.FormComponent> {
|
||||
this.tableNameTextBox = this.view.modelBuilder.inputBox().withValidation((name) => {
|
||||
let tableName = name.value;
|
||||
|
||||
@@ -247,14 +247,14 @@ export class FileConfigPage extends ImportPage {
|
||||
}
|
||||
|
||||
|
||||
private async createSchemaDropdown(): Promise<sqlops.FormComponent> {
|
||||
private async createSchemaDropdown(): Promise<azdata.FormComponent> {
|
||||
this.schemaDropdown = this.view.modelBuilder.dropDown().withProperties({
|
||||
required: true
|
||||
}).component();
|
||||
this.schemaLoader = this.view.modelBuilder.loadingComponent().withItem(this.schemaDropdown).component();
|
||||
|
||||
this.schemaDropdown.onValueChanged(() => {
|
||||
this.model.schema = (<sqlops.CategoryValue>this.schemaDropdown.value).name;
|
||||
this.model.schema = (<azdata.CategoryValue>this.schemaDropdown.value).name;
|
||||
});
|
||||
|
||||
|
||||
@@ -267,8 +267,8 @@ export class FileConfigPage extends ImportPage {
|
||||
|
||||
private async populateSchemaDropdown(): Promise<boolean> {
|
||||
this.schemaLoader.loading = true;
|
||||
let connectionUri = await sqlops.connection.getUriForConnection(this.model.server.connectionId);
|
||||
let queryProvider = sqlops.dataprotocol.getProvider<sqlops.QueryProvider>(this.model.server.providerName, sqlops.DataProviderType.QueryProvider);
|
||||
let connectionUri = await azdata.connection.getUriForConnection(this.model.server.connectionId);
|
||||
let queryProvider = azdata.dataprotocol.getProvider<azdata.QueryProvider>(this.model.server.providerName, azdata.DataProviderType.QueryProvider);
|
||||
|
||||
let query = `SELECT name FROM sys.schemas`;
|
||||
|
||||
@@ -321,16 +321,16 @@ export class FileConfigPage extends ImportPage {
|
||||
|
||||
// private async populateTableNames(): Promise<boolean> {
|
||||
// this.tableNames = [];
|
||||
// let databaseName = (<sqlops.CategoryValue>this.databaseDropdown.value).name;
|
||||
// let databaseName = (<azdata.CategoryValue>this.databaseDropdown.value).name;
|
||||
//
|
||||
// if (!databaseName || databaseName.length === 0) {
|
||||
// this.tableNames = [];
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// let connectionUri = await sqlops.connection.getUriForConnection(this.model.server.connectionId);
|
||||
// let queryProvider = sqlops.dataprotocol.getProvider<sqlops.QueryProvider>(this.model.server.providerName, sqlops.DataProviderType.QueryProvider);
|
||||
// let results: sqlops.SimpleExecuteResult;
|
||||
// let connectionUri = await azdata.connection.getUriForConnection(this.model.server.connectionId);
|
||||
// let queryProvider = azdata.dataprotocol.getProvider<azdata.QueryProvider>(this.model.server.providerName, azdata.DataProviderType.QueryProvider);
|
||||
// let results: azdata.SimpleExecuteResult;
|
||||
//
|
||||
// try {
|
||||
// //let query = sqlstring.format('USE ?; SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = \'BASE TABLE\'', [databaseName]);
|
||||
@@ -348,6 +348,6 @@ export class FileConfigPage extends ImportPage {
|
||||
}
|
||||
|
||||
|
||||
interface ConnectionDropdownValue extends sqlops.CategoryValue {
|
||||
connection: sqlops.connection.Connection;
|
||||
interface ConnectionDropdownValue extends azdata.CategoryValue {
|
||||
connection: azdata.connection.Connection;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as vscode from 'vscode';
|
||||
import * as path from 'path';
|
||||
@@ -17,14 +17,14 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
export class ImportConfigPage extends DacFxConfigPage {
|
||||
|
||||
protected readonly wizardPage: sqlops.window.WizardPage;
|
||||
protected readonly wizardPage: azdata.window.WizardPage;
|
||||
protected readonly instance: DataTierApplicationWizard;
|
||||
protected readonly model: DacFxDataModel;
|
||||
protected readonly view: sqlops.ModelView;
|
||||
protected readonly view: azdata.ModelView;
|
||||
|
||||
private form: sqlops.FormContainer;
|
||||
private form: azdata.FormContainer;
|
||||
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: sqlops.window.WizardPage, model: DacFxDataModel, view: sqlops.ModelView) {
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: azdata.window.WizardPage, model: DacFxDataModel, view: azdata.ModelView) {
|
||||
super(instance, wizardPage, model, view);
|
||||
this.fileExtension = '.bacpac';
|
||||
}
|
||||
@@ -53,7 +53,7 @@ export class ImportConfigPage extends DacFxConfigPage {
|
||||
return r1;
|
||||
}
|
||||
|
||||
private async createFileBrowser(): Promise<sqlops.FormComponent> {
|
||||
private async createFileBrowser(): Promise<azdata.FormComponent> {
|
||||
this.createFileBrowserParts();
|
||||
|
||||
this.fileButton.onDidClick(async (click) => {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { ColumnMetadata, ImportDataModel } from '../api/models';
|
||||
import { ImportPage } from '../api/importPage';
|
||||
@@ -51,12 +51,12 @@ export class ModifyColumnsPage extends ImportPage {
|
||||
{ name: 'varchar(50)', displayName: 'varchar(50)' },
|
||||
{ name: 'varchar(MAX)', displayName: 'varchar(MAX)' }
|
||||
];
|
||||
private table: sqlops.DeclarativeTableComponent;
|
||||
private loading: sqlops.LoadingComponent;
|
||||
private text: sqlops.TextComponent;
|
||||
private form: sqlops.FormContainer;
|
||||
private table: azdata.DeclarativeTableComponent;
|
||||
private loading: azdata.LoadingComponent;
|
||||
private text: azdata.TextComponent;
|
||||
private form: azdata.FormContainer;
|
||||
|
||||
public constructor(instance: FlatFileWizard, wizardPage: sqlops.window.WizardPage, model: ImportDataModel, view: sqlops.ModelView, provider: FlatFileProvider) {
|
||||
public constructor(instance: FlatFileWizard, wizardPage: azdata.window.WizardPage, model: ImportDataModel, view: azdata.ModelView, provider: FlatFileProvider) {
|
||||
super(instance, wizardPage, model, view, provider);
|
||||
}
|
||||
|
||||
@@ -142,23 +142,23 @@ export class ModifyColumnsPage extends ImportPage {
|
||||
height: 400,
|
||||
columns: [{
|
||||
displayName: localize('flatFileImport.columnName', 'Column Name'),
|
||||
valueType: sqlops.DeclarativeDataType.string,
|
||||
valueType: azdata.DeclarativeDataType.string,
|
||||
width: '150px',
|
||||
isReadOnly: false
|
||||
}, {
|
||||
displayName: localize('flatFileImport.dataType', 'Data Type'),
|
||||
valueType: sqlops.DeclarativeDataType.editableCategory,
|
||||
valueType: azdata.DeclarativeDataType.editableCategory,
|
||||
width: '150px',
|
||||
isReadOnly: false,
|
||||
categoryValues: this.categoryValues
|
||||
}, {
|
||||
displayName: localize('flatFileImport.primaryKey', 'Primary Key'),
|
||||
valueType: sqlops.DeclarativeDataType.boolean,
|
||||
valueType: azdata.DeclarativeDataType.boolean,
|
||||
width: '100px',
|
||||
isReadOnly: false
|
||||
}, {
|
||||
displayName: localize('flatFileImport.allowNulls', 'Allow Nulls'),
|
||||
valueType: sqlops.DeclarativeDataType.boolean,
|
||||
valueType: azdata.DeclarativeDataType.boolean,
|
||||
isReadOnly: false,
|
||||
width: '100px'
|
||||
}],
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { ImportDataModel } from '../api/models';
|
||||
import { ImportPage } from '../api/importPage';
|
||||
@@ -15,12 +15,12 @@ import { FlatFileWizard } from '../flatFileWizard';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export class ProsePreviewPage extends ImportPage {
|
||||
private table: sqlops.TableComponent;
|
||||
private loading: sqlops.LoadingComponent;
|
||||
private form: sqlops.FormContainer;
|
||||
private refresh: sqlops.ButtonComponent;
|
||||
private table: azdata.TableComponent;
|
||||
private loading: azdata.LoadingComponent;
|
||||
private form: azdata.FormContainer;
|
||||
private refresh: azdata.ButtonComponent;
|
||||
|
||||
public constructor(instance: FlatFileWizard, wizardPage: sqlops.window.WizardPage, model: ImportDataModel, view: sqlops.ModelView, provider: FlatFileProvider) {
|
||||
public constructor(instance: FlatFileWizard, wizardPage: azdata.window.WizardPage, model: ImportDataModel, view: azdata.ModelView, provider: FlatFileProvider) {
|
||||
super(instance, wizardPage, model, view, provider);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { DacFxDataModel } from '../api/models';
|
||||
import { DataTierApplicationWizard, Operation, DeployOperationPath, ExtractOperationPath, ImportOperationPath, ExportOperationPath } from '../dataTierApplicationWizard';
|
||||
@@ -14,18 +14,18 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
export class SelectOperationPage extends BasePage {
|
||||
|
||||
protected readonly wizardPage: sqlops.window.WizardPage;
|
||||
protected readonly wizardPage: azdata.window.WizardPage;
|
||||
protected readonly instance: DataTierApplicationWizard;
|
||||
protected readonly model: DacFxDataModel;
|
||||
protected readonly view: sqlops.ModelView;
|
||||
protected readonly view: azdata.ModelView;
|
||||
|
||||
private deployRadioButton: sqlops.RadioButtonComponent;
|
||||
private extractRadioButton: sqlops.RadioButtonComponent;
|
||||
private importRadioButton: sqlops.RadioButtonComponent;
|
||||
private exportRadioButton: sqlops.RadioButtonComponent;
|
||||
private form: sqlops.FormContainer;
|
||||
private deployRadioButton: azdata.RadioButtonComponent;
|
||||
private extractRadioButton: azdata.RadioButtonComponent;
|
||||
private importRadioButton: azdata.RadioButtonComponent;
|
||||
private exportRadioButton: azdata.RadioButtonComponent;
|
||||
private form: azdata.FormContainer;
|
||||
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: sqlops.window.WizardPage, model: DacFxDataModel, view: sqlops.ModelView) {
|
||||
public constructor(instance: DataTierApplicationWizard, wizardPage: azdata.window.WizardPage, model: DacFxDataModel, view: azdata.ModelView) {
|
||||
super();
|
||||
this.instance = instance;
|
||||
this.wizardPage = wizardPage;
|
||||
@@ -61,7 +61,7 @@ export class SelectOperationPage extends BasePage {
|
||||
return true;
|
||||
}
|
||||
|
||||
private async createDeployRadioButton(): Promise<sqlops.FormComponent> {
|
||||
private async createDeployRadioButton(): Promise<azdata.FormComponent> {
|
||||
this.deployRadioButton = this.view.modelBuilder.radioButton()
|
||||
.withProperties({
|
||||
name: 'selectedOperation',
|
||||
@@ -90,7 +90,7 @@ export class SelectOperationPage extends BasePage {
|
||||
};
|
||||
}
|
||||
|
||||
private async createExtractRadioButton(): Promise<sqlops.FormComponent> {
|
||||
private async createExtractRadioButton(): Promise<azdata.FormComponent> {
|
||||
this.extractRadioButton = this.view.modelBuilder.radioButton()
|
||||
.withProperties({
|
||||
name: 'selectedOperation',
|
||||
@@ -115,7 +115,7 @@ export class SelectOperationPage extends BasePage {
|
||||
};
|
||||
}
|
||||
|
||||
private async createImportRadioButton(): Promise<sqlops.FormComponent> {
|
||||
private async createImportRadioButton(): Promise<azdata.FormComponent> {
|
||||
this.importRadioButton = this.view.modelBuilder.radioButton()
|
||||
.withProperties({
|
||||
name: 'selectedOperation',
|
||||
@@ -140,7 +140,7 @@ export class SelectOperationPage extends BasePage {
|
||||
};
|
||||
}
|
||||
|
||||
private async createExportRadioButton(): Promise<sqlops.FormComponent> {
|
||||
private async createExportRadioButton(): Promise<azdata.FormComponent> {
|
||||
this.exportRadioButton = this.view.modelBuilder.radioButton()
|
||||
.withProperties({
|
||||
name: 'selectedOperation',
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
|
||||
import { ImportDataModel } from '../api/models';
|
||||
@@ -17,12 +17,12 @@ const localize = nls.loadMessageBundle();
|
||||
|
||||
|
||||
export class SummaryPage extends ImportPage {
|
||||
private table: sqlops.TableComponent;
|
||||
private statusText: sqlops.TextComponent;
|
||||
private loading: sqlops.LoadingComponent;
|
||||
private form: sqlops.FormContainer;
|
||||
private table: azdata.TableComponent;
|
||||
private statusText: azdata.TextComponent;
|
||||
private loading: azdata.LoadingComponent;
|
||||
private form: azdata.FormContainer;
|
||||
|
||||
public constructor(instance: FlatFileWizard, wizardPage: sqlops.window.WizardPage, model: ImportDataModel, view: sqlops.ModelView, provider: FlatFileProvider) {
|
||||
public constructor(instance: FlatFileWizard, wizardPage: azdata.window.WizardPage, model: ImportDataModel, view: azdata.ModelView, provider: FlatFileProvider) {
|
||||
super(instance, wizardPage, model, view, provider);
|
||||
}
|
||||
|
||||
@@ -142,18 +142,18 @@ export class SummaryPage extends ImportPage {
|
||||
if (options.authenticationType === 'Integrated') {
|
||||
connectionString = `Data Source=${options.server + (options.port ? `,${options.port}` : '')};Initial Catalog=${this.model.database};Integrated Security=True`;
|
||||
} else {
|
||||
let credentials = await sqlops.connection.getCredentials(this.model.server.connectionId);
|
||||
let credentials = await azdata.connection.getCredentials(this.model.server.connectionId);
|
||||
connectionString = `Data Source=${options.server + (options.port ? `,${options.port}` : '')};Initial Catalog=${this.model.database};Integrated Security=False;User Id=${options.user};Password=${credentials.password}`;
|
||||
}
|
||||
|
||||
// TODO: Fix this, it's returning undefined string.
|
||||
//await sqlops.connection.getConnectionString(this.model.server.connectionId, true);
|
||||
//await azdata.connection.getConnectionString(this.model.server.connectionId, true);
|
||||
return connectionString;
|
||||
}
|
||||
|
||||
// private async getCountRowsInserted(): Promise<Number> {
|
||||
// let connectionUri = await sqlops.connection.getUriForConnection(this.model.server.connectionId);
|
||||
// let queryProvider = sqlops.dataprotocol.getProvider<sqlops.QueryProvider>(this.model.server.providerName, sqlops.DataProviderType.QueryProvider);
|
||||
// let connectionUri = await azdata.connection.getUriForConnection(this.model.server.connectionId);
|
||||
// let queryProvider = azdata.dataprotocol.getProvider<azdata.QueryProvider>(this.model.server.providerName, azdata.DataProviderType.QueryProvider);
|
||||
// try {
|
||||
// let query = sqlstring.format('USE ?; SELECT COUNT(*) FROM ?', [this.model.database, this.model.table]);
|
||||
// let results = await queryProvider.runQueryAndReturn(connectionUri, query);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
import * as vscode from 'vscode';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { normalize, join } from 'path';
|
||||
import * as fs from 'fs';
|
||||
|
||||
@@ -22,7 +22,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
for (let i = 0; i < installers.length; i++) {
|
||||
if (installers[i].endsWith('.vsix')) {
|
||||
let installerFullPath = join(extensionInstallersFolder, installers[i]);
|
||||
await sqlops.extensions.install(installerFullPath);
|
||||
await azdata.extensions.install(installerFullPath);
|
||||
}
|
||||
}
|
||||
await setConfiguration('workbench.enablePreviewFeatures', true);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import 'mocha';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import { context } from './testContext';
|
||||
import { getDefaultTestingServer } from './testConfig';
|
||||
import { connectToServer } from './utils';
|
||||
@@ -16,9 +16,9 @@ if (context.RunTest) {
|
||||
suite('Object Explorer integration test suite', () => {
|
||||
test('context menu test', async function () {
|
||||
await connectToServer(await getDefaultTestingServer());
|
||||
let nodes = <sqlops.objectexplorer.ObjectExplorerNode[]>await sqlops.objectexplorer.getActiveConnectionNodes();
|
||||
let nodes = <azdata.objectexplorer.ObjectExplorerNode[]>await azdata.objectexplorer.getActiveConnectionNodes();
|
||||
assert(nodes.length === 1, `expecting 1 active connection, actual: ${nodes.length}`);
|
||||
let actions = await sqlops.objectexplorer.getNodeActions(nodes[0].connectionId, nodes[0].nodePath);
|
||||
let actions = await azdata.objectexplorer.getNodeActions(nodes[0].connectionId, nodes[0].nodePath);
|
||||
const expectedActions = ['Manage', 'New Query', 'Disconnect', 'Delete Connection', 'Refresh', 'New Notebook', 'Launch Profiler'];
|
||||
|
||||
const expectedString = expectedActions.join(',');
|
||||
|
||||
@@ -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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
/// <reference path='../../../../src/sql/sqlops.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/sqlops.proposed.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/sqlops.test.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/azdata.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/azdata.proposed.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/azdata.test.d.ts'/>
|
||||
/// <reference types='@types/node'/>
|
||||
@@ -4,12 +4,12 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import assert = require('assert');
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { TestServerProfile } from './testConfig';
|
||||
|
||||
export async function connectToServer(server: TestServerProfile) {
|
||||
let connectionProfile: sqlops.IConnectionProfile = {
|
||||
let connectionProfile: azdata.IConnectionProfile = {
|
||||
serverName: server.serverName,
|
||||
databaseName: server.database,
|
||||
authenticationType: server.authenticationTypeName,
|
||||
@@ -25,7 +25,7 @@ export async function connectToServer(server: TestServerProfile) {
|
||||
options: {}
|
||||
};
|
||||
await ensureConnectionViewOpened();
|
||||
let result = <sqlops.ConnectionResult>await sqlops.connection.connect(connectionProfile);
|
||||
let result = <azdata.ConnectionResult>await azdata.connection.connect(connectionProfile);
|
||||
assert(result.connected, `Failed to connect to "${connectionProfile.serverName}", error code: ${result.errorCode}, error message: ${result.errorMessage}`);
|
||||
|
||||
//workaround
|
||||
|
||||
8
extensions/mssql/src/api/mssqlapis.d.ts
vendored
8
extensions/mssql/src/api/mssqlapis.d.ts
vendored
@@ -5,7 +5,7 @@
|
||||
|
||||
// This is the place for extensions to expose APIs.
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
/**
|
||||
@@ -35,10 +35,10 @@ export interface MssqlObjectExplorerBrowser {
|
||||
/**
|
||||
* Gets the matching node given a context object, e.g. one from a right-click on a node in Object Explorer
|
||||
*
|
||||
* @param {sqlops.ObjectExplorerContext} objectExplorerContext
|
||||
* @param {azdata.ObjectExplorerContext} objectExplorerContext
|
||||
* @returns {Promise<T>}
|
||||
*/
|
||||
getNode<T extends ITreeNode>(objectExplorerContext: sqlops.ObjectExplorerContext): Promise<T>;
|
||||
getNode<T extends ITreeNode>(objectExplorerContext: azdata.ObjectExplorerContext): Promise<T>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,7 +48,7 @@ export interface MssqlObjectExplorerBrowser {
|
||||
* @interface ITreeNode
|
||||
*/
|
||||
export interface ITreeNode {
|
||||
getNodeInfo(): sqlops.NodeInfo;
|
||||
getNodeInfo(): azdata.NodeInfo;
|
||||
getChildren(refreshChildren: boolean): ITreeNode[] | Promise<ITreeNode[]>;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
/**
|
||||
* Wrapper class to act as a facade over VSCode and Data APIs and allow us to test / mock callbacks into
|
||||
@@ -17,44 +17,44 @@ import * as sqlops from 'sqlops';
|
||||
*/
|
||||
export class ApiWrapper {
|
||||
// Data APIs
|
||||
public registerConnectionProvider(provider: sqlops.ConnectionProvider): vscode.Disposable {
|
||||
return sqlops.dataprotocol.registerConnectionProvider(provider);
|
||||
public registerConnectionProvider(provider: azdata.ConnectionProvider): vscode.Disposable {
|
||||
return azdata.dataprotocol.registerConnectionProvider(provider);
|
||||
}
|
||||
|
||||
public registerObjectExplorerNodeProvider(provider: sqlops.ObjectExplorerNodeProvider): vscode.Disposable {
|
||||
return sqlops.dataprotocol.registerObjectExplorerNodeProvider(provider);
|
||||
public registerObjectExplorerNodeProvider(provider: azdata.ObjectExplorerNodeProvider): vscode.Disposable {
|
||||
return azdata.dataprotocol.registerObjectExplorerNodeProvider(provider);
|
||||
}
|
||||
|
||||
public registerTaskServicesProvider(provider: sqlops.TaskServicesProvider): vscode.Disposable {
|
||||
return sqlops.dataprotocol.registerTaskServicesProvider(provider);
|
||||
public registerTaskServicesProvider(provider: azdata.TaskServicesProvider): vscode.Disposable {
|
||||
return azdata.dataprotocol.registerTaskServicesProvider(provider);
|
||||
}
|
||||
|
||||
public registerFileBrowserProvider(provider: sqlops.FileBrowserProvider): vscode.Disposable {
|
||||
return sqlops.dataprotocol.registerFileBrowserProvider(provider);
|
||||
public registerFileBrowserProvider(provider: azdata.FileBrowserProvider): vscode.Disposable {
|
||||
return azdata.dataprotocol.registerFileBrowserProvider(provider);
|
||||
}
|
||||
|
||||
public createDialog(title: string): sqlops.window.Dialog {
|
||||
return sqlops.window.createModelViewDialog(title);
|
||||
public createDialog(title: string): azdata.window.Dialog {
|
||||
return azdata.window.createModelViewDialog(title);
|
||||
}
|
||||
|
||||
public openDialog(dialog: sqlops.window.Dialog): void {
|
||||
return sqlops.window.openDialog(dialog);
|
||||
public openDialog(dialog: azdata.window.Dialog): void {
|
||||
return azdata.window.openDialog(dialog);
|
||||
}
|
||||
|
||||
public closeDialog(dialog: sqlops.window.Dialog): void {
|
||||
return sqlops.window.closeDialog(dialog);
|
||||
public closeDialog(dialog: azdata.window.Dialog): void {
|
||||
return azdata.window.closeDialog(dialog);
|
||||
}
|
||||
|
||||
public registerTaskHandler(taskId: string, handler: (profile: sqlops.IConnectionProfile) => void): void {
|
||||
sqlops.tasks.registerTask(taskId, handler);
|
||||
public registerTaskHandler(taskId: string, handler: (profile: azdata.IConnectionProfile) => void): void {
|
||||
azdata.tasks.registerTask(taskId, handler);
|
||||
}
|
||||
|
||||
public startBackgroundOperation(operationInfo: sqlops.BackgroundOperationInfo): void {
|
||||
sqlops.tasks.startBackgroundOperation(operationInfo);
|
||||
public startBackgroundOperation(operationInfo: azdata.BackgroundOperationInfo): void {
|
||||
azdata.tasks.startBackgroundOperation(operationInfo);
|
||||
}
|
||||
|
||||
public getActiveConnections(): Thenable<sqlops.connection.Connection[]> {
|
||||
return sqlops.connection.getActiveConnections();
|
||||
public getActiveConnections(): Thenable<azdata.connection.Connection[]> {
|
||||
return azdata.connection.getActiveConnections();
|
||||
}
|
||||
|
||||
// VSCode APIs
|
||||
@@ -113,7 +113,7 @@ export class ApiWrapper {
|
||||
return vscode.window.createOutputChannel(name);
|
||||
}
|
||||
|
||||
public createTab(title: string): sqlops.window.DialogTab {
|
||||
return sqlops.window.createTab(title);
|
||||
public createTab(title: string): azdata.window.DialogTab {
|
||||
return azdata.window.createTab(title);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
import * as vscode from 'vscode';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
import * as types from './types';
|
||||
import * as Constants from './constants';
|
||||
@@ -33,11 +33,11 @@ export default class ContextProvider {
|
||||
private _disposables = new Array<vscode.Disposable>();
|
||||
|
||||
constructor() {
|
||||
this._disposables.push(sqlops.workspace.onDidOpenDashboard(this.onDashboardOpen, this));
|
||||
this._disposables.push(sqlops.workspace.onDidChangeToDashboard(this.onDashboardOpen, this));
|
||||
this._disposables.push(azdata.workspace.onDidOpenDashboard(this.onDashboardOpen, this));
|
||||
this._disposables.push(azdata.workspace.onDidChangeToDashboard(this.onDashboardOpen, this));
|
||||
}
|
||||
|
||||
public onDashboardOpen(e: sqlops.DashboardDocument): void {
|
||||
public onDashboardOpen(e: azdata.DashboardDocument): void {
|
||||
let iscloud: boolean;
|
||||
let edition: number;
|
||||
let isCluster: boolean = false;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { NotificationType, RequestType } from 'vscode-languageclient';
|
||||
import { ITelemetryEventProperties, ITelemetryEventMeasures } from './telemetry';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
// ------------------------------- < Telemetry Sent Event > ------------------------------------
|
||||
|
||||
@@ -51,18 +51,18 @@ export interface AgentJobActionParams {
|
||||
|
||||
export interface CreateAgentJobParams {
|
||||
ownerUri: string;
|
||||
job: sqlops.AgentJobInfo;
|
||||
job: azdata.AgentJobInfo;
|
||||
}
|
||||
|
||||
export interface UpdateAgentJobParams {
|
||||
ownerUri: string;
|
||||
originalJobName: string;
|
||||
job: sqlops.AgentJobInfo;
|
||||
job: azdata.AgentJobInfo;
|
||||
}
|
||||
|
||||
export interface DeleteAgentJobParams {
|
||||
ownerUri: string;
|
||||
job: sqlops.AgentJobInfo;
|
||||
job: azdata.AgentJobInfo;
|
||||
}
|
||||
|
||||
export interface AgentJobDefaultsParams {
|
||||
@@ -72,18 +72,18 @@ export interface AgentJobDefaultsParams {
|
||||
// Job Step management parameters
|
||||
export interface CreateAgentJobStepParams {
|
||||
ownerUri: string;
|
||||
step: sqlops.AgentJobStepInfo;
|
||||
step: azdata.AgentJobStepInfo;
|
||||
}
|
||||
|
||||
export interface UpdateAgentJobStepParams {
|
||||
ownerUri: string;
|
||||
originalJobStepName: string;
|
||||
step: sqlops.AgentJobStepInfo;
|
||||
step: azdata.AgentJobStepInfo;
|
||||
}
|
||||
|
||||
export interface DeleteAgentJobStepParams {
|
||||
ownerUri: string;
|
||||
step: sqlops.AgentJobStepInfo;
|
||||
step: azdata.AgentJobStepInfo;
|
||||
}
|
||||
|
||||
// Alert management parameters
|
||||
@@ -93,18 +93,18 @@ export interface AgentAlertsParams {
|
||||
|
||||
export interface CreateAgentAlertParams {
|
||||
ownerUri: string;
|
||||
alert: sqlops.AgentAlertInfo;
|
||||
alert: azdata.AgentAlertInfo;
|
||||
}
|
||||
|
||||
export interface UpdateAgentAlertParams {
|
||||
ownerUri: string;
|
||||
originalAlertName: string;
|
||||
alert: sqlops.AgentAlertInfo;
|
||||
alert: azdata.AgentAlertInfo;
|
||||
}
|
||||
|
||||
export interface DeleteAgentAlertParams {
|
||||
ownerUri: string;
|
||||
alert: sqlops.AgentAlertInfo;
|
||||
alert: azdata.AgentAlertInfo;
|
||||
}
|
||||
|
||||
// Operator management parameters
|
||||
@@ -114,18 +114,18 @@ export interface AgentOperatorsParams {
|
||||
|
||||
export interface CreateAgentOperatorParams {
|
||||
ownerUri: string;
|
||||
operator: sqlops.AgentOperatorInfo;
|
||||
operator: azdata.AgentOperatorInfo;
|
||||
}
|
||||
|
||||
export interface UpdateAgentOperatorParams {
|
||||
ownerUri: string;
|
||||
originalOperatorName: string;
|
||||
operator: sqlops.AgentOperatorInfo;
|
||||
operator: azdata.AgentOperatorInfo;
|
||||
}
|
||||
|
||||
export interface DeleteAgentOperatorParams {
|
||||
ownerUri: string;
|
||||
operator: sqlops.AgentOperatorInfo;
|
||||
operator: azdata.AgentOperatorInfo;
|
||||
}
|
||||
|
||||
// Proxy management parameters
|
||||
@@ -135,18 +135,18 @@ export interface AgentProxiesParams {
|
||||
|
||||
export interface CreateAgentProxyParams {
|
||||
ownerUri: string;
|
||||
proxy: sqlops.AgentProxyInfo;
|
||||
proxy: azdata.AgentProxyInfo;
|
||||
}
|
||||
|
||||
export interface UpdateAgentProxyParams {
|
||||
ownerUri: string;
|
||||
originalProxyName: string;
|
||||
proxy: sqlops.AgentProxyInfo;
|
||||
proxy: azdata.AgentProxyInfo;
|
||||
}
|
||||
|
||||
export interface DeleteAgentProxyParams {
|
||||
ownerUri: string;
|
||||
proxy: sqlops.AgentProxyInfo;
|
||||
proxy: azdata.AgentProxyInfo;
|
||||
}
|
||||
|
||||
// Agent Credentials parameters
|
||||
@@ -161,133 +161,133 @@ export interface AgentJobScheduleParams {
|
||||
|
||||
export interface CreateAgentJobScheduleParams {
|
||||
ownerUri: string;
|
||||
schedule: sqlops.AgentJobScheduleInfo;
|
||||
schedule: azdata.AgentJobScheduleInfo;
|
||||
}
|
||||
|
||||
export interface UpdateAgentJobScheduleParams {
|
||||
ownerUri: string;
|
||||
originalScheduleName: string;
|
||||
schedule: sqlops.AgentJobScheduleInfo;
|
||||
schedule: azdata.AgentJobScheduleInfo;
|
||||
}
|
||||
|
||||
export interface DeleteAgentJobScheduleParams {
|
||||
ownerUri: string;
|
||||
schedule: sqlops.AgentJobScheduleInfo;
|
||||
schedule: azdata.AgentJobScheduleInfo;
|
||||
}
|
||||
|
||||
// Agent Job management requests
|
||||
export namespace AgentJobsRequest {
|
||||
export const type = new RequestType<AgentJobsParams, sqlops.AgentJobsResult, void, void>('agent/jobs');
|
||||
export const type = new RequestType<AgentJobsParams, azdata.AgentJobsResult, void, void>('agent/jobs');
|
||||
}
|
||||
|
||||
export namespace AgentJobHistoryRequest {
|
||||
export const type = new RequestType<AgentJobHistoryParams, sqlops.AgentJobHistoryResult, void, void>('agent/jobhistory');
|
||||
export const type = new RequestType<AgentJobHistoryParams, azdata.AgentJobHistoryResult, void, void>('agent/jobhistory');
|
||||
}
|
||||
|
||||
export namespace AgentJobActionRequest {
|
||||
export const type = new RequestType<AgentJobActionParams, sqlops.ResultStatus, void, void>('agent/jobaction');
|
||||
export const type = new RequestType<AgentJobActionParams, azdata.ResultStatus, void, void>('agent/jobaction');
|
||||
}
|
||||
|
||||
export namespace CreateAgentJobRequest {
|
||||
export const type = new RequestType<CreateAgentJobParams, sqlops.CreateAgentJobResult, void, void>('agent/createjob');
|
||||
export const type = new RequestType<CreateAgentJobParams, azdata.CreateAgentJobResult, void, void>('agent/createjob');
|
||||
}
|
||||
|
||||
export namespace UpdateAgentJobRequest {
|
||||
export const type = new RequestType<UpdateAgentJobParams, sqlops.UpdateAgentJobResult, void, void>('agent/updatejob');
|
||||
export const type = new RequestType<UpdateAgentJobParams, azdata.UpdateAgentJobResult, void, void>('agent/updatejob');
|
||||
}
|
||||
|
||||
export namespace DeleteAgentJobRequest {
|
||||
export const type = new RequestType<DeleteAgentJobParams, sqlops.ResultStatus, void, void>('agent/deletejob');
|
||||
export const type = new RequestType<DeleteAgentJobParams, azdata.ResultStatus, void, void>('agent/deletejob');
|
||||
}
|
||||
|
||||
export namespace AgentJobDefaultsRequest {
|
||||
export const type = new RequestType<AgentJobDefaultsParams, sqlops.AgentJobDefaultsResult, void, void>('agent/jobdefaults');
|
||||
export const type = new RequestType<AgentJobDefaultsParams, azdata.AgentJobDefaultsResult, void, void>('agent/jobdefaults');
|
||||
}
|
||||
|
||||
// Job Step requests
|
||||
export namespace CreateAgentJobStepRequest {
|
||||
export const type = new RequestType<CreateAgentJobStepParams, sqlops.CreateAgentJobStepResult, void, void>('agent/createjobstep');
|
||||
export const type = new RequestType<CreateAgentJobStepParams, azdata.CreateAgentJobStepResult, void, void>('agent/createjobstep');
|
||||
}
|
||||
|
||||
export namespace UpdateAgentJobStepRequest {
|
||||
export const type = new RequestType<UpdateAgentJobStepParams, sqlops.UpdateAgentJobStepResult, void, void>('agent/updatejobstep');
|
||||
export const type = new RequestType<UpdateAgentJobStepParams, azdata.UpdateAgentJobStepResult, void, void>('agent/updatejobstep');
|
||||
}
|
||||
|
||||
export namespace DeleteAgentJobStepRequest {
|
||||
export const type = new RequestType<DeleteAgentJobStepParams, sqlops.ResultStatus, void, void>('agent/deletejobstep');
|
||||
export const type = new RequestType<DeleteAgentJobStepParams, azdata.ResultStatus, void, void>('agent/deletejobstep');
|
||||
}
|
||||
|
||||
// Alerts requests
|
||||
export namespace AgentAlertsRequest {
|
||||
export const type = new RequestType<CreateAgentAlertParams, sqlops.AgentAlertsResult, void, void>('agent/alerts');
|
||||
export const type = new RequestType<CreateAgentAlertParams, azdata.AgentAlertsResult, void, void>('agent/alerts');
|
||||
}
|
||||
|
||||
export namespace CreateAgentAlertRequest {
|
||||
export const type = new RequestType<CreateAgentAlertParams, sqlops.CreateAgentAlertResult, void, void>('agent/createalert');
|
||||
export const type = new RequestType<CreateAgentAlertParams, azdata.CreateAgentAlertResult, void, void>('agent/createalert');
|
||||
}
|
||||
|
||||
export namespace UpdateAgentAlertRequest {
|
||||
export const type = new RequestType<UpdateAgentAlertParams, sqlops.UpdateAgentAlertResult, void, void>('agent/updatealert');
|
||||
export const type = new RequestType<UpdateAgentAlertParams, azdata.UpdateAgentAlertResult, void, void>('agent/updatealert');
|
||||
}
|
||||
|
||||
export namespace DeleteAgentAlertRequest {
|
||||
export const type = new RequestType<DeleteAgentAlertParams, sqlops.ResultStatus, void, void>('agent/deletealert');
|
||||
export const type = new RequestType<DeleteAgentAlertParams, azdata.ResultStatus, void, void>('agent/deletealert');
|
||||
}
|
||||
|
||||
// Operators requests
|
||||
export namespace AgentOperatorsRequest {
|
||||
export const type = new RequestType<CreateAgentOperatorParams, sqlops.AgentOperatorsResult, void, void>('agent/operators');
|
||||
export const type = new RequestType<CreateAgentOperatorParams, azdata.AgentOperatorsResult, void, void>('agent/operators');
|
||||
}
|
||||
|
||||
export namespace CreateAgentOperatorRequest {
|
||||
export const type = new RequestType<CreateAgentOperatorParams, sqlops.CreateAgentOperatorResult, void, void>('agent/createoperator');
|
||||
export const type = new RequestType<CreateAgentOperatorParams, azdata.CreateAgentOperatorResult, void, void>('agent/createoperator');
|
||||
}
|
||||
|
||||
export namespace UpdateAgentOperatorRequest {
|
||||
export const type = new RequestType<UpdateAgentOperatorParams, sqlops.UpdateAgentOperatorResult, void, void>('agent/updateoperator');
|
||||
export const type = new RequestType<UpdateAgentOperatorParams, azdata.UpdateAgentOperatorResult, void, void>('agent/updateoperator');
|
||||
}
|
||||
|
||||
export namespace DeleteAgentOperatorRequest {
|
||||
export const type = new RequestType<DeleteAgentOperatorParams, sqlops.ResultStatus, void, void>('agent/deleteoperator');
|
||||
export const type = new RequestType<DeleteAgentOperatorParams, azdata.ResultStatus, void, void>('agent/deleteoperator');
|
||||
}
|
||||
|
||||
// Proxies requests
|
||||
export namespace AgentProxiesRequest {
|
||||
export const type = new RequestType<CreateAgentProxyParams, sqlops.AgentProxiesResult, void, void>('agent/proxies');
|
||||
export const type = new RequestType<CreateAgentProxyParams, azdata.AgentProxiesResult, void, void>('agent/proxies');
|
||||
}
|
||||
|
||||
export namespace CreateAgentProxyRequest {
|
||||
export const type = new RequestType<CreateAgentProxyParams, sqlops.CreateAgentProxyResult, void, void>('agent/createproxy');
|
||||
export const type = new RequestType<CreateAgentProxyParams, azdata.CreateAgentProxyResult, void, void>('agent/createproxy');
|
||||
}
|
||||
|
||||
export namespace UpdateAgentProxyRequest {
|
||||
export const type = new RequestType<UpdateAgentProxyParams, sqlops.UpdateAgentProxyResult, void, void>('agent/updateproxy');
|
||||
export const type = new RequestType<UpdateAgentProxyParams, azdata.UpdateAgentProxyResult, void, void>('agent/updateproxy');
|
||||
}
|
||||
|
||||
export namespace DeleteAgentProxyRequest {
|
||||
export const type = new RequestType<DeleteAgentProxyParams, sqlops.ResultStatus, void, void>('agent/deleteproxy');
|
||||
export const type = new RequestType<DeleteAgentProxyParams, azdata.ResultStatus, void, void>('agent/deleteproxy');
|
||||
}
|
||||
|
||||
// Agent Credentials request
|
||||
export namespace AgentCredentialsRequest {
|
||||
export const type = new RequestType<GetCredentialsParams, sqlops.GetCredentialsResult, void, void>('security/credentials');
|
||||
export const type = new RequestType<GetCredentialsParams, azdata.GetCredentialsResult, void, void>('security/credentials');
|
||||
}
|
||||
|
||||
// Job Schedules requests
|
||||
export namespace AgentJobSchedulesRequest {
|
||||
export const type = new RequestType<AgentJobScheduleParams, sqlops.AgentJobSchedulesResult, void, void>('agent/schedules');
|
||||
export const type = new RequestType<AgentJobScheduleParams, azdata.AgentJobSchedulesResult, void, void>('agent/schedules');
|
||||
}
|
||||
|
||||
export namespace CreateAgentJobScheduleRequest {
|
||||
export const type = new RequestType<CreateAgentJobScheduleParams, sqlops.CreateAgentJobScheduleResult, void, void>('agent/createschedule');
|
||||
export const type = new RequestType<CreateAgentJobScheduleParams, azdata.CreateAgentJobScheduleResult, void, void>('agent/createschedule');
|
||||
}
|
||||
|
||||
export namespace UpdateAgentJobScheduleRequest {
|
||||
export const type = new RequestType<UpdateAgentJobScheduleParams, sqlops.UpdateAgentJobScheduleResult, void, void>('agent/updateschedule');
|
||||
export const type = new RequestType<UpdateAgentJobScheduleParams, azdata.UpdateAgentJobScheduleResult, void, void>('agent/updateschedule');
|
||||
}
|
||||
|
||||
export namespace DeleteAgentJobScheduleRequest {
|
||||
export const type = new RequestType<DeleteAgentJobScheduleParams, sqlops.ResultStatus, void, void>('agent/deleteschedule');
|
||||
export const type = new RequestType<DeleteAgentJobScheduleParams, azdata.ResultStatus, void, void>('agent/deleteschedule');
|
||||
}
|
||||
|
||||
// ------------------------------- < Agent Management > ------------------------------------
|
||||
@@ -347,26 +347,26 @@ export interface GenerateDeployPlanParams {
|
||||
}
|
||||
|
||||
export namespace ExportRequest {
|
||||
export const type = new RequestType<ExportParams, sqlops.DacFxResult, void, void>('dacfx/export');
|
||||
export const type = new RequestType<ExportParams, azdata.DacFxResult, void, void>('dacfx/export');
|
||||
}
|
||||
|
||||
export namespace ImportRequest {
|
||||
export const type = new RequestType<ImportParams, sqlops.DacFxResult, void, void>('dacfx/import');
|
||||
export const type = new RequestType<ImportParams, azdata.DacFxResult, void, void>('dacfx/import');
|
||||
}
|
||||
|
||||
export namespace ExtractRequest {
|
||||
export const type = new RequestType<ExtractParams, sqlops.DacFxResult, void, void>('dacfx/extract');
|
||||
export const type = new RequestType<ExtractParams, azdata.DacFxResult, void, void>('dacfx/extract');
|
||||
}
|
||||
|
||||
export namespace DeployRequest {
|
||||
export const type = new RequestType<DeployParams, sqlops.DacFxResult, void, void>('dacfx/deploy');
|
||||
export const type = new RequestType<DeployParams, azdata.DacFxResult, void, void>('dacfx/deploy');
|
||||
}
|
||||
|
||||
export namespace GenerateDeployScriptRequest {
|
||||
export const type = new RequestType<GenerateDeployScriptParams, sqlops.DacFxResult, void, void>('dacfx/generateDeploymentScript');
|
||||
export const type = new RequestType<GenerateDeployScriptParams, azdata.DacFxResult, void, void>('dacfx/generateDeploymentScript');
|
||||
}
|
||||
|
||||
export namespace GenerateDeployPlanRequest {
|
||||
export const type = new RequestType<GenerateDeployPlanParams, sqlops.GenerateDeployPlanResult, void, void>('dacfx/generateDeployPlan');
|
||||
export const type = new RequestType<GenerateDeployPlanParams, azdata.GenerateDeployPlanResult, void, void>('dacfx/generateDeployPlan');
|
||||
}
|
||||
// ------------------------------- < DacFx > ------------------------------------
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import { RequestType } from 'vscode-languageclient';
|
||||
import { Credential } from 'sqlops';
|
||||
import { Credential } from 'azdata';
|
||||
|
||||
// --------------------------------- < Read Credential Request > -------------------------------------------------
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import { IConfig, ServerProvider } from 'service-downloader';
|
||||
import { ServerOptions, RPCMessageType, ClientCapabilities, ServerCapabilities, TransportKind } from 'vscode-languageclient';
|
||||
import { Disposable } from 'vscode';
|
||||
import * as UUID from 'vscode-languageclient/lib/utils/uuid';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
import * as Contracts from './contracts';
|
||||
import * as Constants from './constants';
|
||||
@@ -42,7 +42,7 @@ class CredentialsFeature extends SqlOpsFeature<any> {
|
||||
protected registerProvider(options: any): Disposable {
|
||||
const client = this._client;
|
||||
|
||||
let readCredential = (credentialId: string): Thenable<sqlops.Credential> => {
|
||||
let readCredential = (credentialId: string): Thenable<azdata.Credential> => {
|
||||
return client.sendRequest(Contracts.ReadCredentialRequest.type, { credentialId });
|
||||
};
|
||||
|
||||
@@ -54,7 +54,7 @@ class CredentialsFeature extends SqlOpsFeature<any> {
|
||||
return client.sendRequest(Contracts.DeleteCredentialRequest.type, { credentialId });
|
||||
};
|
||||
|
||||
return sqlops.credentials.registerProvider({
|
||||
return azdata.credentials.registerProvider({
|
||||
deleteCredential,
|
||||
readCredential,
|
||||
saveCredential,
|
||||
|
||||
@@ -9,7 +9,7 @@ import { ClientCapabilities, StaticFeature, RPCMessageType, ServerCapabilities }
|
||||
import { Disposable } from 'vscode';
|
||||
import { Telemetry } from './telemetry';
|
||||
import * as contracts from './contracts';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as Utils from './utils';
|
||||
import * as UUID from 'vscode-languageclient/lib/utils/uuid';
|
||||
|
||||
@@ -54,7 +54,7 @@ export class DacFxServicesFeature extends SqlOpsFeature<undefined> {
|
||||
const client = this._client;
|
||||
let self = this;
|
||||
|
||||
let exportBacpac = (databaseName: string, packageFilePath: string, ownerUri: string, taskExecutionMode: sqlops.TaskExecutionMode): Thenable<sqlops.DacFxResult> => {
|
||||
let exportBacpac = (databaseName: string, packageFilePath: string, ownerUri: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.DacFxResult> => {
|
||||
let params: contracts.ExportParams = { databaseName: databaseName, packageFilePath: packageFilePath, ownerUri: ownerUri, taskExecutionMode: taskExecutionMode };
|
||||
return client.sendRequest(contracts.ExportRequest.type, params).then(
|
||||
r => {
|
||||
@@ -67,7 +67,7 @@ export class DacFxServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let importBacpac = (packageFilePath: string, databaseName: string, ownerUri: string, taskExecutionMode: sqlops.TaskExecutionMode): Thenable<sqlops.DacFxResult> => {
|
||||
let importBacpac = (packageFilePath: string, databaseName: string, ownerUri: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.DacFxResult> => {
|
||||
let params: contracts.ImportParams = { packageFilePath: packageFilePath, databaseName: databaseName, ownerUri: ownerUri, taskExecutionMode: taskExecutionMode };
|
||||
return client.sendRequest(contracts.ImportRequest.type, params).then(
|
||||
r => {
|
||||
@@ -80,7 +80,7 @@ export class DacFxServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let extractDacpac = (databaseName: string, packageFilePath: string, applicationName: string, applicationVersion: string, ownerUri: string, taskExecutionMode: sqlops.TaskExecutionMode): Thenable<sqlops.DacFxResult> => {
|
||||
let extractDacpac = (databaseName: string, packageFilePath: string, applicationName: string, applicationVersion: string, ownerUri: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.DacFxResult> => {
|
||||
let params: contracts.ExtractParams = { databaseName: databaseName, packageFilePath: packageFilePath, applicationName: applicationName, applicationVersion: applicationVersion, ownerUri: ownerUri, taskExecutionMode: taskExecutionMode };
|
||||
return client.sendRequest(contracts.ExtractRequest.type, params).then(
|
||||
r => {
|
||||
@@ -93,7 +93,7 @@ export class DacFxServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let deployDacpac = (packageFilePath: string, targetDatabaseName: string, upgradeExisting: boolean, ownerUri: string, taskExecutionMode: sqlops.TaskExecutionMode): Thenable<sqlops.DacFxResult> => {
|
||||
let deployDacpac = (packageFilePath: string, targetDatabaseName: string, upgradeExisting: boolean, ownerUri: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.DacFxResult> => {
|
||||
let params: contracts.DeployParams = { packageFilePath: packageFilePath, databaseName: targetDatabaseName, upgradeExisting: upgradeExisting, ownerUri: ownerUri, taskExecutionMode: taskExecutionMode };
|
||||
return client.sendRequest(contracts.DeployRequest.type, params).then(
|
||||
r => {
|
||||
@@ -106,7 +106,7 @@ export class DacFxServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let generateDeployScript = (packageFilePath: string, targetDatabaseName: string, scriptFilePath: string, ownerUri: string, taskExecutionMode: sqlops.TaskExecutionMode): Thenable<sqlops.DacFxResult> => {
|
||||
let generateDeployScript = (packageFilePath: string, targetDatabaseName: string, scriptFilePath: string, ownerUri: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.DacFxResult> => {
|
||||
let params: contracts.GenerateDeployScriptParams = { packageFilePath: packageFilePath, databaseName: targetDatabaseName, scriptFilePath: scriptFilePath, ownerUri: ownerUri, taskExecutionMode: taskExecutionMode };
|
||||
return client.sendRequest(contracts.GenerateDeployScriptRequest.type, params).then(
|
||||
r => {
|
||||
@@ -119,7 +119,7 @@ export class DacFxServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let generateDeployPlan = (packageFilePath: string, targetDatabaseName: string, ownerUri: string, taskExecutionMode: sqlops.TaskExecutionMode): Thenable<sqlops.GenerateDeployPlanResult> => {
|
||||
let generateDeployPlan = (packageFilePath: string, targetDatabaseName: string, ownerUri: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.GenerateDeployPlanResult> => {
|
||||
let params: contracts.GenerateDeployPlanParams = { packageFilePath: packageFilePath, databaseName: targetDatabaseName, ownerUri: ownerUri, taskExecutionMode: taskExecutionMode };
|
||||
return client.sendRequest(contracts.GenerateDeployPlanRequest.type, params).then(
|
||||
r => {
|
||||
@@ -132,7 +132,7 @@ export class DacFxServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
return sqlops.dataprotocol.registerDacFxServicesProvider({
|
||||
return azdata.dataprotocol.registerDacFxServicesProvider({
|
||||
providerId: client.providerId,
|
||||
exportBacpac,
|
||||
importBacpac,
|
||||
@@ -185,7 +185,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
};
|
||||
|
||||
// Job management methods
|
||||
let getJobs = (ownerUri: string): Thenable<sqlops.AgentJobsResult> => {
|
||||
let getJobs = (ownerUri: string): Thenable<azdata.AgentJobsResult> => {
|
||||
let params: contracts.AgentJobsParams = { ownerUri: ownerUri, jobId: null };
|
||||
return client.sendRequest(contracts.AgentJobsRequest.type, params).then(
|
||||
r => r,
|
||||
@@ -196,7 +196,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let getJobHistory = (ownerUri: string, jobID: string, jobName: string): Thenable<sqlops.AgentJobHistoryResult> => {
|
||||
let getJobHistory = (ownerUri: string, jobID: string, jobName: string): Thenable<azdata.AgentJobHistoryResult> => {
|
||||
let params: contracts.AgentJobHistoryParams = { ownerUri: ownerUri, jobId: jobID, jobName: jobName };
|
||||
|
||||
return client.sendRequest(contracts.AgentJobHistoryRequest.type, params).then(
|
||||
@@ -208,7 +208,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let jobAction = (ownerUri: string, jobName: string, action: string): Thenable<sqlops.ResultStatus> => {
|
||||
let jobAction = (ownerUri: string, jobName: string, action: string): Thenable<azdata.ResultStatus> => {
|
||||
let params: contracts.AgentJobActionParams = { ownerUri: ownerUri, jobName: jobName, action: action };
|
||||
return client.sendRequest(contracts.AgentJobActionRequest.type, params).then(
|
||||
r => r,
|
||||
@@ -219,7 +219,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let createJob = (ownerUri: string, jobInfo: sqlops.AgentJobInfo): Thenable<sqlops.CreateAgentJobResult> => {
|
||||
let createJob = (ownerUri: string, jobInfo: azdata.AgentJobInfo): Thenable<azdata.CreateAgentJobResult> => {
|
||||
let params: contracts.CreateAgentJobParams = {
|
||||
ownerUri: ownerUri,
|
||||
job: jobInfo
|
||||
@@ -237,7 +237,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let updateJob = (ownerUri: string, originalJobName: string, jobInfo: sqlops.AgentJobInfo): Thenable<sqlops.UpdateAgentJobResult> => {
|
||||
let updateJob = (ownerUri: string, originalJobName: string, jobInfo: azdata.AgentJobInfo): Thenable<azdata.UpdateAgentJobResult> => {
|
||||
let params: contracts.UpdateAgentJobParams = {
|
||||
ownerUri: ownerUri,
|
||||
originalJobName: originalJobName,
|
||||
@@ -256,7 +256,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let deleteJob = (ownerUri: string, jobInfo: sqlops.AgentJobInfo): Thenable<sqlops.ResultStatus> => {
|
||||
let deleteJob = (ownerUri: string, jobInfo: azdata.AgentJobInfo): Thenable<azdata.ResultStatus> => {
|
||||
let params: contracts.DeleteAgentJobParams = {
|
||||
ownerUri: ownerUri,
|
||||
job: jobInfo
|
||||
@@ -274,7 +274,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let getJobDefaults = (ownerUri: string): Thenable<sqlops.AgentJobDefaultsResult> => {
|
||||
let getJobDefaults = (ownerUri: string): Thenable<azdata.AgentJobDefaultsResult> => {
|
||||
let params: contracts.AgentJobDefaultsParams = {
|
||||
ownerUri: ownerUri
|
||||
};
|
||||
@@ -289,7 +289,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
};
|
||||
|
||||
// Job Step management methods
|
||||
let createJobStep = (ownerUri: string, stepInfo: sqlops.AgentJobStepInfo): Thenable<sqlops.CreateAgentJobStepResult> => {
|
||||
let createJobStep = (ownerUri: string, stepInfo: azdata.AgentJobStepInfo): Thenable<azdata.CreateAgentJobStepResult> => {
|
||||
let params: contracts.CreateAgentJobStepParams = {
|
||||
ownerUri: ownerUri,
|
||||
step: stepInfo
|
||||
@@ -307,7 +307,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let updateJobStep = (ownerUri: string, originalJobStepName: string, stepInfo: sqlops.AgentJobStepInfo): Thenable<sqlops.UpdateAgentJobStepResult> => {
|
||||
let updateJobStep = (ownerUri: string, originalJobStepName: string, stepInfo: azdata.AgentJobStepInfo): Thenable<azdata.UpdateAgentJobStepResult> => {
|
||||
let params: contracts.UpdateAgentJobStepParams = {
|
||||
ownerUri: ownerUri,
|
||||
originalJobStepName: originalJobStepName,
|
||||
@@ -326,7 +326,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let deleteJobStep = (ownerUri: string, stepInfo: sqlops.AgentJobStepInfo): Thenable<sqlops.ResultStatus> => {
|
||||
let deleteJobStep = (ownerUri: string, stepInfo: azdata.AgentJobStepInfo): Thenable<azdata.ResultStatus> => {
|
||||
let params: contracts.DeleteAgentJobStepParams = {
|
||||
ownerUri: ownerUri,
|
||||
step: stepInfo
|
||||
@@ -345,7 +345,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
};
|
||||
|
||||
// Alert management methods
|
||||
let getAlerts = (ownerUri: string): Thenable<sqlops.AgentAlertsResult> => {
|
||||
let getAlerts = (ownerUri: string): Thenable<azdata.AgentAlertsResult> => {
|
||||
let params: contracts.AgentAlertsParams = {
|
||||
ownerUri: ownerUri
|
||||
};
|
||||
@@ -359,7 +359,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let createAlert = (ownerUri: string, alertInfo: sqlops.AgentAlertInfo): Thenable<sqlops.CreateAgentAlertResult> => {
|
||||
let createAlert = (ownerUri: string, alertInfo: azdata.AgentAlertInfo): Thenable<azdata.CreateAgentAlertResult> => {
|
||||
let params: contracts.CreateAgentAlertParams = {
|
||||
ownerUri: ownerUri,
|
||||
alert: alertInfo
|
||||
@@ -377,7 +377,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let updateAlert = (ownerUri: string, originalAlertName: string, alertInfo: sqlops.AgentAlertInfo): Thenable<sqlops.UpdateAgentAlertResult> => {
|
||||
let updateAlert = (ownerUri: string, originalAlertName: string, alertInfo: azdata.AgentAlertInfo): Thenable<azdata.UpdateAgentAlertResult> => {
|
||||
let params: contracts.UpdateAgentAlertParams = {
|
||||
ownerUri: ownerUri,
|
||||
originalAlertName: originalAlertName,
|
||||
@@ -396,7 +396,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let deleteAlert = (ownerUri: string, alertInfo: sqlops.AgentAlertInfo): Thenable<sqlops.ResultStatus> => {
|
||||
let deleteAlert = (ownerUri: string, alertInfo: azdata.AgentAlertInfo): Thenable<azdata.ResultStatus> => {
|
||||
let params: contracts.DeleteAgentAlertParams = {
|
||||
ownerUri: ownerUri,
|
||||
alert: alertInfo
|
||||
@@ -415,7 +415,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
};
|
||||
|
||||
// Operator management methods
|
||||
let getOperators = (ownerUri: string): Thenable<sqlops.AgentOperatorsResult> => {
|
||||
let getOperators = (ownerUri: string): Thenable<azdata.AgentOperatorsResult> => {
|
||||
let params: contracts.AgentOperatorsParams = {
|
||||
ownerUri: ownerUri
|
||||
};
|
||||
@@ -429,7 +429,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let createOperator = (ownerUri: string, operatorInfo: sqlops.AgentOperatorInfo): Thenable<sqlops.CreateAgentOperatorResult> => {
|
||||
let createOperator = (ownerUri: string, operatorInfo: azdata.AgentOperatorInfo): Thenable<azdata.CreateAgentOperatorResult> => {
|
||||
let params: contracts.CreateAgentOperatorParams = {
|
||||
ownerUri: ownerUri,
|
||||
operator: operatorInfo
|
||||
@@ -447,7 +447,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let updateOperator = (ownerUri: string, originalOperatorName: string, operatorInfo: sqlops.AgentOperatorInfo): Thenable<sqlops.UpdateAgentOperatorResult> => {
|
||||
let updateOperator = (ownerUri: string, originalOperatorName: string, operatorInfo: azdata.AgentOperatorInfo): Thenable<azdata.UpdateAgentOperatorResult> => {
|
||||
let params: contracts.UpdateAgentOperatorParams = {
|
||||
ownerUri: ownerUri,
|
||||
originalOperatorName: originalOperatorName,
|
||||
@@ -466,7 +466,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let deleteOperator = (ownerUri: string, operatorInfo: sqlops.AgentOperatorInfo): Thenable<sqlops.ResultStatus> => {
|
||||
let deleteOperator = (ownerUri: string, operatorInfo: azdata.AgentOperatorInfo): Thenable<azdata.ResultStatus> => {
|
||||
let params: contracts.DeleteAgentOperatorParams = {
|
||||
ownerUri: ownerUri,
|
||||
operator: operatorInfo
|
||||
@@ -485,7 +485,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
};
|
||||
|
||||
// Proxy management methods
|
||||
let getProxies = (ownerUri: string): Thenable<sqlops.AgentProxiesResult> => {
|
||||
let getProxies = (ownerUri: string): Thenable<azdata.AgentProxiesResult> => {
|
||||
let params: contracts.AgentProxiesParams = {
|
||||
ownerUri: ownerUri
|
||||
};
|
||||
@@ -499,7 +499,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let createProxy = (ownerUri: string, proxyInfo: sqlops.AgentProxyInfo): Thenable<sqlops.CreateAgentOperatorResult> => {
|
||||
let createProxy = (ownerUri: string, proxyInfo: azdata.AgentProxyInfo): Thenable<azdata.CreateAgentOperatorResult> => {
|
||||
let params: contracts.CreateAgentProxyParams = {
|
||||
ownerUri: ownerUri,
|
||||
proxy: proxyInfo
|
||||
@@ -517,7 +517,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let updateProxy = (ownerUri: string, originalProxyName: string, proxyInfo: sqlops.AgentProxyInfo): Thenable<sqlops.UpdateAgentOperatorResult> => {
|
||||
let updateProxy = (ownerUri: string, originalProxyName: string, proxyInfo: azdata.AgentProxyInfo): Thenable<azdata.UpdateAgentOperatorResult> => {
|
||||
let params: contracts.UpdateAgentProxyParams = {
|
||||
ownerUri: ownerUri,
|
||||
originalProxyName: originalProxyName,
|
||||
@@ -536,7 +536,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let deleteProxy = (ownerUri: string, proxyInfo: sqlops.AgentProxyInfo): Thenable<sqlops.ResultStatus> => {
|
||||
let deleteProxy = (ownerUri: string, proxyInfo: azdata.AgentProxyInfo): Thenable<azdata.ResultStatus> => {
|
||||
let params: contracts.DeleteAgentProxyParams = {
|
||||
ownerUri: ownerUri,
|
||||
proxy: proxyInfo
|
||||
@@ -555,7 +555,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
};
|
||||
|
||||
// Agent Credential Method
|
||||
let getCredentials = (ownerUri: string): Thenable<sqlops.GetCredentialsResult> => {
|
||||
let getCredentials = (ownerUri: string): Thenable<azdata.GetCredentialsResult> => {
|
||||
let params: contracts.GetCredentialsParams = {
|
||||
ownerUri: ownerUri
|
||||
};
|
||||
@@ -571,7 +571,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
|
||||
|
||||
// Job Schedule management methods
|
||||
let getJobSchedules = (ownerUri: string): Thenable<sqlops.AgentJobSchedulesResult> => {
|
||||
let getJobSchedules = (ownerUri: string): Thenable<azdata.AgentJobSchedulesResult> => {
|
||||
let params: contracts.AgentJobScheduleParams = {
|
||||
ownerUri: ownerUri
|
||||
};
|
||||
@@ -585,7 +585,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let createJobSchedule = (ownerUri: string, scheduleInfo: sqlops.AgentJobScheduleInfo): Thenable<sqlops.CreateAgentJobScheduleResult> => {
|
||||
let createJobSchedule = (ownerUri: string, scheduleInfo: azdata.AgentJobScheduleInfo): Thenable<azdata.CreateAgentJobScheduleResult> => {
|
||||
let params: contracts.CreateAgentJobScheduleParams = {
|
||||
ownerUri: ownerUri,
|
||||
schedule: scheduleInfo
|
||||
@@ -603,7 +603,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let updateJobSchedule = (ownerUri: string, originalScheduleName: string, scheduleInfo: sqlops.AgentJobScheduleInfo): Thenable<sqlops.UpdateAgentJobScheduleResult> => {
|
||||
let updateJobSchedule = (ownerUri: string, originalScheduleName: string, scheduleInfo: azdata.AgentJobScheduleInfo): Thenable<azdata.UpdateAgentJobScheduleResult> => {
|
||||
let params: contracts.UpdateAgentJobScheduleParams = {
|
||||
ownerUri: ownerUri,
|
||||
originalScheduleName: originalScheduleName,
|
||||
@@ -622,7 +622,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let deleteJobSchedule = (ownerUri: string, scheduleInfo: sqlops.AgentJobScheduleInfo): Thenable<sqlops.ResultStatus> => {
|
||||
let deleteJobSchedule = (ownerUri: string, scheduleInfo: azdata.AgentJobScheduleInfo): Thenable<azdata.ResultStatus> => {
|
||||
let params: contracts.DeleteAgentJobScheduleParams = {
|
||||
ownerUri: ownerUri,
|
||||
schedule: scheduleInfo
|
||||
@@ -640,7 +640,7 @@ export class AgentServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
return sqlops.dataprotocol.registerAgentServicesProvider({
|
||||
return azdata.dataprotocol.registerAgentServicesProvider({
|
||||
providerId: client.providerId,
|
||||
getJobs,
|
||||
getJobHistory,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as path from 'path';
|
||||
import * as os from 'os';
|
||||
import * as nls from 'vscode-nls';
|
||||
@@ -108,7 +108,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<MssqlE
|
||||
resourceProvider.start();
|
||||
|
||||
let nodeProvider = new MssqlObjectExplorerNodeProvider(appContext);
|
||||
sqlops.dataprotocol.registerObjectExplorerNodeProvider(nodeProvider);
|
||||
azdata.dataprotocol.registerObjectExplorerNodeProvider(nodeProvider);
|
||||
activateSparkFeatures(appContext);
|
||||
activateNotebookTask(appContext);
|
||||
}, e => {
|
||||
@@ -131,7 +131,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<MssqlE
|
||||
let api: MssqlExtensionApi = {
|
||||
getMssqlObjectExplorerBrowser(): MssqlObjectExplorerBrowser {
|
||||
return {
|
||||
getNode: (context: sqlops.ObjectExplorerContext) => {
|
||||
getNode: (context: azdata.ObjectExplorerContext) => {
|
||||
let oeProvider = appContext.getService<MssqlObjectExplorerNodeProvider>(Constants.ObjectExplorerService);
|
||||
return <any>oeProvider.findSqlClusterNodeByContext(context);
|
||||
}
|
||||
@@ -147,36 +147,36 @@ function activateSparkFeatures(appContext: AppContext): void {
|
||||
let outputChannel: vscode.OutputChannel = mssqlOutputChannel;
|
||||
extensionContext.subscriptions.push(new OpenSparkJobSubmissionDialogCommand(appContext, outputChannel));
|
||||
extensionContext.subscriptions.push(new OpenSparkJobSubmissionDialogFromFileCommand(appContext, outputChannel));
|
||||
apiWrapper.registerTaskHandler(Constants.mssqlClusterLivySubmitSparkJobTask, (profile: sqlops.IConnectionProfile) => {
|
||||
apiWrapper.registerTaskHandler(Constants.mssqlClusterLivySubmitSparkJobTask, (profile: azdata.IConnectionProfile) => {
|
||||
new OpenSparkJobSubmissionDialogTask(appContext, outputChannel).execute(profile);
|
||||
});
|
||||
apiWrapper.registerTaskHandler(Constants.mssqlClusterLivyOpenSparkHistory, (profile: sqlops.IConnectionProfile) => {
|
||||
apiWrapper.registerTaskHandler(Constants.mssqlClusterLivyOpenSparkHistory, (profile: azdata.IConnectionProfile) => {
|
||||
new OpenSparkYarnHistoryTask(appContext).execute(profile, true);
|
||||
});
|
||||
apiWrapper.registerTaskHandler(Constants.mssqlClusterLivyOpenYarnHistory, (profile: sqlops.IConnectionProfile) => {
|
||||
apiWrapper.registerTaskHandler(Constants.mssqlClusterLivyOpenYarnHistory, (profile: azdata.IConnectionProfile) => {
|
||||
new OpenSparkYarnHistoryTask(appContext).execute(profile, false);
|
||||
});
|
||||
}
|
||||
|
||||
function activateNotebookTask(appContext: AppContext): void {
|
||||
let apiWrapper = appContext.apiWrapper;
|
||||
apiWrapper.registerTaskHandler(Constants.mssqlClusterNewNotebookTask, (profile: sqlops.IConnectionProfile) => {
|
||||
apiWrapper.registerTaskHandler(Constants.mssqlClusterNewNotebookTask, (profile: azdata.IConnectionProfile) => {
|
||||
return saveProfileAndCreateNotebook(profile);
|
||||
});
|
||||
apiWrapper.registerTaskHandler(Constants.mssqlClusterOpenNotebookTask, (profile: sqlops.IConnectionProfile) => {
|
||||
apiWrapper.registerTaskHandler(Constants.mssqlClusterOpenNotebookTask, (profile: azdata.IConnectionProfile) => {
|
||||
return handleOpenNotebookTask(profile);
|
||||
});
|
||||
}
|
||||
|
||||
function saveProfileAndCreateNotebook(profile: sqlops.IConnectionProfile): Promise<void> {
|
||||
function saveProfileAndCreateNotebook(profile: azdata.IConnectionProfile): Promise<void> {
|
||||
return handleNewNotebookTask(undefined, profile);
|
||||
}
|
||||
|
||||
async function handleNewNotebookTask(oeContext?: sqlops.ObjectExplorerContext, profile?: sqlops.IConnectionProfile): Promise<void> {
|
||||
async function handleNewNotebookTask(oeContext?: azdata.ObjectExplorerContext, profile?: azdata.IConnectionProfile): Promise<void> {
|
||||
// Ensure we get a unique ID for the notebook. For now we're using a different prefix to the built-in untitled files
|
||||
// to handle this. We should look into improving this in the future
|
||||
let untitledUri = vscode.Uri.parse(`untitled:Notebook-${untitledCounter++}`);
|
||||
let editor = await sqlops.nb.showNotebookDocument(untitledUri, {
|
||||
let editor = await azdata.nb.showNotebookDocument(untitledUri, {
|
||||
connectionId: profile.id,
|
||||
providerId: jupyterNotebookProviderId,
|
||||
preview: false,
|
||||
@@ -203,7 +203,7 @@ async function handleNewNotebookTask(oeContext?: sqlops.ObjectExplorerContext, p
|
||||
}
|
||||
}
|
||||
|
||||
async function handleOpenNotebookTask(profile: sqlops.IConnectionProfile): Promise<void> {
|
||||
async function handleOpenNotebookTask(profile: azdata.IConnectionProfile): Promise<void> {
|
||||
let notebookFileTypeName = localize('notebookFileType', 'Notebooks');
|
||||
let filter = {};
|
||||
filter[notebookFileTypeName] = 'ipynb';
|
||||
@@ -219,7 +219,7 @@ async function handleOpenNotebookTask(profile: sqlops.IConnectionProfile): Promi
|
||||
// in the future might want additional supported types
|
||||
vscode.window.showErrorMessage(localize('unsupportedFileType', 'Only .ipynb Notebooks are supported'));
|
||||
} else {
|
||||
await sqlops.nb.showNotebookDocument(fileUri, {
|
||||
await azdata.nb.showNotebookDocument(fileUri, {
|
||||
connectionId: profile.id,
|
||||
providerId: jupyterNotebookProviderId,
|
||||
preview: false
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
import * as vscode from 'vscode';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
@@ -42,7 +42,7 @@ export interface ICommandViewContext extends ICommandBaseContext {
|
||||
|
||||
export interface ICommandObjectExplorerContext extends ICommandBaseContext {
|
||||
type: 'objectexplorer';
|
||||
explorerContext: sqlops.ObjectExplorerContext;
|
||||
explorerContext: azdata.ObjectExplorerContext;
|
||||
}
|
||||
|
||||
export type CommandContext = ICommandObjectExplorerContext | ICommandViewContext | ICommandUriContext | ICommandUnknownContext;
|
||||
@@ -115,7 +115,7 @@ export abstract class Command extends vscode.Disposable {
|
||||
}
|
||||
|
||||
if (firstArg && utils.isObjectExplorerContext(firstArg)) {
|
||||
const [explorerContext, ...rest] = args as [sqlops.ObjectExplorerContext, any];
|
||||
const [explorerContext, ...rest] = args as [azdata.ObjectExplorerContext, any];
|
||||
return [{ command: command, type: constants.ObjectExplorerService, explorerContext: explorerContext }, rest];
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
@@ -13,14 +13,14 @@ import * as constants from '../constants';
|
||||
import { IFileSource, IHdfsOptions, IRequestParams, FileSourceFactory } from './fileSources';
|
||||
|
||||
export class SqlClusterConnection {
|
||||
private _connection: sqlops.connection.Connection;
|
||||
private _profile: sqlops.IConnectionProfile;
|
||||
private _connection: azdata.connection.Connection;
|
||||
private _profile: azdata.IConnectionProfile;
|
||||
private _host: string;
|
||||
private _port: string;
|
||||
private _user: string;
|
||||
private _password: string;
|
||||
|
||||
constructor(connectionInfo: sqlops.connection.Connection | sqlops.IConnectionProfile) {
|
||||
constructor(connectionInfo: azdata.connection.Connection | azdata.IConnectionProfile) {
|
||||
this.validate(connectionInfo);
|
||||
|
||||
if ('id' in connectionInfo) {
|
||||
@@ -36,14 +36,14 @@ export class SqlClusterConnection {
|
||||
this._password = this._connection.options[constants.passwordPropName];
|
||||
}
|
||||
|
||||
public get connection(): sqlops.connection.Connection { return this._connection; }
|
||||
public get profile(): sqlops.IConnectionProfile { return this._profile; }
|
||||
public get connection(): azdata.connection.Connection { return this._connection; }
|
||||
public get profile(): azdata.IConnectionProfile { return this._profile; }
|
||||
public get host(): string { return this._host; }
|
||||
public get port(): number { return this._port ? Number.parseInt(this._port) : constants.defaultKnoxPort; }
|
||||
public get user(): string { return this._user; }
|
||||
public get password(): string { return this._password; }
|
||||
|
||||
public isMatch(connection: SqlClusterConnection | sqlops.ConnectionInfo): boolean {
|
||||
public isMatch(connection: SqlClusterConnection | azdata.ConnectionInfo): boolean {
|
||||
if (!connection) { return false; }
|
||||
let options1 = connection instanceof SqlClusterConnection ?
|
||||
connection._connection.options : connection.options;
|
||||
@@ -69,7 +69,7 @@ export class SqlClusterConnection {
|
||||
return FileSourceFactory.instance.createHdfsFileSource(options);
|
||||
}
|
||||
|
||||
private validate(connectionInfo: sqlops.ConnectionInfo): void {
|
||||
private validate(connectionInfo: azdata.ConnectionInfo): void {
|
||||
if (!connectionInfo) {
|
||||
throw new Error(localize('connectionInfoUndefined', 'ConnectionInfo is undefined.'));
|
||||
}
|
||||
@@ -84,7 +84,7 @@ export class SqlClusterConnection {
|
||||
}
|
||||
}
|
||||
|
||||
private getMissingProperties(connectionInfo: sqlops.ConnectionInfo): string[] {
|
||||
private getMissingProperties(connectionInfo: azdata.ConnectionInfo): string[] {
|
||||
if (!connectionInfo || !connectionInfo.options) { return undefined; }
|
||||
return [
|
||||
constants.hostPropName, constants.knoxPortPropName,
|
||||
@@ -92,15 +92,15 @@ export class SqlClusterConnection {
|
||||
].filter(e => connectionInfo.options[e] === undefined);
|
||||
}
|
||||
|
||||
private toConnection(connProfile: sqlops.IConnectionProfile): sqlops.connection.Connection {
|
||||
let connection: sqlops.connection.Connection = Object.assign(connProfile,
|
||||
private toConnection(connProfile: azdata.IConnectionProfile): azdata.connection.Connection {
|
||||
let connection: azdata.connection.Connection = Object.assign(connProfile,
|
||||
{ connectionId: this._profile.id });
|
||||
return connection;
|
||||
}
|
||||
|
||||
private toConnectionProfile(connectionInfo: sqlops.connection.Connection): sqlops.IConnectionProfile {
|
||||
private toConnectionProfile(connectionInfo: azdata.connection.Connection): azdata.IConnectionProfile {
|
||||
let options = connectionInfo.options;
|
||||
let connProfile: sqlops.IConnectionProfile = Object.assign(<sqlops.IConnectionProfile>{},
|
||||
let connProfile: azdata.IConnectionProfile = Object.assign(<azdata.IConnectionProfile>{},
|
||||
connectionInfo,
|
||||
{
|
||||
serverName: `${options[constants.hostPropName]},${options[constants.knoxPortPropName]}`,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as fs from 'fs';
|
||||
import * as fspath from 'path';
|
||||
import * as clipboardy from 'clipboardy';
|
||||
@@ -92,7 +92,7 @@ export class UploadFilesCommand extends ProgressCommand {
|
||||
localize('uploading', 'Uploading files to HDFS'), true,
|
||||
() => this.apiWrapper.showInformationMessage(localize('uploadCanceled', 'Upload operation was canceled')));
|
||||
if (context.type === constants.ObjectExplorerService) {
|
||||
let objectExplorerNode = await sqlops.objectexplorer.getNode(context.explorerContext.connectionProfile.id, folderNode.getNodeInfo().nodePath);
|
||||
let objectExplorerNode = await azdata.objectexplorer.getNode(context.explorerContext.connectionProfile.id, folderNode.getNodeInfo().nodePath);
|
||||
await objectExplorerNode.refresh();
|
||||
}
|
||||
}
|
||||
@@ -150,7 +150,7 @@ export class MkDirCommand extends ProgressCommand {
|
||||
localize('makingDir', 'Creating directory'), true,
|
||||
() => this.apiWrapper.showInformationMessage(localize('mkdirCanceled', 'Operation was canceled')));
|
||||
if (context.type === constants.ObjectExplorerService) {
|
||||
let objectExplorerNode = await sqlops.objectexplorer.getNode(context.explorerContext.connectionProfile.id, folderNode.getNodeInfo().nodePath);
|
||||
let objectExplorerNode = await azdata.objectexplorer.getNode(context.explorerContext.connectionProfile.id, folderNode.getNodeInfo().nodePath);
|
||||
await objectExplorerNode.refresh();
|
||||
}
|
||||
}
|
||||
@@ -191,9 +191,9 @@ export class DeleteFilesCommand extends Command {
|
||||
// TODO ideally would let node define if it's deletable
|
||||
// TODO also, would like to change this to getNodeInfo as OE is the primary use case now
|
||||
let treeItem = await node.getTreeItem();
|
||||
let oeNodeToRefresh: sqlops.objectexplorer.ObjectExplorerNode = undefined;
|
||||
let oeNodeToRefresh: azdata.objectexplorer.ObjectExplorerNode = undefined;
|
||||
if (context.type === constants.ObjectExplorerService) {
|
||||
let oeNodeToDelete = await sqlops.objectexplorer.getNode(context.explorerContext.connectionProfile.id, node.getNodeInfo().nodePath);
|
||||
let oeNodeToDelete = await azdata.objectexplorer.getNode(context.explorerContext.connectionProfile.id, node.getNodeInfo().nodePath);
|
||||
oeNodeToRefresh = await oeNodeToDelete.getParent();
|
||||
}
|
||||
switch (treeItem.contextValue) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as fspath from 'path';
|
||||
import * as fs from 'fs';
|
||||
@@ -153,10 +153,10 @@ export class FolderNode extends HdfsFileSourceNode {
|
||||
return item;
|
||||
}
|
||||
|
||||
getNodeInfo(): sqlops.NodeInfo {
|
||||
getNodeInfo(): azdata.NodeInfo {
|
||||
// TODO handle error message case by returning it in the OE API
|
||||
// TODO support better mapping of node type
|
||||
let nodeInfo: sqlops.NodeInfo = {
|
||||
let nodeInfo: azdata.NodeInfo = {
|
||||
label: this.getDisplayName(),
|
||||
isLeaf: false,
|
||||
errorMessage: undefined,
|
||||
@@ -252,9 +252,9 @@ export class FileNode extends HdfsFileSourceNode implements IFileNode {
|
||||
}
|
||||
|
||||
|
||||
getNodeInfo(): sqlops.NodeInfo {
|
||||
getNodeInfo(): azdata.NodeInfo {
|
||||
// TODO improve node type handling so it's not tied to SQL Server types
|
||||
let nodeInfo: sqlops.NodeInfo = {
|
||||
let nodeInfo: azdata.NodeInfo = {
|
||||
label: this.getDisplayName(),
|
||||
isLeaf: true,
|
||||
errorMessage: undefined,
|
||||
@@ -349,8 +349,8 @@ export class ErrorNode extends TreeNode {
|
||||
}
|
||||
|
||||
|
||||
getNodeInfo(): sqlops.NodeInfo {
|
||||
let nodeInfo: sqlops.NodeInfo = {
|
||||
getNodeInfo(): azdata.NodeInfo {
|
||||
let nodeInfo: azdata.NodeInfo = {
|
||||
label: this.message,
|
||||
isLeaf: false,
|
||||
errorMessage: undefined,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
@@ -23,10 +23,10 @@ import { ICommandObjectExplorerContext } from './command';
|
||||
|
||||
export const mssqlOutputChannel = vscode.window.createOutputChannel(constants.providerId);
|
||||
|
||||
export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sqlops.ObjectExplorerNodeProvider, ITreeChangeHandler {
|
||||
export class MssqlObjectExplorerNodeProvider extends ProviderBase implements azdata.ObjectExplorerNodeProvider, ITreeChangeHandler {
|
||||
public readonly supportedProviderId: string = constants.providerId;
|
||||
private sessionMap: Map<string, SqlClusterSession>;
|
||||
private expandCompleteEmitter = new vscode.EventEmitter<sqlops.ObjectExplorerExpandInfo>();
|
||||
private expandCompleteEmitter = new vscode.EventEmitter<azdata.ObjectExplorerExpandInfo>();
|
||||
|
||||
constructor(private appContext: AppContext) {
|
||||
super();
|
||||
@@ -34,7 +34,7 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
|
||||
this.appContext.registerService<MssqlObjectExplorerNodeProvider>(constants.ObjectExplorerService, this);
|
||||
}
|
||||
|
||||
handleSessionOpen(session: sqlops.ObjectExplorerSession): Thenable<boolean> {
|
||||
handleSessionOpen(session: azdata.ObjectExplorerSession): Thenable<boolean> {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!session) {
|
||||
reject('handleSessionOpen requires a session object to be passed');
|
||||
@@ -44,10 +44,10 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
|
||||
});
|
||||
}
|
||||
|
||||
private async doSessionOpen(session: sqlops.ObjectExplorerSession): Promise<boolean> {
|
||||
private async doSessionOpen(session: azdata.ObjectExplorerSession): Promise<boolean> {
|
||||
if (!session || !session.sessionId) { return false; }
|
||||
|
||||
let sqlConnProfile = await sqlops.objectexplorer.getSessionConnectionProfile(session.sessionId);
|
||||
let sqlConnProfile = await azdata.objectexplorer.getSessionConnectionProfile(session.sessionId);
|
||||
if (!sqlConnProfile) { return false; }
|
||||
|
||||
let clusterConnInfo = await SqlClusterLookUp.getSqlClusterConnection(sqlConnProfile);
|
||||
@@ -59,7 +59,7 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
|
||||
return true;
|
||||
}
|
||||
|
||||
expandNode(nodeInfo: sqlops.ExpandNodeInfo, isRefresh: boolean = false): Thenable<boolean> {
|
||||
expandNode(nodeInfo: azdata.ExpandNodeInfo, isRefresh: boolean = false): Thenable<boolean> {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!nodeInfo) {
|
||||
reject('expandNode requires a nodeInfo object to be passed');
|
||||
@@ -69,7 +69,7 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
|
||||
});
|
||||
}
|
||||
|
||||
private async doExpandNode(nodeInfo: sqlops.ExpandNodeInfo, isRefresh: boolean = false): Promise<boolean> {
|
||||
private async doExpandNode(nodeInfo: azdata.ExpandNodeInfo, isRefresh: boolean = false): Promise<boolean> {
|
||||
let session = this.sessionMap.get(nodeInfo.sessionId);
|
||||
let response = {
|
||||
sessionId: nodeInfo.sessionId,
|
||||
@@ -95,8 +95,8 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
|
||||
return true;
|
||||
}
|
||||
|
||||
private async startExpansion(session: SqlClusterSession, nodeInfo: sqlops.ExpandNodeInfo, isRefresh: boolean = false): Promise<void> {
|
||||
let expandResult: sqlops.ObjectExplorerExpandInfo = {
|
||||
private async startExpansion(session: SqlClusterSession, nodeInfo: azdata.ExpandNodeInfo, isRefresh: boolean = false): Promise<void> {
|
||||
let expandResult: azdata.ObjectExplorerExpandInfo = {
|
||||
sessionId: session.sessionId,
|
||||
nodePath: nodeInfo.nodePath,
|
||||
errorMessage: undefined,
|
||||
@@ -125,24 +125,24 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
|
||||
this.expandCompleteEmitter.fire(expandResult);
|
||||
}
|
||||
|
||||
refreshNode(nodeInfo: sqlops.ExpandNodeInfo): Thenable<boolean> {
|
||||
refreshNode(nodeInfo: azdata.ExpandNodeInfo): Thenable<boolean> {
|
||||
// TODO #3815 implement properly
|
||||
return this.expandNode(nodeInfo, true);
|
||||
}
|
||||
|
||||
handleSessionClose(closeSessionInfo: sqlops.ObjectExplorerCloseSessionInfo): void {
|
||||
handleSessionClose(closeSessionInfo: azdata.ObjectExplorerCloseSessionInfo): void {
|
||||
this.sessionMap.delete(closeSessionInfo.sessionId);
|
||||
}
|
||||
|
||||
findNodes(findNodesInfo: sqlops.FindNodesInfo): Thenable<sqlops.ObjectExplorerFindNodesResponse> {
|
||||
findNodes(findNodesInfo: azdata.FindNodesInfo): Thenable<azdata.ObjectExplorerFindNodesResponse> {
|
||||
// TODO #3814 implement
|
||||
let response: sqlops.ObjectExplorerFindNodesResponse = {
|
||||
let response: azdata.ObjectExplorerFindNodesResponse = {
|
||||
nodes: []
|
||||
};
|
||||
return Promise.resolve(response);
|
||||
}
|
||||
|
||||
registerOnExpandCompleted(handler: (response: sqlops.ObjectExplorerExpandInfo) => any): void {
|
||||
registerOnExpandCompleted(handler: (response: azdata.ObjectExplorerExpandInfo) => any): void {
|
||||
this.expandCompleteEmitter.event(handler);
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
|
||||
this.appContext.apiWrapper.showErrorMessage(localize('sessionNotFound', 'Session for node {0} does not exist', node.nodePathValue));
|
||||
} else {
|
||||
let nodeInfo = node.getNodeInfo();
|
||||
let expandInfo: sqlops.ExpandNodeInfo = {
|
||||
let expandInfo: azdata.ExpandNodeInfo = {
|
||||
nodePath: nodeInfo.nodePath,
|
||||
sessionId: session.sessionId
|
||||
};
|
||||
@@ -181,7 +181,7 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
|
||||
return sqlClusterSession;
|
||||
}
|
||||
|
||||
async findSqlClusterNodeByContext<T extends TreeNode>(context: ICommandObjectExplorerContext | sqlops.ObjectExplorerContext): Promise<T> {
|
||||
async findSqlClusterNodeByContext<T extends TreeNode>(context: ICommandObjectExplorerContext | azdata.ObjectExplorerContext): Promise<T> {
|
||||
let node: T = undefined;
|
||||
let explorerContext = 'explorerContext' in context ? context.explorerContext : context;
|
||||
let sqlConnProfile = explorerContext.connectionProfile;
|
||||
@@ -198,7 +198,7 @@ export class MssqlObjectExplorerNodeProvider extends ProviderBase implements sql
|
||||
return node;
|
||||
}
|
||||
|
||||
public findSqlClusterSessionBySqlConnProfile(connectionProfile: sqlops.IConnectionProfile): SqlClusterSession {
|
||||
public findSqlClusterSessionBySqlConnProfile(connectionProfile: azdata.IConnectionProfile): SqlClusterSession {
|
||||
for (let session of this.sessionMap.values()) {
|
||||
if (session.isMatchedSqlConnection(connectionProfile)) {
|
||||
return session;
|
||||
@@ -213,8 +213,8 @@ export class SqlClusterSession {
|
||||
|
||||
constructor(
|
||||
private _sqlClusterConnection: SqlClusterConnection,
|
||||
private _sqlSession: sqlops.ObjectExplorerSession,
|
||||
private _sqlConnectionProfile: sqlops.IConnectionProfile,
|
||||
private _sqlSession: azdata.ObjectExplorerSession,
|
||||
private _sqlConnectionProfile: azdata.IConnectionProfile,
|
||||
private _appContext: AppContext,
|
||||
private _changeHandler: ITreeChangeHandler
|
||||
) {
|
||||
@@ -224,12 +224,12 @@ export class SqlClusterSession {
|
||||
}
|
||||
|
||||
public get sqlClusterConnection(): SqlClusterConnection { return this._sqlClusterConnection; }
|
||||
public get sqlSession(): sqlops.ObjectExplorerSession { return this._sqlSession; }
|
||||
public get sqlConnectionProfile(): sqlops.IConnectionProfile { return this._sqlConnectionProfile; }
|
||||
public get sqlSession(): azdata.ObjectExplorerSession { return this._sqlSession; }
|
||||
public get sqlConnectionProfile(): azdata.IConnectionProfile { return this._sqlConnectionProfile; }
|
||||
public get sessionId(): string { return this._sqlSession.sessionId; }
|
||||
public get rootNode(): SqlClusterRootNode { return this._rootNode; }
|
||||
|
||||
public isMatchedSqlConnection(sqlConnProfile: sqlops.IConnectionProfile): boolean {
|
||||
public isMatchedSqlConnection(sqlConnProfile: azdata.IConnectionProfile): boolean {
|
||||
return this._sqlConnectionProfile.id === sqlConnProfile.id;
|
||||
}
|
||||
}
|
||||
@@ -266,8 +266,8 @@ class SqlClusterRootNode extends TreeNode {
|
||||
throw new Error('Not intended for use in a file explorer view.');
|
||||
}
|
||||
|
||||
getNodeInfo(): sqlops.NodeInfo {
|
||||
let nodeInfo: sqlops.NodeInfo = {
|
||||
getNodeInfo(): azdata.NodeInfo {
|
||||
let nodeInfo: azdata.NodeInfo = {
|
||||
label: localize('rootLabel', 'Root'),
|
||||
isLeaf: false,
|
||||
errorMessage: undefined,
|
||||
@@ -311,8 +311,8 @@ class DataServicesNode extends TreeNode {
|
||||
throw new Error('Not intended for use in a file explorer view.');
|
||||
}
|
||||
|
||||
getNodeInfo(): sqlops.NodeInfo {
|
||||
let nodeInfo: sqlops.NodeInfo = {
|
||||
getNodeInfo(): azdata.NodeInfo {
|
||||
let nodeInfo: azdata.NodeInfo = {
|
||||
label: localize('dataServicesLabel', 'Data Services'),
|
||||
isLeaf: false,
|
||||
errorMessage: undefined,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { ITreeNode } from './types';
|
||||
|
||||
@@ -74,5 +74,5 @@ export abstract class TreeNode implements ITreeNode {
|
||||
abstract getChildren(refreshChildren: boolean): TreeNode[] | Promise<TreeNode[]>;
|
||||
abstract getTreeItem(): vscode.TreeItem | Promise<vscode.TreeItem>;
|
||||
|
||||
abstract getNodeInfo(): sqlops.NodeInfo;
|
||||
abstract getNodeInfo(): azdata.NodeInfo;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user