Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"http-server": "^0.9.0",
"jquery": "^3.1.0",
"powerbi-client": "file:..",
"powerbi-report-authoring": "^1.0",
"powerbi-report-authoring": "^1.1",
"syntaxhighlighter": "4.0.1"
},
"devDependencies": {}
Expand Down
25 changes: 18 additions & 7 deletions demo/v2-demo/scripts/aisdk.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
const appUrl = 'https://powerbiplaygroundbe.azurewebsites.net/App';
const appUrlEnabled = false;
const defaultInstrumentationKey = "ffe7093c-af96-4df9-8452-b9f4b35ccded";

var appInsightsInstanceDeferred = $.Deferred();

$.getJSON(appUrl, function (appConfig) {
if (appUrlEnabled) {
$.getJSON(appUrl, function (appConfig) {
createAppInsightsInstance(appConfig.instrumentationKey);
});
}
else {
createAppInsightsInstance(defaultInstrumentationKey);
}

function createAppInsightsInstance(instrumentationKey) {
// Application Insights setup
var sdkInstance="appInsightsSDK";window[sdkInstance]="appInsights";var aiName=window[sdkInstance],aisdk=window[aiName]||function(e){function n(e){t[e]=function(){var n=arguments;t.queue.push(function(){t[e].apply(t,n)})}}var t={config:e};t.initialize=!0;var i=document,a=window;setTimeout(function(){var n=i.createElement("script");n.src=e.url||"https://az416426.vo.msecnd.net/scripts/b/ai.2.min.js",i.getElementsByTagName("script")[0].parentNode.appendChild(n)});try{t.cookie=i.cookie}catch(e){}t.queue=[],t.version=2;for(var r=["Event","PageView","Exception","Trace","DependencyData","Metric","PageViewPerformance"];r.length;)n("track"+r.pop());n("startTrackPage"),n("stopTrackPage");var s="Track"+r[0];if(n("start"+s),n("stop"+s),n("addTelemetryInitializer"),n("setAuthenticatedUserContext"),n("clearAuthenticatedUserContext"),n("flush"),!(!0===e.disableExceptionTracking||e.extensionConfig&&e.extensionConfig.ApplicationInsightsAnalytics&&!0===e.extensionConfig.ApplicationInsightsAnalytics.disableExceptionTracking)){n("_"+(r="onerror"));var o=a[r];a[r]=function(e,n,i,a,s){var c=o&&o(e,n,i,a,s);return!0!==c&&t["_"+r]({message:e,url:n,lineNumber:i,columnNumber:a,error:s}),c},e.autoExceptionInstrumented=!0}return t}(
{
instrumentationKey: appConfig.instrumentationKey
}
);window[aiName]=aisdk,aisdk.queue&&0===aisdk.queue.length&&aisdk.trackPageView({});
{
instrumentationKey: instrumentationKey
}
);window[aiName]=aisdk,aisdk.queue&&0===aisdk.queue.length&&aisdk.trackPageView({});

appInsightsInstanceDeferred.resolve(appInsights);
});
appInsightsInstanceDeferred.resolve(appInsights);
}

function getAppInsightsInstance() {
return appInsightsInstanceDeferred;
Expand Down
36 changes: 25 additions & 11 deletions dist/powerbi-client.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! powerbi-client v2.13.2 | (c) 2016 Microsoft Corporation MIT */
/*! powerbi-client v2.14.1 | (c) 2016 Microsoft Corporation MIT */
declare module "util" {
import { HttpPostMessage } from 'http-post-message';
/**
Expand Down Expand Up @@ -93,6 +93,14 @@ declare module "util" {
* Returns random number
*/
export function getRandomValue(): number;
/**
* Returns the time interval between two dates in milliseconds
* @export
* @param {Date} start
* @param {Date} end
* @returns {number}
*/
export function getTimeDiffInMilliseconds(start: Date, end: Date): number;
}
declare module "config" {
/** @ignore */ /** */
Expand All @@ -102,14 +110,6 @@ declare module "config" {
};
export default config;
}
declare module "defaults" {
import * as models from 'powerbi-models';
/** @hidden */
export abstract class Defaults {
static defaultSettings: models.ISettings;
static defaultQnaSettings: models.IQnaSettings;
}
}
declare module "errors" {
export let APINotSupportedForRDLError: string;
export let EmbedUrlNotSupported: string;
Expand Down Expand Up @@ -259,6 +259,15 @@ declare module "embed" {
* @hidden
*/
iframe: HTMLIFrameElement;
/**
* Saves the iframe state. Each iframe should be loaded only once.
* After first load, .embed will go into embedExisting path which will send
* a postMessage of /report/load instead of creating a new iframe.
*
* @type {boolean}
* @hidden
*/
iframeLoaded: boolean;
/**
* Gets or sets the configuration settings for the Power BI embed component.
*
Expand Down Expand Up @@ -300,6 +309,11 @@ declare module "embed" {
* @hidden
*/
frontLoadHandler: () => any;
/**
* The time the last /load request was sent
* @hidden
*/
lastLoadRequest: Date;
/**
* Creates an instance of Embed.
*
Expand Down Expand Up @@ -376,7 +390,7 @@ declare module "embed" {
* @param {boolean} phasedRender
* @returns {Promise<void>}
*/
load(config: IEmbedConfigurationBase, phasedRender?: boolean): Promise<void>;
load(phasedRender?: boolean): Promise<void>;
/**
* Removes one or more event handlers from the list of handlers.
* If a reference to the existing handle function is specified, remove the specific handler.
Expand Down Expand Up @@ -1479,7 +1493,7 @@ declare module "visual" {
* @hidden
*/
constructor(service: service.Service, element: HTMLElement, baseConfig: embed.IEmbedConfigurationBase, phasedRender?: boolean, isBootstrap?: boolean, iframe?: HTMLIFrameElement);
load(baseConfig: embed.IEmbedConfigurationBase, phasedRender?: boolean): Promise<void>;
load(phasedRender?: boolean): Promise<void>;
/**
* Gets the list of pages within the report - not supported in visual embed.
*
Expand Down
Loading