Skip to content

Commit

Permalink
5.6.0 (#70)
Browse files Browse the repository at this point in the history
Co-authored-by: David Brailovsky <dbrailovsky@microsoft.com>
  • Loading branch information
dbrailov and David Brailovsky authored Jun 13, 2023
1 parent 771a0ba commit 849756d
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 132 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Change Log - Power BI Custom Visuals API
## 5.6.0
* Adds the `storageV2` service.
* Adds the `acquireAADToken` service.

## 5.4.0
* Adds `isDataFilterApplied` into DataViewMetadata, to provide a boolean value of whether any applied filter affects the visual.
Expand Down
135 changes: 4 additions & 131 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "powerbi-visuals-api",
"version": "5.4.0",
"version": "5.6.0",
"description": "Power BI Custom Visuals API type definitions for typescript",
"types": "index",
"main": "index.js",
Expand Down
67 changes: 67 additions & 0 deletions src/visuals-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,27 @@ declare module powerbi.extensibility {
}
}

declare module powerbi.extensibility {
export interface AcquireAADTokenResult {
accessToken?: string;
}

export interface IAcquireAADTokenService {
/** Returns an authentication token for the resource that the visual defined as a privilge
* and the scope is the visual guid plus a constant string "_CV_ForPBI"
* @returns the promise that resolves to the authentication token
*/
acquireAADToken(): IPromise<AcquireAADTokenResult>;

/**
* Returns the availability status of the service.
*
* @returns the promise that resolves to privilege status of the service
*/
acquireAADTokenstatus(): IPromise<PrivilegeStatus>;
}
}

declare module powerbi {
/**
* Represents a return type for privilege status query methods
Expand Down Expand Up @@ -1596,6 +1617,50 @@ declare module powerbi.extensibility {
}
}

declare module powerbi.extensibility {

interface StorageV2ResultInfo {
success: boolean;
}

/**
* Provides an access to local storage for read / write access
*/
interface IVisualLocalStorageV2Service {
/**
* Returns the availability status of the service.
*
* @returns the promise that resolves to privilege status of the service
*/
status(): IPromise<PrivilegeStatus>;

/**
* Returns promise that resolves to the data associated with 'key' if it was found or rejects otherwise.
*
* @param key - the name of the payload to retrieve
* @returns the promise that resolves to the data required or rejects if it wasn't found or an error occured.
*/
get(key: string): IPromise<string>;

/**
* Saves the data to local storage. This data can be later be retrieved using the 'key'.
* Returns a promise that resolves to StorageV2ResultInfo, or rejects if an error occured.
*
* @param key - the name of the payload to store
* @param data - the payload string to store
* @returns the promise resolves to StorageV2ResultInfo, or rejects if an error occured.
*/
set(key: string, data: string): IPromise<StorageV2ResultInfo>;

/**
* Deletes data associated with 'key' from local storage.
*
* @param key - the name of the payload to remove
*/
remove(key: string): void;
}
}

declare module powerbi.extensibility {
/**
* An interface for reporting rendering events
Expand Down Expand Up @@ -1732,6 +1797,8 @@ declare module powerbi.extensibility.visual {
webAccessService: IWebAccessService;
drill: (args: DrillArgs) => void;
applyCustomSort: (args: CustomVisualApplyCustomSortArgs) => void;
storageV2Service: IVisualLocalStorageV2Service;
acquireAADTokenService: IAcquireAADTokenService;
}

export interface VisualUpdateOptions extends extensibility.VisualUpdateOptions {
Expand Down

0 comments on commit 849756d

Please sign in to comment.