@microsoft/applicationinsights-channel-js 3.1.3-nightly3.240329-01 → 3.1.3-nightly3.240403-01

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.
Files changed (55) hide show
  1. package/browser/es5/{applicationinsights-channel-js.3.1.3-nightly3.240329-01.cjs.js → applicationinsights-channel-js.3.1.3-nightly3.240403-01.cjs.js} +73 -51
  2. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240403-01.cjs.js.map +1 -0
  3. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240403-01.cjs.min.js +6 -0
  4. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240403-01.cjs.min.js.map +1 -0
  5. package/browser/es5/{applicationinsights-channel-js.3.1.3-nightly3.240329-01.gbl.js → applicationinsights-channel-js.3.1.3-nightly3.240403-01.gbl.js} +75 -53
  6. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240403-01.gbl.js.map +1 -0
  7. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240403-01.gbl.min.js +6 -0
  8. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240403-01.gbl.min.js.map +1 -0
  9. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240403-01.integrity.json +66 -0
  10. package/browser/es5/{applicationinsights-channel-js.3.1.3-nightly3.240329-01.js → applicationinsights-channel-js.3.1.3-nightly3.240403-01.js} +75 -53
  11. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240403-01.js.map +1 -0
  12. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240403-01.min.js +6 -0
  13. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240403-01.min.js.map +1 -0
  14. package/browser/es5/applicationinsights-channel-js.3.cjs.js +72 -50
  15. package/browser/es5/applicationinsights-channel-js.3.cjs.js.map +1 -1
  16. package/browser/es5/applicationinsights-channel-js.3.cjs.min.js +2 -2
  17. package/browser/es5/applicationinsights-channel-js.3.cjs.min.js.map +1 -1
  18. package/browser/es5/applicationinsights-channel-js.3.gbl.js +74 -52
  19. package/browser/es5/applicationinsights-channel-js.3.gbl.js.map +1 -1
  20. package/browser/es5/applicationinsights-channel-js.3.gbl.min.js +2 -2
  21. package/browser/es5/applicationinsights-channel-js.3.gbl.min.js.map +1 -1
  22. package/browser/es5/applicationinsights-channel-js.3.integrity.json +25 -25
  23. package/browser/es5/applicationinsights-channel-js.3.js +74 -52
  24. package/browser/es5/applicationinsights-channel-js.3.js.map +1 -1
  25. package/browser/es5/applicationinsights-channel-js.3.min.js +2 -2
  26. package/browser/es5/applicationinsights-channel-js.3.min.js.map +1 -1
  27. package/dist/es5/applicationinsights-channel-js.js +72 -50
  28. package/dist/es5/applicationinsights-channel-js.js.map +1 -1
  29. package/dist/es5/applicationinsights-channel-js.min.js +2 -2
  30. package/dist/es5/applicationinsights-channel-js.min.js.map +1 -1
  31. package/dist-es5/EnvelopeCreator.js +3 -2
  32. package/dist-es5/EnvelopeCreator.js.map +1 -1
  33. package/dist-es5/Interfaces.js +1 -1
  34. package/dist-es5/InternalConstants.js +1 -1
  35. package/dist-es5/SendBuffer.js +1 -1
  36. package/dist-es5/Sender.js +1 -1
  37. package/dist-es5/Serializer.js +1 -1
  38. package/dist-es5/TelemetryProcessors/Sample.js +1 -1
  39. package/dist-es5/TelemetryProcessors/SamplingScoreGenerators/HashCodeScoreGenerator.js +1 -1
  40. package/dist-es5/TelemetryProcessors/SamplingScoreGenerators/SamplingScoreGenerator.js +1 -1
  41. package/dist-es5/__DynamicConstants.js +1 -1
  42. package/dist-es5/applicationinsights-channel-js.js +1 -1
  43. package/package.json +3 -3
  44. package/types/applicationinsights-channel-js.d.ts +1 -1
  45. package/types/applicationinsights-channel-js.namespaced.d.ts +1 -28
  46. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240329-01.cjs.js.map +0 -1
  47. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240329-01.cjs.min.js +0 -6
  48. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240329-01.cjs.min.js.map +0 -1
  49. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240329-01.gbl.js.map +0 -1
  50. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240329-01.gbl.min.js +0 -6
  51. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240329-01.gbl.min.js.map +0 -1
  52. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240329-01.integrity.json +0 -66
  53. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240329-01.js.map +0 -1
  54. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240329-01.min.js +0 -6
  55. package/browser/es5/applicationinsights-channel-js.3.1.3-nightly3.240329-01.min.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Channel, 3.1.3-nightly3.240329-01
