@microsoft/1ds-post-js 3.2.1 → 3.2.2

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 (53) hide show
  1. package/README.md +1 -1
  2. package/bundle/{ms.post-3.2.1.gbl.js → ms.post-3.2.2.gbl.js} +296 -266
  3. package/bundle/ms.post-3.2.2.gbl.js.map +1 -0
  4. package/bundle/ms.post-3.2.2.gbl.min.js +7 -0
  5. package/bundle/ms.post-3.2.2.gbl.min.js.map +1 -0
  6. package/bundle/ms.post-3.2.2.integrity.json +46 -0
  7. package/bundle/{ms.post-3.2.1.js → ms.post-3.2.2.js} +296 -266
  8. package/bundle/ms.post-3.2.2.js.map +1 -0
  9. package/bundle/ms.post-3.2.2.min.js +7 -0
  10. package/bundle/ms.post-3.2.2.min.js.map +1 -0
  11. package/bundle/ms.post.gbl.js +295 -265
  12. package/bundle/ms.post.gbl.js.map +1 -1
  13. package/bundle/ms.post.gbl.min.js +2 -2
  14. package/bundle/ms.post.gbl.min.js.map +1 -1
  15. package/bundle/ms.post.integrity.json +17 -17
  16. package/bundle/ms.post.js +295 -265
  17. package/bundle/ms.post.js.map +1 -1
  18. package/bundle/ms.post.min.js +2 -2
  19. package/bundle/ms.post.min.js.map +1 -1
  20. package/dist/ms.post.js +40 -17
  21. package/dist/ms.post.js.map +1 -1
  22. package/dist/ms.post.min.js +2 -2
  23. package/dist/ms.post.min.js.map +1 -1
  24. package/dist-esm/src/BatchNotificationActions.js +1 -1
  25. package/dist-esm/src/ClockSkewManager.js +1 -1
  26. package/dist-esm/src/Constants.js +1 -1
  27. package/dist-esm/src/DataModels.js +1 -1
  28. package/dist-esm/src/EventBatch.js +1 -1
  29. package/dist-esm/src/HttpManager.d.ts +2 -1
  30. package/dist-esm/src/HttpManager.js +5 -5
  31. package/dist-esm/src/HttpManager.js.map +1 -1
  32. package/dist-esm/src/Index.js +1 -1
  33. package/dist-esm/src/KillSwitch.js +1 -1
  34. package/dist-esm/src/PostChannel.d.ts +2 -5
  35. package/dist-esm/src/PostChannel.js +21 -11
  36. package/dist-esm/src/PostChannel.js.map +1 -1
  37. package/dist-esm/src/RetryPolicy.js +1 -1
  38. package/dist-esm/src/Serializer.js +1 -1
  39. package/dist-esm/src/TimeoutOverrideWrapper.d.ts +18 -0
  40. package/dist-esm/src/TimeoutOverrideWrapper.js +28 -0
  41. package/dist-esm/src/TimeoutOverrideWrapper.js.map +1 -0
  42. package/dist-esm/src/typings/XDomainRequest.js +1 -1
  43. package/package.json +3 -3
  44. package/src/HttpManager.ts +5 -4
  45. package/src/PostChannel.ts +30 -11
  46. package/src/TimeoutOverrideWrapper.ts +29 -0
  47. package/bundle/ms.post-3.2.1.gbl.js.map +0 -1
  48. package/bundle/ms.post-3.2.1.gbl.min.js +0 -7
  49. package/bundle/ms.post-3.2.1.gbl.min.js.map +0 -1
  50. package/bundle/ms.post-3.2.1.integrity.json +0 -46
  51. package/bundle/ms.post-3.2.1.js.map +0 -1
  52. package/bundle/ms.post-3.2.1.min.js +0 -7
  53. package/bundle/ms.post-3.2.1.min.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * 1DS JS SDK POST plugin, 3.2.1
2
+ * 1DS JS SDK POST plugin, 3.2.2
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  * (Microsoft Internal Only)
5
5
  */
@@ -80,6 +80,254 @@
80
80
  d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
81
81
  }
82
82
 
