mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Make resource parameter optional for getSecurityToken API (#3322)
This commit is contained in:
5
src/sql/sqlops.d.ts
vendored
5
src/sql/sqlops.d.ts
vendored
@@ -1957,10 +1957,11 @@ declare module 'sqlops' {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a security token by asking the account's provider
|
* Generates a security token by asking the account's provider
|
||||||
* @param {Account} account Account to generate security token for
|
* @param {Account} account Account to generate security token for (defaults to
|
||||||
|
* AzureResource.ResourceManagement if not given)
|
||||||
* @return {Thenable<{}>} Promise to return the security token
|
* @return {Thenable<{}>} Promise to return the security token
|
||||||
*/
|
*/
|
||||||
export function getSecurityToken(account: Account, resource: AzureResource): Thenable<{}>;
|
export function getSecurityToken(account: Account, resource?: AzureResource): Thenable<{}>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An [event](#Event) which fires when the accounts have changed.
|
* An [event](#Event) which fires when the accounts have changed.
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
MainThreadAccountManagementShape,
|
MainThreadAccountManagementShape,
|
||||||
SqlMainContext,
|
SqlMainContext,
|
||||||
} from 'sql/workbench/api/node/sqlExtHost.protocol';
|
} from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||||
|
import { AzureResource } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||||
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
|
import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
|
||||||
import { Event, Emitter } from 'vs/base/common/event';
|
import { Event, Emitter } from 'vs/base/common/event';
|
||||||
|
|
||||||
@@ -89,7 +90,10 @@ export class ExtHostAccountManagement extends ExtHostAccountManagementShape {
|
|||||||
return Promise.all(promises).then(() => resultAccounts);
|
return Promise.all(promises).then(() => resultAccounts);
|
||||||
}
|
}
|
||||||
|
|
||||||
public $getSecurityToken(account: sqlops.Account, resource: sqlops.AzureResource): Thenable<{}> {
|
public $getSecurityToken(account: sqlops.Account, resource?: sqlops.AzureResource): Thenable<{}> {
|
||||||
|
if (resource === undefined) {
|
||||||
|
resource = AzureResource.ResourceManagement;
|
||||||
|
}
|
||||||
return this.$getAllAccounts().then(() => {
|
return this.$getAllAccounts().then(() => {
|
||||||
for (const handle in this._accounts) {
|
for (const handle in this._accounts) {
|
||||||
const providerHandle = parseInt(handle);
|
const providerHandle = parseInt(handle);
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ export function createApiFactory(
|
|||||||
getAllAccounts(): Thenable<sqlops.Account[]> {
|
getAllAccounts(): Thenable<sqlops.Account[]> {
|
||||||
return extHostAccountManagement.$getAllAccounts();
|
return extHostAccountManagement.$getAllAccounts();
|
||||||
},
|
},
|
||||||
getSecurityToken(account: sqlops.Account, resource: sqlops.AzureResource): Thenable<{}> {
|
getSecurityToken(account: sqlops.Account, resource?: sqlops.AzureResource): Thenable<{}> {
|
||||||
return extHostAccountManagement.$getSecurityToken(account, resource);
|
return extHostAccountManagement.$getSecurityToken(account, resource);
|
||||||
},
|
},
|
||||||
onDidChangeAccounts(listener: (e: sqlops.DidChangeAccountsParams) => void, thisArgs?: any, disposables?: extHostTypes.Disposable[]) {
|
onDidChangeAccounts(listener: (e: sqlops.DidChangeAccountsParams) => void, thisArgs?: any, disposables?: extHostTypes.Disposable[]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user