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

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.
@@ -708,7 +708,7 @@
708
708
  {
709
709
  "kind": "MethodSignature",
710
710
  "canonicalReference": "@microsoft/applicationinsights-web-basic!IAppInsightsCore#addPlugin:member(1)",
711
- "docComment": "/**\n * Add a new plugin to the installation\n *\n * @param plugin - The new plugin to add\n *\n * @param replaceExisting - should any existing plugin be replaced\n *\n * @param doAsync - Should the add be performed asynchronously\n */\n",
711
+ "docComment": "/**\n * Add a new plugin to the installation\n *\n * @param plugin - The new plugin to add\n *\n * @param replaceExisting - should any existing plugin be replaced, default is false\n *\n * @param doAsync - Should the add be performed asynchronously\n *\n * @param addCb - [Optional] callback to call after the plugin has been added\n */\n",
712
712
  "excerptTokens": [
713
713
  {
714
714
  "kind": "Content",
@@ -742,7 +742,7 @@
742
742
  },
743
743
  {
744
744
  "kind": "Content",
745
- "text": ", replaceExisting: "
745
+ "text": ", replaceExisting?: "
746
746
  },
747
747
  {
748
748
  "kind": "Content",
@@ -750,7 +750,7 @@
750
750
  },
751
751
  {
752
752
  "kind": "Content",
753
- "text": ", doAsync: "
753
+ "text": ", doAsync?: "
754
754
  },
755
755
  {
756
756
  "kind": "Content",
@@ -979,6 +979,96 @@
979
979
  "parameters": [],
980
980
  "name": "evtNamespace"
981
981
  },
982
+ {
983
+ "kind": "MethodSignature",
984
+ "canonicalReference": "@microsoft/applicationinsights-web-basic!IAppInsightsCore#flush:member(1)",
985
+ "docComment": "/**\n * Flush and send any batched / cached data immediately\n *\n * @param async - send data asynchronously when true (defaults to true)\n *\n * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. If the caller doesn't return true the caller should assume that it may never be called.\n *\n * @param sendReason - specify the reason that you are calling \"flush\" defaults to ManualFlush (1) if not specified\n *\n * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.\n *\n * @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called\n */\n",
986
+ "excerptTokens": [
987
+ {
988
+ "kind": "Content",
989
+ "text": "flush(isAsync?: "
990
+ },
991
+ {
992
+ "kind": "Content",
993
+ "text": "boolean"
994
+ },
995
+ {
996
+ "kind": "Content",
997
+ "text": ", callBack?: "
998
+ },
999
+ {
1000
+ "kind": "Content",
1001
+ "text": "(flushComplete?: boolean) => void"
1002
+ },
1003
+ {
1004
+ "kind": "Content",
1005
+ "text": ", sendReason?: "
1006
+ },
1007
+ {
1008
+ "kind": "Reference",
1009
+ "text": "SendRequestReason",
1010
+ "canonicalReference": "@microsoft/applicationinsights-web-basic!SendRequestReason:enum"
1011
+ },
1012
+ {
1013
+ "kind": "Content",
1014
+ "text": ", cbTimeout?: "
1015
+ },
1016
+ {
1017
+ "kind": "Content",
1018
+ "text": "number"
1019
+ },
1020
+ {
1021
+ "kind": "Content",
1022
+ "text": "): "
1023
+ },
1024
+ {
1025
+ "kind": "Content",
1026
+ "text": "boolean | void"
1027
+ },
1028
+ {
1029
+ "kind": "Content",
1030
+ "text": ";"
1031
+ }
1032
+ ],
1033
+ "isOptional": false,
1034
+ "returnTypeTokenRange": {
1035
+ "startIndex": 9,
1036
+ "endIndex": 10
1037
+ },
1038
+ "releaseTag": "Public",
1039
+ "overloadIndex": 1,
1040
+ "parameters": [
1041
+ {
1042
+ "parameterName": "isAsync",
1043
+ "parameterTypeTokenRange": {
1044
+ "startIndex": 1,
1045
+ "endIndex": 2
1046
+ }
1047
+ },
1048
+ {
1049
+ "parameterName": "callBack",
1050
+ "parameterTypeTokenRange": {
1051
+ "startIndex": 3,
1052
+ "endIndex": 4
1053
+ }
1054
+ },
1055
+ {
1056
+ "parameterName": "sendReason",
1057
+ "parameterTypeTokenRange": {
1058
+ "startIndex": 5,
1059
+ "endIndex": 6
1060
+ }
1061
+ },
1062
+ {
1063
+ "parameterName": "cbTimeout",
1064
+ "parameterTypeTokenRange": {
1065
+ "startIndex": 7,
1066
+ "endIndex": 8
1067
+ }
1068
+ }
1069
+ ],
1070
+ "name": "flush"
1071
+ },
982
1072
  {
983
1073
  "kind": "MethodSignature",
984
1074
  "canonicalReference": "@microsoft/applicationinsights-web-basic!IAppInsightsCore#getCookieMgr:member(1)",
@@ -1543,7 +1633,7 @@
1543
1633
  {
1544
1634
  "kind": "MethodSignature",
1545
1635
  "canonicalReference": "@microsoft/applicationinsights-web-basic!IAppInsightsCore#unload:member(1)",
1546
- "docComment": "/**\n * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous unload call return `true` stating that all plugins reported that they also unloaded, the recommended approach is to create a new instance and initialize that instance. This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable to successfully remove any global references or they may just be completing the unload process asynchronously.\n */\n",
1636
+ "docComment": "/**\n * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous unload call return `true` stating that all plugins reported that they also unloaded, the recommended approach is to create a new instance and initialize that instance. This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable to successfully remove any global references or they may just be completing the unload process asynchronously.\n *\n * @param isAsync - Can the unload be performed asynchronously (default)\n *\n * @param unloadComplete - An optional callback that will be called once the unload has completed\n *\n * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.\n */\n",
1547
1637
  "excerptTokens": [
1548
1638
  {
1549
1639
  "kind": "Content",
@@ -1559,7 +1649,24 @@
1559
1649
  },
1560
1650
  {
1561
1651
  "kind": "Content",
1562
- "text": "() => void"
1652
+ "text": "(unloadState: "
1653
+ },
1654
+ {
1655
+ "kind": "Reference",
1656
+ "text": "ITelemetryUnloadState",
1657
+ "canonicalReference": "@microsoft/applicationinsights-web-basic!ITelemetryUnloadState:interface"
1658
+ },
1659
+ {
1660
+ "kind": "Content",
1661
+ "text": ") => void"
1662
+ },
1663
+ {
1664
+ "kind": "Content",
1665
+ "text": ", cbTimeout?: "
1666
+ },
1667
+ {
1668
+ "kind": "Content",
1669
+ "text": "number"
1563
1670
  },
1564
1671
  {
1565
1672
  "kind": "Content",
@@ -1576,8 +1683,8 @@
1576
1683
  ],
1577
1684
  "isOptional": false,
1578
1685
  "returnTypeTokenRange": {
1579
- "startIndex": 5,
1580
- "endIndex": 6
1686
+ "startIndex": 9,
1687
+ "endIndex": 10
1581
1688
  },
1582
1689
  "releaseTag": "Public",
1583
1690
  "overloadIndex": 1,
@@ -1593,7 +1700,14 @@
1593
1700
  "parameterName": "unloadComplete",
1594
1701
  "parameterTypeTokenRange": {
1595
1702
  "startIndex": 3,
1596
- "endIndex": 4
1703
+ "endIndex": 6
1704
+ }
1705
+ },
1706
+ {
1707
+ "parameterName": "cbTimeout",
1708
+ "parameterTypeTokenRange": {
1709
+ "startIndex": 7,
1710
+ "endIndex": 8
1597
1711
  }
1598
1712
  }
1599
1713
  ],
@@ -45,7 +45,7 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
45
45
  // Warning: (ae-forgotten-export) The symbol "INotificationListener" needs to be exported by the entry point index.d.ts
46
46
  addNotificationListener?(listener: INotificationListener): void;
47
47
  // Warning: (ae-forgotten-export) The symbol "ITelemetryPlugin" needs to be exported by the entry point index.d.ts
48
- addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
48
+ addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
49
49
  // Warning: (ae-forgotten-export) The symbol "TelemetryInitializerFunction" needs to be exported by the entry point index.d.ts
50
50
  // Warning: (ae-forgotten-export) The symbol "ITelemetryInitializerHandler" needs to be exported by the entry point index.d.ts
51
51
  addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
@@ -54,6 +54,8 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
54
54
  // (undocumented)
55
55
  config: IConfiguration;
56
56
  evtNamespace(): string;
57
+ // Warning: (ae-forgotten-export) The symbol "SendRequestReason" needs to be exported by the entry point index.d.ts
58
+ flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason, cbTimeout?: number): boolean | void;
57
59
  // Warning: (ae-forgotten-export) The symbol "ICookieMgr" needs to be exported by the entry point index.d.ts
58
60
  getCookieMgr(): ICookieMgr;
59
61
  getNotifyMgr(): INotificationManager;
@@ -78,7 +80,8 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
78
80
  stopPollingInternalLogs?(): void;
79
81
  // (undocumented)
80
82
  track(telemetryItem: ITelemetryItem): void;
81
- unload(isAsync?: boolean, unloadComplete?: () => void): void;
83
+ // Warning: (ae-forgotten-export) The symbol "ITelemetryUnloadState" needs to be exported by the entry point index.d.ts
84
+ unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
82
85
  }
83
86
 
84
87
  // @public
@@ -265,7 +268,6 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
265
268
  readonly _senderConfig: ISenderConfig;
266
269
  // (undocumented)
267
270
  teardown(): void;
268
- // Warning: (ae-forgotten-export) The symbol "SendRequestReason" needs to be exported by the entry point index.d.ts
269
271
  triggerSend(async?: boolean, forcedSender?: SenderFunction, sendReason?: SendRequestReason): void;
270
272
  // Warning: (ae-forgotten-export) The symbol "XDomainRequest" needs to be exported by the entry point index.d.ts
271
273
  _xdrOnLoad(xdr: XDomainRequest, payload: string[]): void;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft.ApplicationInsights, 2.8.0-beta.2203-05
2
+ * Microsoft.ApplicationInsights, 2.8.0-beta.2203-08
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -107,10 +107,20 @@ declare namespace ApplicationInsights {
107
107
  * approach is to create a new instance and initialize that instance.
108
108
  * This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
109
109
  * to successfully remove any global references or they may just be completing the unload process asynchronously.
110
+ * @param isAsync - Can the unload be performed asynchronously (default)
111
+ * @param unloadComplete - An optional callback that will be called once the unload has completed
112
+ * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
110
113
  */
111
114
  unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
112
115
  getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
113
- addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
116
+ /**
117
+ * Add a new plugin to the installation
118
+ * @param plugin - The new plugin to add
119
+ * @param replaceExisting - should any existing plugin be replaced, default is false
120
+ * @param doAsync - Should the add be performed asynchronously
121
+ * @param addCb - [Optional] callback to call after the plugin has been added
122
+ */
123
+ addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
114
124
  /**
115
125
  * Returns the unique event namespace that should be used
116
126
  */
@@ -120,6 +130,15 @@ declare namespace ApplicationInsights {
120
130
  * @param handler - the handler
121
131
  */
122
132
  addUnloadCb(handler: UnloadHandler): void;
133
+ /**
134
+ * Flush and send any batched / cached data immediately
135
+ * @param async - send data asynchronously when true (defaults to true)
136
+ * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called.
137
+ * If the caller doesn't return true the caller should assume that it may never be called.
138
+ * @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
139
+ * @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called
140
+ */
141
+ flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): void;
123
142
  protected releaseQueue(): void;
124
143
  /**
125
144
  * Hook for Core extensions to allow them to update their own configuration before updating all of the plugins.
@@ -410,8 +429,11 @@ declare namespace ApplicationInsights {
410
429
  * approach is to create a new instance and initialize that instance.
411
430
  * This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
412
431
  * to successfully remove any global references or they may just be completing the unload process asynchronously.
432
+ * @param isAsync - Can the unload be performed asynchronously (default)
433
+ * @param unloadComplete - An optional callback that will be called once the unload has completed
434
+ * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
413
435
  */
414
- unload(isAsync?: boolean, unloadComplete?: () => void): void;
436
+ unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
415
437
  /**
416
438
  * Find and return the (first) plugin with the specified identifier if present
417
439
  * @param pluginIdentifier
@@ -420,10 +442,11 @@ declare namespace ApplicationInsights {
420
442
  /**
421
443
  * Add a new plugin to the installation
422
444
  * @param plugin - The new plugin to add
423
- * @param replaceExisting - should any existing plugin be replaced
445
+ * @param replaceExisting - should any existing plugin be replaced, default is false
424
446
  * @param doAsync - Should the add be performed asynchronously
447
+ * @param addCb - [Optional] callback to call after the plugin has been added
425
448
  */
426
- addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
449
+ addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
427
450
  /**
428
451
  * Returns the unique event namespace that should be used when registering events
429
452
  */
@@ -433,6 +456,16 @@ declare namespace ApplicationInsights {
433
456
  * @param handler - the handler
434
457
  */
435
458
  addUnloadCb(handler: UnloadHandler): void;
459
+ /**
460
+ * Flush and send any batched / cached data immediately
461
+ * @param async - send data asynchronously when true (defaults to true)
462
+ * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called.
463
+ * If the caller doesn't return true the caller should assume that it may never be called.
464
+ * @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
465
+ * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
466
+ * @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called
467
+ */
468
+ flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason, cbTimeout?: number): boolean | void;
436
469
  }
437
470
 
438
471
  /**
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript Web SDK - Basic, 2.8.0-beta.2203-05
2
+ * Application Insights JavaScript Web SDK - Basic, 2.8.0-beta.2203-08
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -2331,6 +2331,7 @@
2331
2331
  doneIterating = true;
2332
2332
  doCallback();
2333
2333
  });
2334
+ return true;
2334
2335
  },
2335
2336
  _a._setQueue = function (queue) {
2336
2337
  channelQueue = queue;
@@ -2687,7 +2688,7 @@
2687
2688
  _configExtensions.push.apply(_configExtensions, __spreadArrayFn(__spreadArrayFn([], extensions, false), config.extensions));
2688
2689
  _channelConfig = (config || {}).channels;
2689
2690
  _initPluginChain(config, null);
2690
- if (_self.getTransmissionControls().length === 0) {
2691
+ if (!_channelQueue || _channelQueue.length === 0) {
2691
2692
  throwError("No channels available");
2692
2693
  }
2693
2694
  _isInitialized = true;
@@ -2808,16 +2809,12 @@
2808
2809
  _self.stopPollingInternalLogs();
2809
2810
  processUnloadCtx.processNext(unloadState);
2810
2811
  }
2811
- if (_channelControl) {
2812
- _channelControl.flush(isAsync, _doUnload, 6 , cbTimeout);
2813
- }
2814
- else {
2815
- _doUnload(true);
2812
+ if (!_flushChannels(isAsync, _doUnload, 6 , cbTimeout)) {
2813
+ _doUnload(false);
2816
2814
  }
2817
2815
  };
2818
2816
  _self.getPlugin = _getPlugin;
2819
2817
  _self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) {
2820
- if (isAsync === void 0) { isAsync = true; }
2821
2818
  if (!plugin) {
2822
2819
  addCb && addCb(false);
2823
2820
  _logOrThrowError(strValidationError);
@@ -2862,6 +2859,7 @@
2862
2859
  _self.evtNamespace = function () {
2863
2860
  return _evtNamespace;
2864
2861
  };
2862
+ _self.flush = _flushChannels;
2865
2863
  proxyFunctionAs(_self, "addUnloadCb", function () { return _unloadHandlers; }, "add");
2866
2864
  function _initDefaults() {
2867
2865
  _isInitialized = false;
@@ -3027,6 +3025,13 @@
3027
3025
  queue.length = 0;
3028
3026
  }
3029
3027
  }
3028
+ function _flushChannels(isAsync, callBack, sendReason, cbTimeout) {
3029
+ if (_channelControl) {
3030
+ return _channelControl.flush(isAsync, callBack, sendReason || 6 , cbTimeout);
3031
+ }
3032
+ callBack && callBack(false);
3033
+ return true;
3034
+ }
3030
3035
  function _initDebugListener(config) {
3031
3036
  if (config.disableDbgExt === true && _debugListener) {
3032
3037
  _notificationManager[strRemoveNotificationListener](_debugListener);
@@ -5040,7 +5045,7 @@
5040
5045
  }
5041
5046
  }
5042
5047
  var EnvelopeCreator = {
5043
- Version: "2.8.0-beta.2203-05"
5048
+ Version: "2.8.0-beta.2203-08"
5044
5049
  };
5045
5050
  function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
5046
5051
  EnvelopeCreatorInit(logger, telemetryItem);