@microsoft/1ds-core-js 3.2.3 → 3.2.4

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 (68) hide show
  1. package/README.md +1 -1
  2. package/bundle/{ms.core-3.2.3.gbl.js → ms.core-3.2.4.gbl.js} +823 -716
  3. package/bundle/ms.core-3.2.4.gbl.js.map +1 -0
  4. package/bundle/ms.core-3.2.4.gbl.min.js +7 -0
  5. package/bundle/ms.core-3.2.4.gbl.min.js.map +1 -0
  6. package/bundle/ms.core-3.2.4.integrity.json +46 -0
  7. package/bundle/{ms.core-3.2.3.js → ms.core-3.2.4.js} +823 -716
  8. package/bundle/ms.core-3.2.4.js.map +1 -0
  9. package/bundle/ms.core-3.2.4.min.js +7 -0
  10. package/bundle/ms.core-3.2.4.min.js.map +1 -0
  11. package/bundle/ms.core.gbl.js +822 -715
  12. package/bundle/ms.core.gbl.js.map +1 -1
  13. package/bundle/ms.core.gbl.min.js +2 -2
  14. package/bundle/ms.core.gbl.min.js.map +1 -1
  15. package/bundle/ms.core.integrity.json +17 -17
  16. package/bundle/ms.core.js +822 -715
  17. package/bundle/ms.core.js.map +1 -1
  18. package/bundle/ms.core.min.js +2 -2
  19. package/bundle/ms.core.min.js.map +1 -1
  20. package/dist/ms.core.js +34 -33
  21. package/dist/ms.core.js.map +1 -1
  22. package/dist/ms.core.min.js +2 -2
  23. package/dist/ms.core.min.js.map +1 -1
  24. package/dist-esm/src/AppInsightsCore.d.ts +2 -7
  25. package/dist-esm/src/AppInsightsCore.js +24 -26
  26. package/dist-esm/src/AppInsightsCore.js.map +1 -1
  27. package/dist-esm/src/BaseCore.d.ts +2 -2
  28. package/dist-esm/src/BaseCore.js +16 -10
  29. package/dist-esm/src/BaseCore.js.map +1 -1
  30. package/dist-esm/src/DataModels.js +1 -1
  31. package/dist-esm/src/ESPromise.d.ts +5 -5
  32. package/dist-esm/src/ESPromise.js +7 -7
  33. package/dist-esm/src/ESPromise.js.map +1 -1
  34. package/dist-esm/src/ESPromiseScheduler.d.ts +4 -4
  35. package/dist-esm/src/ESPromiseScheduler.js +8 -8
  36. package/dist-esm/src/ESPromiseScheduler.js.map +1 -1
  37. package/dist-esm/src/Enums.d.ts +5 -5
  38. package/dist-esm/src/Enums.js +6 -6
  39. package/dist-esm/src/Enums.js.map +1 -1
  40. package/dist-esm/src/Index.d.ts +1 -2
  41. package/dist-esm/src/Index.js +2 -2
  42. package/dist-esm/src/Index.js.map +1 -1
  43. package/dist-esm/src/InternalConstants.d.ts +6 -0
  44. package/dist-esm/src/InternalConstants.js +19 -0
  45. package/dist-esm/src/InternalConstants.js.map +1 -0
  46. package/dist-esm/src/Utils.d.ts +9 -3
  47. package/dist-esm/src/Utils.js +19 -18
  48. package/dist-esm/src/Utils.js.map +1 -1
  49. package/dist-esm/src/ValueSanitizer.d.ts +1 -1
  50. package/dist-esm/src/ValueSanitizer.js +5 -4
  51. package/dist-esm/src/ValueSanitizer.js.map +1 -1
  52. package/package.json +4 -2
  53. package/src/AppInsightsCore.ts +28 -30
  54. package/src/BaseCore.ts +13 -10
  55. package/src/ESPromise.ts +6 -6
  56. package/src/ESPromiseScheduler.ts +8 -8
  57. package/src/Enums.ts +5 -5
  58. package/src/Index.ts +1 -1
  59. package/src/InternalConstants.ts +16 -0
  60. package/src/Utils.ts +24 -24
  61. package/src/ValueSanitizer.ts +5 -4
  62. package/bundle/ms.core-3.2.3.gbl.js.map +0 -1
  63. package/bundle/ms.core-3.2.3.gbl.min.js +0 -7
  64. package/bundle/ms.core-3.2.3.gbl.min.js.map +0 -1
  65. package/bundle/ms.core-3.2.3.integrity.json +0 -46
  66. package/bundle/ms.core-3.2.3.js.map +0 -1
  67. package/bundle/ms.core-3.2.3.min.js +0 -7
  68. package/bundle/ms.core-3.2.3.min.js.map +0 -1
