@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,11 +1,11 @@
|
|
|
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
|
'use strict';
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
/*! https://github.com/nevware21/ts-utils v0.11.
|
|
8
|
+
/*! https://github.com/nevware21/ts-utils v0.11.3 */
|
|
9
9
|
/*#__NO_SIDE_EFFECTS__*/
|
|
10
10
|
function _pureAssign(func1, func2) {
|
|
11
11
|
return func1 || func2;
|
|
@@ -134,14 +134,52 @@ function objForEachKey(theObject, callbackfn, thisArg) {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
+
var propMap = {
|
|
138
|
+
e: "enumerable",
|
|
139
|
+
c: "configurable",
|
|
140
|
+
v: "value",
|
|
141
|
+
w: "writable",
|
|
142
|
+
g: "get",
|
|
143
|
+
s: "set"
|
|
144
|
+
};
|
|
145
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
146
|
+
function _createProp(value) {
|
|
147
|
+
var prop = {};
|
|
148
|
+
prop[propMap["c"]] = true;
|
|
149
|
+
prop[propMap["e"]] = true;
|
|
150
|
+
if (value.l) {
|
|
151
|
+
prop.get = function () { return value.l.v; };
|
|
152
|
+
var desc = objGetOwnPropertyDescriptor(value.l, "v");
|
|
153
|
+
if (desc && desc.set) {
|
|
154
|
+
prop.set = function (newValue) {
|
|
155
|
+
value.l.v = newValue;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
objForEachKey(value, function (key, value) {
|
|
160
|
+
prop[propMap[key]] = isUndefined(value) ? prop[propMap[key]] : value;
|
|
161
|
+
});
|
|
162
|
+
return prop;
|
|
163
|
+
}
|
|
164
|
+
var objDefineProp = ( /*#__PURE__*/_pureRef(ObjClass$1, "defineProperty"));
|
|
165
|
+
function objDefine(target, key, propDesc) {
|
|
166
|
+
return objDefineProp(target, key, _createProp(propDesc));
|
|
167
|
+
}
|
|
137
168
|
/*#__NO_SIDE_EFFECTS__*/
|
|
138
|
-
function _createKeyValueMap(values, keyType, valueType, completeFn) {
|
|
169
|
+
function _createKeyValueMap(values, keyType, valueType, completeFn, writable) {
|
|
139
170
|
var theMap = {};
|
|
140
171
|
objForEachKey(values, function (key, value) {
|
|
141
|
-
theMap
|
|
142
|
-
theMap
|
|
172
|
+
_assignMapValue(theMap, key, keyType ? value : key, writable);
|
|
173
|
+
_assignMapValue(theMap, value, valueType ? value : key, writable);
|
|
174
|
+
});
|
|
175
|
+
return completeFn ? completeFn(theMap) : theMap;
|
|
176
|
+
}
|
|
177
|
+
function _assignMapValue(theMap, key, value, writable) {
|
|
178
|
+
objDefineProp(theMap, key, {
|
|
179
|
+
value: value,
|
|
180
|
+
enumerable: true,
|
|
181
|
+
writable: !!writable
|
|
143
182
|
});
|
|
144
|
-
return completeFn(theMap);
|
|
145
183
|
}
|
|
146
184
|
var asString = ( /* #__PURE__ */_pureAssign(StrCls));
|
|
147
185
|
var ERROR_TYPE = "[object Error]";
|
|
@@ -181,7 +219,7 @@ function objDeepFreeze(value) {
|
|
|
181
219
|
if (_objFreeze) {
|
|
182
220
|
objForEachKey(value, function (key, value) {
|
|
183
221
|
if (isArray(value) || isObject(value)) {
|
|
184
|
-
|
|
222
|
+
objDeepFreeze(value);
|
|
185
223
|
}
|
|
186
224
|
});
|
|
187
225
|
}
|
|
@@ -191,20 +229,20 @@ var objFreeze = ( /* #__PURE__*/_pureAssign(_objFreeze, _doNothing));
|
|
|
191
229
|
var objGetPrototypeOf = ( /* #__PURE__*/_pureAssign(( /* #__PURE__*/_pureRef(ObjClass$1, "getPrototypeOf")), _getProto));
|
|
192
230
|
/*#__NO_SIDE_EFFECTS__*/
|
|
193
231
|
function createEnum(values) {
|
|
194
|
-
return _createKeyValueMap(values, 1 , 0 ,
|
|
232
|
+
return _createKeyValueMap(values, 1 , 0 , objFreeze);
|
|
195
233
|
}
|
|
196
234
|
/*#__NO_SIDE_EFFECTS__*/
|
|
197
235
|
function createEnumKeyMap(values) {
|
|
198
|
-
return _createKeyValueMap(values, 0 , 0 ,
|
|
236
|
+
return _createKeyValueMap(values, 0 , 0 , objFreeze);
|
|
199
237
|
}
|
|
200
238
|
/*#__NO_SIDE_EFFECTS__*/
|
|
201
239
|
function createSimpleMap(values) {
|
|
202
240
|
var mapClass = {};
|
|
203
241
|
objForEachKey(values, function (key, value) {
|
|
204
|
-
mapClass
|
|
205
|
-
mapClass
|
|
242
|
+
_assignMapValue(mapClass, key, value[1]);
|
|
243
|
+
_assignMapValue(mapClass, value[0], value[1]);
|
|
206
244
|
});
|
|
207
|
-
return
|
|
245
|
+
return objFreeze(mapClass);
|
|
208
246
|
}
|
|
209
247
|
/*#__NO_SIDE_EFFECTS__*/
|
|
210
248
|
function createTypeMap(values) {
|
|
@@ -338,37 +376,6 @@ function polyGetKnownSymbol(name) {
|
|
|
338
376
|
}
|
|
339
377
|
return result;
|
|
340
378
|
}
|
|
341
|
-
var propMap = {
|
|
342
|
-
e: "enumerable",
|
|
343
|
-
c: "configurable",
|
|
344
|
-
v: "value",
|
|
345
|
-
w: "writable",
|
|
346
|
-
g: "get",
|
|
347
|
-
s: "set"
|
|
348
|
-
};
|
|
349
|
-
/*#__NO_SIDE_EFFECTS__*/
|
|
350
|
-
function _createProp(value) {
|
|
351
|
-
var prop = {};
|
|
352
|
-
prop[propMap["c"]] = true;
|
|
353
|
-
prop[propMap["e"]] = true;
|
|
354
|
-
if (value.l) {
|
|
355
|
-
prop.get = function () { return value.l.v; };
|
|
356
|
-
var desc = objGetOwnPropertyDescriptor(value.l, "v");
|
|
357
|
-
if (desc && desc.set) {
|
|
358
|
-
prop.set = function (newValue) {
|
|
359
|
-
value.l.v = newValue;
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
objForEachKey(value, function (key, value) {
|
|
364
|
-
prop[propMap[key]] = isUndefined(value) ? prop[propMap[key]] : value;
|
|
365
|
-
});
|
|
366
|
-
return prop;
|
|
367
|
-
}
|
|
368
|
-
var objDefineProp = ( /*#__PURE__*/_pureRef(ObjClass$1, "defineProperty"));
|
|
369
|
-
function objDefine(target, key, propDesc) {
|
|
370
|
-
return objDefineProp(target, key, _createProp(propDesc));
|
|
371
|
-
}
|
|
372
379
|
var _globalLazyTestHooks;
|
|
373
380
|
function _initTestHooks() {
|
|
374
381
|
_globalLazyTestHooks = _getGlobalConfig();
|
|
@@ -1237,6 +1244,13 @@ function __spreadArrayFn(to, from) {
|
|
|
1237
1244
|
var createEnumStyle = createEnum;
|
|
1238
1245
|
var createValueMap = createTypeMap;
|
|
1239
1246
|
|
|
1247
|
+
var ActiveStatus = createEnumStyle({
|
|
1248
|
+
NONE: 0 ,
|
|
1249
|
+
PENDING: 3 ,
|
|
1250
|
+
INACTIVE: 1 ,
|
|
1251
|
+
ACTIVE: 2
|
|
1252
|
+
});
|
|
1253
|
+
|
|
1240
1254
|
var _DYN_TO_LOWER_CASE$1 = "toLowerCase";
|
|
1241
1255
|
var _DYN_BLK_VAL = "blkVal";
|
|
1242
1256
|
var _DYN_LENGTH$2 = "length";
|
|
@@ -1257,13 +1271,17 @@ var _DYN_IDENTIFIER = "identifier";
|
|
|
1257
1271
|
var _DYN_REMOVE_NOTIFICATION_0 = "removeNotificationListener";
|
|
1258
1272
|
var _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener";
|
|
1259
1273
|
var _DYN_IS_INITIALIZED = "isInitialized";
|
|
1274
|
+
var _DYN_INSTRUMENTATION_KEY$2 = "instrumentationKey";
|
|
1275
|
+
var _DYN__INACTIVE = "INACTIVE";
|
|
1276
|
+
var _DYN_VALUE = "value";
|
|
1260
1277
|
var _DYN_GET_NOTIFY_MGR = "getNotifyMgr";
|
|
1261
1278
|
var _DYN_GET_PLUGIN = "getPlugin";
|
|
1262
|
-
var _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs";
|
|
1263
1279
|
var _DYN_NAME$2 = "name";
|
|
1280
|
+
var _DYN_I_KEY = "iKey";
|
|
1264
1281
|
var _DYN_TIME = "time";
|
|
1265
1282
|
var _DYN_PROCESS_NEXT = "processNext";
|
|
1266
1283
|
var _DYN_GET_PROCESS_TEL_CONT2 = "getProcessTelContext";
|
|
1284
|
+
var _DYN_POLL_INTERNAL_LOGS = "pollInternalLogs";
|
|
1267
1285
|
var _DYN_ENABLED = "enabled";
|
|
1268
1286
|
var _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs";
|
|
1269
1287
|
var _DYN_UNLOAD = "unload";
|
|
@@ -1613,6 +1631,54 @@ function _createAllPromise(newPromise) {
|
|
|
1613
1631
|
}, additionalArgs);
|
|
1614
1632
|
};
|
|
1615
1633
|
}
|
|
1634
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
1635
|
+
function _createAllSettledPromise(newPromise) {
|
|
1636
|
+
return createCachedValue(function (input) {
|
|
1637
|
+
var additionalArgs = arrSlice(arguments, 1);
|
|
1638
|
+
return newPromise(function (resolve, reject) {
|
|
1639
|
+
var values = [];
|
|
1640
|
+
var pending = 1;
|
|
1641
|
+
function processItem(item, idx) {
|
|
1642
|
+
pending++;
|
|
1643
|
+
doAwaitResponse(item, function (value) {
|
|
1644
|
+
if (value.rejected) {
|
|
1645
|
+
values[idx] = {
|
|
1646
|
+
status: REJECTED,
|
|
1647
|
+
reason: value.reason
|
|
1648
|
+
};
|
|
1649
|
+
}
|
|
1650
|
+
else {
|
|
1651
|
+
values[idx] = {
|
|
1652
|
+
status: "fulfilled",
|
|
1653
|
+
value: value.value
|
|
1654
|
+
};
|
|
1655
|
+
}
|
|
1656
|
+
if (--pending === 0) {
|
|
1657
|
+
resolve(values);
|
|
1658
|
+
}
|
|
1659
|
+
});
|
|
1660
|
+
}
|
|
1661
|
+
try {
|
|
1662
|
+
if (isArray(input)) {
|
|
1663
|
+
arrForEach(input, processItem);
|
|
1664
|
+
}
|
|
1665
|
+
else if (isIterable(input)) {
|
|
1666
|
+
iterForOf(input, processItem);
|
|
1667
|
+
}
|
|
1668
|
+
else {
|
|
1669
|
+
throwTypeError("Input is not an iterable");
|
|
1670
|
+
}
|
|
1671
|
+
pending--;
|
|
1672
|
+
if (pending === 0) {
|
|
1673
|
+
resolve(values);
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
catch (e) {
|
|
1677
|
+
reject(e);
|
|
1678
|
+
}
|
|
1679
|
+
}, additionalArgs);
|
|
1680
|
+
});
|
|
1681
|
+
}
|
|
1616
1682
|
function syncItemProcessor(pending) {
|
|
1617
1683
|
arrForEach(pending, function (fn) {
|
|
1618
1684
|
try {
|
|
@@ -1664,11 +1730,16 @@ function createNativePromise(executor, timeout) {
|
|
|
1664
1730
|
return thePromise;
|
|
1665
1731
|
}
|
|
1666
1732
|
var _promiseCreator;
|
|
1733
|
+
var _allSettledCreator;
|
|
1667
1734
|
function createPromise(executor, timeout) {
|
|
1668
1735
|
!_promiseCreator && (_promiseCreator = createCachedValue(createNativePromise));
|
|
1669
1736
|
return _promiseCreator.v.call(this, executor, timeout);
|
|
1670
1737
|
}
|
|
1671
1738
|
var createAllPromise = /*#__PURE__*/ _createAllPromise(createPromise);
|
|
1739
|
+
function createAllSettledPromise(input, timeout) {
|
|
1740
|
+
!_allSettledCreator && (_allSettledCreator = _createAllSettledPromise(createPromise));
|
|
1741
|
+
return _allSettledCreator.v(input, timeout);
|
|
1742
|
+
}
|
|
1672
1743
|
|
|
1673
1744
|
var UNDEFINED_VALUE$1 = undefined;
|
|
1674
1745
|
var STR_EMPTY$1 = "";
|
|
@@ -2166,7 +2237,7 @@ function newId(maxLength) {
|
|
|
2166
2237
|
return result;
|
|
2167
2238
|
}
|
|
2168
2239
|
|
|
2169
|
-
var version = '3.3.0-nightly3.2406-
|
|
2240
|
+
var version = '3.3.0-nightly3.2406-09';
|
|
2170
2241
|
var instanceName = "." + newId(6);
|
|
2171
2242
|
var _dataUid = 0;
|
|
2172
2243
|
function _canAcceptData(target) {
|
|
@@ -4406,6 +4477,8 @@ var strValidationError = "Plugins must provide initialize method";
|
|
|
4406
4477
|
var strNotificationManager = "_notificationManager";
|
|
4407
4478
|
var strSdkUnloadingError = "SDK is still unloading...";
|
|
4408
4479
|
var strSdkNotInitialized = "SDK is not initialized";
|
|
4480
|
+
var maxInitQueueSize = 100;
|
|
4481
|
+
var maxInitTimeout = 50000;
|
|
4409
4482
|
var defaultConfig = objDeepFreeze((_a$1 = {
|
|
4410
4483
|
cookieCfg: {}
|
|
4411
4484
|
},
|
|
@@ -4562,15 +4635,23 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
4562
4635
|
var _extensions;
|
|
4563
4636
|
var _pluginVersionStringArr;
|
|
4564
4637
|
var _pluginVersionString;
|
|
4638
|
+
var _activeStatus;
|
|
4639
|
+
var _endpoint;
|
|
4640
|
+
var _initInMemoMaxSize;
|
|
4641
|
+
var _isStatusSet;
|
|
4565
4642
|
var _internalLogPoller;
|
|
4566
4643
|
var _internalLogPollerListening;
|
|
4567
4644
|
var _forceStopInternalLogPoller;
|
|
4568
4645
|
dynamicProto(AppInsightsCore, this, function (_self) {
|
|
4569
4646
|
_initDefaults();
|
|
4570
4647
|
_self["_getDbgPlgTargets"] = function () {
|
|
4571
|
-
return [_extensions];
|
|
4648
|
+
return [_extensions, _eventQueue];
|
|
4572
4649
|
};
|
|
4573
4650
|
_self[_DYN_IS_INITIALIZED ] = function () { return _isInitialized; };
|
|
4651
|
+
_self.activeStatus = function () { return _activeStatus; };
|
|
4652
|
+
_self._setPendingStatus = function () {
|
|
4653
|
+
_activeStatus = 3 ;
|
|
4654
|
+
};
|
|
4574
4655
|
_self[_DYN_INITIALIZE$1 ] = function (config, extensions, logger, notificationManager) {
|
|
4575
4656
|
if (_isUnloading) {
|
|
4576
4657
|
throwError(strSdkUnloadingError);
|
|
@@ -4581,14 +4662,88 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
4581
4662
|
_configHandler = createDynamicConfig(config, defaultConfig, logger || _self[_DYN_LOGGER ], false);
|
|
4582
4663
|
config = _configHandler.cfg;
|
|
4583
4664
|
_addUnloadHook(_configHandler[_DYN_WATCH ](function (details) {
|
|
4584
|
-
|
|
4665
|
+
var rootCfg = details.cfg;
|
|
4666
|
+
var isPending = _activeStatus === 3 ;
|
|
4667
|
+
if (isPending) {
|
|
4668
|
+
return;
|
|
4669
|
+
}
|
|
4670
|
+
_initInMemoMaxSize = rootCfg.initInMemoMaxSize || maxInitQueueSize;
|
|
4671
|
+
var ikey = rootCfg[_DYN_INSTRUMENTATION_KEY$2 ];
|
|
4672
|
+
var endpointUrl = rootCfg.endpointUrl;
|
|
4673
|
+
if (isNullOrUndefined(ikey)) {
|
|
4674
|
+
_instrumentationKey = null;
|
|
4675
|
+
_activeStatus = ActiveStatus[_DYN__INACTIVE ];
|
|
4676
|
+
var msg = "Please provide instrumentation key";
|
|
4677
|
+
if (!_isInitialized) {
|
|
4678
|
+
throwError(msg);
|
|
4679
|
+
}
|
|
4680
|
+
else {
|
|
4681
|
+
_throwInternal(_logger, 1 , 100 , msg);
|
|
4682
|
+
_releaseQueues();
|
|
4683
|
+
}
|
|
4684
|
+
return;
|
|
4685
|
+
}
|
|
4686
|
+
var promises = [];
|
|
4687
|
+
if (isPromiseLike(ikey)) {
|
|
4688
|
+
promises[_DYN_PUSH$2 ](ikey);
|
|
4689
|
+
_instrumentationKey = null;
|
|
4690
|
+
}
|
|
4691
|
+
else {
|
|
4692
|
+
_instrumentationKey = ikey;
|
|
4693
|
+
}
|
|
4694
|
+
if (isPromiseLike(endpointUrl)) {
|
|
4695
|
+
promises[_DYN_PUSH$2 ](endpointUrl);
|
|
4696
|
+
_endpoint = null;
|
|
4697
|
+
}
|
|
4698
|
+
else {
|
|
4699
|
+
_endpoint = endpointUrl;
|
|
4700
|
+
}
|
|
4701
|
+
if (promises[_DYN_LENGTH$2 ]) {
|
|
4702
|
+
_isStatusSet = false;
|
|
4703
|
+
_activeStatus = 3 ;
|
|
4704
|
+
var initTimeout = isNotNullOrUndefined(rootCfg.initTimeOut) ? rootCfg.initTimeOut : maxInitTimeout;
|
|
4705
|
+
var allPromises = createAllSettledPromise(promises);
|
|
4706
|
+
scheduleTimeout(function () {
|
|
4707
|
+
if (!_isStatusSet) {
|
|
4708
|
+
_setStatus();
|
|
4709
|
+
}
|
|
4710
|
+
}, initTimeout);
|
|
4711
|
+
doAwaitResponse(allPromises, function (response) {
|
|
4712
|
+
try {
|
|
4713
|
+
if (_isStatusSet) {
|
|
4714
|
+
return;
|
|
4715
|
+
}
|
|
4716
|
+
if (!response.rejected) {
|
|
4717
|
+
var values = response[_DYN_VALUE ];
|
|
4718
|
+
if (values && values[_DYN_LENGTH$2 ]) {
|
|
4719
|
+
var ikeyRes = values[0];
|
|
4720
|
+
_instrumentationKey = ikeyRes && ikeyRes[_DYN_VALUE ];
|
|
4721
|
+
if (values[_DYN_LENGTH$2 ] > 1) {
|
|
4722
|
+
var endpointRes = values[1];
|
|
4723
|
+
_endpoint = endpointRes && endpointRes[_DYN_VALUE ];
|
|
4724
|
+
}
|
|
4725
|
+
}
|
|
4726
|
+
if (_instrumentationKey) {
|
|
4727
|
+
config[_DYN_INSTRUMENTATION_KEY$2 ] = _instrumentationKey;
|
|
4728
|
+
config.endpointUrl = _endpoint;
|
|
4729
|
+
}
|
|
4730
|
+
}
|
|
4731
|
+
_setStatus();
|
|
4732
|
+
}
|
|
4733
|
+
catch (e) {
|
|
4734
|
+
if (!_isStatusSet) {
|
|
4735
|
+
_setStatus();
|
|
4736
|
+
}
|
|
4737
|
+
}
|
|
4738
|
+
});
|
|
4739
|
+
}
|
|
4740
|
+
else {
|
|
4741
|
+
_setStatus();
|
|
4742
|
+
}
|
|
4585
4743
|
var extCfg = details.ref(details.cfg, STR_EXTENSION_CONFIG);
|
|
4586
4744
|
objForEachKey(extCfg, function (key) {
|
|
4587
4745
|
details.ref(extCfg, key);
|
|
4588
4746
|
});
|
|
4589
|
-
if (isNullOrUndefined(_instrumentationKey)) {
|
|
4590
|
-
throwError("Please provide instrumentation key");
|
|
4591
|
-
}
|
|
4592
4747
|
}));
|
|
4593
4748
|
_notificationManager = notificationManager;
|
|
4594
4749
|
_debugListener = _initDebugListener(_configHandler, _hookContainer, _notificationManager && _self[_DYN_GET_NOTIFY_MGR ](), _debugListener);
|
|
@@ -4611,8 +4766,9 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
4611
4766
|
_registerDelayedCfgListener(config, _cfgListeners, _logger);
|
|
4612
4767
|
_cfgListeners = null;
|
|
4613
4768
|
_isInitialized = true;
|
|
4614
|
-
|
|
4615
|
-
|
|
4769
|
+
if (_activeStatus === ActiveStatus.ACTIVE) {
|
|
4770
|
+
_releaseQueues();
|
|
4771
|
+
}
|
|
4616
4772
|
};
|
|
4617
4773
|
_self.getChannels = function () {
|
|
4618
4774
|
var controls = [];
|
|
@@ -4633,14 +4789,16 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
4633
4789
|
_notifyInvalidEvent(telemetryItem);
|
|
4634
4790
|
throwError("telemetry name required");
|
|
4635
4791
|
}
|
|
4636
|
-
telemetryItem
|
|
4792
|
+
telemetryItem[_DYN_I_KEY ] = telemetryItem[_DYN_I_KEY ] || _instrumentationKey;
|
|
4637
4793
|
telemetryItem[_DYN_TIME ] = telemetryItem[_DYN_TIME ] || toISOString(new Date());
|
|
4638
4794
|
telemetryItem.ver = telemetryItem.ver || "4.0";
|
|
4639
|
-
if (!_isUnloading && _self[_DYN_IS_INITIALIZED ]()) {
|
|
4795
|
+
if (!_isUnloading && _self[_DYN_IS_INITIALIZED ]() && _activeStatus === ActiveStatus.ACTIVE) {
|
|
4640
4796
|
_createTelCtx()[_DYN_PROCESS_NEXT ](telemetryItem);
|
|
4641
4797
|
}
|
|
4642
|
-
else {
|
|
4643
|
-
_eventQueue[
|
|
4798
|
+
else if (_activeStatus !== ActiveStatus[_DYN__INACTIVE ]) {
|
|
4799
|
+
if (_eventQueue[_DYN_LENGTH$2 ] <= _initInMemoMaxSize) {
|
|
4800
|
+
_eventQueue[_DYN_PUSH$2 ](telemetryItem);
|
|
4801
|
+
}
|
|
4644
4802
|
}
|
|
4645
4803
|
}, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync));
|
|
4646
4804
|
};
|
|
@@ -4685,9 +4843,15 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
4685
4843
|
if (_isInitialized && _eventQueue[_DYN_LENGTH$2 ] > 0) {
|
|
4686
4844
|
var eventQueue = _eventQueue;
|
|
4687
4845
|
_eventQueue = [];
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4846
|
+
if (_activeStatus === 2 ) {
|
|
4847
|
+
arrForEach(eventQueue, function (event) {
|
|
4848
|
+
event[_DYN_I_KEY ] = event[_DYN_I_KEY ] || _instrumentationKey;
|
|
4849
|
+
_createTelCtx()[_DYN_PROCESS_NEXT ](event);
|
|
4850
|
+
});
|
|
4851
|
+
}
|
|
4852
|
+
else {
|
|
4853
|
+
_throwInternal(_logger, 2 , 20 , "core init status is not active");
|
|
4854
|
+
}
|
|
4691
4855
|
}
|
|
4692
4856
|
};
|
|
4693
4857
|
_self[_DYN_POLL_INTERNAL_LOGS ] = function (eventName) {
|
|
@@ -4696,6 +4860,23 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
4696
4860
|
_internalLogPoller && _internalLogPoller[_DYN_CANCEL ]();
|
|
4697
4861
|
return _startLogPoller(true);
|
|
4698
4862
|
};
|
|
4863
|
+
function _setStatus() {
|
|
4864
|
+
_isStatusSet = true;
|
|
4865
|
+
if (isNullOrUndefined(_instrumentationKey)) {
|
|
4866
|
+
_activeStatus = ActiveStatus[_DYN__INACTIVE ];
|
|
4867
|
+
_throwInternal(_logger, 1 , 112 , "ikey can't be resolved from promises");
|
|
4868
|
+
}
|
|
4869
|
+
else {
|
|
4870
|
+
_activeStatus = ActiveStatus.ACTIVE;
|
|
4871
|
+
}
|
|
4872
|
+
_releaseQueues();
|
|
4873
|
+
}
|
|
4874
|
+
function _releaseQueues() {
|
|
4875
|
+
if (_isInitialized) {
|
|
4876
|
+
_self.releaseQueue();
|
|
4877
|
+
_self[_DYN_POLL_INTERNAL_LOGS ]();
|
|
4878
|
+
}
|
|
4879
|
+
}
|
|
4699
4880
|
function _startLogPoller(alwaysStart) {
|
|
4700
4881
|
if ((!_internalLogPoller || !_internalLogPoller[_DYN_ENABLED ]) && !_forceStopInternalLogPoller) {
|
|
4701
4882
|
var shouldStart = alwaysStart || (_logger && _logger.queue[_DYN_LENGTH$2 ] > 0);
|
|
@@ -4969,6 +5150,10 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
4969
5150
|
_forceStopInternalLogPoller = false;
|
|
4970
5151
|
_internalLogPoller = null;
|
|
4971
5152
|
_internalLogPollerListening = false;
|
|
5153
|
+
_activeStatus = 0 ;
|
|
5154
|
+
_endpoint = null;
|
|
5155
|
+
_initInMemoMaxSize = null;
|
|
5156
|
+
_isStatusSet = false;
|
|
4972
5157
|
}
|
|
4973
5158
|
function _createTelCtx() {
|
|
4974
5159
|
var theCtx = createProcessTelemetryContext(_getPluginChain(), _configHandler.cfg, _self);
|
|
@@ -5111,7 +5296,7 @@ var AppInsightsCore = /** @class */ (function () {
|
|
|
5111
5296
|
var _a;
|
|
5112
5297
|
var item = (_a = {},
|
|
5113
5298
|
_a[_DYN_NAME$2 ] = _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage[_DYN_MESSAGE_ID ],
|
|
5114
|
-
_a
|
|
5299
|
+
_a[_DYN_I_KEY ] = _instrumentationKey,
|
|
5115
5300
|
_a[_DYN_TIME ] = toISOString(new Date()),
|
|
5116
5301
|
_a.baseType = _InternalLogMessage.dataType,
|
|
5117
5302
|
_a.baseData = { message: logMessage[_DYN_MESSAGE$1 ] },
|
|
@@ -5547,7 +5732,7 @@ var SenderPostManager = /** @class */ (function () {
|
|
|
5547
5732
|
if (!responseHandled) {
|
|
5548
5733
|
responseHandled = true;
|
|
5549
5734
|
if (!result.rejected) {
|
|
5550
|
-
var response_1 = result
|
|
5735
|
+
var response_1 = result[_DYN_VALUE ];
|
|
5551
5736
|
try {
|
|
5552
5737
|
if (!_isOneDs && !response_1.ok) {
|
|
5553
5738
|
_handleError(response_1.statusText);
|
|
@@ -5560,7 +5745,7 @@ var SenderPostManager = /** @class */ (function () {
|
|
|
5560
5745
|
}
|
|
5561
5746
|
else {
|
|
5562
5747
|
doAwaitResponse(response_1.text(), function (resp) {
|
|
5563
|
-
_onFetchComplete(response_1, payload, resp
|
|
5748
|
+
_onFetchComplete(response_1, payload, resp[_DYN_VALUE ]);
|
|
5564
5749
|
resolveFunc && resolveFunc(true);
|
|
5565
5750
|
});
|
|
5566
5751
|
}
|
|
@@ -5866,7 +6051,7 @@ var RequestHeaders = createValueMap({
|
|
|
5866
6051
|
var _DYN_SPLIT = "split";
|
|
5867
6052
|
var _DYN_LENGTH$1 = "length";
|
|
5868
6053
|
var _DYN_TO_LOWER_CASE = "toLowerCase";
|
|
5869
|
-
var _DYN_INGESTIONENDPOINT = "ingestionendpoint";
|
|
6054
|
+
var _DYN_INGESTIONENDPOINT$1 = "ingestionendpoint";
|
|
5870
6055
|
var _DYN_TO_STRING$1 = "toString";
|
|
5871
6056
|
var _DYN_PUSH$1 = "push";
|
|
5872
6057
|
var _DYN_REMOVE_ITEM = "removeItem";
|
|
@@ -6199,11 +6384,11 @@ function parseConnectionString(connectionString) {
|
|
|
6199
6384
|
if (objKeys(result)[_DYN_LENGTH$1 ] > 0) {
|
|
6200
6385
|
if (result.endpointsuffix) {
|
|
6201
6386
|
var locationPrefix = result.location ? result.location + "." : "";
|
|
6202
|
-
result[_DYN_INGESTIONENDPOINT ] = result[_DYN_INGESTIONENDPOINT ] || ("https://" + locationPrefix + "dc." + result.endpointsuffix);
|
|
6387
|
+
result[_DYN_INGESTIONENDPOINT$1 ] = result[_DYN_INGESTIONENDPOINT$1 ] || ("https://" + locationPrefix + "dc." + result.endpointsuffix);
|
|
6203
6388
|
}
|
|
6204
|
-
result[_DYN_INGESTIONENDPOINT ] = result[_DYN_INGESTIONENDPOINT ] || DEFAULT_BREEZE_ENDPOINT;
|
|
6205
|
-
if (strEndsWith(result[_DYN_INGESTIONENDPOINT ], "/")) {
|
|
6206
|
-
result[_DYN_INGESTIONENDPOINT ] = result[_DYN_INGESTIONENDPOINT ].slice(0, -1);
|
|
6389
|
+
result[_DYN_INGESTIONENDPOINT$1 ] = result[_DYN_INGESTIONENDPOINT$1 ] || DEFAULT_BREEZE_ENDPOINT;
|
|
6390
|
+
if (strEndsWith(result[_DYN_INGESTIONENDPOINT$1 ], "/")) {
|
|
6391
|
+
result[_DYN_INGESTIONENDPOINT$1 ] = result[_DYN_INGESTIONENDPOINT$1 ].slice(0, -1);
|
|
6207
6392
|
}
|
|
6208
6393
|
}
|
|
6209
6394
|
return result;
|
|
@@ -7310,7 +7495,7 @@ function EnvelopeCreatorInit(logger, telemetryItem) {
|
|
|
7310
7495
|
}
|
|
7311
7496
|
}
|
|
7312
7497
|
var EnvelopeCreator = {
|
|
7313
|
-
Version: '3.3.0-nightly3.2406-
|
|
7498
|
+
Version: '3.3.0-nightly3.2406-09'
|
|
7314
7499
|
};
|
|
7315
7500
|
function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
|
|
7316
7501
|
EnvelopeCreatorInit(logger, telemetryItem);
|
|
@@ -8112,6 +8297,12 @@ var Sender = /** @class */ (function (_super) {
|
|
|
8112
8297
|
return senderConfig;
|
|
8113
8298
|
}
|
|
8114
8299
|
});
|
|
8300
|
+
if (core.activeStatus() === ActiveStatus.PENDING) {
|
|
8301
|
+
_self.pause();
|
|
8302
|
+
}
|
|
8303
|
+
else if (core.activeStatus() === ActiveStatus.ACTIVE) {
|
|
8304
|
+
_self.resume();
|
|
8305
|
+
}
|
|
8115
8306
|
if (_orgEndpointUrl !== senderConfig.endpointUrl) {
|
|
8116
8307
|
_endpointUrl = _orgEndpointUrl = senderConfig.endpointUrl;
|
|
8117
8308
|
}
|
|
@@ -8160,7 +8351,7 @@ var Sender = /** @class */ (function (_super) {
|
|
|
8160
8351
|
_throwInternal(diagLog, 1 , 100 , "Invalid Instrumentation key " + _instrumentationKey);
|
|
8161
8352
|
}
|
|
8162
8353
|
_customHeaders = senderConfig[_DYN_CUSTOM_HEADERS ];
|
|
8163
|
-
if (!isInternalApplicationInsightsEndpoint(_endpointUrl) && _customHeaders && _customHeaders[_DYN_LENGTH ] > 0) {
|
|
8354
|
+
if (isString(_endpointUrl) && !isInternalApplicationInsightsEndpoint(_endpointUrl) && _customHeaders && _customHeaders[_DYN_LENGTH ] > 0) {
|
|
8164
8355
|
arrForEach(_customHeaders, function (customHeader) {
|
|
8165
8356
|
_this.addHeader(customHeader.header, customHeader.value);
|
|
8166
8357
|
});
|
|
@@ -8875,8 +9066,10 @@ var Sender = /** @class */ (function (_super) {
|
|
|
8875
9066
|
|
|
8876
9067
|
var _DYN_INSTRUMENTATION_KEY = "instrumentationKey";
|
|
8877
9068
|
var _DYN_CONNECTION_STRING = "connectionString";
|
|
9069
|
+
var _DYN_INSTRUMENTATIONKEY0 = "instrumentationkey";
|
|
8878
9070
|
var _DYN_ENDPOINT_URL = "endpointUrl";
|
|
8879
|
-
var
|
|
9071
|
+
var _DYN_INGESTIONENDPOINT = "ingestionendpoint";
|
|
9072
|
+
var _DYN_USER_OVERRIDE_ENDPOI1 = "userOverrideEndpointUrl";
|
|
8880
9073
|
|
|
8881
9074
|
var defaultConfigValues = {
|
|
8882
9075
|
diagnosticLogInterval: cfgDfValidate(_chkDiagLevel, 10000)
|
|
@@ -8914,13 +9107,42 @@ var ApplicationInsights = /** @class */ (function () {
|
|
|
8914
9107
|
var cfgHandler = createDynamicConfig(config || {}, defaultConfigValues);
|
|
8915
9108
|
_config = cfgHandler.cfg;
|
|
8916
9109
|
core.addUnloadHook(onConfigChange(cfgHandler, function () {
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
var
|
|
8920
|
-
|
|
8921
|
-
|
|
9110
|
+
var configCs = _config[_DYN_CONNECTION_STRING ];
|
|
9111
|
+
if (isPromiseLike(configCs)) {
|
|
9112
|
+
var ikeyPromise = createAsyncPromise(function (resolve, reject) {
|
|
9113
|
+
doAwaitResponse(configCs, function (res) {
|
|
9114
|
+
var curCs = res.value;
|
|
9115
|
+
var ikey = _config[_DYN_INSTRUMENTATION_KEY ];
|
|
9116
|
+
if (!res.rejected && curCs) {
|
|
9117
|
+
_config[_DYN_CONNECTION_STRING ] = curCs;
|
|
9118
|
+
var resolvedCs = parseConnectionString(curCs);
|
|
9119
|
+
ikey = resolvedCs[_DYN_INSTRUMENTATIONKEY0 ] || ikey;
|
|
9120
|
+
}
|
|
9121
|
+
resolve(ikey);
|
|
9122
|
+
});
|
|
9123
|
+
});
|
|
9124
|
+
var urlPromise = createAsyncPromise(function (resolve, reject) {
|
|
9125
|
+
doAwaitResponse(configCs, function (res) {
|
|
9126
|
+
var curCs = res.value;
|
|
9127
|
+
var url = _config[_DYN_ENDPOINT_URL ];
|
|
9128
|
+
if (!res.rejected && curCs) {
|
|
9129
|
+
var resolvedCs = parseConnectionString(curCs);
|
|
9130
|
+
var ingest = resolvedCs[_DYN_INGESTIONENDPOINT ];
|
|
9131
|
+
url = ingest ? ingest + DEFAULT_BREEZE_PATH : url;
|
|
9132
|
+
}
|
|
9133
|
+
resolve(url);
|
|
9134
|
+
});
|
|
9135
|
+
});
|
|
9136
|
+
_config[_DYN_INSTRUMENTATION_KEY ] = ikeyPromise;
|
|
9137
|
+
_config[_DYN_ENDPOINT_URL ] = _config[_DYN_USER_OVERRIDE_ENDPOI1 ] || urlPromise;
|
|
9138
|
+
}
|
|
9139
|
+
if (isString(configCs)) {
|
|
9140
|
+
var cs = parseConnectionString(configCs);
|
|
9141
|
+
var ingest = cs[_DYN_INGESTIONENDPOINT ];
|
|
9142
|
+
_config[_DYN_ENDPOINT_URL ] = _config[_DYN_USER_OVERRIDE_ENDPOI1 ] ? _config[_DYN_USER_OVERRIDE_ENDPOI1 ] : (ingest + DEFAULT_BREEZE_PATH);
|
|
9143
|
+
_config[_DYN_INSTRUMENTATION_KEY ] = cs[_DYN_INSTRUMENTATIONKEY0 ] || _config[_DYN_INSTRUMENTATION_KEY ];
|
|
8922
9144
|
}
|
|
8923
|
-
_config[_DYN_ENDPOINT_URL ] = _config[
|
|
9145
|
+
_config[_DYN_ENDPOINT_URL ] = _config[_DYN_USER_OVERRIDE_ENDPOI1 ] ? _config[_DYN_USER_OVERRIDE_ENDPOI1 ] : _config[_DYN_ENDPOINT_URL ];
|
|
8924
9146
|
}));
|
|
8925
9147
|
core.initialize(_config, [new Sender()]);
|
|
8926
9148
|
}
|
|
@@ -8945,4 +9167,4 @@ exports.arrForEach = arrForEach;
|
|
|
8945
9167
|
exports.isNullOrUndefined = isNullOrUndefined;
|
|
8946
9168
|
exports.proxyFunctions = proxyFunctions;
|
|
8947
9169
|
exports.throwError = throwError;
|
|
8948
|
-
//# sourceMappingURL=aib.3.3.0-nightly3.2406-
|
|
9170
|
+
//# sourceMappingURL=aib.3.3.0-nightly3.2406-09.cjs.js.map
|