@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
|
'use strict';
|
|
@@ -1006,6 +1006,13 @@ var BatchDiscardedReason = createEnumStyle({
|
|
|
1006
1006
|
MaxInStorageTimeExceeded: 3
|
|
1007
1007
|
});
|
|
1008
1008
|
|
|
1009
|
+
var ActiveStatus = createEnumStyle({
|
|
1010
|
+
NONE: 0 ,
|
|
1011
|
+
PENDING: 3 ,
|
|
1012
|
+
INACTIVE: 1 ,
|
|
1013
|
+
ACTIVE: 2
|
|
1014
|
+
});
|
|
1015
|
+
|
|
1009
1016
|
var _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
1010
1017
|
var _DYN_BLK_VAL = "blkVal";
|
|
1011
1018
|
var _DYN_LENGTH = "length";
|
|
@@ -1026,13 +1033,17 @@ var _DYN_IDENTIFIER = "identifier";
|
|
|
1026
1033
|
var _DYN_REMOVE_NOTIFICATION_0 = "removeNotificationListener";
|
|
1027
1034
|
var _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener";
|
|
1028
1035
|
var _DYN_IS_INITIALIZED = "isInitialized";
|
|
1036
|
+
var _DYN_INSTRUMENTATION_KEY = "instrumentationKey";
|
|
1037
|
+
var _DYN__INACTIVE = "INACTIVE";
|
|
1038
|
+
var _DYN_VALUE = "value";
|
|
1029
1039
|
var _DYN_GET_NOTIFY_MGR = "getNotifyMgr";
|
|
1030
1040
|
var _DYN_GET_PLUGIN = "getPlugin";
|
|
1031
|
-
var _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs";
|
|
1032
1041
|
var _DYN_NAME = "name";
|
|
1042
|
+
var _DYN_I_KEY = "iKey";
|
|
1033
1043
|
var _DYN_TIME = "time";
|
|
1034
1044
|
var _DYN_PROCESS_NEXT = "processNext";
|
|
1035
1045
|
var _DYN_GET_PROCESS_TEL_CONT2 = "getProcessTelContext";
|
|
1046
|
+
var _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs";
|
|
1036
1047
|
var _DYN_ENABLED = "enabled";
|
|
1037
1048
|
var _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs";
|
|
1038
1049
|
var _DYN_UNLOAD = "unload";
|
|
@@ -1670,6 +1681,54 @@ function _createAllPromise(newPromise) {
|
|
|
1670
1681
|
}, additionalArgs);
|
|
1671
1682
|
};
|
|
1672
1683
|
}
|
|
1684
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
1685
|
+
function _createAllSettledPromise(newPromise) {
|
|
1686
|
+
return createCachedValue(function (input) {
|
|
1687
|
+
var additionalArgs = arrSlice(arguments, 1);
|
|
1688
|
+
return newPromise(function (resolve, reject) {
|
|
1689
|
+
var values = [];
|
|
1690
|
+
var pending = 1;
|
|
1691
|
+
function processItem(item, idx) {
|
|
1692
|
+
pending++;
|
|
1693
|
+
doAwaitResponse(item, function (value) {
|
|
1694
|
+
if (value.rejected) {
|
|
1695
|
+
values[idx] = {
|
|
1696
|
+
status: REJECTED,
|
|
1697
|
+
reason: value.reason
|
|
1698
|
+
};
|
|
1699
|
+
}
|
|
1700
|
+
else {
|
|
1701
|
+
values[idx] = {
|
|
1702
|
+
status: "fulfilled",
|
|
1703
|
+
value: value.value
|
|
1704
|
+
};
|
|
1705
|
+
}
|
|
1706
|
+
if (--pending === 0) {
|
|
1707
|
+
resolve(values);
|
|
1708
|
+
}
|
|
1709
|
+
});
|
|
1710
|
+
}
|
|
1711
|
+
try {
|
|
1712
|
+
if (isArray(input)) {
|
|
1713
|
+
arrForEach(input, processItem);
|
|
1714
|
+
}
|
|
1715
|
+
else if (isIterable(input)) {
|
|
1716
|
+
iterForOf(input, processItem);
|
|
1717
|
+
}
|
|
1718
|
+
else {
|
|
1719
|
+
throwTypeError("Input is not an iterable");
|
|
1720
|
+
}
|
|
1721
|
+
pending--;
|
|
1722
|
+
if (pending === 0) {
|
|
1723
|
+
resolve(values);
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
catch (e) {
|
|
1727
|
+
reject(e);
|
|
1728
|
+
}
|
|
1729
|
+
}, additionalArgs);
|
|
1730
|
+
});
|
|
1731
|
+
}
|
|
1673
1732
|
function syncItemProcessor(pending) {
|
|
1674
1733
|
arrForEach(pending, function (fn) {
|
|
1675
1734
|
try {
|
|
@@ -1721,11 +1780,16 @@ function createNativePromise(executor, timeout) {
|
|
|
1721
1780
|
return thePromise;
|
|
1722
1781
|
}
|
|
1723
1782
|
var _promiseCreator;
|
|
1783
|
+
var _allSettledCreator;
|
|
1724
1784
|
function createPromise(executor, timeout) {
|
|
1725
1785
|
!_promiseCreator && (_promiseCreator = createCachedValue(createNativePromise));
|
|
1726
1786
|
return _promiseCreator.v.call(this, executor, timeout);
|
|
1727
1787
|
}
|
|
1728
1788
|
var createAllPromise = /*#__PURE__*/ _createAllPromise(createPromise);
|
|
1789
|
+
function createAllSettledPromise(input, timeout) {
|
|
1790
|
+
!_allSettledCreator && (_allSettledCreator = _createAllSettledPromise(createPromise));
|
|
1791
|
+
return _allSettledCreator.v(input, timeout);
|
|
1792
|
+
}
|
|
1729
1793
|
|
|
1730
1794
|
var UNDEFINED_VALUE = undefined;
|
|
1731
1795
|
var STR_EMPTY$1 = "";
|
|
@@ -2364,7 +2428,7 @@ function newId(maxLength) {
|
|
|
2364
2428
|
return result;
|
|
2365
2429
|
}
|
|
2366
2430
|
|
|
2367
|
-
var version = '3.3.0-nightly3.2406-
|
|
2431
|
+
var version = '3.3.0-nightly3.2406-08';
|
|
2368
2432
|
var instanceName = "." + newId(6);
|
|
2369
2433
|
var _dataUid = 0;
|
|
2370
2434
|
function _canAcceptData(target) {
|
|
@@ -4830,6 +4894,8 @@ var strValidationError = "Plugins must provide initialize method";
|
|
|
4830
4894
|
var strNotificationManager = "_notificationManager";
|
|
4831
4895
|
var strSdkUnloadingError = "SDK is still unloading...";
|
|
4832
4896
|
var strSdkNotInitialized = "SDK is not initialized";
|
|
4897
|
+
var maxInitQueueSize = 100;
|
|
4898
|
+
var maxInitTimeout = 50000;
|
|
4833
4899
|
var defaultConfig = objDeepFreeze((_a = {
|
|
4834
4900
|
cookieCfg: {}
|
|
4835
4901
|
},
|
|
@@ -4986,15 +5052,23 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
4986
5052
|
var _extensions;
|
|
4987
5053
|
var _pluginVersionStringArr;
|
|
4988
5054
|
var _pluginVersionString;
|
|
5055
|
+
var _activeStatus;
|
|
5056
|
+
var _endpoint;
|
|
5057
|
+
var _initInMemoMaxSize;
|
|
5058
|
+
var _isStatusSet;
|
|
4989
5059
|
var _internalLogPoller;
|
|
4990
5060
|
var _internalLogPollerListening;
|
|
4991
5061
|
var _forceStopInternalLogPoller;
|
|
4992
5062
|
dynamicProto(AppInsightsCore, this, function (_self) {
|
|
4993
5063
|
_initDefaults();
|
|
4994
5064
|
_self["_getDbgPlgTargets"] = function () {
|
|
4995
|
-
return [_extensions];
|
|
5065
|
+
return [_extensions, _eventQueue];
|
|
4996
5066
|
};
|
|
4997
5067
|
_self[_DYN_IS_INITIALIZED ] = function () { return _isInitialized; };
|
|
5068
|
+
_self.activeStatus = function () { return _activeStatus; };
|
|
5069
|
+
_self._setPendingStatus = function () {
|
|
5070
|
+
_activeStatus = 3 ;
|
|
5071
|
+
};
|
|
4998
5072
|
_self[_DYN_INITIALIZE ] = function (config, extensions, logger, notificationManager) {
|
|
4999
5073
|
if (_isUnloading) {
|
|
5000
5074
|
throwError(strSdkUnloadingError);
|
|
@@ -5005,14 +5079,88 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5005
5079
|
_configHandler = createDynamicConfig(config, defaultConfig, logger || _self[_DYN_LOGGER ], false);
|
|
5006
5080
|
config = _configHandler.cfg;
|
|
5007
5081
|
_addUnloadHook(_configHandler[_DYN_WATCH ](function (details) {
|
|
5008
|
-
|
|
5082
|
+
var rootCfg = details.cfg;
|
|
5083
|
+
var isPending = _activeStatus === 3 ;
|
|
5084
|
+
if (isPending) {
|
|
5085
|
+
return;
|
|
5086
|
+
}
|
|
5087
|
+
_initInMemoMaxSize = rootCfg.initInMemoMaxSize || maxInitQueueSize;
|
|
5088
|
+
var ikey = rootCfg[_DYN_INSTRUMENTATION_KEY ];
|
|
5089
|
+
var endpointUrl = rootCfg.endpointUrl;
|
|
5090
|
+
if (isNullOrUndefined(ikey)) {
|
|
5091
|
+
_instrumentationKey = null;
|
|
5092
|
+
_activeStatus = ActiveStatus[_DYN__INACTIVE ];
|
|
5093
|
+
var msg = "Please provide instrumentation key";
|
|
5094
|
+
if (!_isInitialized) {
|
|
5095
|
+
throwError(msg);
|
|
5096
|
+
}
|
|
5097
|
+
else {
|
|
5098
|
+
_throwInternal(_logger, 1 , 100 , msg);
|
|
5099
|
+
_releaseQueues();
|
|
5100
|
+
}
|
|
5101
|
+
return;
|
|
5102
|
+
}
|
|
5103
|
+
var promises = [];
|
|
5104
|
+
if (isPromiseLike(ikey)) {
|
|
5105
|
+
promises[_DYN_PUSH ](ikey);
|
|
5106
|
+
_instrumentationKey = null;
|
|
5107
|
+
}
|
|
5108
|
+
else {
|
|
5109
|
+
_instrumentationKey = ikey;
|
|
5110
|
+
}
|
|
5111
|
+
if (isPromiseLike(endpointUrl)) {
|
|
5112
|
+
promises[_DYN_PUSH ](endpointUrl);
|
|
5113
|
+
_endpoint = null;
|
|
5114
|
+
}
|
|
5115
|
+
else {
|
|
5116
|
+
_endpoint = endpointUrl;
|
|
5117
|
+
}
|
|
5118
|
+
if (promises[_DYN_LENGTH ]) {
|
|
5119
|
+
_isStatusSet = false;
|
|
5120
|
+
_activeStatus = 3 ;
|
|
5121
|
+
var initTimeout = isNotNullOrUndefined(rootCfg.initTimeOut) ? rootCfg.initTimeOut : maxInitTimeout;
|
|
5122
|
+
var allPromises = createAllSettledPromise(promises);
|
|
5123
|
+
scheduleTimeout(function () {
|
|
5124
|
+
if (!_isStatusSet) {
|
|
5125
|
+
_setStatus();
|
|
5126
|
+
}
|
|
5127
|
+
}, initTimeout);
|
|
5128
|
+
doAwaitResponse(allPromises, function (response) {
|
|
5129
|
+
try {
|
|
5130
|
+
if (_isStatusSet) {
|
|
5131
|
+
return;
|
|
5132
|
+
}
|
|
5133
|
+
if (!response.rejected) {
|
|
5134
|
+
var values = response[_DYN_VALUE ];
|
|
5135
|
+
if (values && values[_DYN_LENGTH ]) {
|
|
5136
|
+
var ikeyRes = values[0];
|
|
5137
|
+
_instrumentationKey = ikeyRes && ikeyRes[_DYN_VALUE ];
|
|
5138
|
+
if (values[_DYN_LENGTH ] > 1) {
|
|
5139
|
+
var endpointRes = values[1];
|
|
5140
|
+
_endpoint = endpointRes && endpointRes[_DYN_VALUE ];
|
|
5141
|
+
}
|
|
5142
|
+
}
|
|
5143
|
+
if (_instrumentationKey) {
|
|
5144
|
+
config[_DYN_INSTRUMENTATION_KEY ] = _instrumentationKey;
|
|
5145
|
+
config.endpointUrl = _endpoint;
|
|
5146
|
+
}
|
|
5147
|
+
}
|
|
5148
|
+
_setStatus();
|
|
5149
|
+
}
|
|
5150
|
+
catch (e) {
|
|
5151
|
+
if (!_isStatusSet) {
|
|
5152
|
+
_setStatus();
|
|
5153
|
+
}
|
|
5154
|
+
}
|
|
5155
|
+
});
|
|
5156
|
+
}
|
|
5157
|
+
else {
|
|
5158
|
+
_setStatus();
|
|
5159
|
+
}
|
|
5009
5160
|
var extCfg = details.ref(details.cfg, STR_EXTENSION_CONFIG);
|
|
5010
5161
|
objForEachKey(extCfg, function (key) {
|
|
5011
5162
|
details.ref(extCfg, key);
|
|
5012
5163
|
});
|
|
5013
|
-
if (isNullOrUndefined(_instrumentationKey)) {
|
|
5014
|
-
throwError("Please provide instrumentation key");
|
|
5015
|
-
}
|
|
5016
5164
|
}));
|
|
5017
5165
|
_notificationManager = notificationManager;
|
|
5018
5166
|
_debugListener = _initDebugListener(_configHandler, _hookContainer, _notificationManager && _self[_DYN_GET_NOTIFY_MGR ](), _debugListener);
|
|
@@ -5035,8 +5183,9 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5035
5183
|
_registerDelayedCfgListener(config, _cfgListeners, _logger);
|
|
5036
5184
|
_cfgListeners = null;
|
|
5037
5185
|
_isInitialized = true;
|
|
5038
|
-
|
|
5039
|
-
|
|
5186
|
+
if (_activeStatus === ActiveStatus.ACTIVE) {
|
|
5187
|
+
_releaseQueues();
|
|
5188
|
+
}
|
|
5040
5189
|
};
|
|
5041
5190
|
_self.getChannels = function () {
|
|
5042
5191
|
var controls = [];
|
|
@@ -5057,14 +5206,16 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5057
5206
|
_notifyInvalidEvent(telemetryItem);
|
|
5058
5207
|
throwError("telemetry name required");
|
|
5059
5208
|
}
|
|
5060
|
-
telemetryItem
|
|
5209
|
+
telemetryItem[_DYN_I_KEY ] = telemetryItem[_DYN_I_KEY ] || _instrumentationKey;
|
|
5061
5210
|
telemetryItem[_DYN_TIME ] = telemetryItem[_DYN_TIME ] || toISOString(new Date());
|
|
5062
5211
|
telemetryItem.ver = telemetryItem.ver || "4.0";
|
|
5063
|
-
if (!_isUnloading && _self[_DYN_IS_INITIALIZED ]()) {
|
|
5212
|
+
if (!_isUnloading && _self[_DYN_IS_INITIALIZED ]() && _activeStatus === ActiveStatus.ACTIVE) {
|
|
5064
5213
|
_createTelCtx()[_DYN_PROCESS_NEXT ](telemetryItem);
|
|
5065
5214
|
}
|
|
5066
|
-
else {
|
|
5067
|
-
_eventQueue[
|
|
5215
|
+
else if (_activeStatus !== ActiveStatus[_DYN__INACTIVE ]) {
|
|
5216
|
+
if (_eventQueue[_DYN_LENGTH ] <= _initInMemoMaxSize) {
|
|
5217
|
+
_eventQueue[_DYN_PUSH ](telemetryItem);
|
|
5218
|
+
}
|
|
5068
5219
|
}
|
|
5069
5220
|
}, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync));
|
|
5070
5221
|
};
|
|
@@ -5109,9 +5260,15 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5109
5260
|
if (_isInitialized && _eventQueue[_DYN_LENGTH ] > 0) {
|
|
5110
5261
|
var eventQueue = _eventQueue;
|
|
5111
5262
|
_eventQueue = [];
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5263
|
+
if (_activeStatus === 2 ) {
|
|
5264
|
+
arrForEach(eventQueue, function (event) {
|
|
5265
|
+
event[_DYN_I_KEY ] = event[_DYN_I_KEY ] || _instrumentationKey;
|
|
5266
|
+
_createTelCtx()[_DYN_PROCESS_NEXT ](event);
|
|
5267
|
+
});
|
|
5268
|
+
}
|
|
5269
|
+
else {
|
|
5270
|
+
_throwInternal(_logger, 2 , 20 , "core init status is not active");
|
|
5271
|
+
}
|
|
5115
5272
|
}
|
|
5116
5273
|
};
|
|
5117
5274
|
_self[_DYN_POLL_INTERNAL_LOGS ] = function (eventName) {
|
|
@@ -5120,6 +5277,23 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5120
5277
|
_internalLogPoller && _internalLogPoller[_DYN_CANCEL ]();
|
|
5121
5278
|
return _startLogPoller(true);
|
|
5122
5279
|
};
|
|
5280
|
+
function _setStatus() {
|
|
5281
|
+
_isStatusSet = true;
|
|
5282
|
+
if (isNullOrUndefined(_instrumentationKey)) {
|
|
5283
|
+
_activeStatus = ActiveStatus[_DYN__INACTIVE ];
|
|
5284
|
+
_throwInternal(_logger, 1 , 112 , "ikey can't be resolved from promises");
|
|
5285
|
+
}
|
|
5286
|
+
else {
|
|
5287
|
+
_activeStatus = ActiveStatus.ACTIVE;
|
|
5288
|
+
}
|
|
5289
|
+
_releaseQueues();
|
|
5290
|
+
}
|
|
5291
|
+
function _releaseQueues() {
|
|
5292
|
+
if (_isInitialized) {
|
|
5293
|
+
_self.releaseQueue();
|
|
5294
|
+
_self[_DYN_POLL_INTERNAL_LOGS ]();
|
|
5295
|
+
}
|
|
5296
|
+
}
|
|
5123
5297
|
function _startLogPoller(alwaysStart) {
|
|
5124
5298
|
if ((!_internalLogPoller || !_internalLogPoller[_DYN_ENABLED ]) && !_forceStopInternalLogPoller) {
|
|
5125
5299
|
var shouldStart = alwaysStart || (_logger && _logger.queue[_DYN_LENGTH ] > 0);
|
|
@@ -5393,6 +5567,10 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5393
5567
|
_forceStopInternalLogPoller = false;
|
|
5394
5568
|
_internalLogPoller = null;
|
|
5395
5569
|
_internalLogPollerListening = false;
|
|
5570
|
+
_activeStatus = 0 ;
|
|
5571
|
+
_endpoint = null;
|
|
5572
|
+
_initInMemoMaxSize = null;
|
|
5573
|
+
_isStatusSet = false;
|
|
5396
5574
|
}
|
|
5397
5575
|
function _createTelCtx() {
|
|
5398
5576
|
var theCtx = createProcessTelemetryContext(_getPluginChain(), _configHandler.cfg, _self);
|
|
@@ -5535,7 +5713,7 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5535
5713
|
var _a;
|
|
5536
5714
|
var item = (_a = {},
|
|
5537
5715
|
_a[_DYN_NAME ] = _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage[_DYN_MESSAGE_ID ],
|
|
5538
|
-
_a
|
|
5716
|
+
_a[_DYN_I_KEY ] = _instrumentationKey,
|
|
5539
5717
|
_a[_DYN_TIME ] = toISOString(new Date()),
|
|
5540
5718
|
_a.baseType = _InternalLogMessage.dataType,
|
|
5541
5719
|
_a.baseData = { message: logMessage[_DYN_MESSAGE ] },
|
|
@@ -5971,7 +6149,7 @@ var SenderPostManager = /** @class */ (function () {
|
|
|
5971
6149
|
if (!responseHandled) {
|
|
5972
6150
|
responseHandled = true;
|
|
5973
6151
|
if (!result.rejected) {
|
|
5974
|
-
var response_1 = result
|
|
6152
|
+
var response_1 = result[_DYN_VALUE ];
|
|
5975
6153
|
try {
|
|
5976
6154
|
if (!_isOneDs && !response_1.ok) {
|
|
5977
6155
|
_handleError(response_1.statusText);
|
|
@@ -5984,7 +6162,7 @@ var SenderPostManager = /** @class */ (function () {
|
|
|
5984
6162
|
}
|
|
5985
6163
|
else {
|
|
5986
6164
|
doAwaitResponse(response_1.text(), function (resp) {
|
|
5987
|
-
_onFetchComplete(response_1, payload, resp
|
|
6165
|
+
_onFetchComplete(response_1, payload, resp[_DYN_VALUE ]);
|
|
5988
6166
|
resolveFunc && resolveFunc(true);
|
|
5989
6167
|
});
|
|
5990
6168
|
}
|
|
@@ -6589,6 +6767,7 @@ function InstrumentEvent(target, evtName, callbacks, checkPrototype, checkParent
|
|
|
6589
6767
|
return null;
|
|
6590
6768
|
}
|
|
6591
6769
|
|
|
6770
|
+
exports.ActiveStatus = ActiveStatus;
|
|
6592
6771
|
exports.AppInsightsCore = AppInsightsCore;
|
|
6593
6772
|
exports.BaseTelemetryPlugin = BaseTelemetryPlugin;
|
|
6594
6773
|
exports.BatchDiscardedReason = BatchDiscardedReason;
|