@microsoft/applicationinsights-core-js 2.8.0-beta.2203-01 → 2.8.0-beta.2203-02
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-core-js.integrity.json +9 -9
- package/browser/applicationinsights-core-js.js +945 -479
- package/browser/applicationinsights-core-js.js.map +1 -1
- package/browser/applicationinsights-core-js.min.js +2 -2
- package/browser/applicationinsights-core-js.min.js.map +1 -1
- package/dist/applicationinsights-core-js.api.json +3904 -877
- package/dist/applicationinsights-core-js.api.md +264 -30
- package/dist/applicationinsights-core-js.d.ts +410 -89
- package/dist/applicationinsights-core-js.js +945 -479
- package/dist/applicationinsights-core-js.js.map +1 -1
- package/dist/applicationinsights-core-js.min.js +2 -2
- package/dist/applicationinsights-core-js.min.js.map +1 -1
- package/dist/applicationinsights-core-js.rollup.d.ts +410 -89
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js +1 -1
- package/dist-esm/JavaScriptSDK/BaseCore.js +66 -23
- package/dist-esm/JavaScriptSDK/BaseCore.js.map +1 -1
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +44 -5
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js.map +1 -1
- package/dist-esm/JavaScriptSDK/ChannelController.js +105 -73
- package/dist-esm/JavaScriptSDK/ChannelController.js.map +1 -1
- package/dist-esm/JavaScriptSDK/Constants.js +1 -1
- package/dist-esm/JavaScriptSDK/CookieMgr.js +3 -4
- package/dist-esm/JavaScriptSDK/CookieMgr.js.map +1 -1
- package/dist-esm/JavaScriptSDK/CoreUtils.js +6 -122
- package/dist-esm/JavaScriptSDK/CoreUtils.js.map +1 -1
- package/dist-esm/JavaScriptSDK/DataCacheHelper.js +93 -0
- package/dist-esm/JavaScriptSDK/DataCacheHelper.js.map +1 -0
- package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +12 -12
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js.map +1 -1
- package/dist-esm/JavaScriptSDK/EnvUtils.js +8 -7
- package/dist-esm/JavaScriptSDK/EnvUtils.js.map +1 -1
- package/dist-esm/JavaScriptSDK/EventHelpers.js +472 -0
- package/dist-esm/JavaScriptSDK/EventHelpers.js.map +1 -0
- package/dist-esm/JavaScriptSDK/HelperFuncs.js +32 -59
- package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
- package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -1
- package/dist-esm/JavaScriptSDK/InternalConstants.js +28 -0
- package/dist-esm/JavaScriptSDK/InternalConstants.js.map +1 -0
- package/dist-esm/JavaScriptSDK/NotificationManager.js +8 -11
- package/dist-esm/JavaScriptSDK/NotificationManager.js.map +1 -1
- package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
- package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +184 -110
- package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js.map +1 -1
- package/dist-esm/JavaScriptSDK/RandomHelper.js +3 -2
- package/dist-esm/JavaScriptSDK/RandomHelper.js.map +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +32 -13
- package/dist-esm/JavaScriptSDK/TelemetryHelpers.js.map +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +4 -6
- package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js.map +1 -1
- package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +90 -96
- package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js.map +1 -1
- package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js +8 -0
- package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js.map +1 -0
- package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -2
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js.map +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +8 -0
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js.map +1 -0
- package/dist-esm/applicationinsights-core-js.js +8 -4
- package/dist-esm/applicationinsights-core-js.js.map +1 -1
- package/package.json +1 -1
- package/src/JavaScriptSDK/BaseCore.ts +80 -24
- package/src/JavaScriptSDK/BaseTelemetryPlugin.ts +76 -5
- package/src/JavaScriptSDK/ChannelController.ts +107 -61
- package/src/JavaScriptSDK/CookieMgr.ts +4 -4
- package/src/JavaScriptSDK/CoreUtils.ts +6 -143
- package/src/JavaScriptSDK/DataCacheHelper.ts +106 -0
- package/src/JavaScriptSDK/DiagnosticLogger.ts +12 -11
- package/src/JavaScriptSDK/EnvUtils.ts +7 -6
- package/src/JavaScriptSDK/EventHelpers.ts +542 -0
- package/src/JavaScriptSDK/HelperFuncs.ts +35 -54
- package/src/JavaScriptSDK/InternalConstants.ts +26 -0
- package/src/JavaScriptSDK/NotificationManager.ts +7 -11
- package/src/JavaScriptSDK/ProcessTelemetryContext.ts +237 -124
- package/src/JavaScriptSDK/RandomHelper.ts +2 -1
- package/src/JavaScriptSDK/TelemetryHelpers.ts +47 -15
- package/src/JavaScriptSDK/TelemetryInitializerPlugin.ts +5 -15
- package/src/JavaScriptSDK.Enums/LoggingEnums.ts +184 -87
- package/src/JavaScriptSDK.Enums/TelemetryUnloadReason.ts +27 -0
- package/src/JavaScriptSDK.Interfaces/IAppInsightsCore.ts +20 -0
- package/src/JavaScriptSDK.Interfaces/IChannelControls.ts +9 -2
- package/src/JavaScriptSDK.Interfaces/IProcessTelemetryContext.ts +55 -16
- package/src/JavaScriptSDK.Interfaces/ITelemetryPlugin.ts +16 -9
- package/src/JavaScriptSDK.Interfaces/ITelemetryPluginChain.ts +9 -11
- package/src/JavaScriptSDK.Interfaces/ITelemetryUnloadState.ts +10 -0
- package/types/JavaScriptSDK/BaseCore.d.ts +4 -0
- package/types/JavaScriptSDK/BaseTelemetryPlugin.d.ts +20 -1
- package/types/JavaScriptSDK/ChannelController.d.ts +4 -0
- package/types/JavaScriptSDK/CoreUtils.d.ts +1 -42
- package/types/JavaScriptSDK/DataCacheHelper.d.ts +13 -0
- package/types/JavaScriptSDK/EventHelpers.d.ts +152 -0
- package/types/JavaScriptSDK/HelperFuncs.d.ts +8 -17
- package/types/JavaScriptSDK/InternalConstants.d.ts +20 -0
- package/types/JavaScriptSDK/ProcessTelemetryContext.d.ts +10 -3
- package/types/JavaScriptSDK/TelemetryHelpers.d.ts +8 -0
- package/types/JavaScriptSDK/TelemetryInitializerPlugin.d.ts +0 -7
- package/types/JavaScriptSDK.Enums/LoggingEnums.d.ts +91 -2
- package/types/JavaScriptSDK.Enums/TelemetryUnloadReason.d.ts +9 -0
- package/types/JavaScriptSDK.Interfaces/IAppInsightsCore.d.ts +17 -0
- package/types/JavaScriptSDK.Interfaces/IChannelControls.d.ts +9 -2
- package/types/JavaScriptSDK.Interfaces/IProcessTelemetryContext.d.ts +49 -14
- package/types/JavaScriptSDK.Interfaces/ITelemetryPlugin.d.ts +15 -8
- package/types/JavaScriptSDK.Interfaces/ITelemetryPluginChain.d.ts +9 -10
- package/types/JavaScriptSDK.Interfaces/ITelemetryUnloadState.d.ts +6 -0
- package/types/applicationinsights-core-js.d.ts +6 -3
|
@@ -5,13 +5,11 @@
|
|
|
5
5
|
import { ITelemetryItem } from "./ITelemetryItem";
|
|
6
6
|
import { IConfiguration } from "./IConfiguration";
|
|
7
7
|
import { IAppInsightsCore } from "./IAppInsightsCore";
|
|
8
|
-
import { IProcessTelemetryContext } from "./IProcessTelemetryContext";
|
|
8
|
+
import { IProcessTelemetryContext, IProcessTelemetryUnloadContext } from "./IProcessTelemetryContext";
|
|
9
9
|
import { ITelemetryPluginChain } from "./ITelemetryPluginChain";
|
|
10
|
+
import { ITelemetryUnloadState } from "./ITelemetryUnloadState";
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
* Configuration provided to SDK core
|
|
13
|
-
*/
|
|
14
|
-
export interface ITelemetryPlugin extends IPlugin {
|
|
12
|
+
export interface ITelemetryProcessor {
|
|
15
13
|
/**
|
|
16
14
|
* Call back for telemetry processing before it it is sent
|
|
17
15
|
* @param env - This is the current event being reported
|
|
@@ -20,7 +18,12 @@ export interface ITelemetryPlugin extends IPlugin {
|
|
|
20
18
|
* to later plugins (vs appending items to the telemetry item)
|
|
21
19
|
*/
|
|
22
20
|
processTelemetry: (env: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => void;
|
|
23
|
-
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Configuration provided to SDK core
|
|
25
|
+
*/
|
|
26
|
+
export interface ITelemetryPlugin extends ITelemetryProcessor, IPlugin {
|
|
24
27
|
/**
|
|
25
28
|
* Set next extension for telemetry processing, this is not optional as plugins should use the
|
|
26
29
|
* processNext() function of the passed IProcessTelemetryContext instead. It is being kept for
|
|
@@ -52,10 +55,14 @@ export interface IPlugin {
|
|
|
52
55
|
isInitialized?: () => boolean;
|
|
53
56
|
|
|
54
57
|
/**
|
|
55
|
-
* Tear down the plugin and remove any hooked value, the plugin should
|
|
56
|
-
* therefore
|
|
58
|
+
* Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and
|
|
59
|
+
* therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further
|
|
60
|
+
* processTelemetry calls are ignored and it just calls the processNext() with the provided context.
|
|
61
|
+
* @param unloadCtx - This is the context that should be used during unloading.
|
|
62
|
+
* @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
|
|
63
|
+
* @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
|
|
57
64
|
*/
|
|
58
|
-
teardown?: () => void;
|
|
65
|
+
teardown?: (unloadCtx: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => void | boolean;
|
|
59
66
|
|
|
60
67
|
/**
|
|
61
68
|
* Extension name
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
"use strict";
|
|
4
3
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { IProcessTelemetryUnloadContext } from "./IProcessTelemetryContext";
|
|
5
|
+
import { ITelemetryPlugin, ITelemetryProcessor } from "./ITelemetryPlugin";
|
|
6
|
+
import { ITelemetryUnloadState } from "./ITelemetryUnloadState";
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Configuration provided to SDK core
|
|
11
10
|
*/
|
|
12
|
-
export interface ITelemetryPluginChain {
|
|
11
|
+
export interface ITelemetryPluginChain extends ITelemetryProcessor {
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Returns the underlying plugin that is being proxied for the processTelemetry call
|
|
@@ -22,11 +21,10 @@ export interface ITelemetryPluginChain {
|
|
|
22
21
|
getNext: () => ITelemetryPluginChain;
|
|
23
22
|
|
|
24
23
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @param
|
|
28
|
-
*
|
|
29
|
-
* to later plugins (vs appending items to the telemetry item)
|
|
24
|
+
* This plugin is being unloaded and should remove any hooked events and cleanup any global/scoped values, after this
|
|
25
|
+
* call the plugin will be removed from the telemetry processing chain and will no longer receive any events..
|
|
26
|
+
* @param unloadCtx - The unload context to use for this call.
|
|
27
|
+
* @param unloadState - The details of the unload operation
|
|
30
28
|
*/
|
|
31
|
-
|
|
29
|
+
unload?: (unloadCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
|
|
32
30
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { TelemetryUnloadReason } from "../JavaScriptSDK.Enums/TelemetryUnloadReason";
|
|
5
|
+
|
|
6
|
+
export interface ITelemetryUnloadState {
|
|
7
|
+
reason: TelemetryUnloadReason;
|
|
8
|
+
isAsync: boolean;
|
|
9
|
+
flushComplete?: boolean;
|
|
10
|
+
}
|
|
@@ -61,5 +61,9 @@ export declare class BaseCore implements IAppInsightsCore {
|
|
|
61
61
|
*/
|
|
62
62
|
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
|
|
63
63
|
getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
|
|
64
|
+
/**
|
|
65
|
+
* Returns the unique event namespace that should be used
|
|
66
|
+
*/
|
|
67
|
+
evtNamespace(): string;
|
|
64
68
|
protected releaseQueue(): void;
|
|
65
69
|
}
|
|
@@ -3,9 +3,10 @@ import { IConfiguration } from "../JavaScriptSDK.Interfaces/IConfiguration";
|
|
|
3
3
|
import { IDiagnosticLogger } from "../JavaScriptSDK.Interfaces/IDiagnosticLogger";
|
|
4
4
|
import { IPlugin, ITelemetryPlugin } from "../JavaScriptSDK.Interfaces/ITelemetryPlugin";
|
|
5
5
|
import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
|
|
6
|
-
import { IProcessTelemetryContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
6
|
+
import { IProcessTelemetryContext, IProcessTelemetryUnloadContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
7
7
|
import { ITelemetryPluginChain } from "../JavaScriptSDK.Interfaces/ITelemetryPluginChain";
|
|
8
8
|
import { IInstrumentHook } from "../JavaScriptSDK.Interfaces/IInstrumentHooks";
|
|
9
|
+
import { ITelemetryUnloadState } from "../JavaScriptSDK.Interfaces/ITelemetryUnloadState";
|
|
9
10
|
/**
|
|
10
11
|
* BaseTelemetryPlugin provides a basic implementation of the ITelemetryPlugin interface so that plugins
|
|
11
12
|
* can avoid implementation the same set of boiler plate code as well as provide a base
|
|
@@ -51,8 +52,26 @@ export declare abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
|
|
|
51
52
|
* Internal helper to allow setting of the internal initialized setting for inherited instances and unit testing
|
|
52
53
|
*/
|
|
53
54
|
protected setInitialized: (isInitialized: boolean) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Teardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin
|
|
57
|
+
* finishes it's removal.
|
|
58
|
+
* @param unloadCtx - This is the context that should be used during unloading.
|
|
59
|
+
* @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
|
|
60
|
+
* @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
|
|
61
|
+
* @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
|
|
62
|
+
*/
|
|
63
|
+
protected _doTeardown?: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void) => void | boolean;
|
|
54
64
|
constructor();
|
|
55
65
|
initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
|
|
66
|
+
/**
|
|
67
|
+
* Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and
|
|
68
|
+
* therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further
|
|
69
|
+
* processTelemetry calls are ignored and it just calls the processNext() with the provided context.
|
|
70
|
+
* @param unloadCtx - This is the context that should be used during unloading.
|
|
71
|
+
* @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
|
|
72
|
+
* @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
|
|
73
|
+
*/
|
|
74
|
+
teardown(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState): void | boolean;
|
|
56
75
|
abstract processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
57
76
|
/**
|
|
58
77
|
* Add this hook so that it is automatically removed during unloading
|
|
@@ -7,6 +7,10 @@ import { ITelemetryPluginChain } from "../JavaScriptSDK.Interfaces/ITelemetryPlu
|
|
|
7
7
|
export declare const ChannelControllerPriority = 500;
|
|
8
8
|
export interface IChannelController extends IChannelControls {
|
|
9
9
|
flush(isAsync: boolean, callBack: (flushComplete?: boolean) => void, sendReason: SendRequestReason, cbTimeout?: number): void;
|
|
10
|
+
getChannel<T extends IPlugin = IPlugin>(pluginIdentifier: string): T;
|
|
11
|
+
}
|
|
12
|
+
export interface IInternalChannelController extends IChannelController {
|
|
13
|
+
_setQueue: (channels: _IInternalChannels[]) => void;
|
|
10
14
|
}
|
|
11
15
|
export interface _IInternalChannels {
|
|
12
16
|
queue: IChannelControls[];
|
|
@@ -2,47 +2,6 @@ import { IConfiguration } from "../JavaScriptSDK.Interfaces/IConfiguration";
|
|
|
2
2
|
import { ICookieMgr } from "../JavaScriptSDK.Interfaces/ICookieMgr";
|
|
3
3
|
import { IDiagnosticLogger } from "../JavaScriptSDK.Interfaces/IDiagnosticLogger";
|
|
4
4
|
export declare const Undefined = "undefined";
|
|
5
|
-
/**
|
|
6
|
-
* Trys to add an event handler for the specified event to the window, body and document
|
|
7
|
-
* @param eventName {string} - The name of the event
|
|
8
|
-
* @param callback {any} - The callback function that needs to be executed for the given event
|
|
9
|
-
* @return {boolean} - true if the handler was successfully added
|
|
10
|
-
*/
|
|
11
|
-
export declare function addEventHandler(eventName: string, callback: any): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Bind the listener to the array of events
|
|
14
|
-
* @param events An string array of event names to bind the listener to
|
|
15
|
-
* @param listener The event callback to call when the event is triggered
|
|
16
|
-
* @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.
|
|
17
|
-
* @returns true - when at least one of the events was registered otherwise false
|
|
18
|
-
*/
|
|
19
|
-
export declare function addEventListeners(events: string[], listener: any, excludeEvents?: string[]): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Listen to the 'beforeunload', 'unload' and 'pagehide' events which indicates a page unload is occurring,
|
|
22
|
-
* this does NOT listen to the 'visibilitychange' event as while it does indicate that the page is being hidden
|
|
23
|
-
* it does not *necessarily* mean that the page is being completely unloaded, it can mean that the user is
|
|
24
|
-
* just navigating to a different Tab and may come back (without unloading the page). As such you may also
|
|
25
|
-
* need to listen to the 'addPageHideEventListener' and 'addPageShowEventListener' events.
|
|
26
|
-
* @param listener - The event callback to call when a page unload event is triggered
|
|
27
|
-
* @param excludeEvents - [Optional] An array of events that should not be hooked, unless no other events can be.
|
|
28
|
-
* @returns true - when at least one of the events was registered otherwise false
|
|
29
|
-
*/
|
|
30
|
-
export declare function addPageUnloadEventListener(listener: any, excludeEvents?: string[]): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Listen to the pagehide and visibility changing to 'hidden' events
|
|
33
|
-
* @param listener - The event callback to call when a page hide event is triggered
|
|
34
|
-
* @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.
|
|
35
|
-
* Suggestion: pass as true if you are also calling addPageUnloadEventListener as that also hooks pagehide
|
|
36
|
-
* @returns true - when at least one of the events was registered otherwise false
|
|
37
|
-
*/
|
|
38
|
-
export declare function addPageHideEventListener(listener: any, excludeEvents?: string[]): boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Listen to the pageshow and visibility changing to 'visible' events
|
|
41
|
-
* @param listener - The event callback to call when a page is show event is triggered
|
|
42
|
-
* @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.
|
|
43
|
-
* @returns true - when at least one of the events was registered otherwise false
|
|
44
|
-
*/
|
|
45
|
-
export declare function addPageShowEventListener(listener: any, excludeEvents?: string[]): boolean;
|
|
46
5
|
export declare function newGuid(): string;
|
|
47
6
|
/**
|
|
48
7
|
* Return the current value of the Performance Api now() function (if available) and fallback to dateNow() if it is unavailable (IE9 or less)
|
|
@@ -193,7 +152,7 @@ export interface ICoreUtils {
|
|
|
193
152
|
* @param callback {any} - The callback function that needs to be executed for the given event
|
|
194
153
|
* @return {boolean} - true if the handler was successfully added
|
|
195
154
|
*/
|
|
196
|
-
addEventHandler: (eventName: string, callback: any) => boolean;
|
|
155
|
+
addEventHandler: (eventName: string, callback: any, evtNamespace?: string | string[]) => boolean;
|
|
197
156
|
/**
|
|
198
157
|
* Return the current time via the Date now() function (if available) and falls back to (new Date()).getTime() if now() is unavailable (IE8 or less)
|
|
199
158
|
* https://caniuse.com/#search=Date.now
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface IDataCache {
|
|
2
|
+
id: string;
|
|
3
|
+
accept: (target: any) => boolean;
|
|
4
|
+
get: <T>(target: any, name: string, defValue?: T, addDefault?: boolean) => T;
|
|
5
|
+
kill: (target: any, name: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function createUniqueNamespace(name: string, includeVersion?: boolean): string;
|
|
8
|
+
export declare function createElmNodeData(name?: string): {
|
|
9
|
+
id: string;
|
|
10
|
+
accept: (target: any) => boolean;
|
|
11
|
+
get: <T>(target: any, name: string, defValue?: T, addDefault?: boolean) => T;
|
|
12
|
+
kill: (target: any, name: string) => void;
|
|
13
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
export interface _IRegisteredEvents {
|
|
2
|
+
name: string;
|
|
3
|
+
handler: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Get all of the registered events on the target object, this is primarily used for testing cleanup but may also be used by
|
|
7
|
+
* applications to remove their own events
|
|
8
|
+
* @param target - The EventTarget that has registered events
|
|
9
|
+
* @param evtName - [Optional] The name of the event to return the registered handlers and full name (with namespaces)
|
|
10
|
+
*/
|
|
11
|
+
export declare function __getRegisteredEvents(target: any, evtName?: string): _IRegisteredEvents[];
|
|
12
|
+
export declare function mergeEvtNamespace(theNamespace: string, namespaces: string | string[]): string | string[];
|
|
13
|
+
/**
|
|
14
|
+
* Binds the specified function to an event, so that the function gets called whenever the event fires on the object
|
|
15
|
+
* @param obj Object to add the event too.
|
|
16
|
+
* @param eventName String that specifies any of the standard DHTML Events without "on" prefix, if may also include an optional (dot "." prefixed)
|
|
17
|
+
* namespaces "click" "click.mynamespace" in addition to specific namespaces.
|
|
18
|
+
* @param handlerRef Pointer that specifies the function to call when event fires
|
|
19
|
+
* @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace,
|
|
20
|
+
* if the eventName also includes a namespace the namespace(s) are merged into a single namespace
|
|
21
|
+
* @param useCapture [Optional] Defaults to false
|
|
22
|
+
* @returns True if the function was bound successfully to the event, otherwise false
|
|
23
|
+
*/
|
|
24
|
+
export declare function eventOn<T>(target: T, eventName: string, handlerRef: any, evtNamespace?: string | string[], useCapture?: boolean): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Removes an event handler for the specified event
|
|
27
|
+
* @param Object to remove the event from
|
|
28
|
+
* @param eventName {string} - The name of the event, with optional namespaces or just the namespaces,
|
|
29
|
+
* such as "click", "click.mynamespace" or ".mynamespace"
|
|
30
|
+
* @param handlerRef {any} - The callback function that needs to be removed from the given event, when using a
|
|
31
|
+
* namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers
|
|
32
|
+
* otherwise this will only remove events with this specific handler.
|
|
33
|
+
* @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace,
|
|
34
|
+
* if the eventName also includes a namespace the namespace(s) are merged into a single namespace
|
|
35
|
+
* @param useCapture [Optional] Defaults to false
|
|
36
|
+
*/
|
|
37
|
+
export declare function eventOff<T>(target: T, eventName: string, handlerRef: any, evtNamespace?: string | string[], useCapture?: boolean): void;
|
|
38
|
+
/**
|
|
39
|
+
* Binds the specified function to an event, so that the function gets called whenever the event fires on the object
|
|
40
|
+
* @param obj Object to add the event too.
|
|
41
|
+
* @param eventNameWithoutOn String that specifies any of the standard DHTML Events without "on" prefix and optional (dot "." prefixed) namespaces "click" "click.mynamespace".
|
|
42
|
+
* @param handlerRef Pointer that specifies the function to call when event fires
|
|
43
|
+
* @param useCapture [Optional] Defaults to false
|
|
44
|
+
* @returns True if the function was bound successfully to the event, otherwise false
|
|
45
|
+
*/
|
|
46
|
+
export declare function attachEvent(obj: any, eventNameWithoutOn: string, handlerRef: any, useCapture?: boolean): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Removes an event handler for the specified event
|
|
49
|
+
* @param Object to remove the event from
|
|
50
|
+
* @param eventNameWithoutOn {string} - The name of the event, with optional namespaces or just the namespaces,
|
|
51
|
+
* such as "click", "click.mynamespace" or ".mynamespace"
|
|
52
|
+
* @param handlerRef {any} - The callback function that needs to be removed from the given event, when using a
|
|
53
|
+
* namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers
|
|
54
|
+
* otherwise this will only remove events with this specific handler.
|
|
55
|
+
* @param useCapture [Optional] Defaults to false
|
|
56
|
+
*/
|
|
57
|
+
export declare function detachEvent(obj: any, eventNameWithoutOn: string, handlerRef: any, useCapture?: boolean): void;
|
|
58
|
+
/**
|
|
59
|
+
* Trys to add an event handler for the specified event to the window, body and document
|
|
60
|
+
* @param eventName {string} - The name of the event
|
|
61
|
+
* @param callback {any} - The callback function that needs to be executed for the given event
|
|
62
|
+
* @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
|
|
63
|
+
* @return {boolean} - true if the handler was successfully added
|
|
64
|
+
*/
|
|
65
|
+
export declare function addEventHandler(eventName: string, callback: any, evtNamespace?: string | string[]): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Trys to remove event handler(s) for the specified event/namespace to the window, body and document
|
|
68
|
+
* @param eventName {string} - The name of the event, with optional namespaces or just the namespaces,
|
|
69
|
+
* such as "click", "click.mynamespace" or ".mynamespace"
|
|
70
|
+
* @param callback {any} - - The callback function that needs to be removed from the given event, when using a
|
|
71
|
+
* namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers
|
|
72
|
+
* otherwise this will only remove events with this specific handler.
|
|
73
|
+
* @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
|
|
74
|
+
*/
|
|
75
|
+
export declare function removeEventHandler(eventName: string, callback: any, evtNamespace?: string | string[]): void;
|
|
76
|
+
/**
|
|
77
|
+
* Bind the listener to the array of events
|
|
78
|
+
* @param events An string array of event names to bind the listener to
|
|
79
|
+
* @param listener The event callback to call when the event is triggered
|
|
80
|
+
* @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.
|
|
81
|
+
* @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
|
|
82
|
+
* @returns true - when at least one of the events was registered otherwise false
|
|
83
|
+
*/
|
|
84
|
+
export declare function addEventListeners(events: string[], listener: any, excludeEvents?: string[], evtNamespace?: string | string[]): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Remove the listener from the array of events
|
|
87
|
+
* @param events An string array of event names to bind the listener to
|
|
88
|
+
* @param listener The event callback to call when the event is triggered
|
|
89
|
+
* @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
|
|
90
|
+
*/
|
|
91
|
+
export declare function removeEventListeners(events: string[], listener: any, evtNamespace?: string | string[]): void;
|
|
92
|
+
/**
|
|
93
|
+
* Listen to the 'beforeunload', 'unload' and 'pagehide' events which indicates a page unload is occurring,
|
|
94
|
+
* this does NOT listen to the 'visibilitychange' event as while it does indicate that the page is being hidden
|
|
95
|
+
* it does not *necessarily* mean that the page is being completely unloaded, it can mean that the user is
|
|
96
|
+
* just navigating to a different Tab and may come back (without unloading the page). As such you may also
|
|
97
|
+
* need to listen to the 'addPageHideEventListener' and 'addPageShowEventListener' events.
|
|
98
|
+
* @param listener - The event callback to call when a page unload event is triggered
|
|
99
|
+
* @param excludeEvents - [Optional] An array of events that should not be hooked, unless no other events can be.
|
|
100
|
+
* @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
|
|
101
|
+
* @returns true - when at least one of the events was registered otherwise false
|
|
102
|
+
*/
|
|
103
|
+
export declare function addPageUnloadEventListener(listener: any, excludeEvents: string[], evtNamespace?: string | string[]): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Remove any matching 'beforeunload', 'unload' and 'pagehide' events that may have been added via addEventListener,
|
|
106
|
+
* addEventListeners, addPageUnloadEventListener or addPageHideEventListener.
|
|
107
|
+
* @param listener - The specific event callback to to be removed
|
|
108
|
+
* @param evtNamespace - [Optional] Namespace(s) uniquely identified and removed based on this namespace.
|
|
109
|
+
* @returns true - when at least one of the events was registered otherwise false
|
|
110
|
+
*/
|
|
111
|
+
export declare function removePageUnloadEventListener(listener: any, evtNamespace?: string | string[]): void;
|
|
112
|
+
/**
|
|
113
|
+
* Listen to the pagehide and visibility changing to 'hidden' events, because the 'visibilitychange' uses
|
|
114
|
+
* an internal proxy to detect the visibility state you SHOULD use a unique namespace when if you plan to call
|
|
115
|
+
* removePageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event.
|
|
116
|
+
* @param listener - The event callback to call when a page hide event is triggered
|
|
117
|
+
* @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.
|
|
118
|
+
* @param evtNamespace - [Optional] A Namespace to append to the event listeners so they can be uniquely identified and removed
|
|
119
|
+
* based on this namespace. This call also adds an additional unique "pageshow" namespace to the events
|
|
120
|
+
* so that only the matching "removePageHideEventListener" can remove these events.
|
|
121
|
+
* Suggestion: pass as true if you are also calling addPageUnloadEventListener as that also hooks pagehide
|
|
122
|
+
* @returns true - when at least one of the events was registered otherwise false
|
|
123
|
+
*/
|
|
124
|
+
export declare function addPageHideEventListener(listener: any, excludeEvents: string[], evtNamespace?: string | string[]): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Removes the pageHide event listeners added by addPageHideEventListener, because the 'visibilitychange' uses
|
|
127
|
+
* an internal proxy to detect the visibility state you SHOULD use a unique namespace when calling addPageHideEventListener
|
|
128
|
+
* as the remove ignores the listener argument for the 'visibilitychange' event.
|
|
129
|
+
* @param listener - The specific listener to remove for the 'pageshow' event only (ignored for 'visibilitychange')
|
|
130
|
+
* @param evtNamespace - The unique namespace used when calling addPageShowEventListener
|
|
131
|
+
*/
|
|
132
|
+
export declare function removePageHideEventListener(listener: any, evtNamespace?: string | string[]): void;
|
|
133
|
+
/**
|
|
134
|
+
* Listen to the pageshow and visibility changing to 'visible' events, because the 'visibilitychange' uses
|
|
135
|
+
* an internal proxy to detect the visibility state you SHOULD use a unique namespace when if you plan to call
|
|
136
|
+
* removePageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event.
|
|
137
|
+
* @param listener - The event callback to call when a page is show event is triggered
|
|
138
|
+
* @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.
|
|
139
|
+
* @param evtNamespace - [Optional/Recommended] A Namespace to append to the event listeners so they can be uniquely
|
|
140
|
+
* identified and removed based on this namespace. This call also adds an additional unique "pageshow" namespace to the events
|
|
141
|
+
* so that only the matching "removePageShowEventListener" can remove these events.
|
|
142
|
+
* @returns true - when at least one of the events was registered otherwise false
|
|
143
|
+
*/
|
|
144
|
+
export declare function addPageShowEventListener(listener: any, excludeEvents: string[], evtNamespace?: string | string[]): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Removes the pageShow event listeners added by addPageShowEventListener, because the 'visibilitychange' uses
|
|
147
|
+
* an internal proxy to detect the visibility state you SHOULD use a unique namespace when calling addPageShowEventListener
|
|
148
|
+
* as the remove ignores the listener argument for the 'visibilitychange' event.
|
|
149
|
+
* @param listener - The specific listener to remove for the 'pageshow' event only (ignored for 'visibilitychange')
|
|
150
|
+
* @param evtNamespace - The unique namespace used when calling addPageShowEventListener
|
|
151
|
+
*/
|
|
152
|
+
export declare function removePageShowEventListener(listener: any, evtNamespace?: string | string[]): void;
|
|
@@ -12,23 +12,7 @@ export declare function isNotNullOrUndefined(value: any): boolean;
|
|
|
12
12
|
export declare function hasOwnProperty(obj: any, prop: string): boolean;
|
|
13
13
|
export declare function isObject(value: any): boolean;
|
|
14
14
|
export declare function isFunction(value: any): value is Function;
|
|
15
|
-
|
|
16
|
-
* Binds the specified function to an event, so that the function gets called whenever the event fires on the object
|
|
17
|
-
* @param obj Object to add the event too.
|
|
18
|
-
* @param eventNameWithoutOn String that specifies any of the standard DHTML Events without "on" prefix
|
|
19
|
-
* @param handlerRef Pointer that specifies the function to call when event fires
|
|
20
|
-
* @param useCapture [Optional] Defaults to false
|
|
21
|
-
* @returns True if the function was bound successfully to the event, otherwise false
|
|
22
|
-
*/
|
|
23
|
-
export declare function attachEvent(obj: any, eventNameWithoutOn: string, handlerRef: any, useCapture?: boolean): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Removes an event handler for the specified event
|
|
26
|
-
* @param Object to remove the event from
|
|
27
|
-
* @param eventNameWithoutOn {string} - The name of the event
|
|
28
|
-
* @param handlerRef {any} - The callback function that needs to be executed for the given event
|
|
29
|
-
* @param useCapture [Optional] Defaults to false
|
|
30
|
-
*/
|
|
31
|
-
export declare function detachEvent(obj: any, eventNameWithoutOn: string, handlerRef: any, useCapture?: boolean): void;
|
|
15
|
+
export declare function isPromiseLike<T>(value: any): value is PromiseLike<T>;
|
|
32
16
|
/**
|
|
33
17
|
* Validates that the string name conforms to the JS IdentifierName specification and if not
|
|
34
18
|
* normalizes the name so that it would. This method does not identify or change any keywords
|
|
@@ -187,6 +171,7 @@ export declare function objKeys(obj: {}): string[];
|
|
|
187
171
|
* @returns True if it was able to create the accessors otherwise false
|
|
188
172
|
*/
|
|
189
173
|
export declare function objDefineAccessors<T>(target: any, prop: string, getProp?: () => T, setProp?: (v: T) => void): boolean;
|
|
174
|
+
export declare function deepFreeze<T>(obj: T): T;
|
|
190
175
|
export declare const objFreeze: <T>(value: T) => T;
|
|
191
176
|
export declare const objSeal: <T>(value: T) => T;
|
|
192
177
|
/**
|
|
@@ -250,6 +235,12 @@ export declare function proxyFunctions<T, S>(target: T, source: S | (() => S), f
|
|
|
250
235
|
* @param defaults Simple helper
|
|
251
236
|
*/
|
|
252
237
|
export declare function createClassFromInterface<T>(defaults?: T): new () => T;
|
|
238
|
+
/**
|
|
239
|
+
* Create an enum style object which has both the key => value and value => key mappings
|
|
240
|
+
* @param values - The values to populate on the new object
|
|
241
|
+
* @returns
|
|
242
|
+
*/
|
|
243
|
+
export declare function createEnumStyle<T>(values: T): T;
|
|
253
244
|
/**
|
|
254
245
|
* A helper function to assist with JIT performance for objects that have properties added / removed dynamically
|
|
255
246
|
* this is primarily for chromium based browsers and has limited effects on Firefox and none of IE. Only call this
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const strEmpty = "";
|
|
2
|
+
export declare const strProcessTelemetry = "processTelemetry";
|
|
3
|
+
export declare const strPriority = "priority";
|
|
4
|
+
export declare const strSetNextPlugin = "setNextPlugin";
|
|
5
|
+
export declare const strIsInitialized = "isInitialized";
|
|
6
|
+
export declare const strTeardown = "teardown";
|
|
7
|
+
export declare const strCore = "core";
|
|
8
|
+
export declare const strUpdate = "update";
|
|
9
|
+
export declare const strDisabled = "disabled";
|
|
10
|
+
export declare const strDoTeardown = "_doTeardown";
|
|
11
|
+
export declare const strProcessNext = "processNext";
|
|
12
|
+
export declare const strResume = "resume";
|
|
13
|
+
export declare const strPause = "pause";
|
|
14
|
+
export declare const strNotificationListener = "NotificationListener";
|
|
15
|
+
export declare const strAddNotificationListener: string;
|
|
16
|
+
export declare const strRemoveNotificationListener: string;
|
|
17
|
+
export declare const strEventsSent = "eventsSent";
|
|
18
|
+
export declare const strEventsDiscarded = "eventsDiscarded";
|
|
19
|
+
export declare const strEventsSendRequest = "eventsSendRequest";
|
|
20
|
+
export declare const strPerfEvent = "perfEvent";
|
|
@@ -2,7 +2,7 @@ import { IAppInsightsCore } from "../JavaScriptSDK.Interfaces/IAppInsightsCore";
|
|
|
2
2
|
import { IConfiguration } from "../JavaScriptSDK.Interfaces/IConfiguration";
|
|
3
3
|
import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
|
|
4
4
|
import { IPlugin, ITelemetryPlugin } from "../JavaScriptSDK.Interfaces/ITelemetryPlugin";
|
|
5
|
-
import { IProcessTelemetryContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
5
|
+
import { IProcessTelemetryContext, IProcessTelemetryUnloadContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
6
6
|
import { ITelemetryPluginChain } from "../JavaScriptSDK.Interfaces/ITelemetryPluginChain";
|
|
7
7
|
import { IDiagnosticLogger } from "../JavaScriptSDK.Interfaces/IDiagnosticLogger";
|
|
8
8
|
/**
|
|
@@ -12,6 +12,13 @@ import { IDiagnosticLogger } from "../JavaScriptSDK.Interfaces/IDiagnosticLogger
|
|
|
12
12
|
* @param core - The current core instance
|
|
13
13
|
*/
|
|
14
14
|
export declare function createProcessTelemetryContext(telemetryChain: ITelemetryPluginChain, config: IConfiguration, core: IAppInsightsCore, startAt?: IPlugin): IProcessTelemetryContext;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new Telemetry Item context with the current config, core and plugin execution chain for handling the unloading of the chain
|
|
17
|
+
* @param plugins - The plugin instances that will be executed
|
|
18
|
+
* @param config - The current config
|
|
19
|
+
* @param core - The current core instance
|
|
20
|
+
*/
|
|
21
|
+
export declare function createProcessTelemetryUnloadContext(telemetryChain: ITelemetryPluginChain, config: IConfiguration, core: IAppInsightsCore, startAt?: IPlugin): IProcessTelemetryUnloadContext;
|
|
15
22
|
/**
|
|
16
23
|
* Creates an execution chain from the array of plugins
|
|
17
24
|
* @param plugins - The array of plugins that will be executed in this order
|
|
@@ -70,15 +77,15 @@ export declare class ProcessTelemetryContext implements IProcessTelemetryContext
|
|
|
70
77
|
* @param itemCtx - This is the context for the current request, ITelemetryPlugin instances
|
|
71
78
|
* can optionally use this to access the current core instance or define / pass additional information
|
|
72
79
|
* to later plugins (vs appending items to the telemetry item)
|
|
80
|
+
* @returns boolean (true) if there is no more plugins to process otherwise false or undefined (void)
|
|
73
81
|
*/
|
|
74
|
-
processNext: (env: ITelemetryItem) => void;
|
|
82
|
+
processNext: (env: ITelemetryItem) => boolean | void;
|
|
75
83
|
/**
|
|
76
84
|
* Synchronously iterate over the context chain running the callback for each plugin, once
|
|
77
85
|
* every plugin has been executed via the callback, any associated onComplete will be called.
|
|
78
86
|
* @param callback - The function call for each plugin in the context chain
|
|
79
87
|
*/
|
|
80
88
|
iterate: <T extends ITelemetryPlugin = ITelemetryPlugin>(callback: (plugin: T) => void) => void;
|
|
81
|
-
/**
|
|
82
89
|
/**
|
|
83
90
|
* Create a new context using the core and config from the current instance
|
|
84
91
|
* @param plugins - The execution order to process the plugins, if null or not supplied
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { IPlugin } from "../JavaScriptSDK.Interfaces/ITelemetryPlugin";
|
|
2
2
|
import { IProcessTelemetryContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
3
|
+
import { IAppInsightsCore } from "../JavaScriptSDK.Interfaces/IAppInsightsCore";
|
|
4
|
+
export interface IPluginState {
|
|
5
|
+
core?: IAppInsightsCore;
|
|
6
|
+
isInitialized?: boolean;
|
|
7
|
+
tearDown?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function _getPluginState(plugin: IPlugin): IPluginState;
|
|
3
11
|
/**
|
|
4
12
|
* Initialize the queue of plugins
|
|
5
13
|
* @param plugins - The array of plugins to initialize and setting of the next plugin
|
|
@@ -13,11 +13,4 @@ export declare class TelemetryInitializerPlugin extends BaseTelemetryPlugin impl
|
|
|
13
13
|
*/
|
|
14
14
|
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler;
|
|
15
15
|
processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
16
|
-
/**
|
|
17
|
-
* This plugin is being unloaded and should remove any hooked events and cleanup any global/scoped values, after this
|
|
18
|
-
* call the plugin will be removed from the telemetry processing chain and will no longer receive any events..
|
|
19
|
-
* @param itemCtx - This is the context that should be used during unloading if required to flush any cached events.
|
|
20
|
-
* @param isAsync - Should the plugin attempt to unload synchronously or can it complete asynchronously
|
|
21
|
-
*/
|
|
22
|
-
unload(itemCtx: IProcessTelemetryContext, isAsync: boolean): void;
|
|
23
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare enum
|
|
1
|
+
export declare const enum eLoggingSeverity {
|
|
2
2
|
/**
|
|
3
3
|
* Error will be sent as internal telemetry
|
|
4
4
|
*/
|
|
@@ -8,6 +8,95 @@ export declare enum LoggingSeverity {
|
|
|
8
8
|
*/
|
|
9
9
|
WARNING = 2
|
|
10
10
|
}
|
|
11
|
+
export declare const LoggingSeverity: {
|
|
12
|
+
CRITICAL: number;
|
|
13
|
+
WARNING: number;
|
|
14
|
+
};
|
|
15
|
+
export declare type LoggingSeverity = number | eLoggingSeverity;
|
|
16
|
+
export declare const enum _eInternalMessageId {
|
|
17
|
+
BrowserDoesNotSupportLocalStorage = 0,
|
|
18
|
+
BrowserCannotReadLocalStorage = 1,
|
|
19
|
+
BrowserCannotReadSessionStorage = 2,
|
|
20
|
+
BrowserCannotWriteLocalStorage = 3,
|
|
21
|
+
BrowserCannotWriteSessionStorage = 4,
|
|
22
|
+
BrowserFailedRemovalFromLocalStorage = 5,
|
|
23
|
+
BrowserFailedRemovalFromSessionStorage = 6,
|
|
24
|
+
CannotSendEmptyTelemetry = 7,
|
|
25
|
+
ClientPerformanceMathError = 8,
|
|
26
|
+
ErrorParsingAISessionCookie = 9,
|
|
27
|
+
ErrorPVCalc = 10,
|
|
28
|
+
ExceptionWhileLoggingError = 11,
|
|
29
|
+
FailedAddingTelemetryToBuffer = 12,
|
|
30
|
+
FailedMonitorAjaxAbort = 13,
|
|
31
|
+
FailedMonitorAjaxDur = 14,
|
|
32
|
+
FailedMonitorAjaxOpen = 15,
|
|
33
|
+
FailedMonitorAjaxRSC = 16,
|
|
34
|
+
FailedMonitorAjaxSend = 17,
|
|
35
|
+
FailedMonitorAjaxGetCorrelationHeader = 18,
|
|
36
|
+
FailedToAddHandlerForOnBeforeUnload = 19,
|
|
37
|
+
FailedToSendQueuedTelemetry = 20,
|
|
38
|
+
FailedToReportDataLoss = 21,
|
|
39
|
+
FlushFailed = 22,
|
|
40
|
+
MessageLimitPerPVExceeded = 23,
|
|
41
|
+
MissingRequiredFieldSpecification = 24,
|
|
42
|
+
NavigationTimingNotSupported = 25,
|
|
43
|
+
OnError = 26,
|
|
44
|
+
SessionRenewalDateIsZero = 27,
|
|
45
|
+
SenderNotInitialized = 28,
|
|
46
|
+
StartTrackEventFailed = 29,
|
|
47
|
+
StopTrackEventFailed = 30,
|
|
48
|
+
StartTrackFailed = 31,
|
|
49
|
+
StopTrackFailed = 32,
|
|
50
|
+
TelemetrySampledAndNotSent = 33,
|
|
51
|
+
TrackEventFailed = 34,
|
|
52
|
+
TrackExceptionFailed = 35,
|
|
53
|
+
TrackMetricFailed = 36,
|
|
54
|
+
TrackPVFailed = 37,
|
|
55
|
+
TrackPVFailedCalc = 38,
|
|
56
|
+
TrackTraceFailed = 39,
|
|
57
|
+
TransmissionFailed = 40,
|
|
58
|
+
FailedToSetStorageBuffer = 41,
|
|
59
|
+
FailedToRestoreStorageBuffer = 42,
|
|
60
|
+
InvalidBackendResponse = 43,
|
|
61
|
+
FailedToFixDepricatedValues = 44,
|
|
62
|
+
InvalidDurationValue = 45,
|
|
63
|
+
TelemetryEnvelopeInvalid = 46,
|
|
64
|
+
CreateEnvelopeError = 47,
|
|
65
|
+
CannotSerializeObject = 48,
|
|
66
|
+
CannotSerializeObjectNonSerializable = 49,
|
|
67
|
+
CircularReferenceDetected = 50,
|
|
68
|
+
ClearAuthContextFailed = 51,
|
|
69
|
+
ExceptionTruncated = 52,
|
|
70
|
+
IllegalCharsInName = 53,
|
|
71
|
+
ItemNotInArray = 54,
|
|
72
|
+
MaxAjaxPerPVExceeded = 55,
|
|
73
|
+
MessageTruncated = 56,
|
|
74
|
+
NameTooLong = 57,
|
|
75
|
+
SampleRateOutOfRange = 58,
|
|
76
|
+
SetAuthContextFailed = 59,
|
|
77
|
+
SetAuthContextFailedAccountName = 60,
|
|
78
|
+
StringValueTooLong = 61,
|
|
79
|
+
StartCalledMoreThanOnce = 62,
|
|
80
|
+
StopCalledWithoutStart = 63,
|
|
81
|
+
TelemetryInitializerFailed = 64,
|
|
82
|
+
TrackArgumentsNotSpecified = 65,
|
|
83
|
+
UrlTooLong = 66,
|
|
84
|
+
SessionStorageBufferFull = 67,
|
|
85
|
+
CannotAccessCookie = 68,
|
|
86
|
+
IdTooLong = 69,
|
|
87
|
+
InvalidEvent = 70,
|
|
88
|
+
FailedMonitorAjaxSetRequestHeader = 71,
|
|
89
|
+
SendBrowserInfoOnUserInit = 72,
|
|
90
|
+
PluginException = 73,
|
|
91
|
+
NotificationException = 74,
|
|
92
|
+
SnippetScriptLoadFailure = 99,
|
|
93
|
+
InvalidInstrumentationKey = 100,
|
|
94
|
+
CannotParseAiBlobValue = 101,
|
|
95
|
+
InvalidContentBlob = 102,
|
|
96
|
+
TrackPageActionEventFailed = 103,
|
|
97
|
+
FailedAddingCustomDefinedRequestContext = 104,
|
|
98
|
+
InMemoryStorageBufferFull = 105
|
|
99
|
+
}
|
|
11
100
|
/**
|
|
12
101
|
* Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered
|
|
13
102
|
*/
|
|
@@ -95,4 +184,4 @@ export declare const _InternalMessageId: {
|
|
|
95
184
|
FailedAddingCustomDefinedRequestContext: number;
|
|
96
185
|
InMemoryStorageBufferFull: number;
|
|
97
186
|
};
|
|
98
|
-
export declare type _InternalMessageId = number |
|
|
187
|
+
export declare type _InternalMessageId = number | _eInternalMessageId;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The TelemetryUnloadReason enumeration contains the possible reasons for why a plugin is being unloaded / torndown().
|
|
3
|
+
*/
|
|
4
|
+
export declare const enum TelemetryUnloadReason {
|
|
5
|
+
/**
|
|
6
|
+
* Teardown has been called without any context.
|
|
7
|
+
*/
|
|
8
|
+
ManualTeardown = 0
|
|
9
|
+
}
|