Add compile options to a few extensions (#8252)

* add compile options to a few extensions

* move dep to dev dep

* fix return types
This commit is contained in:
Anthony Dresser
2019-11-07 11:41:31 -08:00
committed by GitHub
parent b364e32beb
commit ef0a92d83f
68 changed files with 121 additions and 211 deletions

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
@@ -26,7 +24,7 @@ export class ExtHostObjectExplorerNodeStub implements azdata.objectexplorer.Obje
public metadata: azdata.ObjectMetadata;
public errorMessage: string;
constructor(nodeName: string, nodeSchema: string, nodeType, parent: azdata.objectexplorer.ObjectExplorerNode) {
constructor(nodeName: string, nodeSchema: string, nodeType: string, parent: azdata.objectexplorer.ObjectExplorerNode) {
this.parent = parent;
this.nodeType = nodeType;
this.metadata = { metadataType: undefined, metadataTypeName: undefined, name: nodeName, schema: nodeSchema, urn: undefined };
@@ -65,4 +63,4 @@ export class ExtHostObjectExplorerNodeStub implements azdata.objectexplorer.Obje
createChild(nodeName: string, nodeSchema: string, nodeType: string): ExtHostObjectExplorerNodeStub {
return new ExtHostObjectExplorerNodeStub(nodeName, nodeSchema, nodeType, this);
}
}
}

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as should from 'should';
import 'mocha';

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
export interface IPackageInfo {
name: string;
@@ -10,7 +9,7 @@ export interface IPackageInfo {
aiKey: string;
}
export function getPackageInfo(packageJson: any): IPackageInfo {
export function getPackageInfo(packageJson: any): IPackageInfo | undefined {
if (packageJson) {
return {
name: packageJson.name,
@@ -18,6 +17,7 @@ export function getPackageInfo(packageJson: any): IPackageInfo {
aiKey: packageJson.aiKey
};
}
return undefined;
}
/**
@@ -58,4 +58,4 @@ export function getTelemetryErrorType(msg: string): string {
else {
return 'Other';
}
}
}

View File

@@ -13,9 +13,7 @@
"experimentalDecorators": true,
"moduleResolution": "node",
"strict": false,
"noImplicitAny": false,
"noUnusedParameters": false,
"noImplicitReturns": false,
},
"exclude": [
"node_modules"

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import { promises as fs } from 'fs';
@@ -28,7 +26,7 @@ export class AgentUtils {
return AgentUtils._agentService;
}
public static async getDatabases(ownerUri: string): Promise<string[]> {
public static async getDatabases(ownerUri: string): Promise<string[] | undefined> {
if (!AgentUtils._connectionService) {
let currentConnection = await azdata.connection.getCurrentConnection();
this._connectionService = azdata.dataprotocol.getProvider<azdata.ConnectionProvider>(currentConnection.providerId, azdata.DataProviderType.ConnectionProvider);
@@ -37,6 +35,7 @@ export class AgentUtils {
if (result && result.databaseNames && result.databaseNames.length > 0) {
return result.databaseNames;
}
return undefined;
});
}

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
@@ -148,4 +147,4 @@ export class AlertData implements IAgentDialogData {
return azdata.AlertType.sqlServerEvent;
}
}
}
}

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
@@ -195,4 +194,4 @@ export class JobData implements IAgentDialogData {
startStepId: this.startStepId
};
}
}
}

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
@@ -269,4 +268,4 @@ export class JobStepData implements IAgentDialogData {
return JobStepDialog.NextStep;
}
}
}
}

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import { AgentUtils } from '../agentUtils';

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import { AgentUtils } from '../agentUtils';
@@ -21,7 +20,7 @@ export class PickScheduleData implements IAgentDialogData {
this.jobName = jobName;
}
public async initialize(): Promise<azdata.AgentJobScheduleInfo[]> {
public async initialize(): Promise<azdata.AgentJobScheduleInfo[] | undefined> {
let agentService = await AgentUtils.getAgentService();
try {
let result = await agentService.getJobSchedules(this.ownerUri);
@@ -30,6 +29,7 @@ export class PickScheduleData implements IAgentDialogData {
this.schedules = result.schedules;
return this.schedules;
}
return undefined;
} catch (error) {
throw error;
}

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import { AgentUtils } from '../agentUtils';

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
@@ -31,9 +30,9 @@ export abstract class AgentDialog<T extends IAgentDialogData> {
return this.model.dialogMode;
}
protected abstract async updateModel();
protected abstract async updateModel(): Promise<void>;
protected abstract async initializeDialog(dialog: azdata.window.Dialog);
protected abstract async initializeDialog(dialog: azdata.window.Dialog): Promise<void>;
public async openDialog(dialogName?: string) {
if (!this._isOpen) {
@@ -87,4 +86,4 @@ export abstract class AgentDialog<T extends IAgentDialogData> {
public get isOpen(): boolean {
return this._isOpen;
}
}
}

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
import { AgentDialog } from './agentDialog';
@@ -112,7 +110,6 @@ export class AlertDialog extends AgentDialog<AlertData> {
private static readonly IncludeErrorInEmailCheckBoxLabel: string = localize('alertDialog.IncludeErrorInEmail', "Include alert error text in e-mail");
private static readonly IncludeErrorInPagerCheckBoxLabel: string = localize('alertDialog.IncludeErrorInPager', "Include alert error text in pager");
private static readonly AdditionalMessageTextBoxLabel: string = localize('alertDialog.AdditionalNotification', "Additional notification message to send");
private static readonly DelayBetweenResponsesTextBoxLabel: string = localize('alertDialog.DelayBetweenResponse', "Delay between responses");
private static readonly DelayMinutesTextBoxLabel: string = localize('alertDialog.DelayMinutes', "Delay Minutes");
private static readonly DelaySecondsTextBoxLabel: string = localize('alertDialog.DelaySeconds', "Delay Seconds");
@@ -526,7 +523,7 @@ export class AlertDialog extends AgentDialog<AlertData> {
return severityNumber;
}
protected updateModel() {
protected async updateModel(): Promise<void> {
this.model.name = this.nameTextBox.value;
this.model.isEnabled = this.enabledCheckBox.checked;
this.model.jobId = this.jobId;

View File

@@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
import { JobData } from '../data/jobData';
@@ -59,7 +59,6 @@ export class JobDialog extends AgentDialog<JobData> {
// Schedules tab strings
private readonly SchedulesTopLabelString: string = localize('jobDialog.schedulesaLabel', "Schedules list");
private readonly PickScheduleButtonString: string = localize('jobDialog.pickSchedule', "Pick Schedule");
private readonly ScheduleNameLabelString: string = localize('jobDialog.scheduleNameLabel', "Schedule Name");
// Alerts tab strings
private readonly AlertsTopLabelString: string = localize('jobDialog.alertsList', "Alerts list");
@@ -98,7 +97,6 @@ export class JobDialog extends AgentDialog<JobData> {
private removeScheduleButton: azdata.ButtonComponent;
// Notifications tab controls
private notificationsTabTopLabel: azdata.TextComponent;
private emailCheckBox: azdata.CheckBoxComponent;
private emailOperatorDropdown: azdata.DropDownComponent;
private emailConditionDropdown: azdata.DropDownComponent;
@@ -549,7 +547,6 @@ export class JobDialog extends AgentDialog<JobData> {
private initializeNotificationsTab() {
this.notificationsTab.registerContent(async view => {
this.notificationsTabTopLabel = view.modelBuilder.text().withProperties({ value: this.NotificationsTabTopLabelString }).component();
this.emailCheckBox = view.modelBuilder.checkBox().withProperties({
label: this.EmailCheckBoxString,
width: 80
@@ -652,10 +649,10 @@ export class JobDialog extends AgentDialog<JobData> {
});
}
private convertStepsToData(jobSteps: azdata.AgentJobStepInfo[]): any[][] {
let result = [];
private convertStepsToData(jobSteps: azdata.AgentJobStepInfo[]): Array<string | number>[] {
let result: Array<string | number>[] = [];
jobSteps.forEach(jobStep => {
let cols = [];
let cols: Array<string | number> = [];
cols.push(jobStep.id);
cols.push(jobStep.stepName);
cols.push(JobStepData.convertToSubSystemDisplayName(jobStep.subSystem));
@@ -666,8 +663,8 @@ export class JobDialog extends AgentDialog<JobData> {
return result;
}
private convertSchedulesToData(jobSchedules: azdata.AgentJobScheduleInfo[]): any[][] {
let result = [];
private convertSchedulesToData(jobSchedules: azdata.AgentJobScheduleInfo[]): Array<string | number>[] {
let result: Array<string | number>[] = [];
jobSchedules.forEach(schedule => {
let cols = [];
cols.push(schedule.id);
@@ -678,8 +675,8 @@ export class JobDialog extends AgentDialog<JobData> {
return result;
}
private convertAlertsToData(alerts: azdata.AgentAlertInfo[]): any[][] {
let result = [];
private convertAlertsToData(alerts: azdata.AgentAlertInfo[]): Array<string | boolean>[] {
let result: Array<string | boolean>[] = [];
alerts.forEach(alert => {
let cols = [];
cols.push(alert.name);
@@ -690,7 +687,7 @@ export class JobDialog extends AgentDialog<JobData> {
return result;
}
protected updateModel() {
protected async updateModel(): Promise<void> {
this.model.name = this.nameTextBox.value;
this.model.owner = this.ownerTextBox.value;
this.model.enabled = this.enabledCheckBox.checked;

View File

@@ -2,16 +2,15 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { JobStepData } from '../data/jobStepData';
import { AgentUtils } from '../agentUtils';
import { JobData } from '../data/jobData';
import { AgentDialog } from './agentDialog';
import { AgentDialogMode } from '../interfaces';
const path = require('path');
import * as path from 'path';
const localize = nls.loadMessageBundle();
@@ -153,7 +152,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
this.dialog.content = [this.generalTab, this.advancedTab];
}
private createCommands(view, queryProvider: azdata.QueryProvider) {
private createCommands(view: azdata.ModelView, queryProvider: azdata.QueryProvider) {
this.openButton = view.modelBuilder.button()
.withProperties({
label: this.OpenCommandText,
@@ -396,9 +395,9 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
});
}
private createRetryCounters(view) {
private createRetryCounters(view: azdata.ModelView) {
this.retryAttemptsBox = view.modelBuilder.inputBox()
.withValidation(component => component.value >= 0)
.withValidation(component => Number(component.value) >= 0)
.withProperties({
inputType: 'number',
width: '100%',
@@ -406,7 +405,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
})
.component();
this.retryIntervalBox = view.modelBuilder.inputBox()
.withValidation(component => component.value >= 0)
.withValidation(component => Number(component.value) >= 0)
.withProperties({
inputType: 'number',
width: '100%',
@@ -491,7 +490,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
azdata.window.openDialog(this.fileBrowserDialog);
}
private createTSQLOptions(view) {
private createTSQLOptions(view: azdata.ModelView) {
this.outputFileBrowserButton = view.modelBuilder.button()
.withProperties({ width: '20px', label: '...' }).component();
this.outputFileBrowserButton.onDidClick(() => this.openFileBrowserDialog());
@@ -536,7 +535,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
return outputFileForm;
}
protected updateModel() {
protected async updateModel(): Promise<void> {
this.model.stepName = this.nameTextBox.value;
if (!this.model.stepName || this.model.stepName.length === 0) {
this.dialog.message = this.dialog.message = { text: this.BlankStepNameErrorText };

View File

@@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as path from 'path';
import * as azdata from 'azdata';
@@ -17,7 +17,6 @@ const localize = nls.loadMessageBundle();
const CreateDialogTitle: string = localize('notebookDialog.newJob', "New Notebook Job");
const EditDialogTitle: string = localize('notebookDialog.editJob', "Edit Notebook Job");
const GeneralTabText: string = localize('notebookDialog.general', "General");
const BlankJobNameErrorText: string = localize('notebookDialog.blankJobNameError', "The name of the job cannot be blank.");
// Notebook details strings
const NotebookDetailsSeparatorTitle: string = localize('notebookDialog.notebookSection', "Notebook Details");
@@ -33,7 +32,6 @@ const OwnerTextBoxLabel: string = localize('notebookDialog.owner', "Owner");
const SchedulesTopLabelString: string = localize('notebookDialog.schedulesaLabel', "Schedules list");
const PickScheduleButtonString: string = localize('notebookDialog.pickSchedule', "Pick Schedule");
const RemoveScheduleButtonString: string = localize('notebookDialog.removeSchedule', "Remove Schedule");
const ScheduleNameLabelString: string = localize('notebookDialog.scheduleNameLabel', "Schedule Name");
const DescriptionTextBoxLabel: string = localize('notebookDialog.description', "Description");
// Event Name strings
@@ -69,7 +67,6 @@ export class NotebookDialog extends AgentDialog<NotebookData> {
private isEdit: boolean = false;
// Job objects
private steps: azdata.AgentJobStepInfo[];
private schedules: azdata.AgentJobScheduleInfo[];
constructor(ownerUri: string, options: NotebookDialogOptions = undefined) {
@@ -77,7 +74,6 @@ export class NotebookDialog extends AgentDialog<NotebookData> {
ownerUri,
new NotebookData(ownerUri, options),
options.notebookInfo ? EditDialogTitle : CreateDialogTitle);
this.steps = this.model.jobSteps ? this.model.jobSteps : [];
this.schedules = this.model.jobSchedules ? this.model.jobSchedules : [];
this.isEdit = options.notebookInfo ? true : false;
this.dialogName = this.isEdit ? EditJobDialogEvent : NewJobDialogEvent;
@@ -280,10 +276,6 @@ export class NotebookDialog extends AgentDialog<NotebookData> {
else {
this.templateFilePathBox.required = true;
}
let idx: number = undefined;
if (this.model.category && this.model.category !== '') {
idx = this.model.jobCategories.indexOf(this.model.category);
}
this.descriptionTextBox.value = this.model.description;
this.openTemplateFileButton.onDidClick(e => {
});
@@ -298,14 +290,8 @@ export class NotebookDialog extends AgentDialog<NotebookData> {
}
private createRowContainer(view: azdata.ModelView): azdata.FlexBuilder {
return view.modelBuilder.flexContainer().withLayout({
flexFlow: 'row',
justifyContent: 'space-between'
});
}
private convertSchedulesToData(jobSchedules: azdata.AgentJobScheduleInfo[]): any[][] {
let result = [];
private convertSchedulesToData(jobSchedules: azdata.AgentJobScheduleInfo[]): Array<string | number>[] {
let result: Array<string | number>[] = [];
jobSchedules.forEach(schedule => {
let cols = [];
cols.push(schedule.id);
@@ -316,7 +302,7 @@ export class NotebookDialog extends AgentDialog<NotebookData> {
return result;
}
protected updateModel() {
protected async updateModel(): Promise<void> {
this.model.name = this.nameTextBox.value;
this.model.owner = this.ownerTextBox.value;
this.model.description = this.descriptionTextBox.value;

View File

@@ -3,10 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { OperatorData } from '../data/operatorData';
import * as nls from 'vscode-nls';
import { AgentDialog } from './agentDialog';
@@ -409,7 +406,7 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
});
}
protected updateModel() {
protected async updateModel(): Promise<void> {
this.model.name = this.nameTextBox.value;
this.model.enabled = this.enabledCheckBox.checked;
this.model.emailAddress = this.emailNameTextBox.value;

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
import * as vscode from 'vscode';

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
import { AgentDialog } from './agentDialog';
@@ -34,7 +32,6 @@ export class ProxyDialog extends AgentDialog<ProxyData> {
private static readonly SSASCommandLabel: string = localize('createProxy.SSASCommandLabel', "SQL Server Analysis Services Command");
private static readonly SSISPackageLabel: string = localize('createProxy.SSISPackage', "SQL Server Integration Services Package");
private static readonly PowerShellLabel: string = localize('createProxy.PowerShell', "PowerShell");
private static readonly SubSystemHeadingLabel: string = localize('createProxy.subSystemHeading', "Active to the following subsytems");
private readonly NewProxyDialog = 'NewProxyDialogOpened';
private readonly EditProxyDialog = 'EditProxyDialogOpened';
@@ -189,7 +186,7 @@ export class ProxyDialog extends AgentDialog<ProxyData> {
label: ProxyDialog.PowerShellLabel
}).component();
let checkBoxContainer = view.modelBuilder.groupContainer()
view.modelBuilder.groupContainer()
.withItems([this.operatingSystemCheckBox, this.replicationSnapshotCheckBox,
this.replicationTransactionLogCheckBox, this.replicationDistributorCheckBox, this.replicationMergeCheckbox,
this.replicationQueueReaderCheckbox, this.sqlQueryCheckBox, this.sqlCommandCheckBox, this.sqlIntegrationServicesPackageCheckbox,
@@ -217,7 +214,7 @@ export class ProxyDialog extends AgentDialog<ProxyData> {
}
protected updateModel() {
protected async updateModel(): Promise<void> {
this.model.accountName = this.proxyNameTextBox.value;
this.model.credentialName = this.credentialNameDropDown.value as string;
this.model.credentialId = this.credentials.find(

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
@@ -92,4 +91,4 @@ export class ScheduleDialog {
this.model.selectedSchedule = this.model.schedules[selectedRow];
}
}
}
}

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
@@ -36,7 +35,6 @@ export class MainController {
protected _context: vscode.ExtensionContext;
private jobDialog: JobDialog;
private jobStepDialog: JobStepDialog;
private alertDialog: AlertDialog;
private operatorDialog: OperatorDialog;
private proxyDialog: ProxyDialog;
@@ -204,13 +202,6 @@ export class MainController {
connection = await azdata.connection.openConnectionDialog();
}
else {
let sqlConnectionsPresent: boolean;
for (let i = 0; i < connections.length; i++) {
if (connections[i].providerName === 'MSSQL') {
sqlConnectionsPresent = true;
break;
}
}
let connectionNames: azdata.connection.Connection[] = [];
let connectionDisplayString: string[] = [];
for (let i = 0; i < connections.length; i++) {

View File

@@ -2,16 +2,13 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as should from 'should';
import * as TypeMoq from 'typemoq';
import 'mocha';
import * as azdata from 'azdata';
import { JobData } from '../../data/jobData';
const testOwnerUri = 'agent://testuri';
let mockJobData: TypeMoq.IMock<JobData>;
let mockAgentService: TypeMoq.IMock<azdata.AgentServicesProvider>;
describe('Agent extension create job objects', function (): void {
@@ -37,7 +34,6 @@ describe('Agent extension create job objects', function (): void {
should.strictEqual(createJobResult, undefined);
createJobResult = mockAgentService.object.createJob(testOwnerUri, TypeMoq.It.isAny());
should.notEqual(createJobResult, undefined);
mockJobData = TypeMoq.Mock.ofType<JobData>(JobData, TypeMoq.MockBehavior.Loose, false, [TypeMoq.It.isAnyString(), undefined, mockAgentService]);
});
it('Create Alert Data', async () => {

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import 'mocha';
import * as should from 'should';

View File

@@ -10,10 +10,7 @@
"experimentalDecorators": true,
"moduleResolution": "node",
"strict": false,
"noImplicitAny": false,
"noUnusedParameters": false,
"noImplicitReturns": false,
"noUnusedLocals": false,
"noUnusedParameters": false
},
"exclude": [
"node_modules"

View File

@@ -159,6 +159,7 @@
},
"devDependencies": {
"@types/kerberos": "^1.1.0",
"@types/request": "^2.48.3",
"vscode": "^1.1.36"
}
}

View File

@@ -3,17 +3,15 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { ClusterController, ControllerError } from '../controller/clusterControllerApi';
import { ControllerTreeDataProvider } from '../tree/controllerTreeDataProvider';
import { TreeNode } from '../tree/treeNode';
import { AuthType } from '../constants';
import { ManageControllerCommand } from '../../extension';
import { BdcDashboardOptions } from './bdcDashboardModel';
import { ControllerNode } from '../tree/controllerTreeNode';
const localize = nls.loadMessageBundle();
@@ -33,7 +31,7 @@ export class AddControllerDialogModel {
private _authTypes: azdata.CategoryValue[];
constructor(
public treeDataProvider: ControllerTreeDataProvider,
public node?: TreeNode,
public node?: ControllerNode,
public prefilledUrl?: string,
public prefilledAuth?: azdata.CategoryValue,
public prefilledUsername?: string,

View File

@@ -192,7 +192,7 @@ export class BdcDashboard extends BdcDashboardPage {
* @param serviceName The name of the service to switch to the tab of
*/
public switchToServiceTab(serviceName: string): void {
const tabPageMapping = this.serviceTabPageMapping[serviceName];
const tabPageMapping = this.serviceTabPageMapping.get(serviceName);
if (!tabPageMapping) {
return;
}
@@ -213,7 +213,7 @@ export class BdcDashboard extends BdcDashboardPage {
if (services) {
// Add a nav item for each service
services.forEach(s => {
const existingTabPage = this.serviceTabPageMapping[s.serviceName];
const existingTabPage = this.serviceTabPageMapping.get(s.serviceName);
if (existingTabPage) {
// We've already created the tab and page for this service, just update the tab health status dot
existingTabPage.navTab.dot.value = getHealthStatusDot(s.healthStatus);
@@ -221,7 +221,7 @@ export class BdcDashboard extends BdcDashboardPage {
// New service - create the page and tab
const navItem = createServiceNavTab(this.modelView.modelBuilder, s);
const serviceStatusPage = new BdcServiceStatusPage(s.serviceName, this.model, this.modelView).container;
this.serviceTabPageMapping[s.serviceName] = { navTab: navItem, servicePage: serviceStatusPage };
this.serviceTabPageMapping.set(s.serviceName, { navTab: navItem, servicePage: serviceStatusPage });
navItem.div.onDidClick(() => {
this.switchToServiceTab(s.serviceName);
});

View File

@@ -79,7 +79,7 @@ export class BdcServiceStatusPage extends BdcDashboardPage {
private createResourceNavTabs(resources: ResourceStatusModel[]) {
let tabIndex = this.createdTabs.size;
resources.forEach(resource => {
const existingTab: ServiceTab = this.createdTabs[resource.resourceName];
const existingTab: ServiceTab = this.createdTabs.get(resource.resourceName);
if (existingTab) {
// We already created this tab so just update the status
existingTab.dot.value = getHealthStatusDot(resource.healthStatus);
@@ -87,7 +87,7 @@ export class BdcServiceStatusPage extends BdcDashboardPage {
// New tab - create and add to the end of the container
const currentIndex = tabIndex++;
const resourceHeaderTab = createResourceHeaderTab(this.modelView.modelBuilder, resource);
this.createdTabs[resource.resourceName] = resourceHeaderTab;
this.createdTabs.set(resource.resourceName, resourceHeaderTab);
const resourceStatusPage: azdata.FlexContainer = new BdcDashboardResourceStatusPage(this.model, this.modelView, this.serviceName, resource.resourceName).container;
resourceHeaderTab.div.onDidClick(() => {
// Don't need to do anything if this is already the currently selected tab

View File

@@ -22,7 +22,7 @@ function convertCredsToJson(creds: string): { credentials: {} } {
if (!creds) {
return undefined;
}
let credObj = { 'credentials': {} };
let credObj: { 'credentials': { [key: string]: any } } = { 'credentials': {} };
let pairs = creds.split(',');
let validPairs: string[] = [];
for (let i = 0; i < pairs.length; i++) {

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
import * as vscode from 'vscode';

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { TreeNode } from './treeNode';
export interface IControllerTreeChangeHandler {

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as vscode from 'vscode';
import * as azdata from 'azdata';
import { TreeNode } from './treeNode';
@@ -77,7 +75,7 @@ export class ControllerTreeDataProvider implements vscode.TreeDataProvider<TreeN
this.notifyNodeChanged();
}
public deleteController(url: string, auth: AuthType, username: string): ControllerNode {
public deleteController(url: string, auth: AuthType, username: string): ControllerNode[] {
let deleted = this.root.deleteControllerNode(url, auth, username);
if (deleted) {
this.notifyNodeChanged();

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as vscode from 'vscode';
import * as azdata from 'azdata';
import { IControllerTreeChangeHandler } from './controllerTreeChangeHandler';
@@ -129,20 +127,20 @@ export class ControllerRootNode extends ControllerTreeNode {
}
}
public deleteControllerNode(url: string, auth: AuthType, username: string): ControllerNode {
public deleteControllerNode(url: string, auth: AuthType, username: string): ControllerNode[] | undefined {
if (!url || (auth === 'basic' && !username)) {
return undefined;
}
let nodes = this.children as ControllerNode[];
let index = nodes.findIndex(e => isControllerMatch(e, url, auth, username));
let deleted = undefined;
let deleted: ControllerNode[] | undefined;
if (index >= 0) {
deleted = nodes.splice(index, 1);
}
return deleted;
}
private getExistingControllerNode(url: string, auth: AuthType, username: string): ControllerNode {
private getExistingControllerNode(url: string, auth: AuthType, username: string): ControllerNode | undefined {
if (!url || !username) {
return undefined;
}
@@ -169,7 +167,7 @@ export class ControllerNode extends ControllerTreeNode {
this.description = description;
}
public async getChildren(): Promise<ControllerTreeNode[]> {
public async getChildren(): Promise<ControllerTreeNode[] | undefined> {
if (this.children && this.children.length > 0) {
this.clearChildren();
}
@@ -178,11 +176,12 @@ export class ControllerNode extends ControllerTreeNode {
vscode.commands.executeCommand('bigDataClusters.command.addController', this);
return this.children as ControllerTreeNode[];
}
return undefined;
}
public static toIpAndPort(url: string): string {
public static toIpAndPort(url: string): string | undefined {
if (!url) {
return;
return undefined;
}
return url.trim().replace(/ /g, '').replace(/^.+\:\/\//, '');
}
@@ -245,4 +244,3 @@ export class ControllerNode extends ControllerTreeNode {
function isControllerMatch(node: ControllerNode, url: string, auth: string, username: string): unknown {
return node.url === url && node.auth === auth && node.username === username;
}

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
import * as vscode from 'vscode';

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { generateGuid } from '../utils';

View File

@@ -73,7 +73,7 @@ export function showErrorMessage(error: any, prefixText?: string): void {
* Mappings of the different expected state values to their localized friendly names.
* These are defined in aris/projects/controller/src/Microsoft.SqlServer.Controller/StateMachines
*/
const stateToDisplayTextMap = {
const stateToDisplayTextMap: { [key: string]: string } = {
// K8sScaledSetStateMachine
'creating': localize('state.creating', "Creating"),
'waiting': localize('state.waiting', "Waiting"),
@@ -287,5 +287,3 @@ export function getIgnoreSslVerificationConfigSetting(): boolean {
}
return true;
}

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as vscode from 'vscode';
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
@@ -156,14 +154,14 @@ async function lookupController(explorerContext?: azdata.ObjectExplorerContext):
}
function addBdcController(treeDataProvider: ControllerTreeDataProvider, node?: TreeNode): void {
let model = new AddControllerDialogModel(treeDataProvider, node);
let model = new AddControllerDialogModel(treeDataProvider, node as ControllerNode);
let dialog = new AddControllerDialog(model);
dialog.showDialog();
}
async function deleteBdcController(treeDataProvider: ControllerTreeDataProvider, node: TreeNode): Promise<boolean> {
async function deleteBdcController(treeDataProvider: ControllerTreeDataProvider, node: TreeNode): Promise<boolean | undefined> {
if (!node && !(node instanceof ControllerNode)) {
return;
return undefined;
}
let controllerNode = node as ControllerNode;

View File

@@ -15,10 +15,7 @@
"./node_modules/@types"
],
"strict": false,
"noImplicitAny": false,
"noUnusedParameters": false,
"noImplicitReturns": false,
"noUnusedLocals": false,
},
"exclude": [
"node_modules"

View File

@@ -2,11 +2,36 @@
# yarn lockfile v1
"@types/caseless@*":
version "0.12.2"
resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.2.tgz#f65d3d6389e01eeb458bd54dc8f52b95a9463bc8"
integrity sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==
"@types/kerberos@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@types/kerberos/-/kerberos-1.1.0.tgz#fb1e5bc4f7272d152f67714deb100d5de7cb3e48"
integrity sha512-ixpV6PSSMnIVpMNCLQ0gWguC2+pBxc0LeUCv9Ugj54opVSVFXfPNYP6sMa7UHvicYGDXAyHQSAzQC8VYEIgdFQ==
"@types/node@*":
version "12.12.6"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.6.tgz#a47240c10d86a9a57bb0c633f0b2e0aea9ce9253"
integrity sha512-FjsYUPzEJdGXjwKqSpE0/9QEh6kzhTAeObA54rn6j3rR4C/mzpI9L0KNfoeASSPMMdxIsoJuCLDWcM/rVjIsSA==
"@types/request@^2.48.3":
version "2.48.3"
resolved "https://registry.yarnpkg.com/@types/request/-/request-2.48.3.tgz#970b8ed2317568c390361d29c555a95e74bd6135"
integrity sha512-3Wo2jNYwqgXcIz/rrq18AdOZUQB8cQ34CXZo+LUwPJNpvRAL86+Kc2wwI8mqpz9Cr1V+enIox5v+WZhy/p3h8w==
dependencies:
"@types/caseless" "*"
"@types/node" "*"
"@types/tough-cookie" "*"
form-data "^2.5.0"
"@types/tough-cookie@*":
version "2.3.5"
resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-2.3.5.tgz#9da44ed75571999b65c37b60c9b2b88db54c585d"
integrity sha512-SCcK7mvGi3+ZNz833RRjFIxrn4gI1PPR3NtuIS+6vMkvmsGjosqTJwRt5bAEFLRz+wtJMWv8+uOnZf2hi2QXTg==
agent-base@4, agent-base@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee"
@@ -285,6 +310,15 @@ forever-agent@~0.6.1:
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=
form-data@^2.5.0:
version "2.5.1"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4"
integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.6"
mime-types "^2.1.12"
form-data@~2.3.2:
version "2.3.3"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as vscode from 'vscode';
import * as azdata from 'azdata';
@@ -116,7 +115,7 @@ export class ApiWrapper {
public openTextDocument(uri: vscode.Uri): Thenable<vscode.TextDocument>;
public openTextDocument(options: { language?: string; content?: string; }): Thenable<vscode.TextDocument>;
public openTextDocument(uriOrOptions): Thenable<vscode.TextDocument> {
public openTextDocument(uriOrOptions: any): Thenable<vscode.TextDocument> {
return vscode.workspace.openTextDocument(uriOrOptions);
}

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
import { AppContext } from '../appContext';
@@ -180,4 +179,3 @@ export function refreshCommand(appContext: AppContext, tree: CmsResourceTreeProv
tree.notifyNodeChanged(node);
});
}

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { AppContext } from '../appContext';
import { CmsResourceTreeProvider } from './tree/treeProvider';
import {

View File

@@ -3,12 +3,10 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
export enum CmsResourceItemType {
cmsMessageNodeContainer = 'cms.resource.itemType.cmsMessageNodeContainer',
cmsEmptyNodeContainer = 'cms.resource.itemType.cmsEmptyNodeContainer',
cmsNodeContainer = 'cms.resource.itemType.databaseServerContainer',
registeredServer = 'cms.resource.itemType.databaseServer',
serverGroup = 'cms.resource.itemType.serverGroup'
}
}

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import { NodeInfo } from 'azdata';

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import { AppContext } from '../../appContext';
import { TreeNode } from '../treeNode';
@@ -45,4 +44,4 @@ export interface ICmsResourceNodeInfo {
description: string;
ownerUri: string;
connection: azdata.connection.Connection;
}
}

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import { NodeInfo } from 'azdata';
import * as nls from 'vscode-nls';

View File

@@ -3,10 +3,9 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import { TreeItemCollapsibleState, TreeItem } from 'vscode';
import { TreeItemCollapsibleState } from 'vscode';
import { AppContext } from '../../appContext';
import { TreeNode } from '../treeNode';
import { CmsResourceTreeNodeBase } from './baseTreeNodes';

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import { TreeItemCollapsibleState } from 'vscode';
import { TreeNode } from '../treeNode';
@@ -27,8 +26,8 @@ export class RegisteredServerTreeNode extends CmsResourceTreeNodeBase {
super(name, description, ownerUri, appContext, treeChangeHandler, parent);
}
public async getChildren(): Promise<TreeNode[]> {
return;
public async getChildren(): Promise<TreeNode[] | undefined> {
return undefined;
}
public getTreeItem(): azdata.TreeItem | Promise<azdata.TreeItem> {
@@ -37,8 +36,8 @@ export class RegisteredServerTreeNode extends CmsResourceTreeNodeBase {
connectionName: this.name ? this.name : this.serverName,
serverName: this.serverName,
databaseName: '',
userName: undefined,
password: undefined,
userName: undefined as string,
password: undefined as string,
authenticationType: 'Integrated',
savePassword: false,
groupFullName: '',

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import * as azdata from 'azdata';
import { TreeNode } from '../treeNode';
@@ -33,7 +31,7 @@ export class ServerGroupTreeNode extends CmsResourceTreeNodeBase {
}
public getChildren(): TreeNode[] | Promise<TreeNode[]> {
try {
let nodes = [];
let nodes: TreeNode[] = [];
return this.appContext.cmsUtils.getRegisteredServers(this.ownerUri, this.relativePath).then((result) => {
if (result) {
if (result.registeredServersList) {

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { TreeNode } from '../treeNode';
export interface ICmsResourceTreeChangeHandler {

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { TreeDataProvider, EventEmitter, Event, TreeItem } from 'vscode';
import { AppContext } from '../../appContext';
import * as nls from 'vscode-nls';
@@ -14,7 +13,6 @@ import { CmsResourceEmptyTreeNode } from './cmsResourceEmptyTreeNode';
import { ICmsResourceTreeChangeHandler } from './treeChangeHandler';
import { CmsResourceMessageTreeNode } from '../messageTreeNode';
import { CmsResourceTreeNode } from './cmsResourceTreeNode';
import { ICmsResourceNodeInfo } from './baseTreeNodes';
export class CmsResourceTreeProvider implements TreeDataProvider<TreeNode>, ICmsResourceTreeChangeHandler {
@@ -38,7 +36,7 @@ export class CmsResourceTreeProvider implements TreeDataProvider<TreeNode>, ICms
// to determine whether the system has been initialized.
const cachedServers = this._appContext.cmsUtils.getSavedServers();
if (cachedServers && cachedServers.length > 0) {
const servers = [];
const servers: CmsResourceTreeNode[] = [];
cachedServers.forEach(async (server) => {
servers.push(new CmsResourceTreeNode(
server.name,

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as vscode from 'vscode';

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
import * as azdata from 'azdata';
@@ -89,12 +88,13 @@ export class CmsUtils {
return this._cmsService;
}
public async getRegisteredServers(ownerUri: string, relativePath: string): Promise<mssql.ListRegisteredServersResult> {
public async getRegisteredServers(ownerUri: string, relativePath: string): Promise<mssql.ListRegisteredServersResult | undefined> {
const cmsService = await this.getCmsService();
const result = await cmsService.getRegisteredServers(ownerUri, relativePath);
if (result && result.registeredServersList && result.registeredServersList) {
return result;
}
return undefined;
}
public async createCmsServer(connection: azdata.connection.Connection,
@@ -166,7 +166,7 @@ export class CmsUtils {
}
public async addRegisteredServer(relativePath: string, ownerUri: string,
parentServerName?: string): Promise<boolean> {
parentServerName?: string): Promise<boolean | undefined> {
let provider = await this.getCmsService();
// Initial profile to disallow SQL Login without
// changing provider.
@@ -200,6 +200,7 @@ export class CmsUtils {
return result;
}
}
return undefined;
}
public async removeRegisteredServer(registeredServerName: string, relativePath: string, ownerUri: string): Promise<boolean> {
@@ -232,7 +233,7 @@ export class CmsUtils {
return this._credentialProvider;
}
public async makeConnection(initialConnectionProfile?: azdata.IConnectionProfile): Promise<azdata.connection.Connection> {
public async makeConnection(initialConnectionProfile?: azdata.IConnectionProfile): Promise<azdata.connection.Connection | undefined> {
if (!initialConnectionProfile) {
initialConnectionProfile = {
connectionName: undefined,
@@ -261,6 +262,7 @@ export class CmsUtils {
}
return connection;
}
return undefined;
}
// Static Functions

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import ControllerBase from './controllerBase';
import { CmsResourceTreeProvider } from '../cmsResource/tree/treeProvider';
import { registerCmsResourceCommands } from '../cmsResource/commands';

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as vscode from 'vscode';
import { AppContext } from '../appContext';
@@ -31,4 +29,3 @@ export default abstract class ControllerBase implements vscode.Disposable {
this.deactivate();
}
}

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import 'mocha';
import * as vscode from 'vscode';
import * as should from 'should';
@@ -13,7 +12,6 @@ import { ApiWrapper } from '../../../apiWrapper';
import { CmsResourceTreeProvider } from '../../../cmsResource/tree/treeProvider';
import { CmsResourceMessageTreeNode } from '../../../cmsResource/messageTreeNode';
import { CmsResourceEmptyTreeNode } from '../../../cmsResource/tree/cmsResourceEmptyTreeNode';
import { CmsResourceTreeNode } from '../../../cmsResource/tree/cmsResourceTreeNode';
import { CmsUtils } from '../../../cmsUtils';
// Mock services

View File

@@ -15,10 +15,7 @@
"moduleResolution": "node",
"declaration": false,
"strict": false,
"noImplicitAny": false,
"noUnusedParameters": false,
"noImplicitReturns": false,
"noUnusedLocals": false,
},
"exclude": [
"node_modules"

View File

@@ -43,9 +43,9 @@ export abstract class BasePage {
* Sets up a navigation validator.
* This will be called right before onPageEnter().
*/
public abstract setupNavigationValidator();
public abstract setupNavigationValidator(): void;
protected async getServerValues(): Promise<{ connection, displayName, name }[]> {
protected async getServerValues(): Promise<{ connection: azdata.connection.ConnectionProfile, displayName: string, name: string }[]> {
let cons = await azdata.connection.getConnections(/* activeConnectionsOnly */ true);
// This user has no active connections ABORT MISSION
if (!cons || cons.length === 0) {
@@ -105,7 +105,7 @@ export abstract class BasePage {
return values;
}
protected async getDatabaseValues(): Promise<{ displayName, name }[]> {
protected async getDatabaseValues(): Promise<{ displayName: string, name: string }[]> {
let idx = -1;
let count = -1;
let values = (await azdata.connection.listDatabases(this.model.server.connectionId)).map(db => {

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
@@ -38,7 +37,7 @@ export abstract class DacFxConfigPage extends BasePage {
this.view = view;
}
public setupNavigationValidator() {
public setupNavigationValidator(): void {
this.instance.registerNavigationValidator(() => {
return true;
});
@@ -198,4 +197,3 @@ export abstract class DacFxConfigPage extends BasePage {
interface ConnectionDropdownValue extends azdata.CategoryValue {
connection: azdata.connection.ConnectionProfile;
}

View File

@@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import { DacFxDataModel } from '../api/models';
@@ -65,7 +64,7 @@ export class DacFxSummaryPage extends BasePage {
return true;
}
public setupNavigationValidator() {
public setupNavigationValidator(): void {
this.instance.registerNavigationValidator(() => {
if (this.loader.loading) {
return false;

View File

@@ -3,16 +3,13 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
import * as path from 'path';
import * as os from 'os';
import { DacFxDataModel } from '../api/models';
import { DataTierApplicationWizard, DeployOperationPath, Operation, DeployNewOperationPath, PageName } from '../dataTierApplicationWizard';
import { DacFxConfigPage } from '../api/dacFxConfigPage';
import { DacFxSummaryPage } from './dacFxSummaryPage';
const localize = nls.loadMessageBundle();

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
@@ -60,7 +59,7 @@ export class ExtractConfigPage extends DacFxConfigPage {
return true;
}
public setupNavigationValidator() {
public setupNavigationValidator(): void {
this.instance.registerNavigationValidator(() => {
if (this.databaseLoader.loading) {
return false;

View File

@@ -3,12 +3,10 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
import * as path from 'path';
import * as os from 'os';
import { DacFxDataModel } from '../api/models';
import { DataTierApplicationWizard } from '../dataTierApplicationWizard';
import { DacFxConfigPage } from '../api/dacFxConfigPage';

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import { DacFxDataModel } from '../api/models';
@@ -177,7 +176,7 @@ export class SelectOperationPage extends BasePage {
this.instance.wizard.addPage(summaryPage.wizardPage, index);
}
public setupNavigationValidator() {
public setupNavigationValidator(): void {
this.instance.registerNavigationValidator(() => {
return true;
});

View File

@@ -3,10 +3,6 @@
"compilerOptions": {
"outDir": "./out",
"strict": false,
"alwaysStrict": false,
"noImplicitAny": false,
"noImplicitReturns": false,
"noUnusedLocals": false,
"noUnusedParameters": false
},
"include": [