@microsoft/applicationinsights-properties-js 3.0.0-beta.2302-01 → 3.0.0-beta.2302-02

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 (31) hide show
  1. package/browser/applicationinsights-properties-js.integrity.json +9 -9
  2. package/browser/applicationinsights-properties-js.js +57 -15
  3. package/browser/applicationinsights-properties-js.js.map +1 -1
  4. package/browser/applicationinsights-properties-js.min.js +2 -2
  5. package/browser/applicationinsights-properties-js.min.js.map +1 -1
  6. package/dist/applicationinsights-properties-js.d.ts +1 -1
  7. package/dist/applicationinsights-properties-js.js +57 -15
  8. package/dist/applicationinsights-properties-js.js.map +1 -1
  9. package/dist/applicationinsights-properties-js.min.js +2 -2
  10. package/dist/applicationinsights-properties-js.min.js.map +1 -1
  11. package/dist/applicationinsights-properties-js.rollup.d.ts +1 -1
  12. package/dist-esm/Context/Application.js +1 -1
  13. package/dist-esm/Context/Device.js +1 -1
  14. package/dist-esm/Context/Internal.js +1 -1
  15. package/dist-esm/Context/Location.js +1 -1
  16. package/dist-esm/Context/Session.js +1 -1
  17. package/dist-esm/Context/TelemetryTrace.js +1 -1
  18. package/dist-esm/Context/User.js +1 -1
  19. package/dist-esm/Interfaces/IPropTelemetryContext.js +1 -1
  20. package/dist-esm/Interfaces/IPropertiesConfig.js +1 -1
  21. package/dist-esm/PropertiesPlugin.js +1 -1
  22. package/dist-esm/TelemetryContext.js +1 -1
  23. package/dist-esm/__DynamicConstants.js +4 -4
  24. package/dist-esm/__DynamicConstants.js.map +1 -1
  25. package/dist-esm/applicationinsights-properties-js.js +1 -1
  26. package/package.json +6 -6
  27. package/src/Context/Session.ts +11 -11
  28. package/src/Context/User.ts +13 -13
  29. package/src/PropertiesPlugin.ts +20 -20
  30. package/src/TelemetryContext.ts +25 -25
  31. package/src/__DynamicConstants.ts +41 -41
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft Application Insights properties plugin, 3.0.0-beta.2302-01
2
+ * Microsoft Application Insights properties plugin, 3.0.0-beta.2302-02
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Properties Plugin, 3.0.0-beta.2302-01
2
+ * Application Insights JavaScript SDK - Properties Plugin, 3.0.0-beta.2302-02
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -871,6 +871,44 @@
871
871
  var TRIM = "trim";
872
872
  var strTrim = StrProto[TRIM] ? _unwrapFunction(TRIM) : polyStrTrim;
873
873
 
874
+ function _createTimerHandler(startTimer, refreshFn, cancelFn) {
875
+ var ref = true;
876
+ var timerId = startTimer ? refreshFn(null) : null;
877
+ function _unref() {
878
+ ref = false;
879
+ timerId && timerId["unref"] && timerId["unref"]();
880
+ return timer;
881
+ }
882
+ function _ref() {
883
+ ref = true;
884
+ timerId && timerId["ref"] && timerId["ref"]();
885
+ return timer;
886
+ }
887
+ function _hasRef() {
888
+ if (timerId && timerId["hasRef"]) {
889
+ return timerId["hasRef"]();
890
+ }
891
+ return ref;
892
+ }
893
+ var timer = {
894
+ cancel: function () {
895
+ timerId && cancelFn(timerId);
896
+ timerId = null;
897
+ },
898
+ refresh: function () {
899
+ timerId = refreshFn(timerId);
900
+ if (!ref) {
901
+ _unref();
902
+ }
903
+ return timer;
904
+ },
905
+ hasRef: _hasRef,
906
+ ref: _ref,
907
+ unref: _unref
908
+ };
909
+ return timer;
910
+ }
911
+
874
912
  function _extractArgs(args, startAt) {
875
913
  var theArgs = [];
876
914
  for (var lp = startAt; lp < args[LENGTH]; lp++) {
@@ -879,22 +917,26 @@
879
917
  return theArgs;
880
918
  }
881
919
 
882
- function _scheduleTimeoutWith(self, setTimeoutFn, clearTimeoutFn, theArgs) {
883
- var timeoutId = setTimeoutFn.apply(self, theArgs);
884
- return {
885
- cancel: function () {
886
- timeoutId && clearTimeoutFn.call(self, timeoutId);
887
- timeoutId = null;
888
- },
889
- refresh: function () {
890
- timeoutId && clearTimeoutFn.call(self, timeoutId);
891
- timeoutId = setTimeoutFn.apply(self, theArgs);
892
- return this;
920
+ function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
921
+ var isArr = isArray(overrideFn);
922
+ var len = isArr ? overrideFn.length : 0;
923
+ var setFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout;
924
+ var clearFn = (len > 1 ? overrideFn[1] : UNDEF_VALUE) || clearTimeout;
925
+ return _createTimerHandler(startTimer, function (timerId) {
926
+ if (timerId) {
927
+ if (timerId.refresh) {
928
+ timerId.refresh();
929
+ return timerId;
930
+ }
931
+ clearFn.call(self, timerId);
893
932
  }
894
- };
933
+ return setFn.apply(self, theArgs);
934
+ }, function (timerId) {
935
+ clearFn.call(self, timerId);
936
+ });
895
937
  }
896
938
  function scheduleTimeout(callback, timeout) {
897
- return _scheduleTimeoutWith(this, setTimeout, clearTimeout, _extractArgs(arguments, 0));
939
+ return _createTimeoutWith(this, true, UNDEF_VALUE, _extractArgs(arguments, 0));
898
940
  }
899
941
 
900
942
  var createEnumStyle = createEnum;
@@ -1196,7 +1238,7 @@
1196
1238
  }
1197
1239
 
1198
1240
  var _objDefineProperty = ObjDefineProperty;
1199
- var version = "3.0.0-beta.2302-01";
1241
+ var version = "3.0.0-beta.2302-02";
1200
1242
  var instanceName = "." + newId(6);
1201
1243
  var _dataUid = 0;
1202
1244
  function _createAccessor(target, prop, value) {