@microsoft/applicationinsights-core-js 2.7.5-nightly.2203-03 → 2.7.5
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 +766 -1967
- 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 +9840 -16439
- package/dist/applicationinsights-core-js.api.md +48 -425
- package/dist/applicationinsights-core-js.d.ts +123 -784
- package/dist/applicationinsights-core-js.js +766 -1967
- 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 +123 -784
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js +69 -3
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js.map +1 -1
- package/dist-esm/JavaScriptSDK/BaseCore.js +99 -496
- package/dist-esm/JavaScriptSDK/BaseCore.js.map +1 -1
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +21 -120
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js.map +1 -1
- package/dist-esm/JavaScriptSDK/ChannelController.js +87 -202
- package/dist-esm/JavaScriptSDK/ChannelController.js.map +1 -1
- package/dist-esm/JavaScriptSDK/Constants.js +1 -1
- package/dist-esm/JavaScriptSDK/CookieMgr.js +4 -4
- package/dist-esm/JavaScriptSDK/CookieMgr.js.map +1 -1
- package/dist-esm/JavaScriptSDK/CoreUtils.js +148 -7
- package/dist-esm/JavaScriptSDK/CoreUtils.js.map +1 -1
- package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +14 -27
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js.map +1 -1
- package/dist-esm/JavaScriptSDK/EnvUtils.js +12 -13
- package/dist-esm/JavaScriptSDK/EnvUtils.js.map +1 -1
- package/dist-esm/JavaScriptSDK/HelperFuncs.js +86 -89
- package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
- package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -3
- package/dist-esm/JavaScriptSDK/InstrumentHooks.js.map +1 -1
- package/dist-esm/JavaScriptSDK/NotificationManager.js +42 -37
- package/dist-esm/JavaScriptSDK/NotificationManager.js.map +1 -1
- package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
- package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +119 -430
- package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js.map +1 -1
- package/dist-esm/JavaScriptSDK/RandomHelper.js +4 -30
- package/dist-esm/JavaScriptSDK/RandomHelper.js.map +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +14 -60
- package/dist-esm/JavaScriptSDK/TelemetryHelpers.js.map +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryPluginChain.js +76 -0
- package/dist-esm/JavaScriptSDK/TelemetryPluginChain.js.map +1 -0
- package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +96 -90
- package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js.map +1 -1
- package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +2 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js.map +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/ITelemetryItem.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +2 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js.map +1 -1
- package/dist-esm/applicationinsights-core-js.js +7 -12
- package/dist-esm/applicationinsights-core-js.js.map +1 -1
- package/package.json +67 -70
- package/src/JavaScriptSDK/AppInsightsCore.ts +101 -2
- package/src/JavaScriptSDK/BaseCore.ts +120 -696
- package/src/JavaScriptSDK/BaseTelemetryPlugin.ts +31 -205
- package/src/JavaScriptSDK/ChannelController.ts +103 -242
- package/src/JavaScriptSDK/CookieMgr.ts +5 -7
- package/src/JavaScriptSDK/CoreUtils.ts +172 -8
- package/src/JavaScriptSDK/DiagnosticLogger.ts +14 -29
- package/src/JavaScriptSDK/EnvUtils.ts +12 -13
- package/src/JavaScriptSDK/HelperFuncs.ts +97 -123
- package/src/JavaScriptSDK/InstrumentHooks.ts +2 -4
- package/src/JavaScriptSDK/NotificationManager.ts +37 -34
- package/src/JavaScriptSDK/PerfManager.ts +7 -4
- package/src/JavaScriptSDK/ProcessTelemetryContext.ts +134 -543
- package/src/JavaScriptSDK/RandomHelper.ts +3 -35
- package/src/JavaScriptSDK/TelemetryHelpers.ts +21 -83
- package/src/JavaScriptSDK/TelemetryPluginChain.ts +120 -0
- package/src/JavaScriptSDK.Enums/LoggingEnums.ts +87 -184
- package/src/JavaScriptSDK.Enums/SendRequestReason.ts +0 -5
- package/src/JavaScriptSDK.Interfaces/IAppInsightsCore.ts +2 -82
- package/src/JavaScriptSDK.Interfaces/IChannelControls.ts +5 -16
- package/src/JavaScriptSDK.Interfaces/IInstrumentHooks.ts +6 -16
- package/src/JavaScriptSDK.Interfaces/IProcessTelemetryContext.ts +14 -94
- package/src/JavaScriptSDK.Interfaces/ITelemetryPlugin.ts +10 -28
- package/src/JavaScriptSDK.Interfaces/ITelemetryPluginChain.ts +11 -9
- package/types/JavaScriptSDK/AppInsightsCore.d.ts +21 -0
- package/types/JavaScriptSDK/BaseCore.d.ts +3 -81
- package/types/JavaScriptSDK/BaseTelemetryPlugin.d.ts +10 -53
- package/types/JavaScriptSDK/ChannelController.d.ts +17 -16
- package/types/JavaScriptSDK/CoreUtils.d.ts +48 -1
- package/types/JavaScriptSDK/DiagnosticLogger.d.ts +0 -10
- package/types/JavaScriptSDK/HelperFuncs.d.ts +32 -33
- package/types/JavaScriptSDK/PerfManager.d.ts +1 -1
- package/types/JavaScriptSDK/ProcessTelemetryContext.d.ts +6 -69
- package/types/JavaScriptSDK/RandomHelper.d.ts +0 -6
- package/types/JavaScriptSDK/TelemetryHelpers.d.ts +3 -23
- package/types/JavaScriptSDK/TelemetryPluginChain.d.ts +32 -0
- package/types/JavaScriptSDK.Enums/LoggingEnums.d.ts +2 -91
- package/types/JavaScriptSDK.Enums/SendRequestReason.d.ts +0 -4
- package/types/JavaScriptSDK.Interfaces/IAppInsightsCore.d.ts +1 -72
- package/types/JavaScriptSDK.Interfaces/IChannelControls.d.ts +5 -16
- package/types/JavaScriptSDK.Interfaces/IInstrumentHooks.d.ts +0 -9
- package/types/JavaScriptSDK.Interfaces/IProcessTelemetryContext.d.ts +11 -82
- package/types/JavaScriptSDK.Interfaces/ITelemetryPlugin.d.ts +8 -25
- package/types/JavaScriptSDK.Interfaces/ITelemetryPluginChain.d.ts +10 -9
- package/types/applicationinsights-core-js.d.ts +9 -18
- package/types/tsdoc-metadata.json +1 -1
- package/dist-esm/JavaScriptSDK/DataCacheHelper.js +0 -93
- package/dist-esm/JavaScriptSDK/DataCacheHelper.js.map +0 -1
- package/dist-esm/JavaScriptSDK/EventHelpers.js +0 -477
- package/dist-esm/JavaScriptSDK/EventHelpers.js.map +0 -1
- package/dist-esm/JavaScriptSDK/InternalConstants.js +0 -28
- package/dist-esm/JavaScriptSDK/InternalConstants.js.map +0 -1
- package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +0 -81
- package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js.map +0 -1
- package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +0 -33
- package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js.map +0 -1
- package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js +0 -8
- package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js.map +0 -1
- package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js +0 -8
- package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js.map +0 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js +0 -6
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js.map +0 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +0 -8
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js.map +0 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +0 -8
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js.map +0 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js +0 -6
- package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js.map +0 -1
- package/src/JavaScriptSDK/DataCacheHelper.ts +0 -106
- package/src/JavaScriptSDK/EventHelpers.ts +0 -550
- package/src/JavaScriptSDK/InternalConstants.ts +0 -26
- package/src/JavaScriptSDK/TelemetryInitializerPlugin.ts +0 -111
- package/src/JavaScriptSDK/UnloadHandlerContainer.ts +0 -46
- package/src/JavaScriptSDK.Enums/TelemetryUnloadReason.ts +0 -27
- package/src/JavaScriptSDK.Enums/TelemetryUpdateReason.ts +0 -27
- package/src/JavaScriptSDK.Interfaces/ITelemetryInitializers.ts +0 -16
- package/src/JavaScriptSDK.Interfaces/ITelemetryUnloadState.ts +0 -10
- package/src/JavaScriptSDK.Interfaces/ITelemetryUpdateState.ts +0 -34
- package/src/JavaScriptSDK.Interfaces/IUnloadableComponent.ts +0 -17
- package/types/JavaScriptSDK/DataCacheHelper.d.ts +0 -13
- package/types/JavaScriptSDK/EventHelpers.d.ts +0 -154
- package/types/JavaScriptSDK/InternalConstants.d.ts +0 -20
- package/types/JavaScriptSDK/TelemetryInitializerPlugin.d.ts +0 -16
- package/types/JavaScriptSDK/UnloadHandlerContainer.d.ts +0 -11
- package/types/JavaScriptSDK.Enums/TelemetryUnloadReason.d.ts +0 -21
- package/types/JavaScriptSDK.Enums/TelemetryUpdateReason.d.ts +0 -20
- package/types/JavaScriptSDK.Interfaces/ITelemetryInitializers.d.ts +0 -13
- package/types/JavaScriptSDK.Interfaces/ITelemetryUnloadState.d.ts +0 -6
- package/types/JavaScriptSDK.Interfaces/ITelemetryUpdateState.d.ts +0 -22
- package/types/JavaScriptSDK.Interfaces/IUnloadableComponent.d.ts +0 -13
|
@@ -3,25 +3,14 @@ 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
|
|
6
|
+
import { IProcessTelemetryContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
7
7
|
import { ITelemetryPluginChain } from "../JavaScriptSDK.Interfaces/ITelemetryPluginChain";
|
|
8
|
-
import { UnloadHandler } from "./UnloadHandlerContainer";
|
|
9
|
-
import { IInstrumentHook } from "../JavaScriptSDK.Interfaces/IInstrumentHooks";
|
|
10
|
-
import { ITelemetryUnloadState } from "../JavaScriptSDK.Interfaces/ITelemetryUnloadState";
|
|
11
|
-
import { ITelemetryUpdateState } from "../JavaScriptSDK.Interfaces/ITelemetryUpdateState";
|
|
12
8
|
/**
|
|
13
9
|
* BaseTelemetryPlugin provides a basic implementation of the ITelemetryPlugin interface so that plugins
|
|
14
10
|
* can avoid implementation the same set of boiler plate code as well as provide a base
|
|
15
11
|
* implementation so that new default implementations can be added without breaking all plugins.
|
|
16
12
|
*/
|
|
17
13
|
export declare abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
|
|
18
|
-
identifier: string;
|
|
19
|
-
version?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Holds the core instance that was used during initialization
|
|
22
|
-
*/
|
|
23
|
-
core: IAppInsightsCore;
|
|
24
|
-
priority: number;
|
|
25
14
|
/**
|
|
26
15
|
* Call back for telemetry processing before it it is sent
|
|
27
16
|
* @param env - This is the current event being reported
|
|
@@ -43,6 +32,13 @@ export declare abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
|
|
|
43
32
|
* Returns whether the plugin has been initialized
|
|
44
33
|
*/
|
|
45
34
|
isInitialized: () => boolean;
|
|
35
|
+
identifier: string;
|
|
36
|
+
version?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Holds the core instance that was used during initialization
|
|
39
|
+
*/
|
|
40
|
+
core: IAppInsightsCore;
|
|
41
|
+
priority: number;
|
|
46
42
|
/**
|
|
47
43
|
* Helper to return the current IProcessTelemetryContext, if the passed argument exists this just
|
|
48
44
|
* returns that value (helps with minification for callers), otherwise it will return the configured
|
|
@@ -55,49 +51,10 @@ export declare abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
|
|
|
55
51
|
*/
|
|
56
52
|
protected setInitialized: (isInitialized: boolean) => void;
|
|
57
53
|
/**
|
|
58
|
-
*
|
|
59
|
-
* finishes it's removal.
|
|
60
|
-
* @param unloadCtx - This is the context that should be used during unloading.
|
|
61
|
-
* @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.
|
|
62
|
-
* @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.
|
|
63
|
-
* @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
|
|
64
|
-
*/
|
|
65
|
-
protected _doTeardown?: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void) => void | boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Extension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
|
|
68
|
-
* @param updateCtx - This is the context that should be used during updating.
|
|
69
|
-
* @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
|
|
70
|
-
* @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
|
|
71
|
-
* @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
|
|
54
|
+
* Internal helper to initialize the instance
|
|
72
55
|
*/
|
|
73
|
-
|
|
56
|
+
private _baseTelInit;
|
|
74
57
|
constructor();
|
|
75
58
|
initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
|
|
76
|
-
/**
|
|
77
|
-
* Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and
|
|
78
|
-
* therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further
|
|
79
|
-
* processTelemetry calls are ignored and it just calls the processNext() with the provided context.
|
|
80
|
-
* @param unloadCtx - This is the context that should be used during unloading.
|
|
81
|
-
* @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.
|
|
82
|
-
* @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
|
|
83
|
-
*/
|
|
84
|
-
teardown(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState): void | boolean;
|
|
85
59
|
abstract processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
86
|
-
/**
|
|
87
|
-
* The the plugin should re-evaluate configuration and update any cached configuration settings.
|
|
88
|
-
* @param updateCtx - This is the context that should be used during updating.
|
|
89
|
-
* @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
|
|
90
|
-
* @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
|
|
91
|
-
*/
|
|
92
|
-
update(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean;
|
|
93
|
-
/**
|
|
94
|
-
* Add an unload handler that will be called when the SDK is being unloaded
|
|
95
|
-
* @param handler - the handler
|
|
96
|
-
*/
|
|
97
|
-
protected _addUnloadCb(handler: UnloadHandler): void;
|
|
98
|
-
/**
|
|
99
|
-
* Add this hook so that it is automatically removed during unloading
|
|
100
|
-
* @param hooks - The single hook or an array of IInstrumentHook objects
|
|
101
|
-
*/
|
|
102
|
-
protected _addHook(hooks: IInstrumentHook | IInstrumentHook[]): void;
|
|
103
60
|
}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { SendRequestReason } from "../JavaScriptSDK.Enums/SendRequestReason";
|
|
2
1
|
import { IAppInsightsCore } from "../JavaScriptSDK.Interfaces/IAppInsightsCore";
|
|
3
|
-
import { IChannelControls } from "../JavaScriptSDK.Interfaces/IChannelControls";
|
|
4
2
|
import { IConfiguration } from "../JavaScriptSDK.Interfaces/IConfiguration";
|
|
5
|
-
import {
|
|
3
|
+
import { IChannelControls } from "../JavaScriptSDK.Interfaces/IChannelControls";
|
|
4
|
+
import { IPlugin, ITelemetryPlugin } from "../JavaScriptSDK.Interfaces/ITelemetryPlugin";
|
|
6
5
|
import { ITelemetryPluginChain } from "../JavaScriptSDK.Interfaces/ITelemetryPluginChain";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
|
|
7
|
+
import { IProcessTelemetryContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
8
|
+
import { BaseTelemetryPlugin } from "./BaseTelemetryPlugin";
|
|
9
|
+
export declare class ChannelController extends BaseTelemetryPlugin {
|
|
10
|
+
identifier: string;
|
|
11
|
+
priority: number;
|
|
12
|
+
setNextPlugin: (next: ITelemetryPlugin | ITelemetryPluginChain) => void;
|
|
13
|
+
constructor();
|
|
14
|
+
processTelemetry(item: ITelemetryItem, itemCtx: IProcessTelemetryContext): void;
|
|
15
|
+
getChannelControls(): IChannelControls[][];
|
|
16
|
+
initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[]): void;
|
|
17
|
+
/**
|
|
18
|
+
* Static constructor, attempt to create accessors
|
|
19
|
+
*/
|
|
20
|
+
private static _staticInit;
|
|
18
21
|
}
|
|
19
|
-
export declare function createChannelControllerPlugin(channelQueue: _IInternalChannels[], core: IAppInsightsCore): IChannelController;
|
|
20
|
-
export declare function createChannelQueues(channels: IChannelControls[][], extensions: IPlugin[], config: IConfiguration, core: IAppInsightsCore): _IInternalChannels[];
|
|
@@ -2,12 +2,59 @@ 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;
|
|
5
46
|
export declare function newGuid(): string;
|
|
6
47
|
/**
|
|
7
48
|
* Return the current value of the Performance Api now() function (if available) and fallback to dateNow() if it is unavailable (IE9 or less)
|
|
8
49
|
* https://caniuse.com/#search=performance.now
|
|
9
50
|
*/
|
|
10
51
|
export declare function perfNow(): number;
|
|
52
|
+
/**
|
|
53
|
+
* Generate random base64 id string.
|
|
54
|
+
* The default length is 22 which is 132-bits so almost the same as a GUID but as base64 (the previous default was 5)
|
|
55
|
+
* @param maxLength - Optional value to specify the length of the id to be generated, defaults to 22
|
|
56
|
+
*/
|
|
57
|
+
export declare function newId(maxLength?: number): string;
|
|
11
58
|
/**
|
|
12
59
|
* The strEndsWith() method determines whether a string ends with the characters of a specified string, returning true or false as appropriate.
|
|
13
60
|
* @param value - The value to check whether it ends with the search value.
|
|
@@ -152,7 +199,7 @@ export interface ICoreUtils {
|
|
|
152
199
|
* @param callback {any} - The callback function that needs to be executed for the given event
|
|
153
200
|
* @return {boolean} - true if the handler was successfully added
|
|
154
201
|
*/
|
|
155
|
-
addEventHandler: (eventName: string, callback: any
|
|
202
|
+
addEventHandler: (eventName: string, callback: any) => boolean;
|
|
156
203
|
/**
|
|
157
204
|
* 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)
|
|
158
205
|
* https://caniuse.com/#search=Date.now
|
|
@@ -63,13 +63,3 @@ export declare class DiagnosticLogger implements IDiagnosticLogger {
|
|
|
63
63
|
*/
|
|
64
64
|
logInternalMessage(severity: LoggingSeverity, message: _InternalLogMessage): void;
|
|
65
65
|
}
|
|
66
|
-
/**
|
|
67
|
-
* This is a helper method which will call throwInternal on the passed logger, will throw exceptions in
|
|
68
|
-
* debug mode or attempt to log the error as a console warning. This helper is provided mostly to better
|
|
69
|
-
* support minification as logger.throwInternal() will not compress the publish "throwInternal" used throughout
|
|
70
|
-
* the code.
|
|
71
|
-
* @param logger - The Diagnostic Logger instance to use.
|
|
72
|
-
* @param severity {LoggingSeverity} - The severity of the log message
|
|
73
|
-
* @param message {_InternalLogMessage} - The log message.
|
|
74
|
-
*/
|
|
75
|
-
export declare function _throwInternal(logger: IDiagnosticLogger, severity: LoggingSeverity, msgId: _InternalMessageId, msg: string, properties?: Object, isUserAct?: boolean): void;
|
|
@@ -1,18 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment.
|
|
3
|
+
* @ignore
|
|
4
|
+
*/
|
|
5
5
|
export declare function _getObjProto(target: any): any;
|
|
6
6
|
export declare function objToString(obj: any): any;
|
|
7
7
|
export declare function isTypeof(value: any, theType: string): boolean;
|
|
8
|
-
export declare function isUndefined(value: any):
|
|
9
|
-
export declare function isNotUndefined
|
|
10
|
-
export declare function isNullOrUndefined(value: any):
|
|
11
|
-
export declare function isNotNullOrUndefined
|
|
8
|
+
export declare function isUndefined(value: any): boolean;
|
|
9
|
+
export declare function isNotUndefined(value: any): boolean;
|
|
10
|
+
export declare function isNullOrUndefined(value: any): boolean;
|
|
11
|
+
export declare function isNotNullOrUndefined(value: any): boolean;
|
|
12
12
|
export declare function hasOwnProperty(obj: any, prop: string): boolean;
|
|
13
|
-
export declare function isObject
|
|
13
|
+
export declare function isObject(value: any): boolean;
|
|
14
14
|
export declare function isFunction(value: any): value is Function;
|
|
15
|
-
|
|
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;
|
|
16
32
|
/**
|
|
17
33
|
* Validates that the string name conforms to the JS IdentifierName specification and if not
|
|
18
34
|
* normalizes the name so that it would. This method does not identify or change any keywords
|
|
@@ -27,7 +43,7 @@ export declare function normalizeJsName(name: string): string;
|
|
|
27
43
|
* @param target The target object to find and process the keys
|
|
28
44
|
* @param callbackfn The function to call with the details
|
|
29
45
|
*/
|
|
30
|
-
export declare function objForEachKey
|
|
46
|
+
export declare function objForEachKey(target: any, callbackfn: (name: string, value: any) => void): void;
|
|
31
47
|
/**
|
|
32
48
|
* The strEndsWith() method determines whether a string ends with the characters of a specified string, returning true or false as appropriate.
|
|
33
49
|
* @param value - The value to check whether it ends with the search value.
|
|
@@ -67,8 +83,7 @@ export declare function strContains(value: string, search: string): boolean;
|
|
|
67
83
|
*/
|
|
68
84
|
export declare function isDate(obj: any): obj is Date;
|
|
69
85
|
/**
|
|
70
|
-
* Check if an object is of type Array
|
|
71
|
-
* and exists to help with TypeScript validation only.
|
|
86
|
+
* Check if an object is of type Array
|
|
72
87
|
*/
|
|
73
88
|
export declare let isArray: <T = any>(obj: any) => obj is Array<T>;
|
|
74
89
|
/**
|
|
@@ -121,7 +136,7 @@ export declare function _toISOStringPoly(date: Date): string;
|
|
|
121
136
|
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. It can return -1 to break out of the loop
|
|
122
137
|
* @param thisArg [Optional] An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
|
|
123
138
|
*/
|
|
124
|
-
export declare function arrForEach<T
|
|
139
|
+
export declare function arrForEach<T>(arr: T[], callbackfn: (value: T, index?: number, array?: T[]) => void | number, thisArg?: any): void;
|
|
125
140
|
/**
|
|
126
141
|
* Returns the index of the first occurrence of a value in an array. This helper exists to avoid adding a polyfil for older browsers
|
|
127
142
|
* that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype
|
|
@@ -171,7 +186,6 @@ export declare function objKeys(obj: {}): string[];
|
|
|
171
186
|
* @returns True if it was able to create the accessors otherwise false
|
|
172
187
|
*/
|
|
173
188
|
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;
|
|
175
189
|
export declare const objFreeze: <T>(value: T) => T;
|
|
176
190
|
export declare const objSeal: <T>(value: T) => T;
|
|
177
191
|
/**
|
|
@@ -193,7 +207,7 @@ export declare function getExceptionName(object: any): string;
|
|
|
193
207
|
* @param srcChk - [Optional] Callback to check to original value that if supplied will be called if the new value should be set (if allowed)
|
|
194
208
|
* @returns The existing or new value, depending what was set
|
|
195
209
|
*/
|
|
196
|
-
export declare function setValue<T, K extends keyof T>(target: T, field: K, value: T[K], valChk?: (
|
|
210
|
+
export declare function setValue<T, K extends keyof T>(target: T, field: K, value: T[K], valChk?: (value: T[K]) => boolean, srcChk?: (value: T[K]) => boolean): T[K];
|
|
197
211
|
/**
|
|
198
212
|
* Returns the current value from the target object if not null or undefined otherwise sets the new value and returns it
|
|
199
213
|
* @param target - The target object to return or set the default value
|
|
@@ -218,29 +232,15 @@ export declare function throwError(message: string): never;
|
|
|
218
232
|
* @param target - The target object to be assigned with the source properties and functions
|
|
219
233
|
* @param source - The source object which will be assigned / called by setting / calling the targets proxies
|
|
220
234
|
* @param chkSet - An optional callback to determine whether a specific property/function should be proxied
|
|
235
|
+
* @memberof Initialization
|
|
221
236
|
*/
|
|
222
|
-
export declare function proxyAssign
|
|
223
|
-
export declare function proxyFunctionAs<T, S>(target: T, name: string, source: S | (() => S), theFunc: (keyof S), overwriteTarget?: boolean): void;
|
|
224
|
-
/**
|
|
225
|
-
* Creates proxy functions on the target which internally will call the source version with all arguments passed to the target method.
|
|
226
|
-
*
|
|
227
|
-
* @param target - The target object to be assigned with the source properties and functions
|
|
228
|
-
* @param source - The source object which will be assigned / called by setting / calling the targets proxies
|
|
229
|
-
* @param functionsToProxy - An array of function names that will be proxied on the target
|
|
230
|
-
*/
|
|
231
|
-
export declare function proxyFunctions<T, S>(target: T, source: S | (() => S), functionsToProxy: (keyof S)[], overwriteTarget?: boolean): T;
|
|
237
|
+
export declare function proxyAssign(target: any, source: any, chkSet?: (name: string, isFunc?: boolean, source?: any, target?: any) => boolean): any;
|
|
232
238
|
/**
|
|
233
239
|
* Simpler helper to create a dynamic class that implements the interface and populates the values with the defaults.
|
|
234
240
|
* Only instance properties (hasOwnProperty) values are copied from the defaults to the new instance
|
|
235
241
|
* @param defaults Simple helper
|
|
236
242
|
*/
|
|
237
243
|
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;
|
|
244
244
|
/**
|
|
245
245
|
* A helper function to assist with JIT performance for objects that have properties added / removed dynamically
|
|
246
246
|
* this is primarily for chromium based browsers and has limited effects on Firefox and none of IE. Only call this
|
|
@@ -259,5 +259,4 @@ export declare function optimizeObject<T>(theObject: T): T;
|
|
|
259
259
|
* @param obj5 - object to merge.
|
|
260
260
|
* @returns The extended first object.
|
|
261
261
|
*/
|
|
262
|
-
export declare function objExtend<T2, T3, T4, T5, T6>(
|
|
263
|
-
export declare function objExtend<T1, T2, T3, T4, T5, T6>(obj1?: T1, obj2?: T2, obj3?: T3, obj4?: T4, obj5?: T5, obj6?: T6): T1 & T2 & T3 & T4 & T5 & T6;
|
|
262
|
+
export declare function objExtend<T1, T2, T3, T4, T5, T6>(obj?: boolean | T1, obj2?: T2, obj3?: T3, obj4?: T4, obj5?: T5, obj6?: T6): T1 & T2 & T3 & T4 & T5 & T6;
|
|
@@ -46,7 +46,7 @@ export declare class PerfManager implements IPerfManager {
|
|
|
46
46
|
* Defined as private so it can be visualized via the DebugPlugin
|
|
47
47
|
*/
|
|
48
48
|
private ctx;
|
|
49
|
-
constructor(manager
|
|
49
|
+
constructor(manager: INotificationManager);
|
|
50
50
|
/**
|
|
51
51
|
* Create a new event and start timing, the manager may return null/undefined to indicate that it does not
|
|
52
52
|
* want to monitor this source event.
|
|
@@ -1,65 +1,17 @@
|
|
|
1
1
|
import { IAppInsightsCore } from "../JavaScriptSDK.Interfaces/IAppInsightsCore";
|
|
2
|
+
import { IDiagnosticLogger } from "../JavaScriptSDK.Interfaces/IDiagnosticLogger";
|
|
2
3
|
import { IConfiguration } from "../JavaScriptSDK.Interfaces/IConfiguration";
|
|
3
4
|
import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
|
|
4
|
-
import { IPlugin
|
|
5
|
-
import { IProcessTelemetryContext
|
|
5
|
+
import { IPlugin } from "../JavaScriptSDK.Interfaces/ITelemetryPlugin";
|
|
6
|
+
import { IProcessTelemetryContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
6
7
|
import { ITelemetryPluginChain } from "../JavaScriptSDK.Interfaces/ITelemetryPluginChain";
|
|
7
|
-
import { IDiagnosticLogger } from "../JavaScriptSDK.Interfaces/IDiagnosticLogger";
|
|
8
|
-
/**
|
|
9
|
-
* Creates a new Telemetry Item context with the current config, core and plugin execution chain
|
|
10
|
-
* @param plugins - The plugin instances that will be executed
|
|
11
|
-
* @param config - The current config
|
|
12
|
-
* @param core - The current core instance
|
|
13
|
-
* @param startAt - Identifies the next plugin to execute, if null there is no "next" plugin and if undefined it should assume the start of the chain
|
|
14
|
-
*/
|
|
15
|
-
export declare function createProcessTelemetryContext(telemetryChain: ITelemetryPluginChain | null, config: IConfiguration, core: IAppInsightsCore, startAt?: IPlugin): IProcessTelemetryContext;
|
|
16
|
-
/**
|
|
17
|
-
* Creates a new Telemetry Item context with the current config, core and plugin execution chain for handling the unloading of the chain
|
|
18
|
-
* @param plugins - The plugin instances that will be executed
|
|
19
|
-
* @param config - The current config
|
|
20
|
-
* @param core - The current core instance
|
|
21
|
-
* @param startAt - Identifies the next plugin to execute, if null there is no "next" plugin and if undefined it should assume the start of the chain
|
|
22
|
-
*/
|
|
23
|
-
export declare function createProcessTelemetryUnloadContext(telemetryChain: ITelemetryPluginChain, config: IConfiguration, core: IAppInsightsCore, startAt?: IPlugin): IProcessTelemetryUnloadContext;
|
|
24
|
-
/**
|
|
25
|
-
* Creates a new Telemetry Item context with the current config, core and plugin execution chain for updating the configuration
|
|
26
|
-
* @param plugins - The plugin instances that will be executed
|
|
27
|
-
* @param config - The current config
|
|
28
|
-
* @param core - The current core instance
|
|
29
|
-
* @param startAt - Identifies the next plugin to execute, if null there is no "next" plugin and if undefined it should assume the start of the chain
|
|
30
|
-
*/
|
|
31
|
-
export declare function createProcessTelemetryUpdateContext(telemetryChain: ITelemetryPluginChain, config: IConfiguration, core: IAppInsightsCore, startAt?: IPlugin): IProcessTelemetryUpdateContext;
|
|
32
|
-
/**
|
|
33
|
-
* Creates an execution chain from the array of plugins
|
|
34
|
-
* @param plugins - The array of plugins that will be executed in this order
|
|
35
|
-
* @param defItemCtx - The default execution context to use when no telemetry context is passed to processTelemetry(), this
|
|
36
|
-
* should be for legacy plugins only. Currently, only used for passing the current core instance and to provide better error
|
|
37
|
-
* reporting (hasRun) when errors occur.
|
|
38
|
-
*/
|
|
39
|
-
export declare function createTelemetryProxyChain(plugins: IPlugin[], config: IConfiguration, core: IAppInsightsCore, startAt?: IPlugin): ITelemetryPluginChain;
|
|
40
|
-
/**
|
|
41
|
-
* Create the processing telemetry proxy instance, the proxy is used to abstract the current plugin to allow monitoring and
|
|
42
|
-
* execution plugins while passing around the dynamic execution state (IProcessTelemetryContext), the proxy instance no longer
|
|
43
|
-
* contains any execution state and can be reused between requests (this was not the case for 2.7.2 and earlier with the
|
|
44
|
-
* TelemetryPluginChain class).
|
|
45
|
-
* @param plugin - The plugin instance to proxy
|
|
46
|
-
* @param config - The default execution context to use when no telemetry context is passed to processTelemetry(), this
|
|
47
|
-
* should be for legacy plugins only. Currently, only used for passing the current core instance and to provide better error
|
|
48
|
-
* reporting (hasRun) when errors occur.
|
|
49
|
-
* @returns
|
|
50
|
-
*/
|
|
51
|
-
export declare function createTelemetryPluginProxy(plugin: ITelemetryPlugin, config: IConfiguration, core: IAppInsightsCore): ITelemetryPluginChain;
|
|
52
|
-
/**
|
|
53
|
-
* This class will be removed!
|
|
54
|
-
* @deprecated use createProcessTelemetryContext() instead
|
|
55
|
-
*/
|
|
56
8
|
export declare class ProcessTelemetryContext implements IProcessTelemetryContext {
|
|
57
9
|
/**
|
|
58
10
|
* Gets the current core config instance
|
|
59
11
|
*/
|
|
60
12
|
getCfg: () => IConfiguration;
|
|
61
13
|
getExtCfg: <T>(identifier: string, defaultValue?: T | any) => T;
|
|
62
|
-
getConfig: (identifier: string, field: string, defaultValue?: number | string | boolean
|
|
14
|
+
getConfig: (identifier: string, field: string, defaultValue?: number | string | boolean) => number | string | boolean;
|
|
63
15
|
/**
|
|
64
16
|
* Returns the IAppInsightsCore instance for the current request
|
|
65
17
|
*/
|
|
@@ -87,32 +39,17 @@ export declare class ProcessTelemetryContext implements IProcessTelemetryContext
|
|
|
87
39
|
* @param itemCtx - This is the context for the current request, ITelemetryPlugin instances
|
|
88
40
|
* can optionally use this to access the current core instance or define / pass additional information
|
|
89
41
|
* to later plugins (vs appending items to the telemetry item)
|
|
90
|
-
* @returns boolean (true) if there is no more plugins to process otherwise false or undefined (void)
|
|
91
|
-
*/
|
|
92
|
-
processNext: (env: ITelemetryItem) => boolean | void;
|
|
93
|
-
/**
|
|
94
|
-
* Synchronously iterate over the context chain running the callback for each plugin, once
|
|
95
|
-
* every plugin has been executed via the callback, any associated onComplete will be called.
|
|
96
|
-
* @param callback - The function call for each plugin in the context chain
|
|
97
42
|
*/
|
|
98
|
-
|
|
43
|
+
processNext: (env: ITelemetryItem) => void;
|
|
99
44
|
/**
|
|
100
45
|
* Create a new context using the core and config from the current instance
|
|
101
|
-
* @param plugins - The execution order to process the plugins, if null or not supplied
|
|
102
|
-
* then the current execution order will be copied.
|
|
103
|
-
* @param startAt - The plugin to start processing from, if missing from the execution
|
|
104
|
-
* order then the next plugin will be NOT set.
|
|
105
46
|
*/
|
|
106
47
|
createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryContext;
|
|
107
|
-
/**
|
|
108
|
-
* Set the function to call when the current chain has executed all processNext or unloadNext items.
|
|
109
|
-
*/
|
|
110
|
-
onComplete: (onComplete: () => void) => void;
|
|
111
48
|
/**
|
|
112
49
|
* Creates a new Telemetry Item context with the current config, core and plugin execution chain
|
|
113
50
|
* @param plugins - The plugin instances that will be executed
|
|
114
51
|
* @param config - The current config
|
|
115
52
|
* @param core - The current core instance
|
|
116
53
|
*/
|
|
117
|
-
constructor(
|
|
54
|
+
constructor(plugins: IPlugin[] | ITelemetryPluginChain, config: IConfiguration, core: IAppInsightsCore, startAt?: IPlugin);
|
|
118
55
|
}
|
|
@@ -21,9 +21,3 @@ export declare function mwcRandomSeed(value?: number): void;
|
|
|
21
21
|
* @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)
|
|
22
22
|
*/
|
|
23
23
|
export declare function mwcRandom32(signed?: boolean): number;
|
|
24
|
-
/**
|
|
25
|
-
* Generate random base64 id string.
|
|
26
|
-
* The default length is 22 which is 132-bits so almost the same as a GUID but as base64 (the previous default was 5)
|
|
27
|
-
* @param maxLength - Optional value to specify the length of the id to be generated, defaults to 22
|
|
28
|
-
*/
|
|
29
|
-
export declare function newId(maxLength?: number): string;
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { IPlugin } from "../JavaScriptSDK.Interfaces/ITelemetryPlugin";
|
|
2
|
-
import {
|
|
3
|
-
import { IAppInsightsCore } from "../JavaScriptSDK.Interfaces/IAppInsightsCore";
|
|
4
|
-
import { IUnloadableComponent } from "../JavaScriptSDK.Interfaces/IUnloadableComponent";
|
|
5
|
-
import { ITelemetryUnloadState } from "../JavaScriptSDK.Interfaces/ITelemetryUnloadState";
|
|
6
|
-
export interface IPluginState {
|
|
7
|
-
core?: IAppInsightsCore;
|
|
8
|
-
isInitialized?: boolean;
|
|
9
|
-
tearDown?: boolean;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare function _getPluginState(plugin: IPlugin): IPluginState;
|
|
2
|
+
import { ProcessTelemetryContext } from "./ProcessTelemetryContext";
|
|
13
3
|
/**
|
|
14
4
|
* Initialize the queue of plugins
|
|
15
5
|
* @param plugins - The array of plugins to initialize and setting of the next plugin
|
|
@@ -17,15 +7,5 @@ export declare function _getPluginState(plugin: IPlugin): IPluginState;
|
|
|
17
7
|
* @param core THe current core instance
|
|
18
8
|
* @param extensions The extensions
|
|
19
9
|
*/
|
|
20
|
-
export declare function initializePlugins(processContext:
|
|
21
|
-
export declare function sortPlugins
|
|
22
|
-
/**
|
|
23
|
-
* Teardown / Unload helper to perform teardown/unloading operations for the provided components synchronously or asynchronously, this will call any
|
|
24
|
-
* _doTeardown() or _doUnload() functions on the provided components to allow them to finish removal.
|
|
25
|
-
* @param components - The components you want to unload
|
|
26
|
-
* @param unloadCtx - This is the context that should be used during unloading.
|
|
27
|
-
* @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.
|
|
28
|
-
* @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.
|
|
29
|
-
* @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
|
|
30
|
-
*/
|
|
31
|
-
export declare function unloadComponents(components: any | IUnloadableComponent[], unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void): void | boolean;
|
|
10
|
+
export declare function initializePlugins(processContext: ProcessTelemetryContext, extensions: IPlugin[]): void;
|
|
11
|
+
export declare function sortPlugins(plugins: IPlugin[]): IPlugin[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
|
|
2
|
+
import { IProcessTelemetryContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
3
|
+
import { ITelemetryPluginChain } from "../JavaScriptSDK.Interfaces/ITelemetryPluginChain";
|
|
4
|
+
import { ITelemetryPlugin } from "../JavaScriptSDK.Interfaces/ITelemetryPlugin";
|
|
5
|
+
export declare class TelemetryPluginChain implements ITelemetryPluginChain {
|
|
6
|
+
/**
|
|
7
|
+
* Returns the underlying plugin that is being proxied for the processTelemetry call
|
|
8
|
+
*/
|
|
9
|
+
getPlugin: () => ITelemetryPlugin;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the next plugin
|
|
12
|
+
*/
|
|
13
|
+
getNext: () => ITelemetryPluginChain;
|
|
14
|
+
/**
|
|
15
|
+
* Sets the next proxy to be executed as the next plugin
|
|
16
|
+
* (Should only be used during initialization, which is why it's not defined on the interface)
|
|
17
|
+
*/
|
|
18
|
+
setNext: (nextPlugin: ITelemetryPluginChain) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Call back for telemetry processing before it it is sent
|
|
21
|
+
* @param env - This is the current event being reported
|
|
22
|
+
* @param itemCtx - This is the context for the current request, ITelemetryPlugin instances
|
|
23
|
+
* can optionally use this to access the current core instance or define / pass additional information
|
|
24
|
+
* to later plugins (vs appending items to the telemetry item)
|
|
25
|
+
*/
|
|
26
|
+
processTelemetry: (env: ITelemetryItem, itemCtx: IProcessTelemetryContext) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Internal flag used to try and identify root cause failures
|
|
29
|
+
*/
|
|
30
|
+
private _hasRun;
|
|
31
|
+
constructor(plugin: ITelemetryPlugin, defItemCtx: IProcessTelemetryContext);
|
|
32
|
+
}
|