@microsoft/applicationinsights-core-js 3.0.0-beta.2209-03 → 3.0.0-beta.2210-02

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.
Files changed (179) hide show
  1. package/browser/applicationinsights-core-js.integrity.json +9 -9
  2. package/browser/applicationinsights-core-js.js +1249 -675
  3. package/browser/applicationinsights-core-js.js.map +1 -1
  4. package/browser/applicationinsights-core-js.min.js +2 -2
  5. package/browser/applicationinsights-core-js.min.js.map +1 -1
  6. package/dist/applicationinsights-core-js.api.json +3669 -1713
  7. package/dist/applicationinsights-core-js.api.md +131 -54
  8. package/dist/applicationinsights-core-js.d.ts +332 -131
  9. package/dist/applicationinsights-core-js.js +1249 -675
  10. package/dist/applicationinsights-core-js.js.map +1 -1
  11. package/dist/applicationinsights-core-js.min.js +2 -2
  12. package/dist/applicationinsights-core-js.min.js.map +1 -1
  13. package/dist/applicationinsights-core-js.rollup.d.ts +332 -131
  14. package/dist-esm/Config/ConfigDefaults.js +114 -0
  15. package/dist-esm/Config/ConfigDefaults.js.map +1 -0
  16. package/dist-esm/Config/DynamicConfig.js +129 -0
  17. package/dist-esm/Config/DynamicConfig.js.map +1 -0
  18. package/dist-esm/Config/DynamicProperty.js +139 -0
  19. package/dist-esm/Config/DynamicProperty.js.map +1 -0
  20. package/dist-esm/Config/DynamicState.js +109 -0
  21. package/dist-esm/Config/DynamicState.js.map +1 -0
  22. package/dist-esm/Config/DynamicSupport.js +57 -0
  23. package/dist-esm/Config/DynamicSupport.js.map +1 -0
  24. package/dist-esm/Config/IConfigDefaults.js +8 -0
  25. package/dist-esm/Config/IConfigDefaults.js.map +1 -0
  26. package/dist-esm/Config/IDynamicConfigHandler.js +8 -0
  27. package/dist-esm/Config/IDynamicConfigHandler.js.map +1 -0
  28. package/dist-esm/Config/IDynamicPropertyHandler.js +8 -0
  29. package/dist-esm/Config/IDynamicPropertyHandler.js.map +1 -0
  30. package/dist-esm/Config/IDynamicWatcher.js +8 -0
  31. package/dist-esm/Config/IDynamicWatcher.js.map +1 -0
  32. package/dist-esm/Config/_IDynamicConfigHandlerState.js +6 -0
  33. package/dist-esm/Config/_IDynamicConfigHandlerState.js.map +1 -0
  34. package/dist-esm/JavaScriptSDK/AppInsightsCore.js +808 -23
  35. package/dist-esm/JavaScriptSDK/AppInsightsCore.js.map +1 -1
  36. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +22 -18
  37. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js.map +1 -1
  38. package/dist-esm/JavaScriptSDK/ChannelController.js +1 -1
  39. package/dist-esm/JavaScriptSDK/CookieMgr.js +78 -38
  40. package/dist-esm/JavaScriptSDK/CookieMgr.js.map +1 -1
  41. package/dist-esm/JavaScriptSDK/CoreUtils.js +6 -5
  42. package/dist-esm/JavaScriptSDK/CoreUtils.js.map +1 -1
  43. package/dist-esm/JavaScriptSDK/DataCacheHelper.js +10 -8
  44. package/dist-esm/JavaScriptSDK/DataCacheHelper.js.map +1 -1
  45. package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
  46. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +40 -23
  47. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js.map +1 -1
  48. package/dist-esm/JavaScriptSDK/EnvUtils.js +1 -115
  49. package/dist-esm/JavaScriptSDK/EnvUtils.js.map +1 -1
  50. package/dist-esm/JavaScriptSDK/EventHelpers.js +30 -29
  51. package/dist-esm/JavaScriptSDK/EventHelpers.js.map +1 -1
  52. package/dist-esm/JavaScriptSDK/HelperFuncs.js +19 -34
  53. package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
  54. package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -1
  55. package/dist-esm/JavaScriptSDK/InternalConstants.js +5 -1
  56. package/dist-esm/JavaScriptSDK/InternalConstants.js.map +1 -1
  57. package/dist-esm/JavaScriptSDK/NotificationManager.js +18 -11
  58. package/dist-esm/JavaScriptSDK/NotificationManager.js.map +1 -1
  59. package/dist-esm/JavaScriptSDK/PerfManager.js +2 -3
  60. package/dist-esm/JavaScriptSDK/PerfManager.js.map +1 -1
  61. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +62 -53
  62. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js.map +1 -1
  63. package/dist-esm/JavaScriptSDK/RandomHelper.js +1 -1
  64. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +8 -10
  65. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js.map +1 -1
  66. package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +3 -4
  67. package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js.map +1 -1
  68. package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +1 -1
  69. package/dist-esm/JavaScriptSDK/W3cTraceParent.js +12 -10
  70. package/dist-esm/JavaScriptSDK/W3cTraceParent.js.map +1 -1
  71. package/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js +1 -2
  72. package/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js.map +1 -1
  73. package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
  74. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +2 -107
  75. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js.map +1 -1
  76. package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
  77. package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js +1 -1
  78. package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js +1 -1
  79. package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
  80. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
  81. package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
  82. package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
  83. package/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
  84. package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
  85. package/dist-esm/JavaScriptSDK.Interfaces/IDistributedTraceContext.js +1 -1
  86. package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
  87. package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
  88. package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
  89. package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
  90. package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
  91. package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
  92. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js +1 -1
  93. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
  94. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
  95. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -1
  96. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +1 -1
  97. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +1 -1
  98. package/dist-esm/JavaScriptSDK.Interfaces/ITraceParent.js +1 -1
  99. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadHook.js +8 -0
  100. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadHook.js.map +1 -0
  101. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js +3 -1
  102. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js.map +1 -1
  103. package/dist-esm/__DynamicConstants.js +26 -23
  104. package/dist-esm/__DynamicConstants.js.map +1 -1
  105. package/dist-esm/applicationinsights-core-js.js +6 -4
  106. package/dist-esm/applicationinsights-core-js.js.map +1 -1
  107. package/package.json +2 -2
  108. package/src/JavaScriptSDK/AppInsightsCore.ts +1156 -16
  109. package/src/JavaScriptSDK/BaseTelemetryPlugin.ts +25 -17
  110. package/src/JavaScriptSDK/CookieMgr.ts +88 -41
  111. package/src/JavaScriptSDK/CoreUtils.ts +4 -3
  112. package/src/JavaScriptSDK/DiagnosticLogger.ts +51 -29
  113. package/src/JavaScriptSDK/EnvUtils.ts +0 -133
  114. package/src/JavaScriptSDK/EventHelpers.ts +29 -28
  115. package/src/JavaScriptSDK/HelperFuncs.ts +22 -39
  116. package/src/JavaScriptSDK/InternalConstants.ts +5 -0
  117. package/src/JavaScriptSDK/NotificationManager.ts +25 -14
  118. package/src/JavaScriptSDK/PerfManager.ts +2 -2
  119. package/src/JavaScriptSDK/ProcessTelemetryContext.ts +73 -56
  120. package/src/JavaScriptSDK/TelemetryHelpers.ts +8 -9
  121. package/src/JavaScriptSDK/TelemetryInitializerPlugin.ts +2 -2
  122. package/src/JavaScriptSDK/W3cTraceParent.ts +7 -6
  123. package/src/JavaScriptSDK.Enums/EnumHelperFuncs.ts +0 -1
  124. package/src/JavaScriptSDK.Enums/LoggingEnums.ts +9 -108
  125. package/src/JavaScriptSDK.Enums/TelemetryUpdateReason.ts +1 -1
  126. package/src/JavaScriptSDK.Interfaces/IAppInsightsCore.ts +28 -3
  127. package/src/JavaScriptSDK.Interfaces/ICookieMgr.ts +8 -0
  128. package/src/JavaScriptSDK.Interfaces/IDiagnosticLogger.ts +15 -8
  129. package/src/JavaScriptSDK.Interfaces/IInstrumentHooks.ts +3 -1
  130. package/src/JavaScriptSDK.Interfaces/INotificationListener.ts +5 -5
  131. package/src/JavaScriptSDK.Interfaces/INotificationManager.ts +8 -8
  132. package/src/JavaScriptSDK.Interfaces/IPerfManager.ts +3 -3
  133. package/src/JavaScriptSDK.Interfaces/IProcessTelemetryContext.ts +10 -9
  134. package/src/JavaScriptSDK.Interfaces/ITelemetryInitializers.ts +2 -1
  135. package/src/JavaScriptSDK.Interfaces/ITelemetryUpdateState.ts +15 -5
  136. package/src/JavaScriptSDK.Interfaces/IUnloadHook.ts +22 -0
  137. package/src/JavaScriptSDK.Interfaces/IUnloadableComponent.ts +3 -3
  138. package/tsconfig.json +3 -2
  139. package/types/Config/ConfigDefaults.d.ts +10 -0
  140. package/types/Config/DynamicConfig.d.ts +23 -0
  141. package/types/Config/DynamicProperty.d.ts +3 -0
  142. package/types/Config/DynamicState.d.ts +3 -0
  143. package/types/Config/DynamicSupport.d.ts +15 -0
  144. package/types/Config/IConfigDefaults.d.ts +42 -0
  145. package/types/Config/IDynamicConfigHandler.d.ts +46 -0
  146. package/types/Config/IDynamicPropertyHandler.d.ts +11 -0
  147. package/types/Config/IDynamicWatcher.d.ts +28 -0
  148. package/types/Config/_IDynamicConfigHandlerState.d.ts +35 -0
  149. package/types/JavaScriptSDK/AppInsightsCore.d.ts +136 -4
  150. package/types/JavaScriptSDK/BaseTelemetryPlugin.d.ts +2 -2
  151. package/types/JavaScriptSDK/CookieMgr.d.ts +0 -10
  152. package/types/JavaScriptSDK/DiagnosticLogger.d.ts +18 -16
  153. package/types/JavaScriptSDK/EventHelpers.d.ts +24 -24
  154. package/types/JavaScriptSDK/HelperFuncs.d.ts +13 -11
  155. package/types/JavaScriptSDK/InternalConstants.d.ts +4 -0
  156. package/types/JavaScriptSDK/NotificationManager.d.ts +7 -7
  157. package/types/JavaScriptSDK/PerfManager.d.ts +2 -2
  158. package/types/JavaScriptSDK/ProcessTelemetryContext.d.ts +3 -2
  159. package/types/JavaScriptSDK/TelemetryHelpers.d.ts +3 -3
  160. package/types/JavaScriptSDK.Enums/LoggingEnums.d.ts +7 -5
  161. package/types/JavaScriptSDK.Enums/TelemetryUpdateReason.d.ts +1 -0
  162. package/types/JavaScriptSDK.Interfaces/IAppInsightsCore.d.ts +25 -3
  163. package/types/JavaScriptSDK.Interfaces/ICookieMgr.d.ts +6 -0
  164. package/types/JavaScriptSDK.Interfaces/IDiagnosticLogger.d.ts +14 -8
  165. package/types/JavaScriptSDK.Interfaces/IInstrumentHooks.d.ts +2 -1
  166. package/types/JavaScriptSDK.Interfaces/INotificationListener.d.ts +5 -5
  167. package/types/JavaScriptSDK.Interfaces/INotificationManager.d.ts +8 -8
  168. package/types/JavaScriptSDK.Interfaces/IPerfManager.d.ts +3 -3
  169. package/types/JavaScriptSDK.Interfaces/IProcessTelemetryContext.d.ts +5 -9
  170. package/types/JavaScriptSDK.Interfaces/ITelemetryInitializers.d.ts +2 -1
  171. package/types/JavaScriptSDK.Interfaces/ITelemetryUpdateState.d.ts +13 -2
  172. package/types/JavaScriptSDK.Interfaces/IUnloadHook.d.ts +18 -0
  173. package/types/__DynamicConstants.d.ts +18 -15
  174. package/types/applicationinsights-core-js.d.ts +11 -4
  175. package/types/tsdoc-metadata.json +1 -1
  176. package/dist-esm/JavaScriptSDK/BaseCore.js +0 -654
  177. package/dist-esm/JavaScriptSDK/BaseCore.js.map +0 -1
  178. package/src/JavaScriptSDK/BaseCore.ts +0 -948
  179. package/types/JavaScriptSDK/BaseCore.d.ts +0 -124
