@microsoft/applicationinsights-web-basic 3.0.0-beta.2302-01 → 3.0.0-beta.2302-03

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": "3.0.0-beta.2302-03",
4
+ "ext": {
5
+ "@js": {
6
+ "file": "aib.3.0.0-beta.2302-03.js",
7
+ "type": "text/javascript; charset=utf-8",
8
+ "integrity": "sha256-qIw9FwnwMvnXpJeyLh/ap3eccmLzZvie6C/reDLyY6w= sha384-x7TVfPbrAqfiOAcDQu6GsRmJPhGMfugwha9JsYpJevij0Djswt0Ebmjfv7ixvW95 sha512-cpBjOihDFCXoDD3EtDRgaZ8drJ4jE6fjysiMwySeg3ZvVfiTPkKf1rOHb9N4rhYbFTl6eh/7jscza09MWLwH8w==",
9
+ "hashes": {
10
+ "sha256": "qIw9FwnwMvnXpJeyLh/ap3eccmLzZvie6C/reDLyY6w=",
11
+ "sha384": "x7TVfPbrAqfiOAcDQu6GsRmJPhGMfugwha9JsYpJevij0Djswt0Ebmjfv7ixvW95",
12
+ "sha512": "cpBjOihDFCXoDD3EtDRgaZ8drJ4jE6fjysiMwySeg3ZvVfiTPkKf1rOHb9N4rhYbFTl6eh/7jscza09MWLwH8w=="
13
+ }
14
+ },
15
+ "@min.js": {
16
+ "file": "aib.3.0.0-beta.2302-03.min.js",
17
+ "type": "text/javascript; charset=utf-8",
18
+ "integrity": "sha256-mgD0d7JwCVdVLWq9nDHLj/6BgW8nbeYcsEd1KFWjHsY= sha384-xlSgZypXt8RUaz5S53e0YtmuTwaA0ehZkjIW910VgKxFU/68+LzcwsSd+kcTFap5 sha512-Skjd3ensG4+iosi5XU1WDGr+VgfhoANrq86ToW3+VG+1yP34979xLVfRjblvw05b8MjhUdccDtkwFtMRMf9+Ow==",
19
+ "hashes": {
20
+ "sha256": "mgD0d7JwCVdVLWq9nDHLj/6BgW8nbeYcsEd1KFWjHsY=",
21
+ "sha384": "xlSgZypXt8RUaz5S53e0YtmuTwaA0ehZkjIW910VgKxFU/68+LzcwsSd+kcTFap5",
22
+ "sha512": "Skjd3ensG4+iosi5XU1WDGr+VgfhoANrq86ToW3+VG+1yP34979xLVfRjblvw05b8MjhUdccDtkwFtMRMf9+Ow=="
23
+ }
24
+ }
25
+ }
26
+ }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript Web SDK - Basic, 3.0.0-beta.2302-01
2
+ * Application Insights JavaScript Web SDK - Basic, 3.0.0-beta.2302-03
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -1042,6 +1042,44 @@
1042
1042
  var TRIM = "trim";
1043
1043
  var strTrim = StrProto[TRIM] ? _unwrapFunction(TRIM) : polyStrTrim;
1044
1044
 