83
+ /*!
84
+ * Microsoft Dynamic Proto Utility, 1.1.6
85
+ * Copyright (c) Microsoft and contributors. All rights reserved.
86
+ */
87
+ var Constructor = 'constructor';
88
+ var Prototype = 'prototype';
89
+ var strFunction = 'function';
90
+ var DynInstFuncTable = '_dynInstFuncs';
91
+ var DynProxyTag = '_isDynProxy';
92
+ var DynClassName = '_dynClass';
93
+ var DynClassNamePrefix = '_dynCls$';
94
+ var DynInstChkTag = '_dynInstChk';
95
+ var DynAllowInstChkTag = DynInstChkTag;
96
+ var DynProtoDefaultOptions = '_dfOpts';
97
+ var UnknownValue = '_unknown_';
98
+ var str__Proto$1 = "__proto__";
99
+ var DynProtoBaseProto = "_dyn" + str__Proto$1;
100
+ var DynProtoCurrent = "_dynInstProto";
101
+ var strUseBaseInst = 'useBaseInst';
102
+ var strSetInstFuncs = 'setInstFuncs';
103
+ var Obj = Object;
104
+ var _objGetPrototypeOf$1 = Obj["getPrototypeOf"];
105
+ var _objGetOwnProps = Obj["getOwnPropertyNames"];
106
+ var _dynamicNames = 0;
107
+ function _hasOwnProperty(obj, prop) {
108
+ return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);
109
+ }
110
+ function _isObjectOrArrayPrototype(target) {
111
+ return target && (target === Obj[Prototype] || target === Array[Prototype]);
112
+ }
113
+ function _isObjectArrayOrFunctionPrototype(target) {
114
+ return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
115
+ }
116
+ function _getObjProto$1(target) {
117
+ var newProto;
118
+ if (target) {
119
+ if (_objGetPrototypeOf$1) {
120
+ return _objGetPrototypeOf$1(target);
121
+ }
122
+ var curProto = target[str__Proto$1] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
123
+ newProto = target[DynProtoBaseProto] || curProto;
124
+ if (!_hasOwnProperty(target, DynProtoBaseProto)) {
125
+ delete target[DynProtoCurrent];
126
+ newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto];
127
+ target[DynProtoCurrent] = curProto;
128
+ }
129
+ }
130
+ return newProto;
131
+ }
132
+ function _forEachProp(target, func) {
133
+ var props = [];
134
+ if (_objGetOwnProps) {
135
+ props = _objGetOwnProps(target);
136
+ }
137
+ else {
138
+ for (var name_1 in target) {
139
+ if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) {
140
+ props.push(name_1);
141
+ }
142
+ }
143
+ }
144
+ if (props && props.length > 0) {
145
+ for (var lp = 0; lp < props.length; lp++) {
146
+ func(props[lp]);
147
+ }
148
+ }
149
+ }
150
+ function _isDynamicCandidate(target, funcName, skipOwn) {
151
+ return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));
152
+ }
153
+ function _throwTypeError(message) {
154
+ throw new TypeError("DynamicProto: " + message);
155
+ }
156
+ function _getInstanceFuncs(thisTarget) {
157
+ var instFuncs = {};
158
+ _forEachProp(thisTarget, function (name) {
159
+ if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {
160
+ instFuncs[name] = thisTarget[name];
161
+ }
162
+ });
163
+ return instFuncs;
164
+ }
165
+ function _hasVisited(values, value) {
166
+ for (var lp = values.length - 1; lp >= 0; lp--) {
167
+ if (values[lp] === value) {
168
+ return true;
169
+ }
170
+ }
171
+ return false;
172
+ }
173
+ function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
174
+ function _instFuncProxy(target, funcHost, funcName) {
175
+ var theFunc = funcHost[funcName];
176
+ if (theFunc[DynProxyTag] && useBaseInst) {
177
+ var instFuncTable = target[DynInstFuncTable] || {};
178
+ if (instFuncTable[DynAllowInstChkTag] !== false) {
179
+ theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;
180
+ }
181
+ }
182
+ return function () {
183
+ return theFunc.apply(target, arguments);
184
+ };
185
+ }
186
+ var baseFuncs = {};
187
+ _forEachProp(instFuncs, function (name) {
188
+ baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
189
+ });
190
+ var baseProto = _getObjProto$1(classProto);
191
+ var visited = [];
192
+ while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
193
+ _forEachProp(baseProto, function (name) {
194
+ if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf$1)) {
195
+ baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
196
+ }
197
+ });
198
+ visited.push(baseProto);
199
+ baseProto = _getObjProto$1(baseProto);
200
+ }
201
+ return baseFuncs;
202
+ }
203
+ function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
204
+ var instFunc = null;
205
+ if (target && _hasOwnProperty(proto, DynClassName)) {
206
+ var instFuncTable = target[DynInstFuncTable] || {};
207
+ instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];
208
+ if (!instFunc) {
209
+ _throwTypeError("Missing [" + funcName + "] " + strFunction);
210
+ }
211
+ if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
212
+ var canAddInst = !_hasOwnProperty(target, funcName);
213
+ var objProto = _getObjProto$1(target);
214
+ var visited = [];
215
+ while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
216
+ var protoFunc = objProto[funcName];
217
+ if (protoFunc) {
218
+ canAddInst = (protoFunc === currentDynProtoProxy);
219
+ break;
220
+ }
221
+ visited.push(objProto);
222
+ objProto = _getObjProto$1(objProto);
223
+ }
224
+ try {
225
+ if (canAddInst) {
226
+ target[funcName] = instFunc;
227
+ }
228
+ instFunc[DynInstChkTag] = 1;
229
+ }
230
+ catch (e) {
231
+ instFuncTable[DynAllowInstChkTag] = false;
232
+ }
233
+ }
234
+ }
235
+ return instFunc;
236
+ }
237
+ function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
238
+ var protoFunc = proto[funcName];
239
+ if (protoFunc === currentDynProtoProxy) {
240
+ protoFunc = _getObjProto$1(proto)[funcName];
241
+ }
242
+ if (typeof protoFunc !== strFunction) {
243
+ _throwTypeError("[" + funcName + "] is not a " + strFunction);
244
+ }
245
+ return protoFunc;
246
+ }
247
+ function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
248
+ function _createDynamicPrototype(proto, funcName) {
249
+ var dynProtoProxy = function () {
250
+ var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
251
+ return instFunc.apply(this, arguments);
252
+ };
253
+ dynProtoProxy[DynProxyTag] = 1;
254
+ return dynProtoProxy;
255
+ }
256
+ if (!_isObjectOrArrayPrototype(proto)) {
257
+ var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};
258
+ var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {});
259
+ if (instFuncTable[DynAllowInstChkTag] !== false) {
260
+ instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
261
+ }
262
+ _forEachProp(target, function (name) {
263
+ if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
264
+ instFuncs_1[name] = target[name];
265
+ delete target[name];
266
+ if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
267
+ proto[name] = _createDynamicPrototype(proto, name);
268
+ }
269
+ }
270
+ });
271
+ }
272
+ }
273
+ function _checkPrototype(classProto, thisTarget) {
274
+ if (_objGetPrototypeOf$1) {
275
+ var visited = [];
276
+ var thisProto = _getObjProto$1(thisTarget);
277
+ while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
278
+ if (thisProto === classProto) {
279
+ return true;
280
+ }
281
+ visited.push(thisProto);
282
+ thisProto = _getObjProto$1(thisProto);
283
+ }
284
+ return false;
285
+ }
286
+ return true;
287
+ }
288
+ function _getObjName(target, unknownValue) {
289
+ if (_hasOwnProperty(target, Prototype)) {
290
+ return target.name || unknownValue || UnknownValue;
291
+ }
292
+ return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;
293
+ }
294
+ function dynamicProto(theClass, target, delegateFunc, options) {
295
+ if (!_hasOwnProperty(theClass, Prototype)) {
296
+ _throwTypeError("theClass is an invalid class definition.");
297
+ }
298
+ var classProto = theClass[Prototype];
299
+ if (!_checkPrototype(classProto, target)) {
300
+ _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]");
301
+ }
302
+ var className = null;
303
+ if (_hasOwnProperty(classProto, DynClassName)) {
304
+ className = classProto[DynClassName];
305
+ }
306
+ else {
307
+ className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames;
308
+ _dynamicNames++;
309
+ classProto[DynClassName] = className;
310
+ }
311
+ var perfOptions = dynamicProto[DynProtoDefaultOptions];
312
+ var useBaseInst = !!perfOptions[strUseBaseInst];
313
+ if (useBaseInst && options && options[strUseBaseInst] !== undefined) {
314
+ useBaseInst = !!options[strUseBaseInst];
315
+ }
316
+ var instFuncs = _getInstanceFuncs(target);
317
+ var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
318
+ delegateFunc(target, baseFuncs);
319
+ var setInstanceFunc = !!_objGetPrototypeOf$1 && !!perfOptions[strSetInstFuncs];
320
+ if (setInstanceFunc && options) {
321
+ setInstanceFunc = !!options[strSetInstFuncs];
322
+ }
323
+ _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
324
+ }
325
+ var perfDefaults = {
326
+ setInstFuncs: true,
327
+ useBaseInst: true
328
+ };
329
+ dynamicProto[DynProtoDefaultOptions] = perfDefaults;
330
+
83
331
  var strEmpty = "";
