@microsoft/applicationinsights-web-basic 2.8.0-beta.2203-08 → 2.8.0-beta.2203-11

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": "2.8.0-beta.2203-11",
4
+ "ext": {
5
+ "@js": {
6
+ "file": "aib.2.8.0-beta.2203-11.js",
7
+ "type": "text/javascript; charset=utf-8",
8
+ "integrity": "sha256-W/1Dngve19je45vNTnZOdYPxUX4UxvCYOHvEPi3iWJY= sha384-lWJD0lufdttQPidS1e7afHGgTGKdWtdVcr0jPVZrrwq7pJkF7vLXCaP4Qgs1UXxl sha512-+C2tUIEAEFByK6h1WQ2OX8ziTiTZWCvU9APJZdCFIo+rdQAxbDenE1XTS5CwMPjSH6NUhi0BDbkuy587BveNxA==",
9
+ "hashes": {
10
+ "sha256": "W/1Dngve19je45vNTnZOdYPxUX4UxvCYOHvEPi3iWJY=",
11
+ "sha384": "lWJD0lufdttQPidS1e7afHGgTGKdWtdVcr0jPVZrrwq7pJkF7vLXCaP4Qgs1UXxl",
12
+ "sha512": "+C2tUIEAEFByK6h1WQ2OX8ziTiTZWCvU9APJZdCFIo+rdQAxbDenE1XTS5CwMPjSH6NUhi0BDbkuy587BveNxA=="
13
+ }
14
+ },
15
+ "@min.js": {
16
+ "file": "aib.2.8.0-beta.2203-11.min.js",
17
+ "type": "text/javascript; charset=utf-8",
18
+ "integrity": "sha256-aWFck8nK5UVZFTvV9XsnrgFm4C9XGOLJ2CMqUZnjG/c= sha384-3HqUBeV+CplE+eDbkNhE6Rq2lEGEcxttOdZFPeHOzmPFScrUwRnkuR4gsIYaNUE7 sha512-6JhPF3HPGMYNOErsBS2Z377Q297ru1lN1AKhfr53EMD240k1gNucV6VvxZB275MsxguTcseB81AP295UlrN4rQ==",
19
+ "hashes": {
20
+ "sha256": "aWFck8nK5UVZFTvV9XsnrgFm4C9XGOLJ2CMqUZnjG/c=",
21
+ "sha384": "3HqUBeV+CplE+eDbkNhE6Rq2lEGEcxttOdZFPeHOzmPFScrUwRnkuR4gsIYaNUE7",
22
+ "sha512": "6JhPF3HPGMYNOErsBS2Z377Q297ru1lN1AKhfr53EMD240k1gNucV6VvxZB275MsxguTcseB81AP295UlrN4rQ=="
23
+ }
24
+ }
25
+ }
26
+ }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript Web SDK - Basic, 2.8.0-beta.2203-08
2
+ * Application Insights JavaScript Web SDK - Basic, 2.8.0-beta.2203-11
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -8,107 +8,6 @@
8
8
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Microsoft = global.Microsoft || {}, global.Microsoft.ApplicationInsights = global.Microsoft.ApplicationInsights || {})));
9
9
  })(this, (function (exports) { 'use strict';
10
10
 
11
- var EventsDiscardedReason = {
12
- Unknown: 0,
13
- NonRetryableStatus: 1,
14
- InvalidEvent: 2,
15
- SizeLimitExceeded: 3,
16
- KillSwitch: 4,
17
- QueueFull: 5
18
- };
19
-
20
- var strShimFunction = "function";
21
- var strShimObject = "object";
22
- var strShimUndefined = "undefined";
23
- var strShimPrototype = "prototype";
24
- var strShimHasOwnProperty = "hasOwnProperty";
25
- var ObjClass = Object;
26
- var ObjProto = ObjClass[strShimPrototype];
27
- var ObjAssign = ObjClass["assign"];
28
- var ObjCreate = ObjClass["create"];
29
- var ObjDefineProperty = ObjClass["defineProperty"];
30
- var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty];
31
-
32
- var _cachedGlobal = null;
33
- function getGlobal(useCached) {
34
- if (useCached === void 0) { useCached = true; }
35
- if (!_cachedGlobal || !useCached) {
36
- if (typeof globalThis !== strShimUndefined && globalThis) {
37
- _cachedGlobal = globalThis;
38
- }
39
- if (typeof self !== strShimUndefined && self) {
40
- _cachedGlobal = self;
41
- }
42
- if (typeof window !== strShimUndefined && window) {
43
- _cachedGlobal = window;
44
- }
45
- if (typeof global !== strShimUndefined && global) {
46
- _cachedGlobal = global;
47
- }
48
- }
49
- return _cachedGlobal;
50
- }
51
- function throwTypeError(message) {
52
- throw new TypeError(message);
53
- }
54
- function objCreateFn(obj) {
55
- var func = ObjCreate;
56
- if (func) {
57
- return func(obj);
58
- }
59
- if (obj == null) {
60
- return {};
61
- }
62
- var type = typeof obj;
63
- if (type !== strShimObject && type !== strShimFunction) {
64
- throwTypeError("Object prototype may only be an Object:" + obj);
65
- }
66
- function tmpFunc() { }
67
- tmpFunc[strShimPrototype] = obj;
68
- return new tmpFunc();
69
- }
70
-
71
- (getGlobal() || {})["Symbol"];
72
- (getGlobal() || {})["Reflect"];
73
- var __objAssignFnImpl = function (t) {
74
- for (var s, i = 1, n = arguments.length; i < n; i++) {
75
- s = arguments[i];
76
- for (var p in s) {
77
- if (ObjProto[strShimHasOwnProperty].call(s, p)) {
78
- t[p] = s[p];
79
- }
80
- }
81
- }
82
- return t;
83
- };
84
- var __assignFn = ObjAssign || __objAssignFnImpl;
85
- var extendStaticsFn = function (d, b) {
86
- extendStaticsFn = ObjClass["setPrototypeOf"] ||
87
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
88
- function (d, b) {
89
- for (var p in b) {
90
- if (b[strShimHasOwnProperty](p)) {
91
- d[p] = b[p];
92
- }
93
- }
94
- };
95
- return extendStaticsFn(d, b);
96
- };
97
- function __extendsFn(d, b) {
98
- if (typeof b !== strShimFunction && b !== null) {
99
- throwTypeError("Class extends value " + String(b) + " is not a constructor or null");
100
- }
101
- extendStaticsFn(d, b);
102
- function __() { this.constructor = d; }
103
- d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
104
- }
105
- function __spreadArrayFn(to, from) {
106
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) {
107
- to[j] = from[i];
108
- }
109
- return to;
110
- }
111
-
112
11
  /*!
113
12
  * Microsoft Dynamic Proto Utility, 1.1.4
114
13
  * Copyright (c) Microsoft and contributors. All rights reserved.
@@ -350,6 +249,111 @@
350
249
  };
351
250
  dynamicProto[DynProtoDefaultOptions] = perfDefaults;
352
251
 
252
+ var EventsDiscardedReason = {
253
+ Unknown: 0,
254
+ NonRetryableStatus: 1,
255
+ InvalidEvent: 2,
256
+ SizeLimitExceeded: 3,
257
+ KillSwitch: 4,
258
+ QueueFull: 5
259
+ };
260
+
261
+ var strShimFunction = "function";
262
+ var strShimObject = "object";
263
+ var strShimUndefined = "undefined";
264
+ var strShimPrototype = "prototype";
265
+ var strShimHasOwnProperty = "hasOwnProperty";
266
+ var ObjClass = Object;
267
+ var ObjProto = ObjClass[strShimPrototype];
268
+ var ObjAssign = ObjClass["assign"];
269
+ var ObjCreate = ObjClass["create"];
270
+ var ObjDefineProperty = ObjClass["defineProperty"];
271
+ var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty];
272
+
273
+ var _cachedGlobal = null;
274
+ function getGlobal(useCached) {
275
+ if (useCached === void 0) { useCached = true; }
276
+ if (!_cachedGlobal || !useCached) {
277
+ if (typeof globalThis !== strShimUndefined && globalThis) {
278
+ _cachedGlobal = globalThis;
279
+ }
280
+ if (typeof self !== strShimUndefined && self) {
281
+ _cachedGlobal = self;
282
+ }
283
+ if (typeof window !== strShimUndefined && window) {
284
+ _cachedGlobal = window;
285
+ }
286
+ if (typeof global !== strShimUndefined && global) {
287
+ _cachedGlobal = global;
288
+ }
289
+ }
290
+ return _cachedGlobal;
291
+ }
292
+ function throwTypeError(message) {
293
+ throw new TypeError(message);
294
+ }
295
+ function objCreateFn(obj) {
296
+ var func = ObjCreate;
297
+ if (func) {
298
+ return func(obj);
299
+ }
300
+ if (obj == null) {
301
+ return {};
302
+ }
303
+ var type = typeof obj;
304
+ if (type !== strShimObject && type !== strShimFunction) {
305
+ throwTypeError("Object prototype may only be an Object:" + obj);
306
+ }
307
+ function tmpFunc() { }
308
+ tmpFunc[strShimPrototype] = obj;
309
+ return new tmpFunc();
310
+ }
311
+
312
+ (getGlobal() || {})["Symbol"];
313
+ (getGlobal() || {})["Reflect"];
314
+ var __objAssignFnImpl = function (t) {
315
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
316
+ s = arguments[i];
317
+ for (var p in s) {
318
+ if (ObjProto[strShimHasOwnProperty].call(s, p)) {
319
+ t[p] = s[p];
320
+ }
321
+ }
322
+ }
323
+ return t;
324
+ };
325
+ var __assignFn = ObjAssign || __objAssignFnImpl;
326
+ var extendStaticsFn = function (d, b) {
327
+ extendStaticsFn = ObjClass["setPrototypeOf"] ||
328
+ ({ __proto__: [] } instanceof Array && function (d, b) {
329
+ d.__proto__ = b;
330
+ }) ||
331
+ function (d, b) {
332
+ for (var p in b) {
333
+ if (b[strShimHasOwnProperty](p)) {
334
+ d[p] = b[p];
335
+ }
336
+ }
337
+ };
338
+ return extendStaticsFn(d, b);
339
+ };
340
+ function __extendsFn(d, b) {
341
+ if (typeof b !== strShimFunction && b !== null) {
342
+ throwTypeError("Class extends value " + String(b) + " is not a constructor or null");
343
+ }
344
+ extendStaticsFn(d, b);
345
+ function __() {
346
+ this.constructor = d;
347
+ }
348
+ d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
349
+ }
350
+ function __spreadArrayFn(to, from) {
351
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) {
352
+ to[j] = from[i];
353
+ }
354
+ return to;
355
+ }
356
+
353
357
  var strEmpty$1 = "";
354
358
  var strProcessTelemetry = "processTelemetry";
355
359
  var strPriority = "priority";
@@ -1460,7 +1464,7 @@
1460
1464
  }
1461
1465
 
1462
1466
  var _objDefineProperty = ObjDefineProperty;
1463
- var version = "2.7.3";
1467
+ var version = "2.8.0-beta.2203-11";
1464
1468
  var instanceName = "." + newId(6);
1465
1469
  var _dataUid = 0;
1466
1470
  function _createAccessor(target, prop, value) {
@@ -1610,7 +1614,9 @@
1610
1614
  var context = {
1611
1615
  _next: _moveNext,
1612
1616
  ctx: {
1613
- core: function () { return core; },
1617
+ core: function () {
1618
+ return core;
1619
+ },
1614
1620
  diagLog: function () {
1615
1621
  return safeGetLogger(core, config);
1616
1622
  },
@@ -2262,7 +2268,9 @@
2262
2268
  }
2263
2269
  });
2264
2270
  },
2265
- isInitialized: function () { return isInitialized; },
2271
+ isInitialized: function () {
2272
+ return isInitialized;
2273
+ },
2266
2274
  processTelemetry: function (item, itemCtx) {
2267
2275
  _processChannelQueue(channelQueue, itemCtx || _getTelCtx(), function (chainCtx) {
2268
2276
  chainCtx[strProcessNext](item);
@@ -2696,9 +2704,11 @@
2696
2704
  };
2697
2705
  _self.getTransmissionControls = function () {
2698
2706
  var controls = [];
2699
- arrForEach(_channelQueue, function (channels) {
2700
- controls.push(channels.queue);
2701
- });
2707
+ if (_channelQueue) {
2708
+ arrForEach(_channelQueue, function (channels) {
2709
+ controls.push(channels.queue);
2710
+ });
2711
+ }
2702
2712
  return objFreeze(controls);
2703
2713
  };
2704
2714
  _self.track = function (telemetryItem) {
@@ -2763,7 +2773,7 @@
2763
2773
  }
2764
2774
  };
2765
2775
  _self.pollInternalLogs = function (eventName) {
2766
- _internalLogsEventName = eventName;
2776
+ _internalLogsEventName = eventName || null;
2767
2777
  var interval = _self.config.diagnosticLogInterval;
2768
2778
  if (!interval || !(interval > 0)) {
2769
2779
  interval = 10000;
@@ -2839,7 +2849,7 @@
2839
2849
  var removedPlugins_1 = [existingPlugin.plugin];
2840
2850
  var unloadState = {
2841
2851
  reason: 2 ,
2842
- isAsync: isAsync
2852
+ isAsync: !!isAsync
2843
2853
  };
2844
2854
  _removePlugins(removedPlugins_1, unloadState, function (removed) {
2845
2855
  if (!removed) {
@@ -2864,7 +2874,7 @@
2864
2874
  function _initDefaults() {
2865
2875
  _isInitialized = false;
2866
2876
  _self.logger = new DiagnosticLogger({ loggingLevelConsole: 1 });
2867
- _self.config = null;
2877
+ _self.config = {};
2868
2878
  _self._extensions = [];
2869
2879
  _telemetryInitializerPlugin = new TelemetryInitializerPlugin();
2870
2880
  _eventQueue = [];
@@ -2874,7 +2884,7 @@
2874
2884
  _cookieManager = null;
2875
2885
  _pluginChain = null;
2876
2886
  _coreExtensions = null;
2877
- _configExtensions = null;
2887
+ _configExtensions = [];
2878
2888
  _channelControl = null;
2879
2889
  _channelConfig = null;
2880
2890
  _channelQueue = null;
@@ -3183,6 +3193,8 @@
3183
3193
  var strEvents = "events";
3184
3194
  createUniqueNamespace("aiEvtPageHide");
3185
3195
  createUniqueNamespace("aiEvtPageShow");
3196
+ var rRemoveEmptyNs = /\.[\.]+/g;
3197
+ var rRemoveTrailingEmptyNs = /[\.]+$/;
3186
3198
  var _guid = 1;
3187
3199
  var elmNodeData = createElmNodeData("events");
3188
3200
  var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
@@ -3217,10 +3229,10 @@
3217
3229
  eventName = (eventName || "") + theNamespace_1;
3218
3230
  }
3219
3231
  }
3220
- var parsedEvent = (eventNamespace.exec(eventName) || []);
3232
+ var parsedEvent = (eventNamespace.exec(eventName || "") || []);
3221
3233
  return {
3222
3234
  type: parsedEvent[1],
3223
- ns: ((parsedEvent[2] || "").split(".").sort()).join(".")
3235
+ ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".")
3224
3236
  };
3225
3237
  }
3226
3238
  function _getRegisteredEvents(target, evtName, addDefault) {
@@ -3293,6 +3305,7 @@
3293
3305
  else {
3294
3306
  newNamespaces = [theNamespace, namespaces];
3295
3307
  }
3308
+ newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns).split(".");
3296
3309
  }
3297
3310
  else {
3298
3311
  newNamespaces = theNamespace;
@@ -5045,7 +5058,7 @@
5045
5058
  }
5046
5059
  }
5047
5060
  var EnvelopeCreator = {
5048
- Version: "2.8.0-beta.2203-08"
5061
+ Version: "2.8.0-beta.2203-11"
5049
5062
  };
5050
5063
  function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
5051
5064
  EnvelopeCreatorInit(logger, telemetryItem);
@@ -5603,6 +5616,9 @@
5603
5616
  _headers[name] = value;
5604
5617
  };
5605
5618
  _self.initialize = function (config, core, extensions, pluginChain) {
5619
+ if (_self.isInitialized()) {
5620
+ _throwInternal(_self.diagLog(), LoggingSeverity.CRITICAL, _InternalMessageId.SenderNotInitialized, "Sender is already initialized");
5621
+ }
5606
5622
  _base.initialize(config, core, extensions, pluginChain);
5607
5623
  var ctx = _self._getTelCtx();
5608
5624
  var identifier = _self.identifier;
@@ -6205,46 +6221,41 @@
6205
6221
 
6206
6222
  var ApplicationInsights = /** @class */ (function () {
6207
6223
  function ApplicationInsights(config) {
6224
+ var core = new AppInsightsCore();
6208
6225
  if (isNullOrUndefined(config) ||
6209
6226
  isNullOrUndefined(config.instrumentationKey)) {
6210
6227
  throwError("Invalid input configuration");
6211
6228
  }
6212
- this.config = config;
6213
- this.getSKUDefaults();
6214
- this.initialize();
6215
- }
6216
- ApplicationInsights.prototype.initialize = function () {
6217
- this.core = new AppInsightsCore();
6218
- var extensions = [];
6219
- var appInsightsChannel = new Sender();
6220
- extensions.push(appInsightsChannel);
6221
- this.core.initialize(this.config, extensions);
6222
- appInsightsChannel.initialize(this.config, this.core, extensions);
6223
- this.pollInternalLogs();
6224
- };
6225
- ApplicationInsights.prototype.track = function (item) {
6226
- this.core.track(item);
6227
- };
6228
- ApplicationInsights.prototype.flush = function (async) {
6229
- if (async === void 0) { async = true; }
6230
- arrForEach(this.core.getTransmissionControls(), function (controls) {
6231
- arrForEach(controls, function (plugin) {
6232
- async
6233
- ? plugin.flush()
6234
- : plugin.triggerSend(async, null, 1 );
6235
- });
6229
+ dynamicProto(ApplicationInsights, this, function (_self) {
6230
+ _self.config = config;
6231
+ _self.getSKUDefaults();
6232
+ _initialize();
6233
+ _self.initialize = _initialize;
6234
+ _self.getSKUDefaults = function () {
6235
+ _self.config.diagnosticLogInterval =
6236
+ _self.config.diagnosticLogInterval && _self.config.diagnosticLogInterval > 0 ? _self.config.diagnosticLogInterval : 10000;
6237
+ };
6238
+ proxyFunctions(_self, core, [
6239
+ "track",
6240
+ "flush",
6241
+ "pollInternalLogs",
6242
+ "stopPollingInternalLogs",
6243
+ "unload",
6244
+ "getPlugin",
6245
+ "addPlugin",
6246
+ "evtNamespace",
6247
+ "addUnloadCb"
6248
+ ]);
6249
+ function _initialize() {
6250
+ var extensions = [];
6251
+ var appInsightsChannel = new Sender();
6252
+ extensions.push(appInsightsChannel);
6253
+ core.initialize(this.config, extensions);
6254
+ appInsightsChannel.initialize(this.config, core, extensions);
6255
+ core.pollInternalLogs();
6256
+ }
6236
6257
  });
6237
- };
6238
- ApplicationInsights.prototype.pollInternalLogs = function () {
6239
- this.core.pollInternalLogs();
6240
- };
6241
- ApplicationInsights.prototype.stopPollingInternalLogs = function () {
6242
- this.core.stopPollingInternalLogs();
6243
- };
6244
- ApplicationInsights.prototype.getSKUDefaults = function () {
6245
- this.config.diagnosticLogInterval =
6246
- this.config.diagnosticLogInterval && this.config.diagnosticLogInterval > 0 ? this.config.diagnosticLogInterval : 10000;
6247
- };
6258
+ }
6248
6259
  return ApplicationInsights;
6249
6260
  }());
6250
6261
 
@@ -6252,8 +6263,13 @@
6252
6263
  exports.ApplicationInsights = ApplicationInsights;
6253
6264
  exports.CoreUtils = CoreUtils;
6254
6265
  exports.Sender = Sender;
6266
+ exports._InternalMessageId = _InternalMessageId;
6267
+ exports.arrForEach = arrForEach;
6268
+ exports.isNullOrUndefined = isNullOrUndefined;
6269
+ exports.proxyFunctions = proxyFunctions;
6270
+ exports.throwError = throwError;
6255
6271
 
6256
6272
  (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true });
6257
6273
 
6258
6274
  }));
6259
- //# sourceMappingURL=aib.2.8.0-beta.2203-08.js.map
6275
+ //# sourceMappingURL=aib.2.8.0-beta.2203-11.js.map