@microsoft/applicationinsights-core-js 3.0.0-beta.2211-03 → 3.0.0-beta.2211-04
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/applicationinsights-core-js.integrity.json +9 -9
- package/browser/applicationinsights-core-js.js +1055 -1226
- 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 +85 -85
- package/dist/applicationinsights-core-js.api.md +8 -8
- package/dist/applicationinsights-core-js.d.ts +7 -7
- package/dist/applicationinsights-core-js.js +1055 -1226
- 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 +7 -7
- package/dist-esm/Config/ConfigDefaults.js +1 -1
- package/dist-esm/Config/DynamicConfig.js +1 -1
- package/dist-esm/Config/DynamicProperty.js +1 -1
- package/dist-esm/Config/DynamicState.js +1 -1
- package/dist-esm/Config/DynamicSupport.js +1 -1
- package/dist-esm/Config/IConfigDefaults.js +1 -1
- package/dist-esm/Config/IDynamicConfigHandler.js +1 -1
- package/dist-esm/Config/IDynamicPropertyHandler.js +1 -1
- package/dist-esm/Config/IDynamicWatcher.js +1 -1
- package/dist-esm/Config/_IDynamicConfigHandlerState.js +1 -1
- package/dist-esm/JavaScriptSDK/AggregationError.js +1 -1
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js +93 -61
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js.map +1 -1
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
- package/dist-esm/JavaScriptSDK/Constants.js +8 -0
- package/dist-esm/JavaScriptSDK/Constants.js.map +1 -0
- package/dist-esm/JavaScriptSDK/CookieMgr.js +1 -1
- package/dist-esm/JavaScriptSDK/CoreUtils.js +1 -1
- package/dist-esm/JavaScriptSDK/DataCacheHelper.js +2 -2
- package/dist-esm/JavaScriptSDK/DataCacheHelper.js.map +1 -1
- package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +1 -1
- package/dist-esm/JavaScriptSDK/EnvUtils.js +1 -1
- package/dist-esm/JavaScriptSDK/EventHelpers.js +1 -1
- package/dist-esm/JavaScriptSDK/HelperFuncs.js +1 -1
- package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -1
- package/dist-esm/JavaScriptSDK/InternalConstants.js +1 -1
- package/dist-esm/JavaScriptSDK/NotificationManager.js +1 -1
- package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
- package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +5 -5
- package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js.map +1 -1
- package/dist-esm/JavaScriptSDK/RandomHelper.js +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +1 -1
- package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +1 -1
- package/dist-esm/JavaScriptSDK/W3cTraceParent.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js +1 -1
- 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/IDistributedTraceContext.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 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITraceParent.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IUnloadHook.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js +1 -1
- package/dist-esm/__DynamicConstants.js +15 -17
- package/dist-esm/__DynamicConstants.js.map +1 -1
- package/dist-esm/applicationinsights-core-js.js +1 -1
- package/package.json +1 -1
- package/src/JavaScriptSDK/AppInsightsCore.ts +99 -64
- package/src/JavaScriptSDK/Constants.ts +4 -0
- package/src/JavaScriptSDK.Interfaces/IAppInsightsCore.ts +2 -2
- package/src/JavaScriptSDK.Interfaces/IChannelControls.ts +4 -4
- package/types/Config/IConfigDefaults.d.ts +3 -3
- package/types/Config/IDynamicWatcher.d.ts +1 -1
- package/types/JavaScriptSDK/AppInsightsCore.d.ts +1 -1
- package/types/JavaScriptSDK/Constants.d.ts +1 -0
- package/types/JavaScriptSDK/UnloadHandlerContainer.d.ts +1 -1
- package/types/JavaScriptSDK.Enums/EventsDiscardedReason.d.ts +1 -1
- package/types/JavaScriptSDK.Enums/LoggingEnums.d.ts +2 -2
- package/types/JavaScriptSDK.Interfaces/IAppInsightsCore.d.ts +1 -1
- package/types/JavaScriptSDK.Interfaces/IChannelControls.d.ts +4 -4
- package/types/JavaScriptSDK.Interfaces/IInstrumentHooks.d.ts +1 -1
- package/types/__DynamicConstants.d.ts +2 -4
- package/dist-esm/JavaScriptSDK/ChannelController.js +0 -217
- package/dist-esm/JavaScriptSDK/ChannelController.js.map +0 -1
- package/src/JavaScriptSDK/ChannelController.ts +0 -274
- package/types/JavaScriptSDK/ChannelController.d.ts +0 -19
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
6
6
|
import {
|
|
7
7
|
ITimerHandler, arrAppend, arrForEach, arrIndexOf, deepExtend, dumpObj, hasDocument, isFunction, isNullOrUndefined, isPlainObject,
|
|
8
|
-
objDeepFreeze, objDefineProp, objForEachKey, objFreeze, objHasOwn, scheduleInterval, throwError
|
|
8
|
+
objDeepFreeze, objDefineProp, objForEachKey, objFreeze, objHasOwn, scheduleInterval, scheduleTimeout, throwError
|
|
9
9
|
} from "@nevware21/ts-utils";
|
|
10
10
|
import { createDynamicConfig, onConfigChange } from "../Config/DynamicConfig";
|
|
11
11
|
import { IConfigDefaults } from "../Config/IConfigDefaults";
|
|
@@ -33,10 +33,7 @@ import { ITelemetryPluginChain } from "../JavaScriptSDK.Interfaces/ITelemetryPlu
|
|
|
33
33
|
import { ITelemetryUnloadState } from "../JavaScriptSDK.Interfaces/ITelemetryUnloadState";
|
|
34
34
|
import { ITelemetryUpdateState } from "../JavaScriptSDK.Interfaces/ITelemetryUpdateState";
|
|
35
35
|
import { ILegacyUnloadHook, IUnloadHook } from "../JavaScriptSDK.Interfaces/IUnloadHook";
|
|
36
|
-
import {
|
|
37
|
-
ChannelControllerPriority, IChannelController, IInternalChannelController, _IInternalChannels, createChannelControllerPlugin,
|
|
38
|
-
createChannelQueues
|
|
39
|
-
} from "./ChannelController";
|
|
36
|
+
import { ChannelControllerPriority } from "./Constants";
|
|
40
37
|
import { createCookieMgr } from "./CookieMgr";
|
|
41
38
|
import { createUniqueNamespace } from "./DataCacheHelper";
|
|
42
39
|
import { getDebugListener } from "./DbgExtensionUtils";
|
|
@@ -84,9 +81,10 @@ function _createPerfManager (core: IAppInsightsCore, notificationMgr: INotificat
|
|
|
84
81
|
return new PerfManager(notificationMgr);
|
|
85
82
|
}
|
|
86
83
|
|
|
87
|
-
function _validateExtensions(logger: IDiagnosticLogger, channelPriority: number, allExtensions: IPlugin[]): {
|
|
84
|
+
function _validateExtensions(logger: IDiagnosticLogger, channelPriority: number, allExtensions: IPlugin[]): { core: IPlugin[], channels: IChannelControls[] } {
|
|
88
85
|
// Concat all available extensions
|
|
89
86
|
let coreExtensions: ITelemetryPlugin[] = [];
|
|
87
|
+
let channels: IChannelControls[] = [];
|
|
90
88
|
|
|
91
89
|
// Check if any two extensions have the same priority, then warn to console
|
|
92
90
|
// And extract the local extensions from the
|
|
@@ -111,16 +109,18 @@ function _validateExtensions(logger: IDiagnosticLogger, channelPriority: number,
|
|
|
111
109
|
}
|
|
112
110
|
}
|
|
113
111
|
|
|
114
|
-
// Split extensions to core and
|
|
112
|
+
// Split extensions to core and channels
|
|
115
113
|
if (!extPriority || extPriority < channelPriority) {
|
|
116
114
|
// Add to core extension that will be managed by AppInsightsCore
|
|
117
115
|
coreExtensions.push(ext);
|
|
116
|
+
} else {
|
|
117
|
+
channels.push(ext);
|
|
118
118
|
}
|
|
119
119
|
});
|
|
120
120
|
|
|
121
121
|
return {
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
core: coreExtensions,
|
|
123
|
+
channels: channels
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -239,10 +239,8 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
239
239
|
let _cookieManager: ICookieMgr | null;
|
|
240
240
|
let _pluginChain: ITelemetryPluginChain | null;
|
|
241
241
|
let _configExtensions: IPlugin[];
|
|
242
|
-
let _coreExtensions: ITelemetryPlugin[] | null;
|
|
243
|
-
let _channelControl: IChannelController | null;
|
|
244
242
|
let _channelConfig: IChannelControls[][] | null | undefined;
|
|
245
|
-
let
|
|
243
|
+
let _channels: IChannelControls[] | null;
|
|
246
244
|
let _isUnloading: boolean;
|
|
247
245
|
let _telemetryInitializerPlugin: TelemetryInitializerPlugin;
|
|
248
246
|
let _internalLogsEventName: string | null;
|
|
@@ -317,10 +315,17 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
317
315
|
|
|
318
316
|
_initPluginChain(null);
|
|
319
317
|
|
|
320
|
-
if (!
|
|
318
|
+
if (!_channels || _channels.length === 0) {
|
|
321
319
|
throwError("No " + STR_CHANNELS + " available");
|
|
322
320
|
}
|
|
323
321
|
|
|
322
|
+
if (_channels.length > 1) {
|
|
323
|
+
let teeController = _self.getPlugin("TeeChannelController");
|
|
324
|
+
if (!teeController || !teeController.plugin) {
|
|
325
|
+
_throwInternal(_self.logger, eLoggingSeverity.CRITICAL, _eInternalMessageId.SenderNotInitialized, "TeeChannel required");
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
324
329
|
_registerDelayedCfgListener(config, _cfgListeners, _self.logger);
|
|
325
330
|
_cfgListeners = null;
|
|
326
331
|
|
|
@@ -330,11 +335,11 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
330
335
|
_self.pollInternalLogs();
|
|
331
336
|
};
|
|
332
337
|
|
|
333
|
-
_self.
|
|
334
|
-
let controls: IChannelControls[]
|
|
335
|
-
if (
|
|
336
|
-
arrForEach(
|
|
337
|
-
controls.push(
|
|
338
|
+
_self.getChannels = (): IChannelControls[] => {
|
|
339
|
+
let controls: IChannelControls[] = [];
|
|
340
|
+
if (_channels) {
|
|
341
|
+
arrForEach(_channels, (channel) => {
|
|
342
|
+
controls.push(channel);
|
|
338
343
|
});
|
|
339
344
|
}
|
|
340
345
|
|
|
@@ -786,11 +791,9 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
786
791
|
_cfgPerfManager = null;
|
|
787
792
|
_cookieManager = null;
|
|
788
793
|
_pluginChain = null;
|
|
789
|
-
_coreExtensions = null;
|
|
790
794
|
_configExtensions = [];
|
|
791
|
-
_channelControl = null;
|
|
792
795
|
_channelConfig = null;
|
|
793
|
-
|
|
796
|
+
_channels = null;
|
|
794
797
|
_isUnloading = false;
|
|
795
798
|
_internalLogsEventName = null;
|
|
796
799
|
_evtNamespace = createUniqueNamespace("AIBaseCore", true);
|
|
@@ -812,50 +815,34 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
812
815
|
// Extension validation
|
|
813
816
|
let theExtensions = _validateExtensions(_self.logger, ChannelControllerPriority, _configExtensions);
|
|
814
817
|
|
|
815
|
-
_coreExtensions = theExtensions.core;
|
|
816
818
|
_pluginChain = null;
|
|
817
819
|
_pluginVersionString = null;
|
|
818
820
|
_pluginVersionStringArr = null;
|
|
819
821
|
|
|
820
|
-
//
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
//
|
|
824
|
-
|
|
825
|
-
if (_channelControl) {
|
|
826
|
-
// During add / remove of a plugin this may get called again, so don't re-add if already present
|
|
827
|
-
// But we also want the controller as the last, so remove if already present
|
|
828
|
-
// And reusing the existing instance, just in case an installed plugin has a reference and
|
|
829
|
-
// is using it.
|
|
830
|
-
let idx = arrIndexOf(allExtensions, _channelControl);
|
|
831
|
-
if (idx !== -1) {
|
|
832
|
-
allExtensions.splice(idx, 1);
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
idx = arrIndexOf(_coreExtensions, _channelControl);
|
|
836
|
-
if (idx !== -1) {
|
|
837
|
-
_coreExtensions.splice(idx, 1);
|
|
838
|
-
}
|
|
822
|
+
// Get the primary channel queue and include as part of the normal extensions
|
|
823
|
+
_channels = (_channelConfig || [])[0] ||[];
|
|
824
|
+
|
|
825
|
+
// Add any channels provided in the extensions and sort them
|
|
826
|
+
_channels = sortPlugins(arrAppend(_channels, theExtensions.channels));
|
|
839
827
|
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
_channelControl = createChannelControllerPlugin(_channelQueue, _self);
|
|
843
|
-
}
|
|
828
|
+
// Sort the complete set of extensions by priority
|
|
829
|
+
let allExtensions = sortPlugins(theExtensions.core);
|
|
844
830
|
|
|
845
831
|
// Add on "channelController" as the last "plugin"
|
|
846
|
-
allExtensions
|
|
847
|
-
_coreExtensions.push(_channelControl);
|
|
832
|
+
arrAppend(allExtensions, _channels);
|
|
848
833
|
|
|
849
834
|
// Required to allow plugins to call core.getPlugin() during their own initialization
|
|
850
|
-
_extensions =
|
|
835
|
+
_extensions = objFreeze(allExtensions);
|
|
851
836
|
|
|
852
|
-
|
|
853
|
-
_channelControl.initialize(_configHandler.cfg, _self, allExtensions);
|
|
837
|
+
let rootCtx = _createTelCtx();
|
|
854
838
|
|
|
855
|
-
|
|
839
|
+
// Initializing the channels first
|
|
840
|
+
if (_channels && _channels.length > 0) {
|
|
841
|
+
initializePlugins(rootCtx.createNew(_channels), allExtensions);
|
|
842
|
+
}
|
|
856
843
|
|
|
857
|
-
// Now
|
|
858
|
-
|
|
844
|
+
// Now initialize the normal extensions
|
|
845
|
+
initializePlugins(rootCtx, allExtensions);
|
|
859
846
|
|
|
860
847
|
if (updateState) {
|
|
861
848
|
_doUpdate(updateState);
|
|
@@ -867,16 +854,19 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
867
854
|
let thePlugin: IPlugin = null;
|
|
868
855
|
|
|
869
856
|
arrForEach(_extensions, (ext: any) => {
|
|
870
|
-
if (ext.identifier === pluginIdentifier && ext !==
|
|
857
|
+
if (ext.identifier === pluginIdentifier && ext !== _telemetryInitializerPlugin) {
|
|
871
858
|
thePlugin = ext;
|
|
872
859
|
return -1;
|
|
873
860
|
}
|
|
861
|
+
|
|
862
|
+
// TODO: Check if the extension is an extension "host" (like the TeeChannel)
|
|
863
|
+
// So that if the extension is not found we can ask the "host" plugins for the plugin
|
|
874
864
|
});
|
|
875
865
|
|
|
876
|
-
if (!thePlugin && _channelControl) {
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
}
|
|
866
|
+
// if (!thePlugin && _channelControl) {
|
|
867
|
+
// // Check the channel Controller
|
|
868
|
+
// thePlugin = _channelControl.getChannel(pluginIdentifier);
|
|
869
|
+
// }
|
|
880
870
|
|
|
881
871
|
if (thePlugin) {
|
|
882
872
|
theExt = {
|
|
@@ -916,9 +906,9 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
916
906
|
function _getPluginChain() {
|
|
917
907
|
if (!_pluginChain) {
|
|
918
908
|
// copy the collection of extensions
|
|
919
|
-
let extensions = (
|
|
909
|
+
let extensions = (_extensions || []).slice();
|
|
920
910
|
|
|
921
|
-
// During add / remove this may get called again, so don't
|
|
911
|
+
// During add / remove this may get called again, so don't read if already present
|
|
922
912
|
if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) {
|
|
923
913
|
extensions.push(_telemetryInitializerPlugin);
|
|
924
914
|
}
|
|
@@ -999,11 +989,56 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
999
989
|
}
|
|
1000
990
|
|
|
1001
991
|
function _flushChannels(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason, cbTimeout?: number) {
|
|
1002
|
-
|
|
1003
|
-
|
|
992
|
+
// Setting waiting to one so that we don't call the callBack until we finish iterating
|
|
993
|
+
let waiting = 1;
|
|
994
|
+
let doneIterating = false;
|
|
995
|
+
let cbTimer: ITimerHandler = null;
|
|
996
|
+
cbTimeout = cbTimeout || 5000;
|
|
997
|
+
|
|
998
|
+
function doCallback() {
|
|
999
|
+
waiting--;
|
|
1000
|
+
if (doneIterating && waiting === 0) {
|
|
1001
|
+
cbTimer && cbTimer.cancel();
|
|
1002
|
+
cbTimer = null;
|
|
1003
|
+
|
|
1004
|
+
callBack && callBack(doneIterating);
|
|
1005
|
+
callBack = null;
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
if (_channels && _channels.length > 0) {
|
|
1010
|
+
let flushCtx = _createTelCtx().createNew(_channels);
|
|
1011
|
+
flushCtx.iterate<IChannelControls>((plugin) => {
|
|
1012
|
+
if (plugin.flush) {
|
|
1013
|
+
waiting ++;
|
|
1014
|
+
|
|
1015
|
+
let handled = false;
|
|
1016
|
+
// Not all channels will call this callback for every scenario
|
|
1017
|
+
if (!plugin.flush(isAsync, () => {
|
|
1018
|
+
handled = true;
|
|
1019
|
+
doCallback();
|
|
1020
|
+
}, sendReason)) {
|
|
1021
|
+
if (!handled) {
|
|
1022
|
+
// If any channel doesn't return true and it didn't call the callback, then we should assume that the callback
|
|
1023
|
+
// will never be called, so use a timeout to allow the channel(s) some time to "finish" before triggering any
|
|
1024
|
+
// followup function (such as unloading)
|
|
1025
|
+
if (isAsync && cbTimer == null) {
|
|
1026
|
+
cbTimer = scheduleTimeout(() => {
|
|
1027
|
+
cbTimer = null;
|
|
1028
|
+
doCallback();
|
|
1029
|
+
}, cbTimeout);
|
|
1030
|
+
} else {
|
|
1031
|
+
doCallback();
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
});
|
|
1004
1037
|
}
|
|
1005
1038
|
|
|
1006
|
-
|
|
1039
|
+
doneIterating = true;
|
|
1040
|
+
doCallback();
|
|
1041
|
+
|
|
1007
1042
|
return true;
|
|
1008
1043
|
}
|
|
1009
1044
|
|
|
@@ -1082,7 +1117,7 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
1082
1117
|
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
1083
1118
|
}
|
|
1084
1119
|
|
|
1085
|
-
public
|
|
1120
|
+
public getChannels(): IChannelControls[] {
|
|
1086
1121
|
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
1087
1122
|
return null;
|
|
1088
1123
|
}
|
|
@@ -70,9 +70,9 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
70
70
|
initialize(config: IConfiguration, extensions: IPlugin[], logger?: IDiagnosticLogger, notificationManager?: INotificationManager): void;
|
|
71
71
|
|
|
72
72
|
/*
|
|
73
|
-
* Get transmission
|
|
73
|
+
* Get transmission channels for controlling transmission behavior
|
|
74
74
|
*/
|
|
75
|
-
|
|
75
|
+
getChannels(): IChannelControls[];
|
|
76
76
|
|
|
77
77
|
/*
|
|
78
78
|
* Core track API
|
|
@@ -15,12 +15,12 @@ export interface IChannelControls extends ITelemetryPlugin {
|
|
|
15
15
|
/**
|
|
16
16
|
* Pause sending data
|
|
17
17
|
*/
|
|
18
|
-
pause(): void;
|
|
18
|
+
pause?(): void;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Resume sending data
|
|
22
22
|
*/
|
|
23
|
-
resume(): void;
|
|
23
|
+
resume?(): void;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and
|
|
@@ -30,7 +30,7 @@ export interface IChannelControls extends ITelemetryPlugin {
|
|
|
30
30
|
* @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.
|
|
31
31
|
* @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
|
|
32
32
|
*/
|
|
33
|
-
teardown
|
|
33
|
+
teardown?: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => void | boolean;
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Flush to send data immediately; channel should default to sending data asynchronously
|
|
@@ -40,7 +40,7 @@ export interface IChannelControls extends ITelemetryPlugin {
|
|
|
40
40
|
* @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
|
|
41
41
|
* @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
|
|
42
42
|
*/
|
|
43
|
-
flush(async: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void;
|
|
43
|
+
flush?(async: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
export const MinChannelPriorty: number = 100;
|
|
@@ -2,11 +2,11 @@ import { IConfiguration } from "../JavaScriptSDK.Interfaces/IConfiguration";
|
|
|
2
2
|
/**
|
|
3
3
|
* The type to identify whether the default value should be applied in preference to the provided value.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type IConfigCheckFn<V> = (value: V) => boolean;
|
|
6
6
|
/**
|
|
7
7
|
* The type which identifies the function use to validate the user supplied value
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type IConfigSetFn<T, V> = (value: any, defValue: V, theConfig: T) => V;
|
|
10
10
|
/**
|
|
11
11
|
* The default values with a check function
|
|
12
12
|
*/
|
|
@@ -37,6 +37,6 @@ export interface IConfigDefaultCheck<T, V, C extends IConfiguration = IConfigura
|
|
|
37
37
|
* The Type definition to define default values to be applied to the config
|
|
38
38
|
* The value may be either the direct value or a ConfigDefaultCheck definition
|
|
39
39
|
*/
|
|
40
|
-
export
|
|
40
|
+
export type IConfigDefaults<T, C extends IConfiguration = IConfiguration> = {
|
|
41
41
|
[key in keyof T]: T[key] | IConfigDefaultCheck<T, T[key], C>;
|
|
42
42
|
};
|
|
@@ -21,7 +21,7 @@ export interface IWatchDetails<T extends IConfiguration> {
|
|
|
21
21
|
*/
|
|
22
22
|
setDf: <C>(theConfig: C, defaultValues: IConfigDefaults<C>) => C;
|
|
23
23
|
}
|
|
24
|
-
export
|
|
24
|
+
export type WatcherFunction<T extends IConfiguration> = (details: IWatchDetails<T>) => void;
|
|
25
25
|
/**
|
|
26
26
|
* @internal
|
|
27
27
|
*/
|
|
@@ -40,7 +40,7 @@ export declare class AppInsightsCore implements IAppInsightsCore {
|
|
|
40
40
|
getWParam: () => number;
|
|
41
41
|
constructor();
|
|
42
42
|
initialize(config: IConfiguration, extensions: IPlugin[], logger?: IDiagnosticLogger, notificationManager?: INotificationManager): void;
|
|
43
|
-
|
|
43
|
+
getChannels(): IChannelControls[];
|
|
44
44
|
track(telemetryItem: ITelemetryItem): void;
|
|
45
45
|
getProcessTelContext(): IProcessTelemetryContext;
|
|
46
46
|
getNotifyMgr(): INotificationManager;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ChannelControllerPriority = 500;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IProcessTelemetryUnloadContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
|
|
2
2
|
import { ITelemetryUnloadState } from "../JavaScriptSDK.Interfaces/ITelemetryUnloadState";
|
|
3
|
-
export
|
|
3
|
+
export type UnloadHandler = (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
|
|
4
4
|
export interface IUnloadHandlerContainer {
|
|
5
5
|
add: (handler: UnloadHandler) => void;
|
|
6
6
|
run: (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
|
|
@@ -31,4 +31,4 @@ export declare const enum eEventsDiscardedReason {
|
|
|
31
31
|
* The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.
|
|
32
32
|
*/
|
|
33
33
|
export declare const EventsDiscardedReason: import("../JavaScriptSDK.Enums/EnumHelperFuncs").EnumValue<typeof eEventsDiscardedReason>;
|
|
34
|
-
export
|
|
34
|
+
export type EventsDiscardedReason = number | eEventsDiscardedReason;
|
|
@@ -13,7 +13,7 @@ export declare const enum eLoggingSeverity {
|
|
|
13
13
|
WARNING = 2
|
|
14
14
|
}
|
|
15
15
|
export declare const LoggingSeverity: import("../JavaScriptSDK.Enums/EnumHelperFuncs").EnumValue<typeof eLoggingSeverity>;
|
|
16
|
-
export
|
|
16
|
+
export type LoggingSeverity = number | eLoggingSeverity;
|
|
17
17
|
export declare const enum _eInternalMessageId {
|
|
18
18
|
BrowserDoesNotSupportLocalStorage = 0,
|
|
19
19
|
BrowserCannotReadLocalStorage = 1,
|
|
@@ -101,4 +101,4 @@ export declare const enum _eInternalMessageId {
|
|
|
101
101
|
ConfigWatcherException = 107,
|
|
102
102
|
DynamicConfigException = 108
|
|
103
103
|
}
|
|
104
|
-
export
|
|
104
|
+
export type _InternalMessageId = number | _eInternalMessageId;
|
|
@@ -49,7 +49,7 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
49
49
|
*/
|
|
50
50
|
isInitialized?: () => boolean;
|
|
51
51
|
initialize(config: IConfiguration, extensions: IPlugin[], logger?: IDiagnosticLogger, notificationManager?: INotificationManager): void;
|
|
52
|
-
|
|
52
|
+
getChannels(): IChannelControls[];
|
|
53
53
|
track(telemetryItem: ITelemetryItem): void;
|
|
54
54
|
/**
|
|
55
55
|
* Get the current notification manager
|
|
@@ -9,11 +9,11 @@ export interface IChannelControls extends ITelemetryPlugin {
|
|
|
9
9
|
/**
|
|
10
10
|
* Pause sending data
|
|
11
11
|
*/
|
|
12
|
-
pause(): void;
|
|
12
|
+
pause?(): void;
|
|
13
13
|
/**
|
|
14
14
|
* Resume sending data
|
|
15
15
|
*/
|
|
16
|
-
resume(): void;
|
|
16
|
+
resume?(): void;
|
|
17
17
|
/**
|
|
18
18
|
* Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and
|
|
19
19
|
* therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further
|
|
@@ -22,7 +22,7 @@ export interface IChannelControls extends ITelemetryPlugin {
|
|
|
22
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
23
|
* @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
|
|
24
24
|
*/
|
|
25
|
-
teardown
|
|
25
|
+
teardown?: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => void | boolean;
|
|
26
26
|
/**
|
|
27
27
|
* Flush to send data immediately; channel should default to sending data asynchronously
|
|
28
28
|
* @param async - send data asynchronously when true
|
|
@@ -31,6 +31,6 @@ export interface IChannelControls extends ITelemetryPlugin {
|
|
|
31
31
|
* @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
|
|
32
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
|
|
33
33
|
*/
|
|
34
|
-
flush(async: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void;
|
|
34
|
+
flush?(async: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void;
|
|
35
35
|
}
|
|
36
36
|
export declare const MinChannelPriorty: number;
|
|
@@ -3,7 +3,7 @@ import { IUnloadHook } from "./IUnloadHook";
|
|
|
3
3
|
* A callback function that will be called for the wrapped instrumentation function
|
|
4
4
|
* before the original function is executed.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type InstrumentorHooksCallback = (funcArgs: IInstrumentCallDetails, ...orgArgs: any[]) => void;
|
|
7
7
|
/**
|
|
8
8
|
* The callbacks to call for the instrumented function, you must provide at least the request and/or response callbacks, both are not required.
|
|
9
9
|
* You must always supply the error callback
|
|
@@ -13,6 +13,7 @@ export declare const _DYN_CANCEL = "cancel";
|
|
|
13
13
|
export declare const _DYN_INITIALIZE = "initialize";
|
|
14
14
|
export declare const _DYN_IDENTIFIER = "identifier";
|
|
15
15
|
export declare const _DYN_IS_INITIALIZED = "isInitialized";
|
|
16
|
+
export declare const _DYN_GET_PLUGIN = "getPlugin";
|
|
16
17
|
export declare const _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs";
|
|
17
18
|
export declare const _DYN_NAME = "name";
|
|
18
19
|
export declare const _DYN_TIME = "time";
|
|
@@ -24,10 +25,9 @@ export declare const _DYN_REMOVE_NOTIFICATION_2 = "removeNotificationListener";
|
|
|
24
25
|
export declare const _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs";
|
|
25
26
|
export declare const _DYN_ON_COMPLETE = "onComplete";
|
|
26
27
|
export declare const _DYN_CALL = "call";
|
|
27
|
-
export declare const _DYN_GET_PLUGIN = "getPlugin";
|
|
28
|
-
export declare const _DYN_FLUSH = "flush";
|
|
29
28
|
export declare const _DYN_VERSION = "version";
|
|
30
29
|
export declare const _DYN_LOGGING_LEVEL_CONSOL4 = "loggingLevelConsole";
|
|
30
|
+
export declare const _DYN_CREATE_NEW = "createNew";
|
|
31
31
|
export declare const _DYN_TEARDOWN = "teardown";
|
|
32
32
|
export declare const _DYN_MESSAGE_ID = "messageId";
|
|
33
33
|
export declare const _DYN_MESSAGE = "message";
|
|
@@ -37,8 +37,6 @@ export declare const _DYN__DO_TEARDOWN = "_doTeardown";
|
|
|
37
37
|
export declare const _DYN_UPDATE = "update";
|
|
38
38
|
export declare const _DYN_GET_NEXT = "getNext";
|
|
39
39
|
export declare const _DYN_SET_NEXT_PLUGIN = "setNextPlugin";
|
|
40
|
-
export declare const _DYN_CREATE_NEW = "createNew";
|
|
41
|
-
export declare const _DYN_CONFIG = "config";
|
|
42
40
|
export declare const _DYN_USER_AGENT = "userAgent";
|
|
43
41
|
export declare const _DYN_SPLIT = "split";
|
|
44
42
|
export declare const _DYN_NODE_TYPE = "nodeType";
|