@microsoft/applicationinsights-web-basic 2.8.0-beta.2203-09 → 2.8.0-beta.2203-12

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-12",
4
+ "ext": {
5
+ "@js": {
6
+ "file": "aib.2.8.0-beta.2203-12.js",
7
+ "type": "text/javascript; charset=utf-8",
8
+ "integrity": "sha256-z3aJ3YcNXTwTTHqt7zbF3u9Xf31nfDtVxEGvnuhRZ1Q= sha384-/dlfiAACCz3LqSjEcrkoJH6HlSgphCZkZV6naSS1B+xD5ZjKvaL7LGV7RnqLCl/+ sha512-JN0Fmv4U06hWnIbJXvl3XhtobBPhczzLCXzArjoIPxzlDNLz0pIu3ArJv1cMuF8iYhTDTas5IWeO1US3h0Op1A==",
9
+ "hashes": {
10
+ "sha256": "z3aJ3YcNXTwTTHqt7zbF3u9Xf31nfDtVxEGvnuhRZ1Q=",
11
+ "sha384": "/dlfiAACCz3LqSjEcrkoJH6HlSgphCZkZV6naSS1B+xD5ZjKvaL7LGV7RnqLCl/+",
12
+ "sha512": "JN0Fmv4U06hWnIbJXvl3XhtobBPhczzLCXzArjoIPxzlDNLz0pIu3ArJv1cMuF8iYhTDTas5IWeO1US3h0Op1A=="
13
+ }
14
+ },
15
+ "@min.js": {
16
+ "file": "aib.2.8.0-beta.2203-12.min.js",
17
+ "type": "text/javascript; charset=utf-8",
18
+ "integrity": "sha256-o4Z4Y5CRSNfHFxRhEhsYu8+KelHbBfJUQzycxKmoGVM= sha384-pPGyTqyzH7TKvFeIMsGvcpuJNKaeIIhdYnnmCDUgrnet4xhHewJYfndy9yvkd6Xz sha512-BeISSCLIGJPtOM9y7f49IX1jK4BefhxSepJjfrb5X1inbY6v3p9HWoXO5fd3wnJvSLqWK6sO3G0LZxqZ/k3Kiw==",
19
+ "hashes": {
20
+ "sha256": "o4Z4Y5CRSNfHFxRhEhsYu8+KelHbBfJUQzycxKmoGVM=",
21
+ "sha384": "pPGyTqyzH7TKvFeIMsGvcpuJNKaeIIhdYnnmCDUgrnet4xhHewJYfndy9yvkd6Xz",
22
+ "sha512": "BeISSCLIGJPtOM9y7f49IX1jK4BefhxSepJjfrb5X1inbY6v3p9HWoXO5fd3wnJvSLqWK6sO3G0LZxqZ/k3Kiw=="
23
+ }
24
+ }
25
+ }
26
+ }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript Web SDK - Basic, 2.8.0-beta.2203-09
2
+ * Application Insights JavaScript Web SDK - Basic, 2.8.0-beta.2203-12
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-12";
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;
@@ -3219,7 +3229,7 @@
3219
3229
  eventName = (eventName || "") + theNamespace_1;
3220
3230
  }
3221
3231
  }
3222
- var parsedEvent = (eventNamespace.exec(eventName) || []);
3232
+ var parsedEvent = (eventNamespace.exec(eventName || "") || []);
3223
3233
  return {
3224
3234
  type: parsedEvent[1],
3225
3235
  ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".")
@@ -5048,7 +5058,7 @@
5048
5058
  }
5049
5059
  }
5050
5060
  var EnvelopeCreator = {
5051
- Version: "2.8.0-beta.2203-09"
5061
+ Version: "2.8.0-beta.2203-12"
5052
5062
  };
5053
5063
  function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
5054
5064
  EnvelopeCreatorInit(logger, telemetryItem);
@@ -5606,6 +5616,9 @@
5606
5616
  _headers[name] = value;
5607
5617
  };
5608
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
+ }
5609
5622
  _base.initialize(config, core, extensions, pluginChain);
5610
5623
  var ctx = _self._getTelCtx();
5611
5624
  var identifier = _self.identifier;
@@ -6208,46 +6221,41 @@
6208
6221
 
6209
6222
  var ApplicationInsights = /** @class */ (function () {
6210
6223
  function ApplicationInsights(config) {
6224
+ var core = new AppInsightsCore();
6211
6225
  if (isNullOrUndefined(config) ||
6212
6226
  isNullOrUndefined(config.instrumentationKey)) {
6213
6227
  throwError("Invalid input configuration");
6214
6228
  }
6215
- this.config = config;
6216
- this.getSKUDefaults();
6217
- this.initialize();
6218
- }
6219
- ApplicationInsights.prototype.initialize = function () {
6220
- this.core = new AppInsightsCore();
6221
- var extensions = [];
6222
- var appInsightsChannel = new Sender();
6223
- extensions.push(appInsightsChannel);
6224
- this.core.initialize(this.config, extensions);
6225
- appInsightsChannel.initialize(this.config, this.core, extensions);
6226
- this.pollInternalLogs();
6227
- };
6228
- ApplicationInsights.prototype.track = function (item) {
6229
- this.core.track(item);
6230
- };
6231
- ApplicationInsights.prototype.flush = function (async) {
6232
- if (async === void 0) { async = true; }
6233
- arrForEach(this.core.getTransmissionControls(), function (controls) {
6234
- arrForEach(controls, function (plugin) {
6235
- async
6236
- ? plugin.flush()
6237
- : plugin.triggerSend(async, null, 1 );
6238
- });
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
+ }
6239
6257
  });
6240
- };
6241
- ApplicationInsights.prototype.pollInternalLogs = function () {
6242
- this.core.pollInternalLogs();
6243
- };
6244
- ApplicationInsights.prototype.stopPollingInternalLogs = function () {
6245
- this.core.stopPollingInternalLogs();
6246
- };
6247
- ApplicationInsights.prototype.getSKUDefaults = function () {
6248
- this.config.diagnosticLogInterval =
6249
- this.config.diagnosticLogInterval && this.config.diagnosticLogInterval > 0 ? this.config.diagnosticLogInterval : 10000;
6250
- };
6258
+ }
6251
6259
  return ApplicationInsights;
6252
6260
  }());
6253
6261
 
@@ -6255,8 +6263,13 @@
6255
6263
  exports.ApplicationInsights = ApplicationInsights;
6256
6264
  exports.CoreUtils = CoreUtils;
6257
6265
  exports.Sender = Sender;
6266
+ exports._InternalMessageId = _InternalMessageId;
6267
+ exports.arrForEach = arrForEach;
6268
+ exports.isNullOrUndefined = isNullOrUndefined;
6269
+ exports.proxyFunctions = proxyFunctions;
6270
+ exports.throwError = throwError;
6258
6271
 
6259
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 });
6260
6273
 
6261
6274
  }));
6262
- //# sourceMappingURL=aib.2.8.0-beta.2203-09.js.map
6275
+ //# sourceMappingURL=aib.2.8.0-beta.2203-12.js.map