@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
  'use strict';
@@ -1165,14 +1165,19 @@ function throwAggregationError(message, sourceErrors) {
1165
1165
  throw new aggregationErrorType(theMessage, sourceErrors || []);
1166
1166
  }
1167
1167
 
1168
+ var STR_PROMISE = "Promise";
1169
+ var REJECTED = "rejected";
1170
+
1168
1171
  function doAwaitResponse(value, cb) {
1169
1172
  return doAwait(value, function (value) {
1170
1173
  return cb ? cb({
1171
- value: value,
1172
- rejected: false
1174
+ status: "fulfilled",
1175
+ rejected: false,
1176
+ value: value
1173
1177
  }) : value;
1174
1178
  }, function (reason) {
1175
1179
  return cb ? cb({
1180
+ status: REJECTED,
1176
1181
  rejected: true,
1177
1182
  reason: reason
1178
1183
  }) : reason;
@@ -1180,18 +1185,32 @@ function doAwaitResponse(value, cb) {
1180
1185
  }
1181
1186
  function doAwait(value, resolveFn, rejectFn, finallyFn) {
1182
1187
  var result = value;
1183
- if (isPromiseLike(value)) {
1184
- if (resolveFn || rejectFn) {
1185
- result = value.then(resolveFn, rejectFn);
1188
+ try {
1189
+ if (isPromiseLike(value)) {
1190
+ if (resolveFn || rejectFn) {
1191
+ result = value.then(resolveFn, rejectFn);
1192
+ }
1186
1193
  }
1187
- }
1188
- else {
1189
- if (resolveFn) {
1190
- result = resolveFn(value);
1194
+ else {
1195
+ try {
1196
+ if (resolveFn) {
1197
+ result = resolveFn(value);
1198
+ }
1199
+ }
1200
+ catch (err) {
1201
+ if (rejectFn) {
1202
+ result = rejectFn(err);
1203
+ }
1204
+ else {
1205
+ throw err;
1206
+ }
1207
+ }
1191
1208
  }
1192
1209
  }
1193
- if (finallyFn) {
1194
- doFinally(result, finallyFn);
1210
+ finally {
1211
+ if (finallyFn) {
1212
+ doFinally(result, finallyFn);
1213
+ }
1195
1214
  }
1196
1215
  return result;
1197
1216
  }
@@ -1219,21 +1238,22 @@ function doFinally(value, finallyFn) {
1219
1238
  return result;
1220
1239
  }
1221
1240
 
1222
- var STRING_STATES = [
1223
- "pending", "resolving", "resolved", "rejected"
1241
+ var STRING_STATES = [
1242
+ "pending", "resolving", "resolved", REJECTED
1224
1243
  ];
1225
1244
 
1226
1245
  var DISPATCH_EVENT = "dispatchEvent";
1227
1246
  var _hasInitEvent;
1247
+ function _hasInitEventFn(doc) {
1248
+ var evt;
1249
+ if (doc && doc.createEvent) {
1250
+ evt = doc.createEvent("Event");
1251
+ }
1252
+ return (!!evt && evt.initEvent);
1253
+ }
1228
1254
  function emitEvent(target, evtName, populateEvent, useNewEvent) {
1229
1255
  var doc = getDocument();
1230
- !_hasInitEvent && (_hasInitEvent = safeGetLazy(function () {
1231
- var evt;
1232
- if (doc && doc.createEvent) {
1233
- evt = doc.createEvent("Event");
1234
- }
1235
- return (!!evt && evt.initEvent);
1236
- }, null));
1256
+ !_hasInitEvent && (_hasInitEvent = createCachedValue(!!safe(_hasInitEventFn, [doc]).v));
1237
1257
  var theEvt = _hasInitEvent.v ? doc.createEvent("Event") : (useNewEvent ? new Event(evtName) : {});
1238
1258
  populateEvent && populateEvent(theEvt);
1239
1259
  if (_hasInitEvent.v) {
@@ -1254,8 +1274,6 @@ function emitEvent(target, evtName, populateEvent, useNewEvent) {
1254
1274
  }
1255
1275
  }
1256
1276
 
1257
- var STR_PROMISE = "Promise";
1258
-
1259
1277
  var NODE_UNHANDLED_REJECTION = "unhandledRejection";
1260
1278
  var UNHANDLED_REJECTION = NODE_UNHANDLED_REJECTION.toLowerCase();
1261
1279
  var _unhandledRejectionTimeout = 10;
@@ -1276,7 +1294,7 @@ function _createPromise(newPromise, processor, executor) {
1276
1294
  var _unHandledRejectionHandler = null;
1277
1295
  var _thePromise;
1278
1296
  !_hasPromiseRejectionEvent && (_hasPromiseRejectionEvent = lazySafeGetInst(STR_PROMISE + "RejectionEvent"));
1279
- var _then = function (onResolved, onRejected) {
1297
+ function _then(onResolved, onRejected) {
1280
1298
  try {
1281
1299
  _handled = true;
1282
1300
  _unHandledRejectionHandler && _unHandledRejectionHandler.cancel();
@@ -1311,11 +1329,11 @@ function _createPromise(newPromise, processor, executor) {
1311
1329
  }
1312
1330
  finally {
1313
1331
  }
1314
- };
1315
- var _catch = function (onRejected) {
1332
+ }
1333
+ function _catch(onRejected) {
1316
1334
  return _then(undefined, onRejected);
1317
- };
1318
- var _finally = function (onFinally) {
1335
+ }
1336
+ function _finally(onFinally) {
1319
1337
  var thenFinally = onFinally;
1320
1338
  var catchFinally = onFinally;
1321
1339
  if (isFunction(onFinally)) {
@@ -1329,21 +1347,21 @@ function _createPromise(newPromise, processor, executor) {
1329
1347
  };
1330
1348
  }
1331
1349
  return _then(thenFinally, catchFinally);
1332
- };
1333
- var _strState = function () {
1350
+ }
1351
+ function _strState() {
1334
1352
  return STRING_STATES[_state];
1335
- };
1336
- var _processQueue = function () {
1353
+ }
1354
+ function _processQueue() {
1337
1355
  if (_queue.length > 0) {
1338
1356
  var pending = _queue.slice();
1339
1357
  _queue = [];
1340
1358
  _handled = true;
1341
- processor(pending);
1342
1359
  _unHandledRejectionHandler && _unHandledRejectionHandler.cancel();
1343
1360
  _unHandledRejectionHandler = null;
1361
+ processor(pending);
1344
1362
  }
1345
- };
1346
- var _createSettleIfFn = function (newState, allowState) {
1363
+ }
1364
+ function _createSettleIfFn(newState, allowState) {
1347
1365
  return function (theValue) {
1348
1366
  if (_state === allowState) {
1349
1367
  if (newState === 2 && isPromiseLike(theValue)) {
@@ -1360,9 +1378,10 @@ function _createPromise(newPromise, processor, executor) {
1360
1378
  }
1361
1379
  }
1362
1380
  };
1363
- };
1364
- var _notifyUnhandledRejection = function () {
1381
+ }
1382
+ function _notifyUnhandledRejection() {
1365
1383
  if (!_handled) {
1384
+ _handled = true;
1366
1385
  if (isNode()) {
1367
1386
  process.emit(NODE_UNHANDLED_REJECTION, _settledValue, _thePromise);
1368
1387
  }
@@ -1375,7 +1394,7 @@ function _createPromise(newPromise, processor, executor) {
1375
1394
  }, !!_hasPromiseRejectionEvent.v);
1376
1395
  }
1377
1396
  }
1378
- };
1397
+ }
1379
1398
  _thePromise = {
1380
1399
  then: _then,
1381
1400
  "catch": _catch,
@@ -1387,9 +1406,9 @@ function _createPromise(newPromise, processor, executor) {
1387
1406
  if (hasSymbol()) {
1388
1407
  _thePromise[getKnownSymbol(11 )] = "IPromise";
1389
1408
  }
1390
- var _toString = function () {
1391
- return "IPromise" + ("") + " " + _strState() + (_hasResolved ? (" - " + dumpFnObj(_settledValue)) : "");
1392
- };
1409
+ function _toString() {
1410
+ return "IPromise" + ("") + " " + _strState() + (_hasResolved ? (" - " + dumpFnObj(_settledValue)) : "") + ("");
1411
+ }
1393
1412
  _thePromise.toString = _toString;
1394
1413
  (function _initialize() {
1395
1414
  if (!isFunction(executor)) {
@@ -1406,7 +1425,7 @@ function _createPromise(newPromise, processor, executor) {
1406
1425
  return _thePromise;
1407
1426
  }
1408
1427
 
1409
- var _processPendingItems = function (pending) {
1428
+ function syncItemProcessor(pending) {
1410
1429
  arrForEach(pending, function (fn) {
1411
1430
  try {
1412
1431
  fn();
@@ -1414,12 +1433,12 @@ var _processPendingItems = function (pending) {
1414
1433
  catch (e) {
1415
1434
  }
1416
1435
  });
1417
- };
1436
+ }
1418
1437
  function timeoutItemProcessor(timeout) {
1419
1438
  var callbackTimeout = isNumber(timeout) ? timeout : 0;
1420
1439
  return function (pending) {
1421
1440
  scheduleTimeout(function () {
1422
- _processPendingItems(pending);
1441
+ syncItemProcessor(pending);
1423
1442
  }, callbackTimeout);
1424
1443
  };
1425
1444
  }
@@ -1428,10 +1447,10 @@ function createAsyncPromise(executor, timeout) {
1428
1447
  return _createPromise(createAsyncPromise, timeoutItemProcessor(timeout), executor, timeout);
1429
1448
  }
1430
1449
 
1431
- var _isPromiseSupported;
1450
+ var _promiseCls;
1432
1451
  function createNativePromise(executor, timeout) {
1433
- !_isPromiseSupported && (_isPromiseSupported = lazySafeGetInst(STR_PROMISE));
1434
- var PrmCls = _isPromiseSupported.v;
1452
+ !_promiseCls && (_promiseCls = createCachedValue((safe(getInst, [STR_PROMISE]).v) || null));
1453
+ var PrmCls = _promiseCls.v;
1435
1454
  if (!PrmCls) {
1436
1455
  return createAsyncPromise(executor);
1437
1456
  }
@@ -1461,7 +1480,7 @@ function createNativePromise(executor, timeout) {
1461
1480
 
1462
1481
  var _promiseCreator;
1463
1482
  function createPromise(executor, timeout) {
1464
- !_promiseCreator && (_promiseCreator = getLazy(function () { return createNativePromise; }));
1483
+ !_promiseCreator && (_promiseCreator = createCachedValue(createNativePromise));
1465
1484
  return _promiseCreator.v.call(this, executor, timeout);
1466
1485
  }
1467
1486
 
@@ -3699,7 +3718,9 @@ var SenderPostManager = /** @class */ (function () {
3699
3718
  return;
3700
3719
  }
3701
3720
  var xhr = openXhr(STR_POST_METHOD, endPointUrl, _sendCredentials, true, sync, payload[_DYN_TIMEOUT ]);
3702
- xhr[_DYN_SET_REQUEST_HEADER ]("Content-type", "application/json");
3721
+ if (!_isOneDs) {
3722
+ xhr[_DYN_SET_REQUEST_HEADER ]("Content-type", "application/json");
3723
+ }
3703
3724
  arrForEach(objKeys(headers), function (headerName) {
3704
3725
  xhr[_DYN_SET_REQUEST_HEADER ](headerName, headers[headerName]);
3705
3726
  });
@@ -5464,6 +5485,7 @@ function _extractPartAExtensions(logger, item, env) {
5464
5485
  var extOs = itmExt.os;
5465
5486
  if (extOs) {
5466
5487
  _setValueIf(envTags, CtxTagKeys.deviceOS, extOs[_DYN_NAME ]);
5488
+ _setValueIf(envTags, CtxTagKeys.deviceOSVersion, extOs.osVer);
5467
5489
  }
5468
5490
  var extTrace = itmExt.trace;
5469
5491
  if (extTrace) {
@@ -5529,7 +5551,7 @@ function EnvelopeCreatorInit(logger, telemetryItem) {
5529
5551
  }
5530
5552
  }
5531
5553
  var EnvelopeCreator = {
5532
- Version: '3.1.3-nightly3.240329-01'
5554
+ Version: '3.1.3-nightly3.240403-01'
5533
5555
  };
5534
5556
  function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
5535
5557
  EnvelopeCreatorInit(logger, telemetryItem);