From 79db577fbaed2f580645d0901a6de68038061a2e Mon Sep 17 00:00:00 2001 From: Roi-Hochler <95178231+Roi-Hochler@users.noreply.github.com> Date: Tue, 26 Mar 2024 09:01:20 +0000 Subject: [PATCH] API 5.9.0 (#88) * 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 Co-authored-by: dbrailov <57748147+dbrailov@users.noreply.github.com> Co-authored-by: aleksSavelev Co-authored-by: Aleksandr Savelev <94454577+AleksSavelev@users.noreply.github.com> --- CHANGELOG.md | 7 ++++++ package-lock.json | 46 ++++++++++++++++++------------------ package.json | 6 ++--- schema.capabilities.json | 16 +++++++++---- src/visuals-api.d.ts | 51 ++++++++++++++++++++++++++++++++-------- 5 files changed, 86 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2036a09..e114b08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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: diff --git a/package-lock.json b/package-lock.json index 46fbdf8..d69a3c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,18 @@ { "name": "powerbi-visuals-api", - "version": "5.8.0", + "version": "5.9.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "powerbi-visuals-api", - "version": "5.8.0", + "version": "5.9.0", "license": "MIT", "dependencies": { - "semver": "^7.3.5" + "semver": "^7.6.0" }, "devDependencies": { - "jasmine": "^3.9.0" + "jasmine": "^3.99.0" } }, "node_modules/balanced-match": { @@ -34,25 +34,25 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, @@ -66,7 +66,7 @@ "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "dependencies": { "once": "^1.3.0", @@ -93,9 +93,9 @@ } }, "node_modules/jasmine-core": { - "version": "3.99.0", - "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.99.0.tgz", - "integrity": "sha512-+ZDaJlEfRopINQqgE+hvzRyDIQDeKfqqTvF8RzXsvU1yE3pBDRud2+Qfh9WvGgRpuzqxyQJVI6Amy5XQ11r/3w==", + "version": "3.99.1", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.99.1.tgz", + "integrity": "sha512-Hu1dmuoGcZ7AfyynN3LsfruwMbxMALMka+YtZeGoLuDEySVmVAPaonkNoBRIw/ectu8b9tVQCJNgp4a4knp+tg==", "dev": true }, "node_modules/lru-cache": { @@ -110,9 +110,9 @@ } }, "node_modules/minimatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.1.tgz", - "integrity": "sha512-reLxBcKUPNBnc/sVtAbxgRVFSegoGeLaSjmphNhcwcolhYLRgtJscn5mRl6YRZNQv40Y7P6JM2YhSIsbL9OB5A==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -124,7 +124,7 @@ "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "dependencies": { "wrappy": "1" @@ -133,16 +133,16 @@ "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -156,7 +156,7 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, "node_modules/yallist": { diff --git a/package.json b/package.json index 976f006..8bb2a4d 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" diff --git a/schema.capabilities.json b/schema.capabilities.json index bfb510e..0335cc1 100644 --- a/schema.capabilities.json +++ b/schema.capabilities.json @@ -74,7 +74,7 @@ "$ref": "#/definitions/subtotals" }, "migration": { - "$ref": "#/definitions/migration" + "$ref": "#/definitions/migration" }, "keepAllMetadataColumns": { "type": "boolean", @@ -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 @@ -576,7 +576,7 @@ } } }, - "dataViewMapping.numberRangeWithKind": { + "dataViewMapping.roleCondition": { "allOf": [ { "$ref": "#/definitions/dataViewMapping.numberRange" @@ -587,6 +587,14 @@ "$ref": "#/definitions/dataRole.kind" } } + }, + { + "properties": { + "areHierarchicallyRelated": { + "type": "boolean", + "description": "Requires that the items in this role are hierarchically related." + } + } } ] }, @@ -1643,4 +1651,4 @@ ] } } -} +} \ No newline at end of file diff --git a/src/visuals-api.d.ts b/src/visuals-api.d.ts index 52fdf70..8e3b293 100644 --- a/src/visuals-api.d.ts +++ b/src/visuals-api.d.ts @@ -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; /** - * 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; } @@ -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; @@ -1751,7 +1772,8 @@ declare namespace powerbi.common { Embed = 1 << 3, ReportServer = 1 << 4, ExportReportHost = 1 << 5, - Mobile = 1 << 6 + Mobile = 1 << 6, + DashboardHost = 1 << 7 } } @@ -1759,6 +1781,14 @@ 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 @@ -1815,6 +1845,7 @@ declare module powerbi.extensibility.visual { setCanDrill: (drillAllowed: boolean) => void; storageV2Service: IVisualLocalStorageV2Service; subSelectionService: IVisualSubSelectionService; + createOpaqueUtils: () => ICustomVisualsOpaqueUtils; } export interface VisualOnObjectFormatting { @@ -1898,4 +1929,4 @@ declare module powerbi.extensibility.visual { queryName: string; sortDirection: SortDirection; } -} +} \ No newline at end of file