Skip to content

Commit cbe8c2a

Browse files
committed
Merge remote-tracking branch 'powerbi/master'
2 parents 612237b + d5efb92 commit cbe8c2a

File tree

7 files changed

+41
-8
lines changed

7 files changed

+41
-8
lines changed

dist/powerbi-client.d.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! powerbi-client v2.7.0 | (c) 2016 Microsoft Corporation MIT */
1+
/*! powerbi-client v2.7.1 | (c) 2016 Microsoft Corporation MIT */
22
declare module "util" {
33
/**
44
* Raises a custom event with event data on the specified HTML element.
@@ -572,6 +572,12 @@ declare module "visualDescriptor" {
572572
* @returns {(Promise<models.ISlicerState>)}
573573
*/
574574
getSlicerState(): Promise<models.ISlicerState>;
575+
/**
576+
* Clone existing visual to a new instance.
577+
*
578+
* @returns {(Promise<models.ICloneVisualResponse>)}
579+
*/
580+
clone(request?: models.ICloneVisualRequest): Promise<models.ICloneVisualResponse>;
575581
}
576582
}
577583
declare module "page" {

dist/powerbi.js

+15-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/powerbi.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "powerbi-client",
3-
"version": "2.7.0",
3+
"version": "2.7.1",
44
"description": "JavaScript library for embedding Power BI into your apps. Provides service which makes it easy to embed different types of components and an object model which allows easy interaction with these components such as changing pages, applying filters, and responding to data selection.",
55
"main": "dist/powerbi.js",
66
"typings": "dist/powerbi-client.d.ts",

src/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const config = {
2-
version: '2.7.0',
2+
version: '2.7.1',
33
type: 'js'
44
};
55

src/embed.ts

+1
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ export abstract class Embed {
383383
*/
384384
setAccessToken(accessToken: string): Promise<void> {
385385
var embedType = this.config.type;
386+
embedType = (embedType === 'create' || embedType === 'visual' || embedType === 'qna') ? 'report' : embedType;
386387
return this.service.hpm.post<models.IError[]>('/' + embedType + '/token', accessToken, { uid: this.config.uniqueId }, this.iframe.contentWindow)
387388
.then(response => {
388389
this.config.accessToken = accessToken;

src/visualDescriptor.ts

+13
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,17 @@ export class VisualDescriptor implements IVisualNode, IFilterable {
175175
throw response.body;
176176
});
177177
}
178+
179+
/**
180+
* Clone existing visual to a new instance.
181+
*
182+
* @returns {(Promise<models.ICloneVisualResponse>)}
183+
*/
184+
clone(request: models.ICloneVisualRequest = {}): Promise<models.ICloneVisualResponse> {
185+
return this.page.report.service.hpm.post<models.ICloneVisualResponse>(`/report/pages/${this.page.name}/visuals/${this.name}/clone`, request, { uid: this.page.report.config.uniqueId }, this.page.report.iframe.contentWindow)
186+
.then(response => response.body,
187+
response => {
188+
throw response.body;
189+
});
190+
}
178191
}

0 commit comments

Comments
 (0)