package/dist/ms.core.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * 1DS JS SDK Core, 3.2.3
2
+ * 1DS JS SDK Core, 3.2.4
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  * (Microsoft Internal Only)
5
5
  */
@@ -81,8 +81,13 @@
81
81
  SDKNotInitialized: 520
82
82
  })));
83
83
 
84
+ var STR_EMPTY = "";
85
+ var STR_DEFAULT_ENDPOINT_URL = "https://browser.events.data.microsoft.com/OneCollector/1.0/";
86
+ var STR_VERSION = "version";
87
+ var STR_PROPERTIES = "properties";
88
+
84
89
  var _a;
85
- var Version = '3.2.3';
90
+ var Version = '3.2.4';
86
91
  var FullVersionString = "1DS-Web-JS-" + Version;
87
92
  var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
88
93
  var strWithCredentials = "withCredentials";
@@ -100,7 +105,7 @@
100
105
  var isDocumentObjectAvailable = Boolean(applicationinsightsCoreJs.getDocument());
101
106
  var isWindowObjectAvailable = Boolean(applicationinsightsCoreJs.getWindow());
102
107
  function isValueAssigned(value) {
103
- return !(value === "" || applicationinsightsCoreJs.isNullOrUndefined(value));
108
+ return !(value === STR_EMPTY || applicationinsightsCoreJs.isNullOrUndefined(value));
104
109
  }
105
110
  function getTenantId(apiKey) {
106
111
  if (apiKey) {
@@ -109,7 +114,7 @@
109
114
  return apiKey.substring(0, indexTenantId);
110
115
  }
111
116
  }
112
- return "";
117
+ return STR_EMPTY;
113
118
  }
114
119
  function isUint8ArrayAvailable() {
115
120
  if (uInt8ArraySupported === null) {
@@ -131,11 +136,11 @@
131
136
  if (propType === "string" || propType === "number" || propType === "boolean" || applicationinsightsCoreJs.isArray(property)) {
132
137
  property = { value: property };
133
138
  }
134
- else if (propType === "object" && !property.hasOwnProperty("value")) {
139
+ else if (propType === "object" && !applicationinsightsShims.ObjHasOwnProperty.call(property, "value")) {
135
140
  property = { value: stringifyObjects ? JSON.stringify(property) : property };
136
141
  }
137
142
  else if (applicationinsightsCoreJs.isNullOrUndefined(property.value)
138
- || property.value === "" || (!applicationinsightsCoreJs.isString(property.value)
143
+ || property.value === STR_EMPTY || (!applicationinsightsCoreJs.isString(property.value)
139
144
  && !applicationinsightsCoreJs.isNumber(property.value) && !applicationinsightsCoreJs.isBoolean(property.value)
140
145
  && !applicationinsightsCoreJs.isArray(property.value))) {
141
146
  return null;
@@ -198,7 +203,7 @@
198
203
  if (applicationinsightsCoreJs.areCookiesSupported(null)) {
199
204
  return getCookieValue(applicationinsightsCoreJs.safeGetCookieMgr(null), name);
200
205
  }
201
- return "";
206
+ return STR_EMPTY;
202
207
  }
203
208
  function getCookieValue(cookieMgr, name, decode) {
204
209
  if (decode === void 0) { decode = true; }
@@ -209,7 +214,7 @@
209
214
  cookieValue = decodeURIComponent(cookieValue);
210
215
  }
211
216
  }
212
- return cookieValue || "";
217
+ return cookieValue || STR_EMPTY;
213
218
  }
214
219
  function createGuid(style) {
215
220
  if (style === void 0) { style = "D" ; }
@@ -221,7 +226,7 @@
221
226
  theGuid = "(" + theGuid + ")";
222
227
  }
223
228
  else if (style === "N" ) {
224
- theGuid = theGuid.replace(/-/g, "");
229
+ theGuid = theGuid.replace(/-/g, STR_EMPTY);
225
230
  }
226
231
  return theGuid;
227
232
  }
@@ -230,7 +235,7 @@
230
235
  var deep = false;
231
236
  var i = 0;
232
237
  var length = arguments.length;
233
- var objProto = Object[applicationinsightsCoreJs.strPrototype];
238
+ var objProto = Object[applicationinsightsShims.strShimPrototype];
234
239
  var theArgs = arguments;
235
240
  if (objProto.toString.call(theArgs[0]) === "[object Boolean]") {
236
241
  deep = theArgs[0];
@@ -315,7 +320,7 @@
315
320
  theType |= getFieldValueType(value[0]);
316
321
  }
317
322
  }
