Skip to content

Commit

Permalink
API 5.9.0 (#88)
Browse files Browse the repository at this point in the history
* HierarchyIdentityFilter

* Auth API Extensions

* fix

* fix

* fix

* CHANGELOG and description

* Update visuals-api.d.ts

* comments

* fix

* 5.9.0

* DashboardHost

* ChangeLog for DashboardHost

* Updated packages

---------

Co-authored-by: David Brailovsky <dbrailovsky@microsoft.com>
Co-authored-by: dbrailov <57748147+dbrailov@users.noreply.github.com>
Co-authored-by: aleksSavelev <v-alsavelev@microsoft.com>
Co-authored-by: Aleksandr Savelev <94454577+AleksSavelev@users.noreply.github.com>
  • Loading branch information
5 people authored Mar 26, 2024
1 parent cc324ae commit 79db577
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 40 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Change Log - Power BI Custom Visuals API
## 5.9.0
* `AcquireAADTokenResult` : Extended with additional properties.
* `createOpaqueUtils` : Create an encapsulated utility for the visual.
* Filter API : Exposing new filter type for hierarchy data - HierarchyIdentity.
* `areHierarchicallyRelated` : Requires that the items in the role are hierarchically related.
* `CustomVisualHostEnv`: Extended with `DashboardHost` type for representing tiles and dashboards in embedded environments.

## 5.8.0
* `storageV2Service` : Enables visuals to use the browser's local storage.
* Support For OnObject Formatting:
Expand Down
46 changes: 23 additions & 23 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "powerbi-visuals-api",
"version": "5.8.0",
"version": "5.9.0",
"description": "Power BI Custom Visuals API type definitions for typescript",
"types": "index",
"main": "index.js",
Expand All @@ -21,10 +21,10 @@
},
"homepage": "https://microsoft.github.io/PowerBI-visuals",
"dependencies": {
"semver": "^7.3.5"
"semver": "^7.6.0"
},
"devDependencies": {
"jasmine": "^3.9.0"
"jasmine": "^3.99.0"
},
"scripts": {
"test": "jasmine"
Expand Down
16 changes: 12 additions & 4 deletions schema.capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"$ref": "#/definitions/subtotals"
},
"migration": {
"$ref": "#/definitions/migration"
"$ref": "#/definitions/migration"
},
"keepAllMetadataColumns": {
"type": "boolean",
Expand Down Expand Up @@ -192,7 +192,7 @@
"patternProperties": {
"^[\\w\\s-]+$": {
"description": "Specifies the number of values that can be assigned to this data role in this mapping",
"$ref": "#/definitions/dataViewMapping.numberRangeWithKind"
"$ref": "#/definitions/dataViewMapping.roleCondition"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -576,7 +576,7 @@
}
}
},
"dataViewMapping.numberRangeWithKind": {
"dataViewMapping.roleCondition": {
"allOf": [
{
"$ref": "#/definitions/dataViewMapping.numberRange"
Expand All @@ -587,6 +587,14 @@
"$ref": "#/definitions/dataRole.kind"
}
}
},
{
"properties": {
"areHierarchicallyRelated": {
"type": "boolean",
"description": "Requires that the items in this role are hierarchically related."
}
}
}
]
},
Expand Down Expand Up @@ -1643,4 +1651,4 @@
]
}
}
}
}
51 changes: 41 additions & 10 deletions src/visuals-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1533,21 +1533,42 @@ declare module powerbi.extensibility {
}

declare module powerbi.extensibility {

/**
* Interface representing information about the user associated with the token.
*/
export interface AcquireAADTokenUserInfo {
userId?: string; // Unique identifier for the user
tenantId?: string; // Unique identifier for the tenant
}

/**
* Interface representing the result of acquiring a Microsoft Entra ID token.
*/
export interface AcquireAADTokenResult {
accessToken?: string;
accessToken?: string; // Access token issued by Microsoft Entra ID
expiresOn?: number; // Expiration time of the access token
userInfo?: AcquireAADTokenUserInfo; // Information about the user associated with the token
}

/**
* Interface representing a service for acquiring authentication tokens from Microsoft Entra ID.
*/
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
*/
/**
* Retrieves an authentication token payload.
*
* The audience is determined by the visual's `AADAuthentication` privilege parameter.
* The scope is formed by concatenating the visual's GUID with "_CV_ForPBI".
*
* @returns A promise that resolves to the authentication token payload.
*/
acquireAADToken(): IPromise<AcquireAADTokenResult>;

/**
* Returns the availability status of the service.
* Retrieves the availability status of the service.
*
* @returns the promise that resolves to privilege status of the service
* @returns A promise that resolves to the privilege status of the service.
*/
acquireAADTokenstatus(): IPromise<PrivilegeStatus>;
}
Expand Down Expand Up @@ -1736,7 +1757,7 @@ declare module powerbi.extensibility {

declare module powerbi.extensibility {
export interface IVisualSubSelectionService {
//** Emits the custom visual's sub-selection to PowerBI */
//** Emits the custom visual's sub-selection to PowerBI */
subSelect(subSelection: powerbi.visuals.CustomVisualSubSelection): void;
//** Sends the custom visual's sub-selection outlines to the PowerBI's outline renderer */
updateRegionOutlines(outlines: powerbi.visuals.SubSelectionRegionOutline[]): void;
Expand All @@ -1751,14 +1772,23 @@ declare namespace powerbi.common {
Embed = 1 << 3,
ReportServer = 1 << 4,
ExportReportHost = 1 << 5,
Mobile = 1 << 6
Mobile = 1 << 6,
DashboardHost = 1 << 7
}
}

declare module powerbi {
export interface IFilter { }
}

declare module powerbi.extensibility {
/** Provides encapsulated utility functions for the visual. */
export interface ICustomVisualsOpaqueUtils {
/** Compares the two CustomVisualOpaqueIdentity values for equality. */
compareCustomVisualOpaqueIdentities(identity1: powerbi.visuals.CustomVisualOpaqueIdentity, identity2: powerbi.visuals.CustomVisualOpaqueIdentity): boolean;
}
}

/**
* Change Log Version 1.13.0
* Expanded `host.colorPalette` now expose a boolean `isHighContrast` flag and several non-data colors
Expand Down Expand Up @@ -1815,6 +1845,7 @@ declare module powerbi.extensibility.visual {
setCanDrill: (drillAllowed: boolean) => void;
storageV2Service: IVisualLocalStorageV2Service;
subSelectionService: IVisualSubSelectionService;
createOpaqueUtils: () => ICustomVisualsOpaqueUtils;
}

export interface VisualOnObjectFormatting {
Expand Down Expand Up @@ -1898,4 +1929,4 @@ declare module powerbi.extensibility.visual {
queryName: string;
sortDirection: SortDirection;
}
}
}

0 comments on commit 79db577

Please sign in to comment.