@microsoft/applicationinsights-core-js 3.3.0-nightly3.2406-06 → 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,5 +1,5 @@
|
|
|
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) {
|
|
@@ -1009,6 +1009,13 @@
|
|
|
1009
1009
|
MaxInStorageTimeExceeded: 3
|
|
1010
1010
|
});
|
|
1011
1011
|
|
|
1012
|
+
var ActiveStatus = createEnumStyle({
|
|
1013
|
+
NONE: 0 ,
|
|
1014
|
+
PENDING: 3 ,
|
|
1015
|
+
INACTIVE: 1 ,
|
|
1016
|
+
ACTIVE: 2
|
|
1017
|
+
});
|
|
1018
|
+
|
|
1012
1019
|
var _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
1013
1020
|
var _DYN_BLK_VAL = "blkVal";
|
|
1014
1021
|
var _DYN_LENGTH = "length";
|
|
@@ -1029,13 +1036,17 @@
|
|
|
1029
1036
|
var _DYN_REMOVE_NOTIFICATION_0 = "removeNotificationListener";
|
|
1030
1037
|
var _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener";
|
|
1031
1038
|
var _DYN_IS_INITIALIZED = "isInitialized";
|
|
1039
|
+
var _DYN_INSTRUMENTATION_KEY = "instrumentationKey";
|
|
1040
|
+
var _DYN__INACTIVE = "INACTIVE";
|
|
1041
|
+
var _DYN_VALUE = "value";
|
|
1032
1042
|
var _DYN_GET_NOTIFY_MGR = "getNotifyMgr";
|
|
1033
1043
|
var _DYN_GET_PLUGIN = "getPlugin";
|
|
1034
|
-
var _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs";
|
|
1035
1044
|
var _DYN_NAME = "name";
|
|
1045
|
+
var _DYN_I_KEY = "iKey";
|
|
1036
1046
|
var _DYN_TIME = "time";
|
|
1037
1047
|
var _DYN_PROCESS_NEXT = "processNext";
|
|
1038
1048
|
var _DYN_GET_PROCESS_TEL_CONT2 = "getProcessTelContext";
|
|
1049
|
+
var _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs";
|
|
1039
1050
|
var _DYN_ENABLED = "enabled";
|
|
1040
1051
|
var _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs";
|
|
1041
1052
|
var _DYN_UNLOAD = "unload";
|
|
@@ -1673,6 +1684,54 @@
|
|
|
1673
1684
|
}, additionalArgs);
|
|
1674
1685
|
};
|
|
1675
1686
|
}
|
|
1687
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
1688
|
+
function _createAllSettledPromise(newPromise) {
|
|
1689
|
+
return createCachedValue(function (input) {
|
|
1690
|
+
var additionalArgs = arrSlice(arguments, 1);
|
|
1691
|
+
return newPromise(function (resolve, reject) {
|
|
1692
|
+
var values = [];
|
|
1693
|
+
var pending = 1;
|
|
1694
|
+
function processItem(item, idx) {
|
|
1695
|
+
pending++;
|
|
1696
|
+
doAwaitResponse(item, function (value) {
|
|
1697
|
+
if (value.rejected) {
|
|
1698
|
+
values[idx] = {
|
|
1699
|
+
status: REJECTED,
|
|
1700
|
+
reason: value.reason
|
|
1701
|
+
};
|
|
1702
|
+
}
|
|
1703
|
+
else {
|
|
1704
|
+
values[idx] = {
|
|
1705
|
+
status: "fulfilled",
|
|
1706
|
+
value: value.value
|
|
1707
|
+
};
|
|
1708
|
+
}
|
|
1709
|
+
if (--pending === 0) {
|
|
1710
|
+
resolve(values);
|
|
1711
|
+
}
|
|
1712
|
+
});
|
|
1713
|
+
}
|
|
1714
|
+
try {
|
|
1715
|
+
if (isArray(input)) {
|
|
1716
|
+
arrForEach(input, processItem);
|
|
1717
|
+
}
|
|
1718
|
+
else if (isIterable(input)) {
|
|
1719
|
+
iterForOf(input, processItem);
|
|
1720
|
+
}
|
|
1721
|
+
else {
|
|
1722
|
+
throwTypeError("Input is not an iterable");
|
|
1723
|
+
}
|
|
1724
|
+
pending--;
|
|
1725
|
+
if (pending === 0) {
|
|
1726
|
+
resolve(values);
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
catch (e) {
|
|
1730
|
+
reject(e);
|
|
1731
|
+
}
|
|
1732
|
+
}, additionalArgs);
|
|
1733
|
+
});
|
|
1734
|
+
}
|
|
1676
1735
|
function syncItemProcessor(pending) {
|
|
1677
1736
|
arrForEach(pending, function (fn) {
|
|
1678
1737
|
try {
|
|
@@ -1724,11 +1783,16 @@
|
|
|
1724
1783
|
return thePromise;
|
|
1725
1784
|
}
|
|
1726
1785
|
var _promiseCreator;
|
|
1786
|
+
var _allSettledCreator;
|
|
1727
1787
|
function createPromise(executor, timeout) {
|
|
1728
1788
|
!_promiseCreator && (_promiseCreator = createCachedValue(createNativePromise));
|
|
1729
1789
|
return _promiseCreator.v.call(this, executor, timeout);
|
|
1730
1790
|
}
|
|
1731
1791
|
var createAllPromise = /*#__PURE__*/ _createAllPromise(createPromise);
|
|
1792
|
+
function createAllSettledPromise(input, timeout) {
|
|
1793
|
+
!_allSettledCreator && (_allSettledCreator = _createAllSettledPromise(createPromise));
|
|
1794
|
+
return _allSettledCreator.v(input, timeout);
|
|
1795
|
+
}
|
|
1732
1796
|
|
|
1733
1797
|
var UNDEFINED_VALUE = undefined;
|
|
1734
1798
|
var STR_EMPTY$1 = "";
|
|
@@ -2367,7 +2431,7 @@
|
|
|
2367
2431
|
return result;
|
|
2368
2432
|
}
|
|
2369
2433
|
|
|
2370
|
-
var version = '3.3.0-nightly3.2406-
|
|
2434
|
+
var version = '3.3.0-nightly3.2406-08';
|
|
2371
2435
|
var instanceName = "." + newId(6);
|
|
2372
2436
|
var _dataUid = 0;
|
|
2373
2437
|
function _canAcceptData(target) {
|
|
@@ -4833,6 +4897,8 @@
|
|
|
4833
4897
|
var strNotificationManager = "_notificationManager";
|
|
4834
4898
|
var strSdkUnloadingError = "SDK is still unloading...";
|
|
4835
4899
|
var strSdkNotInitialized = "SDK is not initialized";
|
|
4900
|
+
var maxInitQueueSize = 100;
|
|
4901
|
+
var maxInitTimeout = 50000;
|
|
4836
4902
|
var defaultConfig = objDeepFreeze((_a = {
|
|
4837
4903
|
cookieCfg: {}
|
|
4838
4904
|
},
|
|
@@ -4989,15 +5055,23 @@
|
|
|
4989
5055
|
var _extensions;
|
|
4990
5056
|
var _pluginVersionStringArr;
|
|
4991
5057
|
var _pluginVersionString;
|
|
5058
|
+
var _activeStatus;
|
|
5059
|
+
var _endpoint;
|
|
5060
|
+
var _initInMemoMaxSize;
|
|
5061
|
+
var _isStatusSet;
|
|
4992
5062
|
var _internalLogPoller;
|
|
4993
5063
|
var _internalLogPollerListening;
|
|
4994
5064
|
var _forceStopInternalLogPoller;
|
|
4995
5065
|
dynamicProto(AppInsightsCore, this, function (_self) {
|
|
4996
5066
|
_initDefaults();
|
|
4997
5067
|
_self["_getDbgPlgTargets"] = function () {
|
|
4998
|
-
return [_extensions];
|
|
5068
|
+
return [_extensions, _eventQueue];
|
|
4999
5069
|
};
|
|
5000
5070
|
_self[_DYN_IS_INITIALIZED ] = function () { return _isInitialized; };
|
|
5071
|
+
_self.activeStatus = function () { return _activeStatus; };
|
|
5072
|
+
_self._setPendingStatus = function () {
|
|
5073
|
+
_activeStatus = 3 ;
|
|
5074
|
+
};
|
|
5001
5075
|
_self[_DYN_INITIALIZE ] = function (config, extensions, logger, notificationManager) {
|
|
5002
5076
|
if (_isUnloading) {
|
|
5003
5077
|
throwError(strSdkUnloadingError);
|
|
@@ -5008,14 +5082,88 @@
|
|
|
5008
5082
|
_configHandler = createDynamicConfig(config, defaultConfig, logger || _self[_DYN_LOGGER ], false);
|
|
5009
5083
|
config = _configHandler.cfg;
|
|
5010
5084
|
_addUnloadHook(_configHandler[_DYN_WATCH ](function (details) {
|
|
5011
|
-
|
|
5085
|
+
var rootCfg = details.cfg;
|
|
5086
|
+
var isPending = _activeStatus === 3 ;
|
|
5087
|
+
if (isPending) {
|
|
5088
|
+
return;
|
|
5089
|
+
}
|
|
5090
|
+
_initInMemoMaxSize = rootCfg.initInMemoMaxSize || maxInitQueueSize;
|
|
5091
|
+
var ikey = rootCfg[_DYN_INSTRUMENTATION_KEY ];
|
|
5092
|
+
var endpointUrl = rootCfg.endpointUrl;
|
|
5093
|
+
if (isNullOrUndefined(ikey)) {
|
|
5094
|
+
_instrumentationKey = null;
|
|
5095
|
+
_activeStatus = ActiveStatus[_DYN__INACTIVE ];
|
|
5096
|
+
var msg = "Please provide instrumentation key";
|
|
5097
|
+
if (!_isInitialized) {
|
|
5098
|
+
throwError(msg);
|
|
5099
|
+
}
|
|
5100
|
+
else {
|
|
5101
|
+
_throwInternal(_logger, 1 , 100 , msg);
|
|
5102
|
+
_releaseQueues();
|
|
5103
|
+
}
|
|
5104
|
+
return;
|
|
5105
|
+
}
|
|
5106
|
+
var promises = [];
|
|
5107
|
+
if (isPromiseLike(ikey)) {
|
|
5108
|
+
promises[_DYN_PUSH ](ikey);
|
|
5109
|
+
_instrumentationKey = null;
|
|
5110
|
+
}
|
|
5111
|
+
else {
|
|
5112
|
+
_instrumentationKey = ikey;
|
|
5113
|
+
}
|
|
5114
|
+
if (isPromiseLike(endpointUrl)) {
|
|
5115
|
+
promises[_DYN_PUSH ](endpointUrl);
|
|
5116
|
+
_endpoint = null;
|
|
5117
|
+
}
|
|
5118
|
+
else {
|
|
5119
|
+
_endpoint = endpointUrl;
|
|
5120
|
+
}
|
|
5121
|
+
if (promises[_DYN_LENGTH ]) {
|
|
5122
|
+
_isStatusSet = false;
|
|
5123
|
+
_activeStatus = 3 ;
|
|
5124
|
+
var initTimeout = isNotNullOrUndefined(rootCfg.initTimeOut) ? rootCfg.initTimeOut : maxInitTimeout;
|
|
5125
|
+
var allPromises = createAllSettledPromise(promises);
|
|
5126
|
+
scheduleTimeout(function () {
|
|
5127
|
+
if (!_isStatusSet) {
|
|
5128
|
+
_setStatus();
|
|
5129
|
+
}
|
|
5130
|
+
}, initTimeout);
|
|
5131
|
+
doAwaitResponse(allPromises, function (response) {
|
|
5132
|
+
try {
|
|
5133
|
+
if (_isStatusSet) {
|
|
5134
|
+
return;
|
|
5135
|
+
}
|
|
5136
|
+
if (!response.rejected) {
|
|
5137
|
+
var values = response[_DYN_VALUE ];
|
|
5138
|
+
if (values && values[_DYN_LENGTH ]) {
|
|
5139
|
+
var ikeyRes = values[0];
|
|
5140
|
+
_instrumentationKey = ikeyRes && ikeyRes[_DYN_VALUE ];
|
|
5141
|
+
if (values[_DYN_LENGTH ] > 1) {
|
|
5142
|
+
var endpointRes = values[1];
|
|
5143
|
+
_endpoint = endpointRes && endpointRes[_DYN_VALUE ];
|
|
5144
|
+
}
|
|
5145
|
+
}
|
|
5146
|
+
if (_instrumentationKey) {
|
|
5147
|
+
config[_DYN_INSTRUMENTATION_KEY ] = _instrumentationKey;
|
|
5148
|
+
config.endpointUrl = _endpoint;
|
|
5149
|
+
}
|
|
5150
|
+
}
|
|
5151
|
+
_setStatus();
|
|
5152
|
+
}
|
|
5153
|
+
catch (e) {
|
|
5154
|
+
if (!_isStatusSet) {
|
|
5155
|
+
_setStatus();
|
|
5156
|
+
}
|
|
5157
|
+
}
|
|
5158
|
+
});
|
|
5159
|
+
}
|
|
5160
|
+
else {
|
|
5161
|
+
_setStatus();
|
|
5162
|
+
}
|
|
5012
5163
|
var extCfg = details.ref(details.cfg, STR_EXTENSION_CONFIG);
|
|
5013
5164
|
objForEachKey(extCfg, function (key) {
|
|
5014
5165
|
details.ref(extCfg, key);
|
|
5015
5166
|
});
|
|
5016
|
-
if (isNullOrUndefined(_instrumentationKey)) {
|
|
5017
|
-
throwError("Please provide instrumentation key");
|
|
5018
|
-
}
|
|
5019
5167
|
}));
|
|
5020
5168
|
_notificationManager = notificationManager;
|
|
5021
5169
|
_debugListener = _initDebugListener(_configHandler, _hookContainer, _notificationManager && _self[_DYN_GET_NOTIFY_MGR ](), _debugListener);
|
|
@@ -5038,8 +5186,9 @@
|
|
|
5038
5186
|
_registerDelayedCfgListener(config, _cfgListeners, _logger);
|
|
5039
5187
|
_cfgListeners = null;
|
|
5040
5188
|
_isInitialized = true;
|
|
5041
|
-
|
|
5042
|
-
|
|
5189
|
+
if (_activeStatus === ActiveStatus.ACTIVE) {
|
|
5190
|
+
_releaseQueues();
|
|
5191
|
+
}
|
|
5043
5192
|
};
|
|
5044
5193
|
_self.getChannels = function () {
|
|
5045
5194
|
var controls = [];
|
|
@@ -5060,14 +5209,16 @@
|
|
|
5060
5209
|
_notifyInvalidEvent(telemetryItem);
|
|
5061
5210
|
throwError("telemetry name required");
|
|
5062
5211
|
}
|
|
5063
|
-
telemetryItem
|
|
5212
|
+
telemetryItem[_DYN_I_KEY ] = telemetryItem[_DYN_I_KEY ] || _instrumentationKey;
|
|
5064
5213
|
telemetryItem[_DYN_TIME ] = telemetryItem[_DYN_TIME ] || toISOString(new Date());
|
|
5065
5214
|
telemetryItem.ver = telemetryItem.ver || "4.0";
|
|
5066
|
-
if (!_isUnloading && _self[_DYN_IS_INITIALIZED ]()) {
|
|
5215
|
+
if (!_isUnloading && _self[_DYN_IS_INITIALIZED ]() && _activeStatus === ActiveStatus.ACTIVE) {
|
|
5067
5216
|
_createTelCtx()[_DYN_PROCESS_NEXT ](telemetryItem);
|
|
5068
5217
|
}
|
|
5069
|
-
else {
|
|
5070
|
-
_eventQueue[
|
|
5218
|
+
else if (_activeStatus !== ActiveStatus[_DYN__INACTIVE ]) {
|
|
5219
|
+
if (_eventQueue[_DYN_LENGTH ] <= _initInMemoMaxSize) {
|
|
5220
|
+
_eventQueue[_DYN_PUSH ](telemetryItem);
|
|
5221
|
+
}
|
|
5071
5222
|
}
|
|
5072
5223
|
}, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync));
|
|
5073
5224
|
};
|
|
@@ -5112,9 +5263,15 @@
|
|
|
5112
5263
|
if (_isInitialized && _eventQueue[_DYN_LENGTH ] > 0) {
|
|
5113
5264
|
var eventQueue = _eventQueue;
|
|
5114
5265
|
_eventQueue = [];
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5266
|
+
if (_activeStatus === 2 ) {
|
|
5267
|
+
arrForEach(eventQueue, function (event) {
|
|
5268
|
+
event[_DYN_I_KEY ] = event[_DYN_I_KEY ] || _instrumentationKey;
|
|
5269
|
+
_createTelCtx()[_DYN_PROCESS_NEXT ](event);
|
|
5270
|
+
});
|
|
5271
|
+
}
|
|
5272
|
+
else {
|
|
5273
|
+
_throwInternal(_logger, 2 , 20 , "core init status is not active");
|
|
5274
|
+
}
|
|
5118
5275
|
}
|
|
5119
5276
|
};
|
|
5120
5277
|
_self[_DYN_POLL_INTERNAL_LOGS ] = function (eventName) {
|
|
@@ -5123,6 +5280,23 @@
|
|
|
5123
5280
|
_internalLogPoller && _internalLogPoller[_DYN_CANCEL ]();
|
|
5124
5281
|
return _startLogPoller(true);
|
|
5125
5282
|
};
|
|
5283
|
+
function _setStatus() {
|
|
5284
|
+
_isStatusSet = true;
|
|
5285
|
+
if (isNullOrUndefined(_instrumentationKey)) {
|
|
5286
|
+
_activeStatus = ActiveStatus[_DYN__INACTIVE ];
|
|
5287
|
+
_throwInternal(_logger, 1 , 112 , "ikey can't be resolved from promises");
|
|
5288
|
+
}
|
|
5289
|
+
else {
|
|
5290
|
+
_activeStatus = ActiveStatus.ACTIVE;
|
|
5291
|
+
}
|
|
5292
|
+
_releaseQueues();
|
|
5293
|
+
}
|
|
5294
|
+
function _releaseQueues() {
|
|
5295
|
+
if (_isInitialized) {
|
|
5296
|
+
_self.releaseQueue();
|
|
5297
|
+
_self[_DYN_POLL_INTERNAL_LOGS ]();
|
|
5298
|
+
}
|
|
5299
|
+
}
|
|
5126
5300
|
function _startLogPoller(alwaysStart) {
|
|
5127
5301
|
if ((!_internalLogPoller || !_internalLogPoller[_DYN_ENABLED ]) && !_forceStopInternalLogPoller) {
|
|
5128
5302
|
var shouldStart = alwaysStart || (_logger && _logger.queue[_DYN_LENGTH ] > 0);
|
|
@@ -5396,6 +5570,10 @@
|
|
|
5396
5570
|
_forceStopInternalLogPoller = false;
|
|
5397
5571
|
_internalLogPoller = null;
|
|
5398
5572
|
_internalLogPollerListening = false;
|
|
5573
|
+
_activeStatus = 0 ;
|
|
5574
|
+
_endpoint = null;
|
|
5575
|
+
_initInMemoMaxSize = null;
|
|
5576
|
+
_isStatusSet = false;
|
|
5399
5577
|
}
|
|
5400
5578
|
function _createTelCtx() {
|
|
5401
5579
|
var theCtx = createProcessTelemetryContext(_getPluginChain(), _configHandler.cfg, _self);
|
|
@@ -5538,7 +5716,7 @@
|
|
|
5538
5716
|
var _a;
|
|
5539
5717
|
var item = (_a = {},
|
|
5540
5718
|
_a[_DYN_NAME ] = _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage[_DYN_MESSAGE_ID ],
|
|
5541
|
-
_a
|
|
5719
|
+
_a[_DYN_I_KEY ] = _instrumentationKey,
|
|
5542
5720
|
_a[_DYN_TIME ] = toISOString(new Date()),
|
|
5543
5721
|
_a.baseType = _InternalLogMessage.dataType,
|
|
5544
5722
|
_a.baseData = { message: logMessage[_DYN_MESSAGE ] },
|
|
@@ -5974,7 +6152,7 @@
|
|
|
5974
6152
|
if (!responseHandled) {
|
|
5975
6153
|
responseHandled = true;
|
|
5976
6154
|
if (!result.rejected) {
|
|
5977
|
-
var response_1 = result
|
|
6155
|
+
var response_1 = result[_DYN_VALUE ];
|
|
5978
6156
|
try {
|
|
5979
6157
|
if (!_isOneDs && !response_1.ok) {
|
|
5980
6158
|
_handleError(response_1.statusText);
|
|
@@ -5987,7 +6165,7 @@
|
|
|
5987
6165
|
}
|
|
5988
6166
|
else {
|
|
5989
6167
|
doAwaitResponse(response_1.text(), function (resp) {
|
|
5990
|
-
_onFetchComplete(response_1, payload, resp
|
|
6168
|
+
_onFetchComplete(response_1, payload, resp[_DYN_VALUE ]);
|
|
5991
6169
|
resolveFunc && resolveFunc(true);
|
|
5992
6170
|
});
|
|
5993
6171
|
}
|
|
@@ -6592,6 +6770,7 @@
|
|
|
6592
6770
|
return null;
|
|
6593
6771
|
}
|
|
6594
6772
|
|
|
6773
|
+
exports.ActiveStatus = ActiveStatus;
|
|
6595
6774
|
exports.AppInsightsCore = AppInsightsCore;
|
|
6596
6775
|
exports.BaseTelemetryPlugin = BaseTelemetryPlugin;
|
|
6597
6776
|
exports.BatchDiscardedReason = BatchDiscardedReason;
|