@microsoft/applicationinsights-web-basic 2.8.0-beta.2203-10 → 2.8.0-beta.2203-13

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-13",
4
+ "ext": {
5
+ "@js": {
6
+ "file": "aib.2.8.0-beta.2203-13.js",
7
+ "type": "text/javascript; charset=utf-8",
8
+ "integrity": "sha256-Jjw+xmDhczrzpcD/CvhMNhoLrRdj4OP+asQQ2eKs9Gw= sha384-kfw8HcbxTMtYH/Upsu//FP8hNDnuvaquTHZKQK09s0rEpij0OFOYfG5mMk2LHXuN sha512-d8kFd5iypQnVjWpfnbyuuqkYaUvwnOofb/gtzDWA+w6w2zmstWiSmbKCXL1tlBHe1R1vpI12tRE3LjtDO6RiwA==",
9
+ "hashes": {
10
+ "sha256": "Jjw+xmDhczrzpcD/CvhMNhoLrRdj4OP+asQQ2eKs9Gw=",
11
+ "sha384": "kfw8HcbxTMtYH/Upsu//FP8hNDnuvaquTHZKQK09s0rEpij0OFOYfG5mMk2LHXuN",
12
+ "sha512": "d8kFd5iypQnVjWpfnbyuuqkYaUvwnOofb/gtzDWA+w6w2zmstWiSmbKCXL1tlBHe1R1vpI12tRE3LjtDO6RiwA=="
13
+ }
14
+ },
15
+ "@min.js": {
16
+ "file": "aib.2.8.0-beta.2203-13.min.js",
17
+ "type": "text/javascript; charset=utf-8",
18
+ "integrity": "sha256-APPYeFbsmqBDH2IdaqYWwnEnA0sAfTRTvLs/9X7wnA8= sha384-DVCOGtymYhqzBYzsRcU4EkNJ6UBd7I42XJt1rBKGH+MPBTxK0LmrEVBKxf7rhpp3 sha512-RnYXTP6A+rjjoqR2JeNB26wva/OeC2ryWOWGDpb86jZAhWgi5/Pm75qmMLudzdupXvjyXBTwsigqakSoEsiaPA==",
19
+ "hashes": {
20
+ "sha256": "APPYeFbsmqBDH2IdaqYWwnEnA0sAfTRTvLs/9X7wnA8=",
21
+ "sha384": "DVCOGtymYhqzBYzsRcU4EkNJ6UBd7I42XJt1rBKGH+MPBTxK0LmrEVBKxf7rhpp3",
22
+ "sha512": "RnYXTP6A+rjjoqR2JeNB26wva/OeC2ryWOWGDpb86jZAhWgi5/Pm75qmMLudzdupXvjyXBTwsigqakSoEsiaPA=="
23
+ }
24
+ }
25
+ }
26
+ }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript Web SDK - Basic, 2.8.0-beta.2203-10
2
+ * Application Insights JavaScript Web SDK - Basic, 2.8.0-beta.2203-13
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -8,111 +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) {
88
- d.__proto__ = b;
89
- }) ||
90
- function (d, b) {
91
- for (var p in b) {
92
- if (b[strShimHasOwnProperty](p)) {
93
- d[p] = b[p];
94
- }
95
- }
96
- };
97
- return extendStaticsFn(d, b);
98
- };
99
- function __extendsFn(d, b) {
100
- if (typeof b !== strShimFunction && b !== null) {
101
- throwTypeError("Class extends value " + String(b) + " is not a constructor or null");
102
- }
103
- extendStaticsFn(d, b);
104
- function __() {
105
- this.constructor = d;
106
- }
107
- d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
108
- }
109
- function __spreadArrayFn(to, from) {
110
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) {
111
- to[j] = from[i];
112
- }
113
- return to;
114
- }
115
-
116
11
  /*!
117
12
  * Microsoft Dynamic Proto Utility, 1.1.4
118
13
  * Copyright (c) Microsoft and contributors. All rights reserved.
@@ -354,6 +249,111 @@
354
249
  };
355
250
  dynamicProto[DynProtoDefaultOptions] = perfDefaults;
356
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
+
357
357
  var strEmpty$1 = "";
358
358
  var strProcessTelemetry = "processTelemetry";
359
359
  var strPriority = "priority";
@@ -1464,7 +1464,7 @@
1464
1464
  }
1465
1465
 
1466
1466
  var _objDefineProperty = ObjDefineProperty;
1467
- var version = "2.7.3";
1467
+ var version = "2.8.0-beta.2203-13";
1468
1468
  var instanceName = "." + newId(6);
1469
1469
  var _dataUid = 0;
1470
1470
  function _createAccessor(target, prop, value) {
@@ -2704,9 +2704,11 @@
2704
2704
  };
2705
2705
  _self.getTransmissionControls = function () {
2706
2706
  var controls = [];
2707
- arrForEach(_channelQueue, function (channels) {
2708
- controls.push(channels.queue);
2709
- });
2707
+ if (_channelQueue) {
2708
+ arrForEach(_channelQueue, function (channels) {
2709
+ controls.push(channels.queue);
2710
+ });
2711
+ }
2710
2712
  return objFreeze(controls);
2711
2713
  };
2712
2714
  _self.track = function (telemetryItem) {
@@ -2771,7 +2773,7 @@
2771
2773
  }
2772
2774
  };
2773
2775
  _self.pollInternalLogs = function (eventName) {
2774
- _internalLogsEventName = eventName;
2776
+ _internalLogsEventName = eventName || null;
2775
2777
  var interval = _self.config.diagnosticLogInterval;
2776
2778
  if (!interval || !(interval > 0)) {
2777
2779
  interval = 10000;
@@ -2847,7 +2849,7 @@
2847
2849
  var removedPlugins_1 = [existingPlugin.plugin];
2848
2850
  var unloadState = {
2849
2851
  reason: 2 ,
2850
- isAsync: isAsync
2852
+ isAsync: !!isAsync
2851
2853
  };
2852
2854
  _removePlugins(removedPlugins_1, unloadState, function (removed) {
2853
2855
  if (!removed) {
@@ -2872,7 +2874,7 @@
2872
2874
  function _initDefaults() {
2873
2875
  _isInitialized = false;
2874
2876
  _self.logger = new DiagnosticLogger({ loggingLevelConsole: 1 });
2875
- _self.config = null;
2877
+ _self.config = {};
2876
2878
  _self._extensions = [];
2877
2879
  _telemetryInitializerPlugin = new TelemetryInitializerPlugin();
2878
2880
  _eventQueue = [];
@@ -2882,7 +2884,7 @@
2882
2884
  _cookieManager = null;
2883
2885
  _pluginChain = null;
2884
2886
  _coreExtensions = null;
2885
- _configExtensions = null;
2887
+ _configExtensions = [];
2886
2888
  _channelControl = null;
2887
2889
  _channelConfig = null;
2888
2890
  _channelQueue = null;
@@ -3227,7 +3229,7 @@
3227
3229
  eventName = (eventName || "") + theNamespace_1;
3228
3230
  }
3229
3231
  }
3230
- var parsedEvent = (eventNamespace.exec(eventName) || []);
3232
+ var parsedEvent = (eventNamespace.exec(eventName || "") || []);
3231
3233
  return {
3232
3234
  type: parsedEvent[1],
3233
3235
  ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".")
@@ -5056,7 +5058,7 @@
5056
5058
  }
5057
5059
  }
5058
5060
  var EnvelopeCreator = {
5059
- Version: "2.8.0-beta.2203-10"
5061
+ Version: "2.8.0-beta.2203-13"
5060
5062
  };
5061
5063
  function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
5062
5064
  EnvelopeCreatorInit(logger, telemetryItem);
@@ -5614,6 +5616,9 @@
5614
5616
  _headers[name] = value;
5615
5617
  };
5616
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
+ }
5617
5622
  _base.initialize(config, core, extensions, pluginChain);
5618
5623
  var ctx = _self._getTelCtx();
5619
5624
  var identifier = _self.identifier;
@@ -6216,46 +6221,41 @@
6216
6221
 
6217
6222
  var ApplicationInsights = /** @class */ (function () {
6218
6223
  function ApplicationInsights(config) {
6224
+ var core = new AppInsightsCore();
6219
6225
  if (isNullOrUndefined(config) ||
6220
6226
  isNullOrUndefined(config.instrumentationKey)) {
6221
6227
  throwError("Invalid input configuration");
6222
6228
  }
6223
- this.config = config;
6224
- this.getSKUDefaults();
6225
- this.initialize();
6226
- }
6227
- ApplicationInsights.prototype.initialize = function () {
6228
- this.core = new AppInsightsCore();
6229
- var extensions = [];
6230
- var appInsightsChannel = new Sender();
6231
- extensions.push(appInsightsChannel);
6232
- this.core.initialize(this.config, extensions);
6233
- appInsightsChannel.initialize(this.config, this.core, extensions);
6234
- this.pollInternalLogs();
6235
- };
6236
- ApplicationInsights.prototype.track = function (item) {
6237
- this.core.track(item);
6238
- };
6239
- ApplicationInsights.prototype.flush = function (async) {
6240
- if (async === void 0) { async = true; }
6241
- arrForEach(this.core.getTransmissionControls(), function (controls) {
6242
- arrForEach(controls, function (plugin) {
6243
- async
6244
- ? plugin.flush()
6245
- : plugin.triggerSend(async, null, 1 );
6246
- });
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
+ }
6247
6257
  });
6248
- };
6249
- ApplicationInsights.prototype.pollInternalLogs = function () {
6250
- this.core.pollInternalLogs();
6251
- };
6252
- ApplicationInsights.prototype.stopPollingInternalLogs = function () {
6253
- this.core.stopPollingInternalLogs();
6254
- };
6255
- ApplicationInsights.prototype.getSKUDefaults = function () {
6256
- this.config.diagnosticLogInterval =
6257
- this.config.diagnosticLogInterval && this.config.diagnosticLogInterval > 0 ? this.config.diagnosticLogInterval : 10000;
6258
- };
6258
+ }
6259
6259
  return ApplicationInsights;
6260
6260
  }());
6261
6261
 
@@ -6263,8 +6263,13 @@
6263
6263
  exports.ApplicationInsights = ApplicationInsights;
6264
6264
  exports.CoreUtils = CoreUtils;
6265
6265
  exports.Sender = Sender;
6266
+ exports._InternalMessageId = _InternalMessageId;
6267
+ exports.arrForEach = arrForEach;
6268
+ exports.isNullOrUndefined = isNullOrUndefined;
6269
+ exports.proxyFunctions = proxyFunctions;
6270
+ exports.throwError = throwError;
6266
6271
 
6267
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 });
6268
6273
 
6269
6274
  }));
6270
- //# sourceMappingURL=aib.2.8.0-beta.2203-10.js.map
6275
+ //# sourceMappingURL=aib.2.8.0-beta.2203-13.js.map