@@ -13,6 +13,8 @@ import { ITelemetryUnloadState } from "./ITelemetryUnloadState";
13
13
  import { UnloadHandler } from "../JavaScriptSDK/UnloadHandlerContainer";
14
14
  import { SendRequestReason } from "../JavaScriptSDK.Enums/SendRequestReason";
15
15
  import { IDistributedTraceContext } from "./IDistributedTraceContext";
16
+ import { ILegacyUnloadHook, IUnloadHook } from "./IUnloadHook";
17
+ import { WatcherFunction } from "../Config/IDynamicWatcher";
16
18
  export interface ILoadedPlugin<T extends IPlugin> {
17
19
  plugin: T;
18
20
  /**
@@ -57,12 +59,12 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
57
59
  * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised.
58
60
  * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be
59
61
  * called.
60
- * @param {INotificationListener} listener - An INotificationListener object.
62
+ * @param listener - An INotificationListener object.
61
63
  */
62
64
  addNotificationListener?(listener: INotificationListener): void;
63
65
  /**
64
66
  * Removes all instances of the listener.
65
- * @param {INotificationListener} listener - INotificationListener to remove.
67
+ * @param listener - INotificationListener to remove.
66
68
  */
67
69
  removeNotificationListener?(listener: INotificationListener): void;
68
70
  /**
@@ -70,7 +72,7 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
70
72
  * @param telemetryInitializer - The Telemetry Initializer function
71
73
  * @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
72
74
  */
73
- addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
75
+ addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler;
74
76
  pollInternalLogs?(eventName?: string): number;
75
77
  stopPollingInternalLogs?(): void;
76
78
  /**
@@ -102,6 +104,14 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
102
104
  * @param addCb - [Optional] callback to call after the plugin has been added
103
105
  */
104
106
  addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
107
+ /**
108
+ * Update the configuration used and broadcast the changes to all loaded plugins, this does NOT support updating, adding or removing
109
+ * any the plugins (extensions or channels). It will notify each plugin (if supported) that the configuration has changed but it will
110
+ * not remove or add any new plugins, you need to call addPlugin or getPlugin(identifier).remove();
111
+ * @param newConfig - The new configuration is apply
112
+ * @param mergeExisting - Should the new configuration merge with the existing or just replace it. Default is to merge.
113
+ */
114
+ updateCfg<T extends IConfiguration = IConfiguration>(newConfig: T, mergeExisting?: boolean): void;
105
115
  /**
106
116
  * Returns the unique event namespace that should be used when registering events
107
117
  */
@@ -111,6 +121,11 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
111
121
  * @param handler - the handler
112
122
  */
113
123
  addUnloadCb(handler: UnloadHandler): void;
124
+ /**
125
+ * Add this hook so that it is automatically removed during unloading
126
+ * @param hooks - The single hook or an array of IInstrumentHook objects
127
+ */
128
+ addUnloadHook(hooks: IUnloadHook | IUnloadHook[] | Iterator<IUnloadHook> | ILegacyUnloadHook | ILegacyUnloadHook[] | Iterator<ILegacyUnloadHook>): void;
114
129
  /**
115
130
  * Flush and send any batched / cached data immediately
116
131
  * @param async - send data asynchronously when true (defaults to true)
@@ -130,4 +145,11 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
130
145
  * Sets the current distributed trace context for this instance if available
131
146
  */
132
147
  setTraceCtx(newTraceCtx: IDistributedTraceContext | null | undefined): void;
148
+ /**
149
+ * Watches and tracks changes for accesses to the current config, and if the accessed config changes the
150
+ * handler will be recalled.
151
+ * @param handler
152
+ * @returns A watcher handler instance that can be used to remove itself when being unloaded
153
+ */
154
+ onCfgChange<T extends IConfiguration = IConfiguration>(handler: WatcherFunction<T>): IUnloadHook;
133
155
  }