318
- else if (applicationinsightsCoreJs.hasOwnProperty(value, "value")) {
323
+ else if (applicationinsightsShims.ObjHasOwnProperty.call(value, "value")) {
319
324
  theType = 8192 | getFieldValueType(value.value);
320
325
  }
321
326
  }
@@ -437,27 +442,25 @@
437
442
  return xhr;
438
443
  }
439
444
 
440
- var PropVersion = "version";
441
- var properties = "properties";
442
445
  var AppInsightsCore = /** @class */ (function (_super) {
443
446
  applicationinsightsShims.__extendsFn(AppInsightsCore, _super);
444
447
  function AppInsightsCore() {
445
448
  var _this = _super.call(this) || this;
446
449
  _this.pluginVersionStringArr = [];
447
- _this.pluginVersionString = "";
448
450
  dynamicProto__default(AppInsightsCore, _this, function (_self, _base) {
449
451
  if (!_self.logger || !_self.logger.queue) {
450
452
  _self.logger = new applicationinsightsCoreJs.DiagnosticLogger({ loggingLevelConsole: 1 });
451
453
  }
452
454
  _self.initialize = function (config, extensions, logger, notificationManager) {
453
455
  applicationinsightsCoreJs.doPerf(_self, function () { return "AppInsightsCore.initialize"; }, function () {
456
+ var _pluginVersionStringArr = _self.pluginVersionStringArr;
454
457
  if (config) {
455
458
  if (!config.endpointUrl) {
456
- config.endpointUrl = "https://browser.events.data.microsoft.com/OneCollector/1.0/";
459
+ config.endpointUrl = STR_DEFAULT_ENDPOINT_URL;
457
460
  }
458
461
  var propertyStorageOverride = config.propertyStorageOverride;
459
462
  if (propertyStorageOverride && (!propertyStorageOverride.getProperty || !propertyStorageOverride.setProperty)) {
460
- throw new Error("Invalid property storage override passed.");
463
+ applicationinsightsCoreJs.throwError("Invalid property storage override passed.");
461
464
  }
462
465
  if (config.channels) {
463
466
  applicationinsightsCoreJs.arrForEach(config.channels, function (channels) {
@@ -465,7 +468,7 @@
465
468
  applicationinsightsCoreJs.arrForEach(channels, function (channel) {
466
469
  if (channel.identifier && channel.version) {
467
470
  var ver = channel.identifier + "=" + channel.version;
468
- _self.pluginVersionStringArr.push(ver);
471
+ _pluginVersionStringArr.push(ver);
469
472
  }
470
473
  });
471
474
  }
@@ -479,11 +482,12 @@
479
482
  applicationinsightsCoreJs.arrForEach(extensions, function (ext) {
480
483
  if (ext && ext.identifier && ext.version) {
481
484
  var ver = ext.identifier + "=" + ext.version;
482
- _self.pluginVersionStringArr.push(ver);
485
+ _pluginVersionStringArr.push(ver);
483
486
  }
484
487
  });
485
488
  }
486
- _self.pluginVersionString = _self.pluginVersionStringArr.join(";");
489
+ _self.pluginVersionString = _pluginVersionStringArr.join(";");
490
+ _self.pluginVersionStringArr = _pluginVersionStringArr;
487
491
  try {
488
492
  _base.initialize(config, extensions, logger, notificationManager);
489
493
  _self.pollInternalLogs("InternalLog");
@@ -494,7 +498,7 @@
494
498
  if (message.indexOf("channels") !== -1) {
495
499
  message += "\n - Channels must be provided through config.channels only!";
496
500
  }
497
- logger_1.throwInternal(1 , 514 , "SDK Initialization Failed - no telemetry will be sent: " + message);
501
+ applicationinsightsCoreJs._throwInternal(logger_1, 1 , 514 , "SDK Initialization Failed - no telemetry will be sent: " + message);
498
502
  }
499
503
  }, function () { return ({ config: config, extensions: extensions, logger: logger, notificationManager: notificationManager }); });
500
504
  };
@@ -511,16 +515,9 @@
511
515
  itemExt.sdk = itemExt.sdk || {};
512
516
  itemExt.sdk.ver = FullVersionString;
513
517
  var baseData = telemetryItem.baseData = telemetryItem.baseData || {};
514
- if (!baseData[properties]) {
515
- baseData[properties] = {};
516
- }
517
- var itemProperties = baseData[properties];
518
- if (!itemProperties[PropVersion]) {
519
- itemProperties[PropVersion] = "";
520
- }
521
- if (_self.pluginVersionString !== "") {
522
- itemProperties[PropVersion] = _self.pluginVersionString;
523
- }
518
+ baseData[STR_PROPERTIES] = baseData[STR_PROPERTIES] || {};
519
+ var itemProperties = baseData[STR_PROPERTIES];
520
+ itemProperties[STR_VERSION] = _self.pluginVersionString || itemProperties[STR_VERSION] || STR_EMPTY;
524
521
  }
525
522
  _base.track(telemetryItem);
526
523
  }, function () { return ({ item: item }); }, !(item.sync));
@@ -528,6 +525,7 @@
528
525
  });
529
526
  return _this;
530
527
  }
528
+ AppInsightsCore.__ieDyn=1;
531
529
  return AppInsightsCore;
532
530
  }(applicationinsightsCoreJs.AppInsightsCore));
