diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 40b4f8db5a..a797772ad9 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -236,7 +236,6 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op const api = gulp.src('src/vs/vscode.d.ts').pipe(rename('out/vs/vscode.d.ts')); // {{SQL CARBON EDIT}} const dataApi = gulp.src('src/sql/azdata.d.ts').pipe(rename('out/sql/azdata.d.ts')); - const sqlopsAPI = gulp.src('src/sql/sqlops.d.ts').pipe(rename('out/sql/sqlops.d.ts')); const telemetry = gulp.src('.build/telemetry/**', { base: '.build/telemetry', dot: true }); @@ -253,8 +252,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op productJsonStream, license, api, - dataApi, - sqlopsAPI, // {{SQL CARBON EDIT}} + dataApi, // {{SQL CARBON EDIT}} telemetry, sources, deps diff --git a/extensions/dacpac/src/typings/ref.d.ts b/extensions/dacpac/src/typings/ref.d.ts index 1c00f76a98..cfdf5dd135 100644 --- a/extensions/dacpac/src/typings/ref.d.ts +++ b/extensions/dacpac/src/typings/ref.d.ts @@ -4,8 +4,6 @@ *--------------------------------------------------------------------------------------------*/ /// -/// -/// /// /// -/// \ No newline at end of file +/// diff --git a/extensions/import/src/typings/ref.d.ts b/extensions/import/src/typings/ref.d.ts index 1c00f76a98..cfdf5dd135 100644 --- a/extensions/import/src/typings/ref.d.ts +++ b/extensions/import/src/typings/ref.d.ts @@ -4,8 +4,6 @@ *--------------------------------------------------------------------------------------------*/ /// -/// -/// /// /// -/// \ No newline at end of file +/// diff --git a/extensions/mssql/src/typings/refs.d.ts b/extensions/mssql/src/typings/refs.d.ts index a57da7a011..dad0d96412 100644 --- a/extensions/mssql/src/typings/refs.d.ts +++ b/extensions/mssql/src/typings/refs.d.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/// -/// /// /// /// diff --git a/extensions/shared.webpack.config.js b/extensions/shared.webpack.config.js index 80e1517b3d..5db426bbbe 100644 --- a/extensions/shared.webpack.config.js +++ b/extensions/shared.webpack.config.js @@ -57,8 +57,7 @@ module.exports = function withDefaults(/**@type WebpackConfig*/extConfig) { }, externals: { 'vscode': 'commonjs vscode', // ignored because it doesn't exist - 'azdata': 'commonjs azdata', - 'sqlops': 'commonjs sqlops' + 'azdata': 'commonjs azdata' }, output: { // all output goes into `dist`. diff --git a/samples/extensionSamples/src/controllers/mainController.ts b/samples/extensionSamples/src/controllers/mainController.ts index f7e0c5fb83..186c671fff 100644 --- a/samples/extensionSamples/src/controllers/mainController.ts +++ b/samples/extensionSamples/src/controllers/mainController.ts @@ -5,7 +5,7 @@ 'use strict'; -import * as sqlops from 'sqlops'; +import * as azdata from 'azdata'; import * as Utils from '../utils'; import ControllerBase from './controllerBase'; import * as fs from 'fs'; @@ -15,47 +15,43 @@ import * as path from 'path'; * The main controller class that initializes the extension */ export default class MainController extends ControllerBase { - // PUBLIC METHODS ////////////////////////////////////////////////////// - /** - * Deactivates the extension - */ - public deactivate(): void { - Utils.logDebug('Main controller deactivated'); - } + public deactivate(): void { + Utils.logDebug('Main controller deactivated'); + } - public activate(): Promise { - const webviewExampleHtml = fs.readFileSync(path.join(__dirname, 'webviewExample.html')).toString(); - const buttonHtml = fs.readFileSync(path.join(__dirname, 'button.html')).toString(); - const counterHtml = fs.readFileSync(path.join(__dirname, 'counter.html')).toString(); + public activate(): Promise { + const webviewExampleHtml = fs.readFileSync(path.join(__dirname, 'webviewExample.html')).toString(); + const buttonHtml = fs.readFileSync(path.join(__dirname, 'button.html')).toString(); + const counterHtml = fs.readFileSync(path.join(__dirname, 'counter.html')).toString(); - let countWidget: sqlops.DashboardWebview; - let buttonWidget: sqlops.DashboardWebview; - let count = 0; + let countWidget: azdata.DashboardWebview; + let buttonWidget: azdata.DashboardWebview; + let count = 0; - let dialog: sqlops.ModalDialog = sqlops.window.createWebViewDialog('Flyout extension'); - dialog.html = '
This is a flyout extension.
'; + let dialog: azdata.ModalDialog = azdata.window.createWebViewDialog('Flyout extension'); + dialog.html = '
This is a flyout extension.
'; - sqlops.dashboard.registerWebviewProvider('webview-count', e => { - e.html = counterHtml; - countWidget = e; - }); - sqlops.dashboard.registerWebviewProvider('webview-button', e => { - e.html = buttonHtml; - buttonWidget = e; - e.onMessage(event => { - if (event === 'openFlyout') { - dialog.open(); - } else { - count++; - countWidget.postMessage(count); - } - }); - }); - sqlops.dashboard.registerWebviewProvider('webviewExample', e => { - e.html = webviewExampleHtml; - }); + azdata.dashboard.registerWebviewProvider('webview-count', e => { + e.html = counterHtml; + countWidget = e; + }); + azdata.dashboard.registerWebviewProvider('webview-button', e => { + e.html = buttonHtml; + buttonWidget = e; + e.onMessage(event => { + if (event === 'openFlyout') { + dialog.open(); + } else { + count++; + countWidget.postMessage(count); + } + }); + }); + azdata.dashboard.registerWebviewProvider('webviewExample', e => { + e.html = webviewExampleHtml; + }); - return Promise.resolve(true); - } + return Promise.resolve(true); + } } diff --git a/samples/extensionSamples/src/typings/ref.d.ts b/samples/extensionSamples/src/typings/ref.d.ts index cd4164909c..46520d1682 100644 --- a/samples/extensionSamples/src/typings/ref.d.ts +++ b/samples/extensionSamples/src/typings/ref.d.ts @@ -3,4 +3,5 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/// +/// +/// diff --git a/samples/serverReports/tasks/buildtasks.js b/samples/serverReports/tasks/buildtasks.js index d288454b27..abc1f43a74 100644 --- a/samples/serverReports/tasks/buildtasks.js +++ b/samples/serverReports/tasks/buildtasks.js @@ -118,6 +118,6 @@ gulp.task('test', (done) => { }); gulp.task('copytypings', function () { - return gulp.src(config.paths.project.root + '/../../src/sql/sqlops.proposed.d.ts') + return gulp.src(config.paths.project.root + '/../../src/sql/azdata.proposed.d.ts') .pipe(gulp.dest('typings/')); }); diff --git a/samples/sqlservices/.gitignore b/samples/sqlservices/.gitignore index 8709e7b205..aeee7322bf 100644 --- a/samples/sqlservices/.gitignore +++ b/samples/sqlservices/.gitignore @@ -1,3 +1,2 @@ node_modules *.vsix -typings/sqlops.proposed.d.ts diff --git a/samples/sqlservices/src/controllers/mainController.ts b/samples/sqlservices/src/controllers/mainController.ts index 914bcd0b0b..0cc15e2962 100644 --- a/samples/sqlservices/src/controllers/mainController.ts +++ b/samples/sqlservices/src/controllers/mainController.ts @@ -5,13 +5,13 @@ 'use strict'; -import * as sqlops from 'sqlops'; +import * as azdata from 'azdata'; import * as Utils from '../utils'; import * as vscode from 'vscode'; import SplitPropertiesPanel from './splitPropertiesPanel'; import * as fs from 'fs'; import * as path from 'path'; -import {TreeNode, TreeDataProvider} from './treeDataProvider'; +import { TreeNode, TreeDataProvider } from './treeDataProvider'; /** * The main controller class that initializes the extension @@ -41,7 +41,7 @@ export default class MainController implements vscode.Disposable { this.registerSqlServicesModelView(); this.registerSplitPanelModelView(); - sqlops.tasks.registerTask('sqlservices.clickTask', (profile) => { + azdata.tasks.registerTask('sqlservices.clickTask', (profile) => { vscode.window.showInformationMessage(`Clicked from profile ${profile.serverName}.${profile.databaseName}`); }); @@ -50,7 +50,7 @@ export default class MainController implements vscode.Disposable { }); vscode.commands.registerCommand('sqlservices.openConnectionDialog', async () => { - let connection = await sqlops.connection.openConnectionDialog(); + let connection = await azdata.connection.openConnectionDialog(); if (connection) { console.info('Connection Opened: ' + connection.options['server']); } @@ -75,7 +75,7 @@ export default class MainController implements vscode.Disposable { return Promise.resolve(true); } - private async getTab3Content(view: sqlops.ModelView): Promise { + private async getTab3Content(view: azdata.ModelView): Promise { let treeData = { label: '1', children: [ @@ -118,7 +118,7 @@ export default class MainController implements vscode.Disposable { let treeDataProvider = new TreeDataProvider(root); - let tree: sqlops.TreeComponent = view.modelBuilder.tree().withProperties({ + let tree: azdata.TreeComponent = view.modelBuilder.tree().withProperties({ 'withCheckbox': true }).component(); let treeView = tree.registerDataProvider(treeDataProvider); @@ -139,16 +139,16 @@ export default class MainController implements vscode.Disposable { component: tree, title: 'Tree' }], { - horizontal: false, - componentWidth: 800, - componentHeight: 800 - }).component(); + horizontal: false, + componentWidth: 800, + componentHeight: 800 + }).component(); let formWrapper = view.modelBuilder.loadingComponent().withItem(formModel).component(); formWrapper.loading = false; await view.initializeModel(formWrapper); } - private async getTabContent(view: sqlops.ModelView, customButton1: sqlops.window.Button, customButton2: sqlops.window.Button, componentWidth: number | string + private async getTabContent(view: azdata.ModelView, customButton1: azdata.window.Button, customButton2: azdata.window.Button, componentWidth: number | string ): Promise { let inputBox = view.modelBuilder.inputBox() .withProperties({ @@ -226,8 +226,8 @@ export default class MainController implements vscode.Disposable { component: inputBox4, title: 'inputBox4' }], { - horizontal: true - }).component(); + horizontal: true + }).component(); let groupModel1 = view.modelBuilder.groupContainer() .withLayout({ }).withItems([ @@ -255,22 +255,22 @@ export default class MainController implements vscode.Disposable { .withProperties({ columns: [{ displayName: 'Column 1', - valueType: sqlops.DeclarativeDataType.string, + valueType: azdata.DeclarativeDataType.string, width: '20px', isReadOnly: true }, { displayName: 'Column 2', - valueType: sqlops.DeclarativeDataType.string, + valueType: azdata.DeclarativeDataType.string, width: '100px', isReadOnly: false }, { displayName: 'Column 3', - valueType: sqlops.DeclarativeDataType.boolean, + valueType: azdata.DeclarativeDataType.boolean, width: '20px', isReadOnly: false }, { displayName: 'Column 4', - valueType: sqlops.DeclarativeDataType.category, + valueType: azdata.DeclarativeDataType.category, isReadOnly: false, width: '120px', categoryValues: [ @@ -317,23 +317,24 @@ export default class MainController implements vscode.Disposable { title: 'Declarative Table' }], formItemLayout); let groupItems = { - components: [{ - component: table, - title: 'Table' - }, { - component: listBox, - title: 'List Box' - }], title: 'group'}; + components: [{ + component: table, + title: 'Table' + }, { + component: listBox, + title: 'List Box' + }], title: 'group' + }; formBuilder.addFormItem(groupItems, formItemLayout); formBuilder.insertFormItem({ component: inputBoxWrapper, title: 'Backup name' - }, 0, formItemLayout); + }, 0, formItemLayout); formBuilder.insertFormItem({ component: inputBox2, title: 'Recovery model' - }, 1, formItemLayout); + }, 1, formItemLayout); formBuilder.insertFormItem({ component: dropdown, title: 'Backup type' @@ -375,20 +376,20 @@ export default class MainController implements vscode.Disposable { } private openDialog(): void { - let dialog = sqlops.window.createModelViewDialog('Test dialog'); - let tab1 = sqlops.window.createTab('Test tab 1'); + let dialog = azdata.window.createModelViewDialog('Test dialog'); + let tab1 = azdata.window.createTab('Test tab 1'); - let tab2 = sqlops.window.createTab('Test tab 2'); - let tab3 = sqlops.window.createTab('Test tab 3'); + let tab2 = azdata.window.createTab('Test tab 2'); + let tab3 = azdata.window.createTab('Test tab 3'); tab2.content = 'sqlservices'; dialog.content = [tab1, tab2, tab3]; dialog.okButton.onClick(() => console.log('ok clicked!')); dialog.cancelButton.onClick(() => console.log('cancel clicked!')); dialog.okButton.label = 'ok'; dialog.cancelButton.label = 'no'; - let customButton1 = sqlops.window.createButton('Load name'); + let customButton1 = azdata.window.createButton('Load name'); customButton1.onClick(() => console.log('button 1 clicked!')); - let customButton2 = sqlops.window.createButton('Load all'); + let customButton2 = azdata.window.createButton('Load all'); customButton2.onClick(() => console.log('button 2 clicked!')); dialog.customButtons = [customButton1, customButton2]; tab1.registerContent(async (view) => { @@ -398,17 +399,17 @@ export default class MainController implements vscode.Disposable { tab3.registerContent(async (view) => { await this.getTab3Content(view); }); - sqlops.window.openDialog(dialog); + azdata.window.openDialog(dialog); } private openWizard(): void { - let wizard = sqlops.window.createWizard('Test wizard'); - let page1 = sqlops.window.createWizardPage('First wizard page'); - let page2 = sqlops.window.createWizardPage('Second wizard page'); + let wizard = azdata.window.createWizard('Test wizard'); + let page1 = azdata.window.createWizardPage('First wizard page'); + let page2 = azdata.window.createWizardPage('Second wizard page'); page2.content = 'sqlservices'; - let customButton1 = sqlops.window.createButton('Load name'); + let customButton1 = azdata.window.createButton('Load name'); customButton1.onClick(() => console.log('button 1 clicked!')); - let customButton2 = sqlops.window.createButton('Load all'); + let customButton2 = azdata.window.createButton('Load all'); customButton2.onClick(() => console.log('button 2 clicked!')); wizard.customButtons = [customButton1, customButton2]; page1.registerContent(async (view) => { @@ -421,10 +422,10 @@ export default class MainController implements vscode.Disposable { isCancelable: true, connection: undefined, operation: op => { - op.updateStatus(sqlops.TaskStatus.InProgress); - op.updateStatus(sqlops.TaskStatus.InProgress, 'Task is running'); + op.updateStatus(azdata.TaskStatus.InProgress); + op.updateStatus(azdata.TaskStatus.InProgress, 'Task is running'); setTimeout(() => { - op.updateStatus(sqlops.TaskStatus.Succeeded); + op.updateStatus(azdata.TaskStatus.Succeeded); }, 5000); } }); @@ -433,7 +434,7 @@ export default class MainController implements vscode.Disposable { } private openEditor(): void { - let editor = sqlops.workspace.createModelViewEditor('Test Model View'); + let editor = azdata.workspace.createModelViewEditor('Test Model View'); editor.registerContent(async view => { let inputBox = view.modelBuilder.inputBox() .withValidation(component => component.value !== 'valid') @@ -452,7 +453,7 @@ export default class MainController implements vscode.Disposable { } private openEditorWithWebview(html1: string, html2: string): void { - let editor = sqlops.workspace.createModelViewEditor('Editor webview', { retainContextWhenHidden: true }); + let editor = azdata.workspace.createModelViewEditor('Editor webview', { retainContextWhenHidden: true }); editor.registerContent(async view => { let count = 0; let webview1 = view.modelBuilder.webView() @@ -502,7 +503,7 @@ export default class MainController implements vscode.Disposable { } private openEditorWithWebview2(): void { - let editor = sqlops.workspace.createModelViewEditor('Editor webview2', { retainContextWhenHidden: true }); + let editor = azdata.workspace.createModelViewEditor('Editor webview2', { retainContextWhenHidden: true }); editor.registerContent(async view => { let inputBox = view.modelBuilder.inputBox().component(); @@ -571,7 +572,7 @@ export default class MainController implements vscode.Disposable { private registerSqlServicesModelView(): void { - sqlops.ui.registerModelViewProvider('sqlservices', async (view) => { + azdata.ui.registerModelViewProvider('sqlservices', async (view) => { let flexModel = view.modelBuilder.flexContainer() .withLayout({ flexFlow: 'row', @@ -586,7 +587,7 @@ export default class MainController implements vscode.Disposable { }) .withItems([ view.modelBuilder.card() - .withProperties({ + .withProperties({ label: 'label1', value: 'value1', actions: [{ label: 'action' }] @@ -598,7 +599,7 @@ export default class MainController implements vscode.Disposable { .withLayout({ flexFlow: 'column' }) .withItems([ view.modelBuilder.card() - .withProperties({ + .withProperties({ label: 'label2', value: 'value2', actions: [{ label: 'action' }] @@ -612,7 +613,7 @@ export default class MainController implements vscode.Disposable { } private registerSplitPanelModelView(): void { - sqlops.ui.registerModelViewProvider('splitPanel', async (view) => { + azdata.ui.registerModelViewProvider('splitPanel', async (view) => { let numPanels = 3; let splitPanel = new SplitPropertiesPanel(view, numPanels); await view.initializeModel(splitPanel.modelBase); diff --git a/samples/sqlservices/src/controllers/splitPropertiesPanel.ts b/samples/sqlservices/src/controllers/splitPropertiesPanel.ts index b9258aa8d9..a0d9c87728 100644 --- a/samples/sqlservices/src/controllers/splitPropertiesPanel.ts +++ b/samples/sqlservices/src/controllers/splitPropertiesPanel.ts @@ -5,15 +5,15 @@ 'use strict'; -import * as sqlops from 'sqlops'; +import * as azdata from 'azdata'; /** * The main controller class that initializes the extension */ export default class SplitPropertiesPanel { - private panels: sqlops.FlexContainer[]; - private _modelBase: sqlops.FlexContainer; - constructor(view: sqlops.ModelView, numPanels: number) { + private panels: azdata.FlexContainer[]; + private _modelBase: azdata.FlexContainer; + constructor(view: azdata.ModelView, numPanels: number) { this.panels = []; let ratio = Math.round(100 / numPanels); for (let i = 0; i < numPanels; i++) { @@ -29,11 +29,11 @@ export default class SplitPropertiesPanel { .component(); } - public get modelBase(): sqlops.Component { + public get modelBase(): azdata.Component { return this._modelBase; } - public addItem(item: sqlops.Component, panel: number): void { + public addItem(item: azdata.Component, panel: number): void { if (panel >= this.panels.length) { throw new Error(`Cannot add to panel ${panel} as only ${this.panels.length - 1} panels defined`); } diff --git a/samples/sqlservices/src/controllers/treeDataProvider.ts b/samples/sqlservices/src/controllers/treeDataProvider.ts index c49600a00d..8a636272c3 100644 --- a/samples/sqlservices/src/controllers/treeDataProvider.ts +++ b/samples/sqlservices/src/controllers/treeDataProvider.ts @@ -6,7 +6,7 @@ 'use strict'; import * as vscode from 'vscode'; -import * as sqlops from 'sqlops'; +import * as azdata from 'azdata'; import * as path from 'path'; export enum TreeCheckboxState { @@ -22,7 +22,7 @@ export interface TreeComponentDataModel { checked?: boolean; } -export class TreeNode implements sqlops.TreeComponentItem { +export class TreeNode implements azdata.TreeComponentItem { private _onNodeChange = new vscode.EventEmitter(); private _onTreeChange = new vscode.EventEmitter(); private _data: TreeComponentDataModel; @@ -252,7 +252,7 @@ export class TreeNode implements sqlops.TreeComponentItem { } } -export class TreeDataProvider implements sqlops.TreeComponentDataProvider { +export class TreeDataProvider implements azdata.TreeComponentDataProvider { private _onDidChangeTreeData = new vscode.EventEmitter(); constructor(private _root: TreeNode) { if (this._root) { @@ -269,8 +269,8 @@ export class TreeDataProvider implements sqlops.TreeComponentDataProvider { - let item: sqlops.TreeComponentItem = {}; + getTreeItem(element: TreeNode): azdata.TreeComponentItem | Thenable { + let item: azdata.TreeComponentItem = {}; item.label = element.label; item.checked = element.checked; item.collapsibleState = element.collapsibleState; diff --git a/samples/sqlservices/tasks/buildtasks.js b/samples/sqlservices/tasks/buildtasks.js index f219c2de18..cedadbb60f 100644 --- a/samples/sqlservices/tasks/buildtasks.js +++ b/samples/sqlservices/tasks/buildtasks.js @@ -18,68 +18,68 @@ let tsProject = ts.createProject('tsconfig.json'); // GULP TASKS ////////////////////////////////////////////////////////////// -gulp.task('clean', function(done) { - return del('out', done); +gulp.task('clean', function (done) { + return del('out', done); }); gulp.task('lint', () => { - return gulp.src([ - config.paths.project.root + '/src/**/*.ts', - config.paths.project.root + '/test/**/*.ts' - ]) - .pipe((tslint({ - formatter: "verbose" - }))) - .pipe(tslint.report()); + return gulp.src([ + config.paths.project.root + '/src/**/*.ts', + config.paths.project.root + '/test/**/*.ts' + ]) + .pipe((tslint({ + formatter: "verbose" + }))) + .pipe(tslint.report()); }); -gulp.task('compile:src', function(done) { - gulp.src([ - config.paths.project.root + '/src/**/*.sql', - config.paths.project.root + '/src/**/*.svg', - config.paths.project.root + '/src/**/*.html' - ]).pipe(gulp.dest('out/src/')); +gulp.task('compile:src', function (done) { + gulp.src([ + config.paths.project.root + '/src/**/*.sql', + config.paths.project.root + '/src/**/*.svg', + config.paths.project.root + '/src/**/*.html' + ]).pipe(gulp.dest('out/src/')); - let srcFiles = [ - config.paths.project.root + '/src/**/*.ts', - config.paths.project.root + '/src/**/*.js', - config.paths.project.root + '/typings/**/*.ts' - ]; + let srcFiles = [ + config.paths.project.root + '/src/**/*.ts', + config.paths.project.root + '/src/**/*.js', + config.paths.project.root + '/typings/**/*.ts' + ]; - return gulp.src(srcFiles) - .pipe(srcmap.init()) - .pipe(tsProject()) - .on('error', function() { - if (process.env.BUILDMACHINE) { - done('Extension Tests failed to build. See Above.'); - process.exit(1); - } - }) - .pipe(srcmap.write('.', { - sourceRoot: function(file) { - return file.cwd + '/src'; - } - })) - .pipe(gulp.dest('out/src/')); + return gulp.src(srcFiles) + .pipe(srcmap.init()) + .pipe(tsProject()) + .on('error', function () { + if (process.env.BUILDMACHINE) { + done('Extension Tests failed to build. See Above.'); + process.exit(1); + } + }) + .pipe(srcmap.write('.', { + sourceRoot: function (file) { + return file.cwd + '/src'; + } + })) + .pipe(gulp.dest('out/src/')); }); -gulp.task('compile:test', function(done) { - let srcFiles = [ - config.paths.project.root + '/test/**/*.ts', - config.paths.project.root + '/typings/**/*.ts' - ]; +gulp.task('compile:test', function (done) { + let srcFiles = [ + config.paths.project.root + '/test/**/*.ts', + config.paths.project.root + '/typings/**/*.ts' + ]; - return gulp.src(srcFiles) - .pipe(srcmap.init()) - .pipe(tsProject()) - .on('error', function() { - if(process.env.BUILDMACHINE) { - done('Failed to compile test source, see above.'); - process.exit(1); - } - }) - .pipe(srcmap.write('.', {sourceRoot: function(file) { return file.cwd + '/test'; }})) - .pipe(gulp.dest('out/test/')); + return gulp.src(srcFiles) + .pipe(srcmap.init()) + .pipe(tsProject()) + .on('error', function () { + if (process.env.BUILDMACHINE) { + done('Failed to compile test source, see above.'); + process.exit(1); + } + }) + .pipe(srcmap.write('.', { sourceRoot: function (file) { return file.cwd + '/test'; } })) + .pipe(gulp.dest('out/test/')); }); // COMPOSED GULP TASKS ///////////////////////////////////////////////////// @@ -87,38 +87,38 @@ gulp.task("compile", gulp.series("compile:src", "compile:test")); gulp.task("build", gulp.series("clean", "lint", "compile")); -gulp.task("watch", function() { - gulp.watch([config.paths.project.root + '/src/**/*', - config.paths.project.root + '/test/**/*.ts'], - gulp.series('build')); +gulp.task("watch", function () { + gulp.watch([config.paths.project.root + '/src/**/*', + config.paths.project.root + '/test/**/*.ts'], + gulp.series('build')); }); gulp.task('test', (done) => { - let workspace = process.env['WORKSPACE']; - if (!workspace) { - workspace = process.cwd(); - } - process.env.JUNIT_REPORT_PATH = workspace + '/test-reports/ext_xunit.xml'; + let workspace = process.env['WORKSPACE']; + if (!workspace) { + workspace = process.cwd(); + } + process.env.JUNIT_REPORT_PATH = workspace + '/test-reports/ext_xunit.xml'; - let azuredatastudioPath = 'azuredatastudio'; - if (process.env['SQLOPS_DEV']) { - let suffix = os.platform === 'win32' ? 'bat' : 'sh'; - azuredatastudioPath = `${process.env['SQLOPS_DEV']}/scripts/sql-cli.${suffix}`; - } - console.log(`Using SQLOPS Path of ${azuredatastudioPath}`); + let azuredatastudioPath = 'azuredatastudio'; + if (process.env['SQLOPS_DEV']) { + let suffix = os.platform === 'win32' ? 'bat' : 'sh'; + azuredatastudioPath = `${process.env['SQLOPS_DEV']}/scripts/sql-cli.${suffix}`; + } + console.log(`Using SQLOPS Path of ${azuredatastudioPath}`); - cproc.exec(`${azuredatastudioPath} --extensionDevelopmentPath="${workspace}" --extensionTestsPath="${workspace}/out/test" --verbose`, (error, stdout, stderr) => { - if (error) { - console.error(`exec error: ${error}`); - process.exit(1); - } - console.log(`stdout: ${stdout}`); - console.log(`stderr: ${stderr}`); - done(); - }); + cproc.exec(`${azuredatastudioPath} --extensionDevelopmentPath="${workspace}" --extensionTestsPath="${workspace}/out/test" --verbose`, (error, stdout, stderr) => { + if (error) { + console.error(`exec error: ${error}`); + process.exit(1); + } + console.log(`stdout: ${stdout}`); + console.log(`stderr: ${stderr}`); + done(); + }); }); -gulp.task('copytypings', function() { - return gulp.src(config.paths.project.root + '/../../src/sql/sqlops.proposed.d.ts') - .pipe(gulp.dest('typings/')); +gulp.task('copytypings', function () { + return gulp.src(config.paths.project.root + '/../../src/sql/azdata.proposed.d.ts') + .pipe(gulp.dest('typings/')); }); diff --git a/src/sql/sqlops.d.ts b/src/sql/sqlops.d.ts deleted file mode 100644 index 1f3a607c27..0000000000 --- a/src/sql/sqlops.d.ts +++ /dev/null @@ -1,1526 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the Source EULA. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -declare module 'sqlops' { - import * as vscode from 'vscode'; - - // EXPORTED NAMESPACES ///////////////////////////////////////////////// - /** - * Namespace for Data Management Protocol global methods - */ - export namespace dataprotocol { - export function registerConnectionProvider(provider: ConnectionProvider): vscode.Disposable; - - export function registerScriptingProvider(provider: ScriptingProvider): vscode.Disposable; - - export function registerObjectExplorerProvider(provider: ObjectExplorerProvider): vscode.Disposable; - - export function registerObjectExplorerNodeProvider(provider: ObjectExplorerNodeProvider): vscode.Disposable; - - export function registerTaskServicesProvider(provider: TaskServicesProvider): vscode.Disposable; - - export function registerFileBrowserProvider(provider: FileBrowserProvider): vscode.Disposable; - - export function registerMetadataProvider(provider: MetadataProvider): vscode.Disposable; - - export function registerQueryProvider(provider: QueryProvider): vscode.Disposable; - - export function registerAdminServicesProvider(provider: AdminServicesProvider): vscode.Disposable; - - export function registerCapabilitiesServiceProvider(provider: CapabilitiesProvider): vscode.Disposable; - - /** - * An [event](#Event) which fires when the specific flavor of a language used in DMP - * connections has changed. And example is for a SQL connection, the flavor changes - * to MSSQL - */ - export const onDidChangeLanguageFlavor: vscode.Event; - } - - /** - * Namespace for credentials management global methods, available to all extensions - */ - export namespace credentials { - /** - * Register a credential provider to handle credential requests. - * @param provider The provider to register - * @return Handle to the provider for disposal - */ - export function registerProvider(provider: CredentialProvider): vscode.Disposable; - - /** - * Retrieves a provider from the extension host if one has been registered. Any credentials - * accessed with the returned provider will have the namespaceId appended to credential ID - * to prevent extensions from trampling over each others' credentials. - * @param namespaceId ID that will be appended to credential IDs. - * @return Promise that returns the namespaced provider - */ - export function getProvider(namespaceId: string): Thenable; - } - - /** - * Namespace for serialization management global methods - */ - export namespace serialization { - export function registerProvider(provider: SerializationProvider): vscode.Disposable; - } - - /** - * Namespace for connection management - */ - export namespace connection { - /** - * Get the current connection based on the active editor or Object Explorer selection - */ - export function getCurrentConnection(): Thenable; - - /** - * Get all active connections - */ - export function getActiveConnections(): Thenable; - - /** - * Get connection string - */ - export function getConnectionString(connectionId: string, includePassword: boolean): Thenable; - - /** - * Get the credentials for an active connection - * @param connectionId The id of the connection - * @returns A dictionary containing the credentials as they would be included in the connection's options dictionary - */ - export function getCredentials(connectionId: string): Thenable<{ [name: string]: string }>; - - /** - * Get ServerInfo for a connectionId - * @param connectionId The id of the connection - * @returns ServerInfo - */ - export function getServerInfo(connectionId: string): Thenable; - - /** - * Interface for representing a connection when working with connection APIs - */ - export interface Connection extends ConnectionInfo { - /** - * The name of the provider managing the connection (e.g. MSSQL) - */ - providerName: string; - - /** - * A unique identifier for the connection - */ - connectionId: string; - } - } - - /** - * Namespace for interacting with Object Explorer - */ - export namespace objectexplorer { - /** - * Get an Object Explorer node corresponding to the given connection and path. If no path - * is given, it returns the top-level node for the given connection. If there is no node at - * the given path, it returns undefined. - * @param connectionId The id of the connection that the node exists on - * @param nodePath The path of the node to get - * @returns The node corresponding to the given connection and path, - * or undefined if no such node exists. - */ - export function getNode(connectionId: string, nodePath?: string): Thenable; - - /** - * Get all active Object Explorer connection nodes - * @returns The Object Explorer nodes for each saved connection - */ - export function getActiveConnectionNodes(): Thenable; - - /** - * Find Object Explorer nodes that match the given information - * @param connectionId The id of the connection that the node exists on - * @param type The type of the object to retrieve - * @param schema The schema of the object, if applicable - * @param name The name of the object - * @param database The database the object exists under, if applicable - * @param parentObjectNames A list of names of parent objects in the tree, ordered from highest to lowest level - * (for example when searching for a table's column, provide the name of its parent table for this argument) - */ - export function findNodes(connectionId: string, type: string, schema: string, name: string, database: string, parentObjectNames: string[]): Thenable; - - /** - * Get connectionProfile from sessionId - * @param sessionId The id of the session that the node exists on - * @returns The IConnecitonProfile for the session - */ - export function getSessionConnectionProfile(sessionId: string): Thenable; - - /** - * Interface for representing and interacting with items in Object Explorer - */ - export interface ObjectExplorerNode extends NodeInfo { - /** - * The id of the connection that the node exists under - */ - connectionId: string; - - /** - * Whether the node is currently expanded in Object Explorer - */ - isExpanded(): Thenable; - - /** - * Set whether the node is expanded or collapsed - * @param expandedState The new state of the node. If 'None', the node will not be changed - */ - setExpandedState(expandedState: vscode.TreeItemCollapsibleState): Thenable; - - /** - * Set whether the node is selected - * @param selected Whether the node should be selected - * @param clearOtherSelections If true, clear any other selections. If false, leave any existing selections. - * Defaults to true when selected is true and false when selected is false. - */ - setSelected(selected: boolean, clearOtherSelections?: boolean): Thenable; - - /** - * Get all the child nodes. Returns an empty list if there are no children. - */ - getChildren(): Thenable; - - /** - * Get the parent node. Returns undefined if there is none. - */ - getParent(): Thenable; - - /** - * Refresh the node, expanding it if it has children - */ - refresh(): Thenable; - } - } - - // EXPORTED INTERFACES ///////////////////////////////////////////////// - export interface ConnectionInfo { - - options: { [name: string]: any }; - } - - export interface IConnectionProfile extends ConnectionInfo { - connectionName: string; - serverName: string; - databaseName: string; - userName: string; - password: string; - authenticationType: string; - savePassword: boolean; - groupFullName?: string; - groupId: string; - providerName: string; - saveProfile: boolean; - id: string; - azureTenantId?: string; - } - - /** - * Options for the actions that could happen after connecting is complete - */ - export interface IConnectionCompletionOptions { - /** - * Save the connection to MRU and settings (only save to setting if profile.saveProfile is set to true) - * Default is true. - */ - saveConnection: boolean; - - /** - * If true, open the dashboard after connection is complete. - * If undefined / false, dashboard won't be opened after connection completes. - * Default is false. - */ - showDashboard?: boolean; - - /** - * If undefined / true, open the connection dialog if connection fails. - * If false, connection dialog won't be opened even if connection fails. - * Default is true. - */ - showConnectionDialogOnError?: boolean; - - /** - * If undefined / true, open the connection firewall rule dialog if connection fails. - * If false, connection firewall rule dialog won't be opened even if connection fails. - * Default is true. - */ - showFirewallRuleOnError?: boolean; - } - - export interface ConnectionInfoSummary { - - /** - * URI identifying the owner of the connection - */ - ownerUri: string; - - /** - * connection id returned from service host. - */ - connectionId: string; - - /** - * any diagnostic messages return from the service host. - */ - messages: string; - - /** - * Error message returned from the engine, if any. - */ - errorMessage: string; - - /** - * Error number returned from the engine, if any. - */ - errorNumber: number; - /** - * Information about the connected server. - */ - serverInfo: ServerInfo; - /** - * information about the actual connection established - */ - connectionSummary: ConnectionSummary; - } - - /** - * Summary that identifies a unique database connection. - */ - export interface ConnectionSummary { - /** - * server name - */ - serverName: string; - /** - * database name - */ - databaseName: string; - /** - * user name - */ - userName: string; - } - - /** - * Information about a Server instance. - */ - export interface ServerInfo { - /** - * The major version of the instance. - */ - serverMajorVersion: number; - /** - * The minor version of the instance. - */ - serverMinorVersion: number; - /** - * The build of the instance. - */ - serverReleaseVersion: number; - /** - * The ID of the engine edition of the instance. - */ - engineEditionId: number; - /** - * String containing the full server version text. - */ - serverVersion: string; - /** - * String describing the product level of the server. - */ - serverLevel: string; - /** - * The edition of the instance. - */ - serverEdition: string; - /** - * Whether the instance is running in the cloud (Azure) or not. - */ - isCloud: boolean; - /** - * The version of Azure that the instance is running on, if applicable. - */ - azureVersion: number; - /** - * The Operating System version string of the machine running the instance. - */ - osVersion: string; - /** - * options for all new server properties. - */ - options: {}; - } - - export interface DataProvider { - handle?: number; - readonly providerId: string; - } - - export interface ConnectionProvider extends DataProvider { - - connect(connectionUri: string, connectionInfo: ConnectionInfo): Thenable; - - disconnect(connectionUri: string): Thenable; - - cancelConnect(connectionUri: string): Thenable; - - listDatabases(connectionUri: string): Thenable; - - changeDatabase(connectionUri: string, newDatabase: string): Thenable; - - rebuildIntelliSenseCache(connectionUri: string): Thenable; - - getConnectionString(connectionUri: string, includePassword: boolean): Thenable; - - buildConnectionInfo?(connectionString: string): Thenable; - - registerOnConnectionComplete(handler: (connSummary: ConnectionInfoSummary) => any): void; - - registerOnIntelliSenseCacheComplete(handler: (connectionUri: string) => any): void; - - registerOnConnectionChanged(handler: (changedConnInfo: ChangedConnectionInfo) => any): void; - } - - export enum ServiceOptionType { - string = 'string', - multistring = 'multistring', - password = 'password', - number = 'number', - category = 'category', - boolean = 'boolean', - object = 'object' - } - - export enum ConnectionOptionSpecialType { - connectionName = 'connectionName', - serverName = 'serverName', - databaseName = 'databaseName', - authType = 'authType', - userName = 'userName', - password = 'password', - appName = 'appName' - } - - export interface CategoryValue { - displayName: string; - name: string; - } - - export interface ConnectionOption { - name: string; - - displayName: string; - - description: string; - - groupName: string; - - valueType: ServiceOptionType; - - specialValueType: ConnectionOptionSpecialType; - - defaultValue: string; - - categoryValues: CategoryValue[]; - - isIdentity: boolean; - - isRequired: boolean; - } - - export interface ConnectionProviderOptions { - options: ConnectionOption[]; - } - - export interface ServiceOption { - name: string; - - displayName: string; - - description: string; - - groupName: string; - - valueType: ServiceOptionType; - - defaultValue: string; - - objectType: string; - - categoryValues: CategoryValue[]; - - isRequired: boolean; - - isArray: boolean; - } - - export interface AdminServicesOptions { - databaseInfoOptions: ServiceOption[]; - - databaseFileInfoOptions: ServiceOption[]; - - fileGroupInfoOptions: ServiceOption[]; - } - - - // List Databases Request ---------------------------------------------------------------------- - export interface ListDatabasesResult { - databaseNames: Array; - } - - /** - * Information about a connection changed event for a resource represented by a URI - */ - export interface ChangedConnectionInfo { - /** - * Owner URI of the connection that changed. - */ - connectionUri: string; - - /** - * Summary of details containing any connection changes. - */ - connection: ConnectionSummary; - } - - export interface FeatureMetadataProvider { - enabled: boolean; - - featureName: string; - - optionsMetadata: ServiceOption[]; - } - - export interface DataProtocolServerCapabilities { - protocolVersion: string; - - providerName: string; - - providerDisplayName: string; - - connectionProvider: ConnectionProviderOptions; - - adminServicesProvider: AdminServicesOptions; - - features: FeatureMetadataProvider[]; - } - - export interface DataProtocolClientCapabilities { - hostName: string; - - hostVersion: string; - } - - export interface CapabilitiesProvider extends DataProvider { - getServerCapabilities(client: DataProtocolClientCapabilities): Thenable; - } - - export enum MetadataType { - Table = 0, - View = 1, - SProc = 2, - Function = 3 - } - - export interface ObjectMetadata { - metadataType: MetadataType; - - metadataTypeName: string; - - urn: string; - - name: string; - - schema: string; - } - - export interface ColumnMetadata { - - hasExtendedProperties: boolean; - - defaultValue: string; - - /// - /// Escaped identifier for the name of the column - /// - escapedName: string; - - /// - /// Whether or not the column is computed - /// - isComputed: boolean; - - /// - /// Whether or not the column is deterministically computed - /// - isDeterministic: boolean; - - /// - /// Whether or not the column is an identity column - /// - isIdentity: boolean; - - /// - /// The ordinal ID of the column - /// - ordinal: number; - - /// - /// Whether or not the column is calculated on the server side. This could be a computed - /// column or a identity column. - /// - isCalculated: boolean; - - /// - /// Whether or not the column is used in a key to uniquely identify a row - /// - isKey: boolean; - - /// - /// Whether or not the column can be trusted for uniqueness - /// - isTrustworthyForUniqueness: boolean; - } - - export interface TableMetadata { - - columns: ColumnMetadata; - - } - - export interface ProviderMetadata { - objectMetadata: ObjectMetadata[]; - } - - export interface MetadataProvider extends DataProvider { - getMetadata(connectionUri: string): Thenable; - - getDatabases(connectionUri: string): Thenable; - - getTableInfo(connectionUri: string, metadata: ObjectMetadata): Thenable; - - getViewInfo(connectionUri: string, metadata: ObjectMetadata): Thenable; - } - - export enum ScriptOperation { - Select = 0, - Create = 1, - Insert = 2, - Update = 3, - Delete = 4, - Execute = 5, - Alter = 6 - } - - export interface ScriptingResult { - operationId: string; - script: string; - } - - export interface ScriptingParamDetails { - filePath: string; - scriptCompatibilityOption: string; - targetDatabaseEngineEdition: string; - targetDatabaseEngineType: string; - } - - export interface ScriptingProvider extends DataProvider { - - scriptAsOperation(connectionUri: string, operation: ScriptOperation, metadata: ObjectMetadata, paramDetails: ScriptingParamDetails): Thenable; - - registerOnScriptingComplete(handler: (scriptingCompleteResult: ScriptingCompleteResult) => any): void; - } - - export interface ScriptingCompleteResult { - errorDetails: string; - - errorMessage: string; - - hasError: boolean; - - canceled: boolean; - - success: boolean; - - operationId: string; - } - - /** - * Parameters to initialize a connection to a database - */ - export interface Credential { - /** - * Unique ID identifying the credential - */ - credentialId: string; - - /** - * password - */ - password: string; - } - - export interface CredentialProvider { - handle: number; - - saveCredential(credentialId: string, password: string): Thenable; - - readCredential(credentialId: string): Thenable; - - deleteCredential(credentialId: string): Thenable; - } - - export interface SerializationProvider { - handle: number; - saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable; - } - - - export interface DidChangeLanguageFlavorParams { - uri: string; - language: string; - flavor: string; - } - - export interface QueryProvider extends DataProvider { - cancelQuery(ownerUri: string): Thenable; - runQuery(ownerUri: string, selection: ISelectionData, runOptions?: ExecutionPlanOptions): Thenable; - runQueryStatement(ownerUri: string, line: number, column: number): Thenable; - runQueryString(ownerUri: string, queryString: string): Thenable; - runQueryAndReturn(ownerUri: string, queryString: string): Thenable; - parseSyntax(ownerUri: string, query: string): Thenable; - getQueryRows(rowData: QueryExecuteSubsetParams): Thenable; - disposeQuery(ownerUri: string): Thenable; - saveResults(requestParams: SaveResultsRequestParams): Thenable; - - // Notifications - registerOnQueryComplete(handler: (result: QueryExecuteCompleteNotificationResult) => any): void; - registerOnBatchStart(handler: (batchInfo: QueryExecuteBatchNotificationParams) => any): void; - registerOnBatchComplete(handler: (batchInfo: QueryExecuteBatchNotificationParams) => any): void; - registerOnResultSetAvailable(handler: (resultSetInfo: QueryExecuteResultSetNotificationParams) => any): void; - registerOnResultSetUpdated(handler: (resultSetInfo: QueryExecuteResultSetNotificationParams) => any): void; - registerOnMessage(handler: (message: QueryExecuteMessageParams) => any): void; - - // Edit Data Requests - commitEdit(ownerUri: string): Thenable; - createRow(ownerUri: string): Thenable; - deleteRow(ownerUri: string, rowId: number): Thenable; - disposeEdit(ownerUri: string): Thenable; - initializeEdit(ownerUri: string, schemaName: string, objectName: string, objectType: string, rowLimit: number, queryString: string): Thenable; - revertCell(ownerUri: string, rowId: number, columnId: number): Thenable; - revertRow(ownerUri: string, rowId: number): Thenable; - updateCell(ownerUri: string, rowId: number, columnId: number, newValue: string): Thenable; - getEditRows(rowData: EditSubsetParams): Thenable; - - // Edit Data Notifications - registerOnEditSessionReady(handler: (ownerUri: string, success: boolean, message: string) => any): void; - } - - export interface IDbColumn { - allowDBNull?: boolean; - baseCatalogName: string; - baseColumnName: string; - baseSchemaName: string; - baseServerName: string; - baseTableName: string; - columnName: string; - columnOrdinal?: number; - columnSize?: number; - isAliased?: boolean; - isAutoIncrement?: boolean; - isExpression?: boolean; - isHidden?: boolean; - isIdentity?: boolean; - isKey?: boolean; - isBytes?: boolean; - isChars?: boolean; - isSqlVariant?: boolean; - isUdt?: boolean; - dataType: string; - isXml?: boolean; - isJson?: boolean; - isLong?: boolean; - isReadOnly?: boolean; - isUnique?: boolean; - numericPrecision?: number; - numericScale?: number; - udtAssemblyQualifiedName: string; - dataTypeName: string; - } - - export interface IGridResultSet { - columns: IDbColumn[]; - rowsUri: string; - numberOfRows: number; - } - - export interface IResultMessage { - batchId?: number; - isError: boolean; - time: string; - message: string; - } - - export interface ISelectionData { - startLine: number; - startColumn: number; - endLine: number; - endColumn: number; - } - - export interface ResultSetSummary { - id: number; - batchId: number; - rowCount: number; - columnInfo: IDbColumn[]; - complete: boolean; - } - - export interface BatchSummary { - hasError: boolean; - id: number; - selection: ISelectionData; - resultSetSummaries: ResultSetSummary[]; - executionElapsed: string; - executionEnd: string; - executionStart: string; - } - - export enum EditRowState { - clean = 0, - dirtyInsert = 1, - dirtyDelete = 2, - dirtyUpdate = 3 - } - - export interface EditRow { - cells: DbCellValue[]; - id: number; - isDirty: boolean; - state: EditRowState; - } - - export interface EditCell extends DbCellValue { - isDirty: boolean; - } - - export interface QueryExecuteCompleteNotificationResult { - ownerUri: string; - batchSummaries: BatchSummary[]; - } - - export interface ExecutionPlanOptions { - displayEstimatedQueryPlan?: boolean; - displayActualQueryPlan?: boolean; - } - - export interface SimpleExecuteParams { - queryString: string; - ownerUri: string; - } - - export interface SimpleExecuteResult { - rowCount: number; - columnInfo: IDbColumn[]; - rows: DbCellValue[][]; - } - - export interface SyntaxParseParams { - ownerUri: string; - query: string; - } - - export interface SyntaxParseResult { - parseable: boolean; - errors: string[]; - } - - // Query Batch Notification ----------------------------------------------------------------------- - export interface QueryExecuteBatchNotificationParams { - batchSummary: BatchSummary; - ownerUri: string; - } - - - export interface QueryExecuteResultSetNotificationParams { - resultSetSummary: ResultSetSummary; - ownerUri: string; - } - - - export interface QueryExecuteMessageParams { - message: IResultMessage; - ownerUri: string; - } - - export interface QueryExecuteSubsetParams { - ownerUri: string; - batchIndex: number; - resultSetIndex: number; - rowsStartIndex: number; - rowsCount: number; - } - - export interface DbCellValue { - displayValue: string; - isNull: boolean; - invariantCultureDisplayValue: string; - } - - export interface ResultSetSubset { - rowCount: number; - rows: DbCellValue[][]; - } - - export interface QueryExecuteSubsetResult { - message: string; - resultSubset: ResultSetSubset; - } - - export interface QueryCancelResult { - messages: string; - } - - // Save Results =============================================================================== - export interface SaveResultsRequestParams { - /** - * 'csv', 'json', 'excel', 'xml' - */ - resultFormat: string; - ownerUri: string; - filePath: string; - batchIndex: number; - resultSetIndex: number; - rowStartIndex: number; - rowEndIndex: number; - columnStartIndex: number; - columnEndIndex: number; - includeHeaders?: boolean; - delimiter?: string; - lineSeperator?: string; - textIdentifier?: string; - encoding?: string; - formatted?: boolean; - } - - export interface SaveResultRequestResult { - messages: string; - } - - // Edit Data ================================================================================== - // Shared Interfaces -------------------------------------------------------------------------- - export interface IEditSessionOperationParams { - ownerUri: string; - } - - export interface IEditRowOperationParams extends IEditSessionOperationParams { - rowId: number; - } - - export interface EditCellResult { - cell: EditCell; - isRowDirty: boolean; - } - - // edit/commit -------------------------------------------------------------------------------- - export interface EditCommitParams extends IEditSessionOperationParams { } - export interface EditCommitResult { } - - // edit/createRow ----------------------------------------------------------------------------- - export interface EditCreateRowParams extends IEditSessionOperationParams { } - export interface EditCreateRowResult { - defaultValues: string[]; - newRowId: number; - } - - // edit/deleteRow ----------------------------------------------------------------------------- - export interface EditDeleteRowParams extends IEditRowOperationParams { } - export interface EditDeleteRowResult { } - - // edit/dispose ------------------------------------------------------------------------------- - export interface EditDisposeParams extends IEditSessionOperationParams { } - export interface EditDisposeResult { } - - // edit/initialize ---------------------------------------------------------------------------- - export interface EditInitializeFiltering { - LimitResults?: number; - } - - export interface EditInitializeParams extends IEditSessionOperationParams { - filters: EditInitializeFiltering; - objectName: string; - schemaName: string; - objectType: string; - queryString: string; - } - - - export interface EditInitializeResult { } - - // edit/revertCell ---------------------------------------------------------------------------- - export interface EditRevertCellParams extends IEditRowOperationParams { - columnId: number; - } - export interface EditRevertCellResult extends EditCellResult { - } - - // edit/revertRow ----------------------------------------------------------------------------- - export interface EditRevertRowParams extends IEditRowOperationParams { } - export interface EditRevertRowResult { } - - // edit/sessionReady Event -------------------------------------------------------------------- - export interface EditSessionReadyParams { - ownerUri: string; - success: boolean; - message: string; - } - - // edit/updateCell ---------------------------------------------------------------------------- - export interface EditUpdateCellParams extends IEditRowOperationParams { - columnId: number; - newValue: string; - } - - export interface EditUpdateCellResult extends EditCellResult { - } - - // edit/subset -------------------------------------------------------------------------------- - export interface EditSubsetParams extends IEditSessionOperationParams { - rowStartIndex: number; - rowCount: number; - } - export interface EditSubsetResult { - rowCount: number; - subset: EditRow[]; - } - - /** - * A NodeInfo object represents an element in the Object Explorer tree under - * a connection. - */ - export interface NodeInfo { - nodePath: string; - nodeType: string; - nodeSubType: string; - nodeStatus: string; - label: string; - isLeaf: boolean; - metadata: ObjectMetadata; - errorMessage: string; - /** - * Optional iconType for the object in the tree. Currently this only supports - * an icon name or SqlThemeIcon name, rather than a path to an icon. - * If not defined, the nodeType + nodeStatus / nodeSubType values - * will be used instead. - */ - iconType?: string | SqlThemeIcon; - /** - * Informs who provides the children to a node, used by data explorer tree view api - */ - childProvider?: string; - /** - * Holds the connection profile for nodes, used by data explorer tree view api - */ - payload?: any; - } - - /** - * A reference to a named icon. Currently only a subset of the SQL icons are available. - * Using a theme icon is preferred over a custom icon as it gives theme authors the possibility to change the icons. - */ - export class SqlThemeIcon { - static readonly Folder: SqlThemeIcon; - static readonly Root: SqlThemeIcon; - static readonly Database: SqlThemeIcon; - static readonly Server: SqlThemeIcon; - static readonly ScalarValuedFunction: SqlThemeIcon; - static readonly TableValuedFunction: SqlThemeIcon; - static readonly AggregateFunction: SqlThemeIcon; - static readonly FileGroup: SqlThemeIcon; - static readonly StoredProcedure: SqlThemeIcon; - static readonly UserDefinedTableType: SqlThemeIcon; - static readonly View: SqlThemeIcon; - static readonly Table: SqlThemeIcon; - static readonly HistoryTable: SqlThemeIcon; - static readonly ServerLevelLinkedServerLogin: SqlThemeIcon; - static readonly ServerLevelServerAudit: SqlThemeIcon; - static readonly ServerLevelCryptographicProvider: SqlThemeIcon; - static readonly ServerLevelCredential: SqlThemeIcon; - static readonly ServerLevelServerRole: SqlThemeIcon; - static readonly ServerLevelLogin: SqlThemeIcon; - static readonly ServerLevelServerAuditSpecification: SqlThemeIcon; - static readonly ServerLevelServerTrigger: SqlThemeIcon; - static readonly ServerLevelLinkedServer: SqlThemeIcon; - static readonly ServerLevelEndpoint: SqlThemeIcon; - static readonly Synonym: SqlThemeIcon; - static readonly DatabaseTrigger: SqlThemeIcon; - static readonly Assembly: SqlThemeIcon; - static readonly MessageType: SqlThemeIcon; - static readonly Contract: SqlThemeIcon; - static readonly Queue: SqlThemeIcon; - static readonly Service: SqlThemeIcon; - static readonly Route: SqlThemeIcon; - static readonly DatabaseAndQueueEventNotification: SqlThemeIcon; - static readonly RemoteServiceBinding: SqlThemeIcon; - static readonly BrokerPriority: SqlThemeIcon; - static readonly FullTextCatalog: SqlThemeIcon; - static readonly FullTextStopList: SqlThemeIcon; - static readonly SqlLogFile: SqlThemeIcon; - static readonly PartitionFunction: SqlThemeIcon; - static readonly PartitionScheme: SqlThemeIcon; - static readonly SearchPropertyList: SqlThemeIcon; - static readonly User: SqlThemeIcon; - static readonly Schema: SqlThemeIcon; - static readonly AsymmetricKey: SqlThemeIcon; - static readonly Certificate: SqlThemeIcon; - static readonly SymmetricKey: SqlThemeIcon; - static readonly DatabaseEncryptionKey: SqlThemeIcon; - static readonly MasterKey: SqlThemeIcon; - static readonly DatabaseAuditSpecification: SqlThemeIcon; - static readonly Column: SqlThemeIcon; - static readonly Key: SqlThemeIcon; - static readonly Constraint: SqlThemeIcon; - static readonly Trigger: SqlThemeIcon; - static readonly Index: SqlThemeIcon; - static readonly Statistic: SqlThemeIcon; - static readonly UserDefinedDataType: SqlThemeIcon; - static readonly UserDefinedType: SqlThemeIcon; - static readonly XmlSchemaCollection: SqlThemeIcon; - static readonly SystemExactNumeric: SqlThemeIcon; - static readonly SystemApproximateNumeric: SqlThemeIcon; - static readonly SystemDateAndTime: SqlThemeIcon; - static readonly SystemCharacterString: SqlThemeIcon; - static readonly SystemUnicodeCharacterString: SqlThemeIcon; - static readonly SystemBinaryString: SqlThemeIcon; - static readonly SystemOtherDataType: SqlThemeIcon; - static readonly SystemClrDataType: SqlThemeIcon; - static readonly SystemSpatialDataType: SqlThemeIcon; - static readonly UserDefinedTableTypeColumn: SqlThemeIcon; - static readonly UserDefinedTableTypeKey: SqlThemeIcon; - static readonly UserDefinedTableTypeConstraint: SqlThemeIcon; - static readonly StoredProcedureParameter: SqlThemeIcon; - static readonly TableValuedFunctionParameter: SqlThemeIcon; - static readonly ScalarValuedFunctionParameter: SqlThemeIcon; - static readonly AggregateFunctionParameter: SqlThemeIcon; - static readonly DatabaseRole: SqlThemeIcon; - static readonly ApplicationRole: SqlThemeIcon; - static readonly FileGroupFile: SqlThemeIcon; - static readonly SystemMessageType: SqlThemeIcon; - static readonly SystemContract: SqlThemeIcon; - static readonly SystemService: SqlThemeIcon; - static readonly SystemQueue: SqlThemeIcon; - static readonly Sequence: SqlThemeIcon; - static readonly SecurityPolicy: SqlThemeIcon; - static readonly DatabaseScopedCredential: SqlThemeIcon; - static readonly ExternalResource: SqlThemeIcon; - static readonly ExternalDataSource: SqlThemeIcon; - static readonly ExternalFileFormat: SqlThemeIcon; - static readonly ExternalTable: SqlThemeIcon; - static readonly ColumnMasterKey: SqlThemeIcon; - static readonly ColumnEncryptionKey: SqlThemeIcon; - - private constructor(id: string); - - /** - * Gets the ID for the theme icon for help in cases where string comparison is needed - */ - public readonly id: string; - } - - // Object Explorer interfaces ----------------------------------------------------------------------- - export interface ObjectExplorerSession { - success: boolean; - sessionId: string; - rootNode: NodeInfo; - errorMessage: string; - } - - export interface ObjectExplorerSessionResponse { - sessionId: string; - } - - export interface ObjectExplorerExpandInfo { - sessionId: string; - nodePath: string; - nodes: NodeInfo[]; - errorMessage: string; - } - - export interface ExpandNodeInfo { - sessionId: string; - nodePath: string; - } - - export interface FindNodesInfo { - sessionId: string; - type: string; - schema: string; - name: string; - database: string; - parentObjectNames: string[]; - } - - export interface ObjectExplorerCloseSessionInfo { - sessionId: string; - } - - export interface ObjectExplorerCloseSessionResponse { - sessionId: string; - success: boolean; - } - - export interface ObjectExplorerFindNodesResponse { - nodes: NodeInfo[]; - } - - export interface ObjectExplorerProviderBase extends DataProvider { - expandNode(nodeInfo: ExpandNodeInfo): Thenable; - - refreshNode(nodeInfo: ExpandNodeInfo): Thenable; - - findNodes(findNodesInfo: FindNodesInfo): Thenable; - - registerOnExpandCompleted(handler: (response: ObjectExplorerExpandInfo) => any): void; - } - - export interface ObjectExplorerProvider extends ObjectExplorerProviderBase { - createNewSession(connInfo: ConnectionInfo): Thenable; - - closeSession(closeSessionInfo: ObjectExplorerCloseSessionInfo): Thenable; - - registerOnSessionCreated(handler: (response: ObjectExplorerSession) => any): void; - - registerOnSessionDisconnected?(handler: (response: ObjectExplorerSession) => any): void; - } - - export interface ObjectExplorerNodeProvider extends ObjectExplorerProviderBase { - /** - * The providerId for whichever type of ObjectExplorer connection this can add folders and objects to - */ - readonly supportedProviderId: string; - - /** - * Optional group name used to sort nodes in the tree. If not defined, the node order will be added in order based on provider ID, with - * nodes from the main ObjectExplorerProvider for this provider type added first - */ - readonly group?: string; - - handleSessionOpen(session: ObjectExplorerSession): Thenable; - - handleSessionClose(closeSessionInfo: ObjectExplorerCloseSessionInfo): void; - } - - // Admin Services interfaces ----------------------------------------------------------------------- - export interface DatabaseInfo { - options: {}; - } - - export interface LoginInfo { - name: string; - } - - export interface CreateDatabaseResponse { - result: boolean; - taskId: number; - } - - export interface CreateLoginResponse { - result: boolean; - taskId: number; - } - - export interface AdminServicesProvider extends DataProvider { - createDatabase(connectionUri: string, database: DatabaseInfo): Thenable; - - createLogin(connectionUri: string, login: LoginInfo): Thenable; - - getDefaultDatabaseInfo(connectionUri: string): Thenable; - - getDatabaseInfo(connectionUri: string): Thenable; - } - - export interface ResultStatus { - success: boolean; - errorMessage: string; - } - - // Security service interfaces ------------------------------------------------------------------------ - export interface CredentialInfo { - id: number; - identity: string; - name: string; - dateLastModified: string; - createDate: string; - providerName: string; - } - - export interface GetCredentialsResult extends ResultStatus { - credentials: CredentialInfo[]; - } - - // Task service interfaces ---------------------------------------------------------------------------- - export enum TaskStatus { - NotStarted = 0, - InProgress = 1, - Succeeded = 2, - SucceededWithWarning = 3, - Failed = 4, - Canceled = 5, - Canceling = 6 - } - - export enum TaskExecutionMode { - execute = 0, - script = 1, - executeAndScript = 2, - } - - export interface ListTasksParams { - listActiveTasksOnly: boolean; - } - - export interface TaskInfo { - connection?: connection.Connection; - taskId: string; - status: TaskStatus; - taskExecutionMode: TaskExecutionMode; - serverName: string; - databaseName: string; - name: string; - description: string; - providerName: string; - isCancelable: boolean; - } - - export interface ListTasksResponse { - tasks: TaskInfo[]; - } - - export interface CancelTaskParams { - taskId: string; - } - - export interface TaskProgressInfo { - taskId: string; - status: TaskStatus; - message: string; - script?: string; - } - - export interface TaskServicesProvider extends DataProvider { - getAllTasks(listTasksParams: ListTasksParams): Thenable; - - cancelTask(cancelTaskParams: CancelTaskParams): Thenable; - - registerOnTaskCreated(handler: (response: TaskInfo) => any): void; - - registerOnTaskStatusChanged(handler: (response: TaskProgressInfo) => any): void; - } - - - // File browser interfaces ----------------------------------------------------------------------- - - export interface FileBrowserProvider extends DataProvider { - openFileBrowser(ownerUri: string, expandPath: string, fileFilters: string[], changeFilter: boolean): Thenable; - registerOnFileBrowserOpened(handler: (response: FileBrowserOpenedParams) => any): void; - expandFolderNode(ownerUri: string, expandPath: string): Thenable; - registerOnFolderNodeExpanded(handler: (response: FileBrowserExpandedParams) => any): void; - validateFilePaths(ownerUri: string, serviceType: string, selectedFiles: string[]): Thenable; - registerOnFilePathsValidated(handler: (response: FileBrowserValidatedParams) => any): void; - closeFileBrowser(ownerUri: string): Thenable; - } - - export interface FileTreeNode { - children: FileTreeNode[]; - isExpanded: boolean; - isFile: boolean; - name: string; - fullPath: string; - } - - export interface FileTree { - rootNode: FileTreeNode; - selectedNode: FileTreeNode; - } - - export interface FileBrowserOpenedParams { - ownerUri: string; - fileTree: FileTree; - succeeded: boolean; - message: string; - } - - export interface FileBrowserExpandedParams { - ownerUri: string; - expandPath: string; - children: FileTreeNode[]; - succeeded: boolean; - message: string; - } - - export interface FileBrowserValidatedParams { - succeeded: boolean; - message: string; - } - - export interface FileBrowserCloseResponse { - succeeded: boolean; - message: string; - } - - export enum AzureResource { - ResourceManagement = 0, - Sql = 1 - } - - export interface ModalDialog { - /** - * Title of the webview. - */ - title: string; - - /** - * Contents of the dialog body. - */ - html: string; - - /** - * The caption of the OK button. - */ - okTitle: string; - - /** - * The caption of the Close button. - */ - closeTitle: string; - - /** - * Opens the dialog. - */ - open(): void; - - /** - * Closes the dialog. - */ - close(): void; - - /** - * Raised when the webview posts a message. - */ - readonly onMessage: vscode.Event; - - /** - * Raised when dialog closed. - */ - readonly onClosed: vscode.Event; - - /** - * Post a message to the dialog. - * - * @param message Body of the message. - */ - postMessage(message: any): Thenable; - } - - export interface DashboardWebview { - - /** - * Raised when the webview posts a message. - */ - readonly onMessage: vscode.Event; - - /** - * Raised when the webview closed. - */ - readonly onClosed: vscode.Event; - - /** - * Post a message to the webview. - * - * @param message Body of the message. - */ - postMessage(message: any): Thenable; - - /** - * The connection info for the dashboard the webview exists on - */ - readonly connection: connection.Connection; - - /** - * The info on the server for the webview dashboard - */ - readonly serverInfo: ServerInfo; - - /** - * Contents of the dialog body. - */ - html: string; - } - - export namespace dashboard { - /** - * Register a provider for a webview widget - */ - export function registerWebviewProvider(widgetId: string, handler: (webview: DashboardWebview) => void): void; - } - - export namespace window { - /** - * @deprecated this method has been deprecated and will be removed in a future release, please use sqlops.window.createWebViewDialog instead. - */ - export function createDialog( - title: string - ): ModalDialog; - } - - export namespace workspace { - /** - * An event that is emitted when a [dashboard](#DashboardDocument) is opened. - */ - export const onDidOpenDashboard: vscode.Event; - - /** - * An event that is emitted when a [dashboard](#DashboardDocument) is focused. - */ - export const onDidChangeToDashboard: vscode.Event; - } - - export interface DashboardDocument { - profile: IConnectionProfile; - serverInfo: ServerInfo; - } - - export class TreeItem extends vscode.TreeItem { - payload?: IConnectionProfile; - childProvider?: string; - } - - export namespace tasks { - - export interface ITaskHandler { - (profile: IConnectionProfile, ...args: any[]): any; - } - - /** - * Registers a task that can be invoked via a keyboard shortcut, - * a menu item, an action, or directly. - * - * Registering a task with an existing task identifier twice - * will cause an error. - * - * @param task A unique identifier for the task. - * @param callback A task handler function. - * @param thisArg The `this` context used when invoking the handler function. - * @return Disposable which unregisters this task on disposal. - */ - export function registerTask(task: string, callback: ITaskHandler, thisArg?: any): vscode.Disposable; - } -} diff --git a/src/sql/sqlops.proposed.d.ts b/src/sql/sqlops.proposed.d.ts deleted file mode 100644 index eb7ae05fc5..0000000000 --- a/src/sql/sqlops.proposed.d.ts +++ /dev/null @@ -1,1828 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the Source EULA. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -// This is the place for API experiments and proposal. - -import * as core from 'sqlops'; -import * as vscode from 'vscode'; - -declare module 'sqlops' { - - /** - * Supports defining a model that can be instantiated as a view in the UI - * @export - */ - export interface ModelBuilder { - navContainer(): ContainerBuilder; - divContainer(): DivBuilder; - flexContainer(): FlexBuilder; - dom(): ComponentBuilder; - card(): ComponentBuilder; - inputBox(): ComponentBuilder; - checkBox(): ComponentBuilder; - radioButton(): ComponentBuilder; - webView(): ComponentBuilder; - editor(): ComponentBuilder; - text(): ComponentBuilder; - image(): ComponentBuilder; - button(): ComponentBuilder; - dropDown(): ComponentBuilder; - tree(): ComponentBuilder>; - listBox(): ComponentBuilder; - table(): ComponentBuilder; - declarativeTable(): ComponentBuilder; - dashboardWidget(widgetId: string): ComponentBuilder; - dashboardWebview(webviewId: string): ComponentBuilder; - formContainer(): FormBuilder; - groupContainer(): GroupBuilder; - toolbarContainer(): ToolbarBuilder; - loadingComponent(): LoadingComponentBuilder; - fileBrowserTree(): ComponentBuilder; - hyperlink(): ComponentBuilder; - } - - export interface TreeComponentDataProvider extends vscode.TreeDataProvider { - getTreeItem(element: T): TreeComponentItem | Thenable; - } - - export interface NodeCheckedEventParameters { - element: T; - checked: boolean; - } - - export interface TreeComponentView extends vscode.Disposable { - onNodeCheckedChanged: vscode.Event>; - onDidChangeSelection: vscode.Event>; - } - - export class TreeComponentItem extends vscode.TreeItem { - checked?: boolean; - enabled?: boolean; - } - - export interface ComponentBuilder { - component(): T; - withProperties(properties: U): ComponentBuilder; - withValidation(validation: (component: T) => boolean): ComponentBuilder; - } - - export interface ContainerBuilder extends ComponentBuilder { - withLayout(layout: TLayout): ContainerBuilder; - withItems(components: Array, itemLayout?: TItemLayout): ContainerBuilder; - } - - export interface FlexBuilder extends ContainerBuilder { - - } - - export interface DivBuilder extends ContainerBuilder { - - } - - export interface GroupBuilder extends ContainerBuilder { - } - - export interface ToolbarBuilder extends ContainerBuilder { - withToolbarItems(components: ToolbarComponent[]): ContainerBuilder; - - /** - * Creates a collection of child components and adds them all to this container - * - * @param toolbarComponents the definitions - */ - addToolbarItems(toolbarComponents: Array): void; - - /** - * Creates a child component and adds it to this container. - * - * @param toolbarComponent the component to be added - */ - addToolbarItem(toolbarComponent: ToolbarComponent): void; - } - - export interface LoadingComponentBuilder extends ComponentBuilder { - /** - * Set the component wrapped by the LoadingComponent - * @param component The component to wrap - */ - withItem(component: Component): LoadingComponentBuilder; - } - - export interface FormBuilder extends ContainerBuilder { - withFormItems(components: (FormComponent | FormComponentGroup)[], itemLayout?: FormItemLayout): FormBuilder; - - /** - * Creates a collection of child components and adds them all to this container - * - * @param formComponents the definitions - * @param [itemLayout] Optional layout for the child items - */ - addFormItems(formComponents: Array, itemLayout?: FormItemLayout): void; - - /** - * Creates a child component and adds it to this container. - * - * @param formComponent the component to be added - * @param [itemLayout] Optional layout for this child item - */ - addFormItem(formComponent: FormComponent | FormComponentGroup, itemLayout?: FormItemLayout): void; - - /** - * Inserts a from component in a given position in the form. Returns error given invalid index - * @param formComponent Form component - * @param index index to insert the component to - * @param itemLayout Item Layout - */ - insertFormItem(formComponent: FormComponent | FormComponentGroup, index?: number, itemLayout?: FormItemLayout): void; - - /** - * Removes a from item from the from - */ - removeFormItem(formComponent: FormComponent | FormComponentGroup): boolean; - } - - export interface Component extends ComponentProperties { - readonly id: string; - - /** - * Sends any updated properties of the component to the UI - * - * @returns henable that completes once the update - * has been applied in the UI - */ - updateProperties(properties: { [key: string]: any }): Thenable; - - /** - * Sends an updated property of the component to the UI - * - * @returns Thenable that completes once the update - * has been applied in the UI - */ - updateProperty(key: string, value: any): Thenable; - - /** - * Updates the specified CSS Styles and notifies the UI - * @param cssStyles The styles to update - * @returns Thenable that completes once the update has been applied to the UI - */ - updateCssStyles(cssStyles: { [key: string]: string }): Thenable; - - /** - * Event fired to notify that the component's validity has changed - */ - readonly onValidityChanged: vscode.Event; - - /** - * Whether the component is valid or not - */ - readonly valid: boolean; - - /** - * Run the component's validations - */ - validate(): Thenable; - - /** - * Focuses the component. - */ - focus(): Thenable; - } - - export interface FormComponent { - component: Component; - title: string; - actions?: Component[]; - required?: boolean; - } - - /** - * Used to create a group of components in a form layout - */ - export interface FormComponentGroup { - /** - * The form components to display in the group along with optional layouts for each item - */ - components: (FormComponent & { layout?: FormItemLayout })[]; - - /** - * The title of the group, displayed above its components - */ - title: string; - } - - export interface ToolbarComponent { - component: Component; - title?: string; - } - - /** - * A component that contains other components - */ - export interface Container extends Component { - /** - * A copy of the child items array. This cannot be added to directly - - * components must be created using the create methods instead - */ - readonly items: Component[]; - - /** - * Removes all child items from this container - */ - clearItems(): void; - /** - * Creates a collection of child components and adds them all to this container - * - * @param itemConfigs the definitions - * @param [itemLayout] Optional layout for the child items - */ - addItems(itemConfigs: Array, itemLayout?: TItemLayout): void; - - /** - * Creates a child component and adds it to this container. - * Adding component to multiple containers is not supported - * - * @param component the component to be added - * @param [itemLayout] Optional layout for this child item - */ - addItem(component: Component, itemLayout?: TItemLayout): void; - - /** - * Creates a child component and inserts it to this container. Returns error given invalid index - * Adding component to multiple containers is not supported - * @param component the component to be added - * @param index the index to insert the component to - * @param [itemLayout] Optional layout for this child item - */ - insertItem(component: Component, index: number, itemLayout?: TItemLayout): void; - - /** - * - * @param component Removes a component from this container - */ - removeItem(component: Component): boolean; - - /** - * Defines the layout for this container - * - * @param layout object - */ - setLayout(layout: TLayout): void; - } - - export interface NavContainer extends Container { - - } - - /** - * Valid values for the align-items CSS property - */ - export type AlignItemsType = 'normal' | 'stretch' | 'center' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'baseline' | 'first baseline' | 'last baseline' | 'safe center' | 'unsafe center' | 'inherit' | 'initial' | 'unset'; - /** - * Valid values for the justify-content CSS property - */ - export type JustifyContentType = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'initial' | 'inherit'; - /** - * Valid values for the align-content CSS property - */ - export type AlignContentType = 'stretch' | 'center' | 'flex-start' | 'flex-end' | 'space-between' | 'space-around' | 'initial' | 'inherit'; - /** - * Valid values for flex-wrap CSS property - */ - export type FlexWrapType = 'nowrap' | 'wrap' | 'wrap-reverse'; - /** - * Valid values for the text-align CSS property - */ - export type TextAlignType = 'left' | 'right' | 'center' | 'justify' | 'initial' | 'inherit'; - /** - * Valid values for the position CSS property - */ - export type PositionType = 'static' | 'absolute' | 'fixed' | 'relative' | 'sticky' | 'initial' | 'inherit'; - /** - * Valid values for the display CSS property - */ - export type DisplayType = 'inline' | 'block' | 'contents' | 'flex' | 'grid' | 'inline-block' | 'inline-flex' | 'inline-grid' | 'inline-table' | 'list-item' | 'run-in' | 'table' | 'table-caption' | ' table-column-group' | 'table-header-group' | 'table-footer-group' | 'table-row-group' | 'table-cell' | 'table-column' | 'table-row' | 'none' | 'initial' | 'inherit' | ''; - - /** - * The config for a FlexBox-based container. This supports easy - * addition of content to a container with a flexible layout - * and use of space. - */ - export interface FlexLayout { - /** - * Matches the flex-flow CSS property and its available values. - * To layout as a vertical view use "column", and for horizontal - * use "row". - */ - flexFlow?: string; - /** - * Matches the justify-content CSS property. - */ - justifyContent?: JustifyContentType; - /** - * Matches the align-items CSS property. - */ - alignItems?: AlignItemsType; - /** - * Matches the align-content CSS property. - */ - alignContent?: AlignContentType; - - /** - * Container Height - */ - height?: number | string; - - /** - * Container Width - */ - width?: number | string; - - /** - * - */ - textAlign?: TextAlignType; - - /** - * The position CSS property. Empty by default. - * This is particularly useful if laying out components inside a FlexContainer and - * the size of the component is meant to be a fixed size. In this case the position must be - * set to 'absolute', with the parent FlexContainer having 'relative' position. - * Without this the component will fail to correctly size itself. - */ - position?: PositionType; - } - - export interface FlexItemLayout { - /** - * Matches the order CSS property and its available values. - */ - order?: number; - /** - * Matches the flex CSS property and its available values. - * Default is "1 1 auto". - */ - flex?: string; - /** - * Matches the CSS style key and its available values. - */ - CSSStyles?: { [key: string]: string }; - } - - export interface FormItemLayout { - horizontal?: boolean; - componentWidth?: number | string; - componentHeight?: number | string; - titleFontSize?: number | string; - info?: string; - } - - export interface FormLayout { - width?: number | string; - height?: number | string; - padding?: string; - } - - export interface GroupLayout { - width?: number | string; - header?: string; - collapsible?: boolean; - collapsed?: boolean; - } - - export interface GroupItemLayout { - } - - export interface DivLayout { - /** - * Container Height - */ - height?: number | string; - - /** - * Container Width - */ - width?: number | string; - } - - export interface DivItemLayout { - /** - * Matches the order CSS property and its available values. - */ - order?: number; - - /** - * Matches the CSS style key and its available values. - */ - CSSStyles?: { [key: string]: string }; - } - - export interface DivContainer extends Container, DivContainerProperties { - } - - export interface FlexContainer extends Container { - } - - export interface FormContainer extends Container { - } - - export interface GroupContainer extends Container { - } - - - export enum Orientation { - Horizontal = 'horizontal', - Vertical = 'vertial' - } - - export interface ToolbarLayout { - orientation: Orientation; - } - export interface ToolbarContainer extends Container { - } - - /** - * Describes an action to be shown in the UI, with a user-readable label - * and a callback to execute the action - */ - export interface ActionDescriptor { - /** - * User-visible label to display - */ - label: string; - /** - * Name of the clickable action. If not defined then no action will be shown - */ - actionTitle?: string; - /** - * Data sent on callback being run. - */ - callbackData?: any; - } - - /** - * Defines status indicators that can be shown to the user as part of - * components such as the Card UI - */ - export enum StatusIndicator { - None = 0, - Ok = 1, - Warning = 2, - Error = 3 - } - - export enum CardType { - VerticalButton = 'VerticalButton', - Details = 'Details', - ListItem = 'ListItem' - } - - /** - * Properties representing the card component, can be used - * when using ModelBuilder to create the component - */ - export interface CardProperties extends ComponentWithIcon { - label: string; - value?: string; - actions?: ActionDescriptor[]; - descriptions?: CardDescriptionItem[]; - status?: StatusIndicator; - - /** - * Returns true if the card is selected - */ - selected?: boolean; - - /** - * Card Type, default: Details - */ - cardType?: CardType; - } - - export interface CardDescriptionItem { - label: string; - value?: string; - } - - export type InputBoxInputType = 'color' | 'date' | 'datetime-local' | 'email' | 'month' | 'number' | 'password' | 'range' | 'search' | 'text' | 'time' | 'url' | 'week'; - - export interface ComponentProperties { - height?: number | string; - width?: number | string; - /** - * The position CSS property. Empty by default. - * This is particularly useful if laying out components inside a FlexContainer and - * the size of the component is meant to be a fixed size. In this case the position must be - * set to 'absolute', with the parent FlexContainer having 'relative' position. - * Without this the component will fail to correctly size itself - */ - position?: PositionType; - /** - * Whether the component is enabled in the DOM - */ - enabled?: boolean; - /** - * Corresponds to the display CSS property for the element - */ - display?: DisplayType; - /** - * Matches the CSS style key and its available values. - */ - CSSStyles?: { [key: string]: string }; - } - - export interface ComponentWithIcon { - iconPath?: string | vscode.Uri | { light: string | vscode.Uri; dark: string | vscode.Uri }; - iconHeight?: number | string; - iconWidth?: number | string; - } - - export interface InputBoxProperties extends ComponentProperties { - value?: string; - ariaLabel?: string; - placeHolder?: string; - inputType?: InputBoxInputType; - required?: boolean; - multiline?: boolean; - rows?: number; - columns?: number; - min?: number; - max?: number; - /** - * Whether to stop key event propagation when enter is pressed in the input box. Leaving this as false - * means the event will propagate up to any parents that have handlers (such as validate on Dialogs) - */ - stopEnterPropagation?: boolean; - } - - export interface TableColumn { - value: string; - width?: number; - cssClass?: string; - toolTip?: string; - } - - export interface TableComponentProperties extends ComponentProperties { - data: any[][]; - columns: string[] | TableColumn[]; - fontSize?: number | string; - selectedRows?: number[]; - } - - export interface FileBrowserTreeProperties extends ComponentProperties { - ownerUri: string; - } - - export interface CheckBoxProperties { - checked?: boolean; - label?: string; - } - - export interface TreeProperties extends ComponentProperties { - withCheckbox?: boolean; - } - - export enum DeclarativeDataType { - string = 'string', - category = 'category', - boolean = 'boolean', - editableCategory = 'editableCategory', - component = 'component' - } - - export interface RadioButtonProperties { - name?: string; - label?: string; - value?: string; - checked?: boolean; - } - - export interface TextComponentProperties extends ComponentProperties, TitledComponentProperties { - value?: string; - links?: LinkArea[]; - } - - export interface ImageComponentProperties extends ComponentProperties, ComponentWithIcon { - - } - - export interface LinkArea { - text: string; - url: string; - } - - export interface HyperlinkComponentProperties extends ComponentProperties, TitledComponentProperties { - label: string; - url: string; - } - - export interface DropDownProperties extends ComponentProperties { - value?: string | CategoryValue; - values?: string[] | CategoryValue[]; - editable?: boolean; - fireOnTextChange?: boolean; - } - - export interface DeclarativeTableColumn { - displayName: string; - valueType: DeclarativeDataType; - isReadOnly: boolean; - width: number | string; - categoryValues?: CategoryValue[]; - } - - export interface DeclarativeTableProperties { - data: any[][]; - columns: DeclarativeTableColumn[]; - } - - export interface ListBoxProperties { - selectedRow?: number; - values?: string[]; - - } - - export interface WebViewProperties extends ComponentProperties { - message?: any; - - /** - * Contents of the webview. - * - * Should be a complete html document. - */ - html?: string; - /** - * Content settings for the webview. - */ - options?: vscode.WebviewOptions; - } - - export interface DomProperties extends ComponentProperties { - /** - * Contents of the DOM component. - */ - html?: string; - } - - /** - * Editor properties for the editor component - */ - export interface EditorProperties extends ComponentProperties { - /** - * The content inside the text editor - */ - content?: string; - /** - * The languge mode for this text editor. The language mode is SQL by default. - */ - languageMode?: string; - /** - * Minimum height for editor component - */ - minimumHeight?: number; - } - - export interface ButtonProperties extends ComponentProperties, ComponentWithIcon { - /** - * The label for the button - */ - label?: string; - /** - * Whether the button opens the file browser dialog - */ - isFile?: boolean; - /** - * The content of the currently selected file - */ - fileContent?: string; - /** - * The title for the button. This title will show when hovered over - */ - title?: string; - fileType?: string; - } - - export interface LoadingComponentProperties { - loading?: boolean; - } - - export interface DivContainerProperties extends ComponentProperties { - /** - * Matches the overflow-y CSS property and its available values. - */ - overflowY?: string; - - /** - * Setting the scroll based on the y offset - * This is used when its child component is webview - */ - yOffsetChange?: number; - } - - export interface TitledComponentProperties { - /** - * The title for the component. This title will show when hovered over - */ - title?: string; - } - - export interface CardComponent extends Component, CardProperties { - onDidActionClick: vscode.Event; - onCardSelectedChanged: vscode.Event; - } - - export interface DomComponent extends Component, DomProperties { - - } - - export interface TextComponent extends Component, TextComponentProperties { - - } - - export interface ImageComponent extends Component, ImageComponentProperties { - - } - - export interface HyperlinkComponent extends Component, HyperlinkComponentProperties { - /** - * An event called when the text is clicked - */ - onDidClick: vscode.Event; - } - - export interface InputBoxComponent extends Component, InputBoxProperties { - onTextChanged: vscode.Event; - /** - * Event that's fired whenever enter is pressed within the input box - */ - onEnterKeyPressed: vscode.Event; - } - - export interface RadioButtonComponent extends Component, RadioButtonProperties { - onDidClick: vscode.Event; - } - - export interface CheckBoxComponent extends Component, CheckBoxProperties { - onChanged: vscode.Event; - } - - export interface DropDownComponent extends Component, DropDownProperties { - onValueChanged: vscode.Event; - } - - export interface TableCell { - row: number; - column: number; - value: any; - } - - export interface DeclarativeTableComponent extends Component, DeclarativeTableProperties { - onDataChanged: vscode.Event; - } - - export interface ListBoxComponent extends Component, ListBoxProperties { - onRowSelected: vscode.Event; - } - - export interface TableComponent extends Component, TableComponentProperties { - onRowSelected: vscode.Event; - } - - export interface FileBrowserTreeComponent extends Component, FileBrowserTreeProperties { - onDidChange: vscode.Event; - } - - export interface TreeComponent extends Component, TreeProperties { - registerDataProvider(dataProvider: TreeComponentDataProvider): TreeComponentView; - } - - export interface WebViewComponent extends Component { - html: string; - message: any; - onMessage: vscode.Event; - readonly options: vscode.WebviewOptions; - } - - /** - * Editor component for displaying the text code editor - */ - export interface EditorComponent extends Component { - /** - * The content inside the text editor - */ - content: string; - /** - * The languge mode for this text editor. The language mode is SQL by default. - */ - languageMode: string; - /** - * The editor Uri which will be used as a reference for VSCode Language Service. - * Currently this is auto-generated by the framework but can be queried after - * view initialization is completed - */ - readonly editorUri: string; - /** - * An event called when the editor content is updated - */ - readonly onContentChanged: vscode.Event; - - /** - * An event called when the editor is created - */ - readonly onEditorCreated: vscode.Event; - - /** - * Toggle for whether the editor should be automatically resized or not - */ - isAutoResizable: boolean; - - /** - * Minimum height for editor component - */ - minimumHeight: number; - - } - - export interface ButtonComponent extends Component, ButtonProperties { - /** - * An event called when the button is clicked - */ - onDidClick: vscode.Event; - } - - export interface DashboardWidgetComponent extends Component { - widgetId: string; - } - - export interface DashboardWebviewComponent extends Component { - webviewId: string; - } - - /** - * Component used to wrap another component that needs to be loaded, and show a loading spinner - * while the contained component is loading - */ - export interface LoadingComponent extends Component { - /** - * Whether to show the loading spinner instead of the contained component. True by default - */ - loading: boolean; - - /** - * The component displayed when the loading property is false - */ - component: Component; - } - - /** - * A view backed by a model provided by an extension. - * This model contains enough information to lay out the view - */ - export interface ModelView { - /** - * Raised when the view closed. - */ - readonly onClosed: vscode.Event; - - /** - * The connection info for the dashboard the webview exists on - */ - readonly connection: connection.Connection; - - /** - * The info on the server for the dashboard - */ - readonly serverInfo: ServerInfo; - - /** - * The model backing the model-based view - */ - readonly modelBuilder: ModelBuilder; - - /** - * Whether or not the model view's root component is valid - */ - readonly valid: boolean; - - /** - * Raised when the model view's valid property changes - */ - readonly onValidityChanged: vscode.Event; - - /** - * Run the model view root component's validations - */ - validate(): Thenable; - - /** - * Initializes the model with a root component definition. - * Once this has been done, the components will be laid out in the UI and - * can be accessed and altered as needed. - */ - initializeModel(root: T): Thenable; - } - - export namespace ui { - /** - * Register a provider for a model-view widget - */ - export function registerModelViewProvider(widgetId: string, handler: (view: ModelView) => void): void; - } - - export namespace window { - /** - * @deprecated this namespace has been deprecated and will be removed in a future release, please use the methods under sqlops.window namespace. - */ - export namespace modelviewdialog { - /** - * Create a dialog with the given title - * @param title The title of the dialog, displayed at the top - */ - export function createDialog(title: string, dialogName?: string): Dialog; - - /** - * Create a dialog tab which can be included as part of the content of a dialog - * @param title The title of the page, displayed on the tab to select the page - */ - export function createTab(title: string): DialogTab; - - /** - * Create a button which can be included in a dialog - * @param label The label of the button - */ - export function createButton(label: string): Button; - - /** - * Opens the given dialog if it is not already open - */ - export function openDialog(dialog: Dialog): void; - - /** - * Closes the given dialog if it is open - */ - export function closeDialog(dialog: Dialog): void; - - /** - * Create a wizard page with the given title, for inclusion in a wizard - * @param title The title of the page - */ - export function createWizardPage(title: string): WizardPage; - - /** - * Create a wizard with the given title and pages - * @param title The title of the wizard - */ - export function createWizard(title: string): Wizard; - - /** - * Used to control whether a message in a dialog/wizard is displayed as an error, - * warning, or informational message. Default is error. - */ - export enum MessageLevel { - Error = 0, - Warning = 1, - Information = 2 - } - - /** - * A message shown in a dialog. If the level is not set it defaults to error. - */ - export type DialogMessage = { - readonly text: string, - readonly description?: string, - readonly level?: MessageLevel - }; - - export interface ModelViewPanel { - /** - * Register model view content for the dialog. - * Doesn't do anything if model view is already registered - */ - registerContent(handler: (view: ModelView) => Thenable): void; - - /** - * Returns the model view content if registered. Returns undefined if model review is not registered - */ - readonly modelView: ModelView; - - /** - * Whether the panel's content is valid - */ - readonly valid: boolean; - - /** - * Fired whenever the panel's valid property changes - */ - readonly onValidityChanged: vscode.Event; - } - - // Model view dialog classes - export interface Dialog extends ModelViewPanel { - /** - * The title of the dialog - */ - title: string; - - /** - * The content of the dialog. If multiple tabs are given they will be displayed with tabs - * If a string is given, it should be the ID of the dialog's model view content - */ - content: string | DialogTab[]; - - /** - * The ok button - */ - okButton: Button; - - /** - * The cancel button - */ - cancelButton: Button; - - /** - * Any additional buttons that should be displayed - */ - customButtons: Button[]; - - /** - * Set the informational message shown in the dialog. Hidden when the message is - * undefined or the text is empty or undefined. The default level is error. - */ - message: DialogMessage; - - /** - * Set the dialog name when opening - * the dialog for telemetry - */ - dialogName?: string; - - /** - * Register a callback that will be called when the user tries to click done. Only - * one callback can be registered at once, so each registration call will clear - * the previous registration. - * @param validator The callback that gets executed when the user tries to click - * done. Return true to allow the dialog to close or false to block it from closing - */ - registerCloseValidator(validator: () => boolean | Thenable): void; - - /** - * Register an operation to run in the background when the dialog is done - * @param operationInfo Operation Information - */ - registerOperation(operationInfo: BackgroundOperationInfo): void; - } - - export interface DialogTab extends ModelViewPanel { - /** - * The title of the tab - */ - title: string; - - /** - * A string giving the ID of the tab's model view content - */ - content: string; - } - - export interface Button { - /** - * The label displayed on the button - */ - label: string; - - /** - * Whether the button is enabled - */ - enabled: boolean; - - /** - * Whether the button is hidden - */ - hidden: boolean; - - /** - * Raised when the button is clicked - */ - readonly onClick: vscode.Event; - } - - export interface WizardPageChangeInfo { - /** - * The page number that the wizard changed from - */ - lastPage: number; - - /** - * The new page number or undefined if the user is closing the wizard - */ - newPage: number; - } - - export interface WizardPage extends ModelViewPanel { - /** - * The title of the page - */ - title: string; - - /** - * A string giving the ID of the page's model view content - */ - content: string; - - /** - * Any additional buttons that should be displayed while the page is open - */ - customButtons: Button[]; - - /** - * Whether the page is enabled. If the page is not enabled, the user will not be - * able to advance to it. Defaults to true. - */ - enabled: boolean; - - /** - * An optional description for the page. If provided it will be displayed underneath the page title. - */ - description: string; - } - - export interface Wizard { - /** - * The title of the wizard - */ - title: string; - - /** - * The wizard's pages. Pages can be added/removed while the dialog is open by using - * the addPage and removePage methods - */ - pages: WizardPage[]; - - /** - * The index in the pages array of the active page, or undefined if the wizard is - * not currently visible - */ - readonly currentPage: number; - - /** - * The done button - */ - doneButton: Button; - - /** - * The cancel button - */ - cancelButton: Button; - - /** - * The generate script button - */ - generateScriptButton: Button; - - /** - * The next button - */ - nextButton: Button; - - /** - * The back button - */ - backButton: Button; - - /** - * Any additional buttons that should be displayed for all pages of the dialog. If - * buttons are needed for specific pages they can be added using the customButtons - * property on each page. - */ - customButtons: Button[]; - - /** - * When set to false page titles and descriptions will not be displayed at the top - * of each wizard page. The default is true. - */ - displayPageTitles: boolean; - - /** - * Event fired when the wizard's page changes, containing information about the - * previous page and the new page - */ - onPageChanged: vscode.Event; - - /** - * Add a page to the wizard at the given index - * @param page The page to add - * @param index The index in the pages array to add the page at, or undefined to - * add it at the end - */ - addPage(page: WizardPage, index?: number): Thenable; - - /** - * Remove the page at the given index from the wizard - * @param index The index in the pages array to remove - */ - removePage(index: number): Thenable; - - /** - * Go to the page at the given index in the pages array. - * @param index The index of the page to go to - */ - setCurrentPage(index: number): Thenable; - - /** - * Open the wizard. Does nothing if the wizard is already open. - */ - open(): Thenable; - - /** - * Close the wizard. Does nothing if the wizard is not open. - */ - close(): Thenable; - - /** - * Register a callback that will be called when the user tries to navigate by - * changing pages or clicking done. Only one callback can be registered at once, so - * each registration call will clear the previous registration. - * @param validator The callback that gets executed when the user tries to - * navigate. Return true to allow the navigation to proceed, or false to - * cancel it. - */ - registerNavigationValidator(validator: (pageChangeInfo: WizardPageChangeInfo) => boolean | Thenable): void; - - /** - * Set the informational message shown in the wizard. Hidden when the message is - * undefined or the text is empty or undefined. The default level is error. - */ - message: DialogMessage; - - /** - * Register an operation to run in the background when the wizard is done - * @param operationInfo Operation Information - */ - registerOperation(operationInfo: BackgroundOperationInfo): void; - } - } - - /** - * creates a web view dialog - */ - export function createWebViewDialog(title: string): ModalDialog; - - /** - * Create a dialog with the given title - * @param title The title of the dialog, displayed at the top - */ - export function createModelViewDialog(title: string, dialogName?: string): Dialog; - - /** - * Create a dialog tab which can be included as part of the content of a dialog - * @param title The title of the page, displayed on the tab to select the page - */ - export function createTab(title: string): DialogTab; - - /** - * Create a button which can be included in a dialog - * @param label The label of the button - */ - export function createButton(label: string): Button; - - /** - * Opens the given dialog if it is not already open - */ - export function openDialog(dialog: Dialog): void; - - /** - * Closes the given dialog if it is open - */ - export function closeDialog(dialog: Dialog): void; - - /** - * Create a wizard page with the given title, for inclusion in a wizard - * @param title The title of the page - */ - export function createWizardPage(title: string): WizardPage; - - /** - * Create a wizard with the given title and pages - * @param title The title of the wizard - */ - export function createWizard(title: string): Wizard; - - /** - * Used to control whether a message in a dialog/wizard is displayed as an error, - * warning, or informational message. Default is error. - */ - export enum MessageLevel { - Error = 0, - Warning = 1, - Information = 2 - } - - /** - * A message shown in a dialog. If the level is not set it defaults to error. - */ - export type DialogMessage = { - readonly text: string, - readonly description?: string, - readonly level?: MessageLevel - }; - - export interface ModelViewPanel { - /** - * Register model view content for the dialog. - * Doesn't do anything if model view is already registered - */ - registerContent(handler: (view: ModelView) => Thenable): void; - - /** - * Returns the model view content if registered. Returns undefined if model review is not registered - */ - readonly modelView: ModelView; - - /** - * Whether the panel's content is valid - */ - readonly valid: boolean; - - /** - * Fired whenever the panel's valid property changes - */ - readonly onValidityChanged: vscode.Event; - } - - // Model view dialog classes - export interface Dialog extends ModelViewPanel { - /** - * The title of the dialog - */ - title: string; - - /** - * The content of the dialog. If multiple tabs are given they will be displayed with tabs - * If a string is given, it should be the ID of the dialog's model view content - */ - content: string | DialogTab[]; - - /** - * The ok button - */ - okButton: Button; - - /** - * The cancel button - */ - cancelButton: Button; - - /** - * Any additional buttons that should be displayed - */ - customButtons: Button[]; - - /** - * Set the informational message shown in the dialog. Hidden when the message is - * undefined or the text is empty or undefined. The default level is error. - */ - message: DialogMessage; - - /** - * Set the dialog name when opening - * the dialog for telemetry - */ - dialogName?: string; - - /** - * Register a callback that will be called when the user tries to click done. Only - * one callback can be registered at once, so each registration call will clear - * the previous registration. - * @param validator The callback that gets executed when the user tries to click - * done. Return true to allow the dialog to close or false to block it from closing - */ - registerCloseValidator(validator: () => boolean | Thenable): void; - - /** - * Register an operation to run in the background when the dialog is done - * @param operationInfo Operation Information - */ - registerOperation(operationInfo: BackgroundOperationInfo): void; - } - - export interface DialogTab extends ModelViewPanel { - /** - * The title of the tab - */ - title: string; - - /** - * A string giving the ID of the tab's model view content - */ - content: string; - } - - export interface Button { - /** - * The label displayed on the button - */ - label: string; - - /** - * Whether the button is enabled - */ - enabled: boolean; - - /** - * Whether the button is hidden - */ - hidden: boolean; - - /** - * Raised when the button is clicked - */ - readonly onClick: vscode.Event; - } - - export interface WizardPageChangeInfo { - /** - * The page number that the wizard changed from - */ - lastPage: number; - - /** - * The new page number or undefined if the user is closing the wizard - */ - newPage: number; - } - - export interface WizardPage extends ModelViewPanel { - /** - * The title of the page - */ - title: string; - - /** - * A string giving the ID of the page's model view content - */ - content: string; - - /** - * Any additional buttons that should be displayed while the page is open - */ - customButtons: Button[]; - - /** - * Whether the page is enabled. If the page is not enabled, the user will not be - * able to advance to it. Defaults to true. - */ - enabled: boolean; - - /** - * An optional description for the page. If provided it will be displayed underneath the page title. - */ - description: string; - } - - export interface Wizard { - /** - * The title of the wizard - */ - title: string; - - /** - * The wizard's pages. Pages can be added/removed while the dialog is open by using - * the addPage and removePage methods - */ - pages: WizardPage[]; - - /** - * The index in the pages array of the active page, or undefined if the wizard is - * not currently visible - */ - readonly currentPage: number; - - /** - * The done button - */ - doneButton: Button; - - /** - * The cancel button - */ - cancelButton: Button; - - /** - * The generate script button - */ - generateScriptButton: Button; - - /** - * The next button - */ - nextButton: Button; - - /** - * The back button - */ - backButton: Button; - - /** - * Any additional buttons that should be displayed for all pages of the dialog. If - * buttons are needed for specific pages they can be added using the customButtons - * property on each page. - */ - customButtons: Button[]; - - /** - * When set to false page titles and descriptions will not be displayed at the top - * of each wizard page. The default is true. - */ - displayPageTitles: boolean; - - /** - * Event fired when the wizard's page changes, containing information about the - * previous page and the new page - */ - onPageChanged: vscode.Event; - - /** - * Add a page to the wizard at the given index - * @param page The page to add - * @param index The index in the pages array to add the page at, or undefined to - * add it at the end - */ - addPage(page: WizardPage, index?: number): Thenable; - - /** - * Remove the page at the given index from the wizard - * @param index The index in the pages array to remove - */ - removePage(index: number): Thenable; - - /** - * Go to the page at the given index in the pages array. - * @param index The index of the page to go to - */ - setCurrentPage(index: number): Thenable; - - /** - * Open the wizard. Does nothing if the wizard is already open. - */ - open(): Thenable; - - /** - * Close the wizard. Does nothing if the wizard is not open. - */ - close(): Thenable; - - /** - * Register a callback that will be called when the user tries to navigate by - * changing pages or clicking done. Only one callback can be registered at once, so - * each registration call will clear the previous registration. - * @param validator The callback that gets executed when the user tries to - * navigate. Return true to allow the navigation to proceed, or false to - * cancel it. - */ - registerNavigationValidator(validator: (pageChangeInfo: WizardPageChangeInfo) => boolean | Thenable): void; - - /** - * Set the informational message shown in the wizard. Hidden when the message is - * undefined or the text is empty or undefined. The default level is error. - */ - message: DialogMessage; - - /** - * Register an operation to run in the background when the wizard is done - * @param operationInfo Operation Information - */ - registerOperation(operationInfo: BackgroundOperationInfo): void; - } - } - - /** - * Namespace for interacting with query editor - */ - export namespace queryeditor { - - /** - * Make connection for the query editor - * @param fileUri file URI for the query editor - * @param connectionId connection ID - */ - export function connect(fileUri: string, connectionId: string): Thenable; - - /** - * Run query if it is a query editor and it is already opened. - * @param fileUri file URI for the query editor - */ - export function runQuery(fileUri: string): void; - } - - /** - * Namespace for interacting with the workspace - */ - export namespace workspace { - - /** - * Create a new model view editor - */ - export function createModelViewEditor(title: string, options?: ModelViewEditorOptions): ModelViewEditor; - - export interface ModelViewEditor extends window.ModelViewPanel { - /** - * `true` if there are unpersisted changes. - * This is editable to support extensions updating the dirty status. - */ - isDirty: boolean; - - /** - * Opens the editor - */ - openEditor(position?: vscode.ViewColumn): Thenable; - - /** - * Registers a save handler for this editor. This will be called if [supportsSave](#ModelViewEditorOptions.supportsSave) - * is set to true and the editor is marked as dirty - */ - registerSaveHandler(handler: () => Thenable): void; - } - } - - export interface ModelViewEditorOptions { - /** - * Should the model view editor's context be kept around even when the editor is no longer visible? It is false by default - */ - readonly retainContextWhenHidden?: boolean; - - /** - * Does this model view editor support save? - */ - readonly supportsSave?: boolean; - } - - export enum DataProviderType { - ConnectionProvider = 'ConnectionProvider', - BackupProvider = 'BackupProvider', - RestoreProvider = 'RestoreProvider', - ScriptingProvider = 'ScriptingProvider', - ObjectExplorerProvider = 'ObjectExplorerProvider', - TaskServicesProvider = 'TaskServicesProvider', - FileBrowserProvider = 'FileBrowserProvider', - ProfilerProvider = 'ProfilerProvider', - MetadataProvider = 'MetadataProvider', - QueryProvider = 'QueryProvider', - AdminServicesProvider = 'AdminServicesProvider', - AgentServicesProvider = 'AgentServicesProvider', - CapabilitiesProvider = 'CapabilitiesProvider', - ObjectExplorerNodeProvider = 'ObjectExplorerNodeProvider', - IconProvider = 'IconProvider', - SerializationProvider = 'SerializationProvider' - } - - export namespace dataprotocol { - /** - * Get the provider corresponding to the given provider ID and type - * @param providerId The ID that the provider was registered with - * @param providerType The type of the provider - */ - export function getProvider(providerId: string, providerType: DataProviderType): T; - - /** - * Get all registered providers of the given type - * @param providerType The type of the providers - */ - export function getProvidersByType(providerType: DataProviderType): T[]; - } - - /** - * Context object passed as an argument to command callbacks. - * Defines the key properties required to identify a node in the object - * explorer tree and take action against it. - */ - export interface ObjectExplorerContext { - - /** - * The connection information for the selected object. - * Note that the connection is not guaranteed to be in a connected - * state on click. - */ - connectionProfile: IConnectionProfile; - /** - * Defines whether this is a Connection-level object. - * If not, the object is expected to be a child object underneath - * one of the connections. - */ - isConnectionNode: boolean; - /** - * Node info for objects below a specific connection. This - * may be null for a Connection-level object - */ - nodeInfo: NodeInfo; - } - - /** - * Background Operation - */ - export interface BackgroundOperation { - /** - * Updates the operation status or adds progress message - * @param status Operation Status - * @param message Progress message - */ - updateStatus(status: TaskStatus, message?: string): void; - - /** - * Operation Id - */ - id: string; - - /** - * Event raised when operation is canceled in UI - */ - onCanceled: vscode.Event; - } - - /** - * Operation Information - */ - export interface BackgroundOperationInfo { - - /** - * The operation id. A unique id will be assigned to it If not specified a - */ - operationId?: string; - /** - * Connection information - */ - connection?: connection.Connection; - - /** - * Operation Display Name - */ - displayName: string; - - /** - * Operation Description - */ - description: string; - - /** - * True if the operation is cancelable - */ - isCancelable: boolean; - - /** - * The actual operation to execute - */ - operation: (operation: BackgroundOperation) => void; - } - - namespace tasks { - /** - * Starts an operation to run in the background - * @param operationInfo Operation Information - */ - export function startBackgroundOperation(operationInfo: BackgroundOperationInfo): void; - - } - - export interface ConnectionResult { - connected: boolean; - connectionId: string; - errorMessage: string; - errorCode: number; - } - - export namespace connection { - /** - * List the databases that can be accessed from the given connection - * @param connectionId The ID of the connection - * @returns An list of names of databases - */ - export function listDatabases(connectionId: string): Thenable; - - /** - * Get a URI corresponding to the given connection so that it can be used with data - * providers and other APIs that require a connection API. - * Note: If the given connection corresponds to multiple URIs this may return any of them - * @param connectionId The ID of the connection - */ - export function getUriForConnection(connectionId: string): Thenable; - - /** - * Opens the connection dialog, calls the callback with the result. If connection was successful - * returns the connection otherwise returns undefined - */ - export function openConnectionDialog(providers?: string[], initialConnectionProfile?: IConnectionProfile, connectionCompletionOptions?: IConnectionCompletionOptions): Thenable; - - /** - * Opens the connection and add it to object explorer and opens the dashboard and returns the ConnectionResult - * @param connectionProfile connection profile - */ - export function connect(connectionProfile: IConnectionProfile, saveConnection?: boolean, showDashboard?: boolean): Thenable; - } - - /* - * Add OssRdbms for sqlops AzureResource. - */ - export enum AzureResource { - OssRdbms = 2 - } -} diff --git a/src/sql/sqlops.test.d.ts b/src/sql/sqlops.test.d.ts deleted file mode 100644 index f340ef34e4..0000000000 --- a/src/sql/sqlops.test.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the Source EULA. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -// This is the place for APIs used for testing - -import * as core from 'sqlops'; -import * as vscode from 'vscode'; - -declare module 'sqlops' { - - export namespace extensions { - export function install(vsixPath: string): Thenable; - } - - export namespace objectexplorer { - /** - * get object explorer node context menu actions - */ - export function getNodeActions(connectionId: string, nodePath: string): Thenable; - } -} diff --git a/src/sql/workbench/api/common/extHostRequireInterceptor.ts b/src/sql/workbench/api/common/extHostRequireInterceptor.ts index 998fd92b8f..14681be5b6 100644 --- a/src/sql/workbench/api/common/extHostRequireInterceptor.ts +++ b/src/sql/workbench/api/common/extHostRequireInterceptor.ts @@ -8,8 +8,7 @@ import { URI } from 'vs/base/common/uri'; import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import * as azdata from 'azdata'; -import * as sqlops from 'sqlops'; -import { IAzdataExtensionApiFactory, ISqlopsExtensionApiFactory } from 'sql/workbench/api/common/sqlExtHost.api.impl'; +import { IAzdataExtensionApiFactory } from 'sql/workbench/api/common/sqlExtHost.api.impl'; import { INodeModuleFactory } from 'vs/workbench/api/common/extHostRequireInterceptor'; export class AzdataNodeModuleFactory implements INodeModuleFactory { @@ -47,39 +46,3 @@ export class AzdataNodeModuleFactory implements INodeModuleFactory { return this._defaultApiImpl; } } - -export class SqlopsNodeModuleFactory implements INodeModuleFactory { - public readonly nodeModuleName = 'sqlops'; - - private readonly _extApiImpl = new Map(); - private _defaultApiImpl: typeof sqlops; - - constructor( - private readonly _apiFactory: ISqlopsExtensionApiFactory, - private readonly _extensionPaths: TernarySearchTree - ) { - } - - public load(request: string, parent: URI): any { - - // get extension id from filename and api for extension - const ext = this._extensionPaths.findSubstr(parent.fsPath); - if (ext) { - let apiImpl = this._extApiImpl.get(ExtensionIdentifier.toKey(ext.identifier)); - if (!apiImpl) { - apiImpl = this._apiFactory(ext); - this._extApiImpl.set(ExtensionIdentifier.toKey(ext.identifier), apiImpl); - } - return apiImpl; - } - - // fall back to a default implementation - if (!this._defaultApiImpl) { - let extensionPathsPretty = ''; - this._extensionPaths.forEach((value, index) => extensionPathsPretty += `\t${index} -> ${value.identifier.value}\n`); - console.warn(`Could not identify extension for 'sqlops' require call from ${parent.fsPath}. These are the extension path mappings: \n${extensionPathsPretty}`); - this._defaultApiImpl = this._apiFactory(nullExtensionDescription); - } - return this._defaultApiImpl; - } -} diff --git a/src/sql/workbench/api/common/sqlExtHost.api.impl.ts b/src/sql/workbench/api/common/sqlExtHost.api.impl.ts index ead95ea925..a92ab2ae0b 100644 --- a/src/sql/workbench/api/common/sqlExtHost.api.impl.ts +++ b/src/sql/workbench/api/common/sqlExtHost.api.impl.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import * as azdata from 'azdata'; -import * as sqlops from 'sqlops'; import * as vscode from 'vscode'; import { SqlExtHostContext } from 'sql/workbench/api/common/sqlExtHost.protocol'; import { ExtHostAccountManagement } from 'sql/workbench/api/common/extHostAccountManagement'; @@ -29,40 +28,32 @@ import { ExtHostExtensionManagement } from 'sql/workbench/api/common/extHostExte import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; import { mssqlProviderName } from 'sql/platform/connection/common/constants'; -import { localize } from 'vs/nls'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IURITransformerService } from 'vs/workbench/api/common/extHostUriTransformerService'; import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService'; import { ILogService } from 'vs/platform/log/common/log'; import { IExtensionApiFactory as vsIApiFactory, createApiFactoryAndRegisterActors as vsApiFactory } from 'vs/workbench/api/common/extHost.api.impl'; -export interface ISqlopsExtensionApiFactory { - (extension: IExtensionDescription): typeof sqlops; -} - export interface IAzdataExtensionApiFactory { (extension: IExtensionDescription): typeof azdata; } export interface IExtensionApiFactory { azdata: IAzdataExtensionApiFactory; - sqlops: ISqlopsExtensionApiFactory; vscode: vsIApiFactory; } export interface IAdsExtensionApiFactory { azdata: IAzdataExtensionApiFactory; - sqlops: ISqlopsExtensionApiFactory; } /** * This method instantiates and returns the extension API surface */ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): IExtensionApiFactory { - const { azdata, sqlops } = createAdsApiFactory(accessor); + const { azdata } = createAdsApiFactory(accessor); return { azdata, - sqlops, vscode: vsApiFactory(accessor) }; } @@ -70,7 +61,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I export interface IAdsExtensionApiFactory { azdata: IAzdataExtensionApiFactory; - sqlops: ISqlopsExtensionApiFactory; } /** @@ -561,371 +551,6 @@ export function createAdsApiFactory(accessor: ServicesAccessor): IAdsExtensionAp ColumnSizingMode: sqlExtHostTypes.ColumnSizingMode, DatabaseEngineEdition: sqlExtHostTypes.DatabaseEngineEdition }; - }, - - // "sqlops" namespace provided for back-compat only, add new interfaces to "azdata" - sqlops: function (extension: IExtensionDescription): typeof sqlops { - - extHostExtensionManagement.$showObsoleteExtensionApiUsageNotification(localize('ObsoleteApiModuleMessage', "The extension \"{0}\" is using sqlops module which has been replaced by azdata module, the sqlops module will be removed in a future release.", extension.identifier.value)); - // namespace: connection - const connection: typeof sqlops.connection = { - getActiveConnections(): Thenable { - return extHostConnectionManagement.$getActiveConnections(); - }, - getCurrentConnection(): Thenable { - return extHostConnectionManagement.$getSqlOpsCurrentConnection(); - }, - getCredentials(connectionId: string): Thenable<{ [name: string]: string }> { - return extHostConnectionManagement.$getCredentials(connectionId); - }, - getServerInfo(connectionId: string): Thenable { - return extHostConnectionManagement.$getServerInfo(connectionId); - }, - openConnectionDialog(providers?: string[], initialConnectionProfile?: sqlops.IConnectionProfile, connectionCompletionOptions?: sqlops.IConnectionCompletionOptions): Thenable { - return extHostConnectionManagement.$openConnectionDialog(providers, initialConnectionProfile, connectionCompletionOptions); - }, - listDatabases(connectionId: string): Thenable { - return extHostConnectionManagement.$listDatabases(connectionId); - }, - getConnectionString(connectionId: string, includePassword: boolean): Thenable { - return extHostConnectionManagement.$getConnectionString(connectionId, includePassword); - }, - getUriForConnection(connectionId: string): Thenable { - return extHostConnectionManagement.$getUriForConnection(connectionId); - }, - connect(connectionProfile: sqlops.IConnectionProfile, saveConnection: boolean, showDashboard: boolean): Thenable { - return extHostConnectionManagement.$connect(connectionProfile, saveConnection, showDashboard); - } - }; - - // namespace: credentials - const credentials: typeof sqlops.credentials = { - registerProvider(provider: sqlops.CredentialProvider): vscode.Disposable { - return extHostCredentialManagement.$registerCredentialProvider(provider); - }, - getProvider(namespaceId: string): Thenable { - return extHostCredentialManagement.$getCredentialProvider(namespaceId); - } - }; - - // namespace: objectexplorer - const objectExplorer: typeof sqlops.objectexplorer = { - getNode(connectionId: string, nodePath?: string): Thenable { - return extHostObjectExplorer.$getNode(connectionId, nodePath); - }, - getActiveConnectionNodes(): Thenable { - return extHostObjectExplorer.$getActiveConnectionNodes(); - }, - findNodes(connectionId: string, type: string, schema: string, name: string, database: string, parentObjectNames: string[]): Thenable { - return extHostObjectExplorer.$findNodes(connectionId, type, schema, name, database, parentObjectNames); - }, - getNodeActions(connectionId: string, nodePath: string): Thenable { - return extHostObjectExplorer.$getNodeActions(connectionId, nodePath); - }, - getSessionConnectionProfile(sessionId: string): Thenable { - return extHostObjectExplorer.$getSessionConnectionProfile(sessionId); - } - }; - - // namespace: serialization - const serialization: typeof sqlops.serialization = { - registerProvider(provider: sqlops.SerializationProvider): vscode.Disposable { - // No-op this to avoid breaks in existing applications. Tested on Github - no examples, - // but I think it's safer to avoid breaking this - return undefined; - }, - }; - - - let registerConnectionProvider = (provider: sqlops.ConnectionProvider): vscode.Disposable => { - // Connection callbacks - provider.registerOnConnectionComplete((connSummary: sqlops.ConnectionInfoSummary) => { - extHostDataProvider.$onConnectComplete(provider.handle, connSummary); - }); - - provider.registerOnIntelliSenseCacheComplete((connectionUri: string) => { - extHostDataProvider.$onIntelliSenseCacheComplete(provider.handle, connectionUri); - }); - - provider.registerOnConnectionChanged((changedConnInfo: sqlops.ChangedConnectionInfo) => { - extHostDataProvider.$onConnectionChanged(provider.handle, changedConnInfo); - }); - - return extHostDataProvider.$registerConnectionProvider(provider); - }; - - let registerQueryProvider = (provider: sqlops.QueryProvider): vscode.Disposable => { - provider.registerOnQueryComplete((result: sqlops.QueryExecuteCompleteNotificationResult) => { - extHostDataProvider.$onQueryComplete(provider.handle, result); - }); - - provider.registerOnBatchStart((batchInfo: sqlops.QueryExecuteBatchNotificationParams) => { - extHostDataProvider.$onBatchStart(provider.handle, batchInfo); - }); - - provider.registerOnBatchComplete((batchInfo: sqlops.QueryExecuteBatchNotificationParams) => { - extHostDataProvider.$onBatchComplete(provider.handle, batchInfo); - }); - - provider.registerOnResultSetAvailable((resultSetInfo: sqlops.QueryExecuteResultSetNotificationParams) => { - extHostDataProvider.$onResultSetAvailable(provider.handle, resultSetInfo); - }); - - provider.registerOnResultSetUpdated((resultSetInfo: sqlops.QueryExecuteResultSetNotificationParams) => { - extHostDataProvider.$onResultSetUpdated(provider.handle, resultSetInfo); - }); - - provider.registerOnMessage((message: sqlops.QueryExecuteMessageParams) => { - extHostDataProvider.$onQueryMessage(provider.handle, message); - }); - - provider.registerOnEditSessionReady((ownerUri: string, success: boolean, message: string) => { - extHostDataProvider.$onEditSessionReady(provider.handle, ownerUri, success, message); - }); - - return extHostDataProvider.$registerQueryProvider(provider); - }; - - let registerObjectExplorerProvider = (provider: sqlops.ObjectExplorerProvider): vscode.Disposable => { - provider.registerOnSessionCreated((response: sqlops.ObjectExplorerSession) => { - extHostDataProvider.$onObjectExplorerSessionCreated(provider.handle, response); - }); - - if (provider.registerOnSessionDisconnected) { - provider.registerOnSessionDisconnected((response: sqlops.ObjectExplorerSession) => { - extHostDataProvider.$onObjectExplorerSessionDisconnected(provider.handle, response); - }); - } - - provider.registerOnExpandCompleted((response: sqlops.ObjectExplorerExpandInfo) => { - extHostDataProvider.$onObjectExplorerNodeExpanded(provider.providerId, response); - }); - - return extHostDataProvider.$registerObjectExplorerProvider(provider); - }; - - let registerObjectExplorerNodeProvider = (provider: sqlops.ObjectExplorerNodeProvider): vscode.Disposable => { - provider.registerOnExpandCompleted((response: sqlops.ObjectExplorerExpandInfo) => { - extHostDataProvider.$onObjectExplorerNodeExpanded(provider.providerId, response); - }); - - return extHostDataProvider.$registerObjectExplorerNodeProvider(provider); - }; - - let registerTaskServicesProvider = (provider: sqlops.TaskServicesProvider): vscode.Disposable => { - provider.registerOnTaskCreated((response: sqlops.TaskInfo) => { - extHostDataProvider.$onTaskCreated(provider.handle, response); - }); - - provider.registerOnTaskStatusChanged((response: sqlops.TaskProgressInfo) => { - extHostDataProvider.$onTaskStatusChanged(provider.handle, response); - }); - - return extHostDataProvider.$registerTaskServicesProvider(provider); - }; - - let registerFileBrowserProvider = (provider: sqlops.FileBrowserProvider): vscode.Disposable => { - provider.registerOnFileBrowserOpened((response: sqlops.FileBrowserOpenedParams) => { - extHostDataProvider.$onFileBrowserOpened(provider.handle, response); - }); - - provider.registerOnFolderNodeExpanded((response: sqlops.FileBrowserExpandedParams) => { - extHostDataProvider.$onFolderNodeExpanded(provider.handle, response); - }); - - provider.registerOnFilePathsValidated((response: sqlops.FileBrowserValidatedParams) => { - extHostDataProvider.$onFilePathsValidated(provider.handle, response); - }); - - return extHostDataProvider.$registerFileBrowserProvider(provider); - }; - - let registerScriptingProvider = (provider: sqlops.ScriptingProvider): vscode.Disposable => { - provider.registerOnScriptingComplete((response: sqlops.ScriptingCompleteResult) => { - extHostDataProvider.$onScriptingComplete(provider.handle, response); - }); - - return extHostDataProvider.$registerScriptingProvider(provider); - }; - - let registerMetadataProvider = (provider: sqlops.MetadataProvider): vscode.Disposable => { - return extHostDataProvider.$registerMetadataProvider(provider); - }; - - let registerCapabilitiesServiceProvider = (provider: sqlops.CapabilitiesProvider): vscode.Disposable => { - return extHostDataProvider.$registerCapabilitiesServiceProvider(provider); - }; - - let registerAdminServicesProvider = (provider: sqlops.AdminServicesProvider): vscode.Disposable => { - return extHostDataProvider.$registerAdminServicesProvider(provider); - }; - - - // namespace: dataprotocol - const dataprotocol: typeof sqlops.dataprotocol = { - registerConnectionProvider, - registerFileBrowserProvider, - registerMetadataProvider, - registerObjectExplorerProvider, - registerObjectExplorerNodeProvider, - registerScriptingProvider, - registerTaskServicesProvider, - registerQueryProvider, - registerAdminServicesProvider, - registerCapabilitiesServiceProvider, - onDidChangeLanguageFlavor(listener: (e: sqlops.DidChangeLanguageFlavorParams) => any, thisArgs?: any, disposables?: extHostTypes.Disposable[]) { - return extHostDataProvider.onDidChangeLanguageFlavor(listener, thisArgs, disposables); - }, - getProvider(providerId: string, providerType: sqlops.DataProviderType) { - return extHostDataProvider.getProvider(providerId, providerType); - }, - getProvidersByType(providerType: sqlops.DataProviderType) { - return extHostDataProvider.getProvidersByType(providerType); - } - }; - - const modelViewDialog: typeof sqlops.window.modelviewdialog = { - createDialog(title: string, dialogName?: string): sqlops.window.modelviewdialog.Dialog { - console.warn('the method sqlops.window.modelviewdialog.createDialog has been deprecated, replace it with azdata.window.createModelViewDialog'); - return extHostModelViewDialog.createDialog(title, dialogName, extension); - }, - createTab(title: string): sqlops.window.modelviewdialog.DialogTab { - console.warn('the method sqlops.window.modelviewdialog.createTab has been deprecated, replace it with azdata.window.createTab'); - return extHostModelViewDialog.createTab(title, extension); - }, - createButton(label: string): sqlops.window.modelviewdialog.Button { - console.warn('the method sqlops.window.modelviewdialog.createButton has been deprecated, replace it with azdata.window.createButton'); - return extHostModelViewDialog.createButton(label); - }, - openDialog(dialog: sqlops.window.modelviewdialog.Dialog) { - console.warn('the method sqlops.window.modelviewdialog.openDialog has been deprecated, replace it with azdata.window.openDialog'); - return extHostModelViewDialog.openDialog(dialog as azdata.window.Dialog); - }, - closeDialog(dialog: sqlops.window.modelviewdialog.Dialog) { - console.warn('the method sqlops.window.modelviewdialog.closeDialog has been deprecated, replace it with azdata.window.closeDialog'); - return extHostModelViewDialog.closeDialog(dialog as azdata.window.Dialog); - }, - createWizardPage(title: string): sqlops.window.modelviewdialog.WizardPage { - console.warn('the method sqlops.window.modelviewdialog.createWizardPage has been deprecated, replace it with azdata.window.createWizardPage'); - return extHostModelViewDialog.createWizardPage(title); - }, - createWizard(title: string): sqlops.window.modelviewdialog.Wizard { - console.warn('the method sqlops.window.modelviewdialog.createWizard has been deprecated, replace it with azdata.window.createWizard'); - return extHostModelViewDialog.createWizard(title); - }, - MessageLevel: sqlExtHostTypes.MessageLevel - }; - - const window: typeof sqlops.window = { - createDialog(name: string) { - console.warn('the method sqlops.window.createDialog has been deprecated, replace it with azdata.window.createWebViewDialog'); - return extHostModalDialogs.createDialog(name); - }, - modelviewdialog: modelViewDialog, - createWebViewDialog(name: string) { - return extHostModalDialogs.createDialog(name); - }, - createModelViewDialog(title: string, dialogName?: string): sqlops.window.Dialog { - return extHostModelViewDialog.createDialog(title, dialogName, extension); - }, - createTab(title: string): sqlops.window.DialogTab { - return extHostModelViewDialog.createTab(title, extension); - }, - createButton(label: string): sqlops.window.Button { - return extHostModelViewDialog.createButton(label); - }, - openDialog(dialog: sqlops.window.Dialog) { - return extHostModelViewDialog.openDialog(dialog as azdata.window.Dialog); - }, - closeDialog(dialog: sqlops.window.Dialog) { - return extHostModelViewDialog.closeDialog(dialog as azdata.window.Dialog); - }, - createWizardPage(title: string): sqlops.window.WizardPage { - return extHostModelViewDialog.createWizardPage(title); - }, - createWizard(title: string): sqlops.window.Wizard { - return extHostModelViewDialog.createWizard(title); - }, - MessageLevel: sqlExtHostTypes.MessageLevel - }; - - const tasks: typeof sqlops.tasks = { - registerTask(id: string, task: (...args: any[]) => any, thisArgs?: any): vscode.Disposable { - return extHostTasks.registerTask(id, task, thisArgs); - }, - startBackgroundOperation(operationInfo: sqlops.BackgroundOperationInfo): void { - extHostBackgroundTaskManagement.$registerTask(operationInfo); - } - }; - - const workspace: typeof sqlops.workspace = { - onDidOpenDashboard: extHostDashboard.onDidOpenDashboard, - onDidChangeToDashboard: extHostDashboard.onDidChangeToDashboard, - createModelViewEditor(title: string, options?: sqlops.ModelViewEditorOptions): sqlops.workspace.ModelViewEditor { - return extHostModelViewDialog.createModelViewEditor(title, extension, options); - } - }; - - const dashboard = { - registerWebviewProvider(widgetId: string, handler: (webview: sqlops.DashboardWebview) => void) { - extHostWebviewWidgets.$registerProvider(widgetId, handler); - } - }; - - const ui = { - registerModelViewProvider(modelViewId: string, handler: (view: sqlops.ModelView) => void): void { - extHostModelView.$registerProvider(modelViewId, handler, extension); - } - }; - - // namespace: queryeditor - const queryEditor: typeof sqlops.queryeditor = { - - connect(fileUri: string, connectionId: string): Thenable { - return extHostQueryEditor.$connect(fileUri, connectionId); - }, - - runQuery(fileUri: string): void { - extHostQueryEditor.$runQuery(fileUri); - } - }; - - const extensions: typeof sqlops.extensions = { - install(vsixPath: string): Thenable { - return extHostExtensionManagement.$install(vsixPath); - } - }; - - return { - connection, - credentials, - objectexplorer: objectExplorer, - serialization, - dataprotocol, - DataProviderType: sqlExtHostTypes.DataProviderType, - DeclarativeDataType: sqlExtHostTypes.DeclarativeDataType, - ServiceOptionType: sqlExtHostTypes.ServiceOptionType, - ConnectionOptionSpecialType: sqlExtHostTypes.ConnectionOptionSpecialType, - EditRowState: sqlExtHostTypes.EditRowState, - MetadataType: sqlExtHostTypes.MetadataType, - TaskStatus: sqlExtHostTypes.TaskStatus, - TaskExecutionMode: sqlExtHostTypes.TaskExecutionMode, - ScriptOperation: sqlExtHostTypes.ScriptOperation, - window, - tasks, - dashboard, - workspace, - queryeditor: queryEditor, - ui: ui, - StatusIndicator: sqlExtHostTypes.StatusIndicator, - CardType: sqlExtHostTypes.CardType, - Orientation: sqlExtHostTypes.Orientation, - SqlThemeIcon: sqlExtHostTypes.SqlThemeIcon, - TreeComponentItem: sqlExtHostTypes.TreeComponentItem, - AzureResource: sqlExtHostTypes.AzureResource, - extensions: extensions, - TreeItem: sqlExtHostTypes.TreeItem - }; } }; } diff --git a/src/sql/workbench/contrib/objectExplorer/common/treeNode.ts b/src/sql/workbench/contrib/objectExplorer/common/treeNode.ts index 6e0172bbef..d947309427 100644 --- a/src/sql/workbench/contrib/objectExplorer/common/treeNode.ts +++ b/src/sql/workbench/contrib/objectExplorer/common/treeNode.ts @@ -5,7 +5,7 @@ import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; import { NodeType, SqlThemeIcon } from 'sql/workbench/contrib/objectExplorer/common/nodeType'; -import * as azdata from 'sqlops'; +import * as azdata from 'azdata'; import * as UUID from 'vs/base/common/uuid'; import { URI } from 'vs/base/common/uri'; diff --git a/src/vs/workbench/api/common/extHostRequireInterceptor.ts b/src/vs/workbench/api/common/extHostRequireInterceptor.ts index 67209e8096..8892a492b7 100644 --- a/src/vs/workbench/api/common/extHostRequireInterceptor.ts +++ b/src/vs/workbench/api/common/extHostRequireInterceptor.ts @@ -20,7 +20,7 @@ import { IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensi import { platform } from 'vs/base/common/process'; import { ILogService } from 'vs/platform/log/common/log'; -import { AzdataNodeModuleFactory, SqlopsNodeModuleFactory } from 'sql/workbench/api/common/extHostRequireInterceptor'; // {{SQL CARBON EDIT}} +import { AzdataNodeModuleFactory } from 'sql/workbench/api/common/extHostRequireInterceptor'; // {{SQL CARBON EDIT}} import { IExtensionApiFactory as sqlIApiFactory } from 'sql/workbench/api/common/sqlExtHost.api.impl'; // {{SQL CARBON EDIT}} @@ -61,7 +61,6 @@ export abstract class RequireInterceptor { this.register(new VSCodeNodeModuleFactory(this._apiFactory.vscode, extensionPaths, this._extensionRegistry, configProvider, this._logService)); // {{SQL CARBON EDIT}} // add node module this.register(new AzdataNodeModuleFactory(this._apiFactory.azdata, extensionPaths)); // {{SQL CARBON EDIT}} // add node module - this.register(new SqlopsNodeModuleFactory(this._apiFactory.sqlops, extensionPaths)); // {{SQL CARBON EDIT}} // add node module this.register(this._instaService.createInstance(KeytarNodeModuleFactory)); if (this._initData.remote.isRemote) { this.register(this._instaService.createInstance(OpenNodeModuleFactory, extensionPaths, this._initData.environment.appUriScheme));