@microsoft/1ds-post-js 4.1.3-nightly3.2403-15 → 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.2403-15.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.2403-15.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.2403-15.gbl.js.map +0 -1
  42. package/bundle/es5/ms.post-4.1.3-nightly3.2403-15.gbl.min.js +0 -7
  43. package/bundle/es5/ms.post-4.1.3-nightly3.2403-15.gbl.min.js.map +0 -1
  44. package/bundle/es5/ms.post-4.1.3-nightly3.2403-15.integrity.json +0 -46
  45. package/bundle/es5/ms.post-4.1.3-nightly3.2403-15.js.map +0 -1
  46. package/bundle/es5/ms.post-4.1.3-nightly3.2403-15.min.js +0 -7
  47. package/bundle/es5/ms.post-4.1.3-nightly3.2403-15.min.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * 1DS JS SDK POST plugin, 4.1.3-nightly3.2403-15
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
  */
@@ -1154,14 +1154,19 @@
1154
1154
  throw new aggregationErrorType(theMessage, sourceErrors || []);
1155
1155
  }
1156
1156
 
1157
+ var STR_PROMISE = "Promise";
1158
+ var REJECTED = "rejected";
1159
+
1157
1160
  function doAwaitResponse(value, cb) {
1158
1161
  return doAwait(value, function (value) {
1159
1162
  return cb ? cb({
1160
- value: value,
1161
- rejected: false
1163
+ status: "fulfilled",
1164
+ rejected: false,
1165
+ value: value
1162
1166
  }) : value;
1163
1167
  }, function (reason) {
1164
1168
  return cb ? cb({
1169
+ status: REJECTED,
1165
1170
  rejected: true,
1166
1171
  reason: reason
1167
1172
  }) : reason;
@@ -1169,18 +1174,32 @@
1169
1174
  }
1170
1175
  function doAwait(value, resolveFn, rejectFn, finallyFn) {
1171
1176
  var result = value;
1172
- if (isPromiseLike(value)) {
1173
- if (resolveFn || rejectFn) {
1174
- result = value.then(resolveFn, rejectFn);
1177
+ try {
1178
+ if (isPromiseLike(value)) {
1179
+ if (resolveFn || rejectFn) {
1180
+ result = value.then(resolveFn, rejectFn);
1181
+ }
1175
1182
  }
1176
- }
1177
- else {
1178
- if (resolveFn) {
1179
- result = resolveFn(value);
1183
+ else {
1184
+ try {
1185
+ if (resolveFn) {
1186
+ result = resolveFn(value);
1187
+ }
1188
+ }
1189
+ catch (err) {
1190
+ if (rejectFn) {
1191
+ result = rejectFn(err);
1192
+ }
1193
+ else {
1194
+ throw err;
1195
+ }
1196
+ }
1180
1197
  }
1181
1198
  }
1182
- if (finallyFn) {
1183
- doFinally(result, finallyFn);
1199
+ finally {
1200
+ if (finallyFn) {
1201
+ doFinally(result, finallyFn);
1202
+ }
1184
1203
  }
1185
1204
  return result;
1186
1205
  }
@@ -1208,21 +1227,22 @@
1208
1227
  return result;
1209
1228
  }
1210
1229
 
1211
- var STRING_STATES = [
1212
- "pending", "resolving", "resolved", "rejected"
1230
+ var STRING_STATES = [
1231
+ "pending", "resolving", "resolved", REJECTED
1213
1232
  ];
1214
1233
 
1215
1234
  var DISPATCH_EVENT = "dispatchEvent";
1216
1235
  var _hasInitEvent;
1236
+ function _hasInitEventFn(doc) {
1237
+ var evt;
1238
+ if (doc && doc.createEvent) {
1239
+ evt = doc.createEvent("Event");
1240
+ }
1241
+ return (!!evt && evt.initEvent);
1242
+ }
1217
1243
  function emitEvent(target, evtName, populateEvent, useNewEvent) {
1218
1244
  var doc = getDocument();
1219
- !_hasInitEvent && (_hasInitEvent = safeGetLazy(function () {
1220
- var evt;
1221
- if (doc && doc.createEvent) {
1222
- evt = doc.createEvent("Event");
1223
- }
1224
- return (!!evt && evt.initEvent);
1225
- }, null));
1245
+ !_hasInitEvent && (_hasInitEvent = createCachedValue(!!safe(_hasInitEventFn, [doc]).v));
1226
1246
  var theEvt = _hasInitEvent.v ? doc.createEvent("Event") : (useNewEvent ? new Event(evtName) : {});
1227
1247
  populateEvent && populateEvent(theEvt);
1228
1248
  if (_hasInitEvent.v) {
@@ -1243,8 +1263,6 @@
1243
1263
  }
1244
1264
  }
1245
1265
 
1246
- var STR_PROMISE = "Promise";
1247
-
1248
1266
  var NODE_UNHANDLED_REJECTION = "unhandledRejection";
1249
1267
  var UNHANDLED_REJECTION = NODE_UNHANDLED_REJECTION.toLowerCase();
1250
1268
  var _unhandledRejectionTimeout = 10;
@@ -1265,7 +1283,7 @@
1265
1283
  var _unHandledRejectionHandler = null;
1266
1284
  var _thePromise;
1267
1285
  !_hasPromiseRejectionEvent && (_hasPromiseRejectionEvent = lazySafeGetInst(STR_PROMISE + "RejectionEvent"));
1268
- var _then = function (onResolved, onRejected) {
1286
+ function _then(onResolved, onRejected) {
1269
1287
  try {
1270
1288
  _handled = true;
1271
1289
  _unHandledRejectionHandler && _unHandledRejectionHandler.cancel();
@@ -1300,11 +1318,11 @@
1300
1318
  }
1301
1319
  finally {
1302
1320
  }
1303
- };
1304
- var _catch = function (onRejected) {
1321
+ }
1322
+ function _catch(onRejected) {
1305
1323
  return _then(undefined, onRejected);
1306
- };
1307
- var _finally = function (onFinally) {
1324
+ }
1325
+ function _finally(onFinally) {
1308
1326
  var thenFinally = onFinally;
1309
1327
  var catchFinally = onFinally;
1310
1328
  if (isFunction(onFinally)) {
@@ -1318,21 +1336,21 @@
1318
1336
  };
1319
1337
  }
1320
1338
  return _then(thenFinally, catchFinally);
1321
- };
1322
- var _strState = function () {
1339
+ }
1340
+ function _strState() {
1323
1341
  return STRING_STATES[_state];
1324
- };
1325
- var _processQueue = function () {
1342
+ }
1343
+ function _processQueue() {
1326
1344
  if (_queue.length > 0) {
1327
1345
  var pending = _queue.slice();
1328
1346
  _queue = [];
1329
1347
  _handled = true;
1330
- processor(pending);
1331
1348
  _unHandledRejectionHandler && _unHandledRejectionHandler.cancel();
1332
1349
  _unHandledRejectionHandler = null;
1350
+ processor(pending);
1333
1351
  }
1334
- };
1335
- var _createSettleIfFn = function (newState, allowState) {
1352
+ }
1353
+ function _createSettleIfFn(newState, allowState) {
1336
1354
  return function (theValue) {
1337
1355
  if (_state === allowState) {
1338
1356
  if (newState === 2 && isPromiseLike(theValue)) {
@@ -1349,9 +1367,10 @@
1349
1367
  }
1350
1368
  }
1351
1369
  };
1352
- };
1353
- var _notifyUnhandledRejection = function () {
1370
+ }
1371
+ function _notifyUnhandledRejection() {
1354
1372
  if (!_handled) {
1373
+ _handled = true;
1355
1374
  if (isNode()) {
1356
1375
  process.emit(NODE_UNHANDLED_REJECTION, _settledValue, _thePromise);
1357
1376
  }
@@ -1364,7 +1383,7 @@
1364
1383
  }, !!_hasPromiseRejectionEvent.v);
1365
1384
  }
1366
1385
  }
1367
- };
1386
+ }
1368
1387
  _thePromise = {
1369
1388
  then: _then,
1370
1389
  "catch": _catch,
@@ -1376,9 +1395,9 @@
1376
1395
  if (hasSymbol()) {
1377
1396
  _thePromise[getKnownSymbol(11 )] = "IPromise";
1378
1397
  }
1379
- var _toString = function () {
1380
- return "IPromise" + ("") + " " + _strState() + (_hasResolved ? (" - " + dumpFnObj(_settledValue)) : "");
1381
- };
1398
+ function _toString() {
1399
+ return "IPromise" + ("") + " " + _strState() + (_hasResolved ? (" - " + dumpFnObj(_settledValue)) : "") + ("");
1400
+ }
1382
1401
  _thePromise.toString = _toString;
1383
1402
  (function _initialize() {
1384
1403
  if (!isFunction(executor)) {
@@ -1395,7 +1414,7 @@
1395
1414
  return _thePromise;
1396
1415
  }
1397
1416
 
1398
- var _processPendingItems = function (pending) {
1417
+ function syncItemProcessor(pending) {
1399
1418
  arrForEach(pending, function (fn) {
1400
1419
  try {
1401
1420
  fn();
@@ -1403,12 +1422,12 @@
1403
1422
  catch (e) {
1404
1423
  }
1405
1424
  });
1406
- };
1425
+ }
1407
1426
  function timeoutItemProcessor(timeout) {
1408
1427
  var callbackTimeout = isNumber(timeout) ? timeout : 0;
1409
1428
  return function (pending) {
1410
1429
  scheduleTimeout(function () {
1411
- _processPendingItems(pending);
1430
+ syncItemProcessor(pending);
1412
1431
  }, callbackTimeout);
1413
1432
  };
1414
1433
  }
@@ -1417,10 +1436,10 @@
1417
1436
  return _createPromise(createAsyncPromise, timeoutItemProcessor(timeout), executor, timeout);
1418
1437
  }
1419
1438
 
1420
- var _isPromiseSupported;
1439
+ var _promiseCls;
1421
1440
  function createNativePromise(executor, timeout) {
1422
- !_isPromiseSupported && (_isPromiseSupported = lazySafeGetInst(STR_PROMISE));
1423
- var PrmCls = _isPromiseSupported.v;
1441
+ !_promiseCls && (_promiseCls = createCachedValue((safe(getInst, [STR_PROMISE]).v) || null));
1442
+ var PrmCls = _promiseCls.v;
1424
1443
  if (!PrmCls) {
1425
1444
  return createAsyncPromise(executor);
1426
1445
  }
@@ -1450,7 +1469,7 @@
1450
1469
 
1451
1470
  var _promiseCreator;
1452
1471
  function createPromise(executor, timeout) {
1453
- !_promiseCreator && (_promiseCreator = getLazy(function () { return createNativePromise; }));
1472
+ !_promiseCreator && (_promiseCreator = createCachedValue(createNativePromise));
1454
1473
  return _promiseCreator.v.call(this, executor, timeout);
1455
1474
  }
1456
1475
 
@@ -3561,7 +3580,9 @@
3561
3580
  return;
3562
3581
  }
3563
3582
  var xhr = openXhr(STR_POST_METHOD, endPointUrl, _sendCredentials, true, sync, payload[_DYN_TIMEOUT ]);
3564
- xhr[_DYN_SET_REQUEST_HEADER ]("Content-type", "application/json");
3583
+ if (!_isOneDs) {
3584
+ xhr[_DYN_SET_REQUEST_HEADER ]("Content-type", "application/json");
3585
+ }
3565
3586
  arrForEach(objKeys(headers), function (headerName) {
3566
3587
  xhr[_DYN_SET_REQUEST_HEADER ](headerName, headers[headerName]);
3567
3588
  });
@@ -4098,7 +4119,7 @@
4098
4119
  var _DYN_PROCESS_TELEMETRY_ST0 = "processTelemetryStart";
4099
4120
 
4100
4121
  var _a$1;
4101
- var Version = '4.1.3-nightly3.2403-15';
4122
+ var Version = '4.1.3-nightly3.240403-01';
4102
4123
  var FullVersionString = "1DS-Web-JS-" + Version;
4103
4124
  var ObjHasOwnProperty = ObjProto$1.hasOwnProperty;
4104
4125
  var _fieldTypeEventPropMap = (_a$1 = {},
@@ -5739,7 +5760,7 @@
5739
5760
  var _this = _super.call(this) || this;
5740
5761
  _this.identifier = "PostChannel";
5741
5762
  _this.priority = 1011;
5742
- _this.version = '4.1.3-nightly3.2403-15';
5763
+ _this.version = '4.1.3-nightly3.240403-01';
5743
5764
  var _postConfig;
5744
5765
  var _isTeardownCalled = false;
5745
5766
  var _flushCallbackQueue = [];