84
332
  var strSetNextPlugin = "setNextPlugin";
85
333
  var strIsInitialized = "isInitialized";
@@ -93,7 +341,7 @@
93
341
  var strIndexOf = "indexOf";
94
342
  var cStrTrim = "trim";
95
343
  var strToString = "toString";
96
- var str__Proto$1 = "__proto__";
344
+ var str__Proto = "__proto__";
97
345
  var strConstructor = "constructor";
98
346
  var _objDefineProperty$1 = ObjDefineProperty;
99
347
  var _objFreeze = ObjClass.freeze;
@@ -108,13 +356,13 @@
108
356
  var rCamelCase = /-([a-z])/g;
109
357
  var rNormalizeInvalid = /([^\w\d_$])/g;
110
358
  var rLeadingNumeric = /^(\d+[\w\d_$])/;
111
- var _objGetPrototypeOf$1 = Object["getPrototypeOf"];
112
- function _getObjProto$1(target) {
359
+ var _objGetPrototypeOf = Object["getPrototypeOf"];
360
+ function _getObjProto(target) {
113
361
  if (target) {
114
- if (_objGetPrototypeOf$1) {
115
- return _objGetPrototypeOf$1(target);
362
+ if (_objGetPrototypeOf) {
363
+ return _objGetPrototypeOf(target);
116
364
  }
117
- var newProto = target[str__Proto$1] || target[strShimPrototype] || target[strConstructor];
365
+ var newProto = target[str__Proto] || target[strShimPrototype] || target[strConstructor];
118
366
  if (newProto) {
119
367
  return newProto;
120
368
  }
@@ -200,7 +448,7 @@
200
448
  function isPlainObject(value) {
201
449
  var result = false;
202
450
  if (value && typeof value === "object") {
203
- var proto = _objGetPrototypeOf$1 ? _objGetPrototypeOf$1(value) : _getObjProto$1(value);
451
+ var proto = _objGetPrototypeOf ? _objGetPrototypeOf(value) : _getObjProto(value);
204
452
  if (!proto) {
205
453
  result = true;
206
454
  }
@@ -431,247 +679,6 @@
431
679
  QueueFull: 5
432
680
  });
433
681
 
434
- /*!
435
- * Microsoft Dynamic Proto Utility, 1.1.4
436
- * Copyright (c) Microsoft and contributors. All rights reserved.
437
- */
438
- var Constructor = 'constructor';
439
- var Prototype = 'prototype';
440
- var strFunction = 'function';
441
- var DynInstFuncTable = '_dynInstFuncs';
442
- var DynProxyTag = '_isDynProxy';
443
- var DynClassName = '_dynClass';
444
- var DynClassNamePrefix = '_dynCls$';
445
- var DynInstChkTag = '_dynInstChk';
446
- var DynAllowInstChkTag = DynInstChkTag;
447
- var DynProtoDefaultOptions = '_dfOpts';
448
- var UnknownValue = '_unknown_';
449
- var str__Proto = "__proto__";
450
- var strUseBaseInst = 'useBaseInst';
451
- var strSetInstFuncs = 'setInstFuncs';
452
- var Obj = Object;
453
- var _objGetPrototypeOf = Obj["getPrototypeOf"];
454
- var _dynamicNames = 0;
455
- function _hasOwnProperty(obj, prop) {
456
- return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);
457
- }
458
- function _isObjectOrArrayPrototype(target) {
459
- return target && (target === Obj[Prototype] || target === Array[Prototype]);
460
- }
461
- function _isObjectArrayOrFunctionPrototype(target) {
462
- return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
463
- }
464
- function _getObjProto(target) {
465
- if (target) {
466
- if (_objGetPrototypeOf) {
467
- return _objGetPrototypeOf(target);
468
- }
469
- var newProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
470
- if (newProto) {
471
- return newProto;
472
- }
473
- }
474
- return null;
475
- }
476
- function _forEachProp(target, func) {
477
- var props = [];
478
- var getOwnProps = Obj["getOwnPropertyNames"];
479
- if (getOwnProps) {
480
- props = getOwnProps(target);
481
- }
482
- else {
483
- for (var name_1 in target) {
484
- if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) {
485
- props.push(name_1);
486
- }
487
- }
488
- }
489
- if (props && props.length > 0) {
490
- for (var lp = 0; lp < props.length; lp++) {
491
- func(props[lp]);
492
- }
493
- }
494
- }
495
- function _isDynamicCandidate(target, funcName, skipOwn) {
496
- return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));
497
- }
498
- function _throwTypeError(message) {
499
- throw new TypeError("DynamicProto: " + message);
500
- }
501
- function _getInstanceFuncs(thisTarget) {
502
- var instFuncs = {};
503
- _forEachProp(thisTarget, function (name) {
504
- if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {
505
- instFuncs[name] = thisTarget[name];
506
- }
507
- });
508
- return instFuncs;
509
- }
510
- function _hasVisited(values, value) {
511
- for (var lp = values.length - 1; lp >= 0; lp--) {
512
- if (values[lp] === value) {
513
- return true;
514
- }
515
- }
516
- return false;
517
- }
518
- function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
519
- function _instFuncProxy(target, funcHost, funcName) {
520
- var theFunc = funcHost[funcName];
521
- if (theFunc[DynProxyTag] && useBaseInst) {
522
- var instFuncTable = target[DynInstFuncTable] || {};
523
- if (instFuncTable[DynAllowInstChkTag] !== false) {
524
- theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;
525
- }
526
- }
527
- return function () {
528
- return theFunc.apply(target, arguments);
529
- };
530
- }
531
- var baseFuncs = {};
532
- _forEachProp(instFuncs, function (name) {
533
- baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
534
- });
535
- var baseProto = _getObjProto(classProto);
536
- var visited = [];
537
- while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
538
- _forEachProp(baseProto, function (name) {
539
- if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {
540
- baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
541
- }
542
- });
543
- visited.push(baseProto);
544
- baseProto = _getObjProto(baseProto);
545
- }
546
- return baseFuncs;
547
- }
548
- function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
549
- var instFunc = null;
550
- if (target && _hasOwnProperty(proto, DynClassName)) {
551
- var instFuncTable = target[DynInstFuncTable] || {};
552
- instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];
553
- if (!instFunc) {
554
- _throwTypeError("Missing [" + funcName + "] " + strFunction);
555
- }
556
- if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
557
- var canAddInst = !_hasOwnProperty(target, funcName);
558
- var objProto = _getObjProto(target);
559
- var visited = [];
560
- while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
561
- var protoFunc = objProto[funcName];
562
- if (protoFunc) {
563
- canAddInst = (protoFunc === currentDynProtoProxy);
564
- break;
565
- }
566
- visited.push(objProto);
567
- objProto = _getObjProto(objProto);
568
- }
569
- try {
570
- if (canAddInst) {
571
- target[funcName] = instFunc;
572
- }
573
- instFunc[DynInstChkTag] = 1;
574
- }
575
- catch (e) {
576
- instFuncTable[DynAllowInstChkTag] = false;
577
- }
578
- }
579
- }
580
- return instFunc;
581
- }
582
- function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
583
- var protoFunc = proto[funcName];
584
- if (protoFunc === currentDynProtoProxy) {
585
- protoFunc = _getObjProto(proto)[funcName];
586
- }
587
- if (typeof protoFunc !== strFunction) {
588
- _throwTypeError("[" + funcName + "] is not a " + strFunction);
589
- }
590
- return protoFunc;
591
- }
592
- function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
593
- function _createDynamicPrototype(proto, funcName) {
594
- var dynProtoProxy = function () {
595
- var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
596
- return instFunc.apply(this, arguments);
597
- };
598
- dynProtoProxy[DynProxyTag] = 1;
599
- return dynProtoProxy;
600
- }
601
- if (!_isObjectOrArrayPrototype(proto)) {
602
- var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};
603
- var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {});
604
- if (instFuncTable[DynAllowInstChkTag] !== false) {
605
- instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
606
- }
607
- _forEachProp(target, function (name) {
608
- if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
609
- instFuncs_1[name] = target[name];
610
- delete target[name];
611
- if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
612
- proto[name] = _createDynamicPrototype(proto, name);
613
- }
614
- }
615
- });
616
- }
617
- }
618
- function _checkPrototype(classProto, thisTarget) {
619
- if (_objGetPrototypeOf) {
620
- var visited = [];
621
- var thisProto = _getObjProto(thisTarget);
622
- while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
623
- if (thisProto === classProto) {
624
- return true;
625
- }
626
- visited.push(thisProto);
627
- thisProto = _getObjProto(thisProto);
628
- }
629
- }
630
- return false;
631
- }
632
- function _getObjName(target, unknownValue) {
633
- if (_hasOwnProperty(target, Prototype)) {
634
- return target.name || unknownValue || UnknownValue;
635
- }
636
- return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;
637
- }
638
- function dynamicProto(theClass, target, delegateFunc, options) {
639
- if (!_hasOwnProperty(theClass, Prototype)) {
640
- _throwTypeError("theClass is an invalid class definition.");
641
- }
642
- var classProto = theClass[Prototype];
643
- if (!_checkPrototype(classProto, target)) {
644
- _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]");
645
- }
646
- var className = null;
647
- if (_hasOwnProperty(classProto, DynClassName)) {
648
- className = classProto[DynClassName];
649
- }
650
- else {
651
- className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames;
652
- _dynamicNames++;
653
- classProto[DynClassName] = className;
654
- }
655
- var perfOptions = dynamicProto[DynProtoDefaultOptions];
656
- var useBaseInst = !!perfOptions[strUseBaseInst];
657
- if (useBaseInst && options && options[strUseBaseInst] !== undefined) {
658
- useBaseInst = !!options[strUseBaseInst];
659
- }
660
- var instFuncs = _getInstanceFuncs(target);
661
- var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
662
- delegateFunc(target, baseFuncs);
663
- var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];
664
- if (setInstanceFunc && options) {
665
- setInstanceFunc = !!options[strSetInstFuncs];
666
- }
667
- _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
668
- }
669
- var perfDefaults = {
670
- setInstFuncs: true,
671
- useBaseInst: true
672
- };
673
- dynamicProto[DynProtoDefaultOptions] = perfDefaults;
674
-
675
682
  var strWindow = "window";
