From 849756de1315d5695a407b08370c36ddb5100b64 Mon Sep 17 00:00:00 2001 From: dbrailov <57748147+dbrailov@users.noreply.github.com> Date: Tue, 13 Jun 2023 13:06:16 +0300 Subject: [PATCH] 5.6.0 (#70) Co-authored-by: David Brailovsky --- CHANGELOG.md | 3 + package-lock.json | 135 ++----------------------------------------- package.json | 2 +- src/visuals-api.d.ts | 67 +++++++++++++++++++++ 4 files changed, 75 insertions(+), 132 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebd4282..2d48590 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/package-lock.json b/package-lock.json index af8dc07..a3e3f0b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "powerbi-visuals-api", - "version": "5.4.0", - "lockfileVersion": 1, + "version": "5.6.0", + "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "powerbi-visuals-api", - "version": "5.3.0", + "version": "5.6.0", "license": "MIT", "dependencies": { "semver": "^7.3.5" @@ -164,132 +164,5 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } - }, - "dependencies": { - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "jasmine": { - "version": "3.99.0", - "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.99.0.tgz", - "integrity": "sha512-YIThBuHzaIIcjxeuLmPD40SjxkEcc8i//sGMDKCgkRMVgIwRJf5qyExtlJpQeh7pkeoBSOe6lQEdg+/9uKg9mw==", - "dev": true, - "requires": { - "glob": "^7.1.6", - "jasmine-core": "~3.99.0" - } - }, - "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==", - "dev": true - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, - "minimatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.1.tgz", - "integrity": "sha512-reLxBcKUPNBnc/sVtAbxgRVFSegoGeLaSjmphNhcwcolhYLRgtJscn5mRl6YRZNQv40Y7P6JM2YhSIsbL9OB5A==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "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=", - "dev": true - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "requires": { - "lru-cache": "^6.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 09d7ab8..fa95408 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/visuals-api.d.ts b/src/visuals-api.d.ts index e11940e..9700d76 100644 --- a/src/visuals-api.d.ts +++ b/src/visuals-api.d.ts @@ -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; + + /** + * Returns the availability status of the service. + * + * @returns the promise that resolves to privilege status of the service + */ + acquireAADTokenstatus(): IPromise; + } +} + declare module powerbi { /** * Represents a return type for privilege status query methods @@ -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; + + /** + * 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; + + /** + * 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; + + /** + * 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 @@ -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 {