@microsoft/applicationinsights-analytics-js 2.8.0-nightly.2202-06 → 2.8.0-nightly.2204-04
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/applicationinsights-analytics-js.integrity.json +9 -9
- package/browser/applicationinsights-analytics-js.js +1774 -924
- package/browser/applicationinsights-analytics-js.js.map +1 -1
- package/browser/applicationinsights-analytics-js.min.js +2 -2
- package/browser/applicationinsights-analytics-js.min.js.map +1 -1
- package/dist/applicationinsights-analytics-js.api.json +138 -229
- package/dist/applicationinsights-analytics-js.api.md +8 -18
- package/dist/applicationinsights-analytics-js.d.ts +9 -104
- package/dist/applicationinsights-analytics-js.js +1774 -924
- package/dist/applicationinsights-analytics-js.js.map +1 -1
- package/dist/applicationinsights-analytics-js.min.js +2 -2
- package/dist/applicationinsights-analytics-js.min.js.map +1 -1
- package/dist/applicationinsights-analytics-js.rollup.d.ts +9 -104
- package/dist-esm/JavaScriptSDK/AnalyticsPlugin.js +674 -0
- package/dist-esm/JavaScriptSDK/AnalyticsPlugin.js.map +1 -0
- package/dist-esm/JavaScriptSDK/Telemetry/PageViewManager.js +21 -8
- package/dist-esm/JavaScriptSDK/Telemetry/PageViewManager.js.map +1 -1
- package/dist-esm/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js +10 -10
- package/dist-esm/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js.map +1 -1
- package/dist-esm/JavaScriptSDK/Telemetry/PageVisitTimeManager.js +5 -5
- package/dist-esm/JavaScriptSDK/Telemetry/PageVisitTimeManager.js.map +1 -1
- package/dist-esm/JavaScriptSDK/Timing.js +39 -0
- package/dist-esm/JavaScriptSDK/Timing.js.map +1 -0
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryConfig.js +1 -1
- package/dist-esm/applicationinsights-analytics-js.js +2 -2
- package/dist-esm/applicationinsights-analytics-js.js.map +1 -1
- package/package.json +6 -6
- package/src/JavaScriptSDK/{ApplicationInsights.ts → AnalyticsPlugin.ts} +403 -325
- package/src/JavaScriptSDK/Telemetry/PageViewManager.ts +32 -13
- package/src/JavaScriptSDK/Telemetry/PageViewPerformanceManager.ts +6 -6
- package/src/JavaScriptSDK/Telemetry/PageVisitTimeManager.ts +1 -1
- package/src/JavaScriptSDK/Timing.ts +46 -0
- package/src/applicationinsights-analytics-js.ts +1 -1
- package/types/JavaScriptSDK/{ApplicationInsights.d.ts → AnalyticsPlugin.d.ts} +12 -16
- package/types/JavaScriptSDK/Telemetry/PageViewManager.d.ts +2 -1
- package/types/JavaScriptSDK/Telemetry/PageViewPerformanceManager.d.ts +9 -9
- package/types/JavaScriptSDK/Telemetry/PageVisitTimeManager.d.ts +4 -4
- package/types/JavaScriptSDK/Timing.d.ts +18 -0
- package/types/applicationinsights-analytics-js.d.ts +1 -1
- package/types/tsdoc-metadata.json +1 -1
- package/dist-esm/JavaScriptSDK/ApplicationInsights.js +0 -606
- package/dist-esm/JavaScriptSDK/ApplicationInsights.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights JavaScript SDK - Web Analytics, 2.8.0-nightly.
|
|
2
|
+
* Microsoft Application Insights JavaScript SDK - Web Analytics, 2.8.0-nightly.2204-04
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -21,7 +21,6 @@ import { IConfig } from '@microsoft/applicationinsights-common';
|
|
|
21
21
|
import { IConfiguration } from '@microsoft/applicationinsights-core-js';
|
|
22
22
|
import { ICookieMgr } from '@microsoft/applicationinsights-core-js';
|
|
23
23
|
import { ICustomProperties } from '@microsoft/applicationinsights-core-js';
|
|
24
|
-
import { IDiagnosticLogger } from '@microsoft/applicationinsights-core-js';
|
|
25
24
|
import { IEventTelemetry } from '@microsoft/applicationinsights-common';
|
|
26
25
|
import { IExceptionTelemetry } from '@microsoft/applicationinsights-common';
|
|
27
26
|
import { IMetricTelemetry } from '@microsoft/applicationinsights-common';
|
|
@@ -31,22 +30,19 @@ import { IPageViewTelemetry } from '@microsoft/applicationinsights-common';
|
|
|
31
30
|
import { IPageViewTelemetryInternal } from '@microsoft/applicationinsights-common';
|
|
32
31
|
import { IPlugin } from '@microsoft/applicationinsights-core-js';
|
|
33
32
|
import { IProcessTelemetryContext } from '@microsoft/applicationinsights-core-js';
|
|
33
|
+
import { ITelemetryInitializerHandler } from '@microsoft/applicationinsights-core-js';
|
|
34
34
|
import { ITelemetryItem } from '@microsoft/applicationinsights-core-js';
|
|
35
35
|
import { ITelemetryPluginChain } from '@microsoft/applicationinsights-core-js';
|
|
36
36
|
import { ITraceTelemetry } from '@microsoft/applicationinsights-common';
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
declare class AnalyticsPlugin extends BaseTelemetryPlugin implements IAppInsights, IAppInsightsInternal {
|
|
39
39
|
static Version: string;
|
|
40
|
-
static getDefaultConfig
|
|
40
|
+
static getDefaultConfig: typeof _getDefaultConfig;
|
|
41
41
|
identifier: string;
|
|
42
42
|
priority: number;
|
|
43
43
|
config: IConfig;
|
|
44
44
|
queue: Array<() => void>;
|
|
45
45
|
autoRoutePVDelay: number;
|
|
46
|
-
protected _telemetryInitializers: Array<(envelope: ITelemetryItem) => boolean | void>;
|
|
47
|
-
protected _pageViewManager: PageViewManager;
|
|
48
|
-
protected _pageViewPerformanceManager: PageViewPerformanceManager;
|
|
49
|
-
protected _pageVisitTimeManager: PageVisitTimeManager;
|
|
50
46
|
constructor();
|
|
51
47
|
/**
|
|
52
48
|
* Get the current cookie manager for this instance
|
|
@@ -170,9 +166,13 @@ export declare class ApplicationInsights extends BaseTelemetryPlugin implements
|
|
|
170
166
|
* @memberof ApplicationInsights
|
|
171
167
|
*/
|
|
172
168
|
_onerror(exception: IAutoExceptionTelemetry): void;
|
|
173
|
-
addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): void;
|
|
169
|
+
addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): ITelemetryInitializerHandler | void;
|
|
174
170
|
initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
|
|
175
171
|
}
|
|
172
|
+
export { AnalyticsPlugin }
|
|
173
|
+
export { AnalyticsPlugin as ApplicationInsights }
|
|
174
|
+
|
|
175
|
+
declare function _getDefaultConfig(config?: IConfig): IConfig;
|
|
176
176
|
|
|
177
177
|
/**
|
|
178
178
|
* Internal interface to pass appInsights object to subcomponents without coupling
|
|
@@ -182,99 +182,4 @@ export declare interface IAppInsightsInternal {
|
|
|
182
182
|
sendPageViewPerformanceInternal(pageViewPerformance: IPageViewPerformanceTelemetryInternal, properties?: Object, systemProperties?: Object): void;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
/**
|
|
186
|
-
* Class encapsulates sending page views and page view performance telemetry.
|
|
187
|
-
*/
|
|
188
|
-
declare class PageViewManager {
|
|
189
|
-
constructor(appInsights: IAppInsightsInternal, overridePageViewDuration: boolean, core: IAppInsightsCore, pageViewPerformanceManager: PageViewPerformanceManager);
|
|
190
|
-
/**
|
|
191
|
-
* Currently supported cases:
|
|
192
|
-
* 1) (default case) track page view called with default parameters, overridePageViewDuration = false. Page view is sent with page view performance when navigation timing data is available.
|
|
193
|
-
* a. If navigation timing is not supported then page view is sent right away with undefined duration. Page view performance is not sent.
|
|
194
|
-
* 2) overridePageViewDuration = true, custom duration provided. Custom duration is used, page view sends right away.
|
|
195
|
-
* 3) overridePageViewDuration = true, custom duration NOT provided. Page view is sent right away, duration is time spent from page load till now (or undefined if navigation timing is not supported).
|
|
196
|
-
* 4) overridePageViewDuration = false, custom duration is provided. Page view is sent right away with custom duration.
|
|
197
|
-
*
|
|
198
|
-
* In all cases page view performance is sent once (only for the 1st call of trackPageView), or not sent if navigation timing is not supported.
|
|
199
|
-
*/
|
|
200
|
-
trackPageView(pageView: IPageViewTelemetry, customProperties?: {
|
|
201
|
-
[key: string]: any;
|
|
202
|
-
}): void;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Class encapsulates sending page view performance telemetry.
|
|
207
|
-
*/
|
|
208
|
-
declare class PageViewPerformanceManager {
|
|
209
|
-
private _logger;
|
|
210
|
-
private MAX_DURATION_ALLOWED;
|
|
211
|
-
constructor(core: IAppInsightsCore);
|
|
212
|
-
populatePageViewPerformanceEvent(pageViewPerformance: IPageViewPerformanceTelemetryInternal): void;
|
|
213
|
-
getPerformanceTiming(): PerformanceTiming | null;
|
|
214
|
-
getPerformanceNavigationTiming(): PerformanceNavigationTiming | null;
|
|
215
|
-
/**
|
|
216
|
-
* Returns true is window PerformanceNavigationTiming API is supported, false otherwise.
|
|
217
|
-
*/
|
|
218
|
-
isPerformanceNavigationTimingSupported(): boolean;
|
|
219
|
-
/**
|
|
220
|
-
* Returns true is window performance timing API is supported, false otherwise.
|
|
221
|
-
*/
|
|
222
|
-
isPerformanceTimingSupported(): PerformanceTiming;
|
|
223
|
-
/**
|
|
224
|
-
* As page loads different parts of performance timing numbers get set. When all of them are set we can report it.
|
|
225
|
-
* Returns true if ready, false otherwise.
|
|
226
|
-
*/
|
|
227
|
-
isPerformanceTimingDataReady(): boolean;
|
|
228
|
-
/**
|
|
229
|
-
* This method tells if given durations should be excluded from collection.
|
|
230
|
-
*/
|
|
231
|
-
shouldCollectDuration(...durations: number[]): boolean;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
declare class PageVisitData {
|
|
235
|
-
pageName: string;
|
|
236
|
-
pageUrl: string;
|
|
237
|
-
pageVisitStartTime: number;
|
|
238
|
-
pageVisitTime: number;
|
|
239
|
-
constructor(pageName: string, pageUrl: string);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Used to track page visit durations
|
|
244
|
-
*/
|
|
245
|
-
declare class PageVisitTimeManager {
|
|
246
|
-
private prevPageVisitDataKeyName;
|
|
247
|
-
private pageVisitTimeTrackingHandler;
|
|
248
|
-
private _logger;
|
|
249
|
-
/**
|
|
250
|
-
* Creates a new instance of PageVisitTimeManager
|
|
251
|
-
* @param pageVisitTimeTrackingHandler Delegate that will be called to send telemetry data to AI (when trackPreviousPageVisit is called)
|
|
252
|
-
* @returns {}
|
|
253
|
-
*/
|
|
254
|
-
constructor(logger: IDiagnosticLogger, pageVisitTimeTrackingHandler: (pageName: string, pageUrl: string, pageVisitTime: number) => void);
|
|
255
|
-
/**
|
|
256
|
-
* Tracks the previous page visit time telemetry (if exists) and starts timing of new page visit time
|
|
257
|
-
* @param currentPageName Name of page to begin timing for visit duration
|
|
258
|
-
* @param currentPageUrl Url of page to begin timing for visit duration
|
|
259
|
-
*/
|
|
260
|
-
trackPreviousPageVisit(currentPageName: string, currentPageUrl: string): void;
|
|
261
|
-
/**
|
|
262
|
-
* Stops timing of current page (if exists) and starts timing for duration of visit to pageName
|
|
263
|
-
* @param pageName Name of page to begin timing visit duration
|
|
264
|
-
* @returns {PageVisitData} Page visit data (including duration) of pageName from last call to start or restart, if exists. Null if not.
|
|
265
|
-
*/
|
|
266
|
-
restartPageVisitTimer(pageName: string, pageUrl: string): PageVisitData;
|
|
267
|
-
/**
|
|
268
|
-
* Starts timing visit duration of pageName
|
|
269
|
-
* @param pageName
|
|
270
|
-
* @returns {}
|
|
271
|
-
*/
|
|
272
|
-
startPageVisitTimer(pageName: string, pageUrl: string): void;
|
|
273
|
-
/**
|
|
274
|
-
* Stops timing of current page, if exists.
|
|
275
|
-
* @returns {PageVisitData} Page visit data (including duration) of pageName from call to start, if exists. Null if not.
|
|
276
|
-
*/
|
|
277
|
-
stopPageVisitTimer(): PageVisitData;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
185
|
export { }
|