@microsoft/applicationinsights-analytics-js 3.0.0-beta.2210-19 → 3.0.0-beta.2210-21

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,5 +1,5 @@
1
1
  /*
2
- * Microsoft Application Insights JavaScript SDK - Web Analytics, 3.0.0-beta.2210-19
2
+ * Microsoft Application Insights JavaScript SDK - Web Analytics, 3.0.0-beta.2210-21
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 - Web Analytics, 3.0.0-beta.2210-19
2
+ * Application Insights JavaScript SDK - Web Analytics, 3.0.0-beta.2210-21
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -1225,7 +1225,7 @@
1225
1225
  }
1226
1226
 
1227
1227
  var _objDefineProperty = ObjDefineProperty;
1228
- var version = "3.0.0-beta.2210-19";
1228
+ var version = "3.0.0-beta.2210-21";
1229
1229
  var instanceName = "." + newId(6);
1230
1230
  var _dataUid = 0;
1231
1231
  function _createAccessor(target, prop, value) {
@@ -3195,13 +3195,14 @@
3195
3195
  var _DYN_TO_STRING$1 = "toString";
3196
3196
  var _DYN_REMOVE_ITEM = "removeItem";
3197
3197
  var _DYN_NAME = "name";
3198
+ var _DYN_MESSAGE$1 = "message";
3199
+ var _DYN_COUNT = "count";
3200
+ var _DYN_STRINGIFY = "stringify";
3198
3201
  var _DYN_PATHNAME = "pathname";
3199
3202
  var _DYN_EXCEPTIONS = "exceptions";
3200
3203
  var _DYN_PARSED_STACK = "parsedStack";
3201
3204
  var _DYN_PROPERTIES = "properties";
3202
3205
  var _DYN_MEASUREMENTS = "measurements";
3203
- var _DYN_STRINGIFY = "stringify";
3204
- var _DYN_MESSAGE$1 = "message";
3205
3206
  var _DYN_SIZE_IN_BYTES = "sizeInBytes";
3206
3207
  var _DYN_TYPE_NAME = "typeName";
3207
3208
  var _DYN_SEVERITY_LEVEL = "severityLevel";
@@ -3457,6 +3458,104 @@
3457
3458
  };
3458
3459
  }
3459
3460
 
3461
+ var StorageType = createEnumStyle({
3462
+ LocalStorage: 0 ,
3463
+ SessionStorage: 1
3464
+ });
3465
+ createEnumStyle({
3466
+ AI: 0 ,
3467
+ AI_AND_W3C: 1 ,
3468
+ W3C: 2
3469
+ });
3470
+
3471
+ var _canUseLocalStorage = undefined;
3472
+ var _canUseSessionStorage = undefined;
3473
+ function _getVerifiedStorageObject(storageType) {
3474
+ try {
3475
+ if (isNullOrUndefined(getGlobal$1())) {
3476
+ return null;
3477
+ }
3478
+ var uid = (new Date)[_DYN_TO_STRING$1 ]();
3479
+ var storage = getInst(storageType === StorageType.LocalStorage ? "localStorage" : "sessionStorage");
3480
+ storage.setItem(uid, uid);
3481
+ var fail = storage.getItem(uid) !== uid;
3482
+ storage[_DYN_REMOVE_ITEM ](uid);
3483
+ if (!fail) {
3484
+ return storage;
3485
+ }
3486
+ }
3487
+ catch (exception) {
3488
+ }
3489
+ return null;
3490
+ }
3491
+ function _getSessionStorageObject() {
3492
+ if (utlCanUseSessionStorage()) {
3493
+ return _getVerifiedStorageObject(StorageType.SessionStorage);
3494
+ }
3495
+ return null;
3496
+ }
3497
+ function utlDisableStorage() {
3498
+ _canUseLocalStorage = false;
3499
+ _canUseSessionStorage = false;
3500
+ }
3501
+ function utlEnableStorage() {
3502
+ _canUseLocalStorage = utlCanUseLocalStorage(true);
3503
+ _canUseSessionStorage = utlCanUseSessionStorage(true);
3504
+ }
3505
+ function utlCanUseLocalStorage(reset) {
3506
+ if (reset || _canUseLocalStorage === undefined) {
3507
+ _canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage);
3508
+ }
3509
+ return _canUseLocalStorage;
3510
+ }
3511
+ function utlCanUseSessionStorage(reset) {
3512
+ if (reset || _canUseSessionStorage === undefined) {
3513
+ _canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage);
3514
+ }
3515
+ return _canUseSessionStorage;
3516
+ }
3517
+ function utlGetSessionStorage(logger, name) {
3518
+ var storage = _getSessionStorageObject();
3519
+ if (storage !== null) {
3520
+ try {
3521
+ return storage.getItem(name);
3522
+ }
3523
+ catch (e) {
3524
+ _canUseSessionStorage = false;
3525
+ _throwInternal(logger, 2 , 2 , "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
3526
+ }
3527
+ }
3528
+ return null;
3529
+ }
3530
+ function utlSetSessionStorage(logger, name, data) {
3531
+ var storage = _getSessionStorageObject();
3532
+ if (storage !== null) {
3533
+ try {
3534
+ storage.setItem(name, data);
3535
+ return true;
3536
+ }
3537
+ catch (e) {
3538
+ _canUseSessionStorage = false;
3539
+ _throwInternal(logger, 2 , 4 , "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
3540
+ }
3541
+ }
3542
+ return false;
3543
+ }
3544
+ function utlRemoveSessionStorage(logger, name) {
3545
+ var storage = _getSessionStorageObject();
3546
+ if (storage !== null) {
3547
+ try {
3548
+ storage[_DYN_REMOVE_ITEM ](name);
3549
+ return true;
3550
+ }
3551
+ catch (e) {
3552
+ _canUseSessionStorage = false;
3553
+ _throwInternal(logger, 2 , 6 , "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
3554
+ }
3555
+ }
3556
+ return false;
3557
+ }
3558
+
3460
3559
  var Event$1 = /** @class */ (function () {
3461
3560
  function Event(logger, name, properties, measurements) {
3462
3561
  this.aiDataContract = {
@@ -3966,7 +4065,7 @@
3966
4065
  var _self = this;
3967
4066
  _self.ver = 2;
3968
4067
  var dataPoint = new DataPoint();
3969
- dataPoint.count = count > 0 ? count : undefined;
4068
+ dataPoint[_DYN_COUNT ] = count > 0 ? count : undefined;
3970
4069
  dataPoint.max = isNaN(max) || max === null ? undefined : max;
3971
4070
  dataPoint.min = isNaN(min) || min === null ? undefined : min;
3972
4071
  dataPoint[_DYN_NAME ] = dataSanitizeString(logger, name) || strNotSpecified;
@@ -4174,16 +4273,6 @@
4174
4273
  return telemetryItem;
4175
4274
  }
4176
4275
 
4177
- var StorageType = createEnumStyle({
4178
- LocalStorage: 0 ,
4179
- SessionStorage: 1
4180
- });
4181
- createEnumStyle({
4182
- AI: 0 ,
4183
- AI_AND_W3C: 1 ,
4184
- W3C: 2
4185
- });
4186
-
4187
4276
  function createDomEvent(eventName) {
4188
4277
  var event = null;
4189
4278
  if (isFunction(Event)) {
@@ -4199,94 +4288,6 @@
4199
4288
  return event;
4200
4289
  }
4201
4290
 
4202
- var _canUseLocalStorage = undefined;
4203
- var _canUseSessionStorage = undefined;
4204
- function _getVerifiedStorageObject(storageType) {
4205
- try {
4206
- if (isNullOrUndefined(getGlobal$1())) {
4207
- return null;
4208
- }
4209
- var uid = (new Date)[_DYN_TO_STRING$1 ]();
4210
- var storage = getInst(storageType === StorageType.LocalStorage ? "localStorage" : "sessionStorage");
4211
- storage.setItem(uid, uid);
4212
- var fail = storage.getItem(uid) !== uid;
4213
- storage[_DYN_REMOVE_ITEM ](uid);
4214
- if (!fail) {
4215
- return storage;
4216
- }
4217
- }
4218
- catch (exception) {
4219
- }
4220
- return null;
4221
- }
4222
- function _getSessionStorageObject() {
4223
- if (utlCanUseSessionStorage()) {
4224
- return _getVerifiedStorageObject(StorageType.SessionStorage);
4225
- }
4226
- return null;
4227
- }
4228
- function utlDisableStorage() {
4229
- _canUseLocalStorage = false;
4230
- _canUseSessionStorage = false;
4231
- }
4232
- function utlEnableStorage() {
4233
- _canUseLocalStorage = utlCanUseLocalStorage(true);
4234
- _canUseSessionStorage = utlCanUseSessionStorage(true);
4235
- }
4236
- function utlCanUseLocalStorage(reset) {
4237
- if (reset || _canUseLocalStorage === undefined) {
4238
- _canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage);
4239
- }
4240
- return _canUseLocalStorage;
4241
- }
4242
- function utlCanUseSessionStorage(reset) {
4243
- if (reset || _canUseSessionStorage === undefined) {
4244
- _canUseSessionStorage = !!_getVerifiedStorageObject(StorageType.SessionStorage);
4245
- }
4246
- return _canUseSessionStorage;
4247
- }
4248
- function utlGetSessionStorage(logger, name) {
4249
- var storage = _getSessionStorageObject();
4250
- if (storage !== null) {
4251
- try {
4252
- return storage.getItem(name);
4253
- }
4254
- catch (e) {
4255
- _canUseSessionStorage = false;
4256
- _throwInternal(logger, 2 , 2 , "Browser failed read of session storage. " + getExceptionName(e), { exception: dumpObj(e) });
4257
- }
4258
- }
4259
- return null;
4260
- }
4261
- function utlSetSessionStorage(logger, name, data) {
4262
- var storage = _getSessionStorageObject();
4263
- if (storage !== null) {
4264
- try {
4265
- storage.setItem(name, data);
4266
- return true;
4267
- }
4268
- catch (e) {
4269
- _canUseSessionStorage = false;
4270
- _throwInternal(logger, 2 , 4 , "Browser failed write to session storage. " + getExceptionName(e), { exception: dumpObj(e) });
4271
- }
4272
- }
4273
- return false;
4274
- }
4275
- function utlRemoveSessionStorage(logger, name) {
4276
- var storage = _getSessionStorageObject();
4277
- if (storage !== null) {
4278
- try {
4279
- storage[_DYN_REMOVE_ITEM ](name);
4280
- return true;
4281
- }
4282
- catch (e) {
4283
- _canUseSessionStorage = false;
4284
- _throwInternal(logger, 2 , 6 , "Browser failed removal of session storage item. " + getExceptionName(e), { exception: dumpObj(e) });
4285
- }
4286
- }
4287
- return false;
4288
- }
4289
-
4290
4291
  var PropertiesPluginIdentifier = "AppInsightsPropertiesPlugin";
4291
4292
  var AnalyticsPluginIdentifier = "ApplicationInsightsAnalytics";
4292
4293
 
@@ -5219,7 +5220,7 @@
5219
5220
  });
5220
5221
  return _this;
5221
5222
  }
5222
- AnalyticsPlugin.Version = "3.0.0-beta.2210-19";
5223
+ AnalyticsPlugin.Version = "3.0.0-beta.2210-21";
5223
5224
  return AnalyticsPlugin;
5224
5225
  }(BaseTelemetryPlugin));
5225
5226