@microsoft/applicationinsights-core-js 2.7.5-nightly.2203-01 → 2.7.5-nightly.2204-03
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 +1999 -793
- 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 +15679 -8835
- package/dist/applicationinsights-core-js.api.md +425 -48
- package/dist/applicationinsights-core-js.d.ts +784 -123
- package/dist/applicationinsights-core-js.js +1999 -793
- 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 +784 -123
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js +3 -69
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js.map +1 -1
- package/dist-esm/JavaScriptSDK/BaseCore.js +496 -99
- package/dist-esm/JavaScriptSDK/BaseCore.js.map +1 -1
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +120 -21
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js.map +1 -1
- package/dist-esm/JavaScriptSDK/ChannelController.js +202 -87
- 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 +7 -148
- 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 +25 -12
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js.map +1 -1
- package/dist-esm/JavaScriptSDK/EnvUtils.js +13 -12
- package/dist-esm/JavaScriptSDK/EnvUtils.js.map +1 -1
- package/dist-esm/JavaScriptSDK/EventHelpers.js +477 -0
- package/dist-esm/JavaScriptSDK/EventHelpers.js.map +1 -0
- package/dist-esm/JavaScriptSDK/HelperFuncs.js +89 -86
- package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
- package/dist-esm/JavaScriptSDK/InstrumentHooks.js +3 -1
- package/dist-esm/JavaScriptSDK/InstrumentHooks.js.map +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 +37 -42
- package/dist-esm/JavaScriptSDK/NotificationManager.js.map +1 -1
- package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
- package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +430 -119
- package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js.map +1 -1
- package/dist-esm/JavaScriptSDK/RandomHelper.js +30 -4
- package/dist-esm/JavaScriptSDK/RandomHelper.js.map +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +60 -14
- package/dist-esm/JavaScriptSDK/TelemetryHelpers.js.map +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +81 -0
- package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js.map +1 -0
- package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +33 -0
- package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js.map +1 -0
- 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.Enums/TelemetryUpdateReason.js +8 -0
- package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js.map +1 -0
- package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -2
- 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/ITelemetryInitializers.js +6 -0
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js.map +1 -0
- 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/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +8 -0
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js.map +1 -0
- package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js +6 -0
- package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js.map +1 -0
- package/dist-esm/applicationinsights-core-js.js +12 -7
- package/dist-esm/applicationinsights-core-js.js.map +1 -1
- package/package.json +2 -2
- package/src/JavaScriptSDK/AppInsightsCore.ts +2 -101
- package/src/JavaScriptSDK/BaseCore.ts +696 -120
- package/src/JavaScriptSDK/BaseTelemetryPlugin.ts +205 -31
- package/src/JavaScriptSDK/ChannelController.ts +242 -103
- package/src/JavaScriptSDK/CookieMgr.ts +7 -5
- package/src/JavaScriptSDK/CoreUtils.ts +8 -172
- package/src/JavaScriptSDK/DataCacheHelper.ts +106 -0
- package/src/JavaScriptSDK/DiagnosticLogger.ts +27 -12
- package/src/JavaScriptSDK/EnvUtils.ts +13 -12
- package/src/JavaScriptSDK/EventHelpers.ts +550 -0
- package/src/JavaScriptSDK/HelperFuncs.ts +123 -97
- package/src/JavaScriptSDK/InstrumentHooks.ts +4 -2
- package/src/JavaScriptSDK/InternalConstants.ts +26 -0
- package/src/JavaScriptSDK/NotificationManager.ts +34 -37
- package/src/JavaScriptSDK/PerfManager.ts +4 -7
- package/src/JavaScriptSDK/ProcessTelemetryContext.ts +543 -134
- package/src/JavaScriptSDK/RandomHelper.ts +35 -3
- package/src/JavaScriptSDK/TelemetryHelpers.ts +83 -21
- package/src/JavaScriptSDK/TelemetryInitializerPlugin.ts +111 -0
- package/src/JavaScriptSDK/UnloadHandlerContainer.ts +46 -0
- package/src/JavaScriptSDK.Enums/LoggingEnums.ts +184 -87
- package/src/JavaScriptSDK.Enums/SendRequestReason.ts +5 -0
- package/src/JavaScriptSDK.Enums/TelemetryUnloadReason.ts +27 -0
- package/src/JavaScriptSDK.Enums/TelemetryUpdateReason.ts +27 -0
- package/src/JavaScriptSDK.Interfaces/IAppInsightsCore.ts +82 -2
- package/src/JavaScriptSDK.Interfaces/IChannelControls.ts +16 -5
- package/src/JavaScriptSDK.Interfaces/IInstrumentHooks.ts +16 -6
- package/src/JavaScriptSDK.Interfaces/IProcessTelemetryContext.ts +94 -14
- package/src/JavaScriptSDK.Interfaces/ITelemetryInitializers.ts +16 -0
- package/src/JavaScriptSDK.Interfaces/ITelemetryPlugin.ts +28 -10
- package/src/JavaScriptSDK.Interfaces/ITelemetryPluginChain.ts +9 -11
- package/src/JavaScriptSDK.Interfaces/ITelemetryUnloadState.ts +10 -0
- package/src/JavaScriptSDK.Interfaces/ITelemetryUpdateState.ts +34 -0
- package/src/JavaScriptSDK.Interfaces/IUnloadableComponent.ts +17 -0
- package/types/JavaScriptSDK/AppInsightsCore.d.ts +0 -21
- package/types/JavaScriptSDK/BaseCore.d.ts +81 -3
- package/types/JavaScriptSDK/BaseTelemetryPlugin.d.ts +53 -10
- package/types/JavaScriptSDK/ChannelController.d.ts +16 -17
- package/types/JavaScriptSDK/CoreUtils.d.ts +1 -48
- package/types/JavaScriptSDK/DataCacheHelper.d.ts +13 -0
- package/types/JavaScriptSDK/DiagnosticLogger.d.ts +10 -0
- package/types/JavaScriptSDK/EventHelpers.d.ts +154 -0
- package/types/JavaScriptSDK/HelperFuncs.d.ts +33 -32
- package/types/JavaScriptSDK/InternalConstants.d.ts +20 -0
- package/types/JavaScriptSDK/PerfManager.d.ts +1 -1
- package/types/JavaScriptSDK/ProcessTelemetryContext.d.ts +69 -6
- package/types/JavaScriptSDK/RandomHelper.d.ts +6 -0
- package/types/JavaScriptSDK/TelemetryHelpers.d.ts +23 -3
- package/types/JavaScriptSDK/TelemetryInitializerPlugin.d.ts +16 -0
- package/types/JavaScriptSDK/UnloadHandlerContainer.d.ts +11 -0
- package/types/JavaScriptSDK.Enums/LoggingEnums.d.ts +91 -2
- package/types/JavaScriptSDK.Enums/SendRequestReason.d.ts +4 -0
- package/types/JavaScriptSDK.Enums/TelemetryUnloadReason.d.ts +21 -0
- package/types/JavaScriptSDK.Enums/TelemetryUpdateReason.d.ts +20 -0
- package/types/JavaScriptSDK.Interfaces/IAppInsightsCore.d.ts +72 -1
- package/types/JavaScriptSDK.Interfaces/IChannelControls.d.ts +16 -5
- package/types/JavaScriptSDK.Interfaces/IInstrumentHooks.d.ts +9 -0
- package/types/JavaScriptSDK.Interfaces/IProcessTelemetryContext.d.ts +82 -11
- package/types/JavaScriptSDK.Interfaces/ITelemetryInitializers.d.ts +13 -0
- package/types/JavaScriptSDK.Interfaces/ITelemetryPlugin.d.ts +25 -8
- package/types/JavaScriptSDK.Interfaces/ITelemetryPluginChain.d.ts +9 -10
- package/types/JavaScriptSDK.Interfaces/ITelemetryUnloadState.d.ts +6 -0
- package/types/JavaScriptSDK.Interfaces/ITelemetryUpdateState.d.ts +22 -0
- package/types/JavaScriptSDK.Interfaces/IUnloadableComponent.d.ts +13 -0
- package/types/applicationinsights-core-js.d.ts +18 -9
- package/types/tsdoc-metadata.json +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryPluginChain.js +0 -76
- package/dist-esm/JavaScriptSDK/TelemetryPluginChain.js.map +0 -1
- package/src/JavaScriptSDK/TelemetryPluginChain.ts +0 -120
- package/types/JavaScriptSDK/TelemetryPluginChain.d.ts +0 -32
|
@@ -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";
|
|
@@ -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,17 +1,65 @@
|
|
|
1
1
|
import { IAppInsightsCore } from "../JavaScriptSDK.Interfaces/IAppInsightsCore";
|
|
2
|
-
import { IDiagnosticLogger } from "../JavaScriptSDK.Interfaces/IDiagnosticLogger";
|
|
3
2
|
import { IConfiguration } from "../JavaScriptSDK.Interfaces/IConfiguration";
|
|
4
3
|
import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
|
|
5
|
-
import { IPlugin } from "../JavaScriptSDK.Interfaces/ITelemetryPlugin";
|
|
6
|
-
import { IProcessTelemetryContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
4
|
+
import { IPlugin, ITelemetryPlugin } from "../JavaScriptSDK.Interfaces/ITelemetryPlugin";
|
|
5
|
+
import { IProcessTelemetryContext, IProcessTelemetryUnloadContext, IProcessTelemetryUpdateContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
7
6
|
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
|
+
*/
|
|
8
56
|
export declare class ProcessTelemetryContext implements IProcessTelemetryContext {
|
|
9
57
|
/**
|
|
10
58
|
* Gets the current core config instance
|
|
11
59
|
*/
|
|
12
60
|
getCfg: () => IConfiguration;
|
|
13
61
|
getExtCfg: <T>(identifier: string, defaultValue?: T | any) => T;
|
|
14
|
-
getConfig: (identifier: string, field: string, defaultValue?: number | string | boolean) => number | string | boolean;
|
|
62
|
+
getConfig: (identifier: string, field: string, defaultValue?: number | string | boolean | string[] | RegExp[] | Function) => number | string | boolean | string[] | RegExp[] | Function;
|
|
15
63
|
/**
|
|
16
64
|
* Returns the IAppInsightsCore instance for the current request
|
|
17
65
|
*/
|
|
@@ -39,17 +87,32 @@ export declare class ProcessTelemetryContext implements IProcessTelemetryContext
|
|
|
39
87
|
* @param itemCtx - This is the context for the current request, ITelemetryPlugin instances
|
|
40
88
|
* can optionally use this to access the current core instance or define / pass additional information
|
|
41
89
|
* 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
|
|
42
97
|
*/
|
|
43
|
-
|
|
98
|
+
iterate: <T extends ITelemetryPlugin = ITelemetryPlugin>(callback: (plugin: T) => void) => void;
|
|
44
99
|
/**
|
|
45
100
|
* 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.
|
|
46
105
|
*/
|
|
47
106
|
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;
|
|
48
111
|
/**
|
|
49
112
|
* Creates a new Telemetry Item context with the current config, core and plugin execution chain
|
|
50
113
|
* @param plugins - The plugin instances that will be executed
|
|
51
114
|
* @param config - The current config
|
|
52
115
|
* @param core - The current core instance
|
|
53
116
|
*/
|
|
54
|
-
constructor(
|
|
117
|
+
constructor(pluginChain: ITelemetryPluginChain, config: IConfiguration, core: IAppInsightsCore, startAt?: IPlugin);
|
|
55
118
|
}
|
|
@@ -21,3 +21,9 @@ 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,5 +1,15 @@
|
|
|
1
1
|
import { IPlugin } from "../JavaScriptSDK.Interfaces/ITelemetryPlugin";
|
|
2
|
-
import {
|
|
2
|
+
import { IProcessTelemetryContext, IProcessTelemetryUnloadContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
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;
|
|
3
13
|
/**
|
|
4
14
|
* Initialize the queue of plugins
|
|
5
15
|
* @param plugins - The array of plugins to initialize and setting of the next plugin
|
|
@@ -7,5 +17,15 @@ import { ProcessTelemetryContext } from "./ProcessTelemetryContext";
|
|
|
7
17
|
* @param core THe current core instance
|
|
8
18
|
* @param extensions The extensions
|
|
9
19
|
*/
|
|
10
|
-
export declare function initializePlugins(processContext:
|
|
11
|
-
export declare function sortPlugins(plugins:
|
|
20
|
+
export declare function initializePlugins(processContext: IProcessTelemetryContext, extensions: IPlugin[]): void;
|
|
21
|
+
export declare function sortPlugins<T = IPlugin>(plugins: T[]): T[];
|
|
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;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IProcessTelemetryContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
2
|
+
import { ITelemetryInitializerContainer, ITelemetryInitializerHandler, TelemetryInitializerFunction } from "../JavaScriptSDK.Interfaces/ITelemetryInitializers";
|
|
3
|
+
import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
|
|
4
|
+
import { BaseTelemetryPlugin } from "./BaseTelemetryPlugin";
|
|
5
|
+
export declare class TelemetryInitializerPlugin extends BaseTelemetryPlugin implements ITelemetryInitializerContainer {
|
|
6
|
+
identifier: string;
|
|
7
|
+
priority: number;
|
|
8
|
+
constructor();
|
|
9
|
+
/**
|
|
10
|
+
* Add a telemetry processor to decorate or drop telemetry events.
|
|
11
|
+
* @param telemetryInitializer - The Telemetry Initializer function
|
|
12
|
+
* @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
|
|
13
|
+
*/
|
|
14
|
+
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler;
|
|
15
|
+
processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IProcessTelemetryUnloadContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
2
|
+
import { ITelemetryUnloadState } from "../JavaScriptSDK.Interfaces/ITelemetryUnloadState";
|
|
3
|
+
export declare type UnloadHandler = (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
|
|
4
|
+
export interface IUnloadHandlerContainer {
|
|
5
|
+
add: (handler: UnloadHandler) => void;
|
|
6
|
+
run: (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function createUnloadHandlerContainer(): {
|
|
9
|
+
add: (handler: UnloadHandler) => void;
|
|
10
|
+
run: (unloadCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
|
|
11
|
+
};
|
|
@@ -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,21 @@
|
|
|
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
|
+
/**
|
|
10
|
+
* Just this plugin is being removed
|
|
11
|
+
*/
|
|
12
|
+
PluginUnload = 1,
|
|
13
|
+
/**
|
|
14
|
+
* This instance of the plugin is being removed and replaced
|
|
15
|
+
*/
|
|
16
|
+
PluginReplace = 2,
|
|
17
|
+
/**
|
|
18
|
+
* The entire SDK is being unloaded
|
|
19
|
+
*/
|
|
20
|
+
SdkUnload = 50
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The TelemetryUpdateReason enumeration contains a set of bit-wise values that specify the reason for update request.
|
|
3
|
+
*/
|
|
4
|
+
export declare const enum TelemetryUpdateReason {
|
|
5
|
+
/**
|
|
6
|
+
* Unknown.
|
|
7
|
+
*/
|
|
8
|
+
Unknown = 0,
|
|
9
|
+
/**
|
|
10
|
+
* The configuration has ben updated or changed
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* One or more plugins have been added
|
|
14
|
+
*/
|
|
15
|
+
PluginAdded = 16,
|
|
16
|
+
/**
|
|
17
|
+
* One or more plugins have been removed
|
|
18
|
+
*/
|
|
19
|
+
PluginRemoved = 32
|
|
20
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITelemetryItem } from "./ITelemetryItem";
|
|
2
2
|
import { IChannelControls } from "./IChannelControls";
|
|
3
|
-
import { IPlugin } from "./ITelemetryPlugin";
|
|
3
|
+
import { IPlugin, ITelemetryPlugin } from "./ITelemetryPlugin";
|
|
4
4
|
import { IConfiguration } from "./IConfiguration";
|
|
5
5
|
import { INotificationManager } from "./INotificationManager";
|
|
6
6
|
import { INotificationListener } from "./INotificationListener";
|
|
@@ -8,6 +8,27 @@ import { IDiagnosticLogger } from "./IDiagnosticLogger";
|
|
|
8
8
|
import { IProcessTelemetryContext } from "./IProcessTelemetryContext";
|
|
9
9
|
import { IPerfManagerProvider } from "./IPerfManager";
|
|
10
10
|
import { ICookieMgr } from "./ICookieMgr";
|
|
11
|
+
import { ITelemetryInitializerHandler, TelemetryInitializerFunction } from "./ITelemetryInitializers";
|
|
12
|
+
import { ITelemetryUnloadState } from "./ITelemetryUnloadState";
|
|
13
|
+
import { UnloadHandler } from "../JavaScriptSDK/UnloadHandlerContainer";
|
|
14
|
+
import { SendRequestReason } from "../JavaScriptSDK.Enums/SendRequestReason";
|
|
15
|
+
export interface ILoadedPlugin<T extends IPlugin> {
|
|
16
|
+
plugin: T;
|
|
17
|
+
/**
|
|
18
|
+
* Identifies whether the plugin is enabled and can process events. This is slightly different from isInitialized as the plugin may be initialized but disabled
|
|
19
|
+
* via the setEnabled() or it may be a shared plugin which has had it's teardown function called from another instance..
|
|
20
|
+
* @returns boolean = true if the plugin is in a state where it is operational.
|
|
21
|
+
*/
|
|
22
|
+
isEnabled: () => boolean;
|
|
23
|
+
/**
|
|
24
|
+
* You can optionally enable / disable a plugin from processing events.
|
|
25
|
+
* Setting enabled to true will not necessarily cause the `isEnabled()` to also return true
|
|
26
|
+
* as the plugin must also have been successfully initialized and not had it's `teardown` method called
|
|
27
|
+
* (unless it's also been re-initialized)
|
|
28
|
+
*/
|
|
29
|
+
setEnabled: (isEnabled: boolean) => void;
|
|
30
|
+
remove: (isAsync?: boolean, removeCb?: (removed?: boolean) => void) => void;
|
|
31
|
+
}
|
|
11
32
|
export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
12
33
|
config: IConfiguration;
|
|
13
34
|
logger: IDiagnosticLogger;
|
|
@@ -43,10 +64,60 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
43
64
|
* @param {INotificationListener} listener - INotificationListener to remove.
|
|
44
65
|
*/
|
|
45
66
|
removeNotificationListener?(listener: INotificationListener): void;
|
|
67
|
+
/**
|
|
68
|
+
* Add a telemetry processor to decorate or drop telemetry events.
|
|
69
|
+
* @param telemetryInitializer - The Telemetry Initializer function
|
|
70
|
+
* @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
|
|
71
|
+
*/
|
|
72
|
+
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
|
|
46
73
|
pollInternalLogs?(eventName?: string): number;
|
|
47
74
|
stopPollingInternalLogs?(): void;
|
|
48
75
|
/**
|
|
49
76
|
* Return a new instance of the IProcessTelemetryContext for processing events
|
|
50
77
|
*/
|
|
51
78
|
getProcessTelContext(): IProcessTelemetryContext;
|
|
79
|
+
/**
|
|
80
|
+
* Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
|
|
81
|
+
* to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
|
|
82
|
+
* unload call return `true` stating that all plugins reported that they also unloaded, the recommended
|
|
83
|
+
* approach is to create a new instance and initialize that instance.
|
|
84
|
+
* This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
|
|
85
|
+
* to successfully remove any global references or they may just be completing the unload process asynchronously.
|
|
86
|
+
* @param isAsync - Can the unload be performed asynchronously (default)
|
|
87
|
+
* @param unloadComplete - An optional callback that will be called once the unload has completed
|
|
88
|
+
* @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
|
|
89
|
+
*/
|
|
90
|
+
unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
|
|
91
|
+
/**
|
|
92
|
+
* Find and return the (first) plugin with the specified identifier if present
|
|
93
|
+
* @param pluginIdentifier
|
|
94
|
+
*/
|
|
95
|
+
getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
|
|
96
|
+
/**
|
|
97
|
+
* Add a new plugin to the installation
|
|
98
|
+
* @param plugin - The new plugin to add
|
|
99
|
+
* @param replaceExisting - should any existing plugin be replaced, default is false
|
|
100
|
+
* @param doAsync - Should the add be performed asynchronously
|
|
101
|
+
* @param addCb - [Optional] callback to call after the plugin has been added
|
|
102
|
+
*/
|
|
103
|
+
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
|
|
104
|
+
/**
|
|
105
|
+
* Returns the unique event namespace that should be used when registering events
|
|
106
|
+
*/
|
|
107
|
+
evtNamespace(): string;
|
|
108
|
+
/**
|
|
109
|
+
* Add a handler that will be called when the SDK is being unloaded
|
|
110
|
+
* @param handler - the handler
|
|
111
|
+
*/
|
|
112
|
+
addUnloadCb(handler: UnloadHandler): void;
|
|
113
|
+
/**
|
|
114
|
+
* Flush and send any batched / cached data immediately
|
|
115
|
+
* @param async - send data asynchronously when true (defaults to true)
|
|
116
|
+
* @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called.
|
|
117
|
+
* If the caller doesn't return true the caller should assume that it may never be called.
|
|
118
|
+
* @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
|
|
119
|
+
* @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
|
|
120
|
+
* @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called
|
|
121
|
+
*/
|
|
122
|
+
flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason, cbTimeout?: number): boolean | void;
|
|
52
123
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { SendRequestReason } from "../JavaScriptSDK.Enums/SendRequestReason";
|
|
2
|
+
import { IProcessTelemetryUnloadContext } from "./IProcessTelemetryContext";
|
|
1
3
|
import { ITelemetryPlugin } from "./ITelemetryPlugin";
|
|
4
|
+
import { ITelemetryUnloadState } from "./ITelemetryUnloadState";
|
|
2
5
|
/**
|
|
3
6
|
* Provides data transmission capabilities
|
|
4
7
|
*/
|
|
@@ -12,14 +15,22 @@ export interface IChannelControls extends ITelemetryPlugin {
|
|
|
12
15
|
*/
|
|
13
16
|
resume(): void;
|
|
14
17
|
/**
|
|
15
|
-
* Tear down
|
|
18
|
+
* Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and
|
|
19
|
+
* therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further
|
|
20
|
+
* processTelemetry calls are ignored and it just calls the processNext() with the provided context.
|
|
21
|
+
* @param unloadCtx - This is the context that should be used during unloading.
|
|
22
|
+
* @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.
|
|
23
|
+
* @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
|
|
16
24
|
*/
|
|
17
|
-
teardown()
|
|
25
|
+
teardown: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => void | boolean;
|
|
18
26
|
/**
|
|
19
27
|
* Flush to send data immediately; channel should default to sending data asynchronously
|
|
20
|
-
* @param async
|
|
21
|
-
* @param callBack
|
|
28
|
+
* @param async - send data asynchronously when true
|
|
29
|
+
* @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called.
|
|
30
|
+
* If the caller doesn't return true the caller should assume that it may never be called.
|
|
31
|
+
* @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
|
|
32
|
+
* @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called
|
|
22
33
|
*/
|
|
23
|
-
flush(async: boolean, callBack?: () => void): void;
|
|
34
|
+
flush(async: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void;
|
|
24
35
|
}
|
|
25
36
|
export declare const MinChannelPriorty: number;
|
|
@@ -8,6 +8,11 @@ export declare type InstrumentorHooksCallback = (funcArgs: IInstrumentCallDetail
|
|
|
8
8
|
* You must always supply the error callback
|
|
9
9
|
*/
|
|
10
10
|
export interface IInstrumentHooksCallbacks {
|
|
11
|
+
/**
|
|
12
|
+
* [Optional] Namespace details (same as the namespace used for events), useful for debugging and testing to
|
|
13
|
+
* identify the source of the instrumented hooks
|
|
14
|
+
*/
|
|
15
|
+
ns?: string | string[];
|
|
11
16
|
/**
|
|
12
17
|
* The hook callback to call before the original function is called
|
|
13
18
|
*/
|
|
@@ -68,4 +73,8 @@ export interface IInstrumentCallDetails {
|
|
|
68
73
|
* The error (exception) which occurred while executing the original method
|
|
69
74
|
*/
|
|
70
75
|
err?: Error;
|
|
76
|
+
/**
|
|
77
|
+
* The Event object from (window.event) at the start of the original call
|
|
78
|
+
*/
|
|
79
|
+
evt?: Event;
|
|
71
80
|
}
|