@microsoft/applicationinsights-web-basic 3.3.0-nightly3.2406-07 → 3.3.0-nightly3.2406-09
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/{aib.3.3.0-nightly3.2406-07.cjs.js → aib.3.3.0-nightly3.2406-09.cjs.js} +299 -77
- package/browser/es5/aib.3.3.0-nightly3.2406-09.cjs.js.map +1 -0
- package/browser/es5/aib.3.3.0-nightly3.2406-09.cjs.min.js +6 -0
- package/browser/es5/aib.3.3.0-nightly3.2406-09.cjs.min.js.map +1 -0
- package/browser/es5/{aib.3.3.0-nightly3.2406-07.gbl.js → aib.3.3.0-nightly3.2406-09.gbl.js} +301 -79
- package/browser/es5/aib.3.3.0-nightly3.2406-09.gbl.js.map +1 -0
- package/browser/es5/aib.3.3.0-nightly3.2406-09.gbl.min.js +6 -0
- package/browser/es5/aib.3.3.0-nightly3.2406-09.gbl.min.js.map +1 -0
- package/browser/es5/aib.3.3.0-nightly3.2406-09.integrity.json +66 -0
- package/browser/es5/{aib.3.3.0-nightly3.2406-07.js → aib.3.3.0-nightly3.2406-09.js} +301 -79
- package/browser/es5/aib.3.3.0-nightly3.2406-09.js.map +1 -0
- package/browser/es5/aib.3.3.0-nightly3.2406-09.min.js +6 -0
- package/browser/es5/aib.3.3.0-nightly3.2406-09.min.js.map +1 -0
- package/browser/es5/aib.3.cjs.js +298 -76
- package/browser/es5/aib.3.cjs.js.map +1 -1
- package/browser/es5/aib.3.cjs.min.js +2 -2
- package/browser/es5/aib.3.cjs.min.js.map +1 -1
- package/browser/es5/aib.3.gbl.js +300 -78
- package/browser/es5/aib.3.gbl.js.map +1 -1
- package/browser/es5/aib.3.gbl.min.js +2 -2
- package/browser/es5/aib.3.gbl.min.js.map +1 -1
- package/browser/es5/aib.3.integrity.json +25 -25
- package/browser/es5/aib.3.js +300 -78
- package/browser/es5/aib.3.js.map +1 -1
- package/browser/es5/aib.3.min.js +2 -2
- package/browser/es5/aib.3.min.js.map +1 -1
- package/dist/es5/applicationinsights-web-basic.js +298 -76
- package/dist/es5/applicationinsights-web-basic.js.map +1 -1
- package/dist/es5/applicationinsights-web-basic.min.js +2 -2
- package/dist/es5/applicationinsights-web-basic.min.js.map +1 -1
- package/dist-es5/__DynamicConstants.js +6 -4
- package/dist-es5/__DynamicConstants.js.map +1 -1
- package/dist-es5/index.js +40 -9
- package/dist-es5/index.js.map +1 -1
- package/package.json +4 -4
- package/types/applicationinsights-web-basic.d.ts +1 -1
- package/types/applicationinsights-web-basic.namespaced.d.ts +67 -5
- package/browser/es5/aib.3.3.0-nightly3.2406-07.cjs.js.map +0 -1
- package/browser/es5/aib.3.3.0-nightly3.2406-07.cjs.min.js +0 -6
- package/browser/es5/aib.3.3.0-nightly3.2406-07.cjs.min.js.map +0 -1
- package/browser/es5/aib.3.3.0-nightly3.2406-07.gbl.js.map +0 -1
- package/browser/es5/aib.3.3.0-nightly3.2406-07.gbl.min.js +0 -6
- package/browser/es5/aib.3.3.0-nightly3.2406-07.gbl.min.js.map +0 -1
- package/browser/es5/aib.3.3.0-nightly3.2406-07.integrity.json +0 -66
- package/browser/es5/aib.3.3.0-nightly3.2406-07.js.map +0 -1
- package/browser/es5/aib.3.3.0-nightly3.2406-07.min.js +0 -6
- package/browser/es5/aib.3.3.0-nightly3.2406-07.min.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript Web SDK - Basic, 3.3.0-nightly3.2406-
|
|
2
|
+
* Application Insights JavaScript Web SDK - Basic, 3.3.0-nightly3.2406-09
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Microsoft = global.Microsoft || {}, global.Microsoft.ApplicationInsights = global.Microsoft.ApplicationInsights || {})));
|
|
9
9
|
})(this, (function (exports) { 'use strict';
|
|
10
10
|
|
|
11
|
-
/*! https://github.com/nevware21/ts-utils v0.11.
|
|
11
|
+
/*! https://github.com/nevware21/ts-utils v0.11.3 */
|
|
12
12
|
/*#__NO_SIDE_EFFECTS__*/
|
|
13
13
|
function _pureAssign(func1, func2) {
|
|
14
14
|
return func1 || func2;
|
|
@@ -137,14 +137,52 @@
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
+
var propMap = {
|
|
141
|
+
e: "enumerable",
|
|
142
|
+
c: "configurable",
|
|
143
|
+
v: "value",
|
|
144
|
+
w: "writable",
|
|
145
|
+
g: "get",
|
|
146
|
+
s: "set"
|
|
147
|
+
};
|
|
148
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
149
|
+
function _createProp(value) {
|
|
150
|
+
var prop = {};
|
|
151
|
+
prop[propMap["c"]] = true;
|
|
152
|
+
prop[propMap["e"]] = true;
|
|
153
|
+
if (value.l) {
|
|
154
|
+
prop.get = function () { return value.l.v; };
|
|
155
|
+
var desc = objGetOwnPropertyDescriptor(value.l, "v");
|
|
156
|
+
if (desc && desc.set) {
|
|
157
|
+
prop.set = function (newValue) {
|
|
158
|
+
value.l.v = newValue;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
objForEachKey(value, function (key, value) {
|
|
163
|
+
prop[propMap[key]] = isUndefined(value) ? prop[propMap[key]] : value;
|
|
164
|
+
});
|
|
165
|
+
return prop;
|
|
166
|
+
}
|
|
167
|
+
var objDefineProp = ( /*#__PURE__*/_pureRef(ObjClass$1, "defineProperty"));
|
|
168
|
+
function objDefine(target, key, propDesc) {
|
|
169
|
+
return objDefineProp(target, key, _createProp(propDesc));
|
|
170
|
+
}
|
|
140
171
|
/*#__NO_SIDE_EFFECTS__*/
|
|
141
|
-
function _createKeyValueMap(values, keyType, valueType, completeFn) {
|
|
172
|
+
function _createKeyValueMap(values, keyType, valueType, completeFn, writable) {
|
|
142
173
|
var theMap = {};
|
|
143
174
|
objForEachKey(values, function (key, value) {
|
|
144
|
-
theMap
|
|
145
|
-
theMap
|
|
175
|
+
_assignMapValue(theMap, key, keyType ? value : key, writable);
|
|
176
|
+
_assignMapValue(theMap, value, valueType ? value : key, writable);
|
|
177
|
+
});
|
|
178
|
+
return completeFn ? completeFn(theMap) : theMap;
|
|
179
|
+
}
|
|
180
|
+
function _assignMapValue(theMap, key, value, writable) {
|
|
181
|
+
objDefineProp(theMap, key, {
|
|
182
|
+
value: value,
|
|
183
|
+
enumerable: true,
|
|
184
|
+
writable: !!writable
|
|
146
185
|
});
|
|
147
|
-
return completeFn(theMap);
|
|
148
186
|
}
|
|
149
187
|
var asString = ( /* #__PURE__ */_pureAssign(StrCls));
|
|
150
188
|
var ERROR_TYPE = "[object Error]";
|
|
@@ -184,7 +222,7 @@
|
|
|
184
222
|
if (_objFreeze) {
|
|
185
223
|
objForEachKey(value, function (key, value) {
|
|
186
224
|
if (isArray(value) || isObject(value)) {
|
|
187
|
-
|
|
225
|
+
objDeepFreeze(value);
|
|
188
226
|
}
|
|
189
227
|
});
|
|
190
228
|
}
|
|
@@ -194,20 +232,20 @@
|
|
|
194
232
|
var objGetPrototypeOf = ( /* #__PURE__*/_pureAssign(( /* #__PURE__*/_pureRef(ObjClass$1, "getPrototypeOf")), _getProto));
|
|
195
233
|
/*#__NO_SIDE_EFFECTS__*/
|
|
196
234
|
function createEnum(values) {
|
|
197
|
-
return _createKeyValueMap(values, 1 , 0 ,
|
|
235
|
+
return _createKeyValueMap(values, 1 , 0 , objFreeze);
|
|
198
236
|
}
|
|
199
237
|
/*#__NO_SIDE_EFFECTS__*/
|
|
200
238
|
function createEnumKeyMap(values) {
|
|
201
|
-
return _createKeyValueMap(values, 0 , 0 ,
|
|
239
|
+
return _createKeyValueMap(values, 0 , 0 , objFreeze);
|
|
202
240
|
}
|
|
203
241
|
/*#__NO_SIDE_EFFECTS__*/
|
|
204
242
|
function createSimpleMap(values) {
|
|
205
243
|
var mapClass = {};
|
|
206
244
|
objForEachKey(values, function (key, value) {
|
|
207
|
-
mapClass
|
|
208
|
-
mapClass
|
|
245
|
+
_assignMapValue(mapClass, key, value[1]);
|
|
246
|
+
_assignMapValue(mapClass, value[0], value[1]);
|
|
209
247
|
});
|
|
210
|
-
return
|
|
248
|
+
return objFreeze(mapClass);
|
|
211
249
|
}
|
|
212
250
|
/*#__NO_SIDE_EFFECTS__*/
|
|
213
251
|
function createTypeMap(values) {
|
|
@@ -341,37 +379,6 @@
|
|
|
341
379
|
}
|
|
342
380
|
return result;
|
|
343
381
|
}
|
|
344
|
-
var propMap = {
|
|
345
|
-
e: "enumerable",
|
|
346
|
-
c: "configurable",
|
|
347
|
-
v: "value",
|
|
348
|
-
w: "writable",
|
|
349
|
-
g: "get",
|
|
350
|
-
s: "set"
|
|
351
|
-
};
|
|
352
|
-
/*#__NO_SIDE_EFFECTS__*/
|
|
353
|
-
function _createProp(value) {
|
|
354
|
-
var prop = {};
|
|
355
|
-
prop[propMap["c"]] = true;
|
|
356
|
-
prop[propMap["e"]] = true;
|
|
357
|
-
if (value.l) {
|
|
358
|
-
prop.get = function () { return value.l.v; };
|
|
359
|
-
var desc = objGetOwnPropertyDescriptor(value.l, "v");
|
|
360
|
-
if (desc && desc.set) {
|
|
361
|
-
prop.set = function (newValue) {
|
|
362
|
-
value.l.v = newValue;
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
objForEachKey(value, function (key, value) {
|
|
367
|
-
prop[propMap[key]] = isUndefined(value) ? prop[propMap[key]] : value;
|
|
368
|
-
});
|
|
369
|
-
return prop;
|
|
370
|
-
}
|
|
371
|
-
var objDefineProp = ( /*#__PURE__*/_pureRef(ObjClass$1, "defineProperty"));
|
|
372
|
-
function objDefine(target, key, propDesc) {
|
|
373
|
-
return objDefineProp(target, key, _createProp(propDesc));
|
|
374
|
-
}
|
|
375
382
|
var _globalLazyTestHooks;
|
|
376
383
|
function _initTestHooks() {
|
|
377
384
|
_globalLazyTestHooks = _getGlobalConfig();
|
|
@@ -1240,6 +1247,13 @@
|
|
|
1240
1247
|
var createEnumStyle = createEnum;
|
|
1241
1248
|
var createValueMap = createTypeMap;
|
|
1242
1249
|
|
|
1250
|
+
var ActiveStatus = createEnumStyle({
|
|
1251
|
+
NONE: 0 ,
|
|
1252
|
+
PENDING: 3 ,
|
|
1253
|
+
INACTIVE: 1 ,
|
|
1254
|
+
ACTIVE: 2
|
|
1255
|
+
});
|
|
1256
|
+
|
|
1243
1257
|
var _DYN_TO_LOWER_CASE$1 = "toLowerCase";
|
|
1244
1258
|
var _DYN_BLK_VAL = "blkVal";
|
|
1245
1259
|
var _DYN_LENGTH$2 = "length";
|
|
@@ -1260,13 +1274,17 @@
|
|
|
1260
1274
|
var _DYN_REMOVE_NOTIFICATION_0 = "removeNotificationListener";
|
|
1261
1275
|
var _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener";
|
|
1262
1276
|
var _DYN_IS_INITIALIZED = "isInitialized";
|
|
1277
|
+
var _DYN_INSTRUMENTATION_KEY$2 = "instrumentationKey";
|
|
1278
|
+
var _DYN__INACTIVE = "INACTIVE";
|
|
1279
|
+
var _DYN_VALUE = "value";
|
|
1263
1280
|
var _DYN_GET_NOTIFY_MGR = "getNotifyMgr";
|
|
1264
1281
|
var _DYN_GET_PLUGIN = "getPlugin";
|
|
1265
|
-
var _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs";
|
|
1266
1282
|
var _DYN_NAME$2 = "name";
|
|
1283
|
+
var _DYN_I_KEY = "iKey";
|
|
1267
1284
|
var _DYN_TIME = "time";
|
|
1268
1285
|
var _DYN_PROCESS_NEXT = "processNext";
|
|
1269
1286
|
var _DYN_GET_PROCESS_TEL_CONT2 = "getProcessTelContext";
|
|
1287
|
+
var _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs";
|
|
1270
1288
|
var _DYN_ENABLED = "enabled";
|
|
1271
1289
|
var _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs";
|
|
1272
1290
|
var _DYN_UNLOAD = "unload";
|
|
@@ -1616,6 +1634,54 @@
|
|
|
1616
1634
|
}, additionalArgs);
|
|
1617
1635
|
};
|
|
1618
1636
|
}
|
|
1637
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
1638
|
+
function _createAllSettledPromise(newPromise) {
|
|
1639
|
+
return createCachedValue(function (input) {
|
|
1640
|
+
var additionalArgs = arrSlice(arguments, 1);
|
|
1641
|
+
return newPromise(function (resolve, reject) {
|
|
1642
|
+
var values = [];
|
|
1643
|
+
var pending = 1;
|
|
1644
|
+
function processItem(item, idx) {
|
|
1645
|
+
pending++;
|
|
1646
|
+
doAwaitResponse(item, function (value) {
|
|
1647
|
+
if (value.rejected) {
|
|
1648
|
+
values[idx] = {
|
|
1649
|
+
status: REJECTED,
|
|
1650
|
+
reason: value.reason
|
|
1651
|
+
};
|
|
1652
|
+
}
|
|
1653
|
+
else {
|
|
1654
|
+
values[idx] = {
|
|
1655
|
+
status: "fulfilled",
|
|
1656
|
+
value: value.value
|
|
1657
|
+
};
|
|
1658
|
+
}
|
|
1659
|
+
if (--pending === 0) {
|
|
1660
|
+
resolve(values);
|
|
1661
|
+
}
|
|
1662
|
+
});
|
|
1663
|
+
}
|
|
1664
|
+
try {
|
|
1665
|
+
if (isArray(input)) {
|
|
1666
|
+
arrForEach(input, processItem);
|
|
1667
|
+
}
|
|
1668
|
+
else if (isIterable(input)) {
|
|
1669
|
+
iterForOf(input, processItem);
|
|
1670
|
+
}
|
|
1671
|
+
else {
|
|
1672
|
+
throwTypeError("Input is not an iterable");
|
|
1673
|
+
}
|
|
1674
|
+
pending--;
|
|
1675
|
+
if (pending === 0) {
|
|
1676
|
+
resolve(values);
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
catch (e) {
|
|
1680
|
+
reject(e);
|
|
1681
|
+
}
|
|
1682
|
+
}, additionalArgs);
|
|
1683
|
+
});
|
|
1684
|
+
}
|
|
1619
1685
|
function syncItemProcessor(pending) {
|
|
1620
1686
|
arrForEach(pending, function (fn) {
|
|
1621
1687
|
try {
|
|
@@ -1667,11 +1733,16 @@
|
|
|
1667
1733
|
return thePromise;
|
|
1668
1734
|
}
|
|
1669
1735
|
var _promiseCreator;
|
|
1736
|
+
var _allSettledCreator;
|
|
1670
1737
|
function createPromise(executor, timeout) {
|
|
1671
1738
|
!_promiseCreator && (_promiseCreator = createCachedValue(createNativePromise));
|
|
1672
1739
|
return _promiseCreator.v.call(this, executor, timeout);
|
|
1673
1740
|
}
|
|
1674
1741
|
var createAllPromise = /*#__PURE__*/ _createAllPromise(createPromise);
|
|
1742
|
+
function createAllSettledPromise(input, timeout) {
|
|
1743
|
+
!_allSettledCreator && (_allSettledCreator = _createAllSettledPromise(createPromise));
|
|
1744
|
+
return _allSettledCreator.v(input, timeout);
|
|
1745
|
+
}
|
|
1675
1746
|
|
|
1676
1747
|
var UNDEFINED_VALUE$1 = undefined;
|
|
1677
1748
|
var STR_EMPTY$1 = "";
|
|
@@ -2169,7 +2240,7 @@
|
|
|
2169
2240
|
return result;
|
|
2170
2241
|
}
|
|
2171
2242
|
|
|
2172
|
-
var version = '3.3.0-nightly3.2406-
|
|
2243
|
+
var version = '3.3.0-nightly3.2406-09';
|
|
2173
2244
|
var instanceName = "." + newId(6);
|
|
2174
2245
|
var _dataUid = 0;
|
|
2175
2246
|
function _canAcceptData(target) {
|
|
@@ -4409,6 +4480,8 @@
|
|
|
4409
4480
|
var strNotificationManager = "_notificationManager";
|
|
4410
4481
|
var strSdkUnloadingError = "SDK is still unloading...";
|
|
4411
4482
|
var strSdkNotInitialized = "SDK is not initialized";
|
|
4483
|
+
var maxInitQueueSize = 100;
|
|
4484
|
+
var maxInitTimeout = 50000;
|
|
4412
4485
|
var defaultConfig = objDeepFreeze((_a$1 = {
|
|
4413
4486
|
cookieCfg: {}
|
|
4414
4487
|
},
|
|
@@ -4565,15 +4638,23 @@
|
|
|
4565
4638
|
var _extensions;
|
|
4566
4639
|
var _pluginVersionStringArr;
|
|
4567
4640
|
var _pluginVersionString;
|
|
4641
|
+
var _activeStatus;
|
|
4642
|
+
var _endpoint;
|
|
4643
|
+
var _initInMemoMaxSize;
|
|
4644
|
+
var _isStatusSet;
|
|
4568
4645
|
var _internalLogPoller;
|
|
4569
4646
|
var _internalLogPollerListening;
|
|
4570
4647
|
var _forceStopInternalLogPoller;
|
|
4571
4648
|
dynamicProto(AppInsightsCore, this, function (_self) {
|
|
4572
4649
|
_initDefaults();
|
|
4573
4650
|
_self["_getDbgPlgTargets"] = function () {
|
|
4574
|
-
return [_extensions];
|
|
4651
|
+
return [_extensions, _eventQueue];
|
|
4575
4652
|
};
|
|
4576
4653
|
_self[_DYN_IS_INITIALIZED ] = function () { return _isInitialized; };
|
|
4654
|
+
_self.activeStatus = function () { return _activeStatus; };
|
|
4655
|
+
_self._setPendingStatus = function () {
|
|
4656
|
+
_activeStatus = 3 ;
|
|
4657
|
+
};
|
|
4577
4658
|
_self[_DYN_INITIALIZE$1 ] = function (config, extensions, logger, notificationManager) {
|
|
4578
4659
|
if (_isUnloading) {
|
|
4579
4660
|
throwError(strSdkUnloadingError);
|
|
@@ -4584,14 +4665,88 @@
|
|
|
4584
4665
|
_configHandler = createDynamicConfig(config, defaultConfig, logger || _self[_DYN_LOGGER ], false);
|
|
4585
4666
|
config = _configHandler.cfg;
|
|
4586
4667
|
_addUnloadHook(_configHandler[_DYN_WATCH ](function (details) {
|
|
4587
|
-
|
|
4668
|
+
var rootCfg = details.cfg;
|
|
4669
|
+
var isPending = _activeStatus === 3 ;
|
|
4670
|
+
if (isPending) {
|
|
4671
|
+
return;
|
|
4672
|
+
}
|
|
4673
|
+
_initInMemoMaxSize = rootCfg.initInMemoMaxSize || maxInitQueueSize;
|
|
4674
|
+
var ikey = rootCfg[_DYN_INSTRUMENTATION_KEY$2 ];
|
|
4675
|
+
var endpointUrl = rootCfg.endpointUrl;
|
|
4676
|
+
if (isNullOrUndefined(ikey)) {
|
|
4677
|
+
_instrumentationKey = null;
|
|
4678
|
+
_activeStatus = ActiveStatus[_DYN__INACTIVE ];
|
|
4679
|
+
var msg = "Please provide instrumentation key";
|
|
4680
|
+
if (!_isInitialized) {
|
|
4681
|
+
throwError(msg);
|
|
4682
|
+
}
|
|
4683
|
+
else {
|
|
4684
|
+
_throwInternal(_logger, 1 , 100 , msg);
|
|
4685
|
+
_releaseQueues();
|
|
4686
|
+
}
|
|
4687
|
+
return;
|
|
4688
|
+
}
|
|
4689
|
+
var promises = [];
|
|
4690
|
+
if (isPromiseLike(ikey)) {
|
|
4691
|
+
promises[_DYN_PUSH$2 ](ikey);
|
|
4692
|
+
_instrumentationKey = null;
|
|
4693
|
+
}
|
|
4694
|
+
else {
|
|
4695
|
+
_instrumentationKey = ikey;
|
|
4696
|
+
}
|
|
4697
|
+
if (isPromiseLike(endpointUrl)) {
|
|
4698
|
+
promises[_DYN_PUSH$2 ](endpointUrl);
|
|
4699
|
+
_endpoint = null;
|
|
4700
|
+
}
|
|
4701
|
+
else {
|
|
4702
|
+
_endpoint = endpointUrl;
|
|
4703
|
+
}
|
|
4704
|
+
if (promises[_DYN_LENGTH$2 ]) {
|
|
4705
|
+
_isStatusSet = false;
|
|
4706
|
+
_activeStatus = 3 ;
|
|
4707
|
+
var initTimeout = isNotNullOrUndefined(rootCfg.initTimeOut) ? rootCfg.initTimeOut : maxInitTimeout;
|
|
4708
|
+
var allPromises = createAllSettledPromise(promises);
|
|
4709
|
+
scheduleTimeout(function () {
|
|
4710
|
+
if (!_isStatusSet) {
|
|
4711
|
+
_setStatus();
|
|
4712
|
+
}
|
|
4713
|
+
}, initTimeout);
|
|
4714
|
+
doAwaitResponse(allPromises, function (response) {
|
|
4715
|
+
try {
|
|
4716
|
+
if (_isStatusSet) {
|
|
4717
|
+
return;
|
|
4718
|
+
}
|
|
4719
|
+
if (!response.rejected) {
|
|
4720
|
+
var values = response[_DYN_VALUE ];
|
|
4721
|
+
if (values && values[_DYN_LENGTH$2 ]) {
|
|
4722
|
+
var ikeyRes = values[0];
|
|
4723
|
+
_instrumentationKey = ikeyRes && ikeyRes[_DYN_VALUE ];
|
|
4724
|
+
if (values[_DYN_LENGTH$2 ] > 1) {
|
|
4725
|
+
var endpointRes = values[1];
|
|
4726
|
+
_endpoint = endpointRes && endpointRes[_DYN_VALUE ];
|
|
4727
|
+
}
|
|
4728
|
+
}
|
|
4729
|
+
if (_instrumentationKey) {
|
|
4730
|
+
config[_DYN_INSTRUMENTATION_KEY$2 ] = _instrumentationKey;
|
|
4731
|
+
config.endpointUrl = _endpoint;
|
|
4732
|
+
}
|
|
4733
|
+
}
|
|
4734
|
+
_setStatus();
|
|
4735
|
+
}
|
|
4736
|
+
catch (e) {
|
|
4737
|
+
if (!_isStatusSet) {
|
|
4738
|
+
_setStatus();
|
|
4739
|
+
}
|
|
4740
|
+
}
|
|
4741
|
+
});
|
|
4742
|
+
}
|
|
4743
|
+
else {
|
|
4744
|
+
_setStatus();
|
|
4745
|
+
}
|
|
4588
4746
|
var extCfg = details.ref(details.cfg, STR_EXTENSION_CONFIG);
|
|
4589
4747
|
objForEachKey(extCfg, function (key) {
|
|
4590
4748
|
details.ref(extCfg, key);
|
|
4591
4749
|
});
|
|
4592
|
-
if (isNullOrUndefined(_instrumentationKey)) {
|
|
4593
|
-
throwError("Please provide instrumentation key");
|
|
4594
|
-
}
|
|
4595
4750
|
}));
|
|
4596
4751
|
_notificationManager = notificationManager;
|
|
4597
4752
|
_debugListener = _initDebugListener(_configHandler, _hookContainer, _notificationManager && _self[_DYN_GET_NOTIFY_MGR ](), _debugListener);
|
|
@@ -4614,8 +4769,9 @@
|
|
|
4614
4769
|
_registerDelayedCfgListener(config, _cfgListeners, _logger);
|
|
4615
4770
|
_cfgListeners = null;
|
|
4616
4771
|
_isInitialized = true;
|
|
4617
|
-
|
|
4618
|
-
|
|
4772
|
+
if (_activeStatus === ActiveStatus.ACTIVE) {
|
|
4773
|
+
_releaseQueues();
|
|
4774
|
+
}
|
|
4619
4775
|
};
|
|
4620
4776
|
_self.getChannels = function () {
|
|
4621
4777
|
var controls = [];
|
|
@@ -4636,14 +4792,16 @@
|
|
|
4636
4792
|
_notifyInvalidEvent(telemetryItem);
|
|
4637
4793
|
throwError("telemetry name required");
|
|
4638
4794
|
}
|
|
4639
|
-
telemetryItem
|
|
4795
|
+
telemetryItem[_DYN_I_KEY ] = telemetryItem[_DYN_I_KEY ] || _instrumentationKey;
|
|
4640
4796
|
telemetryItem[_DYN_TIME ] = telemetryItem[_DYN_TIME ] || toISOString(new Date());
|
|
4641
4797
|
telemetryItem.ver = telemetryItem.ver || "4.0";
|
|
4642
|
-
if (!_isUnloading && _self[_DYN_IS_INITIALIZED ]()) {
|
|
4798
|
+
if (!_isUnloading && _self[_DYN_IS_INITIALIZED ]() && _activeStatus === ActiveStatus.ACTIVE) {
|
|
4643
4799
|
_createTelCtx()[_DYN_PROCESS_NEXT ](telemetryItem);
|
|
4644
4800
|
}
|
|
4645
|
-
else {
|
|
4646
|
-
_eventQueue[
|
|
4801
|
+
else if (_activeStatus !== ActiveStatus[_DYN__INACTIVE ]) {
|
|
4802
|
+
if (_eventQueue[_DYN_LENGTH$2 ] <= _initInMemoMaxSize) {
|
|
4803
|
+
_eventQueue[_DYN_PUSH$2 ](telemetryItem);
|
|
4804
|
+
}
|
|
4647
4805
|
}
|
|
4648
4806
|
}, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync));
|
|
4649
4807
|
};
|
|
@@ -4688,9 +4846,15 @@
|
|
|
4688
4846
|
if (_isInitialized && _eventQueue[_DYN_LENGTH$2 ] > 0) {
|
|
4689
4847
|
var eventQueue = _eventQueue;
|
|
4690
4848
|
_eventQueue = [];
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4849
|
+
if (_activeStatus === 2 ) {
|
|
4850
|
+
arrForEach(eventQueue, function (event) {
|
|
4851
|
+
event[_DYN_I_KEY ] = event[_DYN_I_KEY ] || _instrumentationKey;
|
|
4852
|
+
_createTelCtx()[_DYN_PROCESS_NEXT ](event);
|
|
4853
|
+
});
|
|
4854
|
+
}
|
|
4855
|
+
else {
|
|
4856
|
+
_throwInternal(_logger, 2 , 20 , "core init status is not active");
|
|
4857
|
+
}
|
|
4694
4858
|
}
|
|
4695
4859
|
};
|
|
4696
4860
|
_self[_DYN_POLL_INTERNAL_LOGS ] = function (eventName) {
|
|
@@ -4699,6 +4863,23 @@
|
|
|
4699
4863
|
_internalLogPoller && _internalLogPoller[_DYN_CANCEL ]();
|
|
4700
4864
|
return _startLogPoller(true);
|
|
4701
4865
|
};
|
|
4866
|
+
function _setStatus() {
|
|
4867
|
+
_isStatusSet = true;
|
|
4868
|
+
if (isNullOrUndefined(_instrumentationKey)) {
|
|
4869
|
+
_activeStatus = ActiveStatus[_DYN__INACTIVE ];
|
|
4870
|
+
_throwInternal(_logger, 1 , 112 , "ikey can't be resolved from promises");
|
|
4871
|
+
}
|
|
4872
|
+
else {
|
|
4873
|
+
_activeStatus = ActiveStatus.ACTIVE;
|
|
4874
|
+
}
|
|
4875
|
+
_releaseQueues();
|
|
4876
|
+
}
|
|
4877
|
+
function _releaseQueues() {
|
|
4878
|
+
if (_isInitialized) {
|
|
4879
|
+
_self.releaseQueue();
|
|
4880
|
+
_self[_DYN_POLL_INTERNAL_LOGS ]();
|
|
4881
|
+
}
|
|
4882
|
+
}
|
|
4702
4883
|
function _startLogPoller(alwaysStart) {
|
|
4703
4884
|
if ((!_internalLogPoller || !_internalLogPoller[_DYN_ENABLED ]) && !_forceStopInternalLogPoller) {
|
|
4704
4885
|
var shouldStart = alwaysStart || (_logger && _logger.queue[_DYN_LENGTH$2 ] > 0);
|
|
@@ -4972,6 +5153,10 @@
|
|
|
4972
5153
|
_forceStopInternalLogPoller = false;
|
|
4973
5154
|
_internalLogPoller = null;
|
|
4974
5155
|
_internalLogPollerListening = false;
|
|
5156
|
+
_activeStatus = 0 ;
|
|
5157
|
+
_endpoint = null;
|
|
5158
|
+
_initInMemoMaxSize = null;
|
|
5159
|
+
_isStatusSet = false;
|
|
4975
5160
|
}
|
|
4976
5161
|
function _createTelCtx() {
|
|
4977
5162
|
var theCtx = createProcessTelemetryContext(_getPluginChain(), _configHandler.cfg, _self);
|
|
@@ -5114,7 +5299,7 @@
|
|
|
5114
5299
|
var _a;
|
|
5115
5300
|
var item = (_a = {},
|
|
5116
5301
|
_a[_DYN_NAME$2 ] = _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage[_DYN_MESSAGE_ID ],
|
|
5117
|
-
_a
|
|
5302
|
+
_a[_DYN_I_KEY ] = _instrumentationKey,
|
|
5118
5303
|
_a[_DYN_TIME ] = toISOString(new Date()),
|
|
5119
5304
|
_a.baseType = _InternalLogMessage.dataType,
|
|
5120
5305
|
_a.baseData = { message: logMessage[_DYN_MESSAGE$1 ] },
|
|
@@ -5550,7 +5735,7 @@
|
|
|
5550
5735
|
if (!responseHandled) {
|
|
5551
5736
|
responseHandled = true;
|
|
5552
5737
|
if (!result.rejected) {
|
|
5553
|
-
var response_1 = result
|
|
5738
|
+
var response_1 = result[_DYN_VALUE ];
|
|
5554
5739
|
try {
|
|
5555
5740
|
if (!_isOneDs && !response_1.ok) {
|
|
5556
5741
|
_handleError(response_1.statusText);
|
|
@@ -5563,7 +5748,7 @@
|
|
|
5563
5748
|
}
|
|
5564
5749
|
else {
|
|
5565
5750
|
doAwaitResponse(response_1.text(), function (resp) {
|
|
5566
|
-
_onFetchComplete(response_1, payload, resp
|
|
5751
|
+
_onFetchComplete(response_1, payload, resp[_DYN_VALUE ]);
|
|
5567
5752
|
resolveFunc && resolveFunc(true);
|
|
5568
5753
|
});
|
|
5569
5754
|
}
|
|
@@ -5869,7 +6054,7 @@
|
|
|
5869
6054
|
var _DYN_SPLIT = "split";
|
|
5870
6055
|
var _DYN_LENGTH$1 = "length";
|
|
5871
6056
|
var _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
5872
|
-
var _DYN_INGESTIONENDPOINT = "ingestionendpoint";
|
|
6057
|
+
var _DYN_INGESTIONENDPOINT$1 = "ingestionendpoint";
|
|
5873
6058
|
var _DYN_TO_STRING$1 = "toString";
|
|
5874
6059
|
var _DYN_PUSH$1 = "push";
|
|
5875
6060
|
var _DYN_REMOVE_ITEM = "removeItem";
|
|
@@ -6202,11 +6387,11 @@
|
|
|
6202
6387
|
if (objKeys(result)[_DYN_LENGTH$1 ] > 0) {
|
|
6203
6388
|
if (result.endpointsuffix) {
|
|
6204
6389
|
var locationPrefix = result.location ? result.location + "." : "";
|
|
6205
|
-
result[_DYN_INGESTIONENDPOINT ] = result[_DYN_INGESTIONENDPOINT ] || ("https://" + locationPrefix + "dc." + result.endpointsuffix);
|
|
6390
|
+
result[_DYN_INGESTIONENDPOINT$1 ] = result[_DYN_INGESTIONENDPOINT$1 ] || ("https://" + locationPrefix + "dc." + result.endpointsuffix);
|
|
6206
6391
|
}
|
|
6207
|
-
result[_DYN_INGESTIONENDPOINT ] = result[_DYN_INGESTIONENDPOINT ] || DEFAULT_BREEZE_ENDPOINT;
|
|
6208
|
-
if (strEndsWith(result[_DYN_INGESTIONENDPOINT ], "/")) {
|
|
6209
|
-
result[_DYN_INGESTIONENDPOINT ] = result[_DYN_INGESTIONENDPOINT ].slice(0, -1);
|
|
6392
|
+
result[_DYN_INGESTIONENDPOINT$1 ] = result[_DYN_INGESTIONENDPOINT$1 ] || DEFAULT_BREEZE_ENDPOINT;
|
|
6393
|
+
if (strEndsWith(result[_DYN_INGESTIONENDPOINT$1 ], "/")) {
|
|
6394
|
+
result[_DYN_INGESTIONENDPOINT$1 ] = result[_DYN_INGESTIONENDPOINT$1 ].slice(0, -1);
|
|
6210
6395
|
}
|
|
6211
6396
|
}
|
|
6212
6397
|
return result;
|
|
@@ -7313,7 +7498,7 @@
|
|
|
7313
7498
|
}
|
|
7314
7499
|
}
|
|
7315
7500
|
var EnvelopeCreator = {
|
|
7316
|
-
Version: '3.3.0-nightly3.2406-
|
|
7501
|
+
Version: '3.3.0-nightly3.2406-09'
|
|
7317
7502
|
};
|
|
7318
7503
|
function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
|
|
7319
7504
|
EnvelopeCreatorInit(logger, telemetryItem);
|
|
@@ -8115,6 +8300,12 @@
|
|
|
8115
8300
|
return senderConfig;
|
|
8116
8301
|
}
|
|
8117
8302
|
});
|
|
8303
|
+
if (core.activeStatus() === ActiveStatus.PENDING) {
|
|
8304
|
+
_self.pause();
|
|
8305
|
+
}
|
|
8306
|
+
else if (core.activeStatus() === ActiveStatus.ACTIVE) {
|
|
8307
|
+
_self.resume();
|
|
8308
|
+
}
|
|
8118
8309
|
if (_orgEndpointUrl !== senderConfig.endpointUrl) {
|
|
8119
8310
|
_endpointUrl = _orgEndpointUrl = senderConfig.endpointUrl;
|
|
8120
8311
|
}
|
|
@@ -8163,7 +8354,7 @@
|
|
|
8163
8354
|
_throwInternal(diagLog, 1 , 100 , "Invalid Instrumentation key " + _instrumentationKey);
|
|
8164
8355
|
}
|
|
8165
8356
|
_customHeaders = senderConfig[_DYN_CUSTOM_HEADERS ];
|
|
8166
|
-
if (!isInternalApplicationInsightsEndpoint(_endpointUrl) && _customHeaders && _customHeaders[_DYN_LENGTH ] > 0) {
|
|
8357
|
+
if (isString(_endpointUrl) && !isInternalApplicationInsightsEndpoint(_endpointUrl) && _customHeaders && _customHeaders[_DYN_LENGTH ] > 0) {
|
|
8167
8358
|
arrForEach(_customHeaders, function (customHeader) {
|
|
8168
8359
|
_this.addHeader(customHeader.header, customHeader.value);
|
|
8169
8360
|
});
|
|
@@ -8878,8 +9069,10 @@
|
|
|
8878
9069
|
|
|
8879
9070
|
var _DYN_INSTRUMENTATION_KEY = "instrumentationKey";
|
|
8880
9071
|
var _DYN_CONNECTION_STRING = "connectionString";
|
|
9072
|
+
var _DYN_INSTRUMENTATIONKEY0 = "instrumentationkey";
|
|
8881
9073
|
var _DYN_ENDPOINT_URL = "endpointUrl";
|
|
8882
|
-
var
|
|
9074
|
+
var _DYN_INGESTIONENDPOINT = "ingestionendpoint";
|
|
9075
|
+
var _DYN_USER_OVERRIDE_ENDPOI1 = "userOverrideEndpointUrl";
|
|
8883
9076
|
|
|
8884
9077
|
var defaultConfigValues = {
|
|
8885
9078
|
diagnosticLogInterval: cfgDfValidate(_chkDiagLevel, 10000)
|
|
@@ -8917,13 +9110,42 @@
|
|
|
8917
9110
|
var cfgHandler = createDynamicConfig(config || {}, defaultConfigValues);
|
|
8918
9111
|
_config = cfgHandler.cfg;
|
|
8919
9112
|
core.addUnloadHook(onConfigChange(cfgHandler, function () {
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
var
|
|
8923
|
-
|
|
8924
|
-
|
|
9113
|
+
var configCs = _config[_DYN_CONNECTION_STRING ];
|
|
9114
|
+
if (isPromiseLike(configCs)) {
|
|
9115
|
+
var ikeyPromise = createAsyncPromise(function (resolve, reject) {
|
|
9116
|
+
doAwaitResponse(configCs, function (res) {
|
|
9117
|
+
var curCs = res.value;
|
|
9118
|
+
var ikey = _config[_DYN_INSTRUMENTATION_KEY ];
|
|
9119
|
+
if (!res.rejected && curCs) {
|
|
9120
|
+
_config[_DYN_CONNECTION_STRING ] = curCs;
|
|
9121
|
+
var resolvedCs = parseConnectionString(curCs);
|
|
9122
|
+
ikey = resolvedCs[_DYN_INSTRUMENTATIONKEY0 ] || ikey;
|
|
9123
|
+
}
|
|
9124
|
+
resolve(ikey);
|
|
9125
|
+
});
|
|
9126
|
+
});
|
|
9127
|
+
var urlPromise = createAsyncPromise(function (resolve, reject) {
|
|
9128
|
+
doAwaitResponse(configCs, function (res) {
|
|
9129
|
+
var curCs = res.value;
|
|
9130
|
+
var url = _config[_DYN_ENDPOINT_URL ];
|
|
9131
|
+
if (!res.rejected && curCs) {
|
|
9132
|
+
var resolvedCs = parseConnectionString(curCs);
|
|
9133
|
+
var ingest = resolvedCs[_DYN_INGESTIONENDPOINT ];
|
|
9134
|
+
url = ingest ? ingest + DEFAULT_BREEZE_PATH : url;
|
|
9135
|
+
}
|
|
9136
|
+
resolve(url);
|
|
9137
|
+
});
|
|
9138
|
+
});
|
|
9139
|
+
_config[_DYN_INSTRUMENTATION_KEY ] = ikeyPromise;
|
|
9140
|
+
_config[_DYN_ENDPOINT_URL ] = _config[_DYN_USER_OVERRIDE_ENDPOI1 ] || urlPromise;
|
|
9141
|
+
}
|
|
9142
|
+
if (isString(configCs)) {
|
|
9143
|
+
var cs = parseConnectionString(configCs);
|
|
9144
|
+
var ingest = cs[_DYN_INGESTIONENDPOINT ];
|
|
9145
|
+
_config[_DYN_ENDPOINT_URL ] = _config[_DYN_USER_OVERRIDE_ENDPOI1 ] ? _config[_DYN_USER_OVERRIDE_ENDPOI1 ] : (ingest + DEFAULT_BREEZE_PATH);
|
|
9146
|
+
_config[_DYN_INSTRUMENTATION_KEY ] = cs[_DYN_INSTRUMENTATIONKEY0 ] || _config[_DYN_INSTRUMENTATION_KEY ];
|
|
8925
9147
|
}
|
|
8926
|
-
_config[_DYN_ENDPOINT_URL ] = _config[
|
|
9148
|
+
_config[_DYN_ENDPOINT_URL ] = _config[_DYN_USER_OVERRIDE_ENDPOI1 ] ? _config[_DYN_USER_OVERRIDE_ENDPOI1 ] : _config[_DYN_ENDPOINT_URL ];
|
|
8927
9149
|
}));
|
|
8928
9150
|
core.initialize(_config, [new Sender()]);
|
|
8929
9151
|
}
|