676
683
  var strDocument = "document";
677
684
  var strNavigator = "navigator";
@@ -933,7 +940,7 @@
933
940
  if (isUserAct === void 0) { isUserAct = false; }
934
941
  var message = new _InternalLogMessage(msgId, msg, isUserAct, properties);
935
942
  if (_self.enableDebugExceptions()) {
936
- throw message;
943
+ throw dumpObj(message);
937
944
  }
938
945
  else {
939
946
  var logFunc = severity === 1 ? strErrorToConsole : strWarnToConsole;
@@ -1207,7 +1214,7 @@
1207
1214
  }
1208
1215
 
1209
1216
  var _objDefineProperty = ObjDefineProperty;
1210
- var version = "2.8.1";
1217
+ var version = "2.8.3";
1211
1218
  var instanceName = "." + newId(6);
1212
1219
  var _dataUid = 0;
1213
1220
  function _createAccessor(target, prop, value) {
@@ -2093,7 +2100,7 @@
2093
2100
  }
2094
2101
 
2095
2102
  var _a$1;
2096
- var Version = '3.2.1';
2103
+ var Version = '3.2.2';
2097
2104
  var FullVersionString = "1DS-Web-JS-" + Version;
2098
2105
  var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
2099
2106
  var strWithCredentials = "withCredentials";
