@microsoft/applicationinsights-core-js 3.3.0-nightly3.2406-07 → 3.3.0-nightly3.2406-08
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/es5/applicationinsights-core-js.cjs.js +199 -20
- package/browser/es5/applicationinsights-core-js.cjs.js.map +1 -1
- package/browser/es5/applicationinsights-core-js.cjs.min.js +2 -2
- package/browser/es5/applicationinsights-core-js.cjs.min.js.map +1 -1
- package/browser/es5/applicationinsights-core-js.gbl.js +201 -22
- package/browser/es5/applicationinsights-core-js.gbl.js.map +1 -1
- package/browser/es5/applicationinsights-core-js.gbl.min.js +2 -2
- package/browser/es5/applicationinsights-core-js.gbl.min.js.map +1 -1
- package/browser/es5/applicationinsights-core-js.integrity.json +25 -25
- package/browser/es5/applicationinsights-core-js.js +201 -22
- package/browser/es5/applicationinsights-core-js.js.map +1 -1
- package/browser/es5/applicationinsights-core-js.min.js +2 -2
- package/browser/es5/applicationinsights-core-js.min.js.map +1 -1
- package/dist/es5/applicationinsights-core-js.js +199 -20
- package/dist/es5/applicationinsights-core-js.js.map +1 -1
- package/dist/es5/applicationinsights-core-js.min.js +2 -2
- package/dist/es5/applicationinsights-core-js.min.js.map +1 -1
- package/dist-es5/Config/ConfigDefaultHelpers.js +1 -1
- package/dist-es5/Config/ConfigDefaults.js +1 -1
- package/dist-es5/Config/DynamicConfig.js +1 -1
- package/dist-es5/Config/DynamicProperty.js +1 -1
- package/dist-es5/Config/DynamicState.js +1 -1
- package/dist-es5/Config/DynamicSupport.js +1 -1
- package/dist-es5/Config/IConfigDefaults.js +1 -1
- package/dist-es5/Config/IDynamicConfigHandler.js +1 -1
- package/dist-es5/Config/IDynamicPropertyHandler.js +1 -1
- package/dist-es5/Config/IDynamicWatcher.js +1 -1
- package/dist-es5/Config/_IDynamicConfigHandlerState.js +1 -1
- package/dist-es5/JavaScriptSDK/AggregationError.js +1 -1
- package/dist-es5/JavaScriptSDK/AppInsightsCore.js +166 -20
- package/dist-es5/JavaScriptSDK/AppInsightsCore.js.map +1 -1
- package/dist-es5/JavaScriptSDK/AsyncUtils.js +1 -1
- package/dist-es5/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
- package/dist-es5/JavaScriptSDK/Constants.js +1 -1
- package/dist-es5/JavaScriptSDK/CookieMgr.js +1 -1
- package/dist-es5/JavaScriptSDK/CoreUtils.js +1 -1
- package/dist-es5/JavaScriptSDK/DataCacheHelper.js +2 -2
- package/dist-es5/JavaScriptSDK/DataCacheHelper.js.map +1 -1
- package/dist-es5/JavaScriptSDK/DbgExtensionUtils.js +1 -1
- package/dist-es5/JavaScriptSDK/DiagnosticLogger.js +1 -1
- package/dist-es5/JavaScriptSDK/EnvUtils.js +1 -1
- package/dist-es5/JavaScriptSDK/EventHelpers.js +1 -1
- package/dist-es5/JavaScriptSDK/HelperFuncs.js +1 -1
- package/dist-es5/JavaScriptSDK/InstrumentHooks.js +1 -1
- package/dist-es5/JavaScriptSDK/InternalConstants.js +1 -1
- package/dist-es5/JavaScriptSDK/NotificationManager.js +1 -1
- package/dist-es5/JavaScriptSDK/PerfManager.js +1 -1
- package/dist-es5/JavaScriptSDK/ProcessTelemetryContext.js +1 -1
- package/dist-es5/JavaScriptSDK/RandomHelper.js +1 -1
- package/dist-es5/JavaScriptSDK/ResponseHelpers.js +1 -1
- package/dist-es5/JavaScriptSDK/SenderPostManager.js +4 -4
- package/dist-es5/JavaScriptSDK/SenderPostManager.js.map +1 -1
- package/dist-es5/JavaScriptSDK/TelemetryHelpers.js +1 -1
- package/dist-es5/JavaScriptSDK/TelemetryInitializerPlugin.js +1 -1
- package/dist-es5/JavaScriptSDK/UnloadHandlerContainer.js +1 -1
- package/dist-es5/JavaScriptSDK/UnloadHookContainer.js +1 -1
- package/dist-es5/JavaScriptSDK/W3cTraceParent.js +1 -1
- package/dist-es5/JavaScriptSDK.Enums/EnumHelperFuncs.js +1 -1
- package/dist-es5/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
- package/dist-es5/JavaScriptSDK.Enums/FeatureOptInEnums.js +1 -1
- package/dist-es5/JavaScriptSDK.Enums/InitActiveStatusEnum.js +12 -0
- package/dist-es5/JavaScriptSDK.Enums/InitActiveStatusEnum.js.map +1 -0
- package/dist-es5/JavaScriptSDK.Enums/LoggingEnums.js +1 -1
- package/dist-es5/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
- package/dist-es5/JavaScriptSDK.Enums/TelemetryUnloadReason.js +1 -1
- package/dist-es5/JavaScriptSDK.Enums/TelemetryUpdateReason.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/IChannelControlsHost.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/IDistributedTraceContext.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/IFeatureOptIn.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/ISenderPostManager.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryInitializers.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/ITraceParent.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/IUnloadHook.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/IUnloadableComponent.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/IXDomainRequest.js +1 -1
- package/dist-es5/JavaScriptSDK.Interfaces/IXHROverride.js +1 -1
- package/dist-es5/__DynamicConstants.js +8 -4
- package/dist-es5/__DynamicConstants.js.map +1 -1
- package/dist-es5/applicationinsights-core-js.js +2 -1
- package/dist-es5/applicationinsights-core-js.js.map +1 -1
- package/package.json +1 -1
- package/types/applicationinsights-core-js.d.ts +71 -5
- package/types/applicationinsights-core-js.namespaced.d.ts +71 -5
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Core, 3.3.0-nightly3.2406-
|
|
2
|
+
* Application Insights JavaScript SDK - Core, 3.3.0-nightly3.2406-08
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
6
6
|
var undef = "undefined";
|
|
7
|
-
var nsKey, key, nm, theExports = {}, modName = "
|
|
8
|
-
var mods={}, modDetail=mods[modName]={}, ver="3.3.0-nightly3.2406-
|
|
7
|
+
var nsKey, key, nm, theExports = {}, modName = "es5_applicationinsights_core_js_3_3_0_nightly3_2406_08", msMod="__ms$mod__";
|
|
8
|
+
var mods={}, modDetail=mods[modName]={}, ver="3.3.0-nightly3.2406-08";
|
|
9
9
|
var baseNs=global, nsKey="Microsoft", baseNs=baseNs[nsKey]=(baseNs[nsKey]||{});
|
|
10
10
|
// Versioned namespace "Microsoft.ApplicationInsights3"
|
|
11
11
|
var exportNs=baseNs, nsKey="ApplicationInsights3", exportNs=exportNs[nsKey]=(exportNs[nsKey]||{});
|
|
@@ -1027,6 +1027,13 @@ var BatchDiscardedReason = createEnumStyle({
|
|
|
1027
1027
|
MaxInStorageTimeExceeded: 3
|
|
1028
1028
|
});
|
|
1029
1029
|
|
|
1030
|
+
var ActiveStatus = createEnumStyle({
|
|
1031
|
+
NONE: 0 ,
|
|
1032
|
+
PENDING: 3 ,
|
|
1033
|
+
INACTIVE: 1 ,
|
|
1034
|
+
ACTIVE: 2
|
|
1035
|
+
});
|
|
1036
|
+
|
|
1030
1037
|
var _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
1031
1038
|
var _DYN_BLK_VAL = "blkVal";
|
|
1032
1039
|
var _DYN_LENGTH = "length";
|
|
@@ -1047,13 +1054,17 @@ var _DYN_IDENTIFIER = "identifier";
|
|
|
1047
1054
|
var _DYN_REMOVE_NOTIFICATION_0 = "removeNotificationListener";
|
|
1048
1055
|
var _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener";
|
|
1049
1056
|
var _DYN_IS_INITIALIZED = "isInitialized";
|
|
1057
|
+
var _DYN_INSTRUMENTATION_KEY = "instrumentationKey";
|
|
1058
|
+
var _DYN__INACTIVE = "INACTIVE";
|
|
1059
|
+
var _DYN_VALUE = "value";
|
|
1050
1060
|
var _DYN_GET_NOTIFY_MGR = "getNotifyMgr";
|
|
1051
1061
|
var _DYN_GET_PLUGIN = "getPlugin";
|
|
1052
|
-
var _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs";
|
|
1053
1062
|
var _DYN_NAME = "name";
|
|
1063
|
+
var _DYN_I_KEY = "iKey";
|
|
1054
1064
|
var _DYN_TIME = "time";
|
|
1055
1065
|
var _DYN_PROCESS_NEXT = "processNext";
|
|
1056
1066
|
var _DYN_GET_PROCESS_TEL_CONT2 = "getProcessTelContext";
|
|
1067
|
+
var _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs";
|
|
1057
1068
|
var _DYN_ENABLED = "enabled";
|
|
1058
1069
|
var _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs";
|
|
1059
1070
|
var _DYN_UNLOAD = "unload";
|
|
@@ -1691,6 +1702,54 @@ function _createAllPromise(newPromise) {
|
|
|
1691
1702
|
}, additionalArgs);
|
|
1692
1703
|
};
|
|
1693
1704
|
}
|
|
1705
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
1706
|
+
function _createAllSettledPromise(newPromise) {
|
|
1707
|
+
return createCachedValue(function (input) {
|
|
1708
|
+
var additionalArgs = arrSlice(arguments, 1);
|
|
1709
|
+
return newPromise(function (resolve, reject) {
|
|
1710
|
+
var values = [];
|
|
1711
|
+
var pending = 1;
|
|
1712
|
+
function processItem(item, idx) {
|
|
1713
|
+
pending++;
|
|
1714
|
+
doAwaitResponse(item, function (value) {
|
|
1715
|
+
if (value.rejected) {
|
|
1716
|
+
values[idx] = {
|
|
1717
|
+
status: REJECTED,
|
|
1718
|
+
reason: value.reason
|
|
1719
|
+
};
|
|
1720
|
+
}
|
|
1721
|
+
else {
|
|
1722
|
+
values[idx] = {
|
|
1723
|
+
status: "fulfilled",
|
|
1724
|
+
value: value.value
|
|
1725
|
+
};
|
|
1726
|
+
}
|
|
1727
|
+
if (--pending === 0) {
|
|
1728
|
+
resolve(values);
|
|
1729
|
+
}
|
|
1730
|
+
});
|
|
1731
|
+
}
|
|
1732
|
+
try {
|
|
1733
|
+
if (isArray(input)) {
|
|
1734
|
+
arrForEach(input, processItem);
|
|
1735
|
+
}
|
|
1736
|
+
else if (isIterable(input)) {
|
|
1737
|
+
iterForOf(input, processItem);
|
|
1738
|
+
}
|
|
1739
|
+
else {
|
|
1740
|
+
throwTypeError("Input is not an iterable");
|
|
1741
|
+
}
|
|
1742
|
+
pending--;
|
|
1743
|
+
if (pending === 0) {
|
|
1744
|
+
resolve(values);
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
catch (e) {
|
|
1748
|
+
reject(e);
|
|
1749
|
+
}
|
|
1750
|
+
}, additionalArgs);
|
|
1751
|
+
});
|
|
1752
|
+
}
|
|
1694
1753
|
function syncItemProcessor(pending) {
|
|
1695
1754
|
arrForEach(pending, function (fn) {
|
|
1696
1755
|
try {
|
|
@@ -1742,11 +1801,16 @@ function createNativePromise(executor, timeout) {
|
|
|
1742
1801
|
return thePromise;
|
|
1743
1802
|
}
|
|
1744
1803
|
var _promiseCreator;
|
|
1804
|
+
var _allSettledCreator;
|
|
1745
1805
|
function createPromise(executor, timeout) {
|
|
1746
1806
|
!_promiseCreator && (_promiseCreator = createCachedValue(createNativePromise));
|
|
1747
1807
|
return _promiseCreator.v.call(this, executor, timeout);
|
|
1748
1808
|
}
|
|
1749
1809
|
var createAllPromise = /*#__PURE__*/ _createAllPromise(createPromise);
|
|
1810
|
+
function createAllSettledPromise(input, timeout) {
|
|
1811
|
+
!_allSettledCreator && (_allSettledCreator = _createAllSettledPromise(createPromise));
|
|
1812
|
+
return _allSettledCreator.v(input, timeout);
|
|
1813
|
+
}
|
|
1750
1814
|
|
|
1751
1815
|
var UNDEFINED_VALUE = undefined;
|
|
1752
1816
|
var STR_EMPTY$1 = "";
|
|
@@ -2385,7 +2449,7 @@ function newId(maxLength) {
|
|
|
2385
2449
|
return result;
|
|
2386
2450
|
}
|
|
2387
2451
|
|
|
2388
|
-
var version = '3.3.0-nightly3.2406-
|
|
2452
|
+
var version = '3.3.0-nightly3.2406-08';
|
|
2389
2453
|
var instanceName = "." + newId(6);
|
|
2390
2454
|
var _dataUid = 0;
|
|
2391
2455
|
function _canAcceptData(target) {
|
|
@@ -4851,6 +4915,8 @@ var strValidationError = "Plugins must provide initialize method";
|
|
|
4851
4915
|
var strNotificationManager = "_notificationManager";
|
|
4852
4916
|
var strSdkUnloadingError = "SDK is still unloading...";
|
|
4853
4917
|
var strSdkNotInitialized = "SDK is not initialized";
|
|
4918
|
+
var maxInitQueueSize = 100;
|
|
4919
|
+
var maxInitTimeout = 50000;
|
|
4854
4920
|
var defaultConfig = objDeepFreeze((_a = {
|
|
4855
4921
|
cookieCfg: {}
|
|
4856
4922
|
},
|
|
@@ -5007,15 +5073,23 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5007
5073
|
var _extensions;
|
|
5008
5074
|
var _pluginVersionStringArr;
|
|
5009
5075
|
var _pluginVersionString;
|
|
5076
|
+
var _activeStatus;
|
|
5077
|
+
var _endpoint;
|
|
5078
|
+
var _initInMemoMaxSize;
|
|
5079
|
+
var _isStatusSet;
|
|
5010
5080
|
var _internalLogPoller;
|
|
5011
5081
|
var _internalLogPollerListening;
|
|
5012
5082
|
var _forceStopInternalLogPoller;
|
|
5013
5083
|
dynamicProto(AppInsightsCore, this, function (_self) {
|
|
5014
5084
|
_initDefaults();
|
|
5015
5085
|
_self["_getDbgPlgTargets"] = function () {
|
|
5016
|
-
return [_extensions];
|
|
5086
|
+
return [_extensions, _eventQueue];
|
|
5017
5087
|
};
|
|
5018
5088
|
_self[_DYN_IS_INITIALIZED ] = function () { return _isInitialized; };
|
|
5089
|
+
_self.activeStatus = function () { return _activeStatus; };
|
|
5090
|
+
_self._setPendingStatus = function () {
|
|
5091
|
+
_activeStatus = 3 ;
|
|
5092
|
+
};
|
|
5019
5093
|
_self[_DYN_INITIALIZE ] = function (config, extensions, logger, notificationManager) {
|
|
5020
5094
|
if (_isUnloading) {
|
|
5021
5095
|
throwError(strSdkUnloadingError);
|
|
@@ -5026,14 +5100,88 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5026
5100
|
_configHandler = createDynamicConfig(config, defaultConfig, logger || _self[_DYN_LOGGER ], false);
|
|
5027
5101
|
config = _configHandler.cfg;
|
|
5028
5102
|
_addUnloadHook(_configHandler[_DYN_WATCH ](function (details) {
|
|
5029
|
-
|
|
5103
|
+
var rootCfg = details.cfg;
|
|
5104
|
+
var isPending = _activeStatus === 3 ;
|
|
5105
|
+
if (isPending) {
|
|
5106
|
+
return;
|
|
5107
|
+
}
|
|
5108
|
+
_initInMemoMaxSize = rootCfg.initInMemoMaxSize || maxInitQueueSize;
|
|
5109
|
+
var ikey = rootCfg[_DYN_INSTRUMENTATION_KEY ];
|
|
5110
|
+
var endpointUrl = rootCfg.endpointUrl;
|
|
5111
|
+
if (isNullOrUndefined(ikey)) {
|
|
5112
|
+
_instrumentationKey = null;
|
|
5113
|
+
_activeStatus = ActiveStatus[_DYN__INACTIVE ];
|
|
5114
|
+
var msg = "Please provide instrumentation key";
|
|
5115
|
+
if (!_isInitialized) {
|
|
5116
|
+
throwError(msg);
|
|
5117
|
+
}
|
|
5118
|
+
else {
|
|
5119
|
+
_throwInternal(_logger, 1 , 100 , msg);
|
|
5120
|
+
_releaseQueues();
|
|
5121
|
+
}
|
|
5122
|
+
return;
|
|
5123
|
+
}
|
|
5124
|
+
var promises = [];
|
|
5125
|
+
if (isPromiseLike(ikey)) {
|
|
5126
|
+
promises[_DYN_PUSH ](ikey);
|
|
5127
|
+
_instrumentationKey = null;
|
|
5128
|
+
}
|
|
5129
|
+
else {
|
|
5130
|
+
_instrumentationKey = ikey;
|
|
5131
|
+
}
|
|
5132
|
+
if (isPromiseLike(endpointUrl)) {
|
|
5133
|
+
promises[_DYN_PUSH ](endpointUrl);
|
|
5134
|
+
_endpoint = null;
|
|
5135
|
+
}
|
|
5136
|
+
else {
|
|
5137
|
+
_endpoint = endpointUrl;
|
|
5138
|
+
}
|
|
5139
|
+
if (promises[_DYN_LENGTH ]) {
|
|
5140
|
+
_isStatusSet = false;
|
|
5141
|
+
_activeStatus = 3 ;
|
|
5142
|
+
var initTimeout = isNotNullOrUndefined(rootCfg.initTimeOut) ? rootCfg.initTimeOut : maxInitTimeout;
|
|
5143
|
+
var allPromises = createAllSettledPromise(promises);
|
|
5144
|
+
scheduleTimeout(function () {
|
|
5145
|
+
if (!_isStatusSet) {
|
|
5146
|
+
_setStatus();
|
|
5147
|
+
}
|
|
5148
|
+
}, initTimeout);
|
|
5149
|
+
doAwaitResponse(allPromises, function (response) {
|
|
5150
|
+
try {
|
|
5151
|
+
if (_isStatusSet) {
|
|
5152
|
+
return;
|
|
5153
|
+
}
|
|
5154
|
+
if (!response.rejected) {
|
|
5155
|
+
var values = response[_DYN_VALUE ];
|
|
5156
|
+
if (values && values[_DYN_LENGTH ]) {
|
|
5157
|
+
var ikeyRes = values[0];
|
|
5158
|
+
_instrumentationKey = ikeyRes && ikeyRes[_DYN_VALUE ];
|
|
5159
|
+
if (values[_DYN_LENGTH ] > 1) {
|
|
5160
|
+
var endpointRes = values[1];
|
|
5161
|
+
_endpoint = endpointRes && endpointRes[_DYN_VALUE ];
|
|
5162
|
+
}
|
|
5163
|
+
}
|
|
5164
|
+
if (_instrumentationKey) {
|
|
5165
|
+
config[_DYN_INSTRUMENTATION_KEY ] = _instrumentationKey;
|
|
5166
|
+
config.endpointUrl = _endpoint;
|
|
5167
|
+
}
|
|
5168
|
+
}
|
|
5169
|
+
_setStatus();
|
|
5170
|
+
}
|
|
5171
|
+
catch (e) {
|
|
5172
|
+
if (!_isStatusSet) {
|
|
5173
|
+
_setStatus();
|
|
5174
|
+
}
|
|
5175
|
+
}
|
|
5176
|
+
});
|
|
5177
|
+
}
|
|
5178
|
+
else {
|
|
5179
|
+
_setStatus();
|
|
5180
|
+
}
|
|
5030
5181
|
var extCfg = details.ref(details.cfg, STR_EXTENSION_CONFIG);
|
|
5031
5182
|
objForEachKey(extCfg, function (key) {
|
|
5032
5183
|
details.ref(extCfg, key);
|
|
5033
5184
|
});
|
|
5034
|
-
if (isNullOrUndefined(_instrumentationKey)) {
|
|
5035
|
-
throwError("Please provide instrumentation key");
|
|
5036
|
-
}
|
|
5037
5185
|
}));
|
|
5038
5186
|
_notificationManager = notificationManager;
|
|
5039
5187
|
_debugListener = _initDebugListener(_configHandler, _hookContainer, _notificationManager && _self[_DYN_GET_NOTIFY_MGR ](), _debugListener);
|
|
@@ -5056,8 +5204,9 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5056
5204
|
_registerDelayedCfgListener(config, _cfgListeners, _logger);
|
|
5057
5205
|
_cfgListeners = null;
|
|
5058
5206
|
_isInitialized = true;
|
|
5059
|
-
|
|
5060
|
-
|
|
5207
|
+
if (_activeStatus === ActiveStatus.ACTIVE) {
|
|
5208
|
+
_releaseQueues();
|
|
5209
|
+
}
|
|
5061
5210
|
};
|
|
5062
5211
|
_self.getChannels = function () {
|
|
5063
5212
|
var controls = [];
|
|
@@ -5078,14 +5227,16 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5078
5227
|
_notifyInvalidEvent(telemetryItem);
|
|
5079
5228
|
throwError("telemetry name required");
|
|
5080
5229
|
}
|
|
5081
|
-
telemetryItem
|
|
5230
|
+
telemetryItem[_DYN_I_KEY ] = telemetryItem[_DYN_I_KEY ] || _instrumentationKey;
|
|
5082
5231
|
telemetryItem[_DYN_TIME ] = telemetryItem[_DYN_TIME ] || toISOString(new Date());
|
|
5083
5232
|
telemetryItem.ver = telemetryItem.ver || "4.0";
|
|
5084
|
-
if (!_isUnloading && _self[_DYN_IS_INITIALIZED ]()) {
|
|
5233
|
+
if (!_isUnloading && _self[_DYN_IS_INITIALIZED ]() && _activeStatus === ActiveStatus.ACTIVE) {
|
|
5085
5234
|
_createTelCtx()[_DYN_PROCESS_NEXT ](telemetryItem);
|
|
5086
5235
|
}
|
|
5087
|
-
else {
|
|
5088
|
-
_eventQueue[
|
|
5236
|
+
else if (_activeStatus !== ActiveStatus[_DYN__INACTIVE ]) {
|
|
5237
|
+
if (_eventQueue[_DYN_LENGTH ] <= _initInMemoMaxSize) {
|
|
5238
|
+
_eventQueue[_DYN_PUSH ](telemetryItem);
|
|
5239
|
+
}
|
|
5089
5240
|
}
|
|
5090
5241
|
}, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync));
|
|
5091
5242
|
};
|
|
@@ -5130,9 +5281,15 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5130
5281
|
if (_isInitialized && _eventQueue[_DYN_LENGTH ] > 0) {
|
|
5131
5282
|
var eventQueue = _eventQueue;
|
|
5132
5283
|
_eventQueue = [];
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5284
|
+
if (_activeStatus === 2 ) {
|
|
5285
|
+
arrForEach(eventQueue, function (event) {
|
|
5286
|
+
event[_DYN_I_KEY ] = event[_DYN_I_KEY ] || _instrumentationKey;
|
|
5287
|
+
_createTelCtx()[_DYN_PROCESS_NEXT ](event);
|
|
5288
|
+
});
|
|
5289
|
+
}
|
|
5290
|
+
else {
|
|
5291
|
+
_throwInternal(_logger, 2 , 20 , "core init status is not active");
|
|
5292
|
+
}
|
|
5136
5293
|
}
|
|
5137
5294
|
};
|
|
5138
5295
|
_self[_DYN_POLL_INTERNAL_LOGS ] = function (eventName) {
|
|
@@ -5141,6 +5298,23 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5141
5298
|
_internalLogPoller && _internalLogPoller[_DYN_CANCEL ]();
|
|
5142
5299
|
return _startLogPoller(true);
|
|
5143
5300
|
};
|
|
5301
|
+
function _setStatus() {
|
|
5302
|
+
_isStatusSet = true;
|
|
5303
|
+
if (isNullOrUndefined(_instrumentationKey)) {
|
|
5304
|
+
_activeStatus = ActiveStatus[_DYN__INACTIVE ];
|
|
5305
|
+
_throwInternal(_logger, 1 , 112 , "ikey can't be resolved from promises");
|
|
5306
|
+
}
|
|
5307
|
+
else {
|
|
5308
|
+
_activeStatus = ActiveStatus.ACTIVE;
|
|
5309
|
+
}
|
|
5310
|
+
_releaseQueues();
|
|
5311
|
+
}
|
|
5312
|
+
function _releaseQueues() {
|
|
5313
|
+
if (_isInitialized) {
|
|
5314
|
+
_self.releaseQueue();
|
|
5315
|
+
_self[_DYN_POLL_INTERNAL_LOGS ]();
|
|
5316
|
+
}
|
|
5317
|
+
}
|
|
5144
5318
|
function _startLogPoller(alwaysStart) {
|
|
5145
5319
|
if ((!_internalLogPoller || !_internalLogPoller[_DYN_ENABLED ]) && !_forceStopInternalLogPoller) {
|
|
5146
5320
|
var shouldStart = alwaysStart || (_logger && _logger.queue[_DYN_LENGTH ] > 0);
|
|
@@ -5414,6 +5588,10 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5414
5588
|
_forceStopInternalLogPoller = false;
|
|
5415
5589
|
_internalLogPoller = null;
|
|
5416
5590
|
_internalLogPollerListening = false;
|
|
5591
|
+
_activeStatus = 0 ;
|
|
5592
|
+
_endpoint = null;
|
|
5593
|
+
_initInMemoMaxSize = null;
|
|
5594
|
+
_isStatusSet = false;
|
|
5417
5595
|
}
|
|
5418
5596
|
function _createTelCtx() {
|
|
5419
5597
|
var theCtx = createProcessTelemetryContext(_getPluginChain(), _configHandler.cfg, _self);
|
|
@@ -5556,7 +5734,7 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5556
5734
|
var _a;
|
|
5557
5735
|
var item = (_a = {},
|
|
5558
5736
|
_a[_DYN_NAME ] = _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage[_DYN_MESSAGE_ID ],
|
|
5559
|
-
_a
|
|
5737
|
+
_a[_DYN_I_KEY ] = _instrumentationKey,
|
|
5560
5738
|
_a[_DYN_TIME ] = toISOString(new Date()),
|
|
5561
5739
|
_a.baseType = _InternalLogMessage.dataType,
|
|
5562
5740
|
_a.baseData = { message: logMessage[_DYN_MESSAGE ] },
|
|
@@ -5992,7 +6170,7 @@ var SenderPostManager = /** @class */ (function () {
|
|
|
5992
6170
|
if (!responseHandled) {
|
|
5993
6171
|
responseHandled = true;
|
|
5994
6172
|
if (!result.rejected) {
|
|
5995
|
-
var response_1 = result
|
|
6173
|
+
var response_1 = result[_DYN_VALUE ];
|
|
5996
6174
|
try {
|
|
5997
6175
|
if (!_isOneDs && !response_1.ok) {
|
|
5998
6176
|
_handleError(response_1.statusText);
|
|
@@ -6005,7 +6183,7 @@ var SenderPostManager = /** @class */ (function () {
|
|
|
6005
6183
|
}
|
|
6006
6184
|
else {
|
|
6007
6185
|
doAwaitResponse(response_1.text(), function (resp) {
|
|
6008
|
-
_onFetchComplete(response_1, payload, resp
|
|
6186
|
+
_onFetchComplete(response_1, payload, resp[_DYN_VALUE ]);
|
|
6009
6187
|
resolveFunc && resolveFunc(true);
|
|
6010
6188
|
});
|
|
6011
6189
|
}
|
|
@@ -6610,6 +6788,7 @@ function InstrumentEvent(target, evtName, callbacks, checkPrototype, checkParent
|
|
|
6610
6788
|
return null;
|
|
6611
6789
|
}
|
|
6612
6790
|
|
|
6791
|
+
exports.ActiveStatus = ActiveStatus;
|
|
6613
6792
|
exports.AppInsightsCore = AppInsightsCore;
|
|
6614
6793
|
exports.BaseTelemetryPlugin = BaseTelemetryPlugin;
|
|
6615
6794
|
exports.BatchDiscardedReason = BatchDiscardedReason;
|