From 23e1f6ea61f10a3b52d4be6f786685a55999fd9a Mon Sep 17 00:00:00 2001 From: Alan Ren Date: Thu, 8 Jun 2023 20:56:41 -0700 Subject: [PATCH] copy result handler (#87) * Remove duplicated types (#85) * Remove duplicated types * Remove max line length * add copy result to query provider (#86) * add copy result to query provider * fix error * update js --------- Co-authored-by: Charles Gagnon --- lib/codeConverter.js | 2 - lib/main.js | 17 +- lib/protocol.d.ts | 38 ++-- lib/protocol.js | 15 +- lib/types.d.ts | 292 ------------------------ lib/types.js | 20 +- package.json | 4 +- src/azdata.proposed.d.ts | 474 ++++++++++++++++++++++++++++++++------- src/codeConverter.ts | 6 +- src/main.ts | 23 +- src/protocol.ts | 44 ++-- src/types.ts | 345 ---------------------------- tslint.json | 4 - yarn.lock | 8 +- 14 files changed, 463 insertions(+), 829 deletions(-) diff --git a/lib/codeConverter.js b/lib/codeConverter.js index d445baf..5fb811b 100644 --- a/lib/codeConverter.js +++ b/lib/codeConverter.js @@ -21,8 +21,6 @@ function asScriptingParams(ownerURI, operation, metadata, paramDetails) { type: metadata.metadataTypeName, schema: metadata.schema, name: metadata.name, - // cast to any since azdata needs to be updated to pickup this new field - // TODO: remove cast once updated azdata is published (8/24/2021 - karlb) parentName: metadata.parentName, parentTypeName: metadata.parentTypeName }; diff --git a/lib/main.js b/lib/main.js index 8eab53a..d8dd754 100644 --- a/lib/main.js +++ b/lib/main.js @@ -196,12 +196,7 @@ class ConnectionFeature extends SqlOpsFeature { }); }; let registerOnConnectionChanged = (handler) => { - client.onNotification(protocol.ConnectionChangedNotification.type, (params) => { - handler({ - connectionUri: params.ownerUri, - connection: params.connection - }); - }); + client.onNotification(protocol.ConnectionChangedNotification.type, handler); }; azdata.dataprotocol.onDidChangeLanguageFlavor((params) => { client.sendNotification(protocol.LanguageFlavorChangedNotification.type, params); @@ -381,6 +376,12 @@ class QueryFeature extends SqlOpsFeature { return Promise.reject(e); }); }; + let copyResults = (params) => { + return client.sendRequest(protocol.CopyResultsRequest.type, params).then(r => undefined, e => { + client.logFailedRequest(protocol.CopyResultsRequest.type, e); + return Promise.reject(e); + }); + }; // Edit Data Requests let commitEdit = (ownerUri) => { let params = { ownerUri }; @@ -479,7 +480,8 @@ class QueryFeature extends SqlOpsFeature { runQueryStatement, runQueryString, saveResults, - updateCell + updateCell, + copyResults }); } } @@ -505,6 +507,7 @@ QueryFeature.messagesTypes = [ protocol.SaveResultsAsMarkdownRequest.type, protocol.SaveResultsAsExcelRequest.type, protocol.SaveResultsAsXmlRequest.type, + protocol.CopyResultsRequest.type, protocol.EditCommitRequest.type, protocol.EditCreateRowRequest.type, protocol.EditDeleteRowRequest.type, diff --git a/lib/protocol.d.ts b/lib/protocol.d.ts index 7f2ec32..fa99123 100644 --- a/lib/protocol.d.ts +++ b/lib/protocol.d.ts @@ -104,26 +104,13 @@ export declare namespace ConnectionRequest { const type: RequestType; } export declare namespace ConnectionCompleteNotification { - const type: NotificationType; -} -/** - * Parameters for the ConnectionChanged notification. - */ -export declare class ConnectionChangedParams { - /** - * Owner URI of the connection that changed. - */ - ownerUri: string; - /** - * Summary of details containing any connection changes. - */ - connection: types.ConnectionSummary; + const type: NotificationType; } /** * Connection changed event callback declaration. */ export declare namespace ConnectionChangedNotification { - const type: NotificationType; + const type: NotificationType; } /** * Connection request message format @@ -307,6 +294,9 @@ export declare namespace SaveResultsAsExcelRequest { export declare namespace SaveResultsAsXmlRequest { const type: RequestType; } +export declare namespace CopyResultsRequest { + const type: RequestType; +} export declare namespace SyntaxParseRequest { const type: RequestType; } @@ -330,7 +320,7 @@ export declare namespace ScriptingRequest { const type: RequestType; } export declare namespace ScriptingCompleteNotification { - const type: NotificationType; + const type: NotificationType; } export interface EditSessionOperationParams { ownerUri: string; @@ -383,28 +373,28 @@ export declare namespace EditSubsetRequest { const type: RequestType; } export declare namespace ObjectExplorerCreateSessionRequest { - const type: RequestType; + const type: RequestType; } export declare namespace ObjectExplorerExpandRequest { - const type: RequestType; + const type: RequestType; } export declare namespace ObjectExplorerRefreshRequest { - const type: RequestType; + const type: RequestType; } export declare namespace ObjectExplorerCloseSessionRequest { - const type: RequestType; + const type: RequestType; } export declare namespace ObjectExplorerFindNodesRequest { - const type: RequestType; + const type: RequestType; } export declare namespace ObjectExplorerCreateSessionCompleteNotification { - const type: NotificationType; + const type: NotificationType; } export declare namespace ObjectExplorerSessionDisconnectedNotification { - const type: NotificationType; + const type: NotificationType; } export declare namespace ObjectExplorerExpandCompleteNotification { - const type: NotificationType; + const type: NotificationType; } export declare namespace ListTasksRequest { const type: RequestType; diff --git a/lib/protocol.js b/lib/protocol.js index aa7ac2b..d8721be 100644 --- a/lib/protocol.js +++ b/lib/protocol.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.ScriptingRequest = exports.MetadataQueryRequest = exports.QueryExecutionOptionsRequest = exports.QueryExecuteStringRequest = exports.SimpleExecuteRequest = exports.SyntaxParseRequest = exports.SaveResultsAsXmlRequest = exports.SaveResultsAsExcelRequest = exports.SaveResultsAsMarkdownRequest = exports.SaveResultsAsJsonRequest = exports.SaveResultsAsCsvRequest = exports.QueryExecuteStatementRequest = exports.QueryExecuteSubsetRequest = exports.QueryExecuteRequest = exports.QueryExecuteMessageNotification = exports.QueryExecuteResultSetUpdatedNotification = exports.QueryExecuteResultSetAvailableNotification = exports.QueryExecuteBatchCompleteNotification = exports.QueryExecuteBatchStartNotification = exports.QueryExecuteCompleteNotification = exports.ConnectionUriChangedParams = exports.ConnectionUriChangedNotification = exports.QueryDisposeRequest = exports.QueryCancelRequest = exports.CapabiltiesDiscoveryRequest = exports.CapabiltiesDiscoveryParams = exports.IntelliSenseReadyNotification = exports.ViewMetadataRequest = exports.TableMetadataRequest = exports.TableMetadataResult = exports.TableMetadataParams = exports.LanguageFlavorChangedNotification = exports.BuildConnectionInfoRequest = exports.GetConnectionStringRequest = exports.GetConnectionStringParams = exports.ListDatabasesRequest = exports.ListDatabasesParams = exports.ChangeDatabaseRequest = exports.ChangeDatabaseParams = exports.CancelConnectRequest = exports.CancelConnectParams = exports.DisconnectRequest = exports.DisconnectParams = exports.ChangePasswordRequest = exports.ConnectionChangedNotification = exports.ConnectionChangedParams = exports.ConnectionCompleteNotification = exports.ConnectionRequest = exports.RebuildIntelliSenseParams = exports.RebuildIntelliSenseNotification = void 0; +exports.ScriptingRequest = exports.MetadataQueryRequest = exports.QueryExecutionOptionsRequest = exports.QueryExecuteStringRequest = exports.SimpleExecuteRequest = exports.SyntaxParseRequest = exports.CopyResultsRequest = exports.SaveResultsAsXmlRequest = exports.SaveResultsAsExcelRequest = exports.SaveResultsAsMarkdownRequest = exports.SaveResultsAsJsonRequest = exports.SaveResultsAsCsvRequest = exports.QueryExecuteStatementRequest = exports.QueryExecuteSubsetRequest = exports.QueryExecuteRequest = exports.QueryExecuteMessageNotification = exports.QueryExecuteResultSetUpdatedNotification = exports.QueryExecuteResultSetAvailableNotification = exports.QueryExecuteBatchCompleteNotification = exports.QueryExecuteBatchStartNotification = exports.QueryExecuteCompleteNotification = exports.ConnectionUriChangedParams = exports.ConnectionUriChangedNotification = exports.QueryDisposeRequest = exports.QueryCancelRequest = exports.CapabiltiesDiscoveryRequest = exports.CapabiltiesDiscoveryParams = exports.IntelliSenseReadyNotification = exports.ViewMetadataRequest = exports.TableMetadataRequest = exports.TableMetadataResult = exports.TableMetadataParams = exports.LanguageFlavorChangedNotification = exports.BuildConnectionInfoRequest = exports.GetConnectionStringRequest = exports.GetConnectionStringParams = exports.ListDatabasesRequest = exports.ListDatabasesParams = exports.ChangeDatabaseRequest = exports.ChangeDatabaseParams = exports.CancelConnectRequest = exports.CancelConnectParams = exports.DisconnectRequest = exports.DisconnectParams = exports.ChangePasswordRequest = exports.ConnectionChangedNotification = exports.ConnectionCompleteNotification = exports.ConnectionRequest = exports.RebuildIntelliSenseParams = exports.RebuildIntelliSenseNotification = void 0; exports.FileBrowserCloseRequest = exports.FileBrowserValidatedNotification = exports.FileBrowserValidateRequest = exports.FileBrowserExpandedNotification = exports.FileBrowserExpandRequest = exports.FileBrowserOpenedNotification = exports.FileBrowserOpenRequest = exports.RestoreConfigInfoRequest = exports.CancelRestorePlanRequest = exports.RestorePlanRequest = exports.RestoreRequest = exports.BackupConfigInfoRequest = exports.BackupRequest = exports.GetDatabaseInfoRequest = exports.CreateLoginRequest = exports.DefaultDatabaseInfoRequest = exports.CreateDatabaseRequest = exports.TaskCreatedNotification = exports.TaskStatusChangedNotification = exports.CancelTaskRequest = exports.ListTasksRequest = exports.ObjectExplorerExpandCompleteNotification = exports.ObjectExplorerSessionDisconnectedNotification = exports.ObjectExplorerCreateSessionCompleteNotification = exports.ObjectExplorerFindNodesRequest = exports.ObjectExplorerCloseSessionRequest = exports.ObjectExplorerRefreshRequest = exports.ObjectExplorerExpandRequest = exports.ObjectExplorerCreateSessionRequest = exports.EditSubsetRequest = exports.EditUpdateCellRequest = exports.EditSessionReadyNotification = exports.EditRevertRowRequest = exports.EditRevertCellRequest = exports.EditInitializeRequest = exports.EditDisposeRequest = exports.EditDeleteRowRequest = exports.EditCreateRowRequest = exports.EditCommitRequest = exports.ScriptingCompleteNotification = void 0; const vscode_languageclient_1 = require("vscode-languageclient"); // ---- Refresh IntelliSense ---------------------------------------- @@ -28,12 +28,6 @@ var ConnectionCompleteNotification; ConnectionCompleteNotification.type = new vscode_languageclient_1.NotificationType('connection/complete'); })(ConnectionCompleteNotification = exports.ConnectionCompleteNotification || (exports.ConnectionCompleteNotification = {})); // ------------------------------- < Connection Changed Event > ------------------------------------- -/** - * Parameters for the ConnectionChanged notification. - */ -class ConnectionChangedParams { -} -exports.ConnectionChangedParams = ConnectionChangedParams; /** * Connection changed event callback declaration. */ @@ -241,6 +235,13 @@ var SaveResultsAsXmlRequest; SaveResultsAsXmlRequest.type = new vscode_languageclient_1.RequestType('query/saveXml'); })(SaveResultsAsXmlRequest = exports.SaveResultsAsXmlRequest || (exports.SaveResultsAsXmlRequest = {})); // --------------------------------- ------------------------------------------ +// --------------------------------- < Copy Results Request > ------------------------------------------ +// copy results to clipboard +var CopyResultsRequest; +(function (CopyResultsRequest) { + CopyResultsRequest.type = new vscode_languageclient_1.RequestType('query/copy'); +})(CopyResultsRequest = exports.CopyResultsRequest || (exports.CopyResultsRequest = {})); +// --------------------------------- ------------------------------------------ // ------------------------------- < T-SQL Syntax Parse > ----------------------------------- var SyntaxParseRequest; (function (SyntaxParseRequest) { diff --git a/lib/types.d.ts b/lib/types.d.ts index 2a62198..97b1ece 100644 --- a/lib/types.d.ts +++ b/lib/types.d.ts @@ -1,85 +1,4 @@ import * as azdata from 'azdata'; -/** - * Contains success information, a sessionId to be used when requesting - * expansion of nodes, and a root node to display for this area - */ -export interface CreateSessionResponse { - /** - * Unique Id to use when sending any requests for objects in the tree - * under the node - */ - sessionId: string; -} -/** - * Information returned from a createSessionRequest. Contains success information, a sessionId to be used - * when requesting expansion of nodes, and a root node to display for this area - */ -export interface SessionCreatedParameters { - /** - * Whether the session was created successfully. - */ - success: boolean; - /** - * The ID of the session. - */ - sessionId: string; - /** - * The root node for the session, if it was created successfully. - */ - rootNode: NodeInfo; - /** - * Error message for the failure, if the session was not created successfully. - */ - errorMessage?: string | undefined; - /** - * Error number for the failure, if the session was not created successfully. - */ - errorNumber?: number | undefined; -} -export interface SessionDisconnectedParameters { - success: boolean; - sessionId: string; - rootNode: NodeInfo; - errorMessage: string; -} -export interface ExpandResponse { - nodePath: string; - sessionId: string; - nodes: NodeInfo[]; - errorMessage: string; -} -export interface NodeInfo { - nodePath: string; - nodeType: string; - nodeSubType: string; - nodeStatus: string; - label: string; - isLeaf: boolean; - metadata: azdata.ObjectMetadata; - errorMessage: string; -} -export interface ExpandParams { - sessionId: string; - nodePath: string; -} -export interface CloseSessionParams { - sessionId: string; -} -export interface CloseSessionResponse { - success: boolean; - sessionId: string; -} -export interface FindNodesParams { - sessionId: string; - type: string; - schema: string; - name: string; - database: string; - parentObjectNames: string[]; -} -export interface FindNodesResponse { - nodes: NodeInfo[]; -} export interface CategoryValue { displayName: string; name: string; @@ -96,23 +15,6 @@ export interface ServiceOption { isRequired: boolean; isArray: boolean; } -export interface ConnectionOption { - name: string; - displayName: string; - description: string; - groupName: string; - valueType: string; - defaultValue: string; - objectType: string; - categoryValues: CategoryValue[]; - specialValueType: string; - isIdentity: boolean; - isRequired: boolean; - isArray: boolean; -} -export interface ConnectionProviderOptions { - options: ConnectionOption[]; -} export interface AdminServicesProviderOptions { databaseInfoOptions: ServiceOption[]; databaseFileInfoOptions: ServiceOption[]; @@ -123,64 +25,6 @@ export interface FeatureMetadataProvider { featureName: string; optionsMetadata: ServiceOption[]; } -/** - * Summary that identifies a unique database connection. - */ -export declare class ConnectionSummary { - /** - * server name - */ - serverName: string; - /** - * database name - */ - databaseName: string; - /** - * user name - */ - userName: string; -} -/** - * Connection response format. - */ -export declare class ConnectionCompleteParams { - /** - * URI identifying the owner of the connection - */ - ownerUri: string; - /** - * Connection id returned from service host, if the connection was successful. - */ - connectionId?: string | undefined; - /** - * Additional optional detailed error messages from the engine or service host, if an error occurred. - */ - messages?: string | undefined; - /** - * Error message returned from the engine or service host, if an error occurred. - */ - errorMessage?: string | undefined; - /** - * Error number returned from the engine or server host, if an error occurred. - */ - errorNumber?: number | undefined; - /** - * Information about the connected server, if the connection was successful. - */ - serverInfo?: ServerInfo | undefined; - /** - * Information about the actual connection established, if the connection was successful. - */ - connectionSummary?: ConnectionSummary | undefined; - /** - * Whether the server version is supported by the provider. Default is to assume true. - */ - isSupportedVersion?: boolean | undefined; - /** - * Additional optional message with details about why the version isn't supported. - */ - unsupportedVersionMessage?: string | undefined; -} /** * Update event parameters */ @@ -190,57 +34,6 @@ export declare class IntelliSenseReadyParams { */ ownerUri: string; } -/** - * Information about a SQL Server instance. - */ -export declare class ServerInfo { - /** - * The major version of the SQL Server instance. - */ - serverMajorVersion: number; - /** - * The minor version of the SQL Server instance. - */ - serverMinorVersion: number; - /** - * The build of the SQL Server instance. - */ - serverReleaseVersion: number; - /** - * The ID of the engine edition of the SQL Server 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 SQL Server instance. - */ - serverEdition: string; - /** - * Whether the SQL Server instance is running in the cloud (Azure) or not. - */ - isCloud: boolean; - /** - * The version of Azure that the SQL Server instance is running on, if applicable. - */ - azureVersion: number; - /** - * The Operating System version string of the machine running the SQL Server instance. - */ - osVersion: string; - /** - * options for all new server properties. - */ - options: { - [key: string]: any; - }; -} export declare class CapabiltiesDiscoveryResult { capabilities: azdata.DataProtocolServerCapabilities; } @@ -370,69 +163,6 @@ export interface RestorePlanDetailInfo { isVisible: boolean; defaultValue: any; } -export interface ResultSetSummary { - id: number; - batchId: number; - rowCount: number; - columnInfo: IDbColumn[]; -} -export interface BatchSummary { - hasError: boolean; - id: number; - selection: azdata.ISelectionData; - resultSetSummaries: ResultSetSummary[]; - executionElapsed: string; - executionEnd: string; - executionStart: string; -} -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 EditRow { - cells: azdata.DbCellValue[]; - id: number; - isDirty: boolean; - state: azdata.EditRowState; -} export interface ExecutionPlanOptions { includeEstimatedExecutionPlanXml?: boolean; includeActualExecutionPlanXml?: boolean; @@ -678,28 +408,6 @@ export interface ScriptingParams { */ operation: azdata.ScriptOperation; } -export interface ScriptingCompleteParams { - /** - * The error details for an error that occurred during the scripting operation. - */ - errorDetails: string; - /** - * The error message for an error that occurred during the scripting operation. - */ - errorMessage: string; - /** - * A value to indicate an error occurred during the scripting operation. - */ - hasError: boolean; - /** - * A value to indicate the scripting operation was canceled. - */ - canceled: boolean; - /** - * A value to indicate the scripting operation successfully completed. - */ - success: boolean; -} export declare class TableMetadata { columns: azdata.ColumnMetadata[]; } diff --git a/lib/types.js b/lib/types.js index bd8486c..eae4931 100644 --- a/lib/types.js +++ b/lib/types.js @@ -1,30 +1,12 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.TableMetadata = exports.MetadataQueryResult = exports.MetadataQueryParams = exports.CapabiltiesDiscoveryResult = exports.ServerInfo = exports.IntelliSenseReadyParams = exports.ConnectionCompleteParams = exports.ConnectionSummary = void 0; -/** - * Summary that identifies a unique database connection. - */ -class ConnectionSummary { -} -exports.ConnectionSummary = ConnectionSummary; -/** - * Connection response format. - */ -class ConnectionCompleteParams { -} -exports.ConnectionCompleteParams = ConnectionCompleteParams; +exports.TableMetadata = exports.MetadataQueryResult = exports.MetadataQueryParams = exports.CapabiltiesDiscoveryResult = exports.IntelliSenseReadyParams = void 0; /** * Update event parameters */ class IntelliSenseReadyParams { } exports.IntelliSenseReadyParams = IntelliSenseReadyParams; -/** - * Information about a SQL Server instance. - */ -class ServerInfo { -} -exports.ServerInfo = ServerInfo; class CapabiltiesDiscoveryResult { } exports.CapabiltiesDiscoveryResult = CapabiltiesDiscoveryResult; diff --git a/package.json b/package.json index 3a98972..899e4ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dataprotocol-client", - "version": "1.3.4", + "version": "1.3.5", "description": "Client data protocol implementation for Azure Data Studio", "main": "lib/main", "typings": "lib/main", @@ -15,7 +15,7 @@ "vscode-languageclient": "5.2.1" }, "devDependencies": { - "@types/azdata": "^1.40.0", + "@types/azdata": "^1.44.0", "@types/node": "^12.11.7", "@types/vscode": "^1.67.0", "tslint": "^6.1.3", diff --git a/src/azdata.proposed.d.ts b/src/azdata.proposed.d.ts index 175a9e2..da30b5d 100644 --- a/src/azdata.proposed.d.ts +++ b/src/azdata.proposed.d.ts @@ -9,22 +9,6 @@ import * as vscode from 'vscode'; declare module 'azdata' { - export namespace env { - /** - * Well-known app quality values - */ - export enum AppQuality { - stable = 'stable', - insider = 'insider', - dev = 'dev' - } - - /** - * The version of Azure Data Studio this is currently running as - such as `stable`, or `insider` - */ - export const quality: AppQuality | string | undefined; - } - export namespace nb { export interface NotebookDocument { /** @@ -134,6 +118,24 @@ declare module 'azdata' { } } + export interface LoadingComponentBase { + /** + * When true, the component will display a loading spinner. + */ + loading?: boolean; + + /** + * This sets the alert text which gets announced when the loading spinner is shown. + */ + loadingText?: string; + + /** + * The text to display while loading is set to false. Will also be announced through screen readers + * once loading is completed. + */ + loadingCompletedText?: string; + } + /** * The column information of a data set. */ @@ -392,6 +394,7 @@ declare module 'azdata' { changePassword?(connectionUri: string, connectionInfo: ConnectionInfo, newPassword: string): Thenable; } + // Password Change Request ---------------------------------------------------------------------- export interface PasswordChangeResult { /** * Whether the password change was successful @@ -404,45 +407,107 @@ declare module 'azdata' { } export interface IConnectionProfile extends ConnectionInfo { - /** - * The type of authentication to use when connecting - */ - authenticationType: string | connection.AuthenticationType; azureAccount?: string; azureResourceId?: string; azurePortalEndpoint?: string; } - export namespace connection { + export interface PromptFailedResult extends ProviderError { } + + export interface ProviderError { + /** + * Error name + */ + name?: string; + /** - * Well-known Authentication types commonly supported by connection providers. + * Error code */ - export enum AuthenticationType { + errorCode?: string; + + /** + * Error message + */ + errorMessage?: string; + } + + + export namespace diagnostics { + /** + * Represents a diagnostics provider of accounts. + */ + export interface ErrorDiagnosticsProviderMetadata { + /** + * The id of the provider (ex. a connection provider) that a diagnostics provider will handle errors for. + * Note: only ONE diagnostic provider per id/name at a time. + */ + targetProviderId: string; + } + + export interface ConnectionDiagnosticsResult { + /** + * Whether the error was handled or not. + */ + handled: boolean, /** - * Username and password + * Whether reconnect should be attempted. */ - SqlLogin = 'SqlLogin', + reconnect?: boolean, /** - * Windows Authentication + * If given, the new set of connection options to assign to the original connection profile, overwriting any previous options. */ - Integrated = 'Integrated', + options?: { [name: string]: any }; + } + + /** + * Provides error information + */ + export interface IErrorInformation { /** - * Azure Active Directory - Universal with MFA support + * Error code */ - AzureMFA = 'AzureMFA', + errorCode: number, /** - * Azure Active Directory - Password + * Error Message */ - AzureMFAAndUser = 'AzureMFAAndUser', + errorMessage: string, /** - * Datacenter Security Token Service Authentication + * Stack trace of error */ - DSTSAuth = 'dstsAuth', + messageDetails: string + } + + /** + * Diagnostics object for handling errors for a provider. + */ + export interface ErrorDiagnosticsProvider { /** - * No authentication required + * Called when a connection error occurs, allowing the provider to optionally handle the error and fix any issues before continuing with completing the connection. + * @param errorInfo The error information of the connection error. + * @param connection The connection profile that caused the error. + * @returns ConnectionDiagnosticsResult: The result from the provider for whether the error was handled. */ - None = 'None' + handleConnectionError(errorInfo: IErrorInformation, connection: connection.ConnectionProfile): Thenable; } + + /** + * Registers provider with instance of Diagnostic Provider implementation. + * Note: only ONE diagnostic provider object can be assigned to a specific provider at a time. + * @param providerMetadata Additional data used to register the provider + * @param errorDiagnostics The provider's diagnostic object that handles errors. + * @returns A disposable that when disposed will unregister the provider + */ + export function registerDiagnosticsProvider(providerMetadata: ErrorDiagnosticsProviderMetadata, errorDiagnostics: ErrorDiagnosticsProvider): vscode.Disposable; + } + + export namespace connection { + + /** + * Opens the change password dialog. + * @param profile The connection profile to change the password for. + * @returns The new password that is returned from the operation or undefined if unsuccessful. + */ + export function openChangePasswordDialog(profile: IConnectionProfile): Thenable; } /* @@ -457,13 +522,89 @@ declare module 'azdata' { export interface ConnectionOption { defaultValueOsOverrides?: DefaultValueOsOverride[]; + /** + * Used to define placeholder text + */ + placeholder?: string; + /** * When set to true, the respective connection option will be rendered on the main connection dialog * and not the Advanced Options window. */ showOnConnectionDialog?: boolean; + + /** + * Used to define list of values based on which another option is rendered visible/hidden. + */ + onSelectionChange?: SelectionChangeEvent[]; + } + + export interface ServiceOption { + /** + * Used to define placeholder text + */ + placeholder?: string; + + /** + * Used to define list of values based on which another option is rendered visible/hidden. + */ + onSelectionChange?: SelectionChangeEvent[]; + } + /** + * This change event defines actions + */ + export interface SelectionChangeEvent { + /** + * Values that affect actions defined in this event. + */ + values: string[]; + + /** + * Action to be taken on another option when selected value matches to the list of values provided. + */ + dependentOptionActions: DependentOptionAction[]; } + export interface DependentOptionAction { + /** + * Name of option affected by defined action. + */ + optionName: string, + + /** + * Action to be taken, Supported values: 'show', 'hide'. + */ + action: string; + + /** + * Whether or not the option should be set to required when visible. Defaults to false. + * NOTE: Since this is dynamically defined, option values are not updated on 'show' and validation is not performed. + * When set to true, providers must handle property validation. + */ + required?: boolean; + } + + // Object Explorer interfaces -------------------------------- + export interface ObjectExplorerSession { + /** + * Authentication token for the current session. + */ + securityToken?: accounts.AccountSecurityToken | undefined; + } + + export interface ExpandNodeInfo { + /** + * Authentication token for the current session. + */ + securityToken?: accounts.AccountSecurityToken | undefined; + + /** + * Filters to apply to the child nodes being returned + */ + filters?: NodeFilter[]; + } + // End Object Explorer interfaces ---------------------------- + export interface TaskInfo { targetLocation?: string; } @@ -520,6 +661,13 @@ declare module 'azdata' { type?: ExtensionNodeType; } + export interface AccountKey { + /** + * Auth Library used to add the account + */ + authLibrary?: string; + } + export namespace workspace { /** * Creates and enters a workspace at the specified location @@ -528,13 +676,13 @@ declare module 'azdata' { /** * Enters the workspace with the provided path - * @param workspacefile + * @param workspaceFile */ export function enterWorkspace(workspaceFile: vscode.Uri): Promise; /** * Saves and enters the workspace with the provided path - * @param workspacefile + * @param workspaceFile */ export function saveAndEnterWorkspace(workspaceFile: vscode.Uri): Promise; } @@ -546,13 +694,6 @@ declare module 'azdata' { headerFilter?: boolean, } - export interface TableComponent { - /** - * Append data to an existing table data. - */ - appendData(data: any[][]): Thenable; - } - export interface ListViewOption { /** * The optional accessibility label for the column. Default is the label for the list view option. @@ -600,6 +741,10 @@ declare module 'azdata' { * The url to open. */ url?: string; + /** + * The role of the hyperlink. By default, the role is 'link' and the url will be opened in a new tab. + */ + role?: 'button' | 'link'; } export interface ContextMenuColumnCellValue { @@ -678,11 +823,58 @@ declare module 'azdata' { parentTypeName?: string; } + /** + * Represents a selected range in the result grid. + */ + export interface SelectionRange { + fromRow: number; + toRow: number; + fromColumn: number; + toColumn: number; + } + + /** + * Parameters for the copy results request. + */ + export interface CopyResultsRequestParams { + /** + * URI of the editor. + */ + ownerUri: string; + /** + * Index of the batch. + */ + batchIndex: number; + /** + * Index of the result set. + */ + resultSetIndex: number; + /** + * Whether to include the column headers. + */ + includeHeaders: boolean + /** + * Whether to remove line breaks from the cell value. + */ + removeNewLines: boolean; + /** + * The selected ranges to be copied. + */ + selections: SelectionRange[]; + } + export interface QueryProvider { /** * Notify clients that the URI for a connection has been changed. */ - connectionUriChanged(newUri: string, oldUri: string): Thenable; + connectionUriChanged?(newUri: string, oldUri: string): Thenable; + /** + * Copy the selected data to the clipboard. + * This is introduced to address the performance issue of large amount of data to ADS side. + * ADS will use this if 'supportCopyResultsToClipboard' property is set to true in the provider contribution point in extension's package.json. + * Otherwise, The default handler will load all the selected data to ADS and perform the copy operation. + */ + copyResults?(requestParams: CopyResultsRequestParams): Thenable; } export enum DataProviderType { @@ -700,7 +892,7 @@ declare module 'azdata' { * Open a table designer window. * @param providerId The table designer provider Id. * @param tableInfo The table information. The object will be passed back to the table designer provider as the unique identifier for the table. - * @param telemetryInfo: Optional Key-value pair containing any extra information that needs to be sent via telemetry + * @param telemetryInfo Optional Key-value pair containing any extra information that needs to be sent via telemetry */ export function openTableDesigner(providerId: string, tableInfo: TableInfo, telemetryInfo?: { [key: string]: string }): Thenable; @@ -1625,76 +1817,188 @@ declare module 'azdata' { /** * Corresponds to the aria-live accessibility attribute for this component */ - ariaLive?: string; + ariaLive?: AriaLiveValue } - export interface ContainerBuilder extends ComponentBuilder { + export interface ContainerProperties extends ComponentProperties { /** - * Sets the initial set of properties for the container being created - * @param properties The properties to apply to the container + * Corresponds to the aria-live accessibility attribute for this component */ - withProps(properties: TPropertyBag): ContainerBuilder; + ariaLive?: AriaLiveValue } - export interface ContainerProperties extends ComponentProperties { + export interface NodeInfo { /** - * Corresponds to the aria-live accessibility attribute for this component + * The object type of the node. Node type is used to determine the icon, the object type is the actual type of the node, e.g. for Tables node + * under the database, the nodeType is Folder, the objectType is be Tables. + */ + objectType?: string; + /* + * The path of the parent node. + */ + parentNodePath: string; + /** + * Filterable properties that this node supports */ - ariaLive?: string; + filterableProperties?: NodeFilterProperty[]; + } + + export interface NodeFilterProperty { + /** + * The non-localized name of the filter property + */ + name: string; + /** + * The name of the filter property displayed to the user + */ + displayName: string; + /** + * The type of the filter property + */ + type: NodeFilterPropertyDataType; + /** + * The description of the filter property + */ + description: string; } - export namespace queryeditor { - export interface QueryMessage { + /** + * NodeFilterChoiceProperty is used to define the choices for the filter property if the type is choice + */ + export interface NodeFilterChoiceProperty extends NodeFilterProperty { + /** + * The list of choices for the filter property if the type is choice + */ + choices: NodeFilterChoicePropertyValue[]; + } + + export interface NodeFilterChoicePropertyValue { + /** + * The value of the choice + */ + value: string; + /** + * The display name of the choice + * If not specified, the value will be used as the display name + * If specified, the display name will be used in the dropdown + */ + displayName?: string; + } + + export interface NodeFilter { + /** + * The name of the filter property + */ + name: string; + /** + * The operator of the filter property + */ + operator: NodeFilterOperator; + /** + * The applied values of the filter property + */ + value: string | string[] | number | number[] | boolean | undefined; + } + + export enum NodeFilterPropertyDataType { + String = 0, + Number = 1, + Boolean = 2, + Date = 3, + Choice = 4 + } + + export enum NodeFilterOperator { + Equals = 0, + NotEquals = 1, + LessThan = 2, + LessThanOrEquals = 3, + GreaterThan = 4, + GreaterThanOrEquals = 5, + Between = 6, + NotBetween = 7, + Contains = 8, + NotContains = 9, + IsNull = 10, + IsNotNull = 11 + } + + export namespace window { + export interface Wizard extends LoadingComponentBase { + } + + export interface Dialog extends LoadingComponentBase { + } + + /** + * Opens the error dialog with customization options provided. + * @param options Dialog options to customize error dialog. + * @returns Id of action button clicked by user, e.g. ok, cancel + */ + export function openCustomErrorDialog(options: IErrorDialogOptions): Thenable; + + /** + * Provides dialog options to customize modal dialog content and layout + */ + export interface IErrorDialogOptions { + /** + * Severity Level to identify icon of modal dialog. + */ + severity: MessageLevel; /** - * The message string + * Title of modal dialog header. + */ + headerTitle: string; + /** + * Message text to show on dialog. */ message: string; /** - * Whether this message is an error message or not + * (Optional) Detailed message, e.g stack trace of error. + */ + messageDetails?: string; + /** + * Telemetry View to be used for emitting telemetry events. + */ + telemetryView?: string, + /** + * (Optional) List of custom actions to include in modal dialog alongwith a 'Cancel' button. + * If custom 'actions' are not provided, 'OK' button will be shown by default. */ - isError: boolean; + actions?: IDialogAction[]; /** - * The timestamp for when this message was sent + * (Optional) If provided, instruction text is shown in bold below message. */ - time?: string; + instructionText?: string; + /** + * (Optional) If provided, appends read more link after instruction text. + */ + readMoreLink?: string; } /** - * Information about a query that was executed + * An action that will be rendered as a button on the dialog. */ - export interface QueryInfo { + export interface IDialogAction { /** - * Any messages that have been received from the query provider + * Identifier of action. */ - messages: QueryMessage[]; + id: string; /** - * The ranges for each batch that has executed so far + * Label of Action button. */ - batchRanges: vscode.Range[]; - } - - export interface QueryEventListener { + label: string; /** - * An event that is fired for query events - * @param type The type of query event - * @param document The document this event was sent by - * @param args The extra information for the event, if any - * The args sent depend on the type of event : - * queryStart: undefined - * queryStop: undefined - * executionPlan: string (the plan itself) - * visualize: ResultSetSummary (the result set to be visualized) - * @param queryInfo The information about the query that triggered this event + * Defines if button styling and focus should be based on primary action. */ - onQueryEvent(type: QueryEventType, document: QueryDocument, args: ResultSetSummary | string | undefined, queryInfo: QueryInfo): void; + isPrimary: boolean; } } - export interface NodeInfo { + export interface TableComponent { /** - * The object type of the node. Node type is used to determine the icon, the object type is the actual type of the node, e.g. for Tables node - * under the database, the nodeType is Folder, the objectType is be Tables. + * Set active cell. */ - objectType?: string; + setActiveCell(row: number, column: number): void; } } diff --git a/src/codeConverter.ts b/src/codeConverter.ts index d93dec5..e3baed6 100644 --- a/src/codeConverter.ts +++ b/src/codeConverter.ts @@ -37,10 +37,8 @@ function asScriptingParams( type: metadata.metadataTypeName, schema: metadata.schema, name: metadata.name, - // cast to any since azdata needs to be updated to pickup this new field - // TODO: remove cast once updated azdata is published (8/24/2021 - karlb) - parentName: (metadata).parentName, - parentTypeName: (metadata).parentTypeName + parentName: metadata.parentName, + parentTypeName: metadata.parentTypeName }; let targetDatabaseEngineEdition = paramDetails.targetDatabaseEngineEdition; let targetDatabaseEngineType = paramDetails.targetDatabaseEngineType; diff --git a/src/main.ts b/src/main.ts index 7c78364..6195651 100644 --- a/src/main.ts +++ b/src/main.ts @@ -289,12 +289,7 @@ export class ConnectionFeature extends SqlOpsFeature { }; let registerOnConnectionChanged = (handler: (changedConnInfo: azdata.ChangedConnectionInfo) => any): void => { - client.onNotification(protocol.ConnectionChangedNotification.type, (params: protocol.ConnectionChangedParams) => { - handler({ - connectionUri: params.ownerUri, - connection: params.connection - }); - }); + client.onNotification(protocol.ConnectionChangedNotification.type, handler); }; azdata.dataprotocol.onDidChangeLanguageFlavor((params) => { @@ -341,6 +336,7 @@ export class QueryFeature extends SqlOpsFeature { protocol.SaveResultsAsMarkdownRequest.type, protocol.SaveResultsAsExcelRequest.type, protocol.SaveResultsAsXmlRequest.type, + protocol.CopyResultsRequest.type, protocol.EditCommitRequest.type, protocol.EditCreateRowRequest.type, protocol.EditDeleteRowRequest.type, @@ -518,7 +514,7 @@ export class QueryFeature extends SqlOpsFeature { } ); case 'markdown': - return client.sendRequest(protocol.SaveResultsAsMarkdownRequest.type, requestParams).then ( + return client.sendRequest(protocol.SaveResultsAsMarkdownRequest.type, requestParams).then( undefined, e => { client.logFailedRequest(protocol.SaveResultsAsMarkdownRequest.type, e); @@ -560,6 +556,16 @@ export class QueryFeature extends SqlOpsFeature { ); }; + let copyResults = (params: azdata.CopyResultsRequestParams): Thenable => { + return client.sendRequest(protocol.CopyResultsRequest.type, params).then( + r => undefined, + e => { + client.logFailedRequest(protocol.CopyResultsRequest.type, e); + return Promise.reject(e); + } + ); + }; + // Edit Data Requests let commitEdit = (ownerUri: string): Thenable => { let params: azdata.EditCommitParams = { ownerUri }; @@ -701,7 +707,8 @@ export class QueryFeature extends SqlOpsFeature { runQueryStatement, runQueryString, saveResults, - updateCell + updateCell, + copyResults }); } } diff --git a/src/protocol.ts b/src/protocol.ts index 0c0a05c..04cd416 100644 --- a/src/protocol.ts +++ b/src/protocol.ts @@ -123,31 +123,16 @@ export namespace ConnectionRequest { export namespace ConnectionCompleteNotification { - export const type = new NotificationType('connection/complete'); + export const type = new NotificationType('connection/complete'); } // ------------------------------- < Connection Changed Event > ------------------------------------- -/** - * Parameters for the ConnectionChanged notification. - */ -export class ConnectionChangedParams { - /** - * Owner URI of the connection that changed. - */ - public ownerUri: string; - - /** - * Summary of details containing any connection changes. - */ - public connection: types.ConnectionSummary; -} - /** * Connection changed event callback declaration. */ export namespace ConnectionChangedNotification { - export const type = new NotificationType('connection/connectionchanged'); + export const type = new NotificationType('connection/connectionchanged'); } // ------------------------------- < Password Change for Connection Event > ------------------------------------- @@ -463,6 +448,13 @@ export namespace SaveResultsAsXmlRequest { } // --------------------------------- ------------------------------------------ +// --------------------------------- < Copy Results Request > ------------------------------------------ +// copy results to clipboard +export namespace CopyResultsRequest { + export const type = new RequestType('query/copy'); +} +// --------------------------------- ------------------------------------------ + // ------------------------------- < T-SQL Syntax Parse > ----------------------------------- export namespace SyntaxParseRequest { export const type = new RequestType('query/syntaxparse'); @@ -504,7 +496,7 @@ export namespace ScriptingRequest { // ------------------------------- < Scripting Complete Event > ------------------------------------ export namespace ScriptingCompleteNotification { - export const type = new NotificationType('scripting/scriptComplete'); + export const type = new NotificationType('scripting/scriptComplete'); } @@ -586,38 +578,38 @@ export namespace EditSubsetRequest { // ------------------------------- < Object Explorer Events > ------------------------------------ export namespace ObjectExplorerCreateSessionRequest { - export const type = new RequestType('objectexplorer/createsession'); + export const type = new RequestType('objectexplorer/createsession'); } export namespace ObjectExplorerExpandRequest { - export const type = new RequestType('objectexplorer/expand'); + export const type = new RequestType('objectexplorer/expand'); } export namespace ObjectExplorerRefreshRequest { - export const type = new RequestType('objectexplorer/refresh'); + export const type = new RequestType('objectexplorer/refresh'); } export namespace ObjectExplorerCloseSessionRequest { - export const type = new RequestType('objectexplorer/closesession'); + export const type = new RequestType('objectexplorer/closesession'); } export namespace ObjectExplorerFindNodesRequest { - export const type = new RequestType('objectexplorer/findnodes'); + export const type = new RequestType('objectexplorer/findnodes'); } // ------------------------------- < Object Explorer Events > ------------------------------------ export namespace ObjectExplorerCreateSessionCompleteNotification { - export const type = new NotificationType('objectexplorer/sessioncreated'); + export const type = new NotificationType('objectexplorer/sessioncreated'); } export namespace ObjectExplorerSessionDisconnectedNotification { - export const type = new NotificationType('objectexplorer/sessiondisconnected'); + export const type = new NotificationType('objectexplorer/sessiondisconnected'); } export namespace ObjectExplorerExpandCompleteNotification { - export const type = new NotificationType('objectexplorer/expandCompleted'); + export const type = new NotificationType('objectexplorer/expandCompleted'); } // ------------------------------- < Task Service Events > ------------------------------------ diff --git a/src/types.ts b/src/types.ts index daba6b7..692fd98 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,96 +1,5 @@ import * as azdata from 'azdata'; -/** - * Contains success information, a sessionId to be used when requesting - * expansion of nodes, and a root node to display for this area - */ -export interface CreateSessionResponse { - /** - * Unique Id to use when sending any requests for objects in the tree - * under the node - */ - sessionId: string; -} - -/** - * Information returned from a createSessionRequest. Contains success information, a sessionId to be used - * when requesting expansion of nodes, and a root node to display for this area - */ -export interface SessionCreatedParameters { - /** - * Whether the session was created successfully. - */ - success: boolean; - /** - * The ID of the session. - */ - sessionId: string; - /** - * The root node for the session, if it was created successfully. - */ - rootNode: NodeInfo; - /** - * Error message for the failure, if the session was not created successfully. - */ - errorMessage?: string | undefined; - /** - * Error number for the failure, if the session was not created successfully. - */ - errorNumber?: number | undefined; -} - -export interface SessionDisconnectedParameters { - success: boolean; - sessionId: string; - rootNode: NodeInfo; - errorMessage: string; -} - -export interface ExpandResponse { - nodePath: string; - sessionId: string; - nodes: NodeInfo[]; - errorMessage: string; -} - -export interface NodeInfo { - nodePath: string; - nodeType: string; - nodeSubType: string; - nodeStatus: string; - label: string; - isLeaf: boolean; - metadata: azdata.ObjectMetadata; - errorMessage: string; -} - -export interface ExpandParams { - sessionId: string; - nodePath: string; -} - -export interface CloseSessionParams { - sessionId: string; -} - -export interface CloseSessionResponse { - success: boolean; - sessionId: string; -} - -export interface FindNodesParams { - sessionId: string; - type: string; - schema: string; - name: string; - database: string; - parentObjectNames: string[]; -} - -export interface FindNodesResponse { - nodes: NodeInfo[]; -} - export interface CategoryValue { displayName: string; @@ -119,36 +28,6 @@ export interface ServiceOption { isArray: boolean; } -export interface ConnectionOption { - name: string; - - displayName: string; - - description: string; - - groupName: string; - - valueType: string; - - defaultValue: string; - - objectType: string; - - categoryValues: CategoryValue[]; - - specialValueType: string; - - isIdentity: boolean; - - isRequired: boolean; - - isArray: boolean; -} - -export interface ConnectionProviderOptions { - options: ConnectionOption[]; -} - export interface AdminServicesProviderOptions { databaseInfoOptions: ServiceOption[]; @@ -163,76 +42,6 @@ export interface FeatureMetadataProvider { optionsMetadata: ServiceOption[]; } -/** - * Summary that identifies a unique database connection. - */ -export class ConnectionSummary { - /** - * server name - */ - public serverName: string; - - /** - * database name - */ - public databaseName: string; - - /** - * user name - */ - public userName: string; -} - -/** - * Connection response format. - */ -export class ConnectionCompleteParams { - /** - * URI identifying the owner of the connection - */ - public ownerUri: string; - - /** - * Connection id returned from service host, if the connection was successful. - */ - public connectionId?: string | undefined; - - /** - * Additional optional detailed error messages from the engine or service host, if an error occurred. - */ - public messages?: string | undefined; - - /** - * Error message returned from the engine or service host, if an error occurred. - */ - public errorMessage?: string | undefined; - - /** - * Error number returned from the engine or server host, if an error occurred. - */ - public errorNumber?: number | undefined; - - /** - * Information about the connected server, if the connection was successful. - */ - public serverInfo?: ServerInfo | undefined; - - /** - * Information about the actual connection established, if the connection was successful. - */ - public connectionSummary?: ConnectionSummary | undefined; - - /** - * Whether the server version is supported by the provider. Default is to assume true. - */ - public isSupportedVersion?: boolean | undefined; - - /** - * Additional optional message with details about why the version isn't supported. - */ - public unsupportedVersionMessage?: string | undefined; -} - /** * Update event parameters */ @@ -243,65 +52,6 @@ export class IntelliSenseReadyParams { public ownerUri: string; } -/** - * Information about a SQL Server instance. - */ -export class ServerInfo { - /** - * The major version of the SQL Server instance. - */ - public serverMajorVersion: number; - - /** - * The minor version of the SQL Server instance. - */ - public serverMinorVersion: number; - - /** - * The build of the SQL Server instance. - */ - public serverReleaseVersion: number; - - /** - * The ID of the engine edition of the SQL Server instance. - */ - public engineEditionId: number; - - /** - * String containing the full server version text. - */ - public serverVersion: string; - - /** - * String describing the product level of the server. - */ - public serverLevel: string; - - /** - * The edition of the SQL Server instance. - */ - public serverEdition: string; - - /** - * Whether the SQL Server instance is running in the cloud (Azure) or not. - */ - public isCloud: boolean; - - /** - * The version of Azure that the SQL Server instance is running on, if applicable. - */ - public azureVersion: number; - - /** - * The Operating System version string of the machine running the SQL Server instance. - */ - public osVersion: string; - /** - * options for all new server properties. - */ - public options: { [key: string]: any }; -} - export class CapabiltiesDiscoveryResult { public capabilities: azdata.DataProtocolServerCapabilities; } @@ -487,74 +237,6 @@ export interface RestorePlanDetailInfo { } // Query Execution types -export interface ResultSetSummary { - id: number; - batchId: number; - rowCount: number; - columnInfo: IDbColumn[]; -} - -export interface BatchSummary { - hasError: boolean; - id: number; - selection: azdata.ISelectionData; - resultSetSummaries: ResultSetSummary[]; - executionElapsed: string; - executionEnd: string; - executionStart: string; -} - -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 EditRow { - cells: azdata.DbCellValue[]; - id: number; - isDirty: boolean; - state: azdata.EditRowState; -} export interface ExecutionPlanOptions { includeEstimatedExecutionPlanXml?: boolean; @@ -860,33 +542,6 @@ export interface ScriptingParams { operation: azdata.ScriptOperation; } -export interface ScriptingCompleteParams { - /** - * The error details for an error that occurred during the scripting operation. - */ - errorDetails: string; - - /** - * The error message for an error that occurred during the scripting operation. - */ - errorMessage: string; - - /** - * A value to indicate an error occurred during the scripting operation. - */ - hasError: boolean; - - /** - * A value to indicate the scripting operation was canceled. - */ - canceled: boolean; - - /** - * A value to indicate the scripting operation successfully completed. - */ - success: boolean; -} - export class TableMetadata { columns: azdata.ColumnMetadata[]; diff --git a/tslint.json b/tslint.json index d1d3354..04dd337 100644 --- a/tslint.json +++ b/tslint.json @@ -16,10 +16,6 @@ "forin": true, "jsdoc-format": true, "label-position": true, - "max-line-length": [ - true, - 160 - ], "member-access": false, "member-ordering": [ false, diff --git a/yarn.lock b/yarn.lock index d1ec7b9..a406faf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18,10 +18,10 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@types/azdata@^1.40.0": - version "1.40.0" - resolved "https://registry.yarnpkg.com/@types/azdata/-/azdata-1.40.0.tgz#0a454d9261a6eadbb70692515184bcea5bbb9d61" - integrity sha512-CGsuH9wY6616UGskR1bMd3KcOTHhh43dQz9ruSji3EmzUG6EYJCE+6D3+UZ6M+Ub73XzDeYXobe/rk+fGkaYlg== +"@types/azdata@^1.44.0": + version "1.44.0" + resolved "https://registry.yarnpkg.com/@types/azdata/-/azdata-1.44.0.tgz#c6bb4baacd1b0f74b46742bffd61ae40e922989d" + integrity sha512-AbZnAUybkG+Vqk96PNMcv8ypzN9zqsk1k85v2Gyl5xwUrLkEgGmHnrnK6p70PM3OFaABCYU+t/4fMnnK1JY1YA== dependencies: "@types/vscode" "*"