@microsoft/applicationinsights-common 3.4.0-nightlybeta3.2602-27 → 3.4.1

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.
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Common, 3.4.0-nightlybeta3.2602-27
2
+ * Application Insights JavaScript SDK - Common, 3.4.1
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
6
6
  var undef = "undefined";
7
- var nsKey, key, nm, theExports = {}, modName = "es5_applicationinsights_common_3_4_0_nightlybeta3_2602_27", msMod="__ms$mod__";
8
- var mods={}, modDetail=mods[modName]={}, ver="3.4.0-nightlybeta3.2602-27";
7
+ var nsKey, key, nm, theExports = {}, modName = "es5_applicationinsights_common_3_4_1", msMod="__ms$mod__";
8
+ var mods={}, modDetail=mods[modName]={}, ver="3.4.1";
9
9
  var baseNs=global, nsKey="Microsoft", baseNs=baseNs[nsKey]=(baseNs[nsKey]||{});
10
10
  // Versioned namespace "Microsoft.ApplicationInsights3"
11
11
  var exportNs=baseNs, nsKey="ApplicationInsights3", exportNs=exportNs[nsKey]=(exportNs[nsKey]||{});
@@ -26,7 +26,7 @@
26
26
  'use strict';
27
27
 
28
28
 
29
- /*! https://github.com/nevware21/ts-utils v0.12.6 */
29
+ /*! https://github.com/nevware21/ts-utils v0.13.0 */
30
30
  /*#__NO_SIDE_EFFECTS__*/
