@microsoft/applicationinsights-core-js 3.0.0-beta.2210-09 → 3.0.0-beta.2210-10
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 +112 -88
- 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 +61 -0
- package/dist/applicationinsights-core-js.api.md +3 -0
- package/dist/applicationinsights-core-js.d.ts +8 -1
- package/dist/applicationinsights-core-js.js +112 -88
- 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 +8 -1
- 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 +22 -9
- 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 +30 -0
- package/dist-esm/JavaScriptSDK/AggregationError.js.map +1 -0
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js +11 -16
- 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 +6 -6
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js.map +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 +4 -4
- package/dist-esm/JavaScriptSDK/NotificationManager.js.map +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 +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 -9
- package/dist-esm/__DynamicConstants.js.map +1 -1
- package/dist-esm/applicationinsights-core-js.js +2 -1
- package/dist-esm/applicationinsights-core-js.js.map +1 -1
- package/package.json +1 -1
- package/src/JavaScriptSDK/AggregationError.ts +36 -0
- package/src/JavaScriptSDK/AppInsightsCore.ts +0 -7
- package/types/JavaScriptSDK/AggregationError.d.ts +6 -0
- package/types/__DynamicConstants.d.ts +5 -6
- package/types/applicationinsights-core-js.d.ts +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights Core Javascript SDK, 3.0.0-beta.2210-
|
|
2
|
+
* Microsoft Application Insights Core Javascript SDK, 3.0.0-beta.2210-10
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -2836,6 +2836,13 @@ export declare const enum TelemetryUpdateReason {
|
|
|
2836
2836
|
PluginRemoved = 32
|
|
2837
2837
|
}
|
|
2838
2838
|
|
|
2839
|
+
/**
|
|
2840
|
+
* Throws an Aggregation Error which includes all of the errors that led to this error occurring
|
|
2841
|
+
* @param message - The message describing the aggregation error (the sourceError details are added to this)
|
|
2842
|
+
* @param sourceErrors - An array of the errors that caused this situation
|
|
2843
|
+
*/
|
|
2844
|
+
export declare function throwAggregationError(message: string, sourceErrors: any[]): never;
|
|
2845
|
+
|
|
2839
2846
|
export { throwError }
|
|
2840
2847
|
|
|
2841
2848
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Core, 3.0.0-beta.2210-
|
|
2
|
+
* Application Insights JavaScript SDK - Core, 3.0.0-beta.2210-10
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
import { arrForEach, dumpObj, newSymbol, scheduleTimeout } from "@nevware21/ts-utils";
|
|
8
|
+
import { throwAggregationError } from "../JavaScriptSDK/AggregationError";
|
|
8
9
|
import { _DYN_INDEX_OF, _DYN_LENGTH, _DYN_LOGGER, _DYN_NOTIFY, _DYN_PUSH, _DYN_SET_DF, _DYN_THROW_INTERNAL } from "../__DynamicConstants";
|
|
9
|
-
import { throwInvalidAccess } from "./DynamicSupport";
|
|
10
10
|
var symPrefix = "[[ai_";
|
|
11
11
|
var symPostfix = "]]";
|
|
12
12
|
/**
|
|
@@ -45,15 +45,13 @@ export function _createState(cfgHandler) {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
catch (e) {
|
|
48
|
-
var message = "Watcher [" + dumpObj(callback) + "] failed [" + dumpObj(e) + "]";
|
|
49
48
|
var logger = cfgHandler[_DYN_LOGGER /* @min:%2elogger */];
|
|
50
49
|
if (logger) {
|
|
51
50
|
// Don't let one individual failure break everyone
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
throwInvalidAccess(message);
|
|
51
|
+
logger[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */](1 /* eLoggingSeverity.CRITICAL */, 107 /* _eInternalMessageId.ConfigWatcherException */, "Watcher [" + dumpObj(callback) + "] failed [" + dumpObj(e) + "]");
|
|
56
52
|
}
|
|
53
|
+
// Re-throw the exception so that any true "error" is reported back to the called
|
|
54
|
+
throw e;
|
|
57
55
|
}
|
|
58
56
|
finally {
|
|
59
57
|
theState.act = prevWatcher || null;
|
|
@@ -68,16 +66,31 @@ export function _createState(cfgHandler) {
|
|
|
68
66
|
_watcherTimer.cancel();
|
|
69
67
|
_watcherTimer = null;
|
|
70
68
|
}
|
|
69
|
+
var watcherFailures_1 = [];
|
|
71
70
|
// Now run the handlers
|
|
72
71
|
arrForEach(notifyHandlers, function (handler) {
|
|
73
72
|
// The handler may have self removed as part of another handler so re-check
|
|
74
73
|
if (handler.fn) {
|
|
75
|
-
|
|
74
|
+
try {
|
|
75
|
+
_useHandler(handler, handler.fn);
|
|
76
|
+
}
|
|
77
|
+
catch (e) {
|
|
78
|
+
// Don't let a single failing watcher cause other watches to fail
|
|
79
|
+
watcherFailures_1[_DYN_PUSH /* @min:%2epush */](e);
|
|
80
|
+
}
|
|
76
81
|
}
|
|
77
82
|
});
|
|
78
83
|
// During notification we may have had additional updates -- so notify those updates as well
|
|
79
84
|
if (_waitingHandlers) {
|
|
80
|
-
|
|
85
|
+
try {
|
|
86
|
+
_notifyWatchers();
|
|
87
|
+
}
|
|
88
|
+
catch (e) {
|
|
89
|
+
watcherFailures_1[_DYN_PUSH /* @min:%2epush */](e);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (watcherFailures_1[_DYN_LENGTH /* @min:%2elength */] > 0) {
|
|
93
|
+
throwAggregationError("Unexpected watcher error occurred: ", watcherFailures_1);
|
|
81
94
|
}
|
|
82
95
|
}
|
|
83
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicState.js.map","sources":["DynamicState.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { arrForEach, dumpObj, newSymbol, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { _DYN_INDEX_OF, _DYN_LENGTH, _DYN_LOGGER, _DYN_NOTIFY, _DYN_PUSH, _DYN_SET_DF, _DYN_THROW_INTERNAL } from \"../__DynamicConstants\";\r\
|
|
1
|
+
{"version":3,"file":"DynamicState.js.map","sources":["DynamicState.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { arrForEach, dumpObj, newSymbol, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { throwAggregationError } from \"../JavaScriptSDK/AggregationError\";\r\nimport { _DYN_INDEX_OF, _DYN_LENGTH, _DYN_LOGGER, _DYN_NOTIFY, _DYN_PUSH, _DYN_SET_DF, _DYN_THROW_INTERNAL } from \"../__DynamicConstants\";\r\nvar symPrefix = \"[[ai_\";\r\nvar symPostfix = \"]]\";\r\n/**\r\n * @internal\r\n * @ignore\r\n * Add the watcher to the collection of watchers to be notified for the named value that is changing\r\n * @param watchers - The collection of watchers\r\n * @param theDetail - The dynamic property detail\r\n * @param prevValue - The previous value\r\n */\r\nfunction _insertWatcher(watchers, theDetail) {\r\n if (theDetail && theDetail.h && theDetail.h[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n arrForEach(theDetail.h, function (handler) {\r\n // The handler may have self removed and we also want to only call the handler once.\r\n if (handler && handler.fn && watchers[_DYN_INDEX_OF /* @min:%2eindexOf */](handler) === -1) {\r\n watchers[_DYN_PUSH /* @min:%2epush */](handler);\r\n }\r\n });\r\n }\r\n}\r\nexport function _createState(cfgHandler) {\r\n var _a;\r\n var dynamicPropertySymbol = newSymbol(symPrefix + \"get\" + cfgHandler.uid + symPostfix);\r\n var dynamicPropertyReadOnly = newSymbol(symPrefix + \"ro\" + cfgHandler.uid + symPostfix);\r\n var _waitingHandlers = null;\r\n var _watcherTimer = null;\r\n var theState;\r\n function _useHandler(activeHandler, callback) {\r\n var prevWatcher = theState.act;\r\n try {\r\n theState.act = activeHandler;\r\n callback({\r\n cfg: cfgHandler.cfg,\r\n set: cfgHandler.set.bind(cfgHandler),\r\n setDf: cfgHandler[_DYN_SET_DF /* @min:%2esetDf */].bind(cfgHandler)\r\n });\r\n }\r\n catch (e) {\r\n var logger = cfgHandler[_DYN_LOGGER /* @min:%2elogger */];\r\n if (logger) {\r\n // Don't let one individual failure break everyone\r\n logger[_DYN_THROW_INTERNAL /* @min:%2ethrowInternal */](1 /* eLoggingSeverity.CRITICAL */, 107 /* _eInternalMessageId.ConfigWatcherException */, \"Watcher [\" + dumpObj(callback) + \"] failed [\" + dumpObj(e) + \"]\");\r\n }\r\n // Re-throw the exception so that any true \"error\" is reported back to the called\r\n throw e;\r\n }\r\n finally {\r\n theState.act = prevWatcher || null;\r\n }\r\n }\r\n function _notifyWatchers() {\r\n if (_waitingHandlers) {\r\n var notifyHandlers = _waitingHandlers;\r\n _waitingHandlers = null;\r\n if (_watcherTimer) {\r\n // Stop any timer as we are running them now anyway\r\n _watcherTimer.cancel();\r\n _watcherTimer = null;\r\n }\r\n var watcherFailures_1 = [];\r\n // Now run the handlers\r\n arrForEach(notifyHandlers, function (handler) {\r\n // The handler may have self removed as part of another handler so re-check\r\n if (handler.fn) {\r\n try {\r\n _useHandler(handler, handler.fn);\r\n }\r\n catch (e) {\r\n // Don't let a single failing watcher cause other watches to fail\r\n watcherFailures_1[_DYN_PUSH /* @min:%2epush */](e);\r\n }\r\n }\r\n });\r\n // During notification we may have had additional updates -- so notify those updates as well\r\n if (_waitingHandlers) {\r\n try {\r\n _notifyWatchers();\r\n }\r\n catch (e) {\r\n watcherFailures_1[_DYN_PUSH /* @min:%2epush */](e);\r\n }\r\n }\r\n if (watcherFailures_1[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n throwAggregationError(\"Unexpected watcher error occurred: \", watcherFailures_1);\r\n }\r\n }\r\n }\r\n function _addWatcher(detail) {\r\n if (detail && detail.h[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n if (!_waitingHandlers) {\r\n _waitingHandlers = [];\r\n }\r\n if (!_watcherTimer) {\r\n _watcherTimer = scheduleTimeout(function () {\r\n _watcherTimer = null;\r\n _notifyWatchers();\r\n }, 0);\r\n }\r\n // Add the watcher to the collection of waiting watchers to be executed later\r\n _insertWatcher(_waitingHandlers, detail);\r\n }\r\n }\r\n theState = (_a = {\r\n prop: dynamicPropertySymbol,\r\n ro: dynamicPropertyReadOnly,\r\n hdlr: cfgHandler,\r\n add: _addWatcher\r\n },\r\n _a[_DYN_NOTIFY /* @min:notify */] = _notifyWatchers,\r\n _a.use = _useHandler,\r\n _a);\r\n return theState;\r\n}\r\n//# sourceMappingURL=DynamicState.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;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"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Application Insights JavaScript SDK - Core, 3.0.0-beta.2210-10
|
|
3
|
+
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
import { arrForEach, createCustomError, dumpObj } from "@nevware21/ts-utils";
|
|
8
|
+
import { _DYN_LENGTH } from "../__DynamicConstants";
|
|
9
|
+
var aggregationErrorType;
|
|
10
|
+
/**
|
|
11
|
+
* Throws an Aggregation Error which includes all of the errors that led to this error occurring
|
|
12
|
+
* @param message - The message describing the aggregation error (the sourceError details are added to this)
|
|
13
|
+
* @param sourceErrors - An array of the errors that caused this situation
|
|
14
|
+
*/
|
|
15
|
+
export function throwAggregationError(message, sourceErrors) {
|
|
16
|
+
if (!aggregationErrorType) {
|
|
17
|
+
aggregationErrorType = createCustomError("AggregationError", function (self, args) {
|
|
18
|
+
if (args[_DYN_LENGTH /* @min:%2elength */] > 1) {
|
|
19
|
+
// Save the provided errors
|
|
20
|
+
self.errors = args[1];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
var theMessage = message || "One or more errors occurred.";
|
|
25
|
+
arrForEach(sourceErrors, function (srcError, idx) {
|
|
26
|
+
theMessage += "\n".concat(idx, " > ").concat(dumpObj(srcError));
|
|
27
|
+
});
|
|
28
|
+
throw new aggregationErrorType(message, sourceErrors || []);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=AggregationError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AggregationError.js.map","sources":["AggregationError.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { arrForEach, createCustomError, dumpObj } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH } from \"../__DynamicConstants\";\r\nvar aggregationErrorType;\r\n/**\r\n * Throws an Aggregation Error which includes all of the errors that led to this error occurring\r\n * @param message - The message describing the aggregation error (the sourceError details are added to this)\r\n * @param sourceErrors - An array of the errors that caused this situation\r\n */\r\nexport function throwAggregationError(message, sourceErrors) {\r\n if (!aggregationErrorType) {\r\n aggregationErrorType = createCustomError(\"AggregationError\", function (self, args) {\r\n if (args[_DYN_LENGTH /* @min:%2elength */] > 1) {\r\n // Save the provided errors\r\n self.errors = args[1];\r\n }\r\n });\r\n }\r\n var theMessage = message || \"One or more errors occurred.\";\r\n arrForEach(sourceErrors, function (srcError, idx) {\r\n theMessage += \"\\n\".concat(idx, \" > \").concat(dumpObj(srcError));\r\n });\r\n throw new aggregationErrorType(message, sourceErrors || []);\r\n}\r\n//# sourceMappingURL=AggregationError.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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Core, 3.0.0-beta.2210-
|
|
2
|
+
* Application Insights JavaScript SDK - Core, 3.0.0-beta.2210-10
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -10,7 +10,7 @@ import { __spreadArrayFn as __spreadArray } from "@microsoft/applicationinsights
|
|
|
10
10
|
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
11
11
|
import { arrAppend, arrForEach, arrIndexOf, deepExtend, dumpObj, isFunction, isNullOrUndefined, objDeepFreeze, objDefineProp, objFreeze, objHasOwn, throwError } from "@nevware21/ts-utils";
|
|
12
12
|
import { createDynamicConfig, onConfigChange } from "../Config/DynamicConfig";
|
|
13
|
-
import {
|
|
13
|
+
import { _DYN_ADD_NOTIFICATION_LIS1, _DYN_CALL, _DYN_CONFIGURABLE, _DYN_ENUMERABLE, _DYN_FLUSH, _DYN_GET_NOTIFY_MGR, _DYN_GET_PLUGIN, _DYN_GET_PROCESS_TEL_CONT0, _DYN_IDENTIFIER, _DYN_INITIALIZE, _DYN_IS_ASYNC, _DYN_IS_INITIALIZED, _DYN_LENGTH, _DYN_LOGGER, _DYN_LOGGING_LEVEL_CONSOL4, _DYN_MESSAGE, _DYN_MESSAGE_ID, _DYN_NAME, _DYN_NOTIFY, _DYN_ON_COMPLETE, _DYN_PROCESS_NEXT, _DYN_PUSH, _DYN_REMOVE_NOTIFICATION_2, _DYN_SET_DF, _DYN_SPLICE, _DYN_STOP_POLLING_INTERNA3, _DYN_TEARDOWN, _DYN_TIME, _DYN_WATCH, _DYN__EXTENSIONS } from "../__DynamicConstants";
|
|
14
14
|
import { ChannelControllerPriority, createChannelControllerPlugin, createChannelQueues } from "./ChannelController";
|
|
15
15
|
import { createCookieMgr } from "./CookieMgr";
|
|
16
16
|
import { createUniqueNamespace } from "./DataCacheHelper";
|
|
@@ -274,8 +274,6 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
274
274
|
// For backward compatibility only
|
|
275
275
|
_self[strNotificationManager] = _notificationManager;
|
|
276
276
|
}));
|
|
277
|
-
// Ensure that the current notification manager is exposed
|
|
278
|
-
_configHandler.cfg.extensionConfig[_DYN__NOTIFICATION_MANAGE1 /* @min:%2eNotificationManager */] = _notificationManager;
|
|
279
277
|
}
|
|
280
278
|
return _notificationManager;
|
|
281
279
|
};
|
|
@@ -285,16 +283,16 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
285
283
|
* called.
|
|
286
284
|
* @param listener - An INotificationListener object.
|
|
287
285
|
*/
|
|
288
|
-
_self[
|
|
289
|
-
_self[_DYN_GET_NOTIFY_MGR /* @min:%2egetNotifyMgr */]()[
|
|
286
|
+
_self[_DYN_ADD_NOTIFICATION_LIS1 /* @min:%2eaddNotificationListener */] = function (listener) {
|
|
287
|
+
_self[_DYN_GET_NOTIFY_MGR /* @min:%2egetNotifyMgr */]()[_DYN_ADD_NOTIFICATION_LIS1 /* @min:%2eaddNotificationListener */](listener);
|
|
290
288
|
};
|
|
291
289
|
/**
|
|
292
290
|
* Removes all instances of the listener.
|
|
293
291
|
* @param listener - INotificationListener to remove.
|
|
294
292
|
*/
|
|
295
|
-
_self[
|
|
293
|
+
_self[_DYN_REMOVE_NOTIFICATION_2 /* @min:%2eremoveNotificationListener */] = function (listener) {
|
|
296
294
|
if (_notificationManager) {
|
|
297
|
-
_notificationManager[
|
|
295
|
+
_notificationManager[_DYN_REMOVE_NOTIFICATION_2 /* @min:%2eremoveNotificationListener */](listener);
|
|
298
296
|
}
|
|
299
297
|
};
|
|
300
298
|
_self.getCookieMgr = function () {
|
|
@@ -358,7 +356,7 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
358
356
|
/**
|
|
359
357
|
* Stop polling log messages from logger.queue
|
|
360
358
|
*/
|
|
361
|
-
_self[
|
|
359
|
+
_self[_DYN_STOP_POLLING_INTERNA3 /* @min:%2estopPollingInternalLogs */] = function () {
|
|
362
360
|
if (_internalLogPoller) {
|
|
363
361
|
clearInterval(_internalLogPoller);
|
|
364
362
|
_internalLogPoller = 0;
|
|
@@ -408,7 +406,7 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
408
406
|
// Run all of the unload handlers first (before unloading the plugins)
|
|
409
407
|
_unloadHandlers.run(processUnloadCtx, unloadState);
|
|
410
408
|
// Stop polling the internal logs
|
|
411
|
-
_self[
|
|
409
|
+
_self[_DYN_STOP_POLLING_INTERNA3 /* @min:%2estopPollingInternalLogs */]();
|
|
412
410
|
// Start unloading the components, from this point onwards the SDK should be considered to be in an unstable state
|
|
413
411
|
processUnloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](unloadState);
|
|
414
412
|
}
|
|
@@ -482,7 +480,6 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
482
480
|
_configHandler._block(function (details) {
|
|
483
481
|
// Lets assign the new values to the existing config either overwriting or re-assigning
|
|
484
482
|
var theConfig = details.cfg;
|
|
485
|
-
var notificationManager = theConfig.extensionConfig[_DYN__NOTIFICATION_MANAGE1 /* @min:%2eNotificationManager */];
|
|
486
483
|
_deepMergeConfig(details, theConfig, newConfig, mergeExisting);
|
|
487
484
|
if (!mergeExisting) {
|
|
488
485
|
// Remove (unassign) the values "missing" from the newConfig and also not in the default config
|
|
@@ -495,8 +492,6 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
495
492
|
}
|
|
496
493
|
// Apply defaults to the new config
|
|
497
494
|
details[_DYN_SET_DF /* @min:%2esetDf */](theConfig, defaultConfig);
|
|
498
|
-
// Reapply the notification manager
|
|
499
|
-
theConfig.extensionConfig[_DYN__NOTIFICATION_MANAGE1 /* @min:%2eNotificationManager */] = notificationManager;
|
|
500
495
|
});
|
|
501
496
|
// Now execute all of the listeners (synchronously) so they update their values immediately
|
|
502
497
|
_configHandler[_DYN_NOTIFY /* @min:%2enotify */]();
|
|
@@ -538,7 +533,7 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
538
533
|
// Use a default logger so initialization errors are not dropped on the floor with full logging
|
|
539
534
|
_configHandler = createDynamicConfig({}, defaultConfig, _self[_DYN_LOGGER /* @min:%2elogger */]);
|
|
540
535
|
// Set the logging level to critical so that any critical initialization failures are displayed on the console
|
|
541
|
-
_configHandler.cfg[
|
|
536
|
+
_configHandler.cfg[_DYN_LOGGING_LEVEL_CONSOL4 /* @min:%2eloggingLevelConsole */] = 1 /* eLoggingSeverity.CRITICAL */;
|
|
542
537
|
// Define _self.config
|
|
543
538
|
objDefineProp(_self, "config", (_a = {},
|
|
544
539
|
_a[_DYN_CONFIGURABLE /* @min:configurable */] = true,
|
|
@@ -751,12 +746,12 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
751
746
|
var disableDbgExt = details.cfg.disableDbgExt;
|
|
752
747
|
if (disableDbgExt === true && _debugListener) {
|
|
753
748
|
// Remove any previously loaded debug listener
|
|
754
|
-
_notificationManager[
|
|
749
|
+
_notificationManager[_DYN_REMOVE_NOTIFICATION_2 /* @min:%2eremoveNotificationListener */](_debugListener);
|
|
755
750
|
_debugListener = null;
|
|
756
751
|
}
|
|
757
752
|
if (_notificationManager && !_debugListener && disableDbgExt !== true) {
|
|
758
753
|
_debugListener = getDebugListener(details.cfg);
|
|
759
|
-
_notificationManager[
|
|
754
|
+
_notificationManager[_DYN_ADD_NOTIFICATION_LIS1 /* @min:%2eaddNotificationListener */](_debugListener);
|
|
760
755
|
}
|
|
761
756
|
}));
|
|
762
757
|
}
|