@@ -1,3 +1,4 @@
1
+ import { ITelemetryUpdateState } from "./ITelemetryUpdateState";
1
2
  export interface ICookieMgr {
2
3
  /**
3
4
  * Enable or Disable the usage of cookies
@@ -39,6 +40,11 @@ export interface ICookieMgr {
39
40
  * @returns - True if the cookie was marked for deletion otherwise false (Because cookie usage is not available)
40
41
  */
41
42
  purge(name: string, path?: string): boolean;
43
+ /**
44
+ * Optional Callback hook to allow the diagnostic logger to update it's configuration
45
+ * @param updateState
46
+ */
47
+ update?(updateState: ITelemetryUpdateState): void;
42
48
  }
43
49
  /**
44
50
  * Configuration definition for instance based cookie management configuration
@@ -1,5 +1,6 @@
1
- import { _InternalMessageId, LoggingSeverity } from "../JavaScriptSDK.Enums/LoggingEnums";
1
+ import { _eInternalMessageId, LoggingSeverity } from "../JavaScriptSDK.Enums/LoggingEnums";
2
2
  import { _InternalLogMessage } from "../JavaScriptSDK/DiagnosticLogger";
3
+ import { ITelemetryUpdateState } from "./ITelemetryUpdateState";
3
4
  export interface IDiagnosticLogger {
4
5
  /**
5
6
  * When this is true the SDK will throw exceptions to aid in debugging.
@@ -27,20 +28,20 @@ export interface IDiagnosticLogger {
27
28
  queue: _InternalLogMessage[];
28
29
  /**
29
30
  * This method will throw exceptions in debug mode or attempt to log the error as a console warning.
30
- * @param severity {LoggingSeverity} - The severity of the log message
31
- * @param message {_InternalLogMessage} - The log message.
31
+ * @param severity - {LoggingSeverity} - The severity of the log message
32
+ * @param message - {_InternalLogMessage} - The log message.
32
33
  */