31
31
  function _pureAssign(func1, func2) {
32
32
  return func1 || func2;
@@ -655,7 +655,7 @@ function _setName(baseClass, name) {
655
655
  name && (baseClass[NAME] = name);
656
656
  }
657
657
  /*#__NO_SIDE_EFFECTS__*/
658
- function createCustomError(name, constructCb, errorBase) {
658
+ function createCustomError(name, constructCb, errorBase, superArgsFn) {
659
659
  var theBaseClass = errorBase || Error;
660
660
  var orgName = theBaseClass[PROTOTYPE][NAME];
661
661
  var captureFn = Error.captureStackTrace;
@@ -664,7 +664,7 @@ function createCustomError(name, constructCb, errorBase) {
664
664
  var theArgs = arguments;
665
665
  try {
666
666
  safe(_setName, [theBaseClass, name]);
667
- var _self = fnApply(theBaseClass, _this, ArrSlice[CALL](theArgs)) || _this;
667
+ var _self = fnApply(theBaseClass, _this, superArgsFn ? superArgsFn(theArgs) : ArrSlice[CALL](theArgs)) || _this;
668
668
  if (_self !== _this) {
669
669
  var orgProto = objGetPrototypeOf(_this);
670
670
  if (orgProto !== objGetPrototypeOf(_self)) {
@@ -693,6 +693,13 @@ function _createTrimFn(exp) {
693
693
  var polyStrTrim = ( /*#__PURE__*/_createTrimFn(/^\s+|(?=\s)\s+$/g));
694
694
  var strTrim = ( /*#__PURE__*/_unwrapFunctionWithPoly("trim", StrProto, polyStrTrim));
695
695
  var mathFloor = ( /*#__PURE__*/_pureRef(MathCls, "floor"));
696
+ /*#__NO_SIDE_EFFECTS__*/
697
+ function safeGetDeferred(cb, defValue, argArray) {
698
+ return getDeferred(function () {
699
+ var result = safe(cb, argArray);
700
+ return result.e ? defValue : result.v;
701
+ });
702
+ }
696
703
  var _fnToString;
697
704
  var _objCtrFnString;
698
705
  var _gblWindow;
@@ -735,13 +742,6 @@ function getPerformance() {
735
742
  }
736
743
  return _perf.v;
737
744
  }
738
- /*#__NO_SIDE_EFFECTS__*/
739
- function safeGetDeferred(cb, defValue, argArray) {
740
- return getDeferred(function () {
741
- var result = safe(cb, argArray);
742
- return result.e ? defValue : result.v;
743
- });
744
- }
745
745
  var mathRound = ( /*#__PURE__*/_pureRef(MathCls, "round"));
746
746
  var objGetOwnPropertyDescriptor = ( /*#__PURE__*/_pureAssign(( /*#__PURE__*/_pureRef(ObjClass$1, GET_OWN_PROPERTY_DESCRIPTOR)), _returnNothing));
747
747
  var strEndsWith = ( /*#__PURE__*/_unwrapFunctionWithPoly("endsWith", StrProto, polyStrEndsWith));
@@ -883,7 +883,6 @@ var _DYN_VALUE = "value";
883
883
  var _DYN_UNLOAD = "unload";
884
884
  var _DYN_REASON = "reason";
885
885
  var _DYN_FLUSH = "flush";
886
- var _DYN_VERSION = "version";
887
886
  var _DYN_LOGGING_LEVEL_CONSOL4 = "loggingLevelConsole";
888
887
  var _DYN_JOIN = "join";
889
888
  var _DYN_MESSAGE_ID = "messageId";
@@ -903,7 +902,12 @@ var _DYN_TRACE_STATE = "traceState";
903
902
  var _DYN_COUNT = "count";
904
903
  var _DYN_PRE_TRIGGER_DATE = "preTriggerDate";
905
904
  var _DYN_GET_UTCDATE = "getUTCDate";
905
+ var _DYN_BASE_DATA = "baseData";
906
+ var _DYN_PROPERTIES = "properties";
907
+ var _DYN_USER_AGENT = "userAgent";
908
+ var _DYN_DURATION = "duration";
906
909
  var _DYN_TO_STRING = "toString";
910
+ var _DYN_HANDLER = "handler";
907
911
  var _DYN_EVT_NAME = "evtName";
908
912
  var _DYN_CONCAT = "concat";
909
913
  var _DYN_INGESTIONENDPOINT = "ingestionendpoint";
@@ -911,8 +915,7 @@ var _DYN_CREATE_EVENT = "createEvent";
911
915
  var _DYN_SUBSTRING = "substring";
912
916
  var _DYN_REMOVE_ITEM = "removeItem";
913
917
  var _DYN_GET_ATTRIBUTE = "getAttribute";
914
- var _DYN_CORRELATION_HEADER_E7 = "correlationHeaderExcludePatterns";
915
- var _DYN_PROPERTIES = "properties";
918
+ var _DYN_CORRELATION_HEADER_E8 = "correlationHeaderExcludePatterns";
916
919
  var _DYN_MEASUREMENTS = "measurements";
917
920
  var _DYN_SIZE_IN_BYTES = "sizeInBytes";
918
921
  var _DYN_TYPE_NAME = "typeName";
@@ -925,7 +928,6 @@ var _DYN_ASSEMBLY = "assembly";
925
928
  var _DYN_FILE_NAME = "fileName";
926
929
  var _DYN_LINE = "line";
927
930
  var _DYN_AI_DATA_CONTRACT = "aiDataContract";
928
- var _DYN_DURATION = "duration";
929
931
 
930
932
  var aggregationErrorType;
931
933
  function throwAggregationError(message, sourceErrors) {
@@ -1247,6 +1249,7 @@ var STR_EXTENSION_CONFIG = "extensionConfig";
1247
1249
  var STR_NOT_DYNAMIC_ERROR = "Not dynamic - ";
1248
1250
  var STR_REDACTED = "REDACTED";
1249
1251
  var DEFAULT_SENSITIVE_PARAMS = ["sig", "Signature", "AWSAccessKeyId", "X-Goog-Signature"];
1252
+ var STR_VERSION = "version";
1250
1253
 
1251
1254
  var strGetPrototypeOf = "getPrototypeOf";
1252
1255
  var rCamelCase = /-([a-z])/g;
@@ -1415,7 +1418,7 @@ function getUserAgentString() {
1415
1418
  if (!_userAgent) {
1416
1419
  _userAgent = getLazy(function () {
1417
1420
  var nav = getNavigator() || {};
1418
- return nav.userAgent || STR_EMPTY;
1421
+ return nav[_DYN_USER_AGENT ] || STR_EMPTY;
1419
1422
  });
1420
1423
  }
1421
1424
  return _userAgent.v;
@@ -1544,9 +1547,13 @@ function redactQueryParameters(url, config) {
1544
1547
  if (questionMarkIndex === -1) {
1545
1548
  return url;
1546
1549
  }
1547
- if (config && config.redactQueryParams) {
1550
+ var option = config ? config.redactUrls : undefined;
1551
+ if (option === 3 ) {
1548
1552
  sensitiveParams = DEFAULT_SENSITIVE_PARAMS[_DYN_CONCAT ](config.redactQueryParams);
1549
1553
  }
1554
+ else if (option === 4 ) {
1555
+ sensitiveParams = config.redactQueryParams;
1556
+ }
1550
1557
  else {
1551
1558
  sensitiveParams = DEFAULT_SENSITIVE_PARAMS;
1552
1559
  }
@@ -1617,7 +1624,8 @@ function fieldRedaction(input, config) {
1617
1624
  if (!input || !isString(input) || strIndexOf(input, " ") !== -1) {
1618
1625
  return input;
1619
1626
  }
1620
- var isRedactionDisabled = config && config.redactUrls === false;
1627
+ var option = config ? config.redactUrls : undefined;
1628
+ var isRedactionDisabled = option === false || option === 2 ;
1621
1629
  if (isRedactionDisabled) {
1622
1630
  return input;
1623
1631
  }
@@ -1626,6 +1634,12 @@ function fieldRedaction(input, config) {
1626
1634
  if (!hasCredentials && !hasQueryParams) {
1627
1635
  return input;
1628
1636
  }
1637
+ if (option === 5 ) {
1638
+ hasQueryParams = false;
1639
+ }
1640
+ if (option === 6 ) {
1641
+ hasCredentials = false;
1642
+ }
1629
1643
  try {
1630
1644
  var result = input;
1631
1645
  if (hasCredentials) {
@@ -1717,7 +1731,7 @@ function newId(maxLength) {
1717
1731
  return result;
1718
1732
  }
1719
1733
 
1720
- var version = '3.4.0-nightlybeta3.2602-27';
1734
+ var version = '3.4.1';
1721
1735
  var instanceName = "." + newId(6);
1722
1736
  var _dataUid = 0;
1723
1737
  function _canAcceptData(target) {
@@ -2464,7 +2478,7 @@ var _InternalLogMessage = /** @class */ (function () {
2464
2478
  }());
2465
2479
  /*#__NO_SIDE_EFFECTS__*/
2466
2480
  function safeGetLogger(core, config) {
2467
- return (core || {})[_DYN_LOGGER ] || new DiagnosticLogger(config);
2481
+ return (core || {})[_DYN_LOGGER ] || new DiagnosticLogger(config || (core || {})[_DYN_CONFIG ]);
2468
2482
  }
2469
2483
  var DiagnosticLogger = /** @class */ (function () {
2470
2484
  function DiagnosticLogger(config) {
@@ -2924,7 +2938,7 @@ function isValidSpanId(value) {
2924
2938
  /*#__NO_SIDE_EFFECTS__*/
2925
2939
  function isValidTraceParent(value) {
2926
2940
  if (!value ||
2927
- !_isValid(value[_DYN_VERSION ], 2, INVALID_VERSION) ||
2941
+ !_isValid(value[STR_VERSION ], 2, INVALID_VERSION) ||
2928
2942
  !_isValid(value[_DYN_TRACE_ID ], 32, INVALID_TRACE_ID) ||
2929
2943
  !_isValid(value[_DYN_SPAN_ID ], 16, INVALID_SPAN_ID) ||
2930
2944
  !_isValid(_formatFlags(value[_DYN_TRACE_FLAGS ]), 2)) {
@@ -2946,7 +2960,7 @@ function formatTraceParent(value) {
2946
2960
  if (!_isValid(flags, 2)) {
2947
2961
  flags = "01";
2948
2962
  }
2949
- var version = value[_DYN_VERSION ] || DEFAULT_VERSION;
2963
+ var version = value[STR_VERSION ] || DEFAULT_VERSION;
2950
2964
  if (version !== "00" && version !== "ff") {
2951
2965
  version = DEFAULT_VERSION;
2952
2966
  }
@@ -3377,7 +3391,7 @@ function _doUnregister(target, events, evtName, unRegFn) {
3377
3391
  if (theEvent) {
3378
3392
  if (!evtName.ns || evtName.ns === theEvent[_DYN_EVT_NAME ].ns) {
3379
3393
  if (!unRegFn || unRegFn(theEvent)) {
3380
- _doDetach(target, theEvent[_DYN_EVT_NAME ], theEvent.handler, theEvent.capture);
3394
+ _doDetach(target, theEvent.evtName, theEvent[_DYN_HANDLER ], theEvent.capture);
3381
3395
  events[_DYN_SPLICE ](idx, 1);
3382
3396
  }
3383
3397
  }
@@ -3444,7 +3458,7 @@ function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) {
3444
3458
  var evtName_1 = _getEvtNamespace(eventName, evtNamespace);
3445
3459
  var found_1 = false;
3446
3460
  _unregisterEvents(target, evtName_1, function (regEvent) {
3447
- if ((evtName_1.ns && !handlerRef) || regEvent.handler === handlerRef) {
3461
+ if ((evtName_1.ns && !handlerRef) || regEvent[_DYN_HANDLER ] === handlerRef) {
3448
3462
  found_1 = true;
3449
3463
  return true;
3450
3464
  }
@@ -3691,9 +3705,9 @@ function correlationIdCanIncludeCorrelationHeader(config, requestUrl, currentHos
3691
3705
  if (!requestUrl || (config && config.disableCorrelationHeaders)) {
3692
3706
  return false;
3693
3707
  }
3694
- if (config && config[_DYN_CORRELATION_HEADER_E7 ]) {
3708
+ if (config && config[_DYN_CORRELATION_HEADER_E8 ]) {
3695
3709
  for (var i = 0; i < config.correlationHeaderExcludePatterns[_DYN_LENGTH ]; i++) {
3696
- if (config[_DYN_CORRELATION_HEADER_E7 ][i].test(requestUrl)) {
3710
+ if (config[_DYN_CORRELATION_HEADER_E8 ][i].test(requestUrl)) {
3697
3711
  return false;
3698
3712
  }
3699
3713
  }
@@ -5152,7 +5166,7 @@ var Data = /** @class */ (function () {
5152
5166
  baseData: 1
5153
5167
  };
5154
5168
  this.baseType = baseType;
5155
- this.baseData = data;
5169
+ this[_DYN_BASE_DATA ] = data;
5156
5170
  }
5157
5171
  return Data;
5158
5172
  }());