diff --git a/types/azdata/azdata-tests.ts b/types/azdata/azdata-tests.ts index 2bb0fed50f13db..4d3819084e1828 100644 --- a/types/azdata/azdata-tests.ts +++ b/types/azdata/azdata-tests.ts @@ -124,3 +124,19 @@ const account: azdata.Account = { }; azdata.accounts.getAccountSecurityToken(account, 'tenant-id', azdata.AzureResource.Custom); + +const connectionProfile: azdata.connection.ConnectionProfile = { + providerId: 'MyProvider', + connectionId: 'MyConnectionId', + connectionName: 'MyConnectionName', + serverName: 'MyServerName', + databaseName: 'MyDatabaseName', + userName: 'MyUsername', + password: 'MyPassword', + authenticationType: azdata.connection.AuthenticationType.SqlLogin, + savePassword: false, + groupFullName: 'MyGroupFullName', + groupId: 'MyGroupId', + saveProfile: false, + options: {} +}; diff --git a/types/azdata/index.d.ts b/types/azdata/index.d.ts index c4c056d4aaedc0..a74ab59aadd813 100644 --- a/types/azdata/index.d.ts +++ b/types/azdata/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Azure Data Studio 1.42 +// Type definitions for Azure Data Studio 1.43 // Project: https://github.com/microsoft/azuredatastudio // Definitions by: Charles Gagnon // Alan Ren: @@ -13,7 +13,7 @@ *--------------------------------------------------------------------------------------------*/ /** - * Type Definition for Azure Data Studio 1.42 Extension API + * Type Definition for Azure Data Studio 1.43 Extension API * See https://docs.microsoft.com/sql/azure-data-studio/extensibility-apis for more information */ @@ -25,6 +25,22 @@ declare module 'azdata' { */ export const version: string; + 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; + } + // EXPORTED NAMESPACES ///////////////////////////////////////////////// /** * Namespace for Data Management Protocol global methods @@ -106,6 +122,36 @@ declare module 'azdata' { * Namespace for connection management */ export namespace connection { + /** + * Well-known Authentication types commonly supported by connection providers. + */ + export enum AuthenticationType { + /** + * Username and password + */ + SqlLogin = 'SqlLogin', + /** + * Windows Authentication + */ + Integrated = 'Integrated', + /** + * Azure Active Directory - Universal with MFA support + */ + AzureMFA = 'AzureMFA', + /** + * Azure Active Directory - Password + */ + AzureMFAAndUser = 'AzureMFAAndUser', + /** + * Datacenter Security Token Service Authentication + */ + DSTSAuth = 'dstsAuth', + /** + * No authentication required + */ + None = 'None' + } + /** * Connection profile primary class */ @@ -117,7 +163,7 @@ declare module 'azdata' { databaseName: string; userName: string; password: string; - authenticationType: string; + authenticationType: string | AuthenticationType; savePassword: boolean; groupFullName: string; groupId: string; @@ -322,7 +368,7 @@ declare module 'azdata' { /** * Get the parent node. Returns undefined if there is none. */ - getParent(): Thenable; + getParent(): Thenable; /** * Refresh the node, expanding it if it has children @@ -384,7 +430,10 @@ declare module 'azdata' { databaseName?: string | undefined; userName: string; password: string; - authenticationType: string; + /** + * The type of authentication to use when connecting + */ + authenticationType: string | connection.AuthenticationType; savePassword: boolean; groupFullName?: string | undefined; groupId?: string | undefined; @@ -1961,8 +2010,8 @@ declare module 'azdata' { // Proxy management methods getProxies(ownerUri: string): Thenable; - createProxy(ownerUri: string, proxyInfo: AgentProxyInfo): Thenable; - updateProxy(ownerUri: string, originalProxyName: string, proxyInfo: AgentProxyInfo): Thenable; + createProxy(ownerUri: string, proxyInfo: AgentProxyInfo): Thenable; + updateProxy(ownerUri: string, originalProxyName: string, proxyInfo: AgentProxyInfo): Thenable; deleteProxy(ownerUri: string, proxyInfo: AgentProxyInfo): Thenable; // Credential method @@ -2999,6 +3048,11 @@ declare module 'azdata' { export interface ContainerBuilder extends ComponentBuilder { withLayout(layout: TLayout): ContainerBuilder; withItems(components: Array, itemLayout?: TItemLayout): ContainerBuilder; + /** + * Sets the initial set of properties for the container being created + * @param properties The properties to apply to the container + */ + withProps(properties: TPropertyBag): ContainerBuilder; } export interface FlexBuilder extends ContainerBuilder { @@ -3586,9 +3640,14 @@ declare module 'azdata' { title?: string | undefined; } + /** + * Supported values for aria-live accessibility attribute + */ + export type AriaLiveValue = 'polite' | 'assertive' | 'off'; + export interface InputBoxProperties extends ComponentProperties { value?: string | undefined; - ariaLive?: string | undefined; + ariaLive?: AriaLiveValue | undefined; placeHolder?: string | undefined; inputType?: InputBoxInputType | undefined; required?: boolean | undefined; @@ -4180,6 +4239,10 @@ declare module 'azdata' { export interface TableComponent extends Component, TableComponentProperties { onRowSelected: vscode.Event; onCellAction?: vscode.Event | undefined; + /** + * Append data to the existing table data. + */ + appendData(data: any[][]): Thenable; } export interface FileBrowserTreeComponent extends Component, FileBrowserTreeProperties { @@ -4940,7 +5003,7 @@ declare module 'azdata' { * 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; + message?: DialogMessage; /** * Set the dialog name when opening @@ -5239,9 +5302,41 @@ declare module 'azdata' { | 'executionPlan' | 'visualize'; + /** + * A message sent during the execution of a query + */ + export interface QueryMessage { + /** + * The message string + */ + message: string; + /** + * Whether this message is an error message or not + */ + isError: boolean; + /** + * The timestamp for when this message was sent + */ + time?: string; + } + + /** + * Information about a query that was executed + */ + export interface QueryInfo { + /** + * Any messages that have been received from the query provider + */ + messages: QueryMessage[]; + /** + * The ranges for each batch that has executed so far + */ + batchRanges: vscode.Range[]; + } + export interface QueryEventListener { /** - * A callback that is called whenever a query event occurs + * 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 @@ -5250,8 +5345,9 @@ declare module 'azdata' { * 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 */ - onQueryEvent(type: QueryEventType, document: QueryDocument, args: ResultSetSummary | string | undefined): void; + onQueryEvent(type: QueryEventType, document: QueryDocument, args: ResultSetSummary | string | undefined, queryInfo: QueryInfo): void; } export interface QueryDocument {