Skip to content

Commit a354588

Browse files
committed
Merged PR 245022: eventHooks Improvements - Release version 2.20.0
hosting apps (like TypeScript) that creates a double instance of `service` will cause double registration for eventHooks listener which leads to miss the callback from the iframe. moving `router.post` from `service` constructor to `report` constructor resolves the issue.
1 parent 220c826 commit a354588

10 files changed

+2072
-339
lines changed

dist/powerbi-client.d.ts

+18-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// powerbi-client v2.19.1
1+
// powerbi-client v2.20.0
22
// Copyright (c) Microsoft Corporation.
33
// Licensed under the MIT License.
44
declare module "config" {
@@ -150,6 +150,14 @@ declare module "embed" {
150150
test(event: IEvent<T>): boolean;
151151
handle(event: ICustomEvent<T>): void;
152152
}
153+
/** @hidden */
154+
export interface ISessionHeaders {
155+
uid: string;
156+
sdkSessionId: string;
157+
tokenProviderSupplied?: boolean;
158+
bootstrapped?: boolean;
159+
sdkVersion?: string;
160+
}
153161
/**
154162
* Base class for all Power BI embed components
155163
*
@@ -426,12 +434,12 @@ declare module "embed" {
426434
*/
427435
populateConfig(config: IBootstrapEmbedConfiguration, isBootstrap: boolean): void;
428436
/**
429-
* Validate EventHooks
430-
*
431-
* @private
432-
* @param {models.EventHooks} eventHooks
433-
* @hidden
434-
*/
437+
* Validate EventHooks
438+
*
439+
* @private
440+
* @param {models.EventHooks} eventHooks
441+
* @hidden
442+
*/
435443
private validateEventHooks;
436444
/**
437445
* Adds locale parameters to embedUrl
@@ -1998,7 +2006,7 @@ declare module "visual" {
19982006
declare module "service" {
19992007
import { WindowPostMessageProxy } from 'window-post-message-proxy';
20002008
import { HttpPostMessage } from 'http-post-message';
2001-
import { Router } from 'powerbi-router';
2009+
import { Router, IExtendedRequest, Response as IExtendedResponse } from 'powerbi-router';
20022010
import { IReportCreateConfiguration } from 'powerbi-models';
20032011
import { Embed, IBootstrapEmbedConfiguration, IDashboardEmbedConfiguration, IEmbedConfiguration, IEmbedConfigurationBase, IQnaEmbedConfiguration, IReportEmbedConfiguration, ITileEmbedConfiguration, IVisualEmbedConfiguration } from "embed";
20042012
export interface IEvent<T> {
@@ -2091,7 +2099,7 @@ declare module "service" {
20912099
* @hidden
20922100
*/
20932101
wpmp: WindowPostMessageProxy;
2094-
private router;
2102+
router: Router;
20952103
private uniqueSessionId;
20962104
/**
20972105
* Creates an instance of a Power BI Service.
@@ -2228,7 +2236,7 @@ declare module "service" {
22282236
* @hidden
22292237
*/
22302238
handleTileEvents(event: IEvent<any>): void;
2231-
private invokeSDKHook;
2239+
invokeSDKHook(hook: Function, req: IExtendedRequest, res: IExtendedResponse): Promise<void>;
22322240
/**
22332241
* Given an event object, finds the embed component with the matching type and ID, and invokes its handleEvent method with the event object.
22342242
*

0 commit comments

Comments
 (0)