33
- throwInternal(severity: LoggingSeverity, msgId: _InternalMessageId, msg: string, properties?: Object, isUserAct?: boolean): void;
34
+ throwInternal(severity: LoggingSeverity, msgId: _eInternalMessageId, msg: string, properties?: Object, isUserAct?: boolean): void;
34
35
  /**
35
36
  * This will write a warning to the console if possible
36
- * @param message {string} - The warning message
37
+ * @param message - {string} - The warning message
37
38
  */
38
39
  warnToConsole(message: string): void;
39
40
  /**
40
41
  * This will write an error to the console if possible.
41
42
  * Provided by the default DiagnosticLogger instance, and internally the SDK will fall back to warnToConsole, however,
42
43
  * direct callers MUST check for its existence on the logger as you can provide your own IDiagnosticLogger instance.
43
- * @param message {string} - The error message
44
+ * @param message - {string} - The error message
44
45
  */
45
46
  errorToConsole?(message: string): void;
46
47
  /**
@@ -49,8 +50,13 @@ export interface IDiagnosticLogger {
49
50
  resetInternalMessageCount(): void;
50
51
  /**
51
52
  * Logs a message to the internal queue.
52
- * @param severity {LoggingSeverity} - The severity of the log message
53
- * @param message {_InternalLogMessage} - The message to log.
53
+ * @param severity - {LoggingSeverity} - The severity of the log message
54
+ * @param message - {_InternalLogMessage} - The message to log.
54
55
  */
55
56
  logInternalMessage?(severity: LoggingSeverity, message: _InternalLogMessage): void;
57
+ /**
58
+ * Optional Callback hook to allow the diagnostic logger to update it's configuration
59
+ * @param updateState
60
+ */
61
+ update?(updateState: ITelemetryUpdateState): void;
56
62
  }
@@ -1,3 +1,4 @@
1
+ import { IUnloadHook } from "./IUnloadHook";
1
2
  /**
2
3
  * A callback function that will be called for the wrapped instrumentation function
3
4
  * before the original function is executed.
@@ -34,7 +35,7 @@ export interface IInstrumentHooksCallbacks {
34
35
  /**
35
36
  * The holder of the specific instance callback
36
37
  */