2
+ * Application Insights JavaScript SDK - Channel, 3.1.3-nightly3.240403-01
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -1168,14 +1168,19 @@
1168
1168
  throw new aggregationErrorType(theMessage, sourceErrors || []);
1169
1169
  }
1170
1170
 
1171
+ var STR_PROMISE = "Promise";
1172
+ var REJECTED = "rejected";
1173
+
1171
1174
  function doAwaitResponse(value, cb) {
1172
1175
  return doAwait(value, function (value) {
1173
1176
  return cb ? cb({
1174
- value: value,
1175
- rejected: false
1177
+ status: "fulfilled",
1178
+ rejected: false,
1179
+ value: value
1176
1180
  }) : value;
1177
1181
  }, function (reason) {
1178
1182
  return cb ? cb({
1183
+ status: REJECTED,
1179
1184
  rejected: true,
1180
1185
  reason: reason
1181
1186
  }) : reason;
@@ -1183,18 +1188,32 @@
1183
1188
  }
1184
1189
  function doAwait(value, resolveFn, rejectFn, finallyFn) {
1185
1190
  var result = value;
1186
- if (isPromiseLike(value)) {
1187
- if (resolveFn || rejectFn) {
1188
- result = value.then(resolveFn, rejectFn);
1191
+ try {
1192
+ if (isPromiseLike(value)) {
1193
+ if (resolveFn || rejectFn) {
1194
+ result = value.then(resolveFn, rejectFn);
1195
+ }
1189
1196
  }
1190
- }
1191
- else {
1192
- if (resolveFn) {
1193
- result = resolveFn(value);
1197
+ else {
1198
+ try {
1199
+ if (resolveFn) {
1200
+ result = resolveFn(value);
1201
+ }
1202
+ }
1203
+ catch (err) {
1204
+ if (rejectFn) {
1205
+ result = rejectFn(err);
1206
+ }
1207
+ else {
1208
+ throw err;
1209
+ }
1210
+ }
1194
1211
  }
1195
1212
  }
1196
- if (finallyFn) {
1197
- doFinally(result, finallyFn);
1213
+ finally {
1214
+ if (finallyFn) {
1215
+ doFinally(result, finallyFn);
1216
+ }
1198
1217
  }
1199
1218
  return result;
1200
1219
  }
@@ -1222,21 +1241,22 @@
1222
1241
  return result;
1223
1242
  }
1224
1243
 
1225
- var STRING_STATES = [
1226
- "pending", "resolving", "resolved", "rejected"
1244
+ var STRING_STATES = [
1245
+ "pending", "resolving", "resolved", REJECTED
1227
1246
  ];
1228
1247
 
1229
1248
  var DISPATCH_EVENT = "dispatchEvent";
1230
1249
  var _hasInitEvent;
1250
+ function _hasInitEventFn(doc) {
1251
+ var evt;
1252
+ if (doc && doc.createEvent) {
1253
+ evt = doc.createEvent("Event");
1254
+ }
1255
+ return (!!evt && evt.initEvent);
1256
+ }
1231
1257
  function emitEvent(target, evtName, populateEvent, useNewEvent) {
1232
1258
  var doc = getDocument();
1233
- !_hasInitEvent && (_hasInitEvent = safeGetLazy(function () {
1234
- var evt;
1235
- if (doc && doc.createEvent) {
1236
- evt = doc.createEvent("Event");
1237
- }
1238
- return (!!evt && evt.initEvent);
1239
- }, null));
1259
+ !_hasInitEvent && (_hasInitEvent = createCachedValue(!!safe(_hasInitEventFn, [doc]).v));
1240
1260
  var theEvt = _hasInitEvent.v ? doc.createEvent("Event") : (useNewEvent ? new Event(evtName) : {});
1241
1261
  populateEvent && populateEvent(theEvt);
1242
1262
  if (_hasInitEvent.v) {
@@ -1257,8 +1277,6 @@
1257
1277
  }
1258
1278
  }
1259
1279
 
1260
- var STR_PROMISE = "Promise";
1261
-
1262
1280
  var NODE_UNHANDLED_REJECTION = "unhandledRejection";
1263
1281
  var UNHANDLED_REJECTION = NODE_UNHANDLED_REJECTION.toLowerCase();
1264
1282
  var _unhandledRejectionTimeout = 10;
@@ -1279,7 +1297,7 @@
1279
1297
  var _unHandledRejectionHandler = null;
1280
1298
  var _thePromise;
1281
1299
  !_hasPromiseRejectionEvent && (_hasPromiseRejectionEvent = lazySafeGetInst(STR_PROMISE + "RejectionEvent"));
1282
- var _then = function (onResolved, onRejected) {
1300
+ function _then(onResolved, onRejected) {
1283
1301
  try {
1284
1302
  _handled = true;
1285
1303
  _unHandledRejectionHandler && _unHandledRejectionHandler.cancel();
@@ -1314,11 +1332,11 @@
1314
1332
  }
1315
1333
  finally {
1316
1334
  }
1317
- };
1318
- var _catch = function (onRejected) {
1335
+ }
1336
+ function _catch(onRejected) {
1319
1337
  return _then(undefined, onRejected);
1320
- };
1321
- var _finally = function (onFinally) {
1338
+ }
1339
+ function _finally(onFinally) {
1322
1340
  var thenFinally = onFinally;
1323
1341
  var catchFinally = onFinally;
1324
1342
  if (isFunction(onFinally)) {
@@ -1332,21 +1350,21 @@
1332
1350
  };
1333
1351
  }
1334
1352
  return _then(thenFinally, catchFinally);
1335
- };
1336
- var _strState = function () {
1353
+ }
1354
+ function _strState() {
1337
1355
  return STRING_STATES[_state];
1338
- };
1339
- var _processQueue = function () {
1356
+ }
1357
+ function _processQueue() {
1340
1358
  if (_queue.length > 0) {
1341
1359
  var pending = _queue.slice();
1342
1360
  _queue = [];
1343
1361
  _handled = true;
1344
- processor(pending);
1345
1362
  _unHandledRejectionHandler && _unHandledRejectionHandler.cancel();
1346
1363
  _unHandledRejectionHandler = null;
1364
+ processor(pending);
1347
1365
  }
1348
- };
1349
- var _createSettleIfFn = function (newState, allowState) {
1366
+ }
1367
+ function _createSettleIfFn(newState, allowState) {
1350
1368
  return function (theValue) {
1351
1369
  if (_state === allowState) {
1352
1370
  if (newState === 2 && isPromiseLike(theValue)) {
@@ -1363,9 +1381,10 @@
1363
1381
  }
1364
1382
  }
1365
1383
  };
1366
- };
1367
- var _notifyUnhandledRejection = function () {
1384
+ }
1385
+ function _notifyUnhandledRejection() {
1368
1386
  if (!_handled) {
1387
+ _handled = true;
1369
1388
  if (isNode()) {
1370
1389
  process.emit(NODE_UNHANDLED_REJECTION, _settledValue, _thePromise);
1371
1390
  }
@@ -1378,7 +1397,7 @@
1378
1397
  }, !!_hasPromiseRejectionEvent.v);
1379
1398
  }
1380
1399
  }
1381
- };
1400
+ }
1382
1401
  _thePromise = {
1383
1402
  then: _then,
1384
1403
  "catch": _catch,
@@ -1390,9 +1409,9 @@
1390
1409
  if (hasSymbol()) {
1391
1410
  _thePromise[getKnownSymbol(11 )] = "IPromise";
1392
1411
  }
1393
- var _toString = function () {
1394
- return "IPromise" + ("") + " " + _strState() + (_hasResolved ? (" - " + dumpFnObj(_settledValue)) : "");
1395
- };
1412
+ function _toString() {
1413
+ return "IPromise" + ("") + " " + _strState() + (_hasResolved ? (" - " + dumpFnObj(_settledValue)) : "") + ("");
1414
+ }
1396
1415
  _thePromise.toString = _toString;
1397
1416
  (function _initialize() {
1398
1417
  if (!isFunction(executor)) {
@@ -1409,7 +1428,7 @@
1409
1428
  return _thePromise;
1410
1429
  }
1411
1430
 
1412
- var _processPendingItems = function (pending) {
1431
+ function syncItemProcessor(pending) {
1413
1432
  arrForEach(pending, function (fn) {
1414
1433
  try {
1415
1434
  fn();
@@ -1417,12 +1436,12 @@
1417
1436
  catch (e) {
1418
1437
  }
1419
1438
  });
1420
- };
1439
+ }
1421
1440
  function timeoutItemProcessor(timeout) {
1422
1441
  var callbackTimeout = isNumber(timeout) ? timeout : 0;
1423
1442
  return function (pending) {
1424
1443
  scheduleTimeout(function () {
1425
- _processPendingItems(pending);
1444
+ syncItemProcessor(pending);
1426
1445
  }, callbackTimeout);
1427
1446
  };
1428
1447
  }
@@ -1431,10 +1450,10 @@
1431
1450
  return _createPromise(createAsyncPromise, timeoutItemProcessor(timeout), executor, timeout);
1432
1451
  }
1433
1452
 
1434
- var _isPromiseSupported;
1453
+ var _promiseCls;
1435
1454
  function createNativePromise(executor, timeout) {
1436
- !_isPromiseSupported && (_isPromiseSupported = lazySafeGetInst(STR_PROMISE));
1437
- var PrmCls = _isPromiseSupported.v;
1455
+ !_promiseCls && (_promiseCls = createCachedValue((safe(getInst, [STR_PROMISE]).v) || null));
1456
+ var PrmCls = _promiseCls.v;
1438
1457
  if (!PrmCls) {
1439
1458
  return createAsyncPromise(executor);
1440
1459
  }
@@ -1464,7 +1483,7 @@
1464
1483
 
1465
1484
  var _promiseCreator;
1466
1485
  function createPromise(executor, timeout) {
1467
- !_promiseCreator && (_promiseCreator = getLazy(function () { return createNativePromise; }));
1486
+ !_promiseCreator && (_promiseCreator = createCachedValue(createNativePromise));
1468
1487
  return _promiseCreator.v.call(this, executor, timeout);
1469
1488
  }
1470
1489
 
@@ -3702,7 +3721,9 @@
3702
3721
  return;
3703
3722
  }
3704
3723
  var xhr = openXhr(STR_POST_METHOD, endPointUrl, _sendCredentials, true, sync, payload[_DYN_TIMEOUT ]);
3705
- xhr[_DYN_SET_REQUEST_HEADER ]("Content-type", "application/json");
3724
+ if (!_isOneDs) {
3725
+ xhr[_DYN_SET_REQUEST_HEADER ]("Content-type", "application/json");
3726
+ }
3706
3727
  arrForEach(objKeys(headers), function (headerName) {
3707
3728
  xhr[_DYN_SET_REQUEST_HEADER ](headerName, headers[headerName]);
3708
3729
  });
@@ -5467,6 +5488,7 @@
5467
5488
  var extOs = itmExt.os;
5468
5489
  if (extOs) {
5469
5490
  _setValueIf(envTags, CtxTagKeys.deviceOS, extOs[_DYN_NAME ]);
5491
+ _setValueIf(envTags, CtxTagKeys.deviceOSVersion, extOs.osVer);
5470
5492
  }
5471
5493
  var extTrace = itmExt.trace;
5472
5494
  if (extTrace) {
@@ -5532,7 +5554,7 @@
5532
5554
  }
5533
5555
  }
5534
5556
  var EnvelopeCreator = {
5535
- Version: '3.1.3-nightly3.240329-01'
5557
+ Version: '3.1.3-nightly3.240403-01'
5536
5558
  };
5537
5559
  function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
5538
5560
  EnvelopeCreatorInit(logger, telemetryItem);