@@ -2108,7 +2115,7 @@
2108
2115
  _a$1[4096 | 3 ] = 7 ,
2109
2116
  _a$1);
2110
2117
  Boolean(getDocument());
2111
- var isWindowObjectAvailable = Boolean(getWindow());
2118
+ Boolean(getWindow());
2112
2119
  function isValueAssigned(value) {
2113
2120
  return !(value === "" || isNullOrUndefined(value));
2114
2121
  }
@@ -2802,7 +2809,7 @@
2802
2809
  }
2803
2810
  }
2804
2811
  var HttpManager = /** @class */ (function () {
2805
- function HttpManager(maxEventsPerBatch, maxConnections, maxRequestRetriesBeforeBackoff, actions) {
2812
+ function HttpManager(maxEventsPerBatch, maxConnections, maxRequestRetriesBeforeBackoff, actions, timeoutOverride) {
2806
2813
  this._responseHandlers = [];
2807
2814
  var _urlString = "?cors=true&" + strContentTypeHeader.toLowerCase() + "=" + defaultContentType;
2808
2815
  var _killSwitch = new EVTKillSwitch();
@@ -2941,7 +2948,7 @@
2941
2948
  xdr.send(payload.data);
2942
2949
  }
2943
2950
  else {
2944
- _postManager._setTimeoutOverride(function () {
2951
+ timeoutOverride.set(function () {
2945
2952
  xdr.send(payload.data);
2946
2953
  }, 0);
2947
2954
  }
@@ -2999,7 +3006,7 @@
2999
3006
  _doOnComplete(oncomplete, 200, {});
3000
3007
  }
3001
3008
  if (!responseHandled && payload.timeout > 0) {
3002
- _postManager._setTimeoutOverride(function () {
3009
+ timeoutOverride.set(function () {
3003
3010
  if (!responseHandled) {
3004
3011
  responseHandled = true;
3005
3012
  _doOnComplete(oncomplete, 500, {});
@@ -3538,7 +3545,7 @@
3538
3545
  cb();
3539
3546
  }
3540
3547
  else {
3541
- _postManager._setTimeoutOverride(cb, interval);
3548
+ timeoutOverride.set(cb, interval);
3542
3549
  }
3543
3550
  }
3544
3551
  function _convertAllHeadersToMap(headersString) {
@@ -3630,13 +3637,29 @@
3630
3637
  return HttpManager;
3631
3638
  }());
3632
3639
 
3640
+ function defaultSetTimeout(callback, ms) {
3641
+ var args = [];
3642
+ for (var _i = 2; _i < arguments.length; _i++) {
3643
+ args[_i - 2] = arguments[_i];
3644
+ }
3645
+ return setTimeout(callback, ms, args);
3646
+ }
3647
+ function defaultClearTimeout(timeoutId) {
3648
+ clearTimeout(timeoutId);
3649
+ }
3650
+ function createTimeoutWrapper(argSetTimeout, argClearTimeout) {
3651
+ return {
3652
+ set: argSetTimeout || defaultSetTimeout,
3653
+ clear: argClearTimeout || defaultClearTimeout
3654
+ };
3655
+ }
3656
+
3633
3657
  var FlushCheckTimer = 0.250;
3634
3658
  var MaxNumberEventPerBatch = 500;
3635
3659
  var EventsDroppedAtOneTime = 20;
3636
3660
  var MaxSendAttempts = 6;
3637
3661
  var MaxSyncUnloadSendAttempts = 2;
3638
3662
  var MaxBackoffCount = 4;
3639
- var globalContext = isWindowObjectAvailable ? window : undefined;
3640
3663
  var MaxConnections = 2;
3641
3664
  var MaxRequestRetriesBeforeBackoff = 1;
3642
3665
  var strEventsDiscarded = "eventsDiscarded";
@@ -3650,7 +3673,7 @@
3650
3673
  var _this = _super.call(this) || this;
3651
3674
  _this.identifier = "PostChannel";
3652
3675
  _this.priority = 1011;
3653
- _this.version = '3.2.1';
3676
+ _this.version = '3.2.2';
3654
3677
  var _config;
3655
3678
  var _isTeardownCalled = false;
3656
3679
  var _flushCallbackQueue = [];
@@ -3679,6 +3702,7 @@
3679
3702
  var _maxEventSendAttempts = MaxSendAttempts;
3680
3703
  var _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts;
3681
3704
  var _evtNamespace;
3705
+ var _timeoutWrapper;
3682
3706
  dynamicProto(PostChannel, _this, function (_self, _base) {
3683
3707
  _initDefaults();
3684
3708
  _self["_getDbgPlgTargets"] = function () {
@@ -3694,8 +3718,7 @@
3694
3718
  var ctx = _self._getTelCtx();
3695
3719
  coreConfig.extensionConfig[_self.identifier] = coreConfig.extensionConfig[_self.identifier] || {};
3696
3720
  _config = ctx.getExtCfg(_self.identifier);
3697
- _self._setTimeoutOverride = _config.setTimeoutOverride ? _config.setTimeoutOverride : setTimeout.bind(globalContext);
3698
- _self._clearTimeoutOverride = _config.clearTimeoutOverride ? _config.clearTimeoutOverride : clearTimeout.bind(globalContext);
3721
+ _timeoutWrapper = createTimeoutWrapper(_config.setTimeoutOverride, _config.clearTimeoutOverride);
3699
3722
  _optimizeObject = !_config.disableOptimizeObj && isChromium();
3700
3723
  _hookWParam(extendedCore);
3701
3724
  if (_config.eventsLimitInMem > 0) {
@@ -4028,6 +4051,7 @@
4028
4051
  _maxEventSendAttempts = MaxSendAttempts;
4029
4052
  _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts;
4030
4053
  _evtNamespace = null;
4054
+ _timeoutWrapper = createTimeoutWrapper();
4031
4055
  _httpManager = new HttpManager(MaxNumberEventPerBatch, MaxConnections, MaxRequestRetriesBeforeBackoff, {
4032
4056
  requeue: _requeueEvents,
4033
4057
  send: _sendingEvent,
@@ -4035,7 +4059,7 @@
4035
4059
  drop: _eventsDropped,
4036
4060
  rspFail: _eventsResponseFail,
4037
4061
  oth: _otherEvent
4038
- });
4062
+ }, _timeoutWrapper);
4039
4063
  _initializeProfiles();
4040
4064
  _clearQueues();
4041
4065
  _setAutoLimits();
@@ -4048,11 +4072,11 @@
4048
4072
  if (_currentBackoffCount) {
4049
4073
  timerMultiplier = retryPolicyGetMillisToBackoffForRetry(_currentBackoffCount - 1);
4050
4074
  }
4051
- return _self._setTimeoutOverride(theTimerFunc, timeOut * timerMultiplier);
4075
+ return _timeoutWrapper.set(theTimerFunc, timeOut * timerMultiplier);
4052
4076
  }
4053
4077
  function _clearScheduledTimer() {
4054
4078
  if (_scheduledTimerId !== null) {
4055
- _self._clearTimeoutOverride(_scheduledTimerId);
4079
+ _timeoutWrapper.clear(_scheduledTimerId);
4056
4080
  _scheduledTimerId = null;
4057
4081
  _timerCount = 0;
4058
4082
  }
@@ -4060,7 +4084,7 @@
4060
4084
  function _releaseAllQueues(sendType, sendReason) {
4061
4085
  _clearScheduledTimer();
4062
4086
  if (_flushCallbackTimerId) {
4063
- _self._clearTimeoutOverride(_flushCallbackTimerId);
4087
+ _timeoutWrapper.clear(_flushCallbackTimerId);
4064
4088
  _flushCallbackTimerId = null;
4065
4089
  }
4066
4090
  if (!_paused) {
@@ -4354,6 +4378,12 @@
4354
4378
  _autoFlushBatchLimit = 0;
4355
4379
  }
4356
4380
  }
4381
+ objDefineAccessors(_self, "_setTimeoutOverride", function () { return _timeoutWrapper.set; }, function (value) {
4382
+ _timeoutWrapper = createTimeoutWrapper(value, _timeoutWrapper.clear);
4383
+ });
4384
+ objDefineAccessors(_self, "_clearTimeoutOverride", function () { return _timeoutWrapper.clear; }, function (value) {
4385
+ _timeoutWrapper = createTimeoutWrapper(_timeoutWrapper.set, value);
4386
+ });
4357
4387
  });
4358
4388
  return _this;
4359
4389
  }