mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-15 09:35:37 -05:00
Accounts: Enable notification for accounts change (#2432)
* Enable notification for accounts change * Fixed bugs in extHostAccountManagement.test.ts * Fixed as commented: 1. Removed AccountWithProviderHandle 2. Use a private dictionary _accounts in ExtHostAccountManagement to cache all accounts and corresponding provider handles. 3. getSecurityToken gets provider handle from _accounts for specified account. 4. Added / changed unit tests for getAllAccounts & getSecurityToken
This commit is contained in:
25
src/sql/sqlops.d.ts
vendored
25
src/sql/sqlops.d.ts
vendored
@@ -1855,14 +1855,19 @@ declare module 'sqlops' {
|
||||
* Gets all added accounts.
|
||||
* @returns {Thenable<Account>} Promise to return the accounts
|
||||
*/
|
||||
export function getAllAccounts(): Thenable<AccountWithProviderHandle[]>;
|
||||
export function getAllAccounts(): Thenable<Account[]>;
|
||||
|
||||
/**
|
||||
* Generates a security token by asking the account's provider
|
||||
* @param {Account} account Account to generate security token for
|
||||
* @return {Thenable<{}>} Promise to return the security token
|
||||
*/
|
||||
export function getSecurityToken(account: AccountWithProviderHandle): Thenable<{}>;
|
||||
export function getSecurityToken(account: Account): Thenable<{}>;
|
||||
|
||||
/**
|
||||
* An [event](#Event) which fires when the accounts have changed.
|
||||
*/
|
||||
export const onDidChangeAccounts: vscode.Event<DidChangeAccountsParams>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1930,19 +1935,9 @@ declare module 'sqlops' {
|
||||
isStale: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents an account with account provider's handle
|
||||
*/
|
||||
export interface AccountWithProviderHandle {
|
||||
/**
|
||||
* Account
|
||||
*/
|
||||
account: Account;
|
||||
|
||||
/**
|
||||
* Account's provider handle
|
||||
*/
|
||||
providerHandle: number;
|
||||
export interface DidChangeAccountsParams {
|
||||
// Updated accounts
|
||||
accounts: Account[];
|
||||
}
|
||||
|
||||
// - ACCOUNT PROVIDER //////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user