@microsoft/applicationinsights-web-basic 2.7.3-nightly.2112-07 → 2.7.3

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.
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "aib",
3
+ "version": "2.7.3",
4
+ "ext": {
5
+ "@js": {
6
+ "file": "aib.2.7.3.js",
7
+ "type": "text/javascript; charset=utf-8",
8
+ "integrity": "sha256-Cxgzz50N0MHUTptE4PXS26wypU6SOTWTUZ+aX0OxZgw= sha384-N92V5XNGnKYF1MOQ16gFiwY1ZynoTofhCTB/0mj90xcYWfjAAEcMnp4Juk+EVF0f sha512-RJM+LAvR7/+QUCpfnW4a5PCEaacvRHqWm1WxB6vPZ3BJE0/fhA62KPVOupR13IWZZv9X/fGeR0POGJPJEE/3KA==",
9
+ "hashes": {
10
+ "sha256": "Cxgzz50N0MHUTptE4PXS26wypU6SOTWTUZ+aX0OxZgw=",
11
+ "sha384": "N92V5XNGnKYF1MOQ16gFiwY1ZynoTofhCTB/0mj90xcYWfjAAEcMnp4Juk+EVF0f",
12
+ "sha512": "RJM+LAvR7/+QUCpfnW4a5PCEaacvRHqWm1WxB6vPZ3BJE0/fhA62KPVOupR13IWZZv9X/fGeR0POGJPJEE/3KA=="
13
+ }
14
+ },
15
+ "@min.js": {
16
+ "file": "aib.2.7.3.min.js",
17
+ "type": "text/javascript; charset=utf-8",
18
+ "integrity": "sha256-llYBJkSlUB1If+V4OOs6COeLOEVJcQ9cVMx3LnbTv5c= sha384-Y5+ZTpip4wKKCLBR0AF8qLVUjkrCR0pk34RLquRma6dg8Bb3AOzcYoSxwHHu8IYA sha512-WHlH5yleKei9geTeTwkCFPmTay1qtAe0CMZE9j+QP0lEZBtS5B05JBp/i0g29hOOzxpWf/9sl2MfVsB5/DIjGg==",
19
+ "hashes": {
20
+ "sha256": "llYBJkSlUB1If+V4OOs6COeLOEVJcQ9cVMx3LnbTv5c=",
21
+ "sha384": "Y5+ZTpip4wKKCLBR0AF8qLVUjkrCR0pk34RLquRma6dg8Bb3AOzcYoSxwHHu8IYA",
22
+ "sha512": "WHlH5yleKei9geTeTwkCFPmTay1qtAe0CMZE9j+QP0lEZBtS5B05JBp/i0g29hOOzxpWf/9sl2MfVsB5/DIjGg=="
23
+ }
24
+ }
25
+ }
26
+ }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript Web SDK - Basic, 2.7.3-nightly.2112-07
2
+ * Application Insights JavaScript Web SDK - Basic, 2.7.3
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -29,20 +29,24 @@
29
29
  var ObjDefineProperty = ObjClass["defineProperty"];
30
30
  var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty];
31
31
 