533
531
 
@@ -538,7 +536,7 @@
538
536
  dynamicProto__default(BaseCore, _this, function (_self, _base) {
539
537
  _self.initialize = function (config, extensions, logger, notificationManager) {
540
538
  if (config && !config.endpointUrl) {
541
- config.endpointUrl = "https://browser.events.data.microsoft.com/OneCollector/1.0/";
539
+ config.endpointUrl = STR_DEFAULT_ENDPOINT_URL;
542
540
  }
543
541
  _self.getWParam = function () {
544
542
  return isDocumentObjectAvailable ? 0 : -1;
@@ -562,6 +560,7 @@
562
560
  });
563
561
  return _this;
564
562
  }
563
+ BaseCore.__ieDyn=1;
565
564
  return BaseCore;
566
565
  }(applicationinsightsCoreJs.BaseCore));
567
566
 
@@ -941,7 +940,7 @@
941
940
  }
942
941
  }
943
942
  function _warnLog(message) {
944
- diagLog && diagLog.warnToConsole("ESPromiseScheduler[" + _scheduledName + "] " + message);
943
+ applicationinsightsCoreJs._warnToConsole(diagLog, "ESPromiseScheduler[" + _scheduledName + "] " + message);
945
944
  }
946
945
  }
947
946
  ESPromiseScheduler.incomplete = function () {
@@ -1032,7 +1031,7 @@
1032
1031
  if (mapValue.handler) {
1033
1032
  return mapValue.handler.value(path, name, value, stringifyObjects);
1034
1033
  }
1035
- if (!applicationinsightsCoreJs.isString(name) || applicationinsightsCoreJs.isNullOrUndefined(value) || value === "") {
1034
+ if (!applicationinsightsCoreJs.isString(name) || applicationinsightsCoreJs.isNullOrUndefined(value) || value === STR_EMPTY) {
1036
1035
  return null;
1037
1036
  }
1038
1037
  var property = null;
@@ -1149,7 +1148,9 @@
1149
1148
  exports._InternalLogMessage = applicationinsightsCoreJs._InternalLogMessage;
1150
1149
  exports._InternalMessageId = applicationinsightsCoreJs._InternalMessageId;
1151
1150
  exports.__getRegisteredEvents = applicationinsightsCoreJs.__getRegisteredEvents;
1151
+ exports._logInternalMessage = applicationinsightsCoreJs._logInternalMessage;
1152
1152
  exports._throwInternal = applicationinsightsCoreJs._throwInternal;
1153
+ exports._warnToConsole = applicationinsightsCoreJs._warnToConsole;
1153
1154
  exports.addEventHandler = applicationinsightsCoreJs.addEventHandler;
1154
1155
  exports.addEventListeners = applicationinsightsCoreJs.addEventListeners;
1155
1156
  exports.addPageHideEventListener = applicationinsightsCoreJs.addPageHideEventListener;