@microsoft/applicationinsights-core-js 3.0.0-beta.2210-21 → 3.0.0-beta.2211-01
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 +73 -14
- 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 +197 -36
- package/dist/applicationinsights-core-js.api.md +7 -3
- package/dist/applicationinsights-core-js.d.ts +33 -2
- package/dist/applicationinsights-core-js.js +73 -14
- 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 +33 -2
- 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 +71 -9
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js.map +1 -1
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
- package/dist-esm/JavaScriptSDK/ChannelController.js +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 +6 -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 +100 -10
- package/src/JavaScriptSDK.Interfaces/IAppInsightsCore.ts +15 -0
- package/src/JavaScriptSDK.Interfaces/IConfiguration.ts +6 -0
- package/types/JavaScriptSDK/AppInsightsCore.d.ts +15 -1
- package/types/JavaScriptSDK.Interfaces/IAppInsightsCore.d.ts +12 -0
- package/types/JavaScriptSDK.Interfaces/IConfiguration.d.ts +5 -0
- package/types/__DynamicConstants.d.ts +1 -2
- package/types/tsdoc-metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Core, 3.0.0-beta.
|
|
2
|
+
* Application Insights JavaScript SDK - Core, 3.0.0-beta.2211-01
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -17,13 +17,13 @@ export var _DYN_THROW_INTERNAL = "throwInternal"; // Count: 4
|
|
|
17
17
|
export var _DYN_SET_DF = "setDf"; // Count: 7
|
|
18
18
|
export var _DYN_WATCH = "watch"; // Count: 12
|
|
19
19
|
export var _DYN_LOGGER = "logger"; // Count: 20
|
|
20
|
-
export var _DYN_CONFIGURABLE = "configurable"; // Count:
|
|
21
|
-
export var _DYN_ENUMERABLE = "enumerable"; // Count:
|
|
20
|
+
export var _DYN_CONFIGURABLE = "configurable"; // Count: 6
|
|
21
|
+
export var _DYN_ENUMERABLE = "enumerable"; // Count: 6
|
|
22
22
|
export var _DYN_APPLY = "apply"; // Count: 7
|
|
23
|
-
export var _DYN_PUSH = "push"; // Count:
|
|
23
|
+
export var _DYN_PUSH = "push"; // Count: 34
|
|
24
24
|
export var _DYN_SPLICE = "splice"; // Count: 8
|
|
25
25
|
export var _DYN_INITIALIZE = "initialize"; // Count: 6
|
|
26
|
-
export var _DYN_IDENTIFIER = "identifier"; // Count:
|
|
26
|
+
export var _DYN_IDENTIFIER = "identifier"; // Count: 12
|
|
27
27
|
export var _DYN_IS_INITIALIZED = "isInitialized"; // Count: 11
|
|
28
28
|
export var _DYN_NAME = "name"; // Count: 11
|
|
29
29
|
export var _DYN_TIME = "time"; // Count: 5
|
|
@@ -37,8 +37,8 @@ export var _DYN_ON_COMPLETE = "onComplete"; // Count: 4
|
|
|
37
37
|
export var _DYN_CALL = "call"; // Count: 5
|
|
38
38
|
export var _DYN_GET_PLUGIN = "getPlugin"; // Count: 5
|
|
39
39
|
export var _DYN_FLUSH = "flush"; // Count: 5
|
|
40
|
+
export var _DYN_VERSION = "version"; // Count: 8
|
|
40
41
|
export var _DYN_LOGGING_LEVEL_CONSOL4 = "loggingLevelConsole"; // Count: 2
|
|
41
|
-
export var _DYN__EXTENSIONS = "_extensions"; // Count: 4
|
|
42
42
|
export var _DYN_TEARDOWN = "teardown"; // Count: 10
|
|
43
43
|
export var _DYN_MESSAGE_ID = "messageId"; // Count: 4
|
|
44
44
|
export var _DYN_MESSAGE = "message"; // Count: 6
|
|
@@ -67,5 +67,4 @@ export var _DYN_COMPLETE = "complete"; // Count: 3
|
|
|
67
67
|
export var _DYN_TRACE_ID = "traceId"; // Count: 5
|
|
68
68
|
export var _DYN_SPAN_ID = "spanId"; // Count: 5
|
|
69
69
|
export var _DYN_TRACE_FLAGS = "traceFlags"; // Count: 6
|
|
70
|
-
export var _DYN_VERSION = "version"; // Count: 4
|
|
71
70
|
//# sourceMappingURL=__DynamicConstants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__DynamicConstants.js.map","sources":["__DynamicConstants.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// ###########################################################################################################################################\r\n// Note: DON'T Export these const from the package as we are still targeting IE this will export a mutable variables that someone could change\r\n// ###########################################################################################################################################\r\nexport var _DYN_LENGTH = \"length\"; // Count: 39\r\nexport var _DYN_NOTIFY = \"notify\"; // Count: 4\r\nexport var _DYN_THROW_INTERNAL = \"throwInternal\"; // Count: 4\r\nexport var _DYN_SET_DF = \"setDf\"; // Count: 7\r\nexport var _DYN_WATCH = \"watch\"; // Count: 12\r\nexport var _DYN_LOGGER = \"logger\"; // Count: 20\r\nexport var _DYN_CONFIGURABLE = \"configurable\"; // Count:
|
|
1
|
+
{"version":3,"file":"__DynamicConstants.js.map","sources":["__DynamicConstants.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// ###########################################################################################################################################\r\n// Note: DON'T Export these const from the package as we are still targeting IE this will export a mutable variables that someone could change\r\n// ###########################################################################################################################################\r\nexport var _DYN_LENGTH = \"length\"; // Count: 39\r\nexport var _DYN_NOTIFY = \"notify\"; // Count: 4\r\nexport var _DYN_THROW_INTERNAL = \"throwInternal\"; // Count: 4\r\nexport var _DYN_SET_DF = \"setDf\"; // Count: 7\r\nexport var _DYN_WATCH = \"watch\"; // Count: 12\r\nexport var _DYN_LOGGER = \"logger\"; // Count: 20\r\nexport var _DYN_CONFIGURABLE = \"configurable\"; // Count: 6\r\nexport var _DYN_ENUMERABLE = \"enumerable\"; // Count: 6\r\nexport var _DYN_APPLY = \"apply\"; // Count: 7\r\nexport var _DYN_PUSH = \"push\"; // Count: 34\r\nexport var _DYN_SPLICE = \"splice\"; // Count: 8\r\nexport var _DYN_INITIALIZE = \"initialize\"; // Count: 6\r\nexport var _DYN_IDENTIFIER = \"identifier\"; // Count: 12\r\nexport var _DYN_IS_INITIALIZED = \"isInitialized\"; // Count: 11\r\nexport var _DYN_NAME = \"name\"; // Count: 11\r\nexport var _DYN_TIME = \"time\"; // Count: 5\r\nexport var _DYN_PROCESS_NEXT = \"processNext\"; // Count: 21\r\nexport var _DYN_GET_PROCESS_TEL_CONT0 = \"getProcessTelContext\"; // Count: 2\r\nexport var _DYN_GET_NOTIFY_MGR = \"getNotifyMgr\"; // Count: 5\r\nexport var _DYN_ADD_NOTIFICATION_LIS1 = \"addNotificationListener\"; // Count: 4\r\nexport var _DYN_REMOVE_NOTIFICATION_2 = \"removeNotificationListener\"; // Count: 4\r\nexport var _DYN_STOP_POLLING_INTERNA3 = \"stopPollingInternalLogs\"; // Count: 2\r\nexport var _DYN_ON_COMPLETE = \"onComplete\"; // Count: 4\r\nexport var _DYN_CALL = \"call\"; // Count: 5\r\nexport var _DYN_GET_PLUGIN = \"getPlugin\"; // Count: 5\r\nexport var _DYN_FLUSH = \"flush\"; // Count: 5\r\nexport var _DYN_VERSION = \"version\"; // Count: 8\r\nexport var _DYN_LOGGING_LEVEL_CONSOL4 = \"loggingLevelConsole\"; // Count: 2\r\nexport var _DYN_TEARDOWN = \"teardown\"; // Count: 10\r\nexport var _DYN_MESSAGE_ID = \"messageId\"; // Count: 4\r\nexport var _DYN_MESSAGE = \"message\"; // Count: 6\r\nexport var _DYN_IS_ASYNC = \"isAsync\"; // Count: 7\r\nexport var _DYN_DIAG_LOG = \"diagLog\"; // Count: 9\r\nexport var _DYN__DO_TEARDOWN = \"_doTeardown\"; // Count: 4\r\nexport var _DYN_UPDATE = \"update\"; // Count: 7\r\nexport var _DYN_GET_NEXT = \"getNext\"; // Count: 12\r\nexport var _DYN_SET_NEXT_PLUGIN = \"setNextPlugin\"; // Count: 5\r\nexport var _DYN_CREATE_NEW = \"createNew\"; // Count: 6\r\nexport var _DYN_CONFIG = \"config\"; // Count: 5\r\nexport var _DYN_USER_AGENT = \"userAgent\"; // Count: 5\r\nexport var _DYN_SPLIT = \"split\"; // Count: 5\r\nexport var _DYN_NODE_TYPE = \"nodeType\"; // Count: 3\r\nexport var _DYN_REPLACE = \"replace\"; // Count: 8\r\nexport var _DYN_ENABLE_DEBUG_EXCEPTI5 = \"enableDebugExceptions\"; // Count: 3\r\nexport var _DYN_LOG_INTERNAL_MESSAGE = \"logInternalMessage\"; // Count: 2\r\nexport var _DYN_TO_LOWER_CASE = \"toLowerCase\"; // Count: 8\r\nexport var _DYN_TYPE = \"type\"; // Count: 14\r\nexport var _DYN_HANDLER = \"handler\"; // Count: 5\r\nexport var _DYN_LISTENERS = \"listeners\"; // Count: 6\r\nexport var _DYN_IS_CHILD_EVT = \"isChildEvt\"; // Count: 3\r\nexport var _DYN_GET_CTX = \"getCtx\"; // Count: 6\r\nexport var _DYN_SET_CTX = \"setCtx\"; // Count: 10\r\nexport var _DYN_COMPLETE = \"complete\"; // Count: 3\r\nexport var _DYN_TRACE_ID = \"traceId\"; // Count: 5\r\nexport var _DYN_SPAN_ID = \"spanId\"; // Count: 5\r\nexport var _DYN_TRACE_FLAGS = \"traceFlags\"; // Count: 6\r\n//# sourceMappingURL=__DynamicConstants.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Core, 3.0.0-beta.
|
|
2
|
+
* Application Insights JavaScript SDK - Core, 3.0.0-beta.2211-01
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
export { MinChannelPriorty } from "./JavaScriptSDK.Interfaces/IChannelControls";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/applicationinsights-core-js",
|
|
3
3
|
"author": "Microsoft Application Insights Team",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.2211-01",
|
|
5
5
|
"description": "Microsoft Application Insights Core Javascript SDK",
|
|
6
6
|
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
|
7
7
|
"keywords": [
|
|
@@ -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, objDeepFreeze,
|
|
8
|
-
objForEachKey, objFreeze, objHasOwn, throwError
|
|
7
|
+
arrAppend, arrForEach, arrIndexOf, deepExtend, dumpObj, hasDocument, isFunction, isNullOrUndefined, isPlainObject, objDeepFreeze,
|
|
8
|
+
objDefineProp, objForEachKey, objFreeze, objHasOwn, 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,7 +253,10 @@ 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
|
*/
|
|
@@ -246,6 +267,11 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
246
267
|
// Set the default values (also called during teardown)
|
|
247
268
|
_initDefaults();
|
|
248
269
|
|
|
270
|
+
// Special internal method to allow the unit tests and DebugPlugin to hook embedded objects
|
|
271
|
+
_self["_getDbgPlgTargets"] = () => {
|
|
272
|
+
return [_extensions];
|
|
273
|
+
};
|
|
274
|
+
|
|
249
275
|
_self.isInitialized = () => _isInitialized;
|
|
250
276
|
|
|
251
277
|
// Creating the self.initialize = ()
|
|
@@ -661,6 +687,36 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
661
687
|
}
|
|
662
688
|
};
|
|
663
689
|
|
|
690
|
+
_self.getWParam = () => {
|
|
691
|
+
return (hasDocument() || !!_configHandler.cfg.enableWParam) ? 0 : -1;
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
function _setPluginVersions() {
|
|
695
|
+
_pluginVersionStringArr = [];
|
|
696
|
+
|
|
697
|
+
if (_channelConfig) {
|
|
698
|
+
arrForEach(_channelConfig, (channels) => {
|
|
699
|
+
if (channels) {
|
|
700
|
+
arrForEach(channels, (channel) => {
|
|
701
|
+
if (channel.identifier && channel.version) {
|
|
702
|
+
let ver = channel.identifier + "=" + channel.version;
|
|
703
|
+
_pluginVersionStringArr.push(ver);
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
if (_configExtensions) {
|
|
711
|
+
arrForEach(_configExtensions, (ext) => {
|
|
712
|
+
if (ext && ext.identifier && ext.version) {
|
|
713
|
+
let ver = ext.identifier + "=" + ext.version;
|
|
714
|
+
_pluginVersionStringArr.push(ver);
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
664
720
|
function _initDefaults() {
|
|
665
721
|
_isInitialized = false;
|
|
666
722
|
|
|
@@ -680,8 +736,36 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
680
736
|
}
|
|
681
737
|
});
|
|
682
738
|
|
|
739
|
+
objDefineProp(_self, "pluginVersionStringArr", {
|
|
740
|
+
configurable: true,
|
|
741
|
+
enumerable: true,
|
|
742
|
+
get: () => {
|
|
743
|
+
if (!_pluginVersionStringArr) {
|
|
744
|
+
_setPluginVersions();
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
return _pluginVersionStringArr;
|
|
748
|
+
}
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
objDefineProp(_self, "pluginVersionString", {
|
|
752
|
+
configurable: true,
|
|
753
|
+
enumerable: true,
|
|
754
|
+
get: () => {
|
|
755
|
+
if (!_pluginVersionString) {
|
|
756
|
+
if (!_pluginVersionStringArr) {
|
|
757
|
+
_setPluginVersions();
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
_pluginVersionString = _pluginVersionStringArr.join(";");
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
return _pluginVersionString || STR_EMPTY;
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
|
|
683
767
|
_self.logger = new DiagnosticLogger(_configHandler.cfg);
|
|
684
|
-
|
|
768
|
+
_extensions = [];
|
|
685
769
|
|
|
686
770
|
_telemetryInitializerPlugin = new TelemetryInitializerPlugin();
|
|
687
771
|
_eventQueue = [];
|
|
@@ -703,6 +787,8 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
703
787
|
_instrumentationKey = null;
|
|
704
788
|
_hooks = [];
|
|
705
789
|
_cfgListeners = [];
|
|
790
|
+
_pluginVersionString = null;
|
|
791
|
+
_pluginVersionStringArr = null;
|
|
706
792
|
}
|
|
707
793
|
|
|
708
794
|
function _createTelCtx(): IProcessTelemetryContext {
|
|
@@ -716,7 +802,9 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
716
802
|
|
|
717
803
|
_coreExtensions = theExtensions.core;
|
|
718
804
|
_pluginChain = null;
|
|
719
|
-
|
|
805
|
+
_pluginVersionString = null;
|
|
806
|
+
_pluginVersionStringArr = null;
|
|
807
|
+
|
|
720
808
|
// Sort the complete set of extensions by priority
|
|
721
809
|
let allExtensions = theExtensions.all;
|
|
722
810
|
|
|
@@ -747,7 +835,7 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
747
835
|
_coreExtensions.push(_channelControl);
|
|
748
836
|
|
|
749
837
|
// Required to allow plugins to call core.getPlugin() during their own initialization
|
|
750
|
-
|
|
838
|
+
_extensions = sortPlugins(allExtensions);
|
|
751
839
|
|
|
752
840
|
// Initialize the controls
|
|
753
841
|
_channelControl.initialize(_configHandler.cfg, _self, allExtensions);
|
|
@@ -755,7 +843,7 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
755
843
|
initializePlugins(_createTelCtx(), allExtensions);
|
|
756
844
|
|
|
757
845
|
// Now reset the extensions to just those being managed by AppInsightsCore
|
|
758
|
-
|
|
846
|
+
_extensions = objFreeze(sortPlugins(_coreExtensions || [])).slice();
|
|
759
847
|
|
|
760
848
|
if (updateState) {
|
|
761
849
|
_doUpdate(updateState);
|
|
@@ -766,7 +854,7 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
766
854
|
let theExt: ILoadedPlugin<T> = null;
|
|
767
855
|
let thePlugin: IPlugin = null;
|
|
768
856
|
|
|
769
|
-
arrForEach(
|
|
857
|
+
arrForEach(_extensions, (ext: any) => {
|
|
770
858
|
if (ext.identifier === pluginIdentifier && ext !== _channelControl && ext !== _telemetryInitializerPlugin) {
|
|
771
859
|
thePlugin = ext;
|
|
772
860
|
return -1;
|
|
@@ -849,6 +937,8 @@ export class AppInsightsCore implements IAppInsightsCore {
|
|
|
849
937
|
});
|
|
850
938
|
|
|
851
939
|
_configExtensions = newConfigExtensions;
|
|
940
|
+
_pluginVersionString = null;
|
|
941
|
+
_pluginVersionStringArr = null;
|
|
852
942
|
|
|
853
943
|
// Re-Create the channel config
|
|
854
944
|
let newChannelConfig: IChannelControls[][] = [];
|
|
@@ -48,6 +48,16 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
48
48
|
|
|
49
49
|
logger: IDiagnosticLogger;
|
|
50
50
|
|
|
51
|
+
/**
|
|
52
|
+
* An array of the installed plugins that provide a version
|
|
53
|
+
*/
|
|
54
|
+
readonly pluginVersionStringArr: string[];
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The formatted string of the installed plugins that contain a version number
|
|
58
|
+
*/
|
|
59
|
+
readonly pluginVersionString: string;
|
|
60
|
+
|
|
51
61
|
/**
|
|
52
62
|
* Returns a value that indicates whether the instance has already been previously initialized.
|
|
53
63
|
*/
|
|
@@ -197,4 +207,9 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
197
207
|
* @returns A watcher handler instance that can be used to remove itself when being unloaded
|
|
198
208
|
*/
|
|
199
209
|
onCfgChange<T extends IConfiguration = IConfiguration>(handler: WatcherFunction<T>): IUnloadHook;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Function used to identify the get w parameter used to identify status bit to some channels
|
|
213
|
+
*/
|
|
214
|
+
getWParam: () => number;
|
|
200
215
|
}
|
|
@@ -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
|
}
|
|
@@ -21,8 +21,22 @@ export declare class AppInsightsCore implements IAppInsightsCore {
|
|
|
21
21
|
static defaultConfig: IConfiguration;
|
|
22
22
|
config: IConfiguration;
|
|
23
23
|
logger: IDiagnosticLogger;
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* An array of the installed plugins that provide a version
|
|
26
|
+
*/
|
|
27
|
+
readonly pluginVersionStringArr: string[];
|
|
28
|
+
/**
|
|
29
|
+
* The formatted string of the installed plugins that contain a version number
|
|
30
|
+
*/
|
|
31
|
+
readonly pluginVersionString: string;
|
|
32
|
+
/**
|
|
33
|
+
* Returns a value that indicates whether the instance has already been previously initialized.
|
|
34
|
+
*/
|
|
25
35
|
isInitialized: () => boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Function used to identify the get w parameter used to identify status bit to some channels
|
|
38
|
+
*/
|
|
39
|
+
getWParam: () => number;
|
|
26
40
|
constructor();
|
|
27
41
|
initialize(config: IConfiguration, extensions: IPlugin[], logger?: IDiagnosticLogger, notificationManager?: INotificationManager): void;
|
|
28
42
|
getTransmissionControls(): IChannelControls[][];
|
|
@@ -35,6 +35,14 @@ export interface ILoadedPlugin<T extends IPlugin> {
|
|
|
35
35
|
export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
36
36
|
config: IConfiguration;
|
|
37
37
|
logger: IDiagnosticLogger;
|
|
38
|
+
/**
|
|
39
|
+
* An array of the installed plugins that provide a version
|
|
40
|
+
*/
|
|
41
|
+
readonly pluginVersionStringArr: string[];
|
|
42
|
+
/**
|
|
43
|
+
* The formatted string of the installed plugins that contain a version number
|
|
44
|
+
*/
|
|
45
|
+
readonly pluginVersionString: string;
|
|
38
46
|
/**
|
|
39
47
|
* Returns a value that indicates whether the instance has already been previously initialized.
|
|
40
48
|
*/
|
|
@@ -152,4 +160,8 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
152
160
|
* @returns A watcher handler instance that can be used to remove itself when being unloaded
|
|
153
161
|
*/
|
|
154
162
|
onCfgChange<T extends IConfiguration = IConfiguration>(handler: WatcherFunction<T>): IUnloadHook;
|
|
163
|
+
/**
|
|
164
|
+
* Function used to identify the get w parameter used to identify status bit to some channels
|
|
165
|
+
*/
|
|
166
|
+
getWParam: () => number;
|
|
155
167
|
}
|
|
@@ -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
|
}
|
|
@@ -24,8 +24,8 @@ export declare const _DYN_ON_COMPLETE = "onComplete";
|
|
|
24
24
|
export declare const _DYN_CALL = "call";
|
|
25
25
|
export declare const _DYN_GET_PLUGIN = "getPlugin";
|
|
26
26
|
export declare const _DYN_FLUSH = "flush";
|
|
27
|
+
export declare const _DYN_VERSION = "version";
|
|
27
28
|
export declare const _DYN_LOGGING_LEVEL_CONSOL4 = "loggingLevelConsole";
|
|
28
|
-
export declare const _DYN__EXTENSIONS = "_extensions";
|
|
29
29
|
export declare const _DYN_TEARDOWN = "teardown";
|
|
30
30
|
export declare const _DYN_MESSAGE_ID = "messageId";
|
|
31
31
|
export declare const _DYN_MESSAGE = "message";
|
|
@@ -54,4 +54,3 @@ export declare const _DYN_COMPLETE = "complete";
|
|
|
54
54
|
export declare const _DYN_TRACE_ID = "traceId";
|
|
55
55
|
export declare const _DYN_SPAN_ID = "spanId";
|
|
56
56
|
export declare const _DYN_TRACE_FLAGS = "traceFlags";
|
|
57
|
-
export declare const _DYN_VERSION = "version";
|