@microsoft/applicationinsights-core-js 3.0.0-beta.2210-21 → 3.0.0-beta.2211-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 +113 -27
- 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 +203 -40
- package/dist/applicationinsights-core-js.api.md +10 -5
- package/dist/applicationinsights-core-js.d.ts +36 -4
- package/dist/applicationinsights-core-js.js +113 -27
- 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 +36 -4
- 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 +3 -3
- package/dist-esm/Config/DynamicState.js.map +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 -20
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js.map +1 -1
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
- package/dist-esm/JavaScriptSDK/ChannelController.js +3 -3
- package/dist-esm/JavaScriptSDK/ChannelController.js.map +1 -1
- 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 +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 +5 -6
- package/dist-esm/JavaScriptSDK/W3cTraceParent.js.map +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 +8 -7
- 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 +126 -24
- package/src/JavaScriptSDK.Interfaces/IAppInsightsCore.ts +17 -1
- package/src/JavaScriptSDK.Interfaces/IConfiguration.ts +6 -0
- package/types/JavaScriptSDK/AppInsightsCore.d.ts +17 -2
- package/types/JavaScriptSDK.Interfaces/IAppInsightsCore.d.ts +14 -1
- package/types/JavaScriptSDK.Interfaces/IConfiguration.d.ts +5 -0
- package/types/__DynamicConstants.d.ts +3 -2
- package/types/tsdoc-metadata.json +1 -1
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
6
6
|
import {
|
|
7
|
-
arrAppend, arrForEach, arrIndexOf, deepExtend, dumpObj, isFunction, isNullOrUndefined, isPlainObject,
|
|
8
|
-
objForEachKey, objFreeze, objHasOwn, throwError
|
|
7
|
+
ITimerHandler, arrAppend, arrForEach, arrIndexOf, deepExtend, dumpObj, hasDocument, isFunction, isNullOrUndefined, isPlainObject,
|
|
8
|
+
objDeepFreeze, objDefineProp, objForEachKey, objFreeze, objHasOwn, scheduleInterval, throwError
|
|
9
9
|
} from "@nevware21/ts-utils";
|
|
10
10
|
import { createDynamicConfig, onConfigChange } from "../Config/DynamicConfig";
|
|
11
11
|
import { IConfigDefaults } from "../Config/IConfigDefaults";
|
|
@@ -43,7 +43,7 @@ import { getDebugListener } from "./DbgExtensionUtils";
|
|
|
43
43
|
import { DiagnosticLogger, _InternalLogMessage, _throwInternal, _warnToConsole } from "./DiagnosticLogger";
|
|
44
44
|
import { getSetValue, proxyFunctionAs, proxyFunctions, toISOString } from "./HelperFuncs";
|
|
45
45
|
import {
|
|
46
|
-
STR_CHANNELS, STR_CREATE_PERF_MGR, STR_DISABLED, STR_EXTENSIONS, STR_EXTENSION_CONFIG, UNDEFINED_VALUE
|
|
46
|
+
STR_CHANNELS, STR_CREATE_PERF_MGR, STR_DISABLED, STR_EMPTY, STR_EXTENSIONS, STR_EXTENSION_CONFIG, UNDEFINED_VALUE
|
|
47
47
|
} from "./InternalConstants";
|
|
48
48
|
import { NotificationManager } from "./NotificationManager";
|
|
49
49
|
import { PerfManager, doPerf, getGblPerfMgr } from "./PerfManager";
|
|
@@ -172,6 +172,7 @@ function _findWatcher(listeners: { rm: () => void, w: WatcherFunction<IConfigura
|
|
|
172
172
|
|
|
173
173
|
return { i: idx, l: theListener };
|
|
174
174
|
}
|
|
175
|
+
|
|
175
176
|
function _addDelayedCfgListener(listeners: { rm: () => void, w: WatcherFunction<IConfiguration>}[], newWatcher: WatcherFunction<IConfiguration>) {
|
|
176
177
|
let theListener = _findWatcher(listeners, newWatcher).l;
|
|
177
178
|
|
|
@@ -207,9 +208,26 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
207
208
|
public config: IConfiguration;
|
|
208
209
|
public logger: IDiagnosticLogger;
|
|
209
210
|
|
|
210
|
-
|
|
211
|
+
/**
|
|
212
|
+
* An array of the installed plugins that provide a version
|
|
213
|
+
*/
|
|
214
|
+
public readonly pluginVersionStringArr: string[];
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* The formatted string of the installed plugins that contain a version number
|
|
218
|
+
*/
|
|
219
|
+
public readonly pluginVersionString: string;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Returns a value that indicates whether the instance has already been previously initialized.
|
|
223
|
+
*/
|
|
211
224
|
public isInitialized: () => boolean;
|
|
212
225
|
|
|
226
|
+
/**
|
|
227
|
+
* Function used to identify the get w parameter used to identify status bit to some channels
|
|
228
|
+
*/
|
|
229
|
+
public getWParam: () => number;
|
|
230
|
+
|
|
213
231
|
constructor() {
|
|
214
232
|
// NOTE!: DON'T set default values here, instead set them in the _initDefaults() function as it is also called during teardown()
|
|
215
233
|
let _configHandler: IDynamicConfigHandler<IConfiguration>;
|
|
@@ -235,17 +253,26 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
235
253
|
let _traceCtx: IDistributedTraceContext | null;
|
|
236
254
|
let _instrumentationKey: string | null;
|
|
237
255
|
let _cfgListeners: { rm: () => void, w: WatcherFunction<IConfiguration>}[];
|
|
238
|
-
|
|
256
|
+
let _extensions: IPlugin[];
|
|
257
|
+
let _pluginVersionStringArr: string[];
|
|
258
|
+
let _pluginVersionString: string;
|
|
259
|
+
|
|
239
260
|
/**
|
|
240
261
|
* Internal log poller
|
|
241
262
|
*/
|
|
242
|
-
let _internalLogPoller:
|
|
263
|
+
let _internalLogPoller: ITimerHandler;
|
|
264
|
+
let _internalLogPollerListening: boolean;
|
|
243
265
|
|
|
244
266
|
dynamicProto(AppInsightsCore, this, (_self) => {
|
|
245
267
|
|
|
246
268
|
// Set the default values (also called during teardown)
|
|
247
269
|
_initDefaults();
|
|
248
270
|
|
|
271
|
+
// Special internal method to allow the unit tests and DebugPlugin to hook embedded objects
|
|
272
|
+
_self["_getDbgPlgTargets"] = () => {
|
|
273
|
+
return [_extensions];
|
|
274
|
+
};
|
|
275
|
+
|
|
249
276
|
_self.isInitialized = () => _isInitialized;
|
|
250
277
|
|
|
251
278
|
// Creating the self.initialize = ()
|
|
@@ -299,6 +326,8 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
299
326
|
|
|
300
327
|
_isInitialized = true;
|
|
301
328
|
_self.releaseQueue();
|
|
329
|
+
|
|
330
|
+
_self.pollInternalLogs();
|
|
302
331
|
};
|
|
303
332
|
|
|
304
333
|
_self.getTransmissionControls = (): IChannelControls[][] => {
|
|
@@ -430,22 +459,31 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
430
459
|
/**
|
|
431
460
|
* Periodically check logger.queue for log messages to be flushed
|
|
432
461
|
*/
|
|
433
|
-
_self.pollInternalLogs = (eventName?: string):
|
|
462
|
+
_self.pollInternalLogs = (eventName?: string): ITimerHandler => {
|
|
434
463
|
_internalLogsEventName = eventName || null;
|
|
435
464
|
|
|
436
|
-
|
|
437
|
-
let interval: number =
|
|
465
|
+
function _startLogPoller(config: IConfiguration) {
|
|
466
|
+
let interval: number = config.diagnosticLogInterval;
|
|
438
467
|
if (!interval || !(interval > 0)) {
|
|
439
468
|
interval = 10000;
|
|
440
469
|
}
|
|
441
470
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}
|
|
445
|
-
_internalLogPoller = setInterval(() => {
|
|
471
|
+
_internalLogPoller && _internalLogPoller.cancel();
|
|
472
|
+
_internalLogPoller = scheduleInterval(() => {
|
|
446
473
|
_flushInternalLogs();
|
|
447
474
|
}, interval) as any;
|
|
448
|
-
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
if (!_internalLogPollerListening) {
|
|
478
|
+
_internalLogPollerListening = true;
|
|
479
|
+
// listen to the configuration
|
|
480
|
+
_addUnloadHook(_configHandler.watch((details) => {
|
|
481
|
+
_startLogPoller(details.cfg);
|
|
482
|
+
}));
|
|
483
|
+
} else {
|
|
484
|
+
// We are being called again, so make sure the poller is running
|
|
485
|
+
_startLogPoller(_configHandler.cfg);
|
|
486
|
+
}
|
|
449
487
|
|
|
450
488
|
return _internalLogPoller;
|
|
451
489
|
}
|
|
@@ -454,9 +492,9 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
454
492
|
* Stop polling log messages from logger.queue
|
|
455
493
|
*/
|
|
456
494
|
_self.stopPollingInternalLogs = (): void => {
|
|
457
|
-
if(_internalLogPoller) {
|
|
458
|
-
|
|
459
|
-
_internalLogPoller =
|
|
495
|
+
if (_internalLogPoller) {
|
|
496
|
+
_internalLogPoller.cancel();
|
|
497
|
+
_internalLogPoller = null;
|
|
460
498
|
_flushInternalLogs();
|
|
461
499
|
}
|
|
462
500
|
}
|
|
@@ -661,6 +699,36 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
661
699
|
}
|
|
662
700
|
};
|
|
663
701
|
|
|
702
|
+
_self.getWParam = () => {
|
|
703
|
+
return (hasDocument() || !!_configHandler.cfg.enableWParam) ? 0 : -1;
|
|
704
|
+
};
|
|
705
|
+
|
|
706
|
+
function _setPluginVersions() {
|
|
707
|
+
_pluginVersionStringArr = [];
|
|
708
|
+
|
|
709
|
+
if (_channelConfig) {
|
|
710
|
+
arrForEach(_channelConfig, (channels) => {
|
|
711
|
+
if (channels) {
|
|
712
|
+
arrForEach(channels, (channel) => {
|
|
713
|
+
if (channel.identifier && channel.version) {
|
|
714
|
+
let ver = channel.identifier + "=" + channel.version;
|
|
715
|
+
_pluginVersionStringArr.push(ver);
|
|
716
|
+
}
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
if (_configExtensions) {
|
|
723
|
+
arrForEach(_configExtensions, (ext) => {
|
|
724
|
+
if (ext && ext.identifier && ext.version) {
|
|
725
|
+
let ver = ext.identifier + "=" + ext.version;
|
|
726
|
+
_pluginVersionStringArr.push(ver);
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
|
|
664
732
|
function _initDefaults() {
|
|
665
733
|
_isInitialized = false;
|
|
666
734
|
|
|
@@ -680,8 +748,36 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
680
748
|
}
|
|
681
749
|
});
|
|
682
750
|
|
|
751
|
+
objDefineProp(_self, "pluginVersionStringArr", {
|
|
752
|
+
configurable: true,
|
|
753
|
+
enumerable: true,
|
|
754
|
+
get: () => {
|
|
755
|
+
if (!_pluginVersionStringArr) {
|
|
756
|
+
_setPluginVersions();
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
return _pluginVersionStringArr;
|
|
760
|
+
}
|
|
761
|
+
});
|
|
762
|
+
|
|
763
|
+
objDefineProp(_self, "pluginVersionString", {
|
|
764
|
+
configurable: true,
|
|
765
|
+
enumerable: true,
|
|
766
|
+
get: () => {
|
|
767
|
+
if (!_pluginVersionString) {
|
|
768
|
+
if (!_pluginVersionStringArr) {
|
|
769
|
+
_setPluginVersions();
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
_pluginVersionString = _pluginVersionStringArr.join(";");
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
return _pluginVersionString || STR_EMPTY;
|
|
776
|
+
}
|
|
777
|
+
});
|
|
778
|
+
|
|
683
779
|
_self.logger = new DiagnosticLogger(_configHandler.cfg);
|
|
684
|
-
|
|
780
|
+
_extensions = [];
|
|
685
781
|
|
|
686
782
|
_telemetryInitializerPlugin = new TelemetryInitializerPlugin();
|
|
687
783
|
_eventQueue = [];
|
|
@@ -703,6 +799,8 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
703
799
|
_instrumentationKey = null;
|
|
704
800
|
_hooks = [];
|
|
705
801
|
_cfgListeners = [];
|
|
802
|
+
_pluginVersionString = null;
|
|
803
|
+
_pluginVersionStringArr = null;
|
|
706
804
|
}
|
|
707
805
|
|
|
708
806
|
function _createTelCtx(): IProcessTelemetryContext {
|
|
@@ -716,7 +814,9 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
716
814
|
|
|
717
815
|
_coreExtensions = theExtensions.core;
|
|
718
816
|
_pluginChain = null;
|
|
719
|
-
|
|
817
|
+
_pluginVersionString = null;
|
|
818
|
+
_pluginVersionStringArr = null;
|
|
819
|
+
|
|
720
820
|
// Sort the complete set of extensions by priority
|
|
721
821
|
let allExtensions = theExtensions.all;
|
|
722
822
|
|
|
@@ -747,7 +847,7 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
747
847
|
_coreExtensions.push(_channelControl);
|
|
748
848
|
|
|
749
849
|
// Required to allow plugins to call core.getPlugin() during their own initialization
|
|
750
|
-
|
|
850
|
+
_extensions = sortPlugins(allExtensions);
|
|
751
851
|
|
|
752
852
|
// Initialize the controls
|
|
753
853
|
_channelControl.initialize(_configHandler.cfg, _self, allExtensions);
|
|
@@ -755,7 +855,7 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
755
855
|
initializePlugins(_createTelCtx(), allExtensions);
|
|
756
856
|
|
|
757
857
|
// Now reset the extensions to just those being managed by AppInsightsCore
|
|
758
|
-
|
|
858
|
+
_extensions = objFreeze(sortPlugins(_coreExtensions || [])).slice();
|
|
759
859
|
|
|
760
860
|
if (updateState) {
|
|
761
861
|
_doUpdate(updateState);
|
|
@@ -766,7 +866,7 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
766
866
|
let theExt: ILoadedPlugin<T> = null;
|
|
767
867
|
let thePlugin: IPlugin = null;
|
|
768
868
|
|
|
769
|
-
arrForEach(
|
|
869
|
+
arrForEach(_extensions, (ext: any) => {
|
|
770
870
|
if (ext.identifier === pluginIdentifier && ext !== _channelControl && ext !== _telemetryInitializerPlugin) {
|
|
771
871
|
thePlugin = ext;
|
|
772
872
|
return -1;
|
|
@@ -849,6 +949,8 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
849
949
|
});
|
|
850
950
|
|
|
851
951
|
_configExtensions = newConfigExtensions;
|
|
952
|
+
_pluginVersionString = null;
|
|
953
|
+
_pluginVersionStringArr = null;
|
|
852
954
|
|
|
853
955
|
// Re-Create the channel config
|
|
854
956
|
let newChannelConfig: IChannelControls[][] = [];
|
|
@@ -1050,9 +1152,9 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
1050
1152
|
/**
|
|
1051
1153
|
* Periodically check logger.queue for
|
|
1052
1154
|
*/
|
|
1053
|
-
public pollInternalLogs(eventName?: string):
|
|
1155
|
+
public pollInternalLogs(eventName?: string): ITimerHandler {
|
|
1054
1156
|
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
1055
|
-
return
|
|
1157
|
+
return null;
|
|
1056
1158
|
}
|
|
1057
1159
|
|
|
1058
1160
|
/**
|
|
@@ -17,6 +17,7 @@ import { SendRequestReason } from "../JavaScriptSDK.Enums/SendRequestReason";
|
|
|
17
17
|
import { IDistributedTraceContext } from "./IDistributedTraceContext";
|
|
18
18
|
import { ILegacyUnloadHook, IUnloadHook } from "./IUnloadHook";
|
|
19
19
|
import { WatcherFunction } from "../Config/IDynamicWatcher";
|
|
20
|
+
import { ITimerHandler } from "@nevware21/ts-utils";
|
|
20
21
|
|
|
21
22
|
export interface ILoadedPlugin<T extends IPlugin> {
|
|
22
23
|
plugin: T;
|
|
@@ -48,6 +49,16 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
48
49
|
|
|
49
50
|
logger: IDiagnosticLogger;
|
|
50
51
|
|
|
52
|
+
/**
|
|
53
|
+
* An array of the installed plugins that provide a version
|
|
54
|
+
*/
|
|
55
|
+
readonly pluginVersionStringArr: string[];
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The formatted string of the installed plugins that contain a version number
|
|
59
|
+
*/
|
|
60
|
+
readonly pluginVersionString: string;
|
|
61
|
+
|
|
51
62
|
/**
|
|
52
63
|
* Returns a value that indicates whether the instance has already been previously initialized.
|
|
53
64
|
*/
|
|
@@ -105,7 +116,7 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
105
116
|
*/
|
|
106
117
|
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler;
|
|
107
118
|
|
|
108
|
-
pollInternalLogs?(eventName?: string):
|
|
119
|
+
pollInternalLogs?(eventName?: string): ITimerHandler;
|
|
109
120
|
|
|
110
121
|
stopPollingInternalLogs?(): void;
|
|
111
122
|
|
|
@@ -197,4 +208,9 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
197
208
|
* @returns A watcher handler instance that can be used to remove itself when being unloaded
|
|
198
209
|
*/
|
|
199
210
|
onCfgChange<T extends IConfiguration = IConfiguration>(handler: WatcherFunction<T>): IUnloadHook;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Function used to identify the get w parameter used to identify status bit to some channels
|
|
214
|
+
*/
|
|
215
|
+
getWParam: () => number;
|
|
200
216
|
}
|
|
@@ -167,4 +167,10 @@ export interface IConfiguration {
|
|
|
167
167
|
* this will not send any notifications.
|
|
168
168
|
*/
|
|
169
169
|
disableDbgExt?: boolean;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Add "&w=0" parameter to support UA Parsing when web-workers don't have access to Document.
|
|
173
|
+
* Default is false
|
|
174
|
+
*/
|
|
175
|
+
enableWParam?: boolean;
|
|
170
176
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ITimerHandler } from "@nevware21/ts-utils";
|
|
1
2
|
import { WatcherFunction } from "../Config/IDynamicWatcher";
|
|
2
3
|
import { SendRequestReason } from "../JavaScriptSDK.Enums/SendRequestReason";
|
|
3
4
|
import { IAppInsightsCore, ILoadedPlugin } from "../JavaScriptSDK.Interfaces/IAppInsightsCore";
|
|
@@ -21,8 +22,22 @@ export declare class AppInsightsCore implements IAppInsightsCore {
|
|
|
21
22
|
static defaultConfig: IConfiguration;
|
|
22
23
|
config: IConfiguration;
|
|
23
24
|
logger: IDiagnosticLogger;
|
|
24
|
-
|
|
25
|
+
/**
|
|
26
|
+
* An array of the installed plugins that provide a version
|
|
27
|
+
*/
|
|
28
|
+
readonly pluginVersionStringArr: string[];
|
|
29
|
+
/**
|
|
30
|
+
* The formatted string of the installed plugins that contain a version number
|
|
31
|
+
*/
|
|
32
|
+
readonly pluginVersionString: string;
|
|
33
|
+
/**
|
|
34
|
+
* Returns a value that indicates whether the instance has already been previously initialized.
|
|
35
|
+
*/
|
|
25
36
|
isInitialized: () => boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Function used to identify the get w parameter used to identify status bit to some channels
|
|
39
|
+
*/
|
|
40
|
+
getWParam: () => number;
|
|
26
41
|
constructor();
|
|
27
42
|
initialize(config: IConfiguration, extensions: IPlugin[], logger?: IDiagnosticLogger, notificationManager?: INotificationManager): void;
|
|
28
43
|
getTransmissionControls(): IChannelControls[][];
|
|
@@ -56,7 +71,7 @@ export declare class AppInsightsCore implements IAppInsightsCore {
|
|
|
56
71
|
/**
|
|
57
72
|
* Periodically check logger.queue for
|
|
58
73
|
*/
|
|
59
|
-
pollInternalLogs(eventName?: string):
|
|
74
|
+
pollInternalLogs(eventName?: string): ITimerHandler;
|
|
60
75
|
/**
|
|
61
76
|
* Periodically check logger.queue for
|
|
62
77
|
*/
|
|
@@ -15,6 +15,7 @@ import { SendRequestReason } from "../JavaScriptSDK.Enums/SendRequestReason";
|
|
|
15
15
|
import { IDistributedTraceContext } from "./IDistributedTraceContext";
|
|
16
16
|
import { ILegacyUnloadHook, IUnloadHook } from "./IUnloadHook";
|
|
17
17
|
import { WatcherFunction } from "../Config/IDynamicWatcher";
|
|
18
|
+
import { ITimerHandler } from "@nevware21/ts-utils";
|
|
18
19
|
export interface ILoadedPlugin<T extends IPlugin> {
|
|
19
20
|
plugin: T;
|
|
20
21
|
/**
|
|
@@ -35,6 +36,14 @@ export interface ILoadedPlugin<T extends IPlugin> {
|
|
|
35
36
|
export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
36
37
|
config: IConfiguration;
|
|
37
38
|
logger: IDiagnosticLogger;
|
|
39
|
+
/**
|
|
40
|
+
* An array of the installed plugins that provide a version
|
|
41
|
+
*/
|
|
42
|
+
readonly pluginVersionStringArr: string[];
|
|
43
|
+
/**
|
|
44
|
+
* The formatted string of the installed plugins that contain a version number
|
|
45
|
+
*/
|
|
46
|
+
readonly pluginVersionString: string;
|
|
38
47
|
/**
|
|
39
48
|
* Returns a value that indicates whether the instance has already been previously initialized.
|
|
40
49
|
*/
|
|
@@ -73,7 +82,7 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
73
82
|
* @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
|
|
74
83
|
*/
|
|
75
84
|
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler;
|
|
76
|
-
pollInternalLogs?(eventName?: string):
|
|
85
|
+
pollInternalLogs?(eventName?: string): ITimerHandler;
|
|
77
86
|
stopPollingInternalLogs?(): void;
|
|
78
87
|
/**
|
|
79
88
|
* Return a new instance of the IProcessTelemetryContext for processing events
|
|
@@ -152,4 +161,8 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
152
161
|
* @returns A watcher handler instance that can be used to remove itself when being unloaded
|
|
153
162
|
*/
|
|
154
163
|
onCfgChange<T extends IConfiguration = IConfiguration>(handler: WatcherFunction<T>): IUnloadHook;
|
|
164
|
+
/**
|
|
165
|
+
* Function used to identify the get w parameter used to identify status bit to some channels
|
|
166
|
+
*/
|
|
167
|
+
getWParam: () => number;
|
|
155
168
|
}
|
|
@@ -142,4 +142,9 @@ export interface IConfiguration {
|
|
|
142
142
|
* this will not send any notifications.
|
|
143
143
|
*/
|
|
144
144
|
disableDbgExt?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Add "&w=0" parameter to support UA Parsing when web-workers don't have access to Document.
|
|
147
|
+
* Default is false
|
|
148
|
+
*/
|
|
149
|
+
enableWParam?: boolean;
|
|
145
150
|
}
|
|
@@ -9,9 +9,11 @@ export declare const _DYN_ENUMERABLE = "enumerable";
|
|
|
9
9
|
export declare const _DYN_APPLY = "apply";
|
|
10
10
|
export declare const _DYN_PUSH = "push";
|
|
11
11
|
export declare const _DYN_SPLICE = "splice";
|
|
12
|
+
export declare const _DYN_CANCEL = "cancel";
|
|
12
13
|
export declare const _DYN_INITIALIZE = "initialize";
|
|
13
14
|
export declare const _DYN_IDENTIFIER = "identifier";
|
|
14
15
|
export declare const _DYN_IS_INITIALIZED = "isInitialized";
|
|
16
|
+
export declare const _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs";
|
|
15
17
|
export declare const _DYN_NAME = "name";
|
|
16
18
|
export declare const _DYN_TIME = "time";
|
|
17
19
|
export declare const _DYN_PROCESS_NEXT = "processNext";
|
|
@@ -24,8 +26,8 @@ export declare const _DYN_ON_COMPLETE = "onComplete";
|
|
|
24
26
|
export declare const _DYN_CALL = "call";
|
|
25
27
|
export declare const _DYN_GET_PLUGIN = "getPlugin";
|
|
26
28
|
export declare const _DYN_FLUSH = "flush";
|
|
29
|
+
export declare const _DYN_VERSION = "version";
|
|
27
30
|
export declare const _DYN_LOGGING_LEVEL_CONSOL4 = "loggingLevelConsole";
|
|
28
|
-
export declare const _DYN__EXTENSIONS = "_extensions";
|
|
29
31
|
export declare const _DYN_TEARDOWN = "teardown";
|
|
30
32
|
export declare const _DYN_MESSAGE_ID = "messageId";
|
|
31
33
|
export declare const _DYN_MESSAGE = "message";
|
|
@@ -54,4 +56,3 @@ export declare const _DYN_COMPLETE = "complete";
|
|
|
54
56
|
export declare const _DYN_TRACE_ID = "traceId";
|
|
55
57
|
export declare const _DYN_SPAN_ID = "spanId";
|
|
56
58
|
export declare const _DYN_TRACE_FLAGS = "traceFlags";
|
|
57
|
-
export declare const _DYN_VERSION = "version";
|