@microsoft/1ds-post-js 4.1.3-nightly3.240329-01 → 4.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 (47) hide show
  1. package/bundle/es5/{ms.post-4.1.3-nightly3.240329-01.gbl.js → ms.post-4.1.3-nightly3.240403-01.gbl.js} +75 -54
  2. package/bundle/es5/ms.post-4.1.3-nightly3.240403-01.gbl.js.map +1 -0
  3. package/bundle/es5/ms.post-4.1.3-nightly3.240403-01.gbl.min.js +7 -0
  4. package/bundle/es5/ms.post-4.1.3-nightly3.240403-01.gbl.min.js.map +1 -0
  5. package/bundle/es5/ms.post-4.1.3-nightly3.240403-01.integrity.json +46 -0
  6. package/bundle/es5/{ms.post-4.1.3-nightly3.240329-01.js → ms.post-4.1.3-nightly3.240403-01.js} +75 -54
  7. package/bundle/es5/ms.post-4.1.3-nightly3.240403-01.js.map +1 -0
  8. package/bundle/es5/ms.post-4.1.3-nightly3.240403-01.min.js +7 -0
  9. package/bundle/es5/ms.post-4.1.3-nightly3.240403-01.min.js.map +1 -0
  10. package/bundle/es5/ms.post.gbl.js +74 -53
  11. package/bundle/es5/ms.post.gbl.js.map +1 -1
  12. package/bundle/es5/ms.post.gbl.min.js +2 -2
  13. package/bundle/es5/ms.post.gbl.min.js.map +1 -1
  14. package/bundle/es5/ms.post.integrity.json +17 -17
  15. package/bundle/es5/ms.post.js +74 -53
  16. package/bundle/es5/ms.post.js.map +1 -1
  17. package/bundle/es5/ms.post.min.js +2 -2
  18. package/bundle/es5/ms.post.min.js.map +1 -1
  19. package/dist/es5/ms.post.js +72 -51
  20. package/dist/es5/ms.post.js.map +1 -1
  21. package/dist/es5/ms.post.min.js +2 -2
  22. package/dist/es5/ms.post.min.js.map +1 -1
  23. package/dist-es5/BatchNotificationActions.js +1 -1
  24. package/dist-es5/ClockSkewManager.js +1 -1
  25. package/dist-es5/DataModels.js +1 -1
  26. package/dist-es5/EventBatch.js +1 -1
  27. package/dist-es5/HttpManager.js +1 -1
  28. package/dist-es5/Index.js +1 -1
  29. package/dist-es5/InternalConstants.js +1 -1
  30. package/dist-es5/KillSwitch.js +1 -1
  31. package/dist-es5/PostChannel.js +2 -2
  32. package/dist-es5/PostChannel.js.map +1 -1
  33. package/dist-es5/RetryPolicy.js +1 -1
  34. package/dist-es5/Serializer.js +1 -1
  35. package/dist-es5/TimeoutOverrideWrapper.js +1 -1
  36. package/dist-es5/__DynamicConstants.js +1 -1
  37. package/dist-es5/typings/XDomainRequest.js +1 -1
  38. package/package.json +2 -2
  39. package/types/1ds-post-js.d.ts +1 -1
  40. package/types/1ds-post-js.namespaced.d.ts +1 -28
  41. package/bundle/es5/ms.post-4.1.3-nightly3.240329-01.gbl.js.map +0 -1
  42. package/bundle/es5/ms.post-4.1.3-nightly3.240329-01.gbl.min.js +0 -7
  43. package/bundle/es5/ms.post-4.1.3-nightly3.240329-01.gbl.min.js.map +0 -1
  44. package/bundle/es5/ms.post-4.1.3-nightly3.240329-01.integrity.json +0 -46
  45. package/bundle/es5/ms.post-4.1.3-nightly3.240329-01.js.map +0 -1
  46. package/bundle/es5/ms.post-4.1.3-nightly3.240329-01.min.js +0 -7
  47. package/bundle/es5/ms.post-4.1.3-nightly3.240329-01.min.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * 1DS JS SDK POST plugin, 4.1.3-nightly3.240329-01
2
+ * 1DS JS SDK POST plugin, 4.1.3-nightly3.240403-01
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  * (Microsoft Internal Only)
5
5
  */