32
- function getGlobal() {
33
- if (typeof globalThis !== strShimUndefined && globalThis) {
34
- return globalThis;
35
- }
36
- if (typeof self !== strShimUndefined && self) {
37
- return self;
38
- }
39
- if (typeof window !== strShimUndefined && window) {
40
- return window;
41
- }
42
- if (typeof global !== strShimUndefined && global) {
43
- return global;
32
+ var _cachedGlobal = null;
33
+ function getGlobal(useCached) {
34
+ if (useCached === void 0) { useCached = true; }
35
+ if (!_cachedGlobal || !useCached) {
36
+ if (typeof globalThis !== strShimUndefined && globalThis) {
37
+ _cachedGlobal = globalThis;
38
+ }
39
+ if (typeof self !== strShimUndefined && self) {
40
+ _cachedGlobal = self;
41
+ }
42
+ if (typeof window !== strShimUndefined && window) {
43
+ _cachedGlobal = window;
44
+ }
45
+ if (typeof global !== strShimUndefined && global) {
46
+ _cachedGlobal = global;
47
+ }
44
48
  }
45
- return null;
49
+ return _cachedGlobal;
46
50
  }
47
51
  function throwTypeError(message) {
48
52
  throw new TypeError(message);
@@ -439,6 +443,7 @@
439
443
  var strOnPrefix = "on";
440
444
  var strAttachEvent = "attachEvent";
441
445
  var strAddEventHelper = "addEventListener";
446
+ var strToISOString = "toISOString";
442
447
  var _objDefineProperty = ObjDefineProperty;
443
448
  ObjClass["freeze"];
444
449
  ObjClass["seal"];
@@ -539,22 +544,27 @@
539
544
  return typeof value === "boolean";
540
545
  }
541
546
  function toISOString(date) {
542
- if (isDate(date)) {
543
- var pad = function (num) {
544
- var r = String(num);
545
- if (r.length === 1) {
546
- r = "0" + r;
547
- }
548
- return r;
549
- };
550
- return date.getUTCFullYear()
551
- + "-" + pad(date.getUTCMonth() + 1)
552
- + "-" + pad(date.getUTCDate())
553
- + "T" + pad(date.getUTCHours())
554
- + ":" + pad(date.getUTCMinutes())
555
- + ":" + pad(date.getUTCSeconds())
556
- + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)
557
- + "Z";
547
+ if (date) {
548
+ if (date[strToISOString]) {
549
+ return date[strToISOString]();
550
+ }
551
+ if (isDate(date)) {
552
+ var pad = function (num) {
553
+ var r = String(num);
554
+ if (r.length === 1) {
555
+ r = "0" + r;
556
+ }
557
+ return r;
558
+ };
559
+ return date.getUTCFullYear()
560
+ + "-" + pad(date.getUTCMonth() + 1)
561
+ + "-" + pad(date.getUTCDate())
562
+ + "T" + pad(date.getUTCHours())
563
+ + ":" + pad(date.getUTCMinutes())
564
+ + ":" + pad(date.getUTCSeconds())
565
+ + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)
566
+ + "Z";
567
+ }
558
568
  }
559
569
  }
560
570
  function arrForEach(arr, callbackfn, thisArg) {
@@ -748,6 +758,7 @@
748
758
 
749
759
  var strWindow = "window";
750
760
  var strDocument = "document";
761
+ var strDocumentMode = "documentMode";
751
762
  var strNavigator = "navigator";
752
763
  var strLocation = "location";
753
764
  var strConsole = "console";
@@ -877,7 +888,8 @@
877
888
  }
878
889
  var ua = (userAgentStr || "").toLowerCase();
879
890
  if (strContains(ua, strMsie)) {
880
- return parseInt(ua.split(strMsie)[1]);
891
+ var doc = getDocument() || {};
892
+ return Math.max(parseInt(ua.split(strMsie)[1]), (doc[strDocumentMode] || 0));
881
893
  }
882
894
  else if (strContains(ua, strTrident)) {
883
895
  var tridentVer = parseInt(ua.split(strTrident)[1]);
@@ -920,7 +932,7 @@
920
932
  }
921
933
  function useXDomainRequest() {
922
934
  if (_useXDomainRequest === null) {
923
- _useXDomainRequest = (typeof XDomainRequest !== undefined);
935
+ _useXDomainRequest = (typeof XDomainRequest !== "undefined");
924
936
  if (_useXDomainRequest && isXhrSupported()) {
925
937
  _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst("XMLHttpRequest"), "withCredentials");
926
938
  }
@@ -3073,7 +3085,7 @@
3073
3085
  return exceptionData;
3074
3086
  };
3075
3087
  Exception.prototype.toInterface = function () {
3076
- var _a = this, exceptions = _a.exceptions, properties = _a.properties, measurements = _a.measurements, severityLevel = _a.severityLevel; _a.ver; var problemGroup = _a.problemGroup, id = _a.id, isManual = _a.isManual;
3088
+ var _a = this, exceptions = _a.exceptions, properties = _a.properties, measurements = _a.measurements, severityLevel = _a.severityLevel, problemGroup = _a.problemGroup, id = _a.id, isManual = _a.isManual;
3077
3089
  var exceptionDetailsInterface = exceptions instanceof Array
3078
3090
  && arrMap(exceptions, function (exception) { return exception.toInterface(); })
3079
3091
  || undefined;
@@ -3857,7 +3869,7 @@
3857
3869
  }
3858
3870
  }