1045
+ function _createTimerHandler(startTimer, refreshFn, cancelFn) {
1046
+ var ref = true;
1047
+ var timerId = startTimer ? refreshFn(null) : null;
1048
+ function _unref() {
1049
+ ref = false;
1050
+ timerId && timerId["unref"] && timerId["unref"]();
1051
+ return timer;
1052
+ }
1053
+ function _ref() {
1054
+ ref = true;
1055
+ timerId && timerId["ref"] && timerId["ref"]();
1056
+ return timer;
1057
+ }
1058
+ function _hasRef() {
1059
+ if (timerId && timerId["hasRef"]) {
1060
+ return timerId["hasRef"]();
1061
+ }
1062
+ return ref;
1063
+ }
1064
+ var timer = {
1065
+ cancel: function () {
1066
+ timerId && cancelFn(timerId);
1067
+ timerId = null;
1068
+ },
1069
+ refresh: function () {
1070
+ timerId = refreshFn(timerId);
1071
+ if (!ref) {
1072
+ _unref();
1073
+ }
1074
+ return timer;
1075
+ },
1076
+ hasRef: _hasRef,
1077
+ ref: _ref,
1078
+ unref: _unref
1079
+ };
1080
+ return timer;
1081
+ }
1082
+
1045
1083
  function _extractArgs(args, startAt) {
1046
1084
  var theArgs = [];
1047
1085
  for (var lp = startAt; lp < args[LENGTH]; lp++) {
@@ -1050,38 +1088,37 @@
1050
1088
  return theArgs;
1051
1089
  }
1052
1090
 
1053
- function _scheduleTimeoutWith(self, setTimeoutFn, clearTimeoutFn, theArgs) {
1054
- var timeoutId = setTimeoutFn.apply(self, theArgs);
1055
- return {
1056
- cancel: function () {
1057
- timeoutId && clearTimeoutFn.call(self, timeoutId);
1058
- timeoutId = null;
1059
- },
1060
- refresh: function () {
1061
- timeoutId && clearTimeoutFn.call(self, timeoutId);
1062
- timeoutId = setTimeoutFn.apply(self, theArgs);
1063
- return this;
1064
- }
1065
- };
1091
+ function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
1092
+ var isArr = isArray(overrideFn);
1093
+ var len = isArr ? overrideFn.length : 0;
1094
+ var setFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout;
1095
+ var clearFn = (len > 1 ? overrideFn[1] : UNDEF_VALUE) || clearTimeout;
1096
+ return _createTimerHandler(startTimer, function (timerId) {
1097
+ if (timerId) {
1098
+ if (timerId.refresh) {
1099
+ timerId.refresh();
1100
+ return timerId;
1101
+ }
1102
+ clearFn.call(self, timerId);
1103
+ }
1104
+ return setFn.apply(self, theArgs);
1105
+ }, function (timerId) {
1106
+ clearFn.call(self, timerId);
1107
+ });
1066
1108
  }
1067
1109
  function scheduleTimeout(callback, timeout) {
1068
- return _scheduleTimeoutWith(this, setTimeout, clearTimeout, _extractArgs(arguments, 0));
1110
+ return _createTimeoutWith(this, true, UNDEF_VALUE, _extractArgs(arguments, 0));
1069
1111
  }
1070
1112
 
1071
1113
  function scheduleInterval(callback, timeout) {
1072
1114
  var self = this;
1073
- var theArguments = arguments;
1074
- var intervalId = setInterval.apply(self, theArguments);
1075
- return {
1076
- cancel: function () {
1077
- clearInterval(intervalId);
1078
- },
1079
- refresh: function () {
1080
- clearInterval(intervalId);
1081
- intervalId = setInterval.apply(self, theArguments);
1082
- return this;
1083
- }
1084
- };
1115
+ var theArguments = _extractArgs(arguments, 0);
1116
+ return _createTimerHandler(true, function (intervalId) {
1117
+ intervalId && clearInterval(intervalId);
1118
+ return setInterval.apply(self, theArguments);
1119
+ }, function (intervalId) {
1120
+ clearInterval(intervalId);
1121
+ });
1085
1122
  }
1086
1123
 
1087
1124
  var createEnumStyle = createEnum;
@@ -1550,7 +1587,7 @@
1550
1587
  }
1551
1588
 
1552
1589
  var _objDefineProperty = ObjDefineProperty;
1553
- var version = "3.0.0-beta.2302-01";
1590
+ var version = "3.0.0-beta.2302-03";
1554
1591
  var instanceName = "." + newId(6);
1555
1592
  var _dataUid = 0;
1556
1593
  function _createAccessor(target, prop, value) {
@@ -5742,7 +5779,7 @@
5742
5779
  }
5743
5780
  }
5744
5781
  var EnvelopeCreator = {
5745
- Version: "3.0.0-beta.2302-01"
5782
+ Version: "3.0.0-beta.2302-03"
5746
5783
  };
5747
5784
  function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
5748
5785
  EnvelopeCreatorInit(logger, telemetryItem);
@@ -7181,8 +7218,8 @@
7181
7218
  return Sender;
7182
7219
  }(BaseTelemetryPlugin));
7183
7220
 
7184
- var _DYN_CONNECTION_STRING = "connectionString";
7185
7221
  var _DYN_INSTRUMENTATION_KEY = "instrumentationKey";
7222
+ var _DYN_CONNECTION_STRING = "connectionString";
7186
7223
 
7187
7224
  var defaultConfigValues = {
7188
7225
  diagnosticLogInterval: { isVal: _chkDiagLevel, v: 10000 }
@@ -7194,11 +7231,13 @@
7194
7231
  function ApplicationInsights(config) {
7195
7232
  var core = new AppInsightsCore();
7196
7233
  var _config;
7234
+ if (isNullOrUndefined(config) ||
7235
+ (isNullOrUndefined(config[_DYN_INSTRUMENTATION_KEY ]) && isNullOrUndefined(config[_DYN_CONNECTION_STRING ]))) {
7236
+ throwError("Invalid input configuration");
7237
+ }
7197
7238
  dynamicProto(ApplicationInsights, this, function (_self) {
7198
- objDefineProp(_self, "config", {
7199
- configurable: true,
7200
- enumerable: true,
7201
- get: function () { return _config; }
7239
+ objDefine(_self, "config", {
7240
+ g: function () { return _config; }
7202
7241
  });
7203
7242
  _initialize();
7204
7243
  _self.initialize = _initialize;
@@ -7245,4 +7284,4 @@
7245
7284
  Object.defineProperty(exports, '__esModule', { value: true });
7246
7285
 
7247
7286
  }));
7248
- //# sourceMappingURL=aib.3.0.0-beta.2302-01.js.map
7287
+ //# sourceMappingURL=aib.3.0.0-beta.2302-03.js.map