/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import { createMainContextProxyIdentifier as createMainId, createExtHostContextProxyIdentifier as createExtId, ProxyIdentifier, IRPCProtocol } from 'vs/workbench/services/extensions/node/proxyIdentifier'; import URI, { UriComponents } from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; import { IDisposable } from 'vs/base/common/lifecycle'; import * as sqlops from 'sqlops'; import * as vscode from 'vscode'; import { ITreeComponentItem } from 'sql/workbench/common/views'; import { ITaskHandlerDescription } from 'sql/platform/tasks/common/tasks'; import { IItemConfig, ModelComponentTypes, IComponentShape, IModelViewDialogDetails, IModelViewTabDetails, IModelViewButtonDetails, IModelViewWizardDetails, IModelViewWizardPageDetails, INotebookManagerDetails, INotebookSessionDetails, INotebookKernelDetails, INotebookFutureDetails, FutureMessageType, INotebookFutureDone } from 'sql/workbench/api/common/sqlExtHostTypes'; import { EditorViewColumn } from 'vs/workbench/api/shared/editor'; export abstract class ExtHostAccountManagementShape { $autoOAuthCancelled(handle: number): Thenable { throw ni(); } $clear(handle: number, accountKey: sqlops.AccountKey): Thenable { throw ni(); } $getSecurityToken(account: sqlops.Account, resource?: sqlops.AzureResource): Thenable<{}> { throw ni(); } $initialize(handle: number, restoredAccounts: sqlops.Account[]): Thenable { throw ni(); } $prompt(handle: number): Thenable { throw ni(); } $refresh(handle: number, account: sqlops.Account): Thenable { throw ni(); } $accountsChanged(handle: number, accounts: sqlops.Account[]): Thenable { throw ni(); } } export abstract class ExtHostConnectionManagementShape { $onConnectionOpened(handleId: string, connection: sqlops.connection.Connection): void { throw ni; } } export abstract class ExtHostDataProtocolShape { /** * Establish a connection to a data source using the provided ConnectionInfo instance. */ $connect(handle: number, connectionUri: string, connection: sqlops.ConnectionInfo): Thenable { throw ni(); } /** * Disconnect from a data source using the provided connectionUri string. */ $disconnect(handle: number, connectionUri: string): Thenable { throw ni(); } /** * Cancel a connection to a data source using the provided connectionUri string. */ $cancelConnect(handle: number, connectionUri: string): Thenable { throw ni(); } /** * Change the database for the connection. */ $changeDatabase(handle: number, connectionUri: string, newDatabase: string): Thenable { throw ni(); } /** * List databases for a data source using the provided connectionUri string. * @param handle the handle to use when looking up a provider * @param connectionUri URI identifying a connected resource */ $listDatabases(handle: number, connectionUri: string): Thenable { throw ni(); } /** * Get the connection string for the connection specified by connectionUri * @param handle the handle to use when looking up a provider * @param connectionUri URI identifying a connected resource */ $getConnectionString(handle: number, connectionUri: string, includePassword: boolean): Thenable { throw ni(); } /** * Serialize connection string * @param handle the handle to use when looking up a provider * @param connectionString the connection string to serialize */ $buildConnectionInfo(handle: number, connectionString: string): Thenable { throw ni(); } /** * Notifies all listeners on the Extension Host side that a language change occurred * for a dataprotocol language. The sub-flavor is the specific implementation used for query * and other events * @param params information on what URI was changed and the new language */ $languageFlavorChanged(params: sqlops.DidChangeLanguageFlavorParams): void { throw ni(); } /** * Callback when a connection request has completed */ $onConnectComplete(handle: number, connectionInfoSummary: sqlops.ConnectionInfoSummary): void { throw ni(); } /** * Callback when a IntelliSense cache has been built */ $onIntelliSenseCacheComplete(handle: number, connectionUri: string): void { throw ni(); } $getServerCapabilities(handle: number, client: sqlops.DataProtocolClientCapabilities): Thenable { throw ni(); } /** * Metadata service methods * */ $getMetadata(handle: number, connectionUri: string): Thenable { throw ni(); } $getDatabases(handle: number, connectionUri: string): Thenable { throw ni(); } $getTableInfo(handle: number, connectionUri: string, metadata: sqlops.ObjectMetadata): Thenable { throw ni(); } $getViewInfo(handle: number, connectionUri: string, metadata: sqlops.ObjectMetadata): Thenable { throw ni(); } /** * Object Explorer */ $createObjectExplorerSession(handle: number, connInfo: sqlops.ConnectionInfo): Thenable { throw ni(); } $expandObjectExplorerNode(handle: number, nodeInfo: sqlops.ExpandNodeInfo): Thenable { throw ni(); } $refreshObjectExplorerNode(handle: number, nodeInfo: sqlops.ExpandNodeInfo): Thenable { throw ni(); } $closeObjectExplorerSession(handle: number, closeSessionInfo: sqlops.ObjectExplorerCloseSessionInfo): Thenable { throw ni(); } $findNodes(handle: number, findNodesInfo: sqlops.FindNodesInfo): Thenable { throw ni(); } /** * Tasks */ $getAllTasks(handle: number, listTasksParams: sqlops.ListTasksParams): Thenable { throw ni(); } $cancelTask(handle: number, cancelTaskParams: sqlops.CancelTaskParams): Thenable { throw ni(); } /** * Scripting methods */ $scriptAsOperation(handle: number, connectionUri: string, operation: sqlops.ScriptOperation, metadata: sqlops.ObjectMetadata, paramDetails: sqlops.ScriptingParamDetails): Thenable { throw ni(); } /** * Cancels the currently running query for a URI */ $cancelQuery(handle: number, ownerUri: string): Thenable { throw ni(); } /** * Runs a query for a text selection inside a document */ $runQuery(handle: number, ownerUri: string, selection: sqlops.ISelectionData, runOptions?: sqlops.ExecutionPlanOptions): Thenable { throw ni(); } /** * Runs the current SQL statement query for a text document */ $runQueryStatement(handle: number, ownerUri: string, line: number, column: number): Thenable { throw ni(); } /** * Runs a query for a provided query */ $runQueryString(handle: number, ownerUri: string, queryString: string): Thenable { throw ni(); } /** * Runs a query for a provided query and returns result */ $runQueryAndReturn(handle: number, ownerUri: string, queryString: string): Thenable { throw ni(); } /** * Parses a T-SQL string without actually executing it */ $parseSyntax(handle: number, ownerUri: string, query: string): Thenable { throw ni(); } /** * Gets a subset of rows in a result set in order to display in the UI */ $getQueryRows(handle: number, rowData: sqlops.QueryExecuteSubsetParams): Thenable { throw ni(); } /** * Disposes the cached information regarding a query */ $disposeQuery(handle: number, ownerUri: string): Thenable { throw ni(); } /** * Refreshes the IntelliSense cache */ $rebuildIntelliSenseCache(handle: number, ownerUri: string): Thenable { throw ni(); } /** * Callback when a query has completed */ $onQueryComplete(handle: number, result: sqlops.QueryExecuteCompleteNotificationResult): void { throw ni(); } /** * Callback when a batch has started. This enables the UI to display when batch execution has started */ $onBatchStart(handle: number, batchInfo: sqlops.QueryExecuteBatchNotificationParams): void { throw ni(); } /** * Callback when a batch is complete. This includes updated information on result sets, time to execute, and * other relevant batch information */ $onBatchComplete(handle: number, batchInfo: sqlops.QueryExecuteBatchNotificationParams): void { throw ni(); } /** * Callback when a result set has been returned from query execution and can be displayed */ $onResultSetAvailable(handle: number, resultSetInfo: sqlops.QueryExecuteResultSetNotificationParams): void { throw ni(); } /** * Callback when a result set has been returned from query execution and can be displayed */ $onResultSetUpdate(handle: number, resultSetInfo: sqlops.QueryExecuteResultSetNotificationParams): void { throw ni(); } /** * Callback when a message generated during query execution is issued */ $onQueryMessage(handle: number, message: sqlops.QueryExecuteMessageParams): void { throw ni(); } /** * Requests saving of the results from a result set into a specific format (CSV, JSON, Excel) */ $saveResults(handle: number, requestParams: sqlops.SaveResultsRequestParams): Thenable { throw ni(); } /** * Commits all pending edits in an edit session */ $commitEdit(handle: number, ownerUri: string): Thenable { throw ni(); } /** * Creates a new row in the edit session */ $createRow(handle: number, ownerUri: string): Thenable { throw ni(); } /** * Marks the selected row for deletion in the edit session */ $deleteRow(handle: number, ownerUri: string, rowId: number): Thenable { throw ni(); } /** * Initializes a new edit data session for the requested table/view */ $initializeEdit(handle: number, ownerUri: string, schemaName: string, objectName: string, objectType: string, rowLimit: number, queryString: string): Thenable { throw ni(); } /** * Reverts any pending changes for the requested cell and returns the original value */ $revertCell(handle: number, ownerUri: string, rowId: number, columnId: number): Thenable { throw ni(); } /** * Reverts any pending changes for the requested row */ $revertRow(handle: number, ownerUri: string, rowId: number): Thenable { throw ni(); } /** * Updates a cell value in the requested row. Returns if there are any corrections to the value */ $updateCell(handle: number, ownerUri: string, rowId: number, columId: number, newValue: string): Thenable { throw ni(); } /** * Gets a subset of rows in a result set, merging pending edit changes in order to display in the UI */ $getEditRows(handle: number, rowData: sqlops.EditSubsetParams): Thenable { throw ni(); } /** * Diposes an initialized edit session and cleans up pending edits */ $disposeEdit(handle: number, ownerUri: string): Thenable { throw ni(); } /** * Create a new database on the provided connection */ $createDatabase(handle: number, connectionUri: string, database: sqlops.DatabaseInfo): Thenable { throw ni(); } /** * Get the default database prototype */ $getDefaultDatabaseInfo(handle: number, connectionUri: string): Thenable { throw ni(); } /** * Get the database info */ $getDatabaseInfo(handle: number, connectionUri: string): Thenable { throw ni(); } /** * Create a new login on the provided connection */ $createLogin(handle: number, connectionUri: string, login: sqlops.LoginInfo): Thenable { throw ni(); } /** * Backup a database */ $backup(handle: number, connectionUri: string, backupInfo: { [key: string]: any }, taskExecutionMode: sqlops.TaskExecutionMode): Thenable { throw ni(); } /** * Get the extended database prototype */ $getBackupConfigInfo(handle: number, connectionUri: string): Thenable { throw ni(); } /** * Restores a database */ $restore(handle: number, connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable { throw ni(); } /** * Gets a plan for restoring a database */ $getRestorePlan(handle: number, connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable { throw ni(); } /** * Cancels a plan */ $cancelRestorePlan(handle: number, connectionUri: string, restoreInfo: sqlops.RestoreInfo): Thenable { throw ni(); } /** * Gets restore config Info */ $getRestoreConfigInfo(handle: number, connectionUri: string): Thenable { throw ni(); } /** * Open a file browser */ $openFileBrowser(handle: number, ownerUri: string, expandPath: string, fileFilters: string[], changeFilter: boolean): Thenable { throw ni(); } /** * Expand a folder node */ $expandFolderNode(handle: number, ownerUri: string, expandPath: string): Thenable { throw ni(); } /** * Validate selected file paths */ $validateFilePaths(handle: number, ownerUri: string, serviceType: string, selectedFiles: string[]): Thenable { throw ni(); } /** * Close file browser */ $closeFileBrowser(handle: number, ownerUri: string): Thenable { throw ni(); } /** * Profiler Provider methods */ /** * Create a profiler session */ $createSession(handle: number, sessionId: string, createStatement: string, template: sqlops.ProfilerSessionTemplate): Thenable { throw ni(); } /** * Start a profiler session */ $startSession(handle: number, sessionId: string, sessionName: string): Thenable { throw ni(); } /** * Stop a profiler session */ $stopSession(handle: number, sessionId: string): Thenable { throw ni(); } /** * Pause a profiler session */ $pauseSession(handle: number, sessionId: string): Thenable { throw ni(); } /** * Get list of running XEvent sessions on the profiler session's target server */ $getXEventSessions(handle: number, sessionId: string): Thenable { throw ni(); } /** * Get Agent Job list */ $getJobs(handle: number, ownerUri: string): Thenable { throw ni(); } /** * Get a Agent Job's history */ $getJobHistory(handle: number, ownerUri: string, jobID: string, jobName: string): Thenable { throw ni(); } /** * Run an action on a Job */ $jobAction(handle: number, ownerUri: string, jobName: string, action: string): Thenable { throw ni(); } /** * Deletes a job */ $deleteJob(handle: number, ownerUri: string, job: sqlops.AgentJobInfo): Thenable { throw ni(); } /** * Deletes a job step */ $deleteJobStep(handle: number, ownerUri: string, step: sqlops.AgentJobStepInfo): Thenable { throw ni(); } /** * Get Agent Alerts list */ $getAlerts(handle: number, connectionUri: string): Thenable { throw ni(); } /** * Deletes an alert */ $deleteAlert(handle: number, connectionUri: string, alert: sqlops.AgentAlertInfo): Thenable { throw ni(); } /** * Get Agent Oeprators list */ $getOperators(handle: number, connectionUri: string): Thenable { throw ni(); } /** * Deletes an operator */ $deleteOperator(handle: number, connectionUri: string, operator: sqlops.AgentOperatorInfo): Thenable { throw ni(); } /** * Get Agent Proxies list */ $getProxies(handle: number, connectionUri: string): Thenable { throw ni(); } /** * Deletes a proxy */ $deleteProxy(handle: number, connectionUri: string, proxy: sqlops.AgentProxyInfo): Thenable { throw ni(); } /** * Get Agent Credentials list */ $getCredentials(handle: number, connectionUri: string): Thenable { throw ni(); } /** * DacFx export bacpac */ $exportBacpac(handle: number, databaseName: string, packageFilePath: string, ownerUri: string, taskExecutionMode: sqlops.TaskExecutionMode): Thenable { throw ni(); } /** * DacFx import bacpac */ $importBacpac(handle: number, packageFilePath: string, databaseName: string, ownerUri: string, taskExecutionMode: sqlops.TaskExecutionMode): Thenable { throw ni(); } /** * DacFx extract dacpac */ $extractDacpac(handle: number, databaseName: string, packageFilePath: string, applicationName: string, applicationVersion: string, ownerUri: string, taskExecutionMode: sqlops.TaskExecutionMode): Thenable { throw ni(); } /** * DacFx deploy dacpac */ $deployDacpac(handle: number, packageFilePath: string, databaseName: string, upgradeExisting: boolean, ownerUri: string, taskExecutionMode: sqlops.TaskExecutionMode): Thenable { throw ni(); } } /** * ResourceProvider extension host class. */ export abstract class ExtHostResourceProviderShape { /** * Create a firewall rule */ $createFirewallRule(handle: number, account: sqlops.Account, firewallRuleInfo: sqlops.FirewallRuleInfo): Thenable { throw ni(); } /** * Handle firewall rule */ $handleFirewallRule(handle: number, errorCode: number, errorMessage: string, connectionTypeId: string): Thenable { throw ni(); } } /** * Credential Management extension host class. */ export abstract class ExtHostCredentialManagementShape { $saveCredential(credentialId: string, password: string): Thenable { throw ni(); } $readCredential(credentialId: string): Thenable { throw ni(); } $deleteCredential(credentialId: string): Thenable { throw ni(); } } /** * Serialization provider extension host class. */ export abstract class ExtHostSerializationProviderShape { $saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable { throw ni(); } } export interface MainThreadAccountManagementShape extends IDisposable { $registerAccountProvider(providerMetadata: sqlops.AccountProviderMetadata, handle: number): Thenable; $unregisterAccountProvider(handle: number): Thenable; $beginAutoOAuthDeviceCode(providerId: string, title: string, message: string, userCode: string, uri: string): Thenable; $endAutoOAuthDeviceCode(): void; $accountUpdated(updatedAccount: sqlops.Account): void; $getAccountsForProvider(providerId: string): Thenable; } export interface MainThreadResourceProviderShape extends IDisposable { $registerResourceProvider(providerMetadata: sqlops.ResourceProviderMetadata, handle: number): Thenable; $unregisterResourceProvider(handle: number): Thenable; } export interface MainThreadDataProtocolShape extends IDisposable { $registerConnectionProvider(providerId: string, handle: number): TPromise; $registerBackupProvider(providerId: string, handle: number): TPromise; $registerRestoreProvider(providerId: string, handle: number): TPromise; $registerScriptingProvider(providerId: string, handle: number): TPromise; $registerQueryProvider(providerId: string, handle: number): TPromise; $registerProfilerProvider(providerId: string, handle: number): TPromise; $registerObjectExplorerProvider(providerId: string, handle: number): TPromise; $registerMetadataProvider(providerId: string, handle: number): TPromise; $registerTaskServicesProvider(providerId: string, handle: number): TPromise; $registerFileBrowserProvider(providerId: string, handle: number): TPromise; $registerCapabilitiesServiceProvider(providerId: string, handle: number): TPromise; $registerAdminServicesProvider(providerId: string, handle: number): TPromise; $registerAgentServicesProvider(providerId: string, handle: number): TPromise; $registerDacFxServicesProvider(providerId: string, handle: number): TPromise; $unregisterProvider(handle: number): TPromise; $onConnectionComplete(handle: number, connectionInfoSummary: sqlops.ConnectionInfoSummary): void; $onIntelliSenseCacheComplete(handle: number, connectionUri: string): void; $onConnectionChangeNotification(handle: number, changedConnInfo: sqlops.ChangedConnectionInfo): void; $onQueryComplete(handle: number, result: sqlops.QueryExecuteCompleteNotificationResult): void; $onBatchStart(handle: number, batchInfo: sqlops.QueryExecuteBatchNotificationParams): void; $onBatchComplete(handle: number, batchInfo: sqlops.QueryExecuteBatchNotificationParams): void; $onResultSetAvailable(handle: number, resultSetInfo: sqlops.QueryExecuteResultSetNotificationParams): void; $onResultSetUpdated(handle: number, resultSetInfo: sqlops.QueryExecuteResultSetNotificationParams): void; $onQueryMessage(handle: number, message: sqlops.QueryExecuteMessageParams): void; $onObjectExplorerSessionCreated(handle: number, message: sqlops.ObjectExplorerSession): void; $onObjectExplorerSessionDisconnected(handle: number, message: sqlops.ObjectExplorerSession): void; $onObjectExplorerNodeExpanded(handle: number, message: sqlops.ObjectExplorerExpandInfo): void; $onTaskCreated(handle: number, sessionResponse: sqlops.TaskInfo): void; $onTaskStatusChanged(handle: number, sessionResponse: sqlops.TaskProgressInfo): void; $onFileBrowserOpened(handle: number, response: sqlops.FileBrowserOpenedParams): void; $onFolderNodeExpanded(handle: number, response: sqlops.FileBrowserExpandedParams): void; $onFilePathsValidated(handle: number, response: sqlops.FileBrowserValidatedParams): void; $onScriptingComplete(handle: number, message: sqlops.ScriptingCompleteResult): void; $onSessionEventsAvailable(handle: number, response: sqlops.ProfilerSessionEvents): void; $onSessionStopped(handle: number, response: sqlops.ProfilerSessionStoppedParams): void; $onProfilerSessionCreated(handle: number, response: sqlops.ProfilerSessionCreatedParams): void; $onJobDataUpdated(handle: Number): void; /** * Callback when a session has completed initialization */ $onEditSessionReady(handle: number, ownerUri: string, success: boolean, message: string); } export interface MainThreadConnectionManagementShape extends IDisposable { $getActiveConnections(): Thenable; $getCurrentConnection(): Thenable; $getCredentials(connectionId: string): Thenable<{ [name: string]: string }>; $openConnectionDialog(providers: string[], initialConnectionProfile?: sqlops.IConnectionProfile, connectionCompletionOptions?: sqlops.IConnectionCompletionOptions): Thenable; $listDatabases(connectionId: string): Thenable; $getConnectionString(connectionId: string, includePassword: boolean): Thenable; $getUriForConnection(connectionId: string): Thenable; } export interface MainThreadCredentialManagementShape extends IDisposable { $registerCredentialProvider(handle: number): TPromise; $unregisterCredentialProvider(handle: number): TPromise; } export interface MainThreadSerializationProviderShape extends IDisposable { $registerSerializationProvider(handle: number): TPromise; $unregisterSerializationProvider(handle: number): TPromise; } function ni() { return new Error('Not implemented'); } // --- proxy identifiers export const SqlMainContext = { // SQL entries MainThreadAccountManagement: createMainId('MainThreadAccountManagement'), MainThreadConnectionManagement: createMainId('MainThreadConnectionManagement'), MainThreadCredentialManagement: createMainId('MainThreadCredentialManagement'), MainThreadDataProtocol: createMainId('MainThreadDataProtocol'), MainThreadObjectExplorer: createMainId('MainThreadObjectExplorer'), MainThreadBackgroundTaskManagement: createMainId('MainThreadBackgroundTaskManagement'), MainThreadSerializationProvider: createMainId('MainThreadSerializationProvider'), MainThreadResourceProvider: createMainId('MainThreadResourceProvider'), MainThreadModalDialog: createMainId('MainThreadModalDialog'), MainThreadTasks: createMainId('MainThreadTasks'), MainThreadDashboardWebview: createMainId('MainThreadDashboardWebview'), MainThreadModelView: createMainId('MainThreadModelView'), MainThreadDashboard: createMainId('MainThreadDashboard'), MainThreadModelViewDialog: createMainId('MainThreadModelViewDialog'), MainThreadQueryEditor: createMainId('MainThreadQueryEditor'), MainThreadNotebook: createMainId('MainThreadNotebook'), MainThreadNotebookDocumentsAndEditors: createMainId('MainThreadNotebookDocumentsAndEditors') }; export const SqlExtHostContext = { ExtHostAccountManagement: createExtId('ExtHostAccountManagement'), ExtHostConnectionManagement: createExtId('ExtHostConnectionManagement'), ExtHostCredentialManagement: createExtId('ExtHostCredentialManagement'), ExtHostDataProtocol: createExtId('ExtHostDataProtocol'), ExtHostObjectExplorer: createExtId('ExtHostObjectExplorer'), ExtHostSerializationProvider: createExtId('ExtHostSerializationProvider'), ExtHostResourceProvider: createExtId('ExtHostResourceProvider'), ExtHostModalDialogs: createExtId('ExtHostModalDialogs'), ExtHostTasks: createExtId('ExtHostTasks'), ExtHostBackgroundTaskManagement: createExtId('ExtHostBackgroundTaskManagement'), ExtHostDashboardWebviews: createExtId('ExtHostDashboardWebviews'), ExtHostModelView: createExtId('ExtHostModelView'), ExtHostModelViewTreeViews: createExtId('ExtHostModelViewTreeViews'), ExtHostDashboard: createExtId('ExtHostDashboard'), ExtHostModelViewDialog: createExtId('ExtHostModelViewDialog'), ExtHostQueryEditor: createExtId('ExtHostQueryEditor'), ExtHostNotebook: createExtId('ExtHostNotebook'), ExtHostNotebookDocumentsAndEditors: createExtId('ExtHostNotebookDocumentsAndEditors') }; export interface MainThreadDashboardShape extends IDisposable { } export interface ExtHostDashboardShape { $onDidOpenDashboard(dashboard: sqlops.DashboardDocument): void; $onDidChangeToDashboard(dashboard: sqlops.DashboardDocument): void; } export interface MainThreadModalDialogShape extends IDisposable { $createDialog(handle: number): void; $disposeDialog(handle: number): void; $show(handle: number): void; $setTitle(handle: number, value: string): void; $setHtml(handle: number, value: string): void; $sendMessage(handle: number, value: any): Thenable; } export interface ExtHostModalDialogsShape { $onMessage(handle: number, message: any): void; $onClosed(handle: number): void; } export interface ExtHostTasksShape { $executeContributedTask(id: string, ...args: any[]): Thenable; $getContributedTaskHandlerDescriptions(): TPromise<{ [id: string]: string | ITaskHandlerDescription }>; } export interface MainThreadTasksShape extends IDisposable { $registerTask(id: string): TPromise; $unregisterTask(id: string): TPromise; } export interface ExtHostDashboardWebviewsShape { $registerProvider(widgetId: string, handler: (webview: sqlops.DashboardWebview) => void): void; $onMessage(handle: number, message: any): void; $onClosed(handle: number): void; $registerWidget(handle: number, id: string, connection: sqlops.connection.Connection, serverInfo: sqlops.ServerInfo): void; } export interface MainThreadDashboardWebviewShape extends IDisposable { $sendMessage(handle: number, message: string); $registerProvider(widgetId: string); $setHtml(handle: number, value: string); } export interface ExtHostModelViewShape { $registerProvider(widgetId: string, handler: (webview: sqlops.ModelView) => void, extensionLocation: UriComponents): void; $onClosed(handle: number): void; $registerWidget(handle: number, id: string, connection: sqlops.connection.Connection, serverInfo: sqlops.ServerInfo): void; $handleEvent(handle: number, id: string, eventArgs: any); $runCustomValidations(handle: number, id: string): Thenable; } export interface ExtHostModelViewTreeViewsShape { $getChildren(treeViewId: string, treeItemHandle?: string): TPromise; $createTreeView(handle: number, componentId: string, options: { treeDataProvider: vscode.TreeDataProvider }): sqlops.TreeComponentView; $onNodeCheckedChanged(treeViewId: string, treeItemHandle?: string, checked?: boolean): void; $onNodeSelected(treeViewId: string, nodes: string[]): void; $setExpanded(treeViewId: string, treeItemHandle: string, expanded: boolean): void; $setSelection(treeViewId: string, treeItemHandles: string[]): void; $setVisible(treeViewId: string, visible: boolean): void; } export interface ExtHostBackgroundTaskManagementShape { $onTaskRegistered(operationId: string): void; $onTaskCanceled(operationId: string): void; $registerTask(operationInfo: sqlops.BackgroundOperationInfo): void; $removeTask(operationId: string): void; } export interface MainThreadBackgroundTaskManagementShape extends IDisposable { $registerTask(taskInfo: sqlops.TaskInfo): void; $updateTask(taskProgressInfo: sqlops.TaskProgressInfo): void; } export interface MainThreadModelViewShape extends IDisposable { $registerProvider(id: string): void; $initializeModel(handle: number, rootComponent: IComponentShape): Thenable; $clearContainer(handle: number, componentId: string): Thenable; $addToContainer(handle: number, containerId: string, item: IItemConfig, index?: number): Thenable; $removeFromContainer(handle: number, containerId: string, item: IItemConfig): Thenable; $setLayout(handle: number, componentId: string, layout: any): Thenable; $setProperties(handle: number, componentId: string, properties: { [key: string]: any }): Thenable; $registerEvent(handle: number, componentId: string): Thenable; $validate(handle: number, componentId: string): Thenable; $setDataProvider(handle: number, componentId: string): Thenable; $refreshDataProvider(handle: number, componentId: string, item?: any): Thenable; } export interface ExtHostObjectExplorerShape { } export interface MainThreadObjectExplorerShape extends IDisposable { $getNode(connectionId: string, nodePath?: string): Thenable; $getActiveConnectionNodes(): Thenable<{ nodeInfo: sqlops.NodeInfo, connectionId: string }[]>; $setExpandedState(connectionId: string, nodePath: string, expandedState: vscode.TreeItemCollapsibleState): Thenable; $setSelected(connectionId: string, nodePath: string, selected: boolean, clearOtherSelections?: boolean): Thenable; $getChildren(connectionId: string, nodePath: string): Thenable; $isExpanded(connectionId: string, nodePath: string): Thenable; $findNodes(connectionId: string, type: string, schema: string, name: string, database: string, parentObjectNames: string[]): Thenable; $refresh(connectionId: string, nodePath: string): Thenable; } export interface ExtHostModelViewDialogShape { $onButtonClick(handle: number): void; $onPanelValidityChanged(handle: number, valid: boolean): void; $onWizardPageChanged(handle: number, info: sqlops.window.modelviewdialog.WizardPageChangeInfo): void; $updateWizardPageInfo(handle: number, pageHandles: number[], currentPageIndex: number): void; $validateNavigation(handle: number, info: sqlops.window.modelviewdialog.WizardPageChangeInfo): Thenable; $validateDialogClose(handle: number): Thenable; $handleSave(handle: number): Thenable; } export interface MainThreadModelViewDialogShape extends IDisposable { $openEditor(handle: number, modelViewId: string, title: string, options?: sqlops.ModelViewEditorOptions, position?: vscode.ViewColumn): Thenable; $openDialog(handle: number): Thenable; $closeDialog(handle: number): Thenable; $setDialogDetails(handle: number, details: IModelViewDialogDetails): Thenable; $setTabDetails(handle: number, details: IModelViewTabDetails): Thenable; $setButtonDetails(handle: number, details: IModelViewButtonDetails): Thenable; $openWizard(handle: number): Thenable; $closeWizard(handle: number): Thenable; $setWizardPageDetails(handle: number, details: IModelViewWizardPageDetails): Thenable; $setWizardDetails(handle: number, details: IModelViewWizardDetails): Thenable; $addWizardPage(wizardHandle: number, pageHandle: number, pageIndex: number): Thenable; $removeWizardPage(wizardHandle: number, pageIndex: number): Thenable; $setWizardPage(wizardHandle: number, pageIndex: number): Thenable; $setDirty(handle: number, isDirty: boolean): void; } export interface ExtHostQueryEditorShape { } export interface MainThreadQueryEditorShape extends IDisposable { $connect(fileUri: string, connectionId: string): Thenable; $runQuery(fileUri: string): void; } export interface ExtHostNotebookShape { /** * Looks up a notebook manager for a given notebook URI * @param {number} providerHandle * @param {vscode.Uri} notebookUri * @returns {Thenable} handle of the manager to be used when sending */ $getNotebookManager(providerHandle: number, notebookUri: UriComponents): Thenable; $handleNotebookClosed(notebookUri: UriComponents): void; // Server Manager APIs $doStartServer(managerHandle: number): Thenable; $doStopServer(managerHandle: number): Thenable; // Content Manager APIs $getNotebookContents(managerHandle: number, notebookUri: UriComponents): Thenable; $save(managerHandle: number, notebookUri: UriComponents, notebook: sqlops.nb.INotebookContents): Thenable; // Session Manager APIs $refreshSpecs(managerHandle: number): Thenable; $startNewSession(managerHandle: number, options: sqlops.nb.ISessionOptions): Thenable; $shutdownSession(managerHandle: number, sessionId: string): Thenable; // Session APIs $changeKernel(sessionId: number, kernelInfo: sqlops.nb.IKernelSpec): Thenable; // Kernel APIs $getKernelReadyStatus(kernelId: number): Thenable; $getKernelSpec(kernelId: number): Thenable; $requestComplete(kernelId: number, content: sqlops.nb.ICompleteRequest): Thenable; $requestExecute(kernelId: number, content: sqlops.nb.IExecuteRequest, disposeOnDone?: boolean): Thenable; $interruptKernel(kernelId: number): Thenable; // Future APIs $sendInputReply(futureId: number, content: sqlops.nb.IInputReply): void; $disposeFuture(futureId: number): void; } export interface MainThreadNotebookShape extends IDisposable { $registerNotebookProvider(providerId: string, handle: number): void; $unregisterNotebookProvider(handle: number): void; $onFutureMessage(futureId: number, type: FutureMessageType, payload: sqlops.nb.IMessage): void; $onFutureDone(futureId: number, done: INotebookFutureDone): void; } export interface INotebookDocumentsAndEditorsDelta { removedDocuments?: UriComponents[]; addedDocuments?: INotebookModelAddedData[]; removedEditors?: string[]; addedEditors?: INotebookEditorAddData[]; newActiveEditor?: string; } export interface INotebookModelAddedData { uri: UriComponents; providerId: string; isDirty: boolean; } export interface INotebookEditorAddData { id: string; documentUri: UriComponents; editorPosition: EditorViewColumn; } export interface INotebookShowOptions { position?: EditorViewColumn; preserveFocus?: boolean; preview?: boolean; providerId?: string; connectionId?: string; } export interface ExtHostNotebookDocumentsAndEditorsShape { $acceptDocumentsAndEditorsDelta(delta: INotebookDocumentsAndEditorsDelta): void; } export interface MainThreadNotebookDocumentsAndEditorsShape extends IDisposable { $trySaveDocument(uri: UriComponents): Thenable; $tryShowNotebookDocument(resource: UriComponents, options: INotebookShowOptions): TPromise; }