@microsoft/applicationinsights-core-js 3.0.0-beta.2303-03 → 3.0.0-beta.2303-04

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 (132) hide show
  1. package/browser/applicationinsights-core-js.integrity.json +9 -9
  2. package/browser/applicationinsights-core-js.js +2 -2
  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 +113 -206
  7. package/dist/applicationinsights-core-js.api.md +11 -14
  8. package/dist/applicationinsights-core-js.d.ts +15 -13
  9. package/dist/applicationinsights-core-js.js +2 -2
  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 +15 -13
  14. package/dist-esm/Config/ConfigDefaultHelpers.js +1 -1
  15. package/dist-esm/Config/ConfigDefaults.js +1 -1
  16. package/dist-esm/Config/DynamicConfig.js +1 -1
  17. package/dist-esm/Config/DynamicProperty.js +1 -1
  18. package/dist-esm/Config/DynamicState.js +1 -1
  19. package/dist-esm/Config/DynamicSupport.js +1 -1
  20. package/dist-esm/Config/IConfigDefaults.js +1 -1
  21. package/dist-esm/Config/IDynamicConfigHandler.js +1 -1
  22. package/dist-esm/Config/IDynamicPropertyHandler.js +1 -1
  23. package/dist-esm/Config/IDynamicWatcher.js +1 -1
  24. package/dist-esm/Config/_IDynamicConfigHandlerState.js +1 -1
  25. package/dist-esm/JavaScriptSDK/AggregationError.js +1 -1
  26. package/dist-esm/JavaScriptSDK/AppInsightsCore.js +1 -1
  27. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
  28. package/dist-esm/JavaScriptSDK/Constants.js +1 -1
  29. package/dist-esm/JavaScriptSDK/CookieMgr.js +1 -1
  30. package/dist-esm/JavaScriptSDK/CoreUtils.js +1 -1
  31. package/dist-esm/JavaScriptSDK/DataCacheHelper.js +2 -2
  32. package/dist-esm/JavaScriptSDK/DataCacheHelper.js.map +1 -1
  33. package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
  34. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +1 -1
  35. package/dist-esm/JavaScriptSDK/EnvUtils.js +1 -1
  36. package/dist-esm/JavaScriptSDK/EventHelpers.js +1 -1
  37. package/dist-esm/JavaScriptSDK/HelperFuncs.js +1 -1
  38. package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -1
  39. package/dist-esm/JavaScriptSDK/InternalConstants.js +1 -1
  40. package/dist-esm/JavaScriptSDK/NotificationManager.js +1 -1
  41. package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
  42. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +1 -1
  43. package/dist-esm/JavaScriptSDK/RandomHelper.js +1 -1
  44. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +1 -1
  45. package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +1 -1
  46. package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +1 -1
  47. package/dist-esm/JavaScriptSDK/UnloadHookContainer.js +1 -1
  48. package/dist-esm/JavaScriptSDK/W3cTraceParent.js +1 -1
  49. package/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js +1 -1
  50. package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
  51. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +1 -1
  52. package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
  53. package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js +1 -1
  54. package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js +1 -1
  55. package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
  56. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
  57. package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
  58. package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
  59. package/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
  60. package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
  61. package/dist-esm/JavaScriptSDK.Interfaces/IDistributedTraceContext.js +1 -1
  62. package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
  63. package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
  64. package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
  65. package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
  66. package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
  67. package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
  68. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js +1 -1
  69. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
  70. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
  71. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -1
  72. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +1 -1
  73. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +1 -1
  74. package/dist-esm/JavaScriptSDK.Interfaces/ITraceParent.js +1 -1
  75. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadHook.js +1 -1
  76. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js +1 -1
  77. package/dist-esm/__DynamicConstants.js +1 -1
  78. package/dist-esm/applicationinsights-core-js.js +1 -1
  79. package/package.json +1 -1
  80. package/types/JavaScriptSDK/AppInsightsCore.d.ts +5 -6
  81. package/types/JavaScriptSDK.Interfaces/IAppInsightsCore.d.ts +9 -6
  82. package/src/JavaScriptSDK/AggregationError.ts +0 -36
  83. package/src/JavaScriptSDK/AppInsightsCore.ts +0 -1322
  84. package/src/JavaScriptSDK/BaseTelemetryPlugin.ts +0 -343
  85. package/src/JavaScriptSDK/Constants.ts +0 -4
  86. package/src/JavaScriptSDK/CookieMgr.ts +0 -449
  87. package/src/JavaScriptSDK/CoreUtils.ts +0 -58
  88. package/src/JavaScriptSDK/DataCacheHelper.ts +0 -107
  89. package/src/JavaScriptSDK/DbgExtensionUtils.ts +0 -56
  90. package/src/JavaScriptSDK/DiagnosticLogger.ts +0 -380
  91. package/src/JavaScriptSDK/EnvUtils.ts +0 -312
  92. package/src/JavaScriptSDK/EventHelpers.ts +0 -550
  93. package/src/JavaScriptSDK/HelperFuncs.ts +0 -351
  94. package/src/JavaScriptSDK/InstrumentHooks.ts +0 -280
  95. package/src/JavaScriptSDK/InternalConstants.ts +0 -31
  96. package/src/JavaScriptSDK/NotificationManager.ts +0 -165
  97. package/src/JavaScriptSDK/PerfManager.ts +0 -288
  98. package/src/JavaScriptSDK/ProcessTelemetryContext.ts +0 -674
  99. package/src/JavaScriptSDK/RandomHelper.ts +0 -145
  100. package/src/JavaScriptSDK/TelemetryHelpers.ts +0 -184
  101. package/src/JavaScriptSDK/TelemetryInitializerPlugin.ts +0 -112
  102. package/src/JavaScriptSDK/UnloadHandlerContainer.ts +0 -45
  103. package/src/JavaScriptSDK/UnloadHookContainer.ts +0 -52
  104. package/src/JavaScriptSDK/W3cTraceParent.ts +0 -197
  105. package/src/JavaScriptSDK.Enums/EnumHelperFuncs.ts +0 -24
  106. package/src/JavaScriptSDK.Enums/EventsDiscardedReason.ts +0 -71
  107. package/src/JavaScriptSDK.Enums/LoggingEnums.ts +0 -121
  108. package/src/JavaScriptSDK.Enums/SendRequestReason.ts +0 -56
  109. package/src/JavaScriptSDK.Enums/TelemetryUnloadReason.ts +0 -27
  110. package/src/JavaScriptSDK.Enums/TelemetryUpdateReason.ts +0 -27
  111. package/src/JavaScriptSDK.Interfaces/IAppInsightsCore.ts +0 -216
  112. package/src/JavaScriptSDK.Interfaces/IChannelControls.ts +0 -46
  113. package/src/JavaScriptSDK.Interfaces/IConfiguration.ts +0 -176
  114. package/src/JavaScriptSDK.Interfaces/ICookieMgr.ts +0 -116
  115. package/src/JavaScriptSDK.Interfaces/IDbgExtension.ts +0 -14
  116. package/src/JavaScriptSDK.Interfaces/IDiagnosticLogger.ts +0 -75
  117. package/src/JavaScriptSDK.Interfaces/IDistributedTraceContext.ts +0 -54
  118. package/src/JavaScriptSDK.Interfaces/IInstrumentHooks.ts +0 -100
  119. package/src/JavaScriptSDK.Interfaces/INotificationListener.ts +0 -39
  120. package/src/JavaScriptSDK.Interfaces/INotificationManager.ts +0 -52
  121. package/src/JavaScriptSDK.Interfaces/IPerfEvent.ts +0 -69
  122. package/src/JavaScriptSDK.Interfaces/IPerfManager.ts +0 -53
  123. package/src/JavaScriptSDK.Interfaces/IProcessTelemetryContext.ts +0 -157
  124. package/src/JavaScriptSDK.Interfaces/ITelemetryInitializers.ts +0 -17
  125. package/src/JavaScriptSDK.Interfaces/ITelemetryItem.ts +0 -62
  126. package/src/JavaScriptSDK.Interfaces/ITelemetryPlugin.ts +0 -94
  127. package/src/JavaScriptSDK.Interfaces/ITelemetryPluginChain.ts +0 -30
  128. package/src/JavaScriptSDK.Interfaces/ITelemetryUnloadState.ts +0 -10
  129. package/src/JavaScriptSDK.Interfaces/ITelemetryUpdateState.ts +0 -44
  130. package/src/JavaScriptSDK.Interfaces/ITraceParent.ts +0 -38
  131. package/src/JavaScriptSDK.Interfaces/IUnloadHook.ts +0 -22
  132. package/src/JavaScriptSDK.Interfaces/IUnloadableComponent.ts +0 -17
