From 58959ef35e19eed6fd709d36b520ed69ce534bfb Mon Sep 17 00:00:00 2001 From: Anthony Dresser Date: Tue, 23 Apr 2019 11:18:00 -0700 Subject: [PATCH] Enable stricter compile options on extensions (#5044) * enable stricter compile settings in extensions * more strict compile * formatting * formatting * revert some changes * formtting * formatting --- extensions/azurecore/package.json | 3 +- .../account-provider/azureAccountProvider.ts | 8 +- .../src/account-provider/tokenCache.ts | 2 +- extensions/azurecore/src/apiWrapper.ts | 8 +- extensions/azurecore/src/appContext.ts | 2 - .../src/azureResource/tree/accountTreeNode.ts | 2 - extensions/azurecore/src/constants.ts | 2 - .../controllers/azureResourceController.ts | 6 +- extensions/azurecore/src/extension.ts | 2 +- .../database/databaseTreeDataProvider.test.ts | 14 ++- .../databaseServerTreeDataProvider.test.ts | 14 ++- .../tree/accountTreeNode.test.ts | 28 +++--- extensions/azurecore/tsconfig.json | 9 +- extensions/azurecore/yarn.lock | 43 +++++++-- extensions/mssql/package.json | 5 +- .../src/credentialstore/credentialstore.ts | 2 - extensions/mssql/src/features.ts | 4 +- extensions/mssql/src/main.ts | 6 +- .../src/objectExplorerNodeProvider/command.ts | 2 +- .../objectExplorerNodeProvider/connection.ts | 4 +- .../hdfsCommands.ts | 8 +- .../hdfsProvider.ts | 7 +- extensions/mssql/src/prompts/adapter.ts | 22 ++--- .../sparkJobSubmission/sparkAdvancedTab.ts | 3 - .../mssql/src/sparkFeature/sparkUtils.ts | 1 - extensions/mssql/src/telemetry.ts | 2 +- extensions/mssql/src/utils.ts | 1 + extensions/mssql/tsconfig.json | 7 +- extensions/mssql/yarn.lock | 6 +- extensions/notebook/package.json | 4 + extensions/notebook/src/common/ports.ts | 2 +- extensions/notebook/src/common/utils.ts | 2 +- .../src/dialog/configurePythonDialog.ts | 4 +- extensions/notebook/src/extension.ts | 4 +- .../notebookIntegration.test.ts | 2 - .../intellisense/completionItemProvider.ts | 5 +- .../notebook/src/jupyter/jupyterController.ts | 10 +- .../src/jupyter/jupyterServerInstallation.ts | 10 +- .../src/jupyter/jupyterSessionManager.ts | 9 +- .../notebook/src/jupyter/serverInstance.ts | 6 +- extensions/notebook/src/prompts/adapter.ts | 94 +------------------ extensions/notebook/src/prompts/checkbox.ts | 6 +- extensions/notebook/src/prompts/expand.ts | 4 +- extensions/notebook/src/prompts/list.ts | 4 +- .../notebook/src/test/common/testUtils.ts | 6 +- .../src/test/model/contentManagers.test.ts | 3 - .../src/test/model/serverInstance.test.ts | 23 ++--- .../src/test/model/serverManager.test.ts | 3 - extensions/notebook/tsconfig.json | 9 +- extensions/notebook/yarn.lock | 53 +++++++++++ src/sql/azdata.proposed.d.ts | 4 +- 51 files changed, 196 insertions(+), 294 deletions(-) diff --git a/extensions/azurecore/package.json b/extensions/azurecore/package.json index db8c202187..034e8c0c80 100644 --- a/extensions/azurecore/package.json +++ b/extensions/azurecore/package.json @@ -165,7 +165,8 @@ }, "devDependencies": { "@types/mocha": "^5.2.5", - "@types/node": "^8.10.25", + "@types/node": "^10.12.12", + "@types/request": "^2.48.1", "mocha": "^5.2.0", "should": "^13.2.1", "typemoq": "^2.1.0" diff --git a/extensions/azurecore/src/account-provider/azureAccountProvider.ts b/extensions/azurecore/src/account-provider/azureAccountProvider.ts index 30acdfacf9..66d67d071a 100644 --- a/extensions/azurecore/src/account-provider/azureAccountProvider.ts +++ b/extensions/azurecore/src/account-provider/azureAccountProvider.ts @@ -10,7 +10,6 @@ import * as nls from 'vscode-nls'; import * as vscode from 'vscode'; import * as url from 'url'; import { - Arguments, AzureAccount, AzureAccountProviderMetadata, AzureAccountSecurityTokenCollection, @@ -27,17 +26,12 @@ export class AzureAccountProvider implements azdata.AccountProvider { private static AadCommonTenant: string = 'common'; // MEMBER VARIABLES //////////////////////////////////////////////////// - private _args: Arguments; private _autoOAuthCancelled: boolean; private _commonAuthorityUrl: string; private _inProgressAutoOAuth: InProgressAutoOAuth; private _isInitialized: boolean; constructor(private _metadata: AzureAccountProviderMetadata, private _tokenCache: TokenCache) { - this._args = { - host: this._metadata.settings.host, - clientId: this._metadata.settings.clientId - }; this._autoOAuthCancelled = false; this._inProgressAutoOAuth = null; this._isInitialized = false; @@ -361,7 +355,7 @@ export class AzureAccountProvider implements azdata.AccountProvider { }; // Setup the callback to resolve/reject this promise - let callback = (error, response, body: { error: any; value: any; }) => { + const callback: request.RequestCallback = (error, response, body: { error: any; value: any; }) => { if (error || body.error) { reject(error || JSON.stringify(body.error)); } else { diff --git a/extensions/azurecore/src/account-provider/tokenCache.ts b/extensions/azurecore/src/account-provider/tokenCache.ts index 4225cc26da..8353062269 100644 --- a/extensions/azurecore/src/account-provider/tokenCache.ts +++ b/extensions/azurecore/src/account-provider/tokenCache.ts @@ -136,7 +136,7 @@ export default class TokenCache implements adal.TokenCache { && entry1.resource === entry2.resource; } - private static findByPartial(entry: adal.TokenResponse, query: object): boolean { + private static findByPartial(entry: adal.TokenResponse, query: { [key: string]: any }): boolean { for (let key in query) { if (entry[key] === undefined || entry[key] !== query[key]) { return false; diff --git a/extensions/azurecore/src/apiWrapper.ts b/extensions/azurecore/src/apiWrapper.ts index a37914bcd3..750a43f7f8 100644 --- a/extensions/azurecore/src/apiWrapper.ts +++ b/extensions/azurecore/src/apiWrapper.ts @@ -153,12 +153,6 @@ export class ApiWrapper { return vscode.window.showSaveDialog(options); } - public openTextDocument(uri: vscode.Uri): Thenable; - public openTextDocument(options: { language?: string; content?: string; }): Thenable; - public openTextDocument(uriOrOptions): Thenable { - return vscode.workspace.openTextDocument(uriOrOptions); - } - public showTextDocument(document: vscode.TextDocument, column?: vscode.ViewColumn, preserveFocus?: boolean, preview?: boolean): Thenable { let options: vscode.TextDocumentShowOptions = { viewColumn: column, @@ -209,7 +203,7 @@ export class ApiWrapper { return azdata.accounts.getAllAccounts(); } - public getSecurityToken(account: azdata.Account, resource: azdata.AzureResource): Thenable<{}> { + public getSecurityToken(account: azdata.Account, resource: azdata.AzureResource): Thenable<{ [key: string]: any }> { return azdata.accounts.getSecurityToken(account, resource); } diff --git a/extensions/azurecore/src/appContext.ts b/extensions/azurecore/src/appContext.ts index 4abec27439..df03917215 100644 --- a/extensions/azurecore/src/appContext.ts +++ b/extensions/azurecore/src/appContext.ts @@ -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 { ApiWrapper } from './apiWrapper'; diff --git a/extensions/azurecore/src/azureResource/tree/accountTreeNode.ts b/extensions/azurecore/src/azureResource/tree/accountTreeNode.ts index f815dc51b7..66317135cf 100644 --- a/extensions/azurecore/src/azureResource/tree/accountTreeNode.ts +++ b/extensions/azurecore/src/azureResource/tree/accountTreeNode.ts @@ -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 { Account, NodeInfo, AzureResource } from 'azdata'; import { TokenCredentials } from 'ms-rest'; diff --git a/extensions/azurecore/src/constants.ts b/extensions/azurecore/src/constants.ts index 50eb2eb531..5b10d959dc 100644 --- a/extensions/azurecore/src/constants.ts +++ b/extensions/azurecore/src/constants.ts @@ -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'; const localize = nls.loadMessageBundle(); diff --git a/extensions/azurecore/src/controllers/azureResourceController.ts b/extensions/azurecore/src/controllers/azureResourceController.ts index fc4c29b72f..d1675b2173 100644 --- a/extensions/azurecore/src/controllers/azureResourceController.ts +++ b/extensions/azurecore/src/controllers/azureResourceController.ts @@ -3,10 +3,8 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import ControllerBase from './controllerBase'; -import { DidChangeAccountsParams } from 'azdata'; +import { DidChangeAccountsParams, Account } from 'azdata'; import { IAzureResourceCacheService, @@ -39,7 +37,7 @@ export default class AzureResourceController extends ControllerBase { const azureResourceTree = new AzureResourceTreeProvider(this.appContext); this.extensionContext.subscriptions.push(this.apiWrapper.registerTreeDataProvider('azureResourceExplorer', azureResourceTree)); - let previousAccounts = undefined; + let previousAccounts: Array = undefined; this.appContext.getService(AzureResourceServiceNames.accountService).onDidChangeAccounts((e: DidChangeAccountsParams) => { // the onDidChangeAccounts event will trigger in many cases where the accounts didn't actually change // the notifyNodeChanged event triggers a refresh which triggers a getChildren which can trigger this callback diff --git a/extensions/azurecore/src/extension.ts b/extensions/azurecore/src/extension.ts index 75c84db5ae..cf152569d6 100644 --- a/extensions/azurecore/src/extension.ts +++ b/extensions/azurecore/src/extension.ts @@ -57,7 +57,7 @@ export function activate(extensionContext: vscode.ExtensionContext) { } catch (e) { console.error(`Initialization of Azure account extension storage failed: ${e}`); console.error('Azure accounts will not be available'); - return; + return undefined; } // Create the provider service and activate diff --git a/extensions/azurecore/src/test/azureResource/providers/database/databaseTreeDataProvider.test.ts b/extensions/azurecore/src/test/azureResource/providers/database/databaseTreeDataProvider.test.ts index bee44c4a3a..ad756ff16f 100644 --- a/extensions/azurecore/src/test/azureResource/providers/database/databaseTreeDataProvider.test.ts +++ b/extensions/azurecore/src/test/azureResource/providers/database/databaseTreeDataProvider.test.ts @@ -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 * as TypeMoq from 'typemoq'; import * as azdata from 'azdata'; @@ -59,7 +57,7 @@ const mockResourceRootNode: azureResource.IAzureResourceNode = { } }; -const mockTokens = {}; +const mockTokens: { [key: string]: any } = {}; mockTokens[mockTenantId] = { token: 'mock_token', tokenType: 'Bearer' @@ -80,14 +78,14 @@ const mockDatabases: AzureResourceDatabase[] = [ } ]; -describe('AzureResourceDatabaseTreeDataProvider.info', function(): void { +describe('AzureResourceDatabaseTreeDataProvider.info', function (): void { beforeEach(() => { mockDatabaseService = TypeMoq.Mock.ofType(); mockApiWrapper = TypeMoq.Mock.ofType(); mockExtensionContext = TypeMoq.Mock.ofType(); }); - it('Should be correct when created.', async function(): Promise { + it('Should be correct when created.', async function (): Promise { const treeDataProvider = new AzureResourceDatabaseTreeDataProvider(mockDatabaseService.object, mockApiWrapper.object, mockExtensionContext.object); const treeItem = await treeDataProvider.getTreeItem(mockResourceRootNode); @@ -98,7 +96,7 @@ describe('AzureResourceDatabaseTreeDataProvider.info', function(): void { }); }); -describe('AzureResourceDatabaseTreeDataProvider.getChildren', function(): void { +describe('AzureResourceDatabaseTreeDataProvider.getChildren', function (): void { beforeEach(() => { mockDatabaseService = TypeMoq.Mock.ofType(); mockApiWrapper = TypeMoq.Mock.ofType(); @@ -109,7 +107,7 @@ describe('AzureResourceDatabaseTreeDataProvider.getChildren', function(): void { mockExtensionContext.setup((o) => o.asAbsolutePath(TypeMoq.It.isAnyString())).returns(() => TypeMoq.It.isAnyString()); }); - it('Should return container node when element is undefined.', async function(): Promise { + it('Should return container node when element is undefined.', async function (): Promise { const treeDataProvider = new AzureResourceDatabaseTreeDataProvider(mockDatabaseService.object, mockApiWrapper.object, mockExtensionContext.object); const children = await treeDataProvider.getChildren(); @@ -127,7 +125,7 @@ describe('AzureResourceDatabaseTreeDataProvider.getChildren', function(): void { should(child.treeItem.contextValue).equal('azure.resource.itemType.databaseContainer'); }); - it('Should return resource nodes when it is container node.', async function(): Promise { + it('Should return resource nodes when it is container node.', async function (): Promise { const treeDataProvider = new AzureResourceDatabaseTreeDataProvider(mockDatabaseService.object, mockApiWrapper.object, mockExtensionContext.object); const children = await treeDataProvider.getChildren(mockResourceRootNode); diff --git a/extensions/azurecore/src/test/azureResource/providers/databaseServer/databaseServerTreeDataProvider.test.ts b/extensions/azurecore/src/test/azureResource/providers/databaseServer/databaseServerTreeDataProvider.test.ts index ed055d0375..bf77bee3aa 100644 --- a/extensions/azurecore/src/test/azureResource/providers/databaseServer/databaseServerTreeDataProvider.test.ts +++ b/extensions/azurecore/src/test/azureResource/providers/databaseServer/databaseServerTreeDataProvider.test.ts @@ -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 * as TypeMoq from 'typemoq'; import * as azdata from 'azdata'; @@ -59,7 +57,7 @@ const mockResourceRootNode: azureResource.IAzureResourceNode = { } }; -const mockTokens = {}; +const mockTokens: { [key: string]: any } = {}; mockTokens[mockTenantId] = { token: 'mock_token', tokenType: 'Bearer' @@ -80,14 +78,14 @@ const mockDatabaseServers: AzureResourceDatabaseServer[] = [ } ]; -describe('AzureResourceDatabaseServerTreeDataProvider.info', function(): void { +describe('AzureResourceDatabaseServerTreeDataProvider.info', function (): void { beforeEach(() => { mockDatabaseServerService = TypeMoq.Mock.ofType(); mockApiWrapper = TypeMoq.Mock.ofType(); mockExtensionContext = TypeMoq.Mock.ofType(); }); - it('Should be correct when created.', async function(): Promise { + it('Should be correct when created.', async function (): Promise { const treeDataProvider = new AzureResourceDatabaseServerTreeDataProvider(mockDatabaseServerService.object, mockApiWrapper.object, mockExtensionContext.object); const treeItem = await treeDataProvider.getTreeItem(mockResourceRootNode); @@ -98,7 +96,7 @@ describe('AzureResourceDatabaseServerTreeDataProvider.info', function(): void { }); }); -describe('AzureResourceDatabaseServerTreeDataProvider.getChildren', function(): void { +describe('AzureResourceDatabaseServerTreeDataProvider.getChildren', function (): void { beforeEach(() => { mockDatabaseServerService = TypeMoq.Mock.ofType(); mockApiWrapper = TypeMoq.Mock.ofType(); @@ -109,7 +107,7 @@ describe('AzureResourceDatabaseServerTreeDataProvider.getChildren', function(): mockExtensionContext.setup((o) => o.asAbsolutePath(TypeMoq.It.isAnyString())).returns(() => TypeMoq.It.isAnyString()); }); - it('Should return container node when element is undefined.', async function(): Promise { + it('Should return container node when element is undefined.', async function (): Promise { const treeDataProvider = new AzureResourceDatabaseServerTreeDataProvider(mockDatabaseServerService.object, mockApiWrapper.object, mockExtensionContext.object); const children = await treeDataProvider.getChildren(); @@ -127,7 +125,7 @@ describe('AzureResourceDatabaseServerTreeDataProvider.getChildren', function(): should(child.treeItem.contextValue).equal('azure.resource.itemType.databaseServerContainer'); }); - it('Should return resource nodes when it is container node.', async function(): Promise { + it('Should return resource nodes when it is container node.', async function (): Promise { const treeDataProvider = new AzureResourceDatabaseServerTreeDataProvider(mockDatabaseServerService.object, mockApiWrapper.object, mockExtensionContext.object); const children = await treeDataProvider.getChildren(mockResourceRootNode); diff --git a/extensions/azurecore/src/test/azureResource/tree/accountTreeNode.test.ts b/extensions/azurecore/src/test/azureResource/tree/accountTreeNode.test.ts index 67fedb2518..0f34fa7856 100644 --- a/extensions/azurecore/src/test/azureResource/tree/accountTreeNode.test.ts +++ b/extensions/azurecore/src/test/azureResource/tree/accountTreeNode.test.ts @@ -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 * as TypeMoq from 'typemoq'; import * as azdata from 'azdata'; @@ -77,7 +75,7 @@ const mockSubscriptions = [mockSubscription1, mockSubscription2]; const mockFilteredSubscriptions = [mockSubscription1]; -const mockTokens = {}; +const mockTokens: { [key: string]: any } = {}; mockTokens[mockTenantId] = { token: 'mock_token', tokenType: 'Bearer' @@ -87,7 +85,7 @@ const mockCredential = new TokenCredentials(mockTokens[mockTenantId].token, mock let mockSubscriptionCache: azureResource.AzureResourceSubscription[] = []; -describe('AzureResourceAccountTreeNode.info', function(): void { +describe('AzureResourceAccountTreeNode.info', function (): void { beforeEach(() => { mockExtensionContext = TypeMoq.Mock.ofType(); mockApiWrapper = TypeMoq.Mock.ofType(); @@ -113,7 +111,7 @@ describe('AzureResourceAccountTreeNode.info', function(): void { mockTenantService.setup((o) => o.getTenantId(TypeMoq.It.isAny())).returns(() => Promise.resolve(mockTenantId)); }); - it('Should be correct when created.', async function(): Promise { + it('Should be correct when created.', async function (): Promise { const accountTreeNode = new AzureResourceAccountTreeNode(mockAccount, mockAppContext, mockTreeChangeHandler.object); const accountTreeNodeId = `account_${mockAccount.key.accountId}`; @@ -134,7 +132,7 @@ describe('AzureResourceAccountTreeNode.info', function(): void { should(nodeInfo.iconType).equal(AzureResourceItemType.account); }); - it('Should be correct when there are subscriptions listed.', async function(): Promise { + it('Should be correct when there are subscriptions listed.', async function (): Promise { mockSubscriptionService.setup((o) => o.getSubscriptions(mockAccount, mockCredential)).returns(() => Promise.resolve(mockSubscriptions)); mockSubscriptionFilterService.setup((o) => o.getSelectedSubscriptions(mockAccount)).returns(() => Promise.resolve(undefined)); @@ -154,7 +152,7 @@ describe('AzureResourceAccountTreeNode.info', function(): void { should(nodeInfo.label).equal(accountTreeNodeLabel); }); - it('Should be correct when there are subscriptions filtered.', async function(): Promise { + it('Should be correct when there are subscriptions filtered.', async function (): Promise { mockSubscriptionService.setup((o) => o.getSubscriptions(mockAccount, mockCredential)).returns(() => Promise.resolve(mockSubscriptions)); mockSubscriptionFilterService.setup((o) => o.getSelectedSubscriptions(mockAccount)).returns(() => Promise.resolve(mockFilteredSubscriptions)); @@ -175,7 +173,7 @@ describe('AzureResourceAccountTreeNode.info', function(): void { }); }); -describe('AzureResourceAccountTreeNode.getChildren', function(): void { +describe('AzureResourceAccountTreeNode.getChildren', function (): void { beforeEach(() => { mockExtensionContext = TypeMoq.Mock.ofType(); mockApiWrapper = TypeMoq.Mock.ofType(); @@ -201,7 +199,7 @@ describe('AzureResourceAccountTreeNode.getChildren', function(): void { mockTenantService.setup((o) => o.getTenantId(TypeMoq.It.isAny())).returns(() => Promise.resolve(mockTenantId)); }); - it('Should load subscriptions from scratch and update cache when it is clearing cache.', async function(): Promise { + it('Should load subscriptions from scratch and update cache when it is clearing cache.', async function (): Promise { mockSubscriptionService.setup((o) => o.getSubscriptions(mockAccount, mockCredential)).returns(() => Promise.resolve(mockSubscriptions)); mockSubscriptionFilterService.setup((o) => o.getSelectedSubscriptions(mockAccount)).returns(() => Promise.resolve([])); @@ -235,7 +233,7 @@ describe('AzureResourceAccountTreeNode.getChildren', function(): void { } }); - it('Should load subscriptions from cache when it is not clearing cache.', async function(): Promise { + it('Should load subscriptions from cache when it is not clearing cache.', async function (): Promise { mockSubscriptionService.setup((o) => o.getSubscriptions(mockAccount, mockCredential)).returns(() => Promise.resolve(mockSubscriptions)); mockSubscriptionFilterService.setup((o) => o.getSelectedSubscriptions(mockAccount)).returns(() => Promise.resolve(undefined)); @@ -256,7 +254,7 @@ describe('AzureResourceAccountTreeNode.getChildren', function(): void { } }); - it('Should handle when there is no subscriptions.', async function(): Promise { + it('Should handle when there is no subscriptions.', async function (): Promise { mockSubscriptionService.setup((o) => o.getSubscriptions(mockAccount, mockCredential)).returns(() => Promise.resolve(undefined)); const accountTreeNode = new AzureResourceAccountTreeNode(mockAccount, mockAppContext, mockTreeChangeHandler.object); @@ -272,7 +270,7 @@ describe('AzureResourceAccountTreeNode.getChildren', function(): void { should(children[0].getNodeInfo().label).equal('No Subscriptions found.'); }); - it('Should honor subscription filtering.', async function(): Promise { + it('Should honor subscription filtering.', async function (): Promise { mockSubscriptionService.setup((o) => o.getSubscriptions(mockAccount, mockCredential)).returns(() => Promise.resolve(mockSubscriptions)); mockSubscriptionFilterService.setup((o) => o.getSelectedSubscriptions(mockAccount)).returns(() => Promise.resolve(mockFilteredSubscriptions)); @@ -290,7 +288,7 @@ describe('AzureResourceAccountTreeNode.getChildren', function(): void { } }); - it('Should handle errors.', async function(): Promise { + it('Should handle errors.', async function (): Promise { mockSubscriptionService.setup((o) => o.getSubscriptions(mockAccount, mockCredential)).returns(() => Promise.resolve(mockSubscriptions)); const mockError = 'Test error'; @@ -314,7 +312,7 @@ describe('AzureResourceAccountTreeNode.getChildren', function(): void { }); }); -describe('AzureResourceAccountTreeNode.clearCache', function() : void { +describe('AzureResourceAccountTreeNode.clearCache', function (): void { beforeEach(() => { mockExtensionContext = TypeMoq.Mock.ofType(); mockApiWrapper = TypeMoq.Mock.ofType(); @@ -340,7 +338,7 @@ describe('AzureResourceAccountTreeNode.clearCache', function() : void { mockTenantService.setup((o) => o.getTenantId(TypeMoq.It.isAny())).returns(() => Promise.resolve(mockTenantId)); }); - it('Should clear cache.', async function(): Promise { + it('Should clear cache.', async function (): Promise { const accountTreeNode = new AzureResourceAccountTreeNode(mockAccount, mockAppContext, mockTreeChangeHandler.object); accountTreeNode.clearCache(); should(accountTreeNode.isClearingCache).true(); diff --git a/extensions/azurecore/tsconfig.json b/extensions/azurecore/tsconfig.json index d9fbb41ead..09065e55fc 100644 --- a/extensions/azurecore/tsconfig.json +++ b/extensions/azurecore/tsconfig.json @@ -3,11 +3,10 @@ "compilerOptions": { "outDir": "./out", "strict": false, - "alwaysStrict": false, - "noImplicitAny": false, - "noImplicitReturns": false, - "noUnusedLocals": false, - "noUnusedParameters": false + "noUnusedParameters": false, + "typeRoots": [ + "./node_modules/@types" + ] }, "include": [ "src/**/*" diff --git a/extensions/azurecore/yarn.lock b/extensions/azurecore/yarn.lock index 513c80882a..48a54ba930 100644 --- a/extensions/azurecore/yarn.lock +++ b/extensions/azurecore/yarn.lock @@ -2,20 +2,47 @@ # 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/form-data@*": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@types/form-data/-/form-data-2.2.1.tgz#ee2b3b8eaa11c0938289953606b745b738c54b1e" + integrity sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ== + dependencies: + "@types/node" "*" + "@types/mocha@^5.2.5": version "5.2.5" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.5.tgz#8a4accfc403c124a0bafe8a9fc61a05ec1032073" integrity sha512-lAVp+Kj54ui/vLUFxsJTMtWvZraZxum3w3Nwkble2dNuV5VnPA+Mi2oGX9XYJAaIvZi3tn3cbjS/qcJXRb6Bww== -"@types/node@^8.0.47": - version "8.10.39" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.39.tgz#e7e87ad00364dd7bc485c940926345b8ec1a26ca" - integrity sha512-rE7fktr02J8ybFf6eysife+WF+L4sAHWzw09DgdCebEu+qDwMvv4zl6Bc+825ttGZP73kCKxa3dhJOoGJ8+5mA== +"@types/node@*", "@types/node@^10.12.12": + version "10.14.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.4.tgz#1c586b991457cbb58fef51bc4e0cfcfa347714b5" + integrity sha512-DT25xX/YgyPKiHFOpNuANIQIVvYEwCWXgK2jYYwqgaMrYE6+tq+DtmMwlD3drl6DJbUwtlIDnn0d7tIn/EbXBg== -"@types/node@^8.10.25": - version "8.10.42" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.42.tgz#d3d8e738e13540a09b3f4a714dac1ffbf8939f7d" - integrity sha512-8LCqostMfYwQs9by1k21/P4KZp9uFQk3Q528y3qtPKQnCJmKz0Em3YzgeNjTNV1FVrG/7n/6j12d4UKg9zSgDw== +"@types/node@^8.0.47": + version "8.10.45" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.45.tgz#4c49ba34106bc7dced77ff6bae8eb6543cde8351" + integrity sha512-tGVTbA+i3qfXsLbq9rEq/hezaHY55QxQLeXQL2ejNgFAxxrgu8eMmYIOsRcl7hN1uTLVsKOOYacV/rcJM3sfgQ== + +"@types/request@^2.48.1": + version "2.48.1" + resolved "https://registry.yarnpkg.com/@types/request/-/request-2.48.1.tgz#e402d691aa6670fbbff1957b15f1270230ab42fa" + integrity sha512-ZgEZ1TiD+KGA9LiAAPPJL68Id2UWfeSO62ijSXZjFJArVV+2pKcsVHmrcu+1oiE3q6eDGiFiSolRc4JHoerBBg== + dependencies: + "@types/caseless" "*" + "@types/form-data" "*" + "@types/node" "*" + "@types/tough-cookie" "*" + +"@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== adal-node@^0.1.28: version "0.1.28" diff --git a/extensions/mssql/package.json b/extensions/mssql/package.json index bb692c86f7..cdc08c8cea 100644 --- a/extensions/mssql/package.json +++ b/extensions/mssql/package.json @@ -22,19 +22,18 @@ "bytes": "^3.1.0", "dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#0.2.16", "error-ex": "^1.3.2", - "find-remove": "1.2.1", "figures": "^2.0.0", + "find-remove": "1.2.1", "fs-extra": "^3.0.1", "request": "^2.88.0", "request-promise": "^4.2.2", - "service-downloader": "github:anthonydresser/service-downloader#0.1.5", + "service-downloader": "github:anthonydresser/service-downloader#0.1.6", "stream-meter": "^1.0.4", "uri-js": "^4.2.2", "vscode-extension-telemetry": "0.1.0", "vscode-languageclient": "^3.5.1", "vscode-nls": "^4.0.0" }, - "devDependencies": {}, "contributes": { "commands": [ { diff --git a/extensions/mssql/src/credentialstore/credentialstore.ts b/extensions/mssql/src/credentialstore/credentialstore.ts index ea12c8cdb1..eecdf7332f 100644 --- a/extensions/mssql/src/credentialstore/credentialstore.ts +++ b/extensions/mssql/src/credentialstore/credentialstore.ts @@ -2,10 +2,8 @@ * 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 { SqlOpsDataClient, ClientOptions, SqlOpsFeature } from 'dataprotocol-client'; -import * as path from 'path'; import { IConfig, ServerProvider } from 'service-downloader'; import { ServerOptions, RPCMessageType, ClientCapabilities, ServerCapabilities, TransportKind } from 'vscode-languageclient'; import { Disposable } from 'vscode'; diff --git a/extensions/mssql/src/features.ts b/extensions/mssql/src/features.ts index b8f76db0c1..b051f26d48 100644 --- a/extensions/mssql/src/features.ts +++ b/extensions/mssql/src/features.ts @@ -51,7 +51,6 @@ export class DacFxServicesFeature extends SqlOpsFeature { protected registerProvider(options: undefined): Disposable { const client = this._client; - let self = this; let exportBacpac = (databaseName: string, packageFilePath: string, ownerUri: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable => { let params: contracts.ExportParams = { databaseName: databaseName, packageFilePath: packageFilePath, ownerUri: ownerUri, taskExecutionMode: taskExecutionMode }; @@ -165,7 +164,6 @@ export class SchemaCompareServicesFeature extends SqlOpsFeature { protected registerProvider(options: undefined): Disposable { const client = this._client; - let self = this; let schemaCompare = (sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable => { let params: contracts.SchemaCompareParams = { sourceEndpointInfo: sourceEndpointInfo, targetEndpointInfo: targetEndpointInfo, taskExecutionMode: taskExecutionMode }; @@ -729,4 +727,4 @@ export class AgentServicesFeature extends SqlOpsFeature { registerOnUpdated }); } -} \ No newline at end of file +} diff --git a/extensions/mssql/src/main.ts b/extensions/mssql/src/main.ts index 59446a8ae1..cae5ad2be5 100644 --- a/extensions/mssql/src/main.ts +++ b/extensions/mssql/src/main.ts @@ -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 vscode from 'vscode'; import * as azdata from 'azdata'; @@ -13,7 +12,7 @@ const localize = nls.loadMessageBundle(); import { SqlOpsDataClient, ClientOptions } from 'dataprotocol-client'; import { IConfig, ServerProvider, Events } from 'service-downloader'; -import { ServerOptions, TransportKind, LanguageClient } from 'vscode-languageclient'; +import { ServerOptions, TransportKind } from 'vscode-languageclient'; import * as Constants from './constants'; import ContextProvider from './contextProvider'; @@ -37,7 +36,6 @@ import { registerSearchServerCommand } from './objectExplorerNodeProvider/comman const baseConfig = require('./config.json'); const outputChannel = vscode.window.createOutputChannel(Constants.serviceName); const statusView = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left); -const jupyterNotebookProviderId = 'jupyter'; const msgSampleCodeDataFrame = localize('msgSampleCodeDataFrame', 'This sample code loads the file into a data frame and shows the first 10 results.'); @@ -47,7 +45,7 @@ export async function activate(context: vscode.ExtensionContext): Promise { - let subFolder = await folderNode.mkdir(fileName); } } diff --git a/extensions/mssql/src/objectExplorerNodeProvider/hdfsProvider.ts b/extensions/mssql/src/objectExplorerNodeProvider/hdfsProvider.ts index 4307028212..c5ea3bb7bb 100644 --- a/extensions/mssql/src/objectExplorerNodeProvider/hdfsProvider.ts +++ b/extensions/mssql/src/objectExplorerNodeProvider/hdfsProvider.ts @@ -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 * as fspath from 'path'; @@ -12,9 +10,8 @@ import * as fs from 'fs'; import * as nls from 'vscode-nls'; const localize = nls.loadMessageBundle(); -import { ApiWrapper } from '../apiWrapper'; import * as Constants from '../constants'; -import { IFileSource, IHdfsOptions, HdfsFileSource, IFile, File, FileSourceFactory } from './fileSources'; +import { IFileSource, IHdfsOptions, IFile, File, FileSourceFactory } from './fileSources'; import { CancelableStream } from './cancelableStream'; import { TreeNode } from './treeNodes'; import * as utils from '../utils'; @@ -38,7 +35,7 @@ export class HdfsProvider implements vscode.TreeDataProvider, ITreeCha private _onDidChangeTreeData = new vscode.EventEmitter(); private context: TreeDataContext; - constructor(extensionContext: vscode.ExtensionContext, private vscodeApi: ApiWrapper) { + constructor(extensionContext: vscode.ExtensionContext) { this.connections = []; this.context = new TreeDataContext(extensionContext, this); } diff --git a/extensions/mssql/src/prompts/adapter.ts b/extensions/mssql/src/prompts/adapter.ts index 0417177505..c4f675a28f 100644 --- a/extensions/mssql/src/prompts/adapter.ts +++ b/extensions/mssql/src/prompts/adapter.ts @@ -1,10 +1,7 @@ -'use strict'; - // This code is originally from https://github.com/DonJayamanne/bowerVSCode // License: https://github.com/DonJayamanne/bowerVSCode/blob/master/LICENSE -import {window, OutputChannel } from 'vscode'; -import * as nodeUtil from 'util'; +import { window, OutputChannel } from 'vscode'; import PromptFactory from './factory'; import EscapeException from '../escapeException'; import { IQuestion, IPrompter, IPromptCallback } from './question'; @@ -13,8 +10,6 @@ import { IQuestion, IPrompter, IPromptCallback } from './question'; export default class CodeAdapter implements IPrompter { private outChannel: OutputChannel; - private outBuffer: string = ''; - private messageLevelFormatters = {}; constructor() { // TODO Decide whether output channel logging should be saved here? this.outChannel = window.createOutputChannel('test'); @@ -24,15 +19,9 @@ export default class CodeAdapter implements IPrompter { public logError(message: any): void { let line = `error: ${message.message}\n Code - ${message.code}`; - this.outBuffer += `${line}\n`; this.outChannel.appendLine(line); } - private formatMessage(message: any): string { - const prefix = `${message.level}: (${message.id}) `; - return `${prefix}${message.message}`; - } - public clearLog(): void { this.outChannel.clear(); } @@ -58,19 +47,20 @@ export default class CodeAdapter implements IPrompter { public promptSingle(question: IQuestion, ignoreFocusOut?: boolean): Promise { let questions: IQuestion[] = [question]; - return this.prompt(questions, ignoreFocusOut).then( (answers: {[key: string]: T}) => { + return this.prompt(questions, ignoreFocusOut).then((answers: { [key: string]: T }) => { if (answers) { let response: T = answers[question.name]; return response || undefined; } + return undefined; }); } - public prompt(questions: IQuestion[], ignoreFocusOut?: boolean): Promise<{[key: string]: T}> { - let answers: {[key: string]: T} = {}; + public prompt(questions: IQuestion[], ignoreFocusOut?: boolean): Promise<{ [key: string]: T }> { + let answers: { [key: string]: T } = {}; // Collapse multiple questions into a set of prompt steps - let promptResult: Promise<{[key: string]: T}> = questions.reduce((promise: Promise<{[key: string]: T}>, question: IQuestion) => { + let promptResult: Promise<{ [key: string]: T }> = questions.reduce((promise: Promise<{ [key: string]: T }>, question: IQuestion) => { this.fixQuestion(question); return promise.then(() => { diff --git a/extensions/mssql/src/sparkFeature/dialog/sparkJobSubmission/sparkAdvancedTab.ts b/extensions/mssql/src/sparkFeature/dialog/sparkJobSubmission/sparkAdvancedTab.ts index 9dc897e4bb..11fde6990e 100644 --- a/extensions/mssql/src/sparkFeature/dialog/sparkJobSubmission/sparkAdvancedTab.ts +++ b/extensions/mssql/src/sparkFeature/dialog/sparkJobSubmission/sparkAdvancedTab.ts @@ -3,13 +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'; const localize = nls.loadMessageBundle(); -import { SparkJobSubmissionModel } from './sparkJobSubmissionModel'; import { AppContext } from '../../../appContext'; import { ApiWrapper } from '../../../apiWrapper'; diff --git a/extensions/mssql/src/sparkFeature/sparkUtils.ts b/extensions/mssql/src/sparkFeature/sparkUtils.ts index fdc3ab7b84..503d9ad246 100644 --- a/extensions/mssql/src/sparkFeature/sparkUtils.ts +++ b/extensions/mssql/src/sparkFeature/sparkUtils.ts @@ -10,7 +10,6 @@ import * as path from 'path'; import * as azdata from 'azdata'; import * as vscode from 'vscode'; import * as which from 'which'; -import * as Constants from '../constants'; const localize = nls.loadMessageBundle(); diff --git a/extensions/mssql/src/telemetry.ts b/extensions/mssql/src/telemetry.ts index 501735559e..a62436736b 100644 --- a/extensions/mssql/src/telemetry.ts +++ b/extensions/mssql/src/telemetry.ts @@ -34,11 +34,11 @@ export function FilterErrorPath(line: string): string { return values[1]; } } + return undefined; } export class Telemetry { private static reporter: TelemetryReporter; - private static userId: string; private static platformInformation: PlatformInformation; private static disabled: boolean; diff --git a/extensions/mssql/src/utils.ts b/extensions/mssql/src/utils.ts index 1b68a788eb..cad77fe5b1 100644 --- a/extensions/mssql/src/utils.ts +++ b/extensions/mssql/src/utils.ts @@ -112,6 +112,7 @@ export function getPackageInfo(packageJson: any): IPackageInfo { aiKey: packageJson.aiKey }; } + return undefined; } export function generateUserId(): Promise { diff --git a/extensions/mssql/tsconfig.json b/extensions/mssql/tsconfig.json index d9fbb41ead..a80576b9e2 100644 --- a/extensions/mssql/tsconfig.json +++ b/extensions/mssql/tsconfig.json @@ -3,11 +3,8 @@ "compilerOptions": { "outDir": "./out", "strict": false, - "alwaysStrict": false, - "noImplicitAny": false, - "noImplicitReturns": false, - "noUnusedLocals": false, - "noUnusedParameters": false + "noUnusedParameters": false, + "noImplicitAny": false }, "include": [ "src/**/*" diff --git a/extensions/mssql/yarn.lock b/extensions/mssql/yarn.lock index dee6dfe981..0b66a92b76 100644 --- a/extensions/mssql/yarn.lock +++ b/extensions/mssql/yarn.lock @@ -791,9 +791,9 @@ semver@^5.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== -"service-downloader@github:anthonydresser/service-downloader#0.1.5": - version "0.1.5" - resolved "https://codeload.github.com/anthonydresser/service-downloader/tar.gz/6ebb0465573cc140e461a22f334260f55ef45546" +"service-downloader@github:anthonydresser/service-downloader#0.1.6": + version "0.1.6" + resolved "https://codeload.github.com/anthonydresser/service-downloader/tar.gz/fd4114b145ee2b4f1f7950c23f10f4b1b28a2bfc" dependencies: decompress "^4.2.0" eventemitter2 "^5.0.1" diff --git a/extensions/notebook/package.json b/extensions/notebook/package.json index b0b46e1e33..9d2526602b 100644 --- a/extensions/notebook/package.json +++ b/extensions/notebook/package.json @@ -338,8 +338,12 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { + "@types/decompress": "^4.2.3", + "@types/fs-extra": "^5.0.0", "@types/mocha": "^5.2.5", "@types/node": "^11.9.3", + "@types/request": "^2.48.1", + "@types/temp-write": "^3.3.0", "assert": "^1.4.1", "mocha": "^5.2.0", "mocha-junit-reporter": "^1.17.0", diff --git a/extensions/notebook/src/common/ports.ts b/extensions/notebook/src/common/ports.ts index 1297c35eab..61ad299f5e 100644 --- a/extensions/notebook/src/common/ports.ts +++ b/extensions/notebook/src/common/ports.ts @@ -38,7 +38,7 @@ export async function strictFindFreePort(options: StrictPortFindOptions): Promis * @param max - max number * @return a random integer */ -function getRandomInt(min, max): number { +function getRandomInt(min: number, max: number): number { return Math.floor(Math.random() * (max - min + 1) + min); } diff --git a/extensions/notebook/src/common/utils.ts b/extensions/notebook/src/common/utils.ts index 18f8b86ca0..eb14a4ce6e 100644 --- a/extensions/notebook/src/common/utils.ts +++ b/extensions/notebook/src/common/utils.ts @@ -19,7 +19,7 @@ export function getLivyUrl(serverName: string, port: string): string { } export async function mkDir(dirPath: string, outputChannel?: vscode.OutputChannel): Promise { - if (!await fs.exists(dirPath)) { + if (!await fs.pathExists(dirPath)) { if (outputChannel) { outputChannel.appendLine(localize('mkdirOutputMsg', '... Creating {0}', dirPath)); } diff --git a/extensions/notebook/src/dialog/configurePythonDialog.ts b/extensions/notebook/src/dialog/configurePythonDialog.ts index 0a8baf6294..8b547f0d50 100644 --- a/extensions/notebook/src/dialog/configurePythonDialog.ts +++ b/extensions/notebook/src/dialog/configurePythonDialog.ts @@ -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 nls from 'vscode-nls'; import * as azdata from 'azdata'; @@ -34,7 +32,7 @@ export class ConfigurePythonDialog { private _setupComplete: Deferred; - constructor(private apiWrapper: ApiWrapper, private outputChannel: vscode.OutputChannel, private jupyterInstallation: JupyterServerInstallation) { + constructor(private apiWrapper: ApiWrapper, private jupyterInstallation: JupyterServerInstallation) { this._setupComplete = new Deferred(); } diff --git a/extensions/notebook/src/extension.ts b/extensions/notebook/src/extension.ts index d7afaf2456..acd01d8abc 100644 --- a/extensions/notebook/src/extension.ts +++ b/extensions/notebook/src/extension.ts @@ -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 os from 'os'; @@ -124,7 +122,7 @@ function findNextUntitledEditorName(): string { async function openNotebook(): Promise { try { - let filter = {}; + let filter: { [key: string]: Array } = {}; // TODO support querying valid notebook file types filter[localize('notebookFiles', "Notebooks")] = ['ipynb']; let file = await vscode.window.showOpenDialog({ diff --git a/extensions/notebook/src/integrationTest/notebookIntegration.test.ts b/extensions/notebook/src/integrationTest/notebookIntegration.test.ts index 68728031c7..606ad65a6d 100644 --- a/extensions/notebook/src/integrationTest/notebookIntegration.test.ts +++ b/extensions/notebook/src/integrationTest/notebookIntegration.test.ts @@ -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 * as vscode from 'vscode'; import * as assert from 'assert'; diff --git a/extensions/notebook/src/intellisense/completionItemProvider.ts b/extensions/notebook/src/intellisense/completionItemProvider.ts index 78e2dd5655..3345caf35b 100644 --- a/extensions/notebook/src/intellisense/completionItemProvider.ts +++ b/extensions/notebook/src/intellisense/completionItemProvider.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { nb } from 'azdata'; import * as vscode from 'vscode'; @@ -54,7 +52,7 @@ export class NotebookCompletionItemProvider implements vscode.CompletionItemProv if (sessions && sessions.length > 0) { let session = sessions.find(session => session.path === info.notebook.uri.path); if (!session) { - return; + return undefined; } return session.kernel; } @@ -63,6 +61,7 @@ export class NotebookCompletionItemProvider implements vscode.CompletionItemProv // If an exception occurs, swallow it currently return undefined; } + return undefined; } private findMatchingCell(document: vscode.TextDocument, allDocuments: nb.NotebookDocument[]): INewIntellisenseInfo { diff --git a/extensions/notebook/src/jupyter/jupyterController.ts b/extensions/notebook/src/jupyter/jupyterController.ts index 28d377c9a0..a6ac2f71e2 100644 --- a/extensions/notebook/src/jupyter/jupyterController.ts +++ b/extensions/notebook/src/jupyter/jupyterController.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import * as path from 'path'; import * as azdata from 'azdata'; import * as vscode from 'vscode'; @@ -118,8 +116,8 @@ export class JupyterController implements vscode.Disposable { private async handleOpenNotebookTask(profile: azdata.IConnectionProfile): Promise { let notebookFileTypeName = localize('notebookFileType', 'Notebooks'); - let filter = {}; - filter[notebookFileTypeName] = 'ipynb'; + let filter: { [key: string]: Array } = {}; + filter[notebookFileTypeName] = ['ipynb']; let uris = await this.apiWrapper.showOpenDialog({ filters: filter, canSelectFiles: true, @@ -207,8 +205,8 @@ export class JupyterController implements vscode.Disposable { } public doConfigurePython(jupyterInstaller: JupyterServerInstallation): void { - let pythonDialog = new ConfigurePythonDialog(this.apiWrapper, this.outputChannel, jupyterInstaller); - pythonDialog.showDialog().catch(err => { + let pythonDialog = new ConfigurePythonDialog(this.apiWrapper, jupyterInstaller); + pythonDialog.showDialog().catch((err: any) => { this.apiWrapper.showErrorMessage(utils.getErrorMessage(err)); }); } diff --git a/extensions/notebook/src/jupyter/jupyterServerInstallation.ts b/extensions/notebook/src/jupyter/jupyterServerInstallation.ts index 2b28f476a4..da730714b9 100644 --- a/extensions/notebook/src/jupyter/jupyterServerInstallation.ts +++ b/extensions/notebook/src/jupyter/jupyterServerInstallation.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import * as fs from 'fs-extra'; import * as path from 'path'; import * as nls from 'vscode-nls'; @@ -102,7 +100,7 @@ export default class JupyterServerInstallation { .replace('#bundleversion', bundleVersion) .replace('#extension', process.platform === constants.winPlatform ? 'zip' : 'tar.gz'); - let pythonDownloadUrl = undefined; + let pythonDownloadUrl: string = undefined; switch (utils.getOSPlatform()) { case utils.Platform.Windows: pythonDownloadUrl = 'https://go.microsoft.com/fwlink/?linkid=2074021'; @@ -117,9 +115,7 @@ export default class JupyterServerInstallation { } let pythonPackagePathLocal = this._pythonInstallationPath + '/' + packageName; - let self = undefined; return new Promise((resolve, reject) => { - self = this; backgroundOperation.updateStatus(azdata.TaskStatus.InProgress, msgDownloadPython(platformId, pythonDownloadUrl)); fs.mkdirs(this._pythonInstallationPath, (err) => { if (err) { @@ -169,7 +165,7 @@ export default class JupyterServerInstallation { reject(err); } } - decompress(pythonPackagePathLocal, self._pythonInstallationPath).then(files => { + decompress(pythonPackagePathLocal, this._pythonInstallationPath).then(files => { //Delete zip/tar file fs.unlink(pythonPackagePathLocal, (err) => { if (err) { @@ -310,7 +306,7 @@ export default class JupyterServerInstallation { */ public async promptForPythonInstall(): Promise { if (!JupyterServerInstallation.isPythonInstalled(this.apiWrapper)) { - let pythonDialog = new ConfigurePythonDialog(this.apiWrapper, this.outputChannel, this); + let pythonDialog = new ConfigurePythonDialog(this.apiWrapper, this); return pythonDialog.showDialog(true); } } diff --git a/extensions/notebook/src/jupyter/jupyterSessionManager.ts b/extensions/notebook/src/jupyter/jupyterSessionManager.ts index 350f4e708a..84e4597158 100644 --- a/extensions/notebook/src/jupyter/jupyterSessionManager.ts +++ b/extensions/notebook/src/jupyter/jupyterSessionManager.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import { nb, ServerInfo, connection, IConnectionProfile } from 'azdata'; import { Session, Kernel } from '@jupyterlab/services'; import * as fs from 'fs-extra'; @@ -148,6 +146,7 @@ export class JupyterSessionManager implements nb.SessionManager { if (this._sessionManager && !this._sessionManager.isDisposed) { return this._sessionManager.shutdown(id); } + return undefined; } public shutdownAll(): Promise { @@ -247,7 +246,6 @@ export class JupyterSession implements nb.ISession { await this.getClusterEndpoint(connection.id, KNOX_ENDPOINT_KNOX) || await this.getClusterEndpoint(connection.id, KNOX_ENDPOINT_GATEWAY); if (!clusterEndpoint) { - let kernelDisplayName: string = await this.getKernelDisplayName(); return Promise.reject(new Error(localize('connectionNotValid', 'Spark kernels require a connection to a SQL Server big data cluster master instance.'))); } connection.options[KNOX_ENDPOINT_SERVER] = clusterEndpoint.ipAddress; @@ -270,11 +268,6 @@ export class JupyterSession implements nb.ISession { } } - private async getKernelDisplayName(): Promise { - let spec = await this.kernel.getSpec(); - return spec.display_name; - } - private isSparkKernel(kernelName: string): boolean { return kernelName && kernelName.toLowerCase().indexOf('spark') > -1; } diff --git a/extensions/notebook/src/jupyter/serverInstance.ts b/extensions/notebook/src/jupyter/serverInstance.ts index 06a1720389..4edeace34c 100644 --- a/extensions/notebook/src/jupyter/serverInstance.ts +++ b/extensions/notebook/src/jupyter/serverInstance.ts @@ -246,8 +246,8 @@ export class PerNotebookServerInstance implements IServerInstance { this.childProcess = this.spawnJupyterProcess(install, startCommand); let stdErrLog: string = ''; // Add listeners for the process exiting prematurely - let onErrorBeforeStartup = (err) => reject(err); - let onExitBeforeStart = (err) => { + let onErrorBeforeStartup = (err: any) => reject(err); + let onExitBeforeStart = (err: any) => { if (!this.isStarted) { reject(localize('notebookStartProcessExitPremature', 'Notebook process exited prematurely with error: {0}, StdErr Output: {1}', err, stdErrLog)); } @@ -372,7 +372,7 @@ export class PerNotebookServerInstance implements IServerInstance { } private getEnvWithConfigPaths(env: {}): any { - let newEnv = Object.assign({}, env); + let newEnv: { [key: string]: string } = Object.assign({}, env); newEnv['JUPYTER_CONFIG_DIR'] = this.instanceConfigRoot; newEnv['JUPYTER_PATH'] = this.instanceDataRoot; return newEnv; diff --git a/extensions/notebook/src/prompts/adapter.ts b/extensions/notebook/src/prompts/adapter.ts index 317838479c..4398c50c54 100644 --- a/extensions/notebook/src/prompts/adapter.ts +++ b/extensions/notebook/src/prompts/adapter.ts @@ -1,11 +1,7 @@ -'use strict'; - // This code is originally from https://github.com/DonJayamanne/bowerVSCode // License: https://github.com/DonJayamanne/bowerVSCode/blob/master/LICENSE -import { window, OutputChannel } from 'vscode'; -import * as Constants from '../common/constants'; -import * as nodeUtil from 'util'; +import { window } from 'vscode'; import PromptFactory from './factory'; import EscapeException from './escapeException'; import { IQuestion, IPrompter, IPromptCallback } from './question'; @@ -13,95 +9,12 @@ import { IQuestion, IPrompter, IPromptCallback } from './question'; // Supports simple pattern for prompting for user input and acting on this export default class CodeAdapter implements IPrompter { - private outChannel: OutputChannel; - private outBuffer: string = ''; - private messageLevelFormatters = {}; - constructor() { - // TODO Decide whether output channel logging should be saved here? - this.outChannel = window.createOutputChannel(Constants.outputChannelName); - // this.outChannel.clear(); - } - - public logError(message: any): void { - let line = `error: ${message.message}\n Code - ${message.code}`; - - this.outBuffer += `${line}\n`; - this.outChannel.appendLine(line); - } - - // private formatInfo(message: any) { - // const prefix = `${message.level}: (${message.id}) `; - // if (message.id === "json") { - // let jsonString = JSON.stringify(message.data, undefined, 4); - // return `${prefix}${message.message}\n${jsonString}`; - // } - // else { - // return `${prefix}${message.message}`; - // } - // } - - // private formatAction(message: any) { - // const prefix = `info: ${message.level}: (${message.id}) `; - // return `${prefix}${message.message}`; - // } - - private formatMessage(message: any): string { - const prefix = `${message.level}: (${message.id}) `; - return `${prefix}${message.message}`; - } - - // private formatConflict(message: any) { - // var msg = message.message + ':\n'; - // var picks = (message.data.picks); - // var pickCount = 1; - // picks.forEach((pick) => { - // let pickMessage = (pickCount++).toString() + "). " + pick.endpoint.name + "#" + pick.endpoint.target; - // if (pick.pkgMeta._resolution && pick.pkgMeta._resolution.tag) { - // pickMessage += " which resolved to " + pick.pkgMeta._resolution.tag - // } - // if (Array.isArray(pick.dependants) && pick.dependants.length > 0) { - // pickMessage += " and is required by "; - // pick.dependants.forEach((dep) => { - // pickMessage += " " + dep.endpoint.name + "#" + dep.endpoint.target; - // }); - // } - // msg += " " + pickMessage + "\n"; - // }); - - // var prefix = (message.id === "solved"? "info" : "warn") + `: ${message.level}: (${message.id}) `; - // return prefix + msg; - // } - - public log(message: any): void { - let line: string = ''; - if (message && typeof (message.level) === 'string') { - let formatter: (a: any) => string = this.formatMessage; - if (this.messageLevelFormatters[message.level]) { - formatter = this.messageLevelFormatters[message.level]; - } - line = formatter(message); - } else { - line = nodeUtil.format(arguments); - } - - this.outBuffer += `${line}\n`; - this.outChannel.appendLine(line); - } - - public clearLog(): void { - this.outChannel.clear(); - } - - public showLog(): void { - this.outChannel.show(); - } - // TODO define question interface private fixQuestion(question: any): any { if (question.type === 'checkbox' && Array.isArray(question.choices)) { // For some reason when there's a choice of checkboxes, they aren't formatted properly // Not sure where the issue is - question.choices = question.choices.map(item => { + question.choices = question.choices.map((item: any) => { if (typeof (item) === 'string') { return { checked: false, name: item, value: item }; } else { @@ -118,6 +31,7 @@ export default class CodeAdapter implements IPrompter { let response: T = answers[question.name]; return response || undefined; } + return undefined; }); } @@ -139,7 +53,7 @@ export default class CodeAdapter implements IPrompter { // } if (!question.shouldPrompt || question.shouldPrompt(answers) === true) { - return prompt.render().then(result => { + return prompt.render().then((result: any) => { answers[question.name] = result; if (question.onAnswered) { diff --git a/extensions/notebook/src/prompts/checkbox.ts b/extensions/notebook/src/prompts/checkbox.ts index 2b89438058..62a5549217 100644 --- a/extensions/notebook/src/prompts/checkbox.ts +++ b/extensions/notebook/src/prompts/checkbox.ts @@ -1,5 +1,3 @@ -'use strict'; - // This code is originally from https://github.com/DonJayamanne/bowerVSCode // License: https://github.com/DonJayamanne/bowerVSCode/blob/master/LICENSE @@ -16,7 +14,7 @@ export default class CheckboxPrompt extends Prompt { } public render(): any { - let choices = this._question.choices.reduce((result, choice) => { + let choices = this._question.choices.reduce((result: any, choice: any) => { let choiceName = choice.name || choice; result[`${choice.checked === true ? figures.radioOn : figures.radioOff} ${choiceName}`] = choice; return result; @@ -40,7 +38,7 @@ export default class CheckboxPrompt extends Prompt { return this.render(); } - return this._question.choices.reduce((result2, choice) => { + return this._question.choices.reduce((result2: any, choice: any) => { if (choice.checked === true) { result2.push(choice.value); } diff --git a/extensions/notebook/src/prompts/expand.ts b/extensions/notebook/src/prompts/expand.ts index 9a4a57f52e..d254ba36e2 100644 --- a/extensions/notebook/src/prompts/expand.ts +++ b/extensions/notebook/src/prompts/expand.ts @@ -1,5 +1,3 @@ -'use strict'; - // This code is originally from https://github.com/DonJayamanne/bowerVSCode // License: https://github.com/DonJayamanne/bowerVSCode/blob/master/LICENSE @@ -39,7 +37,7 @@ export default class ExpandPrompt extends Prompt { }); } private renderNameValueChoice(choices: INameValueChoice[]): any { - const choiceMap = this._question.choices.reduce((result, choice) => { + const choiceMap = this._question.choices.reduce((result: any, choice: any) => { result[choice.name] = choice.value; return result; }, {}); diff --git a/extensions/notebook/src/prompts/list.ts b/extensions/notebook/src/prompts/list.ts index c37e2731ad..a487f8e6a7 100644 --- a/extensions/notebook/src/prompts/list.ts +++ b/extensions/notebook/src/prompts/list.ts @@ -1,5 +1,3 @@ -'use strict'; - // This code is originally from https://github.com/DonJayamanne/bowerVSCode // License: https://github.com/DonJayamanne/bowerVSCode/blob/master/LICENSE @@ -14,7 +12,7 @@ export default class ListPrompt extends Prompt { } public render(): any { - const choices = this._question.choices.reduce((result, choice) => { + const choices = this._question.choices.reduce((result: any, choice: any) => { result[choice.name] = choice.value; return result; }, {}); diff --git a/extensions/notebook/src/test/common/testUtils.ts b/extensions/notebook/src/test/common/testUtils.ts index 5d224d9297..68531f3497 100644 --- a/extensions/notebook/src/test/common/testUtils.ts +++ b/extensions/notebook/src/test/common/testUtils.ts @@ -3,11 +3,9 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import * as assert from 'assert'; -export async function assertThrowsAsync(fn, regExp): Promise { +export async function assertThrowsAsync(fn: () => Promise, msg: string): Promise { let f = () => { // Empty }; @@ -16,6 +14,6 @@ export async function assertThrowsAsync(fn, regExp): Promise { } catch (e) { f = () => { throw e; }; } finally { - assert.throws(f, regExp); + assert.throws(f, msg); } } diff --git a/extensions/notebook/src/test/model/contentManagers.test.ts b/extensions/notebook/src/test/model/contentManagers.test.ts index 11ba89d3cb..dc2da1824e 100644 --- a/extensions/notebook/src/test/model/contentManagers.test.ts +++ b/extensions/notebook/src/test/model/contentManagers.test.ts @@ -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 should from 'should'; import * as TypeMoq from 'typemoq'; @@ -33,7 +31,6 @@ let expectedNotebookContent: INotebook = { nbformat: 5, nbformat_minor: 0 }; -let notebookContentString = JSON.stringify(expectedNotebookContent); function verifyMatchesExpectedNotebook(notebook: nb.INotebookContents): void { should(notebook.cells).have.length(1, 'Expected 1 cell'); diff --git a/extensions/notebook/src/test/model/serverInstance.test.ts b/extensions/notebook/src/test/model/serverInstance.test.ts index cb7f774f5f..5f40b6d6b7 100644 --- a/extensions/notebook/src/test/model/serverInstance.test.ts +++ b/extensions/notebook/src/test/model/serverInstance.test.ts @@ -3,11 +3,8 @@ * 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 * as vscode from 'vscode'; import * as stream from 'stream'; import { ChildProcess } from 'child_process'; import 'mocha'; @@ -73,8 +70,8 @@ describe('Jupyter server instance', function (): void { it('Should have URI info after start', async function (): Promise { // Given startup will succeed let process = setupSpawn({ - sdtout: (listener) => undefined, - stderr: (listener) => listener(successMessage) + sdtout: (listener: (msg: string) => void) => { }, + stderr: (listener: (msg: string) => void) => listener(successMessage) }); mockUtils.setup(u => u.spawn(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny())) .returns(() => process.object); @@ -103,9 +100,9 @@ describe('Jupyter server instance', function (): void { it('Should throw if error before startup', async function (): Promise { let error = 'myerr'; let process = setupSpawn({ - sdtout: (listener) => undefined, - stderr: (listener) => listener(successMessage), - error: (listener) => setTimeout(() => listener(new Error(error)), 10) + sdtout: (listener: (msg: string) => void) => { }, + stderr: (listener: (msg: string) => void) => listener(successMessage), + error: (listener: (msg: string | Error) => void) => setTimeout(() => listener(new Error(error)), 10) }); mockUtils.setup(u => u.spawn(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny())) .returns(() => process.object); @@ -117,7 +114,7 @@ describe('Jupyter server instance', function (): void { it('Should throw if exit before startup', async function (): Promise { let code = -1234; let process = setupSpawn({ - exit: (listener) => listener(code) + exit: (listener: (msg: string | number) => void) => listener(code) }); mockUtils.setup(u => u.spawn(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny())) .returns(() => process.object); @@ -130,8 +127,8 @@ describe('Jupyter server instance', function (): void { it('Should call stop with correct port on close', async function (): Promise { // Given startup will succeed let process = setupSpawn({ - sdtout: (listener) => undefined, - stderr: (listener) => listener(successMessage) + sdtout: (listener: (msg: string) => void) => { }, + stderr: (listener: (msg: string) => void) => listener(successMessage) }); mockUtils.setup(u => u.spawn(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny())) .returns(() => process.object); @@ -159,8 +156,8 @@ describe('Jupyter server instance', function (): void { mockUtils.setup(u => u.copy(TypeMoq.It.isAnyString(), TypeMoq.It.isAnyString())).returns(() => Promise.resolve()); let process = setupSpawn({ - sdtout: (listener) => undefined, - stderr: (listener) => listener(successMessage) + sdtout: (listener: (msg: string) => void) => { }, + stderr: (listener: (msg: string) => void) => listener(successMessage) }); mockUtils.setup(u => u.spawn(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny())) .returns(() => process.object); diff --git a/extensions/notebook/src/test/model/serverManager.test.ts b/extensions/notebook/src/test/model/serverManager.test.ts index 5714401235..ec17f93095 100644 --- a/extensions/notebook/src/test/model/serverManager.test.ts +++ b/extensions/notebook/src/test/model/serverManager.test.ts @@ -3,9 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import * as assert from 'assert'; import * as should from 'should'; import * as TypeMoq from 'typemoq'; import * as vscode from 'vscode'; diff --git a/extensions/notebook/tsconfig.json b/extensions/notebook/tsconfig.json index 1d437e3614..af90070c7d 100644 --- a/extensions/notebook/tsconfig.json +++ b/extensions/notebook/tsconfig.json @@ -6,11 +6,10 @@ ], "outDir": "./out", "strict": false, - "alwaysStrict": false, - "noImplicitAny": false, - "noImplicitReturns": false, - "noUnusedLocals": false, - "noUnusedParameters": false + "noUnusedParameters": false, + "typeRoots": [ + "./node_modules/@types" + ] }, "include": [ "src/**/*" diff --git a/extensions/notebook/yarn.lock b/extensions/notebook/yarn.lock index 586658ed98..784f53bef0 100644 --- a/extensions/notebook/yarn.lock +++ b/extensions/notebook/yarn.lock @@ -80,16 +80,69 @@ dependencies: "@phosphor/algorithm" "^1.1.2" +"@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/decompress@^4.2.3": + version "4.2.3" + resolved "https://registry.yarnpkg.com/@types/decompress/-/decompress-4.2.3.tgz#98eed48af80001038aa05690b2094915f296fe65" + integrity sha512-W24e3Ycz1UZPgr1ZEDHlK4XnvOr+CpJH3qNsFeqXwwlW/9END9gxn3oJSsp7gYdiQxrXUHwUUd3xuzVz37MrZQ== + dependencies: + "@types/node" "*" + +"@types/form-data@*": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@types/form-data/-/form-data-2.2.1.tgz#ee2b3b8eaa11c0938289953606b745b738c54b1e" + integrity sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ== + dependencies: + "@types/node" "*" + +"@types/fs-extra@^5.0.0": + version "5.0.5" + resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-5.0.5.tgz#080d90a792f3fa2c5559eb44bd8ef840aae9104b" + integrity sha512-w7iqhDH9mN8eLClQOYTkhdYUOSpp25eXxfc6VbFOGtzxW34JcvctH2bKjj4jD4++z4R5iO5D+pg48W2e03I65A== + dependencies: + "@types/node" "*" + "@types/mocha@^5.2.5": version "5.2.6" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.6.tgz#b8622d50557dd155e9f2f634b7d68fd38de5e94b" integrity sha512-1axi39YdtBI7z957vdqXI4Ac25e7YihYQtJa+Clnxg1zTJEaIRbndt71O3sP4GAMgiAm0pY26/b9BrY4MR/PMw== +"@types/node@*": + version "11.13.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.4.tgz#f83ec3c3e05b174b7241fadeb6688267fe5b22ca" + integrity sha512-+rabAZZ3Yn7tF/XPGHupKIL5EcAbrLxnTr/hgQICxbeuAfWtT0UZSfULE+ndusckBItcv4o6ZeOJplQikVcLvQ== + "@types/node@^11.9.3": version "11.9.3" resolved "https://registry.yarnpkg.com/@types/node/-/node-11.9.3.tgz#14adbb5ab8cd563f549fbae8dbe92e0b7d6e76cc" integrity sha512-DMiqG51GwES/c4ScBY0u5bDlH44+oY8AeYHjY1SGCWidD7h08o1dfHue/TGK7REmif2KiJzaUskO+Q0eaeZ2fQ== +"@types/request@^2.48.1": + version "2.48.1" + resolved "https://registry.yarnpkg.com/@types/request/-/request-2.48.1.tgz#e402d691aa6670fbbff1957b15f1270230ab42fa" + integrity sha512-ZgEZ1TiD+KGA9LiAAPPJL68Id2UWfeSO62ijSXZjFJArVV+2pKcsVHmrcu+1oiE3q6eDGiFiSolRc4JHoerBBg== + dependencies: + "@types/caseless" "*" + "@types/form-data" "*" + "@types/node" "*" + "@types/tough-cookie" "*" + +"@types/temp-write@^3.3.0": + version "3.3.0" + resolved "https://registry.yarnpkg.com/@types/temp-write/-/temp-write-3.3.0.tgz#40fe3d1fae6e98a2e40a13abe83e7a1996ea51ee" + integrity sha512-RW+6TTQi6GVmOmpMoizl0Nfg8yhtPPGJQs8QtzW7eBH5XyoEM30GrUq4weYpEzITH2UrbGTd2Sn/5LRGlGPHrg== + dependencies: + "@types/node" "*" + +"@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== + ajv@^6.5.5: version "6.9.1" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.9.1.tgz#a4d3683d74abc5670e75f0b16520f70a20ea8dc1" diff --git a/src/sql/azdata.proposed.d.ts b/src/sql/azdata.proposed.d.ts index 4e3995b2a9..6b0e3f62b6 100644 --- a/src/sql/azdata.proposed.d.ts +++ b/src/sql/azdata.proposed.d.ts @@ -404,7 +404,7 @@ declare module 'azdata' { /** * options for all new server properties. */ - options: {}; + options: { [key: string]: any }; } export interface DataProvider { @@ -4443,7 +4443,7 @@ declare module 'azdata' { * Mime bundle expected to contain mime type -> contents mappings. * This is dynamic and is controlled by kernels, so cannot be more specific */ - data: {}; + data: { [key: string]: any }; /** * Optional metadata, also a mime bundle */