6
6
  (function (global, factory) {
7
7
  var undef = "undefined";
8
- var nsKey, key, nm, theExports = {}, modName = "es5_ms_post_4_1_3_nightly3_240329_01", msMod="__ms$mod__";
9
- var mods={}, modDetail=mods[modName]={}, ver="4.1.3-nightly3.240329-01";
8
+ var nsKey, key, nm, theExports = {}, modName = "es5_ms_post_4_1_3_nightly3_240403_01", msMod="__ms$mod__";
9
+ var mods={}, modDetail=mods[modName]={}, ver="4.1.3-nightly3.240403-01";
10
10
  // Versioned namespace "oneDS4"
11
11
  var exportNs=global, nsKey="oneDS4", exportNs=exportNs[nsKey]=(exportNs[nsKey]||{});
12
12
  // Global namespace "oneDS"
@@ -1171,14 +1171,19 @@ function throwAggregationError(message, sourceErrors) {
1171
1171
  throw new aggregationErrorType(theMessage, sourceErrors || []);
1172
1172
  }
1173
1173
 
1174
+ var STR_PROMISE = "Promise";
1175
+ var REJECTED = "rejected";
1176
+
1174
1177
  function doAwaitResponse(value, cb) {
1175
1178
  return doAwait(value, function (value) {
1176
1179
  return cb ? cb({
1177
- value: value,
1178
- rejected: false
1180
+ status: "fulfilled",
1181
+ rejected: false,
1182
+ value: value
1179
1183
  }) : value;
1180
1184
  }, function (reason) {
1181
1185
  return cb ? cb({
1186
+ status: REJECTED,
1182
1187
  rejected: true,
1183
1188
  reason: reason
1184
1189
  }) : reason;
@@ -1186,18 +1191,32 @@ function doAwaitResponse(value, cb) {
1186
1191
  }
1187
1192
  function doAwait(value, resolveFn, rejectFn, finallyFn) {
1188
1193
  var result = value;
1189
- if (isPromiseLike(value)) {
1190
- if (resolveFn || rejectFn) {
1191
- result = value.then(resolveFn, rejectFn);
1194
+ try {
1195
+ if (isPromiseLike(value)) {
1196
+ if (resolveFn || rejectFn) {
1197
+ result = value.then(resolveFn, rejectFn);
1198
+ }
1192
1199
  }
1193
- }
1194
- else {
1195
- if (resolveFn) {
1196
- result = resolveFn(value);
1200
+ else {
1201
+ try {
1202
+ if (resolveFn) {
1203
+ result = resolveFn(value);
1204
+ }
1205
+ }
1206
+ catch (err) {
1207
+ if (rejectFn) {
1208
+ result = rejectFn(err);
1209
+ }
1210
+ else {
1211
+ throw err;
1212
+ }
1213
+ }
1197
1214
  }
1198
1215
  }
1199
- if (finallyFn) {
1200
- doFinally(result, finallyFn);
1216
+ finally {
1217
+ if (finallyFn) {
1218
+ doFinally(result, finallyFn);
1219
+ }
1201
1220
  }
1202
1221
  return result;
1203
1222
  }
@@ -1225,21 +1244,22 @@ function doFinally(value, finallyFn) {
1225
1244
  return result;
1226
1245
  }
1227
1246
 
1228
- var STRING_STATES = [
1229
- "pending", "resolving", "resolved", "rejected"
1247
+ var STRING_STATES = [
1248
+ "pending", "resolving", "resolved", REJECTED
1230
1249
  ];
1231
1250
 
1232
1251
  var DISPATCH_EVENT = "dispatchEvent";
1233
1252
  var _hasInitEvent;
1253
+ function _hasInitEventFn(doc) {
1254
+ var evt;
1255
+ if (doc && doc.createEvent) {
1256
+ evt = doc.createEvent("Event");
1257
+ }
1258
+ return (!!evt && evt.initEvent);
1259
+ }
1234
1260
  function emitEvent(target, evtName, populateEvent, useNewEvent) {
1235
1261
  var doc = getDocument();
1236
- !_hasInitEvent && (_hasInitEvent = safeGetLazy(function () {
1237
- var evt;
1238
- if (doc && doc.createEvent) {
1239
- evt = doc.createEvent("Event");
1240
- }
1241
- return (!!evt && evt.initEvent);
1242
- }, null));
1262
+ !_hasInitEvent && (_hasInitEvent = createCachedValue(!!safe(_hasInitEventFn, [doc]).v));
1243
1263
  var theEvt = _hasInitEvent.v ? doc.createEvent("Event") : (useNewEvent ? new Event(evtName) : {});
1244
1264
  populateEvent && populateEvent(theEvt);
1245
1265
  if (_hasInitEvent.v) {
@@ -1260,8 +1280,6 @@ function emitEvent(target, evtName, populateEvent, useNewEvent) {
1260
1280
  }
1261
1281
  }
1262
1282
 
1263
- var STR_PROMISE = "Promise";
1264
-
1265
1283
  var NODE_UNHANDLED_REJECTION = "unhandledRejection";
1266
1284
  var UNHANDLED_REJECTION = NODE_UNHANDLED_REJECTION.toLowerCase();
1267
1285
  var _unhandledRejectionTimeout = 10;
@@ -1282,7 +1300,7 @@ function _createPromise(newPromise, processor, executor) {
1282
1300
  var _unHandledRejectionHandler = null;
1283
1301
  var _thePromise;
1284
1302
  !_hasPromiseRejectionEvent && (_hasPromiseRejectionEvent = lazySafeGetInst(STR_PROMISE + "RejectionEvent"));
1285
- var _then = function (onResolved, onRejected) {
1303
+ function _then(onResolved, onRejected) {
1286
1304
  try {
1287
1305
  _handled = true;
1288
1306
  _unHandledRejectionHandler && _unHandledRejectionHandler.cancel();
@@ -1317,11 +1335,11 @@ function _createPromise(newPromise, processor, executor) {
1317
1335
  }
1318
1336
  finally {
1319
1337
  }
1320
- };
1321
- var _catch = function (onRejected) {
1338
+ }
1339
+ function _catch(onRejected) {
1322
1340
  return _then(undefined, onRejected);
1323
- };
1324
- var _finally = function (onFinally) {
1341
+ }
1342
+ function _finally(onFinally) {
1325
1343
  var thenFinally = onFinally;
1326
1344
  var catchFinally = onFinally;
1327
1345
  if (isFunction(onFinally)) {
@@ -1335,21 +1353,21 @@ function _createPromise(newPromise, processor, executor) {
1335
1353
  };
1336
1354
  }
1337
1355
  return _then(thenFinally, catchFinally);
1338
- };
1339
- var _strState = function () {
1356
+ }
1357
+ function _strState() {
1340
1358
  return STRING_STATES[_state];
1341
- };
1342
- var _processQueue = function () {
1359
+ }
1360
+ function _processQueue() {
1343
1361
  if (_queue.length > 0) {
1344
1362
  var pending = _queue.slice();
1345
1363
  _queue = [];
1346
1364
  _handled = true;
1347
- processor(pending);
1348
1365
  _unHandledRejectionHandler && _unHandledRejectionHandler.cancel();
1349
1366
  _unHandledRejectionHandler = null;
1367
+ processor(pending);
1350
1368
  }
1351
- };
1352
- var _createSettleIfFn = function (newState, allowState) {
1369
+ }
1370
+ function _createSettleIfFn(newState, allowState) {
1353
1371
  return function (theValue) {
1354
1372
  if (_state === allowState) {
1355
1373
  if (newState === 2 && isPromiseLike(theValue)) {
@@ -1366,9 +1384,10 @@ function _createPromise(newPromise, processor, executor) {
1366
1384
  }
1367
1385
  }
1368
1386
  };
1369
- };
1370
- var _notifyUnhandledRejection = function () {
1387
+ }
1388
+ function _notifyUnhandledRejection() {
1371
1389
  if (!_handled) {
1390
+ _handled = true;
1372
1391
  if (isNode()) {
1373
1392
  process.emit(NODE_UNHANDLED_REJECTION, _settledValue, _thePromise);
1374
1393
  }
@@ -1381,7 +1400,7 @@ function _createPromise(newPromise, processor, executor) {
1381
1400
  }, !!_hasPromiseRejectionEvent.v);
1382
1401
  }
1383
1402
  }
1384
- };
1403
+ }
1385
1404
  _thePromise = {
1386
1405
  then: _then,
1387
1406
  "catch": _catch,
@@ -1393,9 +1412,9 @@ function _createPromise(newPromise, processor, executor) {
1393
1412
  if (hasSymbol()) {
1394
1413
  _thePromise[getKnownSymbol(11 )] = "IPromise";
1395
1414
  }
1396
- var _toString = function () {
1397
- return "IPromise" + ("") + " " + _strState() + (_hasResolved ? (" - " + dumpFnObj(_settledValue)) : "");
1398
- };
1415
+ function _toString() {
1416
+ return "IPromise" + ("") + " " + _strState() + (_hasResolved ? (" - " + dumpFnObj(_settledValue)) : "") + ("");
1417
+ }
1399
1418
  _thePromise.toString = _toString;
1400
1419
  (function _initialize() {
1401
1420
  if (!isFunction(executor)) {
@@ -1412,7 +1431,7 @@ function _createPromise(newPromise, processor, executor) {
1412
1431
  return _thePromise;
1413
1432
  }
1414
1433
 
1415
- var _processPendingItems = function (pending) {
1434
+ function syncItemProcessor(pending) {
1416
1435
  arrForEach(pending, function (fn) {
1417
1436
  try {
1418
1437
  fn();
@@ -1420,12 +1439,12 @@ var _processPendingItems = function (pending) {
1420
1439
  catch (e) {
1421
1440
  }
1422
1441
  });
1423
- };
1442
+ }
1424
1443
  function timeoutItemProcessor(timeout) {
1425
1444
  var callbackTimeout = isNumber(timeout) ? timeout : 0;
1426
1445
  return function (pending) {
1427
1446
  scheduleTimeout(function () {
1428
- _processPendingItems(pending);
1447
+ syncItemProcessor(pending);
1429
1448
  }, callbackTimeout);
1430
1449
  };
1431
1450
  }
@@ -1434,10 +1453,10 @@ function createAsyncPromise(executor, timeout) {
1434
1453
  return _createPromise(createAsyncPromise, timeoutItemProcessor(timeout), executor, timeout);
1435
1454
  }
1436
1455
 
1437
- var _isPromiseSupported;
1456
+ var _promiseCls;
1438
1457
  function createNativePromise(executor, timeout) {
1439
- !_isPromiseSupported && (_isPromiseSupported = lazySafeGetInst(STR_PROMISE));
1440
- var PrmCls = _isPromiseSupported.v;
1458
+ !_promiseCls && (_promiseCls = createCachedValue((safe(getInst, [STR_PROMISE]).v) || null));
1459
+ var PrmCls = _promiseCls.v;
1441
1460
  if (!PrmCls) {
1442
1461
  return createAsyncPromise(executor);
1443
1462
  }
@@ -1467,7 +1486,7 @@ function createNativePromise(executor, timeout) {
1467
1486
 
1468
1487
  var _promiseCreator;
1469
1488
  function createPromise(executor, timeout) {
1470
- !_promiseCreator && (_promiseCreator = getLazy(function () { return createNativePromise; }));
1489
+ !_promiseCreator && (_promiseCreator = createCachedValue(createNativePromise));
1471
1490
  return _promiseCreator.v.call(this, executor, timeout);
1472
1491
  }
1473
1492
 
@@ -3578,7 +3597,9 @@ var SenderPostManager = /** @class */ (function () {
3578
3597
  return;
3579
3598
  }
3580
3599
  var xhr = openXhr(STR_POST_METHOD, endPointUrl, _sendCredentials, true, sync, payload[_DYN_TIMEOUT ]);
3581
- xhr[_DYN_SET_REQUEST_HEADER ]("Content-type", "application/json");
3600
+ if (!_isOneDs) {
3601
+ xhr[_DYN_SET_REQUEST_HEADER ]("Content-type", "application/json");
3602
+ }
3582
3603
  arrForEach(objKeys(headers), function (headerName) {
3583
3604
  xhr[_DYN_SET_REQUEST_HEADER ](headerName, headers[headerName]);
3584
3605
  });
@@ -4115,7 +4136,7 @@ var _DYN_LENGTH$1 = "length";
4115
4136
  var _DYN_PROCESS_TELEMETRY_ST0 = "processTelemetryStart";
4116
4137
 
4117
4138
  var _a$1;
4118
- var Version = '4.1.3-nightly3.240329-01';
4139
+ var Version = '4.1.3-nightly3.240403-01';
4119
4140
  var FullVersionString = "1DS-Web-JS-" + Version;
4120
4141
  var ObjHasOwnProperty = ObjProto$1.hasOwnProperty;
4121
4142
  var _fieldTypeEventPropMap = (_a$1 = {},
@@ -5756,7 +5777,7 @@ var PostChannel = /** @class */ (function (_super) {
5756
5777
  var _this = _super.call(this) || this;
5757
5778
  _this.identifier = "PostChannel";
5758
5779
  _this.priority = 1011;
5759
- _this.version = '4.1.3-nightly3.240329-01';
5780
+ _this.version = '4.1.3-nightly3.240403-01';
5760
5781
  var _postConfig;
5761
5782
  var _isTeardownCalled = false;
5762
5783
  var _flushCallbackQueue = [];
@@ -6531,4 +6552,4 @@ exports.PostChannel = PostChannel;
6531
6552
  exports.RT_PROFILE = RT_PROFILE;
6532
6553
 
6533
6554
  }));
6534
- //# sourceMappingURL=ms.post-4.1.3-nightly3.240329-01.gbl.js.map
6555
+ //# sourceMappingURL=ms.post-4.1.3-nightly3.240403-01.gbl.js.map