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