@@ -1,216 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
- import { ITelemetryItem } from "./ITelemetryItem";
4
- import { IChannelControls } from "./IChannelControls";
5
- import { IPlugin, ITelemetryPlugin } from "./ITelemetryPlugin";
6
- import { IConfiguration } from "./IConfiguration";
7
- import { INotificationManager } from "./INotificationManager";
8
- import { INotificationListener } from "./INotificationListener";
9
- import { IDiagnosticLogger } from "./IDiagnosticLogger";
10
- import { IProcessTelemetryContext } from "./IProcessTelemetryContext";
11
- import { IPerfManagerProvider } from "./IPerfManager";
12
- import { ICookieMgr } from "./ICookieMgr";
13
- import { ITelemetryInitializerHandler, TelemetryInitializerFunction } from "./ITelemetryInitializers";
14
- import { ITelemetryUnloadState } from "./ITelemetryUnloadState";
15
- import { UnloadHandler } from "../JavaScriptSDK/UnloadHandlerContainer";
16
- import { SendRequestReason } from "../JavaScriptSDK.Enums/SendRequestReason";
17
- import { IDistributedTraceContext } from "./IDistributedTraceContext";
18
- import { ILegacyUnloadHook, IUnloadHook } from "./IUnloadHook";
19
- import { WatcherFunction } from "../Config/IDynamicWatcher";
20
- import { ITimerHandler } from "@nevware21/ts-utils";
21
-
22
- export interface ILoadedPlugin<T extends IPlugin> {
23
- plugin: T;
24
-
25
- /**
26
- * Identifies whether the plugin is enabled and can process events. This is slightly different from isInitialized as the plugin may be initialized but disabled
27
- * via the setEnabled() or it may be a shared plugin which has had it's teardown function called from another instance..
28
- * @returns boolean = true if the plugin is in a state where it is operational.
29
- */
30
- isEnabled: () => boolean;
31
-
32
- /**
33
- * You can optionally enable / disable a plugin from processing events.
34
- * Setting enabled to true will not necessarily cause the `isEnabled()` to also return true
35
- * as the plugin must also have been successfully initialized and not had it's `teardown` method called
36
- * (unless it's also been re-initialized)
37
- */
38
- setEnabled: (isEnabled: boolean) => void;
39
-
40
- remove: (isAsync?: boolean, removeCb?: (removed?: boolean) => void) => void;
41
- }
42
-
43
- export interface IAppInsightsCore extends IPerfManagerProvider {
44
-
45
- /*
46
- * Config object used to initialize AppInsights
47
- */
48
- config: IConfiguration;
49
-
50
- logger: IDiagnosticLogger;
51
-
52
- /**
53
- * An array of the installed plugins that provide a version
54
- */
55
- readonly pluginVersionStringArr: string[];
56
-
57
- /**
58
- * The formatted string of the installed plugins that contain a version number
59
- */
60
- readonly pluginVersionString: string;
61
-
62
- /**
63
- * Returns a value that indicates whether the instance has already been previously initialized.
64
- */
65
- isInitialized?: () => boolean;
66
-
67
- /*
68
- * Initialization queue. Contains functions to run when appInsights initializes
69
- */
70
- initialize(config: IConfiguration, extensions: IPlugin[], logger?: IDiagnosticLogger, notificationManager?: INotificationManager): void;
71
-
72
- /*
73
- * Get transmission channels for controlling transmission behavior
74
- */
75
- getChannels(): IChannelControls[];
76
-
77
- /*
78
- * Core track API
79
- */
80
- track(telemetryItem: ITelemetryItem): void;
81
-
82
- /**
83
- * Get the current notification manager
84
- */
85
- getNotifyMgr(): INotificationManager;
86
-
87
- /**
88
- * Get the current cookie manager for this instance
89
- */
90
- getCookieMgr(): ICookieMgr;
91
-
92
- /**
93
- * Set the current cookie manager for this instance
94
- * @param cookieMgr - The manager, if set to null/undefined will cause the default to be created
95
- */
96
- setCookieMgr(cookieMgr: ICookieMgr): void;
97
-
98
- /**
99
- * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised.
100
- * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be
101
- * called.
102
- * @param listener - An INotificationListener object.
103
- */
104
- addNotificationListener?(listener: INotificationListener): void;
105
-
106
- /**
107
- * Removes all instances of the listener.
108
- * @param listener - INotificationListener to remove.
109
- */
110
- removeNotificationListener?(listener: INotificationListener): void;
111
-
112
- /**
113
- * Add a telemetry processor to decorate or drop telemetry events.
114
- * @param telemetryInitializer - The Telemetry Initializer function
115
- * @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
116
- */
117
- addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler;
118
-
119
- pollInternalLogs?(eventName?: string): ITimerHandler;
120
-
121
- stopPollingInternalLogs?(): void;
122
-
123
- /**
124
- * Return a new instance of the IProcessTelemetryContext for processing events
125
- */
126
- getProcessTelContext() : IProcessTelemetryContext;
127
-
128
- /**
129
- * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
130
- * to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
131
- * unload call return `true` stating that all plugins reported that they also unloaded, the recommended
132
- * approach is to create a new instance and initialize that instance.
133
- * This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
134
- * to successfully remove any global references or they may just be completing the unload process asynchronously.
135
- * @param isAsync - Can the unload be performed asynchronously (default)
136
- * @param unloadComplete - An optional callback that will be called once the unload has completed
137
- * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
138
- */
139
- unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
140
-
141
- /**
142
- * Find and return the (first) plugin with the specified identifier if present
143
- * @param pluginIdentifier
144
- */
145
- getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
146
-
147
- /**
148
- * Add a new plugin to the installation
149
- * @param plugin - The new plugin to add
150
- * @param replaceExisting - should any existing plugin be replaced, default is false
151
- * @param doAsync - Should the add be performed asynchronously
152
- * @param addCb - [Optional] callback to call after the plugin has been added
153
- */
154
- addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
155
-
156
- /**
157
- * Update the configuration used and broadcast the changes to all loaded plugins, this does NOT support updating, adding or removing
158
- * any the plugins (extensions or channels). It will notify each plugin (if supported) that the configuration has changed but it will
159
- * not remove or add any new plugins, you need to call addPlugin or getPlugin(identifier).remove();
160
- * @param newConfig - The new configuration is apply
161
- * @param mergeExisting - Should the new configuration merge with the existing or just replace it. Default is to merge.
162
- */
163
- updateCfg<T extends IConfiguration = IConfiguration>(newConfig: T, mergeExisting?: boolean): void;
164
-
165
- /**
166
- * Returns the unique event namespace that should be used when registering events
167
- */
168
- evtNamespace(): string;
169
-
170
- /**
171
- * Add a handler that will be called when the SDK is being unloaded
172
- * @param handler - the handler
173
- */
174
- addUnloadCb(handler: UnloadHandler): void;
175
-
176
- /**
177
- * Add this hook so that it is automatically removed during unloading
178
- * @param hooks - The single hook or an array of IInstrumentHook objects
179
- */
180
- addUnloadHook(hooks: IUnloadHook | IUnloadHook[] | Iterator<IUnloadHook> | ILegacyUnloadHook | ILegacyUnloadHook[] | Iterator<ILegacyUnloadHook>): void;
181
-
182
- /**
183
- * Flush and send any batched / cached data immediately
184
- * @param async - send data asynchronously when true (defaults to true)
185
- * @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.
186
- * If the caller doesn't return true the caller should assume that it may never be called.
187
- * @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
188
- * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
189
- * @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
190
- */
191
- flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason, cbTimeout?: number): boolean | void;
192
-
193
- /**
194
- * Gets the current distributed trace context for this instance if available
195
- * @param createNew - Optional flag to create a new instance if one doesn't currently exist, defaults to true
196
- */
197
- getTraceCtx(createNew?: boolean): IDistributedTraceContext | null;
198
-
199
- /**
200
- * Sets the current distributed trace context for this instance if available
201
- */
202
- setTraceCtx(newTraceCtx: IDistributedTraceContext | null | undefined): void;
203
-
204
- /**
205
- * Watches and tracks changes for accesses to the current config, and if the accessed config changes the
206
- * handler will be recalled.
207
- * @param handler
208
- * @returns A watcher handler instance that can be used to remove itself when being unloaded
209
- */
210
- onCfgChange<T extends IConfiguration = IConfiguration>(handler: WatcherFunction<T>): IUnloadHook;
211
-
212
- /**
213
- * Function used to identify the get w parameter used to identify status bit to some channels
214
- */
215
- getWParam: () => number;
216
- }
@@ -1,46 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
- import { SendRequestReason } from "../JavaScriptSDK.Enums/SendRequestReason";
4
- import { IProcessTelemetryUnloadContext } from "./IProcessTelemetryContext";
5
- import { ITelemetryPlugin } from "./ITelemetryPlugin";
6
- import { ITelemetryUnloadState } from "./ITelemetryUnloadState";
7
-
8
- "use strict";
9
-
10
- /**
11
- * Provides data transmission capabilities
12
- */
13
- export interface IChannelControls extends ITelemetryPlugin {
14
-
15
- /**
16
- * Pause sending data
17
- */
18
- pause?(): void;
19
-
20
- /**
21
- * Resume sending data
22
- */
23
- resume?(): void;
24
-
25
- /**
26
- * Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and
27
- * therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further
28
- * processTelemetry calls are ignored and it just calls the processNext() with the provided context.
29
- * @param unloadCtx - This is the context that should be used during unloading.
30
- * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
31
- * @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
32
- */
33
- teardown?: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => void | boolean;
34
-
35
- /**
36
- * Flush to send data immediately; channel should default to sending data asynchronously
37
- * @param async - send data asynchronously when true
38
- * @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.
39
- * If the caller doesn't return true the caller should assume that it may never be called.
40
- * @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
41
- * @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
42
- */
43
- flush?(async: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void;
44
- }
45
-
46
- export const MinChannelPriorty: number = 100;
@@ -1,176 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
- import { ITelemetryPlugin } from "./ITelemetryPlugin";
4
- import { IChannelControls } from "./IChannelControls";
5
- import { ICookieMgrConfig } from "./ICookieMgr";
6
- import { INotificationManager } from "./INotificationManager";
7
- import { IPerfManager } from "./IPerfManager";
8
- import { IAppInsightsCore } from "./IAppInsightsCore";
9
-
10
- "use strict";
11
-
12
- /**
13
- * Configuration provided to SDK core
14
- */
15
- export interface IConfiguration {
16
- /**
17
- * Instrumentation key of resource. Either this or connectionString must be specified.
18
- */
19
- instrumentationKey?: string;
20
-
21
- /**
22
- * Connection string of resource. Either this or instrumentationKey must be specified.
23
- */
24
- connectionString?: string;
25
-
26
- /**
27
- * Polling interval (in ms) for internal logging queue
28
- */
29
- diagnosticLogInterval?: number;
30
-
31
- /**
32
- * Maximum number of iKey transmitted logging telemetry per page view
33
- */
34
- maxMessageLimit?: number;
35
-
36
- /**
37
- * Console logging level. All logs with a severity level higher
38
- * than the configured level will be printed to console. Otherwise
39
- * they are suppressed. ie Level 2 will print both CRITICAL and
40
- * WARNING logs to console, level 1 prints only CRITICAL.
41
- *
42
- * Note: Logs sent as telemetry to instrumentation key will also
43
- * be logged to console if their severity meets the configured loggingConsoleLevel
44
- *
45
- * 0: ALL console logging off
46
- * 1: logs to console: severity >= CRITICAL
47
- * 2: logs to console: severity >= WARNING
48
- */
49
- loggingLevelConsole?: number;
50
-
51
- /**
52
- * Telemtry logging level to instrumentation key. All logs with a severity
53
- * level higher than the configured level will sent as telemetry data to
54
- * the configured instrumentation key.
55
- *
56
- * 0: ALL iKey logging off
57
- * 1: logs to iKey: severity >= CRITICAL
58
- * 2: logs to iKey: severity >= WARNING
59
- */
60
- loggingLevelTelemetry?: number
61
-
62
- /**
63
- * If enabled, uncaught exceptions will be thrown to help with debugging
64
- */
65
- enableDebugExceptions?: boolean;
66
-
67
- /**
68
- * Endpoint where telemetry data is sent
69
- */
70
- endpointUrl?: string;
71
-
72
- /**
73
- * Extension configs loaded in SDK
74
- */
75
- extensionConfig?: { [key: string]: any }; // extension configs;
76
-
77
- /**
78
- * Additional plugins that should be loaded by core at runtime
79
- */
80
- extensions?: ITelemetryPlugin[];
81
-
82
- /**
83
- * Channel queues that is setup by caller in desired order.
84
- * If channels are provided here, core will ignore any channels that are already setup, example if there is a SKU with an initialized channel
85
- */
86
- channels?: IChannelControls[][];
87
-
88
- /**
89
- * @type {boolean}
90
- * Flag that disables the Instrumentation Key validation.
91
- */
92
- disableInstrumentationKeyValidation?: boolean;
93
-
94
- /**
95
- * [Optional] When enabled this will create local perfEvents based on sections of the code that have been instrumented
96
- * to emit perfEvents (via the doPerf()) when this is enabled. This can be used to identify performance issues within
97
- * the SDK, the way you are using it or optionally your own instrumented code.
98
- * The provided IPerfManager implementation does NOT send any additional telemetry events to the server it will only fire
99
- * the new perfEvent() on the INotificationManager which you can listen to.
100
- * This also does not use the window.performance API, so it will work in environments where this API is not supported.
101
- */
102
- enablePerfMgr?: boolean;
103
-
104
- /**
105
- * [Optional] Callback function that will be called to create a the IPerfManager instance when required and ```enablePerfMgr```
106
- * is enabled, this enables you to override the default creation of a PerfManager() without needing to ```setPerfMgr()```
107
- * after initialization.
108
- */
109
- createPerfMgr?: (core: IAppInsightsCore, notificationManager: INotificationManager) => IPerfManager;
110
-
111
- /**
112
- * [Optional] Fire every single performance event not just the top level root performance event. Defaults to false.
113
- */
114
- perfEvtsSendAll?: boolean;
115
-
116
- /**
117
- * [Optional] Identifies the default length used to generate random session and user id's if non currently exists for the user / session.
118
- * Defaults to 22, previous default value was 5, if you need to keep the previous maximum length you should set this value to 5.
119
- */
120
- idLength?: number;
121
-
122
- /**
123
- * @description Custom cookie domain. This is helpful if you want to share Application Insights cookies across subdomains. It
124
- * can be set here or as part of the cookieCfg.domain, the cookieCfg takes precedence if both are specified.
125
- * @type {string}
126
- * @defaultValue ""
127
- */
128
- cookieDomain?: string;
129
-
130
- /**
131
- * @description Custom cookie path. This is helpful if you want to share Application Insights cookies behind an application
132
- * gateway. It can be set here or as part of the cookieCfg.domain, the cookieCfg takes precedence if both are specified.
133
- * @type {string}
134
- * @defaultValue ""
135
- */
136
- cookiePath?: string;
137
-
138
- /**
139
- * [Optional] A boolean that indicated whether to disable the use of cookies by the SDK. If true, the SDK will not store or
140
- * read any data from cookies. Cookie usage can be re-enabled after initialization via the core.getCookieMgr().enable().
141
- */
142
- disableCookiesUsage?: boolean;
143
-
144
- /**
145
- * [Optional] A Cookie Manager configuration which includes hooks to allow interception of the get, set and delete cookie
146
- * operations. If this configuration is specified any specified enabled and domain properties will take precedence over the
147
- * cookieDomain and disableCookiesUsage values.
148
- */
149
- cookieCfg?: ICookieMgrConfig;
150
-
151
- /**
152
- * [Optional] An array of the page unload events that you would like to be ignored, special note there must be at least one valid unload
153
- * event hooked, if you list all or the runtime environment only supports a listed "disabled" event it will still be hooked, if required by the SDK.
154
- * Unload events include "beforeunload", "unload", "visibilitychange" (with 'hidden' state) and "pagehide"
155
- */
156
- disablePageUnloadEvents?: string[];
157
-
158
- /**
159
- * [Optional] An array of page show events that you would like to be ignored, special note there must be at lease one valid show event
160
- * hooked, if you list all or the runtime environment only supports a listed (disabled) event it will STILL be hooked, if required by the SDK.
161
- * Page Show events include "pageshow" and "visibilitychange" (with 'visible' state)
162
- */
163
- disablePageShowEvents?: string[];
164
-
165
- /**
166
- * [Optional] A flag for performance optimization to disable attempting to use the Chrome Debug Extension, if disabled and the extension is installed
167
- * this will not send any notifications.
168
- */
169
- disableDbgExt?: boolean;
170
-
171
- /**
172
- * Add "&w=0" parameter to support UA Parsing when web-workers don't have access to Document.
173
- * Default is false
174
- */
175
- enableWParam?: boolean;
176
- }
@@ -1,116 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import { ITelemetryUpdateState } from "./ITelemetryUpdateState";
5
-
6
- export interface ICookieMgr {
7
-
8
- /**
9
- * Enable or Disable the usage of cookies
10
- */
11
- setEnabled(value: boolean): void;
12
-
13
- /**
14
- * Can the system use cookies, if this returns false then all cookie setting and access functions will return nothing
15
- */
16
- isEnabled(): boolean;
17
-
18
- /**
19
- * Set the named cookie with the value and optional domain and optional
20
- * @param name - The name of the cookie
21
- * @param value - The value of the cookie (Must already be encoded)
22
- * @param maxAgeSec - [optional] The maximum number of SECONDS that this cookie should survive
23
- * @param domain - [optional] The domain to set for the cookie
24
- * @param path - [optional] Path to set for the cookie, if not supplied will default to "/"
25
- * @returns - True if the cookie was set otherwise false (Because cookie usage is not enabled or available)
26
- */
27
- set(name: string, value: string, maxAgeSec?: number, domain?: string, path?: string): boolean;
28
-
29
- /**
30
- * Get the value of the named cookie
31
- * @param name - The name of the cookie
32
- */
33
- get(name: string): string;
34
-
35
- /**
36
- * Delete/Remove the named cookie if cookie support is available and enabled.
37
- * Note: Not using "delete" as the name because it's a reserved word which would cause issues on older browsers
38
- * @param name - The name of the cookie
39
- * @param path - [optional] Path to set for the cookie, if not supplied will default to "/"
40
- * @returns - True if the cookie was marked for deletion otherwise false (Because cookie usage is not enabled or available)
41
- */
42
- del(name: string, path?: string): boolean;
43
-
44
- /**
45
- * Purge the cookie from the system if cookie support is available, this function ignores the enabled setting of the manager
46
- * so any cookie will be removed.
47
- * Note: Not using "delete" as the name because it's a reserved word which would cause issues on older browsers
48
- * @param name - The name of the cookie
49
- * @param path - [optional] Path to set for the cookie, if not supplied will default to "/"
50
- * @returns - True if the cookie was marked for deletion otherwise false (Because cookie usage is not available)
51
- */
52
- purge(name: string, path?: string): boolean;
53
-
54
- /**
55
- * Optional Callback hook to allow the diagnostic logger to update it's configuration
56
- * @param updateState
57
- */
58
- update?(updateState: ITelemetryUpdateState): void;
59
- }
60
-
61
- /**
62
- * Configuration definition for instance based cookie management configuration
63
- */
64
- export interface ICookieMgrConfig {
65
- /**
66
- * Defaults to true, A boolean that indicates whether the use of cookies by the SDK is enabled by the current instance.
67
- * If false, the instance of the SDK initialized by this configuration will not store or read any data from cookies
68
- */
69
- enabled?: boolean;
70
-
71
- /**
72
- * Custom cookie domain. This is helpful if you want to share Application Insights cookies across subdomains.
73
- */
74
- domain?: string;
75
-
76
- /**
77
- * Specifies the path to use for the cookie, defaults to '/'
78
- */
79
- path?: string;
80
-
81
- /**
82
- * Specify the cookie name(s) to be ignored, this will cause any matching cookie name to never be read or written.
83
- * They may still be explicitly purged or deleted. You do not need to repeat the name in the `blockedCookies`
84
- * configuration.(Since v2.8.8)
85
- */
86
- ignoreCookies?: string[];
87
-
88
- /**
89
- * Specify the cookie name(s) to never be written, this will cause any cookie name to never be created or updated,
90
- * they will still be read unless also included in the ignoreCookies and may still be explicitly purged or deleted.
91
- * If not provided defaults to the same list provided in ignoreCookies. (Since v2.8.8)
92
- */
93
- blockedCookies?: string[];
94
-
95
- /**
96
- * Hook function to fetch the named cookie value.
97
- * @param name - The name of the cookie
98
- */
99
- getCookie?: (name: string) => string;
100
-
101
- /**
102
- * Hook function to set the named cookie with the specified value.
103
- * @param name - The name of the cookie
104
- * @param value - The value to set for the cookie
105
- */
106
- setCookie?: (name: string, value: string) => void;
107
-
108
- /**
109
- * Hook function to delete the named cookie with the specified value, separated from
110
- * setCookie to avoid the need to parse the value to determine whether the cookie is being
111
- * added or removed.
112
- * @param name - The name of the cookie
113
- * @param cookieValue - The value to set to expire the cookie
114
- */
115
- delCookie?: (name: string, cookieValue: string) => void;
116
- }
@@ -1,14 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import { INotificationListener } from "./INotificationListener";
5
-
6
- export interface IDbgExtension {
7
- isEnabled: () => boolean;
8
- enable: () => void;
9
- disable: () => void;
10
- listener: INotificationListener,
11
- sendEvt?: (name: string, data: any) => void;
12
- debugMsg?: (name: string, data: any) => void;
13
- diagLog?: (name: string, data: any) => void;
14
- }
@@ -1,75 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
- import { LoggingSeverity, _InternalMessageId } from "../JavaScriptSDK.Enums/LoggingEnums";
4
- import { _InternalLogMessage } from "../JavaScriptSDK/DiagnosticLogger";
5
- import { ITelemetryUpdateState } from "./ITelemetryUpdateState";
6
-
7
- export interface IDiagnosticLogger {
8
- /**
9
- * When this is true the SDK will throw exceptions to aid in debugging.
10
- */
11
- enableDebugExceptions: () => boolean;
12
-
13
- /**
14
- * 0: OFF
15
- * 1: only critical (default)
16
- * 2: critical + info
17
- */
18
- consoleLoggingLevel: () => number;
19
-
20
- /**
21
- * 0: OFF (default)
22
- * 1: CRITICAL
23
- * 2: WARNING
24
- */
25
- telemetryLoggingLevel: () => number;
26
-
27
- /**
28
- * The maximum number of internal messages allowed to be sent per page view
29
- */
30
- maxInternalMessageLimit: () => number;
31
-
32
- /**
33
- * The internal logging queue
34
- */
35
- queue: _InternalLogMessage[];
36
-
37
- /**
38
- * This method will throw exceptions in debug mode or attempt to log the error as a console warning.
39
- * @param severity - The severity of the log message
40
- * @param message - The log message.
41
- */
42
- throwInternal(severity: LoggingSeverity, msgId: _InternalMessageId, msg: string, properties?: Object, isUserAct?: boolean): void;
43
-
44
- /**
45
- * This will write a warning to the console if possible
46
- * @param message - The warning message
47
- */
48
- warnToConsole(message: string): void;
49
-
50
- /**
51
- * This will write an error to the console if possible.
52
- * Provided by the default DiagnosticLogger instance, and internally the SDK will fall back to warnToConsole, however,
53
- * direct callers MUST check for its existence on the logger as you can provide your own IDiagnosticLogger instance.
54
- * @param message - The error message
55
- */
56
- errorToConsole?(message: string): void;
57
-
58
- /**
59
- * Resets the internal message count
60
- */
61
- resetInternalMessageCount(): void;
62
-
63
- /**
64
- * Logs a message to the internal queue.
65
- * @param severity - The severity of the log message
66
- * @param message - The message to log.
67
- */
68
- logInternalMessage?(severity: LoggingSeverity, message: _InternalLogMessage): void;
69
-
70
- /**
71
- * Optional Callback hook to allow the diagnostic logger to update it's configuration
72
- * @param updateState
73
- */
74
- update?(updateState: ITelemetryUpdateState): void;
75
- }