3859
3871
  var EnvelopeCreator = {
3860
- Version: "2.7.3-nightly.2112-07"
3872
+ Version: "2.7.3"
3861
3873
  };
3862
3874
  function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
3863
3875
  EnvelopeCreatorInit(logger, telemetryItem);
@@ -4764,6 +4776,8 @@
4764
4776
  var plainTextBatch = new Blob([batch], { type: "application/json" });
4765
4777
  var requestHeaders = new Headers();
4766
4778
  var batchLength = batch.length;
4779
+ var ignoreResponse = false;
4780
+ var responseHandled = false;
4767
4781
  if (isInternalApplicationInsightsEndpoint(endPointUrl)) {
4768
4782
  requestHeaders.append(RequestHeaders.sdkContextHeader, RequestHeaders.sdkContextHeaderAppIdRequest);
4769
4783
  }
@@ -4780,6 +4794,7 @@
4780
4794
  _a);
4781
4795
  if (!isAsync) {
4782
4796
  init.keepalive = true;
4797
+ ignoreResponse = true;
4783
4798
  _syncFetchPayload += batchLength;
4784
4799
  }
4785
4800
  var request = new Request(endPointUrl, init);
@@ -4788,27 +4803,44 @@
4788
4803
  }
4789
4804
  catch (e) {
4790
4805
  }
4791
- fetch(request).then(function (response) {
4792
- if (!isAsync) {
4793
- _syncFetchPayload -= batchLength;
4794
- batchLength = 0;
4795
- }
4796
- if (!response.ok) {
4797
- _self._onError(payload, response.statusText);
4798
- }
4799
- else {
4800
- response.text().then(function (text) {
4801
- _checkResponsStatus(response.status, payload, response.url, payload.length, response.statusText, text);
4802
- });
4803
- }
4804
- })["catch"](function (error) {
4805
- if (!isAsync) {
4806
- _syncFetchPayload -= batchLength;
4807
- batchLength = 0;
4808
- }
4809
- _self._onError(payload, error.message);
4810
- });
4811
4806
  _self._buffer.markAsSent(payload);
4807
+ try {
4808
+ fetch(request).then(function (response) {
4809
+ if (!isAsync) {
4810
+ _syncFetchPayload -= batchLength;
4811
+ batchLength = 0;
4812
+ }
4813
+ if (!responseHandled) {
4814
+ responseHandled = true;
4815
+ if (!response.ok) {
4816
+ _self._onError(payload, response.statusText);
4817
+ }
4818
+ else {
4819
+ response.text().then(function (text) {
4820
+ _checkResponsStatus(response.status, payload, response.url, payload.length, response.statusText, text);
4821
+ });
4822
+ }
4823
+ }
4824
+ })["catch"](function (error) {
4825
+ if (!isAsync) {
4826
+ _syncFetchPayload -= batchLength;
4827
+ batchLength = 0;
4828
+ }
4829
+ if (!responseHandled) {
4830
+ responseHandled = true;
4831
+ _self._onError(payload, error.message);
4832
+ }
4833
+ });
4834
+ }
4835
+ catch (e) {
4836
+ if (!responseHandled) {
4837
+ _self._onError(payload, dumpObj(e));
4838
+ }
4839
+ }
4840
+ if (ignoreResponse && !responseHandled) {
4841
+ responseHandled = true;
4842
+ _self._onSuccess(payload, payload.length);
4843
+ }
4812
4844
  }
4813
4845
  function _parseResponse(response) {
4814
4846
  try {
@@ -5006,4 +5038,4 @@
5006
5038
  (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true });
5007
5039
 
5008
5040
  }));
5009
- //# sourceMappingURL=aib.2.7.3-nightly.2112-07.js.map
5041
+ //# sourceMappingURL=aib.2.7.3.js.map