37
- export interface IInstrumentHook {
38
+ export interface IInstrumentHook extends IUnloadHook {
38
39
  /** Unique Id for this callback on the hooked method */
39
40
  id: number;
40
41
  /** Holds the callbacks */
@@ -7,20 +7,20 @@ import { IPerfEvent } from "./IPerfEvent";
7
7
  export interface INotificationListener {
8
8
  /**
9
9
  * [Optional] A function called when events are sent.
10
- * @param {ITelemetryItem[]} events - The array of events that have been sent.
10
+ * @param events - The array of events that have been sent.
11
11
  */
12
12
  eventsSent?: (events: ITelemetryItem[]) => void;
13
13
  /**
14
14
  * [Optional] A function called when events are discarded.
15
- * @param {ITelemetryItem[]} events - The array of events that have been discarded.
16
- * @param {number} reason - The reason for discarding the events. The EventsDiscardedReason
15
+ * @param events - The array of events that have been discarded.
16
+ * @param reason - The reason for discarding the events. The EventsDiscardedReason
17
17
  * constant should be used to check the different values.
18
18
  */
19
19
  eventsDiscarded?: (events: ITelemetryItem[], reason: number) => void;
20
20
  /**
21
21
  * [Optional] A function called when the events have been requested to be sent to the sever.
22
- * @param {number} sendReason - The reason why the event batch is being sent.
23
- * @param {boolean} isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
22
+ * @param sendReason - The reason why the event batch is being sent.
23
+ * @param isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
24
24
  */
25
25
  eventsSendRequest?: (sendReason: number, isAsync?: boolean) => void;
26
26
  /**
@@ -8,36 +8,36 @@ export interface INotificationManager {
8
8
  listeners: INotificationListener[];
9
9
  /**
10
10
  * Adds a notification listener.
11
- * @param {INotificationListener} listener - The notification listener to be added.
11
+ * @param listener - The notification listener to be added.
12
12
  */
13
13
  addNotificationListener(listener: INotificationListener): void;
14
14
  /**
15
15
  * Removes all instances of the listener.
16
- * @param {INotificationListener} listener - AWTNotificationListener to remove.
16
+ * @param listener - AWTNotificationListener to remove.
17
17
  */
18
18
  removeNotificationListener(listener: INotificationListener): void;
19
19
  /**
20
20
  * Notification for events sent.
21
- * @param {ITelemetryItem[]} events - The array of events that have been sent.
21
+ * @param events - The array of events that have been sent.
22
22
  */
23
23
  eventsSent(events: ITelemetryItem[]): void;
24
24
  /**
25
25
  * Notification for events being discarded.
26
- * @param {ITelemetryItem[]} events - The array of events that have been discarded by the SDK.
27
- * @param {number} reason - The reason for which the SDK discarded the events. The EventsDiscardedReason
26
+ * @param events - The array of events that have been discarded by the SDK.
27
+ * @param reason - The reason for which the SDK discarded the events. The EventsDiscardedReason
28
28
  * constant should be used to check the different values.
29
29
  */
30
30
  eventsDiscarded(events: ITelemetryItem[], reason: number): void;
31
31
  /**
32
32
  * [Optional] A function called when the events have been requested to be sent to the sever.
33
- * @param {number} sendReason - The reason why the event batch is being sent.
34
- * @param {boolean} isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
33
+ * @param sendReason - The reason why the event batch is being sent.
34
+ * @param isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
35
35
  */
36
36
  eventsSendRequest?(sendReason: number, isAsync: boolean): void;
37
37
  /**
38
38
  * [Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging
39
39
  * the event can be displayed via the debug plugin extension.
40
- * @param perfEvent
40
+ * @param perfEvent - The perf event details
41
41
  */
42
42
  perfEvent?(perfEvent: IPerfEvent): void;
43
43
  }
@@ -9,7 +9,7 @@ export interface IPerfManagerProvider {
9
9
  getPerfMgr(): IPerfManager;
10
10
  /**
11
11
  * Set the current performance manager
12
- * @param perfMgr The performance manager
12
+ * @param perfMgr - The performance manager
13
13
  */
14
14
  setPerfMgr(perfMgr: IPerfManager): void;
15
15
  }
@@ -21,14 +21,14 @@ export interface IPerfManager {
21
21
  /**
22
22
  * Create a new event and start timing, the manager may return null/undefined to indicate that it does not
23
23
  * want to monitor this source event.
24
- * @param src The source name of the event
24
+ * @param src - The source name of the event
25
25
  * @param payloadDetails - An optional callback function to fetch the payload details for the event.
26
26
  * @param isAsync - Is the event occurring from a async event
27
27
  */
28
28
  create(src: string, payloadDetails?: () => any, isAsync?: boolean): IPerfEvent | null | undefined;
29
29
  /**
30
30
  * Complete the perfEvent and fire any notifications.
31
- * @param perfEvent Fire the event which will also complete the passed event
31
+ * @param perfEvent - Fire the event which will also complete the passed event
32
32
  */
33
33
  fire(perfEvent: IPerfEvent): void;
34
34
  /**
@@ -1,3 +1,4 @@
1
+ import { IConfigDefaults } from "../Config/IConfigDefaults";
1
2
  import { IAppInsightsCore } from "./IAppInsightsCore";
2
3
  import { IConfiguration } from "./IConfiguration";
3
4
  import { IDiagnosticLogger } from "./IDiagnosticLogger";
@@ -6,11 +7,6 @@ import { IPlugin, ITelemetryPlugin } from "./ITelemetryPlugin";
6
7
  import { ITelemetryPluginChain } from "./ITelemetryPluginChain";
7
8
  import { ITelemetryUnloadState } from "./ITelemetryUnloadState";
8
9
  import { ITelemetryUpdateState } from "./ITelemetryUpdateState";
9
- export declare const enum GetExtCfgMergeType {
10
- None = 0,
11
- MergeDefaultOnly = 1,
12
- MergeDefaultFromRootOrDefault = 2
13
- }
14
10
  export interface IBaseProcessingContext {
15
11
  /**
16
12
  * The current core instance for the request
@@ -27,13 +23,13 @@ export interface IBaseProcessingContext {
27
23
  /**
28
24
  * Gets the named extension config
29
25
  */
30
- getExtCfg: <T>(identifier: string, defaultValue?: T | any, mergeDefault?: GetExtCfgMergeType) => T;
26
+ getExtCfg: <T>(identifier: string, defaultValue?: IConfigDefaults<T>) => T;
31
27
  /**
32
28
  * Gets the named config from either the named identifier extension or core config if neither exist then the
33
29
  * default value is returned
34
- * @param identifier The named extension identifier
35
- * @param field The config field name
36
- * @param defaultValue The default value to return if no defined config exists
30
+ * @param identifier - The named extension identifier
31
+ * @param field - The config field name
32
+ * @param defaultValue - The default value to return if no defined config exists
37
33
  */
38
34
  getConfig: (identifier: string, field: string, defaultValue?: number | string | boolean | string[] | RegExp[] | Function) => number | string | boolean | string[] | RegExp[] | Function;
39
35
  /**
@@ -1,6 +1,7 @@
1
1
  import { ITelemetryItem } from "./ITelemetryItem";
2
+ import { ILegacyUnloadHook } from "./IUnloadHook";
2
3
  export declare type TelemetryInitializerFunction = <T extends ITelemetryItem>(item: T) => boolean | void;
3
- export interface ITelemetryInitializerHandler {
4
+ export interface ITelemetryInitializerHandler extends ILegacyUnloadHook {
4
5
  remove(): void;
5
6
  }
6
7
  export interface ITelemetryInitializerContainer {
@@ -1,4 +1,5 @@
1
1
  import { TelemetryUpdateReason } from "../JavaScriptSDK.Enums/TelemetryUpdateReason";
2
+ import { IConfiguration } from "./IConfiguration";
2
3
  import { IPlugin } from "./ITelemetryPlugin";
3
4
  export interface ITelemetryUpdateState {
4
5
  /**
@@ -6,11 +7,21 @@ export interface ITelemetryUpdateState {
6
7
  */
7
8
  reason: TelemetryUpdateReason;
8
9
  /**
9
- * If this is a configuration update this was the previous configuration that was used
10
+ * This is a new active configuration that should be used
10
11
  */
12
+ cfg?: IConfiguration;
11
13
  /**
12
- * If this is a configuration update is the new configuration that is being used
14
+ * The detected changes
13
15
  */
16
+ oldCfg?: IConfiguration;
17
+ /**
18
+ * If this is a configuration update this was the previous configuration that was used
19
+ */
20
+ newConfig?: IConfiguration;
21
+ /**
22
+ * Was the new config requested to be merged with the existing config
23
+ */
24
+ merge?: boolean;
14
25
  /**
15
26
  * This holds a collection of plugins that have been added (if the reason identifies that one or more plugins have been added)
16
27
  */
@@ -0,0 +1,18 @@
1
+ /**
2
+ * An interface which provides automatic removal during unloading of the component
3
+ */
4
+ export interface IUnloadHook {
5
+ /**
6
+ * Self remove the referenced component
7
+ */
8
+ rm: () => void;
9
+ }
10
+ /**
11
+ * An alternate interface which provides automatic removal during unloading of the component
12
+ */
13
+ export interface ILegacyUnloadHook {
14
+ /**
15
+ * Legacy Self remove the referenced component
16
+ */
17
+ remove: () => void;
18
+ }
@@ -1,49 +1,52 @@
1
+ export declare const _DYN_LENGTH = "length";
2
+ export declare const _DYN_NOTIFY = "notify";
3
+ export declare const _DYN_THROW_INTERNAL = "throwInternal";
4
+ export declare const _DYN_WATCH = "watch";
5
+ export declare const _DYN_LOGGER = "logger";
6
+ export declare const _DYN_CONFIGURABLE = "configurable";
7
+ export declare const _DYN_ENUMERABLE = "enumerable";
8
+ export declare const _DYN_APPLY = "apply";
9
+ export declare const _DYN_INDEX_OF = "indexOf";
10
+ export declare const _DYN_PUSH = "push";
1
11
  export declare const _DYN_INITIALIZE = "initialize";
2
- export declare const _DYN_NAME = "name";
3
- export declare const _DYN_GET_NOTIFY_MGR = "getNotifyMgr";
4
12
  export declare const _DYN_IDENTIFIER = "identifier";
5
- export declare const _DYN_PUSH = "push";
13
+ export declare const _DYN_SPLICE = "splice";
6
14
  export declare const _DYN_IS_INITIALIZED = "isInitialized";
7
- export declare const _DYN_CONFIG = "config";
8
- export declare const _DYN_INSTRUMENTATION_KEY = "instrumentationKey";
9
- export declare const _DYN_LOGGER = "logger";
10
- export declare const _DYN_LENGTH = "length";
15
+ export declare const _DYN_NAME = "name";
11
16
  export declare const _DYN_TIME = "time";
12
17
  export declare const _DYN_PROCESS_NEXT = "processNext";
13
18
  export declare const _DYN_GET_PROCESS_TEL_CONT0 = "getProcessTelContext";
19
+ export declare const _DYN_GET_NOTIFY_MGR = "getNotifyMgr";
14
20
  export declare const _DYN_ADD_NOTIFICATION_LIS1 = "addNotificationListener";
15
21
  export declare const _DYN_REMOVE_NOTIFICATION_2 = "removeNotificationListener";
16
22
  export declare const _DYN_STOP_POLLING_INTERNA3 = "stopPollingInternalLogs";
17
23
  export declare const _DYN_ON_COMPLETE = "onComplete";
24
+ export declare const _DYN_CALL = "call";
18
25
  export declare const _DYN_GET_PLUGIN = "getPlugin";
19
26
  export declare const _DYN_FLUSH = "flush";
27
+ export declare const _DYN_LOGGING_LEVEL_CONSOL4 = "loggingLevelConsole";
20
28
  export declare const _DYN__EXTENSIONS = "_extensions";
21
- export declare const _DYN_SPLICE = "splice";
22
29
  export declare const _DYN_TEARDOWN = "teardown";
23
30
  export declare const _DYN_MESSAGE_ID = "messageId";
24
31
  export declare const _DYN_MESSAGE = "message";
25
32
  export declare const _DYN_IS_ASYNC = "isAsync";
33
+ export declare const _DYN_DIAG_LOG = "diagLog";
26
34
  export declare const _DYN__DO_TEARDOWN = "_doTeardown";
27
35
  export declare const _DYN_UPDATE = "update";
28
36
  export declare const _DYN_GET_NEXT = "getNext";
29
- export declare const _DYN_DIAG_LOG = "diagLog";
30
37
  export declare const _DYN_SET_NEXT_PLUGIN = "setNextPlugin";
31
38
  export declare const _DYN_CREATE_NEW = "createNew";
32
- export declare const _DYN_COOKIE_CFG = "cookieCfg";
33
- export declare const _DYN_INDEX_OF = "indexOf";
39
+ export declare const _DYN_CONFIG = "config";
34
40
  export declare const _DYN_SUBSTRING = "substring";
35
41
  export declare const _DYN_USER_AGENT = "userAgent";
36
42
  export declare const _DYN_SPLIT = "split";
37
- export declare const _DYN_SUBSTR = "substr";
38
43
  export declare const _DYN_NODE_TYPE = "nodeType";
39
- export declare const _DYN_APPLY = "apply";
40
44
  export declare const _DYN_REPLACE = "replace";
41
- export declare const _DYN_ENABLE_DEBUG_EXCEPTI4 = "enableDebugExceptions";
45
+ export declare const _DYN_ENABLE_DEBUG_EXCEPTI5 = "enableDebugExceptions";
42
46
  export declare const _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage";
43
47
  export declare const _DYN_TO_LOWER_CASE = "toLowerCase";
44
48
  export declare const _DYN_TYPE = "type";
45
49
  export declare const _DYN_HANDLER = "handler";
46
- export declare const _DYN_CALL = "call";
47
50
  export declare const _DYN_LISTENERS = "listeners";
48
51
  export declare const _DYN_IS_CHILD_EVT = "isChildEvt";
49
52
  export declare const _DYN_GET_CTX = "getCtx";
@@ -3,23 +3,23 @@ export { IChannelControls, MinChannelPriorty } from "./JavaScriptSDK.Interfaces/
3
3
  export { ITelemetryPlugin, IPlugin } from "./JavaScriptSDK.Interfaces/ITelemetryPlugin";
4
4
  export { IAppInsightsCore, ILoadedPlugin } from "./JavaScriptSDK.Interfaces/IAppInsightsCore";
5
5
  export { ITelemetryItem, ICustomProperties, Tags } from "./JavaScriptSDK.Interfaces/ITelemetryItem";
6
- export { IBaseProcessingContext, IProcessTelemetryContext, IProcessTelemetryUnloadContext, IProcessTelemetryUpdateContext, GetExtCfgMergeType } from "./JavaScriptSDK.Interfaces/IProcessTelemetryContext";
6
+ export { IBaseProcessingContext, IProcessTelemetryContext, IProcessTelemetryUnloadContext, IProcessTelemetryUpdateContext } from "./JavaScriptSDK.Interfaces/IProcessTelemetryContext";
7
7
  export { INotificationListener } from "./JavaScriptSDK.Interfaces/INotificationListener";
8
8
  export { ITelemetryPluginChain } from "./JavaScriptSDK.Interfaces/ITelemetryPluginChain";
9
9
  export { IDiagnosticLogger } from "./JavaScriptSDK.Interfaces/IDiagnosticLogger";
10
10
  export { InstrumentorHooksCallback, IInstrumentHooksCallbacks, IInstrumentHooks, IInstrumentHook, IInstrumentCallDetails } from "./JavaScriptSDK.Interfaces/IInstrumentHooks";
11
11
  export { IUnloadableComponent } from "./JavaScriptSDK.Interfaces/IUnloadableComponent";
12
+ export { IUnloadHook, ILegacyUnloadHook } from "./JavaScriptSDK.Interfaces/IUnloadHook";
12
13
  export { eEventsDiscardedReason, EventsDiscardedReason } from "./JavaScriptSDK.Enums/EventsDiscardedReason";
13
14
  export { SendRequestReason } from "./JavaScriptSDK.Enums/SendRequestReason";
14
15
  export { TelemetryUpdateReason } from "./JavaScriptSDK.Enums/TelemetryUpdateReason";
15
16
  export { TelemetryUnloadReason } from "./JavaScriptSDK.Enums/TelemetryUnloadReason";
16
17
  export { AppInsightsCore } from "./JavaScriptSDK/AppInsightsCore";
17
- export { BaseCore } from "./JavaScriptSDK/BaseCore";
18
18
  export { BaseTelemetryPlugin } from "./JavaScriptSDK/BaseTelemetryPlugin";
19
19
  export { randomValue, random32, mwcRandomSeed, mwcRandom32, newId } from "./JavaScriptSDK/RandomHelper";
20
20
  export { Undefined, newGuid, perfNow, generateW3CId } from "./JavaScriptSDK/CoreUtils";
21
21
  export { normalizeJsName, toISOString, dateNow, getExceptionName, strContains, setValue, getSetValue, proxyAssign, proxyFunctions, proxyFunctionAs, createClassFromInterface, optimizeObject, isNotUndefined, isNotNullOrUndefined, objExtend } from "./JavaScriptSDK/HelperFuncs";
22
- export { isArray, isTypeof, isUndefined, isNullOrUndefined, objHasOwnProperty as hasOwnProperty, isObject, isFunction, objForEachKey, strEndsWith, strStartsWith, isDate, isError, isString, isNumber, isBoolean, arrForEach, arrIndexOf, arrReduce, arrMap, strTrim, objKeys, objDefineAccessors, throwError, isSymbol, isNotTruthy, isTruthy, objFreeze, objSeal, objToString, objDeepFreeze as deepFreeze, getInst as getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, hasNavigator, getNavigator, hasHistory, getHistory, dumpObj } from "@nevware21/ts-utils";
22
+ export { isArray, isTypeof, isUndefined, isNullOrUndefined, objHasOwnProperty as hasOwnProperty, isObject, isFunction, strEndsWith, strStartsWith, isDate, isError, isString, isNumber, isBoolean, arrForEach, arrIndexOf, arrReduce, arrMap, strTrim, objKeys, objDefineAccessors, throwError, isSymbol, isNotTruthy, isTruthy, objFreeze, objSeal, objToString, objDeepFreeze as deepFreeze, getInst as getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, hasNavigator, getNavigator, hasHistory, getHistory, dumpObj, asString, objForEachKey } from "@nevware21/ts-utils";
23
23
  export { EnumValue, createEnumStyle, createValueMap } from "./JavaScriptSDK.Enums/EnumHelperFuncs";
24
24
  export { attachEvent, detachEvent, addEventHandler, addEventListeners, addPageUnloadEventListener, addPageHideEventListener, addPageShowEventListener, removeEventHandler, removeEventListeners, removePageUnloadEventListener, removePageHideEventListener, removePageShowEventListener, eventOn, eventOff, mergeEvtNamespace, _IRegisteredEvents, __getRegisteredEvents } from "./JavaScriptSDK/EventHelpers";
25
25
  export { getCrypto, getMsCrypto, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, isIE, getIEVersion, isSafari, setEnableEnvMocks, isBeaconsSupported, isFetchSupported, useXDomainRequest, isXhrSupported, findMetaTag, findNamedServerTiming } from "./JavaScriptSDK/EnvUtils";
@@ -32,7 +32,7 @@ export { PerfEvent, PerfManager, doPerf, getGblPerfMgr, setGblPerfMgr } from "./
32
32
  export { safeGetLogger, DiagnosticLogger, _InternalLogMessage, _throwInternal, _warnToConsole, _logInternalMessage } from "./JavaScriptSDK/DiagnosticLogger";
33
33
  export { ProcessTelemetryContext, createProcessTelemetryContext } from "./JavaScriptSDK/ProcessTelemetryContext";
34
34
  export { initializePlugins, sortPlugins, unloadComponents } from "./JavaScriptSDK/TelemetryHelpers";
35
- export { _InternalMessageId, _eInternalMessageId, LoggingSeverity, eLoggingSeverity } from "./JavaScriptSDK.Enums/LoggingEnums";
35
+ export { _eInternalMessageId, LoggingSeverity, eLoggingSeverity } from "./JavaScriptSDK.Enums/LoggingEnums";
36
36
  export { InstrumentProto, InstrumentProtos, InstrumentFunc, InstrumentFuncs, InstrumentEvent } from "./JavaScriptSDK/InstrumentHooks";
37
37
  export { ICookieMgr, ICookieMgrConfig } from "./JavaScriptSDK.Interfaces/ICookieMgr";
38
38
  export { createCookieMgr, safeGetCookieMgr, uaDisallowsSameSiteNone, areCookiesSupported } from "./JavaScriptSDK/CookieMgr";
@@ -46,3 +46,10 @@ export { ITelemetryUnloadState } from "./JavaScriptSDK.Interfaces/ITelemetryUnlo
46
46
  export { IDistributedTraceContext } from "./JavaScriptSDK.Interfaces/IDistributedTraceContext";
47
47
  export { ITraceParent } from "./JavaScriptSDK.Interfaces/ITraceParent";
48
48
  export { createTraceParent, parseTraceParent, isValidTraceId, isValidSpanId, isValidTraceParent, isSampledFlag, formatTraceParent, findW3cTraceParent } from "./JavaScriptSDK/W3cTraceParent";
49
+ export { IConfigCheckFn, IConfigDefaultCheck, IConfigDefaults, IConfigSetFn } from "./Config/IConfigDefaults";
50
+ export { IDynamicConfigHandler } from "./Config/IDynamicConfigHandler";
51
+ export { IDynamicPropertyHandler } from "./Config/IDynamicPropertyHandler";
52
+ export { IWatchDetails, IWatcherHandler, WatcherFunction } from "./Config/IDynamicWatcher";
53
+ export { applyDefaults } from "./Config/ConfigDefaults";
54
+ export { createDynamicConfig, onConfigChange } from "./Config/DynamicConfig";
55
+ export { getDynamicConfigHandler } from "./Config/DynamicSupport";
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.31.1"
8
+ "packageVersion": "7.32.0"
9
9
  }
10
10